@hot-updater/cloudflare 0.20.11 → 0.20.13
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.cjs +190 -329
- package/dist/iac/index.js +206 -345
- package/dist/index.cjs +170 -281
- package/dist/index.js +181 -292
- package/package.json +4 -4
- package/sql/prepareSql.ts +1 -1
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +54 -80
- package/worker/dist/index.js.map +3 -3
package/dist/iac/index.cjs
CHANGED
|
@@ -8,12 +8,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __commonJS = (cb, mod) => function() {
|
|
9
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
10
|
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all) __defProp(target, name, {
|
|
13
|
-
get: all[name],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
11
|
var __copyProps = (to, from, except, desc) => {
|
|
18
12
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n$1 = keys.length, key; i$1 < n$1; i$1++) {
|
|
19
13
|
key = keys[i$1];
|
|
@@ -31,10 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
25
|
}) : target, mod));
|
|
32
26
|
|
|
33
27
|
//#endregion
|
|
34
|
-
let crypto = require("crypto");
|
|
35
|
-
crypto = __toESM(crypto);
|
|
36
|
-
let path = require("path");
|
|
37
|
-
path = __toESM(path);
|
|
38
28
|
let node_util = require("node:util");
|
|
39
29
|
node_util = __toESM(node_util);
|
|
40
30
|
let node_process = require("node:process");
|
|
@@ -47,6 +37,8 @@ let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
|
47
37
|
__hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
|
|
48
38
|
let cloudflare = require("cloudflare");
|
|
49
39
|
cloudflare = __toESM(cloudflare);
|
|
40
|
+
let crypto = require("crypto");
|
|
41
|
+
crypto = __toESM(crypto);
|
|
50
42
|
let node_url = require("node:url");
|
|
51
43
|
node_url = __toESM(node_url);
|
|
52
44
|
let node_child_process = require("node:child_process");
|
|
@@ -55,6 +47,8 @@ let node_string_decoder = require("node:string_decoder");
|
|
|
55
47
|
node_string_decoder = __toESM(node_string_decoder);
|
|
56
48
|
let node_path = require("node:path");
|
|
57
49
|
node_path = __toESM(node_path);
|
|
50
|
+
let path = require("path");
|
|
51
|
+
path = __toESM(path);
|
|
58
52
|
let fs = require("fs");
|
|
59
53
|
fs = __toESM(fs);
|
|
60
54
|
let node_timers_promises = require("node:timers/promises");
|
|
@@ -470,16 +464,16 @@ function G(t, u$2, F$1) {
|
|
|
470
464
|
`).map((e$1) => oD(e$1, u$2, F$1)).join(`
|
|
471
465
|
`);
|
|
472
466
|
}
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
467
|
+
const c$1 = {
|
|
468
|
+
actions: new Set([
|
|
469
|
+
"up",
|
|
470
|
+
"down",
|
|
471
|
+
"left",
|
|
472
|
+
"right",
|
|
473
|
+
"space",
|
|
474
|
+
"enter",
|
|
475
|
+
"cancel"
|
|
476
|
+
]),
|
|
483
477
|
aliases: new Map([
|
|
484
478
|
["k", "up"],
|
|
485
479
|
["j", "down"],
|
|
@@ -519,9 +513,8 @@ function cD({ input: t = node_process.stdin, output: u$2 = node_process.stdout,
|
|
|
519
513
|
});
|
|
520
514
|
node_readline.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
|
|
521
515
|
const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
|
|
522
|
-
const E = String(D$1);
|
|
523
516
|
if (k$1([
|
|
524
|
-
|
|
517
|
+
String(D$1),
|
|
525
518
|
C$1,
|
|
526
519
|
o$2
|
|
527
520
|
], "cancel")) {
|
|
@@ -710,10 +703,7 @@ let dD = class extends x {
|
|
|
710
703
|
if (u$2.group === !0) {
|
|
711
704
|
const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
|
|
712
705
|
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));
|
|
713
|
-
} else
|
|
714
|
-
const F$1 = this.value.includes(u$2.value);
|
|
715
|
-
this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
716
|
-
}
|
|
706
|
+
} else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
717
707
|
}
|
|
718
708
|
};
|
|
719
709
|
var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
|
|
@@ -746,12 +736,10 @@ let wD = class extends x {
|
|
|
746
736
|
return this.options[this.cursor].value;
|
|
747
737
|
}
|
|
748
738
|
toggleAll() {
|
|
749
|
-
|
|
750
|
-
this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
|
|
739
|
+
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
751
740
|
}
|
|
752
741
|
toggleValue() {
|
|
753
|
-
|
|
754
|
-
this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
742
|
+
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
755
743
|
}
|
|
756
744
|
};
|
|
757
745
|
var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
|
|
@@ -1178,8 +1166,7 @@ ${J}${r$1.trimStart()}`), s = 3 + (0, node_util.stripVTControlCharacters)(r$1.tr
|
|
|
1178
1166
|
], s = V ? 80 : 120, r$1 = process.env.CI === "true";
|
|
1179
1167
|
let i$1, a$1, c$2 = !1, l$1 = "", $$2, p$1 = performance.now();
|
|
1180
1168
|
const M$1 = (m$1) => {
|
|
1181
|
-
|
|
1182
|
-
c$2 && N$1(h$2, m$1);
|
|
1169
|
+
c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1183
1170
|
}, v$1 = () => M$1(2), x$1 = () => M$1(1), j$1 = () => {
|
|
1184
1171
|
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);
|
|
1185
1172
|
}, E = () => {
|
|
@@ -1594,8 +1581,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
|
|
|
1594
1581
|
const textDecoder = new TextDecoder();
|
|
1595
1582
|
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
|
|
1596
1583
|
const joinToString = (uint8ArraysOrStrings, encoding) => {
|
|
1597
|
-
|
|
1598
|
-
return strings.join("");
|
|
1584
|
+
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
|
|
1599
1585
|
};
|
|
1600
1586
|
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
1601
1587
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
|
|
@@ -1650,8 +1636,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
1650
1636
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
1651
1637
|
if (index === expressions.length) return newTokens;
|
|
1652
1638
|
const expression = expressions[index];
|
|
1653
|
-
|
|
1654
|
-
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
|
|
1639
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
|
|
1655
1640
|
};
|
|
1656
1641
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
1657
1642
|
if (rawTemplate.length === 0) return {
|
|
@@ -1738,8 +1723,7 @@ const normalizeFdSpecificOptions = (options) => {
|
|
|
1738
1723
|
};
|
|
1739
1724
|
const normalizeFdSpecificOption = (options, optionName) => {
|
|
1740
1725
|
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
|
|
1741
|
-
|
|
1742
|
-
return addDefaultValue$1(optionArray, optionName);
|
|
1726
|
+
return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
|
|
1743
1727
|
};
|
|
1744
1728
|
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
1745
1729
|
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
@@ -1769,12 +1753,11 @@ const parseFd = (fdName) => {
|
|
|
1769
1753
|
};
|
|
1770
1754
|
const FD_REGEXP = /^fd(\d+)$/;
|
|
1771
1755
|
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
1772
|
-
const verboseDefault = (0, node_util.debuglog)("execa").enabled ? "full" : "none";
|
|
1773
1756
|
const DEFAULT_OPTIONS = {
|
|
1774
1757
|
lines: false,
|
|
1775
1758
|
buffer: true,
|
|
1776
1759
|
maxBuffer: 1e3 * 1e3 * 100,
|
|
1777
|
-
verbose:
|
|
1760
|
+
verbose: (0, node_util.debuglog)("execa").enabled ? "full" : "none",
|
|
1778
1761
|
stripFinalNewline: true
|
|
1779
1762
|
};
|
|
1780
1763
|
const FD_SPECIFIC_OPTIONS = [
|
|
@@ -1807,11 +1790,9 @@ const VERBOSE_VALUES = [
|
|
|
1807
1790
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
1808
1791
|
const joinCommand = (filePath, rawArguments) => {
|
|
1809
1792
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
1810
|
-
const command = fileAndArguments.join(" ");
|
|
1811
|
-
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
1812
1793
|
return {
|
|
1813
|
-
command,
|
|
1814
|
-
escapedCommand
|
|
1794
|
+
command: fileAndArguments.join(" "),
|
|
1795
|
+
escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
|
|
1815
1796
|
};
|
|
1816
1797
|
};
|
|
1817
1798
|
const escapeLines = (lines) => (0, node_util.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
@@ -2252,13 +2233,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
|
|
|
2252
2233
|
//#endregion
|
|
2253
2234
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
2254
2235
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
2255
|
-
const
|
|
2236
|
+
const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
|
|
2256
2237
|
type,
|
|
2257
2238
|
result,
|
|
2258
2239
|
verboseInfo
|
|
2259
|
-
});
|
|
2260
|
-
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
2261
|
-
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
2240
|
+
})), verboseInfo, fdNumber);
|
|
2262
2241
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
2263
2242
|
};
|
|
2264
2243
|
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
|
|
@@ -2275,16 +2254,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
|
|
|
2275
2254
|
message
|
|
2276
2255
|
}));
|
|
2277
2256
|
const getPrintedLine = (verboseObject) => {
|
|
2278
|
-
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
2279
2257
|
return {
|
|
2280
|
-
verboseLine,
|
|
2258
|
+
verboseLine: defaultVerboseFunction(verboseObject),
|
|
2281
2259
|
verboseObject
|
|
2282
2260
|
};
|
|
2283
2261
|
};
|
|
2284
2262
|
const serializeVerboseMessage = (message) => {
|
|
2285
|
-
|
|
2286
|
-
const escapedMessage = escapeLines(messageString);
|
|
2287
|
-
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
2263
|
+
return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
2288
2264
|
};
|
|
2289
2265
|
const TAB_SIZE = 2;
|
|
2290
2266
|
|
|
@@ -2303,11 +2279,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
2303
2279
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
2304
2280
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
2305
2281
|
validateVerbose(verbose);
|
|
2306
|
-
const commandId = getCommandId(verbose);
|
|
2307
2282
|
return {
|
|
2308
2283
|
verbose,
|
|
2309
2284
|
escapedCommand,
|
|
2310
|
-
commandId,
|
|
2285
|
+
commandId: getCommandId(verbose),
|
|
2311
2286
|
rawOptions
|
|
2312
2287
|
};
|
|
2313
2288
|
};
|
|
@@ -2334,8 +2309,7 @@ const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - start
|
|
|
2334
2309
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
2335
2310
|
const startTime = getStartTime();
|
|
2336
2311
|
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
|
|
2337
|
-
const
|
|
2338
|
-
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
|
|
2312
|
+
const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
|
|
2339
2313
|
logCommand(escapedCommand, verboseInfo);
|
|
2340
2314
|
return {
|
|
2341
2315
|
command,
|
|
@@ -2403,8 +2377,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
2403
2377
|
var g$2 = parseInt("010", 8);
|
|
2404
2378
|
var o$2 = parseInt("001", 8);
|
|
2405
2379
|
var ug = u$2 | g$2;
|
|
2406
|
-
|
|
2407
|
-
return ret;
|
|
2380
|
+
return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
|
|
2408
2381
|
}
|
|
2409
2382
|
}) });
|
|
2410
2383
|
|
|
@@ -2486,8 +2459,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2486
2459
|
const ppRaw = pathEnv[i$1];
|
|
2487
2460
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2488
2461
|
const pCmd = path$13.join(pathPart, cmd);
|
|
2489
|
-
|
|
2490
|
-
resolve(subStep(p$1, i$1, 0));
|
|
2462
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
2491
2463
|
});
|
|
2492
2464
|
const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
|
|
2493
2465
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
@@ -2512,8 +2484,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2512
2484
|
for (let j$1 = 0; j$1 < pathExt.length; j$1++) {
|
|
2513
2485
|
const cur = p$1 + pathExt[j$1];
|
|
2514
2486
|
try {
|
|
2515
|
-
|
|
2516
|
-
if (is) if (opt.all) found.push(cur);
|
|
2487
|
+
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
2517
2488
|
else return cur;
|
|
2518
2489
|
} catch (ex) {}
|
|
2519
2490
|
}
|
|
@@ -2531,8 +2502,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2531
2502
|
var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
|
|
2532
2503
|
const pathKey$1 = (options = {}) => {
|
|
2533
2504
|
const environment = options.env || process.env;
|
|
2534
|
-
|
|
2535
|
-
if (platform$1 !== "win32") return "PATH";
|
|
2505
|
+
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
2536
2506
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2537
2507
|
};
|
|
2538
2508
|
module.exports = pathKey$1;
|
|
@@ -2660,12 +2630,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
2660
2630
|
parsed.command = path$11.normalize(parsed.command);
|
|
2661
2631
|
parsed.command = escape.command(parsed.command);
|
|
2662
2632
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2663
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
2664
2633
|
parsed.args = [
|
|
2665
2634
|
"/d",
|
|
2666
2635
|
"/s",
|
|
2667
2636
|
"/c",
|
|
2668
|
-
`"${
|
|
2637
|
+
`"${[parsed.command].concat(parsed.args).join(" ")}"`
|
|
2669
2638
|
];
|
|
2670
2639
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
2671
2640
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -2818,9 +2787,7 @@ const npmRunPathEnv = ({ env: env$1 = node_process.default.env,...options } = {}
|
|
|
2818
2787
|
//#endregion
|
|
2819
2788
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
2820
2789
|
const getFinalError = (originalError, message, isSync) => {
|
|
2821
|
-
|
|
2822
|
-
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
|
|
2823
|
-
return new ErrorClass(message, options);
|
|
2790
|
+
return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
|
|
2824
2791
|
};
|
|
2825
2792
|
var DiscardedError = class extends Error {};
|
|
2826
2793
|
const setErrorName = (ErrorClass, value) => {
|
|
@@ -3139,16 +3106,14 @@ const SIGNALS = [
|
|
|
3139
3106
|
//#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
|
|
3140
3107
|
const getSignals = () => {
|
|
3141
3108
|
const realtimeSignals = getRealtimeSignals();
|
|
3142
|
-
|
|
3143
|
-
return signals$1;
|
|
3109
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
3144
3110
|
};
|
|
3145
3111
|
const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
|
|
3146
3112
|
const { signals: { [name]: constantSignal } } = node_os.constants;
|
|
3147
3113
|
const supported = constantSignal !== void 0;
|
|
3148
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
3149
3114
|
return {
|
|
3150
3115
|
name,
|
|
3151
|
-
number,
|
|
3116
|
+
number: supported ? constantSignal : defaultNumber,
|
|
3152
3117
|
description,
|
|
3153
3118
|
supported,
|
|
3154
3119
|
action,
|
|
@@ -3560,8 +3525,7 @@ const isConnected = (anyProcess) => {
|
|
|
3560
3525
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
3561
3526
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
3562
3527
|
if (!strict) return message;
|
|
3563
|
-
const
|
|
3564
|
-
const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
|
|
3528
|
+
const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
|
|
3565
3529
|
return {
|
|
3566
3530
|
id: count++,
|
|
3567
3531
|
type: REQUEST_TYPE,
|
|
@@ -3634,11 +3598,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
|
|
|
3634
3598
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
3635
3599
|
if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
|
|
3636
3600
|
const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
|
|
3637
|
-
const onMessageSent = createDeferred();
|
|
3638
|
-
const id = strict ? wrappedMessage.id : void 0;
|
|
3639
3601
|
const outgoingMessage = {
|
|
3640
|
-
onMessageSent,
|
|
3641
|
-
id
|
|
3602
|
+
onMessageSent: createDeferred(),
|
|
3603
|
+
id: strict ? wrappedMessage.id : void 0
|
|
3642
3604
|
};
|
|
3643
3605
|
outgoingMessages.add(outgoingMessage);
|
|
3644
3606
|
return {
|
|
@@ -3799,8 +3761,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
|
|
|
3799
3761
|
})] : [];
|
|
3800
3762
|
const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
|
|
3801
3763
|
await onAbortedSignal(cancelSignal, signal);
|
|
3802
|
-
|
|
3803
|
-
await sendAbort(subprocess, reason);
|
|
3764
|
+
await sendAbort(subprocess, getReason(cancelSignal));
|
|
3804
3765
|
killOnTimeout({
|
|
3805
3766
|
kill: subprocess.kill,
|
|
3806
3767
|
forceKillAfterDelay,
|
|
@@ -3974,8 +3935,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
3974
3935
|
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
3975
3936
|
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
3976
3937
|
const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
|
|
3977
|
-
const
|
|
3978
|
-
const options = addDefaultOptions(fdOptions);
|
|
3938
|
+
const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
|
|
3979
3939
|
validateTimeout(options);
|
|
3980
3940
|
validateEncoding(options);
|
|
3981
3941
|
validateIpcInputOption(options);
|
|
@@ -4132,7 +4092,7 @@ const u = Object.create(a, {
|
|
|
4132
4092
|
}
|
|
4133
4093
|
});
|
|
4134
4094
|
function h({ preventCancel: r$1 = !1 } = {}) {
|
|
4135
|
-
const
|
|
4095
|
+
const t = new c(this.getReader(), r$1), s = Object.create(u);
|
|
4136
4096
|
return s[n] = t, s;
|
|
4137
4097
|
}
|
|
4138
4098
|
|
|
@@ -4181,18 +4141,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
|
|
|
4181
4141
|
const state = init();
|
|
4182
4142
|
state.length = 0;
|
|
4183
4143
|
try {
|
|
4184
|
-
for await (const chunk of asyncIterable) {
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
addChunk,
|
|
4193
|
-
maxBuffer
|
|
4194
|
-
});
|
|
4195
|
-
}
|
|
4144
|
+
for await (const chunk of asyncIterable) appendChunk({
|
|
4145
|
+
convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
|
|
4146
|
+
state,
|
|
4147
|
+
getSize,
|
|
4148
|
+
truncateChunk,
|
|
4149
|
+
addChunk,
|
|
4150
|
+
maxBuffer
|
|
4151
|
+
});
|
|
4196
4152
|
appendFinalChunk({
|
|
4197
4153
|
state,
|
|
4198
4154
|
convertChunk,
|
|
@@ -4382,10 +4338,9 @@ const stringMethods = {
|
|
|
4382
4338
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
4383
4339
|
if (!(error instanceof MaxBufferError)) throw error;
|
|
4384
4340
|
if (fdNumber === "all") return error;
|
|
4385
|
-
const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
|
|
4386
4341
|
error.maxBufferInfo = {
|
|
4387
4342
|
fdNumber,
|
|
4388
|
-
unit
|
|
4343
|
+
unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
|
|
4389
4344
|
};
|
|
4390
4345
|
stream.destroy();
|
|
4391
4346
|
throw error;
|
|
@@ -4455,19 +4410,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
|
|
|
4455
4410
|
killSignal
|
|
4456
4411
|
});
|
|
4457
4412
|
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
4458
|
-
const
|
|
4459
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
4460
|
-
const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
|
|
4461
|
-
const message = [
|
|
4462
|
-
shortMessage,
|
|
4463
|
-
...messageStdio,
|
|
4464
|
-
...stdio.slice(3),
|
|
4465
|
-
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4466
|
-
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
|
|
4413
|
+
const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
|
|
4467
4414
|
return {
|
|
4468
4415
|
originalMessage,
|
|
4469
4416
|
shortMessage,
|
|
4470
|
-
message
|
|
4417
|
+
message: [
|
|
4418
|
+
shortMessage,
|
|
4419
|
+
...all === void 0 ? [stdio[2], stdio[1]] : [all],
|
|
4420
|
+
...stdio.slice(3),
|
|
4421
|
+
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4422
|
+
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
|
|
4471
4423
|
};
|
|
4472
4424
|
};
|
|
4473
4425
|
const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
|
|
@@ -4488,8 +4440,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
|
|
|
4488
4440
|
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
|
|
4489
4441
|
const getOriginalMessage = (originalError, cwd) => {
|
|
4490
4442
|
if (originalError instanceof DiscardedError) return;
|
|
4491
|
-
const
|
|
4492
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
4443
|
+
const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
|
|
4493
4444
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
4494
4445
|
};
|
|
4495
4446
|
const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, node_util.inspect)(ipcMessage);
|
|
@@ -4611,11 +4562,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
|
|
|
4611
4562
|
const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
4612
4563
|
const exitCode = rawExitCode === null ? void 0 : rawExitCode;
|
|
4613
4564
|
const signal = rawSignal === null ? void 0 : rawSignal;
|
|
4614
|
-
const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
|
|
4615
4565
|
return {
|
|
4616
4566
|
exitCode,
|
|
4617
4567
|
signal,
|
|
4618
|
-
signalDescription
|
|
4568
|
+
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
4619
4569
|
};
|
|
4620
4570
|
};
|
|
4621
4571
|
|
|
@@ -4680,8 +4630,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4680
4630
|
let result = [];
|
|
4681
4631
|
const floorDecimals = (value, decimalDigits) => {
|
|
4682
4632
|
const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
|
|
4683
|
-
|
|
4684
|
-
return flooredValue.toFixed(decimalDigits);
|
|
4633
|
+
return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
|
|
4685
4634
|
};
|
|
4686
4635
|
const add = (value, long, short, valueString) => {
|
|
4687
4636
|
if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
|
|
@@ -4718,14 +4667,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4718
4667
|
} else {
|
|
4719
4668
|
const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
4720
4669
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
4721
|
-
const
|
|
4722
|
-
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
4670
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
4723
4671
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
4724
4672
|
}
|
|
4725
4673
|
} else {
|
|
4726
|
-
const
|
|
4727
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
4728
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
4674
|
+
const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
|
|
4729
4675
|
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
4730
4676
|
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
4731
4677
|
}
|
|
@@ -4754,10 +4700,9 @@ const logResult = (result, verboseInfo) => {
|
|
|
4754
4700
|
logDuration(result, verboseInfo);
|
|
4755
4701
|
};
|
|
4756
4702
|
const logDuration = (result, verboseInfo) => {
|
|
4757
|
-
const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
|
|
4758
4703
|
verboseLog({
|
|
4759
4704
|
type: "duration",
|
|
4760
|
-
verboseMessage
|
|
4705
|
+
verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
|
|
4761
4706
|
verboseInfo,
|
|
4762
4707
|
result
|
|
4763
4708
|
});
|
|
@@ -4884,18 +4829,16 @@ const TYPE_TO_MESSAGE = {
|
|
|
4884
4829
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
4885
4830
|
const getOutputObjectModes = (objectMode, index, newTransforms) => {
|
|
4886
4831
|
const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
|
|
4887
|
-
const readableObjectMode = objectMode ?? writableObjectMode;
|
|
4888
4832
|
return {
|
|
4889
4833
|
writableObjectMode,
|
|
4890
|
-
readableObjectMode
|
|
4834
|
+
readableObjectMode: objectMode ?? writableObjectMode
|
|
4891
4835
|
};
|
|
4892
4836
|
};
|
|
4893
4837
|
const getInputObjectModes = (objectMode, index, newTransforms) => {
|
|
4894
4838
|
const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
|
|
4895
|
-
const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
|
|
4896
4839
|
return {
|
|
4897
4840
|
writableObjectMode,
|
|
4898
|
-
readableObjectMode
|
|
4841
|
+
readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
|
|
4899
4842
|
};
|
|
4900
4843
|
};
|
|
4901
4844
|
const getFdObjectMode = (stdioItems, direction) => {
|
|
@@ -5204,8 +5147,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
|
|
|
5204
5147
|
const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
|
|
5205
5148
|
const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
|
|
5206
5149
|
if (duplicateStdioItems.length === 0) return;
|
|
5207
|
-
|
|
5208
|
-
throwOnDuplicateStream(differentStdioItem, optionName, type);
|
|
5150
|
+
throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
|
|
5209
5151
|
return direction === "output" ? duplicateStdioItems[0].stream : void 0;
|
|
5210
5152
|
};
|
|
5211
5153
|
const hasSameValue = ({ type, value }, secondValue) => {
|
|
@@ -5214,8 +5156,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
|
|
|
5214
5156
|
return value === secondValue;
|
|
5215
5157
|
};
|
|
5216
5158
|
const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
|
|
5217
|
-
|
|
5218
|
-
throwOnDuplicateStream(duplicateStdioItem, optionName, type);
|
|
5159
|
+
throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
|
|
5219
5160
|
};
|
|
5220
5161
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
5221
5162
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
@@ -5224,15 +5165,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
|
5224
5165
|
//#endregion
|
|
5225
5166
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
5226
5167
|
const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
5227
|
-
const stdio = normalizeStdioOption(options, verboseInfo, isSync);
|
|
5228
|
-
const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
|
|
5229
|
-
stdioOption,
|
|
5230
|
-
fdNumber,
|
|
5231
|
-
options,
|
|
5232
|
-
isSync
|
|
5233
|
-
}));
|
|
5234
5168
|
const fileDescriptors = getFinalFileDescriptors({
|
|
5235
|
-
initialFileDescriptors,
|
|
5169
|
+
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
5170
|
+
stdioOption,
|
|
5171
|
+
fdNumber,
|
|
5172
|
+
options,
|
|
5173
|
+
isSync
|
|
5174
|
+
})),
|
|
5236
5175
|
addProperties: addProperties$2,
|
|
5237
5176
|
options,
|
|
5238
5177
|
isSync
|
|
@@ -5249,14 +5188,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
5249
5188
|
optionName
|
|
5250
5189
|
});
|
|
5251
5190
|
const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
|
|
5252
|
-
const
|
|
5191
|
+
const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
|
|
5253
5192
|
stdioItem,
|
|
5254
5193
|
isStdioArray,
|
|
5255
5194
|
fdNumber,
|
|
5256
5195
|
direction,
|
|
5257
5196
|
isSync
|
|
5258
|
-
}));
|
|
5259
|
-
const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
|
|
5197
|
+
})), optionName, direction, options);
|
|
5260
5198
|
const objectMode = getFdObjectMode(normalizedStdioItems, direction);
|
|
5261
5199
|
validateFileObjectMode(normalizedStdioItems, objectMode);
|
|
5262
5200
|
return {
|
|
@@ -5266,9 +5204,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
5266
5204
|
};
|
|
5267
5205
|
};
|
|
5268
5206
|
const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
|
|
5269
|
-
const
|
|
5270
|
-
const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
|
|
5271
|
-
const stdioItems = filterDuplicates(initialStdioItems);
|
|
5207
|
+
const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
|
|
5272
5208
|
const isStdioArray = stdioItems.length > 1;
|
|
5273
5209
|
validateStdioArray(stdioItems, isStdioArray, optionName);
|
|
5274
5210
|
validateStreams(stdioItems);
|
|
@@ -5318,18 +5254,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
5318
5254
|
}
|
|
5319
5255
|
};
|
|
5320
5256
|
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
|
|
5321
|
-
const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
|
|
5322
|
-
stdioItem,
|
|
5323
|
-
addProperties: addProperties$2,
|
|
5324
|
-
direction,
|
|
5325
|
-
options,
|
|
5326
|
-
fileDescriptors,
|
|
5327
|
-
isSync
|
|
5328
|
-
}));
|
|
5329
5257
|
return {
|
|
5330
5258
|
direction,
|
|
5331
5259
|
objectMode,
|
|
5332
|
-
stdioItems:
|
|
5260
|
+
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
5261
|
+
stdioItem,
|
|
5262
|
+
addProperties: addProperties$2,
|
|
5263
|
+
direction,
|
|
5264
|
+
options,
|
|
5265
|
+
fileDescriptors,
|
|
5266
|
+
isSync
|
|
5267
|
+
}))
|
|
5333
5268
|
};
|
|
5334
5269
|
};
|
|
5335
5270
|
const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
|
|
@@ -5459,8 +5394,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
|
5459
5394
|
yield chunk;
|
|
5460
5395
|
return;
|
|
5461
5396
|
}
|
|
5462
|
-
|
|
5463
|
-
yield concatBytes(chunk, newline);
|
|
5397
|
+
yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
|
|
5464
5398
|
};
|
|
5465
5399
|
const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
|
|
5466
5400
|
const linesStringInfo = {
|
|
@@ -5605,7 +5539,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5605
5539
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
5606
5540
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
5607
5541
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
5608
|
-
|
|
5542
|
+
return { stream: new node_stream.Transform({
|
|
5609
5543
|
writableObjectMode,
|
|
5610
5544
|
writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
|
|
5611
5545
|
readableObjectMode,
|
|
@@ -5621,16 +5555,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5621
5555
|
finalMethod([generators], this, done);
|
|
5622
5556
|
},
|
|
5623
5557
|
destroy: destroyMethod
|
|
5624
|
-
});
|
|
5625
|
-
return { stream };
|
|
5558
|
+
}) };
|
|
5626
5559
|
};
|
|
5627
5560
|
const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
|
|
5628
5561
|
const generators = stdioItems.filter(({ type }) => type === "generator");
|
|
5629
5562
|
const reversedGenerators = isInput ? generators.reverse() : generators;
|
|
5630
|
-
for (const { value, optionName } of reversedGenerators)
|
|
5631
|
-
const generators$1 = addInternalGenerators(value, encoding, optionName);
|
|
5632
|
-
chunks = runTransformSync(generators$1, chunks);
|
|
5633
|
-
}
|
|
5563
|
+
for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
|
|
5634
5564
|
return chunks;
|
|
5635
5565
|
};
|
|
5636
5566
|
const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
|
|
@@ -5667,9 +5597,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
|
|
|
5667
5597
|
const [{ type, optionName }] = allStdioItems;
|
|
5668
5598
|
throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
|
|
5669
5599
|
}
|
|
5670
|
-
|
|
5671
|
-
const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
|
|
5672
|
-
options.input = joinToUint8Array(transformedContents);
|
|
5600
|
+
options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
|
|
5673
5601
|
};
|
|
5674
5602
|
const applySingleInputGeneratorsSync = (contents, stdioItems) => {
|
|
5675
5603
|
const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
|
|
@@ -5694,10 +5622,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
|
|
|
5694
5622
|
};
|
|
5695
5623
|
const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
|
|
5696
5624
|
const logLine = (line, fdNumber, verboseInfo) => {
|
|
5697
|
-
const verboseMessage = serializeVerboseMessage(line);
|
|
5698
5625
|
verboseLog({
|
|
5699
5626
|
type: "output",
|
|
5700
|
-
verboseMessage,
|
|
5627
|
+
verboseMessage: serializeVerboseMessage(line),
|
|
5701
5628
|
fdNumber,
|
|
5702
5629
|
verboseInfo
|
|
5703
5630
|
});
|
|
@@ -5709,28 +5636,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
5709
5636
|
if (output === null) return { output: Array.from({ length: 3 }) };
|
|
5710
5637
|
const state = {};
|
|
5711
5638
|
const outputFiles = /* @__PURE__ */ new Set([]);
|
|
5712
|
-
const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
|
|
5713
|
-
result,
|
|
5714
|
-
fileDescriptors,
|
|
5715
|
-
fdNumber,
|
|
5716
|
-
state,
|
|
5717
|
-
outputFiles,
|
|
5718
|
-
isMaxBuffer,
|
|
5719
|
-
verboseInfo
|
|
5720
|
-
}, options));
|
|
5721
5639
|
return {
|
|
5722
|
-
output:
|
|
5640
|
+
output: output.map((result, fdNumber) => transformOutputResultSync({
|
|
5641
|
+
result,
|
|
5642
|
+
fileDescriptors,
|
|
5643
|
+
fdNumber,
|
|
5644
|
+
state,
|
|
5645
|
+
outputFiles,
|
|
5646
|
+
isMaxBuffer,
|
|
5647
|
+
verboseInfo
|
|
5648
|
+
}, options)),
|
|
5723
5649
|
...state
|
|
5724
5650
|
};
|
|
5725
5651
|
};
|
|
5726
5652
|
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
|
|
5727
5653
|
if (result === null) return;
|
|
5728
|
-
const
|
|
5729
|
-
const uint8ArrayResult = bufferToUint8Array(truncatedResult);
|
|
5654
|
+
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
5730
5655
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
5731
|
-
const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
|
|
5732
5656
|
const { serializedResult, finalResult = serializedResult } = serializeChunks({
|
|
5733
|
-
chunks,
|
|
5657
|
+
chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
|
|
5734
5658
|
objectMode,
|
|
5735
5659
|
encoding,
|
|
5736
5660
|
lines,
|
|
@@ -5841,14 +5765,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
|
5841
5765
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
5842
5766
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
5843
5767
|
const resultError = getResultError(error, exitCode, signal);
|
|
5844
|
-
const timedOut = resultError?.code === "ETIMEDOUT";
|
|
5845
|
-
const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
|
|
5846
5768
|
return {
|
|
5847
5769
|
resultError,
|
|
5848
5770
|
exitCode,
|
|
5849
5771
|
signal,
|
|
5850
|
-
timedOut,
|
|
5851
|
-
isMaxBuffer
|
|
5772
|
+
timedOut: resultError?.code === "ETIMEDOUT",
|
|
5773
|
+
isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
|
|
5852
5774
|
};
|
|
5853
5775
|
};
|
|
5854
5776
|
const getResultError = (error, exitCode, signal) => {
|
|
@@ -5860,7 +5782,7 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
5860
5782
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
5861
5783
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
5862
5784
|
const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
|
|
5863
|
-
|
|
5785
|
+
return handleResult(spawnSubprocessSync({
|
|
5864
5786
|
file,
|
|
5865
5787
|
commandArguments,
|
|
5866
5788
|
options,
|
|
@@ -5869,15 +5791,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
|
5869
5791
|
verboseInfo,
|
|
5870
5792
|
fileDescriptors,
|
|
5871
5793
|
startTime
|
|
5872
|
-
});
|
|
5873
|
-
return handleResult(result, verboseInfo, options);
|
|
5794
|
+
}), verboseInfo, options);
|
|
5874
5795
|
};
|
|
5875
5796
|
const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
5876
5797
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
5877
|
-
const
|
|
5878
|
-
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
|
|
5798
|
+
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
|
|
5879
5799
|
validateSyncOptions(options);
|
|
5880
|
-
const fileDescriptors = handleStdioSync(options, verboseInfo);
|
|
5881
5800
|
return {
|
|
5882
5801
|
file,
|
|
5883
5802
|
commandArguments,
|
|
@@ -5886,7 +5805,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
5886
5805
|
startTime,
|
|
5887
5806
|
verboseInfo,
|
|
5888
5807
|
options,
|
|
5889
|
-
fileDescriptors
|
|
5808
|
+
fileDescriptors: handleStdioSync(options, verboseInfo)
|
|
5890
5809
|
};
|
|
5891
5810
|
};
|
|
5892
5811
|
const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
|
|
@@ -5921,16 +5840,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5921
5840
|
isMaxBuffer,
|
|
5922
5841
|
verboseInfo
|
|
5923
5842
|
});
|
|
5924
|
-
const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
|
|
5925
|
-
const all = stripNewline(getAllSync(output, options), options, "all");
|
|
5926
5843
|
return getSyncResult({
|
|
5927
5844
|
error,
|
|
5928
5845
|
exitCode,
|
|
5929
5846
|
signal,
|
|
5930
5847
|
timedOut,
|
|
5931
5848
|
isMaxBuffer,
|
|
5932
|
-
stdio,
|
|
5933
|
-
all,
|
|
5849
|
+
stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
|
|
5850
|
+
all: stripNewline(getAllSync(output, options), options, "all"),
|
|
5934
5851
|
options,
|
|
5935
5852
|
command,
|
|
5936
5853
|
escapedCommand,
|
|
@@ -5940,8 +5857,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5940
5857
|
const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
|
|
5941
5858
|
try {
|
|
5942
5859
|
addInputOptionsSync(fileDescriptors, options);
|
|
5943
|
-
|
|
5944
|
-
return (0, node_child_process.spawnSync)(file, commandArguments, normalizedOptions);
|
|
5860
|
+
return (0, node_child_process.spawnSync)(file, commandArguments, normalizeSpawnSyncOptions(options));
|
|
5945
5861
|
} catch (error) {
|
|
5946
5862
|
return makeEarlyError({
|
|
5947
5863
|
error,
|
|
@@ -6159,19 +6075,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
6159
6075
|
writable,
|
|
6160
6076
|
duplex
|
|
6161
6077
|
});
|
|
6162
|
-
const earlyError = makeEarlyError({
|
|
6163
|
-
error,
|
|
6164
|
-
command,
|
|
6165
|
-
escapedCommand,
|
|
6166
|
-
fileDescriptors,
|
|
6167
|
-
options,
|
|
6168
|
-
startTime,
|
|
6169
|
-
isSync: false
|
|
6170
|
-
});
|
|
6171
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
6172
6078
|
return {
|
|
6173
6079
|
subprocess,
|
|
6174
|
-
promise
|
|
6080
|
+
promise: handleDummyPromise(makeEarlyError({
|
|
6081
|
+
error,
|
|
6082
|
+
command,
|
|
6083
|
+
escapedCommand,
|
|
6084
|
+
fileDescriptors,
|
|
6085
|
+
options,
|
|
6086
|
+
startTime,
|
|
6087
|
+
isSync: false
|
|
6088
|
+
}), verboseInfo, options)
|
|
6175
6089
|
};
|
|
6176
6090
|
};
|
|
6177
6091
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
@@ -6220,8 +6134,7 @@ const addProperties = {
|
|
|
6220
6134
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
6221
6135
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
6222
6136
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
6223
|
-
|
|
6224
|
-
return { stream };
|
|
6137
|
+
return { stream: node_stream.Duplex.fromWeb(transform, { objectMode }) };
|
|
6225
6138
|
},
|
|
6226
6139
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
6227
6140
|
native() {}
|
|
@@ -6467,10 +6380,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
|
6467
6380
|
controller
|
|
6468
6381
|
});
|
|
6469
6382
|
}
|
|
6470
|
-
for (const [outputStream, inputStreams] of pipeGroups.entries())
|
|
6471
|
-
const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
|
|
6472
|
-
pipeStreams(inputStream, outputStream);
|
|
6473
|
-
}
|
|
6383
|
+
for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
|
|
6474
6384
|
};
|
|
6475
6385
|
const pipeTransform = (subprocess, stream, direction, fdNumber) => {
|
|
6476
6386
|
if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
|
|
@@ -6732,10 +6642,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
|
|
|
6732
6642
|
const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
6733
6643
|
try {
|
|
6734
6644
|
const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
|
|
6735
|
-
const destinationStream = getToStream(destination, to);
|
|
6736
6645
|
return {
|
|
6737
6646
|
destination,
|
|
6738
|
-
destinationStream,
|
|
6647
|
+
destinationStream: getToStream(destination, to),
|
|
6739
6648
|
from,
|
|
6740
6649
|
unpipeSignal
|
|
6741
6650
|
};
|
|
@@ -6744,19 +6653,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
|
6744
6653
|
}
|
|
6745
6654
|
};
|
|
6746
6655
|
const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
|
|
6747
|
-
if (Array.isArray(firstArgument)) {
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
pipeOptions: boundOptions
|
|
6752
|
-
};
|
|
6753
|
-
}
|
|
6656
|
+
if (Array.isArray(firstArgument)) return {
|
|
6657
|
+
destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
|
|
6658
|
+
pipeOptions: boundOptions
|
|
6659
|
+
};
|
|
6754
6660
|
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
6755
6661
|
if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
|
|
6756
6662
|
const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
|
|
6757
|
-
const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
|
|
6758
6663
|
return {
|
|
6759
|
-
destination,
|
|
6664
|
+
destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
|
|
6760
6665
|
pipeOptions: rawOptions
|
|
6761
6666
|
};
|
|
6762
6667
|
}
|
|
@@ -6776,8 +6681,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
|
|
|
6776
6681
|
} });
|
|
6777
6682
|
const getSourceStream = (source, from) => {
|
|
6778
6683
|
try {
|
|
6779
|
-
|
|
6780
|
-
return { sourceStream };
|
|
6684
|
+
return { sourceStream: getFromStream(source, from) };
|
|
6781
6685
|
} catch (error) {
|
|
6782
6686
|
return { sourceError: error };
|
|
6783
6687
|
}
|
|
@@ -6871,9 +6775,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
|
|
|
6871
6775
|
const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
6872
6776
|
await (0, node_util.aborted)(unpipeSignal, sourceStream);
|
|
6873
6777
|
await mergedStream.remove(sourceStream);
|
|
6874
|
-
const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
|
|
6875
6778
|
throw createNonCommandError({
|
|
6876
|
-
error,
|
|
6779
|
+
error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
|
|
6877
6780
|
fileDescriptors,
|
|
6878
6781
|
sourceOptions,
|
|
6879
6782
|
startTime
|
|
@@ -6976,13 +6879,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
6976
6879
|
}
|
|
6977
6880
|
};
|
|
6978
6881
|
const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
6979
|
-
const onStdoutChunk = (0, node_events.on)(stream, "data", {
|
|
6980
|
-
signal: controller.signal,
|
|
6981
|
-
highWaterMark: HIGH_WATER_MARK,
|
|
6982
|
-
highWatermark: HIGH_WATER_MARK
|
|
6983
|
-
});
|
|
6984
6882
|
return iterateOnData({
|
|
6985
|
-
onStdoutChunk,
|
|
6883
|
+
onStdoutChunk: (0, node_events.on)(stream, "data", {
|
|
6884
|
+
signal: controller.signal,
|
|
6885
|
+
highWaterMark: HIGH_WATER_MARK,
|
|
6886
|
+
highWatermark: HIGH_WATER_MARK
|
|
6887
|
+
}),
|
|
6986
6888
|
controller,
|
|
6987
6889
|
binary,
|
|
6988
6890
|
shouldEncode,
|
|
@@ -7027,13 +6929,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
7027
6929
|
await Promise.all([resumeStream(stream), logPromise]);
|
|
7028
6930
|
return;
|
|
7029
6931
|
}
|
|
7030
|
-
const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
|
|
7031
6932
|
const iterable = iterateForResult({
|
|
7032
6933
|
stream,
|
|
7033
6934
|
onStreamEnd,
|
|
7034
6935
|
lines,
|
|
7035
6936
|
encoding,
|
|
7036
|
-
stripFinalNewline:
|
|
6937
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
|
|
7037
6938
|
allMixed
|
|
7038
6939
|
});
|
|
7039
6940
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -7053,15 +6954,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
|
|
|
7053
6954
|
verboseInfo,
|
|
7054
6955
|
fdNumber
|
|
7055
6956
|
})) return;
|
|
7056
|
-
|
|
6957
|
+
await logLines(iterateForResult({
|
|
7057
6958
|
stream,
|
|
7058
6959
|
onStreamEnd,
|
|
7059
6960
|
lines: true,
|
|
7060
6961
|
encoding,
|
|
7061
6962
|
stripFinalNewline: true,
|
|
7062
6963
|
allMixed
|
|
7063
|
-
});
|
|
7064
|
-
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
6964
|
+
}), stream, fdNumber, verboseInfo);
|
|
7065
6965
|
};
|
|
7066
6966
|
const resumeStream = async (stream) => {
|
|
7067
6967
|
await (0, node_timers_promises.setImmediate)();
|
|
@@ -7211,10 +7111,9 @@ const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdo
|
|
|
7211
7111
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
7212
7112
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
7213
7113
|
const logIpcOutput = (message, verboseInfo) => {
|
|
7214
|
-
const verboseMessage = serializeVerboseMessage(message);
|
|
7215
7114
|
verboseLog({
|
|
7216
7115
|
type: "ipc",
|
|
7217
|
-
verboseMessage,
|
|
7116
|
+
verboseMessage: serializeVerboseMessage(message),
|
|
7218
7117
|
fdNumber: "ipc",
|
|
7219
7118
|
verboseInfo
|
|
7220
7119
|
});
|
|
@@ -7357,9 +7256,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
7357
7256
|
const promises = weakMap.get(stream);
|
|
7358
7257
|
const promise = createDeferred();
|
|
7359
7258
|
promises.push(promise);
|
|
7360
|
-
const resolve = promise.resolve.bind(promise);
|
|
7361
7259
|
return {
|
|
7362
|
-
resolve,
|
|
7260
|
+
resolve: promise.resolve.bind(promise),
|
|
7363
7261
|
promises
|
|
7364
7262
|
};
|
|
7365
7263
|
};
|
|
@@ -7440,10 +7338,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
7440
7338
|
};
|
|
7441
7339
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
7442
7340
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7443
|
-
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
|
|
7444
7341
|
return {
|
|
7445
7342
|
subprocessStdout,
|
|
7446
|
-
waitReadableDestroy
|
|
7343
|
+
waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
|
|
7447
7344
|
};
|
|
7448
7345
|
};
|
|
7449
7346
|
const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
|
|
@@ -7521,12 +7418,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
7521
7418
|
};
|
|
7522
7419
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
7523
7420
|
const subprocessStdin = getToStream(subprocess, to);
|
|
7524
|
-
const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
|
|
7525
|
-
const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
|
|
7526
7421
|
return {
|
|
7527
7422
|
subprocessStdin,
|
|
7528
|
-
waitWritableFinal,
|
|
7529
|
-
waitWritableDestroy
|
|
7423
|
+
waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
|
|
7424
|
+
waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
|
|
7530
7425
|
};
|
|
7531
7426
|
};
|
|
7532
7427
|
const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
@@ -7622,15 +7517,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
7622
7517
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
7623
7518
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
7624
7519
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7625
|
-
|
|
7520
|
+
return iterateOnStdoutData(iterateOnSubprocessStream({
|
|
7626
7521
|
subprocessStdout,
|
|
7627
7522
|
subprocess,
|
|
7628
7523
|
binary,
|
|
7629
7524
|
shouldEncode: true,
|
|
7630
7525
|
encoding,
|
|
7631
7526
|
preserveNewlines
|
|
7632
|
-
});
|
|
7633
|
-
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
7527
|
+
}), subprocessStdout, subprocess);
|
|
7634
7528
|
};
|
|
7635
7529
|
const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
|
|
7636
7530
|
try {
|
|
@@ -7712,7 +7606,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7712
7606
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
7713
7607
|
const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
|
|
7714
7608
|
const options = handleAsyncOptions(normalizedOptions);
|
|
7715
|
-
const fileDescriptors = handleStdioAsync(options, verboseInfo);
|
|
7716
7609
|
return {
|
|
7717
7610
|
file,
|
|
7718
7611
|
commandArguments,
|
|
@@ -7721,7 +7614,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7721
7614
|
startTime,
|
|
7722
7615
|
verboseInfo,
|
|
7723
7616
|
options,
|
|
7724
|
-
fileDescriptors
|
|
7617
|
+
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
7725
7618
|
};
|
|
7726
7619
|
};
|
|
7727
7620
|
const handleAsyncOptions = ({ timeout, signal,...options }) => {
|
|
@@ -7794,22 +7687,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
|
|
|
7794
7687
|
});
|
|
7795
7688
|
controller.abort();
|
|
7796
7689
|
onInternalError.resolve();
|
|
7797
|
-
|
|
7798
|
-
const all = stripNewline(allResult, options, "all");
|
|
7799
|
-
const result = getAsyncResult({
|
|
7690
|
+
return handleResult(getAsyncResult({
|
|
7800
7691
|
errorInfo,
|
|
7801
7692
|
exitCode,
|
|
7802
7693
|
signal,
|
|
7803
|
-
stdio,
|
|
7804
|
-
all,
|
|
7694
|
+
stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
|
|
7695
|
+
all: stripNewline(allResult, options, "all"),
|
|
7805
7696
|
ipcOutput,
|
|
7806
7697
|
context,
|
|
7807
7698
|
options,
|
|
7808
7699
|
command,
|
|
7809
7700
|
escapedCommand,
|
|
7810
7701
|
startTime
|
|
7811
|
-
});
|
|
7812
|
-
return handleResult(result, verboseInfo, options);
|
|
7702
|
+
}), verboseInfo, options);
|
|
7813
7703
|
};
|
|
7814
7704
|
const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
|
|
7815
7705
|
error: errorInfo.error,
|
|
@@ -7882,8 +7772,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
|
|
|
7882
7772
|
return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
|
|
7883
7773
|
};
|
|
7884
7774
|
const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
|
|
7885
|
-
const
|
|
7886
|
-
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
|
|
7775
|
+
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
|
|
7887
7776
|
const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
|
|
7888
7777
|
const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
|
|
7889
7778
|
file: initialFile,
|
|
@@ -11753,7 +11642,6 @@ var require_toml = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml@3
|
|
|
11753
11642
|
//#region ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js
|
|
11754
11643
|
var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js": ((exports) => {
|
|
11755
11644
|
exports.__esModule = true;
|
|
11756
|
-
exports.Adapt = void 0;
|
|
11757
11645
|
function isBoolean(t) {
|
|
11758
11646
|
return typeOf(t) === "boolean";
|
|
11759
11647
|
}
|
|
@@ -11768,13 +11656,13 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11768
11656
|
}
|
|
11769
11657
|
function Adapt$2(adapter_) {
|
|
11770
11658
|
var meta = adapter_.meta, path$14 = adapter_.path, xdg = adapter_.xdg;
|
|
11771
|
-
|
|
11772
|
-
function XDGAppPaths_
|
|
11659
|
+
return { XDGAppPaths: new (function() {
|
|
11660
|
+
function XDGAppPaths_(options_) {
|
|
11773
11661
|
if (options_ === void 0) options_ = {};
|
|
11774
11662
|
var _a, _b, _c;
|
|
11775
11663
|
function XDGAppPaths(options$1) {
|
|
11776
11664
|
if (options$1 === void 0) options$1 = {};
|
|
11777
|
-
return new XDGAppPaths_
|
|
11665
|
+
return new XDGAppPaths_(options$1);
|
|
11778
11666
|
}
|
|
11779
11667
|
var options = isObject(options_) ? options_ : { name: options_ };
|
|
11780
11668
|
var suffix = (_a = options.suffix) !== null && _a !== void 0 ? _a : "";
|
|
@@ -11784,10 +11672,9 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11784
11672
|
meta.pkgMainFilename(),
|
|
11785
11673
|
meta.mainFilename()
|
|
11786
11674
|
];
|
|
11787
|
-
var nameFallback = "$eval";
|
|
11788
11675
|
var name = path$14.parse(((_c = namePriorityList.find(function(e$1) {
|
|
11789
11676
|
return isString(e$1);
|
|
11790
|
-
})) !== null && _c !== void 0 ? _c :
|
|
11677
|
+
})) !== null && _c !== void 0 ? _c : "$eval") + suffix).name;
|
|
11791
11678
|
XDGAppPaths.$name = function $name() {
|
|
11792
11679
|
return name;
|
|
11793
11680
|
};
|
|
@@ -11797,8 +11684,7 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11797
11684
|
function isIsolated(dirOptions) {
|
|
11798
11685
|
var _a$1;
|
|
11799
11686
|
dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ };
|
|
11800
|
-
|
|
11801
|
-
return isolated;
|
|
11687
|
+
return isBoolean(dirOptions) ? dirOptions : (_a$1 = dirOptions.isolated) !== null && _a$1 !== void 0 ? _a$1 : isolated_;
|
|
11802
11688
|
}
|
|
11803
11689
|
function finalPathSegment(dirOptions) {
|
|
11804
11690
|
return isIsolated(dirOptions) ? name : "";
|
|
@@ -11830,9 +11716,8 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11830
11716
|
};
|
|
11831
11717
|
return XDGAppPaths;
|
|
11832
11718
|
}
|
|
11833
|
-
return XDGAppPaths_
|
|
11834
|
-
}();
|
|
11835
|
-
return { XDGAppPaths: new XDGAppPaths_() };
|
|
11719
|
+
return XDGAppPaths_;
|
|
11720
|
+
}())() };
|
|
11836
11721
|
}
|
|
11837
11722
|
exports.Adapt = Adapt$2;
|
|
11838
11723
|
}) });
|
|
@@ -11845,7 +11730,6 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11845
11730
|
return to;
|
|
11846
11731
|
};
|
|
11847
11732
|
exports.__esModule = true;
|
|
11848
|
-
exports.Adapt = void 0;
|
|
11849
11733
|
function Adapt$1(adapter_) {
|
|
11850
11734
|
var env$1 = adapter_.env, osPaths = adapter_.osPaths, path$14 = adapter_.path;
|
|
11851
11735
|
var isMacOS = /^darwin$/i.test(adapter_.process.platform);
|
|
@@ -11966,10 +11850,10 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11966
11850
|
state
|
|
11967
11851
|
};
|
|
11968
11852
|
};
|
|
11969
|
-
|
|
11970
|
-
function XDG_
|
|
11853
|
+
return { XDG: new (function() {
|
|
11854
|
+
function XDG_() {
|
|
11971
11855
|
function XDG() {
|
|
11972
|
-
return new XDG_
|
|
11856
|
+
return new XDG_();
|
|
11973
11857
|
}
|
|
11974
11858
|
var extension = isMacOS ? macos() : isWinOS ? windows() : linux();
|
|
11975
11859
|
XDG.cache = extension.cache;
|
|
@@ -11987,9 +11871,8 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11987
11871
|
};
|
|
11988
11872
|
return XDG;
|
|
11989
11873
|
}
|
|
11990
|
-
return XDG_
|
|
11991
|
-
}();
|
|
11992
|
-
return { XDG: new XDG_() };
|
|
11874
|
+
return XDG_;
|
|
11875
|
+
}())() };
|
|
11993
11876
|
}
|
|
11994
11877
|
exports.Adapt = Adapt$1;
|
|
11995
11878
|
}) });
|
|
@@ -12002,7 +11885,6 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12002
11885
|
return to;
|
|
12003
11886
|
};
|
|
12004
11887
|
exports.__esModule = true;
|
|
12005
|
-
exports.Adapt = void 0;
|
|
12006
11888
|
function isEmpty(s) {
|
|
12007
11889
|
return !s;
|
|
12008
11890
|
}
|
|
@@ -12017,13 +11899,12 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12017
11899
|
return normalizePath((typeof os$3.homedir === "function" ? os$3.homedir() : void 0) || env$1.get("HOME"));
|
|
12018
11900
|
};
|
|
12019
11901
|
var windows = function() {
|
|
12020
|
-
|
|
11902
|
+
return normalizePath([
|
|
12021
11903
|
typeof os$3.homedir === "function" ? os$3.homedir() : void 0,
|
|
12022
11904
|
env$1.get("USERPROFILE"),
|
|
12023
11905
|
env$1.get("HOME"),
|
|
12024
11906
|
env$1.get("HOMEDRIVE") || env$1.get("HOMEPATH") ? path$14.join(env$1.get("HOMEDRIVE") || "", env$1.get("HOMEPATH") || "") : void 0
|
|
12025
|
-
]
|
|
12026
|
-
return normalizePath(priorityList.find(function(v$1) {
|
|
11907
|
+
].find(function(v$1) {
|
|
12027
11908
|
return !isEmpty(v$1);
|
|
12028
11909
|
}));
|
|
12029
11910
|
};
|
|
@@ -12034,23 +11915,19 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12034
11915
|
return base ? path$14.join.apply(path$14, __spreadArray([base], segments)) : void 0;
|
|
12035
11916
|
}
|
|
12036
11917
|
function posix() {
|
|
12037
|
-
|
|
12038
|
-
var priorityList = [
|
|
11918
|
+
return normalizePath([
|
|
12039
11919
|
typeof os$3.tmpdir === "function" ? os$3.tmpdir() : void 0,
|
|
12040
11920
|
env$1.get("TMPDIR"),
|
|
12041
11921
|
env$1.get("TEMP"),
|
|
12042
11922
|
env$1.get("TMP")
|
|
12043
|
-
]
|
|
12044
|
-
return normalizePath(priorityList.find(function(v$1) {
|
|
11923
|
+
].find(function(v$1) {
|
|
12045
11924
|
return !isEmpty(v$1);
|
|
12046
|
-
})) ||
|
|
11925
|
+
})) || "/tmp";
|
|
12047
11926
|
}
|
|
12048
11927
|
function windows() {
|
|
12049
11928
|
var fallback = "C:\\Temp";
|
|
12050
|
-
var
|
|
12051
|
-
typeof os$3.tmpdir === "function" ? os$3.tmpdir : function() {
|
|
12052
|
-
return void 0;
|
|
12053
|
-
},
|
|
11929
|
+
var v$1 = [
|
|
11930
|
+
typeof os$3.tmpdir === "function" ? os$3.tmpdir : function() {},
|
|
12054
11931
|
function() {
|
|
12055
11932
|
return env$1.get("TEMP");
|
|
12056
11933
|
},
|
|
@@ -12079,26 +11956,24 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12079
11956
|
function() {
|
|
12080
11957
|
return joinPathToBase(env$1.get("SystemDrive"), ["\\", "Temp"]);
|
|
12081
11958
|
}
|
|
12082
|
-
]
|
|
12083
|
-
var v$1 = priorityListLazy.find(function(v$2) {
|
|
11959
|
+
].find(function(v$2) {
|
|
12084
11960
|
return v$2 && !isEmpty(v$2());
|
|
12085
11961
|
});
|
|
12086
11962
|
return v$1 && normalizePath(v$1()) || fallback;
|
|
12087
11963
|
}
|
|
12088
11964
|
return isWinOS ? windows() : posix();
|
|
12089
11965
|
}
|
|
12090
|
-
|
|
12091
|
-
function OSPaths_
|
|
11966
|
+
return { OSPaths: new (function() {
|
|
11967
|
+
function OSPaths_() {
|
|
12092
11968
|
function OSPaths() {
|
|
12093
|
-
return new OSPaths_
|
|
11969
|
+
return new OSPaths_();
|
|
12094
11970
|
}
|
|
12095
11971
|
OSPaths.home = home;
|
|
12096
11972
|
OSPaths.temp = temp;
|
|
12097
11973
|
return OSPaths;
|
|
12098
11974
|
}
|
|
12099
|
-
return OSPaths_
|
|
12100
|
-
}();
|
|
12101
|
-
return { OSPaths: new OSPaths_() };
|
|
11975
|
+
return OSPaths_;
|
|
11976
|
+
}())() };
|
|
12102
11977
|
}
|
|
12103
11978
|
exports.Adapt = Adapt;
|
|
12104
11979
|
}) });
|
|
@@ -12136,7 +12011,6 @@ var require_node$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-p
|
|
|
12136
12011
|
return result;
|
|
12137
12012
|
};
|
|
12138
12013
|
exports.__esModule = true;
|
|
12139
|
-
exports.adapter = void 0;
|
|
12140
12014
|
var os$2 = __importStar$2(require("os"));
|
|
12141
12015
|
var path$5 = __importStar$2(require("path"));
|
|
12142
12016
|
exports.adapter = {
|
|
@@ -12194,7 +12068,6 @@ var require_node$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-
|
|
|
12194
12068
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12195
12069
|
};
|
|
12196
12070
|
exports.__esModule = true;
|
|
12197
|
-
exports.adapter = void 0;
|
|
12198
12071
|
var path$4 = __importStar$1(require("path"));
|
|
12199
12072
|
var os_paths_1 = __importDefault$1(require_mod_cjs$2());
|
|
12200
12073
|
exports.adapter = {
|
|
@@ -12252,7 +12125,6 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-ap
|
|
|
12252
12125
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12253
12126
|
};
|
|
12254
12127
|
exports.__esModule = true;
|
|
12255
|
-
exports.adapter = void 0;
|
|
12256
12128
|
var path$3 = __importStar(require("path"));
|
|
12257
12129
|
var xdg_portable_1 = __importDefault(require_mod_cjs$1());
|
|
12258
12130
|
exports.adapter = {
|
|
@@ -12262,10 +12134,8 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-ap
|
|
|
12262
12134
|
},
|
|
12263
12135
|
meta: {
|
|
12264
12136
|
mainFilename: function() {
|
|
12265
|
-
var
|
|
12266
|
-
|
|
12267
|
-
var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
|
|
12268
|
-
return filename;
|
|
12137
|
+
var requireMainFilename = (typeof require !== "undefined" && require !== null && require.main ? require.main : { filename: void 0 }).filename;
|
|
12138
|
+
return (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
|
|
12269
12139
|
},
|
|
12270
12140
|
pkgMainFilename: function() {
|
|
12271
12141
|
return process.pkg ? process.execPath : void 0;
|
|
@@ -12288,10 +12158,7 @@ var require_mod_cjs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg
|
|
|
12288
12158
|
//#endregion
|
|
12289
12159
|
//#region ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js
|
|
12290
12160
|
var import_toml = /* @__PURE__ */ __toESM(require_toml(), 1);
|
|
12291
|
-
var mod_esm_exports = {};
|
|
12292
|
-
__export(mod_esm_exports, { default: () => mod_esm_default });
|
|
12293
12161
|
var import_mod_cjs = /* @__PURE__ */ __toESM(require_mod_cjs(), 1);
|
|
12294
|
-
__reExport(mod_esm_exports, /* @__PURE__ */ __toESM(require_mod_cjs(), 1));
|
|
12295
12162
|
var mod_esm_default = import_mod_cjs.default;
|
|
12296
12163
|
|
|
12297
12164
|
//#endregion
|
|
@@ -12299,7 +12166,7 @@ var mod_esm_default = import_mod_cjs.default;
|
|
|
12299
12166
|
const isDirectory = (configPath) => {
|
|
12300
12167
|
try {
|
|
12301
12168
|
return fs.default.statSync(configPath).isDirectory();
|
|
12302
|
-
} catch
|
|
12169
|
+
} catch {
|
|
12303
12170
|
return false;
|
|
12304
12171
|
}
|
|
12305
12172
|
};
|
|
@@ -12314,7 +12181,7 @@ const getWranglerLoginAuthToken = () => {
|
|
|
12314
12181
|
const wranglerConfigPath = getGlobalWranglerConfigPath();
|
|
12315
12182
|
const wranglerConfig = fs.default.readFileSync(path.default.join(wranglerConfigPath, "config", "default.toml"), "utf8");
|
|
12316
12183
|
return import_toml.default.parse(wranglerConfig);
|
|
12317
|
-
} catch
|
|
12184
|
+
} catch {
|
|
12318
12185
|
return null;
|
|
12319
12186
|
}
|
|
12320
12187
|
};
|
|
@@ -12322,7 +12189,7 @@ const getWranglerLoginAuthToken = () => {
|
|
|
12322
12189
|
//#endregion
|
|
12323
12190
|
//#region iac/index.ts
|
|
12324
12191
|
const getConfigTemplate = (build) => {
|
|
12325
|
-
|
|
12192
|
+
return new __hot_updater_plugin_core.ConfigBuilder().setBuildType(build).setStorage({
|
|
12326
12193
|
imports: [{
|
|
12327
12194
|
pkg: "@hot-updater/cloudflare",
|
|
12328
12195
|
named: ["r2Storage"]
|
|
@@ -12332,8 +12199,7 @@ const getConfigTemplate = (build) => {
|
|
|
12332
12199
|
accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
|
|
12333
12200
|
cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
|
|
12334
12201
|
})`
|
|
12335
|
-
}
|
|
12336
|
-
const databaseConfig = {
|
|
12202
|
+
}).setDatabase({
|
|
12337
12203
|
imports: [{
|
|
12338
12204
|
pkg: "@hot-updater/cloudflare",
|
|
12339
12205
|
named: ["d1Database"]
|
|
@@ -12343,8 +12209,7 @@ const getConfigTemplate = (build) => {
|
|
|
12343
12209
|
accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
|
|
12344
12210
|
cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
|
|
12345
12211
|
})`
|
|
12346
|
-
};
|
|
12347
|
-
return new __hot_updater_plugin_core.ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
|
|
12212
|
+
}).getResult();
|
|
12348
12213
|
};
|
|
12349
12214
|
const SOURCE_TEMPLATE = `// add this to your App.tsx
|
|
12350
12215
|
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
|
|
@@ -12361,8 +12226,7 @@ export default HotUpdater.wrap({
|
|
|
12361
12226
|
const deployWorker = async (oauth_token, accountId, { d1DatabaseId, d1DatabaseName, r2BucketName }) => {
|
|
12362
12227
|
const cwd = (0, __hot_updater_plugin_core.getCwd)();
|
|
12363
12228
|
const workerPath = require.resolve("@hot-updater/cloudflare/worker", { paths: [cwd] });
|
|
12364
|
-
const
|
|
12365
|
-
const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(wranglerTemplateDir);
|
|
12229
|
+
const { tmpDir, removeTmpDir } = await (0, __hot_updater_plugin_core.copyDirToTmp)(path.default.dirname(workerPath));
|
|
12366
12230
|
try {
|
|
12367
12231
|
const wranglerConfig = JSON.parse(await fs_promises.default.readFile(path.default.join(tmpDir, "wrangler.json"), "utf-8"));
|
|
12368
12232
|
wranglerConfig.d1_databases = [{
|
|
@@ -12374,8 +12238,7 @@ const deployWorker = async (oauth_token, accountId, { d1DatabaseId, d1DatabaseNa
|
|
|
12374
12238
|
binding: "BUCKET",
|
|
12375
12239
|
bucket_name: r2BucketName
|
|
12376
12240
|
}];
|
|
12377
|
-
|
|
12378
|
-
wranglerConfig.vars = { JWT_SECRET: jwtSecret };
|
|
12241
|
+
wranglerConfig.vars = { JWT_SECRET: crypto.default.randomBytes(32).toString("hex") };
|
|
12379
12242
|
await fs_promises.default.writeFile(path.default.join(tmpDir, "wrangler.json"), JSON.stringify(wranglerConfig, null, 2));
|
|
12380
12243
|
const wrangler = await createWrangler({
|
|
12381
12244
|
stdio: "inherit",
|
|
@@ -12487,10 +12350,8 @@ const runInit = async ({ build }) => {
|
|
|
12487
12350
|
selectedBucketName = newR2.name;
|
|
12488
12351
|
}
|
|
12489
12352
|
f.info(`Selected R2: ${selectedBucketName}`);
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
const isPrivate = await ye({ message: "Make R2 bucket private?" });
|
|
12493
|
-
if (isPrivate) try {
|
|
12353
|
+
if ((await cf.r2.buckets.domains.managed.list(selectedBucketName, { account_id: accountId })).enabled) {
|
|
12354
|
+
if (await ye({ message: "Make R2 bucket private?" })) try {
|
|
12494
12355
|
await Te([{
|
|
12495
12356
|
title: "Making R2 bucket private...",
|
|
12496
12357
|
task: async () => {
|