ee-bin 1.5.0 → 1.6.0
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 +122 -120
- package/lib/pargv.js +263 -263
- package/lib/utils.js +121 -111
- package/package.json +26 -24
- package/tools/encrypt.js +315 -315
- package/tools/iconGen.js +182 -182
- package/tools/move.js +84 -84
- package/tools/replaceDist.js +82 -82
- package/tools/serve.js +167 -163
package/index.js
CHANGED
|
@@ -1,121 +1,123 @@
|
|
|
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
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
.
|
|
113
|
-
.
|
|
114
|
-
.option('--
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
+
|
|
121
123
|
program.parse();
|