@nemo-cli/shared 0.1.3 → 0.1.5
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/dist/adapters-C49sidhk.js +246 -0
- package/dist/adapters-C49sidhk.js.map +1 -0
- package/dist/adapters-CRVRGWT9.js +246 -0
- package/dist/adapters-CRVRGWT9.js.map +1 -0
- package/dist/adapters-VexOYXht.js +234 -0
- package/dist/adapters-VexOYXht.js.map +1 -0
- package/dist/index.d.ts +323 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1335 -265
- package/dist/index.js.map +1 -1
- package/dist/prompts-BpcevOrt.js +380 -0
- package/dist/prompts-BpcevOrt.js.map +1 -0
- package/package.json +5 -6
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { t as __exportAll } from "./index.js";
|
|
2
|
+
import { cancel, confirm, group, groupMultiselect, intro, isCancel, log, multiselect, note, outro, progress, select, spinner, stream, taskLog, tasks, text } from "@clack/prompts";
|
|
3
|
+
import ansiEscapes from "ansi-escapes";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import winston from "winston";
|
|
6
|
+
import process$1 from "node:process";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
import { x } from "tinyexec";
|
|
9
|
+
import { $ } from "zx";
|
|
10
|
+
import { ErrorMessage } from "@nemo-cli/ui";
|
|
11
|
+
import { search } from "@inquirer/prompts";
|
|
12
|
+
import Fuse from "fuse.js";
|
|
13
|
+
|
|
14
|
+
//#region src/utils/types.ts
|
|
15
|
+
const hasOwn = (target, key) => Object.hasOwn(target, key);
|
|
16
|
+
const has = (target, key) => Reflect.has(target, key);
|
|
17
|
+
const isType = (type) => (obj) => Object.prototype.toString.call(obj) === `[object ${type}]`;
|
|
18
|
+
const isString = isType("String");
|
|
19
|
+
const isNumber = isType("Number");
|
|
20
|
+
const isBoolean = isType("Boolean");
|
|
21
|
+
const isNull = isType("Null");
|
|
22
|
+
const isUndefined = isType("Undefined");
|
|
23
|
+
const isError = isType("Error");
|
|
24
|
+
const isPromise = isType("Promise");
|
|
25
|
+
const isPlainObject$1 = isType("Object");
|
|
26
|
+
const isArray = isType("Array");
|
|
27
|
+
const isDate = isType("Date");
|
|
28
|
+
const isFunction = isType("Function");
|
|
29
|
+
const isSymbol = isType("Symbol");
|
|
30
|
+
const isSet = isType("Set");
|
|
31
|
+
const isMap = isType("Map");
|
|
32
|
+
const isFormData = isType("FormData");
|
|
33
|
+
const isURLSearchParams = isType("URLSearchParams");
|
|
34
|
+
const isEmpty = (value) => {
|
|
35
|
+
if (value == null) return true;
|
|
36
|
+
if (isString(value)) return value.trim() === "";
|
|
37
|
+
if (isNumber(value)) return !Number.isFinite(value);
|
|
38
|
+
if (isArray(value)) return value.length === 0;
|
|
39
|
+
if (isPlainObject$1(value)) return Object.keys(value).length === 0;
|
|
40
|
+
return false;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils/log.ts
|
|
45
|
+
const customLevels = {
|
|
46
|
+
levels: {
|
|
47
|
+
error: 0,
|
|
48
|
+
warn: 1,
|
|
49
|
+
success: 2,
|
|
50
|
+
info: 3,
|
|
51
|
+
verbose: 4,
|
|
52
|
+
silly: 5,
|
|
53
|
+
timing: 6
|
|
54
|
+
},
|
|
55
|
+
colors: {
|
|
56
|
+
error: "red",
|
|
57
|
+
warn: "yellow",
|
|
58
|
+
success: "green",
|
|
59
|
+
info: "blue",
|
|
60
|
+
verbose: "cyan",
|
|
61
|
+
silly: "magenta",
|
|
62
|
+
timing: "grey"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const DEFAULT_OPTIONS = {
|
|
66
|
+
heading: "@nemo-cli",
|
|
67
|
+
level: "warn"
|
|
68
|
+
};
|
|
69
|
+
winston.addColors(customLevels.colors);
|
|
70
|
+
const init = (customOptions) => {
|
|
71
|
+
const options = {
|
|
72
|
+
...customOptions,
|
|
73
|
+
...DEFAULT_OPTIONS
|
|
74
|
+
};
|
|
75
|
+
return winston.createLogger({
|
|
76
|
+
level: options.level,
|
|
77
|
+
levels: customLevels.levels,
|
|
78
|
+
format: winston.format.combine(winston.format.colorize({ all: true })),
|
|
79
|
+
transports: [new winston.transports.Console({ format: winston.format.simple() })]
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
const logger = init();
|
|
83
|
+
const transformMessage = (messages) => {
|
|
84
|
+
for (let i = 0; i < messages.length; i++) {
|
|
85
|
+
const [current, next] = [messages[i], messages[i + 1]];
|
|
86
|
+
if (isString(current) && isString(next)) messages.splice(i, 2, `${current}${next}`);
|
|
87
|
+
}
|
|
88
|
+
return messages;
|
|
89
|
+
};
|
|
90
|
+
const log$1 = {
|
|
91
|
+
init,
|
|
92
|
+
get level() {
|
|
93
|
+
throw new Error("can't visit level");
|
|
94
|
+
},
|
|
95
|
+
set level(_) {
|
|
96
|
+
throw new Error("use setLevel");
|
|
97
|
+
},
|
|
98
|
+
setLevel(level) {
|
|
99
|
+
logger.level = level;
|
|
100
|
+
},
|
|
101
|
+
stopDebug() {
|
|
102
|
+
logger.level = "warn";
|
|
103
|
+
logger.warn("current winston level", logger.level);
|
|
104
|
+
},
|
|
105
|
+
show(message = "", options) {
|
|
106
|
+
const text = options?.colors?.bold(message) ?? message;
|
|
107
|
+
const type = options?.type ?? "info";
|
|
108
|
+
if (options?.symbol) log.message(text, { symbol: options.symbol });
|
|
109
|
+
else log[type](text);
|
|
110
|
+
},
|
|
111
|
+
info(...messages) {
|
|
112
|
+
for (const message of transformMessage(messages)) if (isString(message)) logger.info(`${message}`);
|
|
113
|
+
else logger.info(`${JSON.stringify(message, null, 2)}`);
|
|
114
|
+
},
|
|
115
|
+
warn(...messages) {
|
|
116
|
+
for (const message of transformMessage(messages)) if (isString(message)) logger.warn(`${message}`);
|
|
117
|
+
else logger.warn(`${JSON.stringify(message, null, 2)}`);
|
|
118
|
+
},
|
|
119
|
+
debug() {
|
|
120
|
+
logger.warn("current winston level", logger.level);
|
|
121
|
+
},
|
|
122
|
+
timing(time) {
|
|
123
|
+
logger.log("timing", `${time}`);
|
|
124
|
+
},
|
|
125
|
+
error(...messages) {
|
|
126
|
+
for (const message of transformMessage(messages)) if (isString(message)) logger.error(`${chalk.red.bgBlack(message)}`);
|
|
127
|
+
else console.log(message);
|
|
128
|
+
},
|
|
129
|
+
verbose(...messages) {
|
|
130
|
+
for (const message of transformMessage(messages)) if (isString(message)) logger.verbose(`${message}`);
|
|
131
|
+
else logger.verbose(`${JSON.stringify(message, null, 2)}`);
|
|
132
|
+
},
|
|
133
|
+
success(...messages) {
|
|
134
|
+
for (const message of transformMessage(messages)) if (isString(message)) logger.log("success", `${chalk.green.bgBlack(message)}`);
|
|
135
|
+
else console.log(message);
|
|
136
|
+
},
|
|
137
|
+
clearScreen() {
|
|
138
|
+
process.stdout.write(ansiEscapes.clearScreen);
|
|
139
|
+
},
|
|
140
|
+
clearTerminal() {
|
|
141
|
+
process.stdout.write(ansiEscapes.clearTerminal);
|
|
142
|
+
},
|
|
143
|
+
beep() {
|
|
144
|
+
process.stdout.write(ansiEscapes.beep);
|
|
145
|
+
},
|
|
146
|
+
scrollDown() {
|
|
147
|
+
process.stdout.write(ansiEscapes.scrollDown);
|
|
148
|
+
},
|
|
149
|
+
scrollUp() {
|
|
150
|
+
process.stdout.write(ansiEscapes.scrollUp);
|
|
151
|
+
},
|
|
152
|
+
eraseEndLine() {
|
|
153
|
+
process.stdout.write(ansiEscapes.cursorPrevLine);
|
|
154
|
+
process.stdout.write(ansiEscapes.eraseLine);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
160
|
+
function isPlainObject(value) {
|
|
161
|
+
if (!value || typeof value !== "object") return false;
|
|
162
|
+
const proto = Object.getPrototypeOf(value);
|
|
163
|
+
if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
|
|
164
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
169
|
+
function isUnsafeProperty(key) {
|
|
170
|
+
return key === "__proto__";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/object/merge.mjs
|
|
175
|
+
function merge(target, source) {
|
|
176
|
+
const sourceKeys = Object.keys(source);
|
|
177
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
178
|
+
const key = sourceKeys[i];
|
|
179
|
+
if (isUnsafeProperty(key)) continue;
|
|
180
|
+
const sourceValue = source[key];
|
|
181
|
+
const targetValue = target[key];
|
|
182
|
+
if (isMergeableValue(sourceValue) && isMergeableValue(targetValue)) target[key] = merge(targetValue, sourceValue);
|
|
183
|
+
else if (Array.isArray(sourceValue)) target[key] = merge([], sourceValue);
|
|
184
|
+
else if (isPlainObject(sourceValue)) target[key] = merge({}, sourceValue);
|
|
185
|
+
else if (targetValue === void 0 || sourceValue !== void 0) target[key] = sourceValue;
|
|
186
|
+
}
|
|
187
|
+
return target;
|
|
188
|
+
}
|
|
189
|
+
function isMergeableValue(value) {
|
|
190
|
+
return isPlainObject(value) || Array.isArray(value);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/utils/error.ts
|
|
195
|
+
const handleError = (err, message) => {
|
|
196
|
+
if (isError(err)) ErrorMessage({ text: `${message}: ${err.message}` });
|
|
197
|
+
else if (isString(err)) ErrorMessage({ text: `${message}: ${err}` });
|
|
198
|
+
else log$1.error(message, err);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/utils/command.ts
|
|
203
|
+
const exit = (code) => process$1.exit(code);
|
|
204
|
+
const createHelpExample = (...commands) => {
|
|
205
|
+
return `
|
|
206
|
+
Example:
|
|
207
|
+
${commands.map((command) => ` $ ${command}`).join("\n")}
|
|
208
|
+
`;
|
|
209
|
+
};
|
|
210
|
+
const createCommand = (name) => {
|
|
211
|
+
const command = new Command(name);
|
|
212
|
+
command.allowExcessArguments();
|
|
213
|
+
command.allowUnknownOption();
|
|
214
|
+
return command;
|
|
215
|
+
};
|
|
216
|
+
const buildCommand = (command, dynamicParts = []) => {
|
|
217
|
+
return {
|
|
218
|
+
command,
|
|
219
|
+
parts: dynamicParts.filter((part) => !isEmpty(part)).map((part) => part?.toString())
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
const x$1 = (command, args, options = {}) => {
|
|
223
|
+
return x(command, args, merge({
|
|
224
|
+
nodeOptions: {
|
|
225
|
+
cwd: process$1.cwd(),
|
|
226
|
+
FORCE_COLOR: "1"
|
|
227
|
+
},
|
|
228
|
+
throwOnError: true
|
|
229
|
+
}, options));
|
|
230
|
+
};
|
|
231
|
+
const zx = (baseCommand, dynamicParts = [], options = {}) => {
|
|
232
|
+
const { command, parts } = buildCommand(baseCommand, dynamicParts);
|
|
233
|
+
const { signal } = new AbortController();
|
|
234
|
+
try {
|
|
235
|
+
return (isEmpty(options) ? $ : $({
|
|
236
|
+
...options,
|
|
237
|
+
signal
|
|
238
|
+
}))`${command} ${parts}`;
|
|
239
|
+
} catch (error) {
|
|
240
|
+
handleError(error, `Failed to execute dynamic command: ${command}`);
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
const xASync = async (command, args, options) => {
|
|
245
|
+
try {
|
|
246
|
+
const { timeout, quiet, ...execOptions } = options ?? {};
|
|
247
|
+
const execPromise = x(command, args, merge({
|
|
248
|
+
nodeOptions: {
|
|
249
|
+
cwd: process$1.cwd(),
|
|
250
|
+
FORCE_COLOR: "1"
|
|
251
|
+
},
|
|
252
|
+
throwOnError: true
|
|
253
|
+
}, execOptions));
|
|
254
|
+
const result = timeout ? await Promise.race([execPromise, new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error(`Command timeout after ${timeout}ms`)), timeout))]) : await execPromise;
|
|
255
|
+
if (result.exitCode) {
|
|
256
|
+
if (!quiet) {
|
|
257
|
+
log$1.show(`Failed to execute command ${command}. Command exited with code ${result.exitCode}.`, { type: "error" });
|
|
258
|
+
log$1.show(result.stderr, { type: "error" });
|
|
259
|
+
}
|
|
260
|
+
return [new Error(result.stderr), null];
|
|
261
|
+
}
|
|
262
|
+
return [null, result];
|
|
263
|
+
} catch (error) {
|
|
264
|
+
handleError(error, `Failed to execute command ${command}.`);
|
|
265
|
+
return [isError(error) ? error : new Error(error), null];
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/utils/prompts.ts
|
|
271
|
+
var prompts_exports = /* @__PURE__ */ __exportAll({
|
|
272
|
+
createCheckbox: () => createCheckbox,
|
|
273
|
+
createConfirm: () => createConfirm,
|
|
274
|
+
createGroup: () => createGroup,
|
|
275
|
+
createGroupMultiSelect: () => createGroupMultiSelect,
|
|
276
|
+
createInput: () => createInput,
|
|
277
|
+
createNote: () => createNote,
|
|
278
|
+
createOptions: () => createOptions,
|
|
279
|
+
createSearch: () => createSearch,
|
|
280
|
+
createSelect: () => createSelect,
|
|
281
|
+
createShowList: () => createShowList,
|
|
282
|
+
createSpinner: () => createSpinner,
|
|
283
|
+
createTaskLog: () => createTaskLog,
|
|
284
|
+
createTasks: () => createTasks,
|
|
285
|
+
intro: () => intro,
|
|
286
|
+
outro: () => outro,
|
|
287
|
+
progress: () => progress,
|
|
288
|
+
stream: () => stream
|
|
289
|
+
});
|
|
290
|
+
const createOptions = (options) => options.map((option) => ({
|
|
291
|
+
label: option.toString(),
|
|
292
|
+
value: option
|
|
293
|
+
}));
|
|
294
|
+
const createPrompt = (fn) => {
|
|
295
|
+
return async (options) => {
|
|
296
|
+
const result = await fn(options);
|
|
297
|
+
if (isCancel(result)) {
|
|
298
|
+
cancel("User cancelled");
|
|
299
|
+
exit(0);
|
|
300
|
+
}
|
|
301
|
+
return result;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
const createShowList = createPrompt((options) => {
|
|
305
|
+
options.map((option) => {
|
|
306
|
+
return isString(option) ? option : option.label;
|
|
307
|
+
}).forEach((item) => {
|
|
308
|
+
log$1.show(item, { type: "step" });
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
const createSearch = ({ message, options }) => {
|
|
312
|
+
const fuse = new Fuse(options, { keys: ["label"] });
|
|
313
|
+
return search({
|
|
314
|
+
message,
|
|
315
|
+
source: (term) => {
|
|
316
|
+
if (!term) return options;
|
|
317
|
+
return fuse.search(term).map(({ item }) => item);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
process.on("uncaughtException", (error) => {
|
|
322
|
+
if (error instanceof Error && error.name === "ExitPromptError") log$1.show("User cancelled", { type: "error" });
|
|
323
|
+
else throw error;
|
|
324
|
+
});
|
|
325
|
+
const createCheckbox = async (opts) => {
|
|
326
|
+
const result = await multiselect(opts);
|
|
327
|
+
if (isCancel(result)) {
|
|
328
|
+
cancel("User cancelled");
|
|
329
|
+
exit(0);
|
|
330
|
+
}
|
|
331
|
+
return result;
|
|
332
|
+
};
|
|
333
|
+
const createNote = ({ message = "", title = "", opts }) => note(message, title, opts);
|
|
334
|
+
const createConfirm = createPrompt(confirm);
|
|
335
|
+
const createTasks = createPrompt(tasks);
|
|
336
|
+
const createSelect = async (opts) => {
|
|
337
|
+
const result = await select(opts);
|
|
338
|
+
if (isCancel(result)) {
|
|
339
|
+
cancel("User cancelled");
|
|
340
|
+
exit(0);
|
|
341
|
+
}
|
|
342
|
+
return result;
|
|
343
|
+
};
|
|
344
|
+
const createInput = async (opts) => {
|
|
345
|
+
const result = await text(opts);
|
|
346
|
+
if (isCancel(result)) {
|
|
347
|
+
cancel("User cancelled");
|
|
348
|
+
exit(0);
|
|
349
|
+
}
|
|
350
|
+
return result;
|
|
351
|
+
};
|
|
352
|
+
const createGroupMultiSelect = async (opts) => {
|
|
353
|
+
const result = await groupMultiselect(opts);
|
|
354
|
+
if (isCancel(result)) {
|
|
355
|
+
cancel("User cancelled");
|
|
356
|
+
process.exit(0);
|
|
357
|
+
}
|
|
358
|
+
return result;
|
|
359
|
+
};
|
|
360
|
+
const createGroup = async (opts) => {
|
|
361
|
+
const result = await group(opts);
|
|
362
|
+
if (isCancel(result)) {
|
|
363
|
+
cancel("User cancelled");
|
|
364
|
+
exit(0);
|
|
365
|
+
}
|
|
366
|
+
return result;
|
|
367
|
+
};
|
|
368
|
+
const createSpinner = (message, options) => {
|
|
369
|
+
const s = spinner(options);
|
|
370
|
+
s.start(message);
|
|
371
|
+
return s;
|
|
372
|
+
};
|
|
373
|
+
const createTaskLog = (title, options) => taskLog({
|
|
374
|
+
title,
|
|
375
|
+
...options
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
//#endregion
|
|
379
|
+
export { has as A, isNull as B, exit as C, handleError as D, zx as E, isEmpty as F, isString as G, isPlainObject$1 as H, isError as I, isUndefined as J, isSymbol as K, isFormData as L, isArray as M, isBoolean as N, log$1 as O, isDate as P, isFunction as R, createHelpExample as S, xASync as T, isPromise as U, isNumber as V, isSet as W, prompts_exports as _, createInput as a, buildCommand as b, createSearch as c, createSpinner as d, createTaskLog as f, progress as g, outro as h, createGroupMultiSelect as i, hasOwn as j, logger as k, createSelect as l, intro as m, createConfirm as n, createNote as o, createTasks as p, isURLSearchParams as q, createGroup as r, createOptions as s, createCheckbox as t, createShowList as u, stream as v, x$1 as w, createCommand as x, $ as y, isMap as z };
|
|
380
|
+
//# sourceMappingURL=prompts-BpcevOrt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-BpcevOrt.js","names":["isPlainObject","log","process","x","tinyexec"],"sources":["../src/utils/types.ts","../src/utils/log.ts","../../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs","../../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","../../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/object/merge.mjs","../src/utils/error.ts","../src/utils/command.ts","../src/utils/prompts.ts"],"sourcesContent":["export const hasOwn = (target: Record<string, unknown>, key: PropertyKey): boolean => Object.hasOwn(target, key)\nexport const has = <T extends object, K extends PropertyKey>(target: T, key: K): boolean => Reflect.has(target, key)\n\nconst isType =\n <T0>(type: string) =>\n <T1 extends T0 = T0>(obj: unknown): obj is T1 =>\n Object.prototype.toString.call(obj) === `[object ${type}]`\n\nexport const isString = isType<string>('String')\nexport const isNumber = isType<number>('Number')\nexport const isBoolean = isType<boolean>('Boolean')\nexport const isNull = isType<null>('Null')\nexport const isUndefined = isType<undefined>('Undefined')\n\nexport const isError = isType<Error>('Error')\n\nexport const isPromise = isType<Promise<unknown>>('Promise')\nexport const isPlainObject = isType<Record<string, unknown>>('Object')\nexport const isArray = isType<unknown[]>('Array')\nexport const isDate = isType<Date>('Date')\nexport const isFunction = isType<AnyFunction>('Function')\n\nexport const isSymbol = isType<symbol>('Symbol')\nexport const isSet = isType<Set<unknown>>('Set')\nexport const isMap = isType<Map<unknown, unknown>>('Map')\nexport const isFormData = isType<FormData>('FormData')\nexport const isURLSearchParams = isType<URLSearchParams>('URLSearchParams')\n\nexport const isEmpty = (value: unknown): value is null | undefined | '' | [] | Record<string, never> => {\n if (value == null) return true\n if (isString(value)) return value.trim() === ''\n if (isNumber(value)) return !Number.isFinite(value)\n if (isArray(value)) return value.length === 0\n if (isPlainObject(value)) return Object.keys(value).length === 0\n return false\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: need to use any\nexport type AnyFunction = (...args: any) => any\n","import { log as clackLog } from '@clack/prompts'\nimport ansiEscapes from 'ansi-escapes'\nimport chalk from 'chalk'\nimport winston from 'winston'\n\nimport type { ColorInstance } from './color'\nimport { isString } from './types'\n\n// type LogLevels = \"silly\" | \"verbose\" | \"info\" | \"timing\" | \"http\" | \"notice\" | \"warn\" | \"error\" | \"silent\";\nconst customLevels = {\n levels: {\n error: 0,\n warn: 1,\n success: 2,\n info: 3,\n verbose: 4,\n silly: 5,\n timing: 6,\n },\n colors: {\n error: 'red',\n warn: 'yellow',\n success: 'green',\n info: 'blue',\n verbose: 'cyan',\n silly: 'magenta',\n timing: 'grey',\n },\n}\nconst DEFAULT_OPTIONS = {\n heading: '@nemo-cli',\n level: 'warn',\n}\n\nwinston.addColors(customLevels.colors)\n\nconst init = (customOptions?: typeof DEFAULT_OPTIONS) => {\n const options = { ...customOptions, ...DEFAULT_OPTIONS }\n const logger = winston.createLogger({\n level: options.level,\n levels: customLevels.levels,\n format: winston.format.combine(winston.format.colorize({ all: true })),\n transports: [\n new winston.transports.Console({\n format: winston.format.simple(),\n }),\n ],\n })\n return logger\n}\n\nexport const logger = init()\n\nconst transformMessage = (messages: unknown[]) => {\n for (let i = 0; i < messages.length; i++) {\n const [current, next] = [messages[i], messages[i + 1]]\n if (isString(current) && isString(next)) {\n messages.splice(i, 2, `${current}${next}`)\n }\n }\n return messages\n}\n\nexport const log = {\n init,\n get level() {\n throw new Error(\"can't visit level\")\n },\n set level(_: unknown) {\n throw new Error('use setLevel')\n },\n setLevel(level: keyof typeof customLevels.levels) {\n logger.level = level\n },\n stopDebug() {\n logger.level = 'warn'\n logger.warn('current winston level', logger.level)\n },\n show(\n message = '',\n options?: {\n symbol?: string\n colors?: ColorInstance\n type?: 'info' | 'success' | 'step' | 'warn' | 'error' | 'message'\n }\n ) {\n const text = options?.colors?.bold(message) ?? message\n const type = options?.type ?? 'info'\n\n if (options?.symbol) {\n clackLog.message(text, { symbol: options.symbol })\n } else {\n clackLog[type](text)\n }\n },\n info(...messages: unknown[]) {\n for (const message of transformMessage(messages)) {\n if (isString(message)) {\n logger.info(`${message}`)\n } else {\n logger.info(`${JSON.stringify(message, null, 2)}`)\n }\n }\n },\n warn(...messages: unknown[]) {\n for (const message of transformMessage(messages)) {\n if (isString(message)) {\n logger.warn(`${message}`)\n } else {\n logger.warn(`${JSON.stringify(message, null, 2)}`)\n }\n }\n },\n debug() {\n // logger.level = 'silly'\n logger.warn('current winston level', logger.level)\n },\n timing(time: string | number) {\n logger.log('timing', `${time}`)\n },\n error(...messages: unknown[]) {\n for (const message of transformMessage(messages)) {\n if (isString(message)) {\n logger.error(`${chalk.red.bgBlack(message)}`)\n } else {\n // fallback to console for non-string\n console.log(message)\n }\n }\n },\n verbose(...messages: unknown[]) {\n for (const message of transformMessage(messages)) {\n if (isString(message)) {\n logger.verbose(`${message}`)\n } else {\n logger.verbose(`${JSON.stringify(message, null, 2)}`)\n }\n }\n },\n success(...messages: unknown[]) {\n for (const message of transformMessage(messages)) {\n if (isString(message)) {\n logger.log('success', `${chalk.green.bgBlack(message)}`)\n } else {\n console.log(message)\n }\n }\n },\n clearScreen() {\n process.stdout.write(ansiEscapes.clearScreen)\n },\n clearTerminal() {\n process.stdout.write(ansiEscapes.clearTerminal)\n },\n beep() {\n process.stdout.write(ansiEscapes.beep)\n },\n scrollDown() {\n process.stdout.write(ansiEscapes.scrollDown)\n },\n scrollUp() {\n process.stdout.write(ansiEscapes.scrollUp)\n },\n eraseEndLine() {\n process.stdout.write(ansiEscapes.cursorPrevLine)\n process.stdout.write(ansiEscapes.eraseLine)\n },\n}\n","function isPlainObject(value) {\n if (!value || typeof value !== 'object') {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n const hasObjectPrototype = proto === null ||\n proto === Object.prototype ||\n Object.getPrototypeOf(proto) === null;\n if (!hasObjectPrototype) {\n return false;\n }\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\nexport { isPlainObject };\n","function isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexport { isUnsafeProperty };\n","import { isUnsafeProperty } from '../_internal/isUnsafeProperty.mjs';\nimport { isPlainObject } from '../predicate/isPlainObject.mjs';\n\nfunction merge(target, source) {\n const sourceKeys = Object.keys(source);\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n if (isUnsafeProperty(key)) {\n continue;\n }\n const sourceValue = source[key];\n const targetValue = target[key];\n if (isMergeableValue(sourceValue) && isMergeableValue(targetValue)) {\n target[key] = merge(targetValue, sourceValue);\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = merge([], sourceValue);\n }\n else if (isPlainObject(sourceValue)) {\n target[key] = merge({}, sourceValue);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\nfunction isMergeableValue(value) {\n return isPlainObject(value) || Array.isArray(value);\n}\n\nexport { merge };\n","import { ErrorMessage } from '@nemo-cli/ui'\nimport { log } from './log'\nimport { isError, isString } from './types'\n\nexport const handleError = (err: unknown, message: string) => {\n if (isError(err)) {\n ErrorMessage({ text: `${message}: ${err.message}` })\n } else if (isString(err)) {\n ErrorMessage({ text: `${message}: ${err}` })\n } else {\n log.error(message, err)\n }\n}\n","import process from 'node:process'\nimport { Command } from 'commander'\nimport { merge } from 'es-toolkit'\nimport { type Options, type Output, type Result, x as tinyexec } from 'tinyexec'\nimport { $, type ProcessPromise, type Options as ZXOptions } from 'zx'\n\nimport { handleError } from './error'\nimport { log } from './log'\nimport { isEmpty, isError } from './types'\n// import { isEmpty, isString } from './types'\n\nexport const exit = (code: number) => process.exit(code)\n\nexport const createHelpExample = (...commands: string[]) => {\n const commandsString = commands.map((command) => ` $ ${command}`).join('\\n')\n return `\nExample:\n${commandsString}\n`\n}\n\nexport const createCommand = (name: string): Command => {\n const command = new Command(name)\n command.allowExcessArguments()\n command.allowUnknownOption()\n\n return command\n}\n\n// 动态命令构建器\n// export interface DynamicCommandOptions extends Partial<ZxOptions> {\n// // 环境变量\n// env?: Record<string, string>\n// // 工作目录\n// cwd?: string\n// // 是否静默输出\n// quiet?: boolean\n// // 超时时间(毫秒)\n// timeout?: number\n// // 命令前缀\n// prefix?: string\n// }\n\n// 动态命令构建函数\nexport const buildCommand = (command: string, dynamicParts: (string | number | boolean | null | undefined)[] = []) => {\n const validParts = dynamicParts.filter((part) => !isEmpty(part)).map((part) => part?.toString())\n\n return {\n command,\n parts: validParts,\n }\n}\n\n// 增强的动态命令执行函数\nexport const x = (command: string, args?: string[], options: Partial<Options> = {}) => {\n const m = merge(\n {\n nodeOptions: {\n cwd: process.cwd(),\n FORCE_COLOR: '1',\n },\n throwOnError: true,\n },\n options\n )\n return tinyexec(command, args, m)\n}\n\n// 新增:动态命令执行器\nexport { $ }\nexport const zx = (\n baseCommand: string,\n dynamicParts: (string | number | boolean | null | undefined)[] = [],\n options: Partial<ZXOptions> = {}\n): ProcessPromise => {\n const { command, parts } = buildCommand(baseCommand, dynamicParts)\n const { signal } = new AbortController()\n\n try {\n const $$ = isEmpty(options) ? $ : $({ ...options, signal })\n\n return $$`${command} ${parts}`\n } catch (error: unknown) {\n handleError(error, `Failed to execute dynamic command: ${command}`)\n throw error\n }\n}\n\n// 模板字符串命令构建器\n// export const template = (strings: TemplateStringsArray, ...values: any[]) => {\n// return strings.reduce((result, string, i) => {\n// const value = values[i] ? String(values[i]) : ''\n// return result + string + value\n// }, '')\n// }\n\n// 条件命令构建器\n// export const conditionalX = async (\n// conditions: Array<{\n// condition: boolean | (() => boolean)\n// command: string\n// args?: string[]\n// options?: DynamicCommandOptions\n// }>\n// ) => {\n// for (const { condition, command, args = [], options = {} } of conditions) {\n// const shouldExecute = typeof condition === 'function' ? condition() : condition\n\n// if (shouldExecute) {\n// return await dynamicX(command, args, options)\n// }\n// }\n\n// throw new Error('No conditions matched for conditional command execution')\n// }\n\n// 并行命令执行器\n// export const parallelX = async (\n// commands: Array<{\n// command: string\n// args?: string[]\n// options?: DynamicCommandOptions\n// }>\n// ) => {\n// const promises = commands.map(({ command, args = [], options = {} }) => dynamicX(command, args, options))\n\n// return await Promise.all(promises)\n// }\n\nexport const xASync = async (\n command: string,\n args?: string[],\n options?: Partial<Options> & { quiet?: boolean; timeout?: number }\n): Promise<[Error, null] | [null, Output]> => {\n try {\n const { timeout, quiet, ...execOptions } = options ?? {}\n const mergedOptions = merge(\n { nodeOptions: { cwd: process.cwd(), FORCE_COLOR: '1' }, throwOnError: true },\n execOptions\n )\n\n const execPromise = tinyexec(command, args, mergedOptions)\n const result = timeout\n ? await Promise.race([\n execPromise,\n new Promise<never>((_, reject) =>\n setTimeout(() => reject(new Error(`Command timeout after ${timeout}ms`)), timeout)\n ),\n ])\n : await execPromise\n\n if (result.exitCode) {\n if (!quiet) {\n log.show(`Failed to execute command ${command}. Command exited with code ${result.exitCode}.`, {\n type: 'error',\n })\n log.show(result.stderr, { type: 'error' })\n }\n return [new Error(result.stderr), null]\n }\n\n return [null, result]\n } catch (error) {\n handleError(error, `Failed to execute command ${command}.`)\n return [isError(error) ? error : new Error(error as string), null]\n }\n}\n\nexport type { Command, Result }\n","import {\n cancel,\n confirm,\n type GroupMultiSelectOptions,\n group,\n groupMultiselect,\n isCancel,\n type MultiSelectOptions,\n multiselect,\n type NoteOptions,\n note,\n type Option,\n type PromptGroup,\n type SelectOptions,\n type SpinnerOptions,\n select,\n spinner,\n type TaskLogOptions,\n type TextOptions,\n taskLog,\n tasks,\n text,\n} from '@clack/prompts'\nimport { search } from '@inquirer/prompts'\nimport Fuse from 'fuse.js'\n\nimport { exit } from './command'\nimport { log } from './log'\nimport { isString } from './types'\n\nexport type PromptOptions<T extends string | number | boolean | symbol = string> = {\n label: string\n value: T\n}\n\nexport const createOptions = <const T extends string | number>(options: readonly T[]): Option<T>[] =>\n options.map((option) => ({ label: option.toString(), value: option }) as Option<T>)\n\nconst createPrompt = <T extends AnyFunction>(fn: T) => {\n return async (options: Parameters<T>[0]): Promise<Awaited<ReturnType<T>>> => {\n const result = await fn(options)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n exit(0)\n }\n return result\n }\n}\n\nexport const createShowList = createPrompt((options: string[] | PromptOptions[]) => {\n const result = options.map((option) => {\n return isString(option) ? option : option.label\n })\n result.forEach((item) => {\n log.show(item, { type: 'step' })\n })\n})\n\nexport const createSearch = ({ message, options }: { message: string; options: PromptOptions[] }) => {\n const fuse = new Fuse(options, { keys: ['label'] })\n\n return search({\n message,\n source: (term) => {\n if (!term) return options\n const result = fuse.search(term)\n return result.map(({ item }) => item)\n },\n })\n}\n\n// Handle inquirer Prompt exceptions\nprocess.on('uncaughtException', (error) => {\n if (error instanceof Error && error.name === 'ExitPromptError') {\n log.show('User cancelled', { type: 'error' })\n } else {\n throw error\n }\n})\n\nexport const createCheckbox = async <Value>(opts: MultiSelectOptions<Value>) => {\n const result = await multiselect(opts)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n exit(0)\n }\n return result as Value[]\n}\n\nexport const createNote = ({\n message = '',\n title = '',\n opts,\n}: {\n message?: string\n title?: string\n opts?: NoteOptions\n}) => note(message, title, opts)\n\nexport const createConfirm = createPrompt(confirm)\n\nexport const createTasks = createPrompt(tasks)\n\nexport const createSelect = async <Value>(opts: SelectOptions<Value>) => {\n const result = await select(opts)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n exit(0)\n }\n return result as Value\n}\n\nexport const createInput = async (opts: TextOptions) => {\n const result = await text(opts)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n exit(0)\n }\n return result as string\n}\n\nexport const createGroupMultiSelect = async <Value>(opts: GroupMultiSelectOptions<Value>) => {\n const result = await groupMultiselect(opts)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n process.exit(0)\n }\n return result\n}\n\nexport const createGroup = async <Value>(opts: PromptGroup<Value>) => {\n const result = await group(opts)\n\n if (isCancel(result)) {\n cancel('User cancelled')\n exit(0)\n }\n return result\n}\n\nexport type Spinner = ReturnType<typeof spinner>\nexport const createSpinner = (message: string, options?: SpinnerOptions) => {\n const s = spinner(options)\n s.start(message)\n return s\n}\n\nexport const createTaskLog = (title: string, options?: TaskLogOptions) => taskLog({ title, ...options })\n\nexport { intro, outro, progress, stream } from '@clack/prompts'\n"],"x_google_ignoreList":[2,3,4],"mappings":";;;;;;;;;;;;;;AAAA,MAAa,UAAU,QAAiC,QAA8B,OAAO,OAAO,QAAQ,IAAI;AAChH,MAAa,OAAgD,QAAW,QAAoB,QAAQ,IAAI,QAAQ,IAAI;AAEpH,MAAM,UACC,UACgB,QACnB,OAAO,UAAU,SAAS,KAAK,IAAI,KAAK,WAAW,KAAK;AAE5D,MAAa,WAAW,OAAe,SAAS;AAChD,MAAa,WAAW,OAAe,SAAS;AAChD,MAAa,YAAY,OAAgB,UAAU;AACnD,MAAa,SAAS,OAAa,OAAO;AAC1C,MAAa,cAAc,OAAkB,YAAY;AAEzD,MAAa,UAAU,OAAc,QAAQ;AAE7C,MAAa,YAAY,OAAyB,UAAU;AAC5D,MAAaA,kBAAgB,OAAgC,SAAS;AACtE,MAAa,UAAU,OAAkB,QAAQ;AACjD,MAAa,SAAS,OAAa,OAAO;AAC1C,MAAa,aAAa,OAAoB,WAAW;AAEzD,MAAa,WAAW,OAAe,SAAS;AAChD,MAAa,QAAQ,OAAqB,MAAM;AAChD,MAAa,QAAQ,OAA8B,MAAM;AACzD,MAAa,aAAa,OAAiB,WAAW;AACtD,MAAa,oBAAoB,OAAwB,kBAAkB;AAE3E,MAAa,WAAW,UAAgF;AACtG,KAAI,SAAS,KAAM,QAAO;AAC1B,KAAI,SAAS,MAAM,CAAE,QAAO,MAAM,MAAM,KAAK;AAC7C,KAAI,SAAS,MAAM,CAAE,QAAO,CAAC,OAAO,SAAS,MAAM;AACnD,KAAI,QAAQ,MAAM,CAAE,QAAO,MAAM,WAAW;AAC5C,KAAIA,gBAAc,MAAM,CAAE,QAAO,OAAO,KAAK,MAAM,CAAC,WAAW;AAC/D,QAAO;;;;;ACzBT,MAAM,eAAe;CACnB,QAAQ;EACN,OAAO;EACP,MAAM;EACN,SAAS;EACT,MAAM;EACN,SAAS;EACT,O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,iBAAiB,SAAiB,YAA6B;CAC1E,MAAM,IAAI,QAAQ,QAAQ;AAC1B,GAAE,MAAM,QAAQ;AAChB,QAAO;;AAGT,MAAa,iBAAiB,OAAe,YAA6B,QAAQ;CAAE;CAAO,GAAG;CAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nemo-cli/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "cli tools",
|
|
5
5
|
"author": "gaozimeng <gaozimeng0425@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@clack/prompts": "1.0.0",
|
|
27
27
|
"@inquirer/prompts": "^8.2.0",
|
|
28
28
|
"acorn": "^8.15.0",
|
|
29
|
-
"ansi-escapes": "^7.
|
|
29
|
+
"ansi-escapes": "^7.3.0",
|
|
30
30
|
"chalk": "^5.6.2",
|
|
31
31
|
"commander": "^14.0.3",
|
|
32
32
|
"concurrently": "^9.2.1",
|
|
@@ -34,21 +34,20 @@
|
|
|
34
34
|
"execa": "^9.6.1",
|
|
35
35
|
"fs-extra": "^11.3.3",
|
|
36
36
|
"fuse.js": "^7.1.0",
|
|
37
|
-
"glob": "^13.0.
|
|
37
|
+
"glob": "^13.0.2",
|
|
38
38
|
"jiti": "^2.6.1",
|
|
39
39
|
"match-sorter": "^8.2.0",
|
|
40
40
|
"open": "^11.0.0",
|
|
41
|
-
"ora": "^9.
|
|
41
|
+
"ora": "^9.3.0",
|
|
42
42
|
"p-limit": "^7.3.0",
|
|
43
43
|
"package-manager-detector": "^1.6.0",
|
|
44
44
|
"superjson": "^2.2.6",
|
|
45
45
|
"tinyexec": "^1.0.2",
|
|
46
|
-
"unconfig": "^7.4.2",
|
|
47
46
|
"update-notifier": "^7.3.1",
|
|
48
47
|
"winston": "^3.19.0",
|
|
49
48
|
"yaml": "^2.8.2",
|
|
50
49
|
"zx": "8.8.5",
|
|
51
|
-
"@nemo-cli/ui": "0.1.
|
|
50
|
+
"@nemo-cli/ui": "0.1.5"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@types/configstore": "^6.0.2",
|