easy-soft-develop 2.1.222 → 2.1.227

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/bin/cli.js CHANGED
@@ -53,15 +53,17 @@ program
53
53
  program
54
54
  .command('update-all-package-version')
55
55
  .description('update all package version for your project')
56
- .action(() => {
57
- updateAllPackageVersion.run();
56
+ .option('--autoInstall <bool>', 'show wait second info')
57
+ .action((a, o) => {
58
+ updateAllPackageVersion.run(a, o);
58
59
  });
59
60
 
60
61
  program
61
62
  .command('update-every-package-version')
62
63
  .description('update all package version for your project')
63
- .action(() => {
64
- updateEveryPackageVersion.run();
64
+ .option('--autoInstall <bool>', 'show wait second info')
65
+ .action((a, o) => {
66
+ updateEveryPackageVersion.run(a, o);
65
67
  });
66
68
 
67
69
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.1.222",
3
+ "version": "2.1.227",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -1,5 +1,9 @@
1
1
  const { updateAllPackageVersion } = require('../tools/package.update');
2
2
 
3
- exports.run = function () {
4
- updateAllPackageVersion();
3
+ exports.run = function (s, o) {
4
+ const {
5
+ _optionValues: { autoInstall = true },
6
+ } = o;
7
+
8
+ updateAllPackageVersion({ autoInstall: autoInstall || false });
5
9
  };
@@ -1,5 +1,9 @@
1
1
  const { updateEveryPackageVersion } = require('../tools/package.update');
2
2
 
3
- exports.run = function () {
4
- updateEveryPackageVersion();
3
+ exports.run = function (s, o) {
4
+ const {
5
+ _optionValues: { autoInstall = true },
6
+ } = o;
7
+
8
+ updateEveryPackageVersion({ autoInstall: autoInstall || false });
5
9
  };
@@ -9,8 +9,9 @@ const developUpdateProjectFromRepository = {
9
9
  repository: '',
10
10
  sourcePath: '',
11
11
  targetPath: '',
12
- folders: [],
13
- files: [],
12
+ syncFolders: [],
13
+ syncFiles: [],
14
+ ignoreSyncWhenExistFiles: [],
14
15
  };
15
16
 
16
17
  const developUpdateProjectFromRepositoryConfigFilePath =
@@ -143,7 +143,7 @@ const ncuScript = {
143
143
  'z:check:all-package-version': 'npx easy-soft-develop check-all-package-version',
144
144
  'z:check:every-package-version': 'npx easy-soft-develop check-every-package-version',
145
145
  'prez:update:all-package-version': 'node ./develop/assists/install.global.develop.dependence',
146
- 'z:update:all-package-version': 'npx easy-soft-develop update-all-package-version',
146
+ 'z:update:all-package-version': 'npx easy-soft-develop update-all-package-version --autoInstall false',
147
147
  'postz:update:all-package-version': 'npm run z:reinstall',
148
148
  'prez:update:every-package-version': 'node ./develop/assists/install.global.develop.dependence',
149
149
  'z:update:every-package-version': 'npx easy-soft-develop update-every-package-version',
@@ -45,7 +45,7 @@ function updateSpecialPackageVersion(packageList) {
45
45
  promptSuccess('check success');
46
46
  }
47
47
 
48
- function updateAllPackageVersion() {
48
+ function updateAllPackageVersion({ autoInstall = true }) {
49
49
  exec('npm run z:initial:environment');
50
50
 
51
51
  const ncuCommand = `npx npm-check-updates --configFilePath ./.ncurc.js --packageFile package.json --registry https://registry.npmjs.org --workspaces --root -u`;
@@ -56,10 +56,12 @@ function updateAllPackageVersion() {
56
56
 
57
57
  promptSuccess('update success, exec install with z:install');
58
58
 
59
- exec('npm run z:install');
59
+ if (autoInstall) {
60
+ exec('npm run z:install');
61
+ }
60
62
  }
61
63
 
62
- function updateEveryPackageVersion() {
64
+ function updateEveryPackageVersion({ autoInstall = true }) {
63
65
  exec('npm run z:initial:environment');
64
66
 
65
67
  const ncuCommand = `npx npm-check-updates --configFilePath ./.ncurc.js --packageFile package.json --registry https://registry.npmjs.org -u`;
@@ -72,7 +74,9 @@ function updateEveryPackageVersion() {
72
74
 
73
75
  promptSuccess('update success, exec install with z:install');
74
76
 
75
- exec('npm run z:install');
77
+ if (autoInstall) {
78
+ exec('npm run z:install');
79
+ }
76
80
  }
77
81
 
78
82
  function checkAllPackageVersion() {
@@ -87,8 +91,6 @@ function checkAllPackageVersion() {
87
91
  adjustMainPackageJsonByCommand(ncuCommand);
88
92
 
89
93
  promptSuccess('update success, exec install with z:install');
90
-
91
- exec('npm run z:install');
92
94
  }
93
95
 
94
96
  function checkEveryPackageVersion() {
@@ -105,8 +107,6 @@ function checkEveryPackageVersion() {
105
107
  adjustChildrenPackageJsonByCommand(ncuCommand);
106
108
 
107
109
  promptSuccess('update success, exec install with z:install');
108
-
109
- exec('npm run z:install');
110
110
  }
111
111
 
112
112
  module.exports = {
@@ -15,6 +15,8 @@ const {
15
15
  copyFileSync,
16
16
  copyFolderSync,
17
17
  promptTip,
18
+ existFileSync,
19
+ promptEmptyLine,
18
20
  } = require('./meta');
19
21
 
20
22
  const {
@@ -44,8 +46,9 @@ function handlePackage({
44
46
  zipPath,
45
47
  sourcePath,
46
48
  targetPath,
47
- folders,
48
- files,
49
+ syncFolders,
50
+ syncFiles,
51
+ ignoreSyncWhenExistFiles,
49
52
  }) {
50
53
  const unzipPath = resolvePath(`./temp/source/`);
51
54
 
@@ -63,7 +66,16 @@ function handlePackage({
63
66
 
64
67
  promptLine();
65
68
 
66
- for (const itemFolder of folders) {
69
+ promptTip('*', 'sync folders.');
70
+ promptEmptyLine();
71
+
72
+ if (syncFolders.length === 0) {
73
+ promptWarn(
74
+ 'none folders will sync, if need, please set "syncFolders" in "develop.update.project.from.repository.json".',
75
+ );
76
+ }
77
+
78
+ for (const itemFolder of syncFolders) {
67
79
  copyFolderSync({
68
80
  sourceMainPath,
69
81
  targetMainPath,
@@ -71,7 +83,37 @@ function handlePackage({
71
83
  });
72
84
  }
73
85
 
74
- for (const itemFile of files) {
86
+ promptTip('*', 'sync files.');
87
+ promptEmptyLine();
88
+
89
+ if (syncFiles.length === 0) {
90
+ promptWarn(
91
+ 'none file will force sync, if need, please set "syncFiles" in "develop.update.project.from.repository.json".',
92
+ );
93
+ }
94
+
95
+ for (const itemFile of syncFiles) {
96
+ copyFileSync({
97
+ sourceMainPath,
98
+ targetMainPath,
99
+ filepath: itemFile,
100
+ });
101
+ }
102
+
103
+ promptTip('*', 'sync files when not exist.');
104
+ promptEmptyLine();
105
+
106
+ if (ignoreSyncWhenExistFiles.length === 0) {
107
+ promptWarn(
108
+ 'none file will sync when it not exist, if need, please set "ignoreSyncWhenExistFiles" in "develop.update.project.from.repository.json".',
109
+ );
110
+ }
111
+
112
+ for (const itemFile of ignoreSyncWhenExistFiles) {
113
+ if (existFileSync(`./${targetMainPath}/${itemFile}`)) {
114
+ continue;
115
+ }
116
+
75
117
  copyFileSync({
76
118
  sourceMainPath,
77
119
  targetMainPath,
@@ -79,6 +121,9 @@ function handlePackage({
79
121
  });
80
122
  }
81
123
 
124
+ promptTip('*', 'clear resource.');
125
+ promptEmptyLine();
126
+
82
127
  clearResource();
83
128
  });
84
129
  }
@@ -138,14 +183,16 @@ async function updateProjectFromRepository({ projectPath = '.', agent }) {
138
183
  repository = '',
139
184
  sourcePath = '',
140
185
  targetPath = '',
141
- folders = [],
142
- files = [],
186
+ syncFolders = [],
187
+ syncFiles = [],
188
+ ignoreSyncWhenExistFiles = [],
143
189
  } = {
144
190
  repository: '',
145
191
  sourcePath: '',
146
192
  targetPath: '',
147
- folders: [],
148
- files: [],
193
+ syncFolders: [],
194
+ syncFiles: [],
195
+ ignoreSyncWhenExistFiles: [],
149
196
  ...getDevelopUpdateProjectFromRepositoryConfig(),
150
197
  };
151
198
 
@@ -188,8 +235,9 @@ async function updateProjectFromRepository({ projectPath = '.', agent }) {
188
235
  zipPath,
189
236
  sourcePath,
190
237
  targetPath,
191
- folders,
192
- files,
238
+ syncFolders,
239
+ syncFiles,
240
+ ignoreSyncWhenExistFiles,
193
241
  });
194
242
  }
195
243
 
@@ -1 +1 @@
1
- export function run(): void;
1
+ export function run(s: any, o: any): void;
@@ -1 +1 @@
1
- export function run(): void;
1
+ export function run(s: any, o: any): void;
@@ -1,7 +1,15 @@
1
1
  export function checkAllPackageVersion(): void;
2
2
  export function checkEveryPackageVersion(): void;
3
- export function updateAllPackageVersion(): void;
4
- export function updateEveryPackageVersion(): void;
3
+ export function updateAllPackageVersion({
4
+ autoInstall,
5
+ }: {
6
+ autoInstall?: boolean | undefined;
7
+ }): void;
8
+ export function updateEveryPackageVersion({
9
+ autoInstall,
10
+ }: {
11
+ autoInstall?: boolean | undefined;
12
+ }): void;
5
13
  /**
6
14
  * update special package version
7
15
  * @param {Array} packageList