@hot-updater/supabase 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
@@ -4,6 +4,7 @@ import g, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:pro
4
4
  import * as f$1 from "node:readline";
5
5
  import M from "node:readline";
6
6
  import tty, { WriteStream } from "node:tty";
7
+ import { ConfigBuilder, copyDirToTmp, link, makeEnv, transformEnv, transformTemplate } from "@hot-updater/plugin-core";
7
8
  import { fileURLToPath } from "node:url";
8
9
  import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
9
10
  import { StringDecoder } from "node:string_decoder";
@@ -17,9 +18,8 @@ import { appendFileSync, createReadStream, createWriteStream, readFileSync, stat
17
18
  import { finished } from "node:stream/promises";
18
19
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
19
20
  import { Buffer as Buffer$1 } from "node:buffer";
20
- import { createClient } from "@supabase/supabase-js";
21
- import { ConfigBuilder, copyDirToTmp, link, makeEnv, transformEnv, transformTemplate } from "@hot-updater/plugin-core";
22
21
  import fs from "fs/promises";
22
+ import { createClient } from "@supabase/supabase-js";
23
23
 
24
24
  //#region rolldown:runtime
25
25
  var __create = Object.create;
@@ -440,16 +440,16 @@ function G(t, u$2, F$1) {
440
440
  `).map((e$1) => oD(e$1, u$2, F$1)).join(`
441
441
  `);
442
442
  }
443
- const aD = [
444
- "up",
445
- "down",
446
- "left",
447
- "right",
448
- "space",
449
- "enter",
450
- "cancel"
451
- ], c$1 = {
452
- actions: new Set(aD),
443
+ const c$1 = {
444
+ actions: new Set([
445
+ "up",
446
+ "down",
447
+ "left",
448
+ "right",
449
+ "space",
450
+ "enter",
451
+ "cancel"
452
+ ]),
453
453
  aliases: new Map([
454
454
  ["k", "up"],
455
455
  ["j", "down"],
@@ -489,9 +489,8 @@ function cD({ input: t = stdin, output: u$2 = stdout, overwrite: F$1 = !0, hideC
489
489
  });
490
490
  f$1.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
491
491
  const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
492
- const E = String(D$1);
493
492
  if (k$1([
494
- E,
493
+ String(D$1),
495
494
  C$1,
496
495
  o$2
497
496
  ], "cancel")) {
@@ -680,10 +679,7 @@ let dD = class extends x {
680
679
  if (u$2.group === !0) {
681
680
  const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
682
681
  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));
683
- } else {
684
- const F$1 = this.value.includes(u$2.value);
685
- this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
686
- }
682
+ } else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
687
683
  }
688
684
  };
689
685
  var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
@@ -716,12 +712,10 @@ let wD = class extends x {
716
712
  return this.options[this.cursor].value;
717
713
  }
718
714
  toggleAll() {
719
- const u$2 = this.value.length === this.options.length;
720
- this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
715
+ this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
721
716
  }
722
717
  toggleValue() {
723
- const u$2 = this.value.includes(this._value);
724
- this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
718
+ this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
725
719
  }
726
720
  };
727
721
  var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
@@ -1148,8 +1142,7 @@ ${J}${r$1.trimStart()}`), s = 3 + stripVTControlCharacters(r$1.trimStart()).leng
1148
1142
  ], s = V ? 80 : 120, r$1 = process.env.CI === "true";
1149
1143
  let i$1, a$1, c$2 = !1, l$1 = "", $$1, p$1 = performance.now();
1150
1144
  const M$1 = (m$1) => {
1151
- const h$2 = m$1 > 1 ? "Something went wrong" : "Canceled";
1152
- c$2 && N$1(h$2, m$1);
1145
+ c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
1153
1146
  }, v$1 = () => M$1(2), x$1 = () => M$1(1), j = () => {
1154
1147
  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);
1155
1148
  }, E = () => {
@@ -1294,8 +1287,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
1294
1287
  const textDecoder = new TextDecoder();
1295
1288
  const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
1296
1289
  const joinToString = (uint8ArraysOrStrings, encoding) => {
1297
- const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);
1298
- return strings.join("");
1290
+ return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
1299
1291
  };
1300
1292
  const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
1301
1293
  if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
@@ -1350,8 +1342,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
1350
1342
  const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
1351
1343
  if (index === expressions.length) return newTokens;
1352
1344
  const expression = expressions[index];
1353
- const expressionTokens = Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)];
1354
- return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
1345
+ return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
1355
1346
  };
1356
1347
  const splitByWhitespaces = (template, rawTemplate) => {
1357
1348
  if (rawTemplate.length === 0) return {
@@ -1438,8 +1429,7 @@ const normalizeFdSpecificOptions = (options) => {
1438
1429
  };
1439
1430
  const normalizeFdSpecificOption = (options, optionName) => {
1440
1431
  const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
1441
- const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
1442
- return addDefaultValue$1(optionArray, optionName);
1432
+ return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
1443
1433
  };
1444
1434
  const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
1445
1435
  const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
@@ -1469,12 +1459,11 @@ const parseFd = (fdName) => {
1469
1459
  };
1470
1460
  const FD_REGEXP = /^fd(\d+)$/;
1471
1461
  const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
1472
- const verboseDefault = debuglog("execa").enabled ? "full" : "none";
1473
1462
  const DEFAULT_OPTIONS = {
1474
1463
  lines: false,
1475
1464
  buffer: true,
1476
1465
  maxBuffer: 1e3 * 1e3 * 100,
1477
- verbose: verboseDefault,
1466
+ verbose: debuglog("execa").enabled ? "full" : "none",
1478
1467
  stripFinalNewline: true
1479
1468
  };
1480
1469
  const FD_SPECIFIC_OPTIONS = [
@@ -1507,11 +1496,9 @@ const VERBOSE_VALUES = [
1507
1496
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
1508
1497
  const joinCommand = (filePath, rawArguments) => {
1509
1498
  const fileAndArguments = [filePath, ...rawArguments];
1510
- const command = fileAndArguments.join(" ");
1511
- const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
1512
1499
  return {
1513
- command,
1514
- escapedCommand
1500
+ command: fileAndArguments.join(" "),
1501
+ escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
1515
1502
  };
1516
1503
  };
1517
1504
  const escapeLines = (lines) => stripVTControlCharacters(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
@@ -1952,13 +1939,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
1952
1939
  //#endregion
1953
1940
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
1954
1941
  const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
1955
- const verboseObject = getVerboseObject({
1942
+ const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
1956
1943
  type,
1957
1944
  result,
1958
1945
  verboseInfo
1959
- });
1960
- const printedLines = getPrintedLines(verboseMessage, verboseObject);
1961
- const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
1946
+ })), verboseInfo, fdNumber);
1962
1947
  if (finalLines !== "") console.warn(finalLines.slice(0, -1));
1963
1948
  };
1964
1949
  const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
@@ -1975,16 +1960,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
1975
1960
  message
1976
1961
  }));
1977
1962
  const getPrintedLine = (verboseObject) => {
1978
- const verboseLine = defaultVerboseFunction(verboseObject);
1979
1963
  return {
1980
- verboseLine,
1964
+ verboseLine: defaultVerboseFunction(verboseObject),
1981
1965
  verboseObject
1982
1966
  };
1983
1967
  };
1984
1968
  const serializeVerboseMessage = (message) => {
1985
- const messageString = typeof message === "string" ? message : inspect(message);
1986
- const escapedMessage = escapeLines(messageString);
1987
- return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
1969
+ return escapeLines(typeof message === "string" ? message : inspect(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
1988
1970
  };
1989
1971
  const TAB_SIZE = 2;
1990
1972
 
@@ -2003,11 +1985,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
2003
1985
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
2004
1986
  const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
2005
1987
  validateVerbose(verbose);
2006
- const commandId = getCommandId(verbose);
2007
1988
  return {
2008
1989
  verbose,
2009
1990
  escapedCommand,
2010
- commandId,
1991
+ commandId: getCommandId(verbose),
2011
1992
  rawOptions
2012
1993
  };
2013
1994
  };
@@ -2034,8 +2015,7 @@ const getDurationMs = (startTime) => Number(hrtime.bigint() - startTime) / 1e6;
2034
2015
  const handleCommand = (filePath, rawArguments, rawOptions) => {
2035
2016
  const startTime = getStartTime();
2036
2017
  const { command, escapedCommand } = joinCommand(filePath, rawArguments);
2037
- const verbose = normalizeFdSpecificOption(rawOptions, "verbose");
2038
- const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
2018
+ const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
2039
2019
  logCommand(escapedCommand, verboseInfo);
2040
2020
  return {
2041
2021
  command,
@@ -2103,8 +2083,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
2103
2083
  var g$2 = parseInt("010", 8);
2104
2084
  var o$2 = parseInt("001", 8);
2105
2085
  var ug = u$2 | g$2;
2106
- var ret = mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2107
- return ret;
2086
+ return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
2108
2087
  }
2109
2088
  }) });
2110
2089
 
@@ -2186,8 +2165,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2186
2165
  const ppRaw = pathEnv[i$1];
2187
2166
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2188
2167
  const pCmd = path$4.join(pathPart, cmd);
2189
- const p$1 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2190
- resolve(subStep(p$1, i$1, 0));
2168
+ resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
2191
2169
  });
2192
2170
  const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
2193
2171
  if (ii === pathExt.length) return resolve(step(i$1 + 1));
@@ -2212,8 +2190,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2212
2190
  for (let j = 0; j < pathExt.length; j++) {
2213
2191
  const cur = p$1 + pathExt[j];
2214
2192
  try {
2215
- const is = isexe.sync(cur, { pathExt: pathExtExe });
2216
- if (is) if (opt.all) found.push(cur);
2193
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
2217
2194
  else return cur;
2218
2195
  } catch (ex) {}
2219
2196
  }
@@ -2231,8 +2208,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
2231
2208
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
2232
2209
  const pathKey$1 = (options = {}) => {
2233
2210
  const environment = options.env || process.env;
2234
- const platform$1 = options.platform || process.platform;
2235
- if (platform$1 !== "win32") return "PATH";
2211
+ if ((options.platform || process.platform) !== "win32") return "PATH";
2236
2212
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2237
2213
  };
2238
2214
  module.exports = pathKey$1;
@@ -2360,12 +2336,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
2360
2336
  parsed.command = path$2.normalize(parsed.command);
2361
2337
  parsed.command = escape.command(parsed.command);
2362
2338
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2363
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2364
2339
  parsed.args = [
2365
2340
  "/d",
2366
2341
  "/s",
2367
2342
  "/c",
2368
- `"${shellCommand}"`
2343
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
2369
2344
  ];
2370
2345
  parsed.command = process.env.comspec || "cmd.exe";
2371
2346
  parsed.options.windowsVerbatimArguments = true;
@@ -2518,9 +2493,7 @@ const npmRunPathEnv = ({ env: env$1 = g.env,...options } = {}) => {
2518
2493
  //#endregion
2519
2494
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
2520
2495
  const getFinalError = (originalError, message, isSync) => {
2521
- const ErrorClass = isSync ? ExecaSyncError : ExecaError;
2522
- const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
2523
- return new ErrorClass(message, options);
2496
+ return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
2524
2497
  };
2525
2498
  var DiscardedError = class extends Error {};
2526
2499
  const setErrorName = (ErrorClass, value) => {
@@ -2839,16 +2812,14 @@ const SIGNALS = [
2839
2812
  //#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
2840
2813
  const getSignals = () => {
2841
2814
  const realtimeSignals = getRealtimeSignals();
2842
- const signals$1 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
2843
- return signals$1;
2815
+ return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
2844
2816
  };
2845
2817
  const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
2846
2818
  const { signals: { [name]: constantSignal } } = constants;
2847
2819
  const supported = constantSignal !== void 0;
2848
- const number = supported ? constantSignal : defaultNumber;
2849
2820
  return {
2850
2821
  name,
2851
- number,
2822
+ number: supported ? constantSignal : defaultNumber,
2852
2823
  description,
2853
2824
  supported,
2854
2825
  action,
@@ -3260,8 +3231,7 @@ const isConnected = (anyProcess) => {
3260
3231
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
3261
3232
  const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
3262
3233
  if (!strict) return message;
3263
- const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);
3264
- const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
3234
+ const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
3265
3235
  return {
3266
3236
  id: count++,
3267
3237
  type: REQUEST_TYPE,
@@ -3334,11 +3304,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
3334
3304
  const startSendMessage = (anyProcess, wrappedMessage, strict) => {
3335
3305
  if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
3336
3306
  const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
3337
- const onMessageSent = createDeferred();
3338
- const id = strict ? wrappedMessage.id : void 0;
3339
3307
  const outgoingMessage = {
3340
- onMessageSent,
3341
- id
3308
+ onMessageSent: createDeferred(),
3309
+ id: strict ? wrappedMessage.id : void 0
3342
3310
  };
3343
3311
  outgoingMessages.add(outgoingMessage);
3344
3312
  return {
@@ -3499,8 +3467,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
3499
3467
  })] : [];
3500
3468
  const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
3501
3469
  await onAbortedSignal(cancelSignal, signal);
3502
- const reason = getReason(cancelSignal);
3503
- await sendAbort(subprocess, reason);
3470
+ await sendAbort(subprocess, getReason(cancelSignal));
3504
3471
  killOnTimeout({
3505
3472
  kill: subprocess.kill,
3506
3473
  forceKillAfterDelay,
@@ -3674,8 +3641,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
3674
3641
  rawOptions.cwd = normalizeCwd(rawOptions.cwd);
3675
3642
  const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
3676
3643
  const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
3677
- const fdOptions = normalizeFdSpecificOptions(initialOptions);
3678
- const options = addDefaultOptions(fdOptions);
3644
+ const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
3679
3645
  validateTimeout(options);
3680
3646
  validateEncoding(options);
3681
3647
  validateIpcInputOption(options);
@@ -3832,7 +3798,7 @@ const u = Object.create(a, {
3832
3798
  }
3833
3799
  });
3834
3800
  function h({ preventCancel: r$1 = !1 } = {}) {
3835
- const e$1 = this.getReader(), t = new c(e$1, r$1), s = Object.create(u);
3801
+ const t = new c(this.getReader(), r$1), s = Object.create(u);
3836
3802
  return s[n] = t, s;
3837
3803
  }
3838
3804
 
@@ -3881,18 +3847,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
3881
3847
  const state = init();
3882
3848
  state.length = 0;
3883
3849
  try {
3884
- for await (const chunk of asyncIterable) {
3885
- const chunkType = getChunkType(chunk);
3886
- const convertedChunk = convertChunk[chunkType](chunk, state);
3887
- appendChunk({
3888
- convertedChunk,
3889
- state,
3890
- getSize,
3891
- truncateChunk,
3892
- addChunk,
3893
- maxBuffer
3894
- });
3895
- }
3850
+ for await (const chunk of asyncIterable) appendChunk({
3851
+ convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
3852
+ state,
3853
+ getSize,
3854
+ truncateChunk,
3855
+ addChunk,
3856
+ maxBuffer
3857
+ });
3896
3858
  appendFinalChunk({
3897
3859
  state,
3898
3860
  convertChunk,
@@ -4082,10 +4044,9 @@ const stringMethods = {
4082
4044
  const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
4083
4045
  if (!(error instanceof MaxBufferError)) throw error;
4084
4046
  if (fdNumber === "all") return error;
4085
- const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
4086
4047
  error.maxBufferInfo = {
4087
4048
  fdNumber,
4088
- unit
4049
+ unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
4089
4050
  };
4090
4051
  stream.destroy();
4091
4052
  throw error;
@@ -4155,19 +4116,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
4155
4116
  killSignal
4156
4117
  });
4157
4118
  const originalMessage = getOriginalMessage(originalError, cwd);
4158
- const suffix = originalMessage === void 0 ? "" : `\n${originalMessage}`;
4159
- const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
4160
- const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
4161
- const message = [
4162
- shortMessage,
4163
- ...messageStdio,
4164
- ...stdio.slice(3),
4165
- ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4166
- ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
4119
+ const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
4167
4120
  return {
4168
4121
  originalMessage,
4169
4122
  shortMessage,
4170
- message
4123
+ message: [
4124
+ shortMessage,
4125
+ ...all === void 0 ? [stdio[2], stdio[1]] : [all],
4126
+ ...stdio.slice(3),
4127
+ ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
4128
+ ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
4171
4129
  };
4172
4130
  };
4173
4131
  const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
@@ -4188,8 +4146,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
4188
4146
  const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
4189
4147
  const getOriginalMessage = (originalError, cwd) => {
4190
4148
  if (originalError instanceof DiscardedError) return;
4191
- const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError);
4192
- const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
4149
+ const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
4193
4150
  return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
4194
4151
  };
4195
4152
  const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : inspect(ipcMessage);
@@ -4311,11 +4268,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
4311
4268
  const normalizeExitPayload = (rawExitCode, rawSignal) => {
4312
4269
  const exitCode = rawExitCode === null ? void 0 : rawExitCode;
4313
4270
  const signal = rawSignal === null ? void 0 : rawSignal;
4314
- const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
4315
4271
  return {
4316
4272
  exitCode,
4317
4273
  signal,
4318
- signalDescription
4274
+ signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
4319
4275
  };
4320
4276
  };
4321
4277
 
@@ -4380,8 +4336,7 @@ function prettyMilliseconds(milliseconds, options) {
4380
4336
  let result = [];
4381
4337
  const floorDecimals = (value, decimalDigits) => {
4382
4338
  const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
4383
- const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits;
4384
- return flooredValue.toFixed(decimalDigits);
4339
+ return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
4385
4340
  };
4386
4341
  const add = (value, long, short, valueString) => {
4387
4342
  if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
@@ -4418,14 +4373,11 @@ function prettyMilliseconds(milliseconds, options) {
4418
4373
  } else {
4419
4374
  const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
4420
4375
  const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
4421
- const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4422
- const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
4376
+ const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
4423
4377
  add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
4424
4378
  }
4425
4379
  } else {
4426
- const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
4427
- const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
4428
- const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
4380
+ const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
4429
4381
  const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
4430
4382
  add(Number.parseFloat(secondsString), "second", "s", secondsString);
4431
4383
  }
@@ -4454,10 +4406,9 @@ const logResult = (result, verboseInfo) => {
4454
4406
  logDuration(result, verboseInfo);
4455
4407
  };
4456
4408
  const logDuration = (result, verboseInfo) => {
4457
- const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
4458
4409
  verboseLog({
4459
4410
  type: "duration",
4460
- verboseMessage,
4411
+ verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
4461
4412
  verboseInfo,
4462
4413
  result
4463
4414
  });
@@ -4584,18 +4535,16 @@ const TYPE_TO_MESSAGE = {
4584
4535
  const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
4585
4536
  const getOutputObjectModes = (objectMode, index, newTransforms) => {
4586
4537
  const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
4587
- const readableObjectMode = objectMode ?? writableObjectMode;
4588
4538
  return {
4589
4539
  writableObjectMode,
4590
- readableObjectMode
4540
+ readableObjectMode: objectMode ?? writableObjectMode
4591
4541
  };
4592
4542
  };
4593
4543
  const getInputObjectModes = (objectMode, index, newTransforms) => {
4594
4544
  const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
4595
- const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
4596
4545
  return {
4597
4546
  writableObjectMode,
4598
- readableObjectMode
4547
+ readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
4599
4548
  };
4600
4549
  };
4601
4550
  const getFdObjectMode = (stdioItems, direction) => {
@@ -4904,8 +4853,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
4904
4853
  const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
4905
4854
  const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
4906
4855
  if (duplicateStdioItems.length === 0) return;
4907
- const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction);
4908
- throwOnDuplicateStream(differentStdioItem, optionName, type);
4856
+ throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
4909
4857
  return direction === "output" ? duplicateStdioItems[0].stream : void 0;
4910
4858
  };
4911
4859
  const hasSameValue = ({ type, value }, secondValue) => {
@@ -4914,8 +4862,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
4914
4862
  return value === secondValue;
4915
4863
  };
4916
4864
  const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
4917
- const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform);
4918
- throwOnDuplicateStream(duplicateStdioItem, optionName, type);
4865
+ throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
4919
4866
  };
4920
4867
  const throwOnDuplicateStream = (stdioItem, optionName, type) => {
4921
4868
  if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
@@ -4924,15 +4871,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
4924
4871
  //#endregion
4925
4872
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
4926
4873
  const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
4927
- const stdio = normalizeStdioOption(options, verboseInfo, isSync);
4928
- const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
4929
- stdioOption,
4930
- fdNumber,
4931
- options,
4932
- isSync
4933
- }));
4934
4874
  const fileDescriptors = getFinalFileDescriptors({
4935
- initialFileDescriptors,
4875
+ initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
4876
+ stdioOption,
4877
+ fdNumber,
4878
+ options,
4879
+ isSync
4880
+ })),
4936
4881
  addProperties: addProperties$2,
4937
4882
  options,
4938
4883
  isSync
@@ -4949,14 +4894,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
4949
4894
  optionName
4950
4895
  });
4951
4896
  const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
4952
- const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({
4897
+ const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
4953
4898
  stdioItem,
4954
4899
  isStdioArray,
4955
4900
  fdNumber,
4956
4901
  direction,
4957
4902
  isSync
4958
- }));
4959
- const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
4903
+ })), optionName, direction, options);
4960
4904
  const objectMode = getFdObjectMode(normalizedStdioItems, direction);
4961
4905
  validateFileObjectMode(normalizedStdioItems, objectMode);
4962
4906
  return {
@@ -4966,9 +4910,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
4966
4910
  };
4967
4911
  };
4968
4912
  const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
4969
- const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];
4970
- const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
4971
- const stdioItems = filterDuplicates(initialStdioItems);
4913
+ const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
4972
4914
  const isStdioArray = stdioItems.length > 1;
4973
4915
  validateStdioArray(stdioItems, isStdioArray, optionName);
4974
4916
  validateStreams(stdioItems);
@@ -5018,18 +4960,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
5018
4960
  }
5019
4961
  };
5020
4962
  const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
5021
- const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
5022
- stdioItem,
5023
- addProperties: addProperties$2,
5024
- direction,
5025
- options,
5026
- fileDescriptors,
5027
- isSync
5028
- }));
5029
4963
  return {
5030
4964
  direction,
5031
4965
  objectMode,
5032
- stdioItems: finalStdioItems
4966
+ stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
4967
+ stdioItem,
4968
+ addProperties: addProperties$2,
4969
+ direction,
4970
+ options,
4971
+ fileDescriptors,
4972
+ isSync
4973
+ }))
5033
4974
  };
5034
4975
  };
5035
4976
  const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
@@ -5159,8 +5100,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
5159
5100
  yield chunk;
5160
5101
  return;
5161
5102
  }
5162
- const newline = isWindowsNewline ? windowsNewline : unixNewline;
5163
- yield concatBytes(chunk, newline);
5103
+ yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
5164
5104
  };
5165
5105
  const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
5166
5106
  const linesStringInfo = {
@@ -5305,7 +5245,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5305
5245
  const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
5306
5246
  const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
5307
5247
  const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
5308
- const stream = new Transform({
5248
+ return { stream: new Transform({
5309
5249
  writableObjectMode,
5310
5250
  writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
5311
5251
  readableObjectMode,
@@ -5321,16 +5261,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
5321
5261
  finalMethod([generators], this, done);
5322
5262
  },
5323
5263
  destroy: destroyMethod
5324
- });
5325
- return { stream };
5264
+ }) };
5326
5265
  };
5327
5266
  const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
5328
5267
  const generators = stdioItems.filter(({ type }) => type === "generator");
5329
5268
  const reversedGenerators = isInput ? generators.reverse() : generators;
5330
- for (const { value, optionName } of reversedGenerators) {
5331
- const generators$1 = addInternalGenerators(value, encoding, optionName);
5332
- chunks = runTransformSync(generators$1, chunks);
5333
- }
5269
+ for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
5334
5270
  return chunks;
5335
5271
  };
5336
5272
  const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
@@ -5367,9 +5303,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
5367
5303
  const [{ type, optionName }] = allStdioItems;
5368
5304
  throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
5369
5305
  }
5370
- const allContents = allStdioItems.map(({ contents }) => contents);
5371
- const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
5372
- options.input = joinToUint8Array(transformedContents);
5306
+ options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
5373
5307
  };
5374
5308
  const applySingleInputGeneratorsSync = (contents, stdioItems) => {
5375
5309
  const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
@@ -5394,10 +5328,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
5394
5328
  };
5395
5329
  const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
5396
5330
  const logLine = (line, fdNumber, verboseInfo) => {
5397
- const verboseMessage = serializeVerboseMessage(line);
5398
5331
  verboseLog({
5399
5332
  type: "output",
5400
- verboseMessage,
5333
+ verboseMessage: serializeVerboseMessage(line),
5401
5334
  fdNumber,
5402
5335
  verboseInfo
5403
5336
  });
@@ -5409,28 +5342,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
5409
5342
  if (output === null) return { output: Array.from({ length: 3 }) };
5410
5343
  const state = {};
5411
5344
  const outputFiles = /* @__PURE__ */ new Set([]);
5412
- const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
5413
- result,
5414
- fileDescriptors,
5415
- fdNumber,
5416
- state,
5417
- outputFiles,
5418
- isMaxBuffer,
5419
- verboseInfo
5420
- }, options));
5421
5345
  return {
5422
- output: transformedOutput,
5346
+ output: output.map((result, fdNumber) => transformOutputResultSync({
5347
+ result,
5348
+ fileDescriptors,
5349
+ fdNumber,
5350
+ state,
5351
+ outputFiles,
5352
+ isMaxBuffer,
5353
+ verboseInfo
5354
+ }, options)),
5423
5355
  ...state
5424
5356
  };
5425
5357
  };
5426
5358
  const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
5427
5359
  if (result === null) return;
5428
- const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);
5429
- const uint8ArrayResult = bufferToUint8Array(truncatedResult);
5360
+ const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
5430
5361
  const { stdioItems, objectMode } = fileDescriptors[fdNumber];
5431
- const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
5432
5362
  const { serializedResult, finalResult = serializedResult } = serializeChunks({
5433
- chunks,
5363
+ chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
5434
5364
  objectMode,
5435
5365
  encoding,
5436
5366
  lines,
@@ -5541,14 +5471,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
5541
5471
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
5542
5472
  const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
5543
5473
  const resultError = getResultError(error, exitCode, signal);
5544
- const timedOut = resultError?.code === "ETIMEDOUT";
5545
- const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
5546
5474
  return {
5547
5475
  resultError,
5548
5476
  exitCode,
5549
5477
  signal,
5550
- timedOut,
5551
- isMaxBuffer
5478
+ timedOut: resultError?.code === "ETIMEDOUT",
5479
+ isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
5552
5480
  };
5553
5481
  };
5554
5482
  const getResultError = (error, exitCode, signal) => {
@@ -5560,7 +5488,7 @@ const getResultError = (error, exitCode, signal) => {
5560
5488
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
5561
5489
  const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5562
5490
  const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
5563
- const result = spawnSubprocessSync({
5491
+ return handleResult(spawnSubprocessSync({
5564
5492
  file,
5565
5493
  commandArguments,
5566
5494
  options,
@@ -5569,15 +5497,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
5569
5497
  verboseInfo,
5570
5498
  fileDescriptors,
5571
5499
  startTime
5572
- });
5573
- return handleResult(result, verboseInfo, options);
5500
+ }), verboseInfo, options);
5574
5501
  };
5575
5502
  const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5576
5503
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
5577
- const syncOptions = normalizeSyncOptions(rawOptions);
5578
- const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
5504
+ const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
5579
5505
  validateSyncOptions(options);
5580
- const fileDescriptors = handleStdioSync(options, verboseInfo);
5581
5506
  return {
5582
5507
  file,
5583
5508
  commandArguments,
@@ -5586,7 +5511,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
5586
5511
  startTime,
5587
5512
  verboseInfo,
5588
5513
  options,
5589
- fileDescriptors
5514
+ fileDescriptors: handleStdioSync(options, verboseInfo)
5590
5515
  };
5591
5516
  };
5592
5517
  const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
@@ -5621,16 +5546,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5621
5546
  isMaxBuffer,
5622
5547
  verboseInfo
5623
5548
  });
5624
- const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
5625
- const all = stripNewline(getAllSync(output, options), options, "all");
5626
5549
  return getSyncResult({
5627
5550
  error,
5628
5551
  exitCode,
5629
5552
  signal,
5630
5553
  timedOut,
5631
5554
  isMaxBuffer,
5632
- stdio,
5633
- all,
5555
+ stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
5556
+ all: stripNewline(getAllSync(output, options), options, "all"),
5634
5557
  options,
5635
5558
  command,
5636
5559
  escapedCommand,
@@ -5640,8 +5563,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
5640
5563
  const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
5641
5564
  try {
5642
5565
  addInputOptionsSync(fileDescriptors, options);
5643
- const normalizedOptions = normalizeSpawnSyncOptions(options);
5644
- return spawnSync(file, commandArguments, normalizedOptions);
5566
+ return spawnSync(file, commandArguments, normalizeSpawnSyncOptions(options));
5645
5567
  } catch (error) {
5646
5568
  return makeEarlyError({
5647
5569
  error,
@@ -5859,19 +5781,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
5859
5781
  writable,
5860
5782
  duplex
5861
5783
  });
5862
- const earlyError = makeEarlyError({
5863
- error,
5864
- command,
5865
- escapedCommand,
5866
- fileDescriptors,
5867
- options,
5868
- startTime,
5869
- isSync: false
5870
- });
5871
- const promise = handleDummyPromise(earlyError, verboseInfo, options);
5872
5784
  return {
5873
5785
  subprocess,
5874
- promise
5786
+ promise: handleDummyPromise(makeEarlyError({
5787
+ error,
5788
+ command,
5789
+ escapedCommand,
5790
+ fileDescriptors,
5791
+ options,
5792
+ startTime,
5793
+ isSync: false
5794
+ }), verboseInfo, options)
5875
5795
  };
5876
5796
  };
5877
5797
  const createDummyStreams = (subprocess, fileDescriptors) => {
@@ -5920,8 +5840,7 @@ const addProperties = {
5920
5840
  nodeStream: ({ value }) => ({ stream: value }),
5921
5841
  webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
5922
5842
  const objectMode = writableObjectMode || readableObjectMode;
5923
- const stream = Duplex.fromWeb(transform, { objectMode });
5924
- return { stream };
5843
+ return { stream: Duplex.fromWeb(transform, { objectMode }) };
5925
5844
  },
5926
5845
  duplex: ({ value: { transform } }) => ({ stream: transform }),
5927
5846
  native() {}
@@ -6167,10 +6086,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
6167
6086
  controller
6168
6087
  });
6169
6088
  }
6170
- for (const [outputStream, inputStreams] of pipeGroups.entries()) {
6171
- const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
6172
- pipeStreams(inputStream, outputStream);
6173
- }
6089
+ for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
6174
6090
  };
6175
6091
  const pipeTransform = (subprocess, stream, direction, fdNumber) => {
6176
6092
  if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
@@ -6432,10 +6348,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
6432
6348
  const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6433
6349
  try {
6434
6350
  const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
6435
- const destinationStream = getToStream(destination, to);
6436
6351
  return {
6437
6352
  destination,
6438
- destinationStream,
6353
+ destinationStream: getToStream(destination, to),
6439
6354
  from,
6440
6355
  unpipeSignal
6441
6356
  };
@@ -6444,19 +6359,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
6444
6359
  }
6445
6360
  };
6446
6361
  const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
6447
- if (Array.isArray(firstArgument)) {
6448
- const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
6449
- return {
6450
- destination,
6451
- pipeOptions: boundOptions
6452
- };
6453
- }
6362
+ if (Array.isArray(firstArgument)) return {
6363
+ destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
6364
+ pipeOptions: boundOptions
6365
+ };
6454
6366
  if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
6455
6367
  if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
6456
6368
  const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
6457
- const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
6458
6369
  return {
6459
- destination,
6370
+ destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
6460
6371
  pipeOptions: rawOptions
6461
6372
  };
6462
6373
  }
@@ -6476,8 +6387,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
6476
6387
  } });
6477
6388
  const getSourceStream = (source, from) => {
6478
6389
  try {
6479
- const sourceStream = getFromStream(source, from);
6480
- return { sourceStream };
6390
+ return { sourceStream: getFromStream(source, from) };
6481
6391
  } catch (error) {
6482
6392
  return { sourceError: error };
6483
6393
  }
@@ -6571,9 +6481,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
6571
6481
  const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
6572
6482
  await aborted(unpipeSignal, sourceStream);
6573
6483
  await mergedStream.remove(sourceStream);
6574
- const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
6575
6484
  throw createNonCommandError({
6576
- error,
6485
+ error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
6577
6486
  fileDescriptors,
6578
6487
  sourceOptions,
6579
6488
  startTime
@@ -6676,13 +6585,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
6676
6585
  }
6677
6586
  };
6678
6587
  const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
6679
- const onStdoutChunk = on(stream, "data", {
6680
- signal: controller.signal,
6681
- highWaterMark: HIGH_WATER_MARK,
6682
- highWatermark: HIGH_WATER_MARK
6683
- });
6684
6588
  return iterateOnData({
6685
- onStdoutChunk,
6589
+ onStdoutChunk: on(stream, "data", {
6590
+ signal: controller.signal,
6591
+ highWaterMark: HIGH_WATER_MARK,
6592
+ highWatermark: HIGH_WATER_MARK
6593
+ }),
6686
6594
  controller,
6687
6595
  binary,
6688
6596
  shouldEncode,
@@ -6727,13 +6635,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
6727
6635
  await Promise.all([resumeStream(stream), logPromise]);
6728
6636
  return;
6729
6637
  }
6730
- const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
6731
6638
  const iterable = iterateForResult({
6732
6639
  stream,
6733
6640
  onStreamEnd,
6734
6641
  lines,
6735
6642
  encoding,
6736
- stripFinalNewline: stripFinalNewlineValue,
6643
+ stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
6737
6644
  allMixed
6738
6645
  });
6739
6646
  const [output] = await Promise.all([getStreamContents({
@@ -6753,15 +6660,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
6753
6660
  verboseInfo,
6754
6661
  fdNumber
6755
6662
  })) return;
6756
- const linesIterable = iterateForResult({
6663
+ await logLines(iterateForResult({
6757
6664
  stream,
6758
6665
  onStreamEnd,
6759
6666
  lines: true,
6760
6667
  encoding,
6761
6668
  stripFinalNewline: true,
6762
6669
  allMixed
6763
- });
6764
- await logLines(linesIterable, stream, fdNumber, verboseInfo);
6670
+ }), stream, fdNumber, verboseInfo);
6765
6671
  };
6766
6672
  const resumeStream = async (stream) => {
6767
6673
  await setImmediate();
@@ -6911,10 +6817,9 @@ const getAllMixed = ({ all, stdout: stdout$1, stderr }) => all && stdout$1 && st
6911
6817
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
6912
6818
  const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
6913
6819
  const logIpcOutput = (message, verboseInfo) => {
6914
- const verboseMessage = serializeVerboseMessage(message);
6915
6820
  verboseLog({
6916
6821
  type: "ipc",
6917
- verboseMessage,
6822
+ verboseMessage: serializeVerboseMessage(message),
6918
6823
  fdNumber: "ipc",
6919
6824
  verboseInfo
6920
6825
  });
@@ -7057,9 +6962,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
7057
6962
  const promises = weakMap.get(stream);
7058
6963
  const promise = createDeferred();
7059
6964
  promises.push(promise);
7060
- const resolve = promise.resolve.bind(promise);
7061
6965
  return {
7062
- resolve,
6966
+ resolve: promise.resolve.bind(promise),
7063
6967
  promises
7064
6968
  };
7065
6969
  };
@@ -7140,10 +7044,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
7140
7044
  };
7141
7045
  const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
7142
7046
  const subprocessStdout = getFromStream(subprocess, from);
7143
- const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
7144
7047
  return {
7145
7048
  subprocessStdout,
7146
- waitReadableDestroy
7049
+ waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
7147
7050
  };
7148
7051
  };
7149
7052
  const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
@@ -7221,12 +7124,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
7221
7124
  };
7222
7125
  const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
7223
7126
  const subprocessStdin = getToStream(subprocess, to);
7224
- const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
7225
- const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
7226
7127
  return {
7227
7128
  subprocessStdin,
7228
- waitWritableFinal,
7229
- waitWritableDestroy
7129
+ waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
7130
+ waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
7230
7131
  };
7231
7132
  };
7232
7133
  const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
@@ -7322,15 +7223,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
7322
7223
  const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
7323
7224
  const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
7324
7225
  const subprocessStdout = getFromStream(subprocess, from);
7325
- const onStdoutData = iterateOnSubprocessStream({
7226
+ return iterateOnStdoutData(iterateOnSubprocessStream({
7326
7227
  subprocessStdout,
7327
7228
  subprocess,
7328
7229
  binary,
7329
7230
  shouldEncode: true,
7330
7231
  encoding,
7331
7232
  preserveNewlines
7332
- });
7333
- return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
7233
+ }), subprocessStdout, subprocess);
7334
7234
  };
7335
7235
  const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
7336
7236
  try {
@@ -7412,7 +7312,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7412
7312
  const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
7413
7313
  const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
7414
7314
  const options = handleAsyncOptions(normalizedOptions);
7415
- const fileDescriptors = handleStdioAsync(options, verboseInfo);
7416
7315
  return {
7417
7316
  file,
7418
7317
  commandArguments,
@@ -7421,7 +7320,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
7421
7320
  startTime,
7422
7321
  verboseInfo,
7423
7322
  options,
7424
- fileDescriptors
7323
+ fileDescriptors: handleStdioAsync(options, verboseInfo)
7425
7324
  };
7426
7325
  };
7427
7326
  const handleAsyncOptions = ({ timeout, signal,...options }) => {
@@ -7494,22 +7393,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
7494
7393
  });
7495
7394
  controller.abort();
7496
7395
  onInternalError.resolve();
7497
- const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));
7498
- const all = stripNewline(allResult, options, "all");
7499
- const result = getAsyncResult({
7396
+ return handleResult(getAsyncResult({
7500
7397
  errorInfo,
7501
7398
  exitCode,
7502
7399
  signal,
7503
- stdio,
7504
- all,
7400
+ stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
7401
+ all: stripNewline(allResult, options, "all"),
7505
7402
  ipcOutput,
7506
7403
  context,
7507
7404
  options,
7508
7405
  command,
7509
7406
  escapedCommand,
7510
7407
  startTime
7511
- });
7512
- return handleResult(result, verboseInfo, options);
7408
+ }), verboseInfo, options);
7513
7409
  };
7514
7410
  const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
7515
7411
  error: errorInfo.error,
@@ -7582,8 +7478,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
7582
7478
  return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
7583
7479
  };
7584
7480
  const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
7585
- const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments];
7586
- const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
7481
+ const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
7587
7482
  const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
7588
7483
  const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
7589
7484
  file: initialFile,
@@ -7681,7 +7576,7 @@ const supabaseApi = (supabaseUrl, supabaseAnonKey) => {
7681
7576
  //#endregion
7682
7577
  //#region iac/index.ts
7683
7578
  const getConfigTemplate = (build) => {
7684
- const storageConfig = {
7579
+ return new ConfigBuilder().setBuildType(build).setStorage({
7685
7580
  imports: [{
7686
7581
  pkg: "@hot-updater/supabase",
7687
7582
  named: ["supabaseStorage"]
@@ -7691,8 +7586,7 @@ const getConfigTemplate = (build) => {
7691
7586
  supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
7692
7587
  bucketName: process.env.HOT_UPDATER_SUPABASE_BUCKET_NAME!,
7693
7588
  })`
7694
- };
7695
- const databaseConfig = {
7589
+ }).setDatabase({
7696
7590
  imports: [{
7697
7591
  pkg: "@hot-updater/supabase",
7698
7592
  named: ["supabaseDatabase"]
@@ -7701,8 +7595,7 @@ const getConfigTemplate = (build) => {
7701
7595
  supabaseUrl: process.env.HOT_UPDATER_SUPABASE_URL!,
7702
7596
  supabaseAnonKey: process.env.HOT_UPDATER_SUPABASE_ANON_KEY!,
7703
7597
  })`
7704
- };
7705
- return new ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
7598
+ }).getResult();
7706
7599
  };
7707
7600
  const SOURCE_TEMPLATE = `// add this to your App.tsx
7708
7601
  import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
@@ -7786,7 +7679,7 @@ const selectBucket = async (api) => {
7786
7679
  if (retryCount === 5) message("Supabase project is not ready yet. This might take a few minutes.");
7787
7680
  buckets = await api.listBuckets();
7788
7681
  return `Retrieved ${buckets.length} buckets`;
7789
- } catch (err) {
7682
+ } catch {
7790
7683
  retryCount++;
7791
7684
  await delay(1e3);
7792
7685
  }
@@ -7815,8 +7708,7 @@ const selectBucket = async (api) => {
7815
7708
  try {
7816
7709
  await api.createBucket(bucketName, { public: false });
7817
7710
  f.success(`Bucket "${bucketName}" created successfully.`);
7818
- const buckets$1 = await api.listBuckets();
7819
- const newBucket = buckets$1.find((bucket) => bucket.name === bucketName);
7711
+ const newBucket = (await api.listBuckets()).find((bucket) => bucket.name === bucketName);
7820
7712
  if (!newBucket) throw new Error("Failed to create and select new bucket");
7821
7713
  return {
7822
7714
  id: newBucket.id,
@@ -7888,8 +7780,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
7888
7780
  });
7889
7781
  if (BD(functionName)) process.exit(0);
7890
7782
  const edgeFunctionsLibPath = path$1.join(workdir, "supabase", "edge-functions");
7891
- const edgeFunctionsCodePath = path$1.join(edgeFunctionsLibPath, "index.ts");
7892
- const edgeFunctionsCode = transformEnv(edgeFunctionsCodePath, { FUNCTION_NAME: functionName });
7783
+ const edgeFunctionsCode = transformEnv(path$1.join(edgeFunctionsLibPath, "index.ts"), { FUNCTION_NAME: functionName });
7893
7784
  const targetDir = path$1.join(workdir, "supabase", "functions", functionName);
7894
7785
  await fs.mkdir(targetDir, { recursive: true });
7895
7786
  const targetPath = path$1.join(targetDir, "index.ts");
@@ -7898,7 +7789,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
7898
7789
  title: "Supabase edge function deploy. This may take a few minutes.",
7899
7790
  task: async () => {
7900
7791
  try {
7901
- const dbPush = await execa("npx", [
7792
+ return (await execa("npx", [
7902
7793
  "supabase",
7903
7794
  "functions",
7904
7795
  "deploy",
@@ -7908,8 +7799,7 @@ const deployEdgeFunction = async (workdir, projectId) => {
7908
7799
  "--no-verify-jwt",
7909
7800
  "--workdir",
7910
7801
  workdir
7911
- ], { cwd: workdir });
7912
- return dbPush.stdout;
7802
+ ], { cwd: workdir })).stdout;
7913
7803
  } catch (err) {
7914
7804
  if (err instanceof ExecaError && err.stderr) f.error(err.stderr);
7915
7805
  else console.error(err);
@@ -7943,10 +7833,8 @@ const runInit = async ({ build }) => {
7943
7833
  spinner.stop();
7944
7834
  const serviceRoleKey = apiKeys.find((key) => key.name === "service_role");
7945
7835
  if (!serviceRoleKey) throw new Error("Service role key not found, is your project paused?");
7946
- const api = supabaseApi(`https://${project.id}.supabase.co`, serviceRoleKey.api_key);
7947
- const bucket = await selectBucket(api);
7948
- const scaffoldLibPath = path$1.dirname(path$1.resolve(__require.resolve("@hot-updater/supabase/scaffold")));
7949
- const { tmpDir, removeTmpDir } = await copyDirToTmp(scaffoldLibPath, "supabase");
7836
+ const bucket = await selectBucket(supabaseApi(`https://${project.id}.supabase.co`, serviceRoleKey.api_key));
7837
+ const { tmpDir, removeTmpDir } = await copyDirToTmp(path$1.dirname(path$1.resolve(__require.resolve("@hot-updater/supabase/scaffold"))), "supabase");
7950
7838
  const migrationPath = await path$1.join(tmpDir, "supabase", "migrations");
7951
7839
  const migrationFiles = await fs.readdir(migrationPath);
7952
7840
  for (const file of migrationFiles) if (file.endsWith(".sql")) {