@done-coding/cli-inject 0.5.2-alpha.0 → 0.5.3-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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-5d256200.js";
2
+ import { c as m } from "./index-9e3770fb.js";
3
3
  import "./types-a1ee6691.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:path";
@@ -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 N, createMainCommand as w } from "@done-coding/cli-utils";
3
+ import { log as n, _get as I, getConfigFileCommonOptions as h, initHandlerCommon as _, _set as b, readConfigFile as k, _curry as A, createSubcommand as D, 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
- }, D = {
35
+ }, M = {
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
- }, R = {
49
+ }, N = M, R = {
50
50
  name: "@done-coding/cli-inject",
51
- version: "0.5.2-alpha.0",
51
+ version: "0.5.3-alpha.0",
52
52
  description: "信息(JSON)注入命令行工具",
53
53
  cliConfig: {
54
54
  namespaceDir: ".done-coding",
55
55
  moduleName: "inject"
56
56
  }
57
57
  }, {
58
- cliConfig: { namespaceDir: M, moduleName: x }
59
- } = R, H = `./${M}/${x}`, T = `${H}.json`, L = () => h({
58
+ cliConfig: { namespaceDir: x, moduleName: H }
59
+ } = R, L = `./${x}/${H}`, T = `${L}.json`, J = () => h({
60
60
  configPathDefault: T
61
- }), J = async (e) => _(D, e, {
61
+ }), U = async (e) => _(N, e, {
62
62
  onFileGenerated: () => {
63
63
  n.info("文件生成成功");
64
64
  }
65
- }), U = () => ({
65
+ }), V = () => ({
66
66
  ...h({
67
67
  configPathDefault: T
68
68
  })
69
- }), V = async ({
69
+ }), W = async ({
70
70
  rootDir: e = process.cwd(),
71
- config: o = D,
71
+ config: o = N,
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
- }, W = async (e) => {
101
+ }, X = 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 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,
106
+ await W({ rootDir: t, config: o });
107
+ }, v = async (e, o) => e === a.INIT ? U(o) : e === a.GENERATE ? X(o) : (n.error(`无效的命令: ${e}`), process.exit(1)), {
108
+ version: K,
109
+ description: q,
110
110
  cliConfig: { moduleName: j }
111
- } = R, q = {
111
+ } = R, z = {
112
112
  command: a.INIT,
113
113
  describe: "初始化提取配置文件",
114
- options: L(),
114
+ options: J(),
115
115
  handler: A(v)(
116
116
  a.INIT
117
117
  )
118
- }, z = {
118
+ }, B = {
119
119
  command: a.GENERATE,
120
120
  describe: "提取信息",
121
- options: U(),
121
+ options: V(),
122
122
  handler: A(v)(
123
123
  a.GENERATE
124
124
  )
125
125
  }, O = {
126
- describe: K,
127
- version: X,
128
- subcommands: [q, z].map(
129
- N
126
+ describe: q,
127
+ version: K,
128
+ subcommands: [z, B].map(
129
+ D
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
- }, ee = async () => w({
135
+ }, ne = async () => w({
136
136
  ...O,
137
137
  ...S()
138
- }), ne = () => N({
138
+ }), oe = () => D({
139
139
  ...O,
140
140
  ...S(!0)
141
141
  });
142
142
  export {
143
- ne as a,
144
- ee as c,
145
- V as g,
143
+ oe as a,
144
+ ne as c,
145
+ W 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-5d256200.js";
2
+ import { a as r, g as s, h as t, k as i } from "./index-9e3770fb.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.2-alpha.0",
3
+ "version": "0.5.3-alpha.0",
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.2-alpha.0"
65
+ "@done-coding/cli-utils": "^0.3.3-alpha.0"
66
66
  },
67
- "gitHead": "7faf662e137d46f776c8e5abdf75ab3db541362c"
67
+ "gitHead": "9b65389752c25c4b7fff7fa8dfd46e5788ef2390"
68
68
  }
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@done-coding/cli-inject",
3
- "version": "0.5.2-alpha.0",
3
+ "version": "0.5.3-alpha.0",
4
4
  "description": "信息(JSON)注入命令行工具",
5
5
  "cliConfig": {
6
6
  "namespaceDir": ".done-coding",