@soybeanjs/cli 0.1.4 → 0.1.5
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/dist/index.d.ts +1 -0
- package/dist/index.js +44 -15
- package/dist/index.mjs +44 -15
- package/package.json +13 -14
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var import_kolorist2 = require("kolorist");
|
|
|
26
26
|
// package.json
|
|
27
27
|
var package_default = {
|
|
28
28
|
name: "@soybeanjs/cli",
|
|
29
|
-
version: "0.1.
|
|
29
|
+
version: "0.1.4",
|
|
30
30
|
description: "SoybeanJS's command lint tools",
|
|
31
31
|
author: {
|
|
32
32
|
name: "Soybean",
|
|
@@ -42,7 +42,8 @@ var package_default = {
|
|
|
42
42
|
url: "https://github.com/honghuangdc/soybean-cli/issues"
|
|
43
43
|
},
|
|
44
44
|
bin: {
|
|
45
|
-
soybean: "dist/index.
|
|
45
|
+
soybean: "dist/index.mjs",
|
|
46
|
+
soy: "dist/index.mjs"
|
|
46
47
|
},
|
|
47
48
|
files: [
|
|
48
49
|
"dist"
|
|
@@ -50,36 +51,34 @@ var package_default = {
|
|
|
50
51
|
scripts: {
|
|
51
52
|
build: "tsup",
|
|
52
53
|
lint: "eslint . --fix",
|
|
53
|
-
commit: "
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"update-pkg": "ncu --deep -u",
|
|
54
|
+
commit: "soy git-commit",
|
|
55
|
+
cleanup: "soy cleanup",
|
|
56
|
+
"update-pkg": "soy update-pkg",
|
|
57
57
|
"update-version": "bumpp package.json",
|
|
58
58
|
"publish-pkg": "pnpm -r publish --access public",
|
|
59
|
-
release: "pnpm update-version && pnpm publish-pkg"
|
|
60
|
-
"sync-pkg": "esno ./scripts/sync.ts"
|
|
59
|
+
release: "pnpm update-version && pnpm publish-pkg"
|
|
61
60
|
},
|
|
62
61
|
dependencies: {
|
|
63
62
|
commander: "^9.4.1",
|
|
64
63
|
execa: "5.1.1",
|
|
65
64
|
kolorist: "^1.6.0",
|
|
66
65
|
minimist: "^1.2.7",
|
|
67
|
-
|
|
66
|
+
"npm-check-updates": "^16.6.2",
|
|
67
|
+
prompts: "^2.4.2",
|
|
68
|
+
rimraf: "^3.0.2",
|
|
69
|
+
zx: "^7.1.1"
|
|
68
70
|
},
|
|
69
71
|
devDependencies: {
|
|
70
72
|
"@soybeanjs/cli": "workspace:*",
|
|
71
73
|
"@types/prompts": "^2.4.2",
|
|
72
74
|
bumpp: "^8.2.1",
|
|
73
|
-
eslint: "^8.
|
|
75
|
+
eslint: "^8.31.0",
|
|
74
76
|
"eslint-config-soybeanjs": "0.2.1",
|
|
75
77
|
esno: "^0.16.3",
|
|
76
78
|
"lint-staged": "^13.1.0",
|
|
77
|
-
"npm-check-updates": "^16.5.5",
|
|
78
|
-
rimraf: "^3.0.2",
|
|
79
79
|
"simple-git-hooks": "^2.8.1",
|
|
80
80
|
tsup: "^6.5.0",
|
|
81
|
-
typescript: "^4.9.4"
|
|
82
|
-
zx: "^7.1.1"
|
|
81
|
+
typescript: "^4.9.4"
|
|
83
82
|
},
|
|
84
83
|
"simple-git-hooks": {
|
|
85
84
|
"commit-msg": "pnpm soybean git-commit-verify",
|
|
@@ -176,6 +175,27 @@ function verifyGitCommit() {
|
|
|
176
175
|
}
|
|
177
176
|
}
|
|
178
177
|
|
|
178
|
+
// src/scripts/cleanup.ts
|
|
179
|
+
var import_zx = require("zx");
|
|
180
|
+
async function cleanup() {
|
|
181
|
+
await import_zx.$`pnpm rimraf node_modules ./**/node_modules dist ./**/dist pnpm-lock.yaml ./**/pnpm-lock.yaml`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/scripts/git-hooks.ts
|
|
185
|
+
var import_zx2 = require("zx");
|
|
186
|
+
async function initSimpleGitHooks() {
|
|
187
|
+
await import_zx2.$`pnpm rimraf .husky`;
|
|
188
|
+
await import_zx2.$`git config core.hooksPath .git/hooks/`;
|
|
189
|
+
await import_zx2.$`rimraf .git/hooks`;
|
|
190
|
+
await import_zx2.$`pnpm simple-git-hooks`;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/scripts/update-pkg.ts
|
|
194
|
+
var import_zx3 = require("zx");
|
|
195
|
+
async function updatePkg() {
|
|
196
|
+
await import_zx3.$`ncu --deep -u`;
|
|
197
|
+
}
|
|
198
|
+
|
|
179
199
|
// src/index.ts
|
|
180
200
|
import_commander.program.command("git-commit").description("\u751F\u6210\u7B26\u5408 Angular \u89C4\u8303\u7684 git commit").action(() => {
|
|
181
201
|
gitCommit();
|
|
@@ -183,5 +203,14 @@ import_commander.program.command("git-commit").description("\u751F\u6210\u7B26\u
|
|
|
183
203
|
import_commander.program.command("git-commit-verify").description("\u6821\u9A8Cgit\u7684commit\u662F\u5426\u7B26\u5408 Angular \u89C4\u8303").action(() => {
|
|
184
204
|
verifyGitCommit();
|
|
185
205
|
});
|
|
186
|
-
import_commander.program.
|
|
206
|
+
import_commander.program.command("cleanup").description("\u6E05\u7A7A\u4F9D\u8D56\u548C\u6784\u5EFA\u4EA7\u7269").action(() => {
|
|
207
|
+
cleanup();
|
|
208
|
+
});
|
|
209
|
+
import_commander.program.command("init-git-hooks").description("\u521D\u59CB\u5316git\u94A9\u5B50").action(() => {
|
|
210
|
+
initSimpleGitHooks();
|
|
211
|
+
});
|
|
212
|
+
import_commander.program.command("update-pkg").description("\u5347\u7EA7\u4F9D\u8D56").action(() => {
|
|
213
|
+
updatePkg();
|
|
214
|
+
});
|
|
215
|
+
import_commander.program.version(package_default.version).description((0, import_kolorist2.blue)("soybean alias soy\n\nhttps://github.com/soybeanjs/cli"));
|
|
187
216
|
import_commander.program.parse(process.argv);
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { blue } from "kolorist";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@soybeanjs/cli",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.4",
|
|
11
11
|
description: "SoybeanJS's command lint tools",
|
|
12
12
|
author: {
|
|
13
13
|
name: "Soybean",
|
|
@@ -23,7 +23,8 @@ var package_default = {
|
|
|
23
23
|
url: "https://github.com/honghuangdc/soybean-cli/issues"
|
|
24
24
|
},
|
|
25
25
|
bin: {
|
|
26
|
-
soybean: "dist/index.
|
|
26
|
+
soybean: "dist/index.mjs",
|
|
27
|
+
soy: "dist/index.mjs"
|
|
27
28
|
},
|
|
28
29
|
files: [
|
|
29
30
|
"dist"
|
|
@@ -31,36 +32,34 @@ var package_default = {
|
|
|
31
32
|
scripts: {
|
|
32
33
|
build: "tsup",
|
|
33
34
|
lint: "eslint . --fix",
|
|
34
|
-
commit: "
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"update-pkg": "ncu --deep -u",
|
|
35
|
+
commit: "soy git-commit",
|
|
36
|
+
cleanup: "soy cleanup",
|
|
37
|
+
"update-pkg": "soy update-pkg",
|
|
38
38
|
"update-version": "bumpp package.json",
|
|
39
39
|
"publish-pkg": "pnpm -r publish --access public",
|
|
40
|
-
release: "pnpm update-version && pnpm publish-pkg"
|
|
41
|
-
"sync-pkg": "esno ./scripts/sync.ts"
|
|
40
|
+
release: "pnpm update-version && pnpm publish-pkg"
|
|
42
41
|
},
|
|
43
42
|
dependencies: {
|
|
44
43
|
commander: "^9.4.1",
|
|
45
44
|
execa: "5.1.1",
|
|
46
45
|
kolorist: "^1.6.0",
|
|
47
46
|
minimist: "^1.2.7",
|
|
48
|
-
|
|
47
|
+
"npm-check-updates": "^16.6.2",
|
|
48
|
+
prompts: "^2.4.2",
|
|
49
|
+
rimraf: "^3.0.2",
|
|
50
|
+
zx: "^7.1.1"
|
|
49
51
|
},
|
|
50
52
|
devDependencies: {
|
|
51
53
|
"@soybeanjs/cli": "workspace:*",
|
|
52
54
|
"@types/prompts": "^2.4.2",
|
|
53
55
|
bumpp: "^8.2.1",
|
|
54
|
-
eslint: "^8.
|
|
56
|
+
eslint: "^8.31.0",
|
|
55
57
|
"eslint-config-soybeanjs": "0.2.1",
|
|
56
58
|
esno: "^0.16.3",
|
|
57
59
|
"lint-staged": "^13.1.0",
|
|
58
|
-
"npm-check-updates": "^16.5.5",
|
|
59
|
-
rimraf: "^3.0.2",
|
|
60
60
|
"simple-git-hooks": "^2.8.1",
|
|
61
61
|
tsup: "^6.5.0",
|
|
62
|
-
typescript: "^4.9.4"
|
|
63
|
-
zx: "^7.1.1"
|
|
62
|
+
typescript: "^4.9.4"
|
|
64
63
|
},
|
|
65
64
|
"simple-git-hooks": {
|
|
66
65
|
"commit-msg": "pnpm soybean git-commit-verify",
|
|
@@ -157,6 +156,27 @@ function verifyGitCommit() {
|
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
|
|
159
|
+
// src/scripts/cleanup.ts
|
|
160
|
+
import { $ } from "zx";
|
|
161
|
+
async function cleanup() {
|
|
162
|
+
await $`pnpm rimraf node_modules ./**/node_modules dist ./**/dist pnpm-lock.yaml ./**/pnpm-lock.yaml`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// src/scripts/git-hooks.ts
|
|
166
|
+
import { $ as $2 } from "zx";
|
|
167
|
+
async function initSimpleGitHooks() {
|
|
168
|
+
await $2`pnpm rimraf .husky`;
|
|
169
|
+
await $2`git config core.hooksPath .git/hooks/`;
|
|
170
|
+
await $2`rimraf .git/hooks`;
|
|
171
|
+
await $2`pnpm simple-git-hooks`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// src/scripts/update-pkg.ts
|
|
175
|
+
import { $ as $3 } from "zx";
|
|
176
|
+
async function updatePkg() {
|
|
177
|
+
await $3`ncu --deep -u`;
|
|
178
|
+
}
|
|
179
|
+
|
|
160
180
|
// src/index.ts
|
|
161
181
|
program.command("git-commit").description("\u751F\u6210\u7B26\u5408 Angular \u89C4\u8303\u7684 git commit").action(() => {
|
|
162
182
|
gitCommit();
|
|
@@ -164,5 +184,14 @@ program.command("git-commit").description("\u751F\u6210\u7B26\u5408 Angular \u89
|
|
|
164
184
|
program.command("git-commit-verify").description("\u6821\u9A8Cgit\u7684commit\u662F\u5426\u7B26\u5408 Angular \u89C4\u8303").action(() => {
|
|
165
185
|
verifyGitCommit();
|
|
166
186
|
});
|
|
167
|
-
program.
|
|
187
|
+
program.command("cleanup").description("\u6E05\u7A7A\u4F9D\u8D56\u548C\u6784\u5EFA\u4EA7\u7269").action(() => {
|
|
188
|
+
cleanup();
|
|
189
|
+
});
|
|
190
|
+
program.command("init-git-hooks").description("\u521D\u59CB\u5316git\u94A9\u5B50").action(() => {
|
|
191
|
+
initSimpleGitHooks();
|
|
192
|
+
});
|
|
193
|
+
program.command("update-pkg").description("\u5347\u7EA7\u4F9D\u8D56").action(() => {
|
|
194
|
+
updatePkg();
|
|
195
|
+
});
|
|
196
|
+
program.version(package_default.version).description(blue("soybean alias soy\n\nhttps://github.com/soybeanjs/cli"));
|
|
168
197
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soybeanjs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "SoybeanJS's command lint tools",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Soybean",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"url": "https://github.com/honghuangdc/soybean-cli/issues"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"soybean": "dist/index.
|
|
19
|
+
"soybean": "dist/index.mjs",
|
|
20
|
+
"soy": "dist/index.mjs"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist"
|
|
@@ -26,22 +27,22 @@
|
|
|
26
27
|
"execa": "5.1.1",
|
|
27
28
|
"kolorist": "^1.6.0",
|
|
28
29
|
"minimist": "^1.2.7",
|
|
29
|
-
"
|
|
30
|
+
"npm-check-updates": "^16.6.2",
|
|
31
|
+
"prompts": "^2.4.2",
|
|
32
|
+
"rimraf": "^3.0.2",
|
|
33
|
+
"zx": "^7.1.1"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
36
|
"@types/prompts": "^2.4.2",
|
|
33
37
|
"bumpp": "^8.2.1",
|
|
34
|
-
"eslint": "^8.
|
|
38
|
+
"eslint": "^8.31.0",
|
|
35
39
|
"eslint-config-soybeanjs": "0.2.1",
|
|
36
40
|
"esno": "^0.16.3",
|
|
37
41
|
"lint-staged": "^13.1.0",
|
|
38
|
-
"npm-check-updates": "^16.5.5",
|
|
39
|
-
"rimraf": "^3.0.2",
|
|
40
42
|
"simple-git-hooks": "^2.8.1",
|
|
41
43
|
"tsup": "^6.5.0",
|
|
42
44
|
"typescript": "^4.9.4",
|
|
43
|
-
"
|
|
44
|
-
"@soybeanjs/cli": "0.1.4"
|
|
45
|
+
"@soybeanjs/cli": "0.1.5"
|
|
45
46
|
},
|
|
46
47
|
"simple-git-hooks": {
|
|
47
48
|
"commit-msg": "pnpm soybean git-commit-verify",
|
|
@@ -58,13 +59,11 @@
|
|
|
58
59
|
"scripts": {
|
|
59
60
|
"build": "tsup",
|
|
60
61
|
"lint": "eslint . --fix",
|
|
61
|
-
"commit": "
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"update-pkg": "ncu --deep -u",
|
|
62
|
+
"commit": "soy git-commit",
|
|
63
|
+
"cleanup": "soy cleanup",
|
|
64
|
+
"update-pkg": "soy update-pkg",
|
|
65
65
|
"update-version": "bumpp package.json",
|
|
66
66
|
"publish-pkg": "pnpm -r publish --access public",
|
|
67
|
-
"release": "pnpm update-version && pnpm publish-pkg"
|
|
68
|
-
"sync-pkg": "esno ./scripts/sync.ts"
|
|
67
|
+
"release": "pnpm update-version && pnpm publish-pkg"
|
|
69
68
|
}
|
|
70
69
|
}
|