@slidev/cli 0.38.4 → 0.38.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-ATIWLFVV.js → build-MNMMWCV6.js} +6 -6
- package/dist/{build-XB553JUF.mjs → build-NROT64YL.mjs} +2 -2
- package/dist/{chunk-CUQDKJBB.js → chunk-FENLKXMB.js} +518 -398
- package/dist/{chunk-NTTNCVJU.mjs → chunk-MDHB5JSE.mjs} +11 -6
- package/dist/{chunk-LAZ5PNFJ.mjs → chunk-RWZQGJHC.mjs} +522 -402
- package/dist/{chunk-TXDYSJOB.js → chunk-SJ7FI34E.js} +11 -6
- package/dist/cli.js +30 -30
- package/dist/cli.mjs +5 -5
- package/dist/{export-JGJTLG7B.mjs → export-2OSN6D4K.mjs} +25 -6
- package/dist/{export-OIZT2CQS.js → export-RNJ27D27.js} +25 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +7 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSJ7FI34Ejs = require('./chunk-SJ7FI34E.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -2426,7 +2426,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2426
2426
|
const pluginOptions = rawConfig.slidev || {};
|
|
2427
2427
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2428
2428
|
const server = await _vite.createServer.call(void 0,
|
|
2429
|
-
await
|
|
2429
|
+
await _chunkSJ7FI34Ejs.mergeViteConfigs.call(void 0,
|
|
2430
2430
|
options,
|
|
2431
2431
|
viteConfig,
|
|
2432
2432
|
{
|
|
@@ -2436,7 +2436,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2436
2436
|
]
|
|
2437
2437
|
},
|
|
2438
2438
|
plugins: [
|
|
2439
|
-
await
|
|
2439
|
+
await _chunkSJ7FI34Ejs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
2440
2440
|
]
|
|
2441
2441
|
},
|
|
2442
2442
|
"serve"
|
|
@@ -2450,16 +2450,16 @@ _chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
|
2450
2450
|
var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
|
|
2451
2451
|
|
|
2452
2452
|
// package.json
|
|
2453
|
-
var version = "0.38.
|
|
2453
|
+
var version = "0.38.5";
|
|
2454
2454
|
|
|
2455
2455
|
// node/themes.ts
|
|
2456
2456
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
2457
2457
|
var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
|
|
2458
2458
|
|
|
2459
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2459
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.19.0/node_modules/@antfu/ni/dist/index.mjs
|
|
2460
2460
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
2461
2461
|
|
|
2462
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2462
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.19.0/node_modules/@antfu/ni/dist/shared/ni.e4583e4e.mjs
|
|
2463
2463
|
_chunkOVFYMGU6js.init_cjs_shims.call(void 0, );
|
|
2464
2464
|
|
|
2465
2465
|
var _readline = require('readline'); var _readline2 = _interopRequireDefault(_readline);
|
|
@@ -2520,7 +2520,7 @@ var bun = {
|
|
|
2520
2520
|
"add": "bun add {0}",
|
|
2521
2521
|
"upgrade": null,
|
|
2522
2522
|
"upgrade-interactive": null,
|
|
2523
|
-
"execute":
|
|
2523
|
+
"execute": "bunx {0}",
|
|
2524
2524
|
"uninstall": "bun remove {0}",
|
|
2525
2525
|
"global_uninstall": "bun remove -g {0}"
|
|
2526
2526
|
};
|
|
@@ -2572,268 +2572,6 @@ var INSTALL_PAGE = {
|
|
|
2572
2572
|
"npm": "https://docs.npmjs.com/cli/v8/configuring-npm/install"
|
|
2573
2573
|
};
|
|
2574
2574
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2575
|
-
var windows;
|
|
2576
|
-
var hasRequiredWindows;
|
|
2577
|
-
function requireWindows() {
|
|
2578
|
-
if (hasRequiredWindows)
|
|
2579
|
-
return windows;
|
|
2580
|
-
hasRequiredWindows = 1;
|
|
2581
|
-
windows = isexe2;
|
|
2582
|
-
isexe2.sync = sync2;
|
|
2583
|
-
var fs4 = _fs3.default;
|
|
2584
|
-
function checkPathExt(path2, options) {
|
|
2585
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
2586
|
-
if (!pathext) {
|
|
2587
|
-
return true;
|
|
2588
|
-
}
|
|
2589
|
-
pathext = pathext.split(";");
|
|
2590
|
-
if (pathext.indexOf("") !== -1) {
|
|
2591
|
-
return true;
|
|
2592
|
-
}
|
|
2593
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
2594
|
-
var p = pathext[i].toLowerCase();
|
|
2595
|
-
if (p && path2.substr(-p.length).toLowerCase() === p) {
|
|
2596
|
-
return true;
|
|
2597
|
-
}
|
|
2598
|
-
}
|
|
2599
|
-
return false;
|
|
2600
|
-
}
|
|
2601
|
-
function checkStat(stat, path2, options) {
|
|
2602
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2603
|
-
return false;
|
|
2604
|
-
}
|
|
2605
|
-
return checkPathExt(path2, options);
|
|
2606
|
-
}
|
|
2607
|
-
function isexe2(path2, options, cb) {
|
|
2608
|
-
fs4.stat(path2, function(er, stat) {
|
|
2609
|
-
cb(er, er ? false : checkStat(stat, path2, options));
|
|
2610
|
-
});
|
|
2611
|
-
}
|
|
2612
|
-
function sync2(path2, options) {
|
|
2613
|
-
return checkStat(fs4.statSync(path2), path2, options);
|
|
2614
|
-
}
|
|
2615
|
-
return windows;
|
|
2616
|
-
}
|
|
2617
|
-
var mode;
|
|
2618
|
-
var hasRequiredMode;
|
|
2619
|
-
function requireMode() {
|
|
2620
|
-
if (hasRequiredMode)
|
|
2621
|
-
return mode;
|
|
2622
|
-
hasRequiredMode = 1;
|
|
2623
|
-
mode = isexe2;
|
|
2624
|
-
isexe2.sync = sync2;
|
|
2625
|
-
var fs4 = _fs3.default;
|
|
2626
|
-
function isexe2(path2, options, cb) {
|
|
2627
|
-
fs4.stat(path2, function(er, stat) {
|
|
2628
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
2629
|
-
});
|
|
2630
|
-
}
|
|
2631
|
-
function sync2(path2, options) {
|
|
2632
|
-
return checkStat(fs4.statSync(path2), options);
|
|
2633
|
-
}
|
|
2634
|
-
function checkStat(stat, options) {
|
|
2635
|
-
return stat.isFile() && checkMode(stat, options);
|
|
2636
|
-
}
|
|
2637
|
-
function checkMode(stat, options) {
|
|
2638
|
-
var mod = stat.mode;
|
|
2639
|
-
var uid = stat.uid;
|
|
2640
|
-
var gid = stat.gid;
|
|
2641
|
-
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
2642
|
-
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
2643
|
-
var u = parseInt("100", 8);
|
|
2644
|
-
var g = parseInt("010", 8);
|
|
2645
|
-
var o = parseInt("001", 8);
|
|
2646
|
-
var ug = u | g;
|
|
2647
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
2648
|
-
return ret;
|
|
2649
|
-
}
|
|
2650
|
-
return mode;
|
|
2651
|
-
}
|
|
2652
|
-
var core;
|
|
2653
|
-
if (process.platform === "win32" || commonjsGlobal.TESTING_WINDOWS) {
|
|
2654
|
-
core = requireWindows();
|
|
2655
|
-
} else {
|
|
2656
|
-
core = requireMode();
|
|
2657
|
-
}
|
|
2658
|
-
var isexe_1 = isexe$1;
|
|
2659
|
-
isexe$1.sync = sync;
|
|
2660
|
-
function isexe$1(path2, options, cb) {
|
|
2661
|
-
if (typeof options === "function") {
|
|
2662
|
-
cb = options;
|
|
2663
|
-
options = {};
|
|
2664
|
-
}
|
|
2665
|
-
if (!cb) {
|
|
2666
|
-
if (typeof Promise !== "function") {
|
|
2667
|
-
throw new TypeError("callback not provided");
|
|
2668
|
-
}
|
|
2669
|
-
return new Promise(function(resolve3, reject) {
|
|
2670
|
-
isexe$1(path2, options || {}, function(er, is) {
|
|
2671
|
-
if (er) {
|
|
2672
|
-
reject(er);
|
|
2673
|
-
} else {
|
|
2674
|
-
resolve3(is);
|
|
2675
|
-
}
|
|
2676
|
-
});
|
|
2677
|
-
});
|
|
2678
|
-
}
|
|
2679
|
-
core(path2, options || {}, function(er, is) {
|
|
2680
|
-
if (er) {
|
|
2681
|
-
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2682
|
-
er = null;
|
|
2683
|
-
is = false;
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
cb(er, is);
|
|
2687
|
-
});
|
|
2688
|
-
}
|
|
2689
|
-
function sync(path2, options) {
|
|
2690
|
-
try {
|
|
2691
|
-
return core.sync(path2, options || {});
|
|
2692
|
-
} catch (er) {
|
|
2693
|
-
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2694
|
-
return false;
|
|
2695
|
-
} else {
|
|
2696
|
-
throw er;
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
2701
|
-
var path$2 = _path2.default;
|
|
2702
|
-
var COLON = isWindows ? ";" : ":";
|
|
2703
|
-
var isexe = isexe_1;
|
|
2704
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
2705
|
-
var getPathInfo = (cmd, opt) => {
|
|
2706
|
-
const colon = opt.colon || COLON;
|
|
2707
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
2708
|
-
...isWindows ? [process.cwd()] : [],
|
|
2709
|
-
...(opt.path || process.env.PATH || "").split(colon)
|
|
2710
|
-
];
|
|
2711
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
2712
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
2713
|
-
if (isWindows) {
|
|
2714
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
2715
|
-
pathExt.unshift("");
|
|
2716
|
-
}
|
|
2717
|
-
return {
|
|
2718
|
-
pathEnv,
|
|
2719
|
-
pathExt,
|
|
2720
|
-
pathExtExe
|
|
2721
|
-
};
|
|
2722
|
-
};
|
|
2723
|
-
var which$1 = (cmd, opt, cb) => {
|
|
2724
|
-
if (typeof opt === "function") {
|
|
2725
|
-
cb = opt;
|
|
2726
|
-
opt = {};
|
|
2727
|
-
}
|
|
2728
|
-
if (!opt)
|
|
2729
|
-
opt = {};
|
|
2730
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2731
|
-
const found = [];
|
|
2732
|
-
const step = (i) => new Promise((resolve3, reject) => {
|
|
2733
|
-
if (i === pathEnv.length)
|
|
2734
|
-
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
2735
|
-
const ppRaw = pathEnv[i];
|
|
2736
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2737
|
-
const pCmd = path$2.join(pathPart, cmd);
|
|
2738
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2739
|
-
resolve3(subStep(p, i, 0));
|
|
2740
|
-
});
|
|
2741
|
-
const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
2742
|
-
if (ii === pathExt.length)
|
|
2743
|
-
return resolve3(step(i + 1));
|
|
2744
|
-
const ext = pathExt[ii];
|
|
2745
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
2746
|
-
if (!er && is) {
|
|
2747
|
-
if (opt.all)
|
|
2748
|
-
found.push(p + ext);
|
|
2749
|
-
else
|
|
2750
|
-
return resolve3(p + ext);
|
|
2751
|
-
}
|
|
2752
|
-
return resolve3(subStep(p, i, ii + 1));
|
|
2753
|
-
});
|
|
2754
|
-
});
|
|
2755
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
2756
|
-
};
|
|
2757
|
-
var whichSync = (cmd, opt) => {
|
|
2758
|
-
opt = opt || {};
|
|
2759
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2760
|
-
const found = [];
|
|
2761
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
2762
|
-
const ppRaw = pathEnv[i];
|
|
2763
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2764
|
-
const pCmd = path$2.join(pathPart, cmd);
|
|
2765
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2766
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
2767
|
-
const cur = p + pathExt[j];
|
|
2768
|
-
try {
|
|
2769
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
2770
|
-
if (is) {
|
|
2771
|
-
if (opt.all)
|
|
2772
|
-
found.push(cur);
|
|
2773
|
-
else
|
|
2774
|
-
return cur;
|
|
2775
|
-
}
|
|
2776
|
-
} catch (ex) {
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
}
|
|
2780
|
-
if (opt.all && found.length)
|
|
2781
|
-
return found;
|
|
2782
|
-
if (opt.nothrow)
|
|
2783
|
-
return null;
|
|
2784
|
-
throw getNotFoundError(cmd);
|
|
2785
|
-
};
|
|
2786
|
-
var which_1 = which$1;
|
|
2787
|
-
which$1.sync = whichSync;
|
|
2788
|
-
function remove(arr, v) {
|
|
2789
|
-
const index = arr.indexOf(v);
|
|
2790
|
-
if (index >= 0)
|
|
2791
|
-
arr.splice(index, 1);
|
|
2792
|
-
return arr;
|
|
2793
|
-
}
|
|
2794
|
-
function exclude(arr, v) {
|
|
2795
|
-
return remove(arr.slice(), v);
|
|
2796
|
-
}
|
|
2797
|
-
function cmdExists(cmd) {
|
|
2798
|
-
try {
|
|
2799
|
-
_child_process.execSync.call(void 0,
|
|
2800
|
-
_os2.default.platform() === "win32" ? `cmd /c "(help ${cmd} > nul || exit 0) && where ${cmd} > nul 2> nul"` : `command -v ${cmd}`
|
|
2801
|
-
);
|
|
2802
|
-
return true;
|
|
2803
|
-
} catch (e2) {
|
|
2804
|
-
return false;
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
function getVoltaPrefix() {
|
|
2808
|
-
const VOLTA_PREFIX = "volta run";
|
|
2809
|
-
const hasVoltaCommand = which_1.sync("volta", { nothrow: true }) !== null;
|
|
2810
|
-
return hasVoltaCommand ? VOLTA_PREFIX : "";
|
|
2811
|
-
}
|
|
2812
|
-
function getCommand(agent, command, args = []) {
|
|
2813
|
-
if (!(agent in AGENTS))
|
|
2814
|
-
throw new Error(`Unsupported agent "${agent}"`);
|
|
2815
|
-
const c = AGENTS[agent][command];
|
|
2816
|
-
if (typeof c === "function")
|
|
2817
|
-
return c(args);
|
|
2818
|
-
if (!c)
|
|
2819
|
-
throw new Error(`Command "${command}" is not support by agent "${agent}"`);
|
|
2820
|
-
return c.replace("{0}", args.join(" ")).trim();
|
|
2821
|
-
}
|
|
2822
|
-
var parseNi = (agent, args, ctx) => {
|
|
2823
|
-
if (agent === "bun")
|
|
2824
|
-
args = args.map((i) => i === "-D" ? "-d" : i);
|
|
2825
|
-
if (args.includes("-g"))
|
|
2826
|
-
return getCommand(agent, "global", exclude(args, "-g"));
|
|
2827
|
-
if (args.includes("--frozen-if-present")) {
|
|
2828
|
-
args = exclude(args, "--frozen-if-present");
|
|
2829
|
-
return getCommand(agent, (ctx == null ? void 0 : ctx.hasLock) ? "frozen" : "install", args);
|
|
2830
|
-
}
|
|
2831
|
-
if (args.includes("--frozen"))
|
|
2832
|
-
return getCommand(agent, "frozen", exclude(args, "--frozen"));
|
|
2833
|
-
if (args.length === 0 || args.every((i) => i.startsWith("-")))
|
|
2834
|
-
return getCommand(agent, "install", args);
|
|
2835
|
-
return getCommand(agent, "add", args);
|
|
2836
|
-
};
|
|
2837
2575
|
var { hasOwnProperty } = Object.prototype;
|
|
2838
2576
|
var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
|
|
2839
2577
|
var encode = (obj, opt) => {
|
|
@@ -2970,7 +2708,7 @@ var unsafe = (val, doUnesc) => {
|
|
|
2970
2708
|
}
|
|
2971
2709
|
try {
|
|
2972
2710
|
val = JSON.parse(val);
|
|
2973
|
-
} catch (
|
|
2711
|
+
} catch (e2) {
|
|
2974
2712
|
}
|
|
2975
2713
|
} else {
|
|
2976
2714
|
let esc = false;
|
|
@@ -3079,7 +2817,7 @@ function pLimit(concurrency) {
|
|
|
3079
2817
|
resolve3(result);
|
|
3080
2818
|
try {
|
|
3081
2819
|
await result;
|
|
3082
|
-
} catch (
|
|
2820
|
+
} catch (e3) {
|
|
3083
2821
|
}
|
|
3084
2822
|
next();
|
|
3085
2823
|
};
|
|
@@ -3150,103 +2888,332 @@ function checkType(type) {
|
|
|
3150
2888
|
}
|
|
3151
2889
|
throw new Error(`Invalid type specified: ${type}`);
|
|
3152
2890
|
}
|
|
3153
|
-
var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
|
|
3154
|
-
var toPath$1 = (urlOrPath) => urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
|
|
3155
|
-
async function locatePath(paths, {
|
|
3156
|
-
cwd = _process2.default.cwd(),
|
|
3157
|
-
type = "file",
|
|
3158
|
-
allowSymlinks = true,
|
|
3159
|
-
concurrency,
|
|
3160
|
-
preserveOrder
|
|
3161
|
-
} = {}) {
|
|
3162
|
-
checkType(type);
|
|
3163
|
-
cwd = toPath$1(cwd);
|
|
3164
|
-
const statFunction = allowSymlinks ? _fs2.promises.stat : _fs2.promises.lstat;
|
|
3165
|
-
return pLocate(paths, async (path_) => {
|
|
3166
|
-
try {
|
|
3167
|
-
const stat = await statFunction(_path2.default.resolve(cwd, path_));
|
|
3168
|
-
return matchType(type, stat);
|
|
3169
|
-
} catch (
|
|
2891
|
+
var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
|
|
2892
|
+
var toPath$1 = (urlOrPath) => urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
|
|
2893
|
+
async function locatePath(paths, {
|
|
2894
|
+
cwd = _process2.default.cwd(),
|
|
2895
|
+
type = "file",
|
|
2896
|
+
allowSymlinks = true,
|
|
2897
|
+
concurrency,
|
|
2898
|
+
preserveOrder
|
|
2899
|
+
} = {}) {
|
|
2900
|
+
checkType(type);
|
|
2901
|
+
cwd = toPath$1(cwd);
|
|
2902
|
+
const statFunction = allowSymlinks ? _fs2.promises.stat : _fs2.promises.lstat;
|
|
2903
|
+
return pLocate(paths, async (path_) => {
|
|
2904
|
+
try {
|
|
2905
|
+
const stat = await statFunction(_path2.default.resolve(cwd, path_));
|
|
2906
|
+
return matchType(type, stat);
|
|
2907
|
+
} catch (e4) {
|
|
2908
|
+
return false;
|
|
2909
|
+
}
|
|
2910
|
+
}, { concurrency, preserveOrder });
|
|
2911
|
+
}
|
|
2912
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
|
|
2913
|
+
var findUpStop = Symbol("findUpStop");
|
|
2914
|
+
async function findUpMultiple(name, options = {}) {
|
|
2915
|
+
let directory = _path2.default.resolve(toPath(options.cwd) || "");
|
|
2916
|
+
const { root } = _path2.default.parse(directory);
|
|
2917
|
+
const stopAt = _path2.default.resolve(directory, options.stopAt || root);
|
|
2918
|
+
const limit = options.limit || Number.POSITIVE_INFINITY;
|
|
2919
|
+
const paths = [name].flat();
|
|
2920
|
+
const runMatcher = async (locateOptions) => {
|
|
2921
|
+
if (typeof name !== "function") {
|
|
2922
|
+
return locatePath(paths, locateOptions);
|
|
2923
|
+
}
|
|
2924
|
+
const foundPath = await name(locateOptions.cwd);
|
|
2925
|
+
if (typeof foundPath === "string") {
|
|
2926
|
+
return locatePath([foundPath], locateOptions);
|
|
2927
|
+
}
|
|
2928
|
+
return foundPath;
|
|
2929
|
+
};
|
|
2930
|
+
const matches = [];
|
|
2931
|
+
while (true) {
|
|
2932
|
+
const foundPath = await runMatcher({ ...options, cwd: directory });
|
|
2933
|
+
if (foundPath === findUpStop) {
|
|
2934
|
+
break;
|
|
2935
|
+
}
|
|
2936
|
+
if (foundPath) {
|
|
2937
|
+
matches.push(_path2.default.resolve(directory, foundPath));
|
|
2938
|
+
}
|
|
2939
|
+
if (directory === stopAt || matches.length >= limit) {
|
|
2940
|
+
break;
|
|
2941
|
+
}
|
|
2942
|
+
directory = _path2.default.dirname(directory);
|
|
2943
|
+
}
|
|
2944
|
+
return matches;
|
|
2945
|
+
}
|
|
2946
|
+
async function findUp(name, options = {}) {
|
|
2947
|
+
const matches = await findUpMultiple(name, { ...options, limit: 1 });
|
|
2948
|
+
return matches[0];
|
|
2949
|
+
}
|
|
2950
|
+
var customRcPath = process.env.NI_CONFIG_FILE;
|
|
2951
|
+
var home = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME;
|
|
2952
|
+
var defaultRcPath = _path2.default.join(home || "~/", ".nirc");
|
|
2953
|
+
var rcPath = customRcPath || defaultRcPath;
|
|
2954
|
+
var defaultConfig = {
|
|
2955
|
+
defaultAgent: "prompt",
|
|
2956
|
+
globalAgent: "npm"
|
|
2957
|
+
};
|
|
2958
|
+
var config;
|
|
2959
|
+
async function getConfig() {
|
|
2960
|
+
var _a;
|
|
2961
|
+
if (!config) {
|
|
2962
|
+
const result = await findUp("package.json") || "";
|
|
2963
|
+
let packageManager = "";
|
|
2964
|
+
if (result)
|
|
2965
|
+
packageManager = (_a = JSON.parse(_fs3.default.readFileSync(result, "utf8")).packageManager) != null ? _a : "";
|
|
2966
|
+
const [, agent, version3] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join("|")})@(d).*?$`)) || [];
|
|
2967
|
+
if (agent)
|
|
2968
|
+
config = Object.assign({}, defaultConfig, { defaultAgent: agent === "yarn" && parseInt(version3) > 1 ? "yarn@berry" : agent });
|
|
2969
|
+
else if (!_fs3.default.existsSync(rcPath))
|
|
2970
|
+
config = defaultConfig;
|
|
2971
|
+
else
|
|
2972
|
+
config = Object.assign({}, defaultConfig, ini.parse(_fs3.default.readFileSync(rcPath, "utf-8")));
|
|
2973
|
+
}
|
|
2974
|
+
return config;
|
|
2975
|
+
}
|
|
2976
|
+
async function getDefaultAgent() {
|
|
2977
|
+
const { defaultAgent } = await getConfig();
|
|
2978
|
+
if (defaultAgent === "prompt" && process.env.CI)
|
|
2979
|
+
return "npm";
|
|
2980
|
+
return defaultAgent;
|
|
2981
|
+
}
|
|
2982
|
+
async function getGlobalAgent() {
|
|
2983
|
+
const { globalAgent } = await getConfig();
|
|
2984
|
+
return globalAgent;
|
|
2985
|
+
}
|
|
2986
|
+
var crossSpawnExports = {};
|
|
2987
|
+
var crossSpawn = {
|
|
2988
|
+
get exports() {
|
|
2989
|
+
return crossSpawnExports;
|
|
2990
|
+
},
|
|
2991
|
+
set exports(v) {
|
|
2992
|
+
crossSpawnExports = v;
|
|
2993
|
+
}
|
|
2994
|
+
};
|
|
2995
|
+
var windows;
|
|
2996
|
+
var hasRequiredWindows;
|
|
2997
|
+
function requireWindows() {
|
|
2998
|
+
if (hasRequiredWindows)
|
|
2999
|
+
return windows;
|
|
3000
|
+
hasRequiredWindows = 1;
|
|
3001
|
+
windows = isexe2;
|
|
3002
|
+
isexe2.sync = sync2;
|
|
3003
|
+
var fs4 = _fs3.default;
|
|
3004
|
+
function checkPathExt(path2, options) {
|
|
3005
|
+
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
3006
|
+
if (!pathext) {
|
|
3007
|
+
return true;
|
|
3008
|
+
}
|
|
3009
|
+
pathext = pathext.split(";");
|
|
3010
|
+
if (pathext.indexOf("") !== -1) {
|
|
3011
|
+
return true;
|
|
3012
|
+
}
|
|
3013
|
+
for (var i = 0; i < pathext.length; i++) {
|
|
3014
|
+
var p = pathext[i].toLowerCase();
|
|
3015
|
+
if (p && path2.substr(-p.length).toLowerCase() === p) {
|
|
3016
|
+
return true;
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
return false;
|
|
3020
|
+
}
|
|
3021
|
+
function checkStat(stat, path2, options) {
|
|
3022
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
3023
|
+
return false;
|
|
3024
|
+
}
|
|
3025
|
+
return checkPathExt(path2, options);
|
|
3026
|
+
}
|
|
3027
|
+
function isexe2(path2, options, cb) {
|
|
3028
|
+
fs4.stat(path2, function(er, stat) {
|
|
3029
|
+
cb(er, er ? false : checkStat(stat, path2, options));
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
function sync2(path2, options) {
|
|
3033
|
+
return checkStat(fs4.statSync(path2), path2, options);
|
|
3034
|
+
}
|
|
3035
|
+
return windows;
|
|
3036
|
+
}
|
|
3037
|
+
var mode;
|
|
3038
|
+
var hasRequiredMode;
|
|
3039
|
+
function requireMode() {
|
|
3040
|
+
if (hasRequiredMode)
|
|
3041
|
+
return mode;
|
|
3042
|
+
hasRequiredMode = 1;
|
|
3043
|
+
mode = isexe2;
|
|
3044
|
+
isexe2.sync = sync2;
|
|
3045
|
+
var fs4 = _fs3.default;
|
|
3046
|
+
function isexe2(path2, options, cb) {
|
|
3047
|
+
fs4.stat(path2, function(er, stat) {
|
|
3048
|
+
cb(er, er ? false : checkStat(stat, options));
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
function sync2(path2, options) {
|
|
3052
|
+
return checkStat(fs4.statSync(path2), options);
|
|
3053
|
+
}
|
|
3054
|
+
function checkStat(stat, options) {
|
|
3055
|
+
return stat.isFile() && checkMode(stat, options);
|
|
3056
|
+
}
|
|
3057
|
+
function checkMode(stat, options) {
|
|
3058
|
+
var mod = stat.mode;
|
|
3059
|
+
var uid = stat.uid;
|
|
3060
|
+
var gid = stat.gid;
|
|
3061
|
+
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
3062
|
+
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
3063
|
+
var u = parseInt("100", 8);
|
|
3064
|
+
var g = parseInt("010", 8);
|
|
3065
|
+
var o = parseInt("001", 8);
|
|
3066
|
+
var ug = u | g;
|
|
3067
|
+
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
3068
|
+
return ret;
|
|
3069
|
+
}
|
|
3070
|
+
return mode;
|
|
3071
|
+
}
|
|
3072
|
+
var core;
|
|
3073
|
+
if (process.platform === "win32" || commonjsGlobal.TESTING_WINDOWS) {
|
|
3074
|
+
core = requireWindows();
|
|
3075
|
+
} else {
|
|
3076
|
+
core = requireMode();
|
|
3077
|
+
}
|
|
3078
|
+
var isexe_1 = isexe$2;
|
|
3079
|
+
isexe$2.sync = sync;
|
|
3080
|
+
function isexe$2(path2, options, cb) {
|
|
3081
|
+
if (typeof options === "function") {
|
|
3082
|
+
cb = options;
|
|
3083
|
+
options = {};
|
|
3084
|
+
}
|
|
3085
|
+
if (!cb) {
|
|
3086
|
+
if (typeof Promise !== "function") {
|
|
3087
|
+
throw new TypeError("callback not provided");
|
|
3088
|
+
}
|
|
3089
|
+
return new Promise(function(resolve3, reject) {
|
|
3090
|
+
isexe$2(path2, options || {}, function(er, is) {
|
|
3091
|
+
if (er) {
|
|
3092
|
+
reject(er);
|
|
3093
|
+
} else {
|
|
3094
|
+
resolve3(is);
|
|
3095
|
+
}
|
|
3096
|
+
});
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
core(path2, options || {}, function(er, is) {
|
|
3100
|
+
if (er) {
|
|
3101
|
+
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
3102
|
+
er = null;
|
|
3103
|
+
is = false;
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
cb(er, is);
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
function sync(path2, options) {
|
|
3110
|
+
try {
|
|
3111
|
+
return core.sync(path2, options || {});
|
|
3112
|
+
} catch (er) {
|
|
3113
|
+
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
3170
3114
|
return false;
|
|
3115
|
+
} else {
|
|
3116
|
+
throw er;
|
|
3171
3117
|
}
|
|
3172
|
-
}
|
|
3118
|
+
}
|
|
3173
3119
|
}
|
|
3174
|
-
var
|
|
3175
|
-
var
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
const
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3120
|
+
var isWindows$1 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
3121
|
+
var path$2 = _path2.default;
|
|
3122
|
+
var COLON = isWindows$1 ? ";" : ":";
|
|
3123
|
+
var isexe$1 = isexe_1;
|
|
3124
|
+
var getNotFoundError$1 = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
3125
|
+
var getPathInfo$1 = (cmd, opt) => {
|
|
3126
|
+
const colon = opt.colon || COLON;
|
|
3127
|
+
const pathEnv = cmd.match(/\//) || isWindows$1 && cmd.match(/\\/) ? [""] : [
|
|
3128
|
+
...isWindows$1 ? [process.cwd()] : [],
|
|
3129
|
+
...(opt.path || process.env.PATH || "").split(colon)
|
|
3130
|
+
];
|
|
3131
|
+
const pathExtExe = isWindows$1 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
3132
|
+
const pathExt = isWindows$1 ? pathExtExe.split(colon) : [""];
|
|
3133
|
+
if (isWindows$1) {
|
|
3134
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
3135
|
+
pathExt.unshift("");
|
|
3136
|
+
}
|
|
3137
|
+
return {
|
|
3138
|
+
pathEnv,
|
|
3139
|
+
pathExt,
|
|
3140
|
+
pathExtExe
|
|
3191
3141
|
};
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3142
|
+
};
|
|
3143
|
+
var which$2 = (cmd, opt, cb) => {
|
|
3144
|
+
if (typeof opt === "function") {
|
|
3145
|
+
cb = opt;
|
|
3146
|
+
opt = {};
|
|
3147
|
+
}
|
|
3148
|
+
if (!opt)
|
|
3149
|
+
opt = {};
|
|
3150
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo$1(cmd, opt);
|
|
3151
|
+
const found = [];
|
|
3152
|
+
const step = (i) => new Promise((resolve3, reject) => {
|
|
3153
|
+
if (i === pathEnv.length)
|
|
3154
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError$1(cmd));
|
|
3155
|
+
const ppRaw = pathEnv[i];
|
|
3156
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
3157
|
+
const pCmd = path$2.join(pathPart, cmd);
|
|
3158
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
3159
|
+
resolve3(subStep(p, i, 0));
|
|
3160
|
+
});
|
|
3161
|
+
const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
3162
|
+
if (ii === pathExt.length)
|
|
3163
|
+
return resolve3(step(i + 1));
|
|
3164
|
+
const ext = pathExt[ii];
|
|
3165
|
+
isexe$1(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
3166
|
+
if (!er && is) {
|
|
3167
|
+
if (opt.all)
|
|
3168
|
+
found.push(p + ext);
|
|
3169
|
+
else
|
|
3170
|
+
return resolve3(p + ext);
|
|
3171
|
+
}
|
|
3172
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
3173
|
+
});
|
|
3174
|
+
});
|
|
3175
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
3176
|
+
};
|
|
3177
|
+
var whichSync$1 = (cmd, opt) => {
|
|
3178
|
+
opt = opt || {};
|
|
3179
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo$1(cmd, opt);
|
|
3180
|
+
const found = [];
|
|
3181
|
+
for (let i = 0; i < pathEnv.length; i++) {
|
|
3182
|
+
const ppRaw = pathEnv[i];
|
|
3183
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
3184
|
+
const pCmd = path$2.join(pathPart, cmd);
|
|
3185
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
3186
|
+
for (let j = 0; j < pathExt.length; j++) {
|
|
3187
|
+
const cur = p + pathExt[j];
|
|
3188
|
+
try {
|
|
3189
|
+
const is = isexe$1.sync(cur, { pathExt: pathExtExe });
|
|
3190
|
+
if (is) {
|
|
3191
|
+
if (opt.all)
|
|
3192
|
+
found.push(cur);
|
|
3193
|
+
else
|
|
3194
|
+
return cur;
|
|
3195
|
+
}
|
|
3196
|
+
} catch (ex) {
|
|
3197
|
+
}
|
|
3203
3198
|
}
|
|
3204
|
-
directory = _path2.default.dirname(directory);
|
|
3205
3199
|
}
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
}
|
|
3212
|
-
var customRcPath = process.env.NI_CONFIG_FILE;
|
|
3213
|
-
var home = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME;
|
|
3214
|
-
var defaultRcPath = _path2.default.join(home || "~/", ".nirc");
|
|
3215
|
-
var rcPath = customRcPath || defaultRcPath;
|
|
3216
|
-
var defaultConfig = {
|
|
3217
|
-
defaultAgent: "prompt",
|
|
3218
|
-
globalAgent: "npm"
|
|
3200
|
+
if (opt.all && found.length)
|
|
3201
|
+
return found;
|
|
3202
|
+
if (opt.nothrow)
|
|
3203
|
+
return null;
|
|
3204
|
+
throw getNotFoundError$1(cmd);
|
|
3219
3205
|
};
|
|
3220
|
-
var
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
if (agent)
|
|
3230
|
-
config = Object.assign({}, defaultConfig, { defaultAgent: agent === "yarn" && parseInt(version3) > 1 ? "yarn@berry" : agent });
|
|
3231
|
-
else if (!_fs3.default.existsSync(rcPath))
|
|
3232
|
-
config = defaultConfig;
|
|
3233
|
-
else
|
|
3234
|
-
config = Object.assign({}, defaultConfig, ini.parse(_fs3.default.readFileSync(rcPath, "utf-8")));
|
|
3206
|
+
var which_1 = which$2;
|
|
3207
|
+
which$2.sync = whichSync$1;
|
|
3208
|
+
var pathKeyExports = {};
|
|
3209
|
+
var pathKey$2 = {
|
|
3210
|
+
get exports() {
|
|
3211
|
+
return pathKeyExports;
|
|
3212
|
+
},
|
|
3213
|
+
set exports(v) {
|
|
3214
|
+
pathKeyExports = v;
|
|
3235
3215
|
}
|
|
3236
|
-
|
|
3237
|
-
}
|
|
3238
|
-
async function getDefaultAgent() {
|
|
3239
|
-
const { defaultAgent } = await getConfig();
|
|
3240
|
-
if (defaultAgent === "prompt" && process.env.CI)
|
|
3241
|
-
return "npm";
|
|
3242
|
-
return defaultAgent;
|
|
3243
|
-
}
|
|
3244
|
-
async function getGlobalAgent() {
|
|
3245
|
-
const { globalAgent } = await getConfig();
|
|
3246
|
-
return globalAgent;
|
|
3247
|
-
}
|
|
3248
|
-
var crossSpawn = { exports: {} };
|
|
3249
|
-
var pathKey$2 = { exports: {} };
|
|
3216
|
+
};
|
|
3250
3217
|
var pathKey$1 = (options = {}) => {
|
|
3251
3218
|
const environment = options.env || process.env;
|
|
3252
3219
|
const platform = options.platform || process.platform;
|
|
@@ -3256,10 +3223,10 @@ var pathKey$1 = (options = {}) => {
|
|
|
3256
3223
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
3257
3224
|
};
|
|
3258
3225
|
pathKey$2.exports = pathKey$1;
|
|
3259
|
-
|
|
3226
|
+
pathKeyExports.default = pathKey$1;
|
|
3260
3227
|
var path$1 = _path2.default;
|
|
3261
|
-
var which = which_1;
|
|
3262
|
-
var getPathKey =
|
|
3228
|
+
var which$1 = which_1;
|
|
3229
|
+
var getPathKey = pathKeyExports;
|
|
3263
3230
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
3264
3231
|
const env2 = parsed.options.env || process.env;
|
|
3265
3232
|
const cwd = process.cwd();
|
|
@@ -3273,7 +3240,7 @@ function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
|
3273
3240
|
}
|
|
3274
3241
|
let resolved;
|
|
3275
3242
|
try {
|
|
3276
|
-
resolved = which.sync(parsed.command, {
|
|
3243
|
+
resolved = which$1.sync(parsed.command, {
|
|
3277
3244
|
path: env2[getPathKey({ env: env2 })],
|
|
3278
3245
|
pathExt: withoutPathExt ? path$1.delimiter : void 0
|
|
3279
3246
|
});
|
|
@@ -3454,10 +3421,10 @@ function spawnSync(command, args, options) {
|
|
|
3454
3421
|
return result;
|
|
3455
3422
|
}
|
|
3456
3423
|
crossSpawn.exports = spawn;
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3424
|
+
crossSpawnExports.spawn = spawn;
|
|
3425
|
+
crossSpawnExports.sync = spawnSync;
|
|
3426
|
+
crossSpawnExports._parse = parse;
|
|
3427
|
+
crossSpawnExports._enoent = enoent;
|
|
3461
3428
|
function stripFinalNewline(input) {
|
|
3462
3429
|
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
3463
3430
|
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
@@ -4014,12 +3981,28 @@ var normalizeStdio = (options) => {
|
|
|
4014
3981
|
const length = Math.max(stdio.length, aliases.length);
|
|
4015
3982
|
return Array.from({ length }, (value, index) => stdio[index]);
|
|
4016
3983
|
};
|
|
4017
|
-
var
|
|
4018
|
-
var
|
|
3984
|
+
var signalExitExports = {};
|
|
3985
|
+
var signalExit = {
|
|
3986
|
+
get exports() {
|
|
3987
|
+
return signalExitExports;
|
|
3988
|
+
},
|
|
3989
|
+
set exports(v) {
|
|
3990
|
+
signalExitExports = v;
|
|
3991
|
+
}
|
|
3992
|
+
};
|
|
3993
|
+
var signalsExports = {};
|
|
3994
|
+
var signals$1 = {
|
|
3995
|
+
get exports() {
|
|
3996
|
+
return signalsExports;
|
|
3997
|
+
},
|
|
3998
|
+
set exports(v) {
|
|
3999
|
+
signalsExports = v;
|
|
4000
|
+
}
|
|
4001
|
+
};
|
|
4019
4002
|
var hasRequiredSignals;
|
|
4020
4003
|
function requireSignals() {
|
|
4021
4004
|
if (hasRequiredSignals)
|
|
4022
|
-
return
|
|
4005
|
+
return signalsExports;
|
|
4023
4006
|
hasRequiredSignals = 1;
|
|
4024
4007
|
(function(module) {
|
|
4025
4008
|
module.exports = [
|
|
@@ -4051,7 +4034,7 @@ function requireSignals() {
|
|
|
4051
4034
|
);
|
|
4052
4035
|
}
|
|
4053
4036
|
})(signals$1);
|
|
4054
|
-
return
|
|
4037
|
+
return signalsExports;
|
|
4055
4038
|
}
|
|
4056
4039
|
var process$1 = commonjsGlobal.process;
|
|
4057
4040
|
var processOk = function(process2) {
|
|
@@ -4118,7 +4101,7 @@ if (!processOk(process$1)) {
|
|
|
4118
4101
|
process$1.reallyExit = originalProcessReallyExit;
|
|
4119
4102
|
emitter.count -= 1;
|
|
4120
4103
|
};
|
|
4121
|
-
|
|
4104
|
+
signalExitExports.unload = unload;
|
|
4122
4105
|
emit = function emit2(event, code, signal) {
|
|
4123
4106
|
if (emitter.emitted[event]) {
|
|
4124
4107
|
return;
|
|
@@ -4144,7 +4127,7 @@ if (!processOk(process$1)) {
|
|
|
4144
4127
|
}
|
|
4145
4128
|
};
|
|
4146
4129
|
});
|
|
4147
|
-
|
|
4130
|
+
signalExitExports.signals = function() {
|
|
4148
4131
|
return signals;
|
|
4149
4132
|
};
|
|
4150
4133
|
loaded = false;
|
|
@@ -4165,7 +4148,7 @@ if (!processOk(process$1)) {
|
|
|
4165
4148
|
process$1.emit = processEmit;
|
|
4166
4149
|
process$1.reallyExit = processReallyExit;
|
|
4167
4150
|
};
|
|
4168
|
-
|
|
4151
|
+
signalExitExports.load = load;
|
|
4169
4152
|
originalProcessReallyExit = process$1.reallyExit;
|
|
4170
4153
|
processReallyExit = function processReallyExit2(code) {
|
|
4171
4154
|
if (!processOk(commonjsGlobal.process)) {
|
|
@@ -4268,7 +4251,7 @@ var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
|
4268
4251
|
if (!cleanup || detached) {
|
|
4269
4252
|
return timedPromise;
|
|
4270
4253
|
}
|
|
4271
|
-
const removeExitHandler =
|
|
4254
|
+
const removeExitHandler = signalExitExports(() => {
|
|
4272
4255
|
spawned.kill();
|
|
4273
4256
|
});
|
|
4274
4257
|
return timedPromise.finally(() => {
|
|
@@ -4278,7 +4261,15 @@ var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
|
4278
4261
|
function isStream(stream2) {
|
|
4279
4262
|
return stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function";
|
|
4280
4263
|
}
|
|
4281
|
-
var
|
|
4264
|
+
var getStreamExports = {};
|
|
4265
|
+
var getStream$1 = {
|
|
4266
|
+
get exports() {
|
|
4267
|
+
return getStreamExports;
|
|
4268
|
+
},
|
|
4269
|
+
set exports(v) {
|
|
4270
|
+
getStreamExports = v;
|
|
4271
|
+
}
|
|
4272
|
+
};
|
|
4282
4273
|
var { PassThrough: PassThroughStream } = _stream2.default;
|
|
4283
4274
|
var bufferStream$1 = (options) => {
|
|
4284
4275
|
options = { ...options };
|
|
@@ -4362,9 +4353,9 @@ async function getStream(inputStream, options) {
|
|
|
4362
4353
|
return stream2.getBufferedValue();
|
|
4363
4354
|
}
|
|
4364
4355
|
getStream$1.exports = getStream;
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4356
|
+
getStreamExports.buffer = (stream2, options) => getStream(stream2, { ...options, encoding: "buffer" });
|
|
4357
|
+
getStreamExports.array = (stream2, options) => getStream(stream2, { ...options, array: true });
|
|
4358
|
+
getStreamExports.MaxBufferError = MaxBufferError;
|
|
4368
4359
|
var { PassThrough } = _stream2.default;
|
|
4369
4360
|
var mergeStream = function() {
|
|
4370
4361
|
var sources = [];
|
|
@@ -4437,9 +4428,9 @@ var getStreamPromise = (stream2, { encoding, buffer, maxBuffer }) => {
|
|
|
4437
4428
|
return;
|
|
4438
4429
|
}
|
|
4439
4430
|
if (encoding) {
|
|
4440
|
-
return
|
|
4431
|
+
return getStreamExports(stream2, { encoding, maxBuffer });
|
|
4441
4432
|
}
|
|
4442
|
-
return
|
|
4433
|
+
return getStreamExports.buffer(stream2, { maxBuffer });
|
|
4443
4434
|
};
|
|
4444
4435
|
var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
4445
4436
|
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
@@ -4520,7 +4511,7 @@ var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) =>
|
|
|
4520
4511
|
return env2;
|
|
4521
4512
|
};
|
|
4522
4513
|
var handleArguments = (file, args, options = {}) => {
|
|
4523
|
-
const parsed =
|
|
4514
|
+
const parsed = crossSpawnExports._parse(file, args, options);
|
|
4524
4515
|
file = parsed.command;
|
|
4525
4516
|
args = parsed.args;
|
|
4526
4517
|
options = parsed.options;
|
|
@@ -5321,14 +5312,14 @@ function requireStyle$1() {
|
|
|
5321
5312
|
default: c.cyan("?")
|
|
5322
5313
|
});
|
|
5323
5314
|
const symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
|
|
5324
|
-
const
|
|
5315
|
+
const delimiter2 = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall);
|
|
5325
5316
|
const item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
|
|
5326
5317
|
style$1 = {
|
|
5327
5318
|
styles,
|
|
5328
5319
|
render,
|
|
5329
5320
|
symbols,
|
|
5330
5321
|
symbol,
|
|
5331
|
-
delimiter,
|
|
5322
|
+
delimiter: delimiter2,
|
|
5332
5323
|
item
|
|
5333
5324
|
};
|
|
5334
5325
|
return style$1;
|
|
@@ -7436,9 +7427,9 @@ function requirePrompts$1() {
|
|
|
7436
7427
|
$2.date = (args) => toPrompt("DatePrompt", args);
|
|
7437
7428
|
$2.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
7438
7429
|
$2.list = (args) => {
|
|
7439
|
-
const
|
|
7430
|
+
const sep2 = args.separator || ",";
|
|
7440
7431
|
return toPrompt("TextPrompt", args, {
|
|
7441
|
-
onSubmit: (str) => str.split(
|
|
7432
|
+
onSubmit: (str) => str.split(sep2).map((s) => s.trim())
|
|
7442
7433
|
});
|
|
7443
7434
|
};
|
|
7444
7435
|
$2.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -7862,14 +7853,14 @@ function requireStyle() {
|
|
|
7862
7853
|
default: c.cyan("?")
|
|
7863
7854
|
});
|
|
7864
7855
|
const symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;
|
|
7865
|
-
const
|
|
7856
|
+
const delimiter2 = (completing) => c.gray(completing ? figures.ellipsis : figures.pointerSmall);
|
|
7866
7857
|
const item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line);
|
|
7867
7858
|
style = {
|
|
7868
7859
|
styles,
|
|
7869
7860
|
render,
|
|
7870
7861
|
symbols,
|
|
7871
7862
|
symbol,
|
|
7872
|
-
delimiter,
|
|
7863
|
+
delimiter: delimiter2,
|
|
7873
7864
|
item
|
|
7874
7865
|
};
|
|
7875
7866
|
return style;
|
|
@@ -9852,9 +9843,9 @@ function requirePrompts() {
|
|
|
9852
9843
|
$2.date = (args) => toPrompt("DatePrompt", args);
|
|
9853
9844
|
$2.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
9854
9845
|
$2.list = (args) => {
|
|
9855
|
-
const
|
|
9846
|
+
const sep2 = args.separator || ",";
|
|
9856
9847
|
return toPrompt("TextPrompt", args, {
|
|
9857
|
-
onSubmit: (str) => str.split(
|
|
9848
|
+
onSubmit: (str) => str.split(sep2).map((s) => s.trim())
|
|
9858
9849
|
});
|
|
9859
9850
|
};
|
|
9860
9851
|
$2.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -9886,11 +9877,11 @@ function requirePrompts() {
|
|
|
9886
9877
|
})(prompts$1);
|
|
9887
9878
|
return prompts$1;
|
|
9888
9879
|
}
|
|
9889
|
-
var lib;
|
|
9880
|
+
var lib$1;
|
|
9890
9881
|
var hasRequiredLib;
|
|
9891
9882
|
function requireLib() {
|
|
9892
9883
|
if (hasRequiredLib)
|
|
9893
|
-
return lib;
|
|
9884
|
+
return lib$1;
|
|
9894
9885
|
hasRequiredLib = 1;
|
|
9895
9886
|
const prompts3 = requirePrompts();
|
|
9896
9887
|
const passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
@@ -9961,8 +9952,8 @@ function requireLib() {
|
|
|
9961
9952
|
function override(answers) {
|
|
9962
9953
|
prompt2._override = Object.assign({}, answers);
|
|
9963
9954
|
}
|
|
9964
|
-
lib = Object.assign(prompt2, { prompt: prompt2, prompts: prompts3, inject, override });
|
|
9965
|
-
return lib;
|
|
9955
|
+
lib$1 = Object.assign(prompt2, { prompt: prompt2, prompts: prompts3, inject, override });
|
|
9956
|
+
return lib$1;
|
|
9966
9957
|
}
|
|
9967
9958
|
function isNodeLT(tar) {
|
|
9968
9959
|
tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number);
|
|
@@ -9976,7 +9967,111 @@ function isNodeLT(tar) {
|
|
|
9976
9967
|
return false;
|
|
9977
9968
|
}
|
|
9978
9969
|
var prompts = isNodeLT("8.6.0") ? requireDist() : requireLib();
|
|
9979
|
-
|
|
9970
|
+
var isexe = isexe_1;
|
|
9971
|
+
var { join: join2, delimiter, sep, posix } = _path2.default;
|
|
9972
|
+
var isWindows = process.platform === "win32";
|
|
9973
|
+
var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
|
|
9974
|
+
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
9975
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
9976
|
+
var getPathInfo = (cmd, {
|
|
9977
|
+
path: optPath = process.env.PATH,
|
|
9978
|
+
pathExt: optPathExt = process.env.PATHEXT,
|
|
9979
|
+
delimiter: optDelimiter = delimiter
|
|
9980
|
+
}) => {
|
|
9981
|
+
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
9982
|
+
...isWindows ? [process.cwd()] : [],
|
|
9983
|
+
...(optPath || "").split(optDelimiter)
|
|
9984
|
+
];
|
|
9985
|
+
if (isWindows) {
|
|
9986
|
+
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
9987
|
+
const pathExt = pathExtExe.split(optDelimiter);
|
|
9988
|
+
if (cmd.includes(".") && pathExt[0] !== "") {
|
|
9989
|
+
pathExt.unshift("");
|
|
9990
|
+
}
|
|
9991
|
+
return { pathEnv, pathExt, pathExtExe };
|
|
9992
|
+
}
|
|
9993
|
+
return { pathEnv, pathExt: [""] };
|
|
9994
|
+
};
|
|
9995
|
+
var getPathPart = (raw, cmd) => {
|
|
9996
|
+
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
9997
|
+
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
9998
|
+
return prefix + join2(pathPart, cmd);
|
|
9999
|
+
};
|
|
10000
|
+
var which = async (cmd, opt = {}) => {
|
|
10001
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
10002
|
+
const found = [];
|
|
10003
|
+
for (const envPart of pathEnv) {
|
|
10004
|
+
const p = getPathPart(envPart, cmd);
|
|
10005
|
+
for (const ext of pathExt) {
|
|
10006
|
+
const withExt = p + ext;
|
|
10007
|
+
const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
10008
|
+
if (is) {
|
|
10009
|
+
if (!opt.all) {
|
|
10010
|
+
return withExt;
|
|
10011
|
+
}
|
|
10012
|
+
found.push(withExt);
|
|
10013
|
+
}
|
|
10014
|
+
}
|
|
10015
|
+
}
|
|
10016
|
+
if (opt.all && found.length) {
|
|
10017
|
+
return found;
|
|
10018
|
+
}
|
|
10019
|
+
if (opt.nothrow) {
|
|
10020
|
+
return null;
|
|
10021
|
+
}
|
|
10022
|
+
throw getNotFoundError(cmd);
|
|
10023
|
+
};
|
|
10024
|
+
var whichSync = (cmd, opt = {}) => {
|
|
10025
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
10026
|
+
const found = [];
|
|
10027
|
+
for (const pathEnvPart of pathEnv) {
|
|
10028
|
+
const p = getPathPart(pathEnvPart, cmd);
|
|
10029
|
+
for (const ext of pathExt) {
|
|
10030
|
+
const withExt = p + ext;
|
|
10031
|
+
const is = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
10032
|
+
if (is) {
|
|
10033
|
+
if (!opt.all) {
|
|
10034
|
+
return withExt;
|
|
10035
|
+
}
|
|
10036
|
+
found.push(withExt);
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
}
|
|
10040
|
+
if (opt.all && found.length) {
|
|
10041
|
+
return found;
|
|
10042
|
+
}
|
|
10043
|
+
if (opt.nothrow) {
|
|
10044
|
+
return null;
|
|
10045
|
+
}
|
|
10046
|
+
throw getNotFoundError(cmd);
|
|
10047
|
+
};
|
|
10048
|
+
var lib = which;
|
|
10049
|
+
which.sync = whichSync;
|
|
10050
|
+
function remove(arr, v) {
|
|
10051
|
+
const index = arr.indexOf(v);
|
|
10052
|
+
if (index >= 0)
|
|
10053
|
+
arr.splice(index, 1);
|
|
10054
|
+
return arr;
|
|
10055
|
+
}
|
|
10056
|
+
function exclude(arr, v) {
|
|
10057
|
+
return remove(arr.slice(), v);
|
|
10058
|
+
}
|
|
10059
|
+
function cmdExists(cmd) {
|
|
10060
|
+
try {
|
|
10061
|
+
_child_process.execSync.call(void 0,
|
|
10062
|
+
_os2.default.platform() === "win32" ? `cmd /c "(help ${cmd} > nul || exit 0) && where ${cmd} > nul 2> nul"` : `command -v ${cmd}`
|
|
10063
|
+
);
|
|
10064
|
+
return true;
|
|
10065
|
+
} catch (e5) {
|
|
10066
|
+
return false;
|
|
10067
|
+
}
|
|
10068
|
+
}
|
|
10069
|
+
function getVoltaPrefix() {
|
|
10070
|
+
const VOLTA_PREFIX = "volta run";
|
|
10071
|
+
const hasVoltaCommand = lib.sync("volta", { nothrow: true }) !== null;
|
|
10072
|
+
return hasVoltaCommand ? VOLTA_PREFIX : "";
|
|
10073
|
+
}
|
|
10074
|
+
async function detect({ autoInstall, cwd } = {}) {
|
|
9980
10075
|
let agent = null;
|
|
9981
10076
|
const lockPath = await findUp(Object.keys(LOCKS), { cwd });
|
|
9982
10077
|
let packageJsonPath;
|
|
@@ -10022,6 +10117,31 @@ async function detect({ autoInstall, cwd }) {
|
|
|
10022
10117
|
}
|
|
10023
10118
|
return agent;
|
|
10024
10119
|
}
|
|
10120
|
+
function getCommand(agent, command, args = []) {
|
|
10121
|
+
if (!(agent in AGENTS))
|
|
10122
|
+
throw new Error(`Unsupported agent "${agent}"`);
|
|
10123
|
+
const c = AGENTS[agent][command];
|
|
10124
|
+
if (typeof c === "function")
|
|
10125
|
+
return c(args);
|
|
10126
|
+
if (!c)
|
|
10127
|
+
throw new Error(`Command "${command}" is not support by agent "${agent}"`);
|
|
10128
|
+
return c.replace("{0}", args.join(" ")).trim();
|
|
10129
|
+
}
|
|
10130
|
+
var parseNi = (agent, args, ctx) => {
|
|
10131
|
+
if (agent === "bun")
|
|
10132
|
+
args = args.map((i) => i === "-D" ? "-d" : i);
|
|
10133
|
+
if (args.includes("-g"))
|
|
10134
|
+
return getCommand(agent, "global", exclude(args, "-g"));
|
|
10135
|
+
if (args.includes("--frozen-if-present")) {
|
|
10136
|
+
args = exclude(args, "--frozen-if-present");
|
|
10137
|
+
return getCommand(agent, (ctx == null ? void 0 : ctx.hasLock) ? "frozen" : "install", args);
|
|
10138
|
+
}
|
|
10139
|
+
if (args.includes("--frozen"))
|
|
10140
|
+
return getCommand(agent, "frozen", exclude(args, "--frozen"));
|
|
10141
|
+
if (args.length === 0 || args.every((i) => i.startsWith("-")))
|
|
10142
|
+
return getCommand(agent, "install", args);
|
|
10143
|
+
return getCommand(agent, "add", args);
|
|
10144
|
+
};
|
|
10025
10145
|
var FORCE_COLOR;
|
|
10026
10146
|
var NODE_DISABLE_COLORS;
|
|
10027
10147
|
var NO_COLOR;
|
|
@@ -10116,7 +10236,7 @@ function init(open, close) {
|
|
|
10116
10236
|
return txt === void 0 ? chain([open], [blk]) : $.enabled ? run$1([blk], txt + "") : txt + "";
|
|
10117
10237
|
};
|
|
10118
10238
|
}
|
|
10119
|
-
var version2 = "0.
|
|
10239
|
+
var version2 = "0.19.0";
|
|
10120
10240
|
var DEBUG_SIGN = "?";
|
|
10121
10241
|
async function run(fn, args, options = {}) {
|
|
10122
10242
|
const debug2 = args.includes(DEBUG_SIGN);
|
|
@@ -10178,7 +10298,7 @@ async function run(fn, args, options = {}) {
|
|
|
10178
10298
|
await execaCommand(command, { stdio: "inherit", encoding: "utf-8", cwd });
|
|
10179
10299
|
}
|
|
10180
10300
|
|
|
10181
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
10301
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.19.0/node_modules/@antfu/ni/dist/index.mjs
|
|
10182
10302
|
|
|
10183
10303
|
|
|
10184
10304
|
|