easy-soft-develop 2.0.119 → 2.0.139

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.
Files changed (47) hide show
  1. package/bin/cli.js +8 -0
  2. package/package.json +13 -9
  3. package/src/cliCollection/publish.js +9 -0
  4. package/src/templates/eslint.template.js +2 -2
  5. package/src/templates/package.template.js +7 -8
  6. package/src/templates/prettier.template.js +1 -1
  7. package/src/tools/commit.refresh.js +1 -1
  8. package/src/tools/develop.file.js +139 -22
  9. package/src/tools/initial.environment.js +35 -6
  10. package/src/tools/meta.js +26 -0
  11. package/src/tools/package.install.global.develop.dependence.js +24 -5
  12. package/src/tools/package.update.js +17 -9
  13. package/types/cliCollection/check-all-package-version.d.ts +1 -0
  14. package/types/cliCollection/clear-all-dependence.d.ts +1 -0
  15. package/types/cliCollection/commit-refresh.d.ts +1 -0
  16. package/types/cliCollection/create-assist-scripts.cli.d.ts +1 -0
  17. package/types/cliCollection/create-lerna-project.d.ts +1 -0
  18. package/types/cliCollection/create-project-with-template.d.ts +1 -0
  19. package/types/cliCollection/publish.d.ts +1 -0
  20. package/types/cliCollection/sleep.d.ts +1 -0
  21. package/types/cliCollection/update-all-package-version.d.ts +1 -0
  22. package/types/cliCollection/update-package-from-package.d.ts +1 -0
  23. package/types/index.d.ts +20 -0
  24. package/types/project/initProject.d.ts +1 -0
  25. package/types/templates/babel.config.template.d.ts +8 -0
  26. package/types/templates/commitlint.config.template.d.ts +8 -0
  27. package/types/templates/editor.template.d.ts +8 -0
  28. package/types/templates/eslint.template.d.ts +178 -0
  29. package/types/templates/git.template.d.ts +18 -0
  30. package/types/templates/lint-staged.template.d.ts +8 -0
  31. package/types/templates/package.template.d.ts +38 -0
  32. package/types/templates/prettier.template.d.ts +28 -0
  33. package/types/templates/stylelint.template.d.ts +27 -0
  34. package/types/templates/template.config.d.ts +1 -0
  35. package/types/tools/clean.d.ts +1 -0
  36. package/types/tools/commit.refresh.d.ts +1 -0
  37. package/types/tools/develop.file.d.ts +10 -0
  38. package/types/tools/initial.environment.d.ts +6 -0
  39. package/types/tools/meta.d.ts +38 -0
  40. package/types/tools/package.install.global.develop.dependence.d.ts +6 -0
  41. package/types/tools/package.script.d.ts +5 -0
  42. package/types/tools/package.tools.d.ts +8 -0
  43. package/types/tools/package.update.d.ts +3 -0
  44. package/types/tools/prettier.file.d.ts +2 -0
  45. package/types/tools/prettier.package.json.d.ts +2 -0
  46. package/types/tools/sleep.d.ts +1 -0
  47. package/types/tools/update.package.from.package.d.ts +7 -0
package/bin/cli.js CHANGED
@@ -7,6 +7,7 @@ const createAssistScripts = require('../src/cliCollection/create-assist-scripts.
7
7
  const checkAllPackageVersion = require('../src/cliCollection/check-all-package-version');
8
8
  const updateAllPackageVersion = require('../src/cliCollection/update-all-package-version');
9
9
  const sleep = require('../src/cliCollection/sleep');
10
+ const publish = require('../src/cliCollection/publish');
10
11
  const commitRefresh = require('../src/cliCollection/commit-refresh');
11
12
  const createLernaProject = require('../src/cliCollection/create-lerna-project');
12
13
  const clearAllDependence = require('../src/cliCollection/clear-all-dependence');
@@ -50,6 +51,13 @@ program
50
51
  sleep.run(a, o);
51
52
  });
52
53
 
54
+ program
55
+ .command('publish')
56
+ .description('publish to npm by script "z:publish:npm-all"')
57
+ .action(() => {
58
+ publish.run();
59
+ });
60
+
53
61
  program
54
62
  .command('commit-refresh')
55
63
  .description('update a flag file when commit')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.0.119",
3
+ "version": "2.0.139",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -13,26 +13,29 @@
13
13
  "license": "ISC",
14
14
  "author": "",
15
15
  "main": "src/index.js",
16
+ "types": "types/index.d.ts",
16
17
  "bin": {
17
18
  "easy-soft-develop": "./bin/cli.js"
18
19
  },
19
20
  "directories": {
20
- "src": "src"
21
+ "src": "src",
22
+ "types": "types"
21
23
  },
22
24
  "files": [
23
- "src/"
25
+ "src/",
26
+ "types/"
24
27
  ],
25
28
  "scripts": {
26
- "change:nrm:local": "nrm use local",
27
- "change:nrm:npm": "nrm use npm",
29
+ "change:npm:registry:local": "nrm use local",
30
+ "change:npm:registry:npm": "nrm use npm",
28
31
  "commitlint": "npx commitlint --edit",
29
- "precz": "node ./bin/cli.js commit-refresh && git stage -A",
32
+ "precz": "node ./bin/cli.js commit-refresh && npm run z:tsc:build && git stage -A",
30
33
  "cz": "cz",
31
34
  "postcz": "git push",
32
35
  "publish:npm": "npm run publish:patch:npm",
33
- "prepublish:patch:npm": "npm run cz&& npm version patch && npm run change:nrm:npm",
36
+ "prepublish:patch:npm": "npm run cz&& npm version patch && npm run change:npm:registry:npm",
34
37
  "publish:patch:npm": "npm publish",
35
- "postpublish:patch:npm": "npm run change:nrm:local",
38
+ "postpublish:patch:npm": "npm run change:npm:registry:local",
36
39
  "test:bin:check-all-package-version": "node ./bin/cli.js check-all-package-version",
37
40
  "test:bin:commit-refresh": "node ./bin/cli.js commit-refresh",
38
41
  "test:bin:create-assist-scripts": "node ./bin/cli.js create-assist-scripts",
@@ -46,7 +49,8 @@
46
49
  "test:createPackageUpdateAllVersionScriptFile": "node ./test/createPackageUpdateAllVersionScriptFile.test.js",
47
50
  "test:createSleepScriptFile": "node ./test/createSleepScriptFile.test.js",
48
51
  "test:inner:assignObject": "node ./test/assignObject.test.js",
49
- "z:prettier:format:all": "npx prettier --write ."
52
+ "z:prettier:format:all": "npx prettier --write .",
53
+ "z:tsc:build": "echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete"
50
54
  },
51
55
  "dependencies": {
52
56
  "commander": "^10.0.0",
@@ -0,0 +1,9 @@
1
+ const { exit, exec } = require('../tools/meta');
2
+
3
+ exports.run = function () {
4
+ exec('npm run npm run z:change:npm:registry:npm');
5
+ exec(`npm run z:publish:npm-all`);
6
+ exec('npm run npm run z:change:npm:registry:local');
7
+
8
+ exit();
9
+ };
@@ -120,7 +120,7 @@ const coreRules = {
120
120
 
121
121
  const reactRules = {
122
122
  'react/sort-comp': 0,
123
- 'react/jsx-uses-react': 'off',
123
+ 'react/jsx-uses-react': 2,
124
124
  'react/react-in-jsx-scope': 'off',
125
125
  'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
126
126
  'react/jsx-wrap-multilines': 0,
@@ -486,7 +486,7 @@ module.exports = {
486
486
  const parserFile = {
487
487
  folderPath: `${folderPath}/config/items/parser`,
488
488
  fileName: 'index.js',
489
- coverFile: false,
489
+ coverFile: true,
490
490
  fileContent: parserFileContent,
491
491
  };
492
492
 
@@ -82,12 +82,10 @@ const toolsScript = {
82
82
  const publishScript = {
83
83
  changelog:
84
84
  'lerna version --conventional-commits --no-push --no-git-tag-version',
85
- 'prez:publish-npm-all': 'npm run z:change:nrm:npm',
86
- 'z:publish-npm-all': 'npm run z:publish:npm-all',
87
- 'postz:publish-npm-all': 'npm run z:change:nrm:local',
88
- 'prez:publish:lerna': 'npm run z:change:nrm:npm',
85
+ 'z:publish-npm-all': 'npx easy-soft-develop publish',
86
+ 'prez:publish:lerna': 'npm run z:change:npm:registry:npm',
89
87
  'z:publish:lerna': 'lerna updated && npm run z:lerna:publish',
90
- 'postz:publish:lerna': 'npm run z:change:nrm:local && npm run z:publish-npm-all',
88
+ 'postz:publish:lerna': 'npm run z:change:npm:registry:local && npm run z:publish-npm-all',
91
89
  'prez:publish:build': 'npm run z:install && npm run cz && npm run z:build:all',
92
90
  'z:publish:build': 'npm run z:publish:lerna',
93
91
  };
@@ -103,7 +101,6 @@ const environmentScript = {
103
101
 
104
102
  const lernaScript = {
105
103
  'z:lerna:publish': 'lerna publish --yes',
106
- 'prez:lerna:bootstrap': 'npm run z:change:nrm:local',
107
104
  'z:lerna:bootstrap':
108
105
  'npm run z:clean && npm run z:husky:install && git pull && npm run z:install',
109
106
  };
@@ -111,14 +108,16 @@ const lernaScript = {
111
108
  const installScript = {
112
109
  "z:reinstall": 'npm run z:lerna:bootstrap',
113
110
  "postinstall": "npm run z:initial:environment",
111
+ "prez:install.global.develop.dependence": "npm run z:change:npm:registry:local",
114
112
  "z:install.global.develop.dependence": "node ./develop/assists/install.global.develop.dependence",
115
113
  "postz:install.global.develop.dependence": "npm run z:install",
114
+ "prez:install": "npm run z:change:npm:registry:local",
116
115
  "z:install": "pnpm install",
117
116
  };
118
117
 
119
118
  const nrmScript = {
120
- "z:change:nrm:local": "nrm use local",
121
- "z:change:nrm:npm": "nrm use npm",
119
+ "z:change:npm:registry:local": "nrm use local",
120
+ "z:change:npm:registry:npm": "nrm use npm",
122
121
  };
123
122
 
124
123
  const commitScript = {
@@ -42,7 +42,7 @@ module.exports = generalConfig;
42
42
  \`;
43
43
 
44
44
  const packageContent = \`${fileGlobalHeader}
45
- var { generalConfig } = require("../../develop/config/prettier/config");
45
+ const { generalConfig } = require("../../develop/config/prettier/config");
46
46
 
47
47
  module.exports = generalConfig;
48
48
  \`;
@@ -30,7 +30,7 @@ function commitRefresh(fileName = '', relativeFolder = '') {
30
30
 
31
31
  const scriptFilePath = `${filePath}/${relativeFolderAdjust}/${fileNameAdjust}`;
32
32
 
33
- writeFileSync(scriptFilePath, content);
33
+ writeFileSync(scriptFilePath, content, { coverFile: true });
34
34
 
35
35
  const log = `${fileNameAdjust} refresh success in folder "./${relativeFolderAdjust}/"`;
36
36
 
@@ -63,6 +63,99 @@ const {
63
63
  configFile: stylelintConfigFile,
64
64
  } = require('../templates/stylelint.template');
65
65
 
66
+ const childrenDevelopPackageConfigContent = `${fileGlobalHeader}
67
+ const childrenDevelopPackageList = [];
68
+
69
+ module.exports = {
70
+ childrenDevelopPackageList,
71
+ };
72
+ `;
73
+
74
+ const childrenSpecialDevelopPackageConfigContent = `${fileGlobalHeader}
75
+ const childrenSpecialDevelopPackageList = {};
76
+
77
+ module.exports = {
78
+ childrenSpecialDevelopPackageList,
79
+ };
80
+ `;
81
+
82
+ const cleanConfigContent = `${fileGlobalHeader}
83
+ const cleanCommand = 'lerna clean -y';
84
+
85
+ const cleanCollection = [];
86
+
87
+ module.exports = {
88
+ cleanCommand,
89
+ cleanCollection,
90
+ };
91
+ `;
92
+
93
+ const globalDevelopPackageConfigContent = `${fileGlobalHeader}
94
+ const globalDevelopPackageList = [];
95
+
96
+ module.exports = {
97
+ globalDevelopPackageList,
98
+ };
99
+ `;
100
+
101
+ const mainDevelopPackageConfigContent = `${fileGlobalHeader}
102
+ const mainDevelopPackageList = [];
103
+
104
+ module.exports = {
105
+ mainDevelopPackageList,
106
+ };
107
+ `;
108
+
109
+ const updatePackageFromPackageConfigContent = `${fileGlobalHeader}
110
+ const updatePackageFromPackageOptions = {
111
+ agent: '',
112
+ localFile: '',
113
+ packageUrl: '',
114
+ repo: '',
115
+ };
116
+
117
+ module.exports = {
118
+ updatePackageFromPackageOptions,
119
+ };
120
+ `;
121
+
122
+ const updateSpecialPackageConfigContent = `${fileGlobalHeader}
123
+ const updateSpecialPackageCollection = [];
124
+
125
+ module.exports = {
126
+ updateSpecialPackageCollection,
127
+ };
128
+ `;
129
+
130
+ const assistConfigIndexContent = `${fileGlobalHeader}
131
+ const {
132
+ childrenDevelopPackageList,
133
+ } = require('./childrenDevelopPackage.config');
134
+ const {
135
+ childrenSpecialDevelopPackageList,
136
+ } = require('./childrenSpecialDevelopPackage.config');
137
+ const { cleanCollection, cleanCommand } = require('./clean.config');
138
+ const { globalDevelopPackageList } = require('./globalDevelopPackage.config');
139
+ const { mainDevelopPackageList } = require('./mainDevelopPackage.config');
140
+ const {
141
+ updatePackageFromPackageOptions,
142
+ } = require('./updatePackageFromPackage.config');
143
+ const {
144
+ updateSpecialPackageCollection,
145
+ } = require('./updateSpecialPackage.config');
146
+
147
+ module.exports = {
148
+ childrenDevelopPackageList,
149
+ childrenSpecialDevelopPackageList,
150
+ cleanCollection,
151
+ cleanCommand,
152
+ globalDevelopPackageList,
153
+ mainDevelopPackageList,
154
+ updatePackageFromPackageOptions,
155
+ updateSpecialPackageCollection,
156
+ };
157
+ `;
158
+
66
159
  function createScriptFile(folderPath, fileName, content, coverFile = false) {
67
160
  mkdirSync(folderPath);
68
161
 
@@ -125,37 +218,61 @@ auto-install-peers=true`,
125
218
  }
126
219
 
127
220
  function createAssistConfigScriptFile() {
128
- const content = `${fileGlobalHeader}
129
- const cleanCommand = '';
221
+ createScriptFile(
222
+ `./develop/assists/config`,
223
+ 'childrenDevelopPackage.config.js',
224
+ childrenDevelopPackageConfigContent,
225
+ false,
226
+ );
130
227
 
131
- const cleanCollection = [];
228
+ createScriptFile(
229
+ `./develop/assists/config`,
230
+ 'childrenSpecialDevelopPackage.config.js',
231
+ childrenSpecialDevelopPackageConfigContent,
232
+ false,
233
+ );
132
234
 
133
- const developDependencePackageCollection = [];
235
+ createScriptFile(
236
+ `./develop/assists/config`,
237
+ 'clean.config.js',
238
+ cleanConfigContent,
239
+ false,
240
+ );
134
241
 
135
- const updateSpecialPackageCollection = [];
242
+ createScriptFile(
243
+ `./develop/assists/config`,
244
+ 'globalDevelopPackage.config.js',
245
+ globalDevelopPackageConfigContent,
246
+ false,
247
+ );
136
248
 
137
- const updatePackageFromPackageOptions = {
138
- agent: '',
139
- localFile: '',
140
- packageUrl: '',
141
- repo: '',
142
- };
249
+ createScriptFile(
250
+ `./develop/assists/config`,
251
+ 'mainDevelopPackage.config.js',
252
+ mainDevelopPackageConfigContent,
253
+ false,
254
+ );
143
255
 
144
- module.exports = {
145
- cleanCommand,
146
- cleanCollection,
147
- developDependencePackageCollection,
148
- updateSpecialPackageCollection,
149
- updatePackageFromPackageOptions,
150
- };
151
- `;
256
+ createScriptFile(
257
+ `./develop/assists/config`,
258
+ 'updatePackageFromPackage.config.js',
259
+ updatePackageFromPackageConfigContent,
260
+ false,
261
+ );
152
262
 
153
- return createScriptFile(
263
+ createScriptFile(
154
264
  `./develop/assists/config`,
155
- 'index.js',
156
- content,
265
+ 'updateSpecialPackage.config.js',
266
+ updateSpecialPackageConfigContent,
157
267
  false,
158
268
  );
269
+
270
+ createScriptFile(
271
+ `./develop/assists/config`,
272
+ 'index.js',
273
+ assistConfigIndexContent,
274
+ true,
275
+ );
159
276
  }
160
277
 
161
278
  function createCleanScriptFile() {
@@ -1,3 +1,4 @@
1
+ const { checkInCollection } = require('./meta');
1
2
  const {
2
3
  promptSuccess,
3
4
  writeFileSync,
@@ -60,18 +61,34 @@ function createPackageFile(fileWithContentCollection) {
60
61
  promptEmptyLine();
61
62
  }
62
63
 
63
- function adjustMainPackageJson({ scripts }) {
64
+ function adjustMainPackageJsonScript({ scripts }) {
64
65
  const mainProjectPath = resolvePath(`./package.json`);
65
66
 
66
67
  const packageJson = readJsonFileSync(mainProjectPath);
67
68
 
69
+ const originalScript = packageJson.scripts;
70
+
71
+ const ignoreDeleteScript = ['z:build:all', 'z:publish:npm-all'];
72
+
73
+ Object.keys(originalScript).forEach((o) => {
74
+ if (!checkInCollection(ignoreDeleteScript, o)) {
75
+ if (
76
+ o.startsWith('z:') ||
77
+ o.startsWith('prez:') ||
78
+ o.startsWith('postz:')
79
+ ) {
80
+ delete originalScript[o];
81
+ }
82
+ }
83
+ });
84
+
68
85
  packageJson.scripts = assignObject(
69
86
  {
70
87
  'z:build:all': 'echo please supplement build all packages commend',
71
88
  'z:publish:npm-all': 'echo please supplement publish to npm commend',
72
89
  },
73
90
  globalScript,
74
- packageJson.scripts || {},
91
+ originalScript || {},
75
92
  scripts,
76
93
  );
77
94
 
@@ -81,7 +98,7 @@ function adjustMainPackageJson({ scripts }) {
81
98
  promptEmptyLine();
82
99
  }
83
100
 
84
- function adjustChildrenPackageJson({ scripts }) {
101
+ function adjustChildrenPackageJsonScript({ scripts }) {
85
102
  loopPackage(({ name, absolutePath }) => {
86
103
  const itemPath = absolutePath;
87
104
 
@@ -89,7 +106,19 @@ function adjustChildrenPackageJson({ scripts }) {
89
106
 
90
107
  const packageJson = readJsonFileSync(childPackageJsonPath);
91
108
 
92
- packageJson.scripts = assignObject(packageJson.scripts || {}, scripts);
109
+ const originalScript = packageJson.scripts;
110
+
111
+ Object.keys(originalScript).forEach((o) => {
112
+ if (
113
+ o.startsWith('z:') ||
114
+ o.startsWith('prez:') ||
115
+ o.startsWith('postz:')
116
+ ) {
117
+ delete originalScript[o];
118
+ }
119
+ });
120
+
121
+ packageJson.scripts = assignObject(originalScript || {}, scripts);
93
122
 
94
123
  writeJsonFileSync(childPackageJsonPath, packageJson, { coverFile: true });
95
124
 
@@ -108,9 +137,9 @@ function initialEnvironment({
108
137
 
109
138
  createPackageFile(packageFileContentList || []);
110
139
 
111
- adjustMainPackageJson({ scripts: mainScripts || {} });
140
+ adjustMainPackageJsonScript({ scripts: mainScripts || {} });
112
141
 
113
- adjustChildrenPackageJson({ scripts: childScripts || {} });
142
+ adjustChildrenPackageJsonScript({ scripts: childScripts || {} });
114
143
 
115
144
  prettierAllPackageJson();
116
145
  }
package/src/tools/meta.js CHANGED
@@ -36,6 +36,31 @@ function getArgCollection() {
36
36
  return process.argv;
37
37
  }
38
38
 
39
+ /**
40
+ * Check value in the collection.
41
+ * @param {Array} collection value collection
42
+ * @param {*} target the target value will be checked
43
+ */
44
+ function checkInCollection(collection, target) {
45
+ let result = false;
46
+
47
+ if (!isArray(collection)) {
48
+ return result;
49
+ }
50
+
51
+ collection.some((o) => {
52
+ if (o === target) {
53
+ result = true;
54
+
55
+ return true;
56
+ }
57
+
58
+ return false;
59
+ });
60
+
61
+ return result;
62
+ }
63
+
39
64
  function checkStringIsEmpty(v) {
40
65
  v = ((v || null) == null ? '' : toString(v))
41
66
  .trim()
@@ -219,6 +244,7 @@ module.exports = {
219
244
  exec,
220
245
  cd,
221
246
  getArgCollection,
247
+ checkInCollection,
222
248
  existFileSync,
223
249
  existDirectorySync,
224
250
  writeFileSync,
@@ -41,6 +41,7 @@ function adjustMainPackageJson(packageList) {
41
41
  const packageJson = readJsonFileSync('./package.json');
42
42
 
43
43
  packageJson.devDependencies = assignObject(
44
+ {},
44
45
  o,
45
46
  packageJson.devDependencies || {},
46
47
  );
@@ -65,13 +66,17 @@ function adjustChildrenPackageJson(packageList, specialPackageList) {
65
66
 
66
67
  let specials = {};
67
68
 
68
- if (specialPackageList[name]) {
69
- if (isArray(specialPackageList[name])) {
70
- specials = buildPackageObject(specialPackageList[name]);
69
+ specialPackageList.forEach((o) => {
70
+ if (o.name === name) {
71
+ specials = {
72
+ ...specials,
73
+ ...buildPackageObject(o.packages),
74
+ };
71
75
  }
72
- }
76
+ });
73
77
 
74
78
  packageJson.devDependencies = assignObject(
79
+ {},
75
80
  o,
76
81
  specials,
77
82
  packageJson.devDependencies || {},
@@ -110,7 +115,21 @@ function installDevelopDependencePackages({
110
115
 
111
116
  prettierAllPackageJson();
112
117
 
113
- updateSpecialPackageVersion(packages);
118
+ let packageListAll = [
119
+ ...packages,
120
+ ...mainDevelopPackageList,
121
+ ...childrenDevelopPackageList,
122
+ ];
123
+
124
+ childrenSpecialDevelopPackageList.forEach((o) => {
125
+ if (isArray(o.packages)) {
126
+ packageListAll = [...packageListAll, ...o.packages];
127
+ }
128
+ });
129
+
130
+ packageListAll = [...new Set(packageListAll)];
131
+
132
+ updateSpecialPackageVersion(packageListAll);
114
133
 
115
134
  exec('npm run z:install');
116
135
 
@@ -1,12 +1,18 @@
1
- const { promptInfo, promptSuccess, exec } = require('./meta');
1
+ const { promptInfo, promptSuccess, exec, promptEmptyLine } = require('./meta');
2
2
  const { loopPackage } = require('./package.tools');
3
3
 
4
- function adjustMainPackageJson(cmd) {
4
+ function adjustMainPackageJsonByCommand(cmd) {
5
+ promptInfo(`update main command: ${cmd}`);
6
+
5
7
  exec(cmd);
6
8
  }
7
9
 
8
- function adjustChildrenPackageJson(cmd) {
10
+ function adjustChildrenPackageJsonByCommand(cmd) {
9
11
  loopPackage(({ name }) => {
12
+ const commandString = `cd ./packages/${name} && ${cmd}`;
13
+
14
+ promptInfo(`update child command: ${commandString}`);
15
+
10
16
  exec(`cd ./packages/${name} && ${cmd}`);
11
17
  });
12
18
  }
@@ -20,9 +26,9 @@ function updateSpecialPackageVersion(packageList) {
20
26
 
21
27
  promptInfo(`${packageList.join()} will check update`);
22
28
 
23
- adjustMainPackageJson(ncuCommand);
29
+ adjustMainPackageJsonByCommand(ncuCommand);
24
30
 
25
- adjustChildrenPackageJson(ncuCommand);
31
+ adjustChildrenPackageJsonByCommand(ncuCommand);
26
32
 
27
33
  promptSuccess('check success');
28
34
  }
@@ -34,9 +40,9 @@ function updateAllPackageVersion() {
34
40
 
35
41
  promptInfo(`all packages version will update`);
36
42
 
37
- adjustMainPackageJson(ncuCommand);
43
+ adjustMainPackageJsonByCommand(ncuCommand);
38
44
 
39
- adjustChildrenPackageJson(ncuCommand);
45
+ adjustChildrenPackageJsonByCommand(ncuCommand);
40
46
 
41
47
  promptSuccess('update success, exec install with z:install');
42
48
 
@@ -46,11 +52,13 @@ function updateAllPackageVersion() {
46
52
  function checkAllPackageVersion() {
47
53
  const ncuCommand = `npx ncu --packageFile package.json`;
48
54
 
55
+ promptEmptyLine();
56
+
49
57
  promptInfo(`all packages version will check update`);
50
58
 
51
- adjustMainPackageJson(ncuCommand);
59
+ adjustMainPackageJsonByCommand(ncuCommand);
52
60
 
53
- adjustChildrenPackageJson(ncuCommand);
61
+ adjustChildrenPackageJsonByCommand(ncuCommand);
54
62
 
55
63
  promptSuccess('update success, exec install with z:install');
56
64
 
@@ -0,0 +1 @@
1
+ export function run(): void;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): Promise<void>;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;
@@ -0,0 +1 @@
1
+ export function run(): void;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;
@@ -0,0 +1 @@
1
+ export function run(): void;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;
@@ -0,0 +1 @@
1
+ export function run(): void;
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import { clean } from "./tools/clean";
2
+ import { commitRefresh } from "./tools/commit.refresh";
3
+ import { initialEnvironment } from "./tools/initial.environment";
4
+ import { installDevelopDependencePackages } from "./tools/package.install.global.develop.dependence";
5
+ import { loopPackage } from "./tools/package.tools";
6
+ import { checkAllPackageVersion } from "./tools/package.update";
7
+ import { updateSpecialPackageVersion } from "./tools/package.update";
8
+ import { updateAllPackageVersion } from "./tools/package.update";
9
+ import { exec } from "./tools/meta";
10
+ import { sleep } from "./tools/sleep";
11
+ import { createCleanScriptFile } from "./tools/develop.file";
12
+ import { createPackageCheckSpecialVersionScriptFile } from "./tools/develop.file";
13
+ import { createInstallGlobalDevelopDependenceScriptFile } from "./tools/develop.file";
14
+ import { createDevelopFiles } from "./tools/develop.file";
15
+ import { prettierAllFile } from "./tools/prettier.file";
16
+ import { prettierChangeFile } from "./tools/prettier.file";
17
+ import { prettierAllPackageJson } from "./tools/prettier.package.json";
18
+ import { prettierCurrentPackageJson } from "./tools/prettier.package.json";
19
+ import { updatePackageFromPackage } from "./tools/update.package.from.package";
20
+ export { clean, commitRefresh, initialEnvironment, installDevelopDependencePackages, loopPackage, checkAllPackageVersion, updateSpecialPackageVersion, updateAllPackageVersion, exec, sleep, createCleanScriptFile, createPackageCheckSpecialVersionScriptFile, createInstallGlobalDevelopDependenceScriptFile, createDevelopFiles, prettierAllFile, prettierChangeFile, prettierAllPackageJson, prettierCurrentPackageJson, updatePackageFromPackage };
@@ -0,0 +1 @@
1
+ export function createLernaProject(name: any): void;
@@ -0,0 +1,8 @@
1
+ export namespace contentFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { contentFileContent as fileContent };
6
+ }
7
+ declare const contentFileContent: string;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ export namespace contentFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { contentFileContent as fileContent };
6
+ }
7
+ declare const contentFileContent: string;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ export namespace contentFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { contentFileContent as fileContent };
6
+ }
7
+ declare const contentFileContent: string;
8
+ export {};
@@ -0,0 +1,178 @@
1
+ export namespace ignoreFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { ignoreFileContent as fileContent };
6
+ }
7
+ export namespace contentFile {
8
+ const folderPath_1: string;
9
+ export { folderPath_1 as folderPath };
10
+ const fileName_1: string;
11
+ export { fileName_1 as fileName };
12
+ const coverFile_1: boolean;
13
+ export { coverFile_1 as coverFile };
14
+ export { contentFileContent as fileContent };
15
+ }
16
+ export namespace ruleEmbedFile {
17
+ const folderPath_2: string;
18
+ export { folderPath_2 as folderPath };
19
+ const fileName_2: string;
20
+ export { fileName_2 as fileName };
21
+ const coverFile_2: boolean;
22
+ export { coverFile_2 as coverFile };
23
+ export { ruleEmbedFileContent as fileContent };
24
+ }
25
+ export namespace ruleCustomFile {
26
+ const folderPath_3: string;
27
+ export { folderPath_3 as folderPath };
28
+ const fileName_3: string;
29
+ export { fileName_3 as fileName };
30
+ const coverFile_3: boolean;
31
+ export { coverFile_3 as coverFile };
32
+ export { ruleCustomFileContent as fileContent };
33
+ }
34
+ export namespace ruleFile {
35
+ const folderPath_4: string;
36
+ export { folderPath_4 as folderPath };
37
+ const fileName_4: string;
38
+ export { fileName_4 as fileName };
39
+ const coverFile_4: boolean;
40
+ export { coverFile_4 as coverFile };
41
+ export { ruleFileContent as fileContent };
42
+ }
43
+ export namespace configFile {
44
+ const folderPath_5: string;
45
+ export { folderPath_5 as folderPath };
46
+ const fileName_5: string;
47
+ export { fileName_5 as fileName };
48
+ const coverFile_5: boolean;
49
+ export { coverFile_5 as coverFile };
50
+ export { configFileContent as fileContent };
51
+ }
52
+ export namespace extendEmbedFile {
53
+ const folderPath_6: string;
54
+ export { folderPath_6 as folderPath };
55
+ const fileName_6: string;
56
+ export { fileName_6 as fileName };
57
+ const coverFile_6: boolean;
58
+ export { coverFile_6 as coverFile };
59
+ export { extendEmbedFileContent as fileContent };
60
+ }
61
+ export namespace extendCustomFile {
62
+ const folderPath_7: string;
63
+ export { folderPath_7 as folderPath };
64
+ const fileName_7: string;
65
+ export { fileName_7 as fileName };
66
+ const coverFile_7: boolean;
67
+ export { coverFile_7 as coverFile };
68
+ export { extendCustomFileContent as fileContent };
69
+ }
70
+ export namespace extendFile {
71
+ const folderPath_8: string;
72
+ export { folderPath_8 as folderPath };
73
+ const fileName_8: string;
74
+ export { fileName_8 as fileName };
75
+ const coverFile_8: boolean;
76
+ export { coverFile_8 as coverFile };
77
+ export { extendFileContent as fileContent };
78
+ }
79
+ export namespace pluginEmbedFile {
80
+ const folderPath_9: string;
81
+ export { folderPath_9 as folderPath };
82
+ const fileName_9: string;
83
+ export { fileName_9 as fileName };
84
+ const coverFile_9: boolean;
85
+ export { coverFile_9 as coverFile };
86
+ export { pluginEmbedFileContent as fileContent };
87
+ }
88
+ export namespace pluginCustomFile {
89
+ const folderPath_10: string;
90
+ export { folderPath_10 as folderPath };
91
+ const fileName_10: string;
92
+ export { fileName_10 as fileName };
93
+ const coverFile_10: boolean;
94
+ export { coverFile_10 as coverFile };
95
+ export { pluginCustomFileContent as fileContent };
96
+ }
97
+ export namespace pluginFile {
98
+ const folderPath_11: string;
99
+ export { folderPath_11 as folderPath };
100
+ const fileName_11: string;
101
+ export { fileName_11 as fileName };
102
+ const coverFile_11: boolean;
103
+ export { coverFile_11 as coverFile };
104
+ export { pluginFileContent as fileContent };
105
+ }
106
+ export namespace parserEmbedFile {
107
+ const folderPath_12: string;
108
+ export { folderPath_12 as folderPath };
109
+ const fileName_12: string;
110
+ export { fileName_12 as fileName };
111
+ const coverFile_12: boolean;
112
+ export { coverFile_12 as coverFile };
113
+ export { parserEmbedFileContent as fileContent };
114
+ }
115
+ export namespace parserCustomFile {
116
+ const folderPath_13: string;
117
+ export { folderPath_13 as folderPath };
118
+ const fileName_13: string;
119
+ export { fileName_13 as fileName };
120
+ const coverFile_13: boolean;
121
+ export { coverFile_13 as coverFile };
122
+ export { parserCustomFileContent as fileContent };
123
+ }
124
+ export namespace parserFile {
125
+ const folderPath_14: string;
126
+ export { folderPath_14 as folderPath };
127
+ const fileName_14: string;
128
+ export { fileName_14 as fileName };
129
+ const coverFile_14: boolean;
130
+ export { coverFile_14 as coverFile };
131
+ export { parserFileContent as fileContent };
132
+ }
133
+ export namespace settingEmbedFile {
134
+ const folderPath_15: string;
135
+ export { folderPath_15 as folderPath };
136
+ const fileName_15: string;
137
+ export { fileName_15 as fileName };
138
+ const coverFile_15: boolean;
139
+ export { coverFile_15 as coverFile };
140
+ export { settingEmbedFileContent as fileContent };
141
+ }
142
+ export namespace settingCustomFile {
143
+ const folderPath_16: string;
144
+ export { folderPath_16 as folderPath };
145
+ const fileName_16: string;
146
+ export { fileName_16 as fileName };
147
+ const coverFile_16: boolean;
148
+ export { coverFile_16 as coverFile };
149
+ export { settingCustomFileContent as fileContent };
150
+ }
151
+ export namespace settingFile {
152
+ const folderPath_17: string;
153
+ export { folderPath_17 as folderPath };
154
+ const fileName_17: string;
155
+ export { fileName_17 as fileName };
156
+ const coverFile_17: boolean;
157
+ export { coverFile_17 as coverFile };
158
+ export { settingFileContent as fileContent };
159
+ }
160
+ declare const ignoreFileContent: string;
161
+ declare const contentFileContent: string;
162
+ declare const ruleEmbedFileContent: string;
163
+ declare const ruleCustomFileContent: string;
164
+ declare const ruleFileContent: string;
165
+ declare const configFileContent: string;
166
+ declare const extendEmbedFileContent: string;
167
+ declare const extendCustomFileContent: string;
168
+ declare const extendFileContent: string;
169
+ declare const pluginEmbedFileContent: string;
170
+ declare const pluginCustomFileContent: string;
171
+ declare const pluginFileContent: string;
172
+ declare const parserEmbedFileContent: string;
173
+ declare const parserCustomFileContent: string;
174
+ declare const parserFileContent: string;
175
+ declare const settingEmbedFileContent: string;
176
+ declare const settingCustomFileContent: string;
177
+ declare const settingFileContent: string;
178
+ export {};
@@ -0,0 +1,18 @@
1
+ export namespace attributeFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { attributeFileContent as fileContent };
6
+ }
7
+ export namespace ignoreFile {
8
+ const folderPath_1: string;
9
+ export { folderPath_1 as folderPath };
10
+ const fileName_1: string;
11
+ export { fileName_1 as fileName };
12
+ const coverFile_1: boolean;
13
+ export { coverFile_1 as coverFile };
14
+ export { ignoreFileContent as fileContent };
15
+ }
16
+ declare const attributeFileContent: string;
17
+ declare const ignoreFileContent: string;
18
+ export {};
@@ -0,0 +1,8 @@
1
+ export namespace contentFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { contentFileContent as fileContent };
6
+ }
7
+ declare const contentFileContent: string;
8
+ export {};
@@ -0,0 +1,38 @@
1
+ export namespace globalChildPackageFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { globalChildPackageFileContent as fileContent };
6
+ }
7
+ export namespace globalMainPackageFile {
8
+ const folderPath_1: string;
9
+ export { folderPath_1 as folderPath };
10
+ const fileName_1: string;
11
+ export { fileName_1 as fileName };
12
+ const coverFile_1: boolean;
13
+ export { coverFile_1 as coverFile };
14
+ export { globalMainPackageFileContent as fileContent };
15
+ }
16
+ export namespace customMainPackageFile {
17
+ const folderPath_2: string;
18
+ export { folderPath_2 as folderPath };
19
+ const fileName_2: string;
20
+ export { fileName_2 as fileName };
21
+ const coverFile_2: boolean;
22
+ export { coverFile_2 as coverFile };
23
+ export { customMainPackageFileContent as fileContent };
24
+ }
25
+ export namespace customChildPackageFile {
26
+ const folderPath_3: string;
27
+ export { folderPath_3 as folderPath };
28
+ const fileName_3: string;
29
+ export { fileName_3 as fileName };
30
+ const coverFile_3: boolean;
31
+ export { coverFile_3 as coverFile };
32
+ export { customChildPackageFileContent as fileContent };
33
+ }
34
+ declare const globalChildPackageFileContent: string;
35
+ declare const globalMainPackageFileContent: string;
36
+ declare const customMainPackageFileContent: string;
37
+ declare const customChildPackageFileContent: string;
38
+ export {};
@@ -0,0 +1,28 @@
1
+ export namespace ignoreFile {
2
+ export const folderPath: string;
3
+ export const fileName: string;
4
+ export const coverFile: boolean;
5
+ export { ignoreFileContent as fileContent };
6
+ }
7
+ export namespace contentFile {
8
+ const folderPath_1: string;
9
+ export { folderPath_1 as folderPath };
10
+ const fileName_1: string;
11
+ export { fileName_1 as fileName };
12
+ const coverFile_1: boolean;
13
+ export { coverFile_1 as coverFile };
14
+ export { contentFileContent as fileContent };
15
+ }
16
+ export namespace configFile {
17
+ const folderPath_2: string;
18
+ export { folderPath_2 as folderPath };
19
+ const fileName_2: string;
20
+ export { fileName_2 as fileName };
21
+ const coverFile_2: boolean;
22
+ export { coverFile_2 as coverFile };
23
+ export { configFileContent as fileContent };
24
+ }
25
+ declare const ignoreFileContent: string;
26
+ declare const contentFileContent: string;
27
+ declare const configFileContent: string;
28
+ export {};
@@ -0,0 +1,27 @@
1
+ export namespace ignoreFile {
2
+ const folderPath: string;
3
+ const fileName: string;
4
+ const coverFile: boolean;
5
+ const fileContent: string;
6
+ }
7
+ export namespace contentFile {
8
+ const folderPath_1: string;
9
+ export { folderPath_1 as folderPath };
10
+ const fileName_1: string;
11
+ export { fileName_1 as fileName };
12
+ const coverFile_1: boolean;
13
+ export { coverFile_1 as coverFile };
14
+ export { contentFileContent as fileContent };
15
+ }
16
+ export namespace configFile {
17
+ const folderPath_2: string;
18
+ export { folderPath_2 as folderPath };
19
+ const fileName_2: string;
20
+ export { fileName_2 as fileName };
21
+ const coverFile_2: boolean;
22
+ export { coverFile_2 as coverFile };
23
+ export { configFileContent as fileContent };
24
+ }
25
+ declare const contentFileContent: string;
26
+ declare const configFileContent: string;
27
+ export {};
@@ -0,0 +1 @@
1
+ export const fileGlobalHeader: "/* eslint-disable no-undef */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n";
@@ -0,0 +1 @@
1
+ export function clean(preCmd: any, ...targets: any[]): void;
@@ -0,0 +1 @@
1
+ export function commitRefresh(fileName?: string, relativeFolder?: string): void;
@@ -0,0 +1,10 @@
1
+ export function createCommitlintConfigFile(successMessage?: string): void;
2
+ export function createBabelConfigFile(successMessage?: string): void;
3
+ export function createNcuConfigFile(successMessage?: string): void;
4
+ export function createNpmConfigFile(successMessage?: string): void;
5
+ export function createCleanScriptFile(): boolean;
6
+ export function createPackageCheckSpecialVersionScriptFile(): void;
7
+ export function createInstallGlobalDevelopDependenceScriptFile(): void;
8
+ export function createInitialEnvironmentScriptFiles(): void;
9
+ export function createDevelopFiles(waitMessage?: string, successMessage?: string): void;
10
+ export function createUpdatePackageFromPackageScriptFile(): boolean;
@@ -0,0 +1,6 @@
1
+ export function initialEnvironment({ mainFileContentList, packageFileContentList, mainScripts, childScripts, }: {
2
+ mainFileContentList?: any[] | undefined;
3
+ packageFileContentList?: any[] | undefined;
4
+ mainScripts?: {} | undefined;
5
+ childScripts?: {} | undefined;
6
+ }): void;
@@ -0,0 +1,38 @@
1
+ export function exec(cmd: any): void;
2
+ export function cd(path: any): void;
3
+ export function getArgCollection(): any;
4
+ /**
5
+ * Check value in the collection.
6
+ * @param {Array} collection value collection
7
+ * @param {*} target the target value will be checked
8
+ */
9
+ export function checkInCollection(collection: any[], target: any): boolean;
10
+ export function existFileSync(path: any): any;
11
+ export function existDirectorySync(path: any): any;
12
+ export function writeFileSync(path: any, content: any, options?: {
13
+ coverFile: boolean;
14
+ }): boolean;
15
+ export function checkStringIsEmpty(v: any): boolean;
16
+ export function promptLine(): void;
17
+ export function promptEmptyLine(): void;
18
+ export function promptSuccess(message: any): void;
19
+ export function promptInfo(message: any): void;
20
+ export function promptWarn(message: any): void;
21
+ export function promptError(error: any): void;
22
+ export function isObject(value: any): boolean;
23
+ export function isArray(value: any): boolean;
24
+ export function assignObject(source: any, ...mergeData: any[]): any;
25
+ export function mkdirSync(path: any): void;
26
+ export function readJsonFileSync(path: any): any;
27
+ export function writeJsonFileSync(path: any, json: any, options?: {
28
+ coverFile: boolean;
29
+ }): boolean;
30
+ export function writeFileWithFolderAndNameSync(folderPath: any, fileName: any, fileContent: any, coverFile?: boolean): boolean;
31
+ export function writeFileWithOptionsSync({ folderPath, fileName, fileContent, coverFile, }: {
32
+ folderPath: any;
33
+ fileName: any;
34
+ fileContent: any;
35
+ coverFile?: boolean | undefined;
36
+ }): boolean;
37
+ export function resolvePath(path: any): any;
38
+ export function exit(): any;
@@ -0,0 +1,6 @@
1
+ export function installDevelopDependencePackages({ globalDevelopPackageList, mainDevelopPackageList, childrenDevelopPackageList, childrenSpecialDevelopPackageList, }: {
2
+ globalDevelopPackageList: any;
3
+ mainDevelopPackageList?: any[] | undefined;
4
+ childrenDevelopPackageList?: any[] | undefined;
5
+ childrenSpecialDevelopPackageList?: any[] | undefined;
6
+ }): void;
@@ -0,0 +1,5 @@
1
+ export const globalScript: {
2
+ 'z:initial:environment': string;
3
+ };
4
+ export const packageScript: {};
5
+ export function getGlobalPackages(): any[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * loop all package
3
+ */
4
+ export function loopPackage(callback?: ({ name, absolutePath, relativePath }: {
5
+ name: any;
6
+ absolutePath: any;
7
+ relativePath: any;
8
+ }) => void): void;
@@ -0,0 +1,3 @@
1
+ export function checkAllPackageVersion(): void;
2
+ export function updateSpecialPackageVersion(packageList: any): void;
3
+ export function updateAllPackageVersion(): void;
@@ -0,0 +1,2 @@
1
+ export function prettierAllFile(): void;
2
+ export function prettierChangeFile(): void;
@@ -0,0 +1,2 @@
1
+ export function prettierAllPackageJson(): void;
2
+ export function prettierCurrentPackageJson(): void;
@@ -0,0 +1 @@
1
+ export function sleep(n: any, showLog?: boolean): void;
@@ -0,0 +1,7 @@
1
+ export function updatePackageFromPackage({ path, primaryRemoteUrl, spareRemoteUrl, agent, localFile, }: {
2
+ path: any;
3
+ primaryRemoteUrl: any;
4
+ spareRemoteUrl: any;
5
+ agent: any;
6
+ localFile: any;
7
+ }): Promise<void>;