@hot-updater/firebase 0.20.11 → 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.
@@ -24,10 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  }) : target, mod));
25
25
 
26
26
  //#endregion
27
- let fs = require("fs");
28
- fs = __toESM(fs);
29
- let path = require("path");
30
- path = __toESM(path);
31
27
  let node_util = require("node:util");
32
28
  node_util = __toESM(node_util);
33
29
  let node_process = require("node:process");
@@ -46,6 +42,10 @@ let node_string_decoder = require("node:string_decoder");
46
42
  node_string_decoder = __toESM(node_string_decoder);
47
43
  let node_path = require("node:path");
48
44
  node_path = __toESM(node_path);
45
+ let path = require("path");
46
+ path = __toESM(path);
47
+ let fs = require("fs");
48
+ fs = __toESM(fs);
49
49
  let node_timers_promises = require("node:timers/promises");
50
50
  node_timers_promises = __toESM(node_timers_promises);
51
51
  let node_os = require("node:os");
@@ -455,16 +455,16 @@ function G(t, u$2, F$1) {
455
455
  `).map((e$1) => oD(e$1, u$2, F$1)).join(`
456
456
  `);
457
457
  }
458
- const aD = [
459
- "up",
460
- "down",
461
- "left",
462
- "right",
463
- "space",
464
- "enter",
465
- "cancel"
466
- ], c$1 = {
467
- actions: new Set(aD),
458
+ const c$1 = {
459
+ actions: new Set([
460
+ "up",
461
+ "down",
462
+ "left",
463
+ "right",
464
+ "space",
465
+ "enter",
466
+ "cancel"
467
+ ]),
468
468
  aliases: new Map([
469
469
  ["k", "up"],
470
470
  ["j", "down"],
@@ -504,9 +504,8 @@ function cD({ input: t = node_process.stdin, output: u$2 = node_process.stdout,
504
504
  });
505
505
  node_readline.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
506
506
  const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
507
- const E = String(D$1);
508
507
  if (k$1([
509
- E,
508
+ String(D$1),
510
509
  C$1,
511
510
  o$2
512
511
  ], "cancel")) {
@@ -695,10 +694,7 @@ let dD = class extends x {
695
694
  if (u$2.group === !0) {
696
695
  const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
697
696
  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));
698
- } else {
699
- const F$1 = this.value.includes(u$2.value);
700
- this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
701
- }
697
+ } else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
702
698
  }
703
699
  };
704
700
  var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
@@ -731,12 +727,10 @@ let wD = class extends x {
731
727
  return this.options[this.cursor].value;
732
728
  }
733
729
  toggleAll() {
734
- const u$2 = this.value.length === this.options.length;
735
- this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
730
+ this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
736
731
  }
737
732
  toggleValue() {
738
- const u$2 = this.value.includes(this._value);
739
- this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
733
+ this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
740
734
  }
741
735
  };
742
736
  var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
@@ -1163,8 +1157,7 @@ ${J}${r$1.trimStart()}`), s = 3 + (0, node_util.stripVTControlCharacters)(r$1.tr
1163
1157
  ], s = V ? 80 : 120, r$1 = process.env.CI === "true";
1164
1158
  let i$1, a$1, c$2 = !1, l$1 = "", $$2, p$1 = performance.now();
1165
1159
  const M$1 = (m$1) => {
1166
- const h$2 = m$1 > 1 ? "Something went wrong" : "Canceled";
1167
- c$2 && N$1(h$2, m$1);
1160
+ c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
1168
1161
  }, v$1 = () => M$1(2), x$1 = () => M$1(1), j$1 = () => {
1169
1162
  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);
1170
1163
  }, E = () => {
@@ -1249,9 +1242,7 @@ function orderBy(arr, criteria, orders) {
1249
1242
  const order = ordersLength > i$1 ? orders[i$1] : orders[ordersLength - 1];
1250
1243
  const criterion = criteria[i$1];
1251
1244
  const criterionIsFunction = typeof criterion === "function";
1252
- const valueA = criterionIsFunction ? criterion(a$1) : a$1[criterion];
1253
- const valueB = criterionIsFunction ? criterion(b$2) : b$2[criterion];
1254
- const result = compareValues(valueA, valueB, order);
1245
+ const result = compareValues(criterionIsFunction ? criterion(a$1) : a$1[criterion], criterionIsFunction ? criterion(b$2) : b$2[criterion], order);
1255
1246
  if (result !== 0) return result;
1256
1247
  }
1257
1248
  return 0;
@@ -1270,8 +1261,7 @@ function uniqWith(arr, areItemsEqual) {
1270
1261
  const result = [];
1271
1262
  for (let i$1 = 0; i$1 < arr.length; i$1++) {
1272
1263
  const item = arr[i$1];
1273
- const isUniq = result.every((v$1) => !areItemsEqual(v$1, item));
1274
- if (isUniq) result.push(item);
1264
+ if (result.every((v$1) => !areItemsEqual(v$1, item))) result.push(item);
1275
1265
  }
1276
1266
  return result;
1277
1267
  }
@@ -1327,8 +1317,7 @@ const float64ArrayTag = "[object Float64Array]";
1327
1317
  function isPlainObject$1(value) {
1328
1318
  if (!value || typeof value !== "object") return false;
1329
1319
  const proto = Object.getPrototypeOf(value);
1330
- const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
1331
- if (!hasObjectPrototype) return false;
1320
+ if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
1332
1321
  return Object.prototype.toString.call(value) === "[object Object]";
1333
1322
  }
1334
1323
 
@@ -1384,11 +1373,7 @@ function areObjectsEqual(a$1, b$2, stack, areValuesEqual) {
1384
1373
  if (aTag !== bTag) return false;
1385
1374
  switch (aTag) {
1386
1375
  case stringTag: return a$1.toString() === b$2.toString();
1387
- case numberTag: {
1388
- const x$1 = a$1.valueOf();
1389
- const y$1 = b$2.valueOf();
1390
- return eq(x$1, y$1);
1391
- }
1376
+ case numberTag: return eq(a$1.valueOf(), b$2.valueOf());
1392
1377
  case booleanTag:
1393
1378
  case dateTag:
1394
1379
  case symbolTag: return Object.is(a$1.valueOf(), b$2.valueOf());
@@ -1445,8 +1430,7 @@ function areObjectsEqual(a$1, b$2, stack, areValuesEqual) {
1445
1430
  return areObjectsEqual(new Uint8Array(a$1), new Uint8Array(b$2), stack, areValuesEqual);
1446
1431
  case errorTag: return a$1.name === b$2.name && a$1.message === b$2.message;
1447
1432
  case objectTag: {
1448
- const areEqualInstances = areObjectsEqual(a$1.constructor, b$2.constructor, stack, areValuesEqual) || isPlainObject$1(a$1) && isPlainObject$1(b$2);
1449
- if (!areEqualInstances) return false;
1433
+ if (!(areObjectsEqual(a$1.constructor, b$2.constructor, stack, areValuesEqual) || isPlainObject$1(a$1) && isPlainObject$1(b$2))) return false;
1450
1434
  const aKeys = [...Object.keys(a$1), ...getSymbols(a$1)];
1451
1435
  const bKeys = [...Object.keys(b$2), ...getSymbols(b$2)];
1452
1436
  if (aKeys.length !== bKeys.length) return false;
@@ -1521,8 +1505,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
1521
1505
  const textDecoder = new TextDecoder();
1522
1506
  const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
1523
1507
  const joinToString = (uint8ArraysOrStrings, encoding) => {
1524
- const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);
1525
- return strings.join("");
1508
+ return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
1526
1509
  };
1527
1510
  const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
1528
1511
  if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
@@ -1577,8 +1560,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
1577
1560
  const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
1578
1561
  if (index === expressions.length) return newTokens;
1579
1562
  const expression = expressions[index];
1580
- const expressionTokens = Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)];
1581
- return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
1563
+ return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
1582
1564
  };
1583
1565
  const splitByWhitespaces = (template, rawTemplate) => {
1584
1566
  if (rawTemplate.length === 0) return {
@@ -1665,8 +1647,7 @@ const normalizeFdSpecificOptions = (options) => {
1665
1647
  };
1666
1648
  const normalizeFdSpecificOption = (options, optionName) => {
1667
1649
  const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
1668
- const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
1669
- return addDefaultValue$1(optionArray, optionName);
1650
+ return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
1670
1651
  };
1671
1652
  const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
1672
1653
  const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
@@ -1696,12 +1677,11 @@ const parseFd = (fdName) => {
1696
1677
  };
1697
1678
  const FD_REGEXP = /^fd(\d+)$/;
1698
1679
  const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
1699
- const verboseDefault = (0, node_util.debuglog)("execa").enabled ? "full" : "none";
1700
1680
  const DEFAULT_OPTIONS = {
1701
1681
  lines: false,
1702
1682
  buffer: true,
1703
1683
  maxBuffer: 1e3 * 1e3 * 100,
1704
- verbose: verboseDefault,
1684
+ verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
1705
1685
  stripFinalNewline: true
1706
1686
  };
1707
1687
  const FD_SPECIFIC_OPTIONS = [
@@ -1734,11 +1714,9 @@ const VERBOSE_VALUES = [
1734
1714
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
1735
1715
  const joinCommand = (filePath, rawArguments) => {
1736
1716
  const fileAndArguments = [filePath, ...rawArguments];
1737
- const command = fileAndArguments.join(" ");
1738
- const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
1739
1717
  return {
1740
- command,
1741
- escapedCommand
1718
+ command: fileAndArguments.join(" "),
1719
+ escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
1742
1720
  };
1743
1721
  };
1744
1722
  const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
@@ -2179,13 +2157,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
2179
2157
  //#endregion
2180
2158
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
2181
2159
  const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
2182
- const verboseObject = getVerboseObject({
2160
+ const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
2183
2161
  type,
2184
2162
  result,
2185
2163
  verboseInfo
2186
- });
2187
- const printedLines = getPrintedLines(verboseMessage, verboseObject);
2188
- const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
2164
+ })), verboseInfo, fdNumber);
2189
2165
  if (finalLines !== "") console.warn(finalLines.slice(0, -1));
2190
2166
  };
2191
2167
  const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
@@ -2202,16 +2178,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
2202
2178
  message
2203
2179
  }));
2204
2180
  const getPrintedLine = (verboseObject) => {
2205
- const verboseLine = defaultVerboseFunction(verboseObject);
2206
2181
  return {
2207
- verboseLine,
2182
+ verboseLine: defaultVerboseFunction(verboseObject),
2208
2183
  verboseObject
2209
2184
  };
2210
2185
  };
2211
2186
  const serializeVerboseMessage = (message) => {
2212
- const messageString = typeof message === "string" ? message : (0, node_util.inspect)(message);
2213
- const escapedMessage = escapeLines(messageString);
2214
- return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
2187
+ return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
2215
2188
  };
2216
2189
  const TAB_SIZE = 2;
2217
2190
 
@@ -2230,11 +2203,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
2230
2203
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
2231
2204
  const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
2232
2205
  validateVerbose(verbose);
2233
- const commandId = getCommandId(verbose);
2234
2206
  return {
2235
2207
  verbose,
2236
2208
  escapedCommand,
2237
- commandId,
2209
+ commandId: getCommandId(verbose),
2238
2210
  rawOptions
2239
2211
  };
2240
2212
  };
@@ -2261,8 +2233,7 @@ const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - start
2261
2233
  const handleCommand = (filePath, rawArguments, rawOptions) => {
2262
2234
  const startTime = getStartTime();
2263
2235
  const { command, escapedCommand } = joinCommand(filePath, rawArguments);
2264
- const verbose = normalizeFdSpecificOption(rawOptions, "verbose");
2265
- const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
2236
+ const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
2266
2237
  logCommand(escapedCommand, verboseInfo);
2267
2238
  return {
2268
2239
  command,
@@ -2330,8 +2301,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
2330
2301
  var g$2 = parseInt("010", 8);
2331
2302
  var o$2 = parseInt("001", 8);
2332
2303
  var ug = u$2 | g$2;
2333
- var ret = mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2334
- return ret;
2304
+ return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2335
2305
  }
2336
2306
  }) });
2337
2307
 
@@ -2413,8 +2383,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2413
2383
  const ppRaw = pathEnv[i$1];
2414
2384
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2415
2385
  const pCmd = path$9.join(pathPart, cmd);
2416
- const p$1 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2417
- resolve(subStep(p$1, i$1, 0));
2386
+ resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
2418
2387
  });
2419
2388
  const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
2420
2389
  if (ii === pathExt.length) return resolve(step(i$1 + 1));
@@ -2439,8 +2408,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2439
2408
  for (let j$1 = 0; j$1 < pathExt.length; j$1++) {
2440
2409
  const cur = p$1 + pathExt[j$1];
2441
2410
  try {
2442
- const is = isexe.sync(cur, { pathExt: pathExtExe });
2443
- if (is) if (opt.all) found.push(cur);
2411
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
2444
2412
  else return cur;
2445
2413
  } catch (ex) {}
2446
2414
  }
@@ -2458,8 +2426,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2458
2426
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
2459
2427
  const pathKey$1 = (options = {}) => {
2460
2428
  const environment = options.env || process.env;
2461
- const platform$1 = options.platform || process.platform;
2462
- if (platform$1 !== "win32") return "PATH";
2429
+ if ((options.platform || process.platform) !== "win32") return "PATH";
2463
2430
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2464
2431
  };
2465
2432
  module.exports = pathKey$1;
@@ -2587,12 +2554,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
2587
2554
  parsed.command = path$7.normalize(parsed.command);
2588
2555
  parsed.command = escape.command(parsed.command);
2589
2556
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2590
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2591
2557
  parsed.args = [
2592
2558
  "/d",
2593
2559
  "/s",
2594
2560
  "/c",
2595
- `"${shellCommand}"`
2561
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
2596
2562
  ];
2597
2563
  parsed.command = process.env.comspec || "cmd.exe";
2598
2564
  parsed.options.windowsVerbatimArguments = true;
@@ -2745,9 +2711,7 @@ const npmRunPathEnv = ({ env: env$1 = node_process.default.env,...options } = {}
2745
2711
  //#endregion
2746
2712
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
2747
2713
  const getFinalError = (originalError, message, isSync) => {
2748
- const ErrorClass = isSync ? ExecaSyncError : ExecaError;
2749
- const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
2750
- return new ErrorClass(message, options);
2714
+ return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
2751
2715
  };
2752
2716
  var DiscardedError = class extends Error {};
2753
2717
  const setErrorName = (ErrorClass, value) => {
@@ -3066,16 +3030,14 @@ const SIGNALS = [
3066
3030
  //#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
3067
3031
  const getSignals = () => {
3068
3032
  const realtimeSignals = getRealtimeSignals();
3069
- const signals$1 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
3070
- return signals$1;
3033
+ return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
3071
3034
  };
3072
3035
  const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
3073
3036
  const { signals: { [name]: constantSignal } } = node_os.constants;
3074
3037
  const supported = constantSignal !== void 0;
3075
- const number = supported ? constantSignal : defaultNumber;
3076
3038
  return {
3077
3039
  name,
3078
- number,
3040
+ number: supported ? constantSignal : defaultNumber,
3079
3041
  description,
3080
3042
  supported,
3081
3043
  action,
@@ -3487,8 +3449,7 @@ const isConnected = (anyProcess) => {
3487
3449
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
3488
3450
  const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
3489
3451
  if (!strict) return message;
3490
- const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);
3491
- const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
3452
+ const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
3492
3453
  return {
3493
3454
  id: count++,
3494
3455
  type: REQUEST_TYPE,
@@ -3561,11 +3522,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
3561
3522
  const startSendMessage = (anyProcess, wrappedMessage, strict) => {
3562
3523
  if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
3563
3524
  const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
3564
- const onMessageSent = createDeferred();
3565
- const id = strict ? wrappedMessage.id : void 0;
3566
3525
  const outgoingMessage = {
3567
- onMessageSent,
3568
- id
3526
+ onMessageSent: createDeferred(),
3527
+ id: strict ? wrappedMessage.id : void 0
3569
3528
  };
3570
3529
  outgoingMessages.add(outgoingMessage);
3571
3530
  return {
@@ -3726,8 +3685,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
3726
3685
  })] : [];
3727
3686
  const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
3728
3687
  await onAbortedSignal(cancelSignal, signal);
3729
- const reason = getReason(cancelSignal);
3730
- await sendAbort(subprocess, reason);
3688
+ await sendAbort(subprocess, getReason(cancelSignal));
3731
3689
  killOnTimeout({
3732
3690
  kill: subprocess.kill,
3733
3691
  forceKillAfterDelay,
@@ -3901,8 +3859,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
3901
3859
  rawOptions.cwd = normalizeCwd(rawOptions.cwd);
3902
3860
  const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
3903
3861
  const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
3904
- const fdOptions = normalizeFdSpecificOptions(initialOptions);
3905
- const options = addDefaultOptions(fdOptions);
3862
+ const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
3906
3863
  validateTimeout(options);
3907
3864
  validateEncoding(options);
3908
3865
  validateIpcInputOption(options);
@@ -4059,7 +4016,7 @@ const u = Object.create(a, {
4059
4016
  }
4060
4017
  });
4061
4018
  function h({ preventCancel: r$1 = !1 } = {}) {
4062
- const e$1 = this.getReader(), t = new c(e$1, r$1), s = Object.create(u);
4019
+ const t = new c(this.getReader(), r$1), s = Object.create(u);
4063
4020
  return s[n] = t, s;
4064
4021
  }
4065
4022
 
@@ -4108,18 +4065,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
4108
4065
  const state = init();
4109
4066
  state.length = 0;
4110
4067
  try {
4111
- for await (const chunk of asyncIterable) {
4112
- const chunkType = getChunkType(chunk);
4113
- const convertedChunk = convertChunk[chunkType](chunk, state);
4114
- appendChunk({
4115
- convertedChunk,
4116
- state,
4117
- getSize,
4118
- truncateChunk,
4119
- addChunk,
4120
- maxBuffer
4121
- });
4122
- }
4068
+ for await (const chunk of asyncIterable) appendChunk({
4069
+ convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
4070
+ state,
4071
+ getSize,
4072
+ truncateChunk,
4073
+ addChunk,
4074
+ maxBuffer
4075
+ });
4123
4076
  appendFinalChunk({
4124
4077
  state,
4125
4078
  convertChunk,
@@ -4309,10 +4262,9 @@ const stringMethods = {
4309
4262
  const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
4310
4263
  if (!(error instanceof MaxBufferError)) throw error;
4311
4264
  if (fdNumber === "all") return error;
4312
- const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
4313
4265
  error.maxBufferInfo = {
4314
4266
  fdNumber,
4315
- unit
4267
+ unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
4316
4268
  };
4317
4269
  stream.destroy();
4318
4270
  throw error;
@@ -4382,19 +4334,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
4382
4334
  killSignal
4383
4335
  });
4384
4336
  const originalMessage = getOriginalMessage(originalError, cwd);
4385
- const suffix = originalMessage === void 0 ? "" : `\n${originalMessage}`;
4386
- const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
4387
- const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
4388
- const message = [
4389
- shortMessage,
4390
- ...messageStdio,
4391
- ...stdio.slice(3),
4392
- ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4393
- ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
4337
+ const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
4394
4338
  return {
4395
4339
  originalMessage,
4396
4340
  shortMessage,
4397
- message
4341
+ message: [
4342
+ shortMessage,
4343
+ ...all === void 0 ? [stdio[2], stdio[1]] : [all],
4344
+ ...stdio.slice(3),
4345
+ ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4346
+ ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
4398
4347
  };
4399
4348
  };
4400
4349
  const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
@@ -4415,8 +4364,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
4415
4364
  const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
4416
4365
  const getOriginalMessage = (originalError, cwd) => {
4417
4366
  if (originalError instanceof DiscardedError) return;
4418
- const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError);
4419
- const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
4367
+ const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
4420
4368
  return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
4421
4369
  };
4422
4370
  const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, node_util.inspect)(ipcMessage);
@@ -4538,11 +4486,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
4538
4486
  const normalizeExitPayload = (rawExitCode, rawSignal) => {
4539
4487
  const exitCode = rawExitCode === null ? void 0 : rawExitCode;
4540
4488
  const signal = rawSignal === null ? void 0 : rawSignal;
4541
- const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
4542
4489
  return {
4543
4490
  exitCode,
4544
4491
  signal,
4545
- signalDescription
4492
+ signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
4546
4493
  };
4547
4494
  };
4548
4495
 
@@ -4607,8 +4554,7 @@ function prettyMilliseconds(milliseconds, options) {
4607
4554
  let result = [];
4608
4555
  const floorDecimals = (value, decimalDigits) => {
4609
4556
  const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
4610
- const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits;
4611
- return flooredValue.toFixed(decimalDigits);
4557
+ return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
4612
4558
  };
4613
4559
  const add = (value, long, short, valueString) => {
4614
4560
  if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
@@ -4645,14 +4591,11 @@ function prettyMilliseconds(milliseconds, options) {
4645
4591
  } else {
4646
4592
  const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
4647
4593
  const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
4648
- const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4649
- const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
4594
+ const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4650
4595
  add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
4651
4596
  }
4652
4597
  } else {
4653
- const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
4654
- const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
4655
- const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
4598
+ const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
4656
4599
  const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
4657
4600
  add(Number.parseFloat(secondsString), "second", "s", secondsString);
4658
4601
  }
@@ -4681,10 +4624,9 @@ const logResult = (result, verboseInfo) => {
4681
4624
  logDuration(result, verboseInfo);
4682
4625
  };
4683
4626
  const logDuration = (result, verboseInfo) => {
4684
- const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
4685
4627
  verboseLog({
4686
4628
  type: "duration",
4687
- verboseMessage,
4629
+ verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
4688
4630
  verboseInfo,
4689
4631
  result
4690
4632
  });
@@ -4811,18 +4753,16 @@ const TYPE_TO_MESSAGE = {
4811
4753
  const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
4812
4754
  const getOutputObjectModes = (objectMode, index, newTransforms) => {
4813
4755
  const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
4814
- const readableObjectMode = objectMode ?? writableObjectMode;
4815
4756
  return {
4816
4757
  writableObjectMode,
4817
- readableObjectMode
4758
+ readableObjectMode: objectMode ?? writableObjectMode
4818
4759
  };
4819
4760
  };
4820
4761
  const getInputObjectModes = (objectMode, index, newTransforms) => {
4821
4762
  const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
4822
- const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
4823
4763
  return {
4824
4764
  writableObjectMode,
4825
- readableObjectMode
4765
+ readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
4826
4766
  };
4827
4767
  };
4828
4768
  const getFdObjectMode = (stdioItems, direction) => {
@@ -5131,8 +5071,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
5131
5071
  const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
5132
5072
  const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
5133
5073
  if (duplicateStdioItems.length === 0) return;
5134
- const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction);
5135
- throwOnDuplicateStream(differentStdioItem, optionName, type);
5074
+ throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
5136
5075
  return direction === "output" ? duplicateStdioItems[0].stream : void 0;
5137
5076
  };
5138
5077
  const hasSameValue = ({ type, value }, secondValue) => {
@@ -5141,8 +5080,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
5141
5080
  return value === secondValue;
5142
5081
  };
5143
5082
  const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
5144
- const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform);
5145
- throwOnDuplicateStream(duplicateStdioItem, optionName, type);
5083
+ throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
5146
5084
  };
5147
5085
  const throwOnDuplicateStream = (stdioItem, optionName, type) => {
5148
5086
  if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
@@ -5151,15 +5089,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
5151
5089
  //#endregion
5152
5090
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
5153
5091
  const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
5154
- const stdio = normalizeStdioOption(options, verboseInfo, isSync);
5155
- const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
5156
- stdioOption,
5157
- fdNumber,
5158
- options,
5159
- isSync
5160
- }));
5161
5092
  const fileDescriptors = getFinalFileDescriptors({
5162
- initialFileDescriptors,
5093
+ initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
5094
+ stdioOption,
5095
+ fdNumber,
5096
+ options,
5097
+ isSync
5098
+ })),
5163
5099
  addProperties: addProperties$2,
5164
5100
  options,
5165
5101
  isSync
@@ -5176,14 +5112,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
5176
5112
  optionName
5177
5113
  });
5178
5114
  const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
5179
- const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({
5115
+ const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
5180
5116
  stdioItem,
5181
5117
  isStdioArray,
5182
5118
  fdNumber,
5183
5119
  direction,
5184
5120
  isSync
5185
- }));
5186
- const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
5121
+ })), optionName, direction, options);
5187
5122
  const objectMode = getFdObjectMode(normalizedStdioItems, direction);
5188
5123
  validateFileObjectMode(normalizedStdioItems, objectMode);
5189
5124
  return {
@@ -5193,9 +5128,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
5193
5128
  };
5194
5129
  };
5195
5130
  const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
5196
- const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];
5197
- const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
5198
- const stdioItems = filterDuplicates(initialStdioItems);
5131
+ const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
5199
5132
  const isStdioArray = stdioItems.length > 1;
5200
5133
  validateStdioArray(stdioItems, isStdioArray, optionName);
5201
5134
  validateStreams(stdioItems);
@@ -5245,18 +5178,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
5245
5178
  }
5246
5179
  };
5247
5180
  const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
5248
- const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
5249
- stdioItem,
5250
- addProperties: addProperties$2,
5251
- direction,
5252
- options,
5253
- fileDescriptors,
5254
- isSync
5255
- }));
5256
5181
  return {
5257
5182
  direction,
5258
5183
  objectMode,
5259
- stdioItems: finalStdioItems
5184
+ stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
5185
+ stdioItem,
5186
+ addProperties: addProperties$2,
5187
+ direction,
5188
+ options,
5189
+ fileDescriptors,
5190
+ isSync
5191
+ }))
5260
5192
  };
5261
5193
  };
5262
5194
  const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
@@ -5386,8 +5318,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
5386
5318
  yield chunk;
5387
5319
  return;
5388
5320
  }
5389
- const newline = isWindowsNewline ? windowsNewline : unixNewline;
5390
- yield concatBytes(chunk, newline);
5321
+ yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
5391
5322
  };
5392
5323
  const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
5393
5324
  const linesStringInfo = {
@@ -5532,7 +5463,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5532
5463
  const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
5533
5464
  const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
5534
5465
  const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
5535
- const stream = new node_stream.Transform({
5466
+ return { stream: new node_stream.Transform({
5536
5467
  writableObjectMode,
5537
5468
  writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
5538
5469
  readableObjectMode,
@@ -5548,16 +5479,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5548
5479
  finalMethod([generators], this, done);
5549
5480
  },
5550
5481
  destroy: destroyMethod
5551
- });
5552
- return { stream };
5482
+ }) };
5553
5483
  };
5554
5484
  const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
5555
5485
  const generators = stdioItems.filter(({ type }) => type === "generator");
5556
5486
  const reversedGenerators = isInput ? generators.reverse() : generators;
5557
- for (const { value, optionName } of reversedGenerators) {
5558
- const generators$1 = addInternalGenerators(value, encoding, optionName);
5559
- chunks = runTransformSync(generators$1, chunks);
5560
- }
5487
+ for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
5561
5488
  return chunks;
5562
5489
  };
5563
5490
  const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
@@ -5594,9 +5521,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
5594
5521
  const [{ type, optionName }] = allStdioItems;
5595
5522
  throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
5596
5523
  }
5597
- const allContents = allStdioItems.map(({ contents }) => contents);
5598
- const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
5599
- options.input = joinToUint8Array(transformedContents);
5524
+ options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
5600
5525
  };
5601
5526
  const applySingleInputGeneratorsSync = (contents, stdioItems) => {
5602
5527
  const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
@@ -5621,10 +5546,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
5621
5546
  };
5622
5547
  const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
5623
5548
  const logLine = (line, fdNumber, verboseInfo) => {
5624
- const verboseMessage = serializeVerboseMessage(line);
5625
5549
  verboseLog({
5626
5550
  type: "output",
5627
- verboseMessage,
5551
+ verboseMessage: serializeVerboseMessage(line),
5628
5552
  fdNumber,
5629
5553
  verboseInfo
5630
5554
  });
@@ -5636,28 +5560,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
5636
5560
  if (output === null) return { output: Array.from({ length: 3 }) };
5637
5561
  const state = {};
5638
5562
  const outputFiles = /* @__PURE__ */ new Set([]);
5639
- const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
5640
- result,
5641
- fileDescriptors,
5642
- fdNumber,
5643
- state,
5644
- outputFiles,
5645
- isMaxBuffer,
5646
- verboseInfo
5647
- }, options));
5648
5563
  return {
5649
- output: transformedOutput,
5564
+ output: output.map((result, fdNumber) => transformOutputResultSync({
5565
+ result,
5566
+ fileDescriptors,
5567
+ fdNumber,
5568
+ state,
5569
+ outputFiles,
5570
+ isMaxBuffer,
5571
+ verboseInfo
5572
+ }, options)),
5650
5573
  ...state
5651
5574
  };
5652
5575
  };
5653
5576
  const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
5654
5577
  if (result === null) return;
5655
- const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);
5656
- const uint8ArrayResult = bufferToUint8Array(truncatedResult);
5578
+ const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
5657
5579
  const { stdioItems, objectMode } = fileDescriptors[fdNumber];
5658
- const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
5659
5580
  const { serializedResult, finalResult = serializedResult } = serializeChunks({
5660
- chunks,
5581
+ chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
5661
5582
  objectMode,
5662
5583
  encoding,
5663
5584
  lines,
@@ -5768,14 +5689,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
5768
5689
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
5769
5690
  const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
5770
5691
  const resultError = getResultError(error, exitCode, signal);
5771
- const timedOut = resultError?.code === "ETIMEDOUT";
5772
- const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
5773
5692
  return {
5774
5693
  resultError,
5775
5694
  exitCode,
5776
5695
  signal,
5777
- timedOut,
5778
- isMaxBuffer
5696
+ timedOut: resultError?.code === "ETIMEDOUT",
5697
+ isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
5779
5698
  };
5780
5699
  };
5781
5700
  const getResultError = (error, exitCode, signal) => {
@@ -5787,7 +5706,7 @@ const getResultError = (error, exitCode, signal) => {
5787
5706
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
5788
5707
  const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5789
5708
  const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
5790
- const result = spawnSubprocessSync({
5709
+ return handleResult(spawnSubprocessSync({
5791
5710
  file,
5792
5711
  commandArguments,
5793
5712
  options,
@@ -5796,15 +5715,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5796
5715
  verboseInfo,
5797
5716
  fileDescriptors,
5798
5717
  startTime
5799
- });
5800
- return handleResult(result, verboseInfo, options);
5718
+ }), verboseInfo, options);
5801
5719
  };
5802
5720
  const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5803
5721
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
5804
- const syncOptions = normalizeSyncOptions(rawOptions);
5805
- const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
5722
+ const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
5806
5723
  validateSyncOptions(options);
5807
- const fileDescriptors = handleStdioSync(options, verboseInfo);
5808
5724
  return {
5809
5725
  file,
5810
5726
  commandArguments,
@@ -5813,7 +5729,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5813
5729
  startTime,
5814
5730
  verboseInfo,
5815
5731
  options,
5816
- fileDescriptors
5732
+ fileDescriptors: handleStdioSync(options, verboseInfo)
5817
5733
  };
5818
5734
  };
5819
5735
  const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
@@ -5848,16 +5764,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5848
5764
  isMaxBuffer,
5849
5765
  verboseInfo
5850
5766
  });
5851
- const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
5852
- const all = stripNewline(getAllSync(output, options), options, "all");
5853
5767
  return getSyncResult({
5854
5768
  error,
5855
5769
  exitCode,
5856
5770
  signal,
5857
5771
  timedOut,
5858
5772
  isMaxBuffer,
5859
- stdio,
5860
- all,
5773
+ stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
5774
+ all: stripNewline(getAllSync(output, options), options, "all"),
5861
5775
  options,
5862
5776
  command,
5863
5777
  escapedCommand,
@@ -5867,8 +5781,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5867
5781
  const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
5868
5782
  try {
5869
5783
  addInputOptionsSync(fileDescriptors, options);
5870
- const normalizedOptions = normalizeSpawnSyncOptions(options);
5871
- return (0, node_child_process.spawnSync)(file, commandArguments, normalizedOptions);
5784
+ return (0, node_child_process.spawnSync)(file, commandArguments, normalizeSpawnSyncOptions(options));
5872
5785
  } catch (error) {
5873
5786
  return makeEarlyError({
5874
5787
  error,
@@ -6086,19 +5999,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
6086
5999
  writable,
6087
6000
  duplex
6088
6001
  });
6089
- const earlyError = makeEarlyError({
6090
- error,
6091
- command,
6092
- escapedCommand,
6093
- fileDescriptors,
6094
- options,
6095
- startTime,
6096
- isSync: false
6097
- });
6098
- const promise = handleDummyPromise(earlyError, verboseInfo, options);
6099
6002
  return {
6100
6003
  subprocess,
6101
- promise
6004
+ promise: handleDummyPromise(makeEarlyError({
6005
+ error,
6006
+ command,
6007
+ escapedCommand,
6008
+ fileDescriptors,
6009
+ options,
6010
+ startTime,
6011
+ isSync: false
6012
+ }), verboseInfo, options)
6102
6013
  };
6103
6014
  };
6104
6015
  const createDummyStreams = (subprocess, fileDescriptors) => {
@@ -6147,8 +6058,7 @@ const addProperties = {
6147
6058
  nodeStream: ({ value }) => ({ stream: value }),
6148
6059
  webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
6149
6060
  const objectMode = writableObjectMode || readableObjectMode;
6150
- const stream = node_stream.Duplex.fromWeb(transform, { objectMode });
6151
- return { stream };
6061
+ return { stream: node_stream.Duplex.fromWeb(transform, { objectMode }) };
6152
6062
  },
6153
6063
  duplex: ({ value: { transform } }) => ({ stream: transform }),
6154
6064
  native() {}
@@ -6394,10 +6304,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
6394
6304
  controller
6395
6305
  });
6396
6306
  }
6397
- for (const [outputStream, inputStreams] of pipeGroups.entries()) {
6398
- const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
6399
- pipeStreams(inputStream, outputStream);
6400
- }
6307
+ for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
6401
6308
  };
6402
6309
  const pipeTransform = (subprocess, stream, direction, fdNumber) => {
6403
6310
  if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
@@ -6659,10 +6566,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
6659
6566
  const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6660
6567
  try {
6661
6568
  const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
6662
- const destinationStream = getToStream(destination, to);
6663
6569
  return {
6664
6570
  destination,
6665
- destinationStream,
6571
+ destinationStream: getToStream(destination, to),
6666
6572
  from,
6667
6573
  unpipeSignal
6668
6574
  };
@@ -6671,19 +6577,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6671
6577
  }
6672
6578
  };
6673
6579
  const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
6674
- if (Array.isArray(firstArgument)) {
6675
- const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
6676
- return {
6677
- destination,
6678
- pipeOptions: boundOptions
6679
- };
6680
- }
6580
+ if (Array.isArray(firstArgument)) return {
6581
+ destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
6582
+ pipeOptions: boundOptions
6583
+ };
6681
6584
  if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
6682
6585
  if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
6683
6586
  const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
6684
- const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
6685
6587
  return {
6686
- destination,
6588
+ destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
6687
6589
  pipeOptions: rawOptions
6688
6590
  };
6689
6591
  }
@@ -6703,8 +6605,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
6703
6605
  } });
6704
6606
  const getSourceStream = (source, from) => {
6705
6607
  try {
6706
- const sourceStream = getFromStream(source, from);
6707
- return { sourceStream };
6608
+ return { sourceStream: getFromStream(source, from) };
6708
6609
  } catch (error) {
6709
6610
  return { sourceError: error };
6710
6611
  }
@@ -6798,9 +6699,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
6798
6699
  const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
6799
6700
  await (0, node_util.aborted)(unpipeSignal, sourceStream);
6800
6701
  await mergedStream.remove(sourceStream);
6801
- const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
6802
6702
  throw createNonCommandError({
6803
- error,
6703
+ error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
6804
6704
  fileDescriptors,
6805
6705
  sourceOptions,
6806
6706
  startTime
@@ -6903,13 +6803,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
6903
6803
  }
6904
6804
  };
6905
6805
  const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
6906
- const onStdoutChunk = (0, node_events.on)(stream, "data", {
6907
- signal: controller.signal,
6908
- highWaterMark: HIGH_WATER_MARK,
6909
- highWatermark: HIGH_WATER_MARK
6910
- });
6911
6806
  return iterateOnData({
6912
- onStdoutChunk,
6807
+ onStdoutChunk: (0, node_events.on)(stream, "data", {
6808
+ signal: controller.signal,
6809
+ highWaterMark: HIGH_WATER_MARK,
6810
+ highWatermark: HIGH_WATER_MARK
6811
+ }),
6913
6812
  controller,
6914
6813
  binary,
6915
6814
  shouldEncode,
@@ -6954,13 +6853,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
6954
6853
  await Promise.all([resumeStream(stream), logPromise]);
6955
6854
  return;
6956
6855
  }
6957
- const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
6958
6856
  const iterable = iterateForResult({
6959
6857
  stream,
6960
6858
  onStreamEnd,
6961
6859
  lines,
6962
6860
  encoding,
6963
- stripFinalNewline: stripFinalNewlineValue,
6861
+ stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
6964
6862
  allMixed
6965
6863
  });
6966
6864
  const [output] = await Promise.all([getStreamContents({
@@ -6980,15 +6878,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
6980
6878
  verboseInfo,
6981
6879
  fdNumber
6982
6880
  })) return;
6983
- const linesIterable = iterateForResult({
6881
+ await logLines(iterateForResult({
6984
6882
  stream,
6985
6883
  onStreamEnd,
6986
6884
  lines: true,
6987
6885
  encoding,
6988
6886
  stripFinalNewline: true,
6989
6887
  allMixed
6990
- });
6991
- await logLines(linesIterable, stream, fdNumber, verboseInfo);
6888
+ }), stream, fdNumber, verboseInfo);
6992
6889
  };
6993
6890
  const resumeStream = async (stream) => {
6994
6891
  await (0, node_timers_promises.setImmediate)();
@@ -7138,10 +7035,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
7138
7035
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
7139
7036
  const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
7140
7037
  const logIpcOutput = (message, verboseInfo) => {
7141
- const verboseMessage = serializeVerboseMessage(message);
7142
7038
  verboseLog({
7143
7039
  type: "ipc",
7144
- verboseMessage,
7040
+ verboseMessage: serializeVerboseMessage(message),
7145
7041
  fdNumber: "ipc",
7146
7042
  verboseInfo
7147
7043
  });
@@ -7284,9 +7180,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
7284
7180
  const promises = weakMap.get(stream);
7285
7181
  const promise = createDeferred();
7286
7182
  promises.push(promise);
7287
- const resolve = promise.resolve.bind(promise);
7288
7183
  return {
7289
- resolve,
7184
+ resolve: promise.resolve.bind(promise),
7290
7185
  promises
7291
7186
  };
7292
7187
  };
@@ -7367,10 +7262,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
7367
7262
  };
7368
7263
  const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
7369
7264
  const subprocessStdout = getFromStream(subprocess, from);
7370
- const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
7371
7265
  return {
7372
7266
  subprocessStdout,
7373
- waitReadableDestroy
7267
+ waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
7374
7268
  };
7375
7269
  };
7376
7270
  const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
@@ -7448,12 +7342,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
7448
7342
  };
7449
7343
  const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
7450
7344
  const subprocessStdin = getToStream(subprocess, to);
7451
- const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
7452
- const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
7453
7345
  return {
7454
7346
  subprocessStdin,
7455
- waitWritableFinal,
7456
- waitWritableDestroy
7347
+ waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
7348
+ waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
7457
7349
  };
7458
7350
  };
7459
7351
  const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
@@ -7549,15 +7441,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
7549
7441
  const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
7550
7442
  const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
7551
7443
  const subprocessStdout = getFromStream(subprocess, from);
7552
- const onStdoutData = iterateOnSubprocessStream({
7444
+ return iterateOnStdoutData(iterateOnSubprocessStream({
7553
7445
  subprocessStdout,
7554
7446
  subprocess,
7555
7447
  binary,
7556
7448
  shouldEncode: true,
7557
7449
  encoding,
7558
7450
  preserveNewlines
7559
- });
7560
- return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
7451
+ }), subprocessStdout, subprocess);
7561
7452
  };
7562
7453
  const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
7563
7454
  try {
@@ -7639,7 +7530,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7639
7530
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
7640
7531
  const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
7641
7532
  const options = handleAsyncOptions(normalizedOptions);
7642
- const fileDescriptors = handleStdioAsync(options, verboseInfo);
7643
7533
  return {
7644
7534
  file,
7645
7535
  commandArguments,
@@ -7648,7 +7538,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7648
7538
  startTime,
7649
7539
  verboseInfo,
7650
7540
  options,
7651
- fileDescriptors
7541
+ fileDescriptors: handleStdioAsync(options, verboseInfo)
7652
7542
  };
7653
7543
  };
7654
7544
  const handleAsyncOptions = ({ timeout, signal,...options }) => {
@@ -7721,22 +7611,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
7721
7611
  });
7722
7612
  controller.abort();
7723
7613
  onInternalError.resolve();
7724
- const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));
7725
- const all = stripNewline(allResult, options, "all");
7726
- const result = getAsyncResult({
7614
+ return handleResult(getAsyncResult({
7727
7615
  errorInfo,
7728
7616
  exitCode,
7729
7617
  signal,
7730
- stdio,
7731
- all,
7618
+ stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
7619
+ all: stripNewline(allResult, options, "all"),
7732
7620
  ipcOutput,
7733
7621
  context,
7734
7622
  options,
7735
7623
  command,
7736
7624
  escapedCommand,
7737
7625
  startTime
7738
- });
7739
- return handleResult(result, verboseInfo, options);
7626
+ }), verboseInfo, options);
7740
7627
  };
7741
7628
  const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
7742
7629
  error: errorInfo.error,
@@ -7809,8 +7696,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
7809
7696
  return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
7810
7697
  };
7811
7698
  const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
7812
- const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments];
7813
- const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
7699
+ const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
7814
7700
  const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
7815
7701
  const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
7816
7702
  file: initialFile,
@@ -7946,9 +7832,8 @@ const listProjects = async () => {
7946
7832
  "projects:list",
7947
7833
  "--json"
7948
7834
  ], { shell: true });
7949
- const projectsJson = JSON.parse(projects.stdout);
7950
- return projectsJson?.result ?? [];
7951
- } catch (err) {
7835
+ return JSON.parse(projects.stdout)?.result ?? [];
7836
+ } catch {
7952
7837
  return [];
7953
7838
  }
7954
7839
  };
@@ -7967,8 +7852,7 @@ const initFirebaseUser = async (cwd) => {
7967
7852
  "list",
7968
7853
  "--format=json"
7969
7854
  ], { shell: true });
7970
- const authListJson = JSON.parse(authList.stdout);
7971
- if (authListJson.length === 0) await execa("gcloud", ["auth", "login"], {
7855
+ if (JSON.parse(authList.stdout).length === 0) await execa("gcloud", ["auth", "login"], {
7972
7856
  stdio: "inherit",
7973
7857
  shell: true
7974
7858
  });
@@ -8041,7 +7925,7 @@ const initFirebaseUser = async (cwd) => {
8041
7925
  shell: true
8042
7926
  });
8043
7927
  if (indexes.exitCode !== 0) throw new Error(indexes.stderr);
8044
- } catch (err) {
7928
+ } catch {
8045
7929
  await execa("gcloud", [
8046
7930
  "firestore",
8047
7931
  "databases",
@@ -8063,8 +7947,7 @@ const initFirebaseUser = async (cwd) => {
8063
7947
  `--project=${projectId}`,
8064
7948
  "--format=json"
8065
7949
  ], { shell: true });
8066
- const bucketsJson = JSON.parse(buckets.stdout);
8067
- storageBucket = bucketsJson.find((bucket) => bucket.name === `${projectId}.firebasestorage.app` || bucket.name === `${projectId}.appspot.com`)?.name;
7950
+ storageBucket = JSON.parse(buckets.stdout).find((bucket) => bucket.name === `${projectId}.firebasestorage.app` || bucket.name === `${projectId}.appspot.com`)?.name;
8068
7951
  if (!storageBucket) {
8069
7952
  f.error("Storage Bucket not found");
8070
7953
  f.step("Please Go to the following links to enable Firestore and Storage and Billing");
@@ -8201,10 +8084,8 @@ function normalizeIndex(index) {
8201
8084
  };
8202
8085
  }
8203
8086
  const mergeIndexes = (originalIndexes, newIndexes) => {
8204
- const mergedIndexes = originalIndexes.indexes.concat(newIndexes.indexes);
8205
- const uniqueIndexes = uniqWith(mergedIndexes, (a$1, b$2) => isEqual(normalizeIndex(a$1), normalizeIndex(b$2)));
8206
8087
  return {
8207
- indexes: uniqueIndexes,
8088
+ indexes: uniqWith(originalIndexes.indexes.concat(newIndexes.indexes), (a$1, b$2) => isEqual(normalizeIndex(a$1), normalizeIndex(b$2))),
8208
8089
  fieldOverrides: merge(originalIndexes.fieldOverrides, newIndexes.fieldOverrides)
8209
8090
  };
8210
8091
  };
@@ -8218,8 +8099,7 @@ const deployFirestore = async (cwd) => {
8218
8099
  fieldOverrides: []
8219
8100
  };
8220
8101
  try {
8221
- const originalStdout = JSON.parse(original.stdout);
8222
- originalIndexes = originalStdout ?? {
8102
+ originalIndexes = JSON.parse(original.stdout) ?? {
8223
8103
  indexes: [],
8224
8104
  fieldOverrides: []
8225
8105
  };
@@ -8275,8 +8155,7 @@ const printTemplate = async (projectId, region) => {
8275
8155
  "--format=json"
8276
8156
  ], { shell: true });
8277
8157
  const parsedData = JSON.parse(stdout);
8278
- const url = parsedData?.serviceConfig?.uri ?? parsedData.url;
8279
- const functionUrl = `${url}/api/check-update`;
8158
+ const functionUrl = `${parsedData?.serviceConfig?.uri ?? parsedData.url}/api/check-update`;
8280
8159
  Me((0, __hot_updater_plugin_core.transformTemplate)(SOURCE_TEMPLATE, { source: functionUrl }));
8281
8160
  } catch (error) {
8282
8161
  if (error instanceof ExecaError) f.error(error.stderr || error.stdout || error.message);
@@ -8288,20 +8167,18 @@ const checkIfGcloudCliInstalled = async () => {
8288
8167
  try {
8289
8168
  await execa("gcloud", ["--version"], { shell: true });
8290
8169
  return true;
8291
- } catch (error) {
8170
+ } catch {
8292
8171
  return false;
8293
8172
  }
8294
8173
  };
8295
8174
  const runInit = async ({ build }) => {
8296
- const isGcloudCliInstalled = await checkIfGcloudCliInstalled();
8297
- if (!isGcloudCliInstalled) {
8175
+ if (!await checkIfGcloudCliInstalled()) {
8298
8176
  f.error("gcloud CLI is not installed");
8299
8177
  f.step("Please go to the following link to install the gcloud CLI");
8300
8178
  f.step((0, __hot_updater_plugin_core.link)("https://cloud.google.com/sdk/docs/install"));
8301
8179
  process.exit(1);
8302
8180
  }
8303
- const firebaseDir = path.default.dirname(path.default.dirname(require.resolve("@hot-updater/firebase/functions")));
8304
- const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(firebaseDir);
8181
+ const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(path.default.dirname(path.default.dirname(require.resolve("@hot-updater/firebase/functions"))));
8305
8182
  const functionsDir = path.default.join(tmpDir, "functions");
8306
8183
  const functionsIndexPath = path.default.join(functionsDir, "index.cjs");
8307
8184
  await fs.default.promises.rename(path.default.join(functionsDir, "_package.json"), path.default.join(functionsDir, "package.json"));
@@ -8340,9 +8217,7 @@ const runInit = async ({ build }) => {
8340
8217
  cwd: tmpDir,
8341
8218
  shell: true
8342
8219
  });
8343
- const parsedData = JSON.parse(stdout);
8344
- const functionsData = parsedData.result || [];
8345
- const hotUpdater = functionsData.find((fn) => fn.id === "hot-updater");
8220
+ const hotUpdater = (JSON.parse(stdout).result || []).find((fn) => fn.id === "hot-updater");
8346
8221
  if (hotUpdater?.region) {
8347
8222
  currentRegion = hotUpdater.region;
8348
8223
  isFunctionsExist = true;
@@ -8383,10 +8258,7 @@ const runInit = async ({ build }) => {
8383
8258
  cwd: tmpDir,
8384
8259
  shell: true
8385
8260
  });
8386
- const functionsListJson = JSON.parse(functionsList.stdout);
8387
- const functionsData = functionsListJson.result || [];
8388
- const hotUpdater = functionsData.find((fn) => fn.id === "hot-updater");
8389
- const account = hotUpdater?.serviceAccount;
8261
+ const account = (JSON.parse(functionsList.stdout).result || []).find((fn) => fn.id === "hot-updater")?.serviceAccount;
8390
8262
  if (!account) {
8391
8263
  f.error("hot-updater function not found");
8392
8264
  await removeTmpDir();
@@ -8398,9 +8270,7 @@ const runInit = async ({ build }) => {
8398
8270
  initializeVariable.projectId,
8399
8271
  "--format=json"
8400
8272
  ], { shell: true });
8401
- const iamJson = JSON.parse(checkIam.stdout);
8402
- const hasTokenCreator = iamJson.bindings.some((binding) => binding.role === "roles/iam.serviceAccountTokenCreator" && binding.members.includes(`serviceAccount:${account}`));
8403
- if (!hasTokenCreator) try {
8273
+ if (!JSON.parse(checkIam.stdout).bindings.some((binding) => binding.role === "roles/iam.serviceAccountTokenCreator" && binding.members.includes(`serviceAccount:${account}`))) try {
8404
8274
  message("Adding IAM Service Account Token Creator role to the service account");
8405
8275
  await execa("gcloud", [
8406
8276
  "projects",
@@ -8413,7 +8283,7 @@ const runInit = async ({ build }) => {
8413
8283
  shell: true
8414
8284
  });
8415
8285
  f.success("IAM Service Account Token Creator role has been added to the service account");
8416
- } catch (err) {
8286
+ } catch {
8417
8287
  f.error("Please go to the following link to add the IAM Service Account Token Creator role to the service account");
8418
8288
  f.step((0, __hot_updater_plugin_core.link)(`https://console.cloud.google.com/iam-admin/iam/project/${initializeVariable.projectId}/serviceaccounts/${account}/edit?inv=1`));
8419
8289
  await removeTmpDir();