@done-coding/cli-extract 0.1.6-alpha.0 → 0.1.8-alpha.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-a262eb93.js";
3
- import "./types-a1ee6691-78bcc10f.js";
2
+ import { c as m } from "./index-9abc1104.js";
4
3
  import "@done-coding/cli-utils";
4
+ import "./types-a1ee6691-9629699d.js";
5
5
  import "node:path";
6
6
  import "node:fs";
7
7
  import "@done-coding/cli-template";
package/es/helpers.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { E as e, a as t } from "./types-a1ee6691-78bcc10f.js";
2
+ import { E as e, a as n } from "./types-a1ee6691-9629699d.js";
3
3
  import "@done-coding/cli-utils";
4
4
  import "node:path";
5
5
  import "node:fs";
6
- import { OutputModeEnum as n } from "@done-coding/cli-template";
6
+ import { OutputModeEnum as t } from "@done-coding/cli-template";
7
7
  const i = {
8
8
  name: "${name}",
9
9
  version: "${version}",
@@ -12,36 +12,39 @@ const i = {
12
12
  namespaceDir: "${cliConfig.namespaceDir}",
13
13
  moduleName: "${cliConfig.moduleName}"
14
14
  }
15
- }, m = {
15
+ }, u = {
16
16
  extractInput: {
17
17
  "./package.json": {
18
18
  name: {
19
19
  type: e.JSON_INJECT,
20
20
  inject: {
21
- type: t.READ
21
+ type: n.READ
22
22
  }
23
23
  },
24
24
  description: {
25
25
  type: e.JSON_INJECT,
26
26
  inject: {
27
- type: t.READ
27
+ type: n.READ
28
28
  }
29
29
  },
30
30
  version: {
31
31
  type: e.JSON_INJECT,
32
32
  inject: {
33
- type: t.READ
33
+ type: n.READ
34
34
  }
35
35
  },
36
36
  "cliConfig.namespaceDir": {
37
37
  type: e.JSON_INJECT,
38
- inject: ".done-coding"
38
+ inject: {
39
+ type: n.FIXED,
40
+ value: ".done-coding"
41
+ }
39
42
  },
40
43
  "cliConfig.moduleName": {
41
44
  type: e.JSON_INJECT,
42
45
  inject: {
43
46
  sourceKey: "name",
44
- type: t.REG,
47
+ type: n.REG,
45
48
  pattern: /@done-coding\/cli-([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)/.source,
46
49
  replaceValue: "$1"
47
50
  }
@@ -51,13 +54,74 @@ const i = {
51
54
  extractOutput: {
52
55
  list: [
53
56
  {
54
- mode: n.OVERWRITE,
57
+ mode: t.OVERWRITE,
55
58
  inputData: JSON.stringify(i, null, 2),
56
59
  output: "./src/extractInfo.json"
57
60
  }
58
61
  ]
59
62
  }
63
+ }, o = {
64
+ npm: {
65
+ aliasInfo: [
66
+ {
67
+ packageJson: {
68
+ name: "${organizationAbbr}-${moduleName}",
69
+ bin: "${binEntry}",
70
+ scripts: {}
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ }, l = {
76
+ extractInput: {
77
+ "./package.json": {
78
+ name: {
79
+ type: e.JSON_INJECT,
80
+ inject: {
81
+ type: n.READ
82
+ }
83
+ },
84
+ bin: {
85
+ type: e.JSON_INJECT,
86
+ inject: {
87
+ type: n.READ
88
+ }
89
+ },
90
+ organization: {
91
+ type: e.FIXED,
92
+ value: "done-coding"
93
+ },
94
+ /** 组织名缩写 */
95
+ organizationAbbr: {
96
+ type: e.FIXED,
97
+ value: "dc"
98
+ },
99
+ binEntry: {
100
+ type: e.FIXED,
101
+ value: "es/cli.mjs"
102
+ },
103
+ moduleName: {
104
+ type: e.JSON_INJECT,
105
+ inject: {
106
+ sourceKey: "name",
107
+ type: n.REG,
108
+ pattern: /@done-coding\/cli-([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)/.source,
109
+ replaceValue: "$1"
110
+ }
111
+ }
112
+ }
113
+ },
114
+ extractOutput: {
115
+ list: [
116
+ {
117
+ mode: t.OVERWRITE,
118
+ inputData: JSON.stringify(o, null, 2),
119
+ output: "./.done-coding/publish.json"
120
+ }
121
+ ]
122
+ }
60
123
  };
61
124
  export {
62
- m as doneCodingSeriesCliInjectInfo
125
+ l as doneCodingPublishAliasInfo,
126
+ u as doneCodingSeriesCliInjectInfo
63
127
  };
@@ -1,39 +1,41 @@
1
1
  #!/usr/bin/env node
2
- import { a as s, e as m, E as u, S as l } from "./types-a1ee6691-78bcc10f.js";
3
- import { log as r, _get as O, _curry as I, createSubcommand as R, getConfigFileCommonOptions as j, initHandlerCommon as v, readConfigFile as $, _set as H, createMainCommand as V } from "@done-coding/cli-utils";
4
- import D from "node:path";
2
+ import { log as r, _get as O, _curry as D, createSubcommand as R, getConfigFileCommonOptions as j, initHandlerCommon as F, readConfigFile as v, _set as H, createMainCommand as V } from "@done-coding/cli-utils";
3
+ import { a as s, e as m, E as u, S as l } from "./types-a1ee6691-9629699d.js";
4
+ import h from "node:path";
5
5
  import C from "node:fs";
6
6
  import { OutputModeEnum as L, batchCompileHandler as W } from "@done-coding/cli-template";
7
- const h = ({
7
+ const N = ({
8
8
  sourceJson: e,
9
9
  targetKey: n,
10
- keyConfig: t
10
+ keyConfig: o
11
11
  }) => {
12
- let o;
13
- typeof t == "string" ? o = {
12
+ let t;
13
+ typeof o == "string" ? t = {
14
14
  type: s.FIXED,
15
- value: t
16
- } : o = t;
17
- const { type: i = s.READ } = o;
18
- switch (i) {
15
+ value: o
16
+ } : t = o;
17
+ const { type: a = s.READ } = t;
18
+ switch (a) {
19
19
  case s.REG: {
20
- const { sourceKey: a, pattern: f, replaceValue: E, flags: g } = o, p = new RegExp(f, g ?? void 0), c = O(e, a);
21
- return typeof c == "string" ? c.replace(p, E) : (r.warn(
22
- `${c}不是字符串类型,无法使用正则表达式进行替换,此处将直接返回原值`
23
- ), c);
20
+ const { sourceKey: c, pattern: f, replaceValue: E, flags: g } = t, p = new RegExp(f, g ?? void 0), i = O(e, c);
21
+ return typeof i == "string" ? i.replace(p, E) : (r.warn(
22
+ `${i}不是字符串类型,无法使用正则表达式进行替换,此处将直接返回原值`
23
+ ), i);
24
24
  }
25
25
  case s.FIXED: {
26
- const { value: a } = o;
27
- return a;
26
+ const { value: c } = t;
27
+ return c;
28
+ }
29
+ case s.READ: {
30
+ const { sourceKey: c = n } = t;
31
+ return O(e, c);
28
32
  }
29
- case s.READ:
30
- return O(e, n);
31
33
  default: {
32
- r.warn(`未知的配置类型${i}`);
34
+ r.warn(`未知的配置类型${a}`);
33
35
  return;
34
36
  }
35
37
  }
36
- }, U = {
38
+ }, $ = {
37
39
  sourceFilePath: "./package.json",
38
40
  keyConfigMap: {
39
41
  name: {
@@ -47,91 +49,91 @@ const h = ({
47
49
  }
48
50
  },
49
51
  injectFilePath: "./src/injectInfo.json"
50
- }, w = U, x = {
52
+ }, w = {
51
53
  name: "@done-coding/cli-inject",
52
- version: "0.5.6-alpha.0",
54
+ version: "0.5.8-alpha.0",
53
55
  description: "信息(JSON)注入命令行工具",
54
56
  cliConfig: {
55
57
  namespaceDir: ".done-coding",
56
58
  moduleName: "inject"
57
59
  }
58
60
  }, {
59
- cliConfig: { namespaceDir: X, moduleName: K }
60
- } = x, q = `./${X}/${K}`, F = `${q}.json`, z = () => j({
61
- configPathDefault: F
62
- }), B = async (e) => v(w, e, {
61
+ cliConfig: { namespaceDir: U, moduleName: X }
62
+ } = w, K = `./${U}/${X}`, x = `${K}.json`, q = () => j({
63
+ configPathDefault: x
64
+ }), z = async (e) => F($, e, {
63
65
  onFileGenerated: () => {
64
66
  r.info("文件生成成功");
65
67
  }
66
- }), Q = () => ({
68
+ }), B = () => ({
67
69
  ...j({
68
- configPathDefault: F
70
+ configPathDefault: x
69
71
  })
70
- }), Y = async ({
72
+ }), Q = async ({
71
73
  rootDir: e = process.cwd(),
72
- config: n = w,
73
- keyConfigMap: t = {}
74
+ config: n = $,
75
+ keyConfigMap: o = {}
74
76
  } = {}) => {
75
77
  const {
76
- sourceFilePath: o,
77
- keyConfigMap: i,
78
- injectFilePath: a
78
+ sourceFilePath: t,
79
+ keyConfigMap: a,
80
+ injectFilePath: c
79
81
  } = n, f = {
80
- ...i,
81
- ...t
82
+ ...a,
83
+ ...o
82
84
  };
83
- if (!o.endsWith(".json"))
85
+ if (!t.endsWith(".json"))
84
86
  return r.error("源文件必须是json"), process.exit(1);
85
- if (!a.endsWith(".json"))
87
+ if (!c.endsWith(".json"))
86
88
  return r.error("注入文件必须是json"), process.exit(1);
87
- const E = D.resolve(e, o), g = C.readFileSync(E, "utf-8"), p = JSON.parse(g), c = Object.entries(f).reduce(
88
- (N, [T, P]) => {
89
- const M = h({ sourceJson: p, targetKey: T, keyConfig: P });
90
- return H(N, T, M), N;
89
+ const E = h.resolve(e, t), g = C.readFileSync(E, "utf-8"), p = JSON.parse(g), i = Object.entries(f).reduce(
90
+ (I, [T, P]) => {
91
+ const M = N({ sourceJson: p, targetKey: T, keyConfig: P });
92
+ return H(I, T, M), I;
91
93
  },
92
94
  {}
93
- ), d = D.resolve(e, a), y = JSON.stringify(c, null, 2);
95
+ ), d = h.resolve(e, c), y = JSON.stringify(i, null, 2);
94
96
  if (C.existsSync(d)) {
95
- const N = C.readFileSync(d, "utf-8");
96
- if (y === N)
97
- return r.skip("注入文件已存在且内容相同,无需重复注入"), c;
97
+ const I = C.readFileSync(d, "utf-8");
98
+ if (y === I)
99
+ return r.skip("注入文件已存在且内容相同,无需重复注入"), i;
98
100
  r.stage("文件内容变化,开始覆盖注入文件");
99
101
  } else
100
102
  r.stage("开始注入文件");
101
103
  C.writeFileSync(d, y), r.success(`文件注入成功: ${d}`), r.info(y);
102
- }, Z = async (e) => {
103
- const n = await $(e);
104
+ }, Y = async (e) => {
105
+ const n = await v(e);
104
106
  if (!n)
105
107
  return r.error("配置文件为空"), process.exit(1);
106
- const { rootDir: t } = e;
107
- await Y({ rootDir: t, config: n });
108
- }, J = async (e, n) => e === m.INIT ? B(n) : e === m.GENERATE ? Z(n) : (r.error(`无效的命令: ${e}`), process.exit(1)), {
109
- version: ee,
110
- description: ne,
111
- cliConfig: { moduleName: Oe }
112
- } = x, te = {
108
+ const { rootDir: o } = e;
109
+ await Q({ rootDir: o, config: n });
110
+ }, J = async (e, n) => e === m.INIT ? z(n) : e === m.GENERATE ? Y(n) : (r.error(`无效的命令: ${e}`), process.exit(1)), {
111
+ version: Z,
112
+ description: ee,
113
+ cliConfig: { moduleName: Te }
114
+ } = w, ne = {
113
115
  command: m.INIT,
114
116
  describe: "初始化提取配置文件",
115
- options: z(),
116
- handler: I(J)(
117
+ options: q(),
118
+ handler: D(J)(
117
119
  m.INIT
118
120
  )
119
- }, oe = {
121
+ }, te = {
120
122
  command: m.GENERATE,
121
123
  describe: "提取信息",
122
- options: Q(),
123
- handler: I(J)(
124
+ options: B(),
125
+ handler: D(J)(
124
126
  m.GENERATE
125
127
  )
126
128
  };
127
- [te, oe].map(
129
+ [ne, te].map(
128
130
  R
129
131
  );
130
- const re = {
132
+ const oe = {
131
133
  name: "${name}",
132
134
  version: "${version}",
133
135
  description: "${description}"
134
- }, se = {
136
+ }, re = {
135
137
  extractInput: {
136
138
  "./package.json": {
137
139
  name: {
@@ -170,91 +172,100 @@ const re = {
170
172
  list: [
171
173
  {
172
174
  mode: L.OVERWRITE,
173
- inputData: JSON.stringify(re, null, 2),
175
+ inputData: JSON.stringify(oe, null, 2),
174
176
  output: "./src/extractInfo.json"
175
177
  }
176
178
  ]
177
179
  }
178
180
  }, S = {
179
181
  name: "@done-coding/cli-extract",
180
- version: "0.1.6-alpha.0",
182
+ version: "0.1.8-alpha.0",
181
183
  description: "信息提取命令行工具",
182
184
  cliConfig: {
183
185
  namespaceDir: ".done-coding",
184
186
  moduleName: "extract"
185
187
  }
186
188
  }, {
187
- cliConfig: { namespaceDir: ce, moduleName: ie }
188
- } = S, ae = `./${ce}/${ie}`, b = `${ae}.json5`, ue = () => j({
189
+ cliConfig: { namespaceDir: se, moduleName: ce }
190
+ } = S, ie = `./${se}/${ce}`, b = `${ie}.json5`, ae = () => j({
189
191
  configPathDefault: b
190
- }), pe = async (e) => v(se, e, {
192
+ }), ue = async (e) => F(re, e, {
191
193
  onFileGenerated: () => {
192
194
  r.info("文件生成成功");
193
195
  }
194
- }), de = ({
196
+ }), pe = ({
195
197
  input: e,
196
198
  rootDir: n
197
199
  }) => {
198
- const t = D.resolve(n, e), o = C.readFileSync(t, "utf-8");
199
- return e.endsWith(".json") || e.endsWith(".json5") ? JSON.parse(o) : o;
200
- }, me = (e) => typeof e == "object" && !!e, le = ({
200
+ const o = h.resolve(n, e), t = C.readFileSync(o, "utf-8");
201
+ return e.endsWith(".json") || e.endsWith(".json5") ? JSON.parse(t) : t;
202
+ }, de = (e) => typeof e == "object" && !!e, me = ({
201
203
  content: e,
202
204
  targetKey: n,
203
- keyConfig: t
205
+ keyConfig: o
204
206
  }) => {
205
- const { type: o, ...i } = t;
206
- switch (o) {
207
+ const { type: t, ...a } = o;
208
+ switch (t) {
207
209
  case u.REG: {
208
210
  if (typeof e != "string")
209
- throw new Error(`${o} 类型的keyConfig需要content为字符串`);
210
- return h({
211
+ throw new Error(`${t} 类型的keyConfig需要content为字符串`);
212
+ return N({
211
213
  sourceJson: {
212
214
  [n]: e
213
215
  },
214
216
  targetKey: n,
215
217
  keyConfig: {
216
- ...i,
218
+ ...a,
217
219
  type: s.REG,
218
220
  sourceKey: n
219
221
  }
220
222
  });
221
223
  }
222
224
  case u.JSON_INJECT: {
223
- if (!me(e))
224
- throw new Error(`${o} 类型的keyConfig需要content为json`);
225
- return h({
225
+ if (!de(e))
226
+ throw new Error(`${t} 类型的keyConfig需要content为json`);
227
+ return N({
226
228
  sourceJson: e,
227
229
  targetKey: n,
228
- keyConfig: t.inject
230
+ keyConfig: o.inject
229
231
  });
230
232
  }
233
+ case u.FIXED:
234
+ return N({
235
+ sourceJson: {},
236
+ targetKey: n,
237
+ keyConfig: {
238
+ ...a,
239
+ type: s.FIXED
240
+ }
241
+ });
231
242
  default:
232
- throw new Error(`不支持的类型${o}`);
243
+ throw new Error(`不支持的类型${t}`);
233
244
  }
234
- }, fe = () => ({
245
+ }, le = () => ({
235
246
  ...j({
236
247
  configPathDefault: b
237
248
  })
238
- }), Ee = async ({
249
+ }), fe = async ({
239
250
  rootDir: e = process.cwd(),
240
251
  config: n
241
252
  }) => {
242
- const { extractInput: t, extractOutput: o } = n, i = Object.entries(t).reduce(
243
- (a, [f, E]) => {
244
- const g = de({
253
+ const { extractInput: o, extractOutput: t } = n, a = Object.entries(o).reduce(
254
+ (c, [f, E]) => {
255
+ const g = pe({
245
256
  rootDir: e,
246
257
  input: f
247
258
  });
248
259
  return Object.entries(E).reduce(
249
- (p, [c, d]) => {
250
- const y = le({
260
+ (p, [i, d]) => {
261
+ const y = me({
251
262
  content: g,
252
- targetKey: c,
263
+ targetKey: i,
253
264
  keyConfig: d
254
265
  });
255
- return p[c] = y, p;
266
+ return p[i] = y, p;
256
267
  },
257
- a
268
+ c
258
269
  );
259
270
  },
260
271
  {}
@@ -262,53 +273,54 @@ const re = {
262
273
  await W(
263
274
  {
264
275
  rootDir: e,
265
- extraEnvData: i
276
+ extraEnvData: a
266
277
  },
267
- o
278
+ t
268
279
  );
269
- }, ge = async (e) => {
270
- const n = await $(e);
280
+ }, Ee = async (e) => {
281
+ const n = await v(e);
271
282
  if (!n)
272
283
  return r.error("配置文件为空"), process.exit(1);
273
- const { rootDir: t } = e;
274
- await Ee({ rootDir: t, config: n });
275
- }, G = async (e, n) => e === l.INIT ? pe(n) : e === l.GENERATE ? ge(n) : (r.error(`无效的命令: ${e}`), process.exit(1)), {
276
- version: ye,
277
- description: Ce,
284
+ const { rootDir: o } = e;
285
+ await fe({ rootDir: o, config: n });
286
+ }, G = async (e, n) => e === l.INIT ? ue(n) : e === l.GENERATE ? Ee(n) : (r.error(`无效的命令: ${e}`), process.exit(1)), {
287
+ version: ge,
288
+ description: ye,
278
289
  cliConfig: { moduleName: A }
279
- } = S, Ne = {
290
+ } = S, Ce = {
280
291
  command: l.INIT,
281
292
  describe: "初始化提取配置文件",
282
- options: ue(),
283
- handler: I(G)(
293
+ options: ae(),
294
+ handler: D(G)(
284
295
  l.INIT
285
296
  )
286
297
  }, Ie = {
287
298
  command: l.GENERATE,
288
299
  describe: "提取信息",
289
- options: fe(),
290
- handler: I(G)(
300
+ options: le(),
301
+ handler: D(G)(
291
302
  l.GENERATE
292
303
  )
293
304
  }, _ = {
294
- describe: Ce,
295
- version: ye,
296
- subcommands: [Ne, Ie].map(
305
+ describe: ye,
306
+ version: ge,
307
+ subcommands: [Ce, Ie].map(
297
308
  R
298
309
  ),
299
310
  demandCommandCount: 1
300
311
  }, k = (e = !1) => {
301
- const n = e ? A : void 0, t = `$0${e ? ` ${A}` : ""} <command> [options]`;
302
- return { command: n, usage: t };
303
- }, Ae = async () => V({
312
+ const n = e ? A : void 0, o = `$0${e ? ` ${A}` : ""} <command> [options]`;
313
+ return { command: n, usage: o };
314
+ }, Oe = async () => V({
304
315
  ..._,
305
316
  ...k()
306
- }), ve = () => R({
317
+ }), Ae = () => R({
307
318
  ..._,
308
319
  ...k(!0)
309
320
  });
310
321
  export {
311
- ve as a,
312
- Ae as c,
322
+ Ae as a,
323
+ Oe as c,
324
+ fe as g,
313
325
  G as h
314
326
  };
package/es/index.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { a as e, h as p } from "./index-a262eb93.js";
3
- import { E as i, S as u } from "./types-a1ee6691-78bcc10f.js";
2
+ import { a as n, g as p, h as s } from "./index-9abc1104.js";
3
+ import { E as u, S as c } from "./types-a1ee6691-9629699d.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:path";
6
6
  import "node:fs";
7
7
  import "@done-coding/cli-template";
8
8
  export {
9
- i as ExtractTypeEnum,
10
- u as SubcommandEnum,
11
- e as crateAsSubcommand,
12
- p as handler
9
+ u as ExtractTypeEnum,
10
+ c as SubcommandEnum,
11
+ n as crateAsSubcommand,
12
+ p as generateFile,
13
+ s as handler
13
14
  };
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ var i = /* @__PURE__ */ ((e) => (e.INIT = "init", e.GENERATE = "generate", e))(i || {}), E = /* @__PURE__ */ ((e) => (e.REG = "reg", e.JSON_INJECT = "json-inject", e.FIXED = "fixed", e))(E || {}), n = /* @__PURE__ */ ((e) => (e.INIT = "init", e.GENERATE = "generate", e))(n || {}), r = /* @__PURE__ */ ((e) => (e.REG = "reg", e.FIXED = "fixed", e.READ = "read", e))(r || {});
3
+ export {
4
+ E,
5
+ i as S,
6
+ r as a,
7
+ n as e
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-extract",
3
- "version": "0.1.6-alpha.0",
3
+ "version": "0.1.8-alpha.0",
4
4
  "description": "信息提取命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -51,7 +51,7 @@
51
51
  "license": "MIT",
52
52
  "sideEffects": false,
53
53
  "devDependencies": {
54
- "@done-coding/cli-inject": "^0.5.6-alpha.0",
54
+ "@done-coding/cli-inject": "^0.5.8-alpha.0",
55
55
  "@types/node": "^18.0.0",
56
56
  "@types/yargs": "^17.0.28",
57
57
  "rimraf": "^6.0.1",
@@ -63,8 +63,8 @@
63
63
  "node": ">=18.0.0"
64
64
  },
65
65
  "dependencies": {
66
- "@done-coding/cli-template": "0.7.7-alpha.0",
67
- "@done-coding/cli-utils": "^0.4.0-alpha.0"
66
+ "@done-coding/cli-template": "0.7.8-alpha.1",
67
+ "@done-coding/cli-utils": "^0.6.0-alpha.0"
68
68
  },
69
- "gitHead": "360b14a641064f732b01ffd6339c2f1963945b61"
69
+ "gitHead": "5879161383e32e7bed351d71d3ef607d81dc021a"
70
70
  }
@@ -1,3 +1,5 @@
1
- import { type ExtractConfig } from '../utils';
1
+ import { type ExtractConfig } from "../utils";
2
2
  /** done-coding 系列cli 注入信息 */
3
3
  export declare const doneCodingSeriesCliInjectInfo: ExtractConfig;
4
+ /** done-coding 系列cli 别名发布信息 */
5
+ export declare const doneCodingPublishAliasInfo: ExtractConfig;
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { handler } from "./handler";
2
+ export { generateFile } from "./utils";
2
3
  export { crateAsSubcommand } from "./main";
3
4
  export * from './utils/types';
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@done-coding/cli-extract",
3
- "version": "0.1.6-alpha.0",
3
+ "version": "0.1.8-alpha.0",
4
4
  "description": "信息提取命令行工具",
5
5
  "cliConfig": {
6
6
  "namespaceDir": ".done-coding",
@@ -1,6 +1,6 @@
1
1
  import type { InitConfigFileOptions, ReadConfigFileOptions } from "@done-coding/cli-utils";
2
2
  import type { CompileTemplateConfig } from "@done-coding/cli-template";
3
- import type { InjectKeyConfig, InjectKeyConfigReg } from "@done-coding/cli-inject";
3
+ import type { InjectKeyConfig, InjectKeyConfigFixed, InjectKeyConfigReg } from "@done-coding/cli-inject";
4
4
  /** 子命令枚举 */
5
5
  export declare enum SubcommandEnum {
6
6
  /** 初始化提取配置文件 */
@@ -23,7 +23,9 @@ export declare enum ExtractTypeEnum {
23
23
  * ---
24
24
  * 内部直接调用 @done-coding/cli-inject
25
25
  */
26
- JSON_INJECT = "json-inject"
26
+ JSON_INJECT = "json-inject",
27
+ /** 固定值 类型 */
28
+ FIXED = "fixed"
27
29
  }
28
30
  /** 初始化选项 */
29
31
  export type InitOptions = InitConfigFileOptions;
@@ -41,8 +43,10 @@ export interface ExtractInputKeyConfigReg extends ExtractInputKeyConfigBase<Extr
41
43
  export interface ExtractInputKeyConfigJsonInject extends ExtractInputKeyConfigBase<ExtractTypeEnum.JSON_INJECT> {
42
44
  inject: InjectKeyConfig;
43
45
  }
46
+ /** 提取配置固定值 */
47
+ export type ExtractInputKeyConfigFixed = ExtractInputKeyConfigBase<ExtractTypeEnum.FIXED> & Omit<InjectKeyConfigFixed, "type">;
44
48
  /** 提取配置 */
45
- export type ExtractInputKeyConfig = ExtractInputKeyConfigReg | ExtractInputKeyConfigJsonInject;
49
+ export type ExtractInputKeyConfig = ExtractInputKeyConfigReg | ExtractInputKeyConfigJsonInject | ExtractInputKeyConfigFixed;
46
50
  /** 提取输入配置 */
47
51
  export interface ExtractInputConfig {
48
52
  [key: string]: ExtractInputKeyConfig;
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- var E = /* @__PURE__ */ ((e) => (e.INIT = "init", e.GENERATE = "generate", e))(E || {}), n = /* @__PURE__ */ ((e) => (e.REG = "reg", e.JSON_INJECT = "json-inject", e))(n || {}), r = /* @__PURE__ */ ((e) => (e.INIT = "init", e.GENERATE = "generate", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.REG = "reg", e.FIXED = "fixed", e.READ = "read", e))(a || {});
3
- export {
4
- n as E,
5
- E as S,
6
- a,
7
- r as e
8
- };