@hot-updater/bare 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/index.cjs +139 -238
- package/dist/index.js +160 -259
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,8 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
}) : target, mod));
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
let path = require("path");
|
|
28
|
-
path = __toESM(path);
|
|
29
27
|
let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
30
28
|
__hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
|
|
31
29
|
let node_url = require("node:url");
|
|
@@ -42,6 +40,8 @@ let node_tty = require("node:tty");
|
|
|
42
40
|
node_tty = __toESM(node_tty);
|
|
43
41
|
let node_path = require("node:path");
|
|
44
42
|
node_path = __toESM(node_path);
|
|
43
|
+
let path = require("path");
|
|
44
|
+
path = __toESM(path);
|
|
45
45
|
let fs = require("fs");
|
|
46
46
|
fs = __toESM(fs);
|
|
47
47
|
let node_timers_promises = require("node:timers/promises");
|
|
@@ -110,8 +110,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
|
|
|
110
110
|
const textDecoder = new TextDecoder();
|
|
111
111
|
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
|
|
112
112
|
const joinToString = (uint8ArraysOrStrings, encoding) => {
|
|
113
|
-
|
|
114
|
-
return strings.join("");
|
|
113
|
+
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
|
|
115
114
|
};
|
|
116
115
|
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
117
116
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
|
|
@@ -166,8 +165,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
166
165
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
167
166
|
if (index === expressions.length) return newTokens;
|
|
168
167
|
const expression = expressions[index];
|
|
169
|
-
|
|
170
|
-
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
|
|
168
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
|
|
171
169
|
};
|
|
172
170
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
173
171
|
if (rawTemplate.length === 0) return {
|
|
@@ -254,8 +252,7 @@ const normalizeFdSpecificOptions = (options) => {
|
|
|
254
252
|
};
|
|
255
253
|
const normalizeFdSpecificOption = (options, optionName) => {
|
|
256
254
|
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
|
|
257
|
-
|
|
258
|
-
return addDefaultValue$1(optionArray, optionName);
|
|
255
|
+
return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
|
|
259
256
|
};
|
|
260
257
|
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
261
258
|
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
@@ -285,12 +282,11 @@ const parseFd = (fdName) => {
|
|
|
285
282
|
};
|
|
286
283
|
const FD_REGEXP = /^fd(\d+)$/;
|
|
287
284
|
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
288
|
-
const verboseDefault = (0, node_util.debuglog)("execa").enabled ? "full" : "none";
|
|
289
285
|
const DEFAULT_OPTIONS = {
|
|
290
286
|
lines: false,
|
|
291
287
|
buffer: true,
|
|
292
288
|
maxBuffer: 1e3 * 1e3 * 100,
|
|
293
|
-
verbose:
|
|
289
|
+
verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
|
|
294
290
|
stripFinalNewline: true
|
|
295
291
|
};
|
|
296
292
|
const FD_SPECIFIC_OPTIONS = [
|
|
@@ -323,11 +319,9 @@ const VERBOSE_VALUES = [
|
|
|
323
319
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
324
320
|
const joinCommand = (filePath, rawArguments) => {
|
|
325
321
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
326
|
-
const command = fileAndArguments.join(" ");
|
|
327
|
-
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
328
322
|
return {
|
|
329
|
-
command,
|
|
330
|
-
escapedCommand
|
|
323
|
+
command: fileAndArguments.join(" "),
|
|
324
|
+
escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
|
|
331
325
|
};
|
|
332
326
|
};
|
|
333
327
|
const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
@@ -768,13 +762,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
|
|
|
768
762
|
//#endregion
|
|
769
763
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
770
764
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
771
|
-
const
|
|
765
|
+
const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
|
|
772
766
|
type,
|
|
773
767
|
result,
|
|
774
768
|
verboseInfo
|
|
775
|
-
});
|
|
776
|
-
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
777
|
-
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
769
|
+
})), verboseInfo, fdNumber);
|
|
778
770
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
779
771
|
};
|
|
780
772
|
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
|
|
@@ -791,16 +783,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
|
|
|
791
783
|
message
|
|
792
784
|
}));
|
|
793
785
|
const getPrintedLine = (verboseObject) => {
|
|
794
|
-
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
795
786
|
return {
|
|
796
|
-
verboseLine,
|
|
787
|
+
verboseLine: defaultVerboseFunction(verboseObject),
|
|
797
788
|
verboseObject
|
|
798
789
|
};
|
|
799
790
|
};
|
|
800
791
|
const serializeVerboseMessage = (message) => {
|
|
801
|
-
|
|
802
|
-
const escapedMessage = escapeLines(messageString);
|
|
803
|
-
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
792
|
+
return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
804
793
|
};
|
|
805
794
|
const TAB_SIZE = 2;
|
|
806
795
|
|
|
@@ -819,11 +808,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
819
808
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
820
809
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
821
810
|
validateVerbose(verbose);
|
|
822
|
-
const commandId = getCommandId(verbose);
|
|
823
811
|
return {
|
|
824
812
|
verbose,
|
|
825
813
|
escapedCommand,
|
|
826
|
-
commandId,
|
|
814
|
+
commandId: getCommandId(verbose),
|
|
827
815
|
rawOptions
|
|
828
816
|
};
|
|
829
817
|
};
|
|
@@ -850,8 +838,7 @@ const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - start
|
|
|
850
838
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
851
839
|
const startTime = getStartTime();
|
|
852
840
|
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
|
|
853
|
-
const
|
|
854
|
-
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
|
|
841
|
+
const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
|
|
855
842
|
logCommand(escapedCommand, verboseInfo);
|
|
856
843
|
return {
|
|
857
844
|
command,
|
|
@@ -919,8 +906,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
919
906
|
var g = parseInt("010", 8);
|
|
920
907
|
var o$1 = parseInt("001", 8);
|
|
921
908
|
var ug = u$1 | g;
|
|
922
|
-
|
|
923
|
-
return ret;
|
|
909
|
+
return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
|
|
924
910
|
}
|
|
925
911
|
}) });
|
|
926
912
|
|
|
@@ -1002,8 +988,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1002
988
|
const ppRaw = pathEnv[i$1];
|
|
1003
989
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
1004
990
|
const pCmd = path$10.join(pathPart, cmd);
|
|
1005
|
-
|
|
1006
|
-
resolve(subStep(p, i$1, 0));
|
|
991
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
1007
992
|
});
|
|
1008
993
|
const subStep = (p, i$1, ii) => new Promise((resolve, reject) => {
|
|
1009
994
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
@@ -1028,8 +1013,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1028
1013
|
for (let j = 0; j < pathExt.length; j++) {
|
|
1029
1014
|
const cur = p + pathExt[j];
|
|
1030
1015
|
try {
|
|
1031
|
-
|
|
1032
|
-
if (is) if (opt.all) found.push(cur);
|
|
1016
|
+
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
1033
1017
|
else return cur;
|
|
1034
1018
|
} catch (ex) {}
|
|
1035
1019
|
}
|
|
@@ -1047,8 +1031,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1047
1031
|
var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
|
|
1048
1032
|
const pathKey$1 = (options = {}) => {
|
|
1049
1033
|
const environment = options.env || process.env;
|
|
1050
|
-
|
|
1051
|
-
if (platform$1 !== "win32") return "PATH";
|
|
1034
|
+
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
1052
1035
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
1053
1036
|
};
|
|
1054
1037
|
module.exports = pathKey$1;
|
|
@@ -1176,12 +1159,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
1176
1159
|
parsed.command = path$8.normalize(parsed.command);
|
|
1177
1160
|
parsed.command = escape.command(parsed.command);
|
|
1178
1161
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
1179
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
1180
1162
|
parsed.args = [
|
|
1181
1163
|
"/d",
|
|
1182
1164
|
"/s",
|
|
1183
1165
|
"/c",
|
|
1184
|
-
`"${
|
|
1166
|
+
`"${[parsed.command].concat(parsed.args).join(" ")}"`
|
|
1185
1167
|
];
|
|
1186
1168
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
1187
1169
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -1334,9 +1316,7 @@ const npmRunPathEnv = ({ env = node_process.default.env,...options } = {}) => {
|
|
|
1334
1316
|
//#endregion
|
|
1335
1317
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
1336
1318
|
const getFinalError = (originalError, message, isSync) => {
|
|
1337
|
-
|
|
1338
|
-
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
|
|
1339
|
-
return new ErrorClass(message, options);
|
|
1319
|
+
return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
|
|
1340
1320
|
};
|
|
1341
1321
|
var DiscardedError = class extends Error {};
|
|
1342
1322
|
const setErrorName = (ErrorClass, value) => {
|
|
@@ -1655,16 +1635,14 @@ const SIGNALS = [
|
|
|
1655
1635
|
//#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
|
|
1656
1636
|
const getSignals = () => {
|
|
1657
1637
|
const realtimeSignals = getRealtimeSignals();
|
|
1658
|
-
|
|
1659
|
-
return signals$1;
|
|
1638
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
1660
1639
|
};
|
|
1661
1640
|
const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
|
|
1662
1641
|
const { signals: { [name]: constantSignal } } = node_os.constants;
|
|
1663
1642
|
const supported = constantSignal !== void 0;
|
|
1664
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
1665
1643
|
return {
|
|
1666
1644
|
name,
|
|
1667
|
-
number,
|
|
1645
|
+
number: supported ? constantSignal : defaultNumber,
|
|
1668
1646
|
description,
|
|
1669
1647
|
supported,
|
|
1670
1648
|
action,
|
|
@@ -2076,8 +2054,7 @@ const isConnected = (anyProcess) => {
|
|
|
2076
2054
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
2077
2055
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
2078
2056
|
if (!strict) return message;
|
|
2079
|
-
const
|
|
2080
|
-
const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
|
|
2057
|
+
const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
|
|
2081
2058
|
return {
|
|
2082
2059
|
id: count++,
|
|
2083
2060
|
type: REQUEST_TYPE,
|
|
@@ -2150,11 +2127,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
|
|
|
2150
2127
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
2151
2128
|
if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
|
|
2152
2129
|
const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
|
|
2153
|
-
const onMessageSent = createDeferred();
|
|
2154
|
-
const id = strict ? wrappedMessage.id : void 0;
|
|
2155
2130
|
const outgoingMessage = {
|
|
2156
|
-
onMessageSent,
|
|
2157
|
-
id
|
|
2131
|
+
onMessageSent: createDeferred(),
|
|
2132
|
+
id: strict ? wrappedMessage.id : void 0
|
|
2158
2133
|
};
|
|
2159
2134
|
outgoingMessages.add(outgoingMessage);
|
|
2160
2135
|
return {
|
|
@@ -2315,8 +2290,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
|
|
|
2315
2290
|
})] : [];
|
|
2316
2291
|
const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
|
|
2317
2292
|
await onAbortedSignal(cancelSignal, signal);
|
|
2318
|
-
|
|
2319
|
-
await sendAbort(subprocess, reason);
|
|
2293
|
+
await sendAbort(subprocess, getReason(cancelSignal));
|
|
2320
2294
|
killOnTimeout({
|
|
2321
2295
|
kill: subprocess.kill,
|
|
2322
2296
|
forceKillAfterDelay,
|
|
@@ -2490,8 +2464,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2490
2464
|
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
2491
2465
|
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
2492
2466
|
const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
|
|
2493
|
-
const
|
|
2494
|
-
const options = addDefaultOptions(fdOptions);
|
|
2467
|
+
const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
|
|
2495
2468
|
validateTimeout(options);
|
|
2496
2469
|
validateEncoding(options);
|
|
2497
2470
|
validateIpcInputOption(options);
|
|
@@ -2648,7 +2621,7 @@ const u = Object.create(a, {
|
|
|
2648
2621
|
}
|
|
2649
2622
|
});
|
|
2650
2623
|
function h({ preventCancel: r = !1 } = {}) {
|
|
2651
|
-
const
|
|
2624
|
+
const t = new c(this.getReader(), r), s = Object.create(u);
|
|
2652
2625
|
return s[n] = t, s;
|
|
2653
2626
|
}
|
|
2654
2627
|
|
|
@@ -2697,18 +2670,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
|
|
|
2697
2670
|
const state = init();
|
|
2698
2671
|
state.length = 0;
|
|
2699
2672
|
try {
|
|
2700
|
-
for await (const chunk of asyncIterable) {
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
addChunk,
|
|
2709
|
-
maxBuffer
|
|
2710
|
-
});
|
|
2711
|
-
}
|
|
2673
|
+
for await (const chunk of asyncIterable) appendChunk({
|
|
2674
|
+
convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
|
|
2675
|
+
state,
|
|
2676
|
+
getSize,
|
|
2677
|
+
truncateChunk,
|
|
2678
|
+
addChunk,
|
|
2679
|
+
maxBuffer
|
|
2680
|
+
});
|
|
2712
2681
|
appendFinalChunk({
|
|
2713
2682
|
state,
|
|
2714
2683
|
convertChunk,
|
|
@@ -2898,10 +2867,9 @@ const stringMethods = {
|
|
|
2898
2867
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
2899
2868
|
if (!(error instanceof MaxBufferError)) throw error;
|
|
2900
2869
|
if (fdNumber === "all") return error;
|
|
2901
|
-
const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
|
|
2902
2870
|
error.maxBufferInfo = {
|
|
2903
2871
|
fdNumber,
|
|
2904
|
-
unit
|
|
2872
|
+
unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
|
|
2905
2873
|
};
|
|
2906
2874
|
stream.destroy();
|
|
2907
2875
|
throw error;
|
|
@@ -2971,19 +2939,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
|
|
|
2971
2939
|
killSignal
|
|
2972
2940
|
});
|
|
2973
2941
|
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
2974
|
-
const
|
|
2975
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
2976
|
-
const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
|
|
2977
|
-
const message = [
|
|
2978
|
-
shortMessage,
|
|
2979
|
-
...messageStdio,
|
|
2980
|
-
...stdio.slice(3),
|
|
2981
|
-
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
2982
|
-
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
|
|
2942
|
+
const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
|
|
2983
2943
|
return {
|
|
2984
2944
|
originalMessage,
|
|
2985
2945
|
shortMessage,
|
|
2986
|
-
message
|
|
2946
|
+
message: [
|
|
2947
|
+
shortMessage,
|
|
2948
|
+
...all === void 0 ? [stdio[2], stdio[1]] : [all],
|
|
2949
|
+
...stdio.slice(3),
|
|
2950
|
+
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
2951
|
+
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
|
|
2987
2952
|
};
|
|
2988
2953
|
};
|
|
2989
2954
|
const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
|
|
@@ -3004,8 +2969,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
|
|
|
3004
2969
|
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
|
|
3005
2970
|
const getOriginalMessage = (originalError, cwd) => {
|
|
3006
2971
|
if (originalError instanceof DiscardedError) return;
|
|
3007
|
-
const
|
|
3008
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
2972
|
+
const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
|
|
3009
2973
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
3010
2974
|
};
|
|
3011
2975
|
const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, node_util.inspect)(ipcMessage);
|
|
@@ -3127,11 +3091,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
|
|
|
3127
3091
|
const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
3128
3092
|
const exitCode = rawExitCode === null ? void 0 : rawExitCode;
|
|
3129
3093
|
const signal = rawSignal === null ? void 0 : rawSignal;
|
|
3130
|
-
const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
|
|
3131
3094
|
return {
|
|
3132
3095
|
exitCode,
|
|
3133
3096
|
signal,
|
|
3134
|
-
signalDescription
|
|
3097
|
+
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
3135
3098
|
};
|
|
3136
3099
|
};
|
|
3137
3100
|
|
|
@@ -3196,8 +3159,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3196
3159
|
let result = [];
|
|
3197
3160
|
const floorDecimals = (value, decimalDigits) => {
|
|
3198
3161
|
const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
|
|
3199
|
-
|
|
3200
|
-
return flooredValue.toFixed(decimalDigits);
|
|
3162
|
+
return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
|
|
3201
3163
|
};
|
|
3202
3164
|
const add = (value, long, short, valueString) => {
|
|
3203
3165
|
if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
|
|
@@ -3234,14 +3196,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3234
3196
|
} else {
|
|
3235
3197
|
const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
3236
3198
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
3237
|
-
const
|
|
3238
|
-
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
3199
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
3239
3200
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
3240
3201
|
}
|
|
3241
3202
|
} else {
|
|
3242
|
-
const
|
|
3243
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
3244
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
3203
|
+
const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
|
|
3245
3204
|
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
3246
3205
|
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
3247
3206
|
}
|
|
@@ -3270,10 +3229,9 @@ const logResult = (result, verboseInfo) => {
|
|
|
3270
3229
|
logDuration(result, verboseInfo);
|
|
3271
3230
|
};
|
|
3272
3231
|
const logDuration = (result, verboseInfo) => {
|
|
3273
|
-
const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
|
|
3274
3232
|
verboseLog({
|
|
3275
3233
|
type: "duration",
|
|
3276
|
-
verboseMessage
|
|
3234
|
+
verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
|
|
3277
3235
|
verboseInfo,
|
|
3278
3236
|
result
|
|
3279
3237
|
});
|
|
@@ -3400,18 +3358,16 @@ const TYPE_TO_MESSAGE = {
|
|
|
3400
3358
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
3401
3359
|
const getOutputObjectModes = (objectMode, index, newTransforms) => {
|
|
3402
3360
|
const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
|
|
3403
|
-
const readableObjectMode = objectMode ?? writableObjectMode;
|
|
3404
3361
|
return {
|
|
3405
3362
|
writableObjectMode,
|
|
3406
|
-
readableObjectMode
|
|
3363
|
+
readableObjectMode: objectMode ?? writableObjectMode
|
|
3407
3364
|
};
|
|
3408
3365
|
};
|
|
3409
3366
|
const getInputObjectModes = (objectMode, index, newTransforms) => {
|
|
3410
3367
|
const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
|
|
3411
|
-
const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
|
|
3412
3368
|
return {
|
|
3413
3369
|
writableObjectMode,
|
|
3414
|
-
readableObjectMode
|
|
3370
|
+
readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
|
|
3415
3371
|
};
|
|
3416
3372
|
};
|
|
3417
3373
|
const getFdObjectMode = (stdioItems, direction) => {
|
|
@@ -3720,8 +3676,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
|
|
|
3720
3676
|
const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
|
|
3721
3677
|
const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
|
|
3722
3678
|
if (duplicateStdioItems.length === 0) return;
|
|
3723
|
-
|
|
3724
|
-
throwOnDuplicateStream(differentStdioItem, optionName, type);
|
|
3679
|
+
throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
|
|
3725
3680
|
return direction === "output" ? duplicateStdioItems[0].stream : void 0;
|
|
3726
3681
|
};
|
|
3727
3682
|
const hasSameValue = ({ type, value }, secondValue) => {
|
|
@@ -3730,8 +3685,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
|
|
|
3730
3685
|
return value === secondValue;
|
|
3731
3686
|
};
|
|
3732
3687
|
const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
|
|
3733
|
-
|
|
3734
|
-
throwOnDuplicateStream(duplicateStdioItem, optionName, type);
|
|
3688
|
+
throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
|
|
3735
3689
|
};
|
|
3736
3690
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
3737
3691
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
@@ -3740,15 +3694,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
|
3740
3694
|
//#endregion
|
|
3741
3695
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
3742
3696
|
const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
3743
|
-
const stdio = normalizeStdioOption(options, verboseInfo, isSync);
|
|
3744
|
-
const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
|
|
3745
|
-
stdioOption,
|
|
3746
|
-
fdNumber,
|
|
3747
|
-
options,
|
|
3748
|
-
isSync
|
|
3749
|
-
}));
|
|
3750
3697
|
const fileDescriptors = getFinalFileDescriptors({
|
|
3751
|
-
initialFileDescriptors,
|
|
3698
|
+
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
3699
|
+
stdioOption,
|
|
3700
|
+
fdNumber,
|
|
3701
|
+
options,
|
|
3702
|
+
isSync
|
|
3703
|
+
})),
|
|
3752
3704
|
addProperties: addProperties$2,
|
|
3753
3705
|
options,
|
|
3754
3706
|
isSync
|
|
@@ -3765,14 +3717,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
3765
3717
|
optionName
|
|
3766
3718
|
});
|
|
3767
3719
|
const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
|
|
3768
|
-
const
|
|
3720
|
+
const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
|
|
3769
3721
|
stdioItem,
|
|
3770
3722
|
isStdioArray,
|
|
3771
3723
|
fdNumber,
|
|
3772
3724
|
direction,
|
|
3773
3725
|
isSync
|
|
3774
|
-
}));
|
|
3775
|
-
const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
|
|
3726
|
+
})), optionName, direction, options);
|
|
3776
3727
|
const objectMode = getFdObjectMode(normalizedStdioItems, direction);
|
|
3777
3728
|
validateFileObjectMode(normalizedStdioItems, objectMode);
|
|
3778
3729
|
return {
|
|
@@ -3782,9 +3733,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
3782
3733
|
};
|
|
3783
3734
|
};
|
|
3784
3735
|
const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
|
|
3785
|
-
const
|
|
3786
|
-
const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
|
|
3787
|
-
const stdioItems = filterDuplicates(initialStdioItems);
|
|
3736
|
+
const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
|
|
3788
3737
|
const isStdioArray = stdioItems.length > 1;
|
|
3789
3738
|
validateStdioArray(stdioItems, isStdioArray, optionName);
|
|
3790
3739
|
validateStreams(stdioItems);
|
|
@@ -3834,18 +3783,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
3834
3783
|
}
|
|
3835
3784
|
};
|
|
3836
3785
|
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
|
|
3837
|
-
const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
|
|
3838
|
-
stdioItem,
|
|
3839
|
-
addProperties: addProperties$2,
|
|
3840
|
-
direction,
|
|
3841
|
-
options,
|
|
3842
|
-
fileDescriptors,
|
|
3843
|
-
isSync
|
|
3844
|
-
}));
|
|
3845
3786
|
return {
|
|
3846
3787
|
direction,
|
|
3847
3788
|
objectMode,
|
|
3848
|
-
stdioItems:
|
|
3789
|
+
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
3790
|
+
stdioItem,
|
|
3791
|
+
addProperties: addProperties$2,
|
|
3792
|
+
direction,
|
|
3793
|
+
options,
|
|
3794
|
+
fileDescriptors,
|
|
3795
|
+
isSync
|
|
3796
|
+
}))
|
|
3849
3797
|
};
|
|
3850
3798
|
};
|
|
3851
3799
|
const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
|
|
@@ -3975,8 +3923,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
|
3975
3923
|
yield chunk;
|
|
3976
3924
|
return;
|
|
3977
3925
|
}
|
|
3978
|
-
|
|
3979
|
-
yield concatBytes(chunk, newline);
|
|
3926
|
+
yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
|
|
3980
3927
|
};
|
|
3981
3928
|
const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
|
|
3982
3929
|
const linesStringInfo = {
|
|
@@ -4121,7 +4068,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
4121
4068
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
4122
4069
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
4123
4070
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
4124
|
-
|
|
4071
|
+
return { stream: new node_stream.Transform({
|
|
4125
4072
|
writableObjectMode,
|
|
4126
4073
|
writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
|
|
4127
4074
|
readableObjectMode,
|
|
@@ -4137,16 +4084,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
4137
4084
|
finalMethod([generators], this, done);
|
|
4138
4085
|
},
|
|
4139
4086
|
destroy: destroyMethod
|
|
4140
|
-
});
|
|
4141
|
-
return { stream };
|
|
4087
|
+
}) };
|
|
4142
4088
|
};
|
|
4143
4089
|
const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
|
|
4144
4090
|
const generators = stdioItems.filter(({ type }) => type === "generator");
|
|
4145
4091
|
const reversedGenerators = isInput ? generators.reverse() : generators;
|
|
4146
|
-
for (const { value, optionName } of reversedGenerators)
|
|
4147
|
-
const generators$1 = addInternalGenerators(value, encoding, optionName);
|
|
4148
|
-
chunks = runTransformSync(generators$1, chunks);
|
|
4149
|
-
}
|
|
4092
|
+
for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
|
|
4150
4093
|
return chunks;
|
|
4151
4094
|
};
|
|
4152
4095
|
const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
|
|
@@ -4183,9 +4126,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
|
|
|
4183
4126
|
const [{ type, optionName }] = allStdioItems;
|
|
4184
4127
|
throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
|
|
4185
4128
|
}
|
|
4186
|
-
|
|
4187
|
-
const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
|
|
4188
|
-
options.input = joinToUint8Array(transformedContents);
|
|
4129
|
+
options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
|
|
4189
4130
|
};
|
|
4190
4131
|
const applySingleInputGeneratorsSync = (contents, stdioItems) => {
|
|
4191
4132
|
const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
|
|
@@ -4210,10 +4151,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
|
|
|
4210
4151
|
};
|
|
4211
4152
|
const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
|
|
4212
4153
|
const logLine = (line, fdNumber, verboseInfo) => {
|
|
4213
|
-
const verboseMessage = serializeVerboseMessage(line);
|
|
4214
4154
|
verboseLog({
|
|
4215
4155
|
type: "output",
|
|
4216
|
-
verboseMessage,
|
|
4156
|
+
verboseMessage: serializeVerboseMessage(line),
|
|
4217
4157
|
fdNumber,
|
|
4218
4158
|
verboseInfo
|
|
4219
4159
|
});
|
|
@@ -4225,28 +4165,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
4225
4165
|
if (output === null) return { output: Array.from({ length: 3 }) };
|
|
4226
4166
|
const state = {};
|
|
4227
4167
|
const outputFiles = /* @__PURE__ */ new Set([]);
|
|
4228
|
-
const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
|
|
4229
|
-
result,
|
|
4230
|
-
fileDescriptors,
|
|
4231
|
-
fdNumber,
|
|
4232
|
-
state,
|
|
4233
|
-
outputFiles,
|
|
4234
|
-
isMaxBuffer,
|
|
4235
|
-
verboseInfo
|
|
4236
|
-
}, options));
|
|
4237
4168
|
return {
|
|
4238
|
-
output:
|
|
4169
|
+
output: output.map((result, fdNumber) => transformOutputResultSync({
|
|
4170
|
+
result,
|
|
4171
|
+
fileDescriptors,
|
|
4172
|
+
fdNumber,
|
|
4173
|
+
state,
|
|
4174
|
+
outputFiles,
|
|
4175
|
+
isMaxBuffer,
|
|
4176
|
+
verboseInfo
|
|
4177
|
+
}, options)),
|
|
4239
4178
|
...state
|
|
4240
4179
|
};
|
|
4241
4180
|
};
|
|
4242
4181
|
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
|
|
4243
4182
|
if (result === null) return;
|
|
4244
|
-
const
|
|
4245
|
-
const uint8ArrayResult = bufferToUint8Array(truncatedResult);
|
|
4183
|
+
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
4246
4184
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
4247
|
-
const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
|
|
4248
4185
|
const { serializedResult, finalResult = serializedResult } = serializeChunks({
|
|
4249
|
-
chunks,
|
|
4186
|
+
chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
|
|
4250
4187
|
objectMode,
|
|
4251
4188
|
encoding,
|
|
4252
4189
|
lines,
|
|
@@ -4357,14 +4294,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
|
4357
4294
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
4358
4295
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
4359
4296
|
const resultError = getResultError(error, exitCode, signal);
|
|
4360
|
-
const timedOut = resultError?.code === "ETIMEDOUT";
|
|
4361
|
-
const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
|
|
4362
4297
|
return {
|
|
4363
4298
|
resultError,
|
|
4364
4299
|
exitCode,
|
|
4365
4300
|
signal,
|
|
4366
|
-
timedOut,
|
|
4367
|
-
isMaxBuffer
|
|
4301
|
+
timedOut: resultError?.code === "ETIMEDOUT",
|
|
4302
|
+
isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
|
|
4368
4303
|
};
|
|
4369
4304
|
};
|
|
4370
4305
|
const getResultError = (error, exitCode, signal) => {
|
|
@@ -4376,7 +4311,7 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
4376
4311
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
4377
4312
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
4378
4313
|
const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
|
|
4379
|
-
|
|
4314
|
+
return handleResult(spawnSubprocessSync({
|
|
4380
4315
|
file,
|
|
4381
4316
|
commandArguments,
|
|
4382
4317
|
options,
|
|
@@ -4385,15 +4320,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
|
4385
4320
|
verboseInfo,
|
|
4386
4321
|
fileDescriptors,
|
|
4387
4322
|
startTime
|
|
4388
|
-
});
|
|
4389
|
-
return handleResult(result, verboseInfo, options);
|
|
4323
|
+
}), verboseInfo, options);
|
|
4390
4324
|
};
|
|
4391
4325
|
const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
4392
4326
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
4393
|
-
const
|
|
4394
|
-
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
|
|
4327
|
+
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
|
|
4395
4328
|
validateSyncOptions(options);
|
|
4396
|
-
const fileDescriptors = handleStdioSync(options, verboseInfo);
|
|
4397
4329
|
return {
|
|
4398
4330
|
file,
|
|
4399
4331
|
commandArguments,
|
|
@@ -4402,7 +4334,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
4402
4334
|
startTime,
|
|
4403
4335
|
verboseInfo,
|
|
4404
4336
|
options,
|
|
4405
|
-
fileDescriptors
|
|
4337
|
+
fileDescriptors: handleStdioSync(options, verboseInfo)
|
|
4406
4338
|
};
|
|
4407
4339
|
};
|
|
4408
4340
|
const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
|
|
@@ -4437,16 +4369,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
4437
4369
|
isMaxBuffer,
|
|
4438
4370
|
verboseInfo
|
|
4439
4371
|
});
|
|
4440
|
-
const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
|
|
4441
|
-
const all = stripNewline(getAllSync(output, options), options, "all");
|
|
4442
4372
|
return getSyncResult({
|
|
4443
4373
|
error,
|
|
4444
4374
|
exitCode,
|
|
4445
4375
|
signal,
|
|
4446
4376
|
timedOut,
|
|
4447
4377
|
isMaxBuffer,
|
|
4448
|
-
stdio,
|
|
4449
|
-
all,
|
|
4378
|
+
stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
|
|
4379
|
+
all: stripNewline(getAllSync(output, options), options, "all"),
|
|
4450
4380
|
options,
|
|
4451
4381
|
command,
|
|
4452
4382
|
escapedCommand,
|
|
@@ -4456,8 +4386,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
4456
4386
|
const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
|
|
4457
4387
|
try {
|
|
4458
4388
|
addInputOptionsSync(fileDescriptors, options);
|
|
4459
|
-
|
|
4460
|
-
return (0, node_child_process.spawnSync)(file, commandArguments, normalizedOptions);
|
|
4389
|
+
return (0, node_child_process.spawnSync)(file, commandArguments, normalizeSpawnSyncOptions(options));
|
|
4461
4390
|
} catch (error) {
|
|
4462
4391
|
return makeEarlyError({
|
|
4463
4392
|
error,
|
|
@@ -4675,19 +4604,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
4675
4604
|
writable,
|
|
4676
4605
|
duplex
|
|
4677
4606
|
});
|
|
4678
|
-
const earlyError = makeEarlyError({
|
|
4679
|
-
error,
|
|
4680
|
-
command,
|
|
4681
|
-
escapedCommand,
|
|
4682
|
-
fileDescriptors,
|
|
4683
|
-
options,
|
|
4684
|
-
startTime,
|
|
4685
|
-
isSync: false
|
|
4686
|
-
});
|
|
4687
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
4688
4607
|
return {
|
|
4689
4608
|
subprocess,
|
|
4690
|
-
promise
|
|
4609
|
+
promise: handleDummyPromise(makeEarlyError({
|
|
4610
|
+
error,
|
|
4611
|
+
command,
|
|
4612
|
+
escapedCommand,
|
|
4613
|
+
fileDescriptors,
|
|
4614
|
+
options,
|
|
4615
|
+
startTime,
|
|
4616
|
+
isSync: false
|
|
4617
|
+
}), verboseInfo, options)
|
|
4691
4618
|
};
|
|
4692
4619
|
};
|
|
4693
4620
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
@@ -4736,8 +4663,7 @@ const addProperties = {
|
|
|
4736
4663
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
4737
4664
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
4738
4665
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
4739
|
-
|
|
4740
|
-
return { stream };
|
|
4666
|
+
return { stream: node_stream.Duplex.fromWeb(transform, { objectMode }) };
|
|
4741
4667
|
},
|
|
4742
4668
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
4743
4669
|
native() {}
|
|
@@ -4983,10 +4909,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
|
4983
4909
|
controller
|
|
4984
4910
|
});
|
|
4985
4911
|
}
|
|
4986
|
-
for (const [outputStream, inputStreams] of pipeGroups.entries())
|
|
4987
|
-
const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
|
|
4988
|
-
pipeStreams(inputStream, outputStream);
|
|
4989
|
-
}
|
|
4912
|
+
for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
|
|
4990
4913
|
};
|
|
4991
4914
|
const pipeTransform = (subprocess, stream, direction, fdNumber) => {
|
|
4992
4915
|
if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
|
|
@@ -5248,10 +5171,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
|
|
|
5248
5171
|
const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
5249
5172
|
try {
|
|
5250
5173
|
const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
|
|
5251
|
-
const destinationStream = getToStream(destination, to);
|
|
5252
5174
|
return {
|
|
5253
5175
|
destination,
|
|
5254
|
-
destinationStream,
|
|
5176
|
+
destinationStream: getToStream(destination, to),
|
|
5255
5177
|
from,
|
|
5256
5178
|
unpipeSignal
|
|
5257
5179
|
};
|
|
@@ -5260,19 +5182,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
|
5260
5182
|
}
|
|
5261
5183
|
};
|
|
5262
5184
|
const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
|
|
5263
|
-
if (Array.isArray(firstArgument)) {
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
pipeOptions: boundOptions
|
|
5268
|
-
};
|
|
5269
|
-
}
|
|
5185
|
+
if (Array.isArray(firstArgument)) return {
|
|
5186
|
+
destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
|
|
5187
|
+
pipeOptions: boundOptions
|
|
5188
|
+
};
|
|
5270
5189
|
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
5271
5190
|
if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
|
|
5272
5191
|
const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
|
|
5273
|
-
const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
|
|
5274
5192
|
return {
|
|
5275
|
-
destination,
|
|
5193
|
+
destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
|
|
5276
5194
|
pipeOptions: rawOptions
|
|
5277
5195
|
};
|
|
5278
5196
|
}
|
|
@@ -5292,8 +5210,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
|
|
|
5292
5210
|
} });
|
|
5293
5211
|
const getSourceStream = (source, from) => {
|
|
5294
5212
|
try {
|
|
5295
|
-
|
|
5296
|
-
return { sourceStream };
|
|
5213
|
+
return { sourceStream: getFromStream(source, from) };
|
|
5297
5214
|
} catch (error) {
|
|
5298
5215
|
return { sourceError: error };
|
|
5299
5216
|
}
|
|
@@ -5387,9 +5304,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
|
|
|
5387
5304
|
const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
5388
5305
|
await (0, node_util.aborted)(unpipeSignal, sourceStream);
|
|
5389
5306
|
await mergedStream.remove(sourceStream);
|
|
5390
|
-
const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
|
|
5391
5307
|
throw createNonCommandError({
|
|
5392
|
-
error,
|
|
5308
|
+
error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
|
|
5393
5309
|
fileDescriptors,
|
|
5394
5310
|
sourceOptions,
|
|
5395
5311
|
startTime
|
|
@@ -5492,13 +5408,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
5492
5408
|
}
|
|
5493
5409
|
};
|
|
5494
5410
|
const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
5495
|
-
const onStdoutChunk = (0, node_events.on)(stream, "data", {
|
|
5496
|
-
signal: controller.signal,
|
|
5497
|
-
highWaterMark: HIGH_WATER_MARK,
|
|
5498
|
-
highWatermark: HIGH_WATER_MARK
|
|
5499
|
-
});
|
|
5500
5411
|
return iterateOnData({
|
|
5501
|
-
onStdoutChunk,
|
|
5412
|
+
onStdoutChunk: (0, node_events.on)(stream, "data", {
|
|
5413
|
+
signal: controller.signal,
|
|
5414
|
+
highWaterMark: HIGH_WATER_MARK,
|
|
5415
|
+
highWatermark: HIGH_WATER_MARK
|
|
5416
|
+
}),
|
|
5502
5417
|
controller,
|
|
5503
5418
|
binary,
|
|
5504
5419
|
shouldEncode,
|
|
@@ -5543,13 +5458,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
5543
5458
|
await Promise.all([resumeStream(stream), logPromise]);
|
|
5544
5459
|
return;
|
|
5545
5460
|
}
|
|
5546
|
-
const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
|
|
5547
5461
|
const iterable = iterateForResult({
|
|
5548
5462
|
stream,
|
|
5549
5463
|
onStreamEnd,
|
|
5550
5464
|
lines,
|
|
5551
5465
|
encoding,
|
|
5552
|
-
stripFinalNewline:
|
|
5466
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
|
|
5553
5467
|
allMixed
|
|
5554
5468
|
});
|
|
5555
5469
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -5569,15 +5483,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
|
|
|
5569
5483
|
verboseInfo,
|
|
5570
5484
|
fdNumber
|
|
5571
5485
|
})) return;
|
|
5572
|
-
|
|
5486
|
+
await logLines(iterateForResult({
|
|
5573
5487
|
stream,
|
|
5574
5488
|
onStreamEnd,
|
|
5575
5489
|
lines: true,
|
|
5576
5490
|
encoding,
|
|
5577
5491
|
stripFinalNewline: true,
|
|
5578
5492
|
allMixed
|
|
5579
|
-
});
|
|
5580
|
-
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
5493
|
+
}), stream, fdNumber, verboseInfo);
|
|
5581
5494
|
};
|
|
5582
5495
|
const resumeStream = async (stream) => {
|
|
5583
5496
|
await (0, node_timers_promises.setImmediate)();
|
|
@@ -5727,10 +5640,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
|
|
|
5727
5640
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
5728
5641
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
5729
5642
|
const logIpcOutput = (message, verboseInfo) => {
|
|
5730
|
-
const verboseMessage = serializeVerboseMessage(message);
|
|
5731
5643
|
verboseLog({
|
|
5732
5644
|
type: "ipc",
|
|
5733
|
-
verboseMessage,
|
|
5645
|
+
verboseMessage: serializeVerboseMessage(message),
|
|
5734
5646
|
fdNumber: "ipc",
|
|
5735
5647
|
verboseInfo
|
|
5736
5648
|
});
|
|
@@ -5873,9 +5785,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
5873
5785
|
const promises = weakMap.get(stream);
|
|
5874
5786
|
const promise = createDeferred();
|
|
5875
5787
|
promises.push(promise);
|
|
5876
|
-
const resolve = promise.resolve.bind(promise);
|
|
5877
5788
|
return {
|
|
5878
|
-
resolve,
|
|
5789
|
+
resolve: promise.resolve.bind(promise),
|
|
5879
5790
|
promises
|
|
5880
5791
|
};
|
|
5881
5792
|
};
|
|
@@ -5956,10 +5867,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
5956
5867
|
};
|
|
5957
5868
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
5958
5869
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
5959
|
-
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
|
|
5960
5870
|
return {
|
|
5961
5871
|
subprocessStdout,
|
|
5962
|
-
waitReadableDestroy
|
|
5872
|
+
waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
|
|
5963
5873
|
};
|
|
5964
5874
|
};
|
|
5965
5875
|
const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
|
|
@@ -6037,12 +5947,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
6037
5947
|
};
|
|
6038
5948
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
6039
5949
|
const subprocessStdin = getToStream(subprocess, to);
|
|
6040
|
-
const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
|
|
6041
|
-
const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
|
|
6042
5950
|
return {
|
|
6043
5951
|
subprocessStdin,
|
|
6044
|
-
waitWritableFinal,
|
|
6045
|
-
waitWritableDestroy
|
|
5952
|
+
waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
|
|
5953
|
+
waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
|
|
6046
5954
|
};
|
|
6047
5955
|
};
|
|
6048
5956
|
const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
@@ -6138,15 +6046,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
6138
6046
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
6139
6047
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
6140
6048
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
6141
|
-
|
|
6049
|
+
return iterateOnStdoutData(iterateOnSubprocessStream({
|
|
6142
6050
|
subprocessStdout,
|
|
6143
6051
|
subprocess,
|
|
6144
6052
|
binary,
|
|
6145
6053
|
shouldEncode: true,
|
|
6146
6054
|
encoding,
|
|
6147
6055
|
preserveNewlines
|
|
6148
|
-
});
|
|
6149
|
-
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
6056
|
+
}), subprocessStdout, subprocess);
|
|
6150
6057
|
};
|
|
6151
6058
|
const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
|
|
6152
6059
|
try {
|
|
@@ -6228,7 +6135,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
6228
6135
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
6229
6136
|
const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
|
|
6230
6137
|
const options = handleAsyncOptions(normalizedOptions);
|
|
6231
|
-
const fileDescriptors = handleStdioAsync(options, verboseInfo);
|
|
6232
6138
|
return {
|
|
6233
6139
|
file,
|
|
6234
6140
|
commandArguments,
|
|
@@ -6237,7 +6143,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
6237
6143
|
startTime,
|
|
6238
6144
|
verboseInfo,
|
|
6239
6145
|
options,
|
|
6240
|
-
fileDescriptors
|
|
6146
|
+
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
6241
6147
|
};
|
|
6242
6148
|
};
|
|
6243
6149
|
const handleAsyncOptions = ({ timeout, signal,...options }) => {
|
|
@@ -6310,22 +6216,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
|
|
|
6310
6216
|
});
|
|
6311
6217
|
controller.abort();
|
|
6312
6218
|
onInternalError.resolve();
|
|
6313
|
-
|
|
6314
|
-
const all = stripNewline(allResult, options, "all");
|
|
6315
|
-
const result = getAsyncResult({
|
|
6219
|
+
return handleResult(getAsyncResult({
|
|
6316
6220
|
errorInfo,
|
|
6317
6221
|
exitCode,
|
|
6318
6222
|
signal,
|
|
6319
|
-
stdio,
|
|
6320
|
-
all,
|
|
6223
|
+
stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
|
|
6224
|
+
all: stripNewline(allResult, options, "all"),
|
|
6321
6225
|
ipcOutput,
|
|
6322
6226
|
context,
|
|
6323
6227
|
options,
|
|
6324
6228
|
command,
|
|
6325
6229
|
escapedCommand,
|
|
6326
6230
|
startTime
|
|
6327
|
-
});
|
|
6328
|
-
return handleResult(result, verboseInfo, options);
|
|
6231
|
+
}), verboseInfo, options);
|
|
6329
6232
|
};
|
|
6330
6233
|
const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
|
|
6331
6234
|
error: errorInfo.error,
|
|
@@ -6398,8 +6301,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
|
|
|
6398
6301
|
return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
|
|
6399
6302
|
};
|
|
6400
6303
|
const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
|
|
6401
|
-
const
|
|
6402
|
-
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
|
|
6304
|
+
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
|
|
6403
6305
|
const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
|
|
6404
6306
|
const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
|
|
6405
6307
|
file: initialFile,
|
|
@@ -6497,7 +6399,7 @@ function getHermesOSExe() {
|
|
|
6497
6399
|
function getReactNativePackagePath(cwd) {
|
|
6498
6400
|
try {
|
|
6499
6401
|
return path.default.dirname(require.resolve("react-native/package.json", { paths: [cwd] }));
|
|
6500
|
-
} catch
|
|
6402
|
+
} catch {
|
|
6501
6403
|
return path.default.join("node_modules", "react-native");
|
|
6502
6404
|
}
|
|
6503
6405
|
}
|
|
@@ -6540,14 +6442,13 @@ async function getHermesCommand(cwd) {
|
|
|
6540
6442
|
* @returns The full path to the compiled HBC file
|
|
6541
6443
|
*/
|
|
6542
6444
|
async function compileHermes({ cwd, sourcemap, inputJsFile }) {
|
|
6543
|
-
const outputHbcFile = `${inputJsFile}.hbc`;
|
|
6544
6445
|
const hermesArgs = [
|
|
6545
6446
|
"-w",
|
|
6546
6447
|
"-O",
|
|
6547
6448
|
"-emit-binary",
|
|
6548
6449
|
"-max-diagnostic-width=80",
|
|
6549
6450
|
"-out",
|
|
6550
|
-
|
|
6451
|
+
`${inputJsFile}.hbc`,
|
|
6551
6452
|
inputJsFile
|
|
6552
6453
|
];
|
|
6553
6454
|
if (sourcemap) hermesArgs.push("-output-source-map");
|