create-rstack 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -1
- package/dist/index.js +1047 -564
- package/package.json +20 -19
- package/template-biome/package.json +1 -1
- package/template-eslint/react-ts/package.json +1 -1
- package/template-eslint/svelte-js/package.json +1 -1
- package/template-eslint/svelte-ts/package.json +2 -2
- package/template-eslint/vanilla-ts/package.json +1 -1
- package/template-eslint/vue-ts/package.json +1 -1
- package/dist/rslib-runtime.js +0 -39
package/dist/index.js
CHANGED
|
@@ -1,19 +1,57 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
5
|
-
import * as __rspack_external_node_fs_promises_153e37e0 from "node:fs/promises";
|
|
6
|
-
import * as __rspack_external_path from "path";
|
|
7
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
8
|
-
import node_path, { dirname } from "node:path";
|
|
2
|
+
import node_fs from "node:fs";
|
|
3
|
+
import node_path, { delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
|
|
9
4
|
import { fileURLToPath } from "node:url";
|
|
10
5
|
import node_util, { styleText } from "node:util";
|
|
11
|
-
import node_process, { stdin, stdout } from "node:process";
|
|
12
|
-
import
|
|
13
|
-
import node_tty from "node:tty";
|
|
6
|
+
import node_process, { cwd as external_node_process_cwd, stdin, stdout } from "node:process";
|
|
7
|
+
import node_tty, { ReadStream } from "node:tty";
|
|
14
8
|
import node_os from "node:os";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { spawn } from "node:child_process";
|
|
11
|
+
import { PassThrough } from "node:stream";
|
|
12
|
+
import node_readline from "node:readline";
|
|
13
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
14
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
15
|
+
import * as __rspack_external_node_readline_91c31510 from "node:readline";
|
|
16
|
+
var __webpack_modules__ = {};
|
|
17
|
+
var __webpack_module_cache__ = {};
|
|
18
|
+
function __webpack_require__(moduleId) {
|
|
19
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
20
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
21
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
22
|
+
exports: {}
|
|
23
|
+
};
|
|
24
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
25
|
+
return module.exports;
|
|
26
|
+
}
|
|
27
|
+
__webpack_require__.m = __webpack_modules__;
|
|
28
|
+
(()=>{
|
|
29
|
+
__webpack_require__.n = (module)=>{
|
|
30
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
31
|
+
__webpack_require__.d(getter, {
|
|
32
|
+
a: getter
|
|
33
|
+
});
|
|
34
|
+
return getter;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
39
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: definition[key]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
(()=>{
|
|
46
|
+
__webpack_require__.add = function(modules) {
|
|
47
|
+
Object.assign(__webpack_require__.m, modules);
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
(()=>{
|
|
51
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
52
|
+
})();
|
|
15
53
|
__webpack_require__.add({
|
|
16
|
-
"./node_modules/.pnpm/@vercel+detect-agent@1.1
|
|
54
|
+
"./node_modules/.pnpm/@vercel+detect-agent@1.2.1/node_modules/@vercel/detect-agent/dist/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
17
55
|
var __defProp = Object.defineProperty;
|
|
18
56
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
57
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -43,37 +81,52 @@ __webpack_require__.add({
|
|
|
43
81
|
});
|
|
44
82
|
module.exports = __toCommonJS(src_exports);
|
|
45
83
|
var import_promises = __webpack_require__("node:fs/promises");
|
|
46
|
-
var import_node_fs = __webpack_require__("node:fs");
|
|
84
|
+
var import_node_fs = __webpack_require__("node:fs?31c0");
|
|
47
85
|
const DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
48
86
|
const CURSOR = "cursor";
|
|
49
87
|
const CURSOR_CLI = "cursor-cli";
|
|
50
88
|
const CLAUDE = "claude";
|
|
89
|
+
const COWORK = "cowork";
|
|
51
90
|
const DEVIN = "devin";
|
|
52
91
|
const REPLIT = "replit";
|
|
53
92
|
const GEMINI = "gemini";
|
|
54
93
|
const CODEX = "codex";
|
|
94
|
+
const ANTIGRAVITY = "antigravity";
|
|
55
95
|
const AUGMENT_CLI = "augment-cli";
|
|
56
96
|
const OPENCODE = "opencode";
|
|
97
|
+
const GITHUB_COPILOT = "github-copilot";
|
|
98
|
+
const GITHUB_COPILOT_CLI = "github-copilot-cli";
|
|
57
99
|
const KNOWN_AGENTS = {
|
|
58
100
|
CURSOR,
|
|
59
101
|
CURSOR_CLI,
|
|
60
102
|
CLAUDE,
|
|
103
|
+
COWORK,
|
|
61
104
|
DEVIN,
|
|
62
105
|
REPLIT,
|
|
63
106
|
GEMINI,
|
|
64
107
|
CODEX,
|
|
108
|
+
ANTIGRAVITY,
|
|
65
109
|
AUGMENT_CLI,
|
|
66
|
-
OPENCODE
|
|
110
|
+
OPENCODE,
|
|
111
|
+
GITHUB_COPILOT
|
|
67
112
|
};
|
|
68
113
|
async function determineAgent() {
|
|
69
114
|
if (process.env.AI_AGENT) {
|
|
70
115
|
const name = process.env.AI_AGENT.trim();
|
|
71
|
-
if (name)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
116
|
+
if (name) {
|
|
117
|
+
if (name === GITHUB_COPILOT || name === GITHUB_COPILOT_CLI) return {
|
|
118
|
+
isAgent: true,
|
|
119
|
+
agent: {
|
|
120
|
+
name: GITHUB_COPILOT
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
isAgent: true,
|
|
125
|
+
agent: {
|
|
126
|
+
name
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
77
130
|
}
|
|
78
131
|
if (process.env.CURSOR_TRACE_ID) return {
|
|
79
132
|
isAgent: true,
|
|
@@ -93,12 +146,18 @@ __webpack_require__.add({
|
|
|
93
146
|
name: GEMINI
|
|
94
147
|
}
|
|
95
148
|
};
|
|
96
|
-
if (process.env.CODEX_SANDBOX) return {
|
|
149
|
+
if (process.env.CODEX_SANDBOX || process.env.CODEX_CI || process.env.CODEX_THREAD_ID) return {
|
|
97
150
|
isAgent: true,
|
|
98
151
|
agent: {
|
|
99
152
|
name: CODEX
|
|
100
153
|
}
|
|
101
154
|
};
|
|
155
|
+
if (process.env.ANTIGRAVITY_AGENT) return {
|
|
156
|
+
isAgent: true,
|
|
157
|
+
agent: {
|
|
158
|
+
name: ANTIGRAVITY
|
|
159
|
+
}
|
|
160
|
+
};
|
|
102
161
|
if (process.env.AUGMENT_AGENT) return {
|
|
103
162
|
isAgent: true,
|
|
104
163
|
agent: {
|
|
@@ -111,16 +170,30 @@ __webpack_require__.add({
|
|
|
111
170
|
name: OPENCODE
|
|
112
171
|
}
|
|
113
172
|
};
|
|
114
|
-
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE)
|
|
173
|
+
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) {
|
|
174
|
+
if (process.env.CLAUDE_CODE_IS_COWORK) return {
|
|
175
|
+
isAgent: true,
|
|
176
|
+
agent: {
|
|
177
|
+
name: COWORK
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
isAgent: true,
|
|
182
|
+
agent: {
|
|
183
|
+
name: CLAUDE
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
if (process.env.REPL_ID) return {
|
|
115
188
|
isAgent: true,
|
|
116
189
|
agent: {
|
|
117
|
-
name:
|
|
190
|
+
name: REPLIT
|
|
118
191
|
}
|
|
119
192
|
};
|
|
120
|
-
if (process.env.
|
|
193
|
+
if (process.env.COPILOT_MODEL || process.env.COPILOT_ALLOW_ALL || process.env.COPILOT_GITHUB_TOKEN) return {
|
|
121
194
|
isAgent: true,
|
|
122
195
|
agent: {
|
|
123
|
-
name:
|
|
196
|
+
name: GITHUB_COPILOT
|
|
124
197
|
}
|
|
125
198
|
};
|
|
126
199
|
try {
|
|
@@ -131,199 +204,13 @@ __webpack_require__.add({
|
|
|
131
204
|
name: DEVIN
|
|
132
205
|
}
|
|
133
206
|
};
|
|
134
|
-
} catch (
|
|
207
|
+
} catch (_error) {}
|
|
135
208
|
return {
|
|
136
209
|
isAgent: false,
|
|
137
210
|
agent: void 0
|
|
138
211
|
};
|
|
139
212
|
}
|
|
140
213
|
},
|
|
141
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
142
|
-
const cp = __webpack_require__("child_process");
|
|
143
|
-
const parse = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
|
|
144
|
-
const enoent = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
|
|
145
|
-
function spawn(command, args, options) {
|
|
146
|
-
const parsed = parse(command, args, options);
|
|
147
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
148
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
149
|
-
return spawned;
|
|
150
|
-
}
|
|
151
|
-
function spawnSync(command, args, options) {
|
|
152
|
-
const parsed = parse(command, args, options);
|
|
153
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
154
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
155
|
-
return result;
|
|
156
|
-
}
|
|
157
|
-
module.exports = spawn;
|
|
158
|
-
module.exports.spawn = spawn;
|
|
159
|
-
module.exports.sync = spawnSync;
|
|
160
|
-
module.exports._parse = parse;
|
|
161
|
-
module.exports._enoent = enoent;
|
|
162
|
-
},
|
|
163
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js" (module) {
|
|
164
|
-
const isWin = 'win32' === process.platform;
|
|
165
|
-
function notFoundError(original, syscall) {
|
|
166
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
167
|
-
code: 'ENOENT',
|
|
168
|
-
errno: 'ENOENT',
|
|
169
|
-
syscall: `${syscall} ${original.command}`,
|
|
170
|
-
path: original.command,
|
|
171
|
-
spawnargs: original.args
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
function hookChildProcess(cp, parsed) {
|
|
175
|
-
if (!isWin) return;
|
|
176
|
-
const originalEmit = cp.emit;
|
|
177
|
-
cp.emit = function(name, arg1) {
|
|
178
|
-
if ('exit' === name) {
|
|
179
|
-
const err = verifyENOENT(arg1, parsed);
|
|
180
|
-
if (err) return originalEmit.call(cp, 'error', err);
|
|
181
|
-
}
|
|
182
|
-
return originalEmit.apply(cp, arguments);
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function verifyENOENT(status, parsed) {
|
|
186
|
-
if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawn');
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
function verifyENOENTSync(status, parsed) {
|
|
190
|
-
if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawnSync');
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
module.exports = {
|
|
194
|
-
hookChildProcess,
|
|
195
|
-
verifyENOENT,
|
|
196
|
-
verifyENOENTSync,
|
|
197
|
-
notFoundError
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
201
|
-
const path = __webpack_require__("path");
|
|
202
|
-
const resolveCommand = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
|
|
203
|
-
const escape = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
|
|
204
|
-
const readShebang = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js");
|
|
205
|
-
const isWin = 'win32' === process.platform;
|
|
206
|
-
const isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
207
|
-
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
208
|
-
function detectShebang(parsed) {
|
|
209
|
-
parsed.file = resolveCommand(parsed);
|
|
210
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
211
|
-
if (shebang) {
|
|
212
|
-
parsed.args.unshift(parsed.file);
|
|
213
|
-
parsed.command = shebang;
|
|
214
|
-
return resolveCommand(parsed);
|
|
215
|
-
}
|
|
216
|
-
return parsed.file;
|
|
217
|
-
}
|
|
218
|
-
function parseNonShell(parsed) {
|
|
219
|
-
if (!isWin) return parsed;
|
|
220
|
-
const commandFile = detectShebang(parsed);
|
|
221
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
222
|
-
if (parsed.options.forceShell || needsShell) {
|
|
223
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
224
|
-
parsed.command = path.normalize(parsed.command);
|
|
225
|
-
parsed.command = escape.command(parsed.command);
|
|
226
|
-
parsed.args = parsed.args.map((arg)=>escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
227
|
-
const shellCommand = [
|
|
228
|
-
parsed.command
|
|
229
|
-
].concat(parsed.args).join(' ');
|
|
230
|
-
parsed.args = [
|
|
231
|
-
'/d',
|
|
232
|
-
'/s',
|
|
233
|
-
'/c',
|
|
234
|
-
`"${shellCommand}"`
|
|
235
|
-
];
|
|
236
|
-
parsed.command = process.env.comspec || 'cmd.exe';
|
|
237
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
238
|
-
}
|
|
239
|
-
return parsed;
|
|
240
|
-
}
|
|
241
|
-
function parse(command, args, options) {
|
|
242
|
-
if (args && !Array.isArray(args)) {
|
|
243
|
-
options = args;
|
|
244
|
-
args = null;
|
|
245
|
-
}
|
|
246
|
-
args = args ? args.slice(0) : [];
|
|
247
|
-
options = Object.assign({}, options);
|
|
248
|
-
const parsed = {
|
|
249
|
-
command,
|
|
250
|
-
args,
|
|
251
|
-
options,
|
|
252
|
-
file: void 0,
|
|
253
|
-
original: {
|
|
254
|
-
command,
|
|
255
|
-
args
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
259
|
-
}
|
|
260
|
-
module.exports = parse;
|
|
261
|
-
},
|
|
262
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js" (module) {
|
|
263
|
-
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
264
|
-
function escapeCommand(arg) {
|
|
265
|
-
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
266
|
-
return arg;
|
|
267
|
-
}
|
|
268
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
269
|
-
arg = `${arg}`;
|
|
270
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
271
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
|
|
272
|
-
arg = `"${arg}"`;
|
|
273
|
-
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
274
|
-
if (doubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, '^$1');
|
|
275
|
-
return arg;
|
|
276
|
-
}
|
|
277
|
-
module.exports.command = escapeCommand;
|
|
278
|
-
module.exports.argument = escapeArgument;
|
|
279
|
-
},
|
|
280
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
281
|
-
const fs = __webpack_require__("fs");
|
|
282
|
-
const shebangCommand = __webpack_require__("./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
|
|
283
|
-
function readShebang(command) {
|
|
284
|
-
const size = 150;
|
|
285
|
-
const buffer = Buffer.alloc(size);
|
|
286
|
-
let fd;
|
|
287
|
-
try {
|
|
288
|
-
fd = fs.openSync(command, 'r');
|
|
289
|
-
fs.readSync(fd, buffer, 0, size, 0);
|
|
290
|
-
fs.closeSync(fd);
|
|
291
|
-
} catch (e) {}
|
|
292
|
-
return shebangCommand(buffer.toString());
|
|
293
|
-
}
|
|
294
|
-
module.exports = readShebang;
|
|
295
|
-
},
|
|
296
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
297
|
-
const path = __webpack_require__("path");
|
|
298
|
-
const which = __webpack_require__("./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
|
|
299
|
-
const getPathKey = __webpack_require__("./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
|
|
300
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
301
|
-
const env = parsed.options.env || process.env;
|
|
302
|
-
const cwd = process.cwd();
|
|
303
|
-
const hasCustomCwd = null != parsed.options.cwd;
|
|
304
|
-
const shouldSwitchCwd = hasCustomCwd && void 0 !== process.chdir && !process.chdir.disabled;
|
|
305
|
-
if (shouldSwitchCwd) try {
|
|
306
|
-
process.chdir(parsed.options.cwd);
|
|
307
|
-
} catch (err) {}
|
|
308
|
-
let resolved;
|
|
309
|
-
try {
|
|
310
|
-
resolved = which.sync(parsed.command, {
|
|
311
|
-
path: env[getPathKey({
|
|
312
|
-
env
|
|
313
|
-
})],
|
|
314
|
-
pathExt: withoutPathExt ? path.delimiter : void 0
|
|
315
|
-
});
|
|
316
|
-
} catch (e) {} finally{
|
|
317
|
-
if (shouldSwitchCwd) process.chdir(cwd);
|
|
318
|
-
}
|
|
319
|
-
if (resolved) resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
|
|
320
|
-
return resolved;
|
|
321
|
-
}
|
|
322
|
-
function resolveCommand(parsed) {
|
|
323
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
324
|
-
}
|
|
325
|
-
module.exports = resolveCommand;
|
|
326
|
-
},
|
|
327
214
|
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
328
215
|
var isMergeableObject = function(value) {
|
|
329
216
|
return isNonNullObject(value) && !isSpecial(value);
|
|
@@ -407,102 +294,6 @@ __webpack_require__.add({
|
|
|
407
294
|
var deepmerge_1 = deepmerge;
|
|
408
295
|
module.exports = deepmerge_1;
|
|
409
296
|
},
|
|
410
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
411
|
-
__webpack_require__("fs");
|
|
412
|
-
var core;
|
|
413
|
-
core = 'win32' === process.platform || global.TESTING_WINDOWS ? __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js") : __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js");
|
|
414
|
-
module.exports = isexe;
|
|
415
|
-
isexe.sync = sync;
|
|
416
|
-
function isexe(path, options, cb) {
|
|
417
|
-
if ('function' == typeof options) {
|
|
418
|
-
cb = options;
|
|
419
|
-
options = {};
|
|
420
|
-
}
|
|
421
|
-
if (!cb) {
|
|
422
|
-
if ('function' != typeof Promise) throw new TypeError('callback not provided');
|
|
423
|
-
return new Promise(function(resolve, reject) {
|
|
424
|
-
isexe(path, options || {}, function(er, is) {
|
|
425
|
-
if (er) reject(er);
|
|
426
|
-
else resolve(is);
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
core(path, options || {}, function(er, is) {
|
|
431
|
-
if (er) {
|
|
432
|
-
if ('EACCES' === er.code || options && options.ignoreErrors) {
|
|
433
|
-
er = null;
|
|
434
|
-
is = false;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
cb(er, is);
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
function sync(path, options) {
|
|
441
|
-
try {
|
|
442
|
-
return core.sync(path, options || {});
|
|
443
|
-
} catch (er) {
|
|
444
|
-
if (options && options.ignoreErrors || 'EACCES' === er.code) return false;
|
|
445
|
-
throw er;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
450
|
-
module.exports = isexe;
|
|
451
|
-
isexe.sync = sync;
|
|
452
|
-
var fs = __webpack_require__("fs");
|
|
453
|
-
function isexe(path, options, cb) {
|
|
454
|
-
fs.stat(path, function(er, stat) {
|
|
455
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
function sync(path, options) {
|
|
459
|
-
return checkStat(fs.statSync(path), options);
|
|
460
|
-
}
|
|
461
|
-
function checkStat(stat, options) {
|
|
462
|
-
return stat.isFile() && checkMode(stat, options);
|
|
463
|
-
}
|
|
464
|
-
function checkMode(stat, options) {
|
|
465
|
-
var mod = stat.mode;
|
|
466
|
-
var uid = stat.uid;
|
|
467
|
-
var gid = stat.gid;
|
|
468
|
-
var myUid = void 0 !== options.uid ? options.uid : process.getuid && process.getuid();
|
|
469
|
-
var myGid = void 0 !== options.gid ? options.gid : process.getgid && process.getgid();
|
|
470
|
-
var u = parseInt('100', 8);
|
|
471
|
-
var g = parseInt('010', 8);
|
|
472
|
-
var o = parseInt('001', 8);
|
|
473
|
-
var ug = u | g;
|
|
474
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && 0 === myUid;
|
|
475
|
-
return ret;
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
479
|
-
module.exports = isexe;
|
|
480
|
-
isexe.sync = sync;
|
|
481
|
-
var fs = __webpack_require__("fs");
|
|
482
|
-
function checkPathExt(path, options) {
|
|
483
|
-
var pathext = void 0 !== options.pathExt ? options.pathExt : process.env.PATHEXT;
|
|
484
|
-
if (!pathext) return true;
|
|
485
|
-
pathext = pathext.split(';');
|
|
486
|
-
if (-1 !== pathext.indexOf('')) return true;
|
|
487
|
-
for(var i = 0; i < pathext.length; i++){
|
|
488
|
-
var p = pathext[i].toLowerCase();
|
|
489
|
-
if (p && path.substr(-p.length).toLowerCase() === p) return true;
|
|
490
|
-
}
|
|
491
|
-
return false;
|
|
492
|
-
}
|
|
493
|
-
function checkStat(stat, path, options) {
|
|
494
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
|
|
495
|
-
return checkPathExt(path, options);
|
|
496
|
-
}
|
|
497
|
-
function isexe(path, options, cb) {
|
|
498
|
-
fs.stat(path, function(er, stat) {
|
|
499
|
-
cb(er, er ? false : checkStat(stat, path, options));
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
function sync(path, options) {
|
|
503
|
-
return checkStat(fs.statSync(path), path, options);
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
297
|
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js" (module) {
|
|
507
298
|
function hasKey(obj, keys) {
|
|
508
299
|
var o = obj;
|
|
@@ -682,96 +473,6 @@ __webpack_require__.add({
|
|
|
682
473
|
return argv;
|
|
683
474
|
};
|
|
684
475
|
},
|
|
685
|
-
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js" (module) {
|
|
686
|
-
const pathKey = (options = {})=>{
|
|
687
|
-
const environment = options.env || process.env;
|
|
688
|
-
const platform = options.platform || process.platform;
|
|
689
|
-
if ('win32' !== platform) return 'PATH';
|
|
690
|
-
return Object.keys(environment).reverse().find((key)=>'PATH' === key.toUpperCase()) || 'Path';
|
|
691
|
-
};
|
|
692
|
-
module.exports = pathKey;
|
|
693
|
-
module.exports["default"] = pathKey;
|
|
694
|
-
},
|
|
695
|
-
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
696
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
697
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
698
|
-
let formatter = (open, close, replace = open)=>(input)=>{
|
|
699
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
700
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
701
|
-
};
|
|
702
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
703
|
-
let result = "", cursor = 0;
|
|
704
|
-
do {
|
|
705
|
-
result += string.substring(cursor, index) + replace;
|
|
706
|
-
cursor = index + close.length;
|
|
707
|
-
index = string.indexOf(close, cursor);
|
|
708
|
-
}while (~index);
|
|
709
|
-
return result + string.substring(cursor);
|
|
710
|
-
};
|
|
711
|
-
let createColors = (enabled = isColorSupported)=>{
|
|
712
|
-
let f = enabled ? formatter : ()=>String;
|
|
713
|
-
return {
|
|
714
|
-
isColorSupported: enabled,
|
|
715
|
-
reset: f("\x1b[0m", "\x1b[0m"),
|
|
716
|
-
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
717
|
-
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
718
|
-
italic: f("\x1b[3m", "\x1b[23m"),
|
|
719
|
-
underline: f("\x1b[4m", "\x1b[24m"),
|
|
720
|
-
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
721
|
-
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
722
|
-
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
723
|
-
black: f("\x1b[30m", "\x1b[39m"),
|
|
724
|
-
red: f("\x1b[31m", "\x1b[39m"),
|
|
725
|
-
green: f("\x1b[32m", "\x1b[39m"),
|
|
726
|
-
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
727
|
-
blue: f("\x1b[34m", "\x1b[39m"),
|
|
728
|
-
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
729
|
-
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
730
|
-
white: f("\x1b[37m", "\x1b[39m"),
|
|
731
|
-
gray: f("\x1b[90m", "\x1b[39m"),
|
|
732
|
-
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
733
|
-
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
734
|
-
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
735
|
-
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
736
|
-
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
737
|
-
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
738
|
-
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
739
|
-
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
740
|
-
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
741
|
-
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
742
|
-
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
743
|
-
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
744
|
-
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
745
|
-
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
746
|
-
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
747
|
-
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
748
|
-
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
749
|
-
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
750
|
-
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
751
|
-
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
752
|
-
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
753
|
-
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
754
|
-
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
755
|
-
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
756
|
-
};
|
|
757
|
-
};
|
|
758
|
-
module.exports = createColors();
|
|
759
|
-
module.exports.createColors = createColors;
|
|
760
|
-
},
|
|
761
|
-
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
762
|
-
const shebangRegex = __webpack_require__("./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
|
|
763
|
-
module.exports = (string = '')=>{
|
|
764
|
-
const match = string.match(shebangRegex);
|
|
765
|
-
if (!match) return null;
|
|
766
|
-
const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
|
|
767
|
-
const binary = path.split('/').pop();
|
|
768
|
-
if ('env' === binary) return argument;
|
|
769
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
770
|
-
};
|
|
771
|
-
},
|
|
772
|
-
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
|
|
773
|
-
module.exports = /^#!(.*)/;
|
|
774
|
-
},
|
|
775
476
|
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js" (module) {
|
|
776
477
|
const ESC = '\x1B';
|
|
777
478
|
const CSI = `${ESC}[`;
|
|
@@ -826,107 +527,11 @@ __webpack_require__.add({
|
|
|
826
527
|
beep
|
|
827
528
|
};
|
|
828
529
|
},
|
|
829
|
-
"
|
|
830
|
-
|
|
831
|
-
const path = __webpack_require__("path");
|
|
832
|
-
const COLON = isWindows ? ';' : ':';
|
|
833
|
-
const isexe = __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js");
|
|
834
|
-
const getNotFoundError = (cmd)=>Object.assign(new Error(`not found: ${cmd}`), {
|
|
835
|
-
code: 'ENOENT'
|
|
836
|
-
});
|
|
837
|
-
const getPathInfo = (cmd, opt)=>{
|
|
838
|
-
const colon = opt.colon || COLON;
|
|
839
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [
|
|
840
|
-
''
|
|
841
|
-
] : [
|
|
842
|
-
...isWindows ? [
|
|
843
|
-
process.cwd()
|
|
844
|
-
] : [],
|
|
845
|
-
...(opt.path || process.env.PATH || '').split(colon)
|
|
846
|
-
];
|
|
847
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' : '';
|
|
848
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [
|
|
849
|
-
''
|
|
850
|
-
];
|
|
851
|
-
if (isWindows) {
|
|
852
|
-
if (-1 !== cmd.indexOf('.') && '' !== pathExt[0]) pathExt.unshift('');
|
|
853
|
-
}
|
|
854
|
-
return {
|
|
855
|
-
pathEnv,
|
|
856
|
-
pathExt,
|
|
857
|
-
pathExtExe
|
|
858
|
-
};
|
|
859
|
-
};
|
|
860
|
-
const which = (cmd, opt, cb)=>{
|
|
861
|
-
if ('function' == typeof opt) {
|
|
862
|
-
cb = opt;
|
|
863
|
-
opt = {};
|
|
864
|
-
}
|
|
865
|
-
if (!opt) opt = {};
|
|
866
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
867
|
-
const found = [];
|
|
868
|
-
const step = (i)=>new Promise((resolve, reject)=>{
|
|
869
|
-
if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
870
|
-
const ppRaw = pathEnv[i];
|
|
871
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
872
|
-
const pCmd = path.join(pathPart, cmd);
|
|
873
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
874
|
-
resolve(subStep(p, i, 0));
|
|
875
|
-
});
|
|
876
|
-
const subStep = (p, i, ii)=>new Promise((resolve, reject)=>{
|
|
877
|
-
if (ii === pathExt.length) return resolve(step(i + 1));
|
|
878
|
-
const ext = pathExt[ii];
|
|
879
|
-
isexe(p + ext, {
|
|
880
|
-
pathExt: pathExtExe
|
|
881
|
-
}, (er, is)=>{
|
|
882
|
-
if (!er && is) if (!opt.all) return resolve(p + ext);
|
|
883
|
-
else found.push(p + ext);
|
|
884
|
-
return resolve(subStep(p, i, ii + 1));
|
|
885
|
-
});
|
|
886
|
-
});
|
|
887
|
-
return cb ? step(0).then((res)=>cb(null, res), cb) : step(0);
|
|
888
|
-
};
|
|
889
|
-
const whichSync = (cmd, opt)=>{
|
|
890
|
-
opt = opt || {};
|
|
891
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
892
|
-
const found = [];
|
|
893
|
-
for(let i = 0; i < pathEnv.length; i++){
|
|
894
|
-
const ppRaw = pathEnv[i];
|
|
895
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
896
|
-
const pCmd = path.join(pathPart, cmd);
|
|
897
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
898
|
-
for(let j = 0; j < pathExt.length; j++){
|
|
899
|
-
const cur = p + pathExt[j];
|
|
900
|
-
try {
|
|
901
|
-
const is = isexe.sync(cur, {
|
|
902
|
-
pathExt: pathExtExe
|
|
903
|
-
});
|
|
904
|
-
if (is) if (!opt.all) return cur;
|
|
905
|
-
else found.push(cur);
|
|
906
|
-
} catch (ex) {}
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
if (opt.all && found.length) return found;
|
|
910
|
-
if (opt.nothrow) return null;
|
|
911
|
-
throw getNotFoundError(cmd);
|
|
912
|
-
};
|
|
913
|
-
module.exports = which;
|
|
914
|
-
which.sync = whichSync;
|
|
915
|
-
},
|
|
916
|
-
child_process (module) {
|
|
917
|
-
module.exports = __rspack_external_child_process;
|
|
918
|
-
},
|
|
919
|
-
fs (module) {
|
|
920
|
-
module.exports = __rspack_external_fs;
|
|
921
|
-
},
|
|
922
|
-
"node:fs" (module) {
|
|
923
|
-
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
530
|
+
"node:fs?31c0" (module) {
|
|
531
|
+
module.exports = __rspack_createRequire_require("node:fs");
|
|
924
532
|
},
|
|
925
533
|
"node:fs/promises" (module) {
|
|
926
|
-
module.exports =
|
|
927
|
-
},
|
|
928
|
-
path (module) {
|
|
929
|
-
module.exports = __rspack_external_path;
|
|
534
|
+
module.exports = __rspack_createRequire_require("node:fs/promises");
|
|
930
535
|
}
|
|
931
536
|
});
|
|
932
537
|
const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
@@ -1147,8 +752,7 @@ function _t(t, e) {
|
|
|
1147
752
|
numLines: r
|
|
1148
753
|
};
|
|
1149
754
|
}
|
|
1150
|
-
globalThis.process.platform.startsWith("win");
|
|
1151
|
-
const z = Symbol("clack:cancel");
|
|
755
|
+
const bt = globalThis.process.platform.startsWith("win"), z = Symbol("clack:cancel");
|
|
1152
756
|
function Ct(t) {
|
|
1153
757
|
return t === z;
|
|
1154
758
|
}
|
|
@@ -1156,6 +760,36 @@ function W(t, e) {
|
|
|
1156
760
|
const s = t;
|
|
1157
761
|
s.isTTY && s.setRawMode(e);
|
|
1158
762
|
}
|
|
763
|
+
function xt({ input: t = stdin, output: e = stdout, overwrite: s = !0, hideCursor: i = !0 } = {}) {
|
|
764
|
+
const r = __rspack_external_node_readline_91c31510.createInterface({
|
|
765
|
+
input: t,
|
|
766
|
+
output: e,
|
|
767
|
+
prompt: "",
|
|
768
|
+
tabSize: 1
|
|
769
|
+
});
|
|
770
|
+
__rspack_external_node_readline_91c31510.emitKeypressEvents(t, r), t instanceof ReadStream && t.isTTY && t.setRawMode(!0);
|
|
771
|
+
const n = (u, { name: a, sequence: l })=>{
|
|
772
|
+
const E = String(u);
|
|
773
|
+
if (H([
|
|
774
|
+
E,
|
|
775
|
+
a,
|
|
776
|
+
l
|
|
777
|
+
], "cancel")) {
|
|
778
|
+
i && e.write(src.cursor.show), process.exit(0);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
if (!s) return;
|
|
782
|
+
const g = "return" === a ? 0 : -1, m = "return" === a ? -1 : 0;
|
|
783
|
+
__rspack_external_node_readline_91c31510.moveCursor(e, g, m, ()=>{
|
|
784
|
+
__rspack_external_node_readline_91c31510.clearLine(e, 1, ()=>{
|
|
785
|
+
t.once("keypress", n);
|
|
786
|
+
});
|
|
787
|
+
});
|
|
788
|
+
};
|
|
789
|
+
return i && e.write(src.cursor.hide), t.once("keypress", n), ()=>{
|
|
790
|
+
t.off("keypress", n), i && e.write(src.cursor.show), t instanceof ReadStream && t.isTTY && !bt && t.setRawMode(!1), r.terminal = !1, r.close();
|
|
791
|
+
};
|
|
792
|
+
}
|
|
1159
793
|
const dist_rt = (t)=>"columns" in t && "number" == typeof t.columns ? t.columns : 80, nt = (t)=>"rows" in t && "number" == typeof t.rows ? t.rows : 20;
|
|
1160
794
|
function Bt(t, e, s, i = s) {
|
|
1161
795
|
const r = dist_rt(t ?? stdout);
|
|
@@ -1218,7 +852,7 @@ class dist_B {
|
|
|
1218
852
|
once: !0
|
|
1219
853
|
});
|
|
1220
854
|
}
|
|
1221
|
-
this.rl =
|
|
855
|
+
this.rl = __rspack_external_node_readline_91c31510["default"].createInterface({
|
|
1222
856
|
input: this.input,
|
|
1223
857
|
tabSize: 2,
|
|
1224
858
|
prompt: "",
|
|
@@ -1418,11 +1052,10 @@ class dist_$t extends dist_B {
|
|
|
1418
1052
|
});
|
|
1419
1053
|
}
|
|
1420
1054
|
}
|
|
1421
|
-
const external_node_fs_ = __webpack_require__("node:fs");
|
|
1422
1055
|
function dist_pt() {
|
|
1423
1056
|
return "win32" !== node_process.platform ? "linux" !== node_process.env.TERM : !!node_process.env.CI || !!node_process.env.WT_SESSION || !!node_process.env.TERMINUS_SUBLIME || "{cmd::Cmder}" === node_process.env.ConEmuTask || "Terminus-Sublime" === node_process.env.TERM_PROGRAM || "vscode" === node_process.env.TERM_PROGRAM || "xterm-256color" === node_process.env.TERM || "alacritty" === node_process.env.TERM || "JetBrains-JediTerm" === node_process.env.TERMINAL_EMULATOR;
|
|
1424
1057
|
}
|
|
1425
|
-
const ee = dist_pt(),
|
|
1058
|
+
const ee = dist_pt(), ce = ()=>"true" === process.env.CI, I = (e, r)=>ee ? e : r, Re = I("\u25C6", "*"), $e = I("\u25A0", "x"), de = I("\u25B2", "x"), dist_V = I("\u25C7", "o"), dist_h = (I("\u250C", "T"), I("\u2502", "|")), dist_x = I("\u2514", "\u2014"), dist_z = (I("\u2510", "T"), I("\u2518", "\u2014"), I("\u25CF", ">")), dist_H = I("\u25CB", " "), te = I("\u25FB", "[\u2022]"), dist_U = I("\u25FC", "[+]"), q = I("\u25FB", "[ ]"), se = (I("\u25AA", "\u2022"), I("\u2500", "-")), pe = I("\u256E", "+"), We = I("\u251C", "+"), me = I("\u256F", "+"), ge = I("\u2570", "+"), fe = (I("\u256D", "+"), I("\u25CF", "\u2022")), Fe = I("\u25C6", "*"), ye = I("\u25B2", "!"), Ee = I("\u25A0", "x"), dist_W = (e)=>{
|
|
1426
1059
|
switch(e){
|
|
1427
1060
|
case "initial":
|
|
1428
1061
|
case "active":
|
|
@@ -1434,7 +1067,7 @@ const ee = dist_pt(), dist_I = (e, r)=>ee ? e : r, Re = dist_I("\u25C6", "*"), $
|
|
|
1434
1067
|
case "submit":
|
|
1435
1068
|
return styleText("green", dist_V);
|
|
1436
1069
|
}
|
|
1437
|
-
}
|
|
1070
|
+
}, ve = (e)=>{
|
|
1438
1071
|
switch(e){
|
|
1439
1072
|
case "initial":
|
|
1440
1073
|
case "active":
|
|
@@ -1591,7 +1224,7 @@ const ee = dist_pt(), dist_I = (e, r)=>ee ? e : r, Re = dist_I("\u25C6", "*"), $
|
|
|
1591
1224
|
}
|
|
1592
1225
|
return i;
|
|
1593
1226
|
};
|
|
1594
|
-
function
|
|
1227
|
+
function J(e, r, s) {
|
|
1595
1228
|
return String(e).normalize().replaceAll(`\r
|
|
1596
1229
|
`, `
|
|
1597
1230
|
`).split(`
|
|
@@ -1618,7 +1251,7 @@ const dist_bt = (e, r, s, i, a)=>{
|
|
|
1618
1251
|
E && F++, $ && F++;
|
|
1619
1252
|
const y = g + (E ? 1 : 0), v = m - ($ ? 1 : 0);
|
|
1620
1253
|
for(let A = y; A < v; A++){
|
|
1621
|
-
const b =
|
|
1254
|
+
const b = J(s(r[A], A === e), l, {
|
|
1622
1255
|
hard: !0,
|
|
1623
1256
|
trim: !1
|
|
1624
1257
|
}).split(`
|
|
@@ -1635,7 +1268,55 @@ const dist_bt = (e, r, s, i, a)=>{
|
|
|
1635
1268
|
for (const A of d)for (const b of A)C.push(b);
|
|
1636
1269
|
return $ && C.push(c), C;
|
|
1637
1270
|
};
|
|
1638
|
-
const
|
|
1271
|
+
const R = {
|
|
1272
|
+
message: (e = [], { symbol: r = styleText("gray", dist_h), secondarySymbol: s = styleText("gray", dist_h), output: i = process.stdout, spacing: a = 1, withGuide: o } = {})=>{
|
|
1273
|
+
const u = [], l = o ?? dist_.withGuide, n = l ? s : "", c = l ? `${r} ` : "", p = l ? `${s} ` : "";
|
|
1274
|
+
for(let g = 0; g < a; g++)u.push(n);
|
|
1275
|
+
const f = Array.isArray(e) ? e : e.split(`
|
|
1276
|
+
`);
|
|
1277
|
+
if (f.length > 0) {
|
|
1278
|
+
const [g, ...E] = f;
|
|
1279
|
+
g.length > 0 ? u.push(`${c}${g}`) : u.push(l ? r : "");
|
|
1280
|
+
for (const $ of E)$.length > 0 ? u.push(`${p}${$}`) : u.push(l ? s : "");
|
|
1281
|
+
}
|
|
1282
|
+
i.write(`${u.join(`
|
|
1283
|
+
`)}
|
|
1284
|
+
`);
|
|
1285
|
+
},
|
|
1286
|
+
info: (e, r)=>{
|
|
1287
|
+
R.message(e, {
|
|
1288
|
+
...r,
|
|
1289
|
+
symbol: styleText("blue", fe)
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1292
|
+
success: (e, r)=>{
|
|
1293
|
+
R.message(e, {
|
|
1294
|
+
...r,
|
|
1295
|
+
symbol: styleText("green", Fe)
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
step: (e, r)=>{
|
|
1299
|
+
R.message(e, {
|
|
1300
|
+
...r,
|
|
1301
|
+
symbol: styleText("green", dist_V)
|
|
1302
|
+
});
|
|
1303
|
+
},
|
|
1304
|
+
warn: (e, r)=>{
|
|
1305
|
+
R.message(e, {
|
|
1306
|
+
...r,
|
|
1307
|
+
symbol: styleText("yellow", ye)
|
|
1308
|
+
});
|
|
1309
|
+
},
|
|
1310
|
+
warning: (e, r)=>{
|
|
1311
|
+
R.warn(e, r);
|
|
1312
|
+
},
|
|
1313
|
+
error: (e, r)=>{
|
|
1314
|
+
R.message(e, {
|
|
1315
|
+
...r,
|
|
1316
|
+
symbol: styleText("red", Ee)
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
}, Nt = (e = "", r)=>{
|
|
1639
1320
|
const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_.withGuide ? `${styleText("gray", dist_x)} ` : "";
|
|
1640
1321
|
s.write(`${i}${styleText("red", e)}
|
|
1641
1322
|
|
|
@@ -1651,13 +1332,13 @@ ${styleText("gray", dist_x)} ` : "";
|
|
|
1651
1332
|
`), dist_Lt = (e)=>{
|
|
1652
1333
|
const r = (i, a)=>{
|
|
1653
1334
|
const o = i.label ?? String(i.value);
|
|
1654
|
-
return "disabled" === a ? `${styleText("gray",
|
|
1335
|
+
return "disabled" === a ? `${styleText("gray", q)} ${dist_Q(o, (u)=>styleText([
|
|
1655
1336
|
"strikethrough",
|
|
1656
1337
|
"gray"
|
|
1657
1338
|
], u))}${i.hint ? ` ${styleText("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : "active" === a ? `${styleText("cyan", te)} ${o}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "selected" === a ? `${styleText("green", dist_U)} ${dist_Q(o, (u)=>styleText("dim", u))}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "cancelled" === a ? `${dist_Q(o, (u)=>styleText([
|
|
1658
1339
|
"strikethrough",
|
|
1659
1340
|
"dim"
|
|
1660
|
-
], u))}` : "active-selected" === a ? `${styleText("green", dist_U)} ${o}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "submitted" === a ? `${dist_Q(o, (u)=>styleText("dim", u))}` : `${styleText("dim",
|
|
1341
|
+
], u))}` : "active-selected" === a ? `${styleText("green", dist_U)} ${o}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "submitted" === a ? `${dist_Q(o, (u)=>styleText("dim", u))}` : `${styleText("dim", q)} ${dist_Q(o, (u)=>styleText("dim", u))}`;
|
|
1661
1342
|
}, s = e.required ?? !0;
|
|
1662
1343
|
return new Lt({
|
|
1663
1344
|
options: e.options,
|
|
@@ -1741,9 +1422,9 @@ ${styleText("cyan", dist_x)}
|
|
|
1741
1422
|
const i = {
|
|
1742
1423
|
hard: !0,
|
|
1743
1424
|
trim: !1
|
|
1744
|
-
}, a =
|
|
1425
|
+
}, a = J(e, r, i).split(`
|
|
1745
1426
|
`), o = a.reduce((n, c)=>Math.max(D(c), n), 0), u = a.map(s).reduce((n, c)=>Math.max(D(c), n), 0), l = r - (u - o);
|
|
1746
|
-
return
|
|
1427
|
+
return J(e, l, i);
|
|
1747
1428
|
}, dist_Vt = (e = "", r = "", s)=>{
|
|
1748
1429
|
const i = s?.output ?? node_process.stdout, a = s?.withGuide ?? dist_.withGuide, o = s?.format ?? jt, u = [
|
|
1749
1430
|
"",
|
|
@@ -1760,8 +1441,85 @@ ${styleText("cyan", dist_x)}
|
|
|
1760
1441
|
${c}
|
|
1761
1442
|
${styleText("gray", f + se.repeat(n + 2) + me)}
|
|
1762
1443
|
`);
|
|
1444
|
+
}, Kt = (e)=>styleText("magenta", e), be = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: a, frames: o = ee ? [
|
|
1445
|
+
"\u25D2",
|
|
1446
|
+
"\u25D0",
|
|
1447
|
+
"\u25D3",
|
|
1448
|
+
"\u25D1"
|
|
1449
|
+
] : [
|
|
1450
|
+
"\u2022",
|
|
1451
|
+
"o",
|
|
1452
|
+
"O",
|
|
1453
|
+
"0"
|
|
1454
|
+
], delay: u = ee ? 80 : 120, signal: l, ...n } = {})=>{
|
|
1455
|
+
const c = ce();
|
|
1456
|
+
let p, f, g = !1, E = !1, $ = "", m, d = performance.now();
|
|
1457
|
+
const F = dist_rt(s), y = n?.styleFrame ?? Kt, v = (B)=>{
|
|
1458
|
+
const P = B > 1 ? a ?? dist_.messages.error : i ?? dist_.messages.cancel;
|
|
1459
|
+
E = 1 === B, g && (k(P, B), E && "function" == typeof r && r());
|
|
1460
|
+
}, C = ()=>v(2), A = ()=>v(1), b = ()=>{
|
|
1461
|
+
process.on("uncaughtExceptionMonitor", C), process.on("unhandledRejection", C), process.on("SIGINT", A), process.on("SIGTERM", A), process.on("exit", v), l && l.addEventListener("abort", A);
|
|
1462
|
+
}, w = ()=>{
|
|
1463
|
+
process.removeListener("uncaughtExceptionMonitor", C), process.removeListener("unhandledRejection", C), process.removeListener("SIGINT", A), process.removeListener("SIGTERM", A), process.removeListener("exit", v), l && l.removeEventListener("abort", A);
|
|
1464
|
+
}, S = ()=>{
|
|
1465
|
+
if (void 0 === m) return;
|
|
1466
|
+
c && s.write(`
|
|
1467
|
+
`);
|
|
1468
|
+
const B = J(m, F, {
|
|
1469
|
+
hard: !0,
|
|
1470
|
+
trim: !1
|
|
1471
|
+
}).split(`
|
|
1472
|
+
`);
|
|
1473
|
+
B.length > 1 && s.write(src.cursor.up(B.length - 1)), s.write(src.cursor.to(0)), s.write(src.erase.down());
|
|
1474
|
+
}, T = (B)=>B.replace(/\.+$/, ""), M = (B)=>{
|
|
1475
|
+
const P = (performance.now() - B) / 1e3, G = Math.floor(P / 60), L = Math.floor(P % 60);
|
|
1476
|
+
return G > 0 ? `[${G}m ${L}s]` : `[${L}s]`;
|
|
1477
|
+
}, O = n.withGuide ?? dist_.withGuide, le = (B = "")=>{
|
|
1478
|
+
g = !0, p = xt({
|
|
1479
|
+
output: s
|
|
1480
|
+
}), $ = T(B), d = performance.now(), O && s.write(`${styleText("gray", dist_h)}
|
|
1481
|
+
`);
|
|
1482
|
+
let P = 0, G = 0;
|
|
1483
|
+
b(), f = setInterval(()=>{
|
|
1484
|
+
if (c && $ === m) return;
|
|
1485
|
+
S(), m = $;
|
|
1486
|
+
const L = y(o[P]);
|
|
1487
|
+
let Z;
|
|
1488
|
+
if (c) Z = `${L} ${$}...`;
|
|
1489
|
+
else if ("timer" === e) Z = `${L} ${$} ${M(d)}`;
|
|
1490
|
+
else {
|
|
1491
|
+
const et = ".".repeat(Math.floor(G)).slice(0, 3);
|
|
1492
|
+
Z = `${L} ${$}${et}`;
|
|
1493
|
+
}
|
|
1494
|
+
const Ze = J(Z, F, {
|
|
1495
|
+
hard: !0,
|
|
1496
|
+
trim: !1
|
|
1497
|
+
});
|
|
1498
|
+
s.write(Ze), P = P + 1 < o.length ? P + 1 : 0, G = G < 4 ? G + .125 : 0;
|
|
1499
|
+
}, u);
|
|
1500
|
+
}, k = (B = "", P = 0, G = !1)=>{
|
|
1501
|
+
if (!g) return;
|
|
1502
|
+
g = !1, clearInterval(f), S();
|
|
1503
|
+
const L = 0 === P ? styleText("green", dist_V) : 1 === P ? styleText("red", $e) : styleText("red", de);
|
|
1504
|
+
$ = B ?? $, G || ("timer" === e ? s.write(`${L} ${$} ${M(d)}
|
|
1505
|
+
`) : s.write(`${L} ${$}
|
|
1506
|
+
`)), w(), p();
|
|
1507
|
+
};
|
|
1508
|
+
return {
|
|
1509
|
+
start: le,
|
|
1510
|
+
stop: (B = "")=>k(B, 0),
|
|
1511
|
+
message: (B = "")=>{
|
|
1512
|
+
$ = T(B ?? $);
|
|
1513
|
+
},
|
|
1514
|
+
cancel: (B = "")=>k(B, 1),
|
|
1515
|
+
error: (B = "")=>k(B, 2),
|
|
1516
|
+
clear: ()=>k("", 0, !0),
|
|
1517
|
+
get isCancelled () {
|
|
1518
|
+
return E;
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1763
1521
|
};
|
|
1764
|
-
|
|
1522
|
+
I("\u2500", "-"), I("\u2501", "="), I("\u2588", "#");
|
|
1765
1523
|
const oe = (e, r)=>e.includes(`
|
|
1766
1524
|
`) ? e.split(`
|
|
1767
1525
|
`).map((s)=>r(s)).join(`
|
|
@@ -2094,12 +1852,13 @@ const normalizeErrorMessage = (err)=>{
|
|
|
2094
1852
|
return err.message;
|
|
2095
1853
|
};
|
|
2096
1854
|
let createLogger = (options = {})=>{
|
|
2097
|
-
|
|
1855
|
+
const { level = 'info', prefix, console: console1 = globalThis.console } = options;
|
|
1856
|
+
let maxLevel = level;
|
|
2098
1857
|
let log = (type, message, ...args)=>{
|
|
2099
1858
|
let logType = LOG_TYPES[type];
|
|
2100
1859
|
const { level } = logType;
|
|
2101
1860
|
if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
|
|
2102
|
-
if (null == message) return
|
|
1861
|
+
if (null == message) return console1.log();
|
|
2103
1862
|
let label = '';
|
|
2104
1863
|
let text = '';
|
|
2105
1864
|
if ('label' in logType) {
|
|
@@ -2117,8 +1876,9 @@ let createLogger = (options = {})=>{
|
|
|
2117
1876
|
let lines = message.split('\n');
|
|
2118
1877
|
text = lines.map((line)=>isErrorStackMessage(line) ? color.gray(line) : line).join('\n');
|
|
2119
1878
|
} else text = `${message}`;
|
|
1879
|
+
if (prefix) text = `${prefix} ${text}`;
|
|
2120
1880
|
const method = 'error' === level || 'warn' === level ? level : 'log';
|
|
2121
|
-
|
|
1881
|
+
console1[method](label.length ? `${label} ${text}` : text, ...args);
|
|
2122
1882
|
};
|
|
2123
1883
|
let logger = {
|
|
2124
1884
|
greet: (message)=>log('log', gradient(message))
|
|
@@ -2132,21 +1892,652 @@ let createLogger = (options = {})=>{
|
|
|
2132
1892
|
maxLevel = val;
|
|
2133
1893
|
}
|
|
2134
1894
|
});
|
|
1895
|
+
Object.defineProperty(logger, 'options', {
|
|
1896
|
+
get: ()=>({
|
|
1897
|
+
...options
|
|
1898
|
+
})
|
|
1899
|
+
});
|
|
2135
1900
|
logger.override = (customLogger)=>{
|
|
2136
1901
|
Object.assign(logger, customLogger);
|
|
2137
1902
|
};
|
|
2138
1903
|
return logger;
|
|
2139
1904
|
};
|
|
2140
1905
|
let src_logger = createLogger();
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
1906
|
+
var main_l = (e, t)=>()=>(t || e((t = {
|
|
1907
|
+
exports: {}
|
|
1908
|
+
}).exports, t), t.exports);
|
|
1909
|
+
var main_u = /* @__PURE__ */ createRequire(import.meta.url);
|
|
1910
|
+
const main_d = /^path$/i;
|
|
1911
|
+
const main_f = {
|
|
1912
|
+
key: "PATH",
|
|
1913
|
+
value: ""
|
|
1914
|
+
};
|
|
1915
|
+
function main_p(e) {
|
|
1916
|
+
for(const t in e){
|
|
1917
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !main_d.test(t)) continue;
|
|
1918
|
+
const n = e[t];
|
|
1919
|
+
if (!n) break;
|
|
1920
|
+
return {
|
|
1921
|
+
key: t,
|
|
1922
|
+
value: n
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
return main_f;
|
|
1926
|
+
}
|
|
1927
|
+
function main_m(e, t) {
|
|
1928
|
+
const i = t.value.split(delimiter);
|
|
1929
|
+
const o = [];
|
|
1930
|
+
let s = e;
|
|
1931
|
+
let c;
|
|
1932
|
+
do {
|
|
1933
|
+
o.push(resolve(s, "node_modules", ".bin"));
|
|
1934
|
+
c = s;
|
|
1935
|
+
s = dirname(s);
|
|
1936
|
+
}while (s !== c);
|
|
1937
|
+
const l = o.concat(i).join(delimiter);
|
|
1938
|
+
return {
|
|
1939
|
+
key: t.key,
|
|
1940
|
+
value: l
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
function main_h(e, t) {
|
|
1944
|
+
const n = {
|
|
1945
|
+
...process.env,
|
|
1946
|
+
...t
|
|
1947
|
+
};
|
|
1948
|
+
const r = main_m(e, main_p(n));
|
|
1949
|
+
n[r.key] = r.value;
|
|
1950
|
+
return n;
|
|
1951
|
+
}
|
|
1952
|
+
const main_g = (e)=>{
|
|
1953
|
+
let t = e.length;
|
|
1954
|
+
const n = new PassThrough();
|
|
1955
|
+
const r = ()=>{
|
|
1956
|
+
if (0 === --t) n.emit("end");
|
|
1957
|
+
};
|
|
1958
|
+
for (const t of e){
|
|
1959
|
+
t.pipe(n, {
|
|
1960
|
+
end: false
|
|
1961
|
+
});
|
|
1962
|
+
t.on("end", r);
|
|
1963
|
+
}
|
|
1964
|
+
return n;
|
|
1965
|
+
};
|
|
1966
|
+
var main_ = /* @__PURE__ */ main_l((e, t)=>{
|
|
1967
|
+
t.exports = a;
|
|
1968
|
+
a.sync = o;
|
|
1969
|
+
var n = main_u("fs");
|
|
1970
|
+
function r(e, t) {
|
|
1971
|
+
var n = void 0 !== t.pathExt ? t.pathExt : process.env.PATHEXT;
|
|
1972
|
+
if (!n) return true;
|
|
1973
|
+
n = n.split(";");
|
|
1974
|
+
if (-1 !== n.indexOf("")) return true;
|
|
1975
|
+
for(var r = 0; r < n.length; r++){
|
|
1976
|
+
var i = n[r].toLowerCase();
|
|
1977
|
+
if (i && e.substr(-i.length).toLowerCase() === i) return true;
|
|
1978
|
+
}
|
|
1979
|
+
return false;
|
|
1980
|
+
}
|
|
1981
|
+
function i(e, t, n) {
|
|
1982
|
+
if (!e.isSymbolicLink() && !e.isFile()) return false;
|
|
1983
|
+
return r(t, n);
|
|
1984
|
+
}
|
|
1985
|
+
function a(e, t, r) {
|
|
1986
|
+
n.stat(e, function(n, a) {
|
|
1987
|
+
r(n, n ? false : i(a, e, t));
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
function o(e, t) {
|
|
1991
|
+
return i(n.statSync(e), e, t);
|
|
1992
|
+
}
|
|
1993
|
+
});
|
|
1994
|
+
var main_v = /* @__PURE__ */ main_l((e, t)=>{
|
|
1995
|
+
t.exports = r;
|
|
1996
|
+
r.sync = i;
|
|
1997
|
+
var n = main_u("fs");
|
|
1998
|
+
function r(e, t, r) {
|
|
1999
|
+
n.stat(e, function(e, n) {
|
|
2000
|
+
r(e, e ? false : a(n, t));
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
function i(e, t) {
|
|
2004
|
+
return a(n.statSync(e), t);
|
|
2005
|
+
}
|
|
2006
|
+
function a(e, t) {
|
|
2007
|
+
return e.isFile() && o(e, t);
|
|
2008
|
+
}
|
|
2009
|
+
function o(e, t) {
|
|
2010
|
+
var n = e.mode;
|
|
2011
|
+
var r = e.uid;
|
|
2012
|
+
var i = e.gid;
|
|
2013
|
+
var a = void 0 !== t.uid ? t.uid : process.getuid && process.getuid();
|
|
2014
|
+
var o = void 0 !== t.gid ? t.gid : process.getgid && process.getgid();
|
|
2015
|
+
var s = parseInt("100", 8);
|
|
2016
|
+
var c = parseInt("010", 8);
|
|
2017
|
+
var l = parseInt("001", 8);
|
|
2018
|
+
var u = s | c;
|
|
2019
|
+
return n & l || n & c && i === o || n & s && r === a || n & u && 0 === a;
|
|
2020
|
+
}
|
|
2021
|
+
});
|
|
2022
|
+
var main_y = /* @__PURE__ */ main_l((e, t)=>{
|
|
2023
|
+
main_u("fs");
|
|
2024
|
+
var n;
|
|
2025
|
+
n = "win32" === process.platform || global.TESTING_WINDOWS ? main_() : main_v();
|
|
2026
|
+
t.exports = r;
|
|
2027
|
+
r.sync = i;
|
|
2028
|
+
function r(e, t, i) {
|
|
2029
|
+
if ("function" == typeof t) {
|
|
2030
|
+
i = t;
|
|
2031
|
+
t = {};
|
|
2032
|
+
}
|
|
2033
|
+
if (!i) {
|
|
2034
|
+
if ("function" != typeof Promise) throw new TypeError("callback not provided");
|
|
2035
|
+
return new Promise(function(n, i) {
|
|
2036
|
+
r(e, t || {}, function(e, t) {
|
|
2037
|
+
if (e) i(e);
|
|
2038
|
+
else n(t);
|
|
2039
|
+
});
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
n(e, t || {}, function(e, n) {
|
|
2043
|
+
if (e) {
|
|
2044
|
+
if ("EACCES" === e.code || t && t.ignoreErrors) {
|
|
2045
|
+
e = null;
|
|
2046
|
+
n = false;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
i(e, n);
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
function i(e, t) {
|
|
2053
|
+
try {
|
|
2054
|
+
return n.sync(e, t || {});
|
|
2055
|
+
} catch (e) {
|
|
2056
|
+
if (t && t.ignoreErrors || "EACCES" === e.code) return false;
|
|
2057
|
+
throw e;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
});
|
|
2061
|
+
var main_b = /* @__PURE__ */ main_l((e, t)=>{
|
|
2062
|
+
const n = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE;
|
|
2063
|
+
const r = main_u("path");
|
|
2064
|
+
const i = n ? ";" : ":";
|
|
2065
|
+
const a = main_y();
|
|
2066
|
+
const o = (e)=>Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), {
|
|
2067
|
+
code: "ENOENT"
|
|
2068
|
+
});
|
|
2069
|
+
const s = (e, t)=>{
|
|
2070
|
+
const r = t.colon || i;
|
|
2071
|
+
const a = e.match(/\//) || n && e.match(/\\/) ? [
|
|
2072
|
+
""
|
|
2073
|
+
] : [
|
|
2074
|
+
...n ? [
|
|
2075
|
+
process.cwd()
|
|
2076
|
+
] : [],
|
|
2077
|
+
...(t.path || process.env.PATH || "").split(r)
|
|
2078
|
+
];
|
|
2079
|
+
const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
2080
|
+
const s = n ? o.split(r) : [
|
|
2081
|
+
""
|
|
2082
|
+
];
|
|
2083
|
+
if (n) {
|
|
2084
|
+
if (-1 !== e.indexOf(".") && "" !== s[0]) s.unshift("");
|
|
2085
|
+
}
|
|
2086
|
+
return {
|
|
2087
|
+
pathEnv: a,
|
|
2088
|
+
pathExt: s,
|
|
2089
|
+
pathExtExe: o
|
|
2090
|
+
};
|
|
2091
|
+
};
|
|
2092
|
+
const c = (e, t, n)=>{
|
|
2093
|
+
if ("function" == typeof t) {
|
|
2094
|
+
n = t;
|
|
2095
|
+
t = {};
|
|
2096
|
+
}
|
|
2097
|
+
if (!t) t = {};
|
|
2098
|
+
const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
|
|
2099
|
+
const u = [];
|
|
2100
|
+
const d = (n)=>new Promise((a, s)=>{
|
|
2101
|
+
if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
|
|
2102
|
+
const c = i[n];
|
|
2103
|
+
const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
|
|
2104
|
+
const d = r.join(l, e);
|
|
2105
|
+
a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
|
|
2106
|
+
});
|
|
2107
|
+
const f = (e, n, r)=>new Promise((i, o)=>{
|
|
2108
|
+
if (r === c.length) return i(d(n + 1));
|
|
2109
|
+
const s = c[r];
|
|
2110
|
+
a(e + s, {
|
|
2111
|
+
pathExt: l
|
|
2112
|
+
}, (a, o)=>{
|
|
2113
|
+
if (!a && o) if (!t.all) return i(e + s);
|
|
2114
|
+
else u.push(e + s);
|
|
2115
|
+
return i(f(e, n, r + 1));
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
return n ? d(0).then((e)=>n(null, e), n) : d(0);
|
|
2119
|
+
};
|
|
2120
|
+
const l = (e, t)=>{
|
|
2121
|
+
t = t || {};
|
|
2122
|
+
const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
|
|
2123
|
+
const l = [];
|
|
2124
|
+
for(let o = 0; o < n.length; o++){
|
|
2125
|
+
const s = n[o];
|
|
2126
|
+
const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
|
|
2127
|
+
const d = r.join(u, e);
|
|
2128
|
+
const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
|
|
2129
|
+
for(let e = 0; e < i.length; e++){
|
|
2130
|
+
const n = f + i[e];
|
|
2131
|
+
try {
|
|
2132
|
+
if (a.sync(n, {
|
|
2133
|
+
pathExt: c
|
|
2134
|
+
})) if (!t.all) return n;
|
|
2135
|
+
else l.push(n);
|
|
2136
|
+
} catch (e) {}
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
if (t.all && l.length) return l;
|
|
2140
|
+
if (t.nothrow) return null;
|
|
2141
|
+
throw o(e);
|
|
2142
|
+
};
|
|
2143
|
+
t.exports = c;
|
|
2144
|
+
c.sync = l;
|
|
2145
|
+
});
|
|
2146
|
+
var main_x = /* @__PURE__ */ main_l((e, t)=>{
|
|
2147
|
+
const n = (e = {})=>{
|
|
2148
|
+
const t = e.env || process.env;
|
|
2149
|
+
if ("win32" !== (e.platform || process.platform)) return "PATH";
|
|
2150
|
+
return Object.keys(t).reverse().find((e)=>"PATH" === e.toUpperCase()) || "Path";
|
|
2151
|
+
};
|
|
2152
|
+
t.exports = n;
|
|
2153
|
+
t.exports.default = n;
|
|
2154
|
+
});
|
|
2155
|
+
var main_S = /* @__PURE__ */ main_l((e, t)=>{
|
|
2156
|
+
const n = main_u("path");
|
|
2157
|
+
const r = main_b();
|
|
2158
|
+
const i = main_x();
|
|
2159
|
+
function a(e, t) {
|
|
2160
|
+
const a = e.options.env || process.env;
|
|
2161
|
+
const o = process.cwd();
|
|
2162
|
+
const s = null != e.options.cwd;
|
|
2163
|
+
const c = s && void 0 !== process.chdir && !process.chdir.disabled;
|
|
2164
|
+
if (c) try {
|
|
2165
|
+
process.chdir(e.options.cwd);
|
|
2166
|
+
} catch (e) {}
|
|
2167
|
+
let l;
|
|
2168
|
+
try {
|
|
2169
|
+
l = r.sync(e.command, {
|
|
2170
|
+
path: a[i({
|
|
2171
|
+
env: a
|
|
2172
|
+
})],
|
|
2173
|
+
pathExt: t ? n.delimiter : void 0
|
|
2174
|
+
});
|
|
2175
|
+
} catch (e) {} finally{
|
|
2176
|
+
if (c) process.chdir(o);
|
|
2177
|
+
}
|
|
2178
|
+
if (l) l = n.resolve(s ? e.options.cwd : "", l);
|
|
2179
|
+
return l;
|
|
2180
|
+
}
|
|
2181
|
+
function o(e) {
|
|
2182
|
+
return a(e) || a(e, true);
|
|
2183
|
+
}
|
|
2184
|
+
t.exports = o;
|
|
2185
|
+
});
|
|
2186
|
+
var main_C = /* @__PURE__ */ main_l((e, t)=>{
|
|
2187
|
+
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
2188
|
+
function r(e) {
|
|
2189
|
+
e = e.replace(n, "^$1");
|
|
2190
|
+
return e;
|
|
2191
|
+
}
|
|
2192
|
+
function i(e, t) {
|
|
2193
|
+
e = `${e}`;
|
|
2194
|
+
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
2195
|
+
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
2196
|
+
e = `"${e}"`;
|
|
2197
|
+
e = e.replace(n, "^$1");
|
|
2198
|
+
if (t) e = e.replace(n, "^$1");
|
|
2199
|
+
return e;
|
|
2200
|
+
}
|
|
2201
|
+
t.exports.command = r;
|
|
2202
|
+
t.exports.argument = i;
|
|
2203
|
+
});
|
|
2204
|
+
var main_w = /* @__PURE__ */ main_l((e, t)=>{
|
|
2205
|
+
t.exports = /^#!(.*)/;
|
|
2206
|
+
});
|
|
2207
|
+
var main_T = /* @__PURE__ */ main_l((e, t)=>{
|
|
2208
|
+
const n = main_w();
|
|
2209
|
+
t.exports = (e = "")=>{
|
|
2210
|
+
const t = e.match(n);
|
|
2211
|
+
if (!t) return null;
|
|
2212
|
+
const [r, i] = t[0].replace(/#! ?/, "").split(" ");
|
|
2213
|
+
const a = r.split("/").pop();
|
|
2214
|
+
if ("env" === a) return i;
|
|
2215
|
+
return i ? `${a} ${i}` : a;
|
|
2216
|
+
};
|
|
2217
|
+
});
|
|
2218
|
+
var main_E = /* @__PURE__ */ main_l((e, t)=>{
|
|
2219
|
+
const n = main_u("fs");
|
|
2220
|
+
const r = main_T();
|
|
2221
|
+
function i(e) {
|
|
2222
|
+
const t = 150;
|
|
2223
|
+
const i = Buffer.alloc(t);
|
|
2224
|
+
let a;
|
|
2225
|
+
try {
|
|
2226
|
+
a = n.openSync(e, "r");
|
|
2227
|
+
n.readSync(a, i, 0, t, 0);
|
|
2228
|
+
n.closeSync(a);
|
|
2229
|
+
} catch (e) {}
|
|
2230
|
+
return r(i.toString());
|
|
2231
|
+
}
|
|
2232
|
+
t.exports = i;
|
|
2233
|
+
});
|
|
2234
|
+
var main_D = /* @__PURE__ */ main_l((e, t)=>{
|
|
2235
|
+
const n = main_u("path");
|
|
2236
|
+
const r = main_S();
|
|
2237
|
+
const i = main_C();
|
|
2238
|
+
const a = main_E();
|
|
2239
|
+
const o = "win32" === process.platform;
|
|
2240
|
+
const s = /\.(?:com|exe)$/i;
|
|
2241
|
+
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
2242
|
+
function l(e) {
|
|
2243
|
+
e.file = r(e);
|
|
2244
|
+
const t = e.file && a(e.file);
|
|
2245
|
+
if (t) {
|
|
2246
|
+
e.args.unshift(e.file);
|
|
2247
|
+
e.command = t;
|
|
2248
|
+
return r(e);
|
|
2249
|
+
}
|
|
2250
|
+
return e.file;
|
|
2251
|
+
}
|
|
2252
|
+
function d(e) {
|
|
2253
|
+
if (!o) return e;
|
|
2254
|
+
const t = l(e);
|
|
2255
|
+
const r = !s.test(t);
|
|
2256
|
+
if (e.options.forceShell || r) {
|
|
2257
|
+
const r = c.test(t);
|
|
2258
|
+
e.command = n.normalize(e.command);
|
|
2259
|
+
e.command = i.command(e.command);
|
|
2260
|
+
e.args = e.args.map((e)=>i.argument(e, r));
|
|
2261
|
+
e.args = [
|
|
2262
|
+
"/d",
|
|
2263
|
+
"/s",
|
|
2264
|
+
"/c",
|
|
2265
|
+
`"${[
|
|
2266
|
+
e.command
|
|
2267
|
+
].concat(e.args).join(" ")}"`
|
|
2268
|
+
];
|
|
2269
|
+
e.command = process.env.comspec || "cmd.exe";
|
|
2270
|
+
e.options.windowsVerbatimArguments = true;
|
|
2271
|
+
}
|
|
2272
|
+
return e;
|
|
2273
|
+
}
|
|
2274
|
+
function f(e, t, n) {
|
|
2275
|
+
if (t && !Array.isArray(t)) {
|
|
2276
|
+
n = t;
|
|
2277
|
+
t = null;
|
|
2278
|
+
}
|
|
2279
|
+
t = t ? t.slice(0) : [];
|
|
2280
|
+
n = Object.assign({}, n);
|
|
2281
|
+
const r = {
|
|
2282
|
+
command: e,
|
|
2283
|
+
args: t,
|
|
2284
|
+
options: n,
|
|
2285
|
+
file: void 0,
|
|
2286
|
+
original: {
|
|
2287
|
+
command: e,
|
|
2288
|
+
args: t
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
return n.shell ? r : d(r);
|
|
2292
|
+
}
|
|
2293
|
+
t.exports = f;
|
|
2294
|
+
});
|
|
2295
|
+
var main_O = /* @__PURE__ */ main_l((e, t)=>{
|
|
2296
|
+
const n = "win32" === process.platform;
|
|
2297
|
+
function r(e, t) {
|
|
2298
|
+
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
2299
|
+
code: "ENOENT",
|
|
2300
|
+
errno: "ENOENT",
|
|
2301
|
+
syscall: `${t} ${e.command}`,
|
|
2302
|
+
path: e.command,
|
|
2303
|
+
spawnargs: e.args
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
function i(e, t) {
|
|
2307
|
+
if (!n) return;
|
|
2308
|
+
const r = e.emit;
|
|
2309
|
+
e.emit = function(n, i) {
|
|
2310
|
+
if ("exit" === n) {
|
|
2311
|
+
const n = a(i, t);
|
|
2312
|
+
if (n) return r.call(e, "error", n);
|
|
2313
|
+
}
|
|
2314
|
+
return r.apply(e, arguments);
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function a(e, t) {
|
|
2318
|
+
if (n && 1 === e && !t.file) return r(t.original, "spawn");
|
|
2319
|
+
return null;
|
|
2320
|
+
}
|
|
2321
|
+
function o(e, t) {
|
|
2322
|
+
if (n && 1 === e && !t.file) return r(t.original, "spawnSync");
|
|
2323
|
+
return null;
|
|
2324
|
+
}
|
|
2325
|
+
t.exports = {
|
|
2326
|
+
hookChildProcess: i,
|
|
2327
|
+
verifyENOENT: a,
|
|
2328
|
+
verifyENOENTSync: o,
|
|
2329
|
+
notFoundError: r
|
|
2330
|
+
};
|
|
2331
|
+
});
|
|
2332
|
+
var main_k = /* @__PURE__ */ main_l((e, t)=>{
|
|
2333
|
+
const n = main_u("child_process");
|
|
2334
|
+
const r = main_D();
|
|
2335
|
+
const i = main_O();
|
|
2336
|
+
function a(e, t, a) {
|
|
2337
|
+
const o = r(e, t, a);
|
|
2338
|
+
const s = n.spawn(o.command, o.args, o.options);
|
|
2339
|
+
i.hookChildProcess(s, o);
|
|
2340
|
+
return s;
|
|
2341
|
+
}
|
|
2342
|
+
function o(e, t, a) {
|
|
2343
|
+
const o = r(e, t, a);
|
|
2344
|
+
const s = n.spawnSync(o.command, o.args, o.options);
|
|
2345
|
+
s.error = s.error || i.verifyENOENTSync(s.status, o);
|
|
2346
|
+
return s;
|
|
2347
|
+
}
|
|
2348
|
+
t.exports = a;
|
|
2349
|
+
t.exports.spawn = a;
|
|
2350
|
+
t.exports.sync = o;
|
|
2351
|
+
t.exports._parse = r;
|
|
2352
|
+
t.exports._enoent = i;
|
|
2353
|
+
});
|
|
2354
|
+
var main_A = main_k();
|
|
2355
|
+
var main_j = class extends Error {
|
|
2356
|
+
result;
|
|
2357
|
+
output;
|
|
2358
|
+
get exitCode() {
|
|
2359
|
+
if (null !== this.result.exitCode) return this.result.exitCode;
|
|
2360
|
+
}
|
|
2361
|
+
constructor(e, t){
|
|
2362
|
+
super(`Process exited with non-zero status (${e.exitCode})`);
|
|
2363
|
+
this.result = e;
|
|
2364
|
+
this.output = t;
|
|
2365
|
+
}
|
|
2366
|
+
};
|
|
2367
|
+
const main_M = {
|
|
2368
|
+
timeout: void 0,
|
|
2369
|
+
persist: false
|
|
2370
|
+
};
|
|
2371
|
+
const N = {
|
|
2372
|
+
windowsHide: true
|
|
2373
|
+
};
|
|
2374
|
+
function main_P(e, t) {
|
|
2375
|
+
return {
|
|
2376
|
+
command: external_node_path_normalize(e),
|
|
2377
|
+
args: t ?? []
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
function main_F(e) {
|
|
2381
|
+
const t = new AbortController();
|
|
2382
|
+
for (const n of e){
|
|
2383
|
+
if (n.aborted) {
|
|
2384
|
+
t.abort();
|
|
2385
|
+
return n;
|
|
2386
|
+
}
|
|
2387
|
+
const e = ()=>{
|
|
2388
|
+
t.abort(n.reason);
|
|
2389
|
+
};
|
|
2390
|
+
n.addEventListener("abort", e, {
|
|
2391
|
+
signal: t.signal
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
return t.signal;
|
|
2395
|
+
}
|
|
2396
|
+
async function main_I(e) {
|
|
2397
|
+
let t = "";
|
|
2398
|
+
for await (const n of e)t += n.toString();
|
|
2399
|
+
return t;
|
|
2400
|
+
}
|
|
2401
|
+
var main_L = class {
|
|
2402
|
+
_process;
|
|
2403
|
+
_aborted = false;
|
|
2404
|
+
_options;
|
|
2405
|
+
_command;
|
|
2406
|
+
_args;
|
|
2407
|
+
_resolveClose;
|
|
2408
|
+
_processClosed;
|
|
2409
|
+
_thrownError;
|
|
2410
|
+
get process() {
|
|
2411
|
+
return this._process;
|
|
2412
|
+
}
|
|
2413
|
+
get pid() {
|
|
2414
|
+
return this._process?.pid;
|
|
2415
|
+
}
|
|
2416
|
+
get exitCode() {
|
|
2417
|
+
if (this._process && null !== this._process.exitCode) return this._process.exitCode;
|
|
2418
|
+
}
|
|
2419
|
+
constructor(e, t, n){
|
|
2420
|
+
this._options = {
|
|
2421
|
+
...main_M,
|
|
2422
|
+
...n
|
|
2423
|
+
};
|
|
2424
|
+
this._command = e;
|
|
2425
|
+
this._args = t ?? [];
|
|
2426
|
+
this._processClosed = new Promise((e)=>{
|
|
2427
|
+
this._resolveClose = e;
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
kill(e) {
|
|
2431
|
+
return this._process?.kill(e) === true;
|
|
2432
|
+
}
|
|
2433
|
+
get aborted() {
|
|
2434
|
+
return this._aborted;
|
|
2435
|
+
}
|
|
2436
|
+
get killed() {
|
|
2437
|
+
return this._process?.killed === true;
|
|
2438
|
+
}
|
|
2439
|
+
pipe(e, t, n) {
|
|
2440
|
+
return main_z(e, t, {
|
|
2441
|
+
...n,
|
|
2442
|
+
stdin: this
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
async *[Symbol.asyncIterator]() {
|
|
2446
|
+
const e = this._process;
|
|
2447
|
+
if (!e) return;
|
|
2448
|
+
const t = [];
|
|
2449
|
+
if (this._streamErr) t.push(this._streamErr);
|
|
2450
|
+
if (this._streamOut) t.push(this._streamOut);
|
|
2451
|
+
const n = main_g(t);
|
|
2452
|
+
const r = node_readline.createInterface({
|
|
2453
|
+
input: n
|
|
2454
|
+
});
|
|
2455
|
+
for await (const e of r)yield e.toString();
|
|
2456
|
+
await this._processClosed;
|
|
2457
|
+
e.removeAllListeners();
|
|
2458
|
+
if (this._thrownError) throw this._thrownError;
|
|
2459
|
+
if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_j(this);
|
|
2460
|
+
}
|
|
2461
|
+
async _waitForOutput() {
|
|
2462
|
+
const e = this._process;
|
|
2463
|
+
if (!e) throw new Error("No process was started");
|
|
2464
|
+
const [t, n] = await Promise.all([
|
|
2465
|
+
this._streamOut ? main_I(this._streamOut) : "",
|
|
2466
|
+
this._streamErr ? main_I(this._streamErr) : ""
|
|
2467
|
+
]);
|
|
2468
|
+
await this._processClosed;
|
|
2469
|
+
if (this._options?.stdin) await this._options.stdin;
|
|
2470
|
+
e.removeAllListeners();
|
|
2471
|
+
if (this._thrownError) throw this._thrownError;
|
|
2472
|
+
const r = {
|
|
2473
|
+
stderr: n,
|
|
2474
|
+
stdout: t,
|
|
2475
|
+
exitCode: this.exitCode
|
|
2476
|
+
};
|
|
2477
|
+
if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_j(this, r);
|
|
2478
|
+
return r;
|
|
2479
|
+
}
|
|
2480
|
+
then(e, t) {
|
|
2481
|
+
return this._waitForOutput().then(e, t);
|
|
2482
|
+
}
|
|
2483
|
+
_streamOut;
|
|
2484
|
+
_streamErr;
|
|
2485
|
+
spawn() {
|
|
2486
|
+
const e = external_node_process_cwd();
|
|
2487
|
+
const n = this._options;
|
|
2488
|
+
const r = {
|
|
2489
|
+
...N,
|
|
2490
|
+
...n.nodeOptions
|
|
2491
|
+
};
|
|
2492
|
+
const i = [];
|
|
2493
|
+
this._resetState();
|
|
2494
|
+
if (void 0 !== n.timeout) i.push(AbortSignal.timeout(n.timeout));
|
|
2495
|
+
if (void 0 !== n.signal) i.push(n.signal);
|
|
2496
|
+
if (true === n.persist) r.detached = true;
|
|
2497
|
+
if (i.length > 0) r.signal = main_F(i);
|
|
2498
|
+
r.env = main_h(e, r.env);
|
|
2499
|
+
const { command: a, args: s } = main_P(this._command, this._args);
|
|
2500
|
+
const c = (0, main_A._parse)(a, s, r);
|
|
2501
|
+
const l = spawn(c.command, c.args, c.options);
|
|
2502
|
+
if (l.stderr) this._streamErr = l.stderr;
|
|
2503
|
+
if (l.stdout) this._streamOut = l.stdout;
|
|
2504
|
+
this._process = l;
|
|
2505
|
+
l.once("error", this._onError);
|
|
2506
|
+
l.once("close", this._onClose);
|
|
2507
|
+
if (void 0 !== n.stdin && l.stdin && n.stdin.process) {
|
|
2508
|
+
const { stdout: e } = n.stdin.process;
|
|
2509
|
+
if (e) e.pipe(l.stdin);
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
_resetState() {
|
|
2513
|
+
this._aborted = false;
|
|
2514
|
+
this._processClosed = new Promise((e)=>{
|
|
2515
|
+
this._resolveClose = e;
|
|
2516
|
+
});
|
|
2517
|
+
this._thrownError = void 0;
|
|
2518
|
+
}
|
|
2519
|
+
_onError = (e)=>{
|
|
2520
|
+
if ("AbortError" === e.name && (!(e.cause instanceof Error) || "TimeoutError" !== e.cause.name)) {
|
|
2521
|
+
this._aborted = true;
|
|
2522
|
+
return;
|
|
2523
|
+
}
|
|
2524
|
+
this._thrownError = e;
|
|
2525
|
+
};
|
|
2526
|
+
_onClose = ()=>{
|
|
2527
|
+
if (this._resolveClose) this._resolveClose();
|
|
2528
|
+
};
|
|
2529
|
+
};
|
|
2530
|
+
const main_R = (e, t, n)=>{
|
|
2531
|
+
const r = new main_L(e, t, n);
|
|
2532
|
+
r.spawn();
|
|
2533
|
+
return r;
|
|
2534
|
+
};
|
|
2535
|
+
const main_z = main_R;
|
|
2536
|
+
const dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.2.1/node_modules/@vercel/detect-agent/dist/index.js");
|
|
2144
2537
|
const cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
2145
2538
|
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
2146
2539
|
const minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
2147
2540
|
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
2148
|
-
const picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
2149
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
2150
2541
|
const src_filename = fileURLToPath(import.meta.url);
|
|
2151
2542
|
const src_dirname = dirname(src_filename);
|
|
2152
2543
|
function cancelAndExit() {
|
|
@@ -2174,7 +2565,7 @@ function pkgFromUserAgent(userAgent) {
|
|
|
2174
2565
|
};
|
|
2175
2566
|
}
|
|
2176
2567
|
function isEmptyDir(path) {
|
|
2177
|
-
const files =
|
|
2568
|
+
const files = node_fs.readdirSync(path);
|
|
2178
2569
|
return 0 === files.length || 1 === files.length && '.git' === files[0];
|
|
2179
2570
|
}
|
|
2180
2571
|
function parseToolsOption(tools) {
|
|
@@ -2184,36 +2575,49 @@ function parseToolsOption(tools) {
|
|
|
2184
2575
|
];
|
|
2185
2576
|
return toolsArr.flatMap((tool)=>tool.split(',')).map((tool)=>tool.trim()).filter(Boolean);
|
|
2186
2577
|
}
|
|
2578
|
+
function parseSkillsOption(skills) {
|
|
2579
|
+
if (void 0 === skills) return null;
|
|
2580
|
+
const skillsArr = Array.isArray(skills) ? skills : [
|
|
2581
|
+
skills
|
|
2582
|
+
];
|
|
2583
|
+
return skillsArr.flatMap((skill)=>skill.split(',')).map((skill)=>skill.trim()).filter(Boolean);
|
|
2584
|
+
}
|
|
2187
2585
|
const BUILTIN_TOOLS = [
|
|
2188
2586
|
'biome',
|
|
2189
2587
|
'eslint',
|
|
2190
2588
|
'prettier'
|
|
2191
2589
|
];
|
|
2192
|
-
function logHelpMessage(name, templates, extraTools) {
|
|
2590
|
+
function logHelpMessage(name, templates, extraTools, extraSkills) {
|
|
2193
2591
|
const toolsList = [
|
|
2194
2592
|
...BUILTIN_TOOLS
|
|
2195
2593
|
];
|
|
2594
|
+
const skillsList = (extraSkills ?? []).map((skill)=>skill.value).filter(Boolean);
|
|
2595
|
+
const hasSkills = skillsList.length > 0;
|
|
2196
2596
|
if (extraTools) {
|
|
2197
2597
|
for (const tool of extraTools)if (tool.value) if ('pre' === tool.order) toolsList.unshift(tool.value);
|
|
2198
2598
|
else toolsList.push(tool.value);
|
|
2199
2599
|
}
|
|
2600
|
+
const skillsOptionLine = hasSkills ? ' --skill <skill> add optional skills, comma separated\n' : '';
|
|
2601
|
+
const optionalSkillsSection = hasSkills ? `
|
|
2602
|
+
Optional skills:
|
|
2603
|
+
${skillsList.join(', ')}` : '';
|
|
2200
2604
|
src_logger.log(`
|
|
2201
2605
|
Usage: create-${name} [dir] [options]
|
|
2202
2606
|
|
|
2203
2607
|
Options:
|
|
2204
2608
|
|
|
2205
2609
|
-h, --help display help for command
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2610
|
+
-d, --dir <dir> create project in specified directory
|
|
2611
|
+
-t, --template <tpl> specify the template to use
|
|
2612
|
+
--tools <tool> add additional tools, comma separated
|
|
2613
|
+
${skillsOptionLine} --override override files in target directory
|
|
2614
|
+
--packageName <name> specify the package name
|
|
2615
|
+
|
|
2616
|
+
Available templates:
|
|
2617
|
+
${templates.join(', ')}
|
|
2214
2618
|
|
|
2215
|
-
|
|
2216
|
-
|
|
2619
|
+
Optional tools:
|
|
2620
|
+
${toolsList.join(', ')}${optionalSkillsSection}
|
|
2217
2621
|
`);
|
|
2218
2622
|
}
|
|
2219
2623
|
async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
@@ -2256,10 +2660,41 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
2256
2660
|
required: false
|
|
2257
2661
|
}));
|
|
2258
2662
|
}
|
|
2663
|
+
function filterExtraSkills(extraSkills, templateName) {
|
|
2664
|
+
return extraSkills?.filter((extraSkill)=>{
|
|
2665
|
+
const when = extraSkill.when ?? (()=>true);
|
|
2666
|
+
return templateName ? when(templateName) : true;
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
function orderExtraSkills(extraSkills) {
|
|
2670
|
+
if (!extraSkills) return [];
|
|
2671
|
+
return [
|
|
2672
|
+
...extraSkills.filter((extraSkill)=>'pre' === extraSkill.order),
|
|
2673
|
+
...extraSkills.filter((extraSkill)=>void 0 === extraSkill.order),
|
|
2674
|
+
...extraSkills.filter((extraSkill)=>'post' === extraSkill.order)
|
|
2675
|
+
];
|
|
2676
|
+
}
|
|
2677
|
+
async function getSkills({ skill, dir, template }, extraSkills, templateName, promptMultiselect = dist_Lt) {
|
|
2678
|
+
const parsedSkills = parseSkillsOption(skill);
|
|
2679
|
+
const filteredExtraSkills = filterExtraSkills(extraSkills, templateName);
|
|
2680
|
+
if (null !== parsedSkills) return parsedSkills.filter((value)=>filteredExtraSkills?.some((extraSkill)=>extraSkill.value === value));
|
|
2681
|
+
if (dir && template) return [];
|
|
2682
|
+
if (!filteredExtraSkills?.length) return [];
|
|
2683
|
+
const orderedExtraSkills = orderExtraSkills(filteredExtraSkills);
|
|
2684
|
+
return checkCancel(await promptMultiselect({
|
|
2685
|
+
message: 'Select optional skills (Use <space> to select, <enter> to continue)',
|
|
2686
|
+
options: orderedExtraSkills.map((extraSkill)=>({
|
|
2687
|
+
value: extraSkill.value,
|
|
2688
|
+
label: extraSkill.label,
|
|
2689
|
+
hint: extraSkill.source
|
|
2690
|
+
})),
|
|
2691
|
+
required: false
|
|
2692
|
+
}));
|
|
2693
|
+
}
|
|
2259
2694
|
function upperFirst(str) {
|
|
2260
2695
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2261
2696
|
}
|
|
2262
|
-
const readJSON = async (path)=>JSON.parse(await
|
|
2697
|
+
const readJSON = async (path)=>JSON.parse(await node_fs.promises.readFile(path, 'utf-8'));
|
|
2263
2698
|
const readPackageJson = async (filePath)=>readJSON(node_path.join(filePath, 'package.json'));
|
|
2264
2699
|
const parseArgv = (processArgv)=>{
|
|
2265
2700
|
const argv = minimist_default()(processArgv.slice(2), {
|
|
@@ -2273,7 +2708,7 @@ const parseArgv = (processArgv)=>{
|
|
|
2273
2708
|
if (argv['package-name']) argv.packageName = argv['package-name'];
|
|
2274
2709
|
return argv;
|
|
2275
2710
|
};
|
|
2276
|
-
function runCommand(command, cwd, packageManager) {
|
|
2711
|
+
async function runCommand(command, cwd, packageManager) {
|
|
2277
2712
|
if (command.startsWith('npm create ')) {
|
|
2278
2713
|
const createReplacements = {
|
|
2279
2714
|
bun: 'bun create ',
|
|
@@ -2285,13 +2720,55 @@ function runCommand(command, cwd, packageManager) {
|
|
|
2285
2720
|
if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
|
|
2286
2721
|
if ('yarn' === packageManager) command = command.replace('@latest', '');
|
|
2287
2722
|
}
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2723
|
+
const result = await main_R(command, [], {
|
|
2724
|
+
nodeOptions: {
|
|
2725
|
+
shell: true,
|
|
2726
|
+
stdio: 'inherit',
|
|
2727
|
+
cwd
|
|
2728
|
+
}
|
|
2292
2729
|
});
|
|
2730
|
+
if (0 !== result.exitCode) {
|
|
2731
|
+
const details = [
|
|
2732
|
+
result.stderr,
|
|
2733
|
+
result.stdout
|
|
2734
|
+
].filter(Boolean).join('\n').trim();
|
|
2735
|
+
throw new Error(`Failed to run command: ${command}${details ? `\n${details}` : ''}`);
|
|
2736
|
+
}
|
|
2293
2737
|
}
|
|
2294
|
-
async function
|
|
2738
|
+
async function runSkillCommand(skill, cwd) {
|
|
2739
|
+
const args = [
|
|
2740
|
+
'-y',
|
|
2741
|
+
'skills',
|
|
2742
|
+
'add',
|
|
2743
|
+
skill.source,
|
|
2744
|
+
'--agent',
|
|
2745
|
+
'universal',
|
|
2746
|
+
'--yes',
|
|
2747
|
+
'--copy',
|
|
2748
|
+
'--skill',
|
|
2749
|
+
skill.skill ?? skill.value
|
|
2750
|
+
];
|
|
2751
|
+
const command = `npx ${args.join(' ')}`;
|
|
2752
|
+
R.info(`Running skill install command: ${color.dim(command)}`);
|
|
2753
|
+
const installationSpinner = be();
|
|
2754
|
+
installationSpinner.start(`Installing skill ${skill.value}`);
|
|
2755
|
+
const result = await main_R('npx', args, {
|
|
2756
|
+
nodeOptions: {
|
|
2757
|
+
cwd,
|
|
2758
|
+
stdio: 'pipe'
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
if (0 !== result.exitCode) {
|
|
2762
|
+
installationSpinner.error(`Failed to install skill ${skill.value}`);
|
|
2763
|
+
const details = [
|
|
2764
|
+
result.stderr,
|
|
2765
|
+
result.stdout
|
|
2766
|
+
].filter(Boolean).join('\n').trim();
|
|
2767
|
+
throw new Error(`Failed to install skill "${skill.value}" from "${skill.source}" using command: ${command}${details ? `\n${details}` : ''}`);
|
|
2768
|
+
}
|
|
2769
|
+
installationSpinner.stop(`Installed skill ${skill.value}`);
|
|
2770
|
+
}
|
|
2771
|
+
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
|
|
2295
2772
|
src_logger.greet(`\n◆ Create ${upperFirst(name)} Project`);
|
|
2296
2773
|
const { isAgent } = await (0, dist.determineAgent)();
|
|
2297
2774
|
if (isAgent) {
|
|
@@ -2299,7 +2776,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2299
2776
|
src_logger.info(`To create a project non-interactively, run: npx -y create-${name} <DIR> --template <TEMPLATE>`);
|
|
2300
2777
|
}
|
|
2301
2778
|
const argv = parseArgv(processArgv);
|
|
2302
|
-
if (argv.help) return void logHelpMessage(name, templates, extraTools);
|
|
2779
|
+
if (argv.help) return void logHelpMessage(name, templates, extraTools, extraSkills);
|
|
2303
2780
|
const cwd = process.cwd();
|
|
2304
2781
|
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
|
|
2305
2782
|
const packageManager = pkgInfo ? pkgInfo.name : 'npm';
|
|
@@ -2319,7 +2796,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2319
2796
|
const { targetDir } = formatted;
|
|
2320
2797
|
const packageName = argv.packageName || formatted.packageName;
|
|
2321
2798
|
const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
|
|
2322
|
-
if (!argv.override &&
|
|
2799
|
+
if (!argv.override && node_fs.existsSync(distFolder) && !isEmptyDir(distFolder)) {
|
|
2323
2800
|
const option = checkCancel(await Jt({
|
|
2324
2801
|
message: `"${targetDir}" is not empty, please choose:`,
|
|
2325
2802
|
options: [
|
|
@@ -2337,9 +2814,11 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2337
2814
|
}
|
|
2338
2815
|
const templateName = await getTemplateName(argv);
|
|
2339
2816
|
const tools = await getTools(argv, extraTools, templateName);
|
|
2817
|
+
const filteredExtraSkills = filterExtraSkills(extraSkills, templateName);
|
|
2818
|
+
const skills = await getSkills(argv, filteredExtraSkills, templateName, dist_Lt);
|
|
2340
2819
|
const srcFolder = node_path.join(root, `template-${templateName}`);
|
|
2341
2820
|
const commonFolder = node_path.join(root, 'template-common');
|
|
2342
|
-
if (!
|
|
2821
|
+
if (!node_fs.existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
|
|
2343
2822
|
copyFolder({
|
|
2344
2823
|
from: commonFolder,
|
|
2345
2824
|
to: distFolder,
|
|
@@ -2355,6 +2834,10 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2355
2834
|
templateParameters,
|
|
2356
2835
|
skipFiles
|
|
2357
2836
|
});
|
|
2837
|
+
for (const skillValue of skills){
|
|
2838
|
+
const matchedSkill = filteredExtraSkills?.find((extraSkill)=>extraSkill.value === skillValue);
|
|
2839
|
+
if (matchedSkill) await runSkillCommand(matchedSkill, distFolder);
|
|
2840
|
+
}
|
|
2358
2841
|
const packageRoot = node_path.resolve(src_dirname, '..');
|
|
2359
2842
|
const agentsMdSearchDirs = [
|
|
2360
2843
|
commonFolder,
|
|
@@ -2369,7 +2852,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2369
2852
|
distFolder,
|
|
2370
2853
|
addAgentsMdSearchDirs: (dir)=>agentsMdSearchDirs.push(dir)
|
|
2371
2854
|
});
|
|
2372
|
-
if (matchedTool.command) runCommand(matchedTool.command, distFolder, packageManager);
|
|
2855
|
+
if (matchedTool.command) await runCommand(matchedTool.command, distFolder, packageManager);
|
|
2373
2856
|
continue;
|
|
2374
2857
|
}
|
|
2375
2858
|
}
|
|
@@ -2401,21 +2884,21 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2401
2884
|
isMergePackageJson: true
|
|
2402
2885
|
});
|
|
2403
2886
|
agentsMdSearchDirs.push(toolFolder);
|
|
2404
|
-
if ('biome' === tool) await
|
|
2887
|
+
if ('biome' === tool) await node_fs.promises.rename(node_path.join(distFolder, 'biome.json.template'), node_path.join(distFolder, 'biome.json'));
|
|
2405
2888
|
}
|
|
2406
2889
|
const agentsFiles = collectAgentsFiles(agentsMdSearchDirs);
|
|
2407
2890
|
if (agentsFiles.length > 0) {
|
|
2408
2891
|
const mergedAgents = mergeAgentsFiles(agentsFiles);
|
|
2409
2892
|
const agentsPath = node_path.join(distFolder, 'AGENTS.md');
|
|
2410
|
-
|
|
2893
|
+
node_fs.writeFileSync(agentsPath, `${replacePlaceholder(mergedAgents, templateParameters)}\n`);
|
|
2411
2894
|
}
|
|
2412
2895
|
const nextSteps = noteInformation ? noteInformation : [
|
|
2413
|
-
`1. ${
|
|
2414
|
-
`2. ${
|
|
2415
|
-
`3. ${
|
|
2416
|
-
`4. ${
|
|
2896
|
+
`1. ${color.cyan(`cd ${targetDir}`)}`,
|
|
2897
|
+
`2. ${color.cyan('git init')} ${color.dim('(optional)')}`,
|
|
2898
|
+
`3. ${color.cyan(`${packageManager} install`)}`,
|
|
2899
|
+
`4. ${color.cyan(`${packageManager} run dev`)}`
|
|
2417
2900
|
];
|
|
2418
|
-
if (nextSteps.length) dist_Vt(nextSteps.map((step)=>
|
|
2901
|
+
if (nextSteps.length) dist_Vt(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
|
|
2419
2902
|
Gt('All set, happy coding!');
|
|
2420
2903
|
}
|
|
2421
2904
|
function sortObjectKeys(obj) {
|
|
@@ -2425,9 +2908,9 @@ function sortObjectKeys(obj) {
|
|
|
2425
2908
|
return sortedObj;
|
|
2426
2909
|
}
|
|
2427
2910
|
function mergePackageJson(targetPackage, extraPackage) {
|
|
2428
|
-
if (!
|
|
2429
|
-
const targetJson = JSON.parse(
|
|
2430
|
-
const extraJson = JSON.parse(
|
|
2911
|
+
if (!node_fs.existsSync(targetPackage)) return;
|
|
2912
|
+
const targetJson = JSON.parse(node_fs.readFileSync(targetPackage, 'utf-8'));
|
|
2913
|
+
const extraJson = JSON.parse(node_fs.readFileSync(extraPackage, 'utf-8'));
|
|
2431
2914
|
const mergedJson = cjs_default()(targetJson, extraJson);
|
|
2432
2915
|
mergedJson.name = targetJson.name || extraJson.name;
|
|
2433
2916
|
for (const key of [
|
|
@@ -2435,7 +2918,7 @@ function mergePackageJson(targetPackage, extraPackage) {
|
|
|
2435
2918
|
'dependencies',
|
|
2436
2919
|
'devDependencies'
|
|
2437
2920
|
])if (key in mergedJson) mergedJson[key] = sortObjectKeys(mergedJson[key]);
|
|
2438
|
-
|
|
2921
|
+
node_fs.writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}\n`);
|
|
2439
2922
|
}
|
|
2440
2923
|
const isMarkdown = (file)=>file.endsWith('.md') || file.endsWith('.mdx');
|
|
2441
2924
|
const replacePlaceholder = (content, templateParameters)=>{
|
|
@@ -2452,14 +2935,14 @@ function copyFolder({ from, to, version, packageName, templateParameters, isMerg
|
|
|
2452
2935
|
'dist',
|
|
2453
2936
|
...skipFiles
|
|
2454
2937
|
];
|
|
2455
|
-
|
|
2938
|
+
node_fs.mkdirSync(to, {
|
|
2456
2939
|
recursive: true
|
|
2457
2940
|
});
|
|
2458
|
-
for (const file of
|
|
2941
|
+
for (const file of node_fs.readdirSync(from)){
|
|
2459
2942
|
if (allSkipFiles.includes(file)) continue;
|
|
2460
2943
|
const srcFile = node_path.resolve(from, file);
|
|
2461
2944
|
const distFile = renameFiles[file] ? node_path.resolve(to, renameFiles[file]) : node_path.resolve(to, file);
|
|
2462
|
-
const stat =
|
|
2945
|
+
const stat = node_fs.statSync(srcFile);
|
|
2463
2946
|
if (stat.isDirectory()) copyFolder({
|
|
2464
2947
|
from: srcFile,
|
|
2465
2948
|
to: distFile,
|
|
@@ -2469,14 +2952,14 @@ function copyFolder({ from, to, version, packageName, templateParameters, isMerg
|
|
|
2469
2952
|
});
|
|
2470
2953
|
else if ('package.json' === file) {
|
|
2471
2954
|
const targetPackage = node_path.resolve(to, 'package.json');
|
|
2472
|
-
if (isMergePackageJson &&
|
|
2473
|
-
else
|
|
2955
|
+
if (isMergePackageJson && node_fs.existsSync(targetPackage)) mergePackageJson(targetPackage, srcFile);
|
|
2956
|
+
else node_fs.copyFileSync(srcFile, distFile);
|
|
2474
2957
|
updatePackageJson(distFile, version, packageName);
|
|
2475
2958
|
} else {
|
|
2476
|
-
|
|
2959
|
+
node_fs.copyFileSync(srcFile, distFile);
|
|
2477
2960
|
if (templateParameters && isMarkdown(distFile)) {
|
|
2478
|
-
const content =
|
|
2479
|
-
|
|
2961
|
+
const content = node_fs.readFileSync(distFile, 'utf-8');
|
|
2962
|
+
node_fs.writeFileSync(distFile, replacePlaceholder(content, templateParameters));
|
|
2480
2963
|
}
|
|
2481
2964
|
}
|
|
2482
2965
|
}
|
|
@@ -2489,7 +2972,7 @@ const isStableVersion = (version)=>[
|
|
|
2489
2972
|
'nightly'
|
|
2490
2973
|
].every((tag)=>!version.includes(tag));
|
|
2491
2974
|
const updatePackageJson = (pkgJsonPath, version, name)=>{
|
|
2492
|
-
let content =
|
|
2975
|
+
let content = node_fs.readFileSync(pkgJsonPath, 'utf-8');
|
|
2493
2976
|
if ('string' == typeof version) {
|
|
2494
2977
|
const targetVersion = isStableVersion(version) ? `^${version}` : version;
|
|
2495
2978
|
content = content.replace(/workspace:\*/g, targetVersion);
|
|
@@ -2503,11 +2986,11 @@ const updatePackageJson = (pkgJsonPath, version, name)=>{
|
|
|
2503
2986
|
const projectName = node_path.basename(node_path.dirname(pkgJsonPath));
|
|
2504
2987
|
if (projectName.length) pkg.name = projectName;
|
|
2505
2988
|
} else if (name) pkg.name = name;
|
|
2506
|
-
|
|
2989
|
+
node_fs.writeFileSync(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
2507
2990
|
};
|
|
2508
2991
|
function readAgentsFile(filePath) {
|
|
2509
|
-
if (!
|
|
2510
|
-
return
|
|
2992
|
+
if (!node_fs.existsSync(filePath)) return null;
|
|
2993
|
+
return node_fs.readFileSync(filePath, 'utf-8');
|
|
2511
2994
|
}
|
|
2512
2995
|
function parseAgentsContent(content) {
|
|
2513
2996
|
const sections = {};
|