create-rstack 1.8.2 → 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 +916 -440
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import node_fs from "node:fs";
|
|
3
|
-
import node_path, { dirname } from "node:path";
|
|
3
|
+
import node_path, { delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import node_util, { styleText } from "node:util";
|
|
6
|
-
import node_process, { stdin, stdout } from "node:process";
|
|
7
|
-
import
|
|
8
|
-
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";
|
|
9
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";
|
|
10
13
|
import { createRequire as __rspack_createRequire } from "node:module";
|
|
11
14
|
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
15
|
+
import * as __rspack_external_node_readline_91c31510 from "node:readline";
|
|
12
16
|
var __webpack_modules__ = {};
|
|
13
17
|
var __webpack_module_cache__ = {};
|
|
14
18
|
function __webpack_require__(moduleId) {
|
|
@@ -207,192 +211,6 @@ __webpack_require__.add({
|
|
|
207
211
|
};
|
|
208
212
|
}
|
|
209
213
|
},
|
|
210
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
211
|
-
const cp = __webpack_require__("child_process");
|
|
212
|
-
const parse = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
|
|
213
|
-
const enoent = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
|
|
214
|
-
function spawn(command, args, options) {
|
|
215
|
-
const parsed = parse(command, args, options);
|
|
216
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
217
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
218
|
-
return spawned;
|
|
219
|
-
}
|
|
220
|
-
function spawnSync(command, args, options) {
|
|
221
|
-
const parsed = parse(command, args, options);
|
|
222
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
223
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
224
|
-
return result;
|
|
225
|
-
}
|
|
226
|
-
module.exports = spawn;
|
|
227
|
-
module.exports.spawn = spawn;
|
|
228
|
-
module.exports.sync = spawnSync;
|
|
229
|
-
module.exports._parse = parse;
|
|
230
|
-
module.exports._enoent = enoent;
|
|
231
|
-
},
|
|
232
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js" (module) {
|
|
233
|
-
const isWin = 'win32' === process.platform;
|
|
234
|
-
function notFoundError(original, syscall) {
|
|
235
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
236
|
-
code: 'ENOENT',
|
|
237
|
-
errno: 'ENOENT',
|
|
238
|
-
syscall: `${syscall} ${original.command}`,
|
|
239
|
-
path: original.command,
|
|
240
|
-
spawnargs: original.args
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
function hookChildProcess(cp, parsed) {
|
|
244
|
-
if (!isWin) return;
|
|
245
|
-
const originalEmit = cp.emit;
|
|
246
|
-
cp.emit = function(name, arg1) {
|
|
247
|
-
if ('exit' === name) {
|
|
248
|
-
const err = verifyENOENT(arg1, parsed);
|
|
249
|
-
if (err) return originalEmit.call(cp, 'error', err);
|
|
250
|
-
}
|
|
251
|
-
return originalEmit.apply(cp, arguments);
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
function verifyENOENT(status, parsed) {
|
|
255
|
-
if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawn');
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
function verifyENOENTSync(status, parsed) {
|
|
259
|
-
if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawnSync');
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
262
|
-
module.exports = {
|
|
263
|
-
hookChildProcess,
|
|
264
|
-
verifyENOENT,
|
|
265
|
-
verifyENOENTSync,
|
|
266
|
-
notFoundError
|
|
267
|
-
};
|
|
268
|
-
},
|
|
269
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
270
|
-
const path = __webpack_require__("path");
|
|
271
|
-
const resolveCommand = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
|
|
272
|
-
const escape = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
|
|
273
|
-
const readShebang = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js");
|
|
274
|
-
const isWin = 'win32' === process.platform;
|
|
275
|
-
const isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
276
|
-
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
277
|
-
function detectShebang(parsed) {
|
|
278
|
-
parsed.file = resolveCommand(parsed);
|
|
279
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
280
|
-
if (shebang) {
|
|
281
|
-
parsed.args.unshift(parsed.file);
|
|
282
|
-
parsed.command = shebang;
|
|
283
|
-
return resolveCommand(parsed);
|
|
284
|
-
}
|
|
285
|
-
return parsed.file;
|
|
286
|
-
}
|
|
287
|
-
function parseNonShell(parsed) {
|
|
288
|
-
if (!isWin) return parsed;
|
|
289
|
-
const commandFile = detectShebang(parsed);
|
|
290
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
291
|
-
if (parsed.options.forceShell || needsShell) {
|
|
292
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
293
|
-
parsed.command = path.normalize(parsed.command);
|
|
294
|
-
parsed.command = escape.command(parsed.command);
|
|
295
|
-
parsed.args = parsed.args.map((arg)=>escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
296
|
-
const shellCommand = [
|
|
297
|
-
parsed.command
|
|
298
|
-
].concat(parsed.args).join(' ');
|
|
299
|
-
parsed.args = [
|
|
300
|
-
'/d',
|
|
301
|
-
'/s',
|
|
302
|
-
'/c',
|
|
303
|
-
`"${shellCommand}"`
|
|
304
|
-
];
|
|
305
|
-
parsed.command = process.env.comspec || 'cmd.exe';
|
|
306
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
307
|
-
}
|
|
308
|
-
return parsed;
|
|
309
|
-
}
|
|
310
|
-
function parse(command, args, options) {
|
|
311
|
-
if (args && !Array.isArray(args)) {
|
|
312
|
-
options = args;
|
|
313
|
-
args = null;
|
|
314
|
-
}
|
|
315
|
-
args = args ? args.slice(0) : [];
|
|
316
|
-
options = Object.assign({}, options);
|
|
317
|
-
const parsed = {
|
|
318
|
-
command,
|
|
319
|
-
args,
|
|
320
|
-
options,
|
|
321
|
-
file: void 0,
|
|
322
|
-
original: {
|
|
323
|
-
command,
|
|
324
|
-
args
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
328
|
-
}
|
|
329
|
-
module.exports = parse;
|
|
330
|
-
},
|
|
331
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js" (module) {
|
|
332
|
-
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
333
|
-
function escapeCommand(arg) {
|
|
334
|
-
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
335
|
-
return arg;
|
|
336
|
-
}
|
|
337
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
338
|
-
arg = `${arg}`;
|
|
339
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
340
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
|
|
341
|
-
arg = `"${arg}"`;
|
|
342
|
-
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
343
|
-
if (doubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, '^$1');
|
|
344
|
-
return arg;
|
|
345
|
-
}
|
|
346
|
-
module.exports.command = escapeCommand;
|
|
347
|
-
module.exports.argument = escapeArgument;
|
|
348
|
-
},
|
|
349
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
350
|
-
const fs = __webpack_require__("fs");
|
|
351
|
-
const shebangCommand = __webpack_require__("./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
|
|
352
|
-
function readShebang(command) {
|
|
353
|
-
const size = 150;
|
|
354
|
-
const buffer = Buffer.alloc(size);
|
|
355
|
-
let fd;
|
|
356
|
-
try {
|
|
357
|
-
fd = fs.openSync(command, 'r');
|
|
358
|
-
fs.readSync(fd, buffer, 0, size, 0);
|
|
359
|
-
fs.closeSync(fd);
|
|
360
|
-
} catch (e) {}
|
|
361
|
-
return shebangCommand(buffer.toString());
|
|
362
|
-
}
|
|
363
|
-
module.exports = readShebang;
|
|
364
|
-
},
|
|
365
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
366
|
-
const path = __webpack_require__("path");
|
|
367
|
-
const which = __webpack_require__("./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
|
|
368
|
-
const getPathKey = __webpack_require__("./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
|
|
369
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
370
|
-
const env = parsed.options.env || process.env;
|
|
371
|
-
const cwd = process.cwd();
|
|
372
|
-
const hasCustomCwd = null != parsed.options.cwd;
|
|
373
|
-
const shouldSwitchCwd = hasCustomCwd && void 0 !== process.chdir && !process.chdir.disabled;
|
|
374
|
-
if (shouldSwitchCwd) try {
|
|
375
|
-
process.chdir(parsed.options.cwd);
|
|
376
|
-
} catch (err) {}
|
|
377
|
-
let resolved;
|
|
378
|
-
try {
|
|
379
|
-
resolved = which.sync(parsed.command, {
|
|
380
|
-
path: env[getPathKey({
|
|
381
|
-
env
|
|
382
|
-
})],
|
|
383
|
-
pathExt: withoutPathExt ? path.delimiter : void 0
|
|
384
|
-
});
|
|
385
|
-
} catch (e) {} finally{
|
|
386
|
-
if (shouldSwitchCwd) process.chdir(cwd);
|
|
387
|
-
}
|
|
388
|
-
if (resolved) resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
|
|
389
|
-
return resolved;
|
|
390
|
-
}
|
|
391
|
-
function resolveCommand(parsed) {
|
|
392
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
393
|
-
}
|
|
394
|
-
module.exports = resolveCommand;
|
|
395
|
-
},
|
|
396
214
|
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
397
215
|
var isMergeableObject = function(value) {
|
|
398
216
|
return isNonNullObject(value) && !isSpecial(value);
|
|
@@ -476,102 +294,6 @@ __webpack_require__.add({
|
|
|
476
294
|
var deepmerge_1 = deepmerge;
|
|
477
295
|
module.exports = deepmerge_1;
|
|
478
296
|
},
|
|
479
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
480
|
-
__webpack_require__("fs");
|
|
481
|
-
var core;
|
|
482
|
-
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");
|
|
483
|
-
module.exports = isexe;
|
|
484
|
-
isexe.sync = sync;
|
|
485
|
-
function isexe(path, options, cb) {
|
|
486
|
-
if ('function' == typeof options) {
|
|
487
|
-
cb = options;
|
|
488
|
-
options = {};
|
|
489
|
-
}
|
|
490
|
-
if (!cb) {
|
|
491
|
-
if ('function' != typeof Promise) throw new TypeError('callback not provided');
|
|
492
|
-
return new Promise(function(resolve, reject) {
|
|
493
|
-
isexe(path, options || {}, function(er, is) {
|
|
494
|
-
if (er) reject(er);
|
|
495
|
-
else resolve(is);
|
|
496
|
-
});
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
core(path, options || {}, function(er, is) {
|
|
500
|
-
if (er) {
|
|
501
|
-
if ('EACCES' === er.code || options && options.ignoreErrors) {
|
|
502
|
-
er = null;
|
|
503
|
-
is = false;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
cb(er, is);
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
function sync(path, options) {
|
|
510
|
-
try {
|
|
511
|
-
return core.sync(path, options || {});
|
|
512
|
-
} catch (er) {
|
|
513
|
-
if (options && options.ignoreErrors || 'EACCES' === er.code) return false;
|
|
514
|
-
throw er;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
519
|
-
module.exports = isexe;
|
|
520
|
-
isexe.sync = sync;
|
|
521
|
-
var fs = __webpack_require__("fs");
|
|
522
|
-
function isexe(path, options, cb) {
|
|
523
|
-
fs.stat(path, function(er, stat) {
|
|
524
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
function sync(path, options) {
|
|
528
|
-
return checkStat(fs.statSync(path), options);
|
|
529
|
-
}
|
|
530
|
-
function checkStat(stat, options) {
|
|
531
|
-
return stat.isFile() && checkMode(stat, options);
|
|
532
|
-
}
|
|
533
|
-
function checkMode(stat, options) {
|
|
534
|
-
var mod = stat.mode;
|
|
535
|
-
var uid = stat.uid;
|
|
536
|
-
var gid = stat.gid;
|
|
537
|
-
var myUid = void 0 !== options.uid ? options.uid : process.getuid && process.getuid();
|
|
538
|
-
var myGid = void 0 !== options.gid ? options.gid : process.getgid && process.getgid();
|
|
539
|
-
var u = parseInt('100', 8);
|
|
540
|
-
var g = parseInt('010', 8);
|
|
541
|
-
var o = parseInt('001', 8);
|
|
542
|
-
var ug = u | g;
|
|
543
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && 0 === myUid;
|
|
544
|
-
return ret;
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
548
|
-
module.exports = isexe;
|
|
549
|
-
isexe.sync = sync;
|
|
550
|
-
var fs = __webpack_require__("fs");
|
|
551
|
-
function checkPathExt(path, options) {
|
|
552
|
-
var pathext = void 0 !== options.pathExt ? options.pathExt : process.env.PATHEXT;
|
|
553
|
-
if (!pathext) return true;
|
|
554
|
-
pathext = pathext.split(';');
|
|
555
|
-
if (-1 !== pathext.indexOf('')) return true;
|
|
556
|
-
for(var i = 0; i < pathext.length; i++){
|
|
557
|
-
var p = pathext[i].toLowerCase();
|
|
558
|
-
if (p && path.substr(-p.length).toLowerCase() === p) return true;
|
|
559
|
-
}
|
|
560
|
-
return false;
|
|
561
|
-
}
|
|
562
|
-
function checkStat(stat, path, options) {
|
|
563
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
|
|
564
|
-
return checkPathExt(path, options);
|
|
565
|
-
}
|
|
566
|
-
function isexe(path, options, cb) {
|
|
567
|
-
fs.stat(path, function(er, stat) {
|
|
568
|
-
cb(er, er ? false : checkStat(stat, path, options));
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
function sync(path, options) {
|
|
572
|
-
return checkStat(fs.statSync(path), path, options);
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
297
|
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js" (module) {
|
|
576
298
|
function hasKey(obj, keys) {
|
|
577
299
|
var o = obj;
|
|
@@ -751,30 +473,6 @@ __webpack_require__.add({
|
|
|
751
473
|
return argv;
|
|
752
474
|
};
|
|
753
475
|
},
|
|
754
|
-
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js" (module) {
|
|
755
|
-
const pathKey = (options = {})=>{
|
|
756
|
-
const environment = options.env || process.env;
|
|
757
|
-
const platform = options.platform || process.platform;
|
|
758
|
-
if ('win32' !== platform) return 'PATH';
|
|
759
|
-
return Object.keys(environment).reverse().find((key)=>'PATH' === key.toUpperCase()) || 'Path';
|
|
760
|
-
};
|
|
761
|
-
module.exports = pathKey;
|
|
762
|
-
module.exports["default"] = pathKey;
|
|
763
|
-
},
|
|
764
|
-
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
765
|
-
const shebangRegex = __webpack_require__("./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
|
|
766
|
-
module.exports = (string = '')=>{
|
|
767
|
-
const match = string.match(shebangRegex);
|
|
768
|
-
if (!match) return null;
|
|
769
|
-
const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
|
|
770
|
-
const binary = path.split('/').pop();
|
|
771
|
-
if ('env' === binary) return argument;
|
|
772
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
773
|
-
};
|
|
774
|
-
},
|
|
775
|
-
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
|
|
776
|
-
module.exports = /^#!(.*)/;
|
|
777
|
-
},
|
|
778
476
|
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js" (module) {
|
|
779
477
|
const ESC = '\x1B';
|
|
780
478
|
const CSI = `${ESC}[`;
|
|
@@ -829,107 +527,11 @@ __webpack_require__.add({
|
|
|
829
527
|
beep
|
|
830
528
|
};
|
|
831
529
|
},
|
|
832
|
-
"./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
833
|
-
const isWindows = 'win32' === process.platform || 'cygwin' === process.env.OSTYPE || 'msys' === process.env.OSTYPE;
|
|
834
|
-
const path = __webpack_require__("path");
|
|
835
|
-
const COLON = isWindows ? ';' : ':';
|
|
836
|
-
const isexe = __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js");
|
|
837
|
-
const getNotFoundError = (cmd)=>Object.assign(new Error(`not found: ${cmd}`), {
|
|
838
|
-
code: 'ENOENT'
|
|
839
|
-
});
|
|
840
|
-
const getPathInfo = (cmd, opt)=>{
|
|
841
|
-
const colon = opt.colon || COLON;
|
|
842
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [
|
|
843
|
-
''
|
|
844
|
-
] : [
|
|
845
|
-
...isWindows ? [
|
|
846
|
-
process.cwd()
|
|
847
|
-
] : [],
|
|
848
|
-
...(opt.path || process.env.PATH || '').split(colon)
|
|
849
|
-
];
|
|
850
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' : '';
|
|
851
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [
|
|
852
|
-
''
|
|
853
|
-
];
|
|
854
|
-
if (isWindows) {
|
|
855
|
-
if (-1 !== cmd.indexOf('.') && '' !== pathExt[0]) pathExt.unshift('');
|
|
856
|
-
}
|
|
857
|
-
return {
|
|
858
|
-
pathEnv,
|
|
859
|
-
pathExt,
|
|
860
|
-
pathExtExe
|
|
861
|
-
};
|
|
862
|
-
};
|
|
863
|
-
const which = (cmd, opt, cb)=>{
|
|
864
|
-
if ('function' == typeof opt) {
|
|
865
|
-
cb = opt;
|
|
866
|
-
opt = {};
|
|
867
|
-
}
|
|
868
|
-
if (!opt) opt = {};
|
|
869
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
870
|
-
const found = [];
|
|
871
|
-
const step = (i)=>new Promise((resolve, reject)=>{
|
|
872
|
-
if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
873
|
-
const ppRaw = pathEnv[i];
|
|
874
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
875
|
-
const pCmd = path.join(pathPart, cmd);
|
|
876
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
877
|
-
resolve(subStep(p, i, 0));
|
|
878
|
-
});
|
|
879
|
-
const subStep = (p, i, ii)=>new Promise((resolve, reject)=>{
|
|
880
|
-
if (ii === pathExt.length) return resolve(step(i + 1));
|
|
881
|
-
const ext = pathExt[ii];
|
|
882
|
-
isexe(p + ext, {
|
|
883
|
-
pathExt: pathExtExe
|
|
884
|
-
}, (er, is)=>{
|
|
885
|
-
if (!er && is) if (!opt.all) return resolve(p + ext);
|
|
886
|
-
else found.push(p + ext);
|
|
887
|
-
return resolve(subStep(p, i, ii + 1));
|
|
888
|
-
});
|
|
889
|
-
});
|
|
890
|
-
return cb ? step(0).then((res)=>cb(null, res), cb) : step(0);
|
|
891
|
-
};
|
|
892
|
-
const whichSync = (cmd, opt)=>{
|
|
893
|
-
opt = opt || {};
|
|
894
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
895
|
-
const found = [];
|
|
896
|
-
for(let i = 0; i < pathEnv.length; i++){
|
|
897
|
-
const ppRaw = pathEnv[i];
|
|
898
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
899
|
-
const pCmd = path.join(pathPart, cmd);
|
|
900
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
901
|
-
for(let j = 0; j < pathExt.length; j++){
|
|
902
|
-
const cur = p + pathExt[j];
|
|
903
|
-
try {
|
|
904
|
-
const is = isexe.sync(cur, {
|
|
905
|
-
pathExt: pathExtExe
|
|
906
|
-
});
|
|
907
|
-
if (is) if (!opt.all) return cur;
|
|
908
|
-
else found.push(cur);
|
|
909
|
-
} catch (ex) {}
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if (opt.all && found.length) return found;
|
|
913
|
-
if (opt.nothrow) return null;
|
|
914
|
-
throw getNotFoundError(cmd);
|
|
915
|
-
};
|
|
916
|
-
module.exports = which;
|
|
917
|
-
which.sync = whichSync;
|
|
918
|
-
},
|
|
919
|
-
child_process (module) {
|
|
920
|
-
module.exports = __rspack_createRequire_require("child_process");
|
|
921
|
-
},
|
|
922
|
-
fs (module) {
|
|
923
|
-
module.exports = __rspack_createRequire_require("fs");
|
|
924
|
-
},
|
|
925
530
|
"node:fs?31c0" (module) {
|
|
926
531
|
module.exports = __rspack_createRequire_require("node:fs");
|
|
927
532
|
},
|
|
928
533
|
"node:fs/promises" (module) {
|
|
929
534
|
module.exports = __rspack_createRequire_require("node:fs/promises");
|
|
930
|
-
},
|
|
931
|
-
path (module) {
|
|
932
|
-
module.exports = __rspack_createRequire_require("path");
|
|
933
535
|
}
|
|
934
536
|
});
|
|
935
537
|
const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
@@ -1150,8 +752,7 @@ function _t(t, e) {
|
|
|
1150
752
|
numLines: r
|
|
1151
753
|
};
|
|
1152
754
|
}
|
|
1153
|
-
globalThis.process.platform.startsWith("win");
|
|
1154
|
-
const z = Symbol("clack:cancel");
|
|
755
|
+
const bt = globalThis.process.platform.startsWith("win"), z = Symbol("clack:cancel");
|
|
1155
756
|
function Ct(t) {
|
|
1156
757
|
return t === z;
|
|
1157
758
|
}
|
|
@@ -1159,6 +760,36 @@ function W(t, e) {
|
|
|
1159
760
|
const s = t;
|
|
1160
761
|
s.isTTY && s.setRawMode(e);
|
|
1161
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
|
+
}
|
|
1162
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;
|
|
1163
794
|
function Bt(t, e, s, i = s) {
|
|
1164
795
|
const r = dist_rt(t ?? stdout);
|
|
@@ -1221,7 +852,7 @@ class dist_B {
|
|
|
1221
852
|
once: !0
|
|
1222
853
|
});
|
|
1223
854
|
}
|
|
1224
|
-
this.rl =
|
|
855
|
+
this.rl = __rspack_external_node_readline_91c31510["default"].createInterface({
|
|
1225
856
|
input: this.input,
|
|
1226
857
|
tabSize: 2,
|
|
1227
858
|
prompt: "",
|
|
@@ -1424,7 +1055,7 @@ class dist_$t extends dist_B {
|
|
|
1424
1055
|
function dist_pt() {
|
|
1425
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;
|
|
1426
1057
|
}
|
|
1427
|
-
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)=>{
|
|
1428
1059
|
switch(e){
|
|
1429
1060
|
case "initial":
|
|
1430
1061
|
case "active":
|
|
@@ -1436,7 +1067,7 @@ const ee = dist_pt(), dist_I = (e, r)=>ee ? e : r, Re = dist_I("\u25C6", "*"), $
|
|
|
1436
1067
|
case "submit":
|
|
1437
1068
|
return styleText("green", dist_V);
|
|
1438
1069
|
}
|
|
1439
|
-
}
|
|
1070
|
+
}, ve = (e)=>{
|
|
1440
1071
|
switch(e){
|
|
1441
1072
|
case "initial":
|
|
1442
1073
|
case "active":
|
|
@@ -1593,7 +1224,7 @@ const ee = dist_pt(), dist_I = (e, r)=>ee ? e : r, Re = dist_I("\u25C6", "*"), $
|
|
|
1593
1224
|
}
|
|
1594
1225
|
return i;
|
|
1595
1226
|
};
|
|
1596
|
-
function
|
|
1227
|
+
function J(e, r, s) {
|
|
1597
1228
|
return String(e).normalize().replaceAll(`\r
|
|
1598
1229
|
`, `
|
|
1599
1230
|
`).split(`
|
|
@@ -1620,7 +1251,7 @@ const dist_bt = (e, r, s, i, a)=>{
|
|
|
1620
1251
|
E && F++, $ && F++;
|
|
1621
1252
|
const y = g + (E ? 1 : 0), v = m - ($ ? 1 : 0);
|
|
1622
1253
|
for(let A = y; A < v; A++){
|
|
1623
|
-
const b =
|
|
1254
|
+
const b = J(s(r[A], A === e), l, {
|
|
1624
1255
|
hard: !0,
|
|
1625
1256
|
trim: !1
|
|
1626
1257
|
}).split(`
|
|
@@ -1637,7 +1268,55 @@ const dist_bt = (e, r, s, i, a)=>{
|
|
|
1637
1268
|
for (const A of d)for (const b of A)C.push(b);
|
|
1638
1269
|
return $ && C.push(c), C;
|
|
1639
1270
|
};
|
|
1640
|
-
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)=>{
|
|
1641
1320
|
const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_.withGuide ? `${styleText("gray", dist_x)} ` : "";
|
|
1642
1321
|
s.write(`${i}${styleText("red", e)}
|
|
1643
1322
|
|
|
@@ -1653,13 +1332,13 @@ ${styleText("gray", dist_x)} ` : "";
|
|
|
1653
1332
|
`), dist_Lt = (e)=>{
|
|
1654
1333
|
const r = (i, a)=>{
|
|
1655
1334
|
const o = i.label ?? String(i.value);
|
|
1656
|
-
return "disabled" === a ? `${styleText("gray",
|
|
1335
|
+
return "disabled" === a ? `${styleText("gray", q)} ${dist_Q(o, (u)=>styleText([
|
|
1657
1336
|
"strikethrough",
|
|
1658
1337
|
"gray"
|
|
1659
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([
|
|
1660
1339
|
"strikethrough",
|
|
1661
1340
|
"dim"
|
|
1662
|
-
], 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))}`;
|
|
1663
1342
|
}, s = e.required ?? !0;
|
|
1664
1343
|
return new Lt({
|
|
1665
1344
|
options: e.options,
|
|
@@ -1743,9 +1422,9 @@ ${styleText("cyan", dist_x)}
|
|
|
1743
1422
|
const i = {
|
|
1744
1423
|
hard: !0,
|
|
1745
1424
|
trim: !1
|
|
1746
|
-
}, a =
|
|
1425
|
+
}, a = J(e, r, i).split(`
|
|
1747
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);
|
|
1748
|
-
return
|
|
1427
|
+
return J(e, l, i);
|
|
1749
1428
|
}, dist_Vt = (e = "", r = "", s)=>{
|
|
1750
1429
|
const i = s?.output ?? node_process.stdout, a = s?.withGuide ?? dist_.withGuide, o = s?.format ?? jt, u = [
|
|
1751
1430
|
"",
|
|
@@ -1762,8 +1441,85 @@ ${styleText("cyan", dist_x)}
|
|
|
1762
1441
|
${c}
|
|
1763
1442
|
${styleText("gray", f + se.repeat(n + 2) + me)}
|
|
1764
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
|
+
};
|
|
1765
1521
|
};
|
|
1766
|
-
|
|
1522
|
+
I("\u2500", "-"), I("\u2501", "="), I("\u2588", "#");
|
|
1767
1523
|
const oe = (e, r)=>e.includes(`
|
|
1768
1524
|
`) ? e.split(`
|
|
1769
1525
|
`).map((s)=>r(s)).join(`
|
|
@@ -2147,9 +1903,637 @@ let createLogger = (options = {})=>{
|
|
|
2147
1903
|
return logger;
|
|
2148
1904
|
};
|
|
2149
1905
|
let src_logger = createLogger();
|
|
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;
|
|
2150
2536
|
const dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.2.1/node_modules/@vercel/detect-agent/dist/index.js");
|
|
2151
|
-
const cross_spawn = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
|
|
2152
|
-
var cross_spawn_default = /*#__PURE__*/ __webpack_require__.n(cross_spawn);
|
|
2153
2537
|
const cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
2154
2538
|
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
2155
2539
|
const minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
@@ -2191,36 +2575,49 @@ function parseToolsOption(tools) {
|
|
|
2191
2575
|
];
|
|
2192
2576
|
return toolsArr.flatMap((tool)=>tool.split(',')).map((tool)=>tool.trim()).filter(Boolean);
|
|
2193
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
|
+
}
|
|
2194
2585
|
const BUILTIN_TOOLS = [
|
|
2195
2586
|
'biome',
|
|
2196
2587
|
'eslint',
|
|
2197
2588
|
'prettier'
|
|
2198
2589
|
];
|
|
2199
|
-
function logHelpMessage(name, templates, extraTools) {
|
|
2590
|
+
function logHelpMessage(name, templates, extraTools, extraSkills) {
|
|
2200
2591
|
const toolsList = [
|
|
2201
2592
|
...BUILTIN_TOOLS
|
|
2202
2593
|
];
|
|
2594
|
+
const skillsList = (extraSkills ?? []).map((skill)=>skill.value).filter(Boolean);
|
|
2595
|
+
const hasSkills = skillsList.length > 0;
|
|
2203
2596
|
if (extraTools) {
|
|
2204
2597
|
for (const tool of extraTools)if (tool.value) if ('pre' === tool.order) toolsList.unshift(tool.value);
|
|
2205
2598
|
else toolsList.push(tool.value);
|
|
2206
2599
|
}
|
|
2600
|
+
const skillsOptionLine = hasSkills ? ' --skill <skill> add optional skills, comma separated\n' : '';
|
|
2601
|
+
const optionalSkillsSection = hasSkills ? `
|
|
2602
|
+
Optional skills:
|
|
2603
|
+
${skillsList.join(', ')}` : '';
|
|
2207
2604
|
src_logger.log(`
|
|
2208
2605
|
Usage: create-${name} [dir] [options]
|
|
2209
2606
|
|
|
2210
2607
|
Options:
|
|
2211
2608
|
|
|
2212
2609
|
-h, --help display help for command
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
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(', ')}
|
|
2221
2618
|
|
|
2222
|
-
|
|
2223
|
-
|
|
2619
|
+
Optional tools:
|
|
2620
|
+
${toolsList.join(', ')}${optionalSkillsSection}
|
|
2224
2621
|
`);
|
|
2225
2622
|
}
|
|
2226
2623
|
async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
@@ -2263,6 +2660,37 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
2263
2660
|
required: false
|
|
2264
2661
|
}));
|
|
2265
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
|
+
}
|
|
2266
2694
|
function upperFirst(str) {
|
|
2267
2695
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
2268
2696
|
}
|
|
@@ -2280,7 +2708,7 @@ const parseArgv = (processArgv)=>{
|
|
|
2280
2708
|
if (argv['package-name']) argv.packageName = argv['package-name'];
|
|
2281
2709
|
return argv;
|
|
2282
2710
|
};
|
|
2283
|
-
function runCommand(command, cwd, packageManager) {
|
|
2711
|
+
async function runCommand(command, cwd, packageManager) {
|
|
2284
2712
|
if (command.startsWith('npm create ')) {
|
|
2285
2713
|
const createReplacements = {
|
|
2286
2714
|
bun: 'bun create ',
|
|
@@ -2292,13 +2720,55 @@ function runCommand(command, cwd, packageManager) {
|
|
|
2292
2720
|
if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
|
|
2293
2721
|
if ('yarn' === packageManager) command = command.replace('@latest', '');
|
|
2294
2722
|
}
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2723
|
+
const result = await main_R(command, [], {
|
|
2724
|
+
nodeOptions: {
|
|
2725
|
+
shell: true,
|
|
2726
|
+
stdio: 'inherit',
|
|
2727
|
+
cwd
|
|
2728
|
+
}
|
|
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
|
+
}
|
|
2737
|
+
}
|
|
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
|
+
}
|
|
2299
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}`);
|
|
2300
2770
|
}
|
|
2301
|
-
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, argv: processArgv = process.argv }) {
|
|
2771
|
+
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
|
|
2302
2772
|
src_logger.greet(`\n◆ Create ${upperFirst(name)} Project`);
|
|
2303
2773
|
const { isAgent } = await (0, dist.determineAgent)();
|
|
2304
2774
|
if (isAgent) {
|
|
@@ -2306,7 +2776,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2306
2776
|
src_logger.info(`To create a project non-interactively, run: npx -y create-${name} <DIR> --template <TEMPLATE>`);
|
|
2307
2777
|
}
|
|
2308
2778
|
const argv = parseArgv(processArgv);
|
|
2309
|
-
if (argv.help) return void logHelpMessage(name, templates, extraTools);
|
|
2779
|
+
if (argv.help) return void logHelpMessage(name, templates, extraTools, extraSkills);
|
|
2310
2780
|
const cwd = process.cwd();
|
|
2311
2781
|
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
|
|
2312
2782
|
const packageManager = pkgInfo ? pkgInfo.name : 'npm';
|
|
@@ -2344,6 +2814,8 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2344
2814
|
}
|
|
2345
2815
|
const templateName = await getTemplateName(argv);
|
|
2346
2816
|
const tools = await getTools(argv, extraTools, templateName);
|
|
2817
|
+
const filteredExtraSkills = filterExtraSkills(extraSkills, templateName);
|
|
2818
|
+
const skills = await getSkills(argv, filteredExtraSkills, templateName, dist_Lt);
|
|
2347
2819
|
const srcFolder = node_path.join(root, `template-${templateName}`);
|
|
2348
2820
|
const commonFolder = node_path.join(root, 'template-common');
|
|
2349
2821
|
if (!node_fs.existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
|
|
@@ -2362,6 +2834,10 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2362
2834
|
templateParameters,
|
|
2363
2835
|
skipFiles
|
|
2364
2836
|
});
|
|
2837
|
+
for (const skillValue of skills){
|
|
2838
|
+
const matchedSkill = filteredExtraSkills?.find((extraSkill)=>extraSkill.value === skillValue);
|
|
2839
|
+
if (matchedSkill) await runSkillCommand(matchedSkill, distFolder);
|
|
2840
|
+
}
|
|
2365
2841
|
const packageRoot = node_path.resolve(src_dirname, '..');
|
|
2366
2842
|
const agentsMdSearchDirs = [
|
|
2367
2843
|
commonFolder,
|
|
@@ -2376,7 +2852,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2376
2852
|
distFolder,
|
|
2377
2853
|
addAgentsMdSearchDirs: (dir)=>agentsMdSearchDirs.push(dir)
|
|
2378
2854
|
});
|
|
2379
|
-
if (matchedTool.command) runCommand(matchedTool.command, distFolder, packageManager);
|
|
2855
|
+
if (matchedTool.command) await runCommand(matchedTool.command, distFolder, packageManager);
|
|
2380
2856
|
continue;
|
|
2381
2857
|
}
|
|
2382
2858
|
}
|