@hot-updater/expo 0.20.10 → 0.20.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +143 -244
- package/dist/index.js +159 -260
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import * as fs$1 from "fs";
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import * as path$2 from "path";
|
|
5
|
-
import path from "path";
|
|
6
2
|
import { compileHermes } from "@hot-updater/bare";
|
|
7
3
|
import { log } from "@hot-updater/plugin-core";
|
|
8
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -11,7 +7,11 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
11
7
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
12
8
|
import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
|
|
13
9
|
import tty from "node:tty";
|
|
14
|
-
import path
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import * as path$2 from "path";
|
|
12
|
+
import path$1 from "path";
|
|
13
|
+
import * as fs$1 from "fs";
|
|
14
|
+
import fs from "fs";
|
|
15
15
|
import { scheduler, setImmediate, setTimeout } from "node:timers/promises";
|
|
16
16
|
import { constants } from "node:os";
|
|
17
17
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
@@ -96,8 +96,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
|
|
|
96
96
|
const textDecoder = new TextDecoder();
|
|
97
97
|
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
|
|
98
98
|
const joinToString = (uint8ArraysOrStrings, encoding) => {
|
|
99
|
-
|
|
100
|
-
return strings.join("");
|
|
99
|
+
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
|
|
101
100
|
};
|
|
102
101
|
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
103
102
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
|
|
@@ -152,8 +151,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
152
151
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
153
152
|
if (index === expressions.length) return newTokens;
|
|
154
153
|
const expression = expressions[index];
|
|
155
|
-
|
|
156
|
-
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
|
|
154
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
|
|
157
155
|
};
|
|
158
156
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
159
157
|
if (rawTemplate.length === 0) return {
|
|
@@ -240,8 +238,7 @@ const normalizeFdSpecificOptions = (options) => {
|
|
|
240
238
|
};
|
|
241
239
|
const normalizeFdSpecificOption = (options, optionName) => {
|
|
242
240
|
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
|
|
243
|
-
|
|
244
|
-
return addDefaultValue$1(optionArray, optionName);
|
|
241
|
+
return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
|
|
245
242
|
};
|
|
246
243
|
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
247
244
|
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
@@ -271,12 +268,11 @@ const parseFd = (fdName) => {
|
|
|
271
268
|
};
|
|
272
269
|
const FD_REGEXP = /^fd(\d+)$/;
|
|
273
270
|
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
274
|
-
const verboseDefault = debuglog("execa").enabled ? "full" : "none";
|
|
275
271
|
const DEFAULT_OPTIONS = {
|
|
276
272
|
lines: false,
|
|
277
273
|
buffer: true,
|
|
278
274
|
maxBuffer: 1e3 * 1e3 * 100,
|
|
279
|
-
verbose:
|
|
275
|
+
verbose: debuglog("execa").enabled ? "full" : "none",
|
|
280
276
|
stripFinalNewline: true
|
|
281
277
|
};
|
|
282
278
|
const FD_SPECIFIC_OPTIONS = [
|
|
@@ -309,11 +305,9 @@ const VERBOSE_VALUES = [
|
|
|
309
305
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
310
306
|
const joinCommand = (filePath, rawArguments) => {
|
|
311
307
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
312
|
-
const command = fileAndArguments.join(" ");
|
|
313
|
-
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
314
308
|
return {
|
|
315
|
-
command,
|
|
316
|
-
escapedCommand
|
|
309
|
+
command: fileAndArguments.join(" "),
|
|
310
|
+
escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
|
|
317
311
|
};
|
|
318
312
|
};
|
|
319
313
|
const escapeLines = (lines) => stripVTControlCharacters(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
@@ -754,13 +748,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
|
|
|
754
748
|
//#endregion
|
|
755
749
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
756
750
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
757
|
-
const
|
|
751
|
+
const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
|
|
758
752
|
type,
|
|
759
753
|
result,
|
|
760
754
|
verboseInfo
|
|
761
|
-
});
|
|
762
|
-
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
763
|
-
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
755
|
+
})), verboseInfo, fdNumber);
|
|
764
756
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
765
757
|
};
|
|
766
758
|
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
|
|
@@ -777,16 +769,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
|
|
|
777
769
|
message
|
|
778
770
|
}));
|
|
779
771
|
const getPrintedLine = (verboseObject) => {
|
|
780
|
-
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
781
772
|
return {
|
|
782
|
-
verboseLine,
|
|
773
|
+
verboseLine: defaultVerboseFunction(verboseObject),
|
|
783
774
|
verboseObject
|
|
784
775
|
};
|
|
785
776
|
};
|
|
786
777
|
const serializeVerboseMessage = (message) => {
|
|
787
|
-
|
|
788
|
-
const escapedMessage = escapeLines(messageString);
|
|
789
|
-
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
778
|
+
return escapeLines(typeof message === "string" ? message : inspect(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
790
779
|
};
|
|
791
780
|
const TAB_SIZE = 2;
|
|
792
781
|
|
|
@@ -805,11 +794,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
805
794
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
806
795
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
807
796
|
validateVerbose(verbose);
|
|
808
|
-
const commandId = getCommandId(verbose);
|
|
809
797
|
return {
|
|
810
798
|
verbose,
|
|
811
799
|
escapedCommand,
|
|
812
|
-
commandId,
|
|
800
|
+
commandId: getCommandId(verbose),
|
|
813
801
|
rawOptions
|
|
814
802
|
};
|
|
815
803
|
};
|
|
@@ -836,8 +824,7 @@ const getDurationMs = (startTime) => Number(hrtime.bigint() - startTime) / 1e6;
|
|
|
836
824
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
837
825
|
const startTime = getStartTime();
|
|
838
826
|
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
|
|
839
|
-
const
|
|
840
|
-
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
|
|
827
|
+
const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
|
|
841
828
|
logCommand(escapedCommand, verboseInfo);
|
|
842
829
|
return {
|
|
843
830
|
command,
|
|
@@ -905,8 +892,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
905
892
|
var g = parseInt("010", 8);
|
|
906
893
|
var o$1 = parseInt("001", 8);
|
|
907
894
|
var ug = u$1 | g;
|
|
908
|
-
|
|
909
|
-
return ret;
|
|
895
|
+
return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
|
|
910
896
|
}
|
|
911
897
|
}) });
|
|
912
898
|
|
|
@@ -988,8 +974,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
988
974
|
const ppRaw = pathEnv[i$1];
|
|
989
975
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
990
976
|
const pCmd = path$5.join(pathPart, cmd);
|
|
991
|
-
|
|
992
|
-
resolve(subStep(p$1, i$1, 0));
|
|
977
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
993
978
|
});
|
|
994
979
|
const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
|
|
995
980
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
@@ -1014,8 +999,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1014
999
|
for (let j = 0; j < pathExt.length; j++) {
|
|
1015
1000
|
const cur = p$1 + pathExt[j];
|
|
1016
1001
|
try {
|
|
1017
|
-
|
|
1018
|
-
if (is) if (opt.all) found.push(cur);
|
|
1002
|
+
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
1019
1003
|
else return cur;
|
|
1020
1004
|
} catch (ex) {}
|
|
1021
1005
|
}
|
|
@@ -1033,8 +1017,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1033
1017
|
var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
|
|
1034
1018
|
const pathKey$1 = (options = {}) => {
|
|
1035
1019
|
const environment = options.env || process.env;
|
|
1036
|
-
|
|
1037
|
-
if (platform$1 !== "win32") return "PATH";
|
|
1020
|
+
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
1038
1021
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
1039
1022
|
};
|
|
1040
1023
|
module.exports = pathKey$1;
|
|
@@ -1162,12 +1145,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
1162
1145
|
parsed.command = path$3.normalize(parsed.command);
|
|
1163
1146
|
parsed.command = escape.command(parsed.command);
|
|
1164
1147
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
1165
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
1166
1148
|
parsed.args = [
|
|
1167
1149
|
"/d",
|
|
1168
1150
|
"/s",
|
|
1169
1151
|
"/c",
|
|
1170
|
-
`"${
|
|
1152
|
+
`"${[parsed.command].concat(parsed.args).join(" ")}"`
|
|
1171
1153
|
];
|
|
1172
1154
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
1173
1155
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -1278,12 +1260,12 @@ function toPath(urlOrPath) {
|
|
|
1278
1260
|
}
|
|
1279
1261
|
function traversePathUp(startPath) {
|
|
1280
1262
|
return { *[Symbol.iterator]() {
|
|
1281
|
-
let currentPath = path
|
|
1263
|
+
let currentPath = path.resolve(toPath(startPath));
|
|
1282
1264
|
let previousPath;
|
|
1283
1265
|
while (previousPath !== currentPath) {
|
|
1284
1266
|
yield currentPath;
|
|
1285
1267
|
previousPath = currentPath;
|
|
1286
|
-
currentPath = path
|
|
1268
|
+
currentPath = path.resolve(currentPath, "..");
|
|
1287
1269
|
}
|
|
1288
1270
|
} };
|
|
1289
1271
|
}
|
|
@@ -1292,21 +1274,21 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
1292
1274
|
//#endregion
|
|
1293
1275
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
1294
1276
|
const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
|
|
1295
|
-
const cwdPath = path
|
|
1277
|
+
const cwdPath = path.resolve(toPath(cwd));
|
|
1296
1278
|
const result = [];
|
|
1297
|
-
const pathParts = pathOption.split(path
|
|
1279
|
+
const pathParts = pathOption.split(path.delimiter);
|
|
1298
1280
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
1299
1281
|
if (addExecPath) applyExecPath(result, pathParts, execPath$1, cwdPath);
|
|
1300
|
-
return pathOption === "" || pathOption === path
|
|
1282
|
+
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
1301
1283
|
};
|
|
1302
1284
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
1303
1285
|
for (const directory of traversePathUp(cwdPath)) {
|
|
1304
|
-
const pathPart = path
|
|
1286
|
+
const pathPart = path.join(directory, "node_modules/.bin");
|
|
1305
1287
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
1306
1288
|
}
|
|
1307
1289
|
};
|
|
1308
1290
|
const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
1309
|
-
const pathPart = path
|
|
1291
|
+
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
1310
1292
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
1311
1293
|
};
|
|
1312
1294
|
const npmRunPathEnv = ({ env = process$1.env,...options } = {}) => {
|
|
@@ -1320,9 +1302,7 @@ const npmRunPathEnv = ({ env = process$1.env,...options } = {}) => {
|
|
|
1320
1302
|
//#endregion
|
|
1321
1303
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
1322
1304
|
const getFinalError = (originalError, message, isSync) => {
|
|
1323
|
-
|
|
1324
|
-
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
|
|
1325
|
-
return new ErrorClass(message, options);
|
|
1305
|
+
return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
|
|
1326
1306
|
};
|
|
1327
1307
|
var DiscardedError = class extends Error {};
|
|
1328
1308
|
const setErrorName = (ErrorClass, value) => {
|
|
@@ -1641,16 +1621,14 @@ const SIGNALS = [
|
|
|
1641
1621
|
//#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
|
|
1642
1622
|
const getSignals = () => {
|
|
1643
1623
|
const realtimeSignals = getRealtimeSignals();
|
|
1644
|
-
|
|
1645
|
-
return signals$1;
|
|
1624
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
1646
1625
|
};
|
|
1647
1626
|
const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
|
|
1648
1627
|
const { signals: { [name]: constantSignal } } = constants;
|
|
1649
1628
|
const supported = constantSignal !== void 0;
|
|
1650
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
1651
1629
|
return {
|
|
1652
1630
|
name,
|
|
1653
|
-
number,
|
|
1631
|
+
number: supported ? constantSignal : defaultNumber,
|
|
1654
1632
|
description,
|
|
1655
1633
|
supported,
|
|
1656
1634
|
action,
|
|
@@ -2062,8 +2040,7 @@ const isConnected = (anyProcess) => {
|
|
|
2062
2040
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
2063
2041
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
2064
2042
|
if (!strict) return message;
|
|
2065
|
-
const
|
|
2066
|
-
const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
|
|
2043
|
+
const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
|
|
2067
2044
|
return {
|
|
2068
2045
|
id: count++,
|
|
2069
2046
|
type: REQUEST_TYPE,
|
|
@@ -2136,11 +2113,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
|
|
|
2136
2113
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
2137
2114
|
if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
|
|
2138
2115
|
const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
|
|
2139
|
-
const onMessageSent = createDeferred();
|
|
2140
|
-
const id = strict ? wrappedMessage.id : void 0;
|
|
2141
2116
|
const outgoingMessage = {
|
|
2142
|
-
onMessageSent,
|
|
2143
|
-
id
|
|
2117
|
+
onMessageSent: createDeferred(),
|
|
2118
|
+
id: strict ? wrappedMessage.id : void 0
|
|
2144
2119
|
};
|
|
2145
2120
|
outgoingMessages.add(outgoingMessage);
|
|
2146
2121
|
return {
|
|
@@ -2301,8 +2276,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
|
|
|
2301
2276
|
})] : [];
|
|
2302
2277
|
const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
|
|
2303
2278
|
await onAbortedSignal(cancelSignal, signal);
|
|
2304
|
-
|
|
2305
|
-
await sendAbort(subprocess, reason);
|
|
2279
|
+
await sendAbort(subprocess, getReason(cancelSignal));
|
|
2306
2280
|
killOnTimeout({
|
|
2307
2281
|
kill: subprocess.kill,
|
|
2308
2282
|
forceKillAfterDelay,
|
|
@@ -2349,7 +2323,7 @@ const mapNode = ({ options }) => {
|
|
|
2349
2323
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath,...options }) => {
|
|
2350
2324
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
2351
2325
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
2352
|
-
const resolvedNodePath = path
|
|
2326
|
+
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
2353
2327
|
const newOptions = {
|
|
2354
2328
|
...options,
|
|
2355
2329
|
nodePath: resolvedNodePath,
|
|
@@ -2361,7 +2335,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
2361
2335
|
commandArguments,
|
|
2362
2336
|
newOptions
|
|
2363
2337
|
];
|
|
2364
|
-
if (path
|
|
2338
|
+
if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
|
|
2365
2339
|
return [
|
|
2366
2340
|
resolvedNodePath,
|
|
2367
2341
|
[
|
|
@@ -2448,7 +2422,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
2448
2422
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
|
|
2449
2423
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
2450
2424
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
2451
|
-
return path
|
|
2425
|
+
return path.resolve(cwdString);
|
|
2452
2426
|
};
|
|
2453
2427
|
const getDefaultCwd = () => {
|
|
2454
2428
|
try {
|
|
@@ -2476,8 +2450,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2476
2450
|
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
2477
2451
|
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
2478
2452
|
const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
|
|
2479
|
-
const
|
|
2480
|
-
const options = addDefaultOptions(fdOptions);
|
|
2453
|
+
const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
|
|
2481
2454
|
validateTimeout(options);
|
|
2482
2455
|
validateEncoding(options);
|
|
2483
2456
|
validateIpcInputOption(options);
|
|
@@ -2488,7 +2461,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2488
2461
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
2489
2462
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
2490
2463
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
2491
|
-
if (process$1.platform === "win32" && path
|
|
2464
|
+
if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
2492
2465
|
return {
|
|
2493
2466
|
file,
|
|
2494
2467
|
commandArguments,
|
|
@@ -2634,7 +2607,7 @@ const u = Object.create(a, {
|
|
|
2634
2607
|
}
|
|
2635
2608
|
});
|
|
2636
2609
|
function h({ preventCancel: r = !1 } = {}) {
|
|
2637
|
-
const
|
|
2610
|
+
const t = new c(this.getReader(), r), s = Object.create(u);
|
|
2638
2611
|
return s[n] = t, s;
|
|
2639
2612
|
}
|
|
2640
2613
|
|
|
@@ -2683,18 +2656,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
|
|
|
2683
2656
|
const state = init();
|
|
2684
2657
|
state.length = 0;
|
|
2685
2658
|
try {
|
|
2686
|
-
for await (const chunk of asyncIterable) {
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
addChunk,
|
|
2695
|
-
maxBuffer
|
|
2696
|
-
});
|
|
2697
|
-
}
|
|
2659
|
+
for await (const chunk of asyncIterable) appendChunk({
|
|
2660
|
+
convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
|
|
2661
|
+
state,
|
|
2662
|
+
getSize,
|
|
2663
|
+
truncateChunk,
|
|
2664
|
+
addChunk,
|
|
2665
|
+
maxBuffer
|
|
2666
|
+
});
|
|
2698
2667
|
appendFinalChunk({
|
|
2699
2668
|
state,
|
|
2700
2669
|
convertChunk,
|
|
@@ -2884,10 +2853,9 @@ const stringMethods = {
|
|
|
2884
2853
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
2885
2854
|
if (!(error instanceof MaxBufferError)) throw error;
|
|
2886
2855
|
if (fdNumber === "all") return error;
|
|
2887
|
-
const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
|
|
2888
2856
|
error.maxBufferInfo = {
|
|
2889
2857
|
fdNumber,
|
|
2890
|
-
unit
|
|
2858
|
+
unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
|
|
2891
2859
|
};
|
|
2892
2860
|
stream.destroy();
|
|
2893
2861
|
throw error;
|
|
@@ -2957,19 +2925,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
|
|
|
2957
2925
|
killSignal
|
|
2958
2926
|
});
|
|
2959
2927
|
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
2960
|
-
const
|
|
2961
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
2962
|
-
const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
|
|
2963
|
-
const message = [
|
|
2964
|
-
shortMessage,
|
|
2965
|
-
...messageStdio,
|
|
2966
|
-
...stdio.slice(3),
|
|
2967
|
-
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
2968
|
-
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
|
|
2928
|
+
const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
|
|
2969
2929
|
return {
|
|
2970
2930
|
originalMessage,
|
|
2971
2931
|
shortMessage,
|
|
2972
|
-
message
|
|
2932
|
+
message: [
|
|
2933
|
+
shortMessage,
|
|
2934
|
+
...all === void 0 ? [stdio[2], stdio[1]] : [all],
|
|
2935
|
+
...stdio.slice(3),
|
|
2936
|
+
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
2937
|
+
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
|
|
2973
2938
|
};
|
|
2974
2939
|
};
|
|
2975
2940
|
const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
|
|
@@ -2990,8 +2955,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
|
|
|
2990
2955
|
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
|
|
2991
2956
|
const getOriginalMessage = (originalError, cwd) => {
|
|
2992
2957
|
if (originalError instanceof DiscardedError) return;
|
|
2993
|
-
const
|
|
2994
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
2958
|
+
const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
|
|
2995
2959
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
2996
2960
|
};
|
|
2997
2961
|
const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : inspect(ipcMessage);
|
|
@@ -3113,11 +3077,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
|
|
|
3113
3077
|
const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
3114
3078
|
const exitCode = rawExitCode === null ? void 0 : rawExitCode;
|
|
3115
3079
|
const signal = rawSignal === null ? void 0 : rawSignal;
|
|
3116
|
-
const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
|
|
3117
3080
|
return {
|
|
3118
3081
|
exitCode,
|
|
3119
3082
|
signal,
|
|
3120
|
-
signalDescription
|
|
3083
|
+
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
3121
3084
|
};
|
|
3122
3085
|
};
|
|
3123
3086
|
|
|
@@ -3182,8 +3145,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3182
3145
|
let result = [];
|
|
3183
3146
|
const floorDecimals = (value, decimalDigits) => {
|
|
3184
3147
|
const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
|
|
3185
|
-
|
|
3186
|
-
return flooredValue.toFixed(decimalDigits);
|
|
3148
|
+
return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
|
|
3187
3149
|
};
|
|
3188
3150
|
const add = (value, long, short, valueString) => {
|
|
3189
3151
|
if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
|
|
@@ -3220,14 +3182,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3220
3182
|
} else {
|
|
3221
3183
|
const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
3222
3184
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
3223
|
-
const
|
|
3224
|
-
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
3185
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
3225
3186
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
3226
3187
|
}
|
|
3227
3188
|
} else {
|
|
3228
|
-
const
|
|
3229
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
3230
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
3189
|
+
const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
|
|
3231
3190
|
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
3232
3191
|
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
3233
3192
|
}
|
|
@@ -3256,10 +3215,9 @@ const logResult = (result, verboseInfo) => {
|
|
|
3256
3215
|
logDuration(result, verboseInfo);
|
|
3257
3216
|
};
|
|
3258
3217
|
const logDuration = (result, verboseInfo) => {
|
|
3259
|
-
const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
|
|
3260
3218
|
verboseLog({
|
|
3261
3219
|
type: "duration",
|
|
3262
|
-
verboseMessage
|
|
3220
|
+
verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
|
|
3263
3221
|
verboseInfo,
|
|
3264
3222
|
result
|
|
3265
3223
|
});
|
|
@@ -3386,18 +3344,16 @@ const TYPE_TO_MESSAGE = {
|
|
|
3386
3344
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
3387
3345
|
const getOutputObjectModes = (objectMode, index, newTransforms) => {
|
|
3388
3346
|
const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
|
|
3389
|
-
const readableObjectMode = objectMode ?? writableObjectMode;
|
|
3390
3347
|
return {
|
|
3391
3348
|
writableObjectMode,
|
|
3392
|
-
readableObjectMode
|
|
3349
|
+
readableObjectMode: objectMode ?? writableObjectMode
|
|
3393
3350
|
};
|
|
3394
3351
|
};
|
|
3395
3352
|
const getInputObjectModes = (objectMode, index, newTransforms) => {
|
|
3396
3353
|
const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
|
|
3397
|
-
const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
|
|
3398
3354
|
return {
|
|
3399
3355
|
writableObjectMode,
|
|
3400
|
-
readableObjectMode
|
|
3356
|
+
readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
|
|
3401
3357
|
};
|
|
3402
3358
|
};
|
|
3403
3359
|
const getFdObjectMode = (stdioItems, direction) => {
|
|
@@ -3706,8 +3662,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
|
|
|
3706
3662
|
const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
|
|
3707
3663
|
const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
|
|
3708
3664
|
if (duplicateStdioItems.length === 0) return;
|
|
3709
|
-
|
|
3710
|
-
throwOnDuplicateStream(differentStdioItem, optionName, type);
|
|
3665
|
+
throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
|
|
3711
3666
|
return direction === "output" ? duplicateStdioItems[0].stream : void 0;
|
|
3712
3667
|
};
|
|
3713
3668
|
const hasSameValue = ({ type, value }, secondValue) => {
|
|
@@ -3716,8 +3671,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
|
|
|
3716
3671
|
return value === secondValue;
|
|
3717
3672
|
};
|
|
3718
3673
|
const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
|
|
3719
|
-
|
|
3720
|
-
throwOnDuplicateStream(duplicateStdioItem, optionName, type);
|
|
3674
|
+
throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
|
|
3721
3675
|
};
|
|
3722
3676
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
3723
3677
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
@@ -3726,15 +3680,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
|
3726
3680
|
//#endregion
|
|
3727
3681
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
3728
3682
|
const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
3729
|
-
const stdio = normalizeStdioOption(options, verboseInfo, isSync);
|
|
3730
|
-
const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
|
|
3731
|
-
stdioOption,
|
|
3732
|
-
fdNumber,
|
|
3733
|
-
options,
|
|
3734
|
-
isSync
|
|
3735
|
-
}));
|
|
3736
3683
|
const fileDescriptors = getFinalFileDescriptors({
|
|
3737
|
-
initialFileDescriptors,
|
|
3684
|
+
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
3685
|
+
stdioOption,
|
|
3686
|
+
fdNumber,
|
|
3687
|
+
options,
|
|
3688
|
+
isSync
|
|
3689
|
+
})),
|
|
3738
3690
|
addProperties: addProperties$2,
|
|
3739
3691
|
options,
|
|
3740
3692
|
isSync
|
|
@@ -3751,14 +3703,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
3751
3703
|
optionName
|
|
3752
3704
|
});
|
|
3753
3705
|
const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
|
|
3754
|
-
const
|
|
3706
|
+
const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
|
|
3755
3707
|
stdioItem,
|
|
3756
3708
|
isStdioArray,
|
|
3757
3709
|
fdNumber,
|
|
3758
3710
|
direction,
|
|
3759
3711
|
isSync
|
|
3760
|
-
}));
|
|
3761
|
-
const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
|
|
3712
|
+
})), optionName, direction, options);
|
|
3762
3713
|
const objectMode = getFdObjectMode(normalizedStdioItems, direction);
|
|
3763
3714
|
validateFileObjectMode(normalizedStdioItems, objectMode);
|
|
3764
3715
|
return {
|
|
@@ -3768,9 +3719,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
3768
3719
|
};
|
|
3769
3720
|
};
|
|
3770
3721
|
const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
|
|
3771
|
-
const
|
|
3772
|
-
const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
|
|
3773
|
-
const stdioItems = filterDuplicates(initialStdioItems);
|
|
3722
|
+
const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
|
|
3774
3723
|
const isStdioArray = stdioItems.length > 1;
|
|
3775
3724
|
validateStdioArray(stdioItems, isStdioArray, optionName);
|
|
3776
3725
|
validateStreams(stdioItems);
|
|
@@ -3820,18 +3769,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
3820
3769
|
}
|
|
3821
3770
|
};
|
|
3822
3771
|
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
|
|
3823
|
-
const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
|
|
3824
|
-
stdioItem,
|
|
3825
|
-
addProperties: addProperties$2,
|
|
3826
|
-
direction,
|
|
3827
|
-
options,
|
|
3828
|
-
fileDescriptors,
|
|
3829
|
-
isSync
|
|
3830
|
-
}));
|
|
3831
3772
|
return {
|
|
3832
3773
|
direction,
|
|
3833
3774
|
objectMode,
|
|
3834
|
-
stdioItems:
|
|
3775
|
+
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
3776
|
+
stdioItem,
|
|
3777
|
+
addProperties: addProperties$2,
|
|
3778
|
+
direction,
|
|
3779
|
+
options,
|
|
3780
|
+
fileDescriptors,
|
|
3781
|
+
isSync
|
|
3782
|
+
}))
|
|
3835
3783
|
};
|
|
3836
3784
|
};
|
|
3837
3785
|
const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
|
|
@@ -3961,8 +3909,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
|
3961
3909
|
yield chunk;
|
|
3962
3910
|
return;
|
|
3963
3911
|
}
|
|
3964
|
-
|
|
3965
|
-
yield concatBytes(chunk, newline);
|
|
3912
|
+
yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
|
|
3966
3913
|
};
|
|
3967
3914
|
const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
|
|
3968
3915
|
const linesStringInfo = {
|
|
@@ -4107,7 +4054,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
4107
4054
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
4108
4055
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
4109
4056
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
4110
|
-
|
|
4057
|
+
return { stream: new Transform({
|
|
4111
4058
|
writableObjectMode,
|
|
4112
4059
|
writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
|
|
4113
4060
|
readableObjectMode,
|
|
@@ -4123,16 +4070,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
4123
4070
|
finalMethod([generators], this, done);
|
|
4124
4071
|
},
|
|
4125
4072
|
destroy: destroyMethod
|
|
4126
|
-
});
|
|
4127
|
-
return { stream };
|
|
4073
|
+
}) };
|
|
4128
4074
|
};
|
|
4129
4075
|
const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
|
|
4130
4076
|
const generators = stdioItems.filter(({ type }) => type === "generator");
|
|
4131
4077
|
const reversedGenerators = isInput ? generators.reverse() : generators;
|
|
4132
|
-
for (const { value, optionName } of reversedGenerators)
|
|
4133
|
-
const generators$1 = addInternalGenerators(value, encoding, optionName);
|
|
4134
|
-
chunks = runTransformSync(generators$1, chunks);
|
|
4135
|
-
}
|
|
4078
|
+
for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
|
|
4136
4079
|
return chunks;
|
|
4137
4080
|
};
|
|
4138
4081
|
const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
|
|
@@ -4169,9 +4112,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
|
|
|
4169
4112
|
const [{ type, optionName }] = allStdioItems;
|
|
4170
4113
|
throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
|
|
4171
4114
|
}
|
|
4172
|
-
|
|
4173
|
-
const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
|
|
4174
|
-
options.input = joinToUint8Array(transformedContents);
|
|
4115
|
+
options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
|
|
4175
4116
|
};
|
|
4176
4117
|
const applySingleInputGeneratorsSync = (contents, stdioItems) => {
|
|
4177
4118
|
const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
|
|
@@ -4196,10 +4137,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
|
|
|
4196
4137
|
};
|
|
4197
4138
|
const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
|
|
4198
4139
|
const logLine = (line, fdNumber, verboseInfo) => {
|
|
4199
|
-
const verboseMessage = serializeVerboseMessage(line);
|
|
4200
4140
|
verboseLog({
|
|
4201
4141
|
type: "output",
|
|
4202
|
-
verboseMessage,
|
|
4142
|
+
verboseMessage: serializeVerboseMessage(line),
|
|
4203
4143
|
fdNumber,
|
|
4204
4144
|
verboseInfo
|
|
4205
4145
|
});
|
|
@@ -4211,28 +4151,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
4211
4151
|
if (output === null) return { output: Array.from({ length: 3 }) };
|
|
4212
4152
|
const state = {};
|
|
4213
4153
|
const outputFiles = /* @__PURE__ */ new Set([]);
|
|
4214
|
-
const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
|
|
4215
|
-
result,
|
|
4216
|
-
fileDescriptors,
|
|
4217
|
-
fdNumber,
|
|
4218
|
-
state,
|
|
4219
|
-
outputFiles,
|
|
4220
|
-
isMaxBuffer,
|
|
4221
|
-
verboseInfo
|
|
4222
|
-
}, options));
|
|
4223
4154
|
return {
|
|
4224
|
-
output:
|
|
4155
|
+
output: output.map((result, fdNumber) => transformOutputResultSync({
|
|
4156
|
+
result,
|
|
4157
|
+
fileDescriptors,
|
|
4158
|
+
fdNumber,
|
|
4159
|
+
state,
|
|
4160
|
+
outputFiles,
|
|
4161
|
+
isMaxBuffer,
|
|
4162
|
+
verboseInfo
|
|
4163
|
+
}, options)),
|
|
4225
4164
|
...state
|
|
4226
4165
|
};
|
|
4227
4166
|
};
|
|
4228
4167
|
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
|
|
4229
4168
|
if (result === null) return;
|
|
4230
|
-
const
|
|
4231
|
-
const uint8ArrayResult = bufferToUint8Array(truncatedResult);
|
|
4169
|
+
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
4232
4170
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
4233
|
-
const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
|
|
4234
4171
|
const { serializedResult, finalResult = serializedResult } = serializeChunks({
|
|
4235
|
-
chunks,
|
|
4172
|
+
chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
|
|
4236
4173
|
objectMode,
|
|
4237
4174
|
encoding,
|
|
4238
4175
|
lines,
|
|
@@ -4343,14 +4280,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
|
4343
4280
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
4344
4281
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
4345
4282
|
const resultError = getResultError(error, exitCode, signal);
|
|
4346
|
-
const timedOut = resultError?.code === "ETIMEDOUT";
|
|
4347
|
-
const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
|
|
4348
4283
|
return {
|
|
4349
4284
|
resultError,
|
|
4350
4285
|
exitCode,
|
|
4351
4286
|
signal,
|
|
4352
|
-
timedOut,
|
|
4353
|
-
isMaxBuffer
|
|
4287
|
+
timedOut: resultError?.code === "ETIMEDOUT",
|
|
4288
|
+
isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
|
|
4354
4289
|
};
|
|
4355
4290
|
};
|
|
4356
4291
|
const getResultError = (error, exitCode, signal) => {
|
|
@@ -4362,7 +4297,7 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
4362
4297
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
4363
4298
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
4364
4299
|
const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
|
|
4365
|
-
|
|
4300
|
+
return handleResult(spawnSubprocessSync({
|
|
4366
4301
|
file,
|
|
4367
4302
|
commandArguments,
|
|
4368
4303
|
options,
|
|
@@ -4371,15 +4306,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
|
4371
4306
|
verboseInfo,
|
|
4372
4307
|
fileDescriptors,
|
|
4373
4308
|
startTime
|
|
4374
|
-
});
|
|
4375
|
-
return handleResult(result, verboseInfo, options);
|
|
4309
|
+
}), verboseInfo, options);
|
|
4376
4310
|
};
|
|
4377
4311
|
const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
4378
4312
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
4379
|
-
const
|
|
4380
|
-
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
|
|
4313
|
+
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
|
|
4381
4314
|
validateSyncOptions(options);
|
|
4382
|
-
const fileDescriptors = handleStdioSync(options, verboseInfo);
|
|
4383
4315
|
return {
|
|
4384
4316
|
file,
|
|
4385
4317
|
commandArguments,
|
|
@@ -4388,7 +4320,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
4388
4320
|
startTime,
|
|
4389
4321
|
verboseInfo,
|
|
4390
4322
|
options,
|
|
4391
|
-
fileDescriptors
|
|
4323
|
+
fileDescriptors: handleStdioSync(options, verboseInfo)
|
|
4392
4324
|
};
|
|
4393
4325
|
};
|
|
4394
4326
|
const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
|
|
@@ -4423,16 +4355,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
4423
4355
|
isMaxBuffer,
|
|
4424
4356
|
verboseInfo
|
|
4425
4357
|
});
|
|
4426
|
-
const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
|
|
4427
|
-
const all = stripNewline(getAllSync(output, options), options, "all");
|
|
4428
4358
|
return getSyncResult({
|
|
4429
4359
|
error,
|
|
4430
4360
|
exitCode,
|
|
4431
4361
|
signal,
|
|
4432
4362
|
timedOut,
|
|
4433
4363
|
isMaxBuffer,
|
|
4434
|
-
stdio,
|
|
4435
|
-
all,
|
|
4364
|
+
stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
|
|
4365
|
+
all: stripNewline(getAllSync(output, options), options, "all"),
|
|
4436
4366
|
options,
|
|
4437
4367
|
command,
|
|
4438
4368
|
escapedCommand,
|
|
@@ -4442,8 +4372,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
4442
4372
|
const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
|
|
4443
4373
|
try {
|
|
4444
4374
|
addInputOptionsSync(fileDescriptors, options);
|
|
4445
|
-
|
|
4446
|
-
return spawnSync(file, commandArguments, normalizedOptions);
|
|
4375
|
+
return spawnSync(file, commandArguments, normalizeSpawnSyncOptions(options));
|
|
4447
4376
|
} catch (error) {
|
|
4448
4377
|
return makeEarlyError({
|
|
4449
4378
|
error,
|
|
@@ -4661,19 +4590,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
4661
4590
|
writable,
|
|
4662
4591
|
duplex
|
|
4663
4592
|
});
|
|
4664
|
-
const earlyError = makeEarlyError({
|
|
4665
|
-
error,
|
|
4666
|
-
command,
|
|
4667
|
-
escapedCommand,
|
|
4668
|
-
fileDescriptors,
|
|
4669
|
-
options,
|
|
4670
|
-
startTime,
|
|
4671
|
-
isSync: false
|
|
4672
|
-
});
|
|
4673
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
4674
4593
|
return {
|
|
4675
4594
|
subprocess,
|
|
4676
|
-
promise
|
|
4595
|
+
promise: handleDummyPromise(makeEarlyError({
|
|
4596
|
+
error,
|
|
4597
|
+
command,
|
|
4598
|
+
escapedCommand,
|
|
4599
|
+
fileDescriptors,
|
|
4600
|
+
options,
|
|
4601
|
+
startTime,
|
|
4602
|
+
isSync: false
|
|
4603
|
+
}), verboseInfo, options)
|
|
4677
4604
|
};
|
|
4678
4605
|
};
|
|
4679
4606
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
@@ -4722,8 +4649,7 @@ const addProperties = {
|
|
|
4722
4649
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
4723
4650
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
4724
4651
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
4725
|
-
|
|
4726
|
-
return { stream };
|
|
4652
|
+
return { stream: Duplex.fromWeb(transform, { objectMode }) };
|
|
4727
4653
|
},
|
|
4728
4654
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
4729
4655
|
native() {}
|
|
@@ -4969,10 +4895,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
|
4969
4895
|
controller
|
|
4970
4896
|
});
|
|
4971
4897
|
}
|
|
4972
|
-
for (const [outputStream, inputStreams] of pipeGroups.entries())
|
|
4973
|
-
const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
|
|
4974
|
-
pipeStreams(inputStream, outputStream);
|
|
4975
|
-
}
|
|
4898
|
+
for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
|
|
4976
4899
|
};
|
|
4977
4900
|
const pipeTransform = (subprocess, stream, direction, fdNumber) => {
|
|
4978
4901
|
if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
|
|
@@ -5234,10 +5157,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
|
|
|
5234
5157
|
const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
5235
5158
|
try {
|
|
5236
5159
|
const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
|
|
5237
|
-
const destinationStream = getToStream(destination, to);
|
|
5238
5160
|
return {
|
|
5239
5161
|
destination,
|
|
5240
|
-
destinationStream,
|
|
5162
|
+
destinationStream: getToStream(destination, to),
|
|
5241
5163
|
from,
|
|
5242
5164
|
unpipeSignal
|
|
5243
5165
|
};
|
|
@@ -5246,19 +5168,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
|
5246
5168
|
}
|
|
5247
5169
|
};
|
|
5248
5170
|
const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
|
|
5249
|
-
if (Array.isArray(firstArgument)) {
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
pipeOptions: boundOptions
|
|
5254
|
-
};
|
|
5255
|
-
}
|
|
5171
|
+
if (Array.isArray(firstArgument)) return {
|
|
5172
|
+
destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
|
|
5173
|
+
pipeOptions: boundOptions
|
|
5174
|
+
};
|
|
5256
5175
|
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
5257
5176
|
if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
|
|
5258
5177
|
const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
|
|
5259
|
-
const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
|
|
5260
5178
|
return {
|
|
5261
|
-
destination,
|
|
5179
|
+
destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
|
|
5262
5180
|
pipeOptions: rawOptions
|
|
5263
5181
|
};
|
|
5264
5182
|
}
|
|
@@ -5278,8 +5196,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
|
|
|
5278
5196
|
} });
|
|
5279
5197
|
const getSourceStream = (source, from) => {
|
|
5280
5198
|
try {
|
|
5281
|
-
|
|
5282
|
-
return { sourceStream };
|
|
5199
|
+
return { sourceStream: getFromStream(source, from) };
|
|
5283
5200
|
} catch (error) {
|
|
5284
5201
|
return { sourceError: error };
|
|
5285
5202
|
}
|
|
@@ -5373,9 +5290,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
|
|
|
5373
5290
|
const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
5374
5291
|
await aborted(unpipeSignal, sourceStream);
|
|
5375
5292
|
await mergedStream.remove(sourceStream);
|
|
5376
|
-
const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
|
|
5377
5293
|
throw createNonCommandError({
|
|
5378
|
-
error,
|
|
5294
|
+
error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
|
|
5379
5295
|
fileDescriptors,
|
|
5380
5296
|
sourceOptions,
|
|
5381
5297
|
startTime
|
|
@@ -5478,13 +5394,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
5478
5394
|
}
|
|
5479
5395
|
};
|
|
5480
5396
|
const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
5481
|
-
const onStdoutChunk = on(stream, "data", {
|
|
5482
|
-
signal: controller.signal,
|
|
5483
|
-
highWaterMark: HIGH_WATER_MARK,
|
|
5484
|
-
highWatermark: HIGH_WATER_MARK
|
|
5485
|
-
});
|
|
5486
5397
|
return iterateOnData({
|
|
5487
|
-
onStdoutChunk,
|
|
5398
|
+
onStdoutChunk: on(stream, "data", {
|
|
5399
|
+
signal: controller.signal,
|
|
5400
|
+
highWaterMark: HIGH_WATER_MARK,
|
|
5401
|
+
highWatermark: HIGH_WATER_MARK
|
|
5402
|
+
}),
|
|
5488
5403
|
controller,
|
|
5489
5404
|
binary,
|
|
5490
5405
|
shouldEncode,
|
|
@@ -5529,13 +5444,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
5529
5444
|
await Promise.all([resumeStream(stream), logPromise]);
|
|
5530
5445
|
return;
|
|
5531
5446
|
}
|
|
5532
|
-
const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
|
|
5533
5447
|
const iterable = iterateForResult({
|
|
5534
5448
|
stream,
|
|
5535
5449
|
onStreamEnd,
|
|
5536
5450
|
lines,
|
|
5537
5451
|
encoding,
|
|
5538
|
-
stripFinalNewline:
|
|
5452
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
|
|
5539
5453
|
allMixed
|
|
5540
5454
|
});
|
|
5541
5455
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -5555,15 +5469,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
|
|
|
5555
5469
|
verboseInfo,
|
|
5556
5470
|
fdNumber
|
|
5557
5471
|
})) return;
|
|
5558
|
-
|
|
5472
|
+
await logLines(iterateForResult({
|
|
5559
5473
|
stream,
|
|
5560
5474
|
onStreamEnd,
|
|
5561
5475
|
lines: true,
|
|
5562
5476
|
encoding,
|
|
5563
5477
|
stripFinalNewline: true,
|
|
5564
5478
|
allMixed
|
|
5565
|
-
});
|
|
5566
|
-
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
5479
|
+
}), stream, fdNumber, verboseInfo);
|
|
5567
5480
|
};
|
|
5568
5481
|
const resumeStream = async (stream) => {
|
|
5569
5482
|
await setImmediate();
|
|
@@ -5713,10 +5626,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
|
|
|
5713
5626
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
5714
5627
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
5715
5628
|
const logIpcOutput = (message, verboseInfo) => {
|
|
5716
|
-
const verboseMessage = serializeVerboseMessage(message);
|
|
5717
5629
|
verboseLog({
|
|
5718
5630
|
type: "ipc",
|
|
5719
|
-
verboseMessage,
|
|
5631
|
+
verboseMessage: serializeVerboseMessage(message),
|
|
5720
5632
|
fdNumber: "ipc",
|
|
5721
5633
|
verboseInfo
|
|
5722
5634
|
});
|
|
@@ -5859,9 +5771,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
5859
5771
|
const promises = weakMap.get(stream);
|
|
5860
5772
|
const promise = createDeferred();
|
|
5861
5773
|
promises.push(promise);
|
|
5862
|
-
const resolve = promise.resolve.bind(promise);
|
|
5863
5774
|
return {
|
|
5864
|
-
resolve,
|
|
5775
|
+
resolve: promise.resolve.bind(promise),
|
|
5865
5776
|
promises
|
|
5866
5777
|
};
|
|
5867
5778
|
};
|
|
@@ -5942,10 +5853,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
5942
5853
|
};
|
|
5943
5854
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
5944
5855
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
5945
|
-
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
|
|
5946
5856
|
return {
|
|
5947
5857
|
subprocessStdout,
|
|
5948
|
-
waitReadableDestroy
|
|
5858
|
+
waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
|
|
5949
5859
|
};
|
|
5950
5860
|
};
|
|
5951
5861
|
const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
|
|
@@ -6023,12 +5933,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
6023
5933
|
};
|
|
6024
5934
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
6025
5935
|
const subprocessStdin = getToStream(subprocess, to);
|
|
6026
|
-
const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
|
|
6027
|
-
const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
|
|
6028
5936
|
return {
|
|
6029
5937
|
subprocessStdin,
|
|
6030
|
-
waitWritableFinal,
|
|
6031
|
-
waitWritableDestroy
|
|
5938
|
+
waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
|
|
5939
|
+
waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
|
|
6032
5940
|
};
|
|
6033
5941
|
};
|
|
6034
5942
|
const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
@@ -6124,15 +6032,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
6124
6032
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
6125
6033
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
6126
6034
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
6127
|
-
|
|
6035
|
+
return iterateOnStdoutData(iterateOnSubprocessStream({
|
|
6128
6036
|
subprocessStdout,
|
|
6129
6037
|
subprocess,
|
|
6130
6038
|
binary,
|
|
6131
6039
|
shouldEncode: true,
|
|
6132
6040
|
encoding,
|
|
6133
6041
|
preserveNewlines
|
|
6134
|
-
});
|
|
6135
|
-
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
6042
|
+
}), subprocessStdout, subprocess);
|
|
6136
6043
|
};
|
|
6137
6044
|
const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
|
|
6138
6045
|
try {
|
|
@@ -6214,7 +6121,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
6214
6121
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
6215
6122
|
const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
|
|
6216
6123
|
const options = handleAsyncOptions(normalizedOptions);
|
|
6217
|
-
const fileDescriptors = handleStdioAsync(options, verboseInfo);
|
|
6218
6124
|
return {
|
|
6219
6125
|
file,
|
|
6220
6126
|
commandArguments,
|
|
@@ -6223,7 +6129,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
6223
6129
|
startTime,
|
|
6224
6130
|
verboseInfo,
|
|
6225
6131
|
options,
|
|
6226
|
-
fileDescriptors
|
|
6132
|
+
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
6227
6133
|
};
|
|
6228
6134
|
};
|
|
6229
6135
|
const handleAsyncOptions = ({ timeout, signal,...options }) => {
|
|
@@ -6296,22 +6202,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
|
|
|
6296
6202
|
});
|
|
6297
6203
|
controller.abort();
|
|
6298
6204
|
onInternalError.resolve();
|
|
6299
|
-
|
|
6300
|
-
const all = stripNewline(allResult, options, "all");
|
|
6301
|
-
const result = getAsyncResult({
|
|
6205
|
+
return handleResult(getAsyncResult({
|
|
6302
6206
|
errorInfo,
|
|
6303
6207
|
exitCode,
|
|
6304
6208
|
signal,
|
|
6305
|
-
stdio,
|
|
6306
|
-
all,
|
|
6209
|
+
stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
|
|
6210
|
+
all: stripNewline(allResult, options, "all"),
|
|
6307
6211
|
ipcOutput,
|
|
6308
6212
|
context,
|
|
6309
6213
|
options,
|
|
6310
6214
|
command,
|
|
6311
6215
|
escapedCommand,
|
|
6312
6216
|
startTime
|
|
6313
|
-
});
|
|
6314
|
-
return handleResult(result, verboseInfo, options);
|
|
6217
|
+
}), verboseInfo, options);
|
|
6315
6218
|
};
|
|
6316
6219
|
const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
|
|
6317
6220
|
error: errorInfo.error,
|
|
@@ -6384,8 +6287,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
|
|
|
6384
6287
|
return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
|
|
6385
6288
|
};
|
|
6386
6289
|
const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
|
|
6387
|
-
const
|
|
6388
|
-
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
|
|
6290
|
+
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
|
|
6389
6291
|
const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
|
|
6390
6292
|
const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
|
|
6391
6293
|
file: initialFile,
|
|
@@ -6522,7 +6424,7 @@ const runExpoPrebuild = async ({ platform: platform$1 }) => {
|
|
|
6522
6424
|
//#region src/expo.ts
|
|
6523
6425
|
const isHermesEnabled = (cwd, platform$1) => {
|
|
6524
6426
|
try {
|
|
6525
|
-
const appJsonPath = path.join(cwd, "app.json");
|
|
6427
|
+
const appJsonPath = path$1.join(cwd, "app.json");
|
|
6526
6428
|
const { expo: expo$1 } = JSON.parse(fs.readFileSync(appJsonPath, "utf-8"));
|
|
6527
6429
|
const platformJsEngine = expo$1?.[platform$1]?.jsEngine;
|
|
6528
6430
|
const commonJsEngine = expo$1?.jsEngine;
|
|
@@ -6533,15 +6435,14 @@ const isHermesEnabled = (cwd, platform$1) => {
|
|
|
6533
6435
|
};
|
|
6534
6436
|
const runBundle = async ({ cwd, platform: platform$1, buildPath, sourcemap }) => {
|
|
6535
6437
|
const filename = `index.${platform$1}`;
|
|
6536
|
-
const bundleOutput = path.join(buildPath, `${filename}.bundle`);
|
|
6537
|
-
const entryFile = resolveMain(cwd);
|
|
6438
|
+
const bundleOutput = path$1.join(buildPath, `${filename}.bundle`);
|
|
6538
6439
|
const args = [
|
|
6539
6440
|
"expo",
|
|
6540
6441
|
"export:embed",
|
|
6541
6442
|
"--platform",
|
|
6542
6443
|
platform$1,
|
|
6543
6444
|
"--entry-file",
|
|
6544
|
-
|
|
6445
|
+
resolveMain(cwd),
|
|
6545
6446
|
"--bundle-output",
|
|
6546
6447
|
bundleOutput,
|
|
6547
6448
|
"--dev",
|
|
@@ -6554,19 +6455,18 @@ const runBundle = async ({ cwd, platform: platform$1, buildPath, sourcemap }) =>
|
|
|
6554
6455
|
log.normal("\n");
|
|
6555
6456
|
let stdout = null;
|
|
6556
6457
|
try {
|
|
6557
|
-
|
|
6458
|
+
stdout = (await execa("npx", args, {
|
|
6558
6459
|
cwd,
|
|
6559
6460
|
env: {
|
|
6560
6461
|
...process.env,
|
|
6561
6462
|
BUILD_OUT_DIR: buildPath
|
|
6562
6463
|
},
|
|
6563
6464
|
reject: true
|
|
6564
|
-
});
|
|
6565
|
-
stdout = result.stdout;
|
|
6465
|
+
})).stdout;
|
|
6566
6466
|
} catch (error) {
|
|
6567
6467
|
if (error instanceof ExecaError) throw error.stderr;
|
|
6568
6468
|
}
|
|
6569
|
-
const bundleId = await fs.promises.readFile(path.join(buildPath, "BUNDLE_ID"), "utf-8").catch(() => null);
|
|
6469
|
+
const bundleId = await fs.promises.readFile(path$1.join(buildPath, "BUNDLE_ID"), "utf-8").catch(() => null);
|
|
6570
6470
|
if (!bundleId) throw new Error(`If you are using Babel, please check if 'hot-updater/babel-plugin' is configured in babel.config.js
|
|
6571
6471
|
Example:
|
|
6572
6472
|
module.exports = {
|
|
@@ -6575,8 +6475,7 @@ module.exports = {
|
|
|
6575
6475
|
]
|
|
6576
6476
|
}
|
|
6577
6477
|
`);
|
|
6578
|
-
|
|
6579
|
-
if (enableHermes) {
|
|
6478
|
+
if (isHermesEnabled(cwd, platform$1)) {
|
|
6580
6479
|
const { hermesVersion } = await compileHermes({
|
|
6581
6480
|
cwd,
|
|
6582
6481
|
inputJsFile: bundleOutput,
|
|
@@ -6602,7 +6501,7 @@ const expo = (config = {
|
|
|
6602
6501
|
await runExpoPrebuild({ platform: platform$1 });
|
|
6603
6502
|
} },
|
|
6604
6503
|
build: async ({ platform: platform$1 }) => {
|
|
6605
|
-
const buildPath = path.join(cwd, outDir);
|
|
6504
|
+
const buildPath = path$1.join(cwd, outDir);
|
|
6606
6505
|
await fs.promises.rm(buildPath, {
|
|
6607
6506
|
recursive: true,
|
|
6608
6507
|
force: true
|