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