@vercel/build-utils 13.3.0 → 13.3.2
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/CHANGELOG.md +17 -0
- package/build.mjs +11 -1
- package/dist/file-blob.js +8 -1
- package/dist/get-service-url-env-vars.d.ts +28 -0
- package/dist/get-service-url-env-vars.js +76 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +71 -1942
- package/dist/python.d.ts +0 -13
- package/dist/python.js +4 -37
- package/package.json +6 -3
- package/lib/python/ast_parser.py +0 -72
- package/lib/python/tests/test_ast_parser.py +0 -72
package/dist/index.js
CHANGED
|
@@ -318,7 +318,7 @@ var require_BufferList = __commonJS({
|
|
|
318
318
|
this.head = this.tail = null;
|
|
319
319
|
this.length = 0;
|
|
320
320
|
};
|
|
321
|
-
BufferList.prototype.join = function
|
|
321
|
+
BufferList.prototype.join = function join5(s) {
|
|
322
322
|
if (this.length === 0)
|
|
323
323
|
return "";
|
|
324
324
|
var p = this.head;
|
|
@@ -14144,7 +14144,7 @@ var require_parse = __commonJS({
|
|
|
14144
14144
|
var escape = require_escape();
|
|
14145
14145
|
var readShebang = require_readShebang();
|
|
14146
14146
|
var semver = require_semver();
|
|
14147
|
-
var
|
|
14147
|
+
var isWin2 = process.platform === "win32";
|
|
14148
14148
|
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
14149
14149
|
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
14150
14150
|
var supportsShellOption = niceTry(() => semver.satisfies(process.version, "^4.8.0 || ^5.7.0 || >= 6.0.0", true)) || false;
|
|
@@ -14159,7 +14159,7 @@ var require_parse = __commonJS({
|
|
|
14159
14159
|
return parsed.file;
|
|
14160
14160
|
}
|
|
14161
14161
|
function parseNonShell(parsed) {
|
|
14162
|
-
if (!
|
|
14162
|
+
if (!isWin2) {
|
|
14163
14163
|
return parsed;
|
|
14164
14164
|
}
|
|
14165
14165
|
const commandFile = detectShebang(parsed);
|
|
@@ -14181,7 +14181,7 @@ var require_parse = __commonJS({
|
|
|
14181
14181
|
return parsed;
|
|
14182
14182
|
}
|
|
14183
14183
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
14184
|
-
if (
|
|
14184
|
+
if (isWin2) {
|
|
14185
14185
|
parsed.command = typeof parsed.options.shell === "string" ? parsed.options.shell : process.env.comspec || "cmd.exe";
|
|
14186
14186
|
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
14187
14187
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -14224,7 +14224,7 @@ var require_parse = __commonJS({
|
|
|
14224
14224
|
var require_enoent = __commonJS({
|
|
14225
14225
|
"../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
|
|
14226
14226
|
"use strict";
|
|
14227
|
-
var
|
|
14227
|
+
var isWin2 = process.platform === "win32";
|
|
14228
14228
|
function notFoundError(original, syscall) {
|
|
14229
14229
|
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
14230
14230
|
code: "ENOENT",
|
|
@@ -14235,7 +14235,7 @@ var require_enoent = __commonJS({
|
|
|
14235
14235
|
});
|
|
14236
14236
|
}
|
|
14237
14237
|
function hookChildProcess(cp, parsed) {
|
|
14238
|
-
if (!
|
|
14238
|
+
if (!isWin2) {
|
|
14239
14239
|
return;
|
|
14240
14240
|
}
|
|
14241
14241
|
const originalEmit = cp.emit;
|
|
@@ -14250,13 +14250,13 @@ var require_enoent = __commonJS({
|
|
|
14250
14250
|
};
|
|
14251
14251
|
}
|
|
14252
14252
|
function verifyENOENT(status, parsed) {
|
|
14253
|
-
if (
|
|
14253
|
+
if (isWin2 && status === 1 && !parsed.file) {
|
|
14254
14254
|
return notFoundError(parsed.original, "spawn");
|
|
14255
14255
|
}
|
|
14256
14256
|
return null;
|
|
14257
14257
|
}
|
|
14258
14258
|
function verifyENOENTSync(status, parsed) {
|
|
14259
|
-
if (
|
|
14259
|
+
if (isWin2 && status === 1 && !parsed.file) {
|
|
14260
14260
|
return notFoundError(parsed.original, "spawnSync");
|
|
14261
14261
|
}
|
|
14262
14262
|
return null;
|
|
@@ -21814,1904 +21814,6 @@ var require_ignore = __commonJS({
|
|
|
21814
21814
|
}
|
|
21815
21815
|
});
|
|
21816
21816
|
|
|
21817
|
-
// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
21818
|
-
var require_which2 = __commonJS({
|
|
21819
|
-
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
|
|
21820
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
21821
|
-
var path7 = require("path");
|
|
21822
|
-
var COLON = isWindows ? ";" : ":";
|
|
21823
|
-
var isexe = require_isexe();
|
|
21824
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
21825
|
-
var getPathInfo = (cmd, opt) => {
|
|
21826
|
-
const colon = opt.colon || COLON;
|
|
21827
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
21828
|
-
// windows always checks the cwd first
|
|
21829
|
-
...isWindows ? [process.cwd()] : [],
|
|
21830
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
21831
|
-
"").split(colon)
|
|
21832
|
-
];
|
|
21833
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
21834
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
21835
|
-
if (isWindows) {
|
|
21836
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
21837
|
-
pathExt.unshift("");
|
|
21838
|
-
}
|
|
21839
|
-
return {
|
|
21840
|
-
pathEnv,
|
|
21841
|
-
pathExt,
|
|
21842
|
-
pathExtExe
|
|
21843
|
-
};
|
|
21844
|
-
};
|
|
21845
|
-
var which = (cmd, opt, cb) => {
|
|
21846
|
-
if (typeof opt === "function") {
|
|
21847
|
-
cb = opt;
|
|
21848
|
-
opt = {};
|
|
21849
|
-
}
|
|
21850
|
-
if (!opt)
|
|
21851
|
-
opt = {};
|
|
21852
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
21853
|
-
const found = [];
|
|
21854
|
-
const step = (i) => new Promise((resolve, reject) => {
|
|
21855
|
-
if (i === pathEnv.length)
|
|
21856
|
-
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
21857
|
-
const ppRaw = pathEnv[i];
|
|
21858
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
21859
|
-
const pCmd = path7.join(pathPart, cmd);
|
|
21860
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
21861
|
-
resolve(subStep(p, i, 0));
|
|
21862
|
-
});
|
|
21863
|
-
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
21864
|
-
if (ii === pathExt.length)
|
|
21865
|
-
return resolve(step(i + 1));
|
|
21866
|
-
const ext = pathExt[ii];
|
|
21867
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
21868
|
-
if (!er && is) {
|
|
21869
|
-
if (opt.all)
|
|
21870
|
-
found.push(p + ext);
|
|
21871
|
-
else
|
|
21872
|
-
return resolve(p + ext);
|
|
21873
|
-
}
|
|
21874
|
-
return resolve(subStep(p, i, ii + 1));
|
|
21875
|
-
});
|
|
21876
|
-
});
|
|
21877
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
21878
|
-
};
|
|
21879
|
-
var whichSync = (cmd, opt) => {
|
|
21880
|
-
opt = opt || {};
|
|
21881
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
21882
|
-
const found = [];
|
|
21883
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
21884
|
-
const ppRaw = pathEnv[i];
|
|
21885
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
21886
|
-
const pCmd = path7.join(pathPart, cmd);
|
|
21887
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
21888
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
21889
|
-
const cur = p + pathExt[j];
|
|
21890
|
-
try {
|
|
21891
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
21892
|
-
if (is) {
|
|
21893
|
-
if (opt.all)
|
|
21894
|
-
found.push(cur);
|
|
21895
|
-
else
|
|
21896
|
-
return cur;
|
|
21897
|
-
}
|
|
21898
|
-
} catch (ex) {
|
|
21899
|
-
}
|
|
21900
|
-
}
|
|
21901
|
-
}
|
|
21902
|
-
if (opt.all && found.length)
|
|
21903
|
-
return found;
|
|
21904
|
-
if (opt.nothrow)
|
|
21905
|
-
return null;
|
|
21906
|
-
throw getNotFoundError(cmd);
|
|
21907
|
-
};
|
|
21908
|
-
module2.exports = which;
|
|
21909
|
-
which.sync = whichSync;
|
|
21910
|
-
}
|
|
21911
|
-
});
|
|
21912
|
-
|
|
21913
|
-
// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
21914
|
-
var require_path_key2 = __commonJS({
|
|
21915
|
-
"../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
|
|
21916
|
-
"use strict";
|
|
21917
|
-
var pathKey = (options = {}) => {
|
|
21918
|
-
const environment = options.env || process.env;
|
|
21919
|
-
const platform = options.platform || process.platform;
|
|
21920
|
-
if (platform !== "win32") {
|
|
21921
|
-
return "PATH";
|
|
21922
|
-
}
|
|
21923
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
21924
|
-
};
|
|
21925
|
-
module2.exports = pathKey;
|
|
21926
|
-
module2.exports.default = pathKey;
|
|
21927
|
-
}
|
|
21928
|
-
});
|
|
21929
|
-
|
|
21930
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
21931
|
-
var require_resolveCommand2 = __commonJS({
|
|
21932
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
21933
|
-
"use strict";
|
|
21934
|
-
var path7 = require("path");
|
|
21935
|
-
var which = require_which2();
|
|
21936
|
-
var getPathKey = require_path_key2();
|
|
21937
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
21938
|
-
const env = parsed.options.env || process.env;
|
|
21939
|
-
const cwd = process.cwd();
|
|
21940
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
21941
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
21942
|
-
if (shouldSwitchCwd) {
|
|
21943
|
-
try {
|
|
21944
|
-
process.chdir(parsed.options.cwd);
|
|
21945
|
-
} catch (err) {
|
|
21946
|
-
}
|
|
21947
|
-
}
|
|
21948
|
-
let resolved;
|
|
21949
|
-
try {
|
|
21950
|
-
resolved = which.sync(parsed.command, {
|
|
21951
|
-
path: env[getPathKey({ env })],
|
|
21952
|
-
pathExt: withoutPathExt ? path7.delimiter : void 0
|
|
21953
|
-
});
|
|
21954
|
-
} catch (e) {
|
|
21955
|
-
} finally {
|
|
21956
|
-
if (shouldSwitchCwd) {
|
|
21957
|
-
process.chdir(cwd);
|
|
21958
|
-
}
|
|
21959
|
-
}
|
|
21960
|
-
if (resolved) {
|
|
21961
|
-
resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
21962
|
-
}
|
|
21963
|
-
return resolved;
|
|
21964
|
-
}
|
|
21965
|
-
function resolveCommand(parsed) {
|
|
21966
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
21967
|
-
}
|
|
21968
|
-
module2.exports = resolveCommand;
|
|
21969
|
-
}
|
|
21970
|
-
});
|
|
21971
|
-
|
|
21972
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
21973
|
-
var require_escape2 = __commonJS({
|
|
21974
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
|
|
21975
|
-
"use strict";
|
|
21976
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
21977
|
-
function escapeCommand(arg) {
|
|
21978
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
21979
|
-
return arg;
|
|
21980
|
-
}
|
|
21981
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
21982
|
-
arg = `${arg}`;
|
|
21983
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
21984
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
21985
|
-
arg = `"${arg}"`;
|
|
21986
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
21987
|
-
if (doubleEscapeMetaChars) {
|
|
21988
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
21989
|
-
}
|
|
21990
|
-
return arg;
|
|
21991
|
-
}
|
|
21992
|
-
module2.exports.command = escapeCommand;
|
|
21993
|
-
module2.exports.argument = escapeArgument;
|
|
21994
|
-
}
|
|
21995
|
-
});
|
|
21996
|
-
|
|
21997
|
-
// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
21998
|
-
var require_shebang_regex2 = __commonJS({
|
|
21999
|
-
"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
|
|
22000
|
-
"use strict";
|
|
22001
|
-
module2.exports = /^#!(.*)/;
|
|
22002
|
-
}
|
|
22003
|
-
});
|
|
22004
|
-
|
|
22005
|
-
// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
22006
|
-
var require_shebang_command2 = __commonJS({
|
|
22007
|
-
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
|
|
22008
|
-
"use strict";
|
|
22009
|
-
var shebangRegex = require_shebang_regex2();
|
|
22010
|
-
module2.exports = (string = "") => {
|
|
22011
|
-
const match = string.match(shebangRegex);
|
|
22012
|
-
if (!match) {
|
|
22013
|
-
return null;
|
|
22014
|
-
}
|
|
22015
|
-
const [path7, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
22016
|
-
const binary = path7.split("/").pop();
|
|
22017
|
-
if (binary === "env") {
|
|
22018
|
-
return argument;
|
|
22019
|
-
}
|
|
22020
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
22021
|
-
};
|
|
22022
|
-
}
|
|
22023
|
-
});
|
|
22024
|
-
|
|
22025
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
22026
|
-
var require_readShebang2 = __commonJS({
|
|
22027
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
22028
|
-
"use strict";
|
|
22029
|
-
var fs7 = require("fs");
|
|
22030
|
-
var shebangCommand = require_shebang_command2();
|
|
22031
|
-
function readShebang(command) {
|
|
22032
|
-
const size = 150;
|
|
22033
|
-
const buffer = Buffer.alloc(size);
|
|
22034
|
-
let fd;
|
|
22035
|
-
try {
|
|
22036
|
-
fd = fs7.openSync(command, "r");
|
|
22037
|
-
fs7.readSync(fd, buffer, 0, size, 0);
|
|
22038
|
-
fs7.closeSync(fd);
|
|
22039
|
-
} catch (e) {
|
|
22040
|
-
}
|
|
22041
|
-
return shebangCommand(buffer.toString());
|
|
22042
|
-
}
|
|
22043
|
-
module2.exports = readShebang;
|
|
22044
|
-
}
|
|
22045
|
-
});
|
|
22046
|
-
|
|
22047
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
22048
|
-
var require_parse4 = __commonJS({
|
|
22049
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
22050
|
-
"use strict";
|
|
22051
|
-
var path7 = require("path");
|
|
22052
|
-
var resolveCommand = require_resolveCommand2();
|
|
22053
|
-
var escape = require_escape2();
|
|
22054
|
-
var readShebang = require_readShebang2();
|
|
22055
|
-
var isWin3 = process.platform === "win32";
|
|
22056
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
22057
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
22058
|
-
function detectShebang(parsed) {
|
|
22059
|
-
parsed.file = resolveCommand(parsed);
|
|
22060
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
22061
|
-
if (shebang) {
|
|
22062
|
-
parsed.args.unshift(parsed.file);
|
|
22063
|
-
parsed.command = shebang;
|
|
22064
|
-
return resolveCommand(parsed);
|
|
22065
|
-
}
|
|
22066
|
-
return parsed.file;
|
|
22067
|
-
}
|
|
22068
|
-
function parseNonShell(parsed) {
|
|
22069
|
-
if (!isWin3) {
|
|
22070
|
-
return parsed;
|
|
22071
|
-
}
|
|
22072
|
-
const commandFile = detectShebang(parsed);
|
|
22073
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
22074
|
-
if (parsed.options.forceShell || needsShell) {
|
|
22075
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
22076
|
-
parsed.command = path7.normalize(parsed.command);
|
|
22077
|
-
parsed.command = escape.command(parsed.command);
|
|
22078
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
22079
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
22080
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
22081
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
22082
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
22083
|
-
}
|
|
22084
|
-
return parsed;
|
|
22085
|
-
}
|
|
22086
|
-
function parse3(command, args, options) {
|
|
22087
|
-
if (args && !Array.isArray(args)) {
|
|
22088
|
-
options = args;
|
|
22089
|
-
args = null;
|
|
22090
|
-
}
|
|
22091
|
-
args = args ? args.slice(0) : [];
|
|
22092
|
-
options = Object.assign({}, options);
|
|
22093
|
-
const parsed = {
|
|
22094
|
-
command,
|
|
22095
|
-
args,
|
|
22096
|
-
options,
|
|
22097
|
-
file: void 0,
|
|
22098
|
-
original: {
|
|
22099
|
-
command,
|
|
22100
|
-
args
|
|
22101
|
-
}
|
|
22102
|
-
};
|
|
22103
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
22104
|
-
}
|
|
22105
|
-
module2.exports = parse3;
|
|
22106
|
-
}
|
|
22107
|
-
});
|
|
22108
|
-
|
|
22109
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
22110
|
-
var require_enoent2 = __commonJS({
|
|
22111
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
|
|
22112
|
-
"use strict";
|
|
22113
|
-
var isWin3 = process.platform === "win32";
|
|
22114
|
-
function notFoundError(original, syscall) {
|
|
22115
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
22116
|
-
code: "ENOENT",
|
|
22117
|
-
errno: "ENOENT",
|
|
22118
|
-
syscall: `${syscall} ${original.command}`,
|
|
22119
|
-
path: original.command,
|
|
22120
|
-
spawnargs: original.args
|
|
22121
|
-
});
|
|
22122
|
-
}
|
|
22123
|
-
function hookChildProcess(cp, parsed) {
|
|
22124
|
-
if (!isWin3) {
|
|
22125
|
-
return;
|
|
22126
|
-
}
|
|
22127
|
-
const originalEmit = cp.emit;
|
|
22128
|
-
cp.emit = function(name, arg1) {
|
|
22129
|
-
if (name === "exit") {
|
|
22130
|
-
const err = verifyENOENT(arg1, parsed);
|
|
22131
|
-
if (err) {
|
|
22132
|
-
return originalEmit.call(cp, "error", err);
|
|
22133
|
-
}
|
|
22134
|
-
}
|
|
22135
|
-
return originalEmit.apply(cp, arguments);
|
|
22136
|
-
};
|
|
22137
|
-
}
|
|
22138
|
-
function verifyENOENT(status, parsed) {
|
|
22139
|
-
if (isWin3 && status === 1 && !parsed.file) {
|
|
22140
|
-
return notFoundError(parsed.original, "spawn");
|
|
22141
|
-
}
|
|
22142
|
-
return null;
|
|
22143
|
-
}
|
|
22144
|
-
function verifyENOENTSync(status, parsed) {
|
|
22145
|
-
if (isWin3 && status === 1 && !parsed.file) {
|
|
22146
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
22147
|
-
}
|
|
22148
|
-
return null;
|
|
22149
|
-
}
|
|
22150
|
-
module2.exports = {
|
|
22151
|
-
hookChildProcess,
|
|
22152
|
-
verifyENOENT,
|
|
22153
|
-
verifyENOENTSync,
|
|
22154
|
-
notFoundError
|
|
22155
|
-
};
|
|
22156
|
-
}
|
|
22157
|
-
});
|
|
22158
|
-
|
|
22159
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
|
22160
|
-
var require_cross_spawn2 = __commonJS({
|
|
22161
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
22162
|
-
"use strict";
|
|
22163
|
-
var cp = require("child_process");
|
|
22164
|
-
var parse3 = require_parse4();
|
|
22165
|
-
var enoent = require_enoent2();
|
|
22166
|
-
function spawn2(command, args, options) {
|
|
22167
|
-
const parsed = parse3(command, args, options);
|
|
22168
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
22169
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
22170
|
-
return spawned;
|
|
22171
|
-
}
|
|
22172
|
-
function spawnSync(command, args, options) {
|
|
22173
|
-
const parsed = parse3(command, args, options);
|
|
22174
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
22175
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
22176
|
-
return result;
|
|
22177
|
-
}
|
|
22178
|
-
module2.exports = spawn2;
|
|
22179
|
-
module2.exports.spawn = spawn2;
|
|
22180
|
-
module2.exports.sync = spawnSync;
|
|
22181
|
-
module2.exports._parse = parse3;
|
|
22182
|
-
module2.exports._enoent = enoent;
|
|
22183
|
-
}
|
|
22184
|
-
});
|
|
22185
|
-
|
|
22186
|
-
// ../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js
|
|
22187
|
-
var require_strip_final_newline = __commonJS({
|
|
22188
|
-
"../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js"(exports2, module2) {
|
|
22189
|
-
"use strict";
|
|
22190
|
-
module2.exports = (input) => {
|
|
22191
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
22192
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
22193
|
-
if (input[input.length - 1] === LF) {
|
|
22194
|
-
input = input.slice(0, input.length - 1);
|
|
22195
|
-
}
|
|
22196
|
-
if (input[input.length - 1] === CR) {
|
|
22197
|
-
input = input.slice(0, input.length - 1);
|
|
22198
|
-
}
|
|
22199
|
-
return input;
|
|
22200
|
-
};
|
|
22201
|
-
}
|
|
22202
|
-
});
|
|
22203
|
-
|
|
22204
|
-
// ../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js
|
|
22205
|
-
var require_npm_run_path = __commonJS({
|
|
22206
|
-
"../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js"(exports2, module2) {
|
|
22207
|
-
"use strict";
|
|
22208
|
-
var path7 = require("path");
|
|
22209
|
-
var pathKey = require_path_key2();
|
|
22210
|
-
var npmRunPath = (options) => {
|
|
22211
|
-
options = {
|
|
22212
|
-
cwd: process.cwd(),
|
|
22213
|
-
path: process.env[pathKey()],
|
|
22214
|
-
execPath: process.execPath,
|
|
22215
|
-
...options
|
|
22216
|
-
};
|
|
22217
|
-
let previous;
|
|
22218
|
-
let cwdPath = path7.resolve(options.cwd);
|
|
22219
|
-
const result = [];
|
|
22220
|
-
while (previous !== cwdPath) {
|
|
22221
|
-
result.push(path7.join(cwdPath, "node_modules/.bin"));
|
|
22222
|
-
previous = cwdPath;
|
|
22223
|
-
cwdPath = path7.resolve(cwdPath, "..");
|
|
22224
|
-
}
|
|
22225
|
-
const execPathDir = path7.resolve(options.cwd, options.execPath, "..");
|
|
22226
|
-
result.push(execPathDir);
|
|
22227
|
-
return result.concat(options.path).join(path7.delimiter);
|
|
22228
|
-
};
|
|
22229
|
-
module2.exports = npmRunPath;
|
|
22230
|
-
module2.exports.default = npmRunPath;
|
|
22231
|
-
module2.exports.env = (options) => {
|
|
22232
|
-
options = {
|
|
22233
|
-
env: process.env,
|
|
22234
|
-
...options
|
|
22235
|
-
};
|
|
22236
|
-
const env = { ...options.env };
|
|
22237
|
-
const path8 = pathKey({ env });
|
|
22238
|
-
options.path = env[path8];
|
|
22239
|
-
env[path8] = module2.exports(options);
|
|
22240
|
-
return env;
|
|
22241
|
-
};
|
|
22242
|
-
}
|
|
22243
|
-
});
|
|
22244
|
-
|
|
22245
|
-
// ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js
|
|
22246
|
-
var require_mimic_fn = __commonJS({
|
|
22247
|
-
"../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports2, module2) {
|
|
22248
|
-
"use strict";
|
|
22249
|
-
var mimicFn = (to, from) => {
|
|
22250
|
-
for (const prop of Reflect.ownKeys(from)) {
|
|
22251
|
-
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
22252
|
-
}
|
|
22253
|
-
return to;
|
|
22254
|
-
};
|
|
22255
|
-
module2.exports = mimicFn;
|
|
22256
|
-
module2.exports.default = mimicFn;
|
|
22257
|
-
}
|
|
22258
|
-
});
|
|
22259
|
-
|
|
22260
|
-
// ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js
|
|
22261
|
-
var require_onetime = __commonJS({
|
|
22262
|
-
"../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports2, module2) {
|
|
22263
|
-
"use strict";
|
|
22264
|
-
var mimicFn = require_mimic_fn();
|
|
22265
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
22266
|
-
var onetime = (function_, options = {}) => {
|
|
22267
|
-
if (typeof function_ !== "function") {
|
|
22268
|
-
throw new TypeError("Expected a function");
|
|
22269
|
-
}
|
|
22270
|
-
let returnValue;
|
|
22271
|
-
let callCount = 0;
|
|
22272
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
22273
|
-
const onetime2 = function(...arguments_) {
|
|
22274
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
22275
|
-
if (callCount === 1) {
|
|
22276
|
-
returnValue = function_.apply(this, arguments_);
|
|
22277
|
-
function_ = null;
|
|
22278
|
-
} else if (options.throw === true) {
|
|
22279
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
22280
|
-
}
|
|
22281
|
-
return returnValue;
|
|
22282
|
-
};
|
|
22283
|
-
mimicFn(onetime2, function_);
|
|
22284
|
-
calledFunctions.set(onetime2, callCount);
|
|
22285
|
-
return onetime2;
|
|
22286
|
-
};
|
|
22287
|
-
module2.exports = onetime;
|
|
22288
|
-
module2.exports.default = onetime;
|
|
22289
|
-
module2.exports.callCount = (function_) => {
|
|
22290
|
-
if (!calledFunctions.has(function_)) {
|
|
22291
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
22292
|
-
}
|
|
22293
|
-
return calledFunctions.get(function_);
|
|
22294
|
-
};
|
|
22295
|
-
}
|
|
22296
|
-
});
|
|
22297
|
-
|
|
22298
|
-
// ../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/core.js
|
|
22299
|
-
var require_core2 = __commonJS({
|
|
22300
|
-
"../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/core.js"(exports2) {
|
|
22301
|
-
"use strict";
|
|
22302
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
22303
|
-
exports2.SIGNALS = void 0;
|
|
22304
|
-
var SIGNALS = [
|
|
22305
|
-
{
|
|
22306
|
-
name: "SIGHUP",
|
|
22307
|
-
number: 1,
|
|
22308
|
-
action: "terminate",
|
|
22309
|
-
description: "Terminal closed",
|
|
22310
|
-
standard: "posix"
|
|
22311
|
-
},
|
|
22312
|
-
{
|
|
22313
|
-
name: "SIGINT",
|
|
22314
|
-
number: 2,
|
|
22315
|
-
action: "terminate",
|
|
22316
|
-
description: "User interruption with CTRL-C",
|
|
22317
|
-
standard: "ansi"
|
|
22318
|
-
},
|
|
22319
|
-
{
|
|
22320
|
-
name: "SIGQUIT",
|
|
22321
|
-
number: 3,
|
|
22322
|
-
action: "core",
|
|
22323
|
-
description: "User interruption with CTRL-\\",
|
|
22324
|
-
standard: "posix"
|
|
22325
|
-
},
|
|
22326
|
-
{
|
|
22327
|
-
name: "SIGILL",
|
|
22328
|
-
number: 4,
|
|
22329
|
-
action: "core",
|
|
22330
|
-
description: "Invalid machine instruction",
|
|
22331
|
-
standard: "ansi"
|
|
22332
|
-
},
|
|
22333
|
-
{
|
|
22334
|
-
name: "SIGTRAP",
|
|
22335
|
-
number: 5,
|
|
22336
|
-
action: "core",
|
|
22337
|
-
description: "Debugger breakpoint",
|
|
22338
|
-
standard: "posix"
|
|
22339
|
-
},
|
|
22340
|
-
{
|
|
22341
|
-
name: "SIGABRT",
|
|
22342
|
-
number: 6,
|
|
22343
|
-
action: "core",
|
|
22344
|
-
description: "Aborted",
|
|
22345
|
-
standard: "ansi"
|
|
22346
|
-
},
|
|
22347
|
-
{
|
|
22348
|
-
name: "SIGIOT",
|
|
22349
|
-
number: 6,
|
|
22350
|
-
action: "core",
|
|
22351
|
-
description: "Aborted",
|
|
22352
|
-
standard: "bsd"
|
|
22353
|
-
},
|
|
22354
|
-
{
|
|
22355
|
-
name: "SIGBUS",
|
|
22356
|
-
number: 7,
|
|
22357
|
-
action: "core",
|
|
22358
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
22359
|
-
standard: "bsd"
|
|
22360
|
-
},
|
|
22361
|
-
{
|
|
22362
|
-
name: "SIGEMT",
|
|
22363
|
-
number: 7,
|
|
22364
|
-
action: "terminate",
|
|
22365
|
-
description: "Command should be emulated but is not implemented",
|
|
22366
|
-
standard: "other"
|
|
22367
|
-
},
|
|
22368
|
-
{
|
|
22369
|
-
name: "SIGFPE",
|
|
22370
|
-
number: 8,
|
|
22371
|
-
action: "core",
|
|
22372
|
-
description: "Floating point arithmetic error",
|
|
22373
|
-
standard: "ansi"
|
|
22374
|
-
},
|
|
22375
|
-
{
|
|
22376
|
-
name: "SIGKILL",
|
|
22377
|
-
number: 9,
|
|
22378
|
-
action: "terminate",
|
|
22379
|
-
description: "Forced termination",
|
|
22380
|
-
standard: "posix",
|
|
22381
|
-
forced: true
|
|
22382
|
-
},
|
|
22383
|
-
{
|
|
22384
|
-
name: "SIGUSR1",
|
|
22385
|
-
number: 10,
|
|
22386
|
-
action: "terminate",
|
|
22387
|
-
description: "Application-specific signal",
|
|
22388
|
-
standard: "posix"
|
|
22389
|
-
},
|
|
22390
|
-
{
|
|
22391
|
-
name: "SIGSEGV",
|
|
22392
|
-
number: 11,
|
|
22393
|
-
action: "core",
|
|
22394
|
-
description: "Segmentation fault",
|
|
22395
|
-
standard: "ansi"
|
|
22396
|
-
},
|
|
22397
|
-
{
|
|
22398
|
-
name: "SIGUSR2",
|
|
22399
|
-
number: 12,
|
|
22400
|
-
action: "terminate",
|
|
22401
|
-
description: "Application-specific signal",
|
|
22402
|
-
standard: "posix"
|
|
22403
|
-
},
|
|
22404
|
-
{
|
|
22405
|
-
name: "SIGPIPE",
|
|
22406
|
-
number: 13,
|
|
22407
|
-
action: "terminate",
|
|
22408
|
-
description: "Broken pipe or socket",
|
|
22409
|
-
standard: "posix"
|
|
22410
|
-
},
|
|
22411
|
-
{
|
|
22412
|
-
name: "SIGALRM",
|
|
22413
|
-
number: 14,
|
|
22414
|
-
action: "terminate",
|
|
22415
|
-
description: "Timeout or timer",
|
|
22416
|
-
standard: "posix"
|
|
22417
|
-
},
|
|
22418
|
-
{
|
|
22419
|
-
name: "SIGTERM",
|
|
22420
|
-
number: 15,
|
|
22421
|
-
action: "terminate",
|
|
22422
|
-
description: "Termination",
|
|
22423
|
-
standard: "ansi"
|
|
22424
|
-
},
|
|
22425
|
-
{
|
|
22426
|
-
name: "SIGSTKFLT",
|
|
22427
|
-
number: 16,
|
|
22428
|
-
action: "terminate",
|
|
22429
|
-
description: "Stack is empty or overflowed",
|
|
22430
|
-
standard: "other"
|
|
22431
|
-
},
|
|
22432
|
-
{
|
|
22433
|
-
name: "SIGCHLD",
|
|
22434
|
-
number: 17,
|
|
22435
|
-
action: "ignore",
|
|
22436
|
-
description: "Child process terminated, paused or unpaused",
|
|
22437
|
-
standard: "posix"
|
|
22438
|
-
},
|
|
22439
|
-
{
|
|
22440
|
-
name: "SIGCLD",
|
|
22441
|
-
number: 17,
|
|
22442
|
-
action: "ignore",
|
|
22443
|
-
description: "Child process terminated, paused or unpaused",
|
|
22444
|
-
standard: "other"
|
|
22445
|
-
},
|
|
22446
|
-
{
|
|
22447
|
-
name: "SIGCONT",
|
|
22448
|
-
number: 18,
|
|
22449
|
-
action: "unpause",
|
|
22450
|
-
description: "Unpaused",
|
|
22451
|
-
standard: "posix",
|
|
22452
|
-
forced: true
|
|
22453
|
-
},
|
|
22454
|
-
{
|
|
22455
|
-
name: "SIGSTOP",
|
|
22456
|
-
number: 19,
|
|
22457
|
-
action: "pause",
|
|
22458
|
-
description: "Paused",
|
|
22459
|
-
standard: "posix",
|
|
22460
|
-
forced: true
|
|
22461
|
-
},
|
|
22462
|
-
{
|
|
22463
|
-
name: "SIGTSTP",
|
|
22464
|
-
number: 20,
|
|
22465
|
-
action: "pause",
|
|
22466
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
22467
|
-
standard: "posix"
|
|
22468
|
-
},
|
|
22469
|
-
{
|
|
22470
|
-
name: "SIGTTIN",
|
|
22471
|
-
number: 21,
|
|
22472
|
-
action: "pause",
|
|
22473
|
-
description: "Background process cannot read terminal input",
|
|
22474
|
-
standard: "posix"
|
|
22475
|
-
},
|
|
22476
|
-
{
|
|
22477
|
-
name: "SIGBREAK",
|
|
22478
|
-
number: 21,
|
|
22479
|
-
action: "terminate",
|
|
22480
|
-
description: "User interruption with CTRL-BREAK",
|
|
22481
|
-
standard: "other"
|
|
22482
|
-
},
|
|
22483
|
-
{
|
|
22484
|
-
name: "SIGTTOU",
|
|
22485
|
-
number: 22,
|
|
22486
|
-
action: "pause",
|
|
22487
|
-
description: "Background process cannot write to terminal output",
|
|
22488
|
-
standard: "posix"
|
|
22489
|
-
},
|
|
22490
|
-
{
|
|
22491
|
-
name: "SIGURG",
|
|
22492
|
-
number: 23,
|
|
22493
|
-
action: "ignore",
|
|
22494
|
-
description: "Socket received out-of-band data",
|
|
22495
|
-
standard: "bsd"
|
|
22496
|
-
},
|
|
22497
|
-
{
|
|
22498
|
-
name: "SIGXCPU",
|
|
22499
|
-
number: 24,
|
|
22500
|
-
action: "core",
|
|
22501
|
-
description: "Process timed out",
|
|
22502
|
-
standard: "bsd"
|
|
22503
|
-
},
|
|
22504
|
-
{
|
|
22505
|
-
name: "SIGXFSZ",
|
|
22506
|
-
number: 25,
|
|
22507
|
-
action: "core",
|
|
22508
|
-
description: "File too big",
|
|
22509
|
-
standard: "bsd"
|
|
22510
|
-
},
|
|
22511
|
-
{
|
|
22512
|
-
name: "SIGVTALRM",
|
|
22513
|
-
number: 26,
|
|
22514
|
-
action: "terminate",
|
|
22515
|
-
description: "Timeout or timer",
|
|
22516
|
-
standard: "bsd"
|
|
22517
|
-
},
|
|
22518
|
-
{
|
|
22519
|
-
name: "SIGPROF",
|
|
22520
|
-
number: 27,
|
|
22521
|
-
action: "terminate",
|
|
22522
|
-
description: "Timeout or timer",
|
|
22523
|
-
standard: "bsd"
|
|
22524
|
-
},
|
|
22525
|
-
{
|
|
22526
|
-
name: "SIGWINCH",
|
|
22527
|
-
number: 28,
|
|
22528
|
-
action: "ignore",
|
|
22529
|
-
description: "Terminal window size changed",
|
|
22530
|
-
standard: "bsd"
|
|
22531
|
-
},
|
|
22532
|
-
{
|
|
22533
|
-
name: "SIGIO",
|
|
22534
|
-
number: 29,
|
|
22535
|
-
action: "terminate",
|
|
22536
|
-
description: "I/O is available",
|
|
22537
|
-
standard: "other"
|
|
22538
|
-
},
|
|
22539
|
-
{
|
|
22540
|
-
name: "SIGPOLL",
|
|
22541
|
-
number: 29,
|
|
22542
|
-
action: "terminate",
|
|
22543
|
-
description: "Watched event",
|
|
22544
|
-
standard: "other"
|
|
22545
|
-
},
|
|
22546
|
-
{
|
|
22547
|
-
name: "SIGINFO",
|
|
22548
|
-
number: 29,
|
|
22549
|
-
action: "ignore",
|
|
22550
|
-
description: "Request for process information",
|
|
22551
|
-
standard: "other"
|
|
22552
|
-
},
|
|
22553
|
-
{
|
|
22554
|
-
name: "SIGPWR",
|
|
22555
|
-
number: 30,
|
|
22556
|
-
action: "terminate",
|
|
22557
|
-
description: "Device running out of power",
|
|
22558
|
-
standard: "systemv"
|
|
22559
|
-
},
|
|
22560
|
-
{
|
|
22561
|
-
name: "SIGSYS",
|
|
22562
|
-
number: 31,
|
|
22563
|
-
action: "core",
|
|
22564
|
-
description: "Invalid system call",
|
|
22565
|
-
standard: "other"
|
|
22566
|
-
},
|
|
22567
|
-
{
|
|
22568
|
-
name: "SIGUNUSED",
|
|
22569
|
-
number: 31,
|
|
22570
|
-
action: "terminate",
|
|
22571
|
-
description: "Invalid system call",
|
|
22572
|
-
standard: "other"
|
|
22573
|
-
}
|
|
22574
|
-
];
|
|
22575
|
-
exports2.SIGNALS = SIGNALS;
|
|
22576
|
-
}
|
|
22577
|
-
});
|
|
22578
|
-
|
|
22579
|
-
// ../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/realtime.js
|
|
22580
|
-
var require_realtime = __commonJS({
|
|
22581
|
-
"../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/realtime.js"(exports2) {
|
|
22582
|
-
"use strict";
|
|
22583
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
22584
|
-
exports2.SIGRTMAX = exports2.getRealtimeSignals = void 0;
|
|
22585
|
-
var getRealtimeSignals = function() {
|
|
22586
|
-
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
22587
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
22588
|
-
};
|
|
22589
|
-
exports2.getRealtimeSignals = getRealtimeSignals;
|
|
22590
|
-
var getRealtimeSignal = function(value, index) {
|
|
22591
|
-
return {
|
|
22592
|
-
name: `SIGRT${index + 1}`,
|
|
22593
|
-
number: SIGRTMIN + index,
|
|
22594
|
-
action: "terminate",
|
|
22595
|
-
description: "Application-specific signal (realtime)",
|
|
22596
|
-
standard: "posix"
|
|
22597
|
-
};
|
|
22598
|
-
};
|
|
22599
|
-
var SIGRTMIN = 34;
|
|
22600
|
-
var SIGRTMAX = 64;
|
|
22601
|
-
exports2.SIGRTMAX = SIGRTMAX;
|
|
22602
|
-
}
|
|
22603
|
-
});
|
|
22604
|
-
|
|
22605
|
-
// ../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/signals.js
|
|
22606
|
-
var require_signals = __commonJS({
|
|
22607
|
-
"../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/signals.js"(exports2) {
|
|
22608
|
-
"use strict";
|
|
22609
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
22610
|
-
exports2.getSignals = void 0;
|
|
22611
|
-
var _os = require("os");
|
|
22612
|
-
var _core = require_core2();
|
|
22613
|
-
var _realtime = require_realtime();
|
|
22614
|
-
var getSignals = function() {
|
|
22615
|
-
const realtimeSignals = (0, _realtime.getRealtimeSignals)();
|
|
22616
|
-
const signals = [..._core.SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
22617
|
-
return signals;
|
|
22618
|
-
};
|
|
22619
|
-
exports2.getSignals = getSignals;
|
|
22620
|
-
var normalizeSignal = function({
|
|
22621
|
-
name,
|
|
22622
|
-
number: defaultNumber,
|
|
22623
|
-
description,
|
|
22624
|
-
action,
|
|
22625
|
-
forced = false,
|
|
22626
|
-
standard
|
|
22627
|
-
}) {
|
|
22628
|
-
const {
|
|
22629
|
-
signals: { [name]: constantSignal }
|
|
22630
|
-
} = _os.constants;
|
|
22631
|
-
const supported = constantSignal !== void 0;
|
|
22632
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
22633
|
-
return { name, number, description, supported, action, forced, standard };
|
|
22634
|
-
};
|
|
22635
|
-
}
|
|
22636
|
-
});
|
|
22637
|
-
|
|
22638
|
-
// ../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/main.js
|
|
22639
|
-
var require_main = __commonJS({
|
|
22640
|
-
"../../node_modules/.pnpm/human-signals@1.1.1/node_modules/human-signals/build/src/main.js"(exports2) {
|
|
22641
|
-
"use strict";
|
|
22642
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
22643
|
-
exports2.signalsByNumber = exports2.signalsByName = void 0;
|
|
22644
|
-
var _os = require("os");
|
|
22645
|
-
var _signals = require_signals();
|
|
22646
|
-
var _realtime = require_realtime();
|
|
22647
|
-
var getSignalsByName = function() {
|
|
22648
|
-
const signals = (0, _signals.getSignals)();
|
|
22649
|
-
return signals.reduce(getSignalByName, {});
|
|
22650
|
-
};
|
|
22651
|
-
var getSignalByName = function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) {
|
|
22652
|
-
return {
|
|
22653
|
-
...signalByNameMemo,
|
|
22654
|
-
[name]: { name, number, description, supported, action, forced, standard }
|
|
22655
|
-
};
|
|
22656
|
-
};
|
|
22657
|
-
var signalsByName = getSignalsByName();
|
|
22658
|
-
exports2.signalsByName = signalsByName;
|
|
22659
|
-
var getSignalsByNumber = function() {
|
|
22660
|
-
const signals = (0, _signals.getSignals)();
|
|
22661
|
-
const length = _realtime.SIGRTMAX + 1;
|
|
22662
|
-
const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
|
|
22663
|
-
return Object.assign({}, ...signalsA);
|
|
22664
|
-
};
|
|
22665
|
-
var getSignalByNumber = function(number, signals) {
|
|
22666
|
-
const signal = findSignalByNumber(number, signals);
|
|
22667
|
-
if (signal === void 0) {
|
|
22668
|
-
return {};
|
|
22669
|
-
}
|
|
22670
|
-
const { name, description, supported, action, forced, standard } = signal;
|
|
22671
|
-
return {
|
|
22672
|
-
[number]: {
|
|
22673
|
-
name,
|
|
22674
|
-
number,
|
|
22675
|
-
description,
|
|
22676
|
-
supported,
|
|
22677
|
-
action,
|
|
22678
|
-
forced,
|
|
22679
|
-
standard
|
|
22680
|
-
}
|
|
22681
|
-
};
|
|
22682
|
-
};
|
|
22683
|
-
var findSignalByNumber = function(number, signals) {
|
|
22684
|
-
const signal = signals.find(({ name }) => _os.constants.signals[name] === number);
|
|
22685
|
-
if (signal !== void 0) {
|
|
22686
|
-
return signal;
|
|
22687
|
-
}
|
|
22688
|
-
return signals.find((signalA) => signalA.number === number);
|
|
22689
|
-
};
|
|
22690
|
-
var signalsByNumber = getSignalsByNumber();
|
|
22691
|
-
exports2.signalsByNumber = signalsByNumber;
|
|
22692
|
-
}
|
|
22693
|
-
});
|
|
22694
|
-
|
|
22695
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/error.js
|
|
22696
|
-
var require_error = __commonJS({
|
|
22697
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/error.js"(exports2, module2) {
|
|
22698
|
-
"use strict";
|
|
22699
|
-
var { signalsByName } = require_main();
|
|
22700
|
-
var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
|
|
22701
|
-
if (timedOut) {
|
|
22702
|
-
return `timed out after ${timeout} milliseconds`;
|
|
22703
|
-
}
|
|
22704
|
-
if (isCanceled) {
|
|
22705
|
-
return "was canceled";
|
|
22706
|
-
}
|
|
22707
|
-
if (errorCode !== void 0) {
|
|
22708
|
-
return `failed with ${errorCode}`;
|
|
22709
|
-
}
|
|
22710
|
-
if (signal !== void 0) {
|
|
22711
|
-
return `was killed with ${signal} (${signalDescription})`;
|
|
22712
|
-
}
|
|
22713
|
-
if (exitCode !== void 0) {
|
|
22714
|
-
return `failed with exit code ${exitCode}`;
|
|
22715
|
-
}
|
|
22716
|
-
return "failed";
|
|
22717
|
-
};
|
|
22718
|
-
var makeError = ({
|
|
22719
|
-
stdout,
|
|
22720
|
-
stderr,
|
|
22721
|
-
all,
|
|
22722
|
-
error,
|
|
22723
|
-
signal,
|
|
22724
|
-
exitCode,
|
|
22725
|
-
command,
|
|
22726
|
-
timedOut,
|
|
22727
|
-
isCanceled,
|
|
22728
|
-
killed,
|
|
22729
|
-
parsed: { options: { timeout } }
|
|
22730
|
-
}) => {
|
|
22731
|
-
exitCode = exitCode === null ? void 0 : exitCode;
|
|
22732
|
-
signal = signal === null ? void 0 : signal;
|
|
22733
|
-
const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
|
|
22734
|
-
const errorCode = error && error.code;
|
|
22735
|
-
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
22736
|
-
const message = `Command ${prefix}: ${command}`;
|
|
22737
|
-
if (error instanceof Error) {
|
|
22738
|
-
error.originalMessage = error.message;
|
|
22739
|
-
error.message = `${message}
|
|
22740
|
-
${error.message}`;
|
|
22741
|
-
} else {
|
|
22742
|
-
error = new Error(message);
|
|
22743
|
-
}
|
|
22744
|
-
error.command = command;
|
|
22745
|
-
error.exitCode = exitCode;
|
|
22746
|
-
error.signal = signal;
|
|
22747
|
-
error.signalDescription = signalDescription;
|
|
22748
|
-
error.stdout = stdout;
|
|
22749
|
-
error.stderr = stderr;
|
|
22750
|
-
if (all !== void 0) {
|
|
22751
|
-
error.all = all;
|
|
22752
|
-
}
|
|
22753
|
-
if ("bufferedData" in error) {
|
|
22754
|
-
delete error.bufferedData;
|
|
22755
|
-
}
|
|
22756
|
-
error.failed = true;
|
|
22757
|
-
error.timedOut = Boolean(timedOut);
|
|
22758
|
-
error.isCanceled = isCanceled;
|
|
22759
|
-
error.killed = killed && !timedOut;
|
|
22760
|
-
return error;
|
|
22761
|
-
};
|
|
22762
|
-
module2.exports = makeError;
|
|
22763
|
-
}
|
|
22764
|
-
});
|
|
22765
|
-
|
|
22766
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/stdio.js
|
|
22767
|
-
var require_stdio = __commonJS({
|
|
22768
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/stdio.js"(exports2, module2) {
|
|
22769
|
-
"use strict";
|
|
22770
|
-
var aliases = ["stdin", "stdout", "stderr"];
|
|
22771
|
-
var hasAlias = (opts) => aliases.some((alias) => opts[alias] !== void 0);
|
|
22772
|
-
var normalizeStdio = (opts) => {
|
|
22773
|
-
if (!opts) {
|
|
22774
|
-
return;
|
|
22775
|
-
}
|
|
22776
|
-
const { stdio } = opts;
|
|
22777
|
-
if (stdio === void 0) {
|
|
22778
|
-
return aliases.map((alias) => opts[alias]);
|
|
22779
|
-
}
|
|
22780
|
-
if (hasAlias(opts)) {
|
|
22781
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
22782
|
-
}
|
|
22783
|
-
if (typeof stdio === "string") {
|
|
22784
|
-
return stdio;
|
|
22785
|
-
}
|
|
22786
|
-
if (!Array.isArray(stdio)) {
|
|
22787
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
22788
|
-
}
|
|
22789
|
-
const length = Math.max(stdio.length, aliases.length);
|
|
22790
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
22791
|
-
};
|
|
22792
|
-
module2.exports = normalizeStdio;
|
|
22793
|
-
module2.exports.node = (opts) => {
|
|
22794
|
-
const stdio = normalizeStdio(opts);
|
|
22795
|
-
if (stdio === "ipc") {
|
|
22796
|
-
return "ipc";
|
|
22797
|
-
}
|
|
22798
|
-
if (stdio === void 0 || typeof stdio === "string") {
|
|
22799
|
-
return [stdio, stdio, stdio, "ipc"];
|
|
22800
|
-
}
|
|
22801
|
-
if (stdio.includes("ipc")) {
|
|
22802
|
-
return stdio;
|
|
22803
|
-
}
|
|
22804
|
-
return [...stdio, "ipc"];
|
|
22805
|
-
};
|
|
22806
|
-
}
|
|
22807
|
-
});
|
|
22808
|
-
|
|
22809
|
-
// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js
|
|
22810
|
-
var require_signals2 = __commonJS({
|
|
22811
|
-
"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports2, module2) {
|
|
22812
|
-
module2.exports = [
|
|
22813
|
-
"SIGABRT",
|
|
22814
|
-
"SIGALRM",
|
|
22815
|
-
"SIGHUP",
|
|
22816
|
-
"SIGINT",
|
|
22817
|
-
"SIGTERM"
|
|
22818
|
-
];
|
|
22819
|
-
if (process.platform !== "win32") {
|
|
22820
|
-
module2.exports.push(
|
|
22821
|
-
"SIGVTALRM",
|
|
22822
|
-
"SIGXCPU",
|
|
22823
|
-
"SIGXFSZ",
|
|
22824
|
-
"SIGUSR2",
|
|
22825
|
-
"SIGTRAP",
|
|
22826
|
-
"SIGSYS",
|
|
22827
|
-
"SIGQUIT",
|
|
22828
|
-
"SIGIOT"
|
|
22829
|
-
// should detect profiler and enable/disable accordingly.
|
|
22830
|
-
// see #21
|
|
22831
|
-
// 'SIGPROF'
|
|
22832
|
-
);
|
|
22833
|
-
}
|
|
22834
|
-
if (process.platform === "linux") {
|
|
22835
|
-
module2.exports.push(
|
|
22836
|
-
"SIGIO",
|
|
22837
|
-
"SIGPOLL",
|
|
22838
|
-
"SIGPWR",
|
|
22839
|
-
"SIGSTKFLT",
|
|
22840
|
-
"SIGUNUSED"
|
|
22841
|
-
);
|
|
22842
|
-
}
|
|
22843
|
-
}
|
|
22844
|
-
});
|
|
22845
|
-
|
|
22846
|
-
// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
22847
|
-
var require_signal_exit = __commonJS({
|
|
22848
|
-
"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module2) {
|
|
22849
|
-
var process2 = global.process;
|
|
22850
|
-
var processOk = function(process3) {
|
|
22851
|
-
return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
|
|
22852
|
-
};
|
|
22853
|
-
if (!processOk(process2)) {
|
|
22854
|
-
module2.exports = function() {
|
|
22855
|
-
return function() {
|
|
22856
|
-
};
|
|
22857
|
-
};
|
|
22858
|
-
} else {
|
|
22859
|
-
assert7 = require("assert");
|
|
22860
|
-
signals = require_signals2();
|
|
22861
|
-
isWin3 = /^win/i.test(process2.platform);
|
|
22862
|
-
EE = require("events");
|
|
22863
|
-
if (typeof EE !== "function") {
|
|
22864
|
-
EE = EE.EventEmitter;
|
|
22865
|
-
}
|
|
22866
|
-
if (process2.__signal_exit_emitter__) {
|
|
22867
|
-
emitter = process2.__signal_exit_emitter__;
|
|
22868
|
-
} else {
|
|
22869
|
-
emitter = process2.__signal_exit_emitter__ = new EE();
|
|
22870
|
-
emitter.count = 0;
|
|
22871
|
-
emitter.emitted = {};
|
|
22872
|
-
}
|
|
22873
|
-
if (!emitter.infinite) {
|
|
22874
|
-
emitter.setMaxListeners(Infinity);
|
|
22875
|
-
emitter.infinite = true;
|
|
22876
|
-
}
|
|
22877
|
-
module2.exports = function(cb, opts) {
|
|
22878
|
-
if (!processOk(global.process)) {
|
|
22879
|
-
return function() {
|
|
22880
|
-
};
|
|
22881
|
-
}
|
|
22882
|
-
assert7.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
22883
|
-
if (loaded === false) {
|
|
22884
|
-
load();
|
|
22885
|
-
}
|
|
22886
|
-
var ev = "exit";
|
|
22887
|
-
if (opts && opts.alwaysLast) {
|
|
22888
|
-
ev = "afterexit";
|
|
22889
|
-
}
|
|
22890
|
-
var remove2 = function() {
|
|
22891
|
-
emitter.removeListener(ev, cb);
|
|
22892
|
-
if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
|
|
22893
|
-
unload();
|
|
22894
|
-
}
|
|
22895
|
-
};
|
|
22896
|
-
emitter.on(ev, cb);
|
|
22897
|
-
return remove2;
|
|
22898
|
-
};
|
|
22899
|
-
unload = function unload2() {
|
|
22900
|
-
if (!loaded || !processOk(global.process)) {
|
|
22901
|
-
return;
|
|
22902
|
-
}
|
|
22903
|
-
loaded = false;
|
|
22904
|
-
signals.forEach(function(sig) {
|
|
22905
|
-
try {
|
|
22906
|
-
process2.removeListener(sig, sigListeners[sig]);
|
|
22907
|
-
} catch (er) {
|
|
22908
|
-
}
|
|
22909
|
-
});
|
|
22910
|
-
process2.emit = originalProcessEmit;
|
|
22911
|
-
process2.reallyExit = originalProcessReallyExit;
|
|
22912
|
-
emitter.count -= 1;
|
|
22913
|
-
};
|
|
22914
|
-
module2.exports.unload = unload;
|
|
22915
|
-
emit = function emit2(event, code, signal) {
|
|
22916
|
-
if (emitter.emitted[event]) {
|
|
22917
|
-
return;
|
|
22918
|
-
}
|
|
22919
|
-
emitter.emitted[event] = true;
|
|
22920
|
-
emitter.emit(event, code, signal);
|
|
22921
|
-
};
|
|
22922
|
-
sigListeners = {};
|
|
22923
|
-
signals.forEach(function(sig) {
|
|
22924
|
-
sigListeners[sig] = function listener() {
|
|
22925
|
-
if (!processOk(global.process)) {
|
|
22926
|
-
return;
|
|
22927
|
-
}
|
|
22928
|
-
var listeners = process2.listeners(sig);
|
|
22929
|
-
if (listeners.length === emitter.count) {
|
|
22930
|
-
unload();
|
|
22931
|
-
emit("exit", null, sig);
|
|
22932
|
-
emit("afterexit", null, sig);
|
|
22933
|
-
if (isWin3 && sig === "SIGHUP") {
|
|
22934
|
-
sig = "SIGINT";
|
|
22935
|
-
}
|
|
22936
|
-
process2.kill(process2.pid, sig);
|
|
22937
|
-
}
|
|
22938
|
-
};
|
|
22939
|
-
});
|
|
22940
|
-
module2.exports.signals = function() {
|
|
22941
|
-
return signals;
|
|
22942
|
-
};
|
|
22943
|
-
loaded = false;
|
|
22944
|
-
load = function load2() {
|
|
22945
|
-
if (loaded || !processOk(global.process)) {
|
|
22946
|
-
return;
|
|
22947
|
-
}
|
|
22948
|
-
loaded = true;
|
|
22949
|
-
emitter.count += 1;
|
|
22950
|
-
signals = signals.filter(function(sig) {
|
|
22951
|
-
try {
|
|
22952
|
-
process2.on(sig, sigListeners[sig]);
|
|
22953
|
-
return true;
|
|
22954
|
-
} catch (er) {
|
|
22955
|
-
return false;
|
|
22956
|
-
}
|
|
22957
|
-
});
|
|
22958
|
-
process2.emit = processEmit;
|
|
22959
|
-
process2.reallyExit = processReallyExit;
|
|
22960
|
-
};
|
|
22961
|
-
module2.exports.load = load;
|
|
22962
|
-
originalProcessReallyExit = process2.reallyExit;
|
|
22963
|
-
processReallyExit = function processReallyExit2(code) {
|
|
22964
|
-
if (!processOk(global.process)) {
|
|
22965
|
-
return;
|
|
22966
|
-
}
|
|
22967
|
-
process2.exitCode = code || /* istanbul ignore next */
|
|
22968
|
-
0;
|
|
22969
|
-
emit("exit", process2.exitCode, null);
|
|
22970
|
-
emit("afterexit", process2.exitCode, null);
|
|
22971
|
-
originalProcessReallyExit.call(process2, process2.exitCode);
|
|
22972
|
-
};
|
|
22973
|
-
originalProcessEmit = process2.emit;
|
|
22974
|
-
processEmit = function processEmit2(ev, arg) {
|
|
22975
|
-
if (ev === "exit" && processOk(global.process)) {
|
|
22976
|
-
if (arg !== void 0) {
|
|
22977
|
-
process2.exitCode = arg;
|
|
22978
|
-
}
|
|
22979
|
-
var ret = originalProcessEmit.apply(this, arguments);
|
|
22980
|
-
emit("exit", process2.exitCode, null);
|
|
22981
|
-
emit("afterexit", process2.exitCode, null);
|
|
22982
|
-
return ret;
|
|
22983
|
-
} else {
|
|
22984
|
-
return originalProcessEmit.apply(this, arguments);
|
|
22985
|
-
}
|
|
22986
|
-
};
|
|
22987
|
-
}
|
|
22988
|
-
var assert7;
|
|
22989
|
-
var signals;
|
|
22990
|
-
var isWin3;
|
|
22991
|
-
var EE;
|
|
22992
|
-
var emitter;
|
|
22993
|
-
var unload;
|
|
22994
|
-
var emit;
|
|
22995
|
-
var sigListeners;
|
|
22996
|
-
var loaded;
|
|
22997
|
-
var load;
|
|
22998
|
-
var originalProcessReallyExit;
|
|
22999
|
-
var processReallyExit;
|
|
23000
|
-
var originalProcessEmit;
|
|
23001
|
-
var processEmit;
|
|
23002
|
-
}
|
|
23003
|
-
});
|
|
23004
|
-
|
|
23005
|
-
// ../../node_modules/.pnpm/p-finally@2.0.1/node_modules/p-finally/index.js
|
|
23006
|
-
var require_p_finally = __commonJS({
|
|
23007
|
-
"../../node_modules/.pnpm/p-finally@2.0.1/node_modules/p-finally/index.js"(exports2, module2) {
|
|
23008
|
-
"use strict";
|
|
23009
|
-
module2.exports = async (promise, onFinally = () => {
|
|
23010
|
-
}) => {
|
|
23011
|
-
let value;
|
|
23012
|
-
try {
|
|
23013
|
-
value = await promise;
|
|
23014
|
-
} catch (error) {
|
|
23015
|
-
await onFinally();
|
|
23016
|
-
throw error;
|
|
23017
|
-
}
|
|
23018
|
-
await onFinally();
|
|
23019
|
-
return value;
|
|
23020
|
-
};
|
|
23021
|
-
}
|
|
23022
|
-
});
|
|
23023
|
-
|
|
23024
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/kill.js
|
|
23025
|
-
var require_kill = __commonJS({
|
|
23026
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/kill.js"(exports2, module2) {
|
|
23027
|
-
"use strict";
|
|
23028
|
-
var os = require("os");
|
|
23029
|
-
var onExit = require_signal_exit();
|
|
23030
|
-
var pFinally = require_p_finally();
|
|
23031
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
23032
|
-
var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
23033
|
-
const killResult = kill(signal);
|
|
23034
|
-
setKillTimeout(kill, signal, options, killResult);
|
|
23035
|
-
return killResult;
|
|
23036
|
-
};
|
|
23037
|
-
var setKillTimeout = (kill, signal, options, killResult) => {
|
|
23038
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
23039
|
-
return;
|
|
23040
|
-
}
|
|
23041
|
-
const timeout = getForceKillAfterTimeout(options);
|
|
23042
|
-
setTimeout(() => {
|
|
23043
|
-
kill("SIGKILL");
|
|
23044
|
-
}, timeout).unref();
|
|
23045
|
-
};
|
|
23046
|
-
var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => {
|
|
23047
|
-
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
23048
|
-
};
|
|
23049
|
-
var isSigterm = (signal) => {
|
|
23050
|
-
return signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
23051
|
-
};
|
|
23052
|
-
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
23053
|
-
if (forceKillAfterTimeout === true) {
|
|
23054
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
23055
|
-
}
|
|
23056
|
-
if (!Number.isInteger(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
23057
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
23058
|
-
}
|
|
23059
|
-
return forceKillAfterTimeout;
|
|
23060
|
-
};
|
|
23061
|
-
var spawnedCancel = (spawned, context) => {
|
|
23062
|
-
const killResult = spawned.kill();
|
|
23063
|
-
if (killResult) {
|
|
23064
|
-
context.isCanceled = true;
|
|
23065
|
-
}
|
|
23066
|
-
};
|
|
23067
|
-
var timeoutKill = (spawned, signal, reject) => {
|
|
23068
|
-
spawned.kill(signal);
|
|
23069
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
23070
|
-
};
|
|
23071
|
-
var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
23072
|
-
if (timeout === 0 || timeout === void 0) {
|
|
23073
|
-
return spawnedPromise;
|
|
23074
|
-
}
|
|
23075
|
-
if (!Number.isInteger(timeout) || timeout < 0) {
|
|
23076
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
23077
|
-
}
|
|
23078
|
-
let timeoutId;
|
|
23079
|
-
const timeoutPromise = new Promise((resolve, reject) => {
|
|
23080
|
-
timeoutId = setTimeout(() => {
|
|
23081
|
-
timeoutKill(spawned, killSignal, reject);
|
|
23082
|
-
}, timeout);
|
|
23083
|
-
});
|
|
23084
|
-
const safeSpawnedPromise = pFinally(spawnedPromise, () => {
|
|
23085
|
-
clearTimeout(timeoutId);
|
|
23086
|
-
});
|
|
23087
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
23088
|
-
};
|
|
23089
|
-
var setExitHandler = (spawned, { cleanup, detached }, timedPromise) => {
|
|
23090
|
-
if (!cleanup || detached) {
|
|
23091
|
-
return timedPromise;
|
|
23092
|
-
}
|
|
23093
|
-
const removeExitHandler = onExit(() => {
|
|
23094
|
-
spawned.kill();
|
|
23095
|
-
});
|
|
23096
|
-
return pFinally(timedPromise, removeExitHandler);
|
|
23097
|
-
};
|
|
23098
|
-
module2.exports = {
|
|
23099
|
-
spawnedKill,
|
|
23100
|
-
spawnedCancel,
|
|
23101
|
-
setupTimeout,
|
|
23102
|
-
setExitHandler
|
|
23103
|
-
};
|
|
23104
|
-
}
|
|
23105
|
-
});
|
|
23106
|
-
|
|
23107
|
-
// ../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js
|
|
23108
|
-
var require_is_stream = __commonJS({
|
|
23109
|
-
"../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports2, module2) {
|
|
23110
|
-
"use strict";
|
|
23111
|
-
var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
23112
|
-
isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
23113
|
-
isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
|
|
23114
|
-
isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream);
|
|
23115
|
-
isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function";
|
|
23116
|
-
module2.exports = isStream;
|
|
23117
|
-
}
|
|
23118
|
-
});
|
|
23119
|
-
|
|
23120
|
-
// ../../node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js
|
|
23121
|
-
var require_pump = __commonJS({
|
|
23122
|
-
"../../node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js"(exports2, module2) {
|
|
23123
|
-
var once = require_once();
|
|
23124
|
-
var eos2 = require_end_of_stream();
|
|
23125
|
-
var fs7;
|
|
23126
|
-
try {
|
|
23127
|
-
fs7 = require("fs");
|
|
23128
|
-
} catch (e) {
|
|
23129
|
-
}
|
|
23130
|
-
var noop = function() {
|
|
23131
|
-
};
|
|
23132
|
-
var ancient = /^v?\.0/.test(process.version);
|
|
23133
|
-
var isFn = function(fn) {
|
|
23134
|
-
return typeof fn === "function";
|
|
23135
|
-
};
|
|
23136
|
-
var isFS = function(stream) {
|
|
23137
|
-
if (!ancient)
|
|
23138
|
-
return false;
|
|
23139
|
-
if (!fs7)
|
|
23140
|
-
return false;
|
|
23141
|
-
return (stream instanceof (fs7.ReadStream || noop) || stream instanceof (fs7.WriteStream || noop)) && isFn(stream.close);
|
|
23142
|
-
};
|
|
23143
|
-
var isRequest = function(stream) {
|
|
23144
|
-
return stream.setHeader && isFn(stream.abort);
|
|
23145
|
-
};
|
|
23146
|
-
var destroyer = function(stream, reading, writing, callback) {
|
|
23147
|
-
callback = once(callback);
|
|
23148
|
-
var closed = false;
|
|
23149
|
-
stream.on("close", function() {
|
|
23150
|
-
closed = true;
|
|
23151
|
-
});
|
|
23152
|
-
eos2(stream, { readable: reading, writable: writing }, function(err) {
|
|
23153
|
-
if (err)
|
|
23154
|
-
return callback(err);
|
|
23155
|
-
closed = true;
|
|
23156
|
-
callback();
|
|
23157
|
-
});
|
|
23158
|
-
var destroyed = false;
|
|
23159
|
-
return function(err) {
|
|
23160
|
-
if (closed)
|
|
23161
|
-
return;
|
|
23162
|
-
if (destroyed)
|
|
23163
|
-
return;
|
|
23164
|
-
destroyed = true;
|
|
23165
|
-
if (isFS(stream))
|
|
23166
|
-
return stream.close(noop);
|
|
23167
|
-
if (isRequest(stream))
|
|
23168
|
-
return stream.abort();
|
|
23169
|
-
if (isFn(stream.destroy))
|
|
23170
|
-
return stream.destroy();
|
|
23171
|
-
callback(err || new Error("stream was destroyed"));
|
|
23172
|
-
};
|
|
23173
|
-
};
|
|
23174
|
-
var call = function(fn) {
|
|
23175
|
-
fn();
|
|
23176
|
-
};
|
|
23177
|
-
var pipe = function(from, to) {
|
|
23178
|
-
return from.pipe(to);
|
|
23179
|
-
};
|
|
23180
|
-
var pump = function() {
|
|
23181
|
-
var streams = Array.prototype.slice.call(arguments);
|
|
23182
|
-
var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop;
|
|
23183
|
-
if (Array.isArray(streams[0]))
|
|
23184
|
-
streams = streams[0];
|
|
23185
|
-
if (streams.length < 2)
|
|
23186
|
-
throw new Error("pump requires two streams per minimum");
|
|
23187
|
-
var error;
|
|
23188
|
-
var destroys = streams.map(function(stream, i) {
|
|
23189
|
-
var reading = i < streams.length - 1;
|
|
23190
|
-
var writing = i > 0;
|
|
23191
|
-
return destroyer(stream, reading, writing, function(err) {
|
|
23192
|
-
if (!error)
|
|
23193
|
-
error = err;
|
|
23194
|
-
if (err)
|
|
23195
|
-
destroys.forEach(call);
|
|
23196
|
-
if (reading)
|
|
23197
|
-
return;
|
|
23198
|
-
destroys.forEach(call);
|
|
23199
|
-
callback(error);
|
|
23200
|
-
});
|
|
23201
|
-
});
|
|
23202
|
-
return streams.reduce(pipe);
|
|
23203
|
-
};
|
|
23204
|
-
module2.exports = pump;
|
|
23205
|
-
}
|
|
23206
|
-
});
|
|
23207
|
-
|
|
23208
|
-
// ../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/buffer-stream.js
|
|
23209
|
-
var require_buffer_stream = __commonJS({
|
|
23210
|
-
"../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/buffer-stream.js"(exports2, module2) {
|
|
23211
|
-
"use strict";
|
|
23212
|
-
var { PassThrough: PassThroughStream } = require("stream");
|
|
23213
|
-
module2.exports = (options) => {
|
|
23214
|
-
options = { ...options };
|
|
23215
|
-
const { array } = options;
|
|
23216
|
-
let { encoding } = options;
|
|
23217
|
-
const isBuffer = encoding === "buffer";
|
|
23218
|
-
let objectMode = false;
|
|
23219
|
-
if (array) {
|
|
23220
|
-
objectMode = !(encoding || isBuffer);
|
|
23221
|
-
} else {
|
|
23222
|
-
encoding = encoding || "utf8";
|
|
23223
|
-
}
|
|
23224
|
-
if (isBuffer) {
|
|
23225
|
-
encoding = null;
|
|
23226
|
-
}
|
|
23227
|
-
const stream = new PassThroughStream({ objectMode });
|
|
23228
|
-
if (encoding) {
|
|
23229
|
-
stream.setEncoding(encoding);
|
|
23230
|
-
}
|
|
23231
|
-
let length = 0;
|
|
23232
|
-
const chunks = [];
|
|
23233
|
-
stream.on("data", (chunk) => {
|
|
23234
|
-
chunks.push(chunk);
|
|
23235
|
-
if (objectMode) {
|
|
23236
|
-
length = chunks.length;
|
|
23237
|
-
} else {
|
|
23238
|
-
length += chunk.length;
|
|
23239
|
-
}
|
|
23240
|
-
});
|
|
23241
|
-
stream.getBufferedValue = () => {
|
|
23242
|
-
if (array) {
|
|
23243
|
-
return chunks;
|
|
23244
|
-
}
|
|
23245
|
-
return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
|
|
23246
|
-
};
|
|
23247
|
-
stream.getBufferedLength = () => length;
|
|
23248
|
-
return stream;
|
|
23249
|
-
};
|
|
23250
|
-
}
|
|
23251
|
-
});
|
|
23252
|
-
|
|
23253
|
-
// ../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/index.js
|
|
23254
|
-
var require_get_stream = __commonJS({
|
|
23255
|
-
"../../node_modules/.pnpm/get-stream@5.2.0/node_modules/get-stream/index.js"(exports2, module2) {
|
|
23256
|
-
"use strict";
|
|
23257
|
-
var { constants: BufferConstants } = require("buffer");
|
|
23258
|
-
var pump = require_pump();
|
|
23259
|
-
var bufferStream = require_buffer_stream();
|
|
23260
|
-
var MaxBufferError = class extends Error {
|
|
23261
|
-
constructor() {
|
|
23262
|
-
super("maxBuffer exceeded");
|
|
23263
|
-
this.name = "MaxBufferError";
|
|
23264
|
-
}
|
|
23265
|
-
};
|
|
23266
|
-
async function getStream(inputStream, options) {
|
|
23267
|
-
if (!inputStream) {
|
|
23268
|
-
return Promise.reject(new Error("Expected a stream"));
|
|
23269
|
-
}
|
|
23270
|
-
options = {
|
|
23271
|
-
maxBuffer: Infinity,
|
|
23272
|
-
...options
|
|
23273
|
-
};
|
|
23274
|
-
const { maxBuffer } = options;
|
|
23275
|
-
let stream;
|
|
23276
|
-
await new Promise((resolve, reject) => {
|
|
23277
|
-
const rejectPromise = (error) => {
|
|
23278
|
-
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
23279
|
-
error.bufferedData = stream.getBufferedValue();
|
|
23280
|
-
}
|
|
23281
|
-
reject(error);
|
|
23282
|
-
};
|
|
23283
|
-
stream = pump(inputStream, bufferStream(options), (error) => {
|
|
23284
|
-
if (error) {
|
|
23285
|
-
rejectPromise(error);
|
|
23286
|
-
return;
|
|
23287
|
-
}
|
|
23288
|
-
resolve();
|
|
23289
|
-
});
|
|
23290
|
-
stream.on("data", () => {
|
|
23291
|
-
if (stream.getBufferedLength() > maxBuffer) {
|
|
23292
|
-
rejectPromise(new MaxBufferError());
|
|
23293
|
-
}
|
|
23294
|
-
});
|
|
23295
|
-
});
|
|
23296
|
-
return stream.getBufferedValue();
|
|
23297
|
-
}
|
|
23298
|
-
module2.exports = getStream;
|
|
23299
|
-
module2.exports.default = getStream;
|
|
23300
|
-
module2.exports.buffer = (stream, options) => getStream(stream, { ...options, encoding: "buffer" });
|
|
23301
|
-
module2.exports.array = (stream, options) => getStream(stream, { ...options, array: true });
|
|
23302
|
-
module2.exports.MaxBufferError = MaxBufferError;
|
|
23303
|
-
}
|
|
23304
|
-
});
|
|
23305
|
-
|
|
23306
|
-
// ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
|
|
23307
|
-
var require_merge_stream = __commonJS({
|
|
23308
|
-
"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module2) {
|
|
23309
|
-
"use strict";
|
|
23310
|
-
var { PassThrough } = require("stream");
|
|
23311
|
-
module2.exports = function() {
|
|
23312
|
-
var sources = [];
|
|
23313
|
-
var output = new PassThrough({ objectMode: true });
|
|
23314
|
-
output.setMaxListeners(0);
|
|
23315
|
-
output.add = add;
|
|
23316
|
-
output.isEmpty = isEmpty;
|
|
23317
|
-
output.on("unpipe", remove2);
|
|
23318
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
23319
|
-
return output;
|
|
23320
|
-
function add(source) {
|
|
23321
|
-
if (Array.isArray(source)) {
|
|
23322
|
-
source.forEach(add);
|
|
23323
|
-
return this;
|
|
23324
|
-
}
|
|
23325
|
-
sources.push(source);
|
|
23326
|
-
source.once("end", remove2.bind(null, source));
|
|
23327
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
23328
|
-
source.pipe(output, { end: false });
|
|
23329
|
-
return this;
|
|
23330
|
-
}
|
|
23331
|
-
function isEmpty() {
|
|
23332
|
-
return sources.length == 0;
|
|
23333
|
-
}
|
|
23334
|
-
function remove2(source) {
|
|
23335
|
-
sources = sources.filter(function(it) {
|
|
23336
|
-
return it !== source;
|
|
23337
|
-
});
|
|
23338
|
-
if (!sources.length && output.readable) {
|
|
23339
|
-
output.end();
|
|
23340
|
-
}
|
|
23341
|
-
}
|
|
23342
|
-
};
|
|
23343
|
-
}
|
|
23344
|
-
});
|
|
23345
|
-
|
|
23346
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/stream.js
|
|
23347
|
-
var require_stream2 = __commonJS({
|
|
23348
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/stream.js"(exports2, module2) {
|
|
23349
|
-
"use strict";
|
|
23350
|
-
var isStream = require_is_stream();
|
|
23351
|
-
var getStream = require_get_stream();
|
|
23352
|
-
var mergeStream = require_merge_stream();
|
|
23353
|
-
var handleInput = (spawned, input) => {
|
|
23354
|
-
if (input === void 0 || spawned.stdin === void 0) {
|
|
23355
|
-
return;
|
|
23356
|
-
}
|
|
23357
|
-
if (isStream(input)) {
|
|
23358
|
-
input.pipe(spawned.stdin);
|
|
23359
|
-
} else {
|
|
23360
|
-
spawned.stdin.end(input);
|
|
23361
|
-
}
|
|
23362
|
-
};
|
|
23363
|
-
var makeAllStream = (spawned, { all }) => {
|
|
23364
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
23365
|
-
return;
|
|
23366
|
-
}
|
|
23367
|
-
const mixed = mergeStream();
|
|
23368
|
-
if (spawned.stdout) {
|
|
23369
|
-
mixed.add(spawned.stdout);
|
|
23370
|
-
}
|
|
23371
|
-
if (spawned.stderr) {
|
|
23372
|
-
mixed.add(spawned.stderr);
|
|
23373
|
-
}
|
|
23374
|
-
return mixed;
|
|
23375
|
-
};
|
|
23376
|
-
var getBufferedData = async (stream, streamPromise) => {
|
|
23377
|
-
if (!stream) {
|
|
23378
|
-
return;
|
|
23379
|
-
}
|
|
23380
|
-
stream.destroy();
|
|
23381
|
-
try {
|
|
23382
|
-
return await streamPromise;
|
|
23383
|
-
} catch (error) {
|
|
23384
|
-
return error.bufferedData;
|
|
23385
|
-
}
|
|
23386
|
-
};
|
|
23387
|
-
var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
23388
|
-
if (!stream || !buffer) {
|
|
23389
|
-
return;
|
|
23390
|
-
}
|
|
23391
|
-
if (encoding) {
|
|
23392
|
-
return getStream(stream, { encoding, maxBuffer });
|
|
23393
|
-
}
|
|
23394
|
-
return getStream.buffer(stream, { maxBuffer });
|
|
23395
|
-
};
|
|
23396
|
-
var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
23397
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
23398
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
23399
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
23400
|
-
try {
|
|
23401
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
23402
|
-
} catch (error) {
|
|
23403
|
-
return Promise.all([
|
|
23404
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
23405
|
-
getBufferedData(stdout, stdoutPromise),
|
|
23406
|
-
getBufferedData(stderr, stderrPromise),
|
|
23407
|
-
getBufferedData(all, allPromise)
|
|
23408
|
-
]);
|
|
23409
|
-
}
|
|
23410
|
-
};
|
|
23411
|
-
var validateInputSync = ({ input }) => {
|
|
23412
|
-
if (isStream(input)) {
|
|
23413
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
23414
|
-
}
|
|
23415
|
-
};
|
|
23416
|
-
module2.exports = {
|
|
23417
|
-
handleInput,
|
|
23418
|
-
makeAllStream,
|
|
23419
|
-
getSpawnedResult,
|
|
23420
|
-
validateInputSync
|
|
23421
|
-
};
|
|
23422
|
-
}
|
|
23423
|
-
});
|
|
23424
|
-
|
|
23425
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/promise.js
|
|
23426
|
-
var require_promise = __commonJS({
|
|
23427
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/promise.js"(exports2, module2) {
|
|
23428
|
-
"use strict";
|
|
23429
|
-
var mergePromiseProperty = (spawned, promise, property) => {
|
|
23430
|
-
const value = typeof promise === "function" ? (...args) => promise()[property](...args) : promise[property].bind(promise);
|
|
23431
|
-
Object.defineProperty(spawned, property, {
|
|
23432
|
-
value,
|
|
23433
|
-
writable: true,
|
|
23434
|
-
enumerable: false,
|
|
23435
|
-
configurable: true
|
|
23436
|
-
});
|
|
23437
|
-
};
|
|
23438
|
-
var mergePromise = (spawned, promise) => {
|
|
23439
|
-
mergePromiseProperty(spawned, promise, "then");
|
|
23440
|
-
mergePromiseProperty(spawned, promise, "catch");
|
|
23441
|
-
if (Promise.prototype.finally) {
|
|
23442
|
-
mergePromiseProperty(spawned, promise, "finally");
|
|
23443
|
-
}
|
|
23444
|
-
return spawned;
|
|
23445
|
-
};
|
|
23446
|
-
var getSpawnedPromise = (spawned) => {
|
|
23447
|
-
return new Promise((resolve, reject) => {
|
|
23448
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
23449
|
-
resolve({ exitCode, signal });
|
|
23450
|
-
});
|
|
23451
|
-
spawned.on("error", (error) => {
|
|
23452
|
-
reject(error);
|
|
23453
|
-
});
|
|
23454
|
-
if (spawned.stdin) {
|
|
23455
|
-
spawned.stdin.on("error", (error) => {
|
|
23456
|
-
reject(error);
|
|
23457
|
-
});
|
|
23458
|
-
}
|
|
23459
|
-
});
|
|
23460
|
-
};
|
|
23461
|
-
module2.exports = {
|
|
23462
|
-
mergePromise,
|
|
23463
|
-
getSpawnedPromise
|
|
23464
|
-
};
|
|
23465
|
-
}
|
|
23466
|
-
});
|
|
23467
|
-
|
|
23468
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/command.js
|
|
23469
|
-
var require_command = __commonJS({
|
|
23470
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/lib/command.js"(exports2, module2) {
|
|
23471
|
-
"use strict";
|
|
23472
|
-
var SPACES_REGEXP = / +/g;
|
|
23473
|
-
var joinCommand = (file, args = []) => {
|
|
23474
|
-
if (!Array.isArray(args)) {
|
|
23475
|
-
return file;
|
|
23476
|
-
}
|
|
23477
|
-
return [file, ...args].join(" ");
|
|
23478
|
-
};
|
|
23479
|
-
var handleEscaping = (tokens, token, index) => {
|
|
23480
|
-
if (index === 0) {
|
|
23481
|
-
return [token];
|
|
23482
|
-
}
|
|
23483
|
-
const previousToken = tokens[tokens.length - 1];
|
|
23484
|
-
if (previousToken.endsWith("\\")) {
|
|
23485
|
-
return [...tokens.slice(0, -1), `${previousToken.slice(0, -1)} ${token}`];
|
|
23486
|
-
}
|
|
23487
|
-
return [...tokens, token];
|
|
23488
|
-
};
|
|
23489
|
-
var parseCommand = (command) => {
|
|
23490
|
-
return command.trim().split(SPACES_REGEXP).reduce(handleEscaping, []);
|
|
23491
|
-
};
|
|
23492
|
-
module2.exports = {
|
|
23493
|
-
joinCommand,
|
|
23494
|
-
parseCommand
|
|
23495
|
-
};
|
|
23496
|
-
}
|
|
23497
|
-
});
|
|
23498
|
-
|
|
23499
|
-
// ../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/index.js
|
|
23500
|
-
var require_execa = __commonJS({
|
|
23501
|
-
"../../node_modules/.pnpm/execa@3.2.0/node_modules/execa/index.js"(exports2, module2) {
|
|
23502
|
-
"use strict";
|
|
23503
|
-
var path7 = require("path");
|
|
23504
|
-
var childProcess = require("child_process");
|
|
23505
|
-
var crossSpawn = require_cross_spawn2();
|
|
23506
|
-
var stripFinalNewline = require_strip_final_newline();
|
|
23507
|
-
var npmRunPath = require_npm_run_path();
|
|
23508
|
-
var onetime = require_onetime();
|
|
23509
|
-
var makeError = require_error();
|
|
23510
|
-
var normalizeStdio = require_stdio();
|
|
23511
|
-
var { spawnedKill, spawnedCancel, setupTimeout, setExitHandler } = require_kill();
|
|
23512
|
-
var { handleInput, getSpawnedResult, makeAllStream, validateInputSync } = require_stream2();
|
|
23513
|
-
var { mergePromise, getSpawnedPromise } = require_promise();
|
|
23514
|
-
var { joinCommand, parseCommand } = require_command();
|
|
23515
|
-
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
23516
|
-
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
23517
|
-
const env = extendEnv ? { ...process.env, ...envOption } : envOption;
|
|
23518
|
-
if (preferLocal) {
|
|
23519
|
-
return npmRunPath.env({ env, cwd: localDir, execPath });
|
|
23520
|
-
}
|
|
23521
|
-
return env;
|
|
23522
|
-
};
|
|
23523
|
-
var handleArgs = (file, args, options = {}) => {
|
|
23524
|
-
const parsed = crossSpawn._parse(file, args, options);
|
|
23525
|
-
file = parsed.command;
|
|
23526
|
-
args = parsed.args;
|
|
23527
|
-
options = parsed.options;
|
|
23528
|
-
options = {
|
|
23529
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
23530
|
-
buffer: true,
|
|
23531
|
-
stripFinalNewline: true,
|
|
23532
|
-
extendEnv: true,
|
|
23533
|
-
preferLocal: false,
|
|
23534
|
-
localDir: options.cwd || process.cwd(),
|
|
23535
|
-
execPath: process.execPath,
|
|
23536
|
-
encoding: "utf8",
|
|
23537
|
-
reject: true,
|
|
23538
|
-
cleanup: true,
|
|
23539
|
-
all: false,
|
|
23540
|
-
...options,
|
|
23541
|
-
windowsHide: true
|
|
23542
|
-
};
|
|
23543
|
-
options.env = getEnv(options);
|
|
23544
|
-
options.stdio = normalizeStdio(options);
|
|
23545
|
-
if (process.platform === "win32" && path7.basename(file, ".exe") === "cmd") {
|
|
23546
|
-
args.unshift("/q");
|
|
23547
|
-
}
|
|
23548
|
-
return { file, args, options, parsed };
|
|
23549
|
-
};
|
|
23550
|
-
var handleOutput = (options, value, error) => {
|
|
23551
|
-
if (typeof value !== "string" && !Buffer.isBuffer(value)) {
|
|
23552
|
-
return error === void 0 ? void 0 : "";
|
|
23553
|
-
}
|
|
23554
|
-
if (options.stripFinalNewline) {
|
|
23555
|
-
return stripFinalNewline(value);
|
|
23556
|
-
}
|
|
23557
|
-
return value;
|
|
23558
|
-
};
|
|
23559
|
-
var execa2 = (file, args, options) => {
|
|
23560
|
-
const parsed = handleArgs(file, args, options);
|
|
23561
|
-
const command = joinCommand(file, args);
|
|
23562
|
-
let spawned;
|
|
23563
|
-
try {
|
|
23564
|
-
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
23565
|
-
} catch (error) {
|
|
23566
|
-
const dummySpawned = new childProcess.ChildProcess();
|
|
23567
|
-
const errorPromise = Promise.reject(makeError({
|
|
23568
|
-
error,
|
|
23569
|
-
stdout: "",
|
|
23570
|
-
stderr: "",
|
|
23571
|
-
all: "",
|
|
23572
|
-
command,
|
|
23573
|
-
parsed,
|
|
23574
|
-
timedOut: false,
|
|
23575
|
-
isCanceled: false,
|
|
23576
|
-
killed: false
|
|
23577
|
-
}));
|
|
23578
|
-
return mergePromise(dummySpawned, errorPromise);
|
|
23579
|
-
}
|
|
23580
|
-
const spawnedPromise = getSpawnedPromise(spawned);
|
|
23581
|
-
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
23582
|
-
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
23583
|
-
const context = { isCanceled: false };
|
|
23584
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
23585
|
-
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
23586
|
-
const handlePromise = async () => {
|
|
23587
|
-
const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
23588
|
-
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
23589
|
-
const stderr = handleOutput(parsed.options, stderrResult);
|
|
23590
|
-
const all = handleOutput(parsed.options, allResult);
|
|
23591
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
23592
|
-
const returnedError = makeError({
|
|
23593
|
-
error,
|
|
23594
|
-
exitCode,
|
|
23595
|
-
signal,
|
|
23596
|
-
stdout,
|
|
23597
|
-
stderr,
|
|
23598
|
-
all,
|
|
23599
|
-
command,
|
|
23600
|
-
parsed,
|
|
23601
|
-
timedOut,
|
|
23602
|
-
isCanceled: context.isCanceled,
|
|
23603
|
-
killed: spawned.killed
|
|
23604
|
-
});
|
|
23605
|
-
if (!parsed.options.reject) {
|
|
23606
|
-
return returnedError;
|
|
23607
|
-
}
|
|
23608
|
-
throw returnedError;
|
|
23609
|
-
}
|
|
23610
|
-
return {
|
|
23611
|
-
command,
|
|
23612
|
-
exitCode: 0,
|
|
23613
|
-
stdout,
|
|
23614
|
-
stderr,
|
|
23615
|
-
all,
|
|
23616
|
-
failed: false,
|
|
23617
|
-
timedOut: false,
|
|
23618
|
-
isCanceled: false,
|
|
23619
|
-
killed: false
|
|
23620
|
-
};
|
|
23621
|
-
};
|
|
23622
|
-
const handlePromiseOnce = onetime(handlePromise);
|
|
23623
|
-
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
|
|
23624
|
-
handleInput(spawned, parsed.options.input);
|
|
23625
|
-
spawned.all = makeAllStream(spawned, parsed.options);
|
|
23626
|
-
return mergePromise(spawned, handlePromiseOnce);
|
|
23627
|
-
};
|
|
23628
|
-
module2.exports = execa2;
|
|
23629
|
-
module2.exports.sync = (file, args, options) => {
|
|
23630
|
-
const parsed = handleArgs(file, args, options);
|
|
23631
|
-
const command = joinCommand(file, args);
|
|
23632
|
-
validateInputSync(parsed.options);
|
|
23633
|
-
let result;
|
|
23634
|
-
try {
|
|
23635
|
-
result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
|
|
23636
|
-
} catch (error) {
|
|
23637
|
-
throw makeError({
|
|
23638
|
-
error,
|
|
23639
|
-
stdout: "",
|
|
23640
|
-
stderr: "",
|
|
23641
|
-
all: "",
|
|
23642
|
-
command,
|
|
23643
|
-
parsed,
|
|
23644
|
-
timedOut: false,
|
|
23645
|
-
isCanceled: false,
|
|
23646
|
-
killed: false
|
|
23647
|
-
});
|
|
23648
|
-
}
|
|
23649
|
-
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
23650
|
-
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
23651
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
23652
|
-
const error = makeError({
|
|
23653
|
-
stdout,
|
|
23654
|
-
stderr,
|
|
23655
|
-
error: result.error,
|
|
23656
|
-
signal: result.signal,
|
|
23657
|
-
exitCode: result.status,
|
|
23658
|
-
command,
|
|
23659
|
-
parsed,
|
|
23660
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
23661
|
-
isCanceled: false,
|
|
23662
|
-
killed: result.signal !== null
|
|
23663
|
-
});
|
|
23664
|
-
if (!parsed.options.reject) {
|
|
23665
|
-
return error;
|
|
23666
|
-
}
|
|
23667
|
-
throw error;
|
|
23668
|
-
}
|
|
23669
|
-
return {
|
|
23670
|
-
command,
|
|
23671
|
-
exitCode: 0,
|
|
23672
|
-
stdout,
|
|
23673
|
-
stderr,
|
|
23674
|
-
failed: false,
|
|
23675
|
-
timedOut: false,
|
|
23676
|
-
isCanceled: false,
|
|
23677
|
-
killed: false
|
|
23678
|
-
};
|
|
23679
|
-
};
|
|
23680
|
-
module2.exports.command = (command, options) => {
|
|
23681
|
-
const [file, ...args] = parseCommand(command);
|
|
23682
|
-
return execa2(file, args, options);
|
|
23683
|
-
};
|
|
23684
|
-
module2.exports.commandSync = (command, options) => {
|
|
23685
|
-
const [file, ...args] = parseCommand(command);
|
|
23686
|
-
return execa2.sync(file, args, options);
|
|
23687
|
-
};
|
|
23688
|
-
module2.exports.node = (scriptPath, args, options = {}) => {
|
|
23689
|
-
if (args && !Array.isArray(args) && typeof args === "object") {
|
|
23690
|
-
options = args;
|
|
23691
|
-
args = [];
|
|
23692
|
-
}
|
|
23693
|
-
const stdio = normalizeStdio.node(options);
|
|
23694
|
-
const { nodePath = process.execPath, nodeOptions = process.execArgv } = options;
|
|
23695
|
-
return execa2(
|
|
23696
|
-
nodePath,
|
|
23697
|
-
[
|
|
23698
|
-
...nodeOptions,
|
|
23699
|
-
scriptPath,
|
|
23700
|
-
...Array.isArray(args) ? args : []
|
|
23701
|
-
],
|
|
23702
|
-
{
|
|
23703
|
-
...options,
|
|
23704
|
-
stdin: void 0,
|
|
23705
|
-
stdout: void 0,
|
|
23706
|
-
stderr: void 0,
|
|
23707
|
-
stdio,
|
|
23708
|
-
shell: false
|
|
23709
|
-
}
|
|
23710
|
-
);
|
|
23711
|
-
};
|
|
23712
|
-
}
|
|
23713
|
-
});
|
|
23714
|
-
|
|
23715
21817
|
// src/index.ts
|
|
23716
21818
|
var src_exports = {};
|
|
23717
21819
|
__export(src_exports, {
|
|
@@ -23763,6 +21865,7 @@ __export(src_exports, {
|
|
|
23763
21865
|
getPrettyError: () => getPrettyError,
|
|
23764
21866
|
getProvidedRuntime: () => getProvidedRuntime,
|
|
23765
21867
|
getScriptName: () => getScriptName,
|
|
21868
|
+
getServiceUrlEnvVars: () => getServiceUrlEnvVars,
|
|
23766
21869
|
getSpawnOptions: () => getSpawnOptions,
|
|
23767
21870
|
getSupportedBunVersion: () => getSupportedBunVersion,
|
|
23768
21871
|
getSupportedNodeVersion: () => getSupportedNodeVersion,
|
|
@@ -23789,7 +21892,6 @@ __export(src_exports, {
|
|
|
23789
21892
|
runPackageJsonScript: () => runPackageJsonScript,
|
|
23790
21893
|
runPipInstall: () => runPipInstall,
|
|
23791
21894
|
runShellScript: () => runShellScript,
|
|
23792
|
-
runStdlibPyScript: () => runStdlibPyScript,
|
|
23793
21895
|
scanParentDirs: () => scanParentDirs,
|
|
23794
21896
|
shouldServe: () => shouldServe,
|
|
23795
21897
|
shouldUseExperimentalBackends: () => shouldUseExperimentalBackends,
|
|
@@ -23824,7 +21926,14 @@ var FileBlob = class _FileBlob {
|
|
|
23824
21926
|
(0, import_assert.default)(typeof stream.pipe === "function");
|
|
23825
21927
|
const chunks = [];
|
|
23826
21928
|
await new Promise((resolve, reject) => {
|
|
23827
|
-
stream.on(
|
|
21929
|
+
stream.on(
|
|
21930
|
+
"data",
|
|
21931
|
+
(chunk) => (
|
|
21932
|
+
// Usually the chunks we receive here are already buffers, so we
|
|
21933
|
+
// avoid the extra buffer copy in those cases to save memory
|
|
21934
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk))
|
|
21935
|
+
)
|
|
21936
|
+
);
|
|
23828
21937
|
stream.on("error", (error) => reject(error));
|
|
23829
21938
|
stream.on("end", () => resolve());
|
|
23830
21939
|
});
|
|
@@ -26250,6 +24359,57 @@ function getPrefixedEnvVars({
|
|
|
26250
24359
|
return newEnvs;
|
|
26251
24360
|
}
|
|
26252
24361
|
|
|
24362
|
+
// src/get-service-url-env-vars.ts
|
|
24363
|
+
function serviceNameToEnvVar(name) {
|
|
24364
|
+
return `${name.replace(/-/g, "_").toUpperCase()}_URL`;
|
|
24365
|
+
}
|
|
24366
|
+
function computeServiceUrl(deploymentUrl, routePrefix) {
|
|
24367
|
+
if (routePrefix === "/") {
|
|
24368
|
+
return `https://${deploymentUrl}`;
|
|
24369
|
+
}
|
|
24370
|
+
const normalizedPrefix = routePrefix.startsWith("/") ? routePrefix.slice(1) : routePrefix;
|
|
24371
|
+
return `https://${deploymentUrl}/${normalizedPrefix}`;
|
|
24372
|
+
}
|
|
24373
|
+
function getFrameworkEnvPrefix(frameworkSlug, frameworkList) {
|
|
24374
|
+
if (!frameworkSlug)
|
|
24375
|
+
return void 0;
|
|
24376
|
+
const framework = frameworkList.find(
|
|
24377
|
+
(f) => f.slug !== null && f.slug === frameworkSlug
|
|
24378
|
+
);
|
|
24379
|
+
return framework?.envPrefix;
|
|
24380
|
+
}
|
|
24381
|
+
function getServiceUrlEnvVars(options) {
|
|
24382
|
+
const { services, frameworkList, currentEnv = {}, deploymentUrl } = options;
|
|
24383
|
+
if (!deploymentUrl || !services || services.length === 0) {
|
|
24384
|
+
return {};
|
|
24385
|
+
}
|
|
24386
|
+
const envVars = {};
|
|
24387
|
+
const frameworkPrefixes = /* @__PURE__ */ new Set();
|
|
24388
|
+
for (const service of services) {
|
|
24389
|
+
const prefix = getFrameworkEnvPrefix(service.framework, frameworkList);
|
|
24390
|
+
if (prefix) {
|
|
24391
|
+
frameworkPrefixes.add(prefix);
|
|
24392
|
+
}
|
|
24393
|
+
}
|
|
24394
|
+
for (const service of services) {
|
|
24395
|
+
if (service.type !== "web" || !service.routePrefix) {
|
|
24396
|
+
continue;
|
|
24397
|
+
}
|
|
24398
|
+
const baseEnvVarName = serviceNameToEnvVar(service.name);
|
|
24399
|
+
const url = computeServiceUrl(deploymentUrl, service.routePrefix);
|
|
24400
|
+
if (!(baseEnvVarName in currentEnv)) {
|
|
24401
|
+
envVars[baseEnvVarName] = url;
|
|
24402
|
+
}
|
|
24403
|
+
for (const prefix of frameworkPrefixes) {
|
|
24404
|
+
const prefixedEnvVarName = `${prefix}${baseEnvVarName}`;
|
|
24405
|
+
if (!(prefixedEnvVarName in currentEnv)) {
|
|
24406
|
+
envVars[prefixedEnvVarName] = url;
|
|
24407
|
+
}
|
|
24408
|
+
}
|
|
24409
|
+
}
|
|
24410
|
+
return envVars;
|
|
24411
|
+
}
|
|
24412
|
+
|
|
26253
24413
|
// src/hard-link-dir.ts
|
|
26254
24414
|
var import_path8 = __toESM(require("path"));
|
|
26255
24415
|
var import_fs2 = require("fs");
|
|
@@ -26821,45 +24981,14 @@ function shouldUseExperimentalBackends(framework) {
|
|
|
26821
24981
|
|
|
26822
24982
|
// src/python.ts
|
|
26823
24983
|
var import_fs3 = __toESM(require("fs"));
|
|
26824
|
-
var
|
|
26825
|
-
var import_execa = __toESM(require_execa());
|
|
26826
|
-
var isWin2 = process.platform === "win32";
|
|
26827
|
-
async function runStdlibPyScript(options) {
|
|
26828
|
-
const { scriptName, pythonPath, args = [], cwd } = options;
|
|
26829
|
-
const scriptPath = (0, import_path11.join)(__dirname, "..", "lib", "python", `${scriptName}.py`);
|
|
26830
|
-
if (!import_fs3.default.existsSync(scriptPath)) {
|
|
26831
|
-
throw new Error(`Python script not found: ${scriptPath}`);
|
|
26832
|
-
}
|
|
26833
|
-
const pythonCmd = pythonPath ?? (isWin2 ? "python" : "python3");
|
|
26834
|
-
debug(
|
|
26835
|
-
`Running stdlib Python script: ${pythonCmd} ${scriptPath} ${args.join(" ")}`
|
|
26836
|
-
);
|
|
26837
|
-
try {
|
|
26838
|
-
const result = await (0, import_execa.default)(pythonCmd, [scriptPath, ...args], { cwd });
|
|
26839
|
-
return { exitCode: 0, stdout: result.stdout, stderr: result.stderr };
|
|
26840
|
-
} catch (err) {
|
|
26841
|
-
const execaErr = err;
|
|
26842
|
-
return {
|
|
26843
|
-
exitCode: execaErr.exitCode ?? 1,
|
|
26844
|
-
stdout: execaErr.stdout ?? "",
|
|
26845
|
-
stderr: execaErr.stderr ?? ""
|
|
26846
|
-
};
|
|
26847
|
-
}
|
|
26848
|
-
}
|
|
24984
|
+
var import_python_analysis = require("@vercel/python-analysis");
|
|
26849
24985
|
async function isPythonEntrypoint(file) {
|
|
26850
24986
|
try {
|
|
26851
24987
|
const fsPath = file.fsPath;
|
|
26852
24988
|
if (!fsPath)
|
|
26853
24989
|
return false;
|
|
26854
24990
|
const content = await import_fs3.default.promises.readFile(fsPath, "utf-8");
|
|
26855
|
-
|
|
26856
|
-
return false;
|
|
26857
|
-
}
|
|
26858
|
-
const result = await runStdlibPyScript({
|
|
26859
|
-
scriptName: "ast_parser",
|
|
26860
|
-
args: [fsPath]
|
|
26861
|
-
});
|
|
26862
|
-
return result.exitCode === 0;
|
|
24991
|
+
return await (0, import_python_analysis.containsAppOrHandler)(content);
|
|
26863
24992
|
} catch (err) {
|
|
26864
24993
|
debug(`Failed to check Python entrypoint: ${err}`);
|
|
26865
24994
|
return false;
|
|
@@ -26915,6 +25044,7 @@ async function isPythonEntrypoint(file) {
|
|
|
26915
25044
|
getPrettyError,
|
|
26916
25045
|
getProvidedRuntime,
|
|
26917
25046
|
getScriptName,
|
|
25047
|
+
getServiceUrlEnvVars,
|
|
26918
25048
|
getSpawnOptions,
|
|
26919
25049
|
getSupportedBunVersion,
|
|
26920
25050
|
getSupportedNodeVersion,
|
|
@@ -26941,7 +25071,6 @@ async function isPythonEntrypoint(file) {
|
|
|
26941
25071
|
runPackageJsonScript,
|
|
26942
25072
|
runPipInstall,
|
|
26943
25073
|
runShellScript,
|
|
26944
|
-
runStdlibPyScript,
|
|
26945
25074
|
scanParentDirs,
|
|
26946
25075
|
shouldServe,
|
|
26947
25076
|
shouldUseExperimentalBackends,
|