@hot-updater/rock 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.
Files changed (3) hide show
  1. package/dist/index.cjs +139 -238
  2. package/dist/index.js +153 -252
  3. 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 node_timers_promises = require("node:timers/promises");
46
46
  node_timers_promises = __toESM(node_timers_promises);
47
47
  let node_os = require("node:os");
@@ -108,8 +108,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
108
108
  const textDecoder = new TextDecoder();
109
109
  const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
110
110
  const joinToString = (uint8ArraysOrStrings, encoding) => {
111
- const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);
112
- return strings.join("");
111
+ return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
113
112
  };
114
113
  const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
115
114
  if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
@@ -164,8 +163,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
164
163
  const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
165
164
  if (index === expressions.length) return newTokens;
166
165
  const expression = expressions[index];
167
- const expressionTokens = Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)];
168
- return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
166
+ return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
169
167
  };
170
168
  const splitByWhitespaces = (template, rawTemplate) => {
171
169
  if (rawTemplate.length === 0) return {
@@ -252,8 +250,7 @@ const normalizeFdSpecificOptions = (options) => {
252
250
  };
253
251
  const normalizeFdSpecificOption = (options, optionName) => {
254
252
  const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
255
- const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
256
- return addDefaultValue$1(optionArray, optionName);
253
+ return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
257
254
  };
258
255
  const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
259
256
  const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
@@ -283,12 +280,11 @@ const parseFd = (fdName) => {
283
280
  };
284
281
  const FD_REGEXP = /^fd(\d+)$/;
285
282
  const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
286
- const verboseDefault = (0, node_util.debuglog)("execa").enabled ? "full" : "none";
287
283
  const DEFAULT_OPTIONS = {
288
284
  lines: false,
289
285
  buffer: true,
290
286
  maxBuffer: 1e3 * 1e3 * 100,
291
- verbose: verboseDefault,
287
+ verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
292
288
  stripFinalNewline: true
293
289
  };
294
290
  const FD_SPECIFIC_OPTIONS = [
@@ -321,11 +317,9 @@ const VERBOSE_VALUES = [
321
317
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
322
318
  const joinCommand = (filePath, rawArguments) => {
323
319
  const fileAndArguments = [filePath, ...rawArguments];
324
- const command = fileAndArguments.join(" ");
325
- const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
326
320
  return {
327
- command,
328
- escapedCommand
321
+ command: fileAndArguments.join(" "),
322
+ escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
329
323
  };
330
324
  };
331
325
  const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
@@ -766,13 +760,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
766
760
  //#endregion
767
761
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
768
762
  const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
769
- const verboseObject = getVerboseObject({
763
+ const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
770
764
  type,
771
765
  result,
772
766
  verboseInfo
773
- });
774
- const printedLines = getPrintedLines(verboseMessage, verboseObject);
775
- const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
767
+ })), verboseInfo, fdNumber);
776
768
  if (finalLines !== "") console.warn(finalLines.slice(0, -1));
777
769
  };
778
770
  const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
@@ -789,16 +781,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
789
781
  message
790
782
  }));
791
783
  const getPrintedLine = (verboseObject) => {
792
- const verboseLine = defaultVerboseFunction(verboseObject);
793
784
  return {
794
- verboseLine,
785
+ verboseLine: defaultVerboseFunction(verboseObject),
795
786
  verboseObject
796
787
  };
797
788
  };
798
789
  const serializeVerboseMessage = (message) => {
799
- const messageString = typeof message === "string" ? message : (0, node_util.inspect)(message);
800
- const escapedMessage = escapeLines(messageString);
801
- return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
790
+ return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
802
791
  };
803
792
  const TAB_SIZE = 2;
804
793
 
@@ -817,11 +806,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
817
806
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
818
807
  const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
819
808
  validateVerbose(verbose);
820
- const commandId = getCommandId(verbose);
821
809
  return {
822
810
  verbose,
823
811
  escapedCommand,
824
- commandId,
812
+ commandId: getCommandId(verbose),
825
813
  rawOptions
826
814
  };
827
815
  };
@@ -848,8 +836,7 @@ const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - start
848
836
  const handleCommand = (filePath, rawArguments, rawOptions) => {
849
837
  const startTime = getStartTime();
850
838
  const { command, escapedCommand } = joinCommand(filePath, rawArguments);
851
- const verbose = normalizeFdSpecificOption(rawOptions, "verbose");
852
- const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
839
+ const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
853
840
  logCommand(escapedCommand, verboseInfo);
854
841
  return {
855
842
  command,
@@ -917,8 +904,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
917
904
  var g = parseInt("010", 8);
918
905
  var o$1 = parseInt("001", 8);
919
906
  var ug = u$1 | g;
920
- var ret = mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
921
- return ret;
907
+ return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
922
908
  }
923
909
  }) });
924
910
 
@@ -1000,8 +986,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
1000
986
  const ppRaw = pathEnv[i$1];
1001
987
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
1002
988
  const pCmd = path$9.join(pathPart, cmd);
1003
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
1004
- resolve(subStep(p, i$1, 0));
989
+ resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
1005
990
  });
1006
991
  const subStep = (p, i$1, ii) => new Promise((resolve, reject) => {
1007
992
  if (ii === pathExt.length) return resolve(step(i$1 + 1));
@@ -1026,8 +1011,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
1026
1011
  for (let j = 0; j < pathExt.length; j++) {
1027
1012
  const cur = p + pathExt[j];
1028
1013
  try {
1029
- const is = isexe.sync(cur, { pathExt: pathExtExe });
1030
- if (is) if (opt.all) found.push(cur);
1014
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
1031
1015
  else return cur;
1032
1016
  } catch (ex) {}
1033
1017
  }
@@ -1045,8 +1029,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
1045
1029
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
1046
1030
  const pathKey$1 = (options = {}) => {
1047
1031
  const environment = options.env || process.env;
1048
- const platform$1 = options.platform || process.platform;
1049
- if (platform$1 !== "win32") return "PATH";
1032
+ if ((options.platform || process.platform) !== "win32") return "PATH";
1050
1033
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
1051
1034
  };
1052
1035
  module.exports = pathKey$1;
@@ -1174,12 +1157,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
1174
1157
  parsed.command = path$7.normalize(parsed.command);
1175
1158
  parsed.command = escape.command(parsed.command);
1176
1159
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1177
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1178
1160
  parsed.args = [
1179
1161
  "/d",
1180
1162
  "/s",
1181
1163
  "/c",
1182
- `"${shellCommand}"`
1164
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
1183
1165
  ];
1184
1166
  parsed.command = process.env.comspec || "cmd.exe";
1185
1167
  parsed.options.windowsVerbatimArguments = true;
@@ -1332,9 +1314,7 @@ const npmRunPathEnv = ({ env = node_process.default.env,...options } = {}) => {
1332
1314
  //#endregion
1333
1315
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
1334
1316
  const getFinalError = (originalError, message, isSync) => {
1335
- const ErrorClass = isSync ? ExecaSyncError : ExecaError;
1336
- const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
1337
- return new ErrorClass(message, options);
1317
+ return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
1338
1318
  };
1339
1319
  var DiscardedError = class extends Error {};
1340
1320
  const setErrorName = (ErrorClass, value) => {
@@ -1653,16 +1633,14 @@ const SIGNALS = [
1653
1633
  //#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
1654
1634
  const getSignals = () => {
1655
1635
  const realtimeSignals = getRealtimeSignals();
1656
- const signals$1 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
1657
- return signals$1;
1636
+ return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
1658
1637
  };
1659
1638
  const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
1660
1639
  const { signals: { [name]: constantSignal } } = node_os.constants;
1661
1640
  const supported = constantSignal !== void 0;
1662
- const number = supported ? constantSignal : defaultNumber;
1663
1641
  return {
1664
1642
  name,
1665
- number,
1643
+ number: supported ? constantSignal : defaultNumber,
1666
1644
  description,
1667
1645
  supported,
1668
1646
  action,
@@ -2074,8 +2052,7 @@ const isConnected = (anyProcess) => {
2074
2052
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
2075
2053
  const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
2076
2054
  if (!strict) return message;
2077
- const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);
2078
- const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
2055
+ const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
2079
2056
  return {
2080
2057
  id: count++,
2081
2058
  type: REQUEST_TYPE,
@@ -2148,11 +2125,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
2148
2125
  const startSendMessage = (anyProcess, wrappedMessage, strict) => {
2149
2126
  if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
2150
2127
  const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
2151
- const onMessageSent = createDeferred();
2152
- const id = strict ? wrappedMessage.id : void 0;
2153
2128
  const outgoingMessage = {
2154
- onMessageSent,
2155
- id
2129
+ onMessageSent: createDeferred(),
2130
+ id: strict ? wrappedMessage.id : void 0
2156
2131
  };
2157
2132
  outgoingMessages.add(outgoingMessage);
2158
2133
  return {
@@ -2313,8 +2288,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
2313
2288
  })] : [];
2314
2289
  const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
2315
2290
  await onAbortedSignal(cancelSignal, signal);
2316
- const reason = getReason(cancelSignal);
2317
- await sendAbort(subprocess, reason);
2291
+ await sendAbort(subprocess, getReason(cancelSignal));
2318
2292
  killOnTimeout({
2319
2293
  kill: subprocess.kill,
2320
2294
  forceKillAfterDelay,
@@ -2488,8 +2462,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
2488
2462
  rawOptions.cwd = normalizeCwd(rawOptions.cwd);
2489
2463
  const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
2490
2464
  const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
2491
- const fdOptions = normalizeFdSpecificOptions(initialOptions);
2492
- const options = addDefaultOptions(fdOptions);
2465
+ const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
2493
2466
  validateTimeout(options);
2494
2467
  validateEncoding(options);
2495
2468
  validateIpcInputOption(options);
@@ -2646,7 +2619,7 @@ const u = Object.create(a, {
2646
2619
  }
2647
2620
  });
2648
2621
  function h({ preventCancel: r = !1 } = {}) {
2649
- const e = this.getReader(), t = new c(e, r), s = Object.create(u);
2622
+ const t = new c(this.getReader(), r), s = Object.create(u);
2650
2623
  return s[n] = t, s;
2651
2624
  }
2652
2625
 
@@ -2695,18 +2668,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
2695
2668
  const state = init();
2696
2669
  state.length = 0;
2697
2670
  try {
2698
- for await (const chunk of asyncIterable) {
2699
- const chunkType = getChunkType(chunk);
2700
- const convertedChunk = convertChunk[chunkType](chunk, state);
2701
- appendChunk({
2702
- convertedChunk,
2703
- state,
2704
- getSize,
2705
- truncateChunk,
2706
- addChunk,
2707
- maxBuffer
2708
- });
2709
- }
2671
+ for await (const chunk of asyncIterable) appendChunk({
2672
+ convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
2673
+ state,
2674
+ getSize,
2675
+ truncateChunk,
2676
+ addChunk,
2677
+ maxBuffer
2678
+ });
2710
2679
  appendFinalChunk({
2711
2680
  state,
2712
2681
  convertChunk,
@@ -2896,10 +2865,9 @@ const stringMethods = {
2896
2865
  const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
2897
2866
  if (!(error instanceof MaxBufferError)) throw error;
2898
2867
  if (fdNumber === "all") return error;
2899
- const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
2900
2868
  error.maxBufferInfo = {
2901
2869
  fdNumber,
2902
- unit
2870
+ unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
2903
2871
  };
2904
2872
  stream.destroy();
2905
2873
  throw error;
@@ -2969,19 +2937,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
2969
2937
  killSignal
2970
2938
  });
2971
2939
  const originalMessage = getOriginalMessage(originalError, cwd);
2972
- const suffix = originalMessage === void 0 ? "" : `\n${originalMessage}`;
2973
- const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
2974
- const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
2975
- const message = [
2976
- shortMessage,
2977
- ...messageStdio,
2978
- ...stdio.slice(3),
2979
- ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
2980
- ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
2940
+ const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
2981
2941
  return {
2982
2942
  originalMessage,
2983
2943
  shortMessage,
2984
- message
2944
+ message: [
2945
+ shortMessage,
2946
+ ...all === void 0 ? [stdio[2], stdio[1]] : [all],
2947
+ ...stdio.slice(3),
2948
+ ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
2949
+ ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
2985
2950
  };
2986
2951
  };
2987
2952
  const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
@@ -3002,8 +2967,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
3002
2967
  const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
3003
2968
  const getOriginalMessage = (originalError, cwd) => {
3004
2969
  if (originalError instanceof DiscardedError) return;
3005
- const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError);
3006
- const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
2970
+ const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
3007
2971
  return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
3008
2972
  };
3009
2973
  const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, node_util.inspect)(ipcMessage);
@@ -3125,11 +3089,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
3125
3089
  const normalizeExitPayload = (rawExitCode, rawSignal) => {
3126
3090
  const exitCode = rawExitCode === null ? void 0 : rawExitCode;
3127
3091
  const signal = rawSignal === null ? void 0 : rawSignal;
3128
- const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
3129
3092
  return {
3130
3093
  exitCode,
3131
3094
  signal,
3132
- signalDescription
3095
+ signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
3133
3096
  };
3134
3097
  };
3135
3098
 
@@ -3194,8 +3157,7 @@ function prettyMilliseconds(milliseconds, options) {
3194
3157
  let result = [];
3195
3158
  const floorDecimals = (value, decimalDigits) => {
3196
3159
  const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
3197
- const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits;
3198
- return flooredValue.toFixed(decimalDigits);
3160
+ return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
3199
3161
  };
3200
3162
  const add = (value, long, short, valueString) => {
3201
3163
  if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
@@ -3232,14 +3194,11 @@ function prettyMilliseconds(milliseconds, options) {
3232
3194
  } else {
3233
3195
  const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
3234
3196
  const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
3235
- const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
3236
- const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
3197
+ const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
3237
3198
  add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
3238
3199
  }
3239
3200
  } else {
3240
- const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
3241
- const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
3242
- const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
3201
+ const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
3243
3202
  const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
3244
3203
  add(Number.parseFloat(secondsString), "second", "s", secondsString);
3245
3204
  }
@@ -3268,10 +3227,9 @@ const logResult = (result, verboseInfo) => {
3268
3227
  logDuration(result, verboseInfo);
3269
3228
  };
3270
3229
  const logDuration = (result, verboseInfo) => {
3271
- const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
3272
3230
  verboseLog({
3273
3231
  type: "duration",
3274
- verboseMessage,
3232
+ verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
3275
3233
  verboseInfo,
3276
3234
  result
3277
3235
  });
@@ -3398,18 +3356,16 @@ const TYPE_TO_MESSAGE = {
3398
3356
  const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
3399
3357
  const getOutputObjectModes = (objectMode, index, newTransforms) => {
3400
3358
  const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
3401
- const readableObjectMode = objectMode ?? writableObjectMode;
3402
3359
  return {
3403
3360
  writableObjectMode,
3404
- readableObjectMode
3361
+ readableObjectMode: objectMode ?? writableObjectMode
3405
3362
  };
3406
3363
  };
3407
3364
  const getInputObjectModes = (objectMode, index, newTransforms) => {
3408
3365
  const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
3409
- const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
3410
3366
  return {
3411
3367
  writableObjectMode,
3412
- readableObjectMode
3368
+ readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
3413
3369
  };
3414
3370
  };
3415
3371
  const getFdObjectMode = (stdioItems, direction) => {
@@ -3718,8 +3674,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
3718
3674
  const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
3719
3675
  const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
3720
3676
  if (duplicateStdioItems.length === 0) return;
3721
- const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction);
3722
- throwOnDuplicateStream(differentStdioItem, optionName, type);
3677
+ throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
3723
3678
  return direction === "output" ? duplicateStdioItems[0].stream : void 0;
3724
3679
  };
3725
3680
  const hasSameValue = ({ type, value }, secondValue) => {
@@ -3728,8 +3683,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
3728
3683
  return value === secondValue;
3729
3684
  };
3730
3685
  const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
3731
- const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform);
3732
- throwOnDuplicateStream(duplicateStdioItem, optionName, type);
3686
+ throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
3733
3687
  };
3734
3688
  const throwOnDuplicateStream = (stdioItem, optionName, type) => {
3735
3689
  if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
@@ -3738,15 +3692,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
3738
3692
  //#endregion
3739
3693
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
3740
3694
  const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
3741
- const stdio = normalizeStdioOption(options, verboseInfo, isSync);
3742
- const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
3743
- stdioOption,
3744
- fdNumber,
3745
- options,
3746
- isSync
3747
- }));
3748
3695
  const fileDescriptors = getFinalFileDescriptors({
3749
- initialFileDescriptors,
3696
+ initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
3697
+ stdioOption,
3698
+ fdNumber,
3699
+ options,
3700
+ isSync
3701
+ })),
3750
3702
  addProperties: addProperties$2,
3751
3703
  options,
3752
3704
  isSync
@@ -3763,14 +3715,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
3763
3715
  optionName
3764
3716
  });
3765
3717
  const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
3766
- const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({
3718
+ const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
3767
3719
  stdioItem,
3768
3720
  isStdioArray,
3769
3721
  fdNumber,
3770
3722
  direction,
3771
3723
  isSync
3772
- }));
3773
- const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
3724
+ })), optionName, direction, options);
3774
3725
  const objectMode = getFdObjectMode(normalizedStdioItems, direction);
3775
3726
  validateFileObjectMode(normalizedStdioItems, objectMode);
3776
3727
  return {
@@ -3780,9 +3731,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
3780
3731
  };
3781
3732
  };
3782
3733
  const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
3783
- const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];
3784
- const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
3785
- const stdioItems = filterDuplicates(initialStdioItems);
3734
+ const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
3786
3735
  const isStdioArray = stdioItems.length > 1;
3787
3736
  validateStdioArray(stdioItems, isStdioArray, optionName);
3788
3737
  validateStreams(stdioItems);
@@ -3832,18 +3781,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
3832
3781
  }
3833
3782
  };
3834
3783
  const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
3835
- const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
3836
- stdioItem,
3837
- addProperties: addProperties$2,
3838
- direction,
3839
- options,
3840
- fileDescriptors,
3841
- isSync
3842
- }));
3843
3784
  return {
3844
3785
  direction,
3845
3786
  objectMode,
3846
- stdioItems: finalStdioItems
3787
+ stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
3788
+ stdioItem,
3789
+ addProperties: addProperties$2,
3790
+ direction,
3791
+ options,
3792
+ fileDescriptors,
3793
+ isSync
3794
+ }))
3847
3795
  };
3848
3796
  };
3849
3797
  const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
@@ -3973,8 +3921,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
3973
3921
  yield chunk;
3974
3922
  return;
3975
3923
  }
3976
- const newline = isWindowsNewline ? windowsNewline : unixNewline;
3977
- yield concatBytes(chunk, newline);
3924
+ yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
3978
3925
  };
3979
3926
  const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
3980
3927
  const linesStringInfo = {
@@ -4119,7 +4066,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
4119
4066
  const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
4120
4067
  const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
4121
4068
  const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
4122
- const stream = new node_stream.Transform({
4069
+ return { stream: new node_stream.Transform({
4123
4070
  writableObjectMode,
4124
4071
  writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
4125
4072
  readableObjectMode,
@@ -4135,16 +4082,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
4135
4082
  finalMethod([generators], this, done);
4136
4083
  },
4137
4084
  destroy: destroyMethod
4138
- });
4139
- return { stream };
4085
+ }) };
4140
4086
  };
4141
4087
  const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
4142
4088
  const generators = stdioItems.filter(({ type }) => type === "generator");
4143
4089
  const reversedGenerators = isInput ? generators.reverse() : generators;
4144
- for (const { value, optionName } of reversedGenerators) {
4145
- const generators$1 = addInternalGenerators(value, encoding, optionName);
4146
- chunks = runTransformSync(generators$1, chunks);
4147
- }
4090
+ for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
4148
4091
  return chunks;
4149
4092
  };
4150
4093
  const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
@@ -4181,9 +4124,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
4181
4124
  const [{ type, optionName }] = allStdioItems;
4182
4125
  throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
4183
4126
  }
4184
- const allContents = allStdioItems.map(({ contents }) => contents);
4185
- const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
4186
- options.input = joinToUint8Array(transformedContents);
4127
+ options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
4187
4128
  };
4188
4129
  const applySingleInputGeneratorsSync = (contents, stdioItems) => {
4189
4130
  const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
@@ -4208,10 +4149,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
4208
4149
  };
4209
4150
  const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
4210
4151
  const logLine = (line, fdNumber, verboseInfo) => {
4211
- const verboseMessage = serializeVerboseMessage(line);
4212
4152
  verboseLog({
4213
4153
  type: "output",
4214
- verboseMessage,
4154
+ verboseMessage: serializeVerboseMessage(line),
4215
4155
  fdNumber,
4216
4156
  verboseInfo
4217
4157
  });
@@ -4223,28 +4163,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
4223
4163
  if (output === null) return { output: Array.from({ length: 3 }) };
4224
4164
  const state = {};
4225
4165
  const outputFiles = /* @__PURE__ */ new Set([]);
4226
- const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
4227
- result,
4228
- fileDescriptors,
4229
- fdNumber,
4230
- state,
4231
- outputFiles,
4232
- isMaxBuffer,
4233
- verboseInfo
4234
- }, options));
4235
4166
  return {
4236
- output: transformedOutput,
4167
+ output: output.map((result, fdNumber) => transformOutputResultSync({
4168
+ result,
4169
+ fileDescriptors,
4170
+ fdNumber,
4171
+ state,
4172
+ outputFiles,
4173
+ isMaxBuffer,
4174
+ verboseInfo
4175
+ }, options)),
4237
4176
  ...state
4238
4177
  };
4239
4178
  };
4240
4179
  const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
4241
4180
  if (result === null) return;
4242
- const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);
4243
- const uint8ArrayResult = bufferToUint8Array(truncatedResult);
4181
+ const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
4244
4182
  const { stdioItems, objectMode } = fileDescriptors[fdNumber];
4245
- const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
4246
4183
  const { serializedResult, finalResult = serializedResult } = serializeChunks({
4247
- chunks,
4184
+ chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
4248
4185
  objectMode,
4249
4186
  encoding,
4250
4187
  lines,
@@ -4355,14 +4292,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
4355
4292
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
4356
4293
  const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
4357
4294
  const resultError = getResultError(error, exitCode, signal);
4358
- const timedOut = resultError?.code === "ETIMEDOUT";
4359
- const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
4360
4295
  return {
4361
4296
  resultError,
4362
4297
  exitCode,
4363
4298
  signal,
4364
- timedOut,
4365
- isMaxBuffer
4299
+ timedOut: resultError?.code === "ETIMEDOUT",
4300
+ isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
4366
4301
  };
4367
4302
  };
4368
4303
  const getResultError = (error, exitCode, signal) => {
@@ -4374,7 +4309,7 @@ const getResultError = (error, exitCode, signal) => {
4374
4309
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
4375
4310
  const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
4376
4311
  const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
4377
- const result = spawnSubprocessSync({
4312
+ return handleResult(spawnSubprocessSync({
4378
4313
  file,
4379
4314
  commandArguments,
4380
4315
  options,
@@ -4383,15 +4318,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
4383
4318
  verboseInfo,
4384
4319
  fileDescriptors,
4385
4320
  startTime
4386
- });
4387
- return handleResult(result, verboseInfo, options);
4321
+ }), verboseInfo, options);
4388
4322
  };
4389
4323
  const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
4390
4324
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
4391
- const syncOptions = normalizeSyncOptions(rawOptions);
4392
- const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
4325
+ const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
4393
4326
  validateSyncOptions(options);
4394
- const fileDescriptors = handleStdioSync(options, verboseInfo);
4395
4327
  return {
4396
4328
  file,
4397
4329
  commandArguments,
@@ -4400,7 +4332,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
4400
4332
  startTime,
4401
4333
  verboseInfo,
4402
4334
  options,
4403
- fileDescriptors
4335
+ fileDescriptors: handleStdioSync(options, verboseInfo)
4404
4336
  };
4405
4337
  };
4406
4338
  const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
@@ -4435,16 +4367,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
4435
4367
  isMaxBuffer,
4436
4368
  verboseInfo
4437
4369
  });
4438
- const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
4439
- const all = stripNewline(getAllSync(output, options), options, "all");
4440
4370
  return getSyncResult({
4441
4371
  error,
4442
4372
  exitCode,
4443
4373
  signal,
4444
4374
  timedOut,
4445
4375
  isMaxBuffer,
4446
- stdio,
4447
- all,
4376
+ stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
4377
+ all: stripNewline(getAllSync(output, options), options, "all"),
4448
4378
  options,
4449
4379
  command,
4450
4380
  escapedCommand,
@@ -4454,8 +4384,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
4454
4384
  const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
4455
4385
  try {
4456
4386
  addInputOptionsSync(fileDescriptors, options);
4457
- const normalizedOptions = normalizeSpawnSyncOptions(options);
4458
- return (0, node_child_process.spawnSync)(file, commandArguments, normalizedOptions);
4387
+ return (0, node_child_process.spawnSync)(file, commandArguments, normalizeSpawnSyncOptions(options));
4459
4388
  } catch (error) {
4460
4389
  return makeEarlyError({
4461
4390
  error,
@@ -4673,19 +4602,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
4673
4602
  writable,
4674
4603
  duplex
4675
4604
  });
4676
- const earlyError = makeEarlyError({
4677
- error,
4678
- command,
4679
- escapedCommand,
4680
- fileDescriptors,
4681
- options,
4682
- startTime,
4683
- isSync: false
4684
- });
4685
- const promise = handleDummyPromise(earlyError, verboseInfo, options);
4686
4605
  return {
4687
4606
  subprocess,
4688
- promise
4607
+ promise: handleDummyPromise(makeEarlyError({
4608
+ error,
4609
+ command,
4610
+ escapedCommand,
4611
+ fileDescriptors,
4612
+ options,
4613
+ startTime,
4614
+ isSync: false
4615
+ }), verboseInfo, options)
4689
4616
  };
4690
4617
  };
4691
4618
  const createDummyStreams = (subprocess, fileDescriptors) => {
@@ -4734,8 +4661,7 @@ const addProperties = {
4734
4661
  nodeStream: ({ value }) => ({ stream: value }),
4735
4662
  webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
4736
4663
  const objectMode = writableObjectMode || readableObjectMode;
4737
- const stream = node_stream.Duplex.fromWeb(transform, { objectMode });
4738
- return { stream };
4664
+ return { stream: node_stream.Duplex.fromWeb(transform, { objectMode }) };
4739
4665
  },
4740
4666
  duplex: ({ value: { transform } }) => ({ stream: transform }),
4741
4667
  native() {}
@@ -4981,10 +4907,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
4981
4907
  controller
4982
4908
  });
4983
4909
  }
4984
- for (const [outputStream, inputStreams] of pipeGroups.entries()) {
4985
- const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
4986
- pipeStreams(inputStream, outputStream);
4987
- }
4910
+ for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
4988
4911
  };
4989
4912
  const pipeTransform = (subprocess, stream, direction, fdNumber) => {
4990
4913
  if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
@@ -5246,10 +5169,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
5246
5169
  const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
5247
5170
  try {
5248
5171
  const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
5249
- const destinationStream = getToStream(destination, to);
5250
5172
  return {
5251
5173
  destination,
5252
- destinationStream,
5174
+ destinationStream: getToStream(destination, to),
5253
5175
  from,
5254
5176
  unpipeSignal
5255
5177
  };
@@ -5258,19 +5180,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
5258
5180
  }
5259
5181
  };
5260
5182
  const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
5261
- if (Array.isArray(firstArgument)) {
5262
- const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
5263
- return {
5264
- destination,
5265
- pipeOptions: boundOptions
5266
- };
5267
- }
5183
+ if (Array.isArray(firstArgument)) return {
5184
+ destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
5185
+ pipeOptions: boundOptions
5186
+ };
5268
5187
  if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
5269
5188
  if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
5270
5189
  const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
5271
- const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
5272
5190
  return {
5273
- destination,
5191
+ destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
5274
5192
  pipeOptions: rawOptions
5275
5193
  };
5276
5194
  }
@@ -5290,8 +5208,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
5290
5208
  } });
5291
5209
  const getSourceStream = (source, from) => {
5292
5210
  try {
5293
- const sourceStream = getFromStream(source, from);
5294
- return { sourceStream };
5211
+ return { sourceStream: getFromStream(source, from) };
5295
5212
  } catch (error) {
5296
5213
  return { sourceError: error };
5297
5214
  }
@@ -5385,9 +5302,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
5385
5302
  const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
5386
5303
  await (0, node_util.aborted)(unpipeSignal, sourceStream);
5387
5304
  await mergedStream.remove(sourceStream);
5388
- const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
5389
5305
  throw createNonCommandError({
5390
- error,
5306
+ error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
5391
5307
  fileDescriptors,
5392
5308
  sourceOptions,
5393
5309
  startTime
@@ -5490,13 +5406,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
5490
5406
  }
5491
5407
  };
5492
5408
  const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
5493
- const onStdoutChunk = (0, node_events.on)(stream, "data", {
5494
- signal: controller.signal,
5495
- highWaterMark: HIGH_WATER_MARK,
5496
- highWatermark: HIGH_WATER_MARK
5497
- });
5498
5409
  return iterateOnData({
5499
- onStdoutChunk,
5410
+ onStdoutChunk: (0, node_events.on)(stream, "data", {
5411
+ signal: controller.signal,
5412
+ highWaterMark: HIGH_WATER_MARK,
5413
+ highWatermark: HIGH_WATER_MARK
5414
+ }),
5500
5415
  controller,
5501
5416
  binary,
5502
5417
  shouldEncode,
@@ -5541,13 +5456,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
5541
5456
  await Promise.all([resumeStream(stream), logPromise]);
5542
5457
  return;
5543
5458
  }
5544
- const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
5545
5459
  const iterable = iterateForResult({
5546
5460
  stream,
5547
5461
  onStreamEnd,
5548
5462
  lines,
5549
5463
  encoding,
5550
- stripFinalNewline: stripFinalNewlineValue,
5464
+ stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
5551
5465
  allMixed
5552
5466
  });
5553
5467
  const [output] = await Promise.all([getStreamContents({
@@ -5567,15 +5481,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
5567
5481
  verboseInfo,
5568
5482
  fdNumber
5569
5483
  })) return;
5570
- const linesIterable = iterateForResult({
5484
+ await logLines(iterateForResult({
5571
5485
  stream,
5572
5486
  onStreamEnd,
5573
5487
  lines: true,
5574
5488
  encoding,
5575
5489
  stripFinalNewline: true,
5576
5490
  allMixed
5577
- });
5578
- await logLines(linesIterable, stream, fdNumber, verboseInfo);
5491
+ }), stream, fdNumber, verboseInfo);
5579
5492
  };
5580
5493
  const resumeStream = async (stream) => {
5581
5494
  await (0, node_timers_promises.setImmediate)();
@@ -5725,10 +5638,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
5725
5638
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
5726
5639
  const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
5727
5640
  const logIpcOutput = (message, verboseInfo) => {
5728
- const verboseMessage = serializeVerboseMessage(message);
5729
5641
  verboseLog({
5730
5642
  type: "ipc",
5731
- verboseMessage,
5643
+ verboseMessage: serializeVerboseMessage(message),
5732
5644
  fdNumber: "ipc",
5733
5645
  verboseInfo
5734
5646
  });
@@ -5871,9 +5783,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
5871
5783
  const promises = weakMap.get(stream);
5872
5784
  const promise = createDeferred();
5873
5785
  promises.push(promise);
5874
- const resolve = promise.resolve.bind(promise);
5875
5786
  return {
5876
- resolve,
5787
+ resolve: promise.resolve.bind(promise),
5877
5788
  promises
5878
5789
  };
5879
5790
  };
@@ -5954,10 +5865,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
5954
5865
  };
5955
5866
  const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
5956
5867
  const subprocessStdout = getFromStream(subprocess, from);
5957
- const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
5958
5868
  return {
5959
5869
  subprocessStdout,
5960
- waitReadableDestroy
5870
+ waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
5961
5871
  };
5962
5872
  };
5963
5873
  const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
@@ -6035,12 +5945,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
6035
5945
  };
6036
5946
  const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
6037
5947
  const subprocessStdin = getToStream(subprocess, to);
6038
- const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
6039
- const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
6040
5948
  return {
6041
5949
  subprocessStdin,
6042
- waitWritableFinal,
6043
- waitWritableDestroy
5950
+ waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
5951
+ waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
6044
5952
  };
6045
5953
  };
6046
5954
  const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
@@ -6136,15 +6044,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
6136
6044
  const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
6137
6045
  const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
6138
6046
  const subprocessStdout = getFromStream(subprocess, from);
6139
- const onStdoutData = iterateOnSubprocessStream({
6047
+ return iterateOnStdoutData(iterateOnSubprocessStream({
6140
6048
  subprocessStdout,
6141
6049
  subprocess,
6142
6050
  binary,
6143
6051
  shouldEncode: true,
6144
6052
  encoding,
6145
6053
  preserveNewlines
6146
- });
6147
- return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
6054
+ }), subprocessStdout, subprocess);
6148
6055
  };
6149
6056
  const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
6150
6057
  try {
@@ -6226,7 +6133,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
6226
6133
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
6227
6134
  const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
6228
6135
  const options = handleAsyncOptions(normalizedOptions);
6229
- const fileDescriptors = handleStdioAsync(options, verboseInfo);
6230
6136
  return {
6231
6137
  file,
6232
6138
  commandArguments,
@@ -6235,7 +6141,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
6235
6141
  startTime,
6236
6142
  verboseInfo,
6237
6143
  options,
6238
- fileDescriptors
6144
+ fileDescriptors: handleStdioAsync(options, verboseInfo)
6239
6145
  };
6240
6146
  };
6241
6147
  const handleAsyncOptions = ({ timeout, signal,...options }) => {
@@ -6308,22 +6214,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
6308
6214
  });
6309
6215
  controller.abort();
6310
6216
  onInternalError.resolve();
6311
- const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));
6312
- const all = stripNewline(allResult, options, "all");
6313
- const result = getAsyncResult({
6217
+ return handleResult(getAsyncResult({
6314
6218
  errorInfo,
6315
6219
  exitCode,
6316
6220
  signal,
6317
- stdio,
6318
- all,
6221
+ stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
6222
+ all: stripNewline(allResult, options, "all"),
6319
6223
  ipcOutput,
6320
6224
  context,
6321
6225
  options,
6322
6226
  command,
6323
6227
  escapedCommand,
6324
6228
  startTime
6325
- });
6326
- return handleResult(result, verboseInfo, options);
6229
+ }), verboseInfo, options);
6327
6230
  };
6328
6231
  const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
6329
6232
  error: errorInfo.error,
@@ -6396,8 +6299,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
6396
6299
  return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
6397
6300
  };
6398
6301
  const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
6399
- const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments];
6400
- const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
6302
+ const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
6401
6303
  const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
6402
6304
  const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
6403
6305
  file: initialFile,
@@ -6493,15 +6395,14 @@ const runBundle = async ({ entryFile, cwd, platform: platform$1, buildPath, sour
6493
6395
  __hot_updater_plugin_core.log.normal("\n");
6494
6396
  let stdout = null;
6495
6397
  try {
6496
- const result = await execa("npx", args, {
6398
+ stdout = (await execa("npx", args, {
6497
6399
  cwd,
6498
6400
  env: {
6499
6401
  ...process.env,
6500
6402
  BUILD_OUT_DIR: buildPath
6501
6403
  },
6502
6404
  reject: true
6503
- });
6504
- stdout = result.stdout;
6405
+ })).stdout;
6505
6406
  } catch (error) {
6506
6407
  if (error instanceof ExecaError) throw error.stderr;
6507
6408
  }