create-done-coding 0.4.3 → 0.4.6
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/es/injectInfo.json.mjs +6 -2
- package/es/main.mjs +16 -16
- package/package.json +7 -3
- package/types/handler.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/injectInfo.json.d.ts +6 -2
package/es/injectInfo.json.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const e = {
|
|
3
|
+
version: "0.4.6",
|
|
3
4
|
name: "create-done-coding",
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
description: "项目创建命令行工具",
|
|
6
|
+
cliConfig: {
|
|
7
|
+
namespaceDir: ".done-coding",
|
|
8
|
+
commandName: "create"
|
|
9
|
+
}
|
|
6
10
|
};
|
|
7
11
|
export {
|
|
8
12
|
e as default
|
package/es/main.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import c from "yargs";
|
|
3
3
|
import { hideBin as m } from "yargs/helpers";
|
|
4
|
-
import { handler as
|
|
5
|
-
import
|
|
6
|
-
import { projectNameForm as l, getTemplateChoices as p, getTemplateForm as d, saveGitHistoryForm as g, shallowCloneForm as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
4
|
+
import { handler as t } from "./handler.mjs";
|
|
5
|
+
import a from "chalk";
|
|
6
|
+
import { projectNameForm as l, getTemplateChoices as p, getTemplateForm as d, saveGitHistoryForm as g, shallowCloneForm as f } from "./utils/question.mjs";
|
|
7
|
+
import s from "./injectInfo.json.mjs";
|
|
8
|
+
const h = async () => ({
|
|
9
9
|
projectName: {
|
|
10
10
|
type: "string",
|
|
11
11
|
alias: "p",
|
|
@@ -25,22 +25,22 @@ const f = async () => ({
|
|
|
25
25
|
shallowClone: {
|
|
26
26
|
type: "boolean",
|
|
27
27
|
alias: "c",
|
|
28
|
-
describe:
|
|
28
|
+
describe: f.message,
|
|
29
29
|
default: !0
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
32
|
-
console.log(e ?
|
|
33
|
-
}, b =
|
|
34
|
-
const
|
|
35
|
-
return e.strict().usage(o).help("help").version(
|
|
36
|
-
}, C = (e) =>
|
|
37
|
-
command:
|
|
31
|
+
}), i = s.cliConfig.commandName, y = (e, o) => {
|
|
32
|
+
console.log(e ? a.red(e) : a.red(o.message)), process.exit(1);
|
|
33
|
+
}, b = s.description, u = `Usage: $0 ${i} [options]`, v = "Usage: $0 [options]", n = async (e, o) => {
|
|
34
|
+
const r = await h();
|
|
35
|
+
return e.strict().usage(o).help("help").version(s.version).alias("v", "version").alias("h", "help").options(r).fail(y).argv;
|
|
36
|
+
}, C = (e) => n(e, u), $ = {
|
|
37
|
+
command: i,
|
|
38
38
|
describe: b,
|
|
39
39
|
builder: C,
|
|
40
|
-
handler:
|
|
40
|
+
handler: t
|
|
41
41
|
}, x = async () => {
|
|
42
|
-
const e = c(m(process.argv)), o = await
|
|
43
|
-
return
|
|
42
|
+
const e = c(m(process.argv)), o = await n(e, v);
|
|
43
|
+
return t(o);
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
46
|
$ as command,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-done-coding",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "项目创建命令行工具",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -30,11 +30,15 @@
|
|
|
30
30
|
"url": "https://gitee.com/justsosu/done-coding-cli.git",
|
|
31
31
|
"directory": "packages/create"
|
|
32
32
|
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"registry": "https://registry.npmjs.org/"
|
|
36
|
+
},
|
|
33
37
|
"author": "JustSoSu",
|
|
34
38
|
"license": "MIT",
|
|
35
39
|
"sideEffects": false,
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@done-coding/cli-inject": "^0.
|
|
41
|
+
"@done-coding/cli-inject": "^0.3.0",
|
|
38
42
|
"@types/node": "^20.0.0",
|
|
39
43
|
"@types/prompts": "^2.4.6",
|
|
40
44
|
"@types/yargs": "^17.0.28",
|
|
@@ -51,5 +55,5 @@
|
|
|
51
55
|
"prompts": "^2.4.2",
|
|
52
56
|
"yargs": "^17.7.2"
|
|
53
57
|
},
|
|
54
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "0e9dcf532b8abf7608d07f738348538fa9a9864d"
|
|
55
59
|
}
|
package/types/handler.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Options } from './utils';
|
|
2
2
|
import type { ArgumentsCamelCase } from "yargs";
|
|
3
|
-
export declare const handler: (argv: ArgumentsCamelCase<Options>) => Promise<undefined>;
|
|
3
|
+
export declare const handler: (argv: ArgumentsCamelCase<Options> | Options) => Promise<undefined>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
"version": "0.4.6",
|
|
2
3
|
"name": "create-done-coding",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
4
|
+
"description": "项目创建命令行工具",
|
|
5
|
+
"cliConfig": {
|
|
6
|
+
"namespaceDir": ".done-coding",
|
|
7
|
+
"commandName": "create"
|
|
8
|
+
}
|
|
5
9
|
};
|
|
6
10
|
|
|
7
11
|
export default _default;
|