@hot-updater/supabase 0.20.11 → 0.20.13
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/iac/index.cjs +164 -276
- package/dist/iac/index.js +162 -274
- package/dist/index.cjs +24 -30
- package/dist/index.js +23 -29
- package/package.json +4 -4
- package/supabase/edge-functions/index.ts +2 -2
package/dist/iac/index.cjs
CHANGED
|
@@ -32,6 +32,8 @@ let node_readline = require("node:readline");
|
|
|
32
32
|
node_readline = __toESM(node_readline);
|
|
33
33
|
let node_tty = require("node:tty");
|
|
34
34
|
node_tty = __toESM(node_tty);
|
|
35
|
+
let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
36
|
+
__hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
|
|
35
37
|
let node_url = require("node:url");
|
|
36
38
|
node_url = __toESM(node_url);
|
|
37
39
|
let node_child_process = require("node:child_process");
|
|
@@ -58,12 +60,10 @@ let node_stream = require("node:stream");
|
|
|
58
60
|
node_stream = __toESM(node_stream);
|
|
59
61
|
let node_buffer = require("node:buffer");
|
|
60
62
|
node_buffer = __toESM(node_buffer);
|
|
61
|
-
let __supabase_supabase_js = require("@supabase/supabase-js");
|
|
62
|
-
__supabase_supabase_js = __toESM(__supabase_supabase_js);
|
|
63
|
-
let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
64
|
-
__hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
|
|
65
63
|
let fs_promises = require("fs/promises");
|
|
66
64
|
fs_promises = __toESM(fs_promises);
|
|
65
|
+
let __supabase_supabase_js = require("@supabase/supabase-js");
|
|
66
|
+
__supabase_supabase_js = __toESM(__supabase_supabase_js);
|
|
67
67
|
|
|
68
68
|
//#region ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
69
69
|
var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js": ((exports, module) => {
|
|
@@ -457,16 +457,16 @@ function G(t, u$2, F$1) {
|
|
|
457
457
|
`).map((e$1) => oD(e$1, u$2, F$1)).join(`
|
|
458
458
|
`);
|
|
459
459
|
}
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
460
|
+
const c$1 = {
|
|
461
|
+
actions: new Set([
|
|
462
|
+
"up",
|
|
463
|
+
"down",
|
|
464
|
+
"left",
|
|
465
|
+
"right",
|
|
466
|
+
"space",
|
|
467
|
+
"enter",
|
|
468
|
+
"cancel"
|
|
469
|
+
]),
|
|
470
470
|
aliases: new Map([
|
|
471
471
|
["k", "up"],
|
|
472
472
|
["j", "down"],
|
|
@@ -506,9 +506,8 @@ function cD({ input: t = node_process.stdin, output: u$2 = node_process.stdout,
|
|
|
506
506
|
});
|
|
507
507
|
node_readline.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
|
|
508
508
|
const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
|
|
509
|
-
const E = String(D$1);
|
|
510
509
|
if (k$1([
|
|
511
|
-
|
|
510
|
+
String(D$1),
|
|
512
511
|
C$1,
|
|
513
512
|
o$2
|
|
514
513
|
], "cancel")) {
|
|
@@ -697,10 +696,7 @@ let dD = class extends x {
|
|
|
697
696
|
if (u$2.group === !0) {
|
|
698
697
|
const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
|
|
699
698
|
this.isGroupSelected(F$1) ? this.value = this.value.filter((s) => e$1.findIndex((i$1) => i$1.value === s) === -1) : this.value = [...this.value, ...e$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
700
|
-
} else
|
|
701
|
-
const F$1 = this.value.includes(u$2.value);
|
|
702
|
-
this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
703
|
-
}
|
|
699
|
+
} else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
704
700
|
}
|
|
705
701
|
};
|
|
706
702
|
var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
|
|
@@ -733,12 +729,10 @@ let wD = class extends x {
|
|
|
733
729
|
return this.options[this.cursor].value;
|
|
734
730
|
}
|
|
735
731
|
toggleAll() {
|
|
736
|
-
|
|
737
|
-
this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
|
|
732
|
+
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
738
733
|
}
|
|
739
734
|
toggleValue() {
|
|
740
|
-
|
|
741
|
-
this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
735
|
+
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
742
736
|
}
|
|
743
737
|
};
|
|
744
738
|
var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
|
|
@@ -1165,8 +1159,7 @@ ${J}${r$1.trimStart()}`), s = 3 + (0, node_util.stripVTControlCharacters)(r$1.tr
|
|
|
1165
1159
|
], s = V ? 80 : 120, r$1 = process.env.CI === "true";
|
|
1166
1160
|
let i$1, a$1, c$2 = !1, l$1 = "", $$2, p$1 = performance.now();
|
|
1167
1161
|
const M$1 = (m$1) => {
|
|
1168
|
-
|
|
1169
|
-
c$2 && N$1(h$2, m$1);
|
|
1162
|
+
c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1170
1163
|
}, v$1 = () => M$1(2), x$1 = () => M$1(1), j$1 = () => {
|
|
1171
1164
|
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", x$1), process.on("SIGTERM", x$1), process.on("exit", M$1);
|
|
1172
1165
|
}, E = () => {
|
|
@@ -1311,8 +1304,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
|
|
|
1311
1304
|
const textDecoder = new TextDecoder();
|
|
1312
1305
|
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
|
|
1313
1306
|
const joinToString = (uint8ArraysOrStrings, encoding) => {
|
|
1314
|
-
|
|
1315
|
-
return strings.join("");
|
|
1307
|
+
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
|
|
1316
1308
|
};
|
|
1317
1309
|
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
1318
1310
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
|
|
@@ -1367,8 +1359,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
1367
1359
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
1368
1360
|
if (index === expressions.length) return newTokens;
|
|
1369
1361
|
const expression = expressions[index];
|
|
1370
|
-
|
|
1371
|
-
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
|
|
1362
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
|
|
1372
1363
|
};
|
|
1373
1364
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
1374
1365
|
if (rawTemplate.length === 0) return {
|
|
@@ -1455,8 +1446,7 @@ const normalizeFdSpecificOptions = (options) => {
|
|
|
1455
1446
|
};
|
|
1456
1447
|
const normalizeFdSpecificOption = (options, optionName) => {
|
|
1457
1448
|
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
|
|
1458
|
-
|
|
1459
|
-
return addDefaultValue$1(optionArray, optionName);
|
|
1449
|
+
return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
|
|
1460
1450
|
};
|
|
1461
1451
|
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
1462
1452
|
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
@@ -1486,12 +1476,11 @@ const parseFd = (fdName) => {
|
|
|
1486
1476
|
};
|
|
1487
1477
|
const FD_REGEXP = /^fd(\d+)$/;
|
|
1488
1478
|
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
1489
|
-
const verboseDefault = (0, node_util.debuglog)("execa").enabled ? "full" : "none";
|
|
1490
1479
|
const DEFAULT_OPTIONS = {
|
|
1491
1480
|
lines: false,
|
|
1492
1481
|
buffer: true,
|
|
1493
1482
|
maxBuffer: 1e3 * 1e3 * 100,
|
|
1494
|
-
verbose:
|
|
1483
|
+
verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
|
|
1495
1484
|
stripFinalNewline: true
|
|
1496
1485
|
};
|
|
1497
1486
|
const FD_SPECIFIC_OPTIONS = [
|
|
@@ -1524,11 +1513,9 @@ const VERBOSE_VALUES = [
|
|
|
1524
1513
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
1525
1514
|
const joinCommand = (filePath, rawArguments) => {
|
|
1526
1515
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
1527
|
-
const command = fileAndArguments.join(" ");
|
|
1528
|
-
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
1529
1516
|
return {
|
|
1530
|
-
command,
|
|
1531
|
-
escapedCommand
|
|
1517
|
+
command: fileAndArguments.join(" "),
|
|
1518
|
+
escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
|
|
1532
1519
|
};
|
|
1533
1520
|
};
|
|
1534
1521
|
const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
@@ -1969,13 +1956,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
|
|
|
1969
1956
|
//#endregion
|
|
1970
1957
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
1971
1958
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
1972
|
-
const
|
|
1959
|
+
const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
|
|
1973
1960
|
type,
|
|
1974
1961
|
result,
|
|
1975
1962
|
verboseInfo
|
|
1976
|
-
});
|
|
1977
|
-
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
1978
|
-
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
1963
|
+
})), verboseInfo, fdNumber);
|
|
1979
1964
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
1980
1965
|
};
|
|
1981
1966
|
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
|
|
@@ -1992,16 +1977,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
|
|
|
1992
1977
|
message
|
|
1993
1978
|
}));
|
|
1994
1979
|
const getPrintedLine = (verboseObject) => {
|
|
1995
|
-
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
1996
1980
|
return {
|
|
1997
|
-
verboseLine,
|
|
1981
|
+
verboseLine: defaultVerboseFunction(verboseObject),
|
|
1998
1982
|
verboseObject
|
|
1999
1983
|
};
|
|
2000
1984
|
};
|
|
2001
1985
|
const serializeVerboseMessage = (message) => {
|
|
2002
|
-
|
|
2003
|
-
const escapedMessage = escapeLines(messageString);
|
|
2004
|
-
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
1986
|
+
return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
2005
1987
|
};
|
|
2006
1988
|
const TAB_SIZE = 2;
|
|
2007
1989
|
|
|
@@ -2020,11 +2002,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
2020
2002
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
2021
2003
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
2022
2004
|
validateVerbose(verbose);
|
|
2023
|
-
const commandId = getCommandId(verbose);
|
|
2024
2005
|
return {
|
|
2025
2006
|
verbose,
|
|
2026
2007
|
escapedCommand,
|
|
2027
|
-
commandId,
|
|
2008
|
+
commandId: getCommandId(verbose),
|
|
2028
2009
|
rawOptions
|
|
2029
2010
|
};
|
|
2030
2011
|
};
|
|
@@ -2051,8 +2032,7 @@ const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - start
|
|
|
2051
2032
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
2052
2033
|
const startTime = getStartTime();
|
|
2053
2034
|
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
|
|
2054
|
-
const
|
|
2055
|
-
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
|
|
2035
|
+
const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
|
|
2056
2036
|
logCommand(escapedCommand, verboseInfo);
|
|
2057
2037
|
return {
|
|
2058
2038
|
command,
|
|
@@ -2120,8 +2100,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
2120
2100
|
var g$2 = parseInt("010", 8);
|
|
2121
2101
|
var o$2 = parseInt("001", 8);
|
|
2122
2102
|
var ug = u$2 | g$2;
|
|
2123
|
-
|
|
2124
|
-
return ret;
|
|
2103
|
+
return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
|
|
2125
2104
|
}
|
|
2126
2105
|
}) });
|
|
2127
2106
|
|
|
@@ -2203,8 +2182,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2203
2182
|
const ppRaw = pathEnv[i$1];
|
|
2204
2183
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2205
2184
|
const pCmd = path$9.join(pathPart, cmd);
|
|
2206
|
-
|
|
2207
|
-
resolve(subStep(p$1, i$1, 0));
|
|
2185
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
2208
2186
|
});
|
|
2209
2187
|
const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
|
|
2210
2188
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
@@ -2229,8 +2207,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2229
2207
|
for (let j$1 = 0; j$1 < pathExt.length; j$1++) {
|
|
2230
2208
|
const cur = p$1 + pathExt[j$1];
|
|
2231
2209
|
try {
|
|
2232
|
-
|
|
2233
|
-
if (is) if (opt.all) found.push(cur);
|
|
2210
|
+
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
2234
2211
|
else return cur;
|
|
2235
2212
|
} catch (ex) {}
|
|
2236
2213
|
}
|
|
@@ -2248,8 +2225,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2248
2225
|
var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
|
|
2249
2226
|
const pathKey$1 = (options = {}) => {
|
|
2250
2227
|
const environment = options.env || process.env;
|
|
2251
|
-
|
|
2252
|
-
if (platform$1 !== "win32") return "PATH";
|
|
2228
|
+
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
2253
2229
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2254
2230
|
};
|
|
2255
2231
|
module.exports = pathKey$1;
|
|
@@ -2377,12 +2353,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
2377
2353
|
parsed.command = path$7.normalize(parsed.command);
|
|
2378
2354
|
parsed.command = escape.command(parsed.command);
|
|
2379
2355
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2380
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
2381
2356
|
parsed.args = [
|
|
2382
2357
|
"/d",
|
|
2383
2358
|
"/s",
|
|
2384
2359
|
"/c",
|
|
2385
|
-
`"${
|
|
2360
|
+
`"${[parsed.command].concat(parsed.args).join(" ")}"`
|
|
2386
2361
|
];
|
|
2387
2362
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
2388
2363
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -2535,9 +2510,7 @@ const npmRunPathEnv = ({ env: env$1 = node_process.default.env,...options } = {}
|
|
|
2535
2510
|
//#endregion
|
|
2536
2511
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
2537
2512
|
const getFinalError = (originalError, message, isSync) => {
|
|
2538
|
-
|
|
2539
|
-
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
|
|
2540
|
-
return new ErrorClass(message, options);
|
|
2513
|
+
return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
|
|
2541
2514
|
};
|
|
2542
2515
|
var DiscardedError = class extends Error {};
|
|
2543
2516
|
const setErrorName = (ErrorClass, value) => {
|
|
@@ -2856,16 +2829,14 @@ const SIGNALS = [
|
|
|
2856
2829
|
//#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
|
|
2857
2830
|
const getSignals = () => {
|
|
2858
2831
|
const realtimeSignals = getRealtimeSignals();
|
|
2859
|
-
|
|
2860
|
-
return signals$1;
|
|
2832
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
2861
2833
|
};
|
|
2862
2834
|
const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
|
|
2863
2835
|
const { signals: { [name]: constantSignal } } = node_os.constants;
|
|
2864
2836
|
const supported = constantSignal !== void 0;
|
|
2865
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
2866
2837
|
return {
|
|
2867
2838
|
name,
|
|
2868
|
-
number,
|
|
2839
|
+
number: supported ? constantSignal : defaultNumber,
|
|
2869
2840
|
description,
|
|
2870
2841
|
supported,
|
|
2871
2842
|
action,
|
|
@@ -3277,8 +3248,7 @@ const isConnected = (anyProcess) => {
|
|
|
3277
3248
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
3278
3249
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
3279
3250
|
if (!strict) return message;
|
|
3280
|
-
const
|
|
3281
|
-
const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
|
|
3251
|
+
const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
|
|
3282
3252
|
return {
|
|
3283
3253
|
id: count++,
|
|
3284
3254
|
type: REQUEST_TYPE,
|
|
@@ -3351,11 +3321,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
|
|
|
3351
3321
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
3352
3322
|
if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
|
|
3353
3323
|
const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
|
|
3354
|
-
const onMessageSent = createDeferred();
|
|
3355
|
-
const id = strict ? wrappedMessage.id : void 0;
|
|
3356
3324
|
const outgoingMessage = {
|
|
3357
|
-
onMessageSent,
|
|
3358
|
-
id
|
|
3325
|
+
onMessageSent: createDeferred(),
|
|
3326
|
+
id: strict ? wrappedMessage.id : void 0
|
|
3359
3327
|
};
|
|
3360
3328
|
outgoingMessages.add(outgoingMessage);
|
|
3361
3329
|
return {
|
|
@@ -3516,8 +3484,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
|
|
|
3516
3484
|
})] : [];
|
|
3517
3485
|
const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
|
|
3518
3486
|
await onAbortedSignal(cancelSignal, signal);
|
|
3519
|
-
|
|
3520
|
-
await sendAbort(subprocess, reason);
|
|
3487
|
+
await sendAbort(subprocess, getReason(cancelSignal));
|
|
3521
3488
|
killOnTimeout({
|
|
3522
3489
|
kill: subprocess.kill,
|
|
3523
3490
|
forceKillAfterDelay,
|
|
@@ -3691,8 +3658,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
3691
3658
|
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
3692
3659
|
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
3693
3660
|
const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
|
|
3694
|
-
const
|
|
3695
|
-
const options = addDefaultOptions(fdOptions);
|
|
3661
|
+
const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
|
|
3696
3662
|
validateTimeout(options);
|
|
3697
3663
|
validateEncoding(options);
|
|
3698
3664
|
validateIpcInputOption(options);
|
|
@@ -3849,7 +3815,7 @@ const u = Object.create(a, {
|
|
|
3849
3815
|
}
|
|
3850
3816
|
});
|
|
3851
3817
|
function h({ preventCancel: r$1 = !1 } = {}) {
|
|
3852
|
-
const
|
|
3818
|
+
const t = new c(this.getReader(), r$1), s = Object.create(u);
|
|
3853
3819
|
return s[n] = t, s;
|
|
3854
3820
|
}
|
|
3855
3821
|
|
|
@@ -3898,18 +3864,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
|
|
|
3898
3864
|
const state = init();
|
|
3899
3865
|
state.length = 0;
|
|
3900
3866
|
try {
|
|
3901
|
-
for await (const chunk of asyncIterable) {
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
addChunk,
|
|
3910
|
-
maxBuffer
|
|
3911
|
-
});
|
|
3912
|
-
}
|
|
3867
|
+
for await (const chunk of asyncIterable) appendChunk({
|
|
3868
|
+
convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
|
|
3869
|
+
state,
|
|
3870
|
+
getSize,
|
|
3871
|
+
truncateChunk,
|
|
3872
|
+
addChunk,
|
|
3873
|
+
maxBuffer
|
|
3874
|
+
});
|
|
3913
3875
|
appendFinalChunk({
|
|
3914
3876
|
state,
|
|
3915
3877
|
convertChunk,
|
|
@@ -4099,10 +4061,9 @@ const stringMethods = {
|
|
|
4099
4061
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
4100
4062
|
if (!(error instanceof MaxBufferError)) throw error;
|
|
4101
4063
|
if (fdNumber === "all") return error;
|
|
4102
|
-
const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
|
|
4103
4064
|
error.maxBufferInfo = {
|
|
4104
4065
|
fdNumber,
|
|
4105
|
-
unit
|
|
4066
|
+
unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
|
|
4106
4067
|
};
|
|
4107
4068
|
stream.destroy();
|
|
4108
4069
|
throw error;
|
|
@@ -4172,19 +4133,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
|
|
|
4172
4133
|
killSignal
|
|
4173
4134
|
});
|
|
4174
4135
|
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
4175
|
-
const
|
|
4176
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
4177
|
-
const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
|
|
4178
|
-
const message = [
|
|
4179
|
-
shortMessage,
|
|
4180
|
-
...messageStdio,
|
|
4181
|
-
...stdio.slice(3),
|
|
4182
|
-
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4183
|
-
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
|
|
4136
|
+
const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
|
|
4184
4137
|
return {
|
|
4185
4138
|
originalMessage,
|
|
4186
4139
|
shortMessage,
|
|
4187
|
-
message
|
|
4140
|
+
message: [
|
|
4141
|
+
shortMessage,
|
|
4142
|
+
...all === void 0 ? [stdio[2], stdio[1]] : [all],
|
|
4143
|
+
...stdio.slice(3),
|
|
4144
|
+
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4145
|
+
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
|
|
4188
4146
|
};
|
|
4189
4147
|
};
|
|
4190
4148
|
const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
|
|
@@ -4205,8 +4163,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
|
|
|
4205
4163
|
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
|
|
4206
4164
|
const getOriginalMessage = (originalError, cwd) => {
|
|
4207
4165
|
if (originalError instanceof DiscardedError) return;
|
|
4208
|
-
const
|
|
4209
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
4166
|
+
const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
|
|
4210
4167
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
4211
4168
|
};
|
|
4212
4169
|
const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, node_util.inspect)(ipcMessage);
|
|
@@ -4328,11 +4285,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
|
|
|
4328
4285
|
const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
4329
4286
|
const exitCode = rawExitCode === null ? void 0 : rawExitCode;
|
|
4330
4287
|
const signal = rawSignal === null ? void 0 : rawSignal;
|
|
4331
|
-
const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
|
|
4332
4288
|
return {
|
|
4333
4289
|
exitCode,
|
|
4334
4290
|
signal,
|
|
4335
|
-
signalDescription
|
|
4291
|
+
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
4336
4292
|
};
|
|
4337
4293
|
};
|
|
4338
4294
|
|
|
@@ -4397,8 +4353,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4397
4353
|
let result = [];
|
|
4398
4354
|
const floorDecimals = (value, decimalDigits) => {
|
|
4399
4355
|
const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
|
|
4400
|
-
|
|
4401
|
-
return flooredValue.toFixed(decimalDigits);
|
|
4356
|
+
return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
|
|
4402
4357
|
};
|
|
4403
4358
|
const add = (value, long, short, valueString) => {
|
|
4404
4359
|
if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
|
|
@@ -4435,14 +4390,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4435
4390
|
} else {
|
|
4436
4391
|
const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
4437
4392
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
4438
|
-
const
|
|
4439
|
-
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
4393
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
4440
4394
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
4441
4395
|
}
|
|
4442
4396
|
} else {
|
|
4443
|
-
const
|
|
4444
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
4445
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
4397
|
+
const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
|
|
4446
4398
|
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
4447
4399
|
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
4448
4400
|
}
|
|
@@ -4471,10 +4423,9 @@ const logResult = (result, verboseInfo) => {
|
|
|
4471
4423
|
logDuration(result, verboseInfo);
|
|
4472
4424
|
};
|
|
4473
4425
|
const logDuration = (result, verboseInfo) => {
|
|
4474
|
-
const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
|
|
4475
4426
|
verboseLog({
|
|
4476
4427
|
type: "duration",
|
|
4477
|
-
verboseMessage
|
|
4428
|
+
verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
|
|
4478
4429
|
verboseInfo,
|
|
4479
4430
|
result
|
|
4480
4431
|
});
|
|
@@ -4601,18 +4552,16 @@ const TYPE_TO_MESSAGE = {
|
|
|
4601
4552
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
4602
4553
|
const getOutputObjectModes = (objectMode, index, newTransforms) => {
|
|
4603
4554
|
const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
|
|
4604
|
-
const readableObjectMode = objectMode ?? writableObjectMode;
|
|
4605
4555
|
return {
|
|
4606
4556
|
writableObjectMode,
|
|
4607
|
-
readableObjectMode
|
|
4557
|
+
readableObjectMode: objectMode ?? writableObjectMode
|
|
4608
4558
|
};
|
|
4609
4559
|
};
|
|
4610
4560
|
const getInputObjectModes = (objectMode, index, newTransforms) => {
|
|
4611
4561
|
const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
|
|
4612
|
-
const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
|
|
4613
4562
|
return {
|
|
4614
4563
|
writableObjectMode,
|
|
4615
|
-
readableObjectMode
|
|
4564
|
+
readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
|
|
4616
4565
|
};
|
|
4617
4566
|
};
|
|
4618
4567
|
const getFdObjectMode = (stdioItems, direction) => {
|
|
@@ -4921,8 +4870,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
|
|
|
4921
4870
|
const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
|
|
4922
4871
|
const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
|
|
4923
4872
|
if (duplicateStdioItems.length === 0) return;
|
|
4924
|
-
|
|
4925
|
-
throwOnDuplicateStream(differentStdioItem, optionName, type);
|
|
4873
|
+
throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
|
|
4926
4874
|
return direction === "output" ? duplicateStdioItems[0].stream : void 0;
|
|
4927
4875
|
};
|
|
4928
4876
|
const hasSameValue = ({ type, value }, secondValue) => {
|
|
@@ -4931,8 +4879,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
|
|
|
4931
4879
|
return value === secondValue;
|
|
4932
4880
|
};
|
|
4933
4881
|
const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
|
|
4934
|
-
|
|
4935
|
-
throwOnDuplicateStream(duplicateStdioItem, optionName, type);
|
|
4882
|
+
throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
|
|
4936
4883
|
};
|
|
4937
4884
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
4938
4885
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
@@ -4941,15 +4888,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
|
4941
4888
|
//#endregion
|
|
4942
4889
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
4943
4890
|
const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
4944
|
-
const stdio = normalizeStdioOption(options, verboseInfo, isSync);
|
|
4945
|
-
const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
|
|
4946
|
-
stdioOption,
|
|
4947
|
-
fdNumber,
|
|
4948
|
-
options,
|
|
4949
|
-
isSync
|
|
4950
|
-
}));
|
|
4951
4891
|
const fileDescriptors = getFinalFileDescriptors({
|
|
4952
|
-
initialFileDescriptors,
|
|
4892
|
+
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
4893
|
+
stdioOption,
|
|
4894
|
+
fdNumber,
|
|
4895
|
+
options,
|
|
4896
|
+
isSync
|
|
4897
|
+
})),
|
|
4953
4898
|
addProperties: addProperties$2,
|
|
4954
4899
|
options,
|
|
4955
4900
|
isSync
|
|
@@ -4966,14 +4911,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
4966
4911
|
optionName
|
|
4967
4912
|
});
|
|
4968
4913
|
const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
|
|
4969
|
-
const
|
|
4914
|
+
const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
|
|
4970
4915
|
stdioItem,
|
|
4971
4916
|
isStdioArray,
|
|
4972
4917
|
fdNumber,
|
|
4973
4918
|
direction,
|
|
4974
4919
|
isSync
|
|
4975
|
-
}));
|
|
4976
|
-
const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
|
|
4920
|
+
})), optionName, direction, options);
|
|
4977
4921
|
const objectMode = getFdObjectMode(normalizedStdioItems, direction);
|
|
4978
4922
|
validateFileObjectMode(normalizedStdioItems, objectMode);
|
|
4979
4923
|
return {
|
|
@@ -4983,9 +4927,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
4983
4927
|
};
|
|
4984
4928
|
};
|
|
4985
4929
|
const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
|
|
4986
|
-
const
|
|
4987
|
-
const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
|
|
4988
|
-
const stdioItems = filterDuplicates(initialStdioItems);
|
|
4930
|
+
const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
|
|
4989
4931
|
const isStdioArray = stdioItems.length > 1;
|
|
4990
4932
|
validateStdioArray(stdioItems, isStdioArray, optionName);
|
|
4991
4933
|
validateStreams(stdioItems);
|
|
@@ -5035,18 +4977,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
5035
4977
|
}
|
|
5036
4978
|
};
|
|
5037
4979
|
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
|
|
5038
|
-
const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
|
|
5039
|
-
stdioItem,
|
|
5040
|
-
addProperties: addProperties$2,
|
|
5041
|
-
direction,
|
|
5042
|
-
options,
|
|
5043
|
-
fileDescriptors,
|
|
5044
|
-
isSync
|
|
5045
|
-
}));
|
|
5046
4980
|
return {
|
|
5047
4981
|
direction,
|
|
5048
4982
|
objectMode,
|
|
5049
|
-
stdioItems:
|
|
4983
|
+
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
4984
|
+
stdioItem,
|
|
4985
|
+
addProperties: addProperties$2,
|
|
4986
|
+
direction,
|
|
4987
|
+
options,
|
|
4988
|
+
fileDescriptors,
|
|
4989
|
+
isSync
|
|
4990
|
+
}))
|
|
5050
4991
|
};
|
|
5051
4992
|
};
|
|
5052
4993
|
const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
|
|
@@ -5176,8 +5117,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
|
5176
5117
|
yield chunk;
|
|
5177
5118
|
return;
|
|
5178
5119
|
}
|
|
5179
|
-
|
|
5180
|
-
yield concatBytes(chunk, newline);
|
|
5120
|
+
yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
|
|
5181
5121
|
};
|
|
5182
5122
|
const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
|
|
5183
5123
|
const linesStringInfo = {
|
|
@@ -5322,7 +5262,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5322
5262
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
5323
5263
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
5324
5264
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
5325
|
-
|
|
5265
|
+
return { stream: new node_stream.Transform({
|
|
5326
5266
|
writableObjectMode,
|
|
5327
5267
|
writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
|
|
5328
5268
|
readableObjectMode,
|
|
@@ -5338,16 +5278,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5338
5278
|
finalMethod([generators], this, done);
|
|
5339
5279
|
},
|
|
5340
5280
|
destroy: destroyMethod
|
|
5341
|
-
});
|
|
5342
|
-
return { stream };
|
|
5281
|
+
}) };
|
|
5343
5282
|
};
|
|
5344
5283
|
const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
|
|
5345
5284
|
const generators = stdioItems.filter(({ type }) => type === "generator");
|
|
5346
5285
|
const reversedGenerators = isInput ? generators.reverse() : generators;
|
|
5347
|
-
for (const { value, optionName } of reversedGenerators)
|
|
5348
|
-
const generators$1 = addInternalGenerators(value, encoding, optionName);
|
|
5349
|
-
chunks = runTransformSync(generators$1, chunks);
|
|
5350
|
-
}
|
|
5286
|
+
for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
|
|
5351
5287
|
return chunks;
|
|
5352
5288
|
};
|
|
5353
5289
|
const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
|
|
@@ -5384,9 +5320,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
|
|
|
5384
5320
|
const [{ type, optionName }] = allStdioItems;
|
|
5385
5321
|
throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
|
|
5386
5322
|
}
|
|
5387
|
-
|
|
5388
|
-
const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
|
|
5389
|
-
options.input = joinToUint8Array(transformedContents);
|
|
5323
|
+
options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
|
|
5390
5324
|
};
|
|
5391
5325
|
const applySingleInputGeneratorsSync = (contents, stdioItems) => {
|
|
5392
5326
|
const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
|
|
@@ -5411,10 +5345,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
|
|
|
5411
5345
|
};
|
|
5412
5346
|
const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
|
|
5413
5347
|
const logLine = (line, fdNumber, verboseInfo) => {
|
|
5414
|
-
const verboseMessage = serializeVerboseMessage(line);
|
|
5415
5348
|
verboseLog({
|
|
5416
5349
|
type: "output",
|
|
5417
|
-
verboseMessage,
|
|
5350
|
+
verboseMessage: serializeVerboseMessage(line),
|
|
5418
5351
|
fdNumber,
|
|
5419
5352
|
verboseInfo
|
|
5420
5353
|
});
|
|
@@ -5426,28 +5359,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
5426
5359
|
if (output === null) return { output: Array.from({ length: 3 }) };
|
|
5427
5360
|
const state = {};
|
|
5428
5361
|
const outputFiles = /* @__PURE__ */ new Set([]);
|
|
5429
|
-
const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
|
|
5430
|
-
result,
|
|
5431
|
-
fileDescriptors,
|
|
5432
|
-
fdNumber,
|
|
5433
|
-
state,
|
|
5434
|
-
outputFiles,
|
|
5435
|
-
isMaxBuffer,
|
|
5436
|
-
verboseInfo
|
|
5437
|
-
}, options));
|
|
5438
5362
|
return {
|
|
5439
|
-
output:
|
|
5363
|
+
output: output.map((result, fdNumber) => transformOutputResultSync({
|
|
5364
|
+
result,
|
|
5365
|
+
fileDescriptors,
|
|
5366
|
+
fdNumber,
|
|
5367
|
+
state,
|
|
5368
|
+
outputFiles,
|
|
5369
|
+
isMaxBuffer,
|
|
5370
|
+
verboseInfo
|
|
5371
|
+
}, options)),
|
|
5440
5372
|
...state
|
|
5441
5373
|
};
|
|
5442
5374
|
};
|
|
5443
5375
|
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
|
|
5444
5376
|
if (result === null) return;
|
|
5445
|
-
const
|
|
5446
|
-
const uint8ArrayResult = bufferToUint8Array(truncatedResult);
|
|
5377
|
+
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
5447
5378
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
5448
|
-
const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
|
|
5449
5379
|
const { serializedResult, finalResult = serializedResult } = serializeChunks({
|
|
5450
|
-
chunks,
|
|
5380
|
+
chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
|
|
5451
5381
|
objectMode,
|
|
5452
5382
|
encoding,
|
|
5453
5383
|
lines,
|
|
@@ -5558,14 +5488,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
|
5558
5488
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
5559
5489
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
5560
5490
|
const resultError = getResultError(error, exitCode, signal);
|
|
5561
|
-
const timedOut = resultError?.code === "ETIMEDOUT";
|
|
5562
|
-
const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
|
|
5563
5491
|
return {
|
|
5564
5492
|
resultError,
|
|
5565
5493
|
exitCode,
|
|
5566
5494
|
signal,
|
|
5567
|
-
timedOut,
|
|
5568
|
-
isMaxBuffer
|
|
5495
|
+
timedOut: resultError?.code === "ETIMEDOUT",
|
|
5496
|
+
isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
|
|
5569
5497
|
};
|
|
5570
5498
|
};
|
|
5571
5499
|
const getResultError = (error, exitCode, signal) => {
|
|
@@ -5577,7 +5505,7 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
5577
5505
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
5578
5506
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
5579
5507
|
const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
|
|
5580
|
-
|
|
5508
|
+
return handleResult(spawnSubprocessSync({
|
|
5581
5509
|
file,
|
|
5582
5510
|
commandArguments,
|
|
5583
5511
|
options,
|
|
@@ -5586,15 +5514,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
|
5586
5514
|
verboseInfo,
|
|
5587
5515
|
fileDescriptors,
|
|
5588
5516
|
startTime
|
|
5589
|
-
});
|
|
5590
|
-
return handleResult(result, verboseInfo, options);
|
|
5517
|
+
}), verboseInfo, options);
|
|
5591
5518
|
};
|
|
5592
5519
|
const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
5593
5520
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
5594
|
-
const
|
|
5595
|
-
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
|
|
5521
|
+
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
|
|
5596
5522
|
validateSyncOptions(options);
|
|
5597
|
-
const fileDescriptors = handleStdioSync(options, verboseInfo);
|
|
5598
5523
|
return {
|
|
5599
5524
|
file,
|
|
5600
5525
|
commandArguments,
|
|
@@ -5603,7 +5528,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
5603
5528
|
startTime,
|
|
5604
5529
|
verboseInfo,
|
|
5605
5530
|
options,
|
|
5606
|
-
fileDescriptors
|
|
5531
|
+
fileDescriptors: handleStdioSync(options, verboseInfo)
|
|
5607
5532
|
};
|
|
5608
5533
|
};
|
|
5609
5534
|
const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
|
|
@@ -5638,16 +5563,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5638
5563
|
isMaxBuffer,
|
|
5639
5564
|
verboseInfo
|
|
5640
5565
|
});
|
|
5641
|
-
const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
|
|
5642
|
-
const all = stripNewline(getAllSync(output, options), options, "all");
|
|
5643
5566
|
return getSyncResult({
|
|
5644
5567
|
error,
|
|
5645
5568
|
exitCode,
|
|
5646
5569
|
signal,
|
|
5647
5570
|
timedOut,
|
|
5648
5571
|
isMaxBuffer,
|
|
5649
|
-
stdio,
|
|
5650
|
-
all,
|
|
5572
|
+
stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
|
|
5573
|
+
all: stripNewline(getAllSync(output, options), options, "all"),
|
|
5651
5574
|
options,
|
|
5652
5575
|
command,
|
|
5653
5576
|
escapedCommand,
|
|
@@ -5657,8 +5580,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5657
5580
|
const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
|
|
5658
5581
|
try {
|
|
5659
5582
|
addInputOptionsSync(fileDescriptors, options);
|
|
5660
|
-
|
|
5661
|
-
return (0, node_child_process.spawnSync)(file, commandArguments, normalizedOptions);
|
|
5583
|
+
return (0, node_child_process.spawnSync)(file, commandArguments, normalizeSpawnSyncOptions(options));
|
|
5662
5584
|
} catch (error) {
|
|
5663
5585
|
return makeEarlyError({
|
|
5664
5586
|
error,
|
|
@@ -5876,19 +5798,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
5876
5798
|
writable,
|
|
5877
5799
|
duplex
|
|
5878
5800
|
});
|
|
5879
|
-
const earlyError = makeEarlyError({
|
|
5880
|
-
error,
|
|
5881
|
-
command,
|
|
5882
|
-
escapedCommand,
|
|
5883
|
-
fileDescriptors,
|
|
5884
|
-
options,
|
|
5885
|
-
startTime,
|
|
5886
|
-
isSync: false
|
|
5887
|
-
});
|
|
5888
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
5889
5801
|
return {
|
|
5890
5802
|
subprocess,
|
|
5891
|
-
promise
|
|
5803
|
+
promise: handleDummyPromise(makeEarlyError({
|
|
5804
|
+
error,
|
|
5805
|
+
command,
|
|
5806
|
+
escapedCommand,
|
|
5807
|
+
fileDescriptors,
|
|
5808
|
+
options,
|
|
5809
|
+
startTime,
|
|
5810
|
+
isSync: false
|
|
5811
|
+
}), verboseInfo, options)
|
|
5892
5812
|
};
|
|
5893
5813
|
};
|
|
5894
5814
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
@@ -5937,8 +5857,7 @@ const addProperties = {
|
|
|
5937
5857
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
5938
5858
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
5939
5859
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
5940
|
-
|
|
5941
|
-
return { stream };
|
|
5860
|
+
return { stream: node_stream.Duplex.fromWeb(transform, { objectMode }) };
|
|
5942
5861
|
},
|
|
5943
5862
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
5944
5863
|
native() {}
|
|
@@ -6184,10 +6103,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
|
6184
6103
|
controller
|
|
6185
6104
|
});
|
|
6186
6105
|
}
|
|
6187
|
-
for (const [outputStream, inputStreams] of pipeGroups.entries())
|
|
6188
|
-
const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
|
|
6189
|
-
pipeStreams(inputStream, outputStream);
|
|
6190
|
-
}
|
|
6106
|
+
for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
|
|
6191
6107
|
};
|
|
6192
6108
|
const pipeTransform = (subprocess, stream, direction, fdNumber) => {
|
|
6193
6109
|
if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
|
|
@@ -6449,10 +6365,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
|
|
|
6449
6365
|
const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
6450
6366
|
try {
|
|
6451
6367
|
const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
|
|
6452
|
-
const destinationStream = getToStream(destination, to);
|
|
6453
6368
|
return {
|
|
6454
6369
|
destination,
|
|
6455
|
-
destinationStream,
|
|
6370
|
+
destinationStream: getToStream(destination, to),
|
|
6456
6371
|
from,
|
|
6457
6372
|
unpipeSignal
|
|
6458
6373
|
};
|
|
@@ -6461,19 +6376,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
|
6461
6376
|
}
|
|
6462
6377
|
};
|
|
6463
6378
|
const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
|
|
6464
|
-
if (Array.isArray(firstArgument)) {
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
pipeOptions: boundOptions
|
|
6469
|
-
};
|
|
6470
|
-
}
|
|
6379
|
+
if (Array.isArray(firstArgument)) return {
|
|
6380
|
+
destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
|
|
6381
|
+
pipeOptions: boundOptions
|
|
6382
|
+
};
|
|
6471
6383
|
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
6472
6384
|
if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
|
|
6473
6385
|
const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
|
|
6474
|
-
const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
|
|
6475
6386
|
return {
|
|
6476
|
-
destination,
|
|
6387
|
+
destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
|
|
6477
6388
|
pipeOptions: rawOptions
|
|
6478
6389
|
};
|
|
6479
6390
|
}
|
|
@@ -6493,8 +6404,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
|
|
|
6493
6404
|
} });
|
|
6494
6405
|
const getSourceStream = (source, from) => {
|
|
6495
6406
|
try {
|
|
6496
|
-
|
|
6497
|
-
return { sourceStream };
|
|
6407
|
+
return { sourceStream: getFromStream(source, from) };
|
|
6498
6408
|
} catch (error) {
|
|
6499
6409
|
return { sourceError: error };
|
|
6500
6410
|
}
|
|
@@ -6588,9 +6498,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
|
|
|
6588
6498
|
const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
6589
6499
|
await (0, node_util.aborted)(unpipeSignal, sourceStream);
|
|
6590
6500
|
await mergedStream.remove(sourceStream);
|
|
6591
|
-
const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
|
|
6592
6501
|
throw createNonCommandError({
|
|
6593
|
-
error,
|
|
6502
|
+
error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
|
|
6594
6503
|
fileDescriptors,
|
|
6595
6504
|
sourceOptions,
|
|
6596
6505
|
startTime
|
|
@@ -6693,13 +6602,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
6693
6602
|
}
|
|
6694
6603
|
};
|
|
6695
6604
|
const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
6696
|
-
const onStdoutChunk = (0, node_events.on)(stream, "data", {
|
|
6697
|
-
signal: controller.signal,
|
|
6698
|
-
highWaterMark: HIGH_WATER_MARK,
|
|
6699
|
-
highWatermark: HIGH_WATER_MARK
|
|
6700
|
-
});
|
|
6701
6605
|
return iterateOnData({
|
|
6702
|
-
onStdoutChunk,
|
|
6606
|
+
onStdoutChunk: (0, node_events.on)(stream, "data", {
|
|
6607
|
+
signal: controller.signal,
|
|
6608
|
+
highWaterMark: HIGH_WATER_MARK,
|
|
6609
|
+
highWatermark: HIGH_WATER_MARK
|
|
6610
|
+
}),
|
|
6703
6611
|
controller,
|
|
6704
6612
|
binary,
|
|
6705
6613
|
shouldEncode,
|
|
@@ -6744,13 +6652,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
6744
6652
|
await Promise.all([resumeStream(stream), logPromise]);
|
|
6745
6653
|
return;
|
|
6746
6654
|
}
|
|
6747
|
-
const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
|
|
6748
6655
|
const iterable = iterateForResult({
|
|
6749
6656
|
stream,
|
|
6750
6657
|
onStreamEnd,
|
|
6751
6658
|
lines,
|
|
6752
6659
|
encoding,
|
|
6753
|
-
stripFinalNewline:
|
|
6660
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
|
|
6754
6661
|
allMixed
|
|
6755
6662
|
});
|
|
6756
6663
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -6770,15 +6677,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
|
|
|
6770
6677
|
verboseInfo,
|
|
6771
6678
|
fdNumber
|
|
6772
6679
|
})) return;
|
|
6773
|
-
|
|
6680
|
+
await logLines(iterateForResult({
|
|
6774
6681
|
stream,
|
|
6775
6682
|
onStreamEnd,
|
|
6776
6683
|
lines: true,
|
|
6777
6684
|
encoding,
|
|
6778
6685
|
stripFinalNewline: true,
|
|
6779
6686
|
allMixed
|
|
6780
|
-
});
|
|
6781
|
-
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
6687
|
+
}), stream, fdNumber, verboseInfo);
|
|
6782
6688
|
};
|
|
6783
6689
|
const resumeStream = async (stream) => {
|
|
6784
6690
|
await (0, node_timers_promises.setImmediate)();
|
|
@@ -6928,10 +6834,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
|
|
|
6928
6834
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
6929
6835
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
6930
6836
|
const logIpcOutput = (message, verboseInfo) => {
|
|
6931
|
-
const verboseMessage = serializeVerboseMessage(message);
|
|
6932
6837
|
verboseLog({
|
|
6933
6838
|
type: "ipc",
|
|
6934
|
-
verboseMessage,
|
|
6839
|
+
verboseMessage: serializeVerboseMessage(message),
|
|
6935
6840
|
fdNumber: "ipc",
|
|
6936
6841
|
verboseInfo
|
|
6937
6842
|
});
|
|
@@ -7074,9 +6979,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
7074
6979
|
const promises = weakMap.get(stream);
|
|
7075
6980
|
const promise = createDeferred();
|
|
7076
6981
|
promises.push(promise);
|
|
7077
|
-
const resolve = promise.resolve.bind(promise);
|
|
7078
6982
|
return {
|
|
7079
|
-
resolve,
|
|
6983
|
+
resolve: promise.resolve.bind(promise),
|
|
7080
6984
|
promises
|
|
7081
6985
|
};
|
|
7082
6986
|
};
|
|
@@ -7157,10 +7061,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
7157
7061
|
};
|
|
7158
7062
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
7159
7063
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7160
|
-
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
|
|
7161
7064
|
return {
|
|
7162
7065
|
subprocessStdout,
|
|
7163
|
-
waitReadableDestroy
|
|
7066
|
+
waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
|
|
7164
7067
|
};
|
|
7165
7068
|
};
|
|
7166
7069
|
const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
|
|
@@ -7238,12 +7141,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
7238
7141
|
};
|
|
7239
7142
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
7240
7143
|
const subprocessStdin = getToStream(subprocess, to);
|
|
7241
|
-
const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
|
|
7242
|
-
const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
|
|
7243
7144
|
return {
|
|
7244
7145
|
subprocessStdin,
|
|
7245
|
-
waitWritableFinal,
|
|
7246
|
-
waitWritableDestroy
|
|
7146
|
+
waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
|
|
7147
|
+
waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
|
|
7247
7148
|
};
|
|
7248
7149
|
};
|
|
7249
7150
|
const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
@@ -7339,15 +7240,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
7339
7240
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
7340
7241
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
7341
7242
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7342
|
-
|
|
7243
|
+
return iterateOnStdoutData(iterateOnSubprocessStream({
|
|
7343
7244
|
subprocessStdout,
|
|
7344
7245
|
subprocess,
|
|
7345
7246
|
binary,
|
|
7346
7247
|
shouldEncode: true,
|
|
7347
7248
|
encoding,
|
|
7348
7249
|
preserveNewlines
|
|
7349
|
-
});
|
|
7350
|
-
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
7250
|
+
}), subprocessStdout, subprocess);
|
|
7351
7251
|
};
|
|
7352
7252
|
const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
|
|
7353
7253
|
try {
|
|
@@ -7429,7 +7329,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7429
7329
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
7430
7330
|
const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
|
|
7431
7331
|
const options = handleAsyncOptions(normalizedOptions);
|
|
7432
|
-
const fileDescriptors = handleStdioAsync(options, verboseInfo);
|
|
7433
7332
|
return {
|
|
7434
7333
|
file,
|
|
7435
7334
|
commandArguments,
|
|
@@ -7438,7 +7337,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7438
7337
|
startTime,
|
|
7439
7338
|
verboseInfo,
|
|
7440
7339
|
options,
|
|
7441
|
-
fileDescriptors
|
|
7340
|
+
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
7442
7341
|
};
|
|
7443
7342
|
};
|
|
7444
7343
|
const handleAsyncOptions = ({ timeout, signal,...options }) => {
|
|
@@ -7511,22 +7410,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
|
|
|
7511
7410
|
});
|
|
7512
7411
|
controller.abort();
|
|
7513
7412
|
onInternalError.resolve();
|
|
7514
|
-
|
|
7515
|
-
const all = stripNewline(allResult, options, "all");
|
|
7516
|
-
const result = getAsyncResult({
|
|
7413
|
+
return handleResult(getAsyncResult({
|
|
7517
7414
|
errorInfo,
|
|
7518
7415
|
exitCode,
|
|
7519
7416
|
signal,
|
|
7520
|
-
stdio,
|
|
7521
|
-
all,
|
|
7417
|
+
stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
|
|
7418
|
+
all: stripNewline(allResult, options, "all"),
|
|
7522
7419
|
ipcOutput,
|
|
7523
7420
|
context,
|
|
7524
7421
|
options,
|
|
7525
7422
|
command,
|
|
7526
7423
|
escapedCommand,
|
|
7527
7424
|
startTime
|
|
7528
|
-
});
|
|
7529
|
-
return handleResult(result, verboseInfo, options);
|
|
7425
|
+
}), verboseInfo, options);
|
|
7530
7426
|
};
|
|
7531
7427
|
const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
|
|
7532
7428
|
error: errorInfo.error,
|
|
@@ -7599,8 +7495,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
|
|
|
7599
7495
|
return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
|
|
7600
7496
|
};
|
|
7601
7497
|
const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
|
|
7602
|
-
const
|
|
7603
|
-
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
|
|
7498
|
+
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
|
|
7604
7499
|
const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
|
|
7605
7500
|
const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
|
|
7606
7501
|
file: initialFile,
|
|
@@ -7698,7 +7593,7 @@ const supabaseApi = (supabaseUrl, supabaseAnonKey) => {
|
|
|
7698
7593
|
//#endregion
|
|
7699
7594
|
//#region iac/index.ts
|
|
7700
7595
|
const getConfigTemplate = (build) => {
|
|
7701
|
-
|
|
7596
|
+
return new __hot_updater_plugin_core.ConfigBuilder().setBuildType(build).setStorage({
|
|
7702
7597
|
imports: [{
|
|
7703
7598
|
pkg: "@hot-updater/supabase",
|
|
7704
7599
|
named: ["supabaseStorage"]
|
|
@@ -7708,8 +7603,7 @@ const getConfigTemplate = (build) => {
|
|
|
7708
7603
|
supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
|
|
7709
7604
|
bucketName: process.env.HOT_UPDATER_SUPABASE_BUCKET_NAME!,
|
|
7710
7605
|
})`
|
|
7711
|
-
}
|
|
7712
|
-
const databaseConfig = {
|
|
7606
|
+
}).setDatabase({
|
|
7713
7607
|
imports: [{
|
|
7714
7608
|
pkg: "@hot-updater/supabase",
|
|
7715
7609
|
named: ["supabaseDatabase"]
|
|
@@ -7718,8 +7612,7 @@ const getConfigTemplate = (build) => {
|
|
|
7718
7612
|
supabaseUrl: process.env.HOT_UPDATER_SUPABASE_URL!,
|
|
7719
7613
|
supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
|
|
7720
7614
|
})`
|
|
7721
|
-
};
|
|
7722
|
-
return new __hot_updater_plugin_core.ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
|
|
7615
|
+
}).getResult();
|
|
7723
7616
|
};
|
|
7724
7617
|
const SOURCE_TEMPLATE = `// add this to your App.tsx
|
|
7725
7618
|
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
|
|
@@ -7803,7 +7696,7 @@ const selectBucket = async (api) => {
|
|
|
7803
7696
|
if (retryCount === 5) message("Supabase project is not ready yet. This might take a few minutes.");
|
|
7804
7697
|
buckets = await api.listBuckets();
|
|
7805
7698
|
return `Retrieved ${buckets.length} buckets`;
|
|
7806
|
-
} catch
|
|
7699
|
+
} catch {
|
|
7807
7700
|
retryCount++;
|
|
7808
7701
|
await delay(1e3);
|
|
7809
7702
|
}
|
|
@@ -7832,8 +7725,7 @@ const selectBucket = async (api) => {
|
|
|
7832
7725
|
try {
|
|
7833
7726
|
await api.createBucket(bucketName, { public: false });
|
|
7834
7727
|
f.success(`Bucket "${bucketName}" created successfully.`);
|
|
7835
|
-
const
|
|
7836
|
-
const newBucket = buckets$1.find((bucket) => bucket.name === bucketName);
|
|
7728
|
+
const newBucket = (await api.listBuckets()).find((bucket) => bucket.name === bucketName);
|
|
7837
7729
|
if (!newBucket) throw new Error("Failed to create and select new bucket");
|
|
7838
7730
|
return {
|
|
7839
7731
|
id: newBucket.id,
|
|
@@ -7905,8 +7797,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
|
|
|
7905
7797
|
});
|
|
7906
7798
|
if (BD(functionName)) process.exit(0);
|
|
7907
7799
|
const edgeFunctionsLibPath = path.default.join(workdir, "supabase", "edge-functions");
|
|
7908
|
-
const
|
|
7909
|
-
const edgeFunctionsCode = (0, __hot_updater_plugin_core.transformEnv)(edgeFunctionsCodePath, { FUNCTION_NAME: functionName });
|
|
7800
|
+
const edgeFunctionsCode = (0, __hot_updater_plugin_core.transformEnv)(path.default.join(edgeFunctionsLibPath, "index.ts"), { FUNCTION_NAME: functionName });
|
|
7910
7801
|
const targetDir = path.default.join(workdir, "supabase", "functions", functionName);
|
|
7911
7802
|
await fs_promises.default.mkdir(targetDir, { recursive: true });
|
|
7912
7803
|
const targetPath = path.default.join(targetDir, "index.ts");
|
|
@@ -7915,7 +7806,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
|
|
|
7915
7806
|
title: "Supabase edge function deploy. This may take a few minutes.",
|
|
7916
7807
|
task: async () => {
|
|
7917
7808
|
try {
|
|
7918
|
-
|
|
7809
|
+
return (await execa("npx", [
|
|
7919
7810
|
"supabase",
|
|
7920
7811
|
"functions",
|
|
7921
7812
|
"deploy",
|
|
@@ -7925,8 +7816,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
|
|
|
7925
7816
|
"--no-verify-jwt",
|
|
7926
7817
|
"--workdir",
|
|
7927
7818
|
workdir
|
|
7928
|
-
], { cwd: workdir });
|
|
7929
|
-
return dbPush.stdout;
|
|
7819
|
+
], { cwd: workdir })).stdout;
|
|
7930
7820
|
} catch (err) {
|
|
7931
7821
|
if (err instanceof ExecaError && err.stderr) f.error(err.stderr);
|
|
7932
7822
|
else console.error(err);
|
|
@@ -7960,10 +7850,8 @@ const runInit = async ({ build }) => {
|
|
|
7960
7850
|
spinner.stop();
|
|
7961
7851
|
const serviceRoleKey = apiKeys.find((key) => key.name === "service_role");
|
|
7962
7852
|
if (!serviceRoleKey) throw new Error("Service role key not found, is your project paused?");
|
|
7963
|
-
const
|
|
7964
|
-
const
|
|
7965
|
-
const scaffoldLibPath = path.default.dirname(path.default.resolve(require.resolve("@hot-updater/supabase/scaffold")));
|
|
7966
|
-
const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(scaffoldLibPath, "supabase");
|
|
7853
|
+
const bucket = await selectBucket(supabaseApi(`https://${project.id}.supabase.co`, serviceRoleKey.api_key));
|
|
7854
|
+
const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(path.default.dirname(path.default.resolve(require.resolve("@hot-updater/supabase/scaffold"))), "supabase");
|
|
7967
7855
|
const migrationPath = await path.default.join(tmpDir, "supabase", "migrations");
|
|
7968
7856
|
const migrationFiles = await fs_promises.default.readdir(migrationPath);
|
|
7969
7857
|
for (const file of migrationFiles) if (file.endsWith(".sql")) {
|