easy-soft-develop 2.1.107 → 2.1.112

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.1.107",
3
+ "version": "2.1.112",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -49,7 +49,7 @@
49
49
  "test:inner:rimraf": "node ./test/rimraf.test.js",
50
50
  "z:change:npm:registry:local": "nrm use local",
51
51
  "z:change:npm:registry:npm": "nrm use npm",
52
- "z:check:all-package-version": "npx ncu",
52
+ "z:check:all-package-version": "npx npm-check-updates",
53
53
  "prez:cz": "node ./bin/cli.js commit-refresh && npm run z:prettier:format:change && npm run z:tsc:build && git stage -A",
54
54
  "z:cz": "git-cz",
55
55
  "postz:cz": "git push",
@@ -69,8 +69,8 @@
69
69
  "postz:publish:patch:npm": "npm run z:change:npm:registry:local && npm publish",
70
70
  "z:reinstall": "rimraf ./node_modules && npm run z:install",
71
71
  "z:tsc:build": "echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete",
72
- "z:update:all-package-version": "npx ncu -u",
73
- "z:update:package-from-package": "npx ncu -u"
72
+ "z:update:all-package-version": "npx npm-check-updates -u",
73
+ "z:update:package-from-package": "npx npm-check-updates -u"
74
74
  },
75
75
  "dependencies": {
76
76
  "commander": "^12.0.0",
@@ -0,0 +1,47 @@
1
+ const {
2
+ writeJsonFileSync,
3
+ readJsonFileSync,
4
+ existFileSync,
5
+ mkdirSync,
6
+ } = require('../tools/meta');
7
+
8
+ const developSubPathVersionNcu = {
9
+ paths: [],
10
+ };
11
+
12
+ const developSubPathVersionNcuConfigFilePath =
13
+ './develop/config/develop.subPath.version.ncu.json';
14
+
15
+ function createDevelopSubPathVersionNcuConfigFile() {
16
+ mkdirSync(`./develop`);
17
+
18
+ mkdirSync(`./develop/config`);
19
+
20
+ writeJsonFileSync(
21
+ developSubPathVersionNcuConfigFilePath,
22
+ developSubPathVersionNcu,
23
+ {
24
+ coverFile: false,
25
+ },
26
+ );
27
+ }
28
+
29
+ function getDevelopSubPathVersionNcuConfig() {
30
+ const developSubPathVersionNcuConfigFileExist = existFileSync(
31
+ developSubPathVersionNcuConfigFilePath,
32
+ );
33
+
34
+ if (!developSubPathVersionNcuConfigFileExist) {
35
+ createDevelopSubPathVersionNcuConfigFile();
36
+ }
37
+
38
+ return {
39
+ ...developSubPathVersionNcu,
40
+ ...readJsonFileSync(developSubPathVersionNcuConfigFilePath),
41
+ };
42
+ }
43
+
44
+ module.exports = {
45
+ createDevelopSubPathVersionNcuConfigFile,
46
+ getDevelopSubPathVersionNcuConfig,
47
+ };
@@ -28,6 +28,9 @@ const {
28
28
  const {
29
29
  createDevelopInitialEnvironmentConfigFile,
30
30
  } = require('../config/develop.initial.environment');
31
+ const {
32
+ createDevelopSubPathVersionNcuConfigFile,
33
+ } = require('../config/develop.subPath.version.ncu');
31
34
 
32
35
  function createRepositoryProjectFolder(name) {
33
36
  mkdirSync(`./${name}`);
@@ -200,6 +203,8 @@ function initialEnvironment() {
200
203
 
201
204
  createDevelopInitialEnvironmentConfigFile();
202
205
 
206
+ createDevelopSubPathVersionNcuConfigFile();
207
+
203
208
  promptSuccess(`step *: config environment`);
204
209
 
205
210
  promptEmptyLine();
@@ -210,7 +215,7 @@ function initialEnvironment() {
210
215
 
211
216
  promptInfo('add global dev packages');
212
217
 
213
- exec('npx ncu -u --packageFile ./**/package.json');
218
+ exec('npx npm-check-updates -u --packageFile ./**/package.json');
214
219
 
215
220
  promptInfo('install dependence packages');
216
221
 
@@ -1,33 +1,53 @@
1
1
  const fs = require('fs');
2
2
 
3
- const { resolvePath, existDirectorySync } = require('./meta');
3
+ const { resolvePath, existDirectorySync, isArray } = require('./meta');
4
+ const {
5
+ getDevelopSubPathVersionNcuConfig,
6
+ } = require('../config/develop.subPath.version.ncu');
4
7
 
5
8
  /**
6
9
  * loop all package
7
10
  */
8
11
  // eslint-disable-next-line no-unused-vars
9
12
  function loopPackage(callback = ({ name, absolutePath, relativePath }) => {}) {
10
- const packagesDir = './packages/';
13
+ const developSubPathVersionNcuConfig = getDevelopSubPathVersionNcuConfig();
11
14
 
12
- if (!existDirectorySync(resolvePath(packagesDir))) {
15
+ const { paths = [] } = {
16
+ paths: [],
17
+ ...developSubPathVersionNcuConfig,
18
+ };
19
+
20
+ if (!isArray(paths)) {
13
21
  return;
14
22
  }
15
23
 
16
- const packagesPath = resolvePath(packagesDir);
17
-
18
- const files = fs.readdirSync(packagesDir);
24
+ if (paths.length === 0) {
25
+ return;
26
+ }
19
27
 
20
- files.forEach((file) => {
21
- const itemPath = `${packagesPath}/${file}`;
28
+ for (let index = 0; index < paths.length; index++) {
29
+ const path = paths[index];
22
30
 
23
- if (file && fs.lstatSync(itemPath).isDirectory()) {
24
- callback({
25
- name: file,
26
- absolutePath: itemPath,
27
- relativePath: `./packages/${file}`,
28
- });
31
+ if (!existDirectorySync(resolvePath(path))) {
32
+ continue;
29
33
  }
30
- });
34
+
35
+ const packagesPath = resolvePath(path);
36
+
37
+ const files = fs.readdirSync(path);
38
+
39
+ files.forEach((file) => {
40
+ const itemPath = `${packagesPath}/${file}`;
41
+
42
+ if (file && fs.lstatSync(itemPath).isDirectory()) {
43
+ callback({
44
+ name: file,
45
+ absolutePath: itemPath,
46
+ relativePath: `./packages/${file}`,
47
+ });
48
+ }
49
+ });
50
+ }
31
51
  }
32
52
 
33
53
  module.exports = { loopPackage };
@@ -20,7 +20,7 @@ function adjustChildrenPackageJsonByCommand(cmd) {
20
20
  function checkEasySoftDevelopVersion() {
21
21
  promptInfo('check easy-soft-develop version');
22
22
 
23
- exec('ncu -g easy-soft-develop');
23
+ exec('npm-check-updates -g easy-soft-develop');
24
24
  }
25
25
 
26
26
  /**
@@ -32,7 +32,7 @@ function updateSpecialPackageVersion(packageList) {
32
32
 
33
33
  const packages = packageList.join(' ');
34
34
 
35
- const ncuCommand = `npx ncu -u ${packages} --packageFile package.json`;
35
+ const ncuCommand = `npx npm-check-updates -u ${packages} --packageFile package.json`;
36
36
 
37
37
  promptInfo(`${packageList.join()} will check update`);
38
38
 
@@ -48,7 +48,7 @@ function updateSpecialPackageVersion(packageList) {
48
48
  function updateAllPackageVersion() {
49
49
  exec('npm run z:initial:environment');
50
50
 
51
- const ncuCommand = `npx ncu -u --packageFile package.json`;
51
+ const ncuCommand = `npx npm-check-updates -u --packageFile package.json`;
52
52
 
53
53
  promptInfo(`all packages version will update`);
54
54
 
@@ -64,7 +64,7 @@ function updateAllPackageVersion() {
64
64
  }
65
65
 
66
66
  function checkAllPackageVersion() {
67
- const ncuCommand = `npx ncu --packageFile package.json`;
67
+ const ncuCommand = `npx npm-check-updates --packageFile package.json`;
68
68
 
69
69
  promptEmptyLine();
70
70
 
@@ -0,0 +1,2 @@
1
+ export function createDevelopSubPathVersionNcuConfigFile(): void;
2
+ export function getDevelopSubPathVersionNcuConfig(): any;