ee-bin 1.5.0 → 1.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,121 +1,136 @@
1
- #!/usr/bin/env node
2
-
3
- const { program } = require('commander');
4
-
5
- /**
6
- * move - Moves resources
7
- */
8
- program
9
- .command('move')
10
- .description('Move multip resources')
11
- .option('--config <folder>', 'config file', './electron/config/bin.js')
12
- .option('--flag <flag>', 'Custom flag')
13
- .action(function() {
14
- const moveScript = require('./tools/move');
15
- moveScript.run(this.opts());
16
- });
17
-
18
- /**
19
- * (deprecated) rd - Moves front-end resources to a specified directory
20
- */
21
- program
22
- .command('rd')
23
- .description('Move frontend resources to public/dist')
24
- .option('--config <folder>', 'config file', './electron/config/bin.js')
25
- .option('--dist <folder>', 'title to use before name')
26
- .option('--target <folder>', 'title to use before name')
27
- .action(function() {
28
- const replaceDist = require('./tools/replaceDist');
29
- replaceDist.run(this.opts());
30
- });
31
-
32
- /**
33
- * encrypt - Code encryption
34
- */
35
- program
36
- .command('encrypt')
37
- .description('Code encryption')
38
- .option('--config <folder>', 'config file')
39
- .option('--out <folder>', 'output directory', './public')
40
- .action(function() {
41
- const encrypt = require('./tools/encrypt');
42
- encrypt.run(this.opts());
43
- });
44
-
45
- /**
46
- * clean - Clear the encrypted code
47
- */
48
- program
49
- .command('clean')
50
- .description('Clear the encrypted code')
51
- .option('-d, --dir <folder>', 'clean directory')
52
- .action(function() {
53
- const encrypt = require('./tools/encrypt');
54
- encrypt.clean(this.opts());
55
- });
56
-
57
- /**
58
- * icon
59
- */
60
- program
61
- .command('icon')
62
- .description('Generate logo')
63
- .action(function() {
64
- const iconGen = require('./tools/iconGen');
65
- iconGen.run();
66
- });
67
-
68
- /**
69
- * dev
70
- */
71
- program
72
- .command('dev')
73
- .description('create frontend-serve and electron-serve')
74
- .option('--config <folder>', 'config file', './electron/config/bin.js')
75
- .option('--serve <mode>', 'serve mode')
76
- .action(function() {
77
- const serve = require('./tools/serve');
78
- serve.dev(this.opts());
79
- });
80
-
81
- /**
82
- * build
83
- */
84
- program
85
- .command('build')
86
- .description('building multiple resources')
87
- .option('--config <folder>', 'config file', './electron/config/bin.js')
88
- .option('--cmds <flag>', 'custom commands')
89
- .action(function() {
90
- const serve = require('./tools/serve');
91
- serve.build(this.opts());
92
- });
93
-
94
- /**
95
- * start
96
- */
97
- program
98
- .command('start')
99
- .description('preview effect')
100
- .option('--config <folder>', 'config file', './electron/config/bin.js')
101
- .action(function() {
102
- const serve = require('./tools/serve');
103
- serve.start(this.opts());
104
- });
105
-
106
- /**
107
- * exec
108
- */
109
- program
110
- .command('exec')
111
- .description('create frontend-serve and electron-serve')
112
- .option('--config <folder>', 'config file', './electron/config/bin.js')
113
- .option('--command <command>', 'Custom command')
114
- .option('--cmds <flag>', 'custom commands')
115
- .action(function() {
116
- // command 选项是关键字,不再使用,改为 cmds
117
- const serve = require('./tools/serve');
118
- serve.exec(this.opts());
119
- });
120
-
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+
5
+ /**
6
+ * move - Moves resources
7
+ */
8
+ program
9
+ .command('move')
10
+ .description('Move multip resources')
11
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
12
+ .option('--flag <flag>', 'Custom flag')
13
+ .action(function() {
14
+ const moveScript = require('./tools/move');
15
+ moveScript.run(this.opts());
16
+ });
17
+
18
+ /**
19
+ * (deprecated) rd - Moves front-end resources to a specified directory
20
+ */
21
+ program
22
+ .command('rd')
23
+ .description('Move frontend resources to public/dist')
24
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
25
+ .option('--dist <folder>', 'title to use before name')
26
+ .option('--target <folder>', 'title to use before name')
27
+ .action(function() {
28
+ const replaceDist = require('./tools/replaceDist');
29
+ replaceDist.run(this.opts());
30
+ });
31
+
32
+ /**
33
+ * encrypt - Code encryption
34
+ */
35
+ program
36
+ .command('encrypt')
37
+ .description('Code encryption')
38
+ .option('--config <folder>', 'config file')
39
+ .option('--out <folder>', 'output directory', './public')
40
+ .action(function() {
41
+ const encrypt = require('./tools/encrypt');
42
+ encrypt.run(this.opts());
43
+ });
44
+
45
+ /**
46
+ * clean - Clear the encrypted code
47
+ */
48
+ program
49
+ .command('clean')
50
+ .description('Clear the encrypted code')
51
+ .option('-d, --dir <folder>', 'clean directory')
52
+ .action(function() {
53
+ const encrypt = require('./tools/encrypt');
54
+ encrypt.clean(this.opts());
55
+ });
56
+
57
+ /**
58
+ * icon
59
+ */
60
+ program
61
+ .command('icon')
62
+ .description('Generate logo')
63
+ .option('-i, --input <file>', 'image file default /public/images/logo.png')
64
+ .option('-o, --output <folder>', 'output directory default /build/icons/')
65
+ .action(function() {
66
+ const iconGen = require('./tools/iconGen');
67
+ iconGen.run();
68
+ });
69
+
70
+ /**
71
+ * dev
72
+ */
73
+ program
74
+ .command('dev')
75
+ .description('create frontend-serve and electron-serve')
76
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
77
+ .option('--serve <mode>', 'serve mode')
78
+ .action(function() {
79
+ const serve = require('./tools/serve');
80
+ serve.dev(this.opts());
81
+ });
82
+
83
+ /**
84
+ * build
85
+ */
86
+ program
87
+ .command('build')
88
+ .description('building multiple resources')
89
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
90
+ .option('--cmds <flag>', 'custom commands')
91
+ .action(function() {
92
+ const serve = require('./tools/serve');
93
+ serve.build(this.opts());
94
+ });
95
+
96
+ /**
97
+ * start
98
+ */
99
+ program
100
+ .command('start')
101
+ .description('preview effect')
102
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
103
+ .action(function() {
104
+ const serve = require('./tools/serve');
105
+ serve.start(this.opts());
106
+ });
107
+
108
+ /**
109
+ * exec
110
+ */
111
+ program
112
+ .command('exec')
113
+ .description('create frontend-serve and electron-serve')
114
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
115
+ .option('--command <command>', 'Custom command')
116
+ .option('--cmds <flag>', 'custom commands')
117
+ .action(function() {
118
+ // command 选项是关键字,不再使用,改为 cmds
119
+ const serve = require('./tools/serve');
120
+ serve.exec(this.opts());
121
+ });
122
+
123
+ /**
124
+ * updater
125
+ */
126
+ program
127
+ .command('updater')
128
+ .description('updater commands')
129
+ .option('--config <folder>', 'config file', './electron/config/bin.js')
130
+ .option('--asar-file <file>', 'asar file path')
131
+ .action(function() {
132
+ const updater = require('./tools/incrUpdater');
133
+ updater.run(this.opts());
134
+ });
135
+
121
136
  program.parse();