Closed kantaroso closed 2 years ago
UI部分は bootstrap 使いたいので下記参考に導入 https://github.com/shaack/electron-bootstrap-starter
jqueryがうまく使えないのでvueでやることにする
https://simulatedgreg.gitbooks.io/electron-vue/content/ja/
$ npm i -D vue-cli
$ npx vue init simulatedgreg/electron-vue ./
? Target directory exists. Continue? Yes
? Application Name movie-spliter
? Application Id com.example.yourapp
? Application Version 0.0.1
? Project description An electron-vue project
? Use Sass / Scss? No
? Select which Vue plugins to install (Press <space> to select, <a> to toggle all, <i> to invert selection)axios, vue-electron, vue-router, vuex, vuex
-electron
? Use linting with ESLint? Yes
? Which ESLint config would you like to use? Standard
? Set up unit testing with Karma + Mocha? No
? Set up end-to-end testing with Spectron + Mocha? No
? What build tool would you like to use? builder
? author kantaroso <51830444+kantaroso@users.noreply.github.com>
vue-cli · Generated "./".
---
All set. Welcome to your new electron-vue project!
Make sure to check out the documentation for this boilerplate at
https://simulatedgreg.gitbooks.io/electron-vue/content/.
Next Steps:
$ yarn (or `npm install`)
$ yarn run dev (or `npm run dev`)
$ npm install
$ npm i -D bootstrap-vue
$ npm run dev
メインプロセスとのやりとり
https://nico-lab.net/cutting_ffmpeg/
コマンドの使い方
一旦切り取りでできるところまで完了
ビルドのエラー対応
その1
adminnoMacBook-Air:movie-spliter admin$ npm run build
> movie-spliter@0.0.1 build
> node .electron-vue/build.js && electron-builder
/Users/admin/Desktop/dev/movie-spliter/.electron-vue/build.js:45
const tasks = new Listr(
^
SyntaxError: Identifier 'tasks' has already been declared
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
https://github.com/SimulatedGREG/electron-vue/issues/1076
adminnoMacBook-Air:movie-spliter admin$ npm run build
> movie-spliter@0.0.1 build
> node .electron-vue/build.js && electron-builder
___ __ __ ___ __
/\_ \ __ /\ \__ ____ /\ \ __ __ __ /\_ \ /\ \
\//\ \ / ,.`\ \ \ ,_\ / ,__\ _______ \ \ \____ /\ \/\ \ /\_\ \//\ \ \_\ \
\_\ \_ /\ __/ \ \ \/ /\__, `\/\______\ \ \ ,. \\ \ \_\ \\/\ \ \_\ \_ /\ ,. \
/\____\\ \____\ \ \ \_ \/\____/\/______/ \ \____/ \ \____/ \ \ \ /\____\\ \____\
\/____/ \/____/ \ \__\ \/___/ \/___/ \/___/ \/_/ \/____/ \/___ /
\/__/
/Users/admin/Desktop/dev/movie-spliter/.electron-vue/build.js:38
const m = new Multispinner(tasks, {
^
ReferenceError: Multispinner is not defined
at build (/Users/admin/Desktop/dev/movie-spliter/.electron-vue/build.js:38:13)
at Object.<anonymous> (/Users/admin/Desktop/dev/movie-spliter/.electron-vue/build.js:24:6)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
https://github.com/SimulatedGREG/electron-vue/issues/1089 https://www.npmjs.com/package/multispinner
diff --git a/.electron-vue/build.js b/.electron-vue/build.js
index 7df446c..6237d56 100644
--- a/.electron-vue/build.js
+++ b/.electron-vue/build.js
@@ -8,6 +8,7 @@ const del = require('del')
const { spawn } = require('child_process')
const webpack = require('webpack')
const Listr = require('listr')
+const Multispinner = require('multispinner')
const mainConfig = require('./webpack.main.config')
@@ -42,7 +43,7 @@ async function build () {
let results = ''
- const tasks = new Listr(
+ const _tasks = new Listr(
[
{
title: 'building master process',
@@ -74,7 +75,7 @@ async function build () {
{ concurrent: 2 }
)
- await tasks
+ await _tasks
.run()
.then(() => {
process.stdout.write('\x1B[2J\x1B[0f')
diff --git a/package-lock.json b/package-lock.json
index 53ab18c..6f2e1fe 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -52,6 +52,7 @@
"html-webpack-plugin": "^3.2.0",
"listr": "^0.14.3",
"mini-css-extract-plugin": "0.4.0",
+ "multispinner": "^0.2.1",
その2
Error: Exit code: 2. Command failed: /usr/bin/perl /private/var/folders/rf/_cvy9tmd7r9d_g1g40z4sf_40000gn/T/t-QJDlVt/1-dmgProperties.pl
Can't locate Mac/Finder/DSStore.pm in @INC (you may need to install the Mac::Finder::DSStore module) (@INC contains: /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /private/var/folders/rf/_cvy9tmd7r9d_g1g40z4sf_40000gn/T/t-QJDlVt/1-dmgProperties.pl line 3.
BEGIN failed--compilation aborted at /private/var/folders/rf/_cvy9tmd7r9d_g1g40z4sf_40000gn/T/t-QJDlVt/1-dmgProperties.pl line 3.
Can't locate Mac/Finder/DSStore.pm in @INC (you may need to install the Mac::Finder::DSStore module) (@INC contains: /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /private/var/folders/rf/_cvy9tmd7r9d_g1g40z4sf_40000gn/T/t-QJDlVt/1-dmgProperties.pl line 3.
BEGIN failed--compilation aborted at /private/var/folders/rf/_cvy9tmd7r9d_g1g40z4sf_40000gn/T/t-QJDlVt/1-dmgProperties.pl line 3.
at /Users/admin/Desktop/dev/movie-spliter/node_modules/builder-util/src/util.ts:126:16
at ChildProcess.exithandler (node:child_process:404:5)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
:
:
:
https://juejin.cn/post/6976194264749309988
adminnoMacBook-Air:movie-spliter admin$ git diff package.json
diff --git a/package.json b/package.json
index 023e0b5..35555da 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,7 @@
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.4",
- "electron-builder": "^20.19.2",
+ "electron-builder": "^22.11.7",
"electron-debug": "^1.5.0",
"electron-devtools-installer": "^2.2.4",
"eslint": "^4.19.1",
参考
https://lealog.hateblo.jp/entry/2018/03/07/162402