easy-soft-develop 2.0.189 → 2.0.190

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
@@ -13,6 +13,7 @@ const createLernaProject = require('../src/cliCollection/create-lerna-project');
13
13
  const clearAllDependence = require('../src/cliCollection/clear-all-dependence');
14
14
  const updatePackageFromPackage = require('../src/cliCollection/update-package-from-package');
15
15
  const createProjectWithTemplate = require('../src/cliCollection/create-project-with-template');
16
+ const prompt = require('../src/cliCollection/prompt');
16
17
 
17
18
  const program = new Command();
18
19
 
@@ -79,6 +80,16 @@ program
79
80
  createLernaProject.run(a, o);
80
81
  });
81
82
 
83
+ program
84
+ .command('prompt')
85
+ .description('prompt message')
86
+ .option('--message <string>', 'the message will show')
87
+ .option('--type <string>', 'prompt type')
88
+ .option('--blankLine [boolean]', 'echo blank line before message', false)
89
+ .action((a, o) => {
90
+ prompt.run(a, o);
91
+ });
92
+
82
93
  program
83
94
  .command('clear-package-all-dependence')
84
95
  .description('clear package all dependence in package.json file')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.0.189",
3
+ "version": "2.0.190",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -29,7 +29,7 @@
29
29
  "change:npm:registry:local": "nrm use local",
30
30
  "change:npm:registry:npm": "nrm use npm",
31
31
  "commitlint": "npx commitlint --edit",
32
- "precz": "node ./bin/cli.js commit-refresh && npm run z:tsc:build && git stage -A",
32
+ "precz": "npm run z:prettier:format:change && node ./bin/cli.js commit-refresh && npm run z:tsc:build && git stage -A",
33
33
  "cz": "cz",
34
34
  "postcz": "git push",
35
35
  "publish:npm": "npm run publish:patch:npm",
@@ -49,16 +49,18 @@
49
49
  "test:createPackageUpdateAllVersionScriptFile": "node ./test/createPackageUpdateAllVersionScriptFile.test.js",
50
50
  "test:createSleepScriptFile": "node ./test/createSleepScriptFile.test.js",
51
51
  "test:inner:assignObject": "node ./test/assignObject.test.js",
52
+ "z:ncu:u:all": "ncu -u",
52
53
  "z:prettier:format:all": "npx prettier --write .",
54
+ "z:prettier:format:change": "npx prettier --cache --write . && node ./bin/cli.js prompt --message \"format changed files complete\" --type success --blankLine",
53
55
  "z:tsc:build": "echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete"
54
56
  },
55
57
  "dependencies": {
56
58
  "commander": "^10.0.0",
57
59
  "download": "^8.0.0",
58
60
  "download-git-repo": "^3.0.2",
59
- "fs-extra": "^11.1.0",
61
+ "fs-extra": "^11.1.1",
60
62
  "hpagent": "^1.2.0",
61
- "ping": "^0.4.2",
63
+ "ping": "^0.4.4",
62
64
  "shelljs": "^0.8.5",
63
65
  "terminal-kit": "^3.0.0"
64
66
  },
@@ -69,17 +71,17 @@
69
71
  "@commitlint/cz-commitlint": "^17.4.4",
70
72
  "commitizen": "^4.3.0",
71
73
  "conventional-changelog-conventionalcommits": "^5.0.0",
72
- "eslint": "^8.35.0",
73
- "eslint-config-prettier": "^8.7.0",
74
- "eslint-formatter-pretty": "^4.1.0",
74
+ "eslint": "^8.36.0",
75
+ "eslint-config-prettier": "^8.8.0",
76
+ "eslint-formatter-pretty": "^5.0.0",
75
77
  "eslint-import-resolver-typescript": "^3.5.3",
76
78
  "eslint-plugin-eslint-comments": "^3.2.0",
77
79
  "eslint-plugin-import": "^2.27.5",
78
80
  "eslint-plugin-prettier": "^4.2.1",
79
81
  "eslint-plugin-promise": "^6.1.1",
80
82
  "husky": "^8.0.3",
81
- "lint-staged": "^13.1.2",
82
- "prettier": "^2.8.4",
83
+ "lint-staged": "^13.2.0",
84
+ "prettier": "^2.8.6",
83
85
  "prettier-plugin-packagejson": "^2"
84
86
  }
85
87
  }
@@ -0,0 +1,53 @@
1
+ const {
2
+ promptInfo,
3
+ checkStringIsEmpty,
4
+ promptEmptyLine,
5
+ promptSuccess,
6
+ promptWarn,
7
+ promptError,
8
+ promptLine,
9
+ } = require('../tools/meta');
10
+
11
+ exports.run = function (s, o) {
12
+ const {
13
+ _optionValues: { message = '', type = 'info', blankLine = '0' },
14
+ } = o;
15
+
16
+ if (checkStringIsEmpty(message)) {
17
+ promptEmptyLine();
18
+ }
19
+
20
+ if (blankLine !== '0') {
21
+ promptEmptyLine();
22
+ }
23
+
24
+ switch (type) {
25
+ case 'info':
26
+ promptInfo(message);
27
+
28
+ break;
29
+
30
+ case 'success':
31
+ promptSuccess(message);
32
+
33
+ break;
34
+
35
+ case 'warn':
36
+ promptWarn(message);
37
+
38
+ break;
39
+
40
+ case 'error':
41
+ promptError(message);
42
+
43
+ break;
44
+
45
+ case 'line':
46
+ promptLine(message);
47
+
48
+ break;
49
+
50
+ default:
51
+ promptInfo(message);
52
+ }
53
+ };
@@ -128,7 +128,7 @@ const nrmScript = {
128
128
 
129
129
  const commitScript = {
130
130
  commitlint: 'npx commitlint --edit',
131
- precz: 'npm run z:commit:refresh && git stage -A',
131
+ precz: 'npm run z:prettier:format:change && npm run z:commit:refresh && git stage -A',
132
132
  cz: 'cz',
133
133
  postcz: 'git push && npm run z:test',
134
134
  precommit: 'npm run z:lint:staged:quiet',
@@ -137,14 +137,14 @@ const commitScript = {
137
137
 
138
138
  const prettierScript = {
139
139
  "z:prettier:format:all": "npx prettier --write .",
140
- "z:prettier:format:change": "npx prettier --cache --write .",
140
+ "z:prettier:format:change": "npx prettier --cache --write . && npx easy-soft-develop --message \\"format changed files complete\\" --type success --blankLine",
141
141
  "z:prettier:package.json:all": "npx prettier --write ./**/package.json",
142
142
  "z:prettier:package.json:current": "npx prettier --write ./package.json",
143
143
  };
144
144
 
145
145
  const ncuScript = {
146
- 'z:check:all-package-version': 'easy-soft-develop check-all-package-version',
147
- 'z:update:all-package-version': 'easy-soft-develop update-all-package-version',
146
+ 'z:check:all-package-version': 'npx easy-soft-develop check-all-package-version',
147
+ 'z:update:all-package-version': 'npx easy-soft-develop update-all-package-version',
148
148
  'postz:update:all-package-version': 'npm run z:install',
149
149
  'z:update:special-package-version': 'node ./develop/assists/package.update.special.version.js',
150
150
  'postz:update:special-package-version': 'npm run z:install',
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;
@@ -1 +1 @@
1
- export function run(): void;
1
+ export function run(): void;