@done-coding/cli-inject 0.5.2 → 0.5.3
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/cli.mjs +1 -1
- package/es/{index-b2a25813.js → index-d1d510a1.js} +28 -28
- package/es/index.mjs +1 -1
- package/package.json +3 -3
- package/types/injectInfo.json.d.ts +1 -1
package/es/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { I as r, S as a } from "./types-a1ee6691.js";
|
|
3
|
-
import { log as n, _get as I, getConfigFileCommonOptions as h, initHandlerCommon as _, _set as b, readConfigFile as k, _curry as A, createSubcommand as
|
|
3
|
+
import { log as n, _get as I, getConfigFileCommonOptions as h, initHandlerCommon as _, _set as b, readConfigFile as k, _curry as A, createSubcommand as N, createMainCommand as w } from "@done-coding/cli-utils";
|
|
4
4
|
import F from "node:path";
|
|
5
5
|
import m from "node:fs";
|
|
6
6
|
const G = ({
|
|
@@ -32,7 +32,7 @@ const G = ({
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, D = {
|
|
36
36
|
sourceFilePath: "./package.json",
|
|
37
37
|
keyConfigMap: {
|
|
38
38
|
name: {
|
|
@@ -46,29 +46,29 @@ const G = ({
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
injectFilePath: "./src/injectInfo.json"
|
|
49
|
-
},
|
|
49
|
+
}, R = {
|
|
50
50
|
name: "@done-coding/cli-inject",
|
|
51
|
-
version: "0.5.
|
|
51
|
+
version: "0.5.3",
|
|
52
52
|
description: "信息(JSON)注入命令行工具",
|
|
53
53
|
cliConfig: {
|
|
54
54
|
namespaceDir: ".done-coding",
|
|
55
55
|
moduleName: "inject"
|
|
56
56
|
}
|
|
57
57
|
}, {
|
|
58
|
-
cliConfig: { namespaceDir:
|
|
59
|
-
} = R,
|
|
58
|
+
cliConfig: { namespaceDir: M, moduleName: x }
|
|
59
|
+
} = R, H = `./${M}/${x}`, T = `${H}.json`, L = () => h({
|
|
60
60
|
configPathDefault: T
|
|
61
|
-
}),
|
|
61
|
+
}), J = async (e) => _(D, e, {
|
|
62
62
|
onFileGenerated: () => {
|
|
63
63
|
n.info("文件生成成功");
|
|
64
64
|
}
|
|
65
|
-
}),
|
|
65
|
+
}), U = () => ({
|
|
66
66
|
...h({
|
|
67
67
|
configPathDefault: T
|
|
68
68
|
})
|
|
69
|
-
}),
|
|
69
|
+
}), V = async ({
|
|
70
70
|
rootDir: e = process.cwd(),
|
|
71
|
-
config: o =
|
|
71
|
+
config: o = D,
|
|
72
72
|
keyConfigMap: t = {}
|
|
73
73
|
} = {}) => {
|
|
74
74
|
const {
|
|
@@ -98,51 +98,51 @@ const G = ({
|
|
|
98
98
|
} else
|
|
99
99
|
n.stage("开始注入文件");
|
|
100
100
|
m.writeFileSync(u, y), n.success(`文件注入成功: ${u}`), n.info(y);
|
|
101
|
-
},
|
|
101
|
+
}, W = async (e) => {
|
|
102
102
|
const o = await k(e);
|
|
103
103
|
if (!o)
|
|
104
104
|
return n.error("配置文件为空"), process.exit(1);
|
|
105
105
|
const { rootDir: t } = e;
|
|
106
|
-
await
|
|
107
|
-
}, v = async (e, o) => e === a.INIT ?
|
|
108
|
-
version:
|
|
109
|
-
description:
|
|
106
|
+
await V({ rootDir: t, config: o });
|
|
107
|
+
}, v = async (e, o) => e === a.INIT ? J(o) : e === a.GENERATE ? W(o) : (n.error(`无效的命令: ${e}`), process.exit(1)), {
|
|
108
|
+
version: X,
|
|
109
|
+
description: K,
|
|
110
110
|
cliConfig: { moduleName: j }
|
|
111
|
-
} = R,
|
|
111
|
+
} = R, q = {
|
|
112
112
|
command: a.INIT,
|
|
113
113
|
describe: "初始化提取配置文件",
|
|
114
|
-
options:
|
|
114
|
+
options: L(),
|
|
115
115
|
handler: A(v)(
|
|
116
116
|
a.INIT
|
|
117
117
|
)
|
|
118
|
-
},
|
|
118
|
+
}, z = {
|
|
119
119
|
command: a.GENERATE,
|
|
120
120
|
describe: "提取信息",
|
|
121
|
-
options:
|
|
121
|
+
options: U(),
|
|
122
122
|
handler: A(v)(
|
|
123
123
|
a.GENERATE
|
|
124
124
|
)
|
|
125
125
|
}, O = {
|
|
126
|
-
describe:
|
|
127
|
-
version:
|
|
128
|
-
subcommands: [
|
|
129
|
-
|
|
126
|
+
describe: K,
|
|
127
|
+
version: X,
|
|
128
|
+
subcommands: [q, z].map(
|
|
129
|
+
N
|
|
130
130
|
),
|
|
131
131
|
demandCommandCount: 1
|
|
132
132
|
}, S = (e = !1) => {
|
|
133
133
|
const o = e ? j : void 0, t = `$0${e ? ` ${j}` : ""} <command> [options]`;
|
|
134
134
|
return { command: o, usage: t };
|
|
135
|
-
},
|
|
135
|
+
}, ee = async () => w({
|
|
136
136
|
...O,
|
|
137
137
|
...S()
|
|
138
|
-
}),
|
|
138
|
+
}), ne = () => N({
|
|
139
139
|
...O,
|
|
140
140
|
...S(!0)
|
|
141
141
|
});
|
|
142
142
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
ne as a,
|
|
144
|
+
ee as c,
|
|
145
|
+
V as g,
|
|
146
146
|
v as h,
|
|
147
147
|
G as k
|
|
148
148
|
};
|
package/es/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as r, g as s, h as t, k as i } from "./index-
|
|
2
|
+
import { a as r, g as s, h as t, k as i } from "./index-d1d510a1.js";
|
|
3
3
|
import { I as u, S as c } from "./types-a1ee6691.js";
|
|
4
4
|
import "@done-coding/cli-utils";
|
|
5
5
|
import "node:path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-inject",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "信息(JSON)注入命令行工具",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"node": ">=18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@done-coding/cli-utils": "^0.3.
|
|
65
|
+
"@done-coding/cli-utils": "^0.3.3"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3caf888c1978970b95d95219ac63d0a3ed2b2912"
|
|
68
68
|
}
|