@storybook/addon-vitest 10.1.0-alpha.10 → 10.1.0-alpha.12
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/_browser-chunks/chunk-ULSHVN74.js +60 -0
- package/dist/_node-chunks/chunk-2CDZI4WP.js +339 -0
- package/dist/_node-chunks/chunk-3HJX4AQ5.js +1697 -0
- package/dist/_node-chunks/{chunk-7SKPZV4T.js → chunk-4R6Y7BGX.js} +11 -13
- package/dist/_node-chunks/chunk-5ZI5GUBS.js +83 -0
- package/dist/_node-chunks/chunk-AB3B3FVZ.js +69 -0
- package/dist/_node-chunks/chunk-IC274GVS.js +138 -0
- package/dist/_node-chunks/{chunk-7J6TCEGO.js → chunk-PCFYAAN7.js} +14 -19
- package/dist/_node-chunks/{chunk-U3WHYFEY.js → chunk-STKK7R3Q.js} +15 -24
- package/dist/index.js +1 -5
- package/dist/manager.js +163 -354
- package/dist/node/coverage-reporter.js +319 -864
- package/dist/node/vitest.js +189 -454
- package/dist/postinstall.js +476 -1343
- package/dist/preset.js +150 -338
- package/dist/vitest-plugin/global-setup.js +50 -105
- package/dist/vitest-plugin/index.js +1160 -2377
- package/dist/vitest-plugin/setup-file.js +6 -12
- package/dist/vitest-plugin/test-utils.js +31 -71
- package/package.json +3 -3
- package/dist/_browser-chunks/chunk-CAYLRBRX.js +0 -77
- package/dist/_browser-chunks/chunk-JK72E6FR.js +0 -6
- package/dist/_node-chunks/chunk-2GFDFSMJ.js +0 -98
- package/dist/_node-chunks/chunk-2VMVOZSQ.js +0 -247
- package/dist/_node-chunks/chunk-3G477K5F.js +0 -481
- package/dist/_node-chunks/chunk-ESR57AJV.js +0 -105
- package/dist/_node-chunks/chunk-VQBCAO3Q.js +0 -2574
|
@@ -0,0 +1,1697 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_xvxi8m6bww from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_xvxi8m6bww from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_xvxi8m6bww from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_xvxi8m6bww.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_xvxi8m6bww.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_xvxi8m6bww.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
dirname,
|
|
14
|
+
join
|
|
15
|
+
} from "./chunk-IC274GVS.js";
|
|
16
|
+
import {
|
|
17
|
+
__commonJS,
|
|
18
|
+
__require,
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-PCFYAAN7.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 || (pathext = pathext.split(";"), pathext.indexOf("") !== -1))
|
|
31
|
+
return !0;
|
|
32
|
+
for (var i = 0; i < pathext.length; i++) {
|
|
33
|
+
var p = pathext[i].toLowerCase();
|
|
34
|
+
if (p && path3.substr(-p.length).toLowerCase() === p)
|
|
35
|
+
return !0;
|
|
36
|
+
}
|
|
37
|
+
return !1;
|
|
38
|
+
}
|
|
39
|
+
function checkStat(stat, path3, options) {
|
|
40
|
+
return !stat.isSymbolicLink() && !stat.isFile() ? !1 : checkPathExt(path3, options);
|
|
41
|
+
}
|
|
42
|
+
function isexe(path3, options, cb) {
|
|
43
|
+
fs.stat(path3, function(er, stat) {
|
|
44
|
+
cb(er, er ? !1 : checkStat(stat, path3, options));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function sync(path3, options) {
|
|
48
|
+
return checkStat(fs.statSync(path3), path3, options);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// ../../node_modules/isexe/mode.js
|
|
54
|
+
var require_mode = __commonJS({
|
|
55
|
+
"../../node_modules/isexe/mode.js"(exports, module) {
|
|
56
|
+
module.exports = isexe;
|
|
57
|
+
isexe.sync = sync;
|
|
58
|
+
var fs = __require("fs");
|
|
59
|
+
function isexe(path3, options, cb) {
|
|
60
|
+
fs.stat(path3, function(er, stat) {
|
|
61
|
+
cb(er, er ? !1 : checkStat(stat, options));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function sync(path3, options) {
|
|
65
|
+
return checkStat(fs.statSync(path3), options);
|
|
66
|
+
}
|
|
67
|
+
function checkStat(stat, options) {
|
|
68
|
+
return stat.isFile() && checkMode(stat, options);
|
|
69
|
+
}
|
|
70
|
+
function checkMode(stat, options) {
|
|
71
|
+
var mod = stat.mode, uid = stat.uid, gid = stat.gid, myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(), myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(), u = parseInt("100", 8), g = parseInt("010", 8), o = parseInt("001", 8), ug = u | g, ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
72
|
+
return ret;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// ../../node_modules/isexe/index.js
|
|
78
|
+
var require_isexe = __commonJS({
|
|
79
|
+
"../../node_modules/isexe/index.js"(exports, module) {
|
|
80
|
+
var fs = __require("fs"), core;
|
|
81
|
+
process.platform === "win32" || global.TESTING_WINDOWS ? core = require_windows() : core = require_mode();
|
|
82
|
+
module.exports = isexe;
|
|
83
|
+
isexe.sync = sync;
|
|
84
|
+
function isexe(path3, options, cb) {
|
|
85
|
+
if (typeof options == "function" && (cb = options, options = {}), !cb) {
|
|
86
|
+
if (typeof Promise != "function")
|
|
87
|
+
throw new TypeError("callback not provided");
|
|
88
|
+
return new Promise(function(resolve, reject) {
|
|
89
|
+
isexe(path3, options || {}, function(er, is) {
|
|
90
|
+
er ? reject(er) : resolve(is);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
core(path3, options || {}, function(er, is) {
|
|
95
|
+
er && (er.code === "EACCES" || options && options.ignoreErrors) && (er = null, is = !1), cb(er, is);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function sync(path3, options) {
|
|
99
|
+
try {
|
|
100
|
+
return core.sync(path3, options || {});
|
|
101
|
+
} catch (er) {
|
|
102
|
+
if (options && options.ignoreErrors || er.code === "EACCES")
|
|
103
|
+
return !1;
|
|
104
|
+
throw er;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// ../../node_modules/which/which.js
|
|
111
|
+
var require_which = __commonJS({
|
|
112
|
+
"../../node_modules/which/which.js"(exports, module) {
|
|
113
|
+
var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", path3 = __require("path"), COLON = isWindows2 ? ";" : ":", isexe = require_isexe(), getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), getPathInfo = (cmd, opt) => {
|
|
114
|
+
let colon = opt.colon || COLON, pathEnv = cmd.match(/\//) || isWindows2 && cmd.match(/\\/) ? [""] : [
|
|
115
|
+
// windows always checks the cwd first
|
|
116
|
+
...isWindows2 ? [process.cwd()] : [],
|
|
117
|
+
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
118
|
+
"").split(colon)
|
|
119
|
+
], pathExtExe = isWindows2 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
120
|
+
return isWindows2 && cmd.indexOf(".") !== -1 && pathExt[0] !== "" && pathExt.unshift(""), {
|
|
121
|
+
pathEnv,
|
|
122
|
+
pathExt,
|
|
123
|
+
pathExtExe
|
|
124
|
+
};
|
|
125
|
+
}, which = (cmd, opt, cb) => {
|
|
126
|
+
typeof opt == "function" && (cb = opt, opt = {}), opt || (opt = {});
|
|
127
|
+
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((resolve, reject) => {
|
|
128
|
+
if (i === pathEnv.length)
|
|
129
|
+
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
130
|
+
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path3.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
131
|
+
resolve(subStep(p, i, 0));
|
|
132
|
+
}), subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
133
|
+
if (ii === pathExt.length)
|
|
134
|
+
return resolve(step(i + 1));
|
|
135
|
+
let ext = pathExt[ii];
|
|
136
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
137
|
+
if (!er && is)
|
|
138
|
+
if (opt.all)
|
|
139
|
+
found.push(p + ext);
|
|
140
|
+
else
|
|
141
|
+
return resolve(p + ext);
|
|
142
|
+
return resolve(subStep(p, i, ii + 1));
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
146
|
+
}, whichSync = (cmd, opt) => {
|
|
147
|
+
opt = opt || {};
|
|
148
|
+
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [];
|
|
149
|
+
for (let i = 0; i < pathEnv.length; i++) {
|
|
150
|
+
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path3.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
151
|
+
for (let j = 0; j < pathExt.length; j++) {
|
|
152
|
+
let cur = p + pathExt[j];
|
|
153
|
+
try {
|
|
154
|
+
if (isexe.sync(cur, { pathExt: pathExtExe }))
|
|
155
|
+
if (opt.all)
|
|
156
|
+
found.push(cur);
|
|
157
|
+
else
|
|
158
|
+
return cur;
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (opt.all && found.length)
|
|
164
|
+
return found;
|
|
165
|
+
if (opt.nothrow)
|
|
166
|
+
return null;
|
|
167
|
+
throw getNotFoundError(cmd);
|
|
168
|
+
};
|
|
169
|
+
module.exports = which;
|
|
170
|
+
which.sync = whichSync;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// ../../node_modules/path-key/index.js
|
|
175
|
+
var require_path_key = __commonJS({
|
|
176
|
+
"../../node_modules/path-key/index.js"(exports, module) {
|
|
177
|
+
"use strict";
|
|
178
|
+
var pathKey2 = (options = {}) => {
|
|
179
|
+
let environment = options.env || process.env;
|
|
180
|
+
return (options.platform || process.platform) !== "win32" ? "PATH" : Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
181
|
+
};
|
|
182
|
+
module.exports = pathKey2;
|
|
183
|
+
module.exports.default = pathKey2;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// ../../node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
188
|
+
var require_resolveCommand = __commonJS({
|
|
189
|
+
"../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
190
|
+
"use strict";
|
|
191
|
+
var path3 = __require("path"), which = require_which(), getPathKey = require_path_key();
|
|
192
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
193
|
+
let env = parsed.options.env || process.env, cwd = process.cwd(), hasCustomCwd = parsed.options.cwd != null, shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
194
|
+
if (shouldSwitchCwd)
|
|
195
|
+
try {
|
|
196
|
+
process.chdir(parsed.options.cwd);
|
|
197
|
+
} catch {
|
|
198
|
+
}
|
|
199
|
+
let resolved;
|
|
200
|
+
try {
|
|
201
|
+
resolved = which.sync(parsed.command, {
|
|
202
|
+
path: env[getPathKey({ env })],
|
|
203
|
+
pathExt: withoutPathExt ? path3.delimiter : void 0
|
|
204
|
+
});
|
|
205
|
+
} catch {
|
|
206
|
+
} finally {
|
|
207
|
+
shouldSwitchCwd && process.chdir(cwd);
|
|
208
|
+
}
|
|
209
|
+
return resolved && (resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved)), resolved;
|
|
210
|
+
}
|
|
211
|
+
function resolveCommand(parsed) {
|
|
212
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, !0);
|
|
213
|
+
}
|
|
214
|
+
module.exports = resolveCommand;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// ../../node_modules/cross-spawn/lib/util/escape.js
|
|
219
|
+
var require_escape = __commonJS({
|
|
220
|
+
"../../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
221
|
+
"use strict";
|
|
222
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
223
|
+
function escapeCommand(arg) {
|
|
224
|
+
return arg = arg.replace(metaCharsRegExp, "^$1"), arg;
|
|
225
|
+
}
|
|
226
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
227
|
+
return arg = `${arg}`, arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'), arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1"), arg = `"${arg}"`, arg = arg.replace(metaCharsRegExp, "^$1"), doubleEscapeMetaChars && (arg = arg.replace(metaCharsRegExp, "^$1")), arg;
|
|
228
|
+
}
|
|
229
|
+
module.exports.command = escapeCommand;
|
|
230
|
+
module.exports.argument = escapeArgument;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// ../../node_modules/shebang-regex/index.js
|
|
235
|
+
var require_shebang_regex = __commonJS({
|
|
236
|
+
"../../node_modules/shebang-regex/index.js"(exports, module) {
|
|
237
|
+
"use strict";
|
|
238
|
+
module.exports = /^#!(.*)/;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// ../../node_modules/shebang-command/index.js
|
|
243
|
+
var require_shebang_command = __commonJS({
|
|
244
|
+
"../../node_modules/shebang-command/index.js"(exports, module) {
|
|
245
|
+
"use strict";
|
|
246
|
+
var shebangRegex = require_shebang_regex();
|
|
247
|
+
module.exports = (string = "") => {
|
|
248
|
+
let match = string.match(shebangRegex);
|
|
249
|
+
if (!match)
|
|
250
|
+
return null;
|
|
251
|
+
let [path3, argument] = match[0].replace(/#! ?/, "").split(" "), binary = path3.split("/").pop();
|
|
252
|
+
return binary === "env" ? argument : argument ? `${binary} ${argument}` : binary;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// ../../node_modules/cross-spawn/lib/util/readShebang.js
|
|
258
|
+
var require_readShebang = __commonJS({
|
|
259
|
+
"../../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
260
|
+
"use strict";
|
|
261
|
+
var fs = __require("fs"), shebangCommand = require_shebang_command();
|
|
262
|
+
function readShebang(command) {
|
|
263
|
+
let buffer = Buffer.alloc(150), fd;
|
|
264
|
+
try {
|
|
265
|
+
fd = fs.openSync(command, "r"), fs.readSync(fd, buffer, 0, 150, 0), fs.closeSync(fd);
|
|
266
|
+
} catch {
|
|
267
|
+
}
|
|
268
|
+
return shebangCommand(buffer.toString());
|
|
269
|
+
}
|
|
270
|
+
module.exports = readShebang;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// ../../node_modules/cross-spawn/lib/parse.js
|
|
275
|
+
var require_parse = __commonJS({
|
|
276
|
+
"../../node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
277
|
+
"use strict";
|
|
278
|
+
var path3 = __require("path"), resolveCommand = require_resolveCommand(), escape = require_escape(), readShebang = require_readShebang(), isWin = process.platform === "win32", isExecutableRegExp = /\.(?:com|exe)$/i, isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
279
|
+
function detectShebang(parsed) {
|
|
280
|
+
parsed.file = resolveCommand(parsed);
|
|
281
|
+
let shebang = parsed.file && readShebang(parsed.file);
|
|
282
|
+
return shebang ? (parsed.args.unshift(parsed.file), parsed.command = shebang, resolveCommand(parsed)) : parsed.file;
|
|
283
|
+
}
|
|
284
|
+
function parseNonShell(parsed) {
|
|
285
|
+
if (!isWin)
|
|
286
|
+
return parsed;
|
|
287
|
+
let commandFile = detectShebang(parsed), needsShell = !isExecutableRegExp.test(commandFile);
|
|
288
|
+
if (parsed.options.forceShell || needsShell) {
|
|
289
|
+
let needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
290
|
+
parsed.command = path3.normalize(parsed.command), parsed.command = escape.command(parsed.command), parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
291
|
+
let shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
292
|
+
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`], parsed.command = process.env.comspec || "cmd.exe", parsed.options.windowsVerbatimArguments = !0;
|
|
293
|
+
}
|
|
294
|
+
return parsed;
|
|
295
|
+
}
|
|
296
|
+
function parse(command, args, options) {
|
|
297
|
+
args && !Array.isArray(args) && (options = args, args = null), args = args ? args.slice(0) : [], options = Object.assign({}, options);
|
|
298
|
+
let parsed = {
|
|
299
|
+
command,
|
|
300
|
+
args,
|
|
301
|
+
options,
|
|
302
|
+
file: void 0,
|
|
303
|
+
original: {
|
|
304
|
+
command,
|
|
305
|
+
args
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
return options.shell ? parsed : parseNonShell(parsed);
|
|
309
|
+
}
|
|
310
|
+
module.exports = parse;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// ../../node_modules/cross-spawn/lib/enoent.js
|
|
315
|
+
var require_enoent = __commonJS({
|
|
316
|
+
"../../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
317
|
+
"use strict";
|
|
318
|
+
var isWin = process.platform === "win32";
|
|
319
|
+
function notFoundError(original, syscall) {
|
|
320
|
+
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
321
|
+
code: "ENOENT",
|
|
322
|
+
errno: "ENOENT",
|
|
323
|
+
syscall: `${syscall} ${original.command}`,
|
|
324
|
+
path: original.command,
|
|
325
|
+
spawnargs: original.args
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function hookChildProcess(cp, parsed) {
|
|
329
|
+
if (!isWin)
|
|
330
|
+
return;
|
|
331
|
+
let originalEmit = cp.emit;
|
|
332
|
+
cp.emit = function(name, arg1) {
|
|
333
|
+
if (name === "exit") {
|
|
334
|
+
let err = verifyENOENT(arg1, parsed);
|
|
335
|
+
if (err)
|
|
336
|
+
return originalEmit.call(cp, "error", err);
|
|
337
|
+
}
|
|
338
|
+
return originalEmit.apply(cp, arguments);
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function verifyENOENT(status, parsed) {
|
|
342
|
+
return isWin && status === 1 && !parsed.file ? notFoundError(parsed.original, "spawn") : null;
|
|
343
|
+
}
|
|
344
|
+
function verifyENOENTSync(status, parsed) {
|
|
345
|
+
return isWin && status === 1 && !parsed.file ? notFoundError(parsed.original, "spawnSync") : null;
|
|
346
|
+
}
|
|
347
|
+
module.exports = {
|
|
348
|
+
hookChildProcess,
|
|
349
|
+
verifyENOENT,
|
|
350
|
+
verifyENOENTSync,
|
|
351
|
+
notFoundError
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
// ../../node_modules/cross-spawn/index.js
|
|
357
|
+
var require_cross_spawn = __commonJS({
|
|
358
|
+
"../../node_modules/cross-spawn/index.js"(exports, module) {
|
|
359
|
+
"use strict";
|
|
360
|
+
var cp = __require("child_process"), parse = require_parse(), enoent = require_enoent();
|
|
361
|
+
function spawn(command, args, options) {
|
|
362
|
+
let parsed = parse(command, args, options), spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
363
|
+
return enoent.hookChildProcess(spawned, parsed), spawned;
|
|
364
|
+
}
|
|
365
|
+
function spawnSync(command, args, options) {
|
|
366
|
+
let parsed = parse(command, args, options), result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
367
|
+
return result.error = result.error || enoent.verifyENOENTSync(result.status, parsed), result;
|
|
368
|
+
}
|
|
369
|
+
module.exports = spawn;
|
|
370
|
+
module.exports.spawn = spawn;
|
|
371
|
+
module.exports.sync = spawnSync;
|
|
372
|
+
module.exports._parse = parse;
|
|
373
|
+
module.exports._enoent = enoent;
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// ../../node_modules/merge-stream/index.js
|
|
378
|
+
var require_merge_stream = __commonJS({
|
|
379
|
+
"../../node_modules/merge-stream/index.js"(exports, module) {
|
|
380
|
+
"use strict";
|
|
381
|
+
var { PassThrough } = __require("stream");
|
|
382
|
+
module.exports = function() {
|
|
383
|
+
var sources = [], output = new PassThrough({ objectMode: !0 });
|
|
384
|
+
return output.setMaxListeners(0), output.add = add, output.isEmpty = isEmpty, output.on("unpipe", remove), Array.prototype.slice.call(arguments).forEach(add), output;
|
|
385
|
+
function add(source) {
|
|
386
|
+
return Array.isArray(source) ? (source.forEach(add), this) : (sources.push(source), source.once("end", remove.bind(null, source)), source.once("error", output.emit.bind(output, "error")), source.pipe(output, { end: !1 }), this);
|
|
387
|
+
}
|
|
388
|
+
function isEmpty() {
|
|
389
|
+
return sources.length == 0;
|
|
390
|
+
}
|
|
391
|
+
function remove(source) {
|
|
392
|
+
sources = sources.filter(function(it) {
|
|
393
|
+
return it !== source;
|
|
394
|
+
}), !sources.length && output.readable && output.end();
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// node_modules/execa/index.js
|
|
401
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
402
|
+
import { Buffer as Buffer3 } from "node:buffer";
|
|
403
|
+
import path2 from "node:path";
|
|
404
|
+
import childProcess from "node:child_process";
|
|
405
|
+
import process6 from "node:process";
|
|
406
|
+
|
|
407
|
+
// ../../node_modules/strip-final-newline/index.js
|
|
408
|
+
function stripFinalNewline(input) {
|
|
409
|
+
let LF = typeof input == "string" ? `
|
|
410
|
+
` : 10, CR = typeof input == "string" ? "\r" : 13;
|
|
411
|
+
return input[input.length - 1] === LF && (input = input.slice(0, -1)), input[input.length - 1] === CR && (input = input.slice(0, -1)), input;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// node_modules/npm-run-path/index.js
|
|
415
|
+
import process2 from "node:process";
|
|
416
|
+
import path from "node:path";
|
|
417
|
+
import { fileURLToPath } from "node:url";
|
|
418
|
+
|
|
419
|
+
// node_modules/path-key/index.js
|
|
420
|
+
function pathKey(options = {}) {
|
|
421
|
+
let {
|
|
422
|
+
env = process.env,
|
|
423
|
+
platform = process.platform
|
|
424
|
+
} = options;
|
|
425
|
+
return platform !== "win32" ? "PATH" : Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// node_modules/npm-run-path/index.js
|
|
429
|
+
var npmRunPath = ({
|
|
430
|
+
cwd = process2.cwd(),
|
|
431
|
+
path: pathOption = process2.env[pathKey()],
|
|
432
|
+
preferLocal = !0,
|
|
433
|
+
execPath = process2.execPath,
|
|
434
|
+
addExecPath = !0
|
|
435
|
+
} = {}) => {
|
|
436
|
+
let cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd, cwdPath = path.resolve(cwdString), result = [];
|
|
437
|
+
return preferLocal && applyPreferLocal(result, cwdPath), addExecPath && applyExecPath(result, execPath, cwdPath), [...result, pathOption].join(path.delimiter);
|
|
438
|
+
}, applyPreferLocal = (result, cwdPath) => {
|
|
439
|
+
let previous;
|
|
440
|
+
for (; previous !== cwdPath; )
|
|
441
|
+
result.push(path.join(cwdPath, "node_modules/.bin")), previous = cwdPath, cwdPath = path.resolve(cwdPath, "..");
|
|
442
|
+
}, applyExecPath = (result, execPath, cwdPath) => {
|
|
443
|
+
let execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
|
|
444
|
+
result.push(path.resolve(cwdPath, execPathString, ".."));
|
|
445
|
+
}, npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
|
|
446
|
+
env = { ...env };
|
|
447
|
+
let pathName = pathKey({ env });
|
|
448
|
+
return options.path = env[pathName], env[pathName] = npmRunPath(options), env;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// node_modules/mimic-fn/index.js
|
|
452
|
+
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
453
|
+
if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
|
|
454
|
+
return;
|
|
455
|
+
let toDescriptor = Object.getOwnPropertyDescriptor(to, property), fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
456
|
+
!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable || Object.defineProperty(to, property, fromDescriptor);
|
|
457
|
+
}, canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
458
|
+
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
459
|
+
}, changePrototype = (to, from) => {
|
|
460
|
+
let fromPrototype = Object.getPrototypeOf(from);
|
|
461
|
+
fromPrototype !== Object.getPrototypeOf(to) && Object.setPrototypeOf(to, fromPrototype);
|
|
462
|
+
}, wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
463
|
+
${fromBody}`, toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"), changeToString = (to, from, name) => {
|
|
464
|
+
let withName = name === "" ? "" : `with ${name.trim()}() `, newToString = wrappedToString.bind(null, withName, from.toString());
|
|
465
|
+
Object.defineProperty(newToString, "name", toStringName), Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
466
|
+
};
|
|
467
|
+
function mimicFunction(to, from, { ignoreNonConfigurable = !1 } = {}) {
|
|
468
|
+
let { name } = to;
|
|
469
|
+
for (let property of Reflect.ownKeys(from))
|
|
470
|
+
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
471
|
+
return changePrototype(to, from), changeToString(to, from, name), to;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// node_modules/onetime/index.js
|
|
475
|
+
var calledFunctions = /* @__PURE__ */ new WeakMap(), onetime = (function_, options = {}) => {
|
|
476
|
+
if (typeof function_ != "function")
|
|
477
|
+
throw new TypeError("Expected a function");
|
|
478
|
+
let returnValue, callCount = 0, functionName = function_.displayName || function_.name || "<anonymous>", onetime2 = function(...arguments_) {
|
|
479
|
+
if (calledFunctions.set(onetime2, ++callCount), callCount === 1)
|
|
480
|
+
returnValue = function_.apply(this, arguments_), function_ = null;
|
|
481
|
+
else if (options.throw === !0)
|
|
482
|
+
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
483
|
+
return returnValue;
|
|
484
|
+
};
|
|
485
|
+
return mimicFunction(onetime2, function_), calledFunctions.set(onetime2, callCount), onetime2;
|
|
486
|
+
};
|
|
487
|
+
onetime.callCount = (function_) => {
|
|
488
|
+
if (!calledFunctions.has(function_))
|
|
489
|
+
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
490
|
+
return calledFunctions.get(function_);
|
|
491
|
+
};
|
|
492
|
+
var onetime_default = onetime;
|
|
493
|
+
|
|
494
|
+
// node_modules/execa/lib/error.js
|
|
495
|
+
import process3 from "node:process";
|
|
496
|
+
|
|
497
|
+
// node_modules/human-signals/build/src/main.js
|
|
498
|
+
import { constants as constants2 } from "node:os";
|
|
499
|
+
|
|
500
|
+
// node_modules/human-signals/build/src/realtime.js
|
|
501
|
+
var getRealtimeSignals = () => {
|
|
502
|
+
let length = SIGRTMAX - SIGRTMIN + 1;
|
|
503
|
+
return Array.from({ length }, getRealtimeSignal);
|
|
504
|
+
}, getRealtimeSignal = (value, index) => ({
|
|
505
|
+
name: `SIGRT${index + 1}`,
|
|
506
|
+
number: SIGRTMIN + index,
|
|
507
|
+
action: "terminate",
|
|
508
|
+
description: "Application-specific signal (realtime)",
|
|
509
|
+
standard: "posix"
|
|
510
|
+
}), SIGRTMIN = 34, SIGRTMAX = 64;
|
|
511
|
+
|
|
512
|
+
// node_modules/human-signals/build/src/signals.js
|
|
513
|
+
import { constants } from "node:os";
|
|
514
|
+
|
|
515
|
+
// node_modules/human-signals/build/src/core.js
|
|
516
|
+
var SIGNALS = [
|
|
517
|
+
{
|
|
518
|
+
name: "SIGHUP",
|
|
519
|
+
number: 1,
|
|
520
|
+
action: "terminate",
|
|
521
|
+
description: "Terminal closed",
|
|
522
|
+
standard: "posix"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
name: "SIGINT",
|
|
526
|
+
number: 2,
|
|
527
|
+
action: "terminate",
|
|
528
|
+
description: "User interruption with CTRL-C",
|
|
529
|
+
standard: "ansi"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: "SIGQUIT",
|
|
533
|
+
number: 3,
|
|
534
|
+
action: "core",
|
|
535
|
+
description: "User interruption with CTRL-\\",
|
|
536
|
+
standard: "posix"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "SIGILL",
|
|
540
|
+
number: 4,
|
|
541
|
+
action: "core",
|
|
542
|
+
description: "Invalid machine instruction",
|
|
543
|
+
standard: "ansi"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: "SIGTRAP",
|
|
547
|
+
number: 5,
|
|
548
|
+
action: "core",
|
|
549
|
+
description: "Debugger breakpoint",
|
|
550
|
+
standard: "posix"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "SIGABRT",
|
|
554
|
+
number: 6,
|
|
555
|
+
action: "core",
|
|
556
|
+
description: "Aborted",
|
|
557
|
+
standard: "ansi"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
name: "SIGIOT",
|
|
561
|
+
number: 6,
|
|
562
|
+
action: "core",
|
|
563
|
+
description: "Aborted",
|
|
564
|
+
standard: "bsd"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: "SIGBUS",
|
|
568
|
+
number: 7,
|
|
569
|
+
action: "core",
|
|
570
|
+
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
571
|
+
standard: "bsd"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "SIGEMT",
|
|
575
|
+
number: 7,
|
|
576
|
+
action: "terminate",
|
|
577
|
+
description: "Command should be emulated but is not implemented",
|
|
578
|
+
standard: "other"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: "SIGFPE",
|
|
582
|
+
number: 8,
|
|
583
|
+
action: "core",
|
|
584
|
+
description: "Floating point arithmetic error",
|
|
585
|
+
standard: "ansi"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: "SIGKILL",
|
|
589
|
+
number: 9,
|
|
590
|
+
action: "terminate",
|
|
591
|
+
description: "Forced termination",
|
|
592
|
+
standard: "posix",
|
|
593
|
+
forced: !0
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: "SIGUSR1",
|
|
597
|
+
number: 10,
|
|
598
|
+
action: "terminate",
|
|
599
|
+
description: "Application-specific signal",
|
|
600
|
+
standard: "posix"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: "SIGSEGV",
|
|
604
|
+
number: 11,
|
|
605
|
+
action: "core",
|
|
606
|
+
description: "Segmentation fault",
|
|
607
|
+
standard: "ansi"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: "SIGUSR2",
|
|
611
|
+
number: 12,
|
|
612
|
+
action: "terminate",
|
|
613
|
+
description: "Application-specific signal",
|
|
614
|
+
standard: "posix"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: "SIGPIPE",
|
|
618
|
+
number: 13,
|
|
619
|
+
action: "terminate",
|
|
620
|
+
description: "Broken pipe or socket",
|
|
621
|
+
standard: "posix"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: "SIGALRM",
|
|
625
|
+
number: 14,
|
|
626
|
+
action: "terminate",
|
|
627
|
+
description: "Timeout or timer",
|
|
628
|
+
standard: "posix"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
name: "SIGTERM",
|
|
632
|
+
number: 15,
|
|
633
|
+
action: "terminate",
|
|
634
|
+
description: "Termination",
|
|
635
|
+
standard: "ansi"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
name: "SIGSTKFLT",
|
|
639
|
+
number: 16,
|
|
640
|
+
action: "terminate",
|
|
641
|
+
description: "Stack is empty or overflowed",
|
|
642
|
+
standard: "other"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "SIGCHLD",
|
|
646
|
+
number: 17,
|
|
647
|
+
action: "ignore",
|
|
648
|
+
description: "Child process terminated, paused or unpaused",
|
|
649
|
+
standard: "posix"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
name: "SIGCLD",
|
|
653
|
+
number: 17,
|
|
654
|
+
action: "ignore",
|
|
655
|
+
description: "Child process terminated, paused or unpaused",
|
|
656
|
+
standard: "other"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
name: "SIGCONT",
|
|
660
|
+
number: 18,
|
|
661
|
+
action: "unpause",
|
|
662
|
+
description: "Unpaused",
|
|
663
|
+
standard: "posix",
|
|
664
|
+
forced: !0
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: "SIGSTOP",
|
|
668
|
+
number: 19,
|
|
669
|
+
action: "pause",
|
|
670
|
+
description: "Paused",
|
|
671
|
+
standard: "posix",
|
|
672
|
+
forced: !0
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
name: "SIGTSTP",
|
|
676
|
+
number: 20,
|
|
677
|
+
action: "pause",
|
|
678
|
+
description: 'Paused using CTRL-Z or "suspend"',
|
|
679
|
+
standard: "posix"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "SIGTTIN",
|
|
683
|
+
number: 21,
|
|
684
|
+
action: "pause",
|
|
685
|
+
description: "Background process cannot read terminal input",
|
|
686
|
+
standard: "posix"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: "SIGBREAK",
|
|
690
|
+
number: 21,
|
|
691
|
+
action: "terminate",
|
|
692
|
+
description: "User interruption with CTRL-BREAK",
|
|
693
|
+
standard: "other"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: "SIGTTOU",
|
|
697
|
+
number: 22,
|
|
698
|
+
action: "pause",
|
|
699
|
+
description: "Background process cannot write to terminal output",
|
|
700
|
+
standard: "posix"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
name: "SIGURG",
|
|
704
|
+
number: 23,
|
|
705
|
+
action: "ignore",
|
|
706
|
+
description: "Socket received out-of-band data",
|
|
707
|
+
standard: "bsd"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
name: "SIGXCPU",
|
|
711
|
+
number: 24,
|
|
712
|
+
action: "core",
|
|
713
|
+
description: "Process timed out",
|
|
714
|
+
standard: "bsd"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: "SIGXFSZ",
|
|
718
|
+
number: 25,
|
|
719
|
+
action: "core",
|
|
720
|
+
description: "File too big",
|
|
721
|
+
standard: "bsd"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
name: "SIGVTALRM",
|
|
725
|
+
number: 26,
|
|
726
|
+
action: "terminate",
|
|
727
|
+
description: "Timeout or timer",
|
|
728
|
+
standard: "bsd"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: "SIGPROF",
|
|
732
|
+
number: 27,
|
|
733
|
+
action: "terminate",
|
|
734
|
+
description: "Timeout or timer",
|
|
735
|
+
standard: "bsd"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
name: "SIGWINCH",
|
|
739
|
+
number: 28,
|
|
740
|
+
action: "ignore",
|
|
741
|
+
description: "Terminal window size changed",
|
|
742
|
+
standard: "bsd"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
name: "SIGIO",
|
|
746
|
+
number: 29,
|
|
747
|
+
action: "terminate",
|
|
748
|
+
description: "I/O is available",
|
|
749
|
+
standard: "other"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
name: "SIGPOLL",
|
|
753
|
+
number: 29,
|
|
754
|
+
action: "terminate",
|
|
755
|
+
description: "Watched event",
|
|
756
|
+
standard: "other"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: "SIGINFO",
|
|
760
|
+
number: 29,
|
|
761
|
+
action: "ignore",
|
|
762
|
+
description: "Request for process information",
|
|
763
|
+
standard: "other"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "SIGPWR",
|
|
767
|
+
number: 30,
|
|
768
|
+
action: "terminate",
|
|
769
|
+
description: "Device running out of power",
|
|
770
|
+
standard: "systemv"
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
name: "SIGSYS",
|
|
774
|
+
number: 31,
|
|
775
|
+
action: "core",
|
|
776
|
+
description: "Invalid system call",
|
|
777
|
+
standard: "other"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
name: "SIGUNUSED",
|
|
781
|
+
number: 31,
|
|
782
|
+
action: "terminate",
|
|
783
|
+
description: "Invalid system call",
|
|
784
|
+
standard: "other"
|
|
785
|
+
}
|
|
786
|
+
];
|
|
787
|
+
|
|
788
|
+
// node_modules/human-signals/build/src/signals.js
|
|
789
|
+
var getSignals = () => {
|
|
790
|
+
let realtimeSignals = getRealtimeSignals();
|
|
791
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
792
|
+
}, normalizeSignal = ({
|
|
793
|
+
name,
|
|
794
|
+
number: defaultNumber,
|
|
795
|
+
description,
|
|
796
|
+
action,
|
|
797
|
+
forced = !1,
|
|
798
|
+
standard
|
|
799
|
+
}) => {
|
|
800
|
+
let {
|
|
801
|
+
signals: { [name]: constantSignal }
|
|
802
|
+
} = constants, supported = constantSignal !== void 0;
|
|
803
|
+
return { name, number: supported ? constantSignal : defaultNumber, description, supported, action, forced, standard };
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
// node_modules/human-signals/build/src/main.js
|
|
807
|
+
var getSignalsByName = () => {
|
|
808
|
+
let signals2 = getSignals();
|
|
809
|
+
return Object.fromEntries(signals2.map(getSignalByName));
|
|
810
|
+
}, getSignalByName = ({
|
|
811
|
+
name,
|
|
812
|
+
number,
|
|
813
|
+
description,
|
|
814
|
+
supported,
|
|
815
|
+
action,
|
|
816
|
+
forced,
|
|
817
|
+
standard
|
|
818
|
+
}) => [name, { name, number, description, supported, action, forced, standard }], signalsByName = getSignalsByName(), getSignalsByNumber = () => {
|
|
819
|
+
let signals2 = getSignals(), length = 65, signalsA = Array.from(
|
|
820
|
+
{ length },
|
|
821
|
+
(value, number) => getSignalByNumber(number, signals2)
|
|
822
|
+
);
|
|
823
|
+
return Object.assign({}, ...signalsA);
|
|
824
|
+
}, getSignalByNumber = (number, signals2) => {
|
|
825
|
+
let signal = findSignalByNumber(number, signals2);
|
|
826
|
+
if (signal === void 0)
|
|
827
|
+
return {};
|
|
828
|
+
let { name, description, supported, action, forced, standard } = signal;
|
|
829
|
+
return {
|
|
830
|
+
[number]: {
|
|
831
|
+
name,
|
|
832
|
+
number,
|
|
833
|
+
description,
|
|
834
|
+
supported,
|
|
835
|
+
action,
|
|
836
|
+
forced,
|
|
837
|
+
standard
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
}, findSignalByNumber = (number, signals2) => {
|
|
841
|
+
let signal = signals2.find(({ name }) => constants2.signals[name] === number);
|
|
842
|
+
return signal !== void 0 ? signal : signals2.find((signalA) => signalA.number === number);
|
|
843
|
+
}, signalsByNumber = getSignalsByNumber();
|
|
844
|
+
|
|
845
|
+
// node_modules/execa/lib/error.js
|
|
846
|
+
var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => timedOut ? `timed out after ${timeout} milliseconds` : isCanceled ? "was canceled" : errorCode !== void 0 ? `failed with ${errorCode}` : signal !== void 0 ? `was killed with ${signal} (${signalDescription})` : exitCode !== void 0 ? `failed with exit code ${exitCode}` : "failed", makeError = ({
|
|
847
|
+
stdout,
|
|
848
|
+
stderr,
|
|
849
|
+
all,
|
|
850
|
+
error,
|
|
851
|
+
signal,
|
|
852
|
+
exitCode,
|
|
853
|
+
command,
|
|
854
|
+
escapedCommand,
|
|
855
|
+
timedOut,
|
|
856
|
+
isCanceled,
|
|
857
|
+
killed,
|
|
858
|
+
parsed: { options: { timeout, cwd = process3.cwd() } }
|
|
859
|
+
}) => {
|
|
860
|
+
exitCode = exitCode === null ? void 0 : exitCode, signal = signal === null ? void 0 : signal;
|
|
861
|
+
let signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description, errorCode = error && error.code, execaMessage = `Command ${getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled })}: ${command}`, isError = Object.prototype.toString.call(error) === "[object Error]", shortMessage = isError ? `${execaMessage}
|
|
862
|
+
${error.message}` : execaMessage, message = [shortMessage, stderr, stdout].filter(Boolean).join(`
|
|
863
|
+
`);
|
|
864
|
+
return isError ? (error.originalMessage = error.message, error.message = message) : error = new Error(message), error.shortMessage = shortMessage, error.command = command, error.escapedCommand = escapedCommand, error.exitCode = exitCode, error.signal = signal, error.signalDescription = signalDescription, error.stdout = stdout, error.stderr = stderr, error.cwd = cwd, all !== void 0 && (error.all = all), "bufferedData" in error && delete error.bufferedData, error.failed = !0, error.timedOut = !!timedOut, error.isCanceled = isCanceled, error.killed = killed && !timedOut, error;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
// node_modules/execa/lib/stdio.js
|
|
868
|
+
var aliases = ["stdin", "stdout", "stderr"], hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0), normalizeStdio = (options) => {
|
|
869
|
+
if (!options)
|
|
870
|
+
return;
|
|
871
|
+
let { stdio } = options;
|
|
872
|
+
if (stdio === void 0)
|
|
873
|
+
return aliases.map((alias) => options[alias]);
|
|
874
|
+
if (hasAlias(options))
|
|
875
|
+
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
876
|
+
if (typeof stdio == "string")
|
|
877
|
+
return stdio;
|
|
878
|
+
if (!Array.isArray(stdio))
|
|
879
|
+
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
880
|
+
let length = Math.max(stdio.length, aliases.length);
|
|
881
|
+
return Array.from({ length }, (value, index) => stdio[index]);
|
|
882
|
+
}, normalizeStdioNode = (options) => {
|
|
883
|
+
let stdio = normalizeStdio(options);
|
|
884
|
+
return stdio === "ipc" ? "ipc" : stdio === void 0 || typeof stdio == "string" ? [stdio, stdio, stdio, "ipc"] : stdio.includes("ipc") ? stdio : [...stdio, "ipc"];
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
// node_modules/execa/lib/kill.js
|
|
888
|
+
import os from "node:os";
|
|
889
|
+
|
|
890
|
+
// node_modules/signal-exit/dist/mjs/signals.js
|
|
891
|
+
var signals = [];
|
|
892
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
893
|
+
process.platform !== "win32" && signals.push(
|
|
894
|
+
"SIGALRM",
|
|
895
|
+
"SIGABRT",
|
|
896
|
+
"SIGVTALRM",
|
|
897
|
+
"SIGXCPU",
|
|
898
|
+
"SIGXFSZ",
|
|
899
|
+
"SIGUSR2",
|
|
900
|
+
"SIGTRAP",
|
|
901
|
+
"SIGSYS",
|
|
902
|
+
"SIGQUIT",
|
|
903
|
+
"SIGIOT"
|
|
904
|
+
// should detect profiler and enable/disable accordingly.
|
|
905
|
+
// see #21
|
|
906
|
+
// 'SIGPROF'
|
|
907
|
+
);
|
|
908
|
+
process.platform === "linux" && signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
909
|
+
|
|
910
|
+
// node_modules/signal-exit/dist/mjs/index.js
|
|
911
|
+
var processOk = (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", kExitEmitter = Symbol.for("signal-exit emitter"), global2 = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object), Emitter = class {
|
|
912
|
+
emitted = {
|
|
913
|
+
afterExit: !1,
|
|
914
|
+
exit: !1
|
|
915
|
+
};
|
|
916
|
+
listeners = {
|
|
917
|
+
afterExit: [],
|
|
918
|
+
exit: []
|
|
919
|
+
};
|
|
920
|
+
count = 0;
|
|
921
|
+
id = Math.random();
|
|
922
|
+
constructor() {
|
|
923
|
+
if (global2[kExitEmitter])
|
|
924
|
+
return global2[kExitEmitter];
|
|
925
|
+
ObjectDefineProperty(global2, kExitEmitter, {
|
|
926
|
+
value: this,
|
|
927
|
+
writable: !1,
|
|
928
|
+
enumerable: !1,
|
|
929
|
+
configurable: !1
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
on(ev, fn) {
|
|
933
|
+
this.listeners[ev].push(fn);
|
|
934
|
+
}
|
|
935
|
+
removeListener(ev, fn) {
|
|
936
|
+
let list = this.listeners[ev], i = list.indexOf(fn);
|
|
937
|
+
i !== -1 && (i === 0 && list.length === 1 ? list.length = 0 : list.splice(i, 1));
|
|
938
|
+
}
|
|
939
|
+
emit(ev, code, signal) {
|
|
940
|
+
if (this.emitted[ev])
|
|
941
|
+
return !1;
|
|
942
|
+
this.emitted[ev] = !0;
|
|
943
|
+
let ret = !1;
|
|
944
|
+
for (let fn of this.listeners[ev])
|
|
945
|
+
ret = fn(code, signal) === !0 || ret;
|
|
946
|
+
return ev === "exit" && (ret = this.emit("afterExit", code, signal) || ret), ret;
|
|
947
|
+
}
|
|
948
|
+
}, SignalExitBase = class {
|
|
949
|
+
}, signalExitWrap = (handler) => ({
|
|
950
|
+
onExit(cb, opts) {
|
|
951
|
+
return handler.onExit(cb, opts);
|
|
952
|
+
},
|
|
953
|
+
load() {
|
|
954
|
+
return handler.load();
|
|
955
|
+
},
|
|
956
|
+
unload() {
|
|
957
|
+
return handler.unload();
|
|
958
|
+
}
|
|
959
|
+
}), SignalExitFallback = class extends SignalExitBase {
|
|
960
|
+
onExit() {
|
|
961
|
+
return () => {
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
load() {
|
|
965
|
+
}
|
|
966
|
+
unload() {
|
|
967
|
+
}
|
|
968
|
+
}, SignalExit = class extends SignalExitBase {
|
|
969
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
970
|
+
// so use a supported signal instead
|
|
971
|
+
/* c8 ignore start */
|
|
972
|
+
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
973
|
+
/* c8 ignore stop */
|
|
974
|
+
#emitter = new Emitter();
|
|
975
|
+
#process;
|
|
976
|
+
#originalProcessEmit;
|
|
977
|
+
#originalProcessReallyExit;
|
|
978
|
+
#sigListeners = {};
|
|
979
|
+
#loaded = !1;
|
|
980
|
+
constructor(process7) {
|
|
981
|
+
super(), this.#process = process7, this.#sigListeners = {};
|
|
982
|
+
for (let sig of signals)
|
|
983
|
+
this.#sigListeners[sig] = () => {
|
|
984
|
+
let listeners = this.#process.listeners(sig), { count } = this.#emitter, p = process7;
|
|
985
|
+
if (typeof p.__signal_exit_emitter__ == "object" && typeof p.__signal_exit_emitter__.count == "number" && (count += p.__signal_exit_emitter__.count), listeners.length === count) {
|
|
986
|
+
this.unload();
|
|
987
|
+
let ret = this.#emitter.emit("exit", null, sig), s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
988
|
+
ret || process7.kill(process7.pid, s);
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
this.#originalProcessReallyExit = process7.reallyExit, this.#originalProcessEmit = process7.emit;
|
|
992
|
+
}
|
|
993
|
+
onExit(cb, opts) {
|
|
994
|
+
if (!processOk(this.#process))
|
|
995
|
+
return () => {
|
|
996
|
+
};
|
|
997
|
+
this.#loaded === !1 && this.load();
|
|
998
|
+
let ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
999
|
+
return this.#emitter.on(ev, cb), () => {
|
|
1000
|
+
this.#emitter.removeListener(ev, cb), this.#emitter.listeners.exit.length === 0 && this.#emitter.listeners.afterExit.length === 0 && this.unload();
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
load() {
|
|
1004
|
+
if (!this.#loaded) {
|
|
1005
|
+
this.#loaded = !0, this.#emitter.count += 1;
|
|
1006
|
+
for (let sig of signals)
|
|
1007
|
+
try {
|
|
1008
|
+
let fn = this.#sigListeners[sig];
|
|
1009
|
+
fn && this.#process.on(sig, fn);
|
|
1010
|
+
} catch {
|
|
1011
|
+
}
|
|
1012
|
+
this.#process.emit = (ev, ...a) => this.#processEmit(ev, ...a), this.#process.reallyExit = (code) => this.#processReallyExit(code);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
unload() {
|
|
1016
|
+
this.#loaded && (this.#loaded = !1, signals.forEach((sig) => {
|
|
1017
|
+
let listener = this.#sigListeners[sig];
|
|
1018
|
+
if (!listener)
|
|
1019
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
1020
|
+
try {
|
|
1021
|
+
this.#process.removeListener(sig, listener);
|
|
1022
|
+
} catch {
|
|
1023
|
+
}
|
|
1024
|
+
}), this.#process.emit = this.#originalProcessEmit, this.#process.reallyExit = this.#originalProcessReallyExit, this.#emitter.count -= 1);
|
|
1025
|
+
}
|
|
1026
|
+
#processReallyExit(code) {
|
|
1027
|
+
return processOk(this.#process) ? (this.#process.exitCode = code || 0, this.#emitter.emit("exit", this.#process.exitCode, null), this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode)) : 0;
|
|
1028
|
+
}
|
|
1029
|
+
#processEmit(ev, ...args) {
|
|
1030
|
+
let og = this.#originalProcessEmit;
|
|
1031
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1032
|
+
typeof args[0] == "number" && (this.#process.exitCode = args[0]);
|
|
1033
|
+
let ret = og.call(this.#process, ev, ...args);
|
|
1034
|
+
return this.#emitter.emit("exit", this.#process.exitCode, null), ret;
|
|
1035
|
+
} else
|
|
1036
|
+
return og.call(this.#process, ev, ...args);
|
|
1037
|
+
}
|
|
1038
|
+
}, process4 = globalThis.process, {
|
|
1039
|
+
/**
|
|
1040
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
1041
|
+
* exit, or running out of stuff to do.
|
|
1042
|
+
*
|
|
1043
|
+
* If the global process object is not suitable for instrumentation,
|
|
1044
|
+
* then this will be a no-op.
|
|
1045
|
+
*
|
|
1046
|
+
* Returns a function that may be used to unload signal-exit.
|
|
1047
|
+
*/
|
|
1048
|
+
onExit,
|
|
1049
|
+
/**
|
|
1050
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
1051
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1052
|
+
* Mostly exposed for the benefit of testing.
|
|
1053
|
+
*
|
|
1054
|
+
* @internal
|
|
1055
|
+
*/
|
|
1056
|
+
load,
|
|
1057
|
+
/**
|
|
1058
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
1059
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1060
|
+
* Mostly exposed for the benefit of testing.
|
|
1061
|
+
*
|
|
1062
|
+
* @internal
|
|
1063
|
+
*/
|
|
1064
|
+
unload
|
|
1065
|
+
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
|
|
1066
|
+
|
|
1067
|
+
// node_modules/execa/lib/kill.js
|
|
1068
|
+
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5, spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
1069
|
+
let killResult = kill(signal);
|
|
1070
|
+
return setKillTimeout(kill, signal, options, killResult), killResult;
|
|
1071
|
+
}, setKillTimeout = (kill, signal, options, killResult) => {
|
|
1072
|
+
if (!shouldForceKill(signal, options, killResult))
|
|
1073
|
+
return;
|
|
1074
|
+
let timeout = getForceKillAfterTimeout(options), t = setTimeout(() => {
|
|
1075
|
+
kill("SIGKILL");
|
|
1076
|
+
}, timeout);
|
|
1077
|
+
t.unref && t.unref();
|
|
1078
|
+
}, shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== !1 && killResult, isSigterm = (signal) => signal === os.constants.signals.SIGTERM || typeof signal == "string" && signal.toUpperCase() === "SIGTERM", getForceKillAfterTimeout = ({ forceKillAfterTimeout = !0 }) => {
|
|
1079
|
+
if (forceKillAfterTimeout === !0)
|
|
1080
|
+
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
1081
|
+
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0)
|
|
1082
|
+
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
1083
|
+
return forceKillAfterTimeout;
|
|
1084
|
+
}, spawnedCancel = (spawned, context) => {
|
|
1085
|
+
spawned.kill() && (context.isCanceled = !0);
|
|
1086
|
+
}, timeoutKill = (spawned, signal, reject) => {
|
|
1087
|
+
spawned.kill(signal), reject(Object.assign(new Error("Timed out"), { timedOut: !0, signal }));
|
|
1088
|
+
}, setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
1089
|
+
if (timeout === 0 || timeout === void 0)
|
|
1090
|
+
return spawnedPromise;
|
|
1091
|
+
let timeoutId, timeoutPromise = new Promise((resolve, reject) => {
|
|
1092
|
+
timeoutId = setTimeout(() => {
|
|
1093
|
+
timeoutKill(spawned, killSignal, reject);
|
|
1094
|
+
}, timeout);
|
|
1095
|
+
}), safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
1096
|
+
clearTimeout(timeoutId);
|
|
1097
|
+
});
|
|
1098
|
+
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
1099
|
+
}, validateTimeout = ({ timeout }) => {
|
|
1100
|
+
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0))
|
|
1101
|
+
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
1102
|
+
}, setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
1103
|
+
if (!cleanup || detached)
|
|
1104
|
+
return timedPromise;
|
|
1105
|
+
let removeExitHandler = onExit(() => {
|
|
1106
|
+
spawned.kill();
|
|
1107
|
+
});
|
|
1108
|
+
return timedPromise.finally(() => {
|
|
1109
|
+
removeExitHandler();
|
|
1110
|
+
});
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
// node_modules/execa/lib/pipe.js
|
|
1114
|
+
import { createWriteStream } from "node:fs";
|
|
1115
|
+
import { ChildProcess } from "node:child_process";
|
|
1116
|
+
|
|
1117
|
+
// node_modules/is-stream/index.js
|
|
1118
|
+
function isStream(stream) {
|
|
1119
|
+
return stream !== null && typeof stream == "object" && typeof stream.pipe == "function";
|
|
1120
|
+
}
|
|
1121
|
+
function isWritableStream(stream) {
|
|
1122
|
+
return isStream(stream) && stream.writable !== !1 && typeof stream._write == "function" && typeof stream._writableState == "object";
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// node_modules/execa/lib/pipe.js
|
|
1126
|
+
var isExecaChildProcess = (target) => target instanceof ChildProcess && typeof target.then == "function", pipeToTarget = (spawned, streamName, target) => {
|
|
1127
|
+
if (typeof target == "string")
|
|
1128
|
+
return spawned[streamName].pipe(createWriteStream(target)), spawned;
|
|
1129
|
+
if (isWritableStream(target))
|
|
1130
|
+
return spawned[streamName].pipe(target), spawned;
|
|
1131
|
+
if (!isExecaChildProcess(target))
|
|
1132
|
+
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
1133
|
+
if (!isWritableStream(target.stdin))
|
|
1134
|
+
throw new TypeError("The target child process's stdin must be available.");
|
|
1135
|
+
return spawned[streamName].pipe(target.stdin), target;
|
|
1136
|
+
}, addPipeMethods = (spawned) => {
|
|
1137
|
+
spawned.stdout !== null && (spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout")), spawned.stderr !== null && (spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr")), spawned.all !== void 0 && (spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all"));
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
// node_modules/execa/lib/stream.js
|
|
1141
|
+
import { createReadStream, readFileSync } from "node:fs";
|
|
1142
|
+
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
1143
|
+
|
|
1144
|
+
// node_modules/get-stream/source/contents.js
|
|
1145
|
+
var getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
1146
|
+
if (!isAsyncIterable(stream))
|
|
1147
|
+
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
1148
|
+
let state = init();
|
|
1149
|
+
state.length = 0;
|
|
1150
|
+
try {
|
|
1151
|
+
for await (let chunk of stream) {
|
|
1152
|
+
let chunkType = getChunkType(chunk), convertedChunk = convertChunk[chunkType](chunk, state);
|
|
1153
|
+
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1154
|
+
}
|
|
1155
|
+
return appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }), finalize(state);
|
|
1156
|
+
} catch (error) {
|
|
1157
|
+
throw error.bufferedData = finalize(state), error;
|
|
1158
|
+
}
|
|
1159
|
+
}, appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
1160
|
+
let convertedChunk = getFinalChunk(state);
|
|
1161
|
+
convertedChunk !== void 0 && appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
1162
|
+
}, appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
1163
|
+
let chunkSize = getSize(convertedChunk), newLength = state.length + chunkSize;
|
|
1164
|
+
if (newLength <= maxBuffer) {
|
|
1165
|
+
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
let truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
1169
|
+
throw truncatedChunk !== void 0 && addNewChunk(truncatedChunk, state, addChunk, maxBuffer), new MaxBufferError();
|
|
1170
|
+
}, addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
1171
|
+
state.contents = addChunk(convertedChunk, state, newLength), state.length = newLength;
|
|
1172
|
+
}, isAsyncIterable = (stream) => typeof stream == "object" && stream !== null && typeof stream[Symbol.asyncIterator] == "function", getChunkType = (chunk) => {
|
|
1173
|
+
let typeOfChunk = typeof chunk;
|
|
1174
|
+
if (typeOfChunk === "string")
|
|
1175
|
+
return "string";
|
|
1176
|
+
if (typeOfChunk !== "object" || chunk === null)
|
|
1177
|
+
return "others";
|
|
1178
|
+
if (globalThis.Buffer?.isBuffer(chunk))
|
|
1179
|
+
return "buffer";
|
|
1180
|
+
let prototypeName = objectToString.call(chunk);
|
|
1181
|
+
return prototypeName === "[object ArrayBuffer]" ? "arrayBuffer" : prototypeName === "[object DataView]" ? "dataView" : Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]" ? "typedArray" : "others";
|
|
1182
|
+
}, { toString: objectToString } = Object.prototype, MaxBufferError = class extends Error {
|
|
1183
|
+
name = "MaxBufferError";
|
|
1184
|
+
constructor() {
|
|
1185
|
+
super("maxBuffer exceeded");
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
// node_modules/get-stream/source/utils.js
|
|
1190
|
+
var identity = (value) => value, noop = () => {
|
|
1191
|
+
}, getContentsProp = ({ contents }) => contents, throwObjectStream = (chunk) => {
|
|
1192
|
+
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
1193
|
+
}, getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
1194
|
+
|
|
1195
|
+
// node_modules/get-stream/source/array-buffer.js
|
|
1196
|
+
async function getStreamAsArrayBuffer(stream, options) {
|
|
1197
|
+
return getStreamContents(stream, arrayBufferMethods, options);
|
|
1198
|
+
}
|
|
1199
|
+
var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) }), useTextEncoder = (chunk) => textEncoder.encode(chunk), textEncoder = new TextEncoder(), useUint8Array = (chunk) => new Uint8Array(chunk), useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength), truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
1200
|
+
let newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
1201
|
+
return new Uint8Array(newContents).set(convertedChunk, previousLength), newContents;
|
|
1202
|
+
}, resizeArrayBufferSlow = (contents, length) => {
|
|
1203
|
+
if (length <= contents.byteLength)
|
|
1204
|
+
return contents;
|
|
1205
|
+
let arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
1206
|
+
return new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0), arrayBuffer;
|
|
1207
|
+
}, resizeArrayBuffer = (contents, length) => {
|
|
1208
|
+
if (length <= contents.maxByteLength)
|
|
1209
|
+
return contents.resize(length), contents;
|
|
1210
|
+
let arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
1211
|
+
return new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0), arrayBuffer;
|
|
1212
|
+
}, getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)), SCALE_FACTOR = 2, finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length), hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype, arrayBufferMethods = {
|
|
1213
|
+
init: initArrayBuffer,
|
|
1214
|
+
convertChunk: {
|
|
1215
|
+
string: useTextEncoder,
|
|
1216
|
+
buffer: useUint8Array,
|
|
1217
|
+
arrayBuffer: useUint8Array,
|
|
1218
|
+
dataView: useUint8ArrayWithOffset,
|
|
1219
|
+
typedArray: useUint8ArrayWithOffset,
|
|
1220
|
+
others: throwObjectStream
|
|
1221
|
+
},
|
|
1222
|
+
getSize: getLengthProp,
|
|
1223
|
+
truncateChunk: truncateArrayBufferChunk,
|
|
1224
|
+
addChunk: addArrayBufferChunk,
|
|
1225
|
+
getFinalChunk: noop,
|
|
1226
|
+
finalize: finalizeArrayBuffer
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
// node_modules/get-stream/source/buffer.js
|
|
1230
|
+
async function getStreamAsBuffer(stream, options) {
|
|
1231
|
+
if (!("Buffer" in globalThis))
|
|
1232
|
+
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
1233
|
+
try {
|
|
1234
|
+
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
1235
|
+
} catch (error) {
|
|
1236
|
+
throw error.bufferedData !== void 0 && (error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData)), error;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
1240
|
+
|
|
1241
|
+
// node_modules/get-stream/source/string.js
|
|
1242
|
+
async function getStreamAsString(stream, options) {
|
|
1243
|
+
return getStreamContents(stream, stringMethods, options);
|
|
1244
|
+
}
|
|
1245
|
+
var initString = () => ({ contents: "", textDecoder: new TextDecoder() }), useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: !0 }), addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk, truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), getFinalStringChunk = ({ textDecoder }) => {
|
|
1246
|
+
let finalChunk = textDecoder.decode();
|
|
1247
|
+
return finalChunk === "" ? void 0 : finalChunk;
|
|
1248
|
+
}, stringMethods = {
|
|
1249
|
+
init: initString,
|
|
1250
|
+
convertChunk: {
|
|
1251
|
+
string: identity,
|
|
1252
|
+
buffer: useTextDecoder,
|
|
1253
|
+
arrayBuffer: useTextDecoder,
|
|
1254
|
+
dataView: useTextDecoder,
|
|
1255
|
+
typedArray: useTextDecoder,
|
|
1256
|
+
others: throwObjectStream
|
|
1257
|
+
},
|
|
1258
|
+
getSize: getLengthProp,
|
|
1259
|
+
truncateChunk: truncateStringChunk,
|
|
1260
|
+
addChunk: addStringChunk,
|
|
1261
|
+
getFinalChunk: getFinalStringChunk,
|
|
1262
|
+
finalize: getContentsProp
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
// node_modules/execa/lib/stream.js
|
|
1266
|
+
var import_merge_stream = __toESM(require_merge_stream(), 1), validateInputOptions = (input) => {
|
|
1267
|
+
if (input !== void 0)
|
|
1268
|
+
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
1269
|
+
}, getInputSync = ({ input, inputFile }) => typeof inputFile != "string" ? input : (validateInputOptions(input), readFileSync(inputFile)), handleInputSync = (options) => {
|
|
1270
|
+
let input = getInputSync(options);
|
|
1271
|
+
if (isStream(input))
|
|
1272
|
+
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
1273
|
+
return input;
|
|
1274
|
+
}, getInput = ({ input, inputFile }) => typeof inputFile != "string" ? input : (validateInputOptions(input), createReadStream(inputFile)), handleInput = (spawned, options) => {
|
|
1275
|
+
let input = getInput(options);
|
|
1276
|
+
input !== void 0 && (isStream(input) ? input.pipe(spawned.stdin) : spawned.stdin.end(input));
|
|
1277
|
+
}, makeAllStream = (spawned, { all }) => {
|
|
1278
|
+
if (!all || !spawned.stdout && !spawned.stderr)
|
|
1279
|
+
return;
|
|
1280
|
+
let mixed = (0, import_merge_stream.default)();
|
|
1281
|
+
return spawned.stdout && mixed.add(spawned.stdout), spawned.stderr && mixed.add(spawned.stderr), mixed;
|
|
1282
|
+
}, getBufferedData = async (stream, streamPromise) => {
|
|
1283
|
+
if (!(!stream || streamPromise === void 0)) {
|
|
1284
|
+
await setTimeout2(0), stream.destroy();
|
|
1285
|
+
try {
|
|
1286
|
+
return await streamPromise;
|
|
1287
|
+
} catch (error) {
|
|
1288
|
+
return error.bufferedData;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
}, getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
1292
|
+
if (!(!stream || !buffer))
|
|
1293
|
+
return encoding === "utf8" || encoding === "utf-8" ? getStreamAsString(stream, { maxBuffer }) : encoding === null || encoding === "buffer" ? getStreamAsBuffer(stream, { maxBuffer }) : applyEncoding(stream, maxBuffer, encoding);
|
|
1294
|
+
}, applyEncoding = async (stream, maxBuffer, encoding) => (await getStreamAsBuffer(stream, { maxBuffer })).toString(encoding), getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1295
|
+
let stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer }), stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer }), allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
1296
|
+
try {
|
|
1297
|
+
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
1298
|
+
} catch (error) {
|
|
1299
|
+
return Promise.all([
|
|
1300
|
+
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
1301
|
+
getBufferedData(stdout, stdoutPromise),
|
|
1302
|
+
getBufferedData(stderr, stderrPromise),
|
|
1303
|
+
getBufferedData(all, allPromise)
|
|
1304
|
+
]);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
// node_modules/execa/lib/promise.js
|
|
1309
|
+
var nativePromisePrototype = (async () => {
|
|
1310
|
+
})().constructor.prototype, descriptors = ["then", "catch", "finally"].map((property) => [
|
|
1311
|
+
property,
|
|
1312
|
+
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
1313
|
+
]), mergePromise = (spawned, promise) => {
|
|
1314
|
+
for (let [property, descriptor] of descriptors) {
|
|
1315
|
+
let value = typeof promise == "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
1316
|
+
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
1317
|
+
}
|
|
1318
|
+
}, getSpawnedPromise = (spawned) => new Promise((resolve, reject) => {
|
|
1319
|
+
spawned.on("exit", (exitCode, signal) => {
|
|
1320
|
+
resolve({ exitCode, signal });
|
|
1321
|
+
}), spawned.on("error", (error) => {
|
|
1322
|
+
reject(error);
|
|
1323
|
+
}), spawned.stdin && spawned.stdin.on("error", (error) => {
|
|
1324
|
+
reject(error);
|
|
1325
|
+
});
|
|
1326
|
+
});
|
|
1327
|
+
|
|
1328
|
+
// node_modules/execa/lib/command.js
|
|
1329
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
1330
|
+
import { ChildProcess as ChildProcess2 } from "node:child_process";
|
|
1331
|
+
var normalizeArgs = (file, args = []) => Array.isArray(args) ? [file, ...args] : [file], NO_ESCAPE_REGEXP = /^[\w.-]+$/, escapeArg = (arg) => typeof arg != "string" || NO_ESCAPE_REGEXP.test(arg) ? arg : `"${arg.replaceAll('"', '\\"')}"`, joinCommand = (file, args) => normalizeArgs(file, args).join(" "), getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), SPACES_REGEXP = / +/g;
|
|
1332
|
+
var parseExpression = (expression) => {
|
|
1333
|
+
let typeOfExpression = typeof expression;
|
|
1334
|
+
if (typeOfExpression === "string")
|
|
1335
|
+
return expression;
|
|
1336
|
+
if (typeOfExpression === "number")
|
|
1337
|
+
return String(expression);
|
|
1338
|
+
if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
|
|
1339
|
+
let typeOfStdout = typeof expression.stdout;
|
|
1340
|
+
if (typeOfStdout === "string")
|
|
1341
|
+
return expression.stdout;
|
|
1342
|
+
if (Buffer2.isBuffer(expression.stdout))
|
|
1343
|
+
return expression.stdout.toString();
|
|
1344
|
+
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
1345
|
+
}
|
|
1346
|
+
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
1347
|
+
}, concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
1348
|
+
...tokens.slice(0, -1),
|
|
1349
|
+
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
1350
|
+
...nextTokens.slice(1)
|
|
1351
|
+
], parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
1352
|
+
let templateString = template ?? templates.raw[index], templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean), newTokens = concatTokens(
|
|
1353
|
+
tokens,
|
|
1354
|
+
templateTokens,
|
|
1355
|
+
templateString.startsWith(" ")
|
|
1356
|
+
);
|
|
1357
|
+
if (index === expressions.length)
|
|
1358
|
+
return newTokens;
|
|
1359
|
+
let expression = expressions[index], expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
1360
|
+
return concatTokens(
|
|
1361
|
+
newTokens,
|
|
1362
|
+
expressionTokens,
|
|
1363
|
+
templateString.endsWith(" ")
|
|
1364
|
+
);
|
|
1365
|
+
}, parseTemplates = (templates, expressions) => {
|
|
1366
|
+
let tokens = [];
|
|
1367
|
+
for (let [index, template] of templates.entries())
|
|
1368
|
+
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
1369
|
+
return tokens;
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
// node_modules/execa/lib/verbose.js
|
|
1373
|
+
import { debuglog } from "node:util";
|
|
1374
|
+
import process5 from "node:process";
|
|
1375
|
+
var verboseDefault = debuglog("execa").enabled, padField = (field, padding) => String(field).padStart(padding, "0"), getTimestamp = () => {
|
|
1376
|
+
let date = /* @__PURE__ */ new Date();
|
|
1377
|
+
return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
|
|
1378
|
+
}, logCommand = (escapedCommand, { verbose }) => {
|
|
1379
|
+
verbose && process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
1380
|
+
`);
|
|
1381
|
+
};
|
|
1382
|
+
|
|
1383
|
+
// node_modules/execa/index.js
|
|
1384
|
+
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100, getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
1385
|
+
let env = extendEnv ? { ...process6.env, ...envOption } : envOption;
|
|
1386
|
+
return preferLocal ? npmRunPathEnv({ env, cwd: localDir, execPath }) : env;
|
|
1387
|
+
}, handleArguments = (file, args, options = {}) => {
|
|
1388
|
+
let parsed = import_cross_spawn.default._parse(file, args, options);
|
|
1389
|
+
return file = parsed.command, args = parsed.args, options = parsed.options, options = {
|
|
1390
|
+
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
1391
|
+
buffer: !0,
|
|
1392
|
+
stripFinalNewline: !0,
|
|
1393
|
+
extendEnv: !0,
|
|
1394
|
+
preferLocal: !1,
|
|
1395
|
+
localDir: options.cwd || process6.cwd(),
|
|
1396
|
+
execPath: process6.execPath,
|
|
1397
|
+
encoding: "utf8",
|
|
1398
|
+
reject: !0,
|
|
1399
|
+
cleanup: !0,
|
|
1400
|
+
all: !1,
|
|
1401
|
+
windowsHide: !0,
|
|
1402
|
+
verbose: verboseDefault,
|
|
1403
|
+
...options
|
|
1404
|
+
}, options.env = getEnv(options), options.stdio = normalizeStdio(options), process6.platform === "win32" && path2.basename(file, ".exe") === "cmd" && args.unshift("/q"), { file, args, options, parsed };
|
|
1405
|
+
}, handleOutput = (options, value, error) => typeof value != "string" && !Buffer3.isBuffer(value) ? error === void 0 ? void 0 : "" : options.stripFinalNewline ? stripFinalNewline(value) : value;
|
|
1406
|
+
function execa(file, args, options) {
|
|
1407
|
+
let parsed = handleArguments(file, args, options), command = joinCommand(file, args), escapedCommand = getEscapedCommand(file, args);
|
|
1408
|
+
logCommand(escapedCommand, parsed.options), validateTimeout(parsed.options);
|
|
1409
|
+
let spawned;
|
|
1410
|
+
try {
|
|
1411
|
+
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
1412
|
+
} catch (error) {
|
|
1413
|
+
let dummySpawned = new childProcess.ChildProcess(), errorPromise = Promise.reject(makeError({
|
|
1414
|
+
error,
|
|
1415
|
+
stdout: "",
|
|
1416
|
+
stderr: "",
|
|
1417
|
+
all: "",
|
|
1418
|
+
command,
|
|
1419
|
+
escapedCommand,
|
|
1420
|
+
parsed,
|
|
1421
|
+
timedOut: !1,
|
|
1422
|
+
isCanceled: !1,
|
|
1423
|
+
killed: !1
|
|
1424
|
+
}));
|
|
1425
|
+
return mergePromise(dummySpawned, errorPromise), dummySpawned;
|
|
1426
|
+
}
|
|
1427
|
+
let spawnedPromise = getSpawnedPromise(spawned), timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise), processDone = setExitHandler(spawned, parsed.options, timedPromise), context = { isCanceled: !1 };
|
|
1428
|
+
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)), spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
1429
|
+
let handlePromiseOnce = onetime_default(async () => {
|
|
1430
|
+
let [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone), stdout = handleOutput(parsed.options, stdoutResult), stderr = handleOutput(parsed.options, stderrResult), all = handleOutput(parsed.options, allResult);
|
|
1431
|
+
if (error || exitCode !== 0 || signal !== null) {
|
|
1432
|
+
let returnedError = makeError({
|
|
1433
|
+
error,
|
|
1434
|
+
exitCode,
|
|
1435
|
+
signal,
|
|
1436
|
+
stdout,
|
|
1437
|
+
stderr,
|
|
1438
|
+
all,
|
|
1439
|
+
command,
|
|
1440
|
+
escapedCommand,
|
|
1441
|
+
parsed,
|
|
1442
|
+
timedOut,
|
|
1443
|
+
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : !1),
|
|
1444
|
+
killed: spawned.killed
|
|
1445
|
+
});
|
|
1446
|
+
if (!parsed.options.reject)
|
|
1447
|
+
return returnedError;
|
|
1448
|
+
throw returnedError;
|
|
1449
|
+
}
|
|
1450
|
+
return {
|
|
1451
|
+
command,
|
|
1452
|
+
escapedCommand,
|
|
1453
|
+
exitCode: 0,
|
|
1454
|
+
stdout,
|
|
1455
|
+
stderr,
|
|
1456
|
+
all,
|
|
1457
|
+
failed: !1,
|
|
1458
|
+
timedOut: !1,
|
|
1459
|
+
isCanceled: !1,
|
|
1460
|
+
killed: !1
|
|
1461
|
+
};
|
|
1462
|
+
});
|
|
1463
|
+
return handleInput(spawned, parsed.options), spawned.all = makeAllStream(spawned, parsed.options), addPipeMethods(spawned), mergePromise(spawned, handlePromiseOnce), spawned;
|
|
1464
|
+
}
|
|
1465
|
+
function execaSync(file, args, options) {
|
|
1466
|
+
let parsed = handleArguments(file, args, options), command = joinCommand(file, args), escapedCommand = getEscapedCommand(file, args);
|
|
1467
|
+
logCommand(escapedCommand, parsed.options);
|
|
1468
|
+
let input = handleInputSync(parsed.options), result;
|
|
1469
|
+
try {
|
|
1470
|
+
result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
1471
|
+
} catch (error) {
|
|
1472
|
+
throw makeError({
|
|
1473
|
+
error,
|
|
1474
|
+
stdout: "",
|
|
1475
|
+
stderr: "",
|
|
1476
|
+
all: "",
|
|
1477
|
+
command,
|
|
1478
|
+
escapedCommand,
|
|
1479
|
+
parsed,
|
|
1480
|
+
timedOut: !1,
|
|
1481
|
+
isCanceled: !1,
|
|
1482
|
+
killed: !1
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
let stdout = handleOutput(parsed.options, result.stdout, result.error), stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
1486
|
+
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
1487
|
+
let error = makeError({
|
|
1488
|
+
stdout,
|
|
1489
|
+
stderr,
|
|
1490
|
+
error: result.error,
|
|
1491
|
+
signal: result.signal,
|
|
1492
|
+
exitCode: result.status,
|
|
1493
|
+
command,
|
|
1494
|
+
escapedCommand,
|
|
1495
|
+
parsed,
|
|
1496
|
+
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
1497
|
+
isCanceled: !1,
|
|
1498
|
+
killed: result.signal !== null
|
|
1499
|
+
});
|
|
1500
|
+
if (!parsed.options.reject)
|
|
1501
|
+
return error;
|
|
1502
|
+
throw error;
|
|
1503
|
+
}
|
|
1504
|
+
return {
|
|
1505
|
+
command,
|
|
1506
|
+
escapedCommand,
|
|
1507
|
+
exitCode: 0,
|
|
1508
|
+
stdout,
|
|
1509
|
+
stderr,
|
|
1510
|
+
failed: !1,
|
|
1511
|
+
timedOut: !1,
|
|
1512
|
+
isCanceled: !1,
|
|
1513
|
+
killed: !1
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}, normalizeScriptOptions = (options = {}) => ({
|
|
1517
|
+
preferLocal: !0,
|
|
1518
|
+
...normalizeScriptStdin(options),
|
|
1519
|
+
...options
|
|
1520
|
+
});
|
|
1521
|
+
function create$(options) {
|
|
1522
|
+
function $2(templatesOrOptions, ...expressions) {
|
|
1523
|
+
if (!Array.isArray(templatesOrOptions))
|
|
1524
|
+
return create$({ ...options, ...templatesOrOptions });
|
|
1525
|
+
let [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
1526
|
+
return execa(file, args, normalizeScriptOptions(options));
|
|
1527
|
+
}
|
|
1528
|
+
return $2.sync = (templates, ...expressions) => {
|
|
1529
|
+
if (!Array.isArray(templates))
|
|
1530
|
+
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
1531
|
+
let [file, ...args] = parseTemplates(templates, expressions);
|
|
1532
|
+
return execaSync(file, args, normalizeScriptOptions(options));
|
|
1533
|
+
}, $2;
|
|
1534
|
+
}
|
|
1535
|
+
var $ = create$();
|
|
1536
|
+
function execaNode(scriptPath, args, options = {}) {
|
|
1537
|
+
args && !Array.isArray(args) && typeof args == "object" && (options = args, args = []);
|
|
1538
|
+
let stdio = normalizeStdioNode(options), defaultExecArgv = process6.execArgv.filter((arg) => !arg.startsWith("--inspect")), {
|
|
1539
|
+
nodePath = process6.execPath,
|
|
1540
|
+
nodeOptions = defaultExecArgv
|
|
1541
|
+
} = options;
|
|
1542
|
+
return execa(
|
|
1543
|
+
nodePath,
|
|
1544
|
+
[
|
|
1545
|
+
...nodeOptions,
|
|
1546
|
+
scriptPath,
|
|
1547
|
+
...Array.isArray(args) ? args : []
|
|
1548
|
+
],
|
|
1549
|
+
{
|
|
1550
|
+
...options,
|
|
1551
|
+
stdin: void 0,
|
|
1552
|
+
stdout: void 0,
|
|
1553
|
+
stderr: void 0,
|
|
1554
|
+
stdio,
|
|
1555
|
+
shell: !1
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
// ../../core/src/shared/utils/module.ts
|
|
1561
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
|
|
1562
|
+
|
|
1563
|
+
// ../../node_modules/exsolve/dist/index.mjs
|
|
1564
|
+
import assert from "node:assert";
|
|
1565
|
+
import v8 from "node:v8";
|
|
1566
|
+
import { format, inspect } from "node:util";
|
|
1567
|
+
var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
|
1568
|
+
"string",
|
|
1569
|
+
"function",
|
|
1570
|
+
"number",
|
|
1571
|
+
"object",
|
|
1572
|
+
"Function",
|
|
1573
|
+
"Object",
|
|
1574
|
+
"boolean",
|
|
1575
|
+
"bigint",
|
|
1576
|
+
"symbol"
|
|
1577
|
+
]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
|
|
1578
|
+
function formatList(array, type = "and") {
|
|
1579
|
+
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
1580
|
+
}
|
|
1581
|
+
function createError(sym, value, constructor) {
|
|
1582
|
+
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
|
1583
|
+
}
|
|
1584
|
+
function makeNodeErrorWithCode(Base, key) {
|
|
1585
|
+
return function(...parameters) {
|
|
1586
|
+
let limit = Error.stackTraceLimit;
|
|
1587
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
1588
|
+
let error = new Base();
|
|
1589
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
|
|
1590
|
+
let message = getMessage(key, parameters, error);
|
|
1591
|
+
return Object.defineProperties(error, {
|
|
1592
|
+
message: {
|
|
1593
|
+
value: message,
|
|
1594
|
+
enumerable: !1,
|
|
1595
|
+
writable: !0,
|
|
1596
|
+
configurable: !0
|
|
1597
|
+
},
|
|
1598
|
+
toString: {
|
|
1599
|
+
value() {
|
|
1600
|
+
return `${this.name} [${key}]: ${this.message}`;
|
|
1601
|
+
},
|
|
1602
|
+
enumerable: !1,
|
|
1603
|
+
writable: !0,
|
|
1604
|
+
configurable: !0
|
|
1605
|
+
}
|
|
1606
|
+
}), captureLargerStackTrace(error), error.code = key, error;
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1609
|
+
function isErrorStackTraceLimitWritable() {
|
|
1610
|
+
try {
|
|
1611
|
+
if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
|
|
1612
|
+
} catch {
|
|
1613
|
+
}
|
|
1614
|
+
let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
1615
|
+
return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
1616
|
+
}
|
|
1617
|
+
function hideStackFrames(wrappedFunction) {
|
|
1618
|
+
let hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
1619
|
+
return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
|
|
1620
|
+
}
|
|
1621
|
+
var captureLargerStackTrace = hideStackFrames(function(error) {
|
|
1622
|
+
let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
1623
|
+
return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
|
|
1624
|
+
});
|
|
1625
|
+
function getMessage(key, parameters, self) {
|
|
1626
|
+
let message = messages.get(key);
|
|
1627
|
+
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
|
1628
|
+
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
|
1629
|
+
let regex = /%[dfijoOs]/g, expectedLength = 0;
|
|
1630
|
+
for (; regex.exec(message) !== null; ) expectedLength++;
|
|
1631
|
+
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
|
1632
|
+
}
|
|
1633
|
+
function determineSpecificType(value) {
|
|
1634
|
+
if (value == null) return String(value);
|
|
1635
|
+
if (typeof value == "function" && value.name) return `function ${value.name}`;
|
|
1636
|
+
if (typeof value == "object")
|
|
1637
|
+
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
|
1638
|
+
let inspected = inspect(value, { colors: !1 });
|
|
1639
|
+
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
|
|
1640
|
+
}
|
|
1641
|
+
var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
1642
|
+
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
|
1643
|
+
let message = "The ";
|
|
1644
|
+
if (name.endsWith(" argument")) message += `${name} `;
|
|
1645
|
+
else {
|
|
1646
|
+
let type = name.includes(".") ? "property" : "argument";
|
|
1647
|
+
message += `"${name}" ${type} `;
|
|
1648
|
+
}
|
|
1649
|
+
message += "must be ";
|
|
1650
|
+
let types = [], instances = [], other = [];
|
|
1651
|
+
for (let value of expected)
|
|
1652
|
+
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
|
1653
|
+
if (instances.length > 0) {
|
|
1654
|
+
let pos = types.indexOf("object");
|
|
1655
|
+
pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
|
|
1656
|
+
}
|
|
1657
|
+
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
|
1658
|
+
}, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
1659
|
+
"ERR_INVALID_MODULE_SPECIFIER",
|
|
1660
|
+
/**
|
|
1661
|
+
* @param {string} request
|
|
1662
|
+
* @param {string} reason
|
|
1663
|
+
* @param {string} [base]
|
|
1664
|
+
*/
|
|
1665
|
+
(request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
|
|
1666
|
+
TypeError
|
|
1667
|
+
), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
|
1668
|
+
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
1669
|
+
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
1670
|
+
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
1671
|
+
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
1672
|
+
/**
|
|
1673
|
+
* @param {string} packagePath
|
|
1674
|
+
* @param {string} subpath
|
|
1675
|
+
* @param {string} [base]
|
|
1676
|
+
*/
|
|
1677
|
+
(packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
|
|
1678
|
+
Error
|
|
1679
|
+
), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
1680
|
+
let inspected = inspect(value);
|
|
1681
|
+
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
1682
|
+
}, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
|
|
1683
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
1684
|
+
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
1685
|
+
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
1686
|
+
|
|
1687
|
+
// ../../core/src/shared/utils/module.ts
|
|
1688
|
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
1689
|
+
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
1690
|
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
1691
|
+
|
|
1692
|
+
export {
|
|
1693
|
+
execa,
|
|
1694
|
+
execaNode,
|
|
1695
|
+
importMetaResolve,
|
|
1696
|
+
resolvePackageDir
|
|
1697
|
+
};
|