storybook 10.0.0-beta.3 → 10.0.0-beta.4
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/_node-chunks/{builder-manager-DXAEQZJB.js → builder-manager-IKHPPPFE.js} +13 -13
- package/dist/_node-chunks/{camelcase-CMMT6PHY.js → camelcase-O2O7JODG.js} +7 -7
- package/dist/_node-chunks/{chunk-ICETGZAR.js → chunk-3J7DQ6TI.js} +7 -7
- package/dist/_node-chunks/{chunk-RUCPXDO3.js → chunk-4FMOVB65.js} +8 -8
- package/dist/_node-chunks/{chunk-EVY6P65U.js → chunk-4VGW2SQA.js} +7 -7
- package/dist/_node-chunks/{chunk-ICFGNVW7.js → chunk-5OILJTZE.js} +7 -7
- package/dist/_node-chunks/{chunk-4TGAX5W7.js → chunk-6COBULLV.js} +7 -7
- package/dist/_node-chunks/{chunk-EI44VA3U.js → chunk-7IIAUEWB.js} +8 -8
- package/dist/_node-chunks/{chunk-DNOOZ2LS.js → chunk-AC3BNULF.js} +552 -717
- package/dist/_node-chunks/{chunk-6Z44ODDR.js → chunk-AXFNB3AN.js} +7 -7
- package/dist/_node-chunks/chunk-CHJLO2LV.js +62 -0
- package/dist/_node-chunks/{chunk-PK6SVDYW.js → chunk-DCHFG5TX.js} +7 -7
- package/dist/_node-chunks/{chunk-R6TLLF24.js → chunk-FWFQ2GU7.js} +6 -6
- package/dist/_node-chunks/{chunk-3SUJKLRV.js → chunk-HAVE6SGK.js} +7 -7
- package/dist/_node-chunks/{chunk-CNKVQCQJ.js → chunk-IB5AEYPX.js} +7 -7
- package/dist/_node-chunks/{chunk-PAZJQ2GH.js → chunk-JECCFKKM.js} +7 -7
- package/dist/_node-chunks/{chunk-SHXAIHPO.js → chunk-JP4LEAXM.js} +7 -7
- package/dist/_node-chunks/chunk-JSSBBVU5.js +79 -0
- package/dist/_node-chunks/chunk-MNG223PY.js +18 -0
- package/dist/_node-chunks/{chunk-XRAB2RZN.js → chunk-MOO2Y4GI.js} +6 -6
- package/dist/_node-chunks/{chunk-7EGB7ALG.js → chunk-N3GFXZDP.js} +7 -7
- package/dist/_node-chunks/{chunk-AKW5OJ2T.js → chunk-NF3GXIEK.js} +9 -9
- package/dist/_node-chunks/{chunk-BV4J7FF6.js → chunk-NOSGJ5PL.js} +7 -7
- package/dist/_node-chunks/{chunk-WRSYICUI.js → chunk-OL2HWCBH.js} +7 -7
- package/dist/_node-chunks/{chunk-KQXC7XVZ.js → chunk-SF2IETZ2.js} +29 -81
- package/dist/_node-chunks/{chunk-LRQFELIZ.js → chunk-TBAIXCHN.js} +8 -8
- package/dist/_node-chunks/{chunk-QI3AVWUV.js → chunk-TTQRDWDJ.js} +12 -12
- package/dist/_node-chunks/{chunk-MVPVYHBT.js → chunk-TYGVOW7L.js} +7 -7
- package/dist/_node-chunks/{chunk-IA7M33LK.js → chunk-USDZSU5L.js} +7 -7
- package/dist/_node-chunks/chunk-XA4TAMUS.js +4966 -0
- package/dist/_node-chunks/{chunk-PA26PSV2.js → chunk-XT6O5CVI.js} +7 -7
- package/dist/_node-chunks/{chunk-TL5RNPZW.js → chunk-YJHXEN7U.js} +10 -10
- package/dist/_node-chunks/{chunk-5XVEWBRA.js → chunk-YRPXGWKW.js} +8 -8
- package/dist/_node-chunks/{default-browser-id-2X5XLPPS.js → default-browser-id-J4OIAAJ5.js} +7 -7
- package/dist/_node-chunks/{dist-JSBOOVQK.js → dist-BMKSKYDI.js} +9 -9
- package/dist/_node-chunks/{globby-YYTLHNUO.js → globby-DASPUXWI.js} +9 -9
- package/dist/_node-chunks/{lib-DJHADRPZ.js → lib-L6BIH4EV.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-WT6XCDU6.js → mdx-N42X6CFJ-2COTUDSL.js} +8 -8
- package/dist/_node-chunks/{p-limit-HTXI4SGX.js → p-limit-HVR3I7TJ.js} +76 -10
- package/dist/_node-chunks/{plugin-NNRMQ2YK.js → plugin-2XPSFYWZ.js} +10 -10
- package/dist/_node-chunks/{plugin-W22F3FQV.js → plugin-FZOHPRK7.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-VFNVWMAM.js → webpack-inject-mocker-runtime-plugin-FGQM2EPC.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-Q4ED2M25.js → webpack-mock-plugin-4HOAIYSX.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +29 -30
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.js +23 -22
- package/dist/core-server/index.js +38 -39
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +22 -22
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager-api/index.js +1 -1
- package/dist/node-logger/index.js +13 -14
- package/dist/preview-api/index.d.ts +67 -68
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +24 -25
- package/package.json +2 -6
- package/dist/_node-chunks/chunk-ALWVSNSK.js +0 -62
- package/dist/_node-chunks/chunk-MHNUEOON.js +0 -87
- package/dist/_node-chunks/chunk-VDFQYNPZ.js +0 -266
- package/dist/_node-chunks/chunk-WELIADWR.js +0 -2377
- package/dist/_node-chunks/chunk-YRXKNGPR.js +0 -18
|
@@ -1,2377 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_6q9nmfaplv7 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_6q9nmfaplv7 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_6q9nmfaplv7 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_6q9nmfaplv7.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_6q9nmfaplv7.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_6q9nmfaplv7.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
findUpSync
|
|
14
|
-
} from "./chunk-VDFQYNPZ.js";
|
|
15
|
-
import {
|
|
16
|
-
__commonJS,
|
|
17
|
-
__name,
|
|
18
|
-
__require,
|
|
19
|
-
__toESM
|
|
20
|
-
} from "./chunk-XRAB2RZN.js";
|
|
21
|
-
|
|
22
|
-
// ../node_modules/isexe/windows.js
|
|
23
|
-
var require_windows = __commonJS({
|
|
24
|
-
"../node_modules/isexe/windows.js"(exports, module) {
|
|
25
|
-
module.exports = isexe;
|
|
26
|
-
isexe.sync = sync;
|
|
27
|
-
var fs = __require("fs");
|
|
28
|
-
function checkPathExt(path3, options) {
|
|
29
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
30
|
-
if (!pathext) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
pathext = pathext.split(";");
|
|
34
|
-
if (pathext.indexOf("") !== -1) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
38
|
-
var p = pathext[i].toLowerCase();
|
|
39
|
-
if (p && path3.substr(-p.length).toLowerCase() === p) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
__name(checkPathExt, "checkPathExt");
|
|
46
|
-
function checkStat(stat, path3, options) {
|
|
47
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return checkPathExt(path3, options);
|
|
51
|
-
}
|
|
52
|
-
__name(checkStat, "checkStat");
|
|
53
|
-
function isexe(path3, options, cb) {
|
|
54
|
-
fs.stat(path3, function(er, stat) {
|
|
55
|
-
cb(er, er ? false : checkStat(stat, path3, options));
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
__name(isexe, "isexe");
|
|
59
|
-
function sync(path3, options) {
|
|
60
|
-
return checkStat(fs.statSync(path3), path3, options);
|
|
61
|
-
}
|
|
62
|
-
__name(sync, "sync");
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// ../node_modules/isexe/mode.js
|
|
67
|
-
var require_mode = __commonJS({
|
|
68
|
-
"../node_modules/isexe/mode.js"(exports, module) {
|
|
69
|
-
module.exports = isexe;
|
|
70
|
-
isexe.sync = sync;
|
|
71
|
-
var fs = __require("fs");
|
|
72
|
-
function isexe(path3, options, cb) {
|
|
73
|
-
fs.stat(path3, function(er, stat) {
|
|
74
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
__name(isexe, "isexe");
|
|
78
|
-
function sync(path3, options) {
|
|
79
|
-
return checkStat(fs.statSync(path3), options);
|
|
80
|
-
}
|
|
81
|
-
__name(sync, "sync");
|
|
82
|
-
function checkStat(stat, options) {
|
|
83
|
-
return stat.isFile() && checkMode(stat, options);
|
|
84
|
-
}
|
|
85
|
-
__name(checkStat, "checkStat");
|
|
86
|
-
function checkMode(stat, options) {
|
|
87
|
-
var mod = stat.mode;
|
|
88
|
-
var uid = stat.uid;
|
|
89
|
-
var gid = stat.gid;
|
|
90
|
-
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
91
|
-
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
92
|
-
var u = parseInt("100", 8);
|
|
93
|
-
var g = parseInt("010", 8);
|
|
94
|
-
var o = parseInt("001", 8);
|
|
95
|
-
var ug = u | g;
|
|
96
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
97
|
-
return ret;
|
|
98
|
-
}
|
|
99
|
-
__name(checkMode, "checkMode");
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// ../node_modules/isexe/index.js
|
|
104
|
-
var require_isexe = __commonJS({
|
|
105
|
-
"../node_modules/isexe/index.js"(exports, module) {
|
|
106
|
-
var fs = __require("fs");
|
|
107
|
-
var core;
|
|
108
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
109
|
-
core = require_windows();
|
|
110
|
-
} else {
|
|
111
|
-
core = require_mode();
|
|
112
|
-
}
|
|
113
|
-
module.exports = isexe;
|
|
114
|
-
isexe.sync = sync;
|
|
115
|
-
function isexe(path3, options, cb) {
|
|
116
|
-
if (typeof options === "function") {
|
|
117
|
-
cb = options;
|
|
118
|
-
options = {};
|
|
119
|
-
}
|
|
120
|
-
if (!cb) {
|
|
121
|
-
if (typeof Promise !== "function") {
|
|
122
|
-
throw new TypeError("callback not provided");
|
|
123
|
-
}
|
|
124
|
-
return new Promise(function(resolve2, reject) {
|
|
125
|
-
isexe(path3, options || {}, function(er, is) {
|
|
126
|
-
if (er) {
|
|
127
|
-
reject(er);
|
|
128
|
-
} else {
|
|
129
|
-
resolve2(is);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
core(path3, options || {}, function(er, is) {
|
|
135
|
-
if (er) {
|
|
136
|
-
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
137
|
-
er = null;
|
|
138
|
-
is = false;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
cb(er, is);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
__name(isexe, "isexe");
|
|
145
|
-
function sync(path3, options) {
|
|
146
|
-
try {
|
|
147
|
-
return core.sync(path3, options || {});
|
|
148
|
-
} catch (er) {
|
|
149
|
-
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
150
|
-
return false;
|
|
151
|
-
} else {
|
|
152
|
-
throw er;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
__name(sync, "sync");
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// ../node_modules/which/which.js
|
|
161
|
-
var require_which = __commonJS({
|
|
162
|
-
"../node_modules/which/which.js"(exports, module) {
|
|
163
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
164
|
-
var path3 = __require("path");
|
|
165
|
-
var COLON = isWindows ? ";" : ":";
|
|
166
|
-
var isexe = require_isexe();
|
|
167
|
-
var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
|
|
168
|
-
var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
|
|
169
|
-
const colon = opt.colon || COLON;
|
|
170
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
171
|
-
// windows always checks the cwd first
|
|
172
|
-
...isWindows ? [process.cwd()] : [],
|
|
173
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
174
|
-
"").split(colon)
|
|
175
|
-
];
|
|
176
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
177
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
178
|
-
if (isWindows) {
|
|
179
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
180
|
-
pathExt.unshift("");
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
pathEnv,
|
|
184
|
-
pathExt,
|
|
185
|
-
pathExtExe
|
|
186
|
-
};
|
|
187
|
-
}, "getPathInfo");
|
|
188
|
-
var which = /* @__PURE__ */ __name((cmd, opt, cb) => {
|
|
189
|
-
if (typeof opt === "function") {
|
|
190
|
-
cb = opt;
|
|
191
|
-
opt = {};
|
|
192
|
-
}
|
|
193
|
-
if (!opt)
|
|
194
|
-
opt = {};
|
|
195
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
196
|
-
const found = [];
|
|
197
|
-
const step = /* @__PURE__ */ __name((i) => new Promise((resolve2, reject) => {
|
|
198
|
-
if (i === pathEnv.length)
|
|
199
|
-
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
200
|
-
const ppRaw = pathEnv[i];
|
|
201
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
202
|
-
const pCmd = path3.join(pathPart, cmd);
|
|
203
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
204
|
-
resolve2(subStep(p, i, 0));
|
|
205
|
-
}), "step");
|
|
206
|
-
const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve2, reject) => {
|
|
207
|
-
if (ii === pathExt.length)
|
|
208
|
-
return resolve2(step(i + 1));
|
|
209
|
-
const ext = pathExt[ii];
|
|
210
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
211
|
-
if (!er && is) {
|
|
212
|
-
if (opt.all)
|
|
213
|
-
found.push(p + ext);
|
|
214
|
-
else
|
|
215
|
-
return resolve2(p + ext);
|
|
216
|
-
}
|
|
217
|
-
return resolve2(subStep(p, i, ii + 1));
|
|
218
|
-
});
|
|
219
|
-
}), "subStep");
|
|
220
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
221
|
-
}, "which");
|
|
222
|
-
var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
|
|
223
|
-
opt = opt || {};
|
|
224
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
225
|
-
const found = [];
|
|
226
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
227
|
-
const ppRaw = pathEnv[i];
|
|
228
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
229
|
-
const pCmd = path3.join(pathPart, cmd);
|
|
230
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
231
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
232
|
-
const cur = p + pathExt[j];
|
|
233
|
-
try {
|
|
234
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
235
|
-
if (is) {
|
|
236
|
-
if (opt.all)
|
|
237
|
-
found.push(cur);
|
|
238
|
-
else
|
|
239
|
-
return cur;
|
|
240
|
-
}
|
|
241
|
-
} catch (ex) {
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (opt.all && found.length)
|
|
246
|
-
return found;
|
|
247
|
-
if (opt.nothrow)
|
|
248
|
-
return null;
|
|
249
|
-
throw getNotFoundError(cmd);
|
|
250
|
-
}, "whichSync");
|
|
251
|
-
module.exports = which;
|
|
252
|
-
which.sync = whichSync;
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
// ../node_modules/path-key/index.js
|
|
257
|
-
var require_path_key = __commonJS({
|
|
258
|
-
"../node_modules/path-key/index.js"(exports, module) {
|
|
259
|
-
"use strict";
|
|
260
|
-
var pathKey2 = /* @__PURE__ */ __name((options = {}) => {
|
|
261
|
-
const environment = options.env || process.env;
|
|
262
|
-
const platform = options.platform || process.platform;
|
|
263
|
-
if (platform !== "win32") {
|
|
264
|
-
return "PATH";
|
|
265
|
-
}
|
|
266
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
267
|
-
}, "pathKey");
|
|
268
|
-
module.exports = pathKey2;
|
|
269
|
-
module.exports.default = pathKey2;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// ../node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
274
|
-
var require_resolveCommand = __commonJS({
|
|
275
|
-
"../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
276
|
-
"use strict";
|
|
277
|
-
var path3 = __require("path");
|
|
278
|
-
var which = require_which();
|
|
279
|
-
var getPathKey = require_path_key();
|
|
280
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
281
|
-
const env = parsed.options.env || process.env;
|
|
282
|
-
const cwd = process.cwd();
|
|
283
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
284
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
285
|
-
if (shouldSwitchCwd) {
|
|
286
|
-
try {
|
|
287
|
-
process.chdir(parsed.options.cwd);
|
|
288
|
-
} catch (err) {
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
let resolved;
|
|
292
|
-
try {
|
|
293
|
-
resolved = which.sync(parsed.command, {
|
|
294
|
-
path: env[getPathKey({ env })],
|
|
295
|
-
pathExt: withoutPathExt ? path3.delimiter : void 0
|
|
296
|
-
});
|
|
297
|
-
} catch (e) {
|
|
298
|
-
} finally {
|
|
299
|
-
if (shouldSwitchCwd) {
|
|
300
|
-
process.chdir(cwd);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (resolved) {
|
|
304
|
-
resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
305
|
-
}
|
|
306
|
-
return resolved;
|
|
307
|
-
}
|
|
308
|
-
__name(resolveCommandAttempt, "resolveCommandAttempt");
|
|
309
|
-
function resolveCommand(parsed) {
|
|
310
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
311
|
-
}
|
|
312
|
-
__name(resolveCommand, "resolveCommand");
|
|
313
|
-
module.exports = resolveCommand;
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
// ../node_modules/cross-spawn/lib/util/escape.js
|
|
318
|
-
var require_escape = __commonJS({
|
|
319
|
-
"../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
320
|
-
"use strict";
|
|
321
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
322
|
-
function escapeCommand(arg) {
|
|
323
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
324
|
-
return arg;
|
|
325
|
-
}
|
|
326
|
-
__name(escapeCommand, "escapeCommand");
|
|
327
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
328
|
-
arg = `${arg}`;
|
|
329
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
330
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
331
|
-
arg = `"${arg}"`;
|
|
332
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
333
|
-
if (doubleEscapeMetaChars) {
|
|
334
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
335
|
-
}
|
|
336
|
-
return arg;
|
|
337
|
-
}
|
|
338
|
-
__name(escapeArgument, "escapeArgument");
|
|
339
|
-
module.exports.command = escapeCommand;
|
|
340
|
-
module.exports.argument = escapeArgument;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
// ../node_modules/shebang-regex/index.js
|
|
345
|
-
var require_shebang_regex = __commonJS({
|
|
346
|
-
"../node_modules/shebang-regex/index.js"(exports, module) {
|
|
347
|
-
"use strict";
|
|
348
|
-
module.exports = /^#!(.*)/;
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
// ../node_modules/shebang-command/index.js
|
|
353
|
-
var require_shebang_command = __commonJS({
|
|
354
|
-
"../node_modules/shebang-command/index.js"(exports, module) {
|
|
355
|
-
"use strict";
|
|
356
|
-
var shebangRegex = require_shebang_regex();
|
|
357
|
-
module.exports = (string = "") => {
|
|
358
|
-
const match = string.match(shebangRegex);
|
|
359
|
-
if (!match) {
|
|
360
|
-
return null;
|
|
361
|
-
}
|
|
362
|
-
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
363
|
-
const binary = path3.split("/").pop();
|
|
364
|
-
if (binary === "env") {
|
|
365
|
-
return argument;
|
|
366
|
-
}
|
|
367
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
// ../node_modules/cross-spawn/lib/util/readShebang.js
|
|
373
|
-
var require_readShebang = __commonJS({
|
|
374
|
-
"../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
375
|
-
"use strict";
|
|
376
|
-
var fs = __require("fs");
|
|
377
|
-
var shebangCommand = require_shebang_command();
|
|
378
|
-
function readShebang(command) {
|
|
379
|
-
const size = 150;
|
|
380
|
-
const buffer = Buffer.alloc(size);
|
|
381
|
-
let fd;
|
|
382
|
-
try {
|
|
383
|
-
fd = fs.openSync(command, "r");
|
|
384
|
-
fs.readSync(fd, buffer, 0, size, 0);
|
|
385
|
-
fs.closeSync(fd);
|
|
386
|
-
} catch (e) {
|
|
387
|
-
}
|
|
388
|
-
return shebangCommand(buffer.toString());
|
|
389
|
-
}
|
|
390
|
-
__name(readShebang, "readShebang");
|
|
391
|
-
module.exports = readShebang;
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
// ../node_modules/cross-spawn/lib/parse.js
|
|
396
|
-
var require_parse = __commonJS({
|
|
397
|
-
"../node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
398
|
-
"use strict";
|
|
399
|
-
var path3 = __require("path");
|
|
400
|
-
var resolveCommand = require_resolveCommand();
|
|
401
|
-
var escape = require_escape();
|
|
402
|
-
var readShebang = require_readShebang();
|
|
403
|
-
var isWin = process.platform === "win32";
|
|
404
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
405
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
406
|
-
function detectShebang(parsed) {
|
|
407
|
-
parsed.file = resolveCommand(parsed);
|
|
408
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
409
|
-
if (shebang) {
|
|
410
|
-
parsed.args.unshift(parsed.file);
|
|
411
|
-
parsed.command = shebang;
|
|
412
|
-
return resolveCommand(parsed);
|
|
413
|
-
}
|
|
414
|
-
return parsed.file;
|
|
415
|
-
}
|
|
416
|
-
__name(detectShebang, "detectShebang");
|
|
417
|
-
function parseNonShell(parsed) {
|
|
418
|
-
if (!isWin) {
|
|
419
|
-
return parsed;
|
|
420
|
-
}
|
|
421
|
-
const commandFile = detectShebang(parsed);
|
|
422
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
423
|
-
if (parsed.options.forceShell || needsShell) {
|
|
424
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
425
|
-
parsed.command = path3.normalize(parsed.command);
|
|
426
|
-
parsed.command = escape.command(parsed.command);
|
|
427
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
428
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
429
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
430
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
431
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
432
|
-
}
|
|
433
|
-
return parsed;
|
|
434
|
-
}
|
|
435
|
-
__name(parseNonShell, "parseNonShell");
|
|
436
|
-
function parse(command, args, options) {
|
|
437
|
-
if (args && !Array.isArray(args)) {
|
|
438
|
-
options = args;
|
|
439
|
-
args = null;
|
|
440
|
-
}
|
|
441
|
-
args = args ? args.slice(0) : [];
|
|
442
|
-
options = Object.assign({}, options);
|
|
443
|
-
const parsed = {
|
|
444
|
-
command,
|
|
445
|
-
args,
|
|
446
|
-
options,
|
|
447
|
-
file: void 0,
|
|
448
|
-
original: {
|
|
449
|
-
command,
|
|
450
|
-
args
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
454
|
-
}
|
|
455
|
-
__name(parse, "parse");
|
|
456
|
-
module.exports = parse;
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
// ../node_modules/cross-spawn/lib/enoent.js
|
|
461
|
-
var require_enoent = __commonJS({
|
|
462
|
-
"../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
463
|
-
"use strict";
|
|
464
|
-
var isWin = process.platform === "win32";
|
|
465
|
-
function notFoundError(original, syscall) {
|
|
466
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
467
|
-
code: "ENOENT",
|
|
468
|
-
errno: "ENOENT",
|
|
469
|
-
syscall: `${syscall} ${original.command}`,
|
|
470
|
-
path: original.command,
|
|
471
|
-
spawnargs: original.args
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
__name(notFoundError, "notFoundError");
|
|
475
|
-
function hookChildProcess(cp, parsed) {
|
|
476
|
-
if (!isWin) {
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
const originalEmit = cp.emit;
|
|
480
|
-
cp.emit = function(name, arg1) {
|
|
481
|
-
if (name === "exit") {
|
|
482
|
-
const err = verifyENOENT(arg1, parsed);
|
|
483
|
-
if (err) {
|
|
484
|
-
return originalEmit.call(cp, "error", err);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
return originalEmit.apply(cp, arguments);
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
__name(hookChildProcess, "hookChildProcess");
|
|
491
|
-
function verifyENOENT(status, parsed) {
|
|
492
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
493
|
-
return notFoundError(parsed.original, "spawn");
|
|
494
|
-
}
|
|
495
|
-
return null;
|
|
496
|
-
}
|
|
497
|
-
__name(verifyENOENT, "verifyENOENT");
|
|
498
|
-
function verifyENOENTSync(status, parsed) {
|
|
499
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
500
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
501
|
-
}
|
|
502
|
-
return null;
|
|
503
|
-
}
|
|
504
|
-
__name(verifyENOENTSync, "verifyENOENTSync");
|
|
505
|
-
module.exports = {
|
|
506
|
-
hookChildProcess,
|
|
507
|
-
verifyENOENT,
|
|
508
|
-
verifyENOENTSync,
|
|
509
|
-
notFoundError
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
// ../node_modules/cross-spawn/index.js
|
|
515
|
-
var require_cross_spawn = __commonJS({
|
|
516
|
-
"../node_modules/cross-spawn/index.js"(exports, module) {
|
|
517
|
-
"use strict";
|
|
518
|
-
var cp = __require("child_process");
|
|
519
|
-
var parse = require_parse();
|
|
520
|
-
var enoent = require_enoent();
|
|
521
|
-
function spawn(command, args, options) {
|
|
522
|
-
const parsed = parse(command, args, options);
|
|
523
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
524
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
525
|
-
return spawned;
|
|
526
|
-
}
|
|
527
|
-
__name(spawn, "spawn");
|
|
528
|
-
function spawnSync(command, args, options) {
|
|
529
|
-
const parsed = parse(command, args, options);
|
|
530
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
531
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
532
|
-
return result;
|
|
533
|
-
}
|
|
534
|
-
__name(spawnSync, "spawnSync");
|
|
535
|
-
module.exports = spawn;
|
|
536
|
-
module.exports.spawn = spawn;
|
|
537
|
-
module.exports.sync = spawnSync;
|
|
538
|
-
module.exports._parse = parse;
|
|
539
|
-
module.exports._enoent = enoent;
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
// ../node_modules/merge-stream/index.js
|
|
544
|
-
var require_merge_stream = __commonJS({
|
|
545
|
-
"../node_modules/merge-stream/index.js"(exports, module) {
|
|
546
|
-
"use strict";
|
|
547
|
-
var { PassThrough } = __require("stream");
|
|
548
|
-
module.exports = function() {
|
|
549
|
-
var sources = [];
|
|
550
|
-
var output = new PassThrough({ objectMode: true });
|
|
551
|
-
output.setMaxListeners(0);
|
|
552
|
-
output.add = add;
|
|
553
|
-
output.isEmpty = isEmpty;
|
|
554
|
-
output.on("unpipe", remove);
|
|
555
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
556
|
-
return output;
|
|
557
|
-
function add(source) {
|
|
558
|
-
if (Array.isArray(source)) {
|
|
559
|
-
source.forEach(add);
|
|
560
|
-
return this;
|
|
561
|
-
}
|
|
562
|
-
sources.push(source);
|
|
563
|
-
source.once("end", remove.bind(null, source));
|
|
564
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
565
|
-
source.pipe(output, { end: false });
|
|
566
|
-
return this;
|
|
567
|
-
}
|
|
568
|
-
__name(add, "add");
|
|
569
|
-
function isEmpty() {
|
|
570
|
-
return sources.length == 0;
|
|
571
|
-
}
|
|
572
|
-
__name(isEmpty, "isEmpty");
|
|
573
|
-
function remove(source) {
|
|
574
|
-
sources = sources.filter(function(it) {
|
|
575
|
-
return it !== source;
|
|
576
|
-
});
|
|
577
|
-
if (!sources.length && output.readable) {
|
|
578
|
-
output.end();
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
__name(remove, "remove");
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
// src/common/utils/paths.ts
|
|
587
|
-
import { join, relative, resolve, sep } from "node:path";
|
|
588
|
-
|
|
589
|
-
// src/common/js-package-manager/constants.ts
|
|
590
|
-
var NPM_LOCKFILE = "package-lock.json";
|
|
591
|
-
var PNPM_LOCKFILE = "pnpm-lock.yaml";
|
|
592
|
-
var YARN_LOCKFILE = "yarn.lock";
|
|
593
|
-
var BUN_LOCKFILE = "bun.lock";
|
|
594
|
-
var BUN_LOCKFILE_BINARY = "bun.lockb";
|
|
595
|
-
var LOCK_FILES = [
|
|
596
|
-
NPM_LOCKFILE,
|
|
597
|
-
PNPM_LOCKFILE,
|
|
598
|
-
YARN_LOCKFILE,
|
|
599
|
-
BUN_LOCKFILE,
|
|
600
|
-
BUN_LOCKFILE_BINARY
|
|
601
|
-
];
|
|
602
|
-
|
|
603
|
-
// src/common/utils/paths.ts
|
|
604
|
-
var projectRoot;
|
|
605
|
-
var getProjectRoot = /* @__PURE__ */ __name(() => {
|
|
606
|
-
if (projectRoot) {
|
|
607
|
-
return projectRoot;
|
|
608
|
-
}
|
|
609
|
-
if (process.env.STORYBOOK_PROJECT_ROOT) {
|
|
610
|
-
return process.env.STORYBOOK_PROJECT_ROOT;
|
|
611
|
-
}
|
|
612
|
-
try {
|
|
613
|
-
const found = findUpSync(".git", { type: "directory" }) || findUpSync(".svn", { type: "directory" }) || findUpSync(".hg", { type: "directory" });
|
|
614
|
-
if (found) {
|
|
615
|
-
projectRoot = join(found, "..");
|
|
616
|
-
return projectRoot;
|
|
617
|
-
}
|
|
618
|
-
} catch (e) {
|
|
619
|
-
process.stdout.write(`
|
|
620
|
-
error searching for repository root: ${e}
|
|
621
|
-
`);
|
|
622
|
-
}
|
|
623
|
-
try {
|
|
624
|
-
const found = findUpSync(LOCK_FILES, { type: "file" });
|
|
625
|
-
if (found) {
|
|
626
|
-
projectRoot = join(found, "..");
|
|
627
|
-
return projectRoot;
|
|
628
|
-
}
|
|
629
|
-
} catch (e) {
|
|
630
|
-
process.stdout.write(`
|
|
631
|
-
error searching for lock file: ${e}
|
|
632
|
-
`);
|
|
633
|
-
}
|
|
634
|
-
try {
|
|
635
|
-
const [basePath, rest] = __dirname.split(`${sep}node_modules${sep}`, 2);
|
|
636
|
-
if (rest && !basePath.includes(`${sep}npm-cache${sep}`) && !relative(basePath, process.cwd()).startsWith("..")) {
|
|
637
|
-
projectRoot = basePath;
|
|
638
|
-
return projectRoot;
|
|
639
|
-
}
|
|
640
|
-
} catch (e) {
|
|
641
|
-
process.stdout.write(`
|
|
642
|
-
error searching for splitDirname: ${e}
|
|
643
|
-
`);
|
|
644
|
-
}
|
|
645
|
-
projectRoot = process.cwd();
|
|
646
|
-
return projectRoot;
|
|
647
|
-
}, "getProjectRoot");
|
|
648
|
-
var invalidateProjectRootCache = /* @__PURE__ */ __name(() => {
|
|
649
|
-
projectRoot = void 0;
|
|
650
|
-
}, "invalidateProjectRootCache");
|
|
651
|
-
var nodePathsToArray = /* @__PURE__ */ __name((nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) => resolve("./", p)), "nodePathsToArray");
|
|
652
|
-
var relativePattern = /^\.{1,2}([/\\]|$)/;
|
|
653
|
-
function normalizeStoryPath(filename) {
|
|
654
|
-
if (relativePattern.test(filename)) {
|
|
655
|
-
return filename;
|
|
656
|
-
}
|
|
657
|
-
return `.${sep}${filename}`;
|
|
658
|
-
}
|
|
659
|
-
__name(normalizeStoryPath, "normalizeStoryPath");
|
|
660
|
-
|
|
661
|
-
// src/common/utils/envs.ts
|
|
662
|
-
async function loadEnvs(options = {}) {
|
|
663
|
-
const { getEnvironment } = await import("./lib-DJHADRPZ.js");
|
|
664
|
-
const defaultNodeEnv = options.production ? "production" : "development";
|
|
665
|
-
const env = {
|
|
666
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
667
|
-
NODE_ENV: process.env.NODE_ENV || defaultNodeEnv,
|
|
668
|
-
NODE_PATH: process.env["NODE_PATH"] || "",
|
|
669
|
-
STORYBOOK: process.env["STORYBOOK"] || "true",
|
|
670
|
-
// This is to support CRA's public folder feature.
|
|
671
|
-
// In production we set this to dot(.) to allow the browser to access these assets
|
|
672
|
-
// even when deployed inside a subpath. (like in GitHub pages)
|
|
673
|
-
// In development this is just empty as we always serves from the root.
|
|
674
|
-
PUBLIC_URL: options.production ? "." : ""
|
|
675
|
-
};
|
|
676
|
-
Object.keys(process.env).filter((name) => /^STORYBOOK_/.test(name)).forEach((name) => {
|
|
677
|
-
env[name] = process.env[name];
|
|
678
|
-
});
|
|
679
|
-
const base = Object.entries(env).reduce(
|
|
680
|
-
(acc, [k, v]) => Object.assign(acc, { [k]: JSON.stringify(v) }),
|
|
681
|
-
{}
|
|
682
|
-
);
|
|
683
|
-
const { stringified, raw } = getEnvironment({ nodeEnv: env["NODE_ENV"] });
|
|
684
|
-
const fullRaw = { ...env, ...raw };
|
|
685
|
-
fullRaw.NODE_PATH = nodePathsToArray(fullRaw.NODE_PATH || "");
|
|
686
|
-
return {
|
|
687
|
-
stringified: { ...base, ...stringified },
|
|
688
|
-
raw: fullRaw
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
__name(loadEnvs, "loadEnvs");
|
|
692
|
-
var stringifyEnvs = /* @__PURE__ */ __name((raw) => Object.entries(raw).reduce((acc, [key, value]) => {
|
|
693
|
-
acc[key] = JSON.stringify(value);
|
|
694
|
-
return acc;
|
|
695
|
-
}, {}), "stringifyEnvs");
|
|
696
|
-
var stringifyProcessEnvs = /* @__PURE__ */ __name((raw) => {
|
|
697
|
-
const envs = Object.entries(raw).reduce((acc, [key, value]) => {
|
|
698
|
-
acc[`process.env.${key}`] = JSON.stringify(value);
|
|
699
|
-
return acc;
|
|
700
|
-
}, {});
|
|
701
|
-
return envs;
|
|
702
|
-
}, "stringifyProcessEnvs");
|
|
703
|
-
var optionalEnvToBoolean = /* @__PURE__ */ __name((input) => {
|
|
704
|
-
if (input === void 0) {
|
|
705
|
-
return void 0;
|
|
706
|
-
}
|
|
707
|
-
if (input.toUpperCase() === "FALSE" || input === "0") {
|
|
708
|
-
return false;
|
|
709
|
-
}
|
|
710
|
-
if (input.toUpperCase() === "TRUE" || input === "1") {
|
|
711
|
-
return true;
|
|
712
|
-
}
|
|
713
|
-
return Boolean(input);
|
|
714
|
-
}, "optionalEnvToBoolean");
|
|
715
|
-
function isCI() {
|
|
716
|
-
return optionalEnvToBoolean(process.env.CI);
|
|
717
|
-
}
|
|
718
|
-
__name(isCI, "isCI");
|
|
719
|
-
|
|
720
|
-
// node_modules/execa/index.js
|
|
721
|
-
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
722
|
-
import { Buffer as Buffer3 } from "node:buffer";
|
|
723
|
-
import path2 from "node:path";
|
|
724
|
-
import childProcess from "node:child_process";
|
|
725
|
-
import process6 from "node:process";
|
|
726
|
-
|
|
727
|
-
// ../node_modules/strip-final-newline/index.js
|
|
728
|
-
function stripFinalNewline(input) {
|
|
729
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
730
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
731
|
-
if (input[input.length - 1] === LF) {
|
|
732
|
-
input = input.slice(0, -1);
|
|
733
|
-
}
|
|
734
|
-
if (input[input.length - 1] === CR) {
|
|
735
|
-
input = input.slice(0, -1);
|
|
736
|
-
}
|
|
737
|
-
return input;
|
|
738
|
-
}
|
|
739
|
-
__name(stripFinalNewline, "stripFinalNewline");
|
|
740
|
-
|
|
741
|
-
// node_modules/npm-run-path/index.js
|
|
742
|
-
import process2 from "node:process";
|
|
743
|
-
import path from "node:path";
|
|
744
|
-
import { fileURLToPath } from "node:url";
|
|
745
|
-
|
|
746
|
-
// node_modules/path-key/index.js
|
|
747
|
-
function pathKey(options = {}) {
|
|
748
|
-
const {
|
|
749
|
-
env = process.env,
|
|
750
|
-
platform = process.platform
|
|
751
|
-
} = options;
|
|
752
|
-
if (platform !== "win32") {
|
|
753
|
-
return "PATH";
|
|
754
|
-
}
|
|
755
|
-
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
756
|
-
}
|
|
757
|
-
__name(pathKey, "pathKey");
|
|
758
|
-
|
|
759
|
-
// node_modules/npm-run-path/index.js
|
|
760
|
-
var npmRunPath = /* @__PURE__ */ __name(({
|
|
761
|
-
cwd = process2.cwd(),
|
|
762
|
-
path: pathOption = process2.env[pathKey()],
|
|
763
|
-
preferLocal = true,
|
|
764
|
-
execPath = process2.execPath,
|
|
765
|
-
addExecPath = true
|
|
766
|
-
} = {}) => {
|
|
767
|
-
const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
|
|
768
|
-
const cwdPath = path.resolve(cwdString);
|
|
769
|
-
const result = [];
|
|
770
|
-
if (preferLocal) {
|
|
771
|
-
applyPreferLocal(result, cwdPath);
|
|
772
|
-
}
|
|
773
|
-
if (addExecPath) {
|
|
774
|
-
applyExecPath(result, execPath, cwdPath);
|
|
775
|
-
}
|
|
776
|
-
return [...result, pathOption].join(path.delimiter);
|
|
777
|
-
}, "npmRunPath");
|
|
778
|
-
var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
|
|
779
|
-
let previous;
|
|
780
|
-
while (previous !== cwdPath) {
|
|
781
|
-
result.push(path.join(cwdPath, "node_modules/.bin"));
|
|
782
|
-
previous = cwdPath;
|
|
783
|
-
cwdPath = path.resolve(cwdPath, "..");
|
|
784
|
-
}
|
|
785
|
-
}, "applyPreferLocal");
|
|
786
|
-
var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
|
|
787
|
-
const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
|
|
788
|
-
result.push(path.resolve(cwdPath, execPathString, ".."));
|
|
789
|
-
}, "applyExecPath");
|
|
790
|
-
var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
|
|
791
|
-
env = { ...env };
|
|
792
|
-
const pathName = pathKey({ env });
|
|
793
|
-
options.path = env[pathName];
|
|
794
|
-
env[pathName] = npmRunPath(options);
|
|
795
|
-
return env;
|
|
796
|
-
}, "npmRunPathEnv");
|
|
797
|
-
|
|
798
|
-
// node_modules/mimic-fn/index.js
|
|
799
|
-
var copyProperty = /* @__PURE__ */ __name((to, from, property, ignoreNonConfigurable) => {
|
|
800
|
-
if (property === "length" || property === "prototype") {
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
if (property === "arguments" || property === "caller") {
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
807
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
808
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
Object.defineProperty(to, property, fromDescriptor);
|
|
812
|
-
}, "copyProperty");
|
|
813
|
-
var canCopyProperty = /* @__PURE__ */ __name(function(toDescriptor, fromDescriptor) {
|
|
814
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
815
|
-
}, "canCopyProperty");
|
|
816
|
-
var changePrototype = /* @__PURE__ */ __name((to, from) => {
|
|
817
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
818
|
-
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
822
|
-
}, "changePrototype");
|
|
823
|
-
var wrappedToString = /* @__PURE__ */ __name((withName, fromBody) => `/* Wrapped ${withName}*/
|
|
824
|
-
${fromBody}`, "wrappedToString");
|
|
825
|
-
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
826
|
-
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
827
|
-
var changeToString = /* @__PURE__ */ __name((to, from, name) => {
|
|
828
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
829
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
830
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
831
|
-
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
832
|
-
}, "changeToString");
|
|
833
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
834
|
-
const { name } = to;
|
|
835
|
-
for (const property of Reflect.ownKeys(from)) {
|
|
836
|
-
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
837
|
-
}
|
|
838
|
-
changePrototype(to, from);
|
|
839
|
-
changeToString(to, from, name);
|
|
840
|
-
return to;
|
|
841
|
-
}
|
|
842
|
-
__name(mimicFunction, "mimicFunction");
|
|
843
|
-
|
|
844
|
-
// node_modules/onetime/index.js
|
|
845
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
846
|
-
var onetime = /* @__PURE__ */ __name((function_, options = {}) => {
|
|
847
|
-
if (typeof function_ !== "function") {
|
|
848
|
-
throw new TypeError("Expected a function");
|
|
849
|
-
}
|
|
850
|
-
let returnValue;
|
|
851
|
-
let callCount = 0;
|
|
852
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
853
|
-
const onetime2 = /* @__PURE__ */ __name(function(...arguments_) {
|
|
854
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
855
|
-
if (callCount === 1) {
|
|
856
|
-
returnValue = function_.apply(this, arguments_);
|
|
857
|
-
function_ = null;
|
|
858
|
-
} else if (options.throw === true) {
|
|
859
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
860
|
-
}
|
|
861
|
-
return returnValue;
|
|
862
|
-
}, "onetime");
|
|
863
|
-
mimicFunction(onetime2, function_);
|
|
864
|
-
calledFunctions.set(onetime2, callCount);
|
|
865
|
-
return onetime2;
|
|
866
|
-
}, "onetime");
|
|
867
|
-
onetime.callCount = (function_) => {
|
|
868
|
-
if (!calledFunctions.has(function_)) {
|
|
869
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
870
|
-
}
|
|
871
|
-
return calledFunctions.get(function_);
|
|
872
|
-
};
|
|
873
|
-
var onetime_default = onetime;
|
|
874
|
-
|
|
875
|
-
// node_modules/execa/lib/error.js
|
|
876
|
-
import process3 from "node:process";
|
|
877
|
-
|
|
878
|
-
// node_modules/human-signals/build/src/main.js
|
|
879
|
-
import { constants as constants2 } from "node:os";
|
|
880
|
-
|
|
881
|
-
// node_modules/human-signals/build/src/realtime.js
|
|
882
|
-
var getRealtimeSignals = /* @__PURE__ */ __name(() => {
|
|
883
|
-
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
884
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
885
|
-
}, "getRealtimeSignals");
|
|
886
|
-
var getRealtimeSignal = /* @__PURE__ */ __name((value, index) => ({
|
|
887
|
-
name: `SIGRT${index + 1}`,
|
|
888
|
-
number: SIGRTMIN + index,
|
|
889
|
-
action: "terminate",
|
|
890
|
-
description: "Application-specific signal (realtime)",
|
|
891
|
-
standard: "posix"
|
|
892
|
-
}), "getRealtimeSignal");
|
|
893
|
-
var SIGRTMIN = 34;
|
|
894
|
-
var SIGRTMAX = 64;
|
|
895
|
-
|
|
896
|
-
// node_modules/human-signals/build/src/signals.js
|
|
897
|
-
import { constants } from "node:os";
|
|
898
|
-
|
|
899
|
-
// node_modules/human-signals/build/src/core.js
|
|
900
|
-
var SIGNALS = [
|
|
901
|
-
{
|
|
902
|
-
name: "SIGHUP",
|
|
903
|
-
number: 1,
|
|
904
|
-
action: "terminate",
|
|
905
|
-
description: "Terminal closed",
|
|
906
|
-
standard: "posix"
|
|
907
|
-
},
|
|
908
|
-
{
|
|
909
|
-
name: "SIGINT",
|
|
910
|
-
number: 2,
|
|
911
|
-
action: "terminate",
|
|
912
|
-
description: "User interruption with CTRL-C",
|
|
913
|
-
standard: "ansi"
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
name: "SIGQUIT",
|
|
917
|
-
number: 3,
|
|
918
|
-
action: "core",
|
|
919
|
-
description: "User interruption with CTRL-\\",
|
|
920
|
-
standard: "posix"
|
|
921
|
-
},
|
|
922
|
-
{
|
|
923
|
-
name: "SIGILL",
|
|
924
|
-
number: 4,
|
|
925
|
-
action: "core",
|
|
926
|
-
description: "Invalid machine instruction",
|
|
927
|
-
standard: "ansi"
|
|
928
|
-
},
|
|
929
|
-
{
|
|
930
|
-
name: "SIGTRAP",
|
|
931
|
-
number: 5,
|
|
932
|
-
action: "core",
|
|
933
|
-
description: "Debugger breakpoint",
|
|
934
|
-
standard: "posix"
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
name: "SIGABRT",
|
|
938
|
-
number: 6,
|
|
939
|
-
action: "core",
|
|
940
|
-
description: "Aborted",
|
|
941
|
-
standard: "ansi"
|
|
942
|
-
},
|
|
943
|
-
{
|
|
944
|
-
name: "SIGIOT",
|
|
945
|
-
number: 6,
|
|
946
|
-
action: "core",
|
|
947
|
-
description: "Aborted",
|
|
948
|
-
standard: "bsd"
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
name: "SIGBUS",
|
|
952
|
-
number: 7,
|
|
953
|
-
action: "core",
|
|
954
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
955
|
-
standard: "bsd"
|
|
956
|
-
},
|
|
957
|
-
{
|
|
958
|
-
name: "SIGEMT",
|
|
959
|
-
number: 7,
|
|
960
|
-
action: "terminate",
|
|
961
|
-
description: "Command should be emulated but is not implemented",
|
|
962
|
-
standard: "other"
|
|
963
|
-
},
|
|
964
|
-
{
|
|
965
|
-
name: "SIGFPE",
|
|
966
|
-
number: 8,
|
|
967
|
-
action: "core",
|
|
968
|
-
description: "Floating point arithmetic error",
|
|
969
|
-
standard: "ansi"
|
|
970
|
-
},
|
|
971
|
-
{
|
|
972
|
-
name: "SIGKILL",
|
|
973
|
-
number: 9,
|
|
974
|
-
action: "terminate",
|
|
975
|
-
description: "Forced termination",
|
|
976
|
-
standard: "posix",
|
|
977
|
-
forced: true
|
|
978
|
-
},
|
|
979
|
-
{
|
|
980
|
-
name: "SIGUSR1",
|
|
981
|
-
number: 10,
|
|
982
|
-
action: "terminate",
|
|
983
|
-
description: "Application-specific signal",
|
|
984
|
-
standard: "posix"
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
name: "SIGSEGV",
|
|
988
|
-
number: 11,
|
|
989
|
-
action: "core",
|
|
990
|
-
description: "Segmentation fault",
|
|
991
|
-
standard: "ansi"
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
name: "SIGUSR2",
|
|
995
|
-
number: 12,
|
|
996
|
-
action: "terminate",
|
|
997
|
-
description: "Application-specific signal",
|
|
998
|
-
standard: "posix"
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
name: "SIGPIPE",
|
|
1002
|
-
number: 13,
|
|
1003
|
-
action: "terminate",
|
|
1004
|
-
description: "Broken pipe or socket",
|
|
1005
|
-
standard: "posix"
|
|
1006
|
-
},
|
|
1007
|
-
{
|
|
1008
|
-
name: "SIGALRM",
|
|
1009
|
-
number: 14,
|
|
1010
|
-
action: "terminate",
|
|
1011
|
-
description: "Timeout or timer",
|
|
1012
|
-
standard: "posix"
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
name: "SIGTERM",
|
|
1016
|
-
number: 15,
|
|
1017
|
-
action: "terminate",
|
|
1018
|
-
description: "Termination",
|
|
1019
|
-
standard: "ansi"
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
name: "SIGSTKFLT",
|
|
1023
|
-
number: 16,
|
|
1024
|
-
action: "terminate",
|
|
1025
|
-
description: "Stack is empty or overflowed",
|
|
1026
|
-
standard: "other"
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
name: "SIGCHLD",
|
|
1030
|
-
number: 17,
|
|
1031
|
-
action: "ignore",
|
|
1032
|
-
description: "Child process terminated, paused or unpaused",
|
|
1033
|
-
standard: "posix"
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
name: "SIGCLD",
|
|
1037
|
-
number: 17,
|
|
1038
|
-
action: "ignore",
|
|
1039
|
-
description: "Child process terminated, paused or unpaused",
|
|
1040
|
-
standard: "other"
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
name: "SIGCONT",
|
|
1044
|
-
number: 18,
|
|
1045
|
-
action: "unpause",
|
|
1046
|
-
description: "Unpaused",
|
|
1047
|
-
standard: "posix",
|
|
1048
|
-
forced: true
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
name: "SIGSTOP",
|
|
1052
|
-
number: 19,
|
|
1053
|
-
action: "pause",
|
|
1054
|
-
description: "Paused",
|
|
1055
|
-
standard: "posix",
|
|
1056
|
-
forced: true
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
name: "SIGTSTP",
|
|
1060
|
-
number: 20,
|
|
1061
|
-
action: "pause",
|
|
1062
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
1063
|
-
standard: "posix"
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
name: "SIGTTIN",
|
|
1067
|
-
number: 21,
|
|
1068
|
-
action: "pause",
|
|
1069
|
-
description: "Background process cannot read terminal input",
|
|
1070
|
-
standard: "posix"
|
|
1071
|
-
},
|
|
1072
|
-
{
|
|
1073
|
-
name: "SIGBREAK",
|
|
1074
|
-
number: 21,
|
|
1075
|
-
action: "terminate",
|
|
1076
|
-
description: "User interruption with CTRL-BREAK",
|
|
1077
|
-
standard: "other"
|
|
1078
|
-
},
|
|
1079
|
-
{
|
|
1080
|
-
name: "SIGTTOU",
|
|
1081
|
-
number: 22,
|
|
1082
|
-
action: "pause",
|
|
1083
|
-
description: "Background process cannot write to terminal output",
|
|
1084
|
-
standard: "posix"
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
name: "SIGURG",
|
|
1088
|
-
number: 23,
|
|
1089
|
-
action: "ignore",
|
|
1090
|
-
description: "Socket received out-of-band data",
|
|
1091
|
-
standard: "bsd"
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
name: "SIGXCPU",
|
|
1095
|
-
number: 24,
|
|
1096
|
-
action: "core",
|
|
1097
|
-
description: "Process timed out",
|
|
1098
|
-
standard: "bsd"
|
|
1099
|
-
},
|
|
1100
|
-
{
|
|
1101
|
-
name: "SIGXFSZ",
|
|
1102
|
-
number: 25,
|
|
1103
|
-
action: "core",
|
|
1104
|
-
description: "File too big",
|
|
1105
|
-
standard: "bsd"
|
|
1106
|
-
},
|
|
1107
|
-
{
|
|
1108
|
-
name: "SIGVTALRM",
|
|
1109
|
-
number: 26,
|
|
1110
|
-
action: "terminate",
|
|
1111
|
-
description: "Timeout or timer",
|
|
1112
|
-
standard: "bsd"
|
|
1113
|
-
},
|
|
1114
|
-
{
|
|
1115
|
-
name: "SIGPROF",
|
|
1116
|
-
number: 27,
|
|
1117
|
-
action: "terminate",
|
|
1118
|
-
description: "Timeout or timer",
|
|
1119
|
-
standard: "bsd"
|
|
1120
|
-
},
|
|
1121
|
-
{
|
|
1122
|
-
name: "SIGWINCH",
|
|
1123
|
-
number: 28,
|
|
1124
|
-
action: "ignore",
|
|
1125
|
-
description: "Terminal window size changed",
|
|
1126
|
-
standard: "bsd"
|
|
1127
|
-
},
|
|
1128
|
-
{
|
|
1129
|
-
name: "SIGIO",
|
|
1130
|
-
number: 29,
|
|
1131
|
-
action: "terminate",
|
|
1132
|
-
description: "I/O is available",
|
|
1133
|
-
standard: "other"
|
|
1134
|
-
},
|
|
1135
|
-
{
|
|
1136
|
-
name: "SIGPOLL",
|
|
1137
|
-
number: 29,
|
|
1138
|
-
action: "terminate",
|
|
1139
|
-
description: "Watched event",
|
|
1140
|
-
standard: "other"
|
|
1141
|
-
},
|
|
1142
|
-
{
|
|
1143
|
-
name: "SIGINFO",
|
|
1144
|
-
number: 29,
|
|
1145
|
-
action: "ignore",
|
|
1146
|
-
description: "Request for process information",
|
|
1147
|
-
standard: "other"
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
name: "SIGPWR",
|
|
1151
|
-
number: 30,
|
|
1152
|
-
action: "terminate",
|
|
1153
|
-
description: "Device running out of power",
|
|
1154
|
-
standard: "systemv"
|
|
1155
|
-
},
|
|
1156
|
-
{
|
|
1157
|
-
name: "SIGSYS",
|
|
1158
|
-
number: 31,
|
|
1159
|
-
action: "core",
|
|
1160
|
-
description: "Invalid system call",
|
|
1161
|
-
standard: "other"
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
name: "SIGUNUSED",
|
|
1165
|
-
number: 31,
|
|
1166
|
-
action: "terminate",
|
|
1167
|
-
description: "Invalid system call",
|
|
1168
|
-
standard: "other"
|
|
1169
|
-
}
|
|
1170
|
-
];
|
|
1171
|
-
|
|
1172
|
-
// node_modules/human-signals/build/src/signals.js
|
|
1173
|
-
var getSignals = /* @__PURE__ */ __name(() => {
|
|
1174
|
-
const realtimeSignals = getRealtimeSignals();
|
|
1175
|
-
const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
1176
|
-
return signals2;
|
|
1177
|
-
}, "getSignals");
|
|
1178
|
-
var normalizeSignal = /* @__PURE__ */ __name(({
|
|
1179
|
-
name,
|
|
1180
|
-
number: defaultNumber,
|
|
1181
|
-
description,
|
|
1182
|
-
action,
|
|
1183
|
-
forced = false,
|
|
1184
|
-
standard
|
|
1185
|
-
}) => {
|
|
1186
|
-
const {
|
|
1187
|
-
signals: { [name]: constantSignal }
|
|
1188
|
-
} = constants;
|
|
1189
|
-
const supported = constantSignal !== void 0;
|
|
1190
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
1191
|
-
return { name, number, description, supported, action, forced, standard };
|
|
1192
|
-
}, "normalizeSignal");
|
|
1193
|
-
|
|
1194
|
-
// node_modules/human-signals/build/src/main.js
|
|
1195
|
-
var getSignalsByName = /* @__PURE__ */ __name(() => {
|
|
1196
|
-
const signals2 = getSignals();
|
|
1197
|
-
return Object.fromEntries(signals2.map(getSignalByName));
|
|
1198
|
-
}, "getSignalsByName");
|
|
1199
|
-
var getSignalByName = /* @__PURE__ */ __name(({
|
|
1200
|
-
name,
|
|
1201
|
-
number,
|
|
1202
|
-
description,
|
|
1203
|
-
supported,
|
|
1204
|
-
action,
|
|
1205
|
-
forced,
|
|
1206
|
-
standard
|
|
1207
|
-
}) => [name, { name, number, description, supported, action, forced, standard }], "getSignalByName");
|
|
1208
|
-
var signalsByName = getSignalsByName();
|
|
1209
|
-
var getSignalsByNumber = /* @__PURE__ */ __name(() => {
|
|
1210
|
-
const signals2 = getSignals();
|
|
1211
|
-
const length = SIGRTMAX + 1;
|
|
1212
|
-
const signalsA = Array.from(
|
|
1213
|
-
{ length },
|
|
1214
|
-
(value, number) => getSignalByNumber(number, signals2)
|
|
1215
|
-
);
|
|
1216
|
-
return Object.assign({}, ...signalsA);
|
|
1217
|
-
}, "getSignalsByNumber");
|
|
1218
|
-
var getSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
|
|
1219
|
-
const signal = findSignalByNumber(number, signals2);
|
|
1220
|
-
if (signal === void 0) {
|
|
1221
|
-
return {};
|
|
1222
|
-
}
|
|
1223
|
-
const { name, description, supported, action, forced, standard } = signal;
|
|
1224
|
-
return {
|
|
1225
|
-
[number]: {
|
|
1226
|
-
name,
|
|
1227
|
-
number,
|
|
1228
|
-
description,
|
|
1229
|
-
supported,
|
|
1230
|
-
action,
|
|
1231
|
-
forced,
|
|
1232
|
-
standard
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
}, "getSignalByNumber");
|
|
1236
|
-
var findSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
|
|
1237
|
-
const signal = signals2.find(({ name }) => constants2.signals[name] === number);
|
|
1238
|
-
if (signal !== void 0) {
|
|
1239
|
-
return signal;
|
|
1240
|
-
}
|
|
1241
|
-
return signals2.find((signalA) => signalA.number === number);
|
|
1242
|
-
}, "findSignalByNumber");
|
|
1243
|
-
var signalsByNumber = getSignalsByNumber();
|
|
1244
|
-
|
|
1245
|
-
// node_modules/execa/lib/error.js
|
|
1246
|
-
var getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
|
|
1247
|
-
if (timedOut) {
|
|
1248
|
-
return `timed out after ${timeout} milliseconds`;
|
|
1249
|
-
}
|
|
1250
|
-
if (isCanceled) {
|
|
1251
|
-
return "was canceled";
|
|
1252
|
-
}
|
|
1253
|
-
if (errorCode !== void 0) {
|
|
1254
|
-
return `failed with ${errorCode}`;
|
|
1255
|
-
}
|
|
1256
|
-
if (signal !== void 0) {
|
|
1257
|
-
return `was killed with ${signal} (${signalDescription})`;
|
|
1258
|
-
}
|
|
1259
|
-
if (exitCode !== void 0) {
|
|
1260
|
-
return `failed with exit code ${exitCode}`;
|
|
1261
|
-
}
|
|
1262
|
-
return "failed";
|
|
1263
|
-
}, "getErrorPrefix");
|
|
1264
|
-
var makeError = /* @__PURE__ */ __name(({
|
|
1265
|
-
stdout,
|
|
1266
|
-
stderr,
|
|
1267
|
-
all,
|
|
1268
|
-
error,
|
|
1269
|
-
signal,
|
|
1270
|
-
exitCode,
|
|
1271
|
-
command,
|
|
1272
|
-
escapedCommand,
|
|
1273
|
-
timedOut,
|
|
1274
|
-
isCanceled,
|
|
1275
|
-
killed,
|
|
1276
|
-
parsed: { options: { timeout, cwd = process3.cwd() } }
|
|
1277
|
-
}) => {
|
|
1278
|
-
exitCode = exitCode === null ? void 0 : exitCode;
|
|
1279
|
-
signal = signal === null ? void 0 : signal;
|
|
1280
|
-
const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
|
|
1281
|
-
const errorCode = error && error.code;
|
|
1282
|
-
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
1283
|
-
const execaMessage = `Command ${prefix}: ${command}`;
|
|
1284
|
-
const isError = Object.prototype.toString.call(error) === "[object Error]";
|
|
1285
|
-
const shortMessage = isError ? `${execaMessage}
|
|
1286
|
-
${error.message}` : execaMessage;
|
|
1287
|
-
const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
|
|
1288
|
-
if (isError) {
|
|
1289
|
-
error.originalMessage = error.message;
|
|
1290
|
-
error.message = message;
|
|
1291
|
-
} else {
|
|
1292
|
-
error = new Error(message);
|
|
1293
|
-
}
|
|
1294
|
-
error.shortMessage = shortMessage;
|
|
1295
|
-
error.command = command;
|
|
1296
|
-
error.escapedCommand = escapedCommand;
|
|
1297
|
-
error.exitCode = exitCode;
|
|
1298
|
-
error.signal = signal;
|
|
1299
|
-
error.signalDescription = signalDescription;
|
|
1300
|
-
error.stdout = stdout;
|
|
1301
|
-
error.stderr = stderr;
|
|
1302
|
-
error.cwd = cwd;
|
|
1303
|
-
if (all !== void 0) {
|
|
1304
|
-
error.all = all;
|
|
1305
|
-
}
|
|
1306
|
-
if ("bufferedData" in error) {
|
|
1307
|
-
delete error.bufferedData;
|
|
1308
|
-
}
|
|
1309
|
-
error.failed = true;
|
|
1310
|
-
error.timedOut = Boolean(timedOut);
|
|
1311
|
-
error.isCanceled = isCanceled;
|
|
1312
|
-
error.killed = killed && !timedOut;
|
|
1313
|
-
return error;
|
|
1314
|
-
}, "makeError");
|
|
1315
|
-
|
|
1316
|
-
// node_modules/execa/lib/stdio.js
|
|
1317
|
-
var aliases = ["stdin", "stdout", "stderr"];
|
|
1318
|
-
var hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias");
|
|
1319
|
-
var normalizeStdio = /* @__PURE__ */ __name((options) => {
|
|
1320
|
-
if (!options) {
|
|
1321
|
-
return;
|
|
1322
|
-
}
|
|
1323
|
-
const { stdio } = options;
|
|
1324
|
-
if (stdio === void 0) {
|
|
1325
|
-
return aliases.map((alias) => options[alias]);
|
|
1326
|
-
}
|
|
1327
|
-
if (hasAlias(options)) {
|
|
1328
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
1329
|
-
}
|
|
1330
|
-
if (typeof stdio === "string") {
|
|
1331
|
-
return stdio;
|
|
1332
|
-
}
|
|
1333
|
-
if (!Array.isArray(stdio)) {
|
|
1334
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
1335
|
-
}
|
|
1336
|
-
const length = Math.max(stdio.length, aliases.length);
|
|
1337
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
1338
|
-
}, "normalizeStdio");
|
|
1339
|
-
|
|
1340
|
-
// node_modules/execa/lib/kill.js
|
|
1341
|
-
import os from "node:os";
|
|
1342
|
-
|
|
1343
|
-
// node_modules/signal-exit/dist/mjs/signals.js
|
|
1344
|
-
var signals = [];
|
|
1345
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1346
|
-
if (process.platform !== "win32") {
|
|
1347
|
-
signals.push(
|
|
1348
|
-
"SIGALRM",
|
|
1349
|
-
"SIGABRT",
|
|
1350
|
-
"SIGVTALRM",
|
|
1351
|
-
"SIGXCPU",
|
|
1352
|
-
"SIGXFSZ",
|
|
1353
|
-
"SIGUSR2",
|
|
1354
|
-
"SIGTRAP",
|
|
1355
|
-
"SIGSYS",
|
|
1356
|
-
"SIGQUIT",
|
|
1357
|
-
"SIGIOT"
|
|
1358
|
-
// should detect profiler and enable/disable accordingly.
|
|
1359
|
-
// see #21
|
|
1360
|
-
// 'SIGPROF'
|
|
1361
|
-
);
|
|
1362
|
-
}
|
|
1363
|
-
if (process.platform === "linux") {
|
|
1364
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
// node_modules/signal-exit/dist/mjs/index.js
|
|
1368
|
-
var processOk = /* @__PURE__ */ __name((process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function", "processOk");
|
|
1369
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1370
|
-
var global2 = globalThis;
|
|
1371
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1372
|
-
var Emitter = class {
|
|
1373
|
-
static {
|
|
1374
|
-
__name(this, "Emitter");
|
|
1375
|
-
}
|
|
1376
|
-
emitted = {
|
|
1377
|
-
afterExit: false,
|
|
1378
|
-
exit: false
|
|
1379
|
-
};
|
|
1380
|
-
listeners = {
|
|
1381
|
-
afterExit: [],
|
|
1382
|
-
exit: []
|
|
1383
|
-
};
|
|
1384
|
-
count = 0;
|
|
1385
|
-
id = Math.random();
|
|
1386
|
-
constructor() {
|
|
1387
|
-
if (global2[kExitEmitter]) {
|
|
1388
|
-
return global2[kExitEmitter];
|
|
1389
|
-
}
|
|
1390
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
1391
|
-
value: this,
|
|
1392
|
-
writable: false,
|
|
1393
|
-
enumerable: false,
|
|
1394
|
-
configurable: false
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
on(ev, fn) {
|
|
1398
|
-
this.listeners[ev].push(fn);
|
|
1399
|
-
}
|
|
1400
|
-
removeListener(ev, fn) {
|
|
1401
|
-
const list = this.listeners[ev];
|
|
1402
|
-
const i = list.indexOf(fn);
|
|
1403
|
-
if (i === -1) {
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
if (i === 0 && list.length === 1) {
|
|
1407
|
-
list.length = 0;
|
|
1408
|
-
} else {
|
|
1409
|
-
list.splice(i, 1);
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
emit(ev, code, signal) {
|
|
1413
|
-
if (this.emitted[ev]) {
|
|
1414
|
-
return false;
|
|
1415
|
-
}
|
|
1416
|
-
this.emitted[ev] = true;
|
|
1417
|
-
let ret = false;
|
|
1418
|
-
for (const fn of this.listeners[ev]) {
|
|
1419
|
-
ret = fn(code, signal) === true || ret;
|
|
1420
|
-
}
|
|
1421
|
-
if (ev === "exit") {
|
|
1422
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
1423
|
-
}
|
|
1424
|
-
return ret;
|
|
1425
|
-
}
|
|
1426
|
-
};
|
|
1427
|
-
var SignalExitBase = class {
|
|
1428
|
-
static {
|
|
1429
|
-
__name(this, "SignalExitBase");
|
|
1430
|
-
}
|
|
1431
|
-
};
|
|
1432
|
-
var signalExitWrap = /* @__PURE__ */ __name((handler) => {
|
|
1433
|
-
return {
|
|
1434
|
-
onExit(cb, opts) {
|
|
1435
|
-
return handler.onExit(cb, opts);
|
|
1436
|
-
},
|
|
1437
|
-
load() {
|
|
1438
|
-
return handler.load();
|
|
1439
|
-
},
|
|
1440
|
-
unload() {
|
|
1441
|
-
return handler.unload();
|
|
1442
|
-
}
|
|
1443
|
-
};
|
|
1444
|
-
}, "signalExitWrap");
|
|
1445
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
1446
|
-
static {
|
|
1447
|
-
__name(this, "SignalExitFallback");
|
|
1448
|
-
}
|
|
1449
|
-
onExit() {
|
|
1450
|
-
return () => {
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
load() {
|
|
1454
|
-
}
|
|
1455
|
-
unload() {
|
|
1456
|
-
}
|
|
1457
|
-
};
|
|
1458
|
-
var SignalExit = class extends SignalExitBase {
|
|
1459
|
-
static {
|
|
1460
|
-
__name(this, "SignalExit");
|
|
1461
|
-
}
|
|
1462
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1463
|
-
// so use a supported signal instead
|
|
1464
|
-
/* c8 ignore start */
|
|
1465
|
-
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1466
|
-
/* c8 ignore stop */
|
|
1467
|
-
#emitter = new Emitter();
|
|
1468
|
-
#process;
|
|
1469
|
-
#originalProcessEmit;
|
|
1470
|
-
#originalProcessReallyExit;
|
|
1471
|
-
#sigListeners = {};
|
|
1472
|
-
#loaded = false;
|
|
1473
|
-
constructor(process7) {
|
|
1474
|
-
super();
|
|
1475
|
-
this.#process = process7;
|
|
1476
|
-
this.#sigListeners = {};
|
|
1477
|
-
for (const sig of signals) {
|
|
1478
|
-
this.#sigListeners[sig] = () => {
|
|
1479
|
-
const listeners = this.#process.listeners(sig);
|
|
1480
|
-
let { count } = this.#emitter;
|
|
1481
|
-
const p = process7;
|
|
1482
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1483
|
-
count += p.__signal_exit_emitter__.count;
|
|
1484
|
-
}
|
|
1485
|
-
if (listeners.length === count) {
|
|
1486
|
-
this.unload();
|
|
1487
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
1488
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1489
|
-
if (!ret)
|
|
1490
|
-
process7.kill(process7.pid, s);
|
|
1491
|
-
}
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
this.#originalProcessReallyExit = process7.reallyExit;
|
|
1495
|
-
this.#originalProcessEmit = process7.emit;
|
|
1496
|
-
}
|
|
1497
|
-
onExit(cb, opts) {
|
|
1498
|
-
if (!processOk(this.#process)) {
|
|
1499
|
-
return () => {
|
|
1500
|
-
};
|
|
1501
|
-
}
|
|
1502
|
-
if (this.#loaded === false) {
|
|
1503
|
-
this.load();
|
|
1504
|
-
}
|
|
1505
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1506
|
-
this.#emitter.on(ev, cb);
|
|
1507
|
-
return () => {
|
|
1508
|
-
this.#emitter.removeListener(ev, cb);
|
|
1509
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1510
|
-
this.unload();
|
|
1511
|
-
}
|
|
1512
|
-
};
|
|
1513
|
-
}
|
|
1514
|
-
load() {
|
|
1515
|
-
if (this.#loaded) {
|
|
1516
|
-
return;
|
|
1517
|
-
}
|
|
1518
|
-
this.#loaded = true;
|
|
1519
|
-
this.#emitter.count += 1;
|
|
1520
|
-
for (const sig of signals) {
|
|
1521
|
-
try {
|
|
1522
|
-
const fn = this.#sigListeners[sig];
|
|
1523
|
-
if (fn)
|
|
1524
|
-
this.#process.on(sig, fn);
|
|
1525
|
-
} catch (_) {
|
|
1526
|
-
}
|
|
1527
|
-
}
|
|
1528
|
-
this.#process.emit = (ev, ...a) => {
|
|
1529
|
-
return this.#processEmit(ev, ...a);
|
|
1530
|
-
};
|
|
1531
|
-
this.#process.reallyExit = (code) => {
|
|
1532
|
-
return this.#processReallyExit(code);
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
unload() {
|
|
1536
|
-
if (!this.#loaded) {
|
|
1537
|
-
return;
|
|
1538
|
-
}
|
|
1539
|
-
this.#loaded = false;
|
|
1540
|
-
signals.forEach((sig) => {
|
|
1541
|
-
const listener = this.#sigListeners[sig];
|
|
1542
|
-
if (!listener) {
|
|
1543
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
1544
|
-
}
|
|
1545
|
-
try {
|
|
1546
|
-
this.#process.removeListener(sig, listener);
|
|
1547
|
-
} catch (_) {
|
|
1548
|
-
}
|
|
1549
|
-
});
|
|
1550
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
1551
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1552
|
-
this.#emitter.count -= 1;
|
|
1553
|
-
}
|
|
1554
|
-
#processReallyExit(code) {
|
|
1555
|
-
if (!processOk(this.#process)) {
|
|
1556
|
-
return 0;
|
|
1557
|
-
}
|
|
1558
|
-
this.#process.exitCode = code || 0;
|
|
1559
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1560
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1561
|
-
}
|
|
1562
|
-
#processEmit(ev, ...args) {
|
|
1563
|
-
const og = this.#originalProcessEmit;
|
|
1564
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
1565
|
-
if (typeof args[0] === "number") {
|
|
1566
|
-
this.#process.exitCode = args[0];
|
|
1567
|
-
}
|
|
1568
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
1569
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1570
|
-
return ret;
|
|
1571
|
-
} else {
|
|
1572
|
-
return og.call(this.#process, ev, ...args);
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
};
|
|
1576
|
-
var process4 = globalThis.process;
|
|
1577
|
-
var {
|
|
1578
|
-
/**
|
|
1579
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
1580
|
-
* exit, or running out of stuff to do.
|
|
1581
|
-
*
|
|
1582
|
-
* If the global process object is not suitable for instrumentation,
|
|
1583
|
-
* then this will be a no-op.
|
|
1584
|
-
*
|
|
1585
|
-
* Returns a function that may be used to unload signal-exit.
|
|
1586
|
-
*/
|
|
1587
|
-
onExit,
|
|
1588
|
-
/**
|
|
1589
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
1590
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1591
|
-
* Mostly exposed for the benefit of testing.
|
|
1592
|
-
*
|
|
1593
|
-
* @internal
|
|
1594
|
-
*/
|
|
1595
|
-
load,
|
|
1596
|
-
/**
|
|
1597
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
1598
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
1599
|
-
* Mostly exposed for the benefit of testing.
|
|
1600
|
-
*
|
|
1601
|
-
* @internal
|
|
1602
|
-
*/
|
|
1603
|
-
unload
|
|
1604
|
-
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
|
|
1605
|
-
|
|
1606
|
-
// node_modules/execa/lib/kill.js
|
|
1607
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
1608
|
-
var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
|
|
1609
|
-
const killResult = kill(signal);
|
|
1610
|
-
setKillTimeout(kill, signal, options, killResult);
|
|
1611
|
-
return killResult;
|
|
1612
|
-
}, "spawnedKill");
|
|
1613
|
-
var setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => {
|
|
1614
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
1615
|
-
return;
|
|
1616
|
-
}
|
|
1617
|
-
const timeout = getForceKillAfterTimeout(options);
|
|
1618
|
-
const t = setTimeout(() => {
|
|
1619
|
-
kill("SIGKILL");
|
|
1620
|
-
}, timeout);
|
|
1621
|
-
if (t.unref) {
|
|
1622
|
-
t.unref();
|
|
1623
|
-
}
|
|
1624
|
-
}, "setKillTimeout");
|
|
1625
|
-
var shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult, "shouldForceKill");
|
|
1626
|
-
var isSigterm = /* @__PURE__ */ __name((signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM", "isSigterm");
|
|
1627
|
-
var getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => {
|
|
1628
|
-
if (forceKillAfterTimeout === true) {
|
|
1629
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
1630
|
-
}
|
|
1631
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
1632
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
1633
|
-
}
|
|
1634
|
-
return forceKillAfterTimeout;
|
|
1635
|
-
}, "getForceKillAfterTimeout");
|
|
1636
|
-
var spawnedCancel = /* @__PURE__ */ __name((spawned, context) => {
|
|
1637
|
-
const killResult = spawned.kill();
|
|
1638
|
-
if (killResult) {
|
|
1639
|
-
context.isCanceled = true;
|
|
1640
|
-
}
|
|
1641
|
-
}, "spawnedCancel");
|
|
1642
|
-
var timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => {
|
|
1643
|
-
spawned.kill(signal);
|
|
1644
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
1645
|
-
}, "timeoutKill");
|
|
1646
|
-
var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
1647
|
-
if (timeout === 0 || timeout === void 0) {
|
|
1648
|
-
return spawnedPromise;
|
|
1649
|
-
}
|
|
1650
|
-
let timeoutId;
|
|
1651
|
-
const timeoutPromise = new Promise((resolve2, reject) => {
|
|
1652
|
-
timeoutId = setTimeout(() => {
|
|
1653
|
-
timeoutKill(spawned, killSignal, reject);
|
|
1654
|
-
}, timeout);
|
|
1655
|
-
});
|
|
1656
|
-
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
1657
|
-
clearTimeout(timeoutId);
|
|
1658
|
-
});
|
|
1659
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
1660
|
-
}, "setupTimeout");
|
|
1661
|
-
var validateTimeout = /* @__PURE__ */ __name(({ timeout }) => {
|
|
1662
|
-
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
1663
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
1664
|
-
}
|
|
1665
|
-
}, "validateTimeout");
|
|
1666
|
-
var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => {
|
|
1667
|
-
if (!cleanup || detached) {
|
|
1668
|
-
return timedPromise;
|
|
1669
|
-
}
|
|
1670
|
-
const removeExitHandler = onExit(() => {
|
|
1671
|
-
spawned.kill();
|
|
1672
|
-
});
|
|
1673
|
-
return timedPromise.finally(() => {
|
|
1674
|
-
removeExitHandler();
|
|
1675
|
-
});
|
|
1676
|
-
}, "setExitHandler");
|
|
1677
|
-
|
|
1678
|
-
// node_modules/execa/lib/pipe.js
|
|
1679
|
-
import { createWriteStream } from "node:fs";
|
|
1680
|
-
import { ChildProcess } from "node:child_process";
|
|
1681
|
-
|
|
1682
|
-
// node_modules/is-stream/index.js
|
|
1683
|
-
function isStream(stream) {
|
|
1684
|
-
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
1685
|
-
}
|
|
1686
|
-
__name(isStream, "isStream");
|
|
1687
|
-
function isWritableStream(stream) {
|
|
1688
|
-
return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
1689
|
-
}
|
|
1690
|
-
__name(isWritableStream, "isWritableStream");
|
|
1691
|
-
|
|
1692
|
-
// node_modules/execa/lib/pipe.js
|
|
1693
|
-
var isExecaChildProcess = /* @__PURE__ */ __name((target) => target instanceof ChildProcess && typeof target.then === "function", "isExecaChildProcess");
|
|
1694
|
-
var pipeToTarget = /* @__PURE__ */ __name((spawned, streamName, target) => {
|
|
1695
|
-
if (typeof target === "string") {
|
|
1696
|
-
spawned[streamName].pipe(createWriteStream(target));
|
|
1697
|
-
return spawned;
|
|
1698
|
-
}
|
|
1699
|
-
if (isWritableStream(target)) {
|
|
1700
|
-
spawned[streamName].pipe(target);
|
|
1701
|
-
return spawned;
|
|
1702
|
-
}
|
|
1703
|
-
if (!isExecaChildProcess(target)) {
|
|
1704
|
-
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
1705
|
-
}
|
|
1706
|
-
if (!isWritableStream(target.stdin)) {
|
|
1707
|
-
throw new TypeError("The target child process's stdin must be available.");
|
|
1708
|
-
}
|
|
1709
|
-
spawned[streamName].pipe(target.stdin);
|
|
1710
|
-
return target;
|
|
1711
|
-
}, "pipeToTarget");
|
|
1712
|
-
var addPipeMethods = /* @__PURE__ */ __name((spawned) => {
|
|
1713
|
-
if (spawned.stdout !== null) {
|
|
1714
|
-
spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
|
|
1715
|
-
}
|
|
1716
|
-
if (spawned.stderr !== null) {
|
|
1717
|
-
spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
|
|
1718
|
-
}
|
|
1719
|
-
if (spawned.all !== void 0) {
|
|
1720
|
-
spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
|
|
1721
|
-
}
|
|
1722
|
-
}, "addPipeMethods");
|
|
1723
|
-
|
|
1724
|
-
// node_modules/execa/lib/stream.js
|
|
1725
|
-
import { createReadStream, readFileSync } from "node:fs";
|
|
1726
|
-
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
1727
|
-
|
|
1728
|
-
// node_modules/get-stream/source/contents.js
|
|
1729
|
-
var getStreamContents = /* @__PURE__ */ __name(async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
1730
|
-
if (!isAsyncIterable(stream)) {
|
|
1731
|
-
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
1732
|
-
}
|
|
1733
|
-
const state = init();
|
|
1734
|
-
state.length = 0;
|
|
1735
|
-
try {
|
|
1736
|
-
for await (const chunk of stream) {
|
|
1737
|
-
const chunkType = getChunkType(chunk);
|
|
1738
|
-
const convertedChunk = convertChunk[chunkType](chunk, state);
|
|
1739
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1740
|
-
}
|
|
1741
|
-
appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
|
|
1742
|
-
return finalize(state);
|
|
1743
|
-
} catch (error) {
|
|
1744
|
-
error.bufferedData = finalize(state);
|
|
1745
|
-
throw error;
|
|
1746
|
-
}
|
|
1747
|
-
}, "getStreamContents");
|
|
1748
|
-
var appendFinalChunk = /* @__PURE__ */ __name(({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
1749
|
-
const convertedChunk = getFinalChunk(state);
|
|
1750
|
-
if (convertedChunk !== void 0) {
|
|
1751
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1752
|
-
}
|
|
1753
|
-
}, "appendFinalChunk");
|
|
1754
|
-
var appendChunk = /* @__PURE__ */ __name(({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
1755
|
-
const chunkSize = getSize(convertedChunk);
|
|
1756
|
-
const newLength = state.length + chunkSize;
|
|
1757
|
-
if (newLength <= maxBuffer) {
|
|
1758
|
-
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
1759
|
-
return;
|
|
1760
|
-
}
|
|
1761
|
-
const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
1762
|
-
if (truncatedChunk !== void 0) {
|
|
1763
|
-
addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
|
|
1764
|
-
}
|
|
1765
|
-
throw new MaxBufferError();
|
|
1766
|
-
}, "appendChunk");
|
|
1767
|
-
var addNewChunk = /* @__PURE__ */ __name((convertedChunk, state, addChunk, newLength) => {
|
|
1768
|
-
state.contents = addChunk(convertedChunk, state, newLength);
|
|
1769
|
-
state.length = newLength;
|
|
1770
|
-
}, "addNewChunk");
|
|
1771
|
-
var isAsyncIterable = /* @__PURE__ */ __name((stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function", "isAsyncIterable");
|
|
1772
|
-
var getChunkType = /* @__PURE__ */ __name((chunk) => {
|
|
1773
|
-
const typeOfChunk = typeof chunk;
|
|
1774
|
-
if (typeOfChunk === "string") {
|
|
1775
|
-
return "string";
|
|
1776
|
-
}
|
|
1777
|
-
if (typeOfChunk !== "object" || chunk === null) {
|
|
1778
|
-
return "others";
|
|
1779
|
-
}
|
|
1780
|
-
if (globalThis.Buffer?.isBuffer(chunk)) {
|
|
1781
|
-
return "buffer";
|
|
1782
|
-
}
|
|
1783
|
-
const prototypeName = objectToString.call(chunk);
|
|
1784
|
-
if (prototypeName === "[object ArrayBuffer]") {
|
|
1785
|
-
return "arrayBuffer";
|
|
1786
|
-
}
|
|
1787
|
-
if (prototypeName === "[object DataView]") {
|
|
1788
|
-
return "dataView";
|
|
1789
|
-
}
|
|
1790
|
-
if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
|
|
1791
|
-
return "typedArray";
|
|
1792
|
-
}
|
|
1793
|
-
return "others";
|
|
1794
|
-
}, "getChunkType");
|
|
1795
|
-
var { toString: objectToString } = Object.prototype;
|
|
1796
|
-
var MaxBufferError = class extends Error {
|
|
1797
|
-
static {
|
|
1798
|
-
__name(this, "MaxBufferError");
|
|
1799
|
-
}
|
|
1800
|
-
name = "MaxBufferError";
|
|
1801
|
-
constructor() {
|
|
1802
|
-
super("maxBuffer exceeded");
|
|
1803
|
-
}
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
|
-
// node_modules/get-stream/source/utils.js
|
|
1807
|
-
var identity = /* @__PURE__ */ __name((value) => value, "identity");
|
|
1808
|
-
var noop = /* @__PURE__ */ __name(() => void 0, "noop");
|
|
1809
|
-
var getContentsProp = /* @__PURE__ */ __name(({ contents }) => contents, "getContentsProp");
|
|
1810
|
-
var throwObjectStream = /* @__PURE__ */ __name((chunk) => {
|
|
1811
|
-
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
1812
|
-
}, "throwObjectStream");
|
|
1813
|
-
var getLengthProp = /* @__PURE__ */ __name((convertedChunk) => convertedChunk.length, "getLengthProp");
|
|
1814
|
-
|
|
1815
|
-
// node_modules/get-stream/source/array-buffer.js
|
|
1816
|
-
async function getStreamAsArrayBuffer(stream, options) {
|
|
1817
|
-
return getStreamContents(stream, arrayBufferMethods, options);
|
|
1818
|
-
}
|
|
1819
|
-
__name(getStreamAsArrayBuffer, "getStreamAsArrayBuffer");
|
|
1820
|
-
var initArrayBuffer = /* @__PURE__ */ __name(() => ({ contents: new ArrayBuffer(0) }), "initArrayBuffer");
|
|
1821
|
-
var useTextEncoder = /* @__PURE__ */ __name((chunk) => textEncoder.encode(chunk), "useTextEncoder");
|
|
1822
|
-
var textEncoder = new TextEncoder();
|
|
1823
|
-
var useUint8Array = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk), "useUint8Array");
|
|
1824
|
-
var useUint8ArrayWithOffset = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength), "useUint8ArrayWithOffset");
|
|
1825
|
-
var truncateArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateArrayBufferChunk");
|
|
1826
|
-
var addArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, { contents, length: previousLength }, length) => {
|
|
1827
|
-
const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
1828
|
-
new Uint8Array(newContents).set(convertedChunk, previousLength);
|
|
1829
|
-
return newContents;
|
|
1830
|
-
}, "addArrayBufferChunk");
|
|
1831
|
-
var resizeArrayBufferSlow = /* @__PURE__ */ __name((contents, length) => {
|
|
1832
|
-
if (length <= contents.byteLength) {
|
|
1833
|
-
return contents;
|
|
1834
|
-
}
|
|
1835
|
-
const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
1836
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1837
|
-
return arrayBuffer;
|
|
1838
|
-
}, "resizeArrayBufferSlow");
|
|
1839
|
-
var resizeArrayBuffer = /* @__PURE__ */ __name((contents, length) => {
|
|
1840
|
-
if (length <= contents.maxByteLength) {
|
|
1841
|
-
contents.resize(length);
|
|
1842
|
-
return contents;
|
|
1843
|
-
}
|
|
1844
|
-
const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
1845
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
1846
|
-
return arrayBuffer;
|
|
1847
|
-
}, "resizeArrayBuffer");
|
|
1848
|
-
var getNewContentsLength = /* @__PURE__ */ __name((length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)), "getNewContentsLength");
|
|
1849
|
-
var SCALE_FACTOR = 2;
|
|
1850
|
-
var finalizeArrayBuffer = /* @__PURE__ */ __name(({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length), "finalizeArrayBuffer");
|
|
1851
|
-
var hasArrayBufferResize = /* @__PURE__ */ __name(() => "resize" in ArrayBuffer.prototype, "hasArrayBufferResize");
|
|
1852
|
-
var arrayBufferMethods = {
|
|
1853
|
-
init: initArrayBuffer,
|
|
1854
|
-
convertChunk: {
|
|
1855
|
-
string: useTextEncoder,
|
|
1856
|
-
buffer: useUint8Array,
|
|
1857
|
-
arrayBuffer: useUint8Array,
|
|
1858
|
-
dataView: useUint8ArrayWithOffset,
|
|
1859
|
-
typedArray: useUint8ArrayWithOffset,
|
|
1860
|
-
others: throwObjectStream
|
|
1861
|
-
},
|
|
1862
|
-
getSize: getLengthProp,
|
|
1863
|
-
truncateChunk: truncateArrayBufferChunk,
|
|
1864
|
-
addChunk: addArrayBufferChunk,
|
|
1865
|
-
getFinalChunk: noop,
|
|
1866
|
-
finalize: finalizeArrayBuffer
|
|
1867
|
-
};
|
|
1868
|
-
|
|
1869
|
-
// node_modules/get-stream/source/buffer.js
|
|
1870
|
-
async function getStreamAsBuffer(stream, options) {
|
|
1871
|
-
if (!("Buffer" in globalThis)) {
|
|
1872
|
-
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
1873
|
-
}
|
|
1874
|
-
try {
|
|
1875
|
-
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
1876
|
-
} catch (error) {
|
|
1877
|
-
if (error.bufferedData !== void 0) {
|
|
1878
|
-
error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
|
|
1879
|
-
}
|
|
1880
|
-
throw error;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
__name(getStreamAsBuffer, "getStreamAsBuffer");
|
|
1884
|
-
var arrayBufferToNodeBuffer = /* @__PURE__ */ __name((arrayBuffer) => globalThis.Buffer.from(arrayBuffer), "arrayBufferToNodeBuffer");
|
|
1885
|
-
|
|
1886
|
-
// node_modules/get-stream/source/string.js
|
|
1887
|
-
async function getStreamAsString(stream, options) {
|
|
1888
|
-
return getStreamContents(stream, stringMethods, options);
|
|
1889
|
-
}
|
|
1890
|
-
__name(getStreamAsString, "getStreamAsString");
|
|
1891
|
-
var initString = /* @__PURE__ */ __name(() => ({ contents: "", textDecoder: new TextDecoder() }), "initString");
|
|
1892
|
-
var useTextDecoder = /* @__PURE__ */ __name((chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true }), "useTextDecoder");
|
|
1893
|
-
var addStringChunk = /* @__PURE__ */ __name((convertedChunk, { contents }) => contents + convertedChunk, "addStringChunk");
|
|
1894
|
-
var truncateStringChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateStringChunk");
|
|
1895
|
-
var getFinalStringChunk = /* @__PURE__ */ __name(({ textDecoder }) => {
|
|
1896
|
-
const finalChunk = textDecoder.decode();
|
|
1897
|
-
return finalChunk === "" ? void 0 : finalChunk;
|
|
1898
|
-
}, "getFinalStringChunk");
|
|
1899
|
-
var stringMethods = {
|
|
1900
|
-
init: initString,
|
|
1901
|
-
convertChunk: {
|
|
1902
|
-
string: identity,
|
|
1903
|
-
buffer: useTextDecoder,
|
|
1904
|
-
arrayBuffer: useTextDecoder,
|
|
1905
|
-
dataView: useTextDecoder,
|
|
1906
|
-
typedArray: useTextDecoder,
|
|
1907
|
-
others: throwObjectStream
|
|
1908
|
-
},
|
|
1909
|
-
getSize: getLengthProp,
|
|
1910
|
-
truncateChunk: truncateStringChunk,
|
|
1911
|
-
addChunk: addStringChunk,
|
|
1912
|
-
getFinalChunk: getFinalStringChunk,
|
|
1913
|
-
finalize: getContentsProp
|
|
1914
|
-
};
|
|
1915
|
-
|
|
1916
|
-
// node_modules/execa/lib/stream.js
|
|
1917
|
-
var import_merge_stream = __toESM(require_merge_stream(), 1);
|
|
1918
|
-
var validateInputOptions = /* @__PURE__ */ __name((input) => {
|
|
1919
|
-
if (input !== void 0) {
|
|
1920
|
-
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
1921
|
-
}
|
|
1922
|
-
}, "validateInputOptions");
|
|
1923
|
-
var getInputSync = /* @__PURE__ */ __name(({ input, inputFile }) => {
|
|
1924
|
-
if (typeof inputFile !== "string") {
|
|
1925
|
-
return input;
|
|
1926
|
-
}
|
|
1927
|
-
validateInputOptions(input);
|
|
1928
|
-
return readFileSync(inputFile);
|
|
1929
|
-
}, "getInputSync");
|
|
1930
|
-
var handleInputSync = /* @__PURE__ */ __name((options) => {
|
|
1931
|
-
const input = getInputSync(options);
|
|
1932
|
-
if (isStream(input)) {
|
|
1933
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
1934
|
-
}
|
|
1935
|
-
return input;
|
|
1936
|
-
}, "handleInputSync");
|
|
1937
|
-
var getInput = /* @__PURE__ */ __name(({ input, inputFile }) => {
|
|
1938
|
-
if (typeof inputFile !== "string") {
|
|
1939
|
-
return input;
|
|
1940
|
-
}
|
|
1941
|
-
validateInputOptions(input);
|
|
1942
|
-
return createReadStream(inputFile);
|
|
1943
|
-
}, "getInput");
|
|
1944
|
-
var handleInput = /* @__PURE__ */ __name((spawned, options) => {
|
|
1945
|
-
const input = getInput(options);
|
|
1946
|
-
if (input === void 0) {
|
|
1947
|
-
return;
|
|
1948
|
-
}
|
|
1949
|
-
if (isStream(input)) {
|
|
1950
|
-
input.pipe(spawned.stdin);
|
|
1951
|
-
} else {
|
|
1952
|
-
spawned.stdin.end(input);
|
|
1953
|
-
}
|
|
1954
|
-
}, "handleInput");
|
|
1955
|
-
var makeAllStream = /* @__PURE__ */ __name((spawned, { all }) => {
|
|
1956
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
1957
|
-
return;
|
|
1958
|
-
}
|
|
1959
|
-
const mixed = (0, import_merge_stream.default)();
|
|
1960
|
-
if (spawned.stdout) {
|
|
1961
|
-
mixed.add(spawned.stdout);
|
|
1962
|
-
}
|
|
1963
|
-
if (spawned.stderr) {
|
|
1964
|
-
mixed.add(spawned.stderr);
|
|
1965
|
-
}
|
|
1966
|
-
return mixed;
|
|
1967
|
-
}, "makeAllStream");
|
|
1968
|
-
var getBufferedData = /* @__PURE__ */ __name(async (stream, streamPromise) => {
|
|
1969
|
-
if (!stream || streamPromise === void 0) {
|
|
1970
|
-
return;
|
|
1971
|
-
}
|
|
1972
|
-
await setTimeout2(0);
|
|
1973
|
-
stream.destroy();
|
|
1974
|
-
try {
|
|
1975
|
-
return await streamPromise;
|
|
1976
|
-
} catch (error) {
|
|
1977
|
-
return error.bufferedData;
|
|
1978
|
-
}
|
|
1979
|
-
}, "getBufferedData");
|
|
1980
|
-
var getStreamPromise = /* @__PURE__ */ __name((stream, { encoding, buffer, maxBuffer }) => {
|
|
1981
|
-
if (!stream || !buffer) {
|
|
1982
|
-
return;
|
|
1983
|
-
}
|
|
1984
|
-
if (encoding === "utf8" || encoding === "utf-8") {
|
|
1985
|
-
return getStreamAsString(stream, { maxBuffer });
|
|
1986
|
-
}
|
|
1987
|
-
if (encoding === null || encoding === "buffer") {
|
|
1988
|
-
return getStreamAsBuffer(stream, { maxBuffer });
|
|
1989
|
-
}
|
|
1990
|
-
return applyEncoding(stream, maxBuffer, encoding);
|
|
1991
|
-
}, "getStreamPromise");
|
|
1992
|
-
var applyEncoding = /* @__PURE__ */ __name(async (stream, maxBuffer, encoding) => {
|
|
1993
|
-
const buffer = await getStreamAsBuffer(stream, { maxBuffer });
|
|
1994
|
-
return buffer.toString(encoding);
|
|
1995
|
-
}, "applyEncoding");
|
|
1996
|
-
var getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1997
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
1998
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
1999
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
2000
|
-
try {
|
|
2001
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
2002
|
-
} catch (error) {
|
|
2003
|
-
return Promise.all([
|
|
2004
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
2005
|
-
getBufferedData(stdout, stdoutPromise),
|
|
2006
|
-
getBufferedData(stderr, stderrPromise),
|
|
2007
|
-
getBufferedData(all, allPromise)
|
|
2008
|
-
]);
|
|
2009
|
-
}
|
|
2010
|
-
}, "getSpawnedResult");
|
|
2011
|
-
|
|
2012
|
-
// node_modules/execa/lib/promise.js
|
|
2013
|
-
var nativePromisePrototype = (async () => {
|
|
2014
|
-
})().constructor.prototype;
|
|
2015
|
-
var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
2016
|
-
property,
|
|
2017
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
2018
|
-
]);
|
|
2019
|
-
var mergePromise = /* @__PURE__ */ __name((spawned, promise) => {
|
|
2020
|
-
for (const [property, descriptor] of descriptors) {
|
|
2021
|
-
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
2022
|
-
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
2023
|
-
}
|
|
2024
|
-
}, "mergePromise");
|
|
2025
|
-
var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve2, reject) => {
|
|
2026
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
2027
|
-
resolve2({ exitCode, signal });
|
|
2028
|
-
});
|
|
2029
|
-
spawned.on("error", (error) => {
|
|
2030
|
-
reject(error);
|
|
2031
|
-
});
|
|
2032
|
-
if (spawned.stdin) {
|
|
2033
|
-
spawned.stdin.on("error", (error) => {
|
|
2034
|
-
reject(error);
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
}), "getSpawnedPromise");
|
|
2038
|
-
|
|
2039
|
-
// node_modules/execa/lib/command.js
|
|
2040
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
2041
|
-
import { ChildProcess as ChildProcess2 } from "node:child_process";
|
|
2042
|
-
var normalizeArgs = /* @__PURE__ */ __name((file, args = []) => {
|
|
2043
|
-
if (!Array.isArray(args)) {
|
|
2044
|
-
return [file];
|
|
2045
|
-
}
|
|
2046
|
-
return [file, ...args];
|
|
2047
|
-
}, "normalizeArgs");
|
|
2048
|
-
var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
2049
|
-
var escapeArg = /* @__PURE__ */ __name((arg) => {
|
|
2050
|
-
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
2051
|
-
return arg;
|
|
2052
|
-
}
|
|
2053
|
-
return `"${arg.replaceAll('"', '\\"')}"`;
|
|
2054
|
-
}, "escapeArg");
|
|
2055
|
-
var joinCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).join(" "), "joinCommand");
|
|
2056
|
-
var getEscapedCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), "getEscapedCommand");
|
|
2057
|
-
var SPACES_REGEXP = / +/g;
|
|
2058
|
-
var parseCommand = /* @__PURE__ */ __name((command) => {
|
|
2059
|
-
const tokens = [];
|
|
2060
|
-
for (const token of command.trim().split(SPACES_REGEXP)) {
|
|
2061
|
-
const previousToken = tokens.at(-1);
|
|
2062
|
-
if (previousToken && previousToken.endsWith("\\")) {
|
|
2063
|
-
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
2064
|
-
} else {
|
|
2065
|
-
tokens.push(token);
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
return tokens;
|
|
2069
|
-
}, "parseCommand");
|
|
2070
|
-
var parseExpression = /* @__PURE__ */ __name((expression) => {
|
|
2071
|
-
const typeOfExpression = typeof expression;
|
|
2072
|
-
if (typeOfExpression === "string") {
|
|
2073
|
-
return expression;
|
|
2074
|
-
}
|
|
2075
|
-
if (typeOfExpression === "number") {
|
|
2076
|
-
return String(expression);
|
|
2077
|
-
}
|
|
2078
|
-
if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
|
|
2079
|
-
const typeOfStdout = typeof expression.stdout;
|
|
2080
|
-
if (typeOfStdout === "string") {
|
|
2081
|
-
return expression.stdout;
|
|
2082
|
-
}
|
|
2083
|
-
if (Buffer2.isBuffer(expression.stdout)) {
|
|
2084
|
-
return expression.stdout.toString();
|
|
2085
|
-
}
|
|
2086
|
-
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
2087
|
-
}
|
|
2088
|
-
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
2089
|
-
}, "parseExpression");
|
|
2090
|
-
var concatTokens = /* @__PURE__ */ __name((tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
2091
|
-
...tokens.slice(0, -1),
|
|
2092
|
-
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
2093
|
-
...nextTokens.slice(1)
|
|
2094
|
-
], "concatTokens");
|
|
2095
|
-
var parseTemplate = /* @__PURE__ */ __name(({ templates, expressions, tokens, index, template }) => {
|
|
2096
|
-
const templateString = template ?? templates.raw[index];
|
|
2097
|
-
const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
|
|
2098
|
-
const newTokens = concatTokens(
|
|
2099
|
-
tokens,
|
|
2100
|
-
templateTokens,
|
|
2101
|
-
templateString.startsWith(" ")
|
|
2102
|
-
);
|
|
2103
|
-
if (index === expressions.length) {
|
|
2104
|
-
return newTokens;
|
|
2105
|
-
}
|
|
2106
|
-
const expression = expressions[index];
|
|
2107
|
-
const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
2108
|
-
return concatTokens(
|
|
2109
|
-
newTokens,
|
|
2110
|
-
expressionTokens,
|
|
2111
|
-
templateString.endsWith(" ")
|
|
2112
|
-
);
|
|
2113
|
-
}, "parseTemplate");
|
|
2114
|
-
var parseTemplates = /* @__PURE__ */ __name((templates, expressions) => {
|
|
2115
|
-
let tokens = [];
|
|
2116
|
-
for (const [index, template] of templates.entries()) {
|
|
2117
|
-
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
2118
|
-
}
|
|
2119
|
-
return tokens;
|
|
2120
|
-
}, "parseTemplates");
|
|
2121
|
-
|
|
2122
|
-
// node_modules/execa/lib/verbose.js
|
|
2123
|
-
import { debuglog } from "node:util";
|
|
2124
|
-
import process5 from "node:process";
|
|
2125
|
-
var verboseDefault = debuglog("execa").enabled;
|
|
2126
|
-
var padField = /* @__PURE__ */ __name((field, padding) => String(field).padStart(padding, "0"), "padField");
|
|
2127
|
-
var getTimestamp = /* @__PURE__ */ __name(() => {
|
|
2128
|
-
const date = /* @__PURE__ */ new Date();
|
|
2129
|
-
return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
|
|
2130
|
-
}, "getTimestamp");
|
|
2131
|
-
var logCommand = /* @__PURE__ */ __name((escapedCommand, { verbose }) => {
|
|
2132
|
-
if (!verbose) {
|
|
2133
|
-
return;
|
|
2134
|
-
}
|
|
2135
|
-
process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
2136
|
-
`);
|
|
2137
|
-
}, "logCommand");
|
|
2138
|
-
|
|
2139
|
-
// node_modules/execa/index.js
|
|
2140
|
-
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
2141
|
-
var getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
2142
|
-
const env = extendEnv ? { ...process6.env, ...envOption } : envOption;
|
|
2143
|
-
if (preferLocal) {
|
|
2144
|
-
return npmRunPathEnv({ env, cwd: localDir, execPath });
|
|
2145
|
-
}
|
|
2146
|
-
return env;
|
|
2147
|
-
}, "getEnv");
|
|
2148
|
-
var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => {
|
|
2149
|
-
const parsed = import_cross_spawn.default._parse(file, args, options);
|
|
2150
|
-
file = parsed.command;
|
|
2151
|
-
args = parsed.args;
|
|
2152
|
-
options = parsed.options;
|
|
2153
|
-
options = {
|
|
2154
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
2155
|
-
buffer: true,
|
|
2156
|
-
stripFinalNewline: true,
|
|
2157
|
-
extendEnv: true,
|
|
2158
|
-
preferLocal: false,
|
|
2159
|
-
localDir: options.cwd || process6.cwd(),
|
|
2160
|
-
execPath: process6.execPath,
|
|
2161
|
-
encoding: "utf8",
|
|
2162
|
-
reject: true,
|
|
2163
|
-
cleanup: true,
|
|
2164
|
-
all: false,
|
|
2165
|
-
windowsHide: true,
|
|
2166
|
-
verbose: verboseDefault,
|
|
2167
|
-
...options
|
|
2168
|
-
};
|
|
2169
|
-
options.env = getEnv(options);
|
|
2170
|
-
options.stdio = normalizeStdio(options);
|
|
2171
|
-
if (process6.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
|
|
2172
|
-
args.unshift("/q");
|
|
2173
|
-
}
|
|
2174
|
-
return { file, args, options, parsed };
|
|
2175
|
-
}, "handleArguments");
|
|
2176
|
-
var handleOutput = /* @__PURE__ */ __name((options, value, error) => {
|
|
2177
|
-
if (typeof value !== "string" && !Buffer3.isBuffer(value)) {
|
|
2178
|
-
return error === void 0 ? void 0 : "";
|
|
2179
|
-
}
|
|
2180
|
-
if (options.stripFinalNewline) {
|
|
2181
|
-
return stripFinalNewline(value);
|
|
2182
|
-
}
|
|
2183
|
-
return value;
|
|
2184
|
-
}, "handleOutput");
|
|
2185
|
-
function execa(file, args, options) {
|
|
2186
|
-
const parsed = handleArguments(file, args, options);
|
|
2187
|
-
const command = joinCommand(file, args);
|
|
2188
|
-
const escapedCommand = getEscapedCommand(file, args);
|
|
2189
|
-
logCommand(escapedCommand, parsed.options);
|
|
2190
|
-
validateTimeout(parsed.options);
|
|
2191
|
-
let spawned;
|
|
2192
|
-
try {
|
|
2193
|
-
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
2194
|
-
} catch (error) {
|
|
2195
|
-
const dummySpawned = new childProcess.ChildProcess();
|
|
2196
|
-
const errorPromise = Promise.reject(makeError({
|
|
2197
|
-
error,
|
|
2198
|
-
stdout: "",
|
|
2199
|
-
stderr: "",
|
|
2200
|
-
all: "",
|
|
2201
|
-
command,
|
|
2202
|
-
escapedCommand,
|
|
2203
|
-
parsed,
|
|
2204
|
-
timedOut: false,
|
|
2205
|
-
isCanceled: false,
|
|
2206
|
-
killed: false
|
|
2207
|
-
}));
|
|
2208
|
-
mergePromise(dummySpawned, errorPromise);
|
|
2209
|
-
return dummySpawned;
|
|
2210
|
-
}
|
|
2211
|
-
const spawnedPromise = getSpawnedPromise(spawned);
|
|
2212
|
-
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
2213
|
-
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
2214
|
-
const context = { isCanceled: false };
|
|
2215
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
2216
|
-
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
2217
|
-
const handlePromise = /* @__PURE__ */ __name(async () => {
|
|
2218
|
-
const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
2219
|
-
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
2220
|
-
const stderr = handleOutput(parsed.options, stderrResult);
|
|
2221
|
-
const all = handleOutput(parsed.options, allResult);
|
|
2222
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
2223
|
-
const returnedError = makeError({
|
|
2224
|
-
error,
|
|
2225
|
-
exitCode,
|
|
2226
|
-
signal,
|
|
2227
|
-
stdout,
|
|
2228
|
-
stderr,
|
|
2229
|
-
all,
|
|
2230
|
-
command,
|
|
2231
|
-
escapedCommand,
|
|
2232
|
-
parsed,
|
|
2233
|
-
timedOut,
|
|
2234
|
-
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
|
|
2235
|
-
killed: spawned.killed
|
|
2236
|
-
});
|
|
2237
|
-
if (!parsed.options.reject) {
|
|
2238
|
-
return returnedError;
|
|
2239
|
-
}
|
|
2240
|
-
throw returnedError;
|
|
2241
|
-
}
|
|
2242
|
-
return {
|
|
2243
|
-
command,
|
|
2244
|
-
escapedCommand,
|
|
2245
|
-
exitCode: 0,
|
|
2246
|
-
stdout,
|
|
2247
|
-
stderr,
|
|
2248
|
-
all,
|
|
2249
|
-
failed: false,
|
|
2250
|
-
timedOut: false,
|
|
2251
|
-
isCanceled: false,
|
|
2252
|
-
killed: false
|
|
2253
|
-
};
|
|
2254
|
-
}, "handlePromise");
|
|
2255
|
-
const handlePromiseOnce = onetime_default(handlePromise);
|
|
2256
|
-
handleInput(spawned, parsed.options);
|
|
2257
|
-
spawned.all = makeAllStream(spawned, parsed.options);
|
|
2258
|
-
addPipeMethods(spawned);
|
|
2259
|
-
mergePromise(spawned, handlePromiseOnce);
|
|
2260
|
-
return spawned;
|
|
2261
|
-
}
|
|
2262
|
-
__name(execa, "execa");
|
|
2263
|
-
function execaSync(file, args, options) {
|
|
2264
|
-
const parsed = handleArguments(file, args, options);
|
|
2265
|
-
const command = joinCommand(file, args);
|
|
2266
|
-
const escapedCommand = getEscapedCommand(file, args);
|
|
2267
|
-
logCommand(escapedCommand, parsed.options);
|
|
2268
|
-
const input = handleInputSync(parsed.options);
|
|
2269
|
-
let result;
|
|
2270
|
-
try {
|
|
2271
|
-
result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
2272
|
-
} catch (error) {
|
|
2273
|
-
throw makeError({
|
|
2274
|
-
error,
|
|
2275
|
-
stdout: "",
|
|
2276
|
-
stderr: "",
|
|
2277
|
-
all: "",
|
|
2278
|
-
command,
|
|
2279
|
-
escapedCommand,
|
|
2280
|
-
parsed,
|
|
2281
|
-
timedOut: false,
|
|
2282
|
-
isCanceled: false,
|
|
2283
|
-
killed: false
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
|
-
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
2287
|
-
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
2288
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
2289
|
-
const error = makeError({
|
|
2290
|
-
stdout,
|
|
2291
|
-
stderr,
|
|
2292
|
-
error: result.error,
|
|
2293
|
-
signal: result.signal,
|
|
2294
|
-
exitCode: result.status,
|
|
2295
|
-
command,
|
|
2296
|
-
escapedCommand,
|
|
2297
|
-
parsed,
|
|
2298
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
2299
|
-
isCanceled: false,
|
|
2300
|
-
killed: result.signal !== null
|
|
2301
|
-
});
|
|
2302
|
-
if (!parsed.options.reject) {
|
|
2303
|
-
return error;
|
|
2304
|
-
}
|
|
2305
|
-
throw error;
|
|
2306
|
-
}
|
|
2307
|
-
return {
|
|
2308
|
-
command,
|
|
2309
|
-
escapedCommand,
|
|
2310
|
-
exitCode: 0,
|
|
2311
|
-
stdout,
|
|
2312
|
-
stderr,
|
|
2313
|
-
failed: false,
|
|
2314
|
-
timedOut: false,
|
|
2315
|
-
isCanceled: false,
|
|
2316
|
-
killed: false
|
|
2317
|
-
};
|
|
2318
|
-
}
|
|
2319
|
-
__name(execaSync, "execaSync");
|
|
2320
|
-
var normalizeScriptStdin = /* @__PURE__ */ __name(({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}, "normalizeScriptStdin");
|
|
2321
|
-
var normalizeScriptOptions = /* @__PURE__ */ __name((options = {}) => ({
|
|
2322
|
-
preferLocal: true,
|
|
2323
|
-
...normalizeScriptStdin(options),
|
|
2324
|
-
...options
|
|
2325
|
-
}), "normalizeScriptOptions");
|
|
2326
|
-
function create$(options) {
|
|
2327
|
-
function $2(templatesOrOptions, ...expressions) {
|
|
2328
|
-
if (!Array.isArray(templatesOrOptions)) {
|
|
2329
|
-
return create$({ ...options, ...templatesOrOptions });
|
|
2330
|
-
}
|
|
2331
|
-
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
2332
|
-
return execa(file, args, normalizeScriptOptions(options));
|
|
2333
|
-
}
|
|
2334
|
-
__name($2, "$");
|
|
2335
|
-
$2.sync = (templates, ...expressions) => {
|
|
2336
|
-
if (!Array.isArray(templates)) {
|
|
2337
|
-
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
2338
|
-
}
|
|
2339
|
-
const [file, ...args] = parseTemplates(templates, expressions);
|
|
2340
|
-
return execaSync(file, args, normalizeScriptOptions(options));
|
|
2341
|
-
};
|
|
2342
|
-
return $2;
|
|
2343
|
-
}
|
|
2344
|
-
__name(create$, "create$");
|
|
2345
|
-
var $ = create$();
|
|
2346
|
-
function execaCommand(command, options) {
|
|
2347
|
-
const [file, ...args] = parseCommand(command);
|
|
2348
|
-
return execa(file, args, options);
|
|
2349
|
-
}
|
|
2350
|
-
__name(execaCommand, "execaCommand");
|
|
2351
|
-
function execaCommandSync(command, options) {
|
|
2352
|
-
const [file, ...args] = parseCommand(command);
|
|
2353
|
-
return execaSync(file, args, options);
|
|
2354
|
-
}
|
|
2355
|
-
__name(execaCommandSync, "execaCommandSync");
|
|
2356
|
-
|
|
2357
|
-
export {
|
|
2358
|
-
NPM_LOCKFILE,
|
|
2359
|
-
PNPM_LOCKFILE,
|
|
2360
|
-
YARN_LOCKFILE,
|
|
2361
|
-
BUN_LOCKFILE,
|
|
2362
|
-
BUN_LOCKFILE_BINARY,
|
|
2363
|
-
getProjectRoot,
|
|
2364
|
-
invalidateProjectRootCache,
|
|
2365
|
-
nodePathsToArray,
|
|
2366
|
-
normalizeStoryPath,
|
|
2367
|
-
loadEnvs,
|
|
2368
|
-
stringifyEnvs,
|
|
2369
|
-
stringifyProcessEnvs,
|
|
2370
|
-
optionalEnvToBoolean,
|
|
2371
|
-
isCI,
|
|
2372
|
-
require_cross_spawn,
|
|
2373
|
-
execa,
|
|
2374
|
-
execaSync,
|
|
2375
|
-
execaCommand,
|
|
2376
|
-
execaCommandSync
|
|
2377
|
-
};
|