@done-coding/cli-utils 0.7.8 → 0.8.1

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/index.mjs CHANGED
@@ -1,54 +1,55 @@
1
1
  #!/usr/bin/env node
2
- import p from "chalk";
3
- import { default as ce } from "chalk";
4
- import g from "node:path";
5
- import m, { existsSync as y, mkdirSync as W, writeFileSync as D, readFileSync as v, rmSync as X } from "node:fs";
6
- import _ from "crypto";
7
- import q from "prompts";
8
- import z from "yargs";
9
- import { hideBin as Q } from "yargs/helpers";
10
- import { execSync as u } from "node:child_process";
11
- import H from "json5";
2
+ import q from "chalk";
3
+ import l from "node:path";
4
+ import m, { existsSync as v, mkdirSync as z, writeFileSync as P, readFileSync as _ } from "node:fs";
5
+ import R from "crypto";
6
+ import Q from "prompts";
7
+ import Z from "yargs";
8
+ import { hideBin as tt } from "yargs/helpers";
9
+ import { execSync as g } from "node:child_process";
10
+ import F from "json5";
12
11
  export * from "json5";
13
- import { default as fe } from "json5";
14
- import Z from "lodash.merge";
15
- import tt from "semver";
16
- import { tmpdir as et } from "node:os";
17
- import { default as ue } from "lodash.get";
18
- import { default as pe } from "lodash.set";
19
- import { default as de } from "lodash.curry";
20
- import E from "pinyin";
21
- const f = Object.assign(
22
- (t, ...r) => console.log(...r.map((e) => p[t](e))),
23
- {
12
+ import { default as Ae } from "json5";
13
+ import et from "lodash.merge";
14
+ import rt from "semver";
15
+ import { tmpdir as st, homedir as nt } from "node:os";
16
+ import { v4 as ot } from "uuid";
17
+ import { v4 as we } from "uuid";
18
+ import { default as Te } from "lodash.get";
19
+ import { default as Ne } from "lodash.set";
20
+ import { default as Be } from "lodash.curry";
21
+ import y from "pinyin";
22
+ const G = (t) => {
23
+ const e = (...[r, ...n]) => t(q[r](...n));
24
+ return Object.assign(e, {
24
25
  /** 成功 */
25
- success: (...t) => f("green", ...t),
26
+ success: (...r) => e("green", ...r),
26
27
  /** /步骤 */
27
- stage: (...t) => f("blue", ...t),
28
+ stage: (...r) => e("blue", ...r),
28
29
  /** 提示信息 */
29
- info: (...t) => f("cyan", ...t),
30
+ info: (...r) => e("cyan", ...r),
30
31
  /** 警告 */
31
- warn: (...t) => f("yellow", ...t),
32
+ warn: (...r) => e("yellow", ...r),
32
33
  /** 错误 */
33
- error: (...t) => f("red", ...t),
34
+ error: (...r) => e("red", ...r),
34
35
  /** 跳过 */
35
- skip: (...t) => f("gray", ...t)
36
- }
37
- ), Bt = (t, {
36
+ skip: (...r) => e("gray", ...r)
37
+ });
38
+ }, a = G(console.log), Zt = G((t) => t), te = (t, {
38
39
  /** 当前目录 */
39
- currentDir: r = process.cwd(),
40
+ currentDir: e = process.cwd(),
40
41
  /** 优先找最远的父目录 */
41
- isFindFarthest: e = !0
42
+ isFindFarthest: r = !0
42
43
  } = {}) => {
43
- const s = g.resolve(r).split(g.sep).map((o, n, c) => c.slice(0, n).concat(o).join(g.sep) || g.sep);
44
- for (; s.length; ) {
45
- const o = e ? s.shift() : s.pop(), n = g.join(o, t);
46
- if (m.existsSync(n))
47
- return o;
44
+ const n = l.resolve(e).split(l.sep).map((s, o, c) => c.slice(0, o).concat(s).join(l.sep) || l.sep);
45
+ for (; n.length; ) {
46
+ const s = r ? n.shift() : n.pop(), o = l.join(s, t);
47
+ if (m.existsSync(o))
48
+ return s;
48
49
  }
49
- }, G = "aes-256-cbc", N = 16, M = "hex", w = ":";
50
- function F(t) {
51
- return _.pbkdf2Sync(
50
+ }, k = "aes-256-cbc", x = 16, C = "hex", w = ":";
51
+ function j(t) {
52
+ return R.pbkdf2Sync(
52
53
  t,
53
54
  "done-coding-cli-salt",
54
55
  // 使用固定的盐值
@@ -59,107 +60,107 @@ function F(t) {
59
60
  "sha256"
60
61
  );
61
62
  }
62
- function kt({
63
+ function ee({
63
64
  text: t,
64
- secretKey: r
65
+ secretKey: e
65
66
  }) {
66
67
  try {
67
- const e = F(r), s = _.randomBytes(N), o = _.createCipheriv(G, e, s);
68
- let n = o.update(t);
69
- n = Buffer.concat([n, o.final()]);
70
- const c = s.toString(M), i = n.toString(M);
68
+ const r = j(e), n = R.randomBytes(x), s = R.createCipheriv(k, r, n);
69
+ let o = s.update(t);
70
+ o = Buffer.concat([o, s.final()]);
71
+ const c = n.toString(C), i = o.toString(C);
71
72
  return `${c}${w}${i}`;
72
- } catch (e) {
73
- return f.error(
74
- `加密失败: ${e instanceof Error ? e.message : String(e)}`
73
+ } catch (r) {
74
+ return a.error(
75
+ `加密失败: ${r instanceof Error ? r.message : String(r)}`
75
76
  ), "";
76
77
  }
77
78
  }
78
- function jt({
79
+ function re({
79
80
  encryptedText: t,
80
- secretKey: r
81
+ secretKey: e
81
82
  }) {
82
83
  try {
83
84
  if (!t.includes(w))
84
85
  return "";
85
- const e = F(r), [s, o] = t.split(w);
86
- if (s.length !== N * 2)
86
+ const r = j(e), [n, s] = t.split(w);
87
+ if (n.length !== x * 2)
87
88
  return "";
88
- const n = Buffer.from(s, M), c = Buffer.from(o, M), i = _.createDecipheriv(G, e, n);
89
- let a = i.update(c);
90
- return a = Buffer.concat([a, i.final()]), a.toString();
91
- } catch (e) {
92
- return f.error(
93
- `解密失败: ${e instanceof Error ? e.message : String(e)}`
89
+ const o = Buffer.from(n, C), c = Buffer.from(s, C), i = R.createDecipheriv(k, r, o);
90
+ let u = i.update(c);
91
+ return u = Buffer.concat([u, i.final()]), u.toString();
92
+ } catch (r) {
93
+ return a.error(
94
+ `解密失败: ${r instanceof Error ? r.message : String(r)}`
94
95
  ), "";
95
96
  }
96
97
  }
97
- const L = (...t) => {
98
- const [r, e = {}] = t;
99
- return q(r, {
100
- onCancel(s) {
101
- return f.error(`退出${s == null ? void 0 : s.name}输入`), process.exit(1);
98
+ const U = (...t) => {
99
+ const [e, r = {}] = t;
100
+ return Q(e, {
101
+ onCancel(n) {
102
+ return a.error(`退出${n == null ? void 0 : n.name}输入`), process.exit(1);
102
103
  },
103
- ...e
104
+ ...r
104
105
  });
105
- }, rt = (t, r) => {
106
- t ? f.error(t) : f.error(r.message), r != null && r.stack && f.error(r.stack), process.exit(1);
107
- }, st = () => {
108
- const t = Q(process.argv);
109
- return z(t);
110
- }, xt = ({
106
+ }, it = (t, e) => {
107
+ t ? a.error(t) : a.error(e.message), e != null && e.stack && a.error(e.stack), process.exit(1);
108
+ }, ct = () => {
109
+ const t = tt(process.argv);
110
+ return Z(t);
111
+ }, se = ({
111
112
  rootScriptName: t,
112
- packageJson: r
113
+ packageJson: e
113
114
  }) => {
114
115
  if (t)
115
116
  return t;
116
- if (!r)
117
+ if (!e)
117
118
  return;
118
- const { bin: e, name: s } = r;
119
- if (e) {
120
- if (typeof e == "string")
121
- return s.includes("/") ? void 0 : s;
122
- if (typeof e == "object") {
123
- const o = Object.entries(e), n = process.argv[1], c = o.filter(([, a]) => n == null ? void 0 : n.endsWith(a));
119
+ const { bin: r, name: n } = e;
120
+ if (r) {
121
+ if (typeof r == "string")
122
+ return n.includes("/") ? void 0 : n;
123
+ if (typeof r == "object") {
124
+ const s = Object.entries(r), o = process.argv[1], c = s.filter(([, u]) => o == null ? void 0 : o.endsWith(u));
124
125
  if (c.length !== 1)
125
126
  return;
126
127
  const [i] = c[0];
127
128
  return process.platform === "win32" ? i.toLowerCase() : i;
128
129
  }
129
130
  }
130
- }, U = (t, {
131
- usage: r,
132
- version: e,
133
- demandCommandCount: s,
134
- options: o,
135
- positionals: n,
131
+ }, H = (t, {
132
+ usage: e,
133
+ version: r,
134
+ demandCommandCount: n,
135
+ options: s,
136
+ positionals: o,
136
137
  subcommands: c,
137
138
  rootScriptName: i
138
- }, a) => {
139
- let l = t.strict();
140
- r && (l = l.usage(`Usage: ${r}`)), s && (l = l.demandCommand(s));
141
- const h = "help";
142
- return l = l.help(h), e ? l = l.version(e).alias("h", h).alias("v", "version") : l = l.alias("h", h), o && (l = l.options(o)), n && (l = Object.entries(n).reduce((S, [P, d]) => S.positional(P, d), l)), c && (l = l.command(c)), a && i && (l = l.scriptName(i)), l;
143
- }, Ht = async ({ handler: t, ...r }) => {
144
- const e = await U(st(), r, !0).fail(
145
- rt
139
+ }, u) => {
140
+ let f = t.strict();
141
+ e && (f = f.usage(`Usage: ${e}`)), n && (f = f.demandCommand(n));
142
+ const p = "help";
143
+ return f = f.help(p), r ? f = f.version(r).alias("h", p).alias("v", "version") : f = f.alias("h", p), s && (f = f.options(s)), o && (f = Object.entries(o).reduce((S, [$, h]) => S.positional($, h), f)), c && (f = f.command(c)), u && i && (f = f.scriptName(i)), f;
144
+ }, ne = async ({ handler: t, ...e }) => {
145
+ const r = await H(ct(), e, !0).fail(
146
+ it
146
147
  ).argv;
147
- return t ? t(e) : e;
148
- }, Gt = (t) => {
149
- const { command: r, describe: e, handler: s = () => {
150
- }, ...o } = t;
148
+ return t ? t(r) : r;
149
+ }, oe = (t) => {
150
+ const { command: e, describe: r, handler: n = () => {
151
+ }, ...s } = t;
151
152
  return {
152
- command: r,
153
- describe: e,
154
- builder(n) {
155
- return U(n, o, !1);
153
+ command: e,
154
+ describe: r,
155
+ builder(o) {
156
+ return H(o, s, !1);
156
157
  },
157
- handler: s
158
+ handler: n
158
159
  };
159
160
  };
160
- var ot = /* @__PURE__ */ ((t) => (t.VSCODE = "VsCode", t.CURSOR = "Cursor", t.OTHER = "其他", t))(ot || {});
161
- const nt = async () => {
162
- const { editorType: t } = await L([
161
+ var at = /* @__PURE__ */ ((t) => (t.VSCODE = "VsCode", t.CURSOR = "Cursor", t.OTHER = "其他", t))(at || {});
162
+ const ft = async () => {
163
+ const { editorType: t } = await U([
163
164
  {
164
165
  name: "editorType",
165
166
  type: "select",
@@ -169,39 +170,39 @@ const nt = async () => {
169
170
  "VsCode",
170
171
  "其他"
171
172
  /* OTHER */
172
- ].map((r) => ({
173
- title: r,
174
- value: r
173
+ ].map((e) => ({
174
+ title: e,
175
+ value: e
175
176
  }))
176
177
  }
177
178
  ]);
178
179
  return t;
179
- }, it = {
180
+ }, lt = {
180
181
  Cursor: "cursor",
181
182
  VsCode: "code"
182
- }, ct = (t, r, e) => {
183
+ }, ut = (t, e, r) => {
183
184
  try {
184
- u(`${t} -v`, { stdio: "ignore" }), u(`${t} ${r}`);
185
+ g(`${t} -v`, { stdio: "ignore" }), g(`${t} ${e}`);
185
186
  } catch {
186
- e();
187
+ r();
187
188
  }
188
- }, at = (t, r) => {
189
- const e = (s) => f.info(`
190
- ${s}, 请用编辑器打开 ${t} 进行编辑
189
+ }, gt = (t, e) => {
190
+ const r = (n) => a.info(`
191
+ ${n}, 请用编辑器打开 ${t} 进行编辑
191
192
  `);
192
- switch (r) {
193
+ switch (e) {
193
194
  case "Cursor":
194
195
  case "VsCode": {
195
- const s = it[r];
196
- ct(s, t, () => {
197
- e(`${s}命令未安装`);
196
+ const n = lt[e];
197
+ ut(n, t, () => {
198
+ r(`${n}命令未安装`);
198
199
  });
199
200
  break;
200
201
  }
201
202
  default:
202
- e("其他编辑器");
203
+ r("其他编辑器");
203
204
  }
204
- }, lt = (t = process.cwd()) => ({
205
+ }, mt = (t = process.cwd()) => ({
205
206
  /** 必须保留 */
206
207
  rootDir: {
207
208
  type: "string",
@@ -210,12 +211,12 @@ const nt = async () => {
210
211
  /** 必须设置默认值 */
211
212
  default: t
212
213
  }
213
- }), Nt = ({
214
+ }), ie = ({
214
215
  configPathDefault: t,
215
- rootDirDefault: r
216
+ rootDirDefault: e
216
217
  }) => ({
217
218
  /** 必须保留 */
218
- ...lt(r),
219
+ ...mt(e),
219
220
  /** 必须保留 */
220
221
  configPath: {
221
222
  type: "string",
@@ -224,31 +225,31 @@ const nt = async () => {
224
225
  /** 必须设置默认值 */
225
226
  default: t
226
227
  }
227
- }), ft = async (t, r) => {
228
- const { configPath: e, rootDir: s } = r, o = g.resolve(s, e), n = g.dirname(o);
229
- return y(n) || W(n, {
228
+ }), pt = async (t, e) => {
229
+ const { configPath: r, rootDir: n } = e, s = l.resolve(n, r), o = l.dirname(s);
230
+ return v(o) || z(o, {
230
231
  recursive: !0
231
- }), o.endsWith(".json5") ? (f.info(`json5模式写入 ${o}`), D(o, H.stringify(t, null, 2)), o) : (f.info(`json模式写入 ${o}`), D(o, JSON.stringify(t, null, 2)), o);
232
- }, Ft = async (t, r, {
233
- onFileGenerated: e,
234
- edit: s = !1
232
+ }), s.endsWith(".json5") ? (a.info(`json5模式写入 ${s}`), P(s, F.stringify(t, null, 2)), s) : (a.info(`json模式写入 ${s}`), P(s, JSON.stringify(t, null, 2)), s);
233
+ }, ce = async (t, e, {
234
+ onFileGenerated: r,
235
+ edit: n = !1
235
236
  } = {}) => {
236
- const o = await ft(t, r);
237
- if (e == null || e(o), s) {
238
- const n = await nt();
239
- at(r.configPath, n);
237
+ const s = await pt(t, e);
238
+ if (r == null || r(s), n) {
239
+ const o = await ft();
240
+ gt(e.configPath, o);
240
241
  }
241
- }, Lt = async (t, r) => {
242
- const { configPath: e, rootDir: s } = t, o = g.resolve(s, e);
243
- if (!y(o)) {
244
- if (r)
245
- return f.info("配置文件不存在,使用onNotExists返回值"), r();
246
- const n = `配置文件不存在 ${o}`;
247
- throw new Error(n);
242
+ }, ae = async (t, e) => {
243
+ const { configPath: r, rootDir: n } = t, s = l.resolve(n, r);
244
+ if (!v(s)) {
245
+ if (e)
246
+ return a.info("配置文件不存在,使用onNotExists返回值"), e();
247
+ const o = `配置文件不存在 ${s}`;
248
+ throw new Error(o);
248
249
  }
249
- return o.endsWith(".json5") ? (f.info(`json5模式解析 ${o}`), H.parse(v(o, "utf8"))) : (f.info(`json模式解析 ${o}`), JSON.parse(v(o, "utf8")));
250
- }, Ut = async () => {
251
- const { useDefaultConfig: t } = await L({
250
+ return s.endsWith(".json5") ? (a.info(`json5模式解析 ${s}`), F.parse(_(s, "utf8"))) : (a.info(`json模式解析 ${s}`), JSON.parse(_(s, "utf8")));
251
+ }, fe = async () => {
252
+ const { useDefaultConfig: t } = await U({
252
253
  name: "useDefaultConfig",
253
254
  type: "confirm",
254
255
  message: "使用默认模板配置",
@@ -258,240 +259,246 @@ const nt = async () => {
258
259
  }, J = "package.json", T = ({
259
260
  rootDir: t
260
261
  }) => {
261
- const r = g.resolve(t, J);
262
- if (!y(r))
262
+ const e = l.resolve(t, J);
263
+ if (!v(e))
263
264
  throw new Error(`${t}未找到package.json文件`);
264
- const e = v(r, "utf-8");
265
- return JSON.parse(e);
266
- }, gt = ({
265
+ const r = _(e, "utf-8");
266
+ return JSON.parse(r);
267
+ }, ht = ({
267
268
  rootDir: t,
268
- pkgJson: r,
269
- pkgName: e,
270
- isDevPkg: s
269
+ pkgJson: e,
270
+ pkgName: r,
271
+ isDevPkg: n
271
272
  }) => {
272
- const o = r || T({ rootDir: t }), n = s ? o.devDependencies : o.dependencies;
273
- let c = n == null ? void 0 : n[e];
273
+ const s = e || T({ rootDir: t }), o = n ? s.devDependencies : s.dependencies;
274
+ let c = o == null ? void 0 : o[r];
274
275
  if (!c) {
275
- const i = s ? o.dependencies : o.devDependencies;
276
- c = i == null ? void 0 : i[e], c && console.log(
277
- p.yellow(
278
- `${s ? "开发" : "生产"}依赖包${e}可能错误的安装在${s ? "dependencies" : "devDependencies"}`
279
- )
276
+ const i = n ? s.dependencies : s.devDependencies;
277
+ c = i == null ? void 0 : i[r], c && a.warn(
278
+ `${n ? "开发" : "生产"}依赖包${r}可能错误的安装在${n ? "dependencies" : "devDependencies"}`
280
279
  );
281
280
  return;
282
281
  }
283
- return c || console.log(p.cyan(`依赖包${e}未安装`)), c;
284
- }, Jt = ({
282
+ return c || a.info(`依赖包${r}未安装`), c;
283
+ }, le = ({
285
284
  patchConfig: t,
286
- rootDir: r
285
+ rootDir: e
287
286
  }) => {
288
287
  if (!t)
289
288
  return;
290
- const e = T({ rootDir: r }), s = Z(e, t), o = g.resolve(r, J);
291
- D(o, JSON.stringify(s, null, 2), "utf-8");
292
- }, O = (t) => {
293
- const e = u("git rev-parse --show-toplevel", {
289
+ const r = T({ rootDir: e }), n = et(r, t), s = l.resolve(e, J);
290
+ P(s, JSON.stringify(n, null, 2), "utf-8");
291
+ }, I = (t) => {
292
+ const r = g("git rev-parse --show-toplevel", {
294
293
  cwd: t
295
294
  }).toString();
296
- if (!e)
295
+ if (!r)
297
296
  throw new Error("获取git根目录失败");
298
- return e.trim();
299
- }, Kt = () => {
297
+ return r.trim();
298
+ }, ue = () => {
300
299
  var t;
301
300
  try {
302
- const r = u("git symbolic-ref --short HEAD", {
301
+ const e = g("git symbolic-ref --short HEAD", {
303
302
  stdio: "ignore"
304
303
  });
305
- return (t = r == null ? void 0 : r.toString()) == null ? void 0 : t.trim();
304
+ return (t = e == null ? void 0 : e.toString()) == null ? void 0 : t.trim();
306
305
  } catch {
307
306
  try {
308
- const e = u("git rev-parse --short HEAD").toString().trim();
309
- f.skip(`当前未指向具体某个分支, 当前commit hash: ${e}`);
307
+ const r = g("git rev-parse --short HEAD").toString().trim();
308
+ a.skip(`当前未指向具体某个分支, 当前commit hash: ${r}`);
310
309
  } finally {
311
310
  return;
312
311
  }
313
312
  }
314
- }, ut = (t) => {
315
- const r = t.match(/moving\s+from\s+(.*)\s+to\s+(.*)/);
316
- if (r) {
317
- const [, e, s] = r;
313
+ }, dt = (t) => {
314
+ const e = t.match(/moving\s+from\s+(.*)\s+to\s+(.*)/);
315
+ if (e) {
316
+ const [, r, n] = e;
318
317
  return {
319
- fromBranch: e.trim(),
320
- toBranch: s.trim()
318
+ fromBranch: r.trim(),
319
+ toBranch: n.trim()
321
320
  };
322
321
  }
323
- }, I = 73, mt = (t) => {
324
- const e = m.statSync(t).mode;
325
- if ((e & I) === I)
322
+ }, A = 73, St = (t) => {
323
+ const r = m.statSync(t).mode;
324
+ if ((r & A) === A)
326
325
  return;
327
- console.log(p.blue(`${t} 没有执行权限 添加... `));
328
- const s = e | I;
329
- m.chmodSync(t, s), console.log(p.green(`${t} 添加执行权限成功`));
330
- };
331
- var R = /* @__PURE__ */ ((t) => (t.PRE_COMMIT = "pre-commit", t.PRE_MERGE_COMMIT = "pre-merge-commit", t.PREPARE_COMMIT_MSG = "prepare-commit-msg", t.COMMIT_MSG = "commit-msg", t.PRE_REBASE = "pre-rebase", t.POST_COMMIT = "post-commit", t.POST_MERGE = "post-merge", t.PRE_PUSH = "pre-push", t))(R || {});
332
- const pt = "husky", ht = ".husky", dt = ({ rootDir: t }) => {
333
- const r = O(t), e = gt({
334
- rootDir: r,
335
- pkgJson: T({ rootDir: r }),
336
- pkgName: pt,
326
+ a.stage(`${t} 没有执行权限 添加... `);
327
+ const n = r | A;
328
+ m.chmodSync(t, n), a.success(`${t} 添加执行权限成功`);
329
+ }, V = (t) => m.existsSync(t), D = async (t) => {
330
+ try {
331
+ return await m.promises.lstat(t), !0;
332
+ } catch (e) {
333
+ return e.code !== "ENOENT";
334
+ }
335
+ }, Et = (t, e = !1) => {
336
+ V(t) && m.rmSync(t, { recursive: !0, force: e });
337
+ }, ge = async (t, e = !1) => {
338
+ await D(t) && await m.promises.rm(t, { recursive: !0, force: e });
339
+ }, yt = (t) => m.readFileSync(t, "utf-8"), _t = (t) => m.promises.readFile(t, "utf-8"), me = (t, e) => JSON.parse(yt(t)) || e, K = async (t, e) => JSON.parse(await _t(t)) || e;
340
+ var d = /* @__PURE__ */ ((t) => (t.PRE_COMMIT = "pre-commit", t.PRE_MERGE_COMMIT = "pre-merge-commit", t.PREPARE_COMMIT_MSG = "prepare-commit-msg", t.COMMIT_MSG = "commit-msg", t.PRE_REBASE = "pre-rebase", t.POST_COMMIT = "post-commit", t.POST_MERGE = "post-merge", t.PRE_PUSH = "pre-push", t))(d || {});
341
+ const Rt = "husky", Ct = ".husky", Ot = ({ rootDir: t }) => {
342
+ const e = I(t), r = ht({
343
+ rootDir: e,
344
+ pkgJson: T({ rootDir: e }),
345
+ pkgName: Rt,
337
346
  isDevPkg: !0
338
347
  });
339
- if (!e)
348
+ if (!r)
340
349
  throw new Error("husky版本获取失败, 可能husky未安装");
341
- const s = e.replace(/^(\^|~)/, ""), o = "<9.0.0";
342
- return tt.satisfies(s, o) ? (console.log(p.cyan(`${s}符合${o}`)), `#!/usr/bin/env sh
343
- . "$(dirname -- "$0")/_/husky.sh"`) : (console.log(p.cyan(`${s}不符合${o}`)), "");
344
- }, yt = ({ rootDir: t }) => {
345
- const r = O(t);
346
- return g.resolve(r, ht);
347
- }, Yt = ({
350
+ const n = r.replace(/^(\^|~)/, ""), s = "<9.0.0";
351
+ return rt.satisfies(n, s) ? (a.info(`${n}符合${s}`), `#!/usr/bin/env sh
352
+ . "$(dirname -- "$0")/_/husky.sh"`) : (a.info(`${n}不符合${s}`), "");
353
+ }, vt = ({ rootDir: t }) => {
354
+ const e = I(t);
355
+ return l.resolve(e, Ct);
356
+ }, pe = ({
348
357
  hookNames: t,
349
- rootDir: r,
350
- getCode: e
358
+ rootDir: e,
359
+ getCode: r
351
360
  }) => {
352
- const s = yt({ rootDir: r });
353
- m.existsSync(s) || m.mkdirSync(s, { recursive: !0 }), t.forEach((o) => {
354
- const n = g.resolve(s, o), c = m.existsSync(n);
355
- let i = e(o);
361
+ const n = vt({ rootDir: e });
362
+ m.existsSync(n) || m.mkdirSync(n, { recursive: !0 }), t.forEach((s) => {
363
+ const o = l.resolve(n, s), c = m.existsSync(o);
364
+ let i = r(s);
356
365
  if (c)
357
- m.readFileSync(n, "utf-8").includes(i) ? console.log(
358
- p.gray(`${n} ${o}相关调用 ${i} 已存在 跳过`)
359
- ) : (m.appendFileSync(
360
- n,
366
+ m.readFileSync(o, "utf-8").includes(i) ? a.skip(`${o} ${s}相关调用 ${i} 已存在 跳过`) : (m.appendFileSync(
367
+ o,
361
368
  `
362
369
  ${i}
363
370
  `
364
- ), console.log(p.green(`${n} 添加 ${o}相关调用成功`)));
371
+ ), a.success(`${o} 添加 ${s}相关调用成功`));
365
372
  else {
366
- const a = dt({
367
- rootDir: r
373
+ const u = Ot({
374
+ rootDir: e
368
375
  });
369
376
  m.writeFileSync(
370
- n,
371
- `${a}
377
+ o,
378
+ `${u}
372
379
 
373
380
  ${i}
374
381
  `,
375
382
  "utf-8"
376
- ), console.log(p.green(`${n} 添加 ${o}相关调用成功`));
383
+ ), a.success(`${o} 添加 ${s}相关调用成功`);
377
384
  }
378
- mt(n);
385
+ St(o);
379
386
  });
380
- }, Vt = [
387
+ }, he = [
381
388
  // HooksNameEnum.PRE_MERGE_COMMIT,
382
- R.PREPARE_COMMIT_MSG,
383
- R.COMMIT_MSG
384
- ], Wt = ({
389
+ d.PREPARE_COMMIT_MSG,
390
+ d.COMMIT_MSG
391
+ ], de = ({
385
392
  hookName: t,
386
- rootDir: r
393
+ rootDir: e
387
394
  }) => {
388
- const e = O(r), s = g.resolve(e, ".git");
395
+ const r = I(e), n = l.resolve(r, ".git");
389
396
  switch (t) {
390
- case R.PREPARE_COMMIT_MSG:
391
- case R.COMMIT_MSG: {
392
- const o = g.resolve(s, "MERGE_MSG");
393
- if (y(o))
394
- return v(o, "utf-8");
397
+ case d.PREPARE_COMMIT_MSG:
398
+ case d.COMMIT_MSG: {
399
+ const s = l.resolve(n, "MERGE_MSG");
400
+ if (v(s))
401
+ return _(s, "utf-8");
395
402
  }
396
403
  }
397
404
  return "";
398
- }, Xt = ({
405
+ }, Se = ({
399
406
  remoteAlias: t = "origin"
400
407
  } = {}) => {
401
408
  try {
402
- const r = u("git rev-parse HEAD").toString().trim(), e = u('git log -1 --pretty=format:"%an"').toString().trim(), s = u('git log -1 --pretty=format:"%ae"').toString().trim(), o = u('git log -1 --pretty=format:"%s"').toString().trim(), n = u("git config user.name").toString().trim(), c = u("git config user.email").toString().trim(), i = u("git rev-parse --abbrev-ref HEAD").toString().trim();
403
- let a = "";
409
+ const e = g("git rev-parse HEAD").toString().trim(), r = g('git log -1 --pretty=format:"%an"').toString().trim(), n = g('git log -1 --pretty=format:"%ae"').toString().trim(), s = g('git log -1 --pretty=format:"%s"').toString().trim(), o = g("git config user.name").toString().trim(), c = g("git config user.email").toString().trim(), i = g("git rev-parse --abbrev-ref HEAD").toString().trim();
410
+ let u = "";
404
411
  try {
405
- a = u(`git config --get remote.${t}.url`).toString().trim();
412
+ u = g(`git config --get remote.${t}.url`).toString().trim();
406
413
  } catch {
407
- f.warn("git远程仓库地址获取失败或者不存在");
414
+ a.warn("git远程仓库地址获取失败或者不存在");
408
415
  }
409
416
  return {
410
- lastHash: r,
411
- lastCommitter: e,
412
- lastCommitterPinYin: E(e, {
413
- style: E.STYLE_NORMAL,
417
+ lastHash: e,
418
+ lastCommitter: r,
419
+ lastCommitterPinYin: y(r, {
420
+ style: y.STYLE_NORMAL,
414
421
  heteronym: !1
415
422
  }).join(""),
416
- lastCommitEmail: s,
417
- lastCommitMsg: o,
418
- userName: n,
419
- userNamePinYin: E(n, {
420
- style: E.STYLE_NORMAL,
423
+ lastCommitEmail: n,
424
+ lastCommitMsg: s,
425
+ userName: o,
426
+ userNamePinYin: y(o, {
427
+ style: y.STYLE_NORMAL,
421
428
  heteronym: !1
422
429
  }).join(""),
423
430
  userEmail: c,
424
431
  branchName: i,
425
- remoteInfo: a ? {
432
+ remoteInfo: u ? {
426
433
  alias: t,
427
- url: a
434
+ url: u
428
435
  } : void 0
429
436
  };
430
- } catch (r) {
431
- throw f.error("获取git最后提交信息失败"), r;
437
+ } catch (e) {
438
+ throw a.error("获取git最后提交信息失败"), e;
432
439
  }
433
- }, K = (t = "") => {
434
- const r = /\s*Merge\s+branch\s+['|"](.+)['|"]\s+into\s+['|"](.+)['|"]\s*/i, e = t.match(r);
435
- if (e) {
436
- const [, i, a] = e;
440
+ }, Y = (t = "") => {
441
+ const e = /\s*Merge\s+branch\s+['|"](.+)['|"]\s+into\s+['|"](.+)['|"]\s*/i, r = t.match(e);
442
+ if (r) {
443
+ const [, i, u] = r;
437
444
  return {
438
445
  fromBranch: i,
439
- toBranch: a
446
+ toBranch: u
440
447
  };
441
448
  }
442
- const s = /\s*Merge\s+branch\s+['|"](.+)['|"]\s+of\s+.+\s+into\s+['|"](.+)['|"]\s*/i, o = t.match(s);
443
- if (o) {
444
- const [, i, a] = o;
449
+ const n = /\s*Merge\s+branch\s+['|"](.+)['|"]\s+of\s+.+\s+into\s+['|"](.+)['|"]\s*/i, s = t.match(n);
450
+ if (s) {
451
+ const [, i, u] = s;
445
452
  return {
446
453
  fromBranch: i,
447
- toBranch: a
454
+ toBranch: u
448
455
  };
449
456
  }
450
- const n = /\s*Merge\s+branch\s+['|"](.+)['|"](\s+of)?\s*/i, c = t.match(n);
457
+ const o = /\s*Merge\s+branch\s+['|"](.+)['|"](\s+of)?\s*/i, c = t.match(o);
451
458
  if (c) {
452
459
  const [, i] = c;
453
460
  return {
454
461
  fromBranch: i
455
462
  };
456
463
  }
457
- }, Rt = (t) => {
458
- if (t.startsWith(A.MERGE))
464
+ }, It = (t) => {
465
+ if (t.startsWith(b.MERGE))
459
466
  return {
460
- fromBranch: t.replace(A.MERGE, "").trim()
467
+ fromBranch: t.replace(b.MERGE, "").trim()
461
468
  };
462
- }, qt = () => {
469
+ }, Ee = () => {
463
470
  const t = process.env.GIT_REFLOG_ACTION || "";
464
471
  if (!t)
465
472
  return;
466
- const r = /merge\s+([^\s]+)\s*/i, e = t.match(r);
467
- if (e) {
468
- const [, n] = e;
473
+ const e = /merge\s+([^\s]+)\s*/i, r = t.match(e);
474
+ if (r) {
475
+ const [, o] = r;
469
476
  return {
470
- fromBranch: n
477
+ fromBranch: o
471
478
  };
472
479
  }
473
- const s = /pull\s+([^\s]+)\s+([^\s]+)/, o = t.match(s);
474
- if (o) {
475
- const [, , n] = o;
480
+ const n = /pull\s+([^\s]+)\s+([^\s]+)/, s = t.match(n);
481
+ if (s) {
482
+ const [, , o] = s;
476
483
  return {
477
- fromBranch: n
484
+ fromBranch: o
478
485
  };
479
486
  }
480
487
  };
481
- var A = /* @__PURE__ */ ((t) => (t.CHECKOUT = "checkout", t.MERGE = "merge", t.COMMIT = "commit", t.COMMIT_MERGE = "commit (merge)", t.PULL = "pull", t.RESET = "reset", t.REBASE_START = "rebase (start)", t.REBASE_FINISH = "rebase (finish)", t.REBASE_ABORT = "rebase (abort)", t.REBASE_CONTINUE = "rebase (continue)", t))(A || {});
482
- const j = "__GIT_REPLACE_MARK__", $ = {
488
+ var b = /* @__PURE__ */ ((t) => (t.CHECKOUT = "checkout", t.MERGE = "merge", t.COMMIT = "commit", t.COMMIT_MERGE = "commit (merge)", t.PULL = "pull", t.RESET = "reset", t.REBASE_START = "rebase (start)", t.REBASE_FINISH = "rebase (finish)", t.REBASE_ABORT = "rebase (abort)", t.REBASE_CONTINUE = "rebase (continue)", t))(b || {});
489
+ const B = "__GIT_REPLACE_MARK__", O = {
483
490
  stringify(t) {
484
- return JSON.stringify(t).replace(/"/g, j);
491
+ return JSON.stringify(t).replace(/"/g, B);
485
492
  },
486
493
  parse(t) {
487
- return JSON.parse(t.replace(new RegExp(j, "g"), '"'));
494
+ return JSON.parse(t.replace(new RegExp(B, "g"), '"'));
488
495
  }
489
- }, zt = ({
496
+ }, ye = ({
490
497
  count: t = 100
491
498
  } = {}) => {
492
499
  if (t <= 0)
493
500
  return [];
494
- const r = {
501
+ const e = {
495
502
  hash: "%H",
496
503
  /** 提交信息 */
497
504
  message: "%s",
@@ -508,171 +515,222 @@ const j = "__GIT_REPLACE_MARK__", $ = {
508
515
  /** 提交日期 */
509
516
  commitTime: "%ci"
510
517
  };
511
- return u(
512
- `git --no-pager log --oneline -n ${t} --pretty=format:"${$.stringify(
513
- r
518
+ return g(
519
+ `git --no-pager log --oneline -n ${t} --pretty=format:"${O.stringify(
520
+ e
514
521
  )}"`
515
522
  ).toString().split(`
516
- `).map((n) => {
517
- const c = $.parse(n);
523
+ `).map((o) => {
524
+ const c = O.parse(o);
518
525
  return {
519
526
  ...c,
520
- mergeInfo: K(c.message)
527
+ mergeInfo: Y(c.message)
521
528
  };
522
529
  });
523
- }, Qt = ({
530
+ }, _e = ({
524
531
  count: t = 100,
525
- filterItem: r = () => !0
532
+ filterItem: e = () => !0
526
533
  } = {}) => {
527
534
  if (t <= 0)
528
535
  return [];
529
- const e = {
536
+ const r = {
530
537
  hash: "%H",
531
538
  fullMessage: "%gs",
532
539
  committer: "%cn",
533
540
  committerEmail: "%ce",
534
541
  commitTime: "%ci"
535
542
  };
536
- return u(
537
- `git --no-pager reflog -n ${t} --pretty=format:"${$.stringify(
538
- e
543
+ return g(
544
+ `git --no-pager reflog -n ${t} --pretty=format:"${O.stringify(
545
+ r
539
546
  )}"`
540
547
  ).toString().split(`
541
- `).map((i) => $.parse(i)).filter(r).map((i) => {
542
- const { fullMessage: a, ...l } = i, h = ":", [S] = a.split(h, 1), P = a.slice(`${S}${h}`.length), d = S.trim(), C = P.trim();
543
- let b, B, V;
544
- if (d.startsWith(
548
+ `).map((i) => O.parse(i)).filter(e).map((i) => {
549
+ const { fullMessage: u, ...f } = i, p = ":", [S] = u.split(p, 1), $ = u.slice(`${S}${p}`.length), h = S.trim(), E = $.trim();
550
+ let M, N, X;
551
+ if (h.startsWith(
545
552
  "checkout"
546
553
  /* CHECKOUT */
547
554
  ))
548
- B = ut(C);
549
- else if (d.startsWith(
555
+ N = dt(E);
556
+ else if (h.startsWith(
550
557
  "merge"
551
558
  /* MERGE */
552
559
  ))
553
- b = Rt(d);
554
- else if (d.startsWith(
560
+ M = It(h);
561
+ else if (h.startsWith(
555
562
  "commit (merge)"
556
563
  /* COMMIT_MERGE */
557
564
  )) {
558
- const k = K(C);
559
- k || f.warn(
560
- `${i.hash} 是合并提交 但是未从提交信息(${C})中检测到合并分支信息,推测手动更改了提交内容`
561
- ), b = k;
565
+ const L = Y(E);
566
+ L || a.warn(
567
+ `${i.hash} 是合并提交 但是未从提交信息(${E})中检测到合并分支信息,推测手动更改了提交内容`
568
+ ), M = L;
562
569
  }
563
570
  return {
564
- ...l,
565
- type: d,
566
- message: C,
567
- mergeInfo: b,
568
- checkoutInfo: B,
569
- rebaseInfo: V
571
+ ...f,
572
+ type: h,
573
+ message: E,
574
+ mergeInfo: M,
575
+ checkoutInfo: N,
576
+ rebaseInfo: X
570
577
  };
571
578
  });
572
- }, Zt = (t) => {
573
- const r = O(t), e = g.resolve(r, ".git"), s = g.resolve(e, "rebase-merge");
574
- if (m.existsSync(s))
579
+ }, Re = (t) => {
580
+ const e = I(t), r = l.resolve(e, ".git"), n = l.resolve(r, "rebase-merge");
581
+ if (m.existsSync(n))
575
582
  return !0;
576
- const o = g.resolve(e, "rebase-apply");
577
- if (m.existsSync(o))
583
+ const s = l.resolve(r, "rebase-apply");
584
+ if (m.existsSync(s))
578
585
  return !0;
579
- const n = g.resolve(e, "REBASE_HEAD");
580
- return !!m.existsSync(n);
581
- }, te = ({
586
+ const o = l.resolve(r, "REBASE_HEAD");
587
+ return !!m.existsSync(o);
588
+ }, Ce = ({
582
589
  branchName: t,
583
- version: r,
584
- remoteInfo: e
590
+ version: e,
591
+ remoteInfo: r
585
592
  }) => {
586
- e && (u(`git push ${e.alias} v${r}`, {
593
+ r && (g(`git push ${r.alias} v${e}`, {
587
594
  stdio: "inherit"
588
- }), u(`git push ${e.alias} ${t}`, {
595
+ }), g(`git push ${r.alias} ${t}`, {
589
596
  stdio: "inherit"
590
597
  }));
591
- }, ee = (t) => /^https?:\/\//.test(t), re = (t) => /^git@/.test(t), se = (t) => {
592
- const { hostname: r, pathname: e } = new URL(t);
593
- return `git@${r}:${e.replace("/", "")}`;
594
- }, x = "git@gitee.com:justsosu/done-coding-cli-assets-config.git", St = (t) => `./.DONE_CODING_CLI/CONFIG_TEMP_DIR_FOR_${t}`, Y = (t) => `./assets/${t}`, Ct = (t) => `${Y(t)}/index.json`, oe = async ({
595
- moduleName: t,
596
- onSuccess: r
598
+ }, $t = (t) => /^https?:\/\//.test(t), Mt = (t) => /^git@/.test(t), Oe = (t) => {
599
+ const { hostname: e, pathname: r } = new URL(t);
600
+ return `git@${e}:${r.replace("/", "")}`;
601
+ }, W = ".done-coding", At = `${W}/cli/assets-config`, Pt = "assets", wt = "index.json", bt = `${W}/config.json`, Tt = "https://gitee.com/justsosu/done-coding-cli-assets-config.git", Dt = ({
602
+ dir: t,
603
+ fn: e,
604
+ endClear: r = !0,
605
+ exitClear: n = !0
597
606
  }) => {
598
- console.log(p.blue(`拉取${t}配置,请稍等...`));
599
- const e = St(t), s = g.resolve(
600
- et(),
601
- e
602
- );
603
- if (y(s))
604
- return console.log(
605
- p.red(`${s} 已存在,请手动删除该目录再试`)
606
- ), process.exit(1);
607
- const o = () => {
608
- X(s, { recursive: !0, force: !0 });
607
+ if (V(t))
608
+ return a.error(`${t} 已存在,请手动删除该目录再试`), process.exit(1);
609
+ const s = () => {
610
+ a.stage("正在清理临时目录...", t), Et(t);
609
611
  };
610
- let n;
612
+ n && process.once("exit", () => {
613
+ a.stage("发现进程退出,正在清理临时目录...", t), s();
614
+ });
615
+ let o;
611
616
  try {
612
- u(`git clone ${x} ${s} --depth=1`);
613
- const c = Ct(t), i = Y(t), a = g.resolve(
614
- s,
615
- c
616
- );
617
- n = JSON.parse(m.readFileSync(a, "utf-8")), process.once("exit", () => {
618
- y(s) && (console.log("发现进程退出,正在清理临时目录..."), o());
619
- }), await r({
620
- repoUrl: x,
621
- config: n,
622
- cliConfigFileRelativePath: c,
623
- cliConfigDirRelativePath: i,
624
- configTemporaryDir: s
625
- });
626
- } finally {
627
- o();
617
+ o = e(t);
618
+ } catch (c) {
619
+ throw r && s(), c;
628
620
  }
629
- return n;
621
+ return r && (o instanceof Promise ? o.finally(s) : s()), o;
630
622
  };
623
+ var Nt = /* @__PURE__ */ ((t) => (t.ASSETS_CONFIG_REPO_URL = "ASSETS_CONFIG_REPO_URL", t))(Nt || {});
624
+ const Lt = (t) => l.resolve(
625
+ st(),
626
+ At,
627
+ `${t}-${ot()}`
628
+ ), Bt = () => l.resolve(nt(), bt), Ft = async () => {
629
+ const t = Bt(), e = {
630
+ ASSETS_CONFIG_REPO_URL: Tt
631
+ };
632
+ try {
633
+ if (await D(t)) {
634
+ const r = await K(t, {});
635
+ Object.entries(r).forEach(([n, s]) => {
636
+ e[n] = s;
637
+ });
638
+ }
639
+ } catch {
640
+ }
641
+ return e;
642
+ }, Gt = async (t) => {
643
+ if (await D(t))
644
+ return a.error(`${t} 已存在,请手动删除该目录再试`), process.exit(1);
645
+ const {
646
+ [
647
+ "ASSETS_CONFIG_REPO_URL"
648
+ /* ASSETS_CONFIG_REPO_URL */
649
+ ]: e
650
+ } = await Ft();
651
+ return Mt(e) || $t(e) ? g(`git clone ${e} ${t} --depth=1`) : (m.mkdirSync(t, { recursive: !0 }), g(`cp -r ${e}/ ${t}/`)), {
652
+ assetConfigRepoUrl: e
653
+ };
654
+ }, ve = async ({
655
+ moduleName: t,
656
+ onSuccess: e
657
+ }) => (a.stage(`拉取${t}配置,请稍等...`), Dt({
658
+ // 资源配置仓库临时文件夹
659
+ dir: Lt(t),
660
+ fn: async (r) => {
661
+ const { assetConfigRepoUrl: n } = await Gt(r), s = l.join(
662
+ Pt,
663
+ t
664
+ ), o = l.join(
665
+ s,
666
+ wt
667
+ ), c = l.resolve(r, o), i = await K(c);
668
+ return await e({
669
+ repoUrl: n,
670
+ config: i,
671
+ moduleDirFileRelativePath: s,
672
+ moduleEntryFileRelativePath: o,
673
+ assetsConfigRepoTempDir: r
674
+ }), i;
675
+ }
676
+ }));
631
677
  export {
632
- ot as EditorTypeEnum,
633
- A as GitRefLogTypeEnum,
634
- R as HooksNameEnum,
635
- Vt as SUPPORT_GET_COMMIT_BY_HOOKS_NAMES,
636
- de as _curry,
637
- ue as _get,
638
- pe as _set,
639
- Yt as addHuskyHooks,
640
- Jt as addPackageConfig,
641
- ce as chalk,
642
- Zt as checkCurrentIsRebasing,
643
- Ht as createMainCommand,
644
- Gt as createSubcommand,
645
- jt as decryptAES,
646
- kt as encryptAES,
647
- mt as fileAddX,
648
- Wt as getCommitByHookName,
649
- Nt as getConfigFileCommonOptions,
650
- zt as getCurrentBranchLastCommitList,
651
- Kt as getCurrentBranchName,
652
- nt as getEditorType,
653
- Xt as getGitLastCommitInfo,
654
- O as getGitProjectDir,
655
- Qt as getLastReflogList,
678
+ Nt as DoneCodingCliGlobalConfigKeyEnum,
679
+ at as EditorTypeEnum,
680
+ b as GitRefLogTypeEnum,
681
+ d as HooksNameEnum,
682
+ he as SUPPORT_GET_COMMIT_BY_HOOKS_NAMES,
683
+ Be as _curry,
684
+ Te as _get,
685
+ Ne as _set,
686
+ pe as addHuskyHooks,
687
+ le as addPackageConfig,
688
+ Dt as applyUseTempDir,
689
+ V as assetIsExits,
690
+ D as assetIsExitsAsync,
691
+ Re as checkCurrentIsRebasing,
692
+ ne as createMainCommand,
693
+ oe as createSubcommand,
694
+ re as decryptAES,
695
+ ee as encryptAES,
696
+ St as fileAddX,
697
+ Lt as getCliModuleTempDir,
698
+ de as getCommitByHookName,
699
+ ie as getConfigFileCommonOptions,
700
+ ye as getCurrentBranchLastCommitList,
701
+ ue as getCurrentBranchName,
702
+ ft as getEditorType,
703
+ Se as getGitLastCommitInfo,
704
+ I as getGitProjectDir,
705
+ _e as getLastReflogList,
706
+ Zt as getLogText,
656
707
  T as getPackageJson,
657
- gt as getRelyPkgVersion,
658
- lt as getRootDirOptions,
659
- xt as getRootScriptName,
660
- Ut as getUseDefaultConfig,
661
- se as http2sshGitUrl,
662
- ft as initConfigFile,
663
- Ft as initHandlerCommon,
664
- ee as isHttpGitUrl,
665
- re as isSshGitUrl,
666
- fe as json5,
667
- f as log,
668
- Bt as lookForParentTarget,
669
- at as openFileInEditor,
670
- te as pushGitPublishInfoToRemote,
671
- oe as readCliConfig,
672
- Lt as readConfigFile,
673
- ut as resolveCheckoutInfoByRefInfo,
674
- K as resolveMergeInfoByCommitMsg,
675
- qt as resolveMergeInfoByGitReflogAction,
676
- Rt as resolveMergeInfoByRefType,
677
- L as xPrompts
708
+ ht as getRelyPkgVersion,
709
+ mt as getRootDirOptions,
710
+ se as getRootScriptName,
711
+ fe as getUseDefaultConfig,
712
+ Oe as http2sshGitUrl,
713
+ pt as initConfigFile,
714
+ ce as initHandlerCommon,
715
+ $t as isHttpGitUrl,
716
+ Mt as isSshGitUrl,
717
+ Ae as json5,
718
+ a as log,
719
+ te as lookForParentTarget,
720
+ gt as openFileInEditor,
721
+ Ce as pushGitPublishInfoToRemote,
722
+ ve as readCliModuleAssetsConfig,
723
+ ae as readConfigFile,
724
+ yt as readFile,
725
+ _t as readFileAsync,
726
+ me as readJsonFile,
727
+ K as readJsonFileAsync,
728
+ Et as removeAsset,
729
+ ge as removeAssetAsync,
730
+ dt as resolveCheckoutInfoByRefInfo,
731
+ Y as resolveMergeInfoByCommitMsg,
732
+ Ee as resolveMergeInfoByGitReflogAction,
733
+ It as resolveMergeInfoByRefType,
734
+ we as uuidv4,
735
+ U as xPrompts
678
736
  };