easy-soft-develop 2.1.203 → 2.1.205
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/package.json +1 -1
- package/src/index.js +8 -0
- package/src/tools/meta.js +84 -0
- package/src/tools/update.project.from.master.template.js +107 -180
- package/types/index.d.ts +8 -0
- package/types/tools/meta.d.ts +40 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3,6 +3,10 @@ const {
|
|
|
3
3
|
cd,
|
|
4
4
|
checkInCollection,
|
|
5
5
|
checkStringIsEmpty,
|
|
6
|
+
copyFile,
|
|
7
|
+
copyFileSync,
|
|
8
|
+
copyFolder,
|
|
9
|
+
copyFolderSync,
|
|
6
10
|
exec,
|
|
7
11
|
existDirectorySync,
|
|
8
12
|
existFileSync,
|
|
@@ -71,6 +75,10 @@ module.exports = {
|
|
|
71
75
|
checkStringIsEmpty,
|
|
72
76
|
clean,
|
|
73
77
|
commitRefresh,
|
|
78
|
+
copyFile,
|
|
79
|
+
copyFileSync,
|
|
80
|
+
copyFolder,
|
|
81
|
+
copyFolderSync,
|
|
74
82
|
createCleanScriptFile,
|
|
75
83
|
createDevelopFiles,
|
|
76
84
|
createInstallGlobalDevelopDependenceScriptFile,
|
package/src/tools/meta.js
CHANGED
|
@@ -410,11 +410,95 @@ function rimraf(path) {
|
|
|
410
410
|
promptSuccess(`remove path success, path: "${path}"`);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
+
function copyFile({
|
|
414
|
+
sourceMainPath,
|
|
415
|
+
targetMainPath,
|
|
416
|
+
filepath,
|
|
417
|
+
callback = null,
|
|
418
|
+
}) {
|
|
419
|
+
promptInfo(`copy file: "${filepath}".`);
|
|
420
|
+
|
|
421
|
+
fs.cp(
|
|
422
|
+
resolvePath(`${sourceMainPath}${filepath}`),
|
|
423
|
+
resolvePath(`${targetMainPath}${filepath}`),
|
|
424
|
+
{
|
|
425
|
+
force: true,
|
|
426
|
+
recursive: true,
|
|
427
|
+
},
|
|
428
|
+
(error) => {
|
|
429
|
+
if (error) {
|
|
430
|
+
promptError(error);
|
|
431
|
+
} else {
|
|
432
|
+
if (callback != null) {
|
|
433
|
+
callback();
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function copyFileSync({ sourceMainPath, targetMainPath, filepath }) {
|
|
441
|
+
promptInfo(`copy file: "${filepath}".`);
|
|
442
|
+
|
|
443
|
+
fs.cpSync(
|
|
444
|
+
resolvePath(`${sourceMainPath}${filepath}`),
|
|
445
|
+
resolvePath(`${targetMainPath}${filepath}`),
|
|
446
|
+
{
|
|
447
|
+
force: true,
|
|
448
|
+
recursive: true,
|
|
449
|
+
},
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function copyFolder({
|
|
454
|
+
sourceMainPath,
|
|
455
|
+
targetMainPath,
|
|
456
|
+
filepath,
|
|
457
|
+
callback = null,
|
|
458
|
+
}) {
|
|
459
|
+
promptInfo(`copy folder: "${filepath}".`);
|
|
460
|
+
|
|
461
|
+
fs.cp(
|
|
462
|
+
resolvePath(`${sourceMainPath}${filepath}`),
|
|
463
|
+
resolvePath(`${targetMainPath}${filepath}`),
|
|
464
|
+
{
|
|
465
|
+
force: true,
|
|
466
|
+
recursive: true,
|
|
467
|
+
},
|
|
468
|
+
(error) => {
|
|
469
|
+
if (error) {
|
|
470
|
+
promptError(error);
|
|
471
|
+
} else {
|
|
472
|
+
if (callback != null) {
|
|
473
|
+
callback();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function copyFolderSync({ sourceMainPath, targetMainPath, filepath }) {
|
|
481
|
+
promptInfo(`copy folder: "${filepath}".`);
|
|
482
|
+
|
|
483
|
+
fs.cpSync(
|
|
484
|
+
resolvePath(`${sourceMainPath}${filepath}`),
|
|
485
|
+
resolvePath(`${targetMainPath}${filepath}`),
|
|
486
|
+
{
|
|
487
|
+
force: true,
|
|
488
|
+
recursive: true,
|
|
489
|
+
},
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
413
493
|
module.exports = {
|
|
414
494
|
assignObject,
|
|
415
495
|
cd,
|
|
416
496
|
checkInCollection,
|
|
417
497
|
checkStringIsEmpty,
|
|
498
|
+
copyFile,
|
|
499
|
+
copyFileSync,
|
|
500
|
+
copyFolder,
|
|
501
|
+
copyFolderSync,
|
|
418
502
|
exec,
|
|
419
503
|
existDirectorySync,
|
|
420
504
|
existFileSync,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const download = require('download');
|
|
2
2
|
const agent = require('hpagent');
|
|
3
|
-
const fs = require('fs');
|
|
4
3
|
const zip = require('cross-zip');
|
|
5
4
|
|
|
6
5
|
const {
|
|
@@ -13,64 +12,12 @@ const {
|
|
|
13
12
|
checkStringIsEmpty,
|
|
14
13
|
promptInfo,
|
|
15
14
|
exec,
|
|
15
|
+
copyFileSync,
|
|
16
|
+
copyFolderSync,
|
|
16
17
|
} = require('./meta');
|
|
17
18
|
|
|
18
19
|
const { HttpsProxyAgent } = agent;
|
|
19
20
|
|
|
20
|
-
function copyFile({
|
|
21
|
-
sourceMainPath,
|
|
22
|
-
targetMainPath,
|
|
23
|
-
filepath,
|
|
24
|
-
callback = null,
|
|
25
|
-
}) {
|
|
26
|
-
promptInfo(`copy file: "${filepath}".`);
|
|
27
|
-
|
|
28
|
-
fs.cp(
|
|
29
|
-
resolvePath(`${sourceMainPath}${filepath}`),
|
|
30
|
-
resolvePath(`${targetMainPath}${filepath}`),
|
|
31
|
-
{
|
|
32
|
-
force: true,
|
|
33
|
-
recursive: true,
|
|
34
|
-
},
|
|
35
|
-
(error) => {
|
|
36
|
-
if (error) {
|
|
37
|
-
promptError(error);
|
|
38
|
-
} else {
|
|
39
|
-
if (callback != null) {
|
|
40
|
-
callback();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function copyFolder({
|
|
48
|
-
sourceMainPath,
|
|
49
|
-
targetMainPath,
|
|
50
|
-
filepath,
|
|
51
|
-
callback = null,
|
|
52
|
-
}) {
|
|
53
|
-
promptInfo(`copy folder: "${filepath}".`);
|
|
54
|
-
|
|
55
|
-
fs.cp(
|
|
56
|
-
resolvePath(`${sourceMainPath}${filepath}`),
|
|
57
|
-
resolvePath(`${targetMainPath}${filepath}`),
|
|
58
|
-
{
|
|
59
|
-
force: true,
|
|
60
|
-
recursive: true,
|
|
61
|
-
},
|
|
62
|
-
(error) => {
|
|
63
|
-
if (error) {
|
|
64
|
-
promptError(error);
|
|
65
|
-
} else {
|
|
66
|
-
if (callback != null) {
|
|
67
|
-
callback();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
21
|
function clearResource() {
|
|
75
22
|
const removeSourceFolderCmd = `rimraf ${resolvePath(`./temp/source/`)}`;
|
|
76
23
|
|
|
@@ -104,135 +51,115 @@ function handlePackage(projectPath, zipPath) {
|
|
|
104
51
|
|
|
105
52
|
promptLine();
|
|
106
53
|
|
|
107
|
-
|
|
54
|
+
copyFileSync({
|
|
108
55
|
sourceMainPath,
|
|
109
56
|
targetMainPath,
|
|
110
57
|
filepath: 'config/router.master.template.config.js',
|
|
111
|
-
callback: () => {
|
|
112
|
-
copyFile({
|
|
113
|
-
sourceMainPath,
|
|
114
|
-
targetMainPath,
|
|
115
|
-
filepath: 'generatorConfig/general/',
|
|
116
|
-
callback: () => {
|
|
117
|
-
copyFile({
|
|
118
|
-
sourceMainPath,
|
|
119
|
-
targetMainPath,
|
|
120
|
-
filepath: 'src/commonAssist/Action/actionGeneral.js',
|
|
121
|
-
callback: () => {
|
|
122
|
-
copyFolder({
|
|
123
|
-
sourceMainPath,
|
|
124
|
-
targetMainPath,
|
|
125
|
-
filepath: 'src/components/PageLoading/',
|
|
126
|
-
callback: () => {
|
|
127
|
-
copyFolder({
|
|
128
|
-
sourceMainPath,
|
|
129
|
-
targetMainPath,
|
|
130
|
-
filepath: 'src/customConfig/general/',
|
|
131
|
-
callback: () => {
|
|
132
|
-
copyFolder({
|
|
133
|
-
sourceMainPath,
|
|
134
|
-
targetMainPath,
|
|
135
|
-
filepath:
|
|
136
|
-
'src/customSpecialComponents/BaseUpdateRoleModal/',
|
|
137
|
-
callback: () => {
|
|
138
|
-
copyFile({
|
|
139
|
-
sourceMainPath,
|
|
140
|
-
targetMainPath,
|
|
141
|
-
filepath:
|
|
142
|
-
'src/customSpecialComponents/CustomAssembly/menuHeader.js',
|
|
143
|
-
callback: () => {
|
|
144
|
-
copyFolder({
|
|
145
|
-
sourceMainPath,
|
|
146
|
-
targetMainPath,
|
|
147
|
-
filepath:
|
|
148
|
-
'src/customSpecialComponents/UpdateModuleModalBase/',
|
|
149
|
-
callback: () => {
|
|
150
|
-
copyFolder({
|
|
151
|
-
sourceMainPath,
|
|
152
|
-
targetMainPath,
|
|
153
|
-
filepath: 'src/pages/',
|
|
154
|
-
callback: () => {
|
|
155
|
-
copyFile({
|
|
156
|
-
sourceMainPath,
|
|
157
|
-
targetMainPath,
|
|
158
|
-
filepath: 'src/utils/init.js',
|
|
159
|
-
callback: () => {
|
|
160
|
-
copyFile({
|
|
161
|
-
sourceMainPath,
|
|
162
|
-
targetMainPath,
|
|
163
|
-
filepath: 'src/utils/tools.jsx',
|
|
164
|
-
callback: () => {
|
|
165
|
-
copyFile({
|
|
166
|
-
sourceMainPath,
|
|
167
|
-
targetMainPath,
|
|
168
|
-
filepath: 'src/access.js',
|
|
169
|
-
callback: () => {
|
|
170
|
-
copyFile({
|
|
171
|
-
sourceMainPath,
|
|
172
|
-
targetMainPath,
|
|
173
|
-
filepath: 'src/app.jsx',
|
|
174
|
-
callback: () => {
|
|
175
|
-
copyFile({
|
|
176
|
-
sourceMainPath,
|
|
177
|
-
targetMainPath,
|
|
178
|
-
filepath:
|
|
179
|
-
'src/global.less',
|
|
180
|
-
callback: () => {
|
|
181
|
-
copyFile({
|
|
182
|
-
sourceMainPath,
|
|
183
|
-
targetMainPath,
|
|
184
|
-
filepath:
|
|
185
|
-
'src/overrides.less',
|
|
186
|
-
callback: () => {
|
|
187
|
-
copyFile({
|
|
188
|
-
sourceMainPath,
|
|
189
|
-
targetMainPath,
|
|
190
|
-
filepath:
|
|
191
|
-
'plugin.ts',
|
|
192
|
-
callback:
|
|
193
|
-
() => {
|
|
194
|
-
copyFile({
|
|
195
|
-
sourceMainPath,
|
|
196
|
-
targetMainPath,
|
|
197
|
-
filepath:
|
|
198
|
-
'tsconfig.json',
|
|
199
|
-
callback:
|
|
200
|
-
() => {
|
|
201
|
-
clearResource();
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
},
|
|
205
|
-
});
|
|
206
|
-
},
|
|
207
|
-
});
|
|
208
|
-
},
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
});
|
|
224
|
-
},
|
|
225
|
-
});
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
},
|
|
231
|
-
});
|
|
232
|
-
},
|
|
233
|
-
});
|
|
234
|
-
},
|
|
235
58
|
});
|
|
59
|
+
|
|
60
|
+
copyFolderSync({
|
|
61
|
+
sourceMainPath,
|
|
62
|
+
targetMainPath,
|
|
63
|
+
filepath: 'generatorConfig/general/',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
copyFileSync({
|
|
67
|
+
sourceMainPath,
|
|
68
|
+
targetMainPath,
|
|
69
|
+
filepath: 'src/commonAssist/Action/actionGeneral.js',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
copyFolderSync({
|
|
73
|
+
sourceMainPath,
|
|
74
|
+
targetMainPath,
|
|
75
|
+
filepath: 'src/components/PageLoading/',
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
copyFolderSync({
|
|
79
|
+
sourceMainPath,
|
|
80
|
+
targetMainPath,
|
|
81
|
+
filepath: 'src/customConfig/general/',
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
copyFolderSync({
|
|
85
|
+
sourceMainPath,
|
|
86
|
+
targetMainPath,
|
|
87
|
+
filepath: 'src/customSpecialComponents/BaseUpdateRoleModal/',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
copyFileSync({
|
|
91
|
+
sourceMainPath,
|
|
92
|
+
targetMainPath,
|
|
93
|
+
filepath: 'src/customSpecialComponents/CustomAssembly/menuHeader.js',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
copyFileSync({
|
|
97
|
+
sourceMainPath,
|
|
98
|
+
targetMainPath,
|
|
99
|
+
filepath: 'src/customSpecialComponents/CustomAssembly/timeAndOperator.js',
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
copyFolderSync({
|
|
103
|
+
sourceMainPath,
|
|
104
|
+
targetMainPath,
|
|
105
|
+
filepath: 'src/customSpecialComponents/UpdateModuleModalBase/',
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
copyFolderSync({
|
|
109
|
+
sourceMainPath,
|
|
110
|
+
targetMainPath,
|
|
111
|
+
filepath: 'src/pages/',
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
copyFileSync({
|
|
115
|
+
sourceMainPath,
|
|
116
|
+
targetMainPath,
|
|
117
|
+
filepath: 'src/utils/init.js',
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
copyFileSync({
|
|
121
|
+
sourceMainPath,
|
|
122
|
+
targetMainPath,
|
|
123
|
+
filepath: 'src/utils/tools.jsx',
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
copyFileSync({
|
|
127
|
+
sourceMainPath,
|
|
128
|
+
targetMainPath,
|
|
129
|
+
filepath: 'src/access.js',
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
copyFileSync({
|
|
133
|
+
sourceMainPath,
|
|
134
|
+
targetMainPath,
|
|
135
|
+
filepath: 'src/app.jsx',
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
copyFileSync({
|
|
139
|
+
sourceMainPath,
|
|
140
|
+
targetMainPath,
|
|
141
|
+
filepath: 'src/global.less',
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
copyFileSync({
|
|
145
|
+
sourceMainPath,
|
|
146
|
+
targetMainPath,
|
|
147
|
+
filepath: 'src/overrides.less',
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
copyFileSync({
|
|
151
|
+
sourceMainPath,
|
|
152
|
+
targetMainPath,
|
|
153
|
+
filepath: 'plugin.ts',
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
copyFileSync({
|
|
157
|
+
sourceMainPath,
|
|
158
|
+
targetMainPath,
|
|
159
|
+
filepath: 'tsconfig.json',
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
clearResource();
|
|
236
163
|
});
|
|
237
164
|
}
|
|
238
165
|
|
package/types/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { checkInCollection } from './tools/meta';
|
|
|
5
5
|
import { checkStringIsEmpty } from './tools/meta';
|
|
6
6
|
import { clean } from './tools/clean';
|
|
7
7
|
import { commitRefresh } from './tools/commit.refresh';
|
|
8
|
+
import { copyFile } from './tools/meta';
|
|
9
|
+
import { copyFileSync } from './tools/meta';
|
|
10
|
+
import { copyFolder } from './tools/meta';
|
|
11
|
+
import { copyFolderSync } from './tools/meta';
|
|
8
12
|
import { createCleanScriptFile } from './tools/develop.file';
|
|
9
13
|
import { createDevelopFiles } from './tools/develop.file';
|
|
10
14
|
import { createInstallGlobalDevelopDependenceScriptFile } from './tools/develop.file';
|
|
@@ -56,6 +60,10 @@ export {
|
|
|
56
60
|
checkStringIsEmpty,
|
|
57
61
|
clean,
|
|
58
62
|
commitRefresh,
|
|
63
|
+
copyFile,
|
|
64
|
+
copyFileSync,
|
|
65
|
+
copyFolder,
|
|
66
|
+
copyFolderSync,
|
|
59
67
|
createCleanScriptFile,
|
|
60
68
|
createDevelopFiles,
|
|
61
69
|
createInstallGlobalDevelopDependenceScriptFile,
|
package/types/tools/meta.d.ts
CHANGED
|
@@ -7,6 +7,46 @@ export function cd(path: any): void;
|
|
|
7
7
|
*/
|
|
8
8
|
export function checkInCollection(collection: any[], target: any): boolean;
|
|
9
9
|
export function checkStringIsEmpty(v: any): boolean;
|
|
10
|
+
export function copyFile({
|
|
11
|
+
sourceMainPath,
|
|
12
|
+
targetMainPath,
|
|
13
|
+
filepath,
|
|
14
|
+
callback,
|
|
15
|
+
}: {
|
|
16
|
+
sourceMainPath: any;
|
|
17
|
+
targetMainPath: any;
|
|
18
|
+
filepath: any;
|
|
19
|
+
callback?: null | undefined;
|
|
20
|
+
}): void;
|
|
21
|
+
export function copyFileSync({
|
|
22
|
+
sourceMainPath,
|
|
23
|
+
targetMainPath,
|
|
24
|
+
filepath,
|
|
25
|
+
}: {
|
|
26
|
+
sourceMainPath: any;
|
|
27
|
+
targetMainPath: any;
|
|
28
|
+
filepath: any;
|
|
29
|
+
}): void;
|
|
30
|
+
export function copyFolder({
|
|
31
|
+
sourceMainPath,
|
|
32
|
+
targetMainPath,
|
|
33
|
+
filepath,
|
|
34
|
+
callback,
|
|
35
|
+
}: {
|
|
36
|
+
sourceMainPath: any;
|
|
37
|
+
targetMainPath: any;
|
|
38
|
+
filepath: any;
|
|
39
|
+
callback?: null | undefined;
|
|
40
|
+
}): void;
|
|
41
|
+
export function copyFolderSync({
|
|
42
|
+
sourceMainPath,
|
|
43
|
+
targetMainPath,
|
|
44
|
+
filepath,
|
|
45
|
+
}: {
|
|
46
|
+
sourceMainPath: any;
|
|
47
|
+
targetMainPath: any;
|
|
48
|
+
filepath: any;
|
|
49
|
+
}): void;
|
|
10
50
|
export function exec(cmd: any): void;
|
|
11
51
|
export function existDirectorySync(path: any): any;
|
|
12
52
|
export function existFileSync(path: any): any;
|