@hot-updater/firebase 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/iac/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { createRequire } from "node:module";
2
- import fs from "fs";
3
- import path from "path";
4
2
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
5
3
  import g, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
6
4
  import * as f$1 from "node:readline";
@@ -10,7 +8,9 @@ import { ConfigBuilder, copyDirToTmp, link, makeEnv, transformEnv, transformTemp
10
8
  import { fileURLToPath } from "node:url";
11
9
  import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
12
10
  import { StringDecoder } from "node:string_decoder";
13
- import path$1 from "node:path";
11
+ import path from "node:path";
12
+ import path$1 from "path";
13
+ import fs from "fs";
14
14
  import { scheduler, setImmediate, setTimeout } from "node:timers/promises";
15
15
  import { constants } from "node:os";
16
16
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
@@ -439,16 +439,16 @@ function G(t, u$2, F$1) {
439
439
  `).map((e$1) => oD(e$1, u$2, F$1)).join(`
440
440
  `);
441
441
  }
442
- const aD = [
443
- "up",
444
- "down",
445
- "left",
446
- "right",
447
- "space",
448
- "enter",
449
- "cancel"
450
- ], c$1 = {
451
- actions: new Set(aD),
442
+ const c$1 = {
443
+ actions: new Set([
444
+ "up",
445
+ "down",
446
+ "left",
447
+ "right",
448
+ "space",
449
+ "enter",
450
+ "cancel"
451
+ ]),
452
452
  aliases: new Map([
453
453
  ["k", "up"],
454
454
  ["j", "down"],
@@ -488,9 +488,8 @@ function cD({ input: t = stdin, output: u$2 = stdout, overwrite: F$1 = !0, hideC
488
488
  });
489
489
  f$1.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
490
490
  const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
491
- const E = String(D$1);
492
491
  if (k$1([
493
- E,
492
+ String(D$1),
494
493
  C$1,
495
494
  o$2
496
495
  ], "cancel")) {
@@ -679,10 +678,7 @@ let dD = class extends x {
679
678
  if (u$2.group === !0) {
680
679
  const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
681
680
  this.isGroupSelected(F$1) ? this.value = this.value.filter((s) => e$1.findIndex((i$1) => i$1.value === s) === -1) : this.value = [...this.value, ...e$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
682
- } else {
683
- const F$1 = this.value.includes(u$2.value);
684
- this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
685
- }
681
+ } else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
686
682
  }
687
683
  };
688
684
  var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
@@ -715,12 +711,10 @@ let wD = class extends x {
715
711
  return this.options[this.cursor].value;
716
712
  }
717
713
  toggleAll() {
718
- const u$2 = this.value.length === this.options.length;
719
- this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
714
+ this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
720
715
  }
721
716
  toggleValue() {
722
- const u$2 = this.value.includes(this._value);
723
- this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
717
+ this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
724
718
  }
725
719
  };
726
720
  var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
@@ -1147,8 +1141,7 @@ ${J}${r$1.trimStart()}`), s = 3 + stripVTControlCharacters(r$1.trimStart()).leng
1147
1141
  ], s = V ? 80 : 120, r$1 = process.env.CI === "true";
1148
1142
  let i$1, a$1, c$2 = !1, l$1 = "", $$1, p$1 = performance.now();
1149
1143
  const M$1 = (m$1) => {
1150
- const h$2 = m$1 > 1 ? "Something went wrong" : "Canceled";
1151
- c$2 && N$1(h$2, m$1);
1144
+ c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
1152
1145
  }, v$1 = () => M$1(2), x$1 = () => M$1(1), j = () => {
1153
1146
  process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", x$1), process.on("SIGTERM", x$1), process.on("exit", M$1);
1154
1147
  }, E = () => {
@@ -1233,9 +1226,7 @@ function orderBy(arr, criteria, orders) {
1233
1226
  const order = ordersLength > i$1 ? orders[i$1] : orders[ordersLength - 1];
1234
1227
  const criterion = criteria[i$1];
1235
1228
  const criterionIsFunction = typeof criterion === "function";
1236
- const valueA = criterionIsFunction ? criterion(a$1) : a$1[criterion];
1237
- const valueB = criterionIsFunction ? criterion(b$2) : b$2[criterion];
1238
- const result = compareValues(valueA, valueB, order);
1229
+ const result = compareValues(criterionIsFunction ? criterion(a$1) : a$1[criterion], criterionIsFunction ? criterion(b$2) : b$2[criterion], order);
1239
1230
  if (result !== 0) return result;
1240
1231
  }
1241
1232
  return 0;
@@ -1254,8 +1245,7 @@ function uniqWith(arr, areItemsEqual) {
1254
1245
  const result = [];
1255
1246
  for (let i$1 = 0; i$1 < arr.length; i$1++) {
1256
1247
  const item = arr[i$1];
1257
- const isUniq = result.every((v$1) => !areItemsEqual(v$1, item));
1258
- if (isUniq) result.push(item);
1248
+ if (result.every((v$1) => !areItemsEqual(v$1, item))) result.push(item);
1259
1249
  }
1260
1250
  return result;
1261
1251
  }
@@ -1311,8 +1301,7 @@ const float64ArrayTag = "[object Float64Array]";
1311
1301
  function isPlainObject$1(value) {
1312
1302
  if (!value || typeof value !== "object") return false;
1313
1303
  const proto = Object.getPrototypeOf(value);
1314
- const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
1315
- if (!hasObjectPrototype) return false;
1304
+ if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
1316
1305
  return Object.prototype.toString.call(value) === "[object Object]";
1317
1306
  }
1318
1307
 
@@ -1368,11 +1357,7 @@ function areObjectsEqual(a$1, b$2, stack, areValuesEqual) {
1368
1357
  if (aTag !== bTag) return false;
1369
1358
  switch (aTag) {
1370
1359
  case stringTag: return a$1.toString() === b$2.toString();
1371
- case numberTag: {
1372
- const x$1 = a$1.valueOf();
1373
- const y$1 = b$2.valueOf();
1374
- return eq(x$1, y$1);
1375
- }
1360
+ case numberTag: return eq(a$1.valueOf(), b$2.valueOf());
1376
1361
  case booleanTag:
1377
1362
  case dateTag:
1378
1363
  case symbolTag: return Object.is(a$1.valueOf(), b$2.valueOf());
@@ -1429,8 +1414,7 @@ function areObjectsEqual(a$1, b$2, stack, areValuesEqual) {
1429
1414
  return areObjectsEqual(new Uint8Array(a$1), new Uint8Array(b$2), stack, areValuesEqual);
1430
1415
  case errorTag: return a$1.name === b$2.name && a$1.message === b$2.message;
1431
1416
  case objectTag: {
1432
- const areEqualInstances = areObjectsEqual(a$1.constructor, b$2.constructor, stack, areValuesEqual) || isPlainObject$1(a$1) && isPlainObject$1(b$2);
1433
- if (!areEqualInstances) return false;
1417
+ if (!(areObjectsEqual(a$1.constructor, b$2.constructor, stack, areValuesEqual) || isPlainObject$1(a$1) && isPlainObject$1(b$2))) return false;
1434
1418
  const aKeys = [...Object.keys(a$1), ...getSymbols(a$1)];
1435
1419
  const bKeys = [...Object.keys(b$2), ...getSymbols(b$2)];
1436
1420
  if (aKeys.length !== bKeys.length) return false;
@@ -1505,8 +1489,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
1505
1489
  const textDecoder = new TextDecoder();
1506
1490
  const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
1507
1491
  const joinToString = (uint8ArraysOrStrings, encoding) => {
1508
- const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);
1509
- return strings.join("");
1492
+ return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
1510
1493
  };
1511
1494
  const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
1512
1495
  if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
@@ -1561,8 +1544,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
1561
1544
  const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
1562
1545
  if (index === expressions.length) return newTokens;
1563
1546
  const expression = expressions[index];
1564
- const expressionTokens = Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)];
1565
- return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
1547
+ return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
1566
1548
  };
1567
1549
  const splitByWhitespaces = (template, rawTemplate) => {
1568
1550
  if (rawTemplate.length === 0) return {
@@ -1649,8 +1631,7 @@ const normalizeFdSpecificOptions = (options) => {
1649
1631
  };
1650
1632
  const normalizeFdSpecificOption = (options, optionName) => {
1651
1633
  const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
1652
- const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
1653
- return addDefaultValue$1(optionArray, optionName);
1634
+ return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
1654
1635
  };
1655
1636
  const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
1656
1637
  const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
@@ -1680,12 +1661,11 @@ const parseFd = (fdName) => {
1680
1661
  };
1681
1662
  const FD_REGEXP = /^fd(\d+)$/;
1682
1663
  const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
1683
- const verboseDefault = debuglog("execa").enabled ? "full" : "none";
1684
1664
  const DEFAULT_OPTIONS = {
1685
1665
  lines: false,
1686
1666
  buffer: true,
1687
1667
  maxBuffer: 1e3 * 1e3 * 100,
1688
- verbose: verboseDefault,
1668
+ verbose: debuglog("execa").enabled ? "full" : "none",
1689
1669
  stripFinalNewline: true
1690
1670
  };
1691
1671
  const FD_SPECIFIC_OPTIONS = [
@@ -1718,11 +1698,9 @@ const VERBOSE_VALUES = [
1718
1698
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
1719
1699
  const joinCommand = (filePath, rawArguments) => {
1720
1700
  const fileAndArguments = [filePath, ...rawArguments];
1721
- const command = fileAndArguments.join(" ");
1722
- const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
1723
1701
  return {
1724
- command,
1725
- escapedCommand
1702
+ command: fileAndArguments.join(" "),
1703
+ escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
1726
1704
  };
1727
1705
  };
1728
1706
  const escapeLines = (lines) => stripVTControlCharacters(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
@@ -2163,13 +2141,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
2163
2141
  //#endregion
2164
2142
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
2165
2143
  const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
2166
- const verboseObject = getVerboseObject({
2144
+ const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
2167
2145
  type,
2168
2146
  result,
2169
2147
  verboseInfo
2170
- });
2171
- const printedLines = getPrintedLines(verboseMessage, verboseObject);
2172
- const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
2148
+ })), verboseInfo, fdNumber);
2173
2149
  if (finalLines !== "") console.warn(finalLines.slice(0, -1));
2174
2150
  };
2175
2151
  const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
@@ -2186,16 +2162,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
2186
2162
  message
2187
2163
  }));
2188
2164
  const getPrintedLine = (verboseObject) => {
2189
- const verboseLine = defaultVerboseFunction(verboseObject);
2190
2165
  return {
2191
- verboseLine,
2166
+ verboseLine: defaultVerboseFunction(verboseObject),
2192
2167
  verboseObject
2193
2168
  };
2194
2169
  };
2195
2170
  const serializeVerboseMessage = (message) => {
2196
- const messageString = typeof message === "string" ? message : inspect(message);
2197
- const escapedMessage = escapeLines(messageString);
2198
- return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
2171
+ return escapeLines(typeof message === "string" ? message : inspect(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
2199
2172
  };
2200
2173
  const TAB_SIZE = 2;
2201
2174
 
@@ -2214,11 +2187,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
2214
2187
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
2215
2188
  const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
2216
2189
  validateVerbose(verbose);
2217
- const commandId = getCommandId(verbose);
2218
2190
  return {
2219
2191
  verbose,
2220
2192
  escapedCommand,
2221
- commandId,
2193
+ commandId: getCommandId(verbose),
2222
2194
  rawOptions
2223
2195
  };
2224
2196
  };
@@ -2245,8 +2217,7 @@ const getDurationMs = (startTime) => Number(hrtime.bigint() - startTime) / 1e6;
2245
2217
  const handleCommand = (filePath, rawArguments, rawOptions) => {
2246
2218
  const startTime = getStartTime();
2247
2219
  const { command, escapedCommand } = joinCommand(filePath, rawArguments);
2248
- const verbose = normalizeFdSpecificOption(rawOptions, "verbose");
2249
- const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
2220
+ const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
2250
2221
  logCommand(escapedCommand, verboseInfo);
2251
2222
  return {
2252
2223
  command,
@@ -2314,8 +2285,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
2314
2285
  var g$2 = parseInt("010", 8);
2315
2286
  var o$2 = parseInt("001", 8);
2316
2287
  var ug = u$2 | g$2;
2317
- var ret = mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2318
- return ret;
2288
+ return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2319
2289
  }
2320
2290
  }) });
2321
2291
 
@@ -2397,8 +2367,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2397
2367
  const ppRaw = pathEnv[i$1];
2398
2368
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2399
2369
  const pCmd = path$4.join(pathPart, cmd);
2400
- const p$1 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2401
- resolve(subStep(p$1, i$1, 0));
2370
+ resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
2402
2371
  });
2403
2372
  const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
2404
2373
  if (ii === pathExt.length) return resolve(step(i$1 + 1));
@@ -2423,8 +2392,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2423
2392
  for (let j = 0; j < pathExt.length; j++) {
2424
2393
  const cur = p$1 + pathExt[j];
2425
2394
  try {
2426
- const is = isexe.sync(cur, { pathExt: pathExtExe });
2427
- if (is) if (opt.all) found.push(cur);
2395
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
2428
2396
  else return cur;
2429
2397
  } catch (ex) {}
2430
2398
  }
@@ -2442,8 +2410,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2442
2410
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
2443
2411
  const pathKey$1 = (options = {}) => {
2444
2412
  const environment = options.env || process.env;
2445
- const platform$1 = options.platform || process.platform;
2446
- if (platform$1 !== "win32") return "PATH";
2413
+ if ((options.platform || process.platform) !== "win32") return "PATH";
2447
2414
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2448
2415
  };
2449
2416
  module.exports = pathKey$1;
@@ -2571,12 +2538,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
2571
2538
  parsed.command = path$2.normalize(parsed.command);
2572
2539
  parsed.command = escape.command(parsed.command);
2573
2540
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2574
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2575
2541
  parsed.args = [
2576
2542
  "/d",
2577
2543
  "/s",
2578
2544
  "/c",
2579
- `"${shellCommand}"`
2545
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
2580
2546
  ];
2581
2547
  parsed.command = process.env.comspec || "cmd.exe";
2582
2548
  parsed.options.windowsVerbatimArguments = true;
@@ -2687,12 +2653,12 @@ function toPath(urlOrPath) {
2687
2653
  }
2688
2654
  function traversePathUp(startPath) {
2689
2655
  return { *[Symbol.iterator]() {
2690
- let currentPath = path$1.resolve(toPath(startPath));
2656
+ let currentPath = path.resolve(toPath(startPath));
2691
2657
  let previousPath;
2692
2658
  while (previousPath !== currentPath) {
2693
2659
  yield currentPath;
2694
2660
  previousPath = currentPath;
2695
- currentPath = path$1.resolve(currentPath, "..");
2661
+ currentPath = path.resolve(currentPath, "..");
2696
2662
  }
2697
2663
  } };
2698
2664
  }
@@ -2701,21 +2667,21 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
2701
2667
  //#endregion
2702
2668
  //#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
2703
2669
  const npmRunPath = ({ cwd = g.cwd(), path: pathOption = g.env[pathKey()], preferLocal = true, execPath: execPath$1 = g.execPath, addExecPath = true } = {}) => {
2704
- const cwdPath = path$1.resolve(toPath(cwd));
2670
+ const cwdPath = path.resolve(toPath(cwd));
2705
2671
  const result = [];
2706
- const pathParts = pathOption.split(path$1.delimiter);
2672
+ const pathParts = pathOption.split(path.delimiter);
2707
2673
  if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
2708
2674
  if (addExecPath) applyExecPath(result, pathParts, execPath$1, cwdPath);
2709
- return pathOption === "" || pathOption === path$1.delimiter ? `${result.join(path$1.delimiter)}${pathOption}` : [...result, pathOption].join(path$1.delimiter);
2675
+ return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
2710
2676
  };
2711
2677
  const applyPreferLocal = (result, pathParts, cwdPath) => {
2712
2678
  for (const directory of traversePathUp(cwdPath)) {
2713
- const pathPart = path$1.join(directory, "node_modules/.bin");
2679
+ const pathPart = path.join(directory, "node_modules/.bin");
2714
2680
  if (!pathParts.includes(pathPart)) result.push(pathPart);
2715
2681
  }
2716
2682
  };
2717
2683
  const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
2718
- const pathPart = path$1.resolve(cwdPath, toPath(execPath$1), "..");
2684
+ const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
2719
2685
  if (!pathParts.includes(pathPart)) result.push(pathPart);
2720
2686
  };
2721
2687
  const npmRunPathEnv = ({ env: env$1 = g.env,...options } = {}) => {
@@ -2729,9 +2695,7 @@ const npmRunPathEnv = ({ env: env$1 = g.env,...options } = {}) => {
2729
2695
  //#endregion
2730
2696
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
2731
2697
  const getFinalError = (originalError, message, isSync) => {
2732
- const ErrorClass = isSync ? ExecaSyncError : ExecaError;
2733
- const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
2734
- return new ErrorClass(message, options);
2698
+ return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
2735
2699
  };
2736
2700
  var DiscardedError = class extends Error {};
2737
2701
  const setErrorName = (ErrorClass, value) => {
@@ -3050,16 +3014,14 @@ const SIGNALS = [
3050
3014
  //#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
3051
3015
  const getSignals = () => {
3052
3016
  const realtimeSignals = getRealtimeSignals();
3053
- const signals$1 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
3054
- return signals$1;
3017
+ return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
3055
3018
  };
3056
3019
  const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
3057
3020
  const { signals: { [name]: constantSignal } } = constants;
3058
3021
  const supported = constantSignal !== void 0;
3059
- const number = supported ? constantSignal : defaultNumber;
3060
3022
  return {
3061
3023
  name,
3062
- number,
3024
+ number: supported ? constantSignal : defaultNumber,
3063
3025
  description,
3064
3026
  supported,
3065
3027
  action,
@@ -3471,8 +3433,7 @@ const isConnected = (anyProcess) => {
3471
3433
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
3472
3434
  const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
3473
3435
  if (!strict) return message;
3474
- const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);
3475
- const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
3436
+ const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
3476
3437
  return {
3477
3438
  id: count++,
3478
3439
  type: REQUEST_TYPE,
@@ -3545,11 +3506,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
3545
3506
  const startSendMessage = (anyProcess, wrappedMessage, strict) => {
3546
3507
  if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
3547
3508
  const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
3548
- const onMessageSent = createDeferred();
3549
- const id = strict ? wrappedMessage.id : void 0;
3550
3509
  const outgoingMessage = {
3551
- onMessageSent,
3552
- id
3510
+ onMessageSent: createDeferred(),
3511
+ id: strict ? wrappedMessage.id : void 0
3553
3512
  };
3554
3513
  outgoingMessages.add(outgoingMessage);
3555
3514
  return {
@@ -3710,8 +3669,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
3710
3669
  })] : [];
3711
3670
  const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
3712
3671
  await onAbortedSignal(cancelSignal, signal);
3713
- const reason = getReason(cancelSignal);
3714
- await sendAbort(subprocess, reason);
3672
+ await sendAbort(subprocess, getReason(cancelSignal));
3715
3673
  killOnTimeout({
3716
3674
  kill: subprocess.kill,
3717
3675
  forceKillAfterDelay,
@@ -3758,7 +3716,7 @@ const mapNode = ({ options }) => {
3758
3716
  const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath,...options }) => {
3759
3717
  if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
3760
3718
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
3761
- const resolvedNodePath = path$1.resolve(cwd, normalizedNodePath);
3719
+ const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
3762
3720
  const newOptions = {
3763
3721
  ...options,
3764
3722
  nodePath: resolvedNodePath,
@@ -3770,7 +3728,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
3770
3728
  commandArguments,
3771
3729
  newOptions
3772
3730
  ];
3773
- if (path$1.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
3731
+ if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
3774
3732
  return [
3775
3733
  resolvedNodePath,
3776
3734
  [
@@ -3857,7 +3815,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
3857
3815
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
3858
3816
  const normalizeCwd = (cwd = getDefaultCwd()) => {
3859
3817
  const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
3860
- return path$1.resolve(cwdString);
3818
+ return path.resolve(cwdString);
3861
3819
  };
3862
3820
  const getDefaultCwd = () => {
3863
3821
  try {
@@ -3885,8 +3843,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
3885
3843
  rawOptions.cwd = normalizeCwd(rawOptions.cwd);
3886
3844
  const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
3887
3845
  const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
3888
- const fdOptions = normalizeFdSpecificOptions(initialOptions);
3889
- const options = addDefaultOptions(fdOptions);
3846
+ const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
3890
3847
  validateTimeout(options);
3891
3848
  validateEncoding(options);
3892
3849
  validateIpcInputOption(options);
@@ -3897,7 +3854,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
3897
3854
  options.killSignal = normalizeKillSignal(options.killSignal);
3898
3855
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
3899
3856
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
3900
- if (g.platform === "win32" && path$1.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
3857
+ if (g.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
3901
3858
  return {
3902
3859
  file,
3903
3860
  commandArguments,
@@ -4043,7 +4000,7 @@ const u = Object.create(a, {
4043
4000
  }
4044
4001
  });
4045
4002
  function h({ preventCancel: r$1 = !1 } = {}) {
4046
- const e$1 = this.getReader(), t = new c(e$1, r$1), s = Object.create(u);
4003
+ const t = new c(this.getReader(), r$1), s = Object.create(u);
4047
4004
  return s[n] = t, s;
4048
4005
  }
4049
4006
 
@@ -4092,18 +4049,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
4092
4049
  const state = init();
4093
4050
  state.length = 0;
4094
4051
  try {
4095
- for await (const chunk of asyncIterable) {
4096
- const chunkType = getChunkType(chunk);
4097
- const convertedChunk = convertChunk[chunkType](chunk, state);
4098
- appendChunk({
4099
- convertedChunk,
4100
- state,
4101
- getSize,
4102
- truncateChunk,
4103
- addChunk,
4104
- maxBuffer
4105
- });
4106
- }
4052
+ for await (const chunk of asyncIterable) appendChunk({
4053
+ convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
4054
+ state,
4055
+ getSize,
4056
+ truncateChunk,
4057
+ addChunk,
4058
+ maxBuffer
4059
+ });
4107
4060
  appendFinalChunk({
4108
4061
  state,
4109
4062
  convertChunk,
@@ -4293,10 +4246,9 @@ const stringMethods = {
4293
4246
  const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
4294
4247
  if (!(error instanceof MaxBufferError)) throw error;
4295
4248
  if (fdNumber === "all") return error;
4296
- const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
4297
4249
  error.maxBufferInfo = {
4298
4250
  fdNumber,
4299
- unit
4251
+ unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
4300
4252
  };
4301
4253
  stream.destroy();
4302
4254
  throw error;
@@ -4366,19 +4318,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
4366
4318
  killSignal
4367
4319
  });
4368
4320
  const originalMessage = getOriginalMessage(originalError, cwd);
4369
- const suffix = originalMessage === void 0 ? "" : `\n${originalMessage}`;
4370
- const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
4371
- const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
4372
- const message = [
4373
- shortMessage,
4374
- ...messageStdio,
4375
- ...stdio.slice(3),
4376
- ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4377
- ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
4321
+ const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
4378
4322
  return {
4379
4323
  originalMessage,
4380
4324
  shortMessage,
4381
- message
4325
+ message: [
4326
+ shortMessage,
4327
+ ...all === void 0 ? [stdio[2], stdio[1]] : [all],
4328
+ ...stdio.slice(3),
4329
+ ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4330
+ ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
4382
4331
  };
4383
4332
  };
4384
4333
  const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
@@ -4399,8 +4348,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
4399
4348
  const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
4400
4349
  const getOriginalMessage = (originalError, cwd) => {
4401
4350
  if (originalError instanceof DiscardedError) return;
4402
- const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError);
4403
- const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
4351
+ const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
4404
4352
  return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
4405
4353
  };
4406
4354
  const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : inspect(ipcMessage);
@@ -4522,11 +4470,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
4522
4470
  const normalizeExitPayload = (rawExitCode, rawSignal) => {
4523
4471
  const exitCode = rawExitCode === null ? void 0 : rawExitCode;
4524
4472
  const signal = rawSignal === null ? void 0 : rawSignal;
4525
- const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
4526
4473
  return {
4527
4474
  exitCode,
4528
4475
  signal,
4529
- signalDescription
4476
+ signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
4530
4477
  };
4531
4478
  };
4532
4479
 
@@ -4591,8 +4538,7 @@ function prettyMilliseconds(milliseconds, options) {
4591
4538
  let result = [];
4592
4539
  const floorDecimals = (value, decimalDigits) => {
4593
4540
  const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
4594
- const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits;
4595
- return flooredValue.toFixed(decimalDigits);
4541
+ return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
4596
4542
  };
4597
4543
  const add = (value, long, short, valueString) => {
4598
4544
  if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
@@ -4629,14 +4575,11 @@ function prettyMilliseconds(milliseconds, options) {
4629
4575
  } else {
4630
4576
  const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
4631
4577
  const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
4632
- const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4633
- const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
4578
+ const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4634
4579
  add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
4635
4580
  }
4636
4581
  } else {
4637
- const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
4638
- const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
4639
- const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
4582
+ const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
4640
4583
  const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
4641
4584
  add(Number.parseFloat(secondsString), "second", "s", secondsString);
4642
4585
  }
@@ -4665,10 +4608,9 @@ const logResult = (result, verboseInfo) => {
4665
4608
  logDuration(result, verboseInfo);
4666
4609
  };
4667
4610
  const logDuration = (result, verboseInfo) => {
4668
- const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
4669
4611
  verboseLog({
4670
4612
  type: "duration",
4671
- verboseMessage,
4613
+ verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
4672
4614
  verboseInfo,
4673
4615
  result
4674
4616
  });
@@ -4795,18 +4737,16 @@ const TYPE_TO_MESSAGE = {
4795
4737
  const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
4796
4738
  const getOutputObjectModes = (objectMode, index, newTransforms) => {
4797
4739
  const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
4798
- const readableObjectMode = objectMode ?? writableObjectMode;
4799
4740
  return {
4800
4741
  writableObjectMode,
4801
- readableObjectMode
4742
+ readableObjectMode: objectMode ?? writableObjectMode
4802
4743
  };
4803
4744
  };
4804
4745
  const getInputObjectModes = (objectMode, index, newTransforms) => {
4805
4746
  const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
4806
- const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
4807
4747
  return {
4808
4748
  writableObjectMode,
4809
- readableObjectMode
4749
+ readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
4810
4750
  };
4811
4751
  };
4812
4752
  const getFdObjectMode = (stdioItems, direction) => {
@@ -5115,8 +5055,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
5115
5055
  const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
5116
5056
  const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
5117
5057
  if (duplicateStdioItems.length === 0) return;
5118
- const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction);
5119
- throwOnDuplicateStream(differentStdioItem, optionName, type);
5058
+ throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
5120
5059
  return direction === "output" ? duplicateStdioItems[0].stream : void 0;
5121
5060
  };
5122
5061
  const hasSameValue = ({ type, value }, secondValue) => {
@@ -5125,8 +5064,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
5125
5064
  return value === secondValue;
5126
5065
  };
5127
5066
  const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
5128
- const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform);
5129
- throwOnDuplicateStream(duplicateStdioItem, optionName, type);
5067
+ throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
5130
5068
  };
5131
5069
  const throwOnDuplicateStream = (stdioItem, optionName, type) => {
5132
5070
  if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
@@ -5135,15 +5073,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
5135
5073
  //#endregion
5136
5074
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
5137
5075
  const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
5138
- const stdio = normalizeStdioOption(options, verboseInfo, isSync);
5139
- const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
5140
- stdioOption,
5141
- fdNumber,
5142
- options,
5143
- isSync
5144
- }));
5145
5076
  const fileDescriptors = getFinalFileDescriptors({
5146
- initialFileDescriptors,
5077
+ initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
5078
+ stdioOption,
5079
+ fdNumber,
5080
+ options,
5081
+ isSync
5082
+ })),
5147
5083
  addProperties: addProperties$2,
5148
5084
  options,
5149
5085
  isSync
@@ -5160,14 +5096,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
5160
5096
  optionName
5161
5097
  });
5162
5098
  const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
5163
- const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({
5099
+ const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
5164
5100
  stdioItem,
5165
5101
  isStdioArray,
5166
5102
  fdNumber,
5167
5103
  direction,
5168
5104
  isSync
5169
- }));
5170
- const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
5105
+ })), optionName, direction, options);
5171
5106
  const objectMode = getFdObjectMode(normalizedStdioItems, direction);
5172
5107
  validateFileObjectMode(normalizedStdioItems, objectMode);
5173
5108
  return {
@@ -5177,9 +5112,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
5177
5112
  };
5178
5113
  };
5179
5114
  const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
5180
- const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];
5181
- const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
5182
- const stdioItems = filterDuplicates(initialStdioItems);
5115
+ const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
5183
5116
  const isStdioArray = stdioItems.length > 1;
5184
5117
  validateStdioArray(stdioItems, isStdioArray, optionName);
5185
5118
  validateStreams(stdioItems);
@@ -5229,18 +5162,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
5229
5162
  }
5230
5163
  };
5231
5164
  const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
5232
- const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
5233
- stdioItem,
5234
- addProperties: addProperties$2,
5235
- direction,
5236
- options,
5237
- fileDescriptors,
5238
- isSync
5239
- }));
5240
5165
  return {
5241
5166
  direction,
5242
5167
  objectMode,
5243
- stdioItems: finalStdioItems
5168
+ stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
5169
+ stdioItem,
5170
+ addProperties: addProperties$2,
5171
+ direction,
5172
+ options,
5173
+ fileDescriptors,
5174
+ isSync
5175
+ }))
5244
5176
  };
5245
5177
  };
5246
5178
  const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
@@ -5370,8 +5302,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
5370
5302
  yield chunk;
5371
5303
  return;
5372
5304
  }
5373
- const newline = isWindowsNewline ? windowsNewline : unixNewline;
5374
- yield concatBytes(chunk, newline);
5305
+ yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
5375
5306
  };
5376
5307
  const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
5377
5308
  const linesStringInfo = {
@@ -5516,7 +5447,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5516
5447
  const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
5517
5448
  const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
5518
5449
  const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
5519
- const stream = new Transform({
5450
+ return { stream: new Transform({
5520
5451
  writableObjectMode,
5521
5452
  writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
5522
5453
  readableObjectMode,
@@ -5532,16 +5463,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5532
5463
  finalMethod([generators], this, done);
5533
5464
  },
5534
5465
  destroy: destroyMethod
5535
- });
5536
- return { stream };
5466
+ }) };
5537
5467
  };
5538
5468
  const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
5539
5469
  const generators = stdioItems.filter(({ type }) => type === "generator");
5540
5470
  const reversedGenerators = isInput ? generators.reverse() : generators;
5541
- for (const { value, optionName } of reversedGenerators) {
5542
- const generators$1 = addInternalGenerators(value, encoding, optionName);
5543
- chunks = runTransformSync(generators$1, chunks);
5544
- }
5471
+ for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
5545
5472
  return chunks;
5546
5473
  };
5547
5474
  const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
@@ -5578,9 +5505,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
5578
5505
  const [{ type, optionName }] = allStdioItems;
5579
5506
  throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
5580
5507
  }
5581
- const allContents = allStdioItems.map(({ contents }) => contents);
5582
- const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
5583
- options.input = joinToUint8Array(transformedContents);
5508
+ options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
5584
5509
  };
5585
5510
  const applySingleInputGeneratorsSync = (contents, stdioItems) => {
5586
5511
  const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
@@ -5605,10 +5530,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
5605
5530
  };
5606
5531
  const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
5607
5532
  const logLine = (line, fdNumber, verboseInfo) => {
5608
- const verboseMessage = serializeVerboseMessage(line);
5609
5533
  verboseLog({
5610
5534
  type: "output",
5611
- verboseMessage,
5535
+ verboseMessage: serializeVerboseMessage(line),
5612
5536
  fdNumber,
5613
5537
  verboseInfo
5614
5538
  });
@@ -5620,28 +5544,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
5620
5544
  if (output === null) return { output: Array.from({ length: 3 }) };
5621
5545
  const state = {};
5622
5546
  const outputFiles = /* @__PURE__ */ new Set([]);
5623
- const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
5624
- result,
5625
- fileDescriptors,
5626
- fdNumber,
5627
- state,
5628
- outputFiles,
5629
- isMaxBuffer,
5630
- verboseInfo
5631
- }, options));
5632
5547
  return {
5633
- output: transformedOutput,
5548
+ output: output.map((result, fdNumber) => transformOutputResultSync({
5549
+ result,
5550
+ fileDescriptors,
5551
+ fdNumber,
5552
+ state,
5553
+ outputFiles,
5554
+ isMaxBuffer,
5555
+ verboseInfo
5556
+ }, options)),
5634
5557
  ...state
5635
5558
  };
5636
5559
  };
5637
5560
  const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
5638
5561
  if (result === null) return;
5639
- const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);
5640
- const uint8ArrayResult = bufferToUint8Array(truncatedResult);
5562
+ const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
5641
5563
  const { stdioItems, objectMode } = fileDescriptors[fdNumber];
5642
- const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
5643
5564
  const { serializedResult, finalResult = serializedResult } = serializeChunks({
5644
- chunks,
5565
+ chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
5645
5566
  objectMode,
5646
5567
  encoding,
5647
5568
  lines,
@@ -5752,14 +5673,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
5752
5673
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
5753
5674
  const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
5754
5675
  const resultError = getResultError(error, exitCode, signal);
5755
- const timedOut = resultError?.code === "ETIMEDOUT";
5756
- const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
5757
5676
  return {
5758
5677
  resultError,
5759
5678
  exitCode,
5760
5679
  signal,
5761
- timedOut,
5762
- isMaxBuffer
5680
+ timedOut: resultError?.code === "ETIMEDOUT",
5681
+ isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
5763
5682
  };
5764
5683
  };
5765
5684
  const getResultError = (error, exitCode, signal) => {
@@ -5771,7 +5690,7 @@ const getResultError = (error, exitCode, signal) => {
5771
5690
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
5772
5691
  const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5773
5692
  const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
5774
- const result = spawnSubprocessSync({
5693
+ return handleResult(spawnSubprocessSync({
5775
5694
  file,
5776
5695
  commandArguments,
5777
5696
  options,
@@ -5780,15 +5699,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5780
5699
  verboseInfo,
5781
5700
  fileDescriptors,
5782
5701
  startTime
5783
- });
5784
- return handleResult(result, verboseInfo, options);
5702
+ }), verboseInfo, options);
5785
5703
  };
5786
5704
  const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5787
5705
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
5788
- const syncOptions = normalizeSyncOptions(rawOptions);
5789
- const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
5706
+ const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
5790
5707
  validateSyncOptions(options);
5791
- const fileDescriptors = handleStdioSync(options, verboseInfo);
5792
5708
  return {
5793
5709
  file,
5794
5710
  commandArguments,
@@ -5797,7 +5713,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5797
5713
  startTime,
5798
5714
  verboseInfo,
5799
5715
  options,
5800
- fileDescriptors
5716
+ fileDescriptors: handleStdioSync(options, verboseInfo)
5801
5717
  };
5802
5718
  };
5803
5719
  const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
@@ -5832,16 +5748,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5832
5748
  isMaxBuffer,
5833
5749
  verboseInfo
5834
5750
  });
5835
- const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
5836
- const all = stripNewline(getAllSync(output, options), options, "all");
5837
5751
  return getSyncResult({
5838
5752
  error,
5839
5753
  exitCode,
5840
5754
  signal,
5841
5755
  timedOut,
5842
5756
  isMaxBuffer,
5843
- stdio,
5844
- all,
5757
+ stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
5758
+ all: stripNewline(getAllSync(output, options), options, "all"),
5845
5759
  options,
5846
5760
  command,
5847
5761
  escapedCommand,
@@ -5851,8 +5765,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5851
5765
  const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
5852
5766
  try {
5853
5767
  addInputOptionsSync(fileDescriptors, options);
5854
- const normalizedOptions = normalizeSpawnSyncOptions(options);
5855
- return spawnSync(file, commandArguments, normalizedOptions);
5768
+ return spawnSync(file, commandArguments, normalizeSpawnSyncOptions(options));
5856
5769
  } catch (error) {
5857
5770
  return makeEarlyError({
5858
5771
  error,
@@ -6070,19 +5983,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
6070
5983
  writable,
6071
5984
  duplex
6072
5985
  });
6073
- const earlyError = makeEarlyError({
6074
- error,
6075
- command,
6076
- escapedCommand,
6077
- fileDescriptors,
6078
- options,
6079
- startTime,
6080
- isSync: false
6081
- });
6082
- const promise = handleDummyPromise(earlyError, verboseInfo, options);
6083
5986
  return {
6084
5987
  subprocess,
6085
- promise
5988
+ promise: handleDummyPromise(makeEarlyError({
5989
+ error,
5990
+ command,
5991
+ escapedCommand,
5992
+ fileDescriptors,
5993
+ options,
5994
+ startTime,
5995
+ isSync: false
5996
+ }), verboseInfo, options)
6086
5997
  };
6087
5998
  };
6088
5999
  const createDummyStreams = (subprocess, fileDescriptors) => {
@@ -6131,8 +6042,7 @@ const addProperties = {
6131
6042
  nodeStream: ({ value }) => ({ stream: value }),
6132
6043
  webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
6133
6044
  const objectMode = writableObjectMode || readableObjectMode;
6134
- const stream = Duplex.fromWeb(transform, { objectMode });
6135
- return { stream };
6045
+ return { stream: Duplex.fromWeb(transform, { objectMode }) };
6136
6046
  },
6137
6047
  duplex: ({ value: { transform } }) => ({ stream: transform }),
6138
6048
  native() {}
@@ -6378,10 +6288,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
6378
6288
  controller
6379
6289
  });
6380
6290
  }
6381
- for (const [outputStream, inputStreams] of pipeGroups.entries()) {
6382
- const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
6383
- pipeStreams(inputStream, outputStream);
6384
- }
6291
+ for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
6385
6292
  };
6386
6293
  const pipeTransform = (subprocess, stream, direction, fdNumber) => {
6387
6294
  if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
@@ -6643,10 +6550,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
6643
6550
  const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6644
6551
  try {
6645
6552
  const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
6646
- const destinationStream = getToStream(destination, to);
6647
6553
  return {
6648
6554
  destination,
6649
- destinationStream,
6555
+ destinationStream: getToStream(destination, to),
6650
6556
  from,
6651
6557
  unpipeSignal
6652
6558
  };
@@ -6655,19 +6561,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6655
6561
  }
6656
6562
  };
6657
6563
  const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
6658
- if (Array.isArray(firstArgument)) {
6659
- const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
6660
- return {
6661
- destination,
6662
- pipeOptions: boundOptions
6663
- };
6664
- }
6564
+ if (Array.isArray(firstArgument)) return {
6565
+ destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
6566
+ pipeOptions: boundOptions
6567
+ };
6665
6568
  if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
6666
6569
  if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
6667
6570
  const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
6668
- const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
6669
6571
  return {
6670
- destination,
6572
+ destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
6671
6573
  pipeOptions: rawOptions
6672
6574
  };
6673
6575
  }
@@ -6687,8 +6589,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
6687
6589
  } });
6688
6590
  const getSourceStream = (source, from) => {
6689
6591
  try {
6690
- const sourceStream = getFromStream(source, from);
6691
- return { sourceStream };
6592
+ return { sourceStream: getFromStream(source, from) };
6692
6593
  } catch (error) {
6693
6594
  return { sourceError: error };
6694
6595
  }
@@ -6782,9 +6683,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
6782
6683
  const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
6783
6684
  await aborted(unpipeSignal, sourceStream);
6784
6685
  await mergedStream.remove(sourceStream);
6785
- const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
6786
6686
  throw createNonCommandError({
6787
- error,
6687
+ error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
6788
6688
  fileDescriptors,
6789
6689
  sourceOptions,
6790
6690
  startTime
@@ -6887,13 +6787,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
6887
6787
  }
6888
6788
  };
6889
6789
  const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
6890
- const onStdoutChunk = on(stream, "data", {
6891
- signal: controller.signal,
6892
- highWaterMark: HIGH_WATER_MARK,
6893
- highWatermark: HIGH_WATER_MARK
6894
- });
6895
6790
  return iterateOnData({
6896
- onStdoutChunk,
6791
+ onStdoutChunk: on(stream, "data", {
6792
+ signal: controller.signal,
6793
+ highWaterMark: HIGH_WATER_MARK,
6794
+ highWatermark: HIGH_WATER_MARK
6795
+ }),
6897
6796
  controller,
6898
6797
  binary,
6899
6798
  shouldEncode,
@@ -6938,13 +6837,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
6938
6837
  await Promise.all([resumeStream(stream), logPromise]);
6939
6838
  return;
6940
6839
  }
6941
- const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
6942
6840
  const iterable = iterateForResult({
6943
6841
  stream,
6944
6842
  onStreamEnd,
6945
6843
  lines,
6946
6844
  encoding,
6947
- stripFinalNewline: stripFinalNewlineValue,
6845
+ stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
6948
6846
  allMixed
6949
6847
  });
6950
6848
  const [output] = await Promise.all([getStreamContents({
@@ -6964,15 +6862,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
6964
6862
  verboseInfo,
6965
6863
  fdNumber
6966
6864
  })) return;
6967
- const linesIterable = iterateForResult({
6865
+ await logLines(iterateForResult({
6968
6866
  stream,
6969
6867
  onStreamEnd,
6970
6868
  lines: true,
6971
6869
  encoding,
6972
6870
  stripFinalNewline: true,
6973
6871
  allMixed
6974
- });
6975
- await logLines(linesIterable, stream, fdNumber, verboseInfo);
6872
+ }), stream, fdNumber, verboseInfo);
6976
6873
  };
6977
6874
  const resumeStream = async (stream) => {
6978
6875
  await setImmediate();
@@ -7122,10 +7019,9 @@ const getAllMixed = ({ all, stdout: stdout$1, stderr }) => all && stdout$1 && st
7122
7019
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
7123
7020
  const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
7124
7021
  const logIpcOutput = (message, verboseInfo) => {
7125
- const verboseMessage = serializeVerboseMessage(message);
7126
7022
  verboseLog({
7127
7023
  type: "ipc",
7128
- verboseMessage,
7024
+ verboseMessage: serializeVerboseMessage(message),
7129
7025
  fdNumber: "ipc",
7130
7026
  verboseInfo
7131
7027
  });
@@ -7268,9 +7164,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
7268
7164
  const promises = weakMap.get(stream);
7269
7165
  const promise = createDeferred();
7270
7166
  promises.push(promise);
7271
- const resolve = promise.resolve.bind(promise);
7272
7167
  return {
7273
- resolve,
7168
+ resolve: promise.resolve.bind(promise),
7274
7169
  promises
7275
7170
  };
7276
7171
  };
@@ -7351,10 +7246,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
7351
7246
  };
7352
7247
  const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
7353
7248
  const subprocessStdout = getFromStream(subprocess, from);
7354
- const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
7355
7249
  return {
7356
7250
  subprocessStdout,
7357
- waitReadableDestroy
7251
+ waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
7358
7252
  };
7359
7253
  };
7360
7254
  const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
@@ -7432,12 +7326,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
7432
7326
  };
7433
7327
  const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
7434
7328
  const subprocessStdin = getToStream(subprocess, to);
7435
- const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
7436
- const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
7437
7329
  return {
7438
7330
  subprocessStdin,
7439
- waitWritableFinal,
7440
- waitWritableDestroy
7331
+ waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
7332
+ waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
7441
7333
  };
7442
7334
  };
7443
7335
  const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
@@ -7533,15 +7425,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
7533
7425
  const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
7534
7426
  const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
7535
7427
  const subprocessStdout = getFromStream(subprocess, from);
7536
- const onStdoutData = iterateOnSubprocessStream({
7428
+ return iterateOnStdoutData(iterateOnSubprocessStream({
7537
7429
  subprocessStdout,
7538
7430
  subprocess,
7539
7431
  binary,
7540
7432
  shouldEncode: true,
7541
7433
  encoding,
7542
7434
  preserveNewlines
7543
- });
7544
- return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
7435
+ }), subprocessStdout, subprocess);
7545
7436
  };
7546
7437
  const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
7547
7438
  try {
@@ -7623,7 +7514,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7623
7514
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
7624
7515
  const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
7625
7516
  const options = handleAsyncOptions(normalizedOptions);
7626
- const fileDescriptors = handleStdioAsync(options, verboseInfo);
7627
7517
  return {
7628
7518
  file,
7629
7519
  commandArguments,
@@ -7632,7 +7522,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7632
7522
  startTime,
7633
7523
  verboseInfo,
7634
7524
  options,
7635
- fileDescriptors
7525
+ fileDescriptors: handleStdioAsync(options, verboseInfo)
7636
7526
  };
7637
7527
  };
7638
7528
  const handleAsyncOptions = ({ timeout, signal,...options }) => {
@@ -7705,22 +7595,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
7705
7595
  });
7706
7596
  controller.abort();
7707
7597
  onInternalError.resolve();
7708
- const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));
7709
- const all = stripNewline(allResult, options, "all");
7710
- const result = getAsyncResult({
7598
+ return handleResult(getAsyncResult({
7711
7599
  errorInfo,
7712
7600
  exitCode,
7713
7601
  signal,
7714
- stdio,
7715
- all,
7602
+ stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
7603
+ all: stripNewline(allResult, options, "all"),
7716
7604
  ipcOutput,
7717
7605
  context,
7718
7606
  options,
7719
7607
  command,
7720
7608
  escapedCommand,
7721
7609
  startTime
7722
- });
7723
- return handleResult(result, verboseInfo, options);
7610
+ }), verboseInfo, options);
7724
7611
  };
7725
7612
  const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
7726
7613
  error: errorInfo.error,
@@ -7793,8 +7680,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
7793
7680
  return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
7794
7681
  };
7795
7682
  const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
7796
- const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments];
7797
- const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
7683
+ const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
7798
7684
  const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
7799
7685
  const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
7800
7686
  file: initialFile,
@@ -7930,9 +7816,8 @@ const listProjects = async () => {
7930
7816
  "projects:list",
7931
7817
  "--json"
7932
7818
  ], { shell: true });
7933
- const projectsJson = JSON.parse(projects.stdout);
7934
- return projectsJson?.result ?? [];
7935
- } catch (err) {
7819
+ return JSON.parse(projects.stdout)?.result ?? [];
7820
+ } catch {
7936
7821
  return [];
7937
7822
  }
7938
7823
  };
@@ -7951,8 +7836,7 @@ const initFirebaseUser = async (cwd) => {
7951
7836
  "list",
7952
7837
  "--format=json"
7953
7838
  ], { shell: true });
7954
- const authListJson = JSON.parse(authList.stdout);
7955
- if (authListJson.length === 0) await execa("gcloud", ["auth", "login"], {
7839
+ if (JSON.parse(authList.stdout).length === 0) await execa("gcloud", ["auth", "login"], {
7956
7840
  stdio: "inherit",
7957
7841
  shell: true
7958
7842
  });
@@ -8025,7 +7909,7 @@ const initFirebaseUser = async (cwd) => {
8025
7909
  shell: true
8026
7910
  });
8027
7911
  if (indexes.exitCode !== 0) throw new Error(indexes.stderr);
8028
- } catch (err) {
7912
+ } catch {
8029
7913
  await execa("gcloud", [
8030
7914
  "firestore",
8031
7915
  "databases",
@@ -8047,8 +7931,7 @@ const initFirebaseUser = async (cwd) => {
8047
7931
  `--project=${projectId}`,
8048
7932
  "--format=json"
8049
7933
  ], { shell: true });
8050
- const bucketsJson = JSON.parse(buckets.stdout);
8051
- storageBucket = bucketsJson.find((bucket) => bucket.name === `${projectId}.firebasestorage.app` || bucket.name === `${projectId}.appspot.com`)?.name;
7934
+ storageBucket = JSON.parse(buckets.stdout).find((bucket) => bucket.name === `${projectId}.firebasestorage.app` || bucket.name === `${projectId}.appspot.com`)?.name;
8052
7935
  if (!storageBucket) {
8053
7936
  f.error("Storage Bucket not found");
8054
7937
  f.step("Please Go to the following links to enable Firestore and Storage and Billing");
@@ -8185,10 +8068,8 @@ function normalizeIndex(index) {
8185
8068
  };
8186
8069
  }
8187
8070
  const mergeIndexes = (originalIndexes, newIndexes) => {
8188
- const mergedIndexes = originalIndexes.indexes.concat(newIndexes.indexes);
8189
- const uniqueIndexes = uniqWith(mergedIndexes, (a$1, b$2) => isEqual(normalizeIndex(a$1), normalizeIndex(b$2)));
8190
8071
  return {
8191
- indexes: uniqueIndexes,
8072
+ indexes: uniqWith(originalIndexes.indexes.concat(newIndexes.indexes), (a$1, b$2) => isEqual(normalizeIndex(a$1), normalizeIndex(b$2))),
8192
8073
  fieldOverrides: merge(originalIndexes.fieldOverrides, newIndexes.fieldOverrides)
8193
8074
  };
8194
8075
  };
@@ -8202,15 +8083,14 @@ const deployFirestore = async (cwd) => {
8202
8083
  fieldOverrides: []
8203
8084
  };
8204
8085
  try {
8205
- const originalStdout = JSON.parse(original.stdout);
8206
- originalIndexes = originalStdout ?? {
8086
+ originalIndexes = JSON.parse(original.stdout) ?? {
8207
8087
  indexes: [],
8208
8088
  fieldOverrides: []
8209
8089
  };
8210
8090
  } catch {}
8211
- const newIndexes = JSON.parse(await fs.promises.readFile(path.join(cwd, "firestore.indexes.json"), "utf-8"));
8091
+ const newIndexes = JSON.parse(await fs.promises.readFile(path$1.join(cwd, "firestore.indexes.json"), "utf-8"));
8212
8092
  const mergedIndexes = mergeIndexes(originalIndexes, newIndexes);
8213
- await fs.promises.writeFile(path.join(cwd, "firestore.indexes.json"), JSON.stringify(mergedIndexes, null, 2));
8093
+ await fs.promises.writeFile(path$1.join(cwd, "firestore.indexes.json"), JSON.stringify(mergedIndexes, null, 2));
8214
8094
  try {
8215
8095
  await execa("npx", [
8216
8096
  "firebase",
@@ -8259,8 +8139,7 @@ const printTemplate = async (projectId, region) => {
8259
8139
  "--format=json"
8260
8140
  ], { shell: true });
8261
8141
  const parsedData = JSON.parse(stdout$1);
8262
- const url = parsedData?.serviceConfig?.uri ?? parsedData.url;
8263
- const functionUrl = `${url}/api/check-update`;
8142
+ const functionUrl = `${parsedData?.serviceConfig?.uri ?? parsedData.url}/api/check-update`;
8264
8143
  Me(transformTemplate(SOURCE_TEMPLATE, { source: functionUrl }));
8265
8144
  } catch (error) {
8266
8145
  if (error instanceof ExecaError) f.error(error.stderr || error.stdout || error.message);
@@ -8272,23 +8151,21 @@ const checkIfGcloudCliInstalled = async () => {
8272
8151
  try {
8273
8152
  await execa("gcloud", ["--version"], { shell: true });
8274
8153
  return true;
8275
- } catch (error) {
8154
+ } catch {
8276
8155
  return false;
8277
8156
  }
8278
8157
  };
8279
8158
  const runInit = async ({ build }) => {
8280
- const isGcloudCliInstalled = await checkIfGcloudCliInstalled();
8281
- if (!isGcloudCliInstalled) {
8159
+ if (!await checkIfGcloudCliInstalled()) {
8282
8160
  f.error("gcloud CLI is not installed");
8283
8161
  f.step("Please go to the following link to install the gcloud CLI");
8284
8162
  f.step(link("https://cloud.google.com/sdk/docs/install"));
8285
8163
  process.exit(1);
8286
8164
  }
8287
- const firebaseDir = path.dirname(path.dirname(__require.resolve("@hot-updater/firebase/functions")));
8288
- const { tmpDir, removeTmpDir } = await copyDirToTmp(firebaseDir);
8289
- const functionsDir = path.join(tmpDir, "functions");
8290
- const functionsIndexPath = path.join(functionsDir, "index.cjs");
8291
- await fs.promises.rename(path.join(functionsDir, "_package.json"), path.join(functionsDir, "package.json"));
8165
+ const { tmpDir, removeTmpDir } = await copyDirToTmp(path$1.dirname(path$1.dirname(__require.resolve("@hot-updater/firebase/functions"))));
8166
+ const functionsDir = path$1.join(tmpDir, "functions");
8167
+ const functionsIndexPath = path$1.join(functionsDir, "index.cjs");
8168
+ await fs.promises.rename(path$1.join(functionsDir, "_package.json"), path$1.join(functionsDir, "package.json"));
8292
8169
  const initializeVariable = await initFirebaseUser(tmpDir);
8293
8170
  let currentRegion;
8294
8171
  await setEnv({
@@ -8324,9 +8201,7 @@ const runInit = async ({ build }) => {
8324
8201
  cwd: tmpDir,
8325
8202
  shell: true
8326
8203
  });
8327
- const parsedData = JSON.parse(stdout$1);
8328
- const functionsData = parsedData.result || [];
8329
- const hotUpdater = functionsData.find((fn) => fn.id === "hot-updater");
8204
+ const hotUpdater = (JSON.parse(stdout$1).result || []).find((fn) => fn.id === "hot-updater");
8330
8205
  if (hotUpdater?.region) {
8331
8206
  currentRegion = hotUpdater.region;
8332
8207
  isFunctionsExist = true;
@@ -8367,10 +8242,7 @@ const runInit = async ({ build }) => {
8367
8242
  cwd: tmpDir,
8368
8243
  shell: true
8369
8244
  });
8370
- const functionsListJson = JSON.parse(functionsList.stdout);
8371
- const functionsData = functionsListJson.result || [];
8372
- const hotUpdater = functionsData.find((fn) => fn.id === "hot-updater");
8373
- const account = hotUpdater?.serviceAccount;
8245
+ const account = (JSON.parse(functionsList.stdout).result || []).find((fn) => fn.id === "hot-updater")?.serviceAccount;
8374
8246
  if (!account) {
8375
8247
  f.error("hot-updater function not found");
8376
8248
  await removeTmpDir();
@@ -8382,9 +8254,7 @@ const runInit = async ({ build }) => {
8382
8254
  initializeVariable.projectId,
8383
8255
  "--format=json"
8384
8256
  ], { shell: true });
8385
- const iamJson = JSON.parse(checkIam.stdout);
8386
- const hasTokenCreator = iamJson.bindings.some((binding) => binding.role === "roles/iam.serviceAccountTokenCreator" && binding.members.includes(`serviceAccount:${account}`));
8387
- if (!hasTokenCreator) try {
8257
+ if (!JSON.parse(checkIam.stdout).bindings.some((binding) => binding.role === "roles/iam.serviceAccountTokenCreator" && binding.members.includes(`serviceAccount:${account}`))) try {
8388
8258
  message("Adding IAM Service Account Token Creator role to the service account");
8389
8259
  await execa("gcloud", [
8390
8260
  "projects",
@@ -8397,7 +8267,7 @@ const runInit = async ({ build }) => {
8397
8267
  shell: true
8398
8268
  });
8399
8269
  f.success("IAM Service Account Token Creator role has been added to the service account");
8400
- } catch (err) {
8270
+ } catch {
8401
8271
  f.error("Please go to the following link to add the IAM Service Account Token Creator role to the service account");
8402
8272
  f.step(link(`https://console.cloud.google.com/iam-admin/iam/project/${initializeVariable.projectId}/serviceaccounts/${account}/edit?inv=1`));
8403
8273
  await removeTmpDir();