@hot-updater/cloudflare 0.20.11 → 0.20.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import crypto from "crypto";
|
|
3
|
-
import path from "path";
|
|
4
2
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
5
3
|
import g, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
6
4
|
import * as f$1 from "node:readline";
|
|
@@ -8,10 +6,12 @@ import M from "node:readline";
|
|
|
8
6
|
import tty, { WriteStream } from "node:tty";
|
|
9
7
|
import { ConfigBuilder, copyDirToTmp, getCwd, link, makeEnv, transformTemplate } from "@hot-updater/plugin-core";
|
|
10
8
|
import { Cloudflare } from "cloudflare";
|
|
9
|
+
import crypto from "crypto";
|
|
11
10
|
import { fileURLToPath } from "node:url";
|
|
12
11
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
13
12
|
import { StringDecoder } from "node:string_decoder";
|
|
14
|
-
import path
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import path$1 from "path";
|
|
15
15
|
import fs from "fs";
|
|
16
16
|
import { scheduler, setImmediate, setTimeout } from "node:timers/promises";
|
|
17
17
|
import { constants } from "node:os";
|
|
@@ -34,12 +34,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
34
34
|
var __commonJS = (cb, mod) => function() {
|
|
35
35
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
36
36
|
};
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all) __defProp(target, name, {
|
|
39
|
-
get: all[name],
|
|
40
|
-
enumerable: true
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
37
|
var __copyProps = (to, from, except, desc) => {
|
|
44
38
|
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++) {
|
|
45
39
|
key = keys[i$1];
|
|
@@ -450,16 +444,16 @@ function G(t, u$2, F$1) {
|
|
|
450
444
|
`).map((e$1) => oD(e$1, u$2, F$1)).join(`
|
|
451
445
|
`);
|
|
452
446
|
}
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
447
|
+
const c$1 = {
|
|
448
|
+
actions: new Set([
|
|
449
|
+
"up",
|
|
450
|
+
"down",
|
|
451
|
+
"left",
|
|
452
|
+
"right",
|
|
453
|
+
"space",
|
|
454
|
+
"enter",
|
|
455
|
+
"cancel"
|
|
456
|
+
]),
|
|
463
457
|
aliases: new Map([
|
|
464
458
|
["k", "up"],
|
|
465
459
|
["j", "down"],
|
|
@@ -499,9 +493,8 @@ function cD({ input: t = stdin, output: u$2 = stdout, overwrite: F$1 = !0, hideC
|
|
|
499
493
|
});
|
|
500
494
|
f$1.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
|
|
501
495
|
const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
|
|
502
|
-
const E = String(D$1);
|
|
503
496
|
if (k$1([
|
|
504
|
-
|
|
497
|
+
String(D$1),
|
|
505
498
|
C$1,
|
|
506
499
|
o$2
|
|
507
500
|
], "cancel")) {
|
|
@@ -690,10 +683,7 @@ let dD = class extends x {
|
|
|
690
683
|
if (u$2.group === !0) {
|
|
691
684
|
const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
|
|
692
685
|
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));
|
|
693
|
-
} else
|
|
694
|
-
const F$1 = this.value.includes(u$2.value);
|
|
695
|
-
this.value = F$1 ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
696
|
-
}
|
|
686
|
+
} else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
697
687
|
}
|
|
698
688
|
};
|
|
699
689
|
var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
|
|
@@ -726,12 +716,10 @@ let wD = class extends x {
|
|
|
726
716
|
return this.options[this.cursor].value;
|
|
727
717
|
}
|
|
728
718
|
toggleAll() {
|
|
729
|
-
|
|
730
|
-
this.value = u$2 ? [] : this.options.map((F$1) => F$1.value);
|
|
719
|
+
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
731
720
|
}
|
|
732
721
|
toggleValue() {
|
|
733
|
-
|
|
734
|
-
this.value = u$2 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
722
|
+
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
735
723
|
}
|
|
736
724
|
};
|
|
737
725
|
var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
|
|
@@ -1158,8 +1146,7 @@ ${J}${r$1.trimStart()}`), s = 3 + stripVTControlCharacters(r$1.trimStart()).leng
|
|
|
1158
1146
|
], s = V ? 80 : 120, r$1 = process.env.CI === "true";
|
|
1159
1147
|
let i$1, a$1, c$2 = !1, l$1 = "", $$1, p$1 = performance.now();
|
|
1160
1148
|
const M$1 = (m$1) => {
|
|
1161
|
-
|
|
1162
|
-
c$2 && N$1(h$2, m$1);
|
|
1149
|
+
c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1163
1150
|
}, v$1 = () => M$1(2), x$1 = () => M$1(1), j = () => {
|
|
1164
1151
|
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);
|
|
1165
1152
|
}, E = () => {
|
|
@@ -1574,8 +1561,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
|
|
|
1574
1561
|
const textDecoder = new TextDecoder();
|
|
1575
1562
|
const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
|
|
1576
1563
|
const joinToString = (uint8ArraysOrStrings, encoding) => {
|
|
1577
|
-
|
|
1578
|
-
return strings.join("");
|
|
1564
|
+
return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
|
|
1579
1565
|
};
|
|
1580
1566
|
const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
|
|
1581
1567
|
if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
|
|
@@ -1630,8 +1616,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
1630
1616
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
1631
1617
|
if (index === expressions.length) return newTokens;
|
|
1632
1618
|
const expression = expressions[index];
|
|
1633
|
-
|
|
1634
|
-
return concatTokens(newTokens, expressionTokens, trailingWhitespaces);
|
|
1619
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression$1) => parseExpression(expression$1)) : [parseExpression(expression)], trailingWhitespaces);
|
|
1635
1620
|
};
|
|
1636
1621
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
1637
1622
|
if (rawTemplate.length === 0) return {
|
|
@@ -1718,8 +1703,7 @@ const normalizeFdSpecificOptions = (options) => {
|
|
|
1718
1703
|
};
|
|
1719
1704
|
const normalizeFdSpecificOption = (options, optionName) => {
|
|
1720
1705
|
const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 });
|
|
1721
|
-
|
|
1722
|
-
return addDefaultValue$1(optionArray, optionName);
|
|
1706
|
+
return addDefaultValue$1(normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName), optionName);
|
|
1723
1707
|
};
|
|
1724
1708
|
const getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
1725
1709
|
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
@@ -1749,12 +1733,11 @@ const parseFd = (fdName) => {
|
|
|
1749
1733
|
};
|
|
1750
1734
|
const FD_REGEXP = /^fd(\d+)$/;
|
|
1751
1735
|
const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
|
|
1752
|
-
const verboseDefault = debuglog("execa").enabled ? "full" : "none";
|
|
1753
1736
|
const DEFAULT_OPTIONS = {
|
|
1754
1737
|
lines: false,
|
|
1755
1738
|
buffer: true,
|
|
1756
1739
|
maxBuffer: 1e3 * 1e3 * 100,
|
|
1757
|
-
verbose:
|
|
1740
|
+
verbose: debuglog("execa").enabled ? "full" : "none",
|
|
1758
1741
|
stripFinalNewline: true
|
|
1759
1742
|
};
|
|
1760
1743
|
const FD_SPECIFIC_OPTIONS = [
|
|
@@ -1787,11 +1770,9 @@ const VERBOSE_VALUES = [
|
|
|
1787
1770
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
1788
1771
|
const joinCommand = (filePath, rawArguments) => {
|
|
1789
1772
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
1790
|
-
const command = fileAndArguments.join(" ");
|
|
1791
|
-
const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ");
|
|
1792
1773
|
return {
|
|
1793
|
-
command,
|
|
1794
|
-
escapedCommand
|
|
1774
|
+
command: fileAndArguments.join(" "),
|
|
1775
|
+
escapedCommand: fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" ")
|
|
1795
1776
|
};
|
|
1796
1777
|
};
|
|
1797
1778
|
const escapeLines = (lines) => stripVTControlCharacters(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n");
|
|
@@ -2232,13 +2213,11 @@ const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine
|
|
|
2232
2213
|
//#endregion
|
|
2233
2214
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
2234
2215
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
2235
|
-
const
|
|
2216
|
+
const finalLines = applyVerboseOnLines(getPrintedLines(verboseMessage, getVerboseObject({
|
|
2236
2217
|
type,
|
|
2237
2218
|
result,
|
|
2238
2219
|
verboseInfo
|
|
2239
|
-
});
|
|
2240
|
-
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
2241
|
-
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
2220
|
+
})), verboseInfo, fdNumber);
|
|
2242
2221
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
2243
2222
|
};
|
|
2244
2223
|
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false,...options } } }) => ({
|
|
@@ -2255,16 +2234,13 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
|
|
|
2255
2234
|
message
|
|
2256
2235
|
}));
|
|
2257
2236
|
const getPrintedLine = (verboseObject) => {
|
|
2258
|
-
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
2259
2237
|
return {
|
|
2260
|
-
verboseLine,
|
|
2238
|
+
verboseLine: defaultVerboseFunction(verboseObject),
|
|
2261
2239
|
verboseObject
|
|
2262
2240
|
};
|
|
2263
2241
|
};
|
|
2264
2242
|
const serializeVerboseMessage = (message) => {
|
|
2265
|
-
|
|
2266
|
-
const escapedMessage = escapeLines(messageString);
|
|
2267
|
-
return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
2243
|
+
return escapeLines(typeof message === "string" ? message : inspect(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
2268
2244
|
};
|
|
2269
2245
|
const TAB_SIZE = 2;
|
|
2270
2246
|
|
|
@@ -2283,11 +2259,10 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
2283
2259
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
2284
2260
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
2285
2261
|
validateVerbose(verbose);
|
|
2286
|
-
const commandId = getCommandId(verbose);
|
|
2287
2262
|
return {
|
|
2288
2263
|
verbose,
|
|
2289
2264
|
escapedCommand,
|
|
2290
|
-
commandId,
|
|
2265
|
+
commandId: getCommandId(verbose),
|
|
2291
2266
|
rawOptions
|
|
2292
2267
|
};
|
|
2293
2268
|
};
|
|
@@ -2314,8 +2289,7 @@ const getDurationMs = (startTime) => Number(hrtime.bigint() - startTime) / 1e6;
|
|
|
2314
2289
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
2315
2290
|
const startTime = getStartTime();
|
|
2316
2291
|
const { command, escapedCommand } = joinCommand(filePath, rawArguments);
|
|
2317
|
-
const
|
|
2318
|
-
const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions });
|
|
2292
|
+
const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, "verbose"), escapedCommand, { ...rawOptions });
|
|
2319
2293
|
logCommand(escapedCommand, verboseInfo);
|
|
2320
2294
|
return {
|
|
2321
2295
|
command,
|
|
@@ -2383,8 +2357,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
2383
2357
|
var g$2 = parseInt("010", 8);
|
|
2384
2358
|
var o$2 = parseInt("001", 8);
|
|
2385
2359
|
var ug = u$2 | g$2;
|
|
2386
|
-
|
|
2387
|
-
return ret;
|
|
2360
|
+
return mod & o$2 || mod & g$2 && gid === myGid || mod & u$2 && uid === myUid || mod & ug && myUid === 0;
|
|
2388
2361
|
}
|
|
2389
2362
|
}) });
|
|
2390
2363
|
|
|
@@ -2466,8 +2439,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2466
2439
|
const ppRaw = pathEnv[i$1];
|
|
2467
2440
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2468
2441
|
const pCmd = path$7.join(pathPart, cmd);
|
|
2469
|
-
|
|
2470
|
-
resolve(subStep(p$1, i$1, 0));
|
|
2442
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
2471
2443
|
});
|
|
2472
2444
|
const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
|
|
2473
2445
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
@@ -2492,8 +2464,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2492
2464
|
for (let j = 0; j < pathExt.length; j++) {
|
|
2493
2465
|
const cur = p$1 + pathExt[j];
|
|
2494
2466
|
try {
|
|
2495
|
-
|
|
2496
|
-
if (is) if (opt.all) found.push(cur);
|
|
2467
|
+
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
2497
2468
|
else return cur;
|
|
2498
2469
|
} catch (ex) {}
|
|
2499
2470
|
}
|
|
@@ -2511,8 +2482,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
2511
2482
|
var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
|
|
2512
2483
|
const pathKey$1 = (options = {}) => {
|
|
2513
2484
|
const environment = options.env || process.env;
|
|
2514
|
-
|
|
2515
|
-
if (platform$1 !== "win32") return "PATH";
|
|
2485
|
+
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
2516
2486
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2517
2487
|
};
|
|
2518
2488
|
module.exports = pathKey$1;
|
|
@@ -2640,12 +2610,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
2640
2610
|
parsed.command = path$5.normalize(parsed.command);
|
|
2641
2611
|
parsed.command = escape.command(parsed.command);
|
|
2642
2612
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2643
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
2644
2613
|
parsed.args = [
|
|
2645
2614
|
"/d",
|
|
2646
2615
|
"/s",
|
|
2647
2616
|
"/c",
|
|
2648
|
-
`"${
|
|
2617
|
+
`"${[parsed.command].concat(parsed.args).join(" ")}"`
|
|
2649
2618
|
];
|
|
2650
2619
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
2651
2620
|
parsed.options.windowsVerbatimArguments = true;
|
|
@@ -2756,12 +2725,12 @@ function toPath(urlOrPath) {
|
|
|
2756
2725
|
}
|
|
2757
2726
|
function traversePathUp(startPath) {
|
|
2758
2727
|
return { *[Symbol.iterator]() {
|
|
2759
|
-
let currentPath = path
|
|
2728
|
+
let currentPath = path.resolve(toPath(startPath));
|
|
2760
2729
|
let previousPath;
|
|
2761
2730
|
while (previousPath !== currentPath) {
|
|
2762
2731
|
yield currentPath;
|
|
2763
2732
|
previousPath = currentPath;
|
|
2764
|
-
currentPath = path
|
|
2733
|
+
currentPath = path.resolve(currentPath, "..");
|
|
2765
2734
|
}
|
|
2766
2735
|
} };
|
|
2767
2736
|
}
|
|
@@ -2770,21 +2739,21 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
2770
2739
|
//#endregion
|
|
2771
2740
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
2772
2741
|
const npmRunPath = ({ cwd = g.cwd(), path: pathOption = g.env[pathKey()], preferLocal = true, execPath: execPath$1 = g.execPath, addExecPath = true } = {}) => {
|
|
2773
|
-
const cwdPath = path
|
|
2742
|
+
const cwdPath = path.resolve(toPath(cwd));
|
|
2774
2743
|
const result = [];
|
|
2775
|
-
const pathParts = pathOption.split(path
|
|
2744
|
+
const pathParts = pathOption.split(path.delimiter);
|
|
2776
2745
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
2777
2746
|
if (addExecPath) applyExecPath(result, pathParts, execPath$1, cwdPath);
|
|
2778
|
-
return pathOption === "" || pathOption === path
|
|
2747
|
+
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
2779
2748
|
};
|
|
2780
2749
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
2781
2750
|
for (const directory of traversePathUp(cwdPath)) {
|
|
2782
|
-
const pathPart = path
|
|
2751
|
+
const pathPart = path.join(directory, "node_modules/.bin");
|
|
2783
2752
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
2784
2753
|
}
|
|
2785
2754
|
};
|
|
2786
2755
|
const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
2787
|
-
const pathPart = path
|
|
2756
|
+
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
2788
2757
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
2789
2758
|
};
|
|
2790
2759
|
const npmRunPathEnv = ({ env: env$1 = g.env,...options } = {}) => {
|
|
@@ -2798,9 +2767,7 @@ const npmRunPathEnv = ({ env: env$1 = g.env,...options } = {}) => {
|
|
|
2798
2767
|
//#endregion
|
|
2799
2768
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
2800
2769
|
const getFinalError = (originalError, message, isSync) => {
|
|
2801
|
-
|
|
2802
|
-
const options = originalError instanceof DiscardedError ? {} : { cause: originalError };
|
|
2803
|
-
return new ErrorClass(message, options);
|
|
2770
|
+
return new (isSync ? ExecaSyncError : ExecaError)(message, originalError instanceof DiscardedError ? {} : { cause: originalError });
|
|
2804
2771
|
};
|
|
2805
2772
|
var DiscardedError = class extends Error {};
|
|
2806
2773
|
const setErrorName = (ErrorClass, value) => {
|
|
@@ -3119,16 +3086,14 @@ const SIGNALS = [
|
|
|
3119
3086
|
//#region ../../node_modules/.pnpm/human-signals@8.0.0/node_modules/human-signals/build/src/signals.js
|
|
3120
3087
|
const getSignals = () => {
|
|
3121
3088
|
const realtimeSignals = getRealtimeSignals();
|
|
3122
|
-
|
|
3123
|
-
return signals$1;
|
|
3089
|
+
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
3124
3090
|
};
|
|
3125
3091
|
const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
|
|
3126
3092
|
const { signals: { [name]: constantSignal } } = constants;
|
|
3127
3093
|
const supported = constantSignal !== void 0;
|
|
3128
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
3129
3094
|
return {
|
|
3130
3095
|
name,
|
|
3131
|
-
number,
|
|
3096
|
+
number: supported ? constantSignal : defaultNumber,
|
|
3132
3097
|
description,
|
|
3133
3098
|
supported,
|
|
3134
3099
|
action,
|
|
@@ -3540,8 +3505,7 @@ const isConnected = (anyProcess) => {
|
|
|
3540
3505
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
3541
3506
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
3542
3507
|
if (!strict) return message;
|
|
3543
|
-
const
|
|
3544
|
-
const hasListeners = hasMessageListeners(anyProcess, ipcEmitter);
|
|
3508
|
+
const hasListeners = hasMessageListeners(anyProcess, getIpcEmitter(anyProcess, channel, isSubprocess));
|
|
3545
3509
|
return {
|
|
3546
3510
|
id: count++,
|
|
3547
3511
|
type: REQUEST_TYPE,
|
|
@@ -3614,11 +3578,9 @@ const RESPONSE_TYPE = "execa:ipc:response";
|
|
|
3614
3578
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
3615
3579
|
if (!OUTGOING_MESSAGES.has(anyProcess)) OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set());
|
|
3616
3580
|
const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);
|
|
3617
|
-
const onMessageSent = createDeferred();
|
|
3618
|
-
const id = strict ? wrappedMessage.id : void 0;
|
|
3619
3581
|
const outgoingMessage = {
|
|
3620
|
-
onMessageSent,
|
|
3621
|
-
id
|
|
3582
|
+
onMessageSent: createDeferred(),
|
|
3583
|
+
id: strict ? wrappedMessage.id : void 0
|
|
3622
3584
|
};
|
|
3623
3585
|
outgoingMessages.add(outgoingMessage);
|
|
3624
3586
|
return {
|
|
@@ -3779,8 +3741,7 @@ const throwOnGracefulCancel = ({ subprocess, cancelSignal, gracefulCancel, force
|
|
|
3779
3741
|
})] : [];
|
|
3780
3742
|
const sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => {
|
|
3781
3743
|
await onAbortedSignal(cancelSignal, signal);
|
|
3782
|
-
|
|
3783
|
-
await sendAbort(subprocess, reason);
|
|
3744
|
+
await sendAbort(subprocess, getReason(cancelSignal));
|
|
3784
3745
|
killOnTimeout({
|
|
3785
3746
|
kill: subprocess.kill,
|
|
3786
3747
|
forceKillAfterDelay,
|
|
@@ -3827,7 +3788,7 @@ const mapNode = ({ options }) => {
|
|
|
3827
3788
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath,...options }) => {
|
|
3828
3789
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
3829
3790
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
3830
|
-
const resolvedNodePath = path
|
|
3791
|
+
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
3831
3792
|
const newOptions = {
|
|
3832
3793
|
...options,
|
|
3833
3794
|
nodePath: resolvedNodePath,
|
|
@@ -3839,7 +3800,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
3839
3800
|
commandArguments,
|
|
3840
3801
|
newOptions
|
|
3841
3802
|
];
|
|
3842
|
-
if (path
|
|
3803
|
+
if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
|
|
3843
3804
|
return [
|
|
3844
3805
|
resolvedNodePath,
|
|
3845
3806
|
[
|
|
@@ -3926,7 +3887,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
3926
3887
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
|
|
3927
3888
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
3928
3889
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
3929
|
-
return path
|
|
3890
|
+
return path.resolve(cwdString);
|
|
3930
3891
|
};
|
|
3931
3892
|
const getDefaultCwd = () => {
|
|
3932
3893
|
try {
|
|
@@ -3954,8 +3915,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
3954
3915
|
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
3955
3916
|
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
3956
3917
|
const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions);
|
|
3957
|
-
const
|
|
3958
|
-
const options = addDefaultOptions(fdOptions);
|
|
3918
|
+
const options = addDefaultOptions(normalizeFdSpecificOptions(initialOptions));
|
|
3959
3919
|
validateTimeout(options);
|
|
3960
3920
|
validateEncoding(options);
|
|
3961
3921
|
validateIpcInputOption(options);
|
|
@@ -3966,7 +3926,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
3966
3926
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
3967
3927
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
3968
3928
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
3969
|
-
if (g.platform === "win32" && path
|
|
3929
|
+
if (g.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
3970
3930
|
return {
|
|
3971
3931
|
file,
|
|
3972
3932
|
commandArguments,
|
|
@@ -4112,7 +4072,7 @@ const u = Object.create(a, {
|
|
|
4112
4072
|
}
|
|
4113
4073
|
});
|
|
4114
4074
|
function h({ preventCancel: r$1 = !1 } = {}) {
|
|
4115
|
-
const
|
|
4075
|
+
const t = new c(this.getReader(), r$1), s = Object.create(u);
|
|
4116
4076
|
return s[n] = t, s;
|
|
4117
4077
|
}
|
|
4118
4078
|
|
|
@@ -4161,18 +4121,14 @@ const getStreamContents$1 = async (stream, { init, convertChunk, getSize, trunca
|
|
|
4161
4121
|
const state = init();
|
|
4162
4122
|
state.length = 0;
|
|
4163
4123
|
try {
|
|
4164
|
-
for await (const chunk of asyncIterable) {
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
addChunk,
|
|
4173
|
-
maxBuffer
|
|
4174
|
-
});
|
|
4175
|
-
}
|
|
4124
|
+
for await (const chunk of asyncIterable) appendChunk({
|
|
4125
|
+
convertedChunk: convertChunk[getChunkType(chunk)](chunk, state),
|
|
4126
|
+
state,
|
|
4127
|
+
getSize,
|
|
4128
|
+
truncateChunk,
|
|
4129
|
+
addChunk,
|
|
4130
|
+
maxBuffer
|
|
4131
|
+
});
|
|
4176
4132
|
appendFinalChunk({
|
|
4177
4133
|
state,
|
|
4178
4134
|
convertChunk,
|
|
@@ -4362,10 +4318,9 @@ const stringMethods = {
|
|
|
4362
4318
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
4363
4319
|
if (!(error instanceof MaxBufferError)) throw error;
|
|
4364
4320
|
if (fdNumber === "all") return error;
|
|
4365
|
-
const unit = getMaxBufferUnit(readableObjectMode, lines, encoding);
|
|
4366
4321
|
error.maxBufferInfo = {
|
|
4367
4322
|
fdNumber,
|
|
4368
|
-
unit
|
|
4323
|
+
unit: getMaxBufferUnit(readableObjectMode, lines, encoding)
|
|
4369
4324
|
};
|
|
4370
4325
|
stream.destroy();
|
|
4371
4326
|
throw error;
|
|
@@ -4435,19 +4390,16 @@ const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDe
|
|
|
4435
4390
|
killSignal
|
|
4436
4391
|
});
|
|
4437
4392
|
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
4438
|
-
const
|
|
4439
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
4440
|
-
const messageStdio = all === void 0 ? [stdio[2], stdio[1]] : [all];
|
|
4441
|
-
const message = [
|
|
4442
|
-
shortMessage,
|
|
4443
|
-
...messageStdio,
|
|
4444
|
-
...stdio.slice(3),
|
|
4445
|
-
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4446
|
-
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n");
|
|
4393
|
+
const shortMessage = `${prefix}: ${escapedCommand}${originalMessage === void 0 ? "" : `\n${originalMessage}`}`;
|
|
4447
4394
|
return {
|
|
4448
4395
|
originalMessage,
|
|
4449
4396
|
shortMessage,
|
|
4450
|
-
message
|
|
4397
|
+
message: [
|
|
4398
|
+
shortMessage,
|
|
4399
|
+
...all === void 0 ? [stdio[2], stdio[1]] : [all],
|
|
4400
|
+
...stdio.slice(3),
|
|
4401
|
+
ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n")
|
|
4402
|
+
].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n")
|
|
4451
4403
|
};
|
|
4452
4404
|
};
|
|
4453
4405
|
const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuffer, errorCode, signal, signalDescription, exitCode, isCanceled, isGracefullyCanceled, isForcefullyTerminated, forceKillAfterDelay, killSignal }) => {
|
|
@@ -4468,8 +4420,7 @@ const getErrorPrefix = ({ originalError, timedOut, timeout, isMaxBuffer, maxBuff
|
|
|
4468
4420
|
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : "";
|
|
4469
4421
|
const getOriginalMessage = (originalError, cwd) => {
|
|
4470
4422
|
if (originalError instanceof DiscardedError) return;
|
|
4471
|
-
const
|
|
4472
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
4423
|
+
const escapedOriginalMessage = escapeLines(fixCwdError(isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError), cwd));
|
|
4473
4424
|
return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage;
|
|
4474
4425
|
};
|
|
4475
4426
|
const serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : inspect(ipcMessage);
|
|
@@ -4591,11 +4542,10 @@ const omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(re
|
|
|
4591
4542
|
const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
4592
4543
|
const exitCode = rawExitCode === null ? void 0 : rawExitCode;
|
|
4593
4544
|
const signal = rawSignal === null ? void 0 : rawSignal;
|
|
4594
|
-
const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal);
|
|
4595
4545
|
return {
|
|
4596
4546
|
exitCode,
|
|
4597
4547
|
signal,
|
|
4598
|
-
signalDescription
|
|
4548
|
+
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
4599
4549
|
};
|
|
4600
4550
|
};
|
|
4601
4551
|
|
|
@@ -4660,8 +4610,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4660
4610
|
let result = [];
|
|
4661
4611
|
const floorDecimals = (value, decimalDigits) => {
|
|
4662
4612
|
const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
|
|
4663
|
-
|
|
4664
|
-
return flooredValue.toFixed(decimalDigits);
|
|
4613
|
+
return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
|
|
4665
4614
|
};
|
|
4666
4615
|
const add = (value, long, short, valueString) => {
|
|
4667
4616
|
if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
|
|
@@ -4698,14 +4647,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
4698
4647
|
} else {
|
|
4699
4648
|
const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
4700
4649
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
4701
|
-
const
|
|
4702
|
-
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
4650
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
4703
4651
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
4704
4652
|
}
|
|
4705
4653
|
} else {
|
|
4706
|
-
const
|
|
4707
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
4708
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
4654
|
+
const secondsFixed = floorDecimals((isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60, typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1);
|
|
4709
4655
|
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
4710
4656
|
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
4711
4657
|
}
|
|
@@ -4734,10 +4680,9 @@ const logResult = (result, verboseInfo) => {
|
|
|
4734
4680
|
logDuration(result, verboseInfo);
|
|
4735
4681
|
};
|
|
4736
4682
|
const logDuration = (result, verboseInfo) => {
|
|
4737
|
-
const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`;
|
|
4738
4683
|
verboseLog({
|
|
4739
4684
|
type: "duration",
|
|
4740
|
-
verboseMessage
|
|
4685
|
+
verboseMessage: `(done in ${prettyMilliseconds(result.durationMs)})`,
|
|
4741
4686
|
verboseInfo,
|
|
4742
4687
|
result
|
|
4743
4688
|
});
|
|
@@ -4864,18 +4809,16 @@ const TYPE_TO_MESSAGE = {
|
|
|
4864
4809
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
4865
4810
|
const getOutputObjectModes = (objectMode, index, newTransforms) => {
|
|
4866
4811
|
const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
|
|
4867
|
-
const readableObjectMode = objectMode ?? writableObjectMode;
|
|
4868
4812
|
return {
|
|
4869
4813
|
writableObjectMode,
|
|
4870
|
-
readableObjectMode
|
|
4814
|
+
readableObjectMode: objectMode ?? writableObjectMode
|
|
4871
4815
|
};
|
|
4872
4816
|
};
|
|
4873
4817
|
const getInputObjectModes = (objectMode, index, newTransforms) => {
|
|
4874
4818
|
const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode;
|
|
4875
|
-
const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);
|
|
4876
4819
|
return {
|
|
4877
4820
|
writableObjectMode,
|
|
4878
|
-
readableObjectMode
|
|
4821
|
+
readableObjectMode: index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode)
|
|
4879
4822
|
};
|
|
4880
4823
|
};
|
|
4881
4824
|
const getFdObjectMode = (stdioItems, direction) => {
|
|
@@ -5184,8 +5127,7 @@ const validateDuplicateStreamSync = ({ otherStdioItems, type, value, optionName,
|
|
|
5184
5127
|
const getDuplicateStreamInstance = ({ otherStdioItems, type, value, optionName, direction }) => {
|
|
5185
5128
|
const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value));
|
|
5186
5129
|
if (duplicateStdioItems.length === 0) return;
|
|
5187
|
-
|
|
5188
|
-
throwOnDuplicateStream(differentStdioItem, optionName, type);
|
|
5130
|
+
throwOnDuplicateStream(duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction), optionName, type);
|
|
5189
5131
|
return direction === "output" ? duplicateStdioItems[0].stream : void 0;
|
|
5190
5132
|
};
|
|
5191
5133
|
const hasSameValue = ({ type, value }, secondValue) => {
|
|
@@ -5194,8 +5136,7 @@ const hasSameValue = ({ type, value }, secondValue) => {
|
|
|
5194
5136
|
return value === secondValue;
|
|
5195
5137
|
};
|
|
5196
5138
|
const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }) => {
|
|
5197
|
-
|
|
5198
|
-
throwOnDuplicateStream(duplicateStdioItem, optionName, type);
|
|
5139
|
+
throwOnDuplicateStream(otherStdioItems.find(({ value: { transform } }) => transform === value.transform), optionName, type);
|
|
5199
5140
|
};
|
|
5200
5141
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
5201
5142
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
@@ -5204,15 +5145,13 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
|
5204
5145
|
//#endregion
|
|
5205
5146
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
5206
5147
|
const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
5207
|
-
const stdio = normalizeStdioOption(options, verboseInfo, isSync);
|
|
5208
|
-
const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
|
|
5209
|
-
stdioOption,
|
|
5210
|
-
fdNumber,
|
|
5211
|
-
options,
|
|
5212
|
-
isSync
|
|
5213
|
-
}));
|
|
5214
5148
|
const fileDescriptors = getFinalFileDescriptors({
|
|
5215
|
-
initialFileDescriptors,
|
|
5149
|
+
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
5150
|
+
stdioOption,
|
|
5151
|
+
fdNumber,
|
|
5152
|
+
options,
|
|
5153
|
+
isSync
|
|
5154
|
+
})),
|
|
5216
5155
|
addProperties: addProperties$2,
|
|
5217
5156
|
options,
|
|
5218
5157
|
isSync
|
|
@@ -5229,14 +5168,13 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
5229
5168
|
optionName
|
|
5230
5169
|
});
|
|
5231
5170
|
const direction = getStreamDirection(initialStdioItems, fdNumber, optionName);
|
|
5232
|
-
const
|
|
5171
|
+
const normalizedStdioItems = normalizeTransforms(initialStdioItems.map((stdioItem) => handleNativeStream({
|
|
5233
5172
|
stdioItem,
|
|
5234
5173
|
isStdioArray,
|
|
5235
5174
|
fdNumber,
|
|
5236
5175
|
direction,
|
|
5237
5176
|
isSync
|
|
5238
|
-
}));
|
|
5239
|
-
const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);
|
|
5177
|
+
})), optionName, direction, options);
|
|
5240
5178
|
const objectMode = getFdObjectMode(normalizedStdioItems, direction);
|
|
5241
5179
|
validateFileObjectMode(normalizedStdioItems, objectMode);
|
|
5242
5180
|
return {
|
|
@@ -5246,9 +5184,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
|
|
|
5246
5184
|
};
|
|
5247
5185
|
};
|
|
5248
5186
|
const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
|
|
5249
|
-
const
|
|
5250
|
-
const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
|
|
5251
|
-
const stdioItems = filterDuplicates(initialStdioItems);
|
|
5187
|
+
const stdioItems = filterDuplicates([...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)]);
|
|
5252
5188
|
const isStdioArray = stdioItems.length > 1;
|
|
5253
5189
|
validateStdioArray(stdioItems, isStdioArray, optionName);
|
|
5254
5190
|
validateStreams(stdioItems);
|
|
@@ -5298,18 +5234,17 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
5298
5234
|
}
|
|
5299
5235
|
};
|
|
5300
5236
|
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties: addProperties$2, options, isSync }) => {
|
|
5301
|
-
const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({
|
|
5302
|
-
stdioItem,
|
|
5303
|
-
addProperties: addProperties$2,
|
|
5304
|
-
direction,
|
|
5305
|
-
options,
|
|
5306
|
-
fileDescriptors,
|
|
5307
|
-
isSync
|
|
5308
|
-
}));
|
|
5309
5237
|
return {
|
|
5310
5238
|
direction,
|
|
5311
5239
|
objectMode,
|
|
5312
|
-
stdioItems:
|
|
5240
|
+
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
5241
|
+
stdioItem,
|
|
5242
|
+
addProperties: addProperties$2,
|
|
5243
|
+
direction,
|
|
5244
|
+
options,
|
|
5245
|
+
fileDescriptors,
|
|
5246
|
+
isSync
|
|
5247
|
+
}))
|
|
5313
5248
|
};
|
|
5314
5249
|
};
|
|
5315
5250
|
const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direction, options, fileDescriptors, isSync }) => {
|
|
@@ -5439,8 +5374,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
|
5439
5374
|
yield chunk;
|
|
5440
5375
|
return;
|
|
5441
5376
|
}
|
|
5442
|
-
|
|
5443
|
-
yield concatBytes(chunk, newline);
|
|
5377
|
+
yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
|
|
5444
5378
|
};
|
|
5445
5379
|
const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
|
|
5446
5380
|
const linesStringInfo = {
|
|
@@ -5585,7 +5519,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5585
5519
|
const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
|
|
5586
5520
|
const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
|
|
5587
5521
|
const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
|
|
5588
|
-
|
|
5522
|
+
return { stream: new Transform({
|
|
5589
5523
|
writableObjectMode,
|
|
5590
5524
|
writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
|
|
5591
5525
|
readableObjectMode,
|
|
@@ -5601,16 +5535,12 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
5601
5535
|
finalMethod([generators], this, done);
|
|
5602
5536
|
},
|
|
5603
5537
|
destroy: destroyMethod
|
|
5604
|
-
});
|
|
5605
|
-
return { stream };
|
|
5538
|
+
}) };
|
|
5606
5539
|
};
|
|
5607
5540
|
const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
|
|
5608
5541
|
const generators = stdioItems.filter(({ type }) => type === "generator");
|
|
5609
5542
|
const reversedGenerators = isInput ? generators.reverse() : generators;
|
|
5610
|
-
for (const { value, optionName } of reversedGenerators)
|
|
5611
|
-
const generators$1 = addInternalGenerators(value, encoding, optionName);
|
|
5612
|
-
chunks = runTransformSync(generators$1, chunks);
|
|
5613
|
-
}
|
|
5543
|
+
for (const { value, optionName } of reversedGenerators) chunks = runTransformSync(addInternalGenerators(value, encoding, optionName), chunks);
|
|
5614
5544
|
return chunks;
|
|
5615
5545
|
};
|
|
5616
5546
|
const addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => {
|
|
@@ -5647,9 +5577,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
|
|
|
5647
5577
|
const [{ type, optionName }] = allStdioItems;
|
|
5648
5578
|
throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
|
|
5649
5579
|
}
|
|
5650
|
-
|
|
5651
|
-
const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
|
|
5652
|
-
options.input = joinToUint8Array(transformedContents);
|
|
5580
|
+
options.input = joinToUint8Array(allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)));
|
|
5653
5581
|
};
|
|
5654
5582
|
const applySingleInputGeneratorsSync = (contents, stdioItems) => {
|
|
5655
5583
|
const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true);
|
|
@@ -5674,10 +5602,9 @@ const logLinesSync = (linesArray, fdNumber, verboseInfo) => {
|
|
|
5674
5602
|
};
|
|
5675
5603
|
const isPipingStream = (stream) => stream._readableState.pipes.length > 0;
|
|
5676
5604
|
const logLine = (line, fdNumber, verboseInfo) => {
|
|
5677
|
-
const verboseMessage = serializeVerboseMessage(line);
|
|
5678
5605
|
verboseLog({
|
|
5679
5606
|
type: "output",
|
|
5680
|
-
verboseMessage,
|
|
5607
|
+
verboseMessage: serializeVerboseMessage(line),
|
|
5681
5608
|
fdNumber,
|
|
5682
5609
|
verboseInfo
|
|
5683
5610
|
});
|
|
@@ -5689,28 +5616,25 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
5689
5616
|
if (output === null) return { output: Array.from({ length: 3 }) };
|
|
5690
5617
|
const state = {};
|
|
5691
5618
|
const outputFiles = /* @__PURE__ */ new Set([]);
|
|
5692
|
-
const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
|
|
5693
|
-
result,
|
|
5694
|
-
fileDescriptors,
|
|
5695
|
-
fdNumber,
|
|
5696
|
-
state,
|
|
5697
|
-
outputFiles,
|
|
5698
|
-
isMaxBuffer,
|
|
5699
|
-
verboseInfo
|
|
5700
|
-
}, options));
|
|
5701
5619
|
return {
|
|
5702
|
-
output:
|
|
5620
|
+
output: output.map((result, fdNumber) => transformOutputResultSync({
|
|
5621
|
+
result,
|
|
5622
|
+
fileDescriptors,
|
|
5623
|
+
fdNumber,
|
|
5624
|
+
state,
|
|
5625
|
+
outputFiles,
|
|
5626
|
+
isMaxBuffer,
|
|
5627
|
+
verboseInfo
|
|
5628
|
+
}, options)),
|
|
5703
5629
|
...state
|
|
5704
5630
|
};
|
|
5705
5631
|
};
|
|
5706
5632
|
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline$1, maxBuffer }) => {
|
|
5707
5633
|
if (result === null) return;
|
|
5708
|
-
const
|
|
5709
|
-
const uint8ArrayResult = bufferToUint8Array(truncatedResult);
|
|
5634
|
+
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
5710
5635
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
5711
|
-
const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);
|
|
5712
5636
|
const { serializedResult, finalResult = serializedResult } = serializeChunks({
|
|
5713
|
-
chunks,
|
|
5637
|
+
chunks: runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state),
|
|
5714
5638
|
objectMode,
|
|
5715
5639
|
encoding,
|
|
5716
5640
|
lines,
|
|
@@ -5821,14 +5745,12 @@ const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
|
5821
5745
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
5822
5746
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
5823
5747
|
const resultError = getResultError(error, exitCode, signal);
|
|
5824
|
-
const timedOut = resultError?.code === "ETIMEDOUT";
|
|
5825
|
-
const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);
|
|
5826
5748
|
return {
|
|
5827
5749
|
resultError,
|
|
5828
5750
|
exitCode,
|
|
5829
5751
|
signal,
|
|
5830
|
-
timedOut,
|
|
5831
|
-
isMaxBuffer
|
|
5752
|
+
timedOut: resultError?.code === "ETIMEDOUT",
|
|
5753
|
+
isMaxBuffer: isMaxBufferSync(resultError, output, maxBuffer)
|
|
5832
5754
|
};
|
|
5833
5755
|
};
|
|
5834
5756
|
const getResultError = (error, exitCode, signal) => {
|
|
@@ -5840,7 +5762,7 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
5840
5762
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
5841
5763
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
5842
5764
|
const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions);
|
|
5843
|
-
|
|
5765
|
+
return handleResult(spawnSubprocessSync({
|
|
5844
5766
|
file,
|
|
5845
5767
|
commandArguments,
|
|
5846
5768
|
options,
|
|
@@ -5849,15 +5771,12 @@ const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
|
5849
5771
|
verboseInfo,
|
|
5850
5772
|
fileDescriptors,
|
|
5851
5773
|
startTime
|
|
5852
|
-
});
|
|
5853
|
-
return handleResult(result, verboseInfo, options);
|
|
5774
|
+
}), verboseInfo, options);
|
|
5854
5775
|
};
|
|
5855
5776
|
const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
5856
5777
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
5857
|
-
const
|
|
5858
|
-
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions);
|
|
5778
|
+
const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, normalizeSyncOptions(rawOptions));
|
|
5859
5779
|
validateSyncOptions(options);
|
|
5860
|
-
const fileDescriptors = handleStdioSync(options, verboseInfo);
|
|
5861
5780
|
return {
|
|
5862
5781
|
file,
|
|
5863
5782
|
commandArguments,
|
|
@@ -5866,7 +5785,7 @@ const handleSyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
5866
5785
|
startTime,
|
|
5867
5786
|
verboseInfo,
|
|
5868
5787
|
options,
|
|
5869
|
-
fileDescriptors
|
|
5788
|
+
fileDescriptors: handleStdioSync(options, verboseInfo)
|
|
5870
5789
|
};
|
|
5871
5790
|
};
|
|
5872
5791
|
const normalizeSyncOptions = (options) => options.node && !options.ipc ? {
|
|
@@ -5901,16 +5820,14 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5901
5820
|
isMaxBuffer,
|
|
5902
5821
|
verboseInfo
|
|
5903
5822
|
});
|
|
5904
|
-
const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));
|
|
5905
|
-
const all = stripNewline(getAllSync(output, options), options, "all");
|
|
5906
5823
|
return getSyncResult({
|
|
5907
5824
|
error,
|
|
5908
5825
|
exitCode,
|
|
5909
5826
|
signal,
|
|
5910
5827
|
timedOut,
|
|
5911
5828
|
isMaxBuffer,
|
|
5912
|
-
stdio,
|
|
5913
|
-
all,
|
|
5829
|
+
stdio: output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)),
|
|
5830
|
+
all: stripNewline(getAllSync(output, options), options, "all"),
|
|
5914
5831
|
options,
|
|
5915
5832
|
command,
|
|
5916
5833
|
escapedCommand,
|
|
@@ -5920,8 +5837,7 @@ const spawnSubprocessSync = ({ file, commandArguments, options, command, escaped
|
|
|
5920
5837
|
const runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => {
|
|
5921
5838
|
try {
|
|
5922
5839
|
addInputOptionsSync(fileDescriptors, options);
|
|
5923
|
-
|
|
5924
|
-
return spawnSync(file, commandArguments, normalizedOptions);
|
|
5840
|
+
return spawnSync(file, commandArguments, normalizeSpawnSyncOptions(options));
|
|
5925
5841
|
} catch (error) {
|
|
5926
5842
|
return makeEarlyError({
|
|
5927
5843
|
error,
|
|
@@ -6139,19 +6055,17 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
6139
6055
|
writable,
|
|
6140
6056
|
duplex
|
|
6141
6057
|
});
|
|
6142
|
-
const earlyError = makeEarlyError({
|
|
6143
|
-
error,
|
|
6144
|
-
command,
|
|
6145
|
-
escapedCommand,
|
|
6146
|
-
fileDescriptors,
|
|
6147
|
-
options,
|
|
6148
|
-
startTime,
|
|
6149
|
-
isSync: false
|
|
6150
|
-
});
|
|
6151
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
6152
6058
|
return {
|
|
6153
6059
|
subprocess,
|
|
6154
|
-
promise
|
|
6060
|
+
promise: handleDummyPromise(makeEarlyError({
|
|
6061
|
+
error,
|
|
6062
|
+
command,
|
|
6063
|
+
escapedCommand,
|
|
6064
|
+
fileDescriptors,
|
|
6065
|
+
options,
|
|
6066
|
+
startTime,
|
|
6067
|
+
isSync: false
|
|
6068
|
+
}), verboseInfo, options)
|
|
6155
6069
|
};
|
|
6156
6070
|
};
|
|
6157
6071
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
@@ -6200,8 +6114,7 @@ const addProperties = {
|
|
|
6200
6114
|
nodeStream: ({ value }) => ({ stream: value }),
|
|
6201
6115
|
webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
|
|
6202
6116
|
const objectMode = writableObjectMode || readableObjectMode;
|
|
6203
|
-
|
|
6204
|
-
return { stream };
|
|
6117
|
+
return { stream: Duplex.fromWeb(transform, { objectMode }) };
|
|
6205
6118
|
},
|
|
6206
6119
|
duplex: ({ value: { transform } }) => ({ stream: transform }),
|
|
6207
6120
|
native() {}
|
|
@@ -6447,10 +6360,7 @@ const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
|
6447
6360
|
controller
|
|
6448
6361
|
});
|
|
6449
6362
|
}
|
|
6450
|
-
for (const [outputStream, inputStreams] of pipeGroups.entries())
|
|
6451
|
-
const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);
|
|
6452
|
-
pipeStreams(inputStream, outputStream);
|
|
6453
|
-
}
|
|
6363
|
+
for (const [outputStream, inputStreams] of pipeGroups.entries()) pipeStreams(inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams), outputStream);
|
|
6454
6364
|
};
|
|
6455
6365
|
const pipeTransform = (subprocess, stream, direction, fdNumber) => {
|
|
6456
6366
|
if (direction === "output") pipeStreams(subprocess.stdio[fdNumber], stream);
|
|
@@ -6712,10 +6622,9 @@ const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNes
|
|
|
6712
6622
|
const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
6713
6623
|
try {
|
|
6714
6624
|
const { destination, pipeOptions: { from, to, unpipeSignal } = {} } = getDestination(boundOptions, createNested, ...pipeArguments);
|
|
6715
|
-
const destinationStream = getToStream(destination, to);
|
|
6716
6625
|
return {
|
|
6717
6626
|
destination,
|
|
6718
|
-
destinationStream,
|
|
6627
|
+
destinationStream: getToStream(destination, to),
|
|
6719
6628
|
from,
|
|
6720
6629
|
unpipeSignal
|
|
6721
6630
|
};
|
|
@@ -6724,19 +6633,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
|
|
|
6724
6633
|
}
|
|
6725
6634
|
};
|
|
6726
6635
|
const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
|
|
6727
|
-
if (Array.isArray(firstArgument)) {
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
pipeOptions: boundOptions
|
|
6732
|
-
};
|
|
6733
|
-
}
|
|
6636
|
+
if (Array.isArray(firstArgument)) return {
|
|
6637
|
+
destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
|
|
6638
|
+
pipeOptions: boundOptions
|
|
6639
|
+
};
|
|
6734
6640
|
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
6735
6641
|
if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
|
|
6736
6642
|
const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
|
|
6737
|
-
const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
|
|
6738
6643
|
return {
|
|
6739
|
-
destination,
|
|
6644
|
+
destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
|
|
6740
6645
|
pipeOptions: rawOptions
|
|
6741
6646
|
};
|
|
6742
6647
|
}
|
|
@@ -6756,8 +6661,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
|
|
|
6756
6661
|
} });
|
|
6757
6662
|
const getSourceStream = (source, from) => {
|
|
6758
6663
|
try {
|
|
6759
|
-
|
|
6760
|
-
return { sourceStream };
|
|
6664
|
+
return { sourceStream: getFromStream(source, from) };
|
|
6761
6665
|
} catch (error) {
|
|
6762
6666
|
return { sourceError: error };
|
|
6763
6667
|
}
|
|
@@ -6851,9 +6755,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
|
|
|
6851
6755
|
const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
|
|
6852
6756
|
await aborted(unpipeSignal, sourceStream);
|
|
6853
6757
|
await mergedStream.remove(sourceStream);
|
|
6854
|
-
const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
|
|
6855
6758
|
throw createNonCommandError({
|
|
6856
|
-
error,
|
|
6759
|
+
error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
|
|
6857
6760
|
fileDescriptors,
|
|
6858
6761
|
sourceOptions,
|
|
6859
6762
|
startTime
|
|
@@ -6956,13 +6859,12 @@ const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
6956
6859
|
}
|
|
6957
6860
|
};
|
|
6958
6861
|
const iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
6959
|
-
const onStdoutChunk = on(stream, "data", {
|
|
6960
|
-
signal: controller.signal,
|
|
6961
|
-
highWaterMark: HIGH_WATER_MARK,
|
|
6962
|
-
highWatermark: HIGH_WATER_MARK
|
|
6963
|
-
});
|
|
6964
6862
|
return iterateOnData({
|
|
6965
|
-
onStdoutChunk,
|
|
6863
|
+
onStdoutChunk: on(stream, "data", {
|
|
6864
|
+
signal: controller.signal,
|
|
6865
|
+
highWaterMark: HIGH_WATER_MARK,
|
|
6866
|
+
highWatermark: HIGH_WATER_MARK
|
|
6867
|
+
}),
|
|
6966
6868
|
controller,
|
|
6967
6869
|
binary,
|
|
6968
6870
|
shouldEncode,
|
|
@@ -7007,13 +6909,12 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
7007
6909
|
await Promise.all([resumeStream(stream), logPromise]);
|
|
7008
6910
|
return;
|
|
7009
6911
|
}
|
|
7010
|
-
const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline$1, fdNumber);
|
|
7011
6912
|
const iterable = iterateForResult({
|
|
7012
6913
|
stream,
|
|
7013
6914
|
onStreamEnd,
|
|
7014
6915
|
lines,
|
|
7015
6916
|
encoding,
|
|
7016
|
-
stripFinalNewline:
|
|
6917
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline$1, fdNumber),
|
|
7017
6918
|
allMixed
|
|
7018
6919
|
});
|
|
7019
6920
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -7033,15 +6934,14 @@ const logOutputAsync = async ({ stream, onStreamEnd, fdNumber, encoding, allMixe
|
|
|
7033
6934
|
verboseInfo,
|
|
7034
6935
|
fdNumber
|
|
7035
6936
|
})) return;
|
|
7036
|
-
|
|
6937
|
+
await logLines(iterateForResult({
|
|
7037
6938
|
stream,
|
|
7038
6939
|
onStreamEnd,
|
|
7039
6940
|
lines: true,
|
|
7040
6941
|
encoding,
|
|
7041
6942
|
stripFinalNewline: true,
|
|
7042
6943
|
allMixed
|
|
7043
|
-
});
|
|
7044
|
-
await logLines(linesIterable, stream, fdNumber, verboseInfo);
|
|
6944
|
+
}), stream, fdNumber, verboseInfo);
|
|
7045
6945
|
};
|
|
7046
6946
|
const resumeStream = async (stream) => {
|
|
7047
6947
|
await setImmediate();
|
|
@@ -7191,10 +7091,9 @@ const getAllMixed = ({ all, stdout: stdout$1, stderr }) => all && stdout$1 && st
|
|
|
7191
7091
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
7192
7092
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
7193
7093
|
const logIpcOutput = (message, verboseInfo) => {
|
|
7194
|
-
const verboseMessage = serializeVerboseMessage(message);
|
|
7195
7094
|
verboseLog({
|
|
7196
7095
|
type: "ipc",
|
|
7197
|
-
verboseMessage,
|
|
7096
|
+
verboseMessage: serializeVerboseMessage(message),
|
|
7198
7097
|
fdNumber: "ipc",
|
|
7199
7098
|
verboseInfo
|
|
7200
7099
|
});
|
|
@@ -7337,9 +7236,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
7337
7236
|
const promises = weakMap.get(stream);
|
|
7338
7237
|
const promise = createDeferred();
|
|
7339
7238
|
promises.push(promise);
|
|
7340
|
-
const resolve = promise.resolve.bind(promise);
|
|
7341
7239
|
return {
|
|
7342
|
-
resolve,
|
|
7240
|
+
resolve: promise.resolve.bind(promise),
|
|
7343
7241
|
promises
|
|
7344
7242
|
};
|
|
7345
7243
|
};
|
|
@@ -7420,10 +7318,9 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
7420
7318
|
};
|
|
7421
7319
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
7422
7320
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7423
|
-
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy");
|
|
7424
7321
|
return {
|
|
7425
7322
|
subprocessStdout,
|
|
7426
|
-
waitReadableDestroy
|
|
7323
|
+
waitReadableDestroy: addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy")
|
|
7427
7324
|
};
|
|
7428
7325
|
};
|
|
7429
7326
|
const getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? {
|
|
@@ -7501,12 +7398,10 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
7501
7398
|
};
|
|
7502
7399
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
7503
7400
|
const subprocessStdin = getToStream(subprocess, to);
|
|
7504
|
-
const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal");
|
|
7505
|
-
const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy");
|
|
7506
7401
|
return {
|
|
7507
7402
|
subprocessStdin,
|
|
7508
|
-
waitWritableFinal,
|
|
7509
|
-
waitWritableDestroy
|
|
7403
|
+
waitWritableFinal: addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"),
|
|
7404
|
+
waitWritableDestroy: addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy")
|
|
7510
7405
|
};
|
|
7511
7406
|
};
|
|
7512
7407
|
const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({
|
|
@@ -7602,15 +7497,14 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
7602
7497
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
7603
7498
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
7604
7499
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
7605
|
-
|
|
7500
|
+
return iterateOnStdoutData(iterateOnSubprocessStream({
|
|
7606
7501
|
subprocessStdout,
|
|
7607
7502
|
subprocess,
|
|
7608
7503
|
binary,
|
|
7609
7504
|
shouldEncode: true,
|
|
7610
7505
|
encoding,
|
|
7611
7506
|
preserveNewlines
|
|
7612
|
-
});
|
|
7613
|
-
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
7507
|
+
}), subprocessStdout, subprocess);
|
|
7614
7508
|
};
|
|
7615
7509
|
const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) {
|
|
7616
7510
|
try {
|
|
@@ -7692,7 +7586,6 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7692
7586
|
const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions);
|
|
7693
7587
|
const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions);
|
|
7694
7588
|
const options = handleAsyncOptions(normalizedOptions);
|
|
7695
|
-
const fileDescriptors = handleStdioAsync(options, verboseInfo);
|
|
7696
7589
|
return {
|
|
7697
7590
|
file,
|
|
7698
7591
|
commandArguments,
|
|
@@ -7701,7 +7594,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
7701
7594
|
startTime,
|
|
7702
7595
|
verboseInfo,
|
|
7703
7596
|
options,
|
|
7704
|
-
fileDescriptors
|
|
7597
|
+
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
7705
7598
|
};
|
|
7706
7599
|
};
|
|
7707
7600
|
const handleAsyncOptions = ({ timeout, signal,...options }) => {
|
|
@@ -7774,22 +7667,19 @@ const handlePromise = async ({ subprocess, options, startTime, verboseInfo, file
|
|
|
7774
7667
|
});
|
|
7775
7668
|
controller.abort();
|
|
7776
7669
|
onInternalError.resolve();
|
|
7777
|
-
|
|
7778
|
-
const all = stripNewline(allResult, options, "all");
|
|
7779
|
-
const result = getAsyncResult({
|
|
7670
|
+
return handleResult(getAsyncResult({
|
|
7780
7671
|
errorInfo,
|
|
7781
7672
|
exitCode,
|
|
7782
7673
|
signal,
|
|
7783
|
-
stdio,
|
|
7784
|
-
all,
|
|
7674
|
+
stdio: stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)),
|
|
7675
|
+
all: stripNewline(allResult, options, "all"),
|
|
7785
7676
|
ipcOutput,
|
|
7786
7677
|
context,
|
|
7787
7678
|
options,
|
|
7788
7679
|
command,
|
|
7789
7680
|
escapedCommand,
|
|
7790
7681
|
startTime
|
|
7791
|
-
});
|
|
7792
|
-
return handleResult(result, verboseInfo, options);
|
|
7682
|
+
}), verboseInfo, options);
|
|
7793
7683
|
};
|
|
7794
7684
|
const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({
|
|
7795
7685
|
error: errorInfo.error,
|
|
@@ -7862,8 +7752,7 @@ const callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, set
|
|
|
7862
7752
|
return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested);
|
|
7863
7753
|
};
|
|
7864
7754
|
const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => {
|
|
7865
|
-
const
|
|
7866
|
-
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);
|
|
7755
|
+
const [initialFile, initialArguments, initialOptions] = normalizeParameters(...isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]);
|
|
7867
7756
|
const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);
|
|
7868
7757
|
const { file = initialFile, commandArguments = initialArguments, options = mergedOptions, isSync = false } = mapArguments({
|
|
7869
7758
|
file: initialFile,
|
|
@@ -11733,7 +11622,6 @@ var require_toml = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/toml@3
|
|
|
11733
11622
|
//#region ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js
|
|
11734
11623
|
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) => {
|
|
11735
11624
|
exports.__esModule = true;
|
|
11736
|
-
exports.Adapt = void 0;
|
|
11737
11625
|
function isBoolean(t) {
|
|
11738
11626
|
return typeOf(t) === "boolean";
|
|
11739
11627
|
}
|
|
@@ -11748,13 +11636,13 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11748
11636
|
}
|
|
11749
11637
|
function Adapt$2(adapter_) {
|
|
11750
11638
|
var meta = adapter_.meta, path$8 = adapter_.path, xdg = adapter_.xdg;
|
|
11751
|
-
|
|
11752
|
-
function XDGAppPaths_
|
|
11639
|
+
return { XDGAppPaths: new (function() {
|
|
11640
|
+
function XDGAppPaths_(options_) {
|
|
11753
11641
|
if (options_ === void 0) options_ = {};
|
|
11754
11642
|
var _a, _b, _c;
|
|
11755
11643
|
function XDGAppPaths(options$1) {
|
|
11756
11644
|
if (options$1 === void 0) options$1 = {};
|
|
11757
|
-
return new XDGAppPaths_
|
|
11645
|
+
return new XDGAppPaths_(options$1);
|
|
11758
11646
|
}
|
|
11759
11647
|
var options = isObject(options_) ? options_ : { name: options_ };
|
|
11760
11648
|
var suffix = (_a = options.suffix) !== null && _a !== void 0 ? _a : "";
|
|
@@ -11764,10 +11652,9 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11764
11652
|
meta.pkgMainFilename(),
|
|
11765
11653
|
meta.mainFilename()
|
|
11766
11654
|
];
|
|
11767
|
-
var nameFallback = "$eval";
|
|
11768
11655
|
var name = path$8.parse(((_c = namePriorityList.find(function(e$1) {
|
|
11769
11656
|
return isString(e$1);
|
|
11770
|
-
})) !== null && _c !== void 0 ? _c :
|
|
11657
|
+
})) !== null && _c !== void 0 ? _c : "$eval") + suffix).name;
|
|
11771
11658
|
XDGAppPaths.$name = function $name() {
|
|
11772
11659
|
return name;
|
|
11773
11660
|
};
|
|
@@ -11777,8 +11664,7 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11777
11664
|
function isIsolated(dirOptions) {
|
|
11778
11665
|
var _a$1;
|
|
11779
11666
|
dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ };
|
|
11780
|
-
|
|
11781
|
-
return isolated;
|
|
11667
|
+
return isBoolean(dirOptions) ? dirOptions : (_a$1 = dirOptions.isolated) !== null && _a$1 !== void 0 ? _a$1 : isolated_;
|
|
11782
11668
|
}
|
|
11783
11669
|
function finalPathSegment(dirOptions) {
|
|
11784
11670
|
return isIsolated(dirOptions) ? name : "";
|
|
@@ -11810,9 +11696,8 @@ var require_XDGAppPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
11810
11696
|
};
|
|
11811
11697
|
return XDGAppPaths;
|
|
11812
11698
|
}
|
|
11813
|
-
return XDGAppPaths_
|
|
11814
|
-
}();
|
|
11815
|
-
return { XDGAppPaths: new XDGAppPaths_() };
|
|
11699
|
+
return XDGAppPaths_;
|
|
11700
|
+
}())() };
|
|
11816
11701
|
}
|
|
11817
11702
|
exports.Adapt = Adapt$2;
|
|
11818
11703
|
}) });
|
|
@@ -11825,7 +11710,6 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11825
11710
|
return to;
|
|
11826
11711
|
};
|
|
11827
11712
|
exports.__esModule = true;
|
|
11828
|
-
exports.Adapt = void 0;
|
|
11829
11713
|
function Adapt$1(adapter_) {
|
|
11830
11714
|
var env$1 = adapter_.env, osPaths = adapter_.osPaths, path$8 = adapter_.path;
|
|
11831
11715
|
var isMacOS = /^darwin$/i.test(adapter_.process.platform);
|
|
@@ -11946,10 +11830,10 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11946
11830
|
state
|
|
11947
11831
|
};
|
|
11948
11832
|
};
|
|
11949
|
-
|
|
11950
|
-
function XDG_
|
|
11833
|
+
return { XDG: new (function() {
|
|
11834
|
+
function XDG_() {
|
|
11951
11835
|
function XDG() {
|
|
11952
|
-
return new XDG_
|
|
11836
|
+
return new XDG_();
|
|
11953
11837
|
}
|
|
11954
11838
|
var extension = isMacOS ? macos() : isWinOS ? windows() : linux();
|
|
11955
11839
|
XDG.cache = extension.cache;
|
|
@@ -11967,9 +11851,8 @@ var require_XDG = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-por
|
|
|
11967
11851
|
};
|
|
11968
11852
|
return XDG;
|
|
11969
11853
|
}
|
|
11970
|
-
return XDG_
|
|
11971
|
-
}();
|
|
11972
|
-
return { XDG: new XDG_() };
|
|
11854
|
+
return XDG_;
|
|
11855
|
+
}())() };
|
|
11973
11856
|
}
|
|
11974
11857
|
exports.Adapt = Adapt$1;
|
|
11975
11858
|
}) });
|
|
@@ -11982,7 +11865,6 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
11982
11865
|
return to;
|
|
11983
11866
|
};
|
|
11984
11867
|
exports.__esModule = true;
|
|
11985
|
-
exports.Adapt = void 0;
|
|
11986
11868
|
function isEmpty(s) {
|
|
11987
11869
|
return !s;
|
|
11988
11870
|
}
|
|
@@ -11997,13 +11879,12 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
11997
11879
|
return normalizePath((typeof os$2.homedir === "function" ? os$2.homedir() : void 0) || env$1.get("HOME"));
|
|
11998
11880
|
};
|
|
11999
11881
|
var windows = function() {
|
|
12000
|
-
|
|
11882
|
+
return normalizePath([
|
|
12001
11883
|
typeof os$2.homedir === "function" ? os$2.homedir() : void 0,
|
|
12002
11884
|
env$1.get("USERPROFILE"),
|
|
12003
11885
|
env$1.get("HOME"),
|
|
12004
11886
|
env$1.get("HOMEDRIVE") || env$1.get("HOMEPATH") ? path$8.join(env$1.get("HOMEDRIVE") || "", env$1.get("HOMEPATH") || "") : void 0
|
|
12005
|
-
]
|
|
12006
|
-
return normalizePath(priorityList.find(function(v$1) {
|
|
11887
|
+
].find(function(v$1) {
|
|
12007
11888
|
return !isEmpty(v$1);
|
|
12008
11889
|
}));
|
|
12009
11890
|
};
|
|
@@ -12014,23 +11895,19 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12014
11895
|
return base ? path$8.join.apply(path$8, __spreadArray([base], segments)) : void 0;
|
|
12015
11896
|
}
|
|
12016
11897
|
function posix() {
|
|
12017
|
-
|
|
12018
|
-
var priorityList = [
|
|
11898
|
+
return normalizePath([
|
|
12019
11899
|
typeof os$2.tmpdir === "function" ? os$2.tmpdir() : void 0,
|
|
12020
11900
|
env$1.get("TMPDIR"),
|
|
12021
11901
|
env$1.get("TEMP"),
|
|
12022
11902
|
env$1.get("TMP")
|
|
12023
|
-
]
|
|
12024
|
-
return normalizePath(priorityList.find(function(v$1) {
|
|
11903
|
+
].find(function(v$1) {
|
|
12025
11904
|
return !isEmpty(v$1);
|
|
12026
|
-
})) ||
|
|
11905
|
+
})) || "/tmp";
|
|
12027
11906
|
}
|
|
12028
11907
|
function windows() {
|
|
12029
11908
|
var fallback = "C:\\Temp";
|
|
12030
|
-
var
|
|
12031
|
-
typeof os$2.tmpdir === "function" ? os$2.tmpdir : function() {
|
|
12032
|
-
return void 0;
|
|
12033
|
-
},
|
|
11909
|
+
var v$1 = [
|
|
11910
|
+
typeof os$2.tmpdir === "function" ? os$2.tmpdir : function() {},
|
|
12034
11911
|
function() {
|
|
12035
11912
|
return env$1.get("TEMP");
|
|
12036
11913
|
},
|
|
@@ -12059,26 +11936,24 @@ var require_OSPaths = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-
|
|
|
12059
11936
|
function() {
|
|
12060
11937
|
return joinPathToBase(env$1.get("SystemDrive"), ["\\", "Temp"]);
|
|
12061
11938
|
}
|
|
12062
|
-
]
|
|
12063
|
-
var v$1 = priorityListLazy.find(function(v$2) {
|
|
11939
|
+
].find(function(v$2) {
|
|
12064
11940
|
return v$2 && !isEmpty(v$2());
|
|
12065
11941
|
});
|
|
12066
11942
|
return v$1 && normalizePath(v$1()) || fallback;
|
|
12067
11943
|
}
|
|
12068
11944
|
return isWinOS ? windows() : posix();
|
|
12069
11945
|
}
|
|
12070
|
-
|
|
12071
|
-
function OSPaths_
|
|
11946
|
+
return { OSPaths: new (function() {
|
|
11947
|
+
function OSPaths_() {
|
|
12072
11948
|
function OSPaths() {
|
|
12073
|
-
return new OSPaths_
|
|
11949
|
+
return new OSPaths_();
|
|
12074
11950
|
}
|
|
12075
11951
|
OSPaths.home = home;
|
|
12076
11952
|
OSPaths.temp = temp;
|
|
12077
11953
|
return OSPaths;
|
|
12078
11954
|
}
|
|
12079
|
-
return OSPaths_
|
|
12080
|
-
}();
|
|
12081
|
-
return { OSPaths: new OSPaths_() };
|
|
11955
|
+
return OSPaths_;
|
|
11956
|
+
}())() };
|
|
12082
11957
|
}
|
|
12083
11958
|
exports.Adapt = Adapt;
|
|
12084
11959
|
}) });
|
|
@@ -12116,7 +11991,6 @@ var require_node$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/os-p
|
|
|
12116
11991
|
return result;
|
|
12117
11992
|
};
|
|
12118
11993
|
exports.__esModule = true;
|
|
12119
|
-
exports.adapter = void 0;
|
|
12120
11994
|
var os$1 = __importStar$2(__require("os"));
|
|
12121
11995
|
var path$4 = __importStar$2(__require("path"));
|
|
12122
11996
|
exports.adapter = {
|
|
@@ -12174,7 +12048,6 @@ var require_node$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-
|
|
|
12174
12048
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12175
12049
|
};
|
|
12176
12050
|
exports.__esModule = true;
|
|
12177
|
-
exports.adapter = void 0;
|
|
12178
12051
|
var path$3 = __importStar$1(__require("path"));
|
|
12179
12052
|
var os_paths_1 = __importDefault$1(require_mod_cjs$2());
|
|
12180
12053
|
exports.adapter = {
|
|
@@ -12232,7 +12105,6 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-ap
|
|
|
12232
12105
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12233
12106
|
};
|
|
12234
12107
|
exports.__esModule = true;
|
|
12235
|
-
exports.adapter = void 0;
|
|
12236
12108
|
var path$2 = __importStar(__require("path"));
|
|
12237
12109
|
var xdg_portable_1 = __importDefault(require_mod_cjs$1());
|
|
12238
12110
|
exports.adapter = {
|
|
@@ -12242,10 +12114,8 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg-ap
|
|
|
12242
12114
|
},
|
|
12243
12115
|
meta: {
|
|
12244
12116
|
mainFilename: function() {
|
|
12245
|
-
var
|
|
12246
|
-
|
|
12247
|
-
var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
|
|
12248
|
-
return filename;
|
|
12117
|
+
var requireMainFilename = (typeof __require !== "undefined" && __require !== null && __require.main ? __require.main : { filename: void 0 }).filename;
|
|
12118
|
+
return (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0);
|
|
12249
12119
|
},
|
|
12250
12120
|
pkgMainFilename: function() {
|
|
12251
12121
|
return process.pkg ? process.execPath : void 0;
|
|
@@ -12268,10 +12138,7 @@ var require_mod_cjs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/xdg
|
|
|
12268
12138
|
//#endregion
|
|
12269
12139
|
//#region ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js
|
|
12270
12140
|
var import_toml = /* @__PURE__ */ __toESM(require_toml(), 1);
|
|
12271
|
-
var mod_esm_exports = {};
|
|
12272
|
-
__export(mod_esm_exports, { default: () => mod_esm_default });
|
|
12273
12141
|
var import_mod_cjs = /* @__PURE__ */ __toESM(require_mod_cjs(), 1);
|
|
12274
|
-
__reExport(mod_esm_exports, /* @__PURE__ */ __toESM(require_mod_cjs(), 1));
|
|
12275
12142
|
var mod_esm_default = import_mod_cjs.default;
|
|
12276
12143
|
|
|
12277
12144
|
//#endregion
|
|
@@ -12279,22 +12146,22 @@ var mod_esm_default = import_mod_cjs.default;
|
|
|
12279
12146
|
const isDirectory = (configPath) => {
|
|
12280
12147
|
try {
|
|
12281
12148
|
return fs.statSync(configPath).isDirectory();
|
|
12282
|
-
} catch
|
|
12149
|
+
} catch {
|
|
12283
12150
|
return false;
|
|
12284
12151
|
}
|
|
12285
12152
|
};
|
|
12286
12153
|
const getGlobalWranglerConfigPath = () => {
|
|
12287
12154
|
const configDir = mod_esm_default(".wrangler").config();
|
|
12288
|
-
const legacyConfigDir = path.join(os.homedir(), ".wrangler");
|
|
12155
|
+
const legacyConfigDir = path$1.join(os.homedir(), ".wrangler");
|
|
12289
12156
|
if (isDirectory(legacyConfigDir)) return legacyConfigDir;
|
|
12290
12157
|
return configDir;
|
|
12291
12158
|
};
|
|
12292
12159
|
const getWranglerLoginAuthToken = () => {
|
|
12293
12160
|
try {
|
|
12294
12161
|
const wranglerConfigPath = getGlobalWranglerConfigPath();
|
|
12295
|
-
const wranglerConfig = fs.readFileSync(path.join(wranglerConfigPath, "config", "default.toml"), "utf8");
|
|
12162
|
+
const wranglerConfig = fs.readFileSync(path$1.join(wranglerConfigPath, "config", "default.toml"), "utf8");
|
|
12296
12163
|
return import_toml.default.parse(wranglerConfig);
|
|
12297
|
-
} catch
|
|
12164
|
+
} catch {
|
|
12298
12165
|
return null;
|
|
12299
12166
|
}
|
|
12300
12167
|
};
|
|
@@ -12302,7 +12169,7 @@ const getWranglerLoginAuthToken = () => {
|
|
|
12302
12169
|
//#endregion
|
|
12303
12170
|
//#region iac/index.ts
|
|
12304
12171
|
const getConfigTemplate = (build) => {
|
|
12305
|
-
|
|
12172
|
+
return new ConfigBuilder().setBuildType(build).setStorage({
|
|
12306
12173
|
imports: [{
|
|
12307
12174
|
pkg: "@hot-updater/cloudflare",
|
|
12308
12175
|
named: ["r2Storage"]
|
|
@@ -12312,8 +12179,7 @@ const getConfigTemplate = (build) => {
|
|
|
12312
12179
|
accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
|
|
12313
12180
|
cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
|
|
12314
12181
|
})`
|
|
12315
|
-
}
|
|
12316
|
-
const databaseConfig = {
|
|
12182
|
+
}).setDatabase({
|
|
12317
12183
|
imports: [{
|
|
12318
12184
|
pkg: "@hot-updater/cloudflare",
|
|
12319
12185
|
named: ["d1Database"]
|
|
@@ -12323,8 +12189,7 @@ const getConfigTemplate = (build) => {
|
|
|
12323
12189
|
accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
|
|
12324
12190
|
cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
|
|
12325
12191
|
})`
|
|
12326
|
-
};
|
|
12327
|
-
return new ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
|
|
12192
|
+
}).getResult();
|
|
12328
12193
|
};
|
|
12329
12194
|
const SOURCE_TEMPLATE = `// add this to your App.tsx
|
|
12330
12195
|
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
|
|
@@ -12341,10 +12206,9 @@ export default HotUpdater.wrap({
|
|
|
12341
12206
|
const deployWorker = async (oauth_token, accountId, { d1DatabaseId, d1DatabaseName, r2BucketName }) => {
|
|
12342
12207
|
const cwd = getCwd();
|
|
12343
12208
|
const workerPath = __require.resolve("@hot-updater/cloudflare/worker", { paths: [cwd] });
|
|
12344
|
-
const
|
|
12345
|
-
const { tmpDir, removeTmpDir } = await copyDirToTmp(wranglerTemplateDir);
|
|
12209
|
+
const { tmpDir, removeTmpDir } = await copyDirToTmp(path$1.dirname(workerPath));
|
|
12346
12210
|
try {
|
|
12347
|
-
const wranglerConfig = JSON.parse(await fs$1.readFile(path.join(tmpDir, "wrangler.json"), "utf-8"));
|
|
12211
|
+
const wranglerConfig = JSON.parse(await fs$1.readFile(path$1.join(tmpDir, "wrangler.json"), "utf-8"));
|
|
12348
12212
|
wranglerConfig.d1_databases = [{
|
|
12349
12213
|
binding: "DB",
|
|
12350
12214
|
database_id: d1DatabaseId,
|
|
@@ -12354,19 +12218,18 @@ const deployWorker = async (oauth_token, accountId, { d1DatabaseId, d1DatabaseNa
|
|
|
12354
12218
|
binding: "BUCKET",
|
|
12355
12219
|
bucket_name: r2BucketName
|
|
12356
12220
|
}];
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
await fs$1.writeFile(path.join(tmpDir, "wrangler.json"), JSON.stringify(wranglerConfig, null, 2));
|
|
12221
|
+
wranglerConfig.vars = { JWT_SECRET: crypto.randomBytes(32).toString("hex") };
|
|
12222
|
+
await fs$1.writeFile(path$1.join(tmpDir, "wrangler.json"), JSON.stringify(wranglerConfig, null, 2));
|
|
12360
12223
|
const wrangler = await createWrangler({
|
|
12361
12224
|
stdio: "inherit",
|
|
12362
12225
|
cloudflareApiToken: oauth_token,
|
|
12363
12226
|
cwd: tmpDir,
|
|
12364
12227
|
accountId
|
|
12365
12228
|
});
|
|
12366
|
-
const migrationPath = await path.join(tmpDir, "migrations");
|
|
12229
|
+
const migrationPath = await path$1.join(tmpDir, "migrations");
|
|
12367
12230
|
const migrationFiles = await fs$1.readdir(migrationPath);
|
|
12368
12231
|
for (const file of migrationFiles) if (file.endsWith(".sql")) {
|
|
12369
|
-
const filePath = path.join(migrationPath, file);
|
|
12232
|
+
const filePath = path$1.join(migrationPath, file);
|
|
12370
12233
|
const content = await fs$1.readFile(filePath, "utf-8");
|
|
12371
12234
|
await fs$1.writeFile(filePath, transformTemplate(content, { BUCKET_NAME: r2BucketName }));
|
|
12372
12235
|
}
|
|
@@ -12467,10 +12330,8 @@ const runInit = async ({ build }) => {
|
|
|
12467
12330
|
selectedBucketName = newR2.name;
|
|
12468
12331
|
}
|
|
12469
12332
|
f.info(`Selected R2: ${selectedBucketName}`);
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
const isPrivate = await ye({ message: "Make R2 bucket private?" });
|
|
12473
|
-
if (isPrivate) try {
|
|
12333
|
+
if ((await cf.r2.buckets.domains.managed.list(selectedBucketName, { account_id: accountId })).enabled) {
|
|
12334
|
+
if (await ye({ message: "Make R2 bucket private?" })) try {
|
|
12474
12335
|
await Te([{
|
|
12475
12336
|
title: "Making R2 bucket private...",
|
|
12476
12337
|
task: async () => {
|