@done-coding/cli-utils 0.8.3-alpha.0 → 0.8.3-alpha.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 +235 -221
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { homedir as
|
|
2
|
+
import { homedir as Y, tmpdir as V } from "node:os";
|
|
3
3
|
import f from "node:path";
|
|
4
|
-
import { createOutputLogFile as
|
|
5
|
-
import g, { existsSync as M, mkdirSync as
|
|
6
|
-
import
|
|
4
|
+
import { createOutputLogFile as ft, createOutputConsole as gt, OutputConsoleTypeEnum as pt } from "@done-coding/output-node";
|
|
5
|
+
import g, { existsSync as M, mkdirSync as mt, writeFileSync as D, readFileSync as N } from "node:fs";
|
|
6
|
+
import _t from "dayjs";
|
|
7
7
|
import { default as _r } from "dayjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { hideBin as
|
|
12
|
-
import { execSync as p, spawn as
|
|
13
|
-
import
|
|
8
|
+
import A, { randomUUID as Et } from "node:crypto";
|
|
9
|
+
import dt from "prompts";
|
|
10
|
+
import ht from "yargs";
|
|
11
|
+
import { hideBin as St } from "yargs/helpers";
|
|
12
|
+
import { execSync as p, spawn as Ct } from "node:child_process";
|
|
13
|
+
import K from "json5";
|
|
14
14
|
export * from "json5";
|
|
15
15
|
import { default as hr } from "json5";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
16
|
+
import Ot from "lodash.merge";
|
|
17
|
+
import Rt from "semver";
|
|
18
18
|
import { default as Cr } from "lodash.get";
|
|
19
19
|
import { default as Rr } from "lodash.set";
|
|
20
20
|
import { default as Ir } from "lodash.curry";
|
|
21
21
|
import P from "pinyin";
|
|
22
22
|
import { default as Nr } from "chalk";
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const W = "__DONE_CODING_ENV_CONFIG__", X = Symbol.for(
|
|
24
|
+
W
|
|
25
25
|
), k = Symbol.for(
|
|
26
26
|
"DONE_CODING_CURRENT_LOG_FILE_NAME"
|
|
27
|
-
),
|
|
27
|
+
), z = "DONE_CODING_PROCESS_CREATE_BY_HIJACK_PRESET_JSON", b = ".done-coding", yt = `${b}/cli/assets-config`, It = "assets", Pt = "index.json", Nt = `${b}/config.json`, At = "output/log", Z = "default", vt = "https://gitee.com/justsosu/done-coding-cli-assets-config.git", $ = 73, Tt = (t) => {
|
|
28
28
|
const r = g.statSync(t).mode;
|
|
29
29
|
if ((r & $) === $)
|
|
30
30
|
return;
|
|
31
|
-
|
|
31
|
+
a.stage(`${t} 没有执行权限 添加... `);
|
|
32
32
|
const s = r | $;
|
|
33
|
-
g.chmodSync(t, s),
|
|
33
|
+
g.chmodSync(t, s), a.success(`${t} 添加执行权限成功`);
|
|
34
34
|
}, w = (t) => g.existsSync(t), B = async (t) => {
|
|
35
35
|
try {
|
|
36
36
|
return await g.promises.lstat(t), !0;
|
|
37
37
|
} catch (e) {
|
|
38
38
|
return e.code !== "ENOENT";
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, Mt = (t, e = !1) => {
|
|
41
41
|
w(t) && g.rmSync(t, { recursive: !0, force: e });
|
|
42
|
-
},
|
|
42
|
+
}, Lt = async (t, e = !1) => {
|
|
43
43
|
await B(t) && await g.promises.rm(t, { recursive: !0, force: e });
|
|
44
|
-
},
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
const r = process.env[
|
|
44
|
+
}, $t = (t) => g.readFileSync(t, "utf-8"), Dt = (t) => g.promises.readFile(t, "utf-8"), be = (t, e) => JSON.parse($t(t)) || e, q = async (t, e) => JSON.parse(await Dt(t)) || e;
|
|
45
|
+
var Gt = /* @__PURE__ */ ((t) => (t.GLOBAL_CONFIG_IMAGE = "GLOBAL_CONFIG_IMAGE", t))(Gt || {});
|
|
46
|
+
const Q = (t) => `${W}_${t}`, tt = (t, e) => {
|
|
47
|
+
const r = process.env[Q(t)];
|
|
48
48
|
if (r !== void 0)
|
|
49
49
|
try {
|
|
50
50
|
return JSON.parse(r).value;
|
|
@@ -53,38 +53,38 @@ const tt = (t) => `${X}_${t}`, et = (t, e) => {
|
|
|
53
53
|
}
|
|
54
54
|
else
|
|
55
55
|
return e;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
const r =
|
|
56
|
+
}, Ft = (t, e) => {
|
|
57
|
+
tt(t);
|
|
58
|
+
const r = Q(t), s = { value: e };
|
|
59
59
|
process.env[r] = JSON.stringify(s);
|
|
60
|
-
},
|
|
60
|
+
}, et = () => globalThis[X], rt = () => {
|
|
61
61
|
const t = globalThis[k];
|
|
62
62
|
if (t)
|
|
63
63
|
return t;
|
|
64
64
|
{
|
|
65
|
-
const e = `${
|
|
65
|
+
const e = `${_t().format("YYYY-MM-DD_HH-mm-ss")}_${process.pid}.log`;
|
|
66
66
|
return globalThis[k] = e, e;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, bt = (t) => {
|
|
69
69
|
const r = {
|
|
70
|
-
...
|
|
70
|
+
...et() || {},
|
|
71
71
|
...t
|
|
72
72
|
};
|
|
73
|
-
return
|
|
74
|
-
},
|
|
73
|
+
return Ft("GLOBAL_CONFIG_IMAGE", r), globalThis[X] = r, r;
|
|
74
|
+
}, wt = () => tt(
|
|
75
75
|
"GLOBAL_CONFIG_IMAGE"
|
|
76
76
|
/* GLOBAL_CONFIG_IMAGE */
|
|
77
|
-
),
|
|
78
|
-
const t =
|
|
77
|
+
), st = (t) => `${b}/${t}/${At}`, Bt = () => {
|
|
78
|
+
const t = wt();
|
|
79
79
|
let e;
|
|
80
80
|
if (t)
|
|
81
81
|
e = t;
|
|
82
82
|
else {
|
|
83
|
-
const m =
|
|
83
|
+
const m = Z;
|
|
84
84
|
e = {
|
|
85
85
|
series: m,
|
|
86
86
|
consoleLog: !0,
|
|
87
|
-
logOutputDir:
|
|
87
|
+
logOutputDir: st(m),
|
|
88
88
|
processLogFileNameList: []
|
|
89
89
|
};
|
|
90
90
|
}
|
|
@@ -93,11 +93,11 @@ const tt = (t) => `${X}_${t}`, et = (t, e) => {
|
|
|
93
93
|
consoleLog: s,
|
|
94
94
|
logOutputDir: n,
|
|
95
95
|
processLogFileNameList: o
|
|
96
|
-
} = e, c =
|
|
97
|
-
let
|
|
96
|
+
} = e, c = rt(), i = (o[0] === c ? o : [c, ...o]).slice(0, 10), u = process.env[z];
|
|
97
|
+
let l;
|
|
98
98
|
if (u)
|
|
99
99
|
try {
|
|
100
|
-
|
|
100
|
+
l = JSON.parse(
|
|
101
101
|
u
|
|
102
102
|
);
|
|
103
103
|
} catch {
|
|
@@ -108,48 +108,48 @@ const tt = (t) => `${X}_${t}`, et = (t, e) => {
|
|
|
108
108
|
logOutputDir: n,
|
|
109
109
|
processLogFileNameList: i,
|
|
110
110
|
/** 自身或祖先进程是否被劫持进程创建 */
|
|
111
|
-
processCreateByHijack: !!
|
|
111
|
+
processCreateByHijack: !!l,
|
|
112
112
|
/** 自身或祖先进程被劫持进程创建 行为预设信息 */
|
|
113
|
-
processCreateByHijackPresetInfo:
|
|
113
|
+
processCreateByHijackPresetInfo: l
|
|
114
114
|
};
|
|
115
|
-
}, C = () =>
|
|
116
|
-
series: t =
|
|
115
|
+
}, C = () => et() || Bt(), we = ({
|
|
116
|
+
series: t = Z,
|
|
117
117
|
consoleLog: e = !0
|
|
118
118
|
}) => {
|
|
119
|
-
const r =
|
|
119
|
+
const r = st(t), s = {
|
|
120
120
|
...C(),
|
|
121
121
|
series: t,
|
|
122
122
|
consoleLog: e,
|
|
123
123
|
logOutputDir: r
|
|
124
124
|
};
|
|
125
|
-
return
|
|
126
|
-
},
|
|
125
|
+
return bt(s);
|
|
126
|
+
}, Ut = () => C().processCreateByHijack, Ht = () => C().processCreateByHijackPresetInfo, jt = (t = !1) => {
|
|
127
127
|
const e = f.resolve(
|
|
128
|
-
t ?
|
|
128
|
+
t ? Y() : V(),
|
|
129
129
|
C().logOutputDir
|
|
130
130
|
);
|
|
131
131
|
return w(e) || g.mkdirSync(e, { recursive: !0 }), e;
|
|
132
|
-
},
|
|
133
|
-
const t =
|
|
132
|
+
}, kt = () => C().processLogFileNameList[1], xt = (() => {
|
|
133
|
+
const t = ft({
|
|
134
134
|
logFilePath: f.resolve(
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
jt(),
|
|
136
|
+
rt()
|
|
137
137
|
)
|
|
138
138
|
});
|
|
139
139
|
let e = !1;
|
|
140
140
|
if (!e) {
|
|
141
|
-
const r =
|
|
141
|
+
const r = kt();
|
|
142
142
|
r && (t.info(`父进程日志文件: ${r}`), e = !0);
|
|
143
143
|
}
|
|
144
144
|
return t;
|
|
145
|
-
})(),
|
|
145
|
+
})(), Jt = (t) => {
|
|
146
146
|
const e = C();
|
|
147
147
|
return typeof e.consoleLog == "boolean" ? e.consoleLog : e.consoleLog.includes(t);
|
|
148
|
-
},
|
|
149
|
-
isSwitchLogFile: (t) => !
|
|
148
|
+
}, a = gt({
|
|
149
|
+
isSwitchLogFile: (t) => !Jt(t),
|
|
150
150
|
enableColor: !0,
|
|
151
|
-
outputFileFn: (t, ...e) =>
|
|
152
|
-
consoleType:
|
|
151
|
+
outputFileFn: (t, ...e) => xt.info({
|
|
152
|
+
consoleType: pt[t],
|
|
153
153
|
consoleMessages: e
|
|
154
154
|
})
|
|
155
155
|
}), Be = (t, {
|
|
@@ -164,9 +164,9 @@ const tt = (t) => `${X}_${t}`, et = (t, e) => {
|
|
|
164
164
|
if (g.existsSync(o))
|
|
165
165
|
return n;
|
|
166
166
|
}
|
|
167
|
-
},
|
|
168
|
-
function
|
|
169
|
-
return
|
|
167
|
+
}, nt = "aes-256-cbc", ot = 16, v = "hex", G = ":";
|
|
168
|
+
function it(t) {
|
|
169
|
+
return A.pbkdf2Sync(
|
|
170
170
|
t,
|
|
171
171
|
"done-coding-cli-salt",
|
|
172
172
|
// 使用固定的盐值
|
|
@@ -182,17 +182,17 @@ function Ue({
|
|
|
182
182
|
secretKey: e
|
|
183
183
|
}) {
|
|
184
184
|
try {
|
|
185
|
-
const r =
|
|
186
|
-
|
|
185
|
+
const r = it(e), s = A.randomBytes(ot), n = A.createCipheriv(
|
|
186
|
+
nt,
|
|
187
187
|
r,
|
|
188
188
|
s
|
|
189
189
|
);
|
|
190
190
|
let o = n.update(t);
|
|
191
191
|
o = Buffer.concat([o, n.final()]);
|
|
192
|
-
const c = s.toString(
|
|
192
|
+
const c = s.toString(v), i = o.toString(v);
|
|
193
193
|
return `${c}${G}${i}`;
|
|
194
194
|
} catch (r) {
|
|
195
|
-
return
|
|
195
|
+
return a.error(
|
|
196
196
|
`加密失败: ${r instanceof Error ? r.message : String(r)}`
|
|
197
197
|
), "";
|
|
198
198
|
}
|
|
@@ -204,11 +204,11 @@ function He({
|
|
|
204
204
|
try {
|
|
205
205
|
if (!t.includes(G))
|
|
206
206
|
return "";
|
|
207
|
-
const r =
|
|
208
|
-
if (s.length !==
|
|
207
|
+
const r = it(e), [s, n] = t.split(G);
|
|
208
|
+
if (s.length !== ot * 2)
|
|
209
209
|
return "";
|
|
210
|
-
const o = Buffer.from(s,
|
|
211
|
-
|
|
210
|
+
const o = Buffer.from(s, v), c = Buffer.from(n, v), i = A.createDecipheriv(
|
|
211
|
+
nt,
|
|
212
212
|
r,
|
|
213
213
|
o
|
|
214
214
|
);
|
|
@@ -217,59 +217,73 @@ function He({
|
|
|
217
217
|
);
|
|
218
218
|
return u = Buffer.concat([u, i.final()]), u.toString();
|
|
219
219
|
} catch (r) {
|
|
220
|
-
return
|
|
220
|
+
return a.error(
|
|
221
221
|
`解密失败: ${r instanceof Error ? r.message : String(r)}`
|
|
222
222
|
), "";
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const
|
|
225
|
+
const ct = {
|
|
226
226
|
/** prompts 开始等待用户输入 */
|
|
227
227
|
PROMPTS_START_WAIT_USER_INPUT: "PROMPTS_START_WAIT_USER_INPUT",
|
|
228
228
|
/** prompts 结束等待用户输入 */
|
|
229
229
|
PROMPTS_END_WAIT_USER_INPUT: "PROMPTS_END_WAIT_USER_INPUT"
|
|
230
|
-
},
|
|
231
|
-
type:
|
|
230
|
+
}, Yt = (t) => ({
|
|
231
|
+
type: ct.PROMPTS_START_WAIT_USER_INPUT,
|
|
232
232
|
data: t
|
|
233
|
-
}),
|
|
234
|
-
type:
|
|
235
|
-
}),
|
|
233
|
+
}), Vt = () => ({
|
|
234
|
+
type: ct.PROMPTS_END_WAIT_USER_INPUT
|
|
235
|
+
}), x = (t) => (a.debug("发送进程自定义事件", t), new Promise((e, r) => {
|
|
236
236
|
process.send ? process.send(t, (s) => {
|
|
237
|
-
s ? (
|
|
238
|
-
}) : (
|
|
237
|
+
s ? (a.error("发送进程自定义事件失败", s), r(s)) : (a.debug("发送进程自定义事件成功", t), e());
|
|
238
|
+
}) : (a.error(
|
|
239
239
|
"进程自定义事件发送失败,process.send is not defined"
|
|
240
240
|
), r(new Error("process.send is not defined")));
|
|
241
241
|
})), U = async (...t) => {
|
|
242
|
-
const [e, r = {}] = t;
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
242
|
+
const [e, r = {}] = t, s = Ut();
|
|
243
|
+
if (s) {
|
|
244
|
+
await x(Yt(t));
|
|
245
|
+
const o = Ht();
|
|
246
|
+
if (o != null && o.beforeInputExit) {
|
|
247
|
+
a.info(
|
|
248
|
+
"劫持进程设置在等待用户输入前退出",
|
|
249
|
+
JSON.stringify(o)
|
|
250
|
+
);
|
|
251
|
+
const c = t[0], i = Array.isArray(c) ? c : [c];
|
|
252
|
+
return a.info(
|
|
253
|
+
`检测到子进程等待用户输入${i.map((u) => `${u.name}: ${u.message}`).join(", ")}`
|
|
254
|
+
), a.error(
|
|
255
|
+
"进程退出,原因: 检测到子进程要等待用户输入,此处子进程自己退出"
|
|
256
|
+
), process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const n = dt(e, {
|
|
260
|
+
onCancel(o) {
|
|
261
|
+
return a.error(
|
|
262
|
+
`您取消了 “${(o == null ? void 0 : o.message) || (o == null ? void 0 : o.name)}” 相关表单输入`
|
|
249
263
|
), process.exit(1);
|
|
250
264
|
},
|
|
251
265
|
...r
|
|
252
266
|
});
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
}),
|
|
256
|
-
},
|
|
267
|
+
return s && n.finally(() => {
|
|
268
|
+
x(Vt());
|
|
269
|
+
}), n;
|
|
270
|
+
}, Kt = async ({
|
|
257
271
|
key: t,
|
|
258
272
|
presetAnswer: e,
|
|
259
273
|
defaultValue: r,
|
|
260
274
|
questionConfig: s
|
|
261
275
|
}) => (e == null ? void 0 : e[t]) ?? r ?? (s !== void 0 ? (await U(s))[t] : void 0), je = ({
|
|
262
276
|
presetAnswer: t
|
|
263
|
-
}) => async (e, r, s) =>
|
|
277
|
+
}) => async (e, r, s) => Kt({
|
|
264
278
|
key: e,
|
|
265
279
|
questionConfig: r,
|
|
266
280
|
defaultValue: s,
|
|
267
281
|
presetAnswer: t
|
|
268
|
-
}),
|
|
269
|
-
t ?
|
|
270
|
-
},
|
|
271
|
-
const t =
|
|
272
|
-
return
|
|
282
|
+
}), Wt = (t, e) => {
|
|
283
|
+
t ? a.error(t) : a.error(e.message), e != null && e.stack && a.error(e.stack), process.exit(1);
|
|
284
|
+
}, Xt = () => {
|
|
285
|
+
const t = St(process.argv);
|
|
286
|
+
return ht(t);
|
|
273
287
|
}, ke = ({
|
|
274
288
|
rootScriptName: t,
|
|
275
289
|
packageJson: e
|
|
@@ -290,7 +304,7 @@ const at = {
|
|
|
290
304
|
return process.platform === "win32" ? i.toLowerCase() : i;
|
|
291
305
|
}
|
|
292
306
|
}
|
|
293
|
-
},
|
|
307
|
+
}, at = (t, {
|
|
294
308
|
usage: e,
|
|
295
309
|
version: r,
|
|
296
310
|
demandCommandCount: s,
|
|
@@ -299,13 +313,13 @@ const at = {
|
|
|
299
313
|
subcommands: c,
|
|
300
314
|
rootScriptName: i
|
|
301
315
|
}, u) => {
|
|
302
|
-
let
|
|
303
|
-
e && (
|
|
316
|
+
let l = t.strict();
|
|
317
|
+
e && (l = l.usage(`Usage: ${e}`)), s && (l = l.demandCommand(s));
|
|
304
318
|
const m = "help";
|
|
305
|
-
return
|
|
319
|
+
return l = l.help(m), r ? l = l.version(r).alias("h", m).alias("v", "version") : l = l.alias("h", m), n && (l = l.options(n)), o && (l = Object.entries(o).reduce((h, [O, E]) => h.positional(O, E), l)), c && (l = l.command(c)), u && i && (l = l.scriptName(i)), l;
|
|
306
320
|
}, xe = async ({ handler: t, ...e }) => {
|
|
307
|
-
const r = await
|
|
308
|
-
|
|
321
|
+
const r = await at(Xt(), e, !0).fail(
|
|
322
|
+
Wt
|
|
309
323
|
).argv;
|
|
310
324
|
return t ? t(r) : r;
|
|
311
325
|
}, Je = (t) => {
|
|
@@ -315,13 +329,13 @@ const at = {
|
|
|
315
329
|
command: e,
|
|
316
330
|
describe: r,
|
|
317
331
|
builder(o) {
|
|
318
|
-
return
|
|
332
|
+
return at(o, n, !1);
|
|
319
333
|
},
|
|
320
334
|
handler: s
|
|
321
335
|
};
|
|
322
336
|
};
|
|
323
|
-
var
|
|
324
|
-
const
|
|
337
|
+
var zt = /* @__PURE__ */ ((t) => (t.VSCODE = "VsCode", t.CURSOR = "Cursor", t.OTHER = "其他", t))(zt || {});
|
|
338
|
+
const Zt = async () => {
|
|
325
339
|
const { editorType: t } = await U([
|
|
326
340
|
{
|
|
327
341
|
name: "editorType",
|
|
@@ -339,24 +353,24 @@ const zt = async () => {
|
|
|
339
353
|
}
|
|
340
354
|
]);
|
|
341
355
|
return t;
|
|
342
|
-
},
|
|
356
|
+
}, qt = {
|
|
343
357
|
Cursor: "cursor",
|
|
344
358
|
VsCode: "code"
|
|
345
|
-
},
|
|
359
|
+
}, Qt = (t, e, r) => {
|
|
346
360
|
try {
|
|
347
361
|
p(`${t} -v`, { stdio: "ignore" }), p(`${t} ${e}`);
|
|
348
362
|
} catch {
|
|
349
363
|
r();
|
|
350
364
|
}
|
|
351
|
-
},
|
|
352
|
-
const r = (s) =>
|
|
365
|
+
}, te = (t, e) => {
|
|
366
|
+
const r = (s) => a.info(`
|
|
353
367
|
${s}, 请用编辑器打开 ${t} 进行编辑
|
|
354
368
|
`);
|
|
355
369
|
switch (e) {
|
|
356
370
|
case "Cursor":
|
|
357
371
|
case "VsCode": {
|
|
358
|
-
const s =
|
|
359
|
-
|
|
372
|
+
const s = qt[e];
|
|
373
|
+
Qt(s, t, () => {
|
|
360
374
|
r(`${s}命令未安装`);
|
|
361
375
|
});
|
|
362
376
|
break;
|
|
@@ -364,7 +378,7 @@ const zt = async () => {
|
|
|
364
378
|
default:
|
|
365
379
|
r("其他编辑器");
|
|
366
380
|
}
|
|
367
|
-
},
|
|
381
|
+
}, ee = (t = process.cwd()) => ({
|
|
368
382
|
/** 必须保留 */
|
|
369
383
|
rootDir: {
|
|
370
384
|
type: "string",
|
|
@@ -378,7 +392,7 @@ const zt = async () => {
|
|
|
378
392
|
rootDirDefault: e
|
|
379
393
|
}) => ({
|
|
380
394
|
/** 必须保留 */
|
|
381
|
-
...
|
|
395
|
+
...ee(e),
|
|
382
396
|
/** 必须保留 */
|
|
383
397
|
configPath: {
|
|
384
398
|
type: "string",
|
|
@@ -387,29 +401,29 @@ const zt = async () => {
|
|
|
387
401
|
/** 必须设置默认值 */
|
|
388
402
|
default: t
|
|
389
403
|
}
|
|
390
|
-
}),
|
|
404
|
+
}), re = async (t, e) => {
|
|
391
405
|
const { configPath: r, rootDir: s } = e, n = f.resolve(s, r), o = f.dirname(n);
|
|
392
|
-
return M(o) ||
|
|
406
|
+
return M(o) || mt(o, {
|
|
393
407
|
recursive: !0
|
|
394
|
-
}), n.endsWith(".json5") ? (
|
|
408
|
+
}), n.endsWith(".json5") ? (a.info(`json5模式写入 ${n}`), D(n, K.stringify(t, null, 2)), n) : (a.info(`json模式写入 ${n}`), D(n, JSON.stringify(t, null, 2)), n);
|
|
395
409
|
}, Ve = async (t, e, {
|
|
396
410
|
onFileGenerated: r,
|
|
397
411
|
edit: s = !1
|
|
398
412
|
} = {}) => {
|
|
399
|
-
const n = await
|
|
413
|
+
const n = await re(t, e);
|
|
400
414
|
if (r == null || r(n), s) {
|
|
401
|
-
const o = await
|
|
402
|
-
|
|
415
|
+
const o = await Zt();
|
|
416
|
+
te(e.configPath, o);
|
|
403
417
|
}
|
|
404
418
|
}, Ke = async (t, e) => {
|
|
405
419
|
const { configPath: r, rootDir: s } = t, n = f.resolve(s, r);
|
|
406
420
|
if (!M(n)) {
|
|
407
421
|
if (e)
|
|
408
|
-
return
|
|
422
|
+
return a.info("配置文件不存在,使用onNotExists返回值"), e();
|
|
409
423
|
const o = `配置文件不存在 ${n}`;
|
|
410
424
|
throw new Error(o);
|
|
411
425
|
}
|
|
412
|
-
return n.endsWith(".json5") ? (
|
|
426
|
+
return n.endsWith(".json5") ? (a.info(`json5模式解析 ${n}`), K.parse(N(n, "utf8"))) : (a.info(`json模式解析 ${n}`), JSON.parse(N(n, "utf8")));
|
|
413
427
|
}, We = async () => {
|
|
414
428
|
const { useDefaultConfig: t } = await U({
|
|
415
429
|
name: "useDefaultConfig",
|
|
@@ -418,15 +432,15 @@ const zt = async () => {
|
|
|
418
432
|
initial: !0
|
|
419
433
|
});
|
|
420
434
|
return t;
|
|
421
|
-
},
|
|
435
|
+
}, lt = "package.json", H = ({
|
|
422
436
|
rootDir: t
|
|
423
437
|
}) => {
|
|
424
|
-
const e = f.resolve(t,
|
|
438
|
+
const e = f.resolve(t, lt);
|
|
425
439
|
if (!M(e))
|
|
426
440
|
throw new Error(`${t}未找到package.json文件`);
|
|
427
441
|
const r = N(e, "utf-8");
|
|
428
442
|
return JSON.parse(r);
|
|
429
|
-
},
|
|
443
|
+
}, se = ({
|
|
430
444
|
rootDir: t,
|
|
431
445
|
pkgJson: e,
|
|
432
446
|
pkgName: r,
|
|
@@ -436,19 +450,19 @@ const zt = async () => {
|
|
|
436
450
|
let c = o == null ? void 0 : o[r];
|
|
437
451
|
if (!c) {
|
|
438
452
|
const i = s ? n.dependencies : n.devDependencies;
|
|
439
|
-
c = i == null ? void 0 : i[r], c &&
|
|
453
|
+
c = i == null ? void 0 : i[r], c && a.warn(
|
|
440
454
|
`${s ? "开发" : "生产"}依赖包${r}可能错误的安装在${s ? "dependencies" : "devDependencies"}`
|
|
441
455
|
);
|
|
442
456
|
return;
|
|
443
457
|
}
|
|
444
|
-
return c ||
|
|
458
|
+
return c || a.info(`依赖包${r}未安装`), c;
|
|
445
459
|
}, Xe = ({
|
|
446
460
|
patchConfig: t,
|
|
447
461
|
rootDir: e
|
|
448
462
|
}) => {
|
|
449
463
|
if (!t)
|
|
450
464
|
return;
|
|
451
|
-
const r = H({ rootDir: e }), s =
|
|
465
|
+
const r = H({ rootDir: e }), s = Ot(r, t), n = f.resolve(e, lt);
|
|
452
466
|
D(n, JSON.stringify(s, null, 2), "utf-8");
|
|
453
467
|
}, L = (t) => {
|
|
454
468
|
const r = p("git rev-parse --show-toplevel", {
|
|
@@ -467,14 +481,14 @@ const zt = async () => {
|
|
|
467
481
|
} catch {
|
|
468
482
|
try {
|
|
469
483
|
const r = p("git rev-parse --short HEAD").toString().trim();
|
|
470
|
-
|
|
484
|
+
a.skip(
|
|
471
485
|
`当前未指向具体某个分支, 当前commit hash: ${r}`
|
|
472
486
|
);
|
|
473
487
|
} finally {
|
|
474
488
|
return;
|
|
475
489
|
}
|
|
476
490
|
}
|
|
477
|
-
},
|
|
491
|
+
}, ne = (t) => {
|
|
478
492
|
const e = t.match(/moving\s+from\s+(.*)\s+to\s+(.*)/);
|
|
479
493
|
if (e) {
|
|
480
494
|
const [, r, s] = e;
|
|
@@ -485,41 +499,41 @@ const zt = async () => {
|
|
|
485
499
|
}
|
|
486
500
|
};
|
|
487
501
|
var y = /* @__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))(y || {});
|
|
488
|
-
const
|
|
489
|
-
const e = L(t), r =
|
|
502
|
+
const oe = "husky", ie = ".husky", ce = ({ rootDir: t }) => {
|
|
503
|
+
const e = L(t), r = se({
|
|
490
504
|
rootDir: e,
|
|
491
505
|
pkgJson: H({ rootDir: e }),
|
|
492
|
-
pkgName:
|
|
506
|
+
pkgName: oe,
|
|
493
507
|
isDevPkg: !0
|
|
494
508
|
});
|
|
495
509
|
if (!r)
|
|
496
510
|
throw new Error("husky版本获取失败, 可能husky未安装");
|
|
497
511
|
const s = r.replace(/^(\^|~)/, ""), n = "<9.0.0";
|
|
498
|
-
return
|
|
499
|
-
. "$(dirname -- "$0")/_/husky.sh"`) : (
|
|
500
|
-
},
|
|
512
|
+
return Rt.satisfies(s, n) ? (a.info(`${s}符合${n}`), `#!/usr/bin/env sh
|
|
513
|
+
. "$(dirname -- "$0")/_/husky.sh"`) : (a.info(`${s}不符合${n}`), "");
|
|
514
|
+
}, ae = ({ rootDir: t }) => {
|
|
501
515
|
const e = L(t);
|
|
502
|
-
return f.resolve(e,
|
|
516
|
+
return f.resolve(e, ie);
|
|
503
517
|
}, Ze = ({
|
|
504
518
|
hookNames: t,
|
|
505
519
|
rootDir: e,
|
|
506
520
|
getCode: r
|
|
507
521
|
}) => {
|
|
508
|
-
const s =
|
|
522
|
+
const s = ae({ rootDir: e });
|
|
509
523
|
g.existsSync(s) || g.mkdirSync(s, { recursive: !0 }), t.forEach((n) => {
|
|
510
524
|
const o = f.resolve(s, n), c = g.existsSync(o);
|
|
511
525
|
let i = r(n);
|
|
512
526
|
if (c)
|
|
513
|
-
g.readFileSync(o, "utf-8").includes(i) ?
|
|
527
|
+
g.readFileSync(o, "utf-8").includes(i) ? a.skip(
|
|
514
528
|
`${o} ${n}相关调用 ${i} 已存在 跳过`
|
|
515
529
|
) : (g.appendFileSync(
|
|
516
530
|
o,
|
|
517
531
|
`
|
|
518
532
|
${i}
|
|
519
533
|
`
|
|
520
|
-
),
|
|
534
|
+
), a.success(`${o} 添加 ${n}相关调用成功`));
|
|
521
535
|
else {
|
|
522
|
-
const u =
|
|
536
|
+
const u = ce({
|
|
523
537
|
rootDir: e
|
|
524
538
|
});
|
|
525
539
|
g.writeFileSync(
|
|
@@ -529,9 +543,9 @@ ${i}
|
|
|
529
543
|
${i}
|
|
530
544
|
`,
|
|
531
545
|
"utf-8"
|
|
532
|
-
),
|
|
546
|
+
), a.success(`${o} 添加 ${n}相关调用成功`);
|
|
533
547
|
}
|
|
534
|
-
|
|
548
|
+
Tt(o);
|
|
535
549
|
});
|
|
536
550
|
}, qe = [
|
|
537
551
|
// HooksNameEnum.PRE_MERGE_COMMIT,
|
|
@@ -560,7 +574,7 @@ ${i}
|
|
|
560
574
|
try {
|
|
561
575
|
u = p(`git config --get remote.${t}.url`).toString().trim();
|
|
562
576
|
} catch {
|
|
563
|
-
|
|
577
|
+
a.warn("git远程仓库地址获取失败或者不存在");
|
|
564
578
|
}
|
|
565
579
|
return {
|
|
566
580
|
lastHash: e,
|
|
@@ -584,9 +598,9 @@ ${i}
|
|
|
584
598
|
} : void 0
|
|
585
599
|
};
|
|
586
600
|
} catch (e) {
|
|
587
|
-
throw
|
|
601
|
+
throw a.error("获取git最后提交信息失败"), e;
|
|
588
602
|
}
|
|
589
|
-
},
|
|
603
|
+
}, ut = (t = "") => {
|
|
590
604
|
const e = /\s*Merge\s+branch\s+['|"](.+)['|"]\s+into\s+['|"](.+)['|"]\s*/i, r = t.match(e);
|
|
591
605
|
if (r) {
|
|
592
606
|
const [, i, u] = r;
|
|
@@ -610,7 +624,7 @@ ${i}
|
|
|
610
624
|
fromBranch: i
|
|
611
625
|
};
|
|
612
626
|
}
|
|
613
|
-
},
|
|
627
|
+
}, le = (t) => {
|
|
614
628
|
if (t.startsWith(F.MERGE))
|
|
615
629
|
return {
|
|
616
630
|
fromBranch: t.replace(F.MERGE, "").trim()
|
|
@@ -635,12 +649,12 @@ ${i}
|
|
|
635
649
|
}
|
|
636
650
|
};
|
|
637
651
|
var F = /* @__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))(F || {});
|
|
638
|
-
const
|
|
652
|
+
const J = "__GIT_REPLACE_MARK__", T = {
|
|
639
653
|
stringify(t) {
|
|
640
|
-
return JSON.stringify(t).replace(/"/g,
|
|
654
|
+
return JSON.stringify(t).replace(/"/g, J);
|
|
641
655
|
},
|
|
642
656
|
parse(t) {
|
|
643
|
-
return JSON.parse(t.replace(new RegExp(
|
|
657
|
+
return JSON.parse(t.replace(new RegExp(J, "g"), '"'));
|
|
644
658
|
}
|
|
645
659
|
}, rr = ({
|
|
646
660
|
count: t = 100
|
|
@@ -673,7 +687,7 @@ const Y = "__GIT_REPLACE_MARK__", T = {
|
|
|
673
687
|
const c = T.parse(o);
|
|
674
688
|
return {
|
|
675
689
|
...c,
|
|
676
|
-
mergeInfo:
|
|
690
|
+
mergeInfo: ut(c.message)
|
|
677
691
|
};
|
|
678
692
|
});
|
|
679
693
|
}, sr = ({
|
|
@@ -695,29 +709,29 @@ const Y = "__GIT_REPLACE_MARK__", T = {
|
|
|
695
709
|
)}"`
|
|
696
710
|
).toString().split(`
|
|
697
711
|
`).map((i) => T.parse(i)).filter(e).map((i) => {
|
|
698
|
-
const { fullMessage: u, ...
|
|
712
|
+
const { fullMessage: u, ...l } = i, m = ":", [h] = u.split(m, 1), O = u.slice(`${h}${m}`.length), E = h.trim(), d = O.trim();
|
|
699
713
|
let S, R, _;
|
|
700
714
|
if (E.startsWith(
|
|
701
715
|
"checkout"
|
|
702
716
|
/* CHECKOUT */
|
|
703
717
|
))
|
|
704
|
-
R =
|
|
718
|
+
R = ne(d);
|
|
705
719
|
else if (E.startsWith(
|
|
706
720
|
"merge"
|
|
707
721
|
/* MERGE */
|
|
708
722
|
))
|
|
709
|
-
S =
|
|
723
|
+
S = le(E);
|
|
710
724
|
else if (E.startsWith(
|
|
711
725
|
"commit (merge)"
|
|
712
726
|
/* COMMIT_MERGE */
|
|
713
727
|
)) {
|
|
714
|
-
const I =
|
|
715
|
-
I ||
|
|
728
|
+
const I = ut(d);
|
|
729
|
+
I || a.warn(
|
|
716
730
|
`${i.hash} 是合并提交 但是未从提交信息(${d})中检测到合并分支信息,推测手动更改了提交内容`
|
|
717
731
|
), S = I;
|
|
718
732
|
}
|
|
719
733
|
return {
|
|
720
|
-
...
|
|
734
|
+
...l,
|
|
721
735
|
type: E,
|
|
722
736
|
message: d,
|
|
723
737
|
mergeInfo: S,
|
|
@@ -744,19 +758,19 @@ const Y = "__GIT_REPLACE_MARK__", T = {
|
|
|
744
758
|
}), p(`git push ${r.alias} ${t}`, {
|
|
745
759
|
stdio: "inherit"
|
|
746
760
|
}));
|
|
747
|
-
},
|
|
761
|
+
}, ue = (t) => /^https?:\/\//.test(t), fe = (t) => /^git@/.test(t), ir = (t) => {
|
|
748
762
|
const { hostname: e, pathname: r } = new URL(t);
|
|
749
763
|
return `git@${e}:${r.replace("/", "")}`;
|
|
750
|
-
},
|
|
764
|
+
}, ge = (t) => f.resolve(t, ".git"), cr = (t) => Lt(ge(t)), pe = ({
|
|
751
765
|
dir: t,
|
|
752
766
|
fn: e,
|
|
753
767
|
endClear: r = !0,
|
|
754
768
|
exitClear: s = !0
|
|
755
769
|
}) => {
|
|
756
770
|
if (w(t))
|
|
757
|
-
return
|
|
771
|
+
return a.error(`${t} 已存在,请手动删除该目录再试`), process.exit(1);
|
|
758
772
|
const n = () => {
|
|
759
|
-
|
|
773
|
+
Mt(t);
|
|
760
774
|
};
|
|
761
775
|
s && process.once("exit", () => {
|
|
762
776
|
n();
|
|
@@ -768,19 +782,19 @@ const Y = "__GIT_REPLACE_MARK__", T = {
|
|
|
768
782
|
throw r && n(), c;
|
|
769
783
|
}
|
|
770
784
|
return r && (o instanceof Promise ? o.finally(n) : n()), o;
|
|
771
|
-
},
|
|
772
|
-
var
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
`${t}-${
|
|
777
|
-
),
|
|
778
|
-
const t =
|
|
779
|
-
ASSETS_CONFIG_REPO_URL:
|
|
785
|
+
}, me = () => Et();
|
|
786
|
+
var _e = /* @__PURE__ */ ((t) => (t.ASSETS_CONFIG_REPO_URL = "ASSETS_CONFIG_REPO_URL", t))(_e || {});
|
|
787
|
+
const Ee = (t) => f.resolve(
|
|
788
|
+
V(),
|
|
789
|
+
yt,
|
|
790
|
+
`${t}-${me()}`
|
|
791
|
+
), de = () => f.resolve(Y(), Nt), he = async () => {
|
|
792
|
+
const t = de(), e = {
|
|
793
|
+
ASSETS_CONFIG_REPO_URL: vt
|
|
780
794
|
};
|
|
781
795
|
try {
|
|
782
796
|
if (await B(t)) {
|
|
783
|
-
const r = await
|
|
797
|
+
const r = await q(t, {});
|
|
784
798
|
Object.entries(r).forEach(([s, n]) => {
|
|
785
799
|
e[s] = n;
|
|
786
800
|
});
|
|
@@ -788,32 +802,32 @@ const _e = (t) => f.resolve(
|
|
|
788
802
|
} catch {
|
|
789
803
|
}
|
|
790
804
|
return e;
|
|
791
|
-
},
|
|
805
|
+
}, Se = async (t) => {
|
|
792
806
|
if (await B(t))
|
|
793
|
-
return
|
|
807
|
+
return a.error(`${t} 已存在,请手动删除该目录再试`), process.exit(1);
|
|
794
808
|
const {
|
|
795
809
|
[
|
|
796
810
|
"ASSETS_CONFIG_REPO_URL"
|
|
797
811
|
/* ASSETS_CONFIG_REPO_URL */
|
|
798
812
|
]: e
|
|
799
|
-
} = await
|
|
800
|
-
return
|
|
813
|
+
} = await he();
|
|
814
|
+
return fe(e) || ue(e) ? p(`git clone ${e} ${t} --depth=1`) : (g.mkdirSync(t, { recursive: !0 }), p(`cp -r ${e}/ ${t}/`)), {
|
|
801
815
|
assetConfigRepoUrl: e
|
|
802
816
|
};
|
|
803
817
|
}, ar = async ({
|
|
804
818
|
moduleName: t,
|
|
805
819
|
onSuccess: e
|
|
806
|
-
}) => (
|
|
820
|
+
}) => (a.stage(`拉取${t}配置,请稍等...`), pe({
|
|
807
821
|
// 资源配置仓库临时文件夹
|
|
808
|
-
dir:
|
|
822
|
+
dir: Ee(t),
|
|
809
823
|
fn: async (r) => {
|
|
810
|
-
const { assetConfigRepoUrl: s } = await
|
|
811
|
-
|
|
824
|
+
const { assetConfigRepoUrl: s } = await Se(r), n = f.join(
|
|
825
|
+
It,
|
|
812
826
|
t
|
|
813
827
|
), o = f.join(
|
|
814
828
|
n,
|
|
815
|
-
|
|
816
|
-
), c = f.resolve(r, o), i = await
|
|
829
|
+
Pt
|
|
830
|
+
), c = f.resolve(r, o), i = await q(c);
|
|
817
831
|
return await e({
|
|
818
832
|
repoUrl: s,
|
|
819
833
|
config: i,
|
|
@@ -822,7 +836,7 @@ const _e = (t) => f.resolve(
|
|
|
822
836
|
assetsConfigRepoTempDir: r
|
|
823
837
|
}), i;
|
|
824
838
|
}
|
|
825
|
-
})),
|
|
839
|
+
})), Ce = /[^a-zA-Z0-9._\-]/, Oe = /[^a-zA-Z0-9._\-]/g, lr = (t) => t ? !Ce.test(t) : !1, ur = (t) => (t || "_").replace(Oe, "_"), fr = (t) => Object.entries(t).map(([e, r]) => `--${e}=${r}`), gr = ({
|
|
826
840
|
command: t,
|
|
827
841
|
args: e,
|
|
828
842
|
env: r,
|
|
@@ -833,31 +847,31 @@ const _e = (t) => f.resolve(
|
|
|
833
847
|
let i = !1;
|
|
834
848
|
const u = {
|
|
835
849
|
beforeInputExit: n
|
|
836
|
-
},
|
|
850
|
+
}, l = Ct(t, e, {
|
|
837
851
|
cwd: s,
|
|
838
852
|
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
839
853
|
env: {
|
|
840
854
|
...r,
|
|
841
|
-
[
|
|
855
|
+
[z]: JSON.stringify(
|
|
842
856
|
u
|
|
843
857
|
)
|
|
844
858
|
}
|
|
845
859
|
}), m = () => {
|
|
846
|
-
i = !0,
|
|
860
|
+
i = !0, l.removeAllListeners();
|
|
847
861
|
}, h = (_) => {
|
|
848
862
|
i || (m(), c(_));
|
|
849
863
|
}, O = (_) => {
|
|
850
|
-
if (
|
|
864
|
+
if (a.debug("劫持子进程消息:", _, i), !i)
|
|
851
865
|
switch (_.type) {
|
|
852
866
|
}
|
|
853
867
|
};
|
|
854
|
-
|
|
868
|
+
l.once("error", h), l.on("message", O);
|
|
855
869
|
let E = "", d = "";
|
|
856
|
-
(S =
|
|
870
|
+
(S = l.stdout) == null || S.on("data", (_) => {
|
|
857
871
|
E += _;
|
|
858
|
-
}), (R =
|
|
872
|
+
}), (R = l.stderr) == null || R.on("data", (_) => {
|
|
859
873
|
d += _;
|
|
860
|
-
}),
|
|
874
|
+
}), l.once("exit", (_, I) => {
|
|
861
875
|
if (i)
|
|
862
876
|
return;
|
|
863
877
|
m();
|
|
@@ -872,9 +886,9 @@ const _e = (t) => f.resolve(
|
|
|
872
886
|
});
|
|
873
887
|
});
|
|
874
888
|
export {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
889
|
+
_e as DoneCodingCliGlobalConfigKeyEnum,
|
|
890
|
+
zt as EditorTypeEnum,
|
|
891
|
+
Gt as EnvConfigProcessKeyEnum,
|
|
878
892
|
F as GitRefLogTypeEnum,
|
|
879
893
|
y as HooksNameEnum,
|
|
880
894
|
qe as SUPPORT_GET_COMMIT_BY_HOOKS_NAMES,
|
|
@@ -883,7 +897,7 @@ export {
|
|
|
883
897
|
Rr as _set,
|
|
884
898
|
Ze as addHuskyHooks,
|
|
885
899
|
Xe as addPackageConfig,
|
|
886
|
-
|
|
900
|
+
pe as applyUseTempDir,
|
|
887
901
|
w as assetIsExits,
|
|
888
902
|
B as assetIsExitsAsync,
|
|
889
903
|
Nr as chalk,
|
|
@@ -893,59 +907,59 @@ export {
|
|
|
893
907
|
_r as dayjs,
|
|
894
908
|
He as decryptAES,
|
|
895
909
|
Ue as encryptAES,
|
|
896
|
-
|
|
910
|
+
Tt as fileAddX,
|
|
897
911
|
je as generateGetAnswerSwiftFn,
|
|
898
|
-
|
|
899
|
-
|
|
912
|
+
Kt as getAnswer,
|
|
913
|
+
Ee as getCliModuleTempDir,
|
|
900
914
|
Qe as getCommitByHookName,
|
|
901
915
|
Ye as getConfigFileCommonOptions,
|
|
902
916
|
rr as getCurrentBranchLastCommitList,
|
|
903
917
|
ze as getCurrentBranchName,
|
|
904
|
-
|
|
905
|
-
|
|
918
|
+
rt as getCurrentProcessLogFileName,
|
|
919
|
+
Zt as getEditorType,
|
|
906
920
|
tr as getGitLastCommitInfo,
|
|
907
|
-
|
|
921
|
+
ge as getGitPath,
|
|
908
922
|
L as getGitProjectDir,
|
|
909
923
|
sr as getLastReflogList,
|
|
910
|
-
|
|
924
|
+
jt as getLogOutputDir,
|
|
911
925
|
H as getPackageJson,
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
926
|
+
kt as getParentProcessLogFileName,
|
|
927
|
+
Ht as getProcessCreateByHijackPresetInfo,
|
|
928
|
+
tt as getProcessEnv,
|
|
929
|
+
se as getRelyPkgVersion,
|
|
930
|
+
ee as getRootDirOptions,
|
|
917
931
|
ke as getRootScriptName,
|
|
918
932
|
ur as getSafePath,
|
|
919
933
|
We as getUseDefaultConfig,
|
|
920
934
|
gr as hijackChildProcess,
|
|
921
935
|
ir as http2sshGitUrl,
|
|
922
|
-
|
|
936
|
+
re as initConfigFile,
|
|
923
937
|
Ve as initHandlerCommon,
|
|
924
|
-
|
|
925
|
-
|
|
938
|
+
ue as isHttpGitUrl,
|
|
939
|
+
fe as isSshGitUrl,
|
|
926
940
|
hr as json5,
|
|
927
|
-
|
|
941
|
+
xt as logger,
|
|
928
942
|
Be as lookForParentTarget,
|
|
929
|
-
|
|
930
|
-
|
|
943
|
+
te as openFileInEditor,
|
|
944
|
+
a as outputConsole,
|
|
931
945
|
fr as params2cliParams,
|
|
932
946
|
lr as pathIsSafe,
|
|
933
|
-
|
|
947
|
+
Ut as processIsHijacked,
|
|
934
948
|
or as pushGitPublishInfoToRemote,
|
|
935
949
|
ar as readCliModuleAssetsConfig,
|
|
936
950
|
Ke as readConfigFile,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
951
|
+
$t as readFile,
|
|
952
|
+
Dt as readFileAsync,
|
|
953
|
+
be as readJsonFile,
|
|
954
|
+
q as readJsonFileAsync,
|
|
955
|
+
Mt as removeAsset,
|
|
956
|
+
Lt as removeAssetAsync,
|
|
957
|
+
ne as resolveCheckoutInfoByRefInfo,
|
|
958
|
+
ut as resolveMergeInfoByCommitMsg,
|
|
945
959
|
er as resolveMergeInfoByGitReflogAction,
|
|
946
|
-
|
|
960
|
+
le as resolveMergeInfoByRefType,
|
|
947
961
|
cr as rmGitCtrlAsync,
|
|
948
|
-
|
|
949
|
-
|
|
962
|
+
we as updateEnvConfig,
|
|
963
|
+
me as uuidv4,
|
|
950
964
|
U as xPrompts
|
|
951
965
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-utils",
|
|
3
|
-
"version": "0.8.3-alpha.
|
|
3
|
+
"version": "0.8.3-alpha.1",
|
|
4
4
|
"description": "cli utils",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=18.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c316dae3339308b554618b88b3e826502c5fc9f1"
|
|
73
73
|
}
|