@hot-updater/aws 0.28.0 → 0.29.1
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 +426 -690
- package/dist/iac/{index.js → index.mjs} +304 -548
- package/dist/index.cjs +179 -59
- package/dist/index.d.cts +37 -4
- package/dist/index.d.mts +62 -0
- package/dist/{index.js → index.mjs} +155 -33
- package/dist/lambda/index.cjs +5819 -6848
- package/dist/lambda/index.d.cts +4 -1
- package/package.json +15 -13
- package/dist/index.d.ts +0 -29
- package/dist/lambda/dist-cjs-Mm7FDWb8.cjs +0 -128
- package/dist/lambda/event-streams-0D7SB645.cjs +0 -204
- /package/dist/iac/{index.d.ts → index.d.mts} +0 -0
package/dist/iac/index.cjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
10
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i
|
|
13
|
-
key = keys[i
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
14
13
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
14
|
get: ((k) => from[k]).bind(null, key),
|
|
16
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -22,20 +21,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
21
|
value: mod,
|
|
23
22
|
enumerable: true
|
|
24
23
|
}) : target, mod));
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
let __hot_updater_cli_tools = require("@hot-updater/cli-tools");
|
|
30
|
-
__hot_updater_cli_tools = __toESM(__hot_updater_cli_tools);
|
|
25
|
+
let _aws_sdk_credential_providers = require("@aws-sdk/credential-providers");
|
|
26
|
+
let _hot_updater_cli_tools = require("@hot-updater/cli-tools");
|
|
31
27
|
let node_url = require("node:url");
|
|
32
|
-
node_url = __toESM(node_url);
|
|
33
28
|
let node_child_process = require("node:child_process");
|
|
34
|
-
node_child_process = __toESM(node_child_process);
|
|
35
29
|
let node_string_decoder = require("node:string_decoder");
|
|
36
|
-
node_string_decoder = __toESM(node_string_decoder);
|
|
37
30
|
let node_util = require("node:util");
|
|
38
|
-
node_util = __toESM(node_util);
|
|
39
31
|
let node_process = require("node:process");
|
|
40
32
|
node_process = __toESM(node_process);
|
|
41
33
|
let node_tty = require("node:tty");
|
|
@@ -47,47 +39,30 @@ path = __toESM(path);
|
|
|
47
39
|
let fs = require("fs");
|
|
48
40
|
fs = __toESM(fs);
|
|
49
41
|
let node_timers_promises = require("node:timers/promises");
|
|
50
|
-
node_timers_promises = __toESM(node_timers_promises);
|
|
51
42
|
let node_os = require("node:os");
|
|
52
|
-
node_os = __toESM(node_os);
|
|
53
43
|
let node_events = require("node:events");
|
|
54
|
-
node_events = __toESM(node_events);
|
|
55
44
|
let node_v8 = require("node:v8");
|
|
56
|
-
node_v8 = __toESM(node_v8);
|
|
57
45
|
let node_fs = require("node:fs");
|
|
58
|
-
node_fs = __toESM(node_fs);
|
|
59
46
|
let node_stream_promises = require("node:stream/promises");
|
|
60
|
-
node_stream_promises = __toESM(node_stream_promises);
|
|
61
47
|
let node_stream = require("node:stream");
|
|
62
|
-
node_stream = __toESM(node_stream);
|
|
63
48
|
let node_buffer = require("node:buffer");
|
|
64
|
-
|
|
65
|
-
let __aws_sdk_client_cloudfront = require("@aws-sdk/client-cloudfront");
|
|
66
|
-
__aws_sdk_client_cloudfront = __toESM(__aws_sdk_client_cloudfront);
|
|
49
|
+
let _aws_sdk_client_cloudfront = require("@aws-sdk/client-cloudfront");
|
|
67
50
|
let crypto = require("crypto");
|
|
68
51
|
crypto = __toESM(crypto);
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
__aws_sdk_client_sts = __toESM(__aws_sdk_client_sts);
|
|
73
|
-
let __aws_sdk_client_lambda = require("@aws-sdk/client-lambda");
|
|
74
|
-
__aws_sdk_client_lambda = __toESM(__aws_sdk_client_lambda);
|
|
52
|
+
let _aws_sdk_client_iam = require("@aws-sdk/client-iam");
|
|
53
|
+
let _aws_sdk_client_sts = require("@aws-sdk/client-sts");
|
|
54
|
+
let _aws_sdk_client_lambda = require("@aws-sdk/client-lambda");
|
|
75
55
|
let fs_promises = require("fs/promises");
|
|
76
56
|
fs_promises = __toESM(fs_promises);
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
__aws_sdk_lib_storage = __toESM(__aws_sdk_lib_storage);
|
|
81
|
-
let __aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
82
|
-
__aws_sdk_client_ssm = __toESM(__aws_sdk_client_ssm);
|
|
83
|
-
|
|
57
|
+
let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
|
|
58
|
+
let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
|
|
59
|
+
let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
84
60
|
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
85
61
|
function isPlainObject$1(value) {
|
|
86
62
|
if (typeof value !== "object" || value === null) return false;
|
|
87
63
|
const prototype = Object.getPrototypeOf(value);
|
|
88
64
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
89
65
|
}
|
|
90
|
-
|
|
91
66
|
//#endregion
|
|
92
67
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/file-url.js
|
|
93
68
|
const safeNormalizeFileUrl = (file, name) => {
|
|
@@ -98,7 +73,6 @@ const safeNormalizeFileUrl = (file, name) => {
|
|
|
98
73
|
const normalizeDenoExecPath = (file) => isDenoExecPath(file) ? file.toString() : file;
|
|
99
74
|
const isDenoExecPath = (file) => typeof file !== "string" && file && Object.getPrototypeOf(file) === String.prototype;
|
|
100
75
|
const normalizeFileUrl = (file) => file instanceof URL ? (0, node_url.fileURLToPath)(file) : file;
|
|
101
|
-
|
|
102
76
|
//#endregion
|
|
103
77
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/parameters.js
|
|
104
78
|
const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
@@ -116,7 +90,6 @@ const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
|
116
90
|
options
|
|
117
91
|
];
|
|
118
92
|
};
|
|
119
|
-
|
|
120
93
|
//#endregion
|
|
121
94
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/uint-array.js
|
|
122
95
|
const { toString: objectToString$1 } = Object.prototype;
|
|
@@ -156,7 +129,6 @@ const getJoinLength = (uint8Arrays) => {
|
|
|
156
129
|
for (const uint8Array of uint8Arrays) joinLength += uint8Array.length;
|
|
157
130
|
return joinLength;
|
|
158
131
|
};
|
|
159
|
-
|
|
160
132
|
//#endregion
|
|
161
133
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/template.js
|
|
162
134
|
const isTemplateString = (templates) => Array.isArray(templates) && Array.isArray(templates.raw);
|
|
@@ -183,7 +155,7 @@ const parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
|
183
155
|
const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);
|
|
184
156
|
if (index === expressions.length) return newTokens;
|
|
185
157
|
const expression = expressions[index];
|
|
186
|
-
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression
|
|
158
|
+
return concatTokens(newTokens, Array.isArray(expression) ? expression.map((expression) => parseExpression(expression)) : [parseExpression(expression)], trailingWhitespaces);
|
|
187
159
|
};
|
|
188
160
|
const splitByWhitespaces = (template, rawTemplate) => {
|
|
189
161
|
if (rawTemplate.length === 0) return {
|
|
@@ -245,7 +217,6 @@ const getSubprocessResult = ({ stdout }) => {
|
|
|
245
217
|
if (stdout === void 0) throw new TypeError("Missing result.stdout in template expression. This is probably due to the previous subprocess' \"stdout\" option.");
|
|
246
218
|
throw new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`);
|
|
247
219
|
};
|
|
248
|
-
|
|
249
220
|
//#endregion
|
|
250
221
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/standard-stream.js
|
|
251
222
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
@@ -260,7 +231,6 @@ const STANDARD_STREAMS_ALIASES = [
|
|
|
260
231
|
"stderr"
|
|
261
232
|
];
|
|
262
233
|
const getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
|
|
263
|
-
|
|
264
234
|
//#endregion
|
|
265
235
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/specific.js
|
|
266
236
|
const normalizeFdSpecificOptions = (options) => {
|
|
@@ -315,7 +285,6 @@ const FD_SPECIFIC_OPTIONS = [
|
|
|
315
285
|
"stripFinalNewline"
|
|
316
286
|
];
|
|
317
287
|
const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === "ipc" ? optionArray.at(-1) : optionArray[fdNumber];
|
|
318
|
-
|
|
319
288
|
//#endregion
|
|
320
289
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/values.js
|
|
321
290
|
const isVerbose = ({ verbose }, fdNumber) => getFdVerbose(verbose, fdNumber) !== "none";
|
|
@@ -332,7 +301,6 @@ const VERBOSE_VALUES = [
|
|
|
332
301
|
"short",
|
|
333
302
|
"full"
|
|
334
303
|
];
|
|
335
|
-
|
|
336
304
|
//#endregion
|
|
337
305
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/escape.js
|
|
338
306
|
const joinCommand = (filePath, rawArguments) => {
|
|
@@ -353,7 +321,7 @@ const escapeControlCharacter = (character) => {
|
|
|
353
321
|
};
|
|
354
322
|
const getSpecialCharRegExp = () => {
|
|
355
323
|
try {
|
|
356
|
-
return new RegExp("\\p{Separator}|\\p{Other}", "gu");
|
|
324
|
+
return /* @__PURE__ */ new RegExp("\\p{Separator}|\\p{Other}", "gu");
|
|
357
325
|
} catch {
|
|
358
326
|
return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g;
|
|
359
327
|
}
|
|
@@ -373,7 +341,6 @@ const quoteString = (escapedArgument) => {
|
|
|
373
341
|
return node_process.platform === "win32" ? `"${escapedArgument.replaceAll("\"", "\"\"")}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
374
342
|
};
|
|
375
343
|
const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
376
|
-
|
|
377
344
|
//#endregion
|
|
378
345
|
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
379
346
|
function isUnicodeSupported() {
|
|
@@ -382,7 +349,6 @@ function isUnicodeSupported() {
|
|
|
382
349
|
if (node_process.default.platform !== "win32") return TERM !== "linux";
|
|
383
350
|
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
384
351
|
}
|
|
385
|
-
|
|
386
352
|
//#endregion
|
|
387
353
|
//#region ../../node_modules/.pnpm/figures@6.1.0/node_modules/figures/index.js
|
|
388
354
|
const common = {
|
|
@@ -661,11 +627,8 @@ const fallbackSymbols = {
|
|
|
661
627
|
...common,
|
|
662
628
|
...specialFallbackSymbols
|
|
663
629
|
};
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
var figures_default = figures;
|
|
667
|
-
const replacements = Object.entries(specialMainSymbols);
|
|
668
|
-
|
|
630
|
+
const figures = isUnicodeSupported() ? mainSymbols : fallbackSymbols;
|
|
631
|
+
Object.entries(specialMainSymbols);
|
|
669
632
|
//#endregion
|
|
670
633
|
//#region ../../node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
|
|
671
634
|
const hasColors = node_tty.default?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
@@ -688,48 +651,47 @@ const format = (open, close) => {
|
|
|
688
651
|
return result;
|
|
689
652
|
};
|
|
690
653
|
};
|
|
691
|
-
|
|
654
|
+
format(0, 0);
|
|
692
655
|
const bold = format(1, 22);
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
656
|
+
format(2, 22);
|
|
657
|
+
format(3, 23);
|
|
658
|
+
format(4, 24);
|
|
659
|
+
format(53, 55);
|
|
660
|
+
format(7, 27);
|
|
661
|
+
format(8, 28);
|
|
662
|
+
format(9, 29);
|
|
663
|
+
format(30, 39);
|
|
664
|
+
format(31, 39);
|
|
665
|
+
format(32, 39);
|
|
666
|
+
format(33, 39);
|
|
667
|
+
format(34, 39);
|
|
668
|
+
format(35, 39);
|
|
669
|
+
format(36, 39);
|
|
670
|
+
format(37, 39);
|
|
708
671
|
const gray = format(90, 39);
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
672
|
+
format(40, 49);
|
|
673
|
+
format(41, 49);
|
|
674
|
+
format(42, 49);
|
|
675
|
+
format(43, 49);
|
|
676
|
+
format(44, 49);
|
|
677
|
+
format(45, 49);
|
|
678
|
+
format(46, 49);
|
|
679
|
+
format(47, 49);
|
|
680
|
+
format(100, 49);
|
|
718
681
|
const redBright = format(91, 39);
|
|
719
|
-
|
|
682
|
+
format(92, 39);
|
|
720
683
|
const yellowBright = format(93, 39);
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
684
|
+
format(94, 39);
|
|
685
|
+
format(95, 39);
|
|
686
|
+
format(96, 39);
|
|
687
|
+
format(97, 39);
|
|
688
|
+
format(101, 49);
|
|
689
|
+
format(102, 49);
|
|
690
|
+
format(103, 49);
|
|
691
|
+
format(104, 49);
|
|
692
|
+
format(105, 49);
|
|
693
|
+
format(106, 49);
|
|
694
|
+
format(107, 49);
|
|
733
695
|
//#endregion
|
|
734
696
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/default.js
|
|
735
697
|
const defaultVerboseFunction = ({ type, message, timestamp, piped, commandId, result: { failed = false } = {}, options: { reject = true } }) => {
|
|
@@ -745,8 +707,8 @@ const defaultVerboseFunction = ({ type, message, timestamp, piped, commandId, re
|
|
|
745
707
|
const serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;
|
|
746
708
|
const padField = (field, padding) => String(field).padStart(padding, "0");
|
|
747
709
|
const getFinalIcon = ({ failed, reject }) => {
|
|
748
|
-
if (!failed) return
|
|
749
|
-
return reject ?
|
|
710
|
+
if (!failed) return figures.tick;
|
|
711
|
+
return reject ? figures.cross : figures.warning;
|
|
750
712
|
};
|
|
751
713
|
const ICONS = {
|
|
752
714
|
command: ({ piped }) => piped ? "|" : "$",
|
|
@@ -763,7 +725,6 @@ const COLORS = {
|
|
|
763
725
|
error: ({ reject }) => reject ? redBright : yellowBright,
|
|
764
726
|
duration: () => gray
|
|
765
727
|
};
|
|
766
|
-
|
|
767
728
|
//#endregion
|
|
768
729
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/custom.js
|
|
769
730
|
const applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => {
|
|
@@ -776,7 +737,6 @@ const applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => {
|
|
|
776
737
|
if (typeof printedLine === "string") return printedLine;
|
|
777
738
|
};
|
|
778
739
|
const appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine : `${printedLine}\n`;
|
|
779
|
-
|
|
780
740
|
//#endregion
|
|
781
741
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/log.js
|
|
782
742
|
const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) => {
|
|
@@ -787,7 +747,7 @@ const verboseLog = ({ type, verboseMessage, fdNumber, verboseInfo, result }) =>
|
|
|
787
747
|
})), verboseInfo, fdNumber);
|
|
788
748
|
if (finalLines !== "") console.warn(finalLines.slice(0, -1));
|
|
789
749
|
};
|
|
790
|
-
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false
|
|
750
|
+
const getVerboseObject = ({ type, result, verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false, ...options } } }) => ({
|
|
791
751
|
type,
|
|
792
752
|
escapedCommand,
|
|
793
753
|
commandId: `${commandId}`,
|
|
@@ -810,7 +770,6 @@ const serializeVerboseMessage = (message) => {
|
|
|
810
770
|
return escapeLines(typeof message === "string" ? message : (0, node_util.inspect)(message)).replaceAll(" ", " ".repeat(TAB_SIZE));
|
|
811
771
|
};
|
|
812
772
|
const TAB_SIZE = 2;
|
|
813
|
-
|
|
814
773
|
//#endregion
|
|
815
774
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/start.js
|
|
816
775
|
const logCommand = (escapedCommand, verboseInfo) => {
|
|
@@ -821,7 +780,6 @@ const logCommand = (escapedCommand, verboseInfo) => {
|
|
|
821
780
|
verboseInfo
|
|
822
781
|
});
|
|
823
782
|
};
|
|
824
|
-
|
|
825
783
|
//#endregion
|
|
826
784
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/info.js
|
|
827
785
|
const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
@@ -845,12 +803,10 @@ const validateVerbose = (verbose) => {
|
|
|
845
803
|
}
|
|
846
804
|
}
|
|
847
805
|
};
|
|
848
|
-
|
|
849
806
|
//#endregion
|
|
850
807
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/duration.js
|
|
851
808
|
const getStartTime = () => node_process.hrtime.bigint();
|
|
852
809
|
const getDurationMs = (startTime) => Number(node_process.hrtime.bigint() - startTime) / 1e6;
|
|
853
|
-
|
|
854
810
|
//#endregion
|
|
855
811
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/command.js
|
|
856
812
|
const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
@@ -865,51 +821,49 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
865
821
|
verboseInfo
|
|
866
822
|
};
|
|
867
823
|
};
|
|
868
|
-
|
|
869
824
|
//#endregion
|
|
870
825
|
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
871
|
-
var require_windows = /* @__PURE__ */
|
|
872
|
-
module.exports = isexe
|
|
873
|
-
isexe
|
|
826
|
+
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
827
|
+
module.exports = isexe;
|
|
828
|
+
isexe.sync = sync;
|
|
874
829
|
var fs$5 = require("fs");
|
|
875
|
-
function checkPathExt(path
|
|
830
|
+
function checkPathExt(path, options) {
|
|
876
831
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
877
832
|
if (!pathext) return true;
|
|
878
833
|
pathext = pathext.split(";");
|
|
879
834
|
if (pathext.indexOf("") !== -1) return true;
|
|
880
|
-
for (var i
|
|
881
|
-
var p
|
|
882
|
-
if (p
|
|
835
|
+
for (var i = 0; i < pathext.length; i++) {
|
|
836
|
+
var p = pathext[i].toLowerCase();
|
|
837
|
+
if (p && path.substr(-p.length).toLowerCase() === p) return true;
|
|
883
838
|
}
|
|
884
839
|
return false;
|
|
885
840
|
}
|
|
886
|
-
function checkStat
|
|
841
|
+
function checkStat(stat, path, options) {
|
|
887
842
|
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
|
|
888
|
-
return checkPathExt(path
|
|
843
|
+
return checkPathExt(path, options);
|
|
889
844
|
}
|
|
890
|
-
function isexe
|
|
891
|
-
fs$5.stat(path
|
|
892
|
-
cb(er, er ? false : checkStat
|
|
845
|
+
function isexe(path, options, cb) {
|
|
846
|
+
fs$5.stat(path, function(er, stat) {
|
|
847
|
+
cb(er, er ? false : checkStat(stat, path, options));
|
|
893
848
|
});
|
|
894
849
|
}
|
|
895
|
-
function sync
|
|
896
|
-
return checkStat
|
|
850
|
+
function sync(path, options) {
|
|
851
|
+
return checkStat(fs$5.statSync(path), path, options);
|
|
897
852
|
}
|
|
898
|
-
})
|
|
899
|
-
|
|
853
|
+
}));
|
|
900
854
|
//#endregion
|
|
901
855
|
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
|
|
902
|
-
var require_mode = /* @__PURE__ */
|
|
903
|
-
module.exports = isexe
|
|
904
|
-
isexe
|
|
856
|
+
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
857
|
+
module.exports = isexe;
|
|
858
|
+
isexe.sync = sync;
|
|
905
859
|
var fs$4 = require("fs");
|
|
906
|
-
function isexe
|
|
907
|
-
fs$4.stat(path
|
|
860
|
+
function isexe(path, options, cb) {
|
|
861
|
+
fs$4.stat(path, function(er, stat) {
|
|
908
862
|
cb(er, er ? false : checkStat(stat, options));
|
|
909
863
|
});
|
|
910
864
|
}
|
|
911
|
-
function sync
|
|
912
|
-
return checkStat(fs$4.statSync(path
|
|
865
|
+
function sync(path, options) {
|
|
866
|
+
return checkStat(fs$4.statSync(path), options);
|
|
913
867
|
}
|
|
914
868
|
function checkStat(stat, options) {
|
|
915
869
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -920,24 +874,23 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
920
874
|
var gid = stat.gid;
|
|
921
875
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
922
876
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
923
|
-
var u
|
|
877
|
+
var u = parseInt("100", 8);
|
|
924
878
|
var g = parseInt("010", 8);
|
|
925
|
-
var o
|
|
926
|
-
var ug = u
|
|
927
|
-
return mod & o
|
|
879
|
+
var o = parseInt("001", 8);
|
|
880
|
+
var ug = u | g;
|
|
881
|
+
return mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
928
882
|
}
|
|
929
|
-
})
|
|
930
|
-
|
|
883
|
+
}));
|
|
931
884
|
//#endregion
|
|
932
885
|
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
933
|
-
var require_isexe = /* @__PURE__ */
|
|
886
|
+
var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
934
887
|
require("fs");
|
|
935
888
|
var core;
|
|
936
889
|
if (process.platform === "win32" || global.TESTING_WINDOWS) core = require_windows();
|
|
937
890
|
else core = require_mode();
|
|
938
|
-
module.exports = isexe
|
|
939
|
-
isexe
|
|
940
|
-
function isexe
|
|
891
|
+
module.exports = isexe;
|
|
892
|
+
isexe.sync = sync;
|
|
893
|
+
function isexe(path, options, cb) {
|
|
941
894
|
if (typeof options === "function") {
|
|
942
895
|
cb = options;
|
|
943
896
|
options = {};
|
|
@@ -945,13 +898,13 @@ var require_isexe = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe
|
|
|
945
898
|
if (!cb) {
|
|
946
899
|
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
947
900
|
return new Promise(function(resolve, reject) {
|
|
948
|
-
isexe
|
|
901
|
+
isexe(path, options || {}, function(er, is) {
|
|
949
902
|
if (er) reject(er);
|
|
950
903
|
else resolve(is);
|
|
951
904
|
});
|
|
952
905
|
});
|
|
953
906
|
}
|
|
954
|
-
core(path
|
|
907
|
+
core(path, options || {}, function(er, is) {
|
|
955
908
|
if (er) {
|
|
956
909
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
957
910
|
er = null;
|
|
@@ -961,19 +914,18 @@ var require_isexe = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe
|
|
|
961
914
|
cb(er, is);
|
|
962
915
|
});
|
|
963
916
|
}
|
|
964
|
-
function sync(path
|
|
917
|
+
function sync(path, options) {
|
|
965
918
|
try {
|
|
966
|
-
return core.sync(path
|
|
919
|
+
return core.sync(path, options || {});
|
|
967
920
|
} catch (er) {
|
|
968
921
|
if (options && options.ignoreErrors || er.code === "EACCES") return false;
|
|
969
922
|
else throw er;
|
|
970
923
|
}
|
|
971
924
|
}
|
|
972
|
-
})
|
|
973
|
-
|
|
925
|
+
}));
|
|
974
926
|
//#endregion
|
|
975
927
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
976
|
-
var require_which = /* @__PURE__ */
|
|
928
|
+
var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
977
929
|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
978
930
|
const path$9 = require("path");
|
|
979
931
|
const COLON = isWindows ? ";" : ":";
|
|
@@ -993,7 +945,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
993
945
|
pathExtExe
|
|
994
946
|
};
|
|
995
947
|
};
|
|
996
|
-
const which
|
|
948
|
+
const which = (cmd, opt, cb) => {
|
|
997
949
|
if (typeof opt === "function") {
|
|
998
950
|
cb = opt;
|
|
999
951
|
opt = {};
|
|
@@ -1001,20 +953,20 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1001
953
|
if (!opt) opt = {};
|
|
1002
954
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
1003
955
|
const found = [];
|
|
1004
|
-
const step = (i
|
|
1005
|
-
if (i
|
|
1006
|
-
const ppRaw = pathEnv[i
|
|
956
|
+
const step = (i) => new Promise((resolve, reject) => {
|
|
957
|
+
if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
958
|
+
const ppRaw = pathEnv[i];
|
|
1007
959
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
1008
960
|
const pCmd = path$9.join(pathPart, cmd);
|
|
1009
|
-
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i
|
|
961
|
+
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
|
|
1010
962
|
});
|
|
1011
|
-
const subStep = (p
|
|
1012
|
-
if (ii === pathExt.length) return resolve(step(i
|
|
963
|
+
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
964
|
+
if (ii === pathExt.length) return resolve(step(i + 1));
|
|
1013
965
|
const ext = pathExt[ii];
|
|
1014
|
-
isexe(p
|
|
1015
|
-
if (!er && is) if (opt.all) found.push(p
|
|
1016
|
-
else return resolve(p
|
|
1017
|
-
return resolve(subStep(p
|
|
966
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
967
|
+
if (!er && is) if (opt.all) found.push(p + ext);
|
|
968
|
+
else return resolve(p + ext);
|
|
969
|
+
return resolve(subStep(p, i, ii + 1));
|
|
1018
970
|
});
|
|
1019
971
|
});
|
|
1020
972
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -1023,13 +975,13 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1023
975
|
opt = opt || {};
|
|
1024
976
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
1025
977
|
const found = [];
|
|
1026
|
-
for (let i
|
|
1027
|
-
const ppRaw = pathEnv[i
|
|
978
|
+
for (let i = 0; i < pathEnv.length; i++) {
|
|
979
|
+
const ppRaw = pathEnv[i];
|
|
1028
980
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
1029
981
|
const pCmd = path$9.join(pathPart, cmd);
|
|
1030
|
-
const p
|
|
982
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1031
983
|
for (let j = 0; j < pathExt.length; j++) {
|
|
1032
|
-
const cur = p
|
|
984
|
+
const cur = p + pathExt[j];
|
|
1033
985
|
try {
|
|
1034
986
|
if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
|
|
1035
987
|
else return cur;
|
|
@@ -1040,25 +992,23 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
1040
992
|
if (opt.nothrow) return null;
|
|
1041
993
|
throw getNotFoundError(cmd);
|
|
1042
994
|
};
|
|
1043
|
-
module.exports = which
|
|
1044
|
-
which
|
|
1045
|
-
})
|
|
1046
|
-
|
|
995
|
+
module.exports = which;
|
|
996
|
+
which.sync = whichSync;
|
|
997
|
+
}));
|
|
1047
998
|
//#endregion
|
|
1048
999
|
//#region ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
1049
|
-
var require_path_key = /* @__PURE__ */
|
|
1050
|
-
const pathKey
|
|
1000
|
+
var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1001
|
+
const pathKey = (options = {}) => {
|
|
1051
1002
|
const environment = options.env || process.env;
|
|
1052
1003
|
if ((options.platform || process.platform) !== "win32") return "PATH";
|
|
1053
1004
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
1054
1005
|
};
|
|
1055
|
-
module.exports = pathKey
|
|
1056
|
-
module.exports.default = pathKey
|
|
1057
|
-
})
|
|
1058
|
-
|
|
1006
|
+
module.exports = pathKey;
|
|
1007
|
+
module.exports.default = pathKey;
|
|
1008
|
+
}));
|
|
1059
1009
|
//#endregion
|
|
1060
1010
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
1061
|
-
var require_resolveCommand = /* @__PURE__ */
|
|
1011
|
+
var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1062
1012
|
const path$8 = require("path");
|
|
1063
1013
|
const which = require_which();
|
|
1064
1014
|
const getPathKey = require_path_key();
|
|
@@ -1082,15 +1032,14 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
1082
1032
|
if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
1083
1033
|
return resolved;
|
|
1084
1034
|
}
|
|
1085
|
-
function resolveCommand
|
|
1035
|
+
function resolveCommand(parsed) {
|
|
1086
1036
|
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
1087
1037
|
}
|
|
1088
|
-
module.exports = resolveCommand
|
|
1089
|
-
})
|
|
1090
|
-
|
|
1038
|
+
module.exports = resolveCommand;
|
|
1039
|
+
}));
|
|
1091
1040
|
//#endregion
|
|
1092
1041
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
1093
|
-
var require_escape = /* @__PURE__ */
|
|
1042
|
+
var require_escape = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1094
1043
|
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
1095
1044
|
function escapeCommand(arg) {
|
|
1096
1045
|
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
@@ -1107,34 +1056,31 @@ var require_escape = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cros
|
|
|
1107
1056
|
}
|
|
1108
1057
|
module.exports.command = escapeCommand;
|
|
1109
1058
|
module.exports.argument = escapeArgument;
|
|
1110
|
-
})
|
|
1111
|
-
|
|
1059
|
+
}));
|
|
1112
1060
|
//#endregion
|
|
1113
1061
|
//#region ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
1114
|
-
var require_shebang_regex = /* @__PURE__ */
|
|
1062
|
+
var require_shebang_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1115
1063
|
module.exports = /^#!(.*)/;
|
|
1116
|
-
})
|
|
1117
|
-
|
|
1064
|
+
}));
|
|
1118
1065
|
//#endregion
|
|
1119
1066
|
//#region ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
1120
|
-
var require_shebang_command = /* @__PURE__ */
|
|
1067
|
+
var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1121
1068
|
const shebangRegex = require_shebang_regex();
|
|
1122
1069
|
module.exports = (string = "") => {
|
|
1123
1070
|
const match = string.match(shebangRegex);
|
|
1124
1071
|
if (!match) return null;
|
|
1125
|
-
const [path
|
|
1126
|
-
const binary = path
|
|
1072
|
+
const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
1073
|
+
const binary = path.split("/").pop();
|
|
1127
1074
|
if (binary === "env") return argument;
|
|
1128
1075
|
return argument ? `${binary} ${argument}` : binary;
|
|
1129
1076
|
};
|
|
1130
|
-
})
|
|
1131
|
-
|
|
1077
|
+
}));
|
|
1132
1078
|
//#endregion
|
|
1133
1079
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
1134
|
-
var require_readShebang = /* @__PURE__ */
|
|
1080
|
+
var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1135
1081
|
const fs$3 = require("fs");
|
|
1136
1082
|
const shebangCommand = require_shebang_command();
|
|
1137
|
-
function readShebang
|
|
1083
|
+
function readShebang(command) {
|
|
1138
1084
|
const size = 150;
|
|
1139
1085
|
const buffer = Buffer.alloc(size);
|
|
1140
1086
|
let fd;
|
|
@@ -1145,17 +1091,16 @@ var require_readShebang = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
1145
1091
|
} catch (e) {}
|
|
1146
1092
|
return shebangCommand(buffer.toString());
|
|
1147
1093
|
}
|
|
1148
|
-
module.exports = readShebang
|
|
1149
|
-
})
|
|
1150
|
-
|
|
1094
|
+
module.exports = readShebang;
|
|
1095
|
+
}));
|
|
1151
1096
|
//#endregion
|
|
1152
1097
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
1153
|
-
var require_parse = /* @__PURE__ */
|
|
1098
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1154
1099
|
const path$7 = require("path");
|
|
1155
1100
|
const resolveCommand = require_resolveCommand();
|
|
1156
1101
|
const escape = require_escape();
|
|
1157
1102
|
const readShebang = require_readShebang();
|
|
1158
|
-
const isWin
|
|
1103
|
+
const isWin = process.platform === "win32";
|
|
1159
1104
|
const isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
1160
1105
|
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
1161
1106
|
function detectShebang(parsed) {
|
|
@@ -1169,7 +1114,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
1169
1114
|
return parsed.file;
|
|
1170
1115
|
}
|
|
1171
1116
|
function parseNonShell(parsed) {
|
|
1172
|
-
if (!isWin
|
|
1117
|
+
if (!isWin) return parsed;
|
|
1173
1118
|
const commandFile = detectShebang(parsed);
|
|
1174
1119
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
1175
1120
|
if (parsed.options.forceShell || needsShell) {
|
|
@@ -1188,7 +1133,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
1188
1133
|
}
|
|
1189
1134
|
return parsed;
|
|
1190
1135
|
}
|
|
1191
|
-
function parse
|
|
1136
|
+
function parse(command, args, options) {
|
|
1192
1137
|
if (args && !Array.isArray(args)) {
|
|
1193
1138
|
options = args;
|
|
1194
1139
|
args = null;
|
|
@@ -1207,12 +1152,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
|
|
|
1207
1152
|
};
|
|
1208
1153
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
1209
1154
|
}
|
|
1210
|
-
module.exports = parse
|
|
1211
|
-
})
|
|
1212
|
-
|
|
1155
|
+
module.exports = parse;
|
|
1156
|
+
}));
|
|
1213
1157
|
//#endregion
|
|
1214
1158
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
1215
|
-
var require_enoent = /* @__PURE__ */
|
|
1159
|
+
var require_enoent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1216
1160
|
const isWin = process.platform === "win32";
|
|
1217
1161
|
function notFoundError(original, syscall) {
|
|
1218
1162
|
return Object.assign(/* @__PURE__ */ new Error(`${syscall} ${original.command} ENOENT`), {
|
|
@@ -1223,15 +1167,15 @@ var require_enoent = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cros
|
|
|
1223
1167
|
spawnargs: original.args
|
|
1224
1168
|
});
|
|
1225
1169
|
}
|
|
1226
|
-
function hookChildProcess(cp
|
|
1170
|
+
function hookChildProcess(cp, parsed) {
|
|
1227
1171
|
if (!isWin) return;
|
|
1228
|
-
const originalEmit = cp
|
|
1229
|
-
cp
|
|
1172
|
+
const originalEmit = cp.emit;
|
|
1173
|
+
cp.emit = function(name, arg1) {
|
|
1230
1174
|
if (name === "exit") {
|
|
1231
1175
|
const err = verifyENOENT(arg1, parsed);
|
|
1232
|
-
if (err) return originalEmit.call(cp
|
|
1176
|
+
if (err) return originalEmit.call(cp, "error", err);
|
|
1233
1177
|
}
|
|
1234
|
-
return originalEmit.apply(cp
|
|
1178
|
+
return originalEmit.apply(cp, arguments);
|
|
1235
1179
|
};
|
|
1236
1180
|
}
|
|
1237
1181
|
function verifyENOENT(status, parsed) {
|
|
@@ -1248,45 +1192,37 @@ var require_enoent = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cros
|
|
|
1248
1192
|
verifyENOENTSync,
|
|
1249
1193
|
notFoundError
|
|
1250
1194
|
};
|
|
1251
|
-
})
|
|
1252
|
-
|
|
1195
|
+
}));
|
|
1253
1196
|
//#endregion
|
|
1254
|
-
//#region ../../node_modules/.pnpm/
|
|
1255
|
-
var
|
|
1197
|
+
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
1198
|
+
var import_cross_spawn = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1256
1199
|
const cp = require("child_process");
|
|
1257
1200
|
const parse = require_parse();
|
|
1258
1201
|
const enoent = require_enoent();
|
|
1259
|
-
function spawn
|
|
1202
|
+
function spawn(command, args, options) {
|
|
1260
1203
|
const parsed = parse(command, args, options);
|
|
1261
1204
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
1262
1205
|
enoent.hookChildProcess(spawned, parsed);
|
|
1263
1206
|
return spawned;
|
|
1264
1207
|
}
|
|
1265
|
-
function spawnSync
|
|
1208
|
+
function spawnSync(command, args, options) {
|
|
1266
1209
|
const parsed = parse(command, args, options);
|
|
1267
1210
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
1268
1211
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
1269
1212
|
return result;
|
|
1270
1213
|
}
|
|
1271
|
-
module.exports = spawn
|
|
1272
|
-
module.exports.spawn = spawn
|
|
1273
|
-
module.exports.sync = spawnSync
|
|
1214
|
+
module.exports = spawn;
|
|
1215
|
+
module.exports.spawn = spawn;
|
|
1216
|
+
module.exports.sync = spawnSync;
|
|
1274
1217
|
module.exports._parse = parse;
|
|
1275
1218
|
module.exports._enoent = enoent;
|
|
1276
|
-
})
|
|
1277
|
-
|
|
1278
|
-
//#endregion
|
|
1279
|
-
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
1280
|
-
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
1219
|
+
})))(), 1);
|
|
1281
1220
|
function pathKey(options = {}) {
|
|
1282
|
-
const { env = process.env, platform
|
|
1283
|
-
if (platform
|
|
1221
|
+
const { env = process.env, platform = process.platform } = options;
|
|
1222
|
+
if (platform !== "win32") return "PATH";
|
|
1284
1223
|
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
1285
1224
|
}
|
|
1286
|
-
|
|
1287
|
-
//#endregion
|
|
1288
|
-
//#region ../../node_modules/.pnpm/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
|
|
1289
|
-
const execFileOriginal = (0, node_util.promisify)(node_child_process.execFile);
|
|
1225
|
+
(0, node_util.promisify)(node_child_process.execFile);
|
|
1290
1226
|
function toPath(urlOrPath) {
|
|
1291
1227
|
return urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
1292
1228
|
}
|
|
@@ -1301,16 +1237,14 @@ function traversePathUp(startPath) {
|
|
|
1301
1237
|
}
|
|
1302
1238
|
} };
|
|
1303
1239
|
}
|
|
1304
|
-
const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
1305
|
-
|
|
1306
1240
|
//#endregion
|
|
1307
1241
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
1308
|
-
const npmRunPath = ({ cwd = node_process.default.cwd(), path: pathOption = node_process.default.env[pathKey()], preferLocal = true, execPath
|
|
1242
|
+
const npmRunPath = ({ cwd = node_process.default.cwd(), path: pathOption = node_process.default.env[pathKey()], preferLocal = true, execPath = node_process.default.execPath, addExecPath = true } = {}) => {
|
|
1309
1243
|
const cwdPath = node_path.default.resolve(toPath(cwd));
|
|
1310
1244
|
const result = [];
|
|
1311
1245
|
const pathParts = pathOption.split(node_path.default.delimiter);
|
|
1312
1246
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
1313
|
-
if (addExecPath) applyExecPath(result, pathParts, execPath
|
|
1247
|
+
if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
|
|
1314
1248
|
return pathOption === "" || pathOption === node_path.default.delimiter ? `${result.join(node_path.default.delimiter)}${pathOption}` : [...result, pathOption].join(node_path.default.delimiter);
|
|
1315
1249
|
};
|
|
1316
1250
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
@@ -1319,18 +1253,17 @@ const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
|
1319
1253
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
1320
1254
|
}
|
|
1321
1255
|
};
|
|
1322
|
-
const applyExecPath = (result, pathParts, execPath
|
|
1323
|
-
const pathPart = node_path.default.resolve(cwdPath, toPath(execPath
|
|
1256
|
+
const applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
1257
|
+
const pathPart = node_path.default.resolve(cwdPath, toPath(execPath), "..");
|
|
1324
1258
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
1325
1259
|
};
|
|
1326
|
-
const npmRunPathEnv = ({ env = node_process.default.env
|
|
1260
|
+
const npmRunPathEnv = ({ env = node_process.default.env, ...options } = {}) => {
|
|
1327
1261
|
env = { ...env };
|
|
1328
1262
|
const pathName = pathKey({ env });
|
|
1329
1263
|
options.path = env[pathName];
|
|
1330
1264
|
env[pathName] = npmRunPath(options);
|
|
1331
1265
|
return env;
|
|
1332
1266
|
};
|
|
1333
|
-
|
|
1334
1267
|
//#endregion
|
|
1335
1268
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js
|
|
1336
1269
|
const getFinalError = (originalError, message, isSync) => {
|
|
@@ -1358,11 +1291,10 @@ var ExecaError = class extends Error {};
|
|
|
1358
1291
|
setErrorName(ExecaError, ExecaError.name);
|
|
1359
1292
|
var ExecaSyncError = class extends Error {};
|
|
1360
1293
|
setErrorName(ExecaSyncError, ExecaSyncError.name);
|
|
1361
|
-
|
|
1362
1294
|
//#endregion
|
|
1363
|
-
//#region ../../node_modules/.pnpm/human-signals@8.0.
|
|
1295
|
+
//#region ../../node_modules/.pnpm/human-signals@8.0.1/node_modules/human-signals/build/src/realtime.js
|
|
1364
1296
|
const getRealtimeSignals = () => {
|
|
1365
|
-
const length =
|
|
1297
|
+
const length = 64 - SIGRTMIN + 1;
|
|
1366
1298
|
return Array.from({ length }, getRealtimeSignal);
|
|
1367
1299
|
};
|
|
1368
1300
|
const getRealtimeSignal = (value, index) => ({
|
|
@@ -1373,10 +1305,8 @@ const getRealtimeSignal = (value, index) => ({
|
|
|
1373
1305
|
standard: "posix"
|
|
1374
1306
|
});
|
|
1375
1307
|
const SIGRTMIN = 34;
|
|
1376
|
-
const SIGRTMAX = 64;
|
|
1377
|
-
|
|
1378
1308
|
//#endregion
|
|
1379
|
-
//#region ../../node_modules/.pnpm/human-signals@8.0.
|
|
1309
|
+
//#region ../../node_modules/.pnpm/human-signals@8.0.1/node_modules/human-signals/build/src/core.js
|
|
1380
1310
|
const SIGNALS = [
|
|
1381
1311
|
{
|
|
1382
1312
|
name: "SIGHUP",
|
|
@@ -1648,9 +1578,8 @@ const SIGNALS = [
|
|
|
1648
1578
|
standard: "other"
|
|
1649
1579
|
}
|
|
1650
1580
|
];
|
|
1651
|
-
|
|
1652
1581
|
//#endregion
|
|
1653
|
-
//#region ../../node_modules/.pnpm/human-signals@8.0.
|
|
1582
|
+
//#region ../../node_modules/.pnpm/human-signals@8.0.1/node_modules/human-signals/build/src/signals.js
|
|
1654
1583
|
const getSignals = () => {
|
|
1655
1584
|
const realtimeSignals = getRealtimeSignals();
|
|
1656
1585
|
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
|
|
@@ -1668,12 +1597,11 @@ const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, f
|
|
|
1668
1597
|
standard
|
|
1669
1598
|
};
|
|
1670
1599
|
};
|
|
1671
|
-
|
|
1672
1600
|
//#endregion
|
|
1673
|
-
//#region ../../node_modules/.pnpm/human-signals@8.0.
|
|
1601
|
+
//#region ../../node_modules/.pnpm/human-signals@8.0.1/node_modules/human-signals/build/src/main.js
|
|
1674
1602
|
const getSignalsByName = () => {
|
|
1675
|
-
const signals
|
|
1676
|
-
return Object.fromEntries(signals
|
|
1603
|
+
const signals = getSignals();
|
|
1604
|
+
return Object.fromEntries(signals.map(getSignalByName));
|
|
1677
1605
|
};
|
|
1678
1606
|
const getSignalByName = ({ name, number, description, supported, action, forced, standard }) => [name, {
|
|
1679
1607
|
name,
|
|
@@ -1686,13 +1614,12 @@ const getSignalByName = ({ name, number, description, supported, action, forced,
|
|
|
1686
1614
|
}];
|
|
1687
1615
|
const signalsByName = getSignalsByName();
|
|
1688
1616
|
const getSignalsByNumber = () => {
|
|
1689
|
-
const signals
|
|
1690
|
-
const
|
|
1691
|
-
const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals$1));
|
|
1617
|
+
const signals = getSignals();
|
|
1618
|
+
const signalsA = Array.from({ length: 65 }, (value, number) => getSignalByNumber(number, signals));
|
|
1692
1619
|
return Object.assign({}, ...signalsA);
|
|
1693
1620
|
};
|
|
1694
|
-
const getSignalByNumber = (number, signals
|
|
1695
|
-
const signal = findSignalByNumber(number, signals
|
|
1621
|
+
const getSignalByNumber = (number, signals) => {
|
|
1622
|
+
const signal = findSignalByNumber(number, signals);
|
|
1696
1623
|
if (signal === void 0) return {};
|
|
1697
1624
|
const { name, description, supported, action, forced, standard } = signal;
|
|
1698
1625
|
return { [number]: {
|
|
@@ -1705,13 +1632,12 @@ const getSignalByNumber = (number, signals$1) => {
|
|
|
1705
1632
|
standard
|
|
1706
1633
|
} };
|
|
1707
1634
|
};
|
|
1708
|
-
const findSignalByNumber = (number, signals
|
|
1709
|
-
const signal = signals
|
|
1635
|
+
const findSignalByNumber = (number, signals) => {
|
|
1636
|
+
const signal = signals.find(({ name }) => node_os.constants.signals[name] === number);
|
|
1710
1637
|
if (signal !== void 0) return signal;
|
|
1711
|
-
return signals
|
|
1638
|
+
return signals.find((signalA) => signalA.number === number);
|
|
1712
1639
|
};
|
|
1713
|
-
|
|
1714
|
-
|
|
1640
|
+
getSignalsByNumber();
|
|
1715
1641
|
//#endregion
|
|
1716
1642
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/signal.js
|
|
1717
1643
|
const normalizeKillSignal = (killSignal) => {
|
|
@@ -1741,7 +1667,6 @@ Available signal numbers: ${getAvailableSignalIntegers()}.`;
|
|
|
1741
1667
|
const getAvailableSignalNames = () => Object.keys(node_os.constants.signals).sort().map((signalName) => `'${signalName}'`).join(", ");
|
|
1742
1668
|
const getAvailableSignalIntegers = () => [...new Set(Object.values(node_os.constants.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", ");
|
|
1743
1669
|
const getSignalDescription = (signal) => signalsByName[signal].description;
|
|
1744
|
-
|
|
1745
1670
|
//#endregion
|
|
1746
1671
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/kill.js
|
|
1747
1672
|
const normalizeForceKillAfterDelay = (forceKillAfterDelay) => {
|
|
@@ -1793,13 +1718,11 @@ const killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSig
|
|
|
1793
1718
|
if (kill("SIGKILL")) context.isForcefullyTerminated ??= true;
|
|
1794
1719
|
} catch {}
|
|
1795
1720
|
};
|
|
1796
|
-
|
|
1797
1721
|
//#endregion
|
|
1798
1722
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/abort-signal.js
|
|
1799
1723
|
const onAbortedSignal = async (mainSignal, stopSignal) => {
|
|
1800
1724
|
if (!mainSignal.aborted) await (0, node_events.once)(mainSignal, "abort", { signal: stopSignal });
|
|
1801
1725
|
};
|
|
1802
|
-
|
|
1803
1726
|
//#endregion
|
|
1804
1727
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/cancel.js
|
|
1805
1728
|
const validateCancelSignal = ({ cancelSignal }) => {
|
|
@@ -1812,18 +1735,17 @@ const terminateOnCancel = async (subprocess, cancelSignal, context, { signal })
|
|
|
1812
1735
|
subprocess.kill();
|
|
1813
1736
|
throw cancelSignal.reason;
|
|
1814
1737
|
};
|
|
1815
|
-
|
|
1816
1738
|
//#endregion
|
|
1817
1739
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/validation.js
|
|
1818
|
-
const validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected
|
|
1740
|
+
const validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected }) => {
|
|
1819
1741
|
validateIpcOption(methodName, isSubprocess, ipc);
|
|
1820
|
-
validateConnection(methodName, isSubprocess, isConnected
|
|
1742
|
+
validateConnection(methodName, isSubprocess, isConnected);
|
|
1821
1743
|
};
|
|
1822
1744
|
const validateIpcOption = (methodName, isSubprocess, ipc) => {
|
|
1823
1745
|
if (!ipc) throw new Error(`${getMethodName(methodName, isSubprocess)} can only be used if the \`ipc\` option is \`true\`.`);
|
|
1824
1746
|
};
|
|
1825
|
-
const validateConnection = (methodName, isSubprocess, isConnected
|
|
1826
|
-
if (!isConnected
|
|
1747
|
+
const validateConnection = (methodName, isSubprocess, isConnected) => {
|
|
1748
|
+
if (!isConnected) throw new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} has already exited or disconnected.`);
|
|
1827
1749
|
};
|
|
1828
1750
|
const throwOnEarlyDisconnect = (isSubprocess) => {
|
|
1829
1751
|
throw new Error(`${getMethodName("getOneMessage", isSubprocess)} could not complete: the ${getOtherProcessName(isSubprocess)} exited or disconnected.`);
|
|
@@ -1867,7 +1789,6 @@ const getOtherProcessName = (isSubprocess) => isSubprocess ? "parent process" :
|
|
|
1867
1789
|
const disconnect = (anyProcess) => {
|
|
1868
1790
|
if (anyProcess.connected) anyProcess.disconnect();
|
|
1869
1791
|
};
|
|
1870
|
-
|
|
1871
1792
|
//#endregion
|
|
1872
1793
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/deferred.js
|
|
1873
1794
|
const createDeferred = () => {
|
|
@@ -1880,7 +1801,6 @@ const createDeferred = () => {
|
|
|
1880
1801
|
});
|
|
1881
1802
|
return Object.assign(promise, methods);
|
|
1882
1803
|
};
|
|
1883
|
-
|
|
1884
1804
|
//#endregion
|
|
1885
1805
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/fd-options.js
|
|
1886
1806
|
const getToStream = (destination, to = "stdin") => {
|
|
@@ -1957,7 +1877,6 @@ const serializeOptionValue = (value) => {
|
|
|
1957
1877
|
if (typeof value === "string") return `'${value}'`;
|
|
1958
1878
|
return typeof value === "number" ? `${value}` : "Stream";
|
|
1959
1879
|
};
|
|
1960
|
-
|
|
1961
1880
|
//#endregion
|
|
1962
1881
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/max-listeners.js
|
|
1963
1882
|
const incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {
|
|
@@ -1968,7 +1887,6 @@ const incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {
|
|
|
1968
1887
|
eventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement);
|
|
1969
1888
|
});
|
|
1970
1889
|
};
|
|
1971
|
-
|
|
1972
1890
|
//#endregion
|
|
1973
1891
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/reference.js
|
|
1974
1892
|
const addReference = (channel, reference) => {
|
|
@@ -1995,7 +1913,6 @@ const redoAddedReferences = (channel, isSubprocess) => {
|
|
|
1995
1913
|
addReferenceCount(channel);
|
|
1996
1914
|
}
|
|
1997
1915
|
};
|
|
1998
|
-
|
|
1999
1916
|
//#endregion
|
|
2000
1917
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/incoming.js
|
|
2001
1918
|
const onMessage = async ({ anyProcess, channel, isSubprocess, ipcEmitter }, wrappedMessage) => {
|
|
@@ -2029,7 +1946,6 @@ const onDisconnect = async ({ anyProcess, channel, isSubprocess, ipcEmitter, bou
|
|
|
2029
1946
|
ipcEmitter.emit("disconnect");
|
|
2030
1947
|
};
|
|
2031
1948
|
const INCOMING_MESSAGES = /* @__PURE__ */ new WeakMap();
|
|
2032
|
-
|
|
2033
1949
|
//#endregion
|
|
2034
1950
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/forward.js
|
|
2035
1951
|
const getIpcEmitter = (anyProcess, channel, isSubprocess) => {
|
|
@@ -2067,7 +1983,6 @@ const isConnected = (anyProcess) => {
|
|
|
2067
1983
|
const ipcEmitter = IPC_EMITTERS.get(anyProcess);
|
|
2068
1984
|
return ipcEmitter === void 0 ? anyProcess.channel !== null : ipcEmitter.connected;
|
|
2069
1985
|
};
|
|
2070
|
-
|
|
2071
1986
|
//#endregion
|
|
2072
1987
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/strict.js
|
|
2073
1988
|
const handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => {
|
|
@@ -2139,7 +2054,6 @@ const throwOnDisconnect$1 = async (anyProcess, isSubprocess, { signal }) => {
|
|
|
2139
2054
|
};
|
|
2140
2055
|
const REQUEST_TYPE = "execa:ipc:request";
|
|
2141
2056
|
const RESPONSE_TYPE = "execa:ipc:response";
|
|
2142
|
-
|
|
2143
2057
|
//#endregion
|
|
2144
2058
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/outgoing.js
|
|
2145
2059
|
const startSendMessage = (anyProcess, wrappedMessage, strict) => {
|
|
@@ -2169,7 +2083,6 @@ const waitForOutgoingMessages = async (anyProcess, ipcEmitter, wrappedMessage) =
|
|
|
2169
2083
|
const OUTGOING_MESSAGES = /* @__PURE__ */ new WeakMap();
|
|
2170
2084
|
const hasMessageListeners = (anyProcess, ipcEmitter) => ipcEmitter.listenerCount("message") > getMinListenerCount(anyProcess);
|
|
2171
2085
|
const getMinListenerCount = (anyProcess) => SUBPROCESS_OPTIONS.has(anyProcess) && !getFdSpecificValue(SUBPROCESS_OPTIONS.get(anyProcess).options.buffer, "ipc") ? 1 : 0;
|
|
2172
|
-
|
|
2173
2086
|
//#endregion
|
|
2174
2087
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/send.js
|
|
2175
2088
|
const sendMessage$1 = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => {
|
|
@@ -2239,7 +2152,6 @@ const getSendMethod = (anyProcess) => {
|
|
|
2239
2152
|
return sendMethod;
|
|
2240
2153
|
};
|
|
2241
2154
|
const PROCESS_SEND_METHODS = /* @__PURE__ */ new WeakMap();
|
|
2242
|
-
|
|
2243
2155
|
//#endregion
|
|
2244
2156
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/graceful.js
|
|
2245
2157
|
const sendAbort = (subprocess, message) => {
|
|
@@ -2290,7 +2202,6 @@ const abortOnDisconnect = () => {
|
|
|
2290
2202
|
cancelController.abort(getAbortDisconnectError());
|
|
2291
2203
|
};
|
|
2292
2204
|
const cancelController = new AbortController();
|
|
2293
|
-
|
|
2294
2205
|
//#endregion
|
|
2295
2206
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/graceful.js
|
|
2296
2207
|
const validateGracefulCancel = ({ gracefulCancel, cancelSignal, ipc, serialization }) => {
|
|
@@ -2329,7 +2240,6 @@ const getReason = ({ reason }) => {
|
|
|
2329
2240
|
});
|
|
2330
2241
|
return error;
|
|
2331
2242
|
};
|
|
2332
|
-
|
|
2333
2243
|
//#endregion
|
|
2334
2244
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/timeout.js
|
|
2335
2245
|
const validateTimeout = ({ timeout }) => {
|
|
@@ -2342,7 +2252,6 @@ const killAfterTimeout = async (subprocess, timeout, context, { signal }) => {
|
|
|
2342
2252
|
subprocess.kill();
|
|
2343
2253
|
throw new DiscardedError();
|
|
2344
2254
|
};
|
|
2345
|
-
|
|
2346
2255
|
//#endregion
|
|
2347
2256
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/node.js
|
|
2348
2257
|
const mapNode = ({ options }) => {
|
|
@@ -2352,7 +2261,7 @@ const mapNode = ({ options }) => {
|
|
|
2352
2261
|
node: true
|
|
2353
2262
|
} };
|
|
2354
2263
|
};
|
|
2355
|
-
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = node_process.execPath, nodeOptions = node_process.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath
|
|
2264
|
+
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = node_process.execPath, nodeOptions = node_process.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
|
|
2356
2265
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
2357
2266
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
2358
2267
|
const resolvedNodePath = node_path.default.resolve(cwd, normalizedNodePath);
|
|
@@ -2382,7 +2291,6 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
2382
2291
|
}
|
|
2383
2292
|
];
|
|
2384
2293
|
};
|
|
2385
|
-
|
|
2386
2294
|
//#endregion
|
|
2387
2295
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/ipc-input.js
|
|
2388
2296
|
const validateIpcInputOption = ({ ipcInput, ipc, serialization }) => {
|
|
@@ -2412,7 +2320,6 @@ const sendIpcInput = async (subprocess, ipcInput) => {
|
|
|
2412
2320
|
if (ipcInput === void 0) return;
|
|
2413
2321
|
await subprocess.sendMessage(ipcInput);
|
|
2414
2322
|
};
|
|
2415
|
-
|
|
2416
2323
|
//#endregion
|
|
2417
2324
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/encoding-option.js
|
|
2418
2325
|
const validateEncoding = ({ encoding }) => {
|
|
@@ -2420,7 +2327,7 @@ const validateEncoding = ({ encoding }) => {
|
|
|
2420
2327
|
const correctEncoding = getCorrectEncoding(encoding);
|
|
2421
2328
|
if (correctEncoding !== void 0) throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`.
|
|
2422
2329
|
Please rename it to ${serializeEncoding(correctEncoding)}.`);
|
|
2423
|
-
const correctEncodings = [...ENCODINGS].map((correctEncoding
|
|
2330
|
+
const correctEncodings = [...ENCODINGS].map((correctEncoding) => serializeEncoding(correctEncoding)).join(", ");
|
|
2424
2331
|
throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`.
|
|
2425
2332
|
Please rename it to one of: ${correctEncodings}.`);
|
|
2426
2333
|
};
|
|
@@ -2449,7 +2356,6 @@ const ENCODING_ALIASES = {
|
|
|
2449
2356
|
binary: "latin1"
|
|
2450
2357
|
};
|
|
2451
2358
|
const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
2452
|
-
|
|
2453
2359
|
//#endregion
|
|
2454
2360
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
|
|
2455
2361
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
@@ -2475,7 +2381,6 @@ const fixCwdError = (originalMessage, cwd) => {
|
|
|
2475
2381
|
if (!cwdStat.isDirectory()) return `The "cwd" option is not a directory: ${cwd}.\n${originalMessage}`;
|
|
2476
2382
|
return originalMessage;
|
|
2477
2383
|
};
|
|
2478
|
-
|
|
2479
2384
|
//#endregion
|
|
2480
2385
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/options.js
|
|
2481
2386
|
const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
@@ -2500,7 +2405,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2500
2405
|
options
|
|
2501
2406
|
};
|
|
2502
2407
|
};
|
|
2503
|
-
const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDir: localDirectory = cwd, encoding = "utf8", reject = true, cleanup = true, all = false, windowsHide = true, killSignal = "SIGTERM", forceKillAfterDelay = true, gracefulCancel = false, ipcInput, ipc = ipcInput !== void 0 || gracefulCancel, serialization = "advanced"
|
|
2408
|
+
const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDir: localDirectory = cwd, encoding = "utf8", reject = true, cleanup = true, all = false, windowsHide = true, killSignal = "SIGTERM", forceKillAfterDelay = true, gracefulCancel = false, ipcInput, ipc = ipcInput !== void 0 || gracefulCancel, serialization = "advanced", ...options }) => ({
|
|
2504
2409
|
...options,
|
|
2505
2410
|
extendEnv,
|
|
2506
2411
|
preferLocal,
|
|
@@ -2532,7 +2437,6 @@ const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory,
|
|
|
2532
2437
|
});
|
|
2533
2438
|
return env;
|
|
2534
2439
|
};
|
|
2535
|
-
|
|
2536
2440
|
//#endregion
|
|
2537
2441
|
//#region ../../node_modules/.pnpm/strip-final-newline@4.0.0/node_modules/strip-final-newline/index.js
|
|
2538
2442
|
function stripFinalNewline(input) {
|
|
@@ -2546,22 +2450,20 @@ const LF = "\n";
|
|
|
2546
2450
|
const LF_BINARY = LF.codePointAt(0);
|
|
2547
2451
|
const CR = "\r";
|
|
2548
2452
|
const CR_BINARY = CR.codePointAt(0);
|
|
2549
|
-
|
|
2550
2453
|
//#endregion
|
|
2551
2454
|
//#region ../../node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.js
|
|
2552
2455
|
function isStream(stream, { checkOpen = true } = {}) {
|
|
2553
2456
|
return stream !== null && typeof stream === "object" && (stream.writable || stream.readable || !checkOpen || stream.writable === void 0 && stream.readable === void 0) && typeof stream.pipe === "function";
|
|
2554
2457
|
}
|
|
2555
|
-
function isWritableStream(stream, { checkOpen = true } = {}) {
|
|
2458
|
+
function isWritableStream$1(stream, { checkOpen = true } = {}) {
|
|
2556
2459
|
return isStream(stream, { checkOpen }) && (stream.writable || !checkOpen) && typeof stream.write === "function" && typeof stream.end === "function" && typeof stream.writable === "boolean" && typeof stream.writableObjectMode === "boolean" && typeof stream.destroy === "function" && typeof stream.destroyed === "boolean";
|
|
2557
2460
|
}
|
|
2558
|
-
function isReadableStream(stream, { checkOpen = true } = {}) {
|
|
2461
|
+
function isReadableStream$1(stream, { checkOpen = true } = {}) {
|
|
2559
2462
|
return isStream(stream, { checkOpen }) && (stream.readable || !checkOpen) && typeof stream.read === "function" && typeof stream.readable === "boolean" && typeof stream.readableObjectMode === "boolean" && typeof stream.destroy === "function" && typeof stream.destroyed === "boolean";
|
|
2560
2463
|
}
|
|
2561
2464
|
function isDuplexStream(stream, options) {
|
|
2562
|
-
return isWritableStream(stream, options) && isReadableStream(stream, options);
|
|
2465
|
+
return isWritableStream$1(stream, options) && isReadableStream$1(stream, options);
|
|
2563
2466
|
}
|
|
2564
|
-
|
|
2565
2467
|
//#endregion
|
|
2566
2468
|
//#region ../../node_modules/.pnpm/@sec-ant+readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js
|
|
2567
2469
|
const a = Object.getPrototypeOf(Object.getPrototypeOf(
|
|
@@ -2642,11 +2544,10 @@ function h({ preventCancel: r = !1 } = {}) {
|
|
|
2642
2544
|
const t = new c(this.getReader(), r), s = Object.create(u);
|
|
2643
2545
|
return s[n] = t, s;
|
|
2644
2546
|
}
|
|
2645
|
-
|
|
2646
2547
|
//#endregion
|
|
2647
2548
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.js
|
|
2648
2549
|
const getAsyncIterable = (stream) => {
|
|
2649
|
-
if (isReadableStream(stream, { checkOpen: false }) && nodeImports.on !== void 0) return getStreamIterable(stream);
|
|
2550
|
+
if (isReadableStream$1(stream, { checkOpen: false }) && nodeImports.on !== void 0) return getStreamIterable(stream);
|
|
2650
2551
|
if (typeof stream?.[Symbol.asyncIterator] === "function") return stream;
|
|
2651
2552
|
if (toString.call(stream) === "[object ReadableStream]") return h.call(stream);
|
|
2652
2553
|
throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
@@ -2680,7 +2581,6 @@ const handleStreamEnd = async (stream, controller, state) => {
|
|
|
2680
2581
|
}
|
|
2681
2582
|
};
|
|
2682
2583
|
const nodeImports = {};
|
|
2683
|
-
|
|
2684
2584
|
//#endregion
|
|
2685
2585
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.js
|
|
2686
2586
|
const getStreamContents$1 = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
@@ -2756,7 +2656,6 @@ var MaxBufferError = class extends Error {
|
|
|
2756
2656
|
super("maxBuffer exceeded");
|
|
2757
2657
|
}
|
|
2758
2658
|
};
|
|
2759
|
-
|
|
2760
2659
|
//#endregion
|
|
2761
2660
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.js
|
|
2762
2661
|
const identity = (value) => value;
|
|
@@ -2766,7 +2665,6 @@ const throwObjectStream = (chunk) => {
|
|
|
2766
2665
|
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
2767
2666
|
};
|
|
2768
2667
|
const getLengthProperty = (convertedChunk) => convertedChunk.length;
|
|
2769
|
-
|
|
2770
2668
|
//#endregion
|
|
2771
2669
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array.js
|
|
2772
2670
|
async function getStreamAsArray(stream, options) {
|
|
@@ -2794,7 +2692,6 @@ const arrayMethods = {
|
|
|
2794
2692
|
getFinalChunk: noop$1,
|
|
2795
2693
|
finalize: getContentsProperty
|
|
2796
2694
|
};
|
|
2797
|
-
|
|
2798
2695
|
//#endregion
|
|
2799
2696
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.js
|
|
2800
2697
|
async function getStreamAsArrayBuffer(stream, options) {
|
|
@@ -2846,7 +2743,6 @@ const arrayBufferMethods = {
|
|
|
2846
2743
|
getFinalChunk: noop$1,
|
|
2847
2744
|
finalize: finalizeArrayBuffer
|
|
2848
2745
|
};
|
|
2849
|
-
|
|
2850
2746
|
//#endregion
|
|
2851
2747
|
//#region ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/string.js
|
|
2852
2748
|
async function getStreamAsString(stream, options) {
|
|
@@ -2856,11 +2752,11 @@ const initString = () => ({
|
|
|
2856
2752
|
contents: "",
|
|
2857
2753
|
textDecoder: new TextDecoder()
|
|
2858
2754
|
});
|
|
2859
|
-
const useTextDecoder = (chunk, { textDecoder
|
|
2755
|
+
const useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
|
|
2860
2756
|
const addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
|
|
2861
2757
|
const truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
2862
|
-
const getFinalStringChunk = ({ textDecoder
|
|
2863
|
-
const finalChunk = textDecoder
|
|
2758
|
+
const getFinalStringChunk = ({ textDecoder }) => {
|
|
2759
|
+
const finalChunk = textDecoder.decode();
|
|
2864
2760
|
return finalChunk === "" ? void 0 : finalChunk;
|
|
2865
2761
|
};
|
|
2866
2762
|
const stringMethods = {
|
|
@@ -2879,7 +2775,6 @@ const stringMethods = {
|
|
|
2879
2775
|
getFinalChunk: getFinalStringChunk,
|
|
2880
2776
|
finalize: getContentsProperty
|
|
2881
2777
|
};
|
|
2882
|
-
|
|
2883
2778
|
//#endregion
|
|
2884
2779
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/max-buffer.js
|
|
2885
2780
|
const handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
@@ -2935,7 +2830,6 @@ const truncateMaxBufferSync = (result, isMaxBuffer, maxBuffer) => {
|
|
|
2935
2830
|
return result.length > maxBufferValue ? result.slice(0, maxBufferValue) : result;
|
|
2936
2831
|
};
|
|
2937
2832
|
const getMaxBufferSync = ([, stdoutMaxBuffer]) => stdoutMaxBuffer;
|
|
2938
|
-
|
|
2939
2833
|
//#endregion
|
|
2940
2834
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/message.js
|
|
2941
2835
|
const createMessages = ({ stdio, all, ipcOutput, originalError, signal, signalDescription, exitCode, escapedCommand, timedOut, isCanceled, isGracefullyCanceled, isMaxBuffer, isForcefullyTerminated, forceKillAfterDelay, killSignal, maxBuffer, timeout, cwd }) => {
|
|
@@ -2997,7 +2891,6 @@ const serializeMessageItem = (messageItem) => {
|
|
|
2997
2891
|
if (isUint8Array(messageItem)) return uint8ArrayToString(messageItem);
|
|
2998
2892
|
return "";
|
|
2999
2893
|
};
|
|
3000
|
-
|
|
3001
2894
|
//#endregion
|
|
3002
2895
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/result.js
|
|
3003
2896
|
const makeSuccessResult = ({ command, escapedCommand, stdio, all, ipcOutput, options: { cwd }, startTime }) => omitUndefinedProperties({
|
|
@@ -3115,7 +3008,6 @@ const normalizeExitPayload = (rawExitCode, rawSignal) => {
|
|
|
3115
3008
|
signalDescription: signal === void 0 ? void 0 : getSignalDescription(rawSignal)
|
|
3116
3009
|
};
|
|
3117
3010
|
};
|
|
3118
|
-
|
|
3119
3011
|
//#endregion
|
|
3120
3012
|
//#region ../../node_modules/.pnpm/parse-ms@4.0.0/node_modules/parse-ms/index.js
|
|
3121
3013
|
const toZeroIfInfinity = (value) => Number.isFinite(value) ? value : 0;
|
|
@@ -3150,11 +3042,10 @@ function parseMilliseconds(milliseconds) {
|
|
|
3150
3042
|
}
|
|
3151
3043
|
throw new TypeError("Expected a finite number or bigint");
|
|
3152
3044
|
}
|
|
3153
|
-
|
|
3154
3045
|
//#endregion
|
|
3155
3046
|
//#region ../../node_modules/.pnpm/pretty-ms@9.2.0/node_modules/pretty-ms/index.js
|
|
3156
3047
|
const isZero = (value) => value === 0 || value === 0n;
|
|
3157
|
-
const pluralize = (word, count
|
|
3048
|
+
const pluralize = (word, count) => count === 1 || count === 1n ? word : `${word}s`;
|
|
3158
3049
|
const SECOND_ROUNDING_EPSILON = 1e-7;
|
|
3159
3050
|
const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;
|
|
3160
3051
|
function prettyMilliseconds(milliseconds, options) {
|
|
@@ -3203,16 +3094,16 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3203
3094
|
add(Number(parsed.minutes), "minute", "m");
|
|
3204
3095
|
if (!options.hideSeconds) if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) {
|
|
3205
3096
|
const seconds = Number(parsed.seconds);
|
|
3206
|
-
const milliseconds
|
|
3097
|
+
const milliseconds = Number(parsed.milliseconds);
|
|
3207
3098
|
const microseconds = Number(parsed.microseconds);
|
|
3208
3099
|
const nanoseconds = Number(parsed.nanoseconds);
|
|
3209
3100
|
add(seconds, "second", "s");
|
|
3210
3101
|
if (options.formatSubMilliseconds) {
|
|
3211
|
-
add(milliseconds
|
|
3102
|
+
add(milliseconds, "millisecond", "ms");
|
|
3212
3103
|
add(microseconds, "microsecond", "µs");
|
|
3213
3104
|
add(nanoseconds, "nanosecond", "ns");
|
|
3214
3105
|
} else {
|
|
3215
|
-
const millisecondsAndBelow = milliseconds
|
|
3106
|
+
const millisecondsAndBelow = milliseconds + microseconds / 1e3 + nanoseconds / 1e6;
|
|
3216
3107
|
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
3217
3108
|
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
3218
3109
|
add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
|
|
@@ -3227,7 +3118,6 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3227
3118
|
if (typeof options.unitCount === "number") result = result.slice(0, Math.max(options.unitCount, 1));
|
|
3228
3119
|
return sign + result.join(separator);
|
|
3229
3120
|
}
|
|
3230
|
-
|
|
3231
3121
|
//#endregion
|
|
3232
3122
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/error.js
|
|
3233
3123
|
const logError = (result, verboseInfo) => {
|
|
@@ -3238,7 +3128,6 @@ const logError = (result, verboseInfo) => {
|
|
|
3238
3128
|
result
|
|
3239
3129
|
});
|
|
3240
3130
|
};
|
|
3241
|
-
|
|
3242
3131
|
//#endregion
|
|
3243
3132
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/complete.js
|
|
3244
3133
|
const logResult = (result, verboseInfo) => {
|
|
@@ -3254,7 +3143,6 @@ const logDuration = (result, verboseInfo) => {
|
|
|
3254
3143
|
result
|
|
3255
3144
|
});
|
|
3256
3145
|
};
|
|
3257
|
-
|
|
3258
3146
|
//#endregion
|
|
3259
3147
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/reject.js
|
|
3260
3148
|
const handleResult = (result, verboseInfo, { reject }) => {
|
|
@@ -3262,7 +3150,6 @@ const handleResult = (result, verboseInfo, { reject }) => {
|
|
|
3262
3150
|
if (result.failed && reject) throw result;
|
|
3263
3151
|
return result;
|
|
3264
3152
|
};
|
|
3265
|
-
|
|
3266
3153
|
//#endregion
|
|
3267
3154
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/type.js
|
|
3268
3155
|
const getStdioItemType = (value, optionName) => {
|
|
@@ -3329,10 +3216,10 @@ const KNOWN_STDIO_STRINGS = new Set([
|
|
|
3329
3216
|
"overlapped",
|
|
3330
3217
|
"pipe"
|
|
3331
3218
|
]);
|
|
3332
|
-
const isReadableStream
|
|
3333
|
-
const isWritableStream
|
|
3334
|
-
const isWebStream = (value) => isReadableStream
|
|
3335
|
-
const isTransformStream = (value) => isReadableStream
|
|
3219
|
+
const isReadableStream = (value) => Object.prototype.toString.call(value) === "[object ReadableStream]";
|
|
3220
|
+
const isWritableStream = (value) => Object.prototype.toString.call(value) === "[object WritableStream]";
|
|
3221
|
+
const isWebStream = (value) => isReadableStream(value) || isWritableStream(value);
|
|
3222
|
+
const isTransformStream = (value) => isReadableStream(value?.readable) && isWritableStream(value?.writable);
|
|
3336
3223
|
const isAsyncIterableObject = (value) => isObject(value) && typeof value[Symbol.asyncIterator] === "function";
|
|
3337
3224
|
const isIterableObject = (value) => isObject(value) && typeof value[Symbol.iterator] === "function";
|
|
3338
3225
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
@@ -3370,7 +3257,6 @@ const TYPE_TO_MESSAGE = {
|
|
|
3370
3257
|
string: "a string",
|
|
3371
3258
|
uint8Array: "a Uint8Array"
|
|
3372
3259
|
};
|
|
3373
|
-
|
|
3374
3260
|
//#endregion
|
|
3375
3261
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/object-mode.js
|
|
3376
3262
|
const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
|
|
@@ -3393,7 +3279,6 @@ const getFdObjectMode = (stdioItems, direction) => {
|
|
|
3393
3279
|
if (lastTransform === void 0) return false;
|
|
3394
3280
|
return direction === "input" ? lastTransform.value.writableObjectMode : lastTransform.value.readableObjectMode;
|
|
3395
3281
|
};
|
|
3396
|
-
|
|
3397
3282
|
//#endregion
|
|
3398
3283
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/normalize.js
|
|
3399
3284
|
const normalizeTransforms = (stdioItems, optionName, direction, options) => [...stdioItems.filter(({ type }) => !TRANSFORM_TYPES.has(type)), ...getTransforms(stdioItems, optionName, direction, options)];
|
|
@@ -3470,7 +3355,6 @@ const normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransfo
|
|
|
3470
3355
|
};
|
|
3471
3356
|
};
|
|
3472
3357
|
const sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms;
|
|
3473
|
-
|
|
3474
3358
|
//#endregion
|
|
3475
3359
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/direction.js
|
|
3476
3360
|
const getStreamDirection = (stdioItems, fdNumber, optionName) => {
|
|
@@ -3494,10 +3378,10 @@ const guessStreamDirection = {
|
|
|
3494
3378
|
iterable: alwaysInput,
|
|
3495
3379
|
asyncIterable: alwaysInput,
|
|
3496
3380
|
uint8Array: alwaysInput,
|
|
3497
|
-
webStream: (value) => isWritableStream
|
|
3381
|
+
webStream: (value) => isWritableStream(value) ? "output" : "input",
|
|
3498
3382
|
nodeStream(value) {
|
|
3499
|
-
if (!isReadableStream(value, { checkOpen: false })) return "output";
|
|
3500
|
-
return isWritableStream(value, { checkOpen: false }) ? void 0 : "input";
|
|
3383
|
+
if (!isReadableStream$1(value, { checkOpen: false })) return "output";
|
|
3384
|
+
return isWritableStream$1(value, { checkOpen: false }) ? void 0 : "input";
|
|
3501
3385
|
},
|
|
3502
3386
|
webTransform: anyDirection,
|
|
3503
3387
|
duplex: anyDirection,
|
|
@@ -3517,14 +3401,12 @@ const getStandardStreamDirection = (value) => {
|
|
|
3517
3401
|
].includes(value)) return "output";
|
|
3518
3402
|
};
|
|
3519
3403
|
const DEFAULT_DIRECTION = "output";
|
|
3520
|
-
|
|
3521
3404
|
//#endregion
|
|
3522
3405
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/array.js
|
|
3523
3406
|
const normalizeIpcStdioArray = (stdioArray, ipc) => ipc && !stdioArray.includes("ipc") ? [...stdioArray, "ipc"] : stdioArray;
|
|
3524
|
-
|
|
3525
3407
|
//#endregion
|
|
3526
3408
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/stdio-option.js
|
|
3527
|
-
const normalizeStdioOption = ({ stdio, ipc, buffer
|
|
3409
|
+
const normalizeStdioOption = ({ stdio, ipc, buffer, ...options }, verboseInfo, isSync) => {
|
|
3528
3410
|
const stdioArray = getStdioArray(stdio, options).map((stdioOption, fdNumber) => addDefaultValue(stdioOption, fdNumber));
|
|
3529
3411
|
return isSync ? normalizeStdioSync(stdioArray, buffer, verboseInfo) : normalizeIpcStdioArray(stdioArray, ipc);
|
|
3530
3412
|
};
|
|
@@ -3548,7 +3430,6 @@ const addDefaultValue = (stdioOption, fdNumber) => {
|
|
|
3548
3430
|
};
|
|
3549
3431
|
const normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((stdioOption, fdNumber) => !buffer[fdNumber] && fdNumber !== 0 && !isFullVerbose(verboseInfo, fdNumber) && isOutputPipeOnly(stdioOption) ? "ignore" : stdioOption);
|
|
3550
3432
|
const isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(stdioOption) && stdioOption.every((item) => item === "pipe");
|
|
3551
|
-
|
|
3552
3433
|
//#endregion
|
|
3553
3434
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/native.js
|
|
3554
3435
|
const handleNativeStream = ({ stdioItem, stdioItem: { type }, isStdioArray, fdNumber, direction, isSync }) => {
|
|
@@ -3617,7 +3498,6 @@ const getStandardStream = (fdNumber, value, optionName) => {
|
|
|
3617
3498
|
if (standardStream === void 0) throw new TypeError(`The \`${optionName}: ${value}\` option is invalid: no such standard stream.`);
|
|
3618
3499
|
return standardStream;
|
|
3619
3500
|
};
|
|
3620
|
-
|
|
3621
3501
|
//#endregion
|
|
3622
3502
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/input-option.js
|
|
3623
3503
|
const handleInputOptions = ({ input, inputFile }, fdNumber) => fdNumber === 0 ? [...handleInputOption(input), ...handleInputFileOption(inputFile)] : [];
|
|
@@ -3627,7 +3507,7 @@ const handleInputOption = (input) => input === void 0 ? [] : [{
|
|
|
3627
3507
|
optionName: "input"
|
|
3628
3508
|
}];
|
|
3629
3509
|
const getInputType = (input) => {
|
|
3630
|
-
if (isReadableStream(input, { checkOpen: false })) return "nodeStream";
|
|
3510
|
+
if (isReadableStream$1(input, { checkOpen: false })) return "nodeStream";
|
|
3631
3511
|
if (typeof input === "string") return "string";
|
|
3632
3512
|
if (isUint8Array(input)) return "uint8Array";
|
|
3633
3513
|
throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.");
|
|
@@ -3647,7 +3527,6 @@ const getInputFileType = (inputFile) => {
|
|
|
3647
3527
|
};
|
|
3648
3528
|
throw new Error("The `inputFile` option must be a file path string or a file URL.");
|
|
3649
3529
|
};
|
|
3650
|
-
|
|
3651
3530
|
//#endregion
|
|
3652
3531
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/duplicate.js
|
|
3653
3532
|
const filterDuplicates = (stdioItems) => stdioItems.filter((stdioItemOne, indexOne) => stdioItems.every((stdioItemTwo, indexTwo) => stdioItemOne.value !== stdioItemTwo.value || indexOne >= indexTwo || stdioItemOne.type === "generator" || stdioItemOne.type === "asyncGenerator"));
|
|
@@ -3708,10 +3587,9 @@ const validateDuplicateTransform = ({ otherStdioItems, type, value, optionName }
|
|
|
3708
3587
|
const throwOnDuplicateStream = (stdioItem, optionName, type) => {
|
|
3709
3588
|
if (stdioItem !== void 0) throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);
|
|
3710
3589
|
};
|
|
3711
|
-
|
|
3712
3590
|
//#endregion
|
|
3713
3591
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle.js
|
|
3714
|
-
const handleStdio = (addProperties
|
|
3592
|
+
const handleStdio = (addProperties, options, verboseInfo, isSync) => {
|
|
3715
3593
|
const fileDescriptors = getFinalFileDescriptors({
|
|
3716
3594
|
initialFileDescriptors: normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
|
|
3717
3595
|
stdioOption,
|
|
@@ -3719,7 +3597,7 @@ const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
|
|
|
3719
3597
|
options,
|
|
3720
3598
|
isSync
|
|
3721
3599
|
})),
|
|
3722
|
-
addProperties
|
|
3600
|
+
addProperties,
|
|
3723
3601
|
options,
|
|
3724
3602
|
isSync
|
|
3725
3603
|
});
|
|
@@ -3768,7 +3646,7 @@ const initializeStdioItem = (value, optionName) => ({
|
|
|
3768
3646
|
const validateStdioArray = (stdioItems, isStdioArray, optionName) => {
|
|
3769
3647
|
if (stdioItems.length === 0) throw new TypeError(`The \`${optionName}\` option must not be an empty array.`);
|
|
3770
3648
|
if (!isStdioArray) return;
|
|
3771
|
-
for (const { value, optionName
|
|
3649
|
+
for (const { value, optionName } of stdioItems) if (INVALID_STDIO_ARRAY_OPTIONS.has(value)) throw new Error(`The \`${optionName}\` option must not include \`${value}\`.`);
|
|
3772
3650
|
};
|
|
3773
3651
|
const INVALID_STDIO_ARRAY_OPTIONS = new Set(["ignore", "ipc"]);
|
|
3774
3652
|
const validateStreams = (stdioItems) => {
|
|
@@ -3784,13 +3662,13 @@ const validateFileObjectMode = (stdioItems, objectMode) => {
|
|
|
3784
3662
|
const fileStdioItem = stdioItems.find(({ type }) => FILE_TYPES.has(type));
|
|
3785
3663
|
if (fileStdioItem !== void 0) throw new TypeError(`The \`${fileStdioItem.optionName}\` option cannot use both files and transforms in objectMode.`);
|
|
3786
3664
|
};
|
|
3787
|
-
const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties
|
|
3665
|
+
const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties, options, isSync }) => {
|
|
3788
3666
|
const fileDescriptors = [];
|
|
3789
3667
|
try {
|
|
3790
3668
|
for (const fileDescriptor of initialFileDescriptors) fileDescriptors.push(getFinalFileDescriptor({
|
|
3791
3669
|
fileDescriptor,
|
|
3792
3670
|
fileDescriptors,
|
|
3793
|
-
addProperties
|
|
3671
|
+
addProperties,
|
|
3794
3672
|
options,
|
|
3795
3673
|
isSync
|
|
3796
3674
|
}));
|
|
@@ -3800,13 +3678,13 @@ const getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addPro
|
|
|
3800
3678
|
throw error;
|
|
3801
3679
|
}
|
|
3802
3680
|
};
|
|
3803
|
-
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties
|
|
3681
|
+
const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdioItems }, fileDescriptors, addProperties, options, isSync }) => {
|
|
3804
3682
|
return {
|
|
3805
3683
|
direction,
|
|
3806
3684
|
objectMode,
|
|
3807
3685
|
stdioItems: stdioItems.map((stdioItem) => addStreamProperties({
|
|
3808
3686
|
stdioItem,
|
|
3809
|
-
addProperties
|
|
3687
|
+
addProperties,
|
|
3810
3688
|
direction,
|
|
3811
3689
|
options,
|
|
3812
3690
|
fileDescriptors,
|
|
@@ -3814,7 +3692,7 @@ const getFinalFileDescriptor = ({ fileDescriptor: { direction, objectMode, stdio
|
|
|
3814
3692
|
}))
|
|
3815
3693
|
};
|
|
3816
3694
|
};
|
|
3817
|
-
const addStreamProperties = ({ stdioItem, addProperties
|
|
3695
|
+
const addStreamProperties = ({ stdioItem, addProperties, direction, options, fileDescriptors, isSync }) => {
|
|
3818
3696
|
const duplicateStream = getDuplicateStream({
|
|
3819
3697
|
stdioItem,
|
|
3820
3698
|
direction,
|
|
@@ -3827,18 +3705,17 @@ const addStreamProperties = ({ stdioItem, addProperties: addProperties$2, direct
|
|
|
3827
3705
|
};
|
|
3828
3706
|
return {
|
|
3829
3707
|
...stdioItem,
|
|
3830
|
-
...addProperties
|
|
3708
|
+
...addProperties[direction][stdioItem.type](stdioItem, options)
|
|
3831
3709
|
};
|
|
3832
3710
|
};
|
|
3833
3711
|
const cleanupCustomStreams = (fileDescriptors) => {
|
|
3834
3712
|
for (const { stdioItems } of fileDescriptors) for (const { stream } of stdioItems) if (stream !== void 0 && !isStandardStream(stream)) stream.destroy();
|
|
3835
3713
|
};
|
|
3836
3714
|
const forwardStdio = (stdioItems) => {
|
|
3837
|
-
if (stdioItems.length > 1) return stdioItems.some(({ value
|
|
3715
|
+
if (stdioItems.length > 1) return stdioItems.some(({ value }) => value === "overlapped") ? "overlapped" : "pipe";
|
|
3838
3716
|
const [{ type, value }] = stdioItems;
|
|
3839
3717
|
return type === "native" ? value : "pipe";
|
|
3840
3718
|
};
|
|
3841
|
-
|
|
3842
3719
|
//#endregion
|
|
3843
3720
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle-sync.js
|
|
3844
3721
|
const handleStdioSync = (options, verboseInfo) => handleStdio(addPropertiesSync, options, verboseInfo, true);
|
|
@@ -3885,12 +3762,10 @@ const addPropertiesSync = {
|
|
|
3885
3762
|
uint8Array: forbiddenIfSync
|
|
3886
3763
|
}
|
|
3887
3764
|
};
|
|
3888
|
-
|
|
3889
3765
|
//#endregion
|
|
3890
3766
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/strip-newline.js
|
|
3891
3767
|
const stripNewline = (value, { stripFinalNewline: stripFinalNewline$1 }, fdNumber) => getStripFinalNewline(stripFinalNewline$1, fdNumber) && value !== void 0 && !Array.isArray(value) ? stripFinalNewline(value) : value;
|
|
3892
|
-
const getStripFinalNewline = (stripFinalNewline
|
|
3893
|
-
|
|
3768
|
+
const getStripFinalNewline = (stripFinalNewline, fdNumber) => fdNumber === "all" ? stripFinalNewline[1] || stripFinalNewline[2] : stripFinalNewline[fdNumber];
|
|
3894
3769
|
//#endregion
|
|
3895
3770
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/split.js
|
|
3896
3771
|
const getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binary || skipped ? void 0 : initializeSplitLines(preserveNewlines, state);
|
|
@@ -3936,8 +3811,8 @@ const linesFinal = function* ({ previousChunks }) {
|
|
|
3936
3811
|
};
|
|
3937
3812
|
const getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state }) => binary || preserveNewlines || readableObjectMode ? void 0 : { transform: appendNewlineGenerator.bind(void 0, state) };
|
|
3938
3813
|
const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
3939
|
-
const { unixNewline, windowsNewline, LF
|
|
3940
|
-
if (chunk.at(-1) === LF
|
|
3814
|
+
const { unixNewline, windowsNewline, LF, concatBytes } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
|
|
3815
|
+
if (chunk.at(-1) === LF) {
|
|
3941
3816
|
yield chunk;
|
|
3942
3817
|
return;
|
|
3943
3818
|
}
|
|
@@ -3962,7 +3837,6 @@ const linesUint8ArrayInfo = {
|
|
|
3962
3837
|
LF: 10,
|
|
3963
3838
|
concatBytes: concatUint8Array
|
|
3964
3839
|
};
|
|
3965
|
-
|
|
3966
3840
|
//#endregion
|
|
3967
3841
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/validate.js
|
|
3968
3842
|
const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName);
|
|
@@ -3985,7 +3859,6 @@ const validateEmptyReturn = (optionName, chunk) => {
|
|
|
3985
3859
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
3986
3860
|
if (condition) { yield value; }`);
|
|
3987
3861
|
};
|
|
3988
|
-
|
|
3989
3862
|
//#endregion
|
|
3990
3863
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/encoding-transform.js
|
|
3991
3864
|
const getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
@@ -3997,9 +3870,9 @@ const getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
|
3997
3870
|
final: encodingStringFinal.bind(void 0, stringDecoder)
|
|
3998
3871
|
};
|
|
3999
3872
|
};
|
|
4000
|
-
const encodingUint8ArrayGenerator = function* (textEncoder
|
|
3873
|
+
const encodingUint8ArrayGenerator = function* (textEncoder, chunk) {
|
|
4001
3874
|
if (node_buffer.Buffer.isBuffer(chunk)) yield bufferToUint8Array(chunk);
|
|
4002
|
-
else if (typeof chunk === "string") yield textEncoder
|
|
3875
|
+
else if (typeof chunk === "string") yield textEncoder.encode(chunk);
|
|
4003
3876
|
else yield chunk;
|
|
4004
3877
|
};
|
|
4005
3878
|
const encodingStringGenerator = function* (stringDecoder, chunk) {
|
|
@@ -4009,7 +3882,6 @@ const encodingStringFinal = function* (stringDecoder) {
|
|
|
4009
3882
|
const lastChunk = stringDecoder.end();
|
|
4010
3883
|
if (lastChunk !== "") yield lastChunk;
|
|
4011
3884
|
};
|
|
4012
|
-
|
|
4013
3885
|
//#endregion
|
|
4014
3886
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/run-async.js
|
|
4015
3887
|
const pushChunks = (0, node_util.callbackify)(async (getChunks, state, getChunksArguments, transformStream) => {
|
|
@@ -4045,7 +3917,6 @@ const destroyTransform = (0, node_util.callbackify)(async ({ currentIterable },
|
|
|
4045
3917
|
const identityGenerator$1 = function* (chunk) {
|
|
4046
3918
|
yield chunk;
|
|
4047
3919
|
};
|
|
4048
|
-
|
|
4049
3920
|
//#endregion
|
|
4050
3921
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/run-sync.js
|
|
4051
3922
|
const pushChunksSync = (getChunksSync, getChunksArguments, transformStream, done) => {
|
|
@@ -4075,7 +3946,6 @@ const generatorFinalChunksSync = function* (final, index, generators) {
|
|
|
4075
3946
|
const identityGenerator = function* (chunk) {
|
|
4076
3947
|
yield chunk;
|
|
4077
3948
|
};
|
|
4078
|
-
|
|
4079
3949
|
//#endregion
|
|
4080
3950
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/transform/generator.js
|
|
4081
3951
|
const generatorToStream = ({ value, value: { transform, final, writableObjectMode, readableObjectMode }, optionName }, { encoding }) => {
|
|
@@ -4091,7 +3961,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
|
|
|
4091
3961
|
writableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(writableObjectMode),
|
|
4092
3962
|
readableObjectMode,
|
|
4093
3963
|
readableHighWaterMark: (0, node_stream.getDefaultHighWaterMark)(readableObjectMode),
|
|
4094
|
-
transform(chunk, encoding
|
|
3964
|
+
transform(chunk, encoding, done) {
|
|
4095
3965
|
transformMethod([
|
|
4096
3966
|
chunk,
|
|
4097
3967
|
generators,
|
|
@@ -4129,7 +3999,6 @@ const addInternalGenerators = ({ transform, final, binary, writableObjectMode, r
|
|
|
4129
3999
|
})
|
|
4130
4000
|
].filter(Boolean);
|
|
4131
4001
|
};
|
|
4132
|
-
|
|
4133
4002
|
//#endregion
|
|
4134
4003
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/input-sync.js
|
|
4135
4004
|
const addInputOptionsSync = (fileDescriptors, options) => {
|
|
@@ -4155,7 +4024,6 @@ const validateSerializable = (newContents) => {
|
|
|
4155
4024
|
const invalidItem = newContents.find((item) => typeof item !== "string" && !isUint8Array(item));
|
|
4156
4025
|
if (invalidItem !== void 0) throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${invalidItem}.`);
|
|
4157
4026
|
};
|
|
4158
|
-
|
|
4159
4027
|
//#endregion
|
|
4160
4028
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/output.js
|
|
4161
4029
|
const shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type, value }) => type === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type }) => TRANSFORM_TYPES.has(type)));
|
|
@@ -4176,7 +4044,6 @@ const logLine = (line, fdNumber, verboseInfo) => {
|
|
|
4176
4044
|
verboseInfo
|
|
4177
4045
|
});
|
|
4178
4046
|
};
|
|
4179
|
-
|
|
4180
4047
|
//#endregion
|
|
4181
4048
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/output-sync.js
|
|
4182
4049
|
const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options, isMaxBuffer, verboseInfo }) => {
|
|
@@ -4196,7 +4063,7 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
|
|
|
4196
4063
|
...state
|
|
4197
4064
|
};
|
|
4198
4065
|
};
|
|
4199
|
-
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline
|
|
4066
|
+
const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline, maxBuffer }) => {
|
|
4200
4067
|
if (result === null) return;
|
|
4201
4068
|
const uint8ArrayResult = bufferToUint8Array(truncateMaxBufferSync(result, isMaxBuffer, maxBuffer));
|
|
4202
4069
|
const { stdioItems, objectMode } = fileDescriptors[fdNumber];
|
|
@@ -4205,7 +4072,7 @@ const transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state, o
|
|
|
4205
4072
|
objectMode,
|
|
4206
4073
|
encoding,
|
|
4207
4074
|
lines,
|
|
4208
|
-
stripFinalNewline
|
|
4075
|
+
stripFinalNewline,
|
|
4209
4076
|
fdNumber
|
|
4210
4077
|
});
|
|
4211
4078
|
logOutputSync({
|
|
@@ -4234,13 +4101,13 @@ const runOutputGeneratorsSync = (chunks, stdioItems, encoding, state) => {
|
|
|
4234
4101
|
return chunks;
|
|
4235
4102
|
}
|
|
4236
4103
|
};
|
|
4237
|
-
const serializeChunks = ({ chunks, objectMode, encoding, lines, stripFinalNewline
|
|
4104
|
+
const serializeChunks = ({ chunks, objectMode, encoding, lines, stripFinalNewline, fdNumber }) => {
|
|
4238
4105
|
if (objectMode) return { serializedResult: chunks };
|
|
4239
4106
|
if (encoding === "buffer") return { serializedResult: joinToUint8Array(chunks) };
|
|
4240
4107
|
const serializedResult = joinToString(chunks, encoding);
|
|
4241
4108
|
if (lines[fdNumber]) return {
|
|
4242
4109
|
serializedResult,
|
|
4243
|
-
finalResult: splitLinesSync(serializedResult, !stripFinalNewline
|
|
4110
|
+
finalResult: splitLinesSync(serializedResult, !stripFinalNewline[fdNumber], objectMode)
|
|
4244
4111
|
};
|
|
4245
4112
|
return { serializedResult };
|
|
4246
4113
|
};
|
|
@@ -4259,16 +4126,15 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
|
|
|
4259
4126
|
}
|
|
4260
4127
|
};
|
|
4261
4128
|
const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
4262
|
-
for (const { path
|
|
4263
|
-
const pathString = typeof path
|
|
4264
|
-
if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path
|
|
4129
|
+
for (const { path, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
4130
|
+
const pathString = typeof path === "string" ? path : path.toString();
|
|
4131
|
+
if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path, serializedResult);
|
|
4265
4132
|
else {
|
|
4266
4133
|
outputFiles.add(pathString);
|
|
4267
|
-
(0, node_fs.writeFileSync)(path
|
|
4134
|
+
(0, node_fs.writeFileSync)(path, serializedResult);
|
|
4268
4135
|
}
|
|
4269
4136
|
}
|
|
4270
4137
|
};
|
|
4271
|
-
|
|
4272
4138
|
//#endregion
|
|
4273
4139
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/all-sync.js
|
|
4274
4140
|
const getAllSync = ([, stdout, stderr], options) => {
|
|
@@ -4280,7 +4146,6 @@ const getAllSync = ([, stdout, stderr], options) => {
|
|
|
4280
4146
|
if (isUint8Array(stdout) && isUint8Array(stderr)) return concatUint8Arrays([stdout, stderr]);
|
|
4281
4147
|
return `${stdout}${stderr}`;
|
|
4282
4148
|
};
|
|
4283
|
-
|
|
4284
4149
|
//#endregion
|
|
4285
4150
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-async.js
|
|
4286
4151
|
const waitForExit = async (subprocess, context) => {
|
|
@@ -4307,7 +4172,6 @@ const waitForSuccessfulExit = async (exitPromise) => {
|
|
|
4307
4172
|
};
|
|
4308
4173
|
const isSubprocessErrorExit = (exitCode, signal) => exitCode === void 0 && signal === void 0;
|
|
4309
4174
|
const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;
|
|
4310
|
-
|
|
4311
4175
|
//#endregion
|
|
4312
4176
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/exit-sync.js
|
|
4313
4177
|
const getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => {
|
|
@@ -4324,7 +4188,6 @@ const getResultError = (error, exitCode, signal) => {
|
|
|
4324
4188
|
if (error !== void 0) return error;
|
|
4325
4189
|
return isFailedExit(exitCode, signal) ? new DiscardedError() : void 0;
|
|
4326
4190
|
};
|
|
4327
|
-
|
|
4328
4191
|
//#endregion
|
|
4329
4192
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-sync.js
|
|
4330
4193
|
const execaCoreSync = (rawFile, rawArguments, rawOptions) => {
|
|
@@ -4417,7 +4280,7 @@ const runSubprocessSync = ({ file, commandArguments, options, command, escapedCo
|
|
|
4417
4280
|
});
|
|
4418
4281
|
}
|
|
4419
4282
|
};
|
|
4420
|
-
const normalizeSpawnSyncOptions = ({ encoding, maxBuffer
|
|
4283
|
+
const normalizeSpawnSyncOptions = ({ encoding, maxBuffer, ...options }) => ({
|
|
4421
4284
|
...options,
|
|
4422
4285
|
encoding: "buffer",
|
|
4423
4286
|
maxBuffer: getMaxBufferSync(maxBuffer)
|
|
@@ -4448,7 +4311,6 @@ const getSyncResult = ({ error, exitCode, signal, timedOut, isMaxBuffer, stdio,
|
|
|
4448
4311
|
startTime,
|
|
4449
4312
|
isSync: true
|
|
4450
4313
|
});
|
|
4451
|
-
|
|
4452
4314
|
//#endregion
|
|
4453
4315
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/get-one.js
|
|
4454
4316
|
const getOneMessage$1 = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true, filter } = {}) => {
|
|
@@ -4499,7 +4361,6 @@ const throwOnStrictError = async (ipcEmitter, isSubprocess, { signal }) => {
|
|
|
4499
4361
|
const [error] = await (0, node_events.once)(ipcEmitter, "strict:error", { signal });
|
|
4500
4362
|
throw getStrictResponseError(error, isSubprocess);
|
|
4501
4363
|
};
|
|
4502
|
-
|
|
4503
4364
|
//#endregion
|
|
4504
4365
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/get-each.js
|
|
4505
4366
|
const getEachMessage$1 = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true } = {}) => loopOnMessages({
|
|
@@ -4570,7 +4431,6 @@ const iterateOnMessages = async function* ({ anyProcess, channel, ipcEmitter, is
|
|
|
4570
4431
|
const throwIfStrictError = ({ error }) => {
|
|
4571
4432
|
if (error) throw error;
|
|
4572
4433
|
};
|
|
4573
|
-
|
|
4574
4434
|
//#endregion
|
|
4575
4435
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/methods.js
|
|
4576
4436
|
const addIpcMethods = (subprocess, { ipc }) => {
|
|
@@ -4610,7 +4470,6 @@ const getIpcMethods = (anyProcess, isSubprocess, ipc) => ({
|
|
|
4610
4470
|
ipc
|
|
4611
4471
|
})
|
|
4612
4472
|
});
|
|
4613
|
-
|
|
4614
4473
|
//#endregion
|
|
4615
4474
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/early-error.js
|
|
4616
4475
|
const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo }) => {
|
|
@@ -4667,7 +4526,6 @@ const duplex = () => new node_stream.Duplex({
|
|
|
4667
4526
|
write() {}
|
|
4668
4527
|
});
|
|
4669
4528
|
const handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);
|
|
4670
|
-
|
|
4671
4529
|
//#endregion
|
|
4672
4530
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/stdio/handle-async.js
|
|
4673
4531
|
const handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);
|
|
@@ -4708,7 +4566,6 @@ const addPropertiesAsync = {
|
|
|
4708
4566
|
uint8Array: forbiddenIfAsync
|
|
4709
4567
|
}
|
|
4710
4568
|
};
|
|
4711
|
-
|
|
4712
4569
|
//#endregion
|
|
4713
4570
|
//#region ../../node_modules/.pnpm/@sindresorhus+merge-streams@4.0.0/node_modules/@sindresorhus/merge-streams/index.js
|
|
4714
4571
|
function mergeStreams(streams) {
|
|
@@ -4791,7 +4648,7 @@ const onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, { s
|
|
|
4791
4648
|
const validateStream = (stream) => {
|
|
4792
4649
|
if (typeof stream?.pipe !== "function") throw new TypeError(`Expected a readable stream, got: \`${typeof stream}\`.`);
|
|
4793
4650
|
};
|
|
4794
|
-
const endWhenStreamsDone = async ({ passThroughStream, stream, streams, ended, aborted
|
|
4651
|
+
const endWhenStreamsDone = async ({ passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent }) => {
|
|
4795
4652
|
updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);
|
|
4796
4653
|
const controller = new AbortController();
|
|
4797
4654
|
try {
|
|
@@ -4802,14 +4659,14 @@ const endWhenStreamsDone = async ({ passThroughStream, stream, streams, ended, a
|
|
|
4802
4659
|
stream,
|
|
4803
4660
|
streams,
|
|
4804
4661
|
ended,
|
|
4805
|
-
aborted
|
|
4662
|
+
aborted,
|
|
4806
4663
|
controller
|
|
4807
4664
|
}),
|
|
4808
4665
|
onInputStreamUnpipe({
|
|
4809
4666
|
stream,
|
|
4810
4667
|
streams,
|
|
4811
4668
|
ended,
|
|
4812
|
-
aborted
|
|
4669
|
+
aborted,
|
|
4813
4670
|
unpipeEvent,
|
|
4814
4671
|
controller
|
|
4815
4672
|
})
|
|
@@ -4818,7 +4675,7 @@ const endWhenStreamsDone = async ({ passThroughStream, stream, streams, ended, a
|
|
|
4818
4675
|
controller.abort();
|
|
4819
4676
|
updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);
|
|
4820
4677
|
}
|
|
4821
|
-
if (streams.size > 0 && streams.size === ended.size + aborted
|
|
4678
|
+
if (streams.size > 0 && streams.size === ended.size + aborted.size) if (ended.size === 0 && aborted.size > 0) abortStream(passThroughStream);
|
|
4822
4679
|
else endStream(passThroughStream);
|
|
4823
4680
|
};
|
|
4824
4681
|
const afterMergedStreamFinished = async (onFinished, stream, { signal }) => {
|
|
@@ -4829,7 +4686,7 @@ const afterMergedStreamFinished = async (onFinished, stream, { signal }) => {
|
|
|
4829
4686
|
if (!signal.aborted) errorOrAbortStream(stream, error);
|
|
4830
4687
|
}
|
|
4831
4688
|
};
|
|
4832
|
-
const onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, aborted
|
|
4689
|
+
const onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, aborted, controller: { signal } }) => {
|
|
4833
4690
|
try {
|
|
4834
4691
|
await (0, node_stream_promises.finished)(stream, {
|
|
4835
4692
|
signal,
|
|
@@ -4840,16 +4697,16 @@ const onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, abo
|
|
|
4840
4697
|
if (streams.has(stream)) ended.add(stream);
|
|
4841
4698
|
} catch (error) {
|
|
4842
4699
|
if (signal.aborted || !streams.has(stream)) return;
|
|
4843
|
-
if (isAbortError(error)) aborted
|
|
4700
|
+
if (isAbortError(error)) aborted.add(stream);
|
|
4844
4701
|
else errorStream(passThroughStream, error);
|
|
4845
4702
|
}
|
|
4846
4703
|
};
|
|
4847
|
-
const onInputStreamUnpipe = async ({ stream, streams, ended, aborted
|
|
4704
|
+
const onInputStreamUnpipe = async ({ stream, streams, ended, aborted, unpipeEvent, controller: { signal } }) => {
|
|
4848
4705
|
await (0, node_events.once)(stream, unpipeEvent, { signal });
|
|
4849
4706
|
if (!stream.readable) return (0, node_events.once)(signal, "abort", { signal });
|
|
4850
4707
|
streams.delete(stream);
|
|
4851
4708
|
ended.delete(stream);
|
|
4852
|
-
aborted
|
|
4709
|
+
aborted.delete(stream);
|
|
4853
4710
|
};
|
|
4854
4711
|
const endStream = (stream) => {
|
|
4855
4712
|
if (stream.writable) stream.end();
|
|
@@ -4869,13 +4726,12 @@ const errorStream = (stream, error) => {
|
|
|
4869
4726
|
}
|
|
4870
4727
|
};
|
|
4871
4728
|
const noop = () => {};
|
|
4872
|
-
const updateMaxListeners = (passThroughStream, increment
|
|
4729
|
+
const updateMaxListeners = (passThroughStream, increment) => {
|
|
4873
4730
|
const maxListeners = passThroughStream.getMaxListeners();
|
|
4874
|
-
if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) passThroughStream.setMaxListeners(maxListeners + increment
|
|
4731
|
+
if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) passThroughStream.setMaxListeners(maxListeners + increment);
|
|
4875
4732
|
};
|
|
4876
4733
|
const PASSTHROUGH_LISTENERS_COUNT = 2;
|
|
4877
4734
|
const PASSTHROUGH_LISTENERS_PER_STREAM = 1;
|
|
4878
|
-
|
|
4879
4735
|
//#endregion
|
|
4880
4736
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/pipeline.js
|
|
4881
4737
|
const pipeStreams = (source, destination) => {
|
|
@@ -4911,7 +4767,6 @@ const onDestinationFinish = async (source, destination) => {
|
|
|
4911
4767
|
const abortSourceStream = (source) => {
|
|
4912
4768
|
if (source.readable) source.destroy();
|
|
4913
4769
|
};
|
|
4914
|
-
|
|
4915
4770
|
//#endregion
|
|
4916
4771
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/output-async.js
|
|
4917
4772
|
const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {
|
|
@@ -4952,7 +4807,6 @@ const setStandardStreamMaxListeners = (stream, { signal }) => {
|
|
|
4952
4807
|
if (isStandardStream(stream)) incrementMaxListeners(stream, MAX_LISTENERS_INCREMENT, signal);
|
|
4953
4808
|
};
|
|
4954
4809
|
const MAX_LISTENERS_INCREMENT = 2;
|
|
4955
|
-
|
|
4956
4810
|
//#endregion
|
|
4957
4811
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
4958
4812
|
/**
|
|
@@ -4985,10 +4839,9 @@ const signals = [];
|
|
|
4985
4839
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
4986
4840
|
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
4987
4841
|
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
4988
|
-
|
|
4989
4842
|
//#endregion
|
|
4990
4843
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
4991
|
-
const processOk = (process
|
|
4844
|
+
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
|
|
4992
4845
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
4993
4846
|
const global$1 = globalThis;
|
|
4994
4847
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -5017,12 +4870,12 @@ var Emitter = class {
|
|
|
5017
4870
|
}
|
|
5018
4871
|
removeListener(ev, fn) {
|
|
5019
4872
|
const list = this.listeners[ev];
|
|
5020
|
-
const i
|
|
4873
|
+
const i = list.indexOf(fn);
|
|
5021
4874
|
/* c8 ignore start */
|
|
5022
|
-
if (i
|
|
4875
|
+
if (i === -1) return;
|
|
5023
4876
|
/* c8 ignore stop */
|
|
5024
|
-
if (i
|
|
5025
|
-
else list.splice(i
|
|
4877
|
+
if (i === 0 && list.length === 1) list.length = 0;
|
|
4878
|
+
else list.splice(i, 1);
|
|
5026
4879
|
}
|
|
5027
4880
|
emit(ev, code, signal) {
|
|
5028
4881
|
if (this.emitted[ev]) return false;
|
|
@@ -5064,27 +4917,27 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5064
4917
|
#originalProcessReallyExit;
|
|
5065
4918
|
#sigListeners = {};
|
|
5066
4919
|
#loaded = false;
|
|
5067
|
-
constructor(process
|
|
4920
|
+
constructor(process) {
|
|
5068
4921
|
super();
|
|
5069
|
-
this.#process = process
|
|
4922
|
+
this.#process = process;
|
|
5070
4923
|
this.#sigListeners = {};
|
|
5071
4924
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
5072
4925
|
const listeners = this.#process.listeners(sig);
|
|
5073
|
-
let { count
|
|
4926
|
+
let { count } = this.#emitter;
|
|
5074
4927
|
/* c8 ignore start */
|
|
5075
|
-
const p
|
|
5076
|
-
if (typeof p
|
|
4928
|
+
const p = process;
|
|
4929
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
5077
4930
|
/* c8 ignore stop */
|
|
5078
|
-
if (listeners.length === count
|
|
4931
|
+
if (listeners.length === count) {
|
|
5079
4932
|
this.unload();
|
|
5080
4933
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
5081
4934
|
/* c8 ignore start */
|
|
5082
4935
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
5083
|
-
if (!ret) process
|
|
4936
|
+
if (!ret) process.kill(process.pid, s);
|
|
5084
4937
|
}
|
|
5085
4938
|
};
|
|
5086
|
-
this.#originalProcessReallyExit = process
|
|
5087
|
-
this.#originalProcessEmit = process
|
|
4939
|
+
this.#originalProcessReallyExit = process.reallyExit;
|
|
4940
|
+
this.#originalProcessEmit = process.emit;
|
|
5088
4941
|
}
|
|
5089
4942
|
onExit(cb, opts) {
|
|
5090
4943
|
/* c8 ignore start */
|
|
@@ -5106,8 +4959,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5106
4959
|
const fn = this.#sigListeners[sig];
|
|
5107
4960
|
if (fn) this.#process.on(sig, fn);
|
|
5108
4961
|
} catch (_) {}
|
|
5109
|
-
this.#process.emit = (ev, ...a
|
|
5110
|
-
return this.#processEmit(ev, ...a
|
|
4962
|
+
this.#process.emit = (ev, ...a) => {
|
|
4963
|
+
return this.#processEmit(ev, ...a);
|
|
5111
4964
|
};
|
|
5112
4965
|
this.#process.reallyExit = (code) => {
|
|
5113
4966
|
return this.#processReallyExit(code);
|
|
@@ -5153,7 +5006,6 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5153
5006
|
};
|
|
5154
5007
|
const process$1 = globalThis.process;
|
|
5155
5008
|
const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
|
5156
|
-
|
|
5157
5009
|
//#endregion
|
|
5158
5010
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/cleanup.js
|
|
5159
5011
|
const cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
@@ -5165,7 +5017,6 @@ const cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
|
5165
5017
|
removeExitHandler();
|
|
5166
5018
|
});
|
|
5167
5019
|
};
|
|
5168
|
-
|
|
5169
5020
|
//#endregion
|
|
5170
5021
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/pipe-arguments.js
|
|
5171
5022
|
const normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNested }, ...pipeArguments) => {
|
|
@@ -5233,7 +5084,6 @@ const getSourceStream = (source, from) => {
|
|
|
5233
5084
|
return { sourceError: error };
|
|
5234
5085
|
}
|
|
5235
5086
|
};
|
|
5236
|
-
|
|
5237
5087
|
//#endregion
|
|
5238
5088
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/throw.js
|
|
5239
5089
|
const handlePipeArgumentsError = ({ sourceStream, sourceError, destinationStream, destinationError, fileDescriptors, sourceOptions, startTime }) => {
|
|
@@ -5271,7 +5121,6 @@ const createNonCommandError = ({ error, fileDescriptors, sourceOptions, startTim
|
|
|
5271
5121
|
isSync: false
|
|
5272
5122
|
});
|
|
5273
5123
|
const PIPE_COMMAND_MESSAGE = "source.pipe(destination)";
|
|
5274
|
-
|
|
5275
5124
|
//#endregion
|
|
5276
5125
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/sequence.js
|
|
5277
5126
|
const waitForBothSubprocesses = async (subprocessPromises) => {
|
|
@@ -5281,7 +5130,6 @@ const waitForBothSubprocesses = async (subprocessPromises) => {
|
|
|
5281
5130
|
if (sourceStatus === "rejected") throw sourceResult;
|
|
5282
5131
|
return destinationResult;
|
|
5283
5132
|
};
|
|
5284
|
-
|
|
5285
5133
|
//#endregion
|
|
5286
5134
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/streaming.js
|
|
5287
5135
|
const pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => {
|
|
@@ -5315,7 +5163,6 @@ const cleanupMergedStreamsMap = async (destinationStream) => {
|
|
|
5315
5163
|
const MERGED_STREAMS = /* @__PURE__ */ new WeakMap();
|
|
5316
5164
|
const SOURCE_LISTENERS_PER_PIPE = 2;
|
|
5317
5165
|
const DESTINATION_LISTENERS_PER_PIPE = 1;
|
|
5318
|
-
|
|
5319
5166
|
//#endregion
|
|
5320
5167
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/abort.js
|
|
5321
5168
|
const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ? [] : [unpipeOnSignalAbort(unpipeSignal, unpipeContext)];
|
|
@@ -5329,7 +5176,6 @@ const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, f
|
|
|
5329
5176
|
startTime
|
|
5330
5177
|
});
|
|
5331
5178
|
};
|
|
5332
|
-
|
|
5333
5179
|
//#endregion
|
|
5334
5180
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/pipe/setup.js
|
|
5335
5181
|
const pipeToSubprocess = (sourceInfo, ...pipeArguments) => {
|
|
@@ -5340,7 +5186,7 @@ const pipeToSubprocess = (sourceInfo, ...pipeArguments) => {
|
|
|
5340
5186
|
...pipeArguments[0]
|
|
5341
5187
|
}
|
|
5342
5188
|
});
|
|
5343
|
-
const { destination
|
|
5189
|
+
const { destination, ...normalizedInfo } = normalizePipeArguments(sourceInfo, ...pipeArguments);
|
|
5344
5190
|
const promise = handlePipePromise({
|
|
5345
5191
|
...normalizedInfo,
|
|
5346
5192
|
destination
|
|
@@ -5379,7 +5225,6 @@ const handlePipePromise = async ({ sourcePromise, sourceStream, sourceOptions, s
|
|
|
5379
5225
|
}
|
|
5380
5226
|
};
|
|
5381
5227
|
const getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]);
|
|
5382
|
-
|
|
5383
5228
|
//#endregion
|
|
5384
5229
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/iterate.js
|
|
5385
5230
|
const iterateOnSubprocessStream = ({ subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines }) => {
|
|
@@ -5402,7 +5247,7 @@ const stopReadingOnExit = async (subprocess, controller) => {
|
|
|
5402
5247
|
controller.abort();
|
|
5403
5248
|
}
|
|
5404
5249
|
};
|
|
5405
|
-
const iterateForResult = ({ stream, onStreamEnd, lines, encoding, stripFinalNewline
|
|
5250
|
+
const iterateForResult = ({ stream, onStreamEnd, lines, encoding, stripFinalNewline, allMixed }) => {
|
|
5406
5251
|
const controller = new AbortController();
|
|
5407
5252
|
stopReadingOnStreamEnd(onStreamEnd, controller, stream);
|
|
5408
5253
|
const objectMode = stream.readableObjectMode && !allMixed;
|
|
@@ -5413,7 +5258,7 @@ const iterateForResult = ({ stream, onStreamEnd, lines, encoding, stripFinalNewl
|
|
|
5413
5258
|
shouldEncode: !objectMode,
|
|
5414
5259
|
encoding,
|
|
5415
5260
|
shouldSplit: !objectMode && lines,
|
|
5416
|
-
preserveNewlines: !stripFinalNewline
|
|
5261
|
+
preserveNewlines: !stripFinalNewline
|
|
5417
5262
|
});
|
|
5418
5263
|
};
|
|
5419
5264
|
const stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
@@ -5459,10 +5304,9 @@ const iterateOnData = async function* ({ onStdoutChunk, controller, binary, shou
|
|
|
5459
5304
|
}
|
|
5460
5305
|
};
|
|
5461
5306
|
const getGenerators = ({ binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => [getEncodingTransformGenerator(binary, encoding, !shouldEncode), getSplitLinesGenerator(binary, preserveNewlines, !shouldSplit, {})].filter(Boolean);
|
|
5462
|
-
|
|
5463
5307
|
//#endregion
|
|
5464
5308
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/io/contents.js
|
|
5465
|
-
const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline
|
|
5309
|
+
const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo }) => {
|
|
5466
5310
|
const logPromise = logOutputAsync({
|
|
5467
5311
|
stream,
|
|
5468
5312
|
onStreamEnd,
|
|
@@ -5481,7 +5325,7 @@ const getStreamOutput = async ({ stream, onStreamEnd, fdNumber, encoding, buffer
|
|
|
5481
5325
|
onStreamEnd,
|
|
5482
5326
|
lines,
|
|
5483
5327
|
encoding,
|
|
5484
|
-
stripFinalNewline: getStripFinalNewline(stripFinalNewline
|
|
5328
|
+
stripFinalNewline: getStripFinalNewline(stripFinalNewline, fdNumber),
|
|
5485
5329
|
allMixed
|
|
5486
5330
|
});
|
|
5487
5331
|
const [output] = await Promise.all([getStreamContents({
|
|
@@ -5538,7 +5382,6 @@ const getBufferedData = async (streamPromise) => {
|
|
|
5538
5382
|
}
|
|
5539
5383
|
};
|
|
5540
5384
|
const handleBufferedData = ({ bufferedData }) => isArrayBuffer(bufferedData) ? new Uint8Array(bufferedData) : bufferedData;
|
|
5541
|
-
|
|
5542
5385
|
//#endregion
|
|
5543
5386
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/wait-stream.js
|
|
5544
5387
|
const waitForStream = async (stream, fdNumber, streamInfo, { isSameDirection, stopOnExit = false } = {}) => {
|
|
@@ -5581,10 +5424,9 @@ const shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection =
|
|
|
5581
5424
|
const isInputFileDescriptor = ({ fileDescriptors }, fdNumber) => fdNumber !== "all" && fileDescriptors[fdNumber].direction === "input";
|
|
5582
5425
|
const isStreamAbort = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE";
|
|
5583
5426
|
const isStreamEpipe = (error) => error?.code === "EPIPE";
|
|
5584
|
-
|
|
5585
5427
|
//#endregion
|
|
5586
5428
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/stdio.js
|
|
5587
|
-
const waitForStdioStreams = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline
|
|
5429
|
+
const waitForStdioStreams = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo }) => subprocess.stdio.map((stream, fdNumber) => waitForSubprocessStream({
|
|
5588
5430
|
stream,
|
|
5589
5431
|
fdNumber,
|
|
5590
5432
|
encoding,
|
|
@@ -5592,11 +5434,11 @@ const waitForStdioStreams = ({ subprocess, encoding, buffer, maxBuffer, lines, s
|
|
|
5592
5434
|
maxBuffer: maxBuffer[fdNumber],
|
|
5593
5435
|
lines: lines[fdNumber],
|
|
5594
5436
|
allMixed: false,
|
|
5595
|
-
stripFinalNewline
|
|
5437
|
+
stripFinalNewline,
|
|
5596
5438
|
verboseInfo,
|
|
5597
5439
|
streamInfo
|
|
5598
5440
|
}));
|
|
5599
|
-
const waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline
|
|
5441
|
+
const waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo }) => {
|
|
5600
5442
|
if (!stream) return;
|
|
5601
5443
|
const onStreamEnd = waitForStream(stream, fdNumber, streamInfo);
|
|
5602
5444
|
if (isInputFileDescriptor(streamInfo, fdNumber)) {
|
|
@@ -5612,24 +5454,23 @@ const waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, max
|
|
|
5612
5454
|
maxBuffer,
|
|
5613
5455
|
lines,
|
|
5614
5456
|
allMixed,
|
|
5615
|
-
stripFinalNewline
|
|
5457
|
+
stripFinalNewline,
|
|
5616
5458
|
verboseInfo,
|
|
5617
5459
|
streamInfo
|
|
5618
5460
|
}), onStreamEnd]);
|
|
5619
5461
|
return output;
|
|
5620
5462
|
};
|
|
5621
|
-
|
|
5622
5463
|
//#endregion
|
|
5623
5464
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/all-async.js
|
|
5624
5465
|
const makeAllStream = ({ stdout, stderr }, { all }) => all && (stdout || stderr) ? mergeStreams([stdout, stderr].filter(Boolean)) : void 0;
|
|
5625
|
-
const waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline
|
|
5466
|
+
const waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo }) => waitForSubprocessStream({
|
|
5626
5467
|
...getAllStream(subprocess, buffer),
|
|
5627
5468
|
fdNumber: "all",
|
|
5628
5469
|
encoding,
|
|
5629
5470
|
maxBuffer: maxBuffer[1] + maxBuffer[2],
|
|
5630
5471
|
lines: lines[1] || lines[2],
|
|
5631
5472
|
allMixed: getAllMixed(subprocess),
|
|
5632
|
-
stripFinalNewline
|
|
5473
|
+
stripFinalNewline,
|
|
5633
5474
|
verboseInfo,
|
|
5634
5475
|
streamInfo
|
|
5635
5476
|
});
|
|
@@ -5653,7 +5494,6 @@ const getAllStream = ({ stdout, stderr, all }, [, bufferStdout, bufferStderr]) =
|
|
|
5653
5494
|
};
|
|
5654
5495
|
};
|
|
5655
5496
|
const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdout.readableObjectMode !== stderr.readableObjectMode;
|
|
5656
|
-
|
|
5657
5497
|
//#endregion
|
|
5658
5498
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
5659
5499
|
const shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc");
|
|
@@ -5665,12 +5505,11 @@ const logIpcOutput = (message, verboseInfo) => {
|
|
|
5665
5505
|
verboseInfo
|
|
5666
5506
|
});
|
|
5667
5507
|
};
|
|
5668
|
-
|
|
5669
5508
|
//#endregion
|
|
5670
5509
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/ipc/buffer-messages.js
|
|
5671
5510
|
const waitForIpcOutput = async ({ subprocess, buffer: bufferArray, maxBuffer: maxBufferArray, ipc, ipcOutput, verboseInfo }) => {
|
|
5672
5511
|
if (!ipc) return ipcOutput;
|
|
5673
|
-
const isVerbose
|
|
5512
|
+
const isVerbose = shouldLogIpc(verboseInfo);
|
|
5674
5513
|
const buffer = getFdSpecificValue(bufferArray, "ipc");
|
|
5675
5514
|
const maxBuffer = getFdSpecificValue(maxBufferArray, "ipc");
|
|
5676
5515
|
for await (const message of loopOnMessages({
|
|
@@ -5685,7 +5524,7 @@ const waitForIpcOutput = async ({ subprocess, buffer: bufferArray, maxBuffer: ma
|
|
|
5685
5524
|
checkIpcMaxBuffer(subprocess, ipcOutput, maxBuffer);
|
|
5686
5525
|
ipcOutput.push(message);
|
|
5687
5526
|
}
|
|
5688
|
-
if (isVerbose
|
|
5527
|
+
if (isVerbose) logIpcOutput(message, verboseInfo);
|
|
5689
5528
|
}
|
|
5690
5529
|
return ipcOutput;
|
|
5691
5530
|
};
|
|
@@ -5693,10 +5532,9 @@ const getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => {
|
|
|
5693
5532
|
await Promise.allSettled([ipcOutputPromise]);
|
|
5694
5533
|
return ipcOutput;
|
|
5695
5534
|
};
|
|
5696
|
-
|
|
5697
5535
|
//#endregion
|
|
5698
5536
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/wait-subprocess.js
|
|
5699
|
-
const waitForSubprocessResult = async ({ subprocess, options: { encoding, buffer, maxBuffer, lines, timeoutDuration: timeout, cancelSignal, gracefulCancel, forceKillAfterDelay, stripFinalNewline
|
|
5537
|
+
const waitForSubprocessResult = async ({ subprocess, options: { encoding, buffer, maxBuffer, lines, timeoutDuration: timeout, cancelSignal, gracefulCancel, forceKillAfterDelay, stripFinalNewline, ipc, ipcInput }, context, verboseInfo, fileDescriptors, originalStreams, onInternalError, controller }) => {
|
|
5700
5538
|
const exitPromise = waitForExit(subprocess, context);
|
|
5701
5539
|
const streamInfo = {
|
|
5702
5540
|
originalStreams,
|
|
@@ -5711,7 +5549,7 @@ const waitForSubprocessResult = async ({ subprocess, options: { encoding, buffer
|
|
|
5711
5549
|
buffer,
|
|
5712
5550
|
maxBuffer,
|
|
5713
5551
|
lines,
|
|
5714
|
-
stripFinalNewline
|
|
5552
|
+
stripFinalNewline,
|
|
5715
5553
|
verboseInfo,
|
|
5716
5554
|
streamInfo
|
|
5717
5555
|
});
|
|
@@ -5721,7 +5559,7 @@ const waitForSubprocessResult = async ({ subprocess, options: { encoding, buffer
|
|
|
5721
5559
|
buffer,
|
|
5722
5560
|
maxBuffer,
|
|
5723
5561
|
lines,
|
|
5724
|
-
stripFinalNewline
|
|
5562
|
+
stripFinalNewline,
|
|
5725
5563
|
verboseInfo,
|
|
5726
5564
|
streamInfo
|
|
5727
5565
|
});
|
|
@@ -5789,7 +5627,6 @@ const throwOnSubprocessError = async (subprocess, { signal }) => {
|
|
|
5789
5627
|
const [error] = await (0, node_events.once)(subprocess, "error", { signal });
|
|
5790
5628
|
throw error;
|
|
5791
5629
|
};
|
|
5792
|
-
|
|
5793
5630
|
//#endregion
|
|
5794
5631
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/concurrent.js
|
|
5795
5632
|
const initializeConcurrentStreams = () => ({
|
|
@@ -5813,7 +5650,6 @@ const waitForConcurrentStreams = async ({ resolve, promises }, subprocess) => {
|
|
|
5813
5650
|
const [isSubprocessExit] = await Promise.race([Promise.allSettled([true, subprocess]), Promise.all([false, ...promises])]);
|
|
5814
5651
|
return !isSubprocessExit;
|
|
5815
5652
|
};
|
|
5816
|
-
|
|
5817
5653
|
//#endregion
|
|
5818
5654
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/shared.js
|
|
5819
5655
|
const safeWaitForSubprocessStdin = async (subprocessStdin) => {
|
|
@@ -5850,7 +5686,6 @@ const destroyOtherStream = (stream, isOpen, error) => {
|
|
|
5850
5686
|
if (error && !isStreamAbort(error)) stream.destroy(error);
|
|
5851
5687
|
else if (isOpen) stream.destroy();
|
|
5852
5688
|
};
|
|
5853
|
-
|
|
5854
5689
|
//#endregion
|
|
5855
5690
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/readable.js
|
|
5856
5691
|
const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, binary: binaryOption = true, preserveNewlines = true } = {}) => {
|
|
@@ -5864,7 +5699,7 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
5864
5699
|
encoding,
|
|
5865
5700
|
preserveNewlines
|
|
5866
5701
|
});
|
|
5867
|
-
const readable
|
|
5702
|
+
const readable = new node_stream.Readable({
|
|
5868
5703
|
read,
|
|
5869
5704
|
destroy: (0, node_util.callbackify)(onReadableDestroy.bind(void 0, {
|
|
5870
5705
|
subprocessStdout,
|
|
@@ -5878,10 +5713,10 @@ const createReadable = ({ subprocess, concurrentStreams, encoding }, { from, bin
|
|
|
5878
5713
|
onStdoutFinished({
|
|
5879
5714
|
subprocessStdout,
|
|
5880
5715
|
onStdoutDataDone,
|
|
5881
|
-
readable
|
|
5716
|
+
readable,
|
|
5882
5717
|
subprocess
|
|
5883
5718
|
});
|
|
5884
|
-
return readable
|
|
5719
|
+
return readable;
|
|
5885
5720
|
};
|
|
5886
5721
|
const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
5887
5722
|
const subprocessStdout = getFromStream(subprocess, from);
|
|
@@ -5916,23 +5751,23 @@ const getReadableMethods = ({ subprocessStdout, subprocess, binary, encoding, pr
|
|
|
5916
5751
|
onStdoutDataDone
|
|
5917
5752
|
};
|
|
5918
5753
|
};
|
|
5919
|
-
const onRead = async (readable
|
|
5754
|
+
const onRead = async (readable, onStdoutData, onStdoutDataDone) => {
|
|
5920
5755
|
try {
|
|
5921
5756
|
const { value, done } = await onStdoutData.next();
|
|
5922
5757
|
if (done) onStdoutDataDone.resolve();
|
|
5923
|
-
else readable
|
|
5758
|
+
else readable.push(value);
|
|
5924
5759
|
} catch {}
|
|
5925
5760
|
};
|
|
5926
|
-
const onStdoutFinished = async ({ subprocessStdout, onStdoutDataDone, readable
|
|
5761
|
+
const onStdoutFinished = async ({ subprocessStdout, onStdoutDataDone, readable, subprocess, subprocessStdin }) => {
|
|
5927
5762
|
try {
|
|
5928
5763
|
await waitForSubprocessStdout(subprocessStdout);
|
|
5929
5764
|
await subprocess;
|
|
5930
5765
|
await safeWaitForSubprocessStdin(subprocessStdin);
|
|
5931
5766
|
await onStdoutDataDone;
|
|
5932
|
-
if (readable
|
|
5767
|
+
if (readable.readable) readable.push(null);
|
|
5933
5768
|
} catch (error) {
|
|
5934
5769
|
await safeWaitForSubprocessStdin(subprocessStdin);
|
|
5935
|
-
destroyOtherReadable(readable
|
|
5770
|
+
destroyOtherReadable(readable, error);
|
|
5936
5771
|
}
|
|
5937
5772
|
};
|
|
5938
5773
|
const onReadableDestroy = async ({ subprocessStdout, subprocess, waitReadableDestroy }, error) => {
|
|
@@ -5944,12 +5779,11 @@ const onReadableDestroy = async ({ subprocessStdout, subprocess, waitReadableDes
|
|
|
5944
5779
|
const destroyOtherReadable = (stream, error) => {
|
|
5945
5780
|
destroyOtherStream(stream, stream.readable, error);
|
|
5946
5781
|
};
|
|
5947
|
-
|
|
5948
5782
|
//#endregion
|
|
5949
5783
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/writable.js
|
|
5950
5784
|
const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
5951
5785
|
const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams);
|
|
5952
|
-
const writable
|
|
5786
|
+
const writable = new node_stream.Writable({
|
|
5953
5787
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
5954
5788
|
destroy: (0, node_util.callbackify)(onWritableDestroy.bind(void 0, {
|
|
5955
5789
|
subprocessStdin,
|
|
@@ -5960,8 +5794,8 @@ const createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => {
|
|
|
5960
5794
|
highWaterMark: subprocessStdin.writableHighWaterMark,
|
|
5961
5795
|
objectMode: subprocessStdin.writableObjectMode
|
|
5962
5796
|
});
|
|
5963
|
-
onStdinFinished(subprocessStdin, writable
|
|
5964
|
-
return writable
|
|
5797
|
+
onStdinFinished(subprocessStdin, writable);
|
|
5798
|
+
return writable;
|
|
5965
5799
|
};
|
|
5966
5800
|
const getSubprocessStdin = (subprocess, to, concurrentStreams) => {
|
|
5967
5801
|
const subprocessStdin = getToStream(subprocess, to);
|
|
@@ -5985,13 +5819,13 @@ const onWritableFinal = async (subprocessStdin, subprocess, waitWritableFinal) =
|
|
|
5985
5819
|
await subprocess;
|
|
5986
5820
|
}
|
|
5987
5821
|
};
|
|
5988
|
-
const onStdinFinished = async (subprocessStdin, writable
|
|
5822
|
+
const onStdinFinished = async (subprocessStdin, writable, subprocessStdout) => {
|
|
5989
5823
|
try {
|
|
5990
5824
|
await waitForSubprocessStdin(subprocessStdin);
|
|
5991
|
-
if (writable
|
|
5825
|
+
if (writable.writable) writable.end();
|
|
5992
5826
|
} catch (error) {
|
|
5993
5827
|
await safeWaitForSubprocessStdout(subprocessStdout);
|
|
5994
|
-
destroyOtherWritable(writable
|
|
5828
|
+
destroyOtherWritable(writable, error);
|
|
5995
5829
|
}
|
|
5996
5830
|
};
|
|
5997
5831
|
const onWritableDestroy = async ({ subprocessStdin, subprocess, waitWritableFinal, waitWritableDestroy }, error) => {
|
|
@@ -6004,7 +5838,6 @@ const onWritableDestroy = async ({ subprocessStdin, subprocess, waitWritableFina
|
|
|
6004
5838
|
const destroyOtherWritable = (stream, error) => {
|
|
6005
5839
|
destroyOtherStream(stream, stream.writable, error);
|
|
6006
5840
|
};
|
|
6007
|
-
|
|
6008
5841
|
//#endregion
|
|
6009
5842
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/duplex.js
|
|
6010
5843
|
const createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, binary: binaryOption = true, preserveNewlines = true } = {}) => {
|
|
@@ -6019,7 +5852,7 @@ const createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, b
|
|
|
6019
5852
|
encoding,
|
|
6020
5853
|
preserveNewlines
|
|
6021
5854
|
});
|
|
6022
|
-
const duplex
|
|
5855
|
+
const duplex = new node_stream.Duplex({
|
|
6023
5856
|
read,
|
|
6024
5857
|
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
6025
5858
|
destroy: (0, node_util.callbackify)(onDuplexDestroy.bind(void 0, {
|
|
@@ -6039,12 +5872,12 @@ const createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, b
|
|
|
6039
5872
|
onStdoutFinished({
|
|
6040
5873
|
subprocessStdout,
|
|
6041
5874
|
onStdoutDataDone,
|
|
6042
|
-
readable: duplex
|
|
5875
|
+
readable: duplex,
|
|
6043
5876
|
subprocess,
|
|
6044
5877
|
subprocessStdin
|
|
6045
5878
|
});
|
|
6046
|
-
onStdinFinished(subprocessStdin, duplex
|
|
6047
|
-
return duplex
|
|
5879
|
+
onStdinFinished(subprocessStdin, duplex, subprocessStdout);
|
|
5880
|
+
return duplex;
|
|
6048
5881
|
};
|
|
6049
5882
|
const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy }, error) => {
|
|
6050
5883
|
await Promise.all([onReadableDestroy({
|
|
@@ -6058,7 +5891,6 @@ const onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess,
|
|
|
6058
5891
|
waitWritableDestroy
|
|
6059
5892
|
}, error)]);
|
|
6060
5893
|
};
|
|
6061
|
-
|
|
6062
5894
|
//#endregion
|
|
6063
5895
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/iterable.js
|
|
6064
5896
|
const createIterable = (subprocess, encoding, { from, binary: binaryOption = false, preserveNewlines = false } = {}) => {
|
|
@@ -6081,7 +5913,6 @@ const iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, sub
|
|
|
6081
5913
|
await subprocess;
|
|
6082
5914
|
}
|
|
6083
5915
|
};
|
|
6084
|
-
|
|
6085
5916
|
//#endregion
|
|
6086
5917
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/convert/add.js
|
|
6087
5918
|
const addConvertedStreams = (subprocess, { encoding }) => {
|
|
@@ -6103,7 +5934,6 @@ const addConvertedStreams = (subprocess, { encoding }) => {
|
|
|
6103
5934
|
subprocess.iterable = createIterable.bind(void 0, subprocess, encoding);
|
|
6104
5935
|
subprocess[Symbol.asyncIterator] = createIterable.bind(void 0, subprocess, encoding, {});
|
|
6105
5936
|
};
|
|
6106
|
-
|
|
6107
5937
|
//#endregion
|
|
6108
5938
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/promise.js
|
|
6109
5939
|
const mergePromise = (subprocess, promise) => {
|
|
@@ -6121,7 +5951,6 @@ const descriptors = [
|
|
|
6121
5951
|
"catch",
|
|
6122
5952
|
"finally"
|
|
6123
5953
|
].map((property) => [property, Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)]);
|
|
6124
|
-
|
|
6125
5954
|
//#endregion
|
|
6126
5955
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/main-async.js
|
|
6127
5956
|
const execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => {
|
|
@@ -6164,7 +5993,7 @@ const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {
|
|
|
6164
5993
|
fileDescriptors: handleStdioAsync(options, verboseInfo)
|
|
6165
5994
|
};
|
|
6166
5995
|
};
|
|
6167
|
-
const handleAsyncOptions = ({ timeout, signal
|
|
5996
|
+
const handleAsyncOptions = ({ timeout, signal, ...options }) => {
|
|
6168
5997
|
if (signal !== void 0) throw new TypeError("The \"signal\" option has been renamed to \"cancelSignal\" instead.");
|
|
6169
5998
|
return {
|
|
6170
5999
|
...options,
|
|
@@ -6274,7 +6103,6 @@ const getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all, ipcOutput, co
|
|
|
6274
6103
|
options,
|
|
6275
6104
|
startTime
|
|
6276
6105
|
});
|
|
6277
|
-
|
|
6278
6106
|
//#endregion
|
|
6279
6107
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/bind.js
|
|
6280
6108
|
const mergeOptions = (boundOptions, options) => {
|
|
@@ -6292,11 +6120,10 @@ const mergeOption = (optionName, boundOptionValue, optionValue) => {
|
|
|
6292
6120
|
return optionValue;
|
|
6293
6121
|
};
|
|
6294
6122
|
const DEEP_OPTIONS = new Set(["env", ...FD_SPECIFIC_OPTIONS]);
|
|
6295
|
-
|
|
6296
6123
|
//#endregion
|
|
6297
6124
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/create.js
|
|
6298
6125
|
const createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => {
|
|
6299
|
-
const createNested = (mapArguments
|
|
6126
|
+
const createNested = (mapArguments, boundOptions, setBoundExeca) => createExeca(mapArguments, boundOptions, deepOptions, setBoundExeca);
|
|
6300
6127
|
const boundExeca = (...execaArguments) => callBoundExeca({
|
|
6301
6128
|
mapArguments,
|
|
6302
6129
|
deepOptions,
|
|
@@ -6333,7 +6160,6 @@ const parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOption
|
|
|
6333
6160
|
isSync
|
|
6334
6161
|
};
|
|
6335
6162
|
};
|
|
6336
|
-
|
|
6337
6163
|
//#endregion
|
|
6338
6164
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/command.js
|
|
6339
6165
|
const mapCommandAsync = ({ file, commandArguments }) => parseCommand(file, commandArguments);
|
|
@@ -6362,7 +6188,6 @@ const parseCommandString = (command) => {
|
|
|
6362
6188
|
return tokens;
|
|
6363
6189
|
};
|
|
6364
6190
|
const SPACES_REGEXP = / +/g;
|
|
6365
|
-
|
|
6366
6191
|
//#endregion
|
|
6367
6192
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/methods/script.js
|
|
6368
6193
|
const setScriptSync = (boundExeca, createNested, boundOptions) => {
|
|
@@ -6380,17 +6205,15 @@ const getScriptOptions = (options) => ({ options: {
|
|
|
6380
6205
|
} });
|
|
6381
6206
|
const getScriptStdinOption = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
|
|
6382
6207
|
const deepScriptOptions = { preferLocal: true };
|
|
6383
|
-
|
|
6384
6208
|
//#endregion
|
|
6385
6209
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/index.js
|
|
6386
6210
|
const execa = createExeca(() => ({}));
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6211
|
+
createExeca(() => ({ isSync: true }));
|
|
6212
|
+
createExeca(mapCommandAsync);
|
|
6213
|
+
createExeca(mapCommandSync);
|
|
6214
|
+
createExeca(mapNode);
|
|
6215
|
+
createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
6392
6216
|
const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcExport();
|
|
6393
|
-
|
|
6394
6217
|
//#endregion
|
|
6395
6218
|
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/error/AbortError.mjs
|
|
6396
6219
|
var AbortError = class extends Error {
|
|
@@ -6399,7 +6222,6 @@ var AbortError = class extends Error {
|
|
|
6399
6222
|
this.name = "AbortError";
|
|
6400
6223
|
}
|
|
6401
6224
|
};
|
|
6402
|
-
|
|
6403
6225
|
//#endregion
|
|
6404
6226
|
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/promise/delay.mjs
|
|
6405
6227
|
function delay(ms, { signal } = {}) {
|
|
@@ -6419,7 +6241,6 @@ function delay(ms, { signal } = {}) {
|
|
|
6419
6241
|
signal?.addEventListener("abort", abortHandler, { once: true });
|
|
6420
6242
|
});
|
|
6421
6243
|
}
|
|
6422
|
-
|
|
6423
6244
|
//#endregion
|
|
6424
6245
|
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
6425
6246
|
function isPlainObject(value) {
|
|
@@ -6428,13 +6249,12 @@ function isPlainObject(value) {
|
|
|
6428
6249
|
if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
|
|
6429
6250
|
return Object.prototype.toString.call(value) === "[object Object]";
|
|
6430
6251
|
}
|
|
6431
|
-
|
|
6432
6252
|
//#endregion
|
|
6433
6253
|
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/merge.mjs
|
|
6434
6254
|
function merge(target, source) {
|
|
6435
6255
|
const sourceKeys = Object.keys(source);
|
|
6436
|
-
for (let i
|
|
6437
|
-
const key = sourceKeys[i
|
|
6256
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
6257
|
+
const key = sourceKeys[i];
|
|
6438
6258
|
const sourceValue = source[key];
|
|
6439
6259
|
const targetValue = target[key];
|
|
6440
6260
|
if (Array.isArray(sourceValue)) if (Array.isArray(targetValue)) target[key] = merge(targetValue, sourceValue);
|
|
@@ -6445,48 +6265,18 @@ function merge(target, source) {
|
|
|
6445
6265
|
}
|
|
6446
6266
|
return target;
|
|
6447
6267
|
}
|
|
6448
|
-
|
|
6449
6268
|
//#endregion
|
|
6450
6269
|
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/omit.mjs
|
|
6451
6270
|
function omit(obj, keys) {
|
|
6452
6271
|
const result = { ...obj };
|
|
6453
|
-
for (let i
|
|
6454
|
-
const key = keys[i
|
|
6272
|
+
for (let i = 0; i < keys.length; i++) {
|
|
6273
|
+
const key = keys[i];
|
|
6455
6274
|
delete result[key];
|
|
6456
6275
|
}
|
|
6457
6276
|
return result;
|
|
6458
6277
|
}
|
|
6459
|
-
|
|
6460
6278
|
//#endregion
|
|
6461
6279
|
//#region iac/cloudfrontDistributionConfig.ts
|
|
6462
|
-
const HOT_UPDATER_LEGACY_CHECK_UPDATE_HEADERS = [
|
|
6463
|
-
"x-bundle-id",
|
|
6464
|
-
"x-app-version",
|
|
6465
|
-
"x-app-platform",
|
|
6466
|
-
"x-min-bundle-id",
|
|
6467
|
-
"x-channel",
|
|
6468
|
-
"x-fingerprint-hash"
|
|
6469
|
-
];
|
|
6470
|
-
const HOT_UPDATER_LEGACY_CHECK_UPDATE_CACHE_POLICY_CONFIG = {
|
|
6471
|
-
Name: "HotUpdaterLegacyCheckUpdateNoCache",
|
|
6472
|
-
Comment: "Forward legacy check-update headers to origin-request Lambda with effectively no cache",
|
|
6473
|
-
DefaultTTL: 0,
|
|
6474
|
-
MaxTTL: 1,
|
|
6475
|
-
MinTTL: 0,
|
|
6476
|
-
ParametersInCacheKeyAndForwardedToOrigin: {
|
|
6477
|
-
EnableAcceptEncodingBrotli: false,
|
|
6478
|
-
EnableAcceptEncodingGzip: false,
|
|
6479
|
-
HeadersConfig: {
|
|
6480
|
-
HeaderBehavior: "whitelist",
|
|
6481
|
-
Headers: {
|
|
6482
|
-
Quantity: HOT_UPDATER_LEGACY_CHECK_UPDATE_HEADERS.length,
|
|
6483
|
-
Items: [...HOT_UPDATER_LEGACY_CHECK_UPDATE_HEADERS]
|
|
6484
|
-
}
|
|
6485
|
-
},
|
|
6486
|
-
CookiesConfig: { CookieBehavior: "none" },
|
|
6487
|
-
QueryStringsConfig: { QueryStringBehavior: "none" }
|
|
6488
|
-
}
|
|
6489
|
-
};
|
|
6490
6280
|
const HOT_UPDATER_SHARED_CACHE_POLICY_CONFIG = {
|
|
6491
6281
|
Name: "HotUpdaterOriginCacheControl",
|
|
6492
6282
|
Comment: "Honor origin Cache-Control without forwarding viewer Host/cookies/query strings",
|
|
@@ -6519,15 +6309,9 @@ const HOT_UPDATER_BEHAVIOR_BASE = {
|
|
|
6519
6309
|
FieldLevelEncryptionId: "",
|
|
6520
6310
|
AllowedMethods: READ_ONLY_METHODS
|
|
6521
6311
|
};
|
|
6522
|
-
const
|
|
6523
|
-
pathPattern: "/api/check-update",
|
|
6524
|
-
cachePolicy: "legacy"
|
|
6525
|
-
}, {
|
|
6526
|
-
pathPattern: "/api/check-update/*",
|
|
6527
|
-
cachePolicy: "shared"
|
|
6528
|
-
}];
|
|
6312
|
+
const HOT_UPDATER_CACHE_BEHAVIOR_PATH = "/api/check-update/*";
|
|
6529
6313
|
const omitLegacyCacheFields = (value) => {
|
|
6530
|
-
const { ForwardedValues: _forwardedValues, MinTTL: _minTTL, DefaultTTL: _defaultTTL, MaxTTL: _maxTTL, OriginRequestPolicyId: _originRequestPolicyId
|
|
6314
|
+
const { ForwardedValues: _forwardedValues, MinTTL: _minTTL, DefaultTTL: _defaultTTL, MaxTTL: _maxTTL, OriginRequestPolicyId: _originRequestPolicyId, ...rest } = value;
|
|
6531
6315
|
return rest;
|
|
6532
6316
|
};
|
|
6533
6317
|
const sanitizeDefaultBehavior = (behavior) => ({
|
|
@@ -6576,17 +6360,10 @@ const buildDefaultCacheBehavior = (options) => ({
|
|
|
6576
6360
|
CachePolicyId: options.sharedCachePolicyId,
|
|
6577
6361
|
LambdaFunctionAssociations: EMPTY_LAMBDA_FUNCTION_ASSOCIATIONS
|
|
6578
6362
|
});
|
|
6579
|
-
const
|
|
6580
|
-
if (cachePolicy === "legacy") return legacyCachePolicyId;
|
|
6581
|
-
if (cachePolicy === "shared") return sharedCachePolicyId;
|
|
6582
|
-
};
|
|
6583
|
-
const buildCacheBehavior = (template, options) => ({
|
|
6363
|
+
const buildCacheBehavior = (options) => ({
|
|
6584
6364
|
...buildSharedBehavior(options.bucketName),
|
|
6585
|
-
PathPattern:
|
|
6586
|
-
CachePolicyId:
|
|
6587
|
-
legacyCachePolicyId: options.legacyCachePolicyId,
|
|
6588
|
-
sharedCachePolicyId: options.sharedCachePolicyId
|
|
6589
|
-
}),
|
|
6365
|
+
PathPattern: HOT_UPDATER_CACHE_BEHAVIOR_PATH,
|
|
6366
|
+
CachePolicyId: options.sharedCachePolicyId,
|
|
6590
6367
|
LambdaFunctionAssociations: buildOriginRequestLambdaAssociations(options.functionArn)
|
|
6591
6368
|
});
|
|
6592
6369
|
const mergeOriginWithExisting = (existingOrigin, overrideOrigin) => ({
|
|
@@ -6615,13 +6392,12 @@ const buildDistributionConfigOverrides = (options) => ({
|
|
|
6615
6392
|
sharedCachePolicyId: options.sharedCachePolicyId
|
|
6616
6393
|
}),
|
|
6617
6394
|
CacheBehaviors: {
|
|
6618
|
-
Quantity:
|
|
6619
|
-
Items:
|
|
6395
|
+
Quantity: 1,
|
|
6396
|
+
Items: [buildCacheBehavior({
|
|
6620
6397
|
bucketName: options.bucketName,
|
|
6621
6398
|
functionArn: options.functionArn,
|
|
6622
|
-
legacyCachePolicyId: options.legacyCachePolicyId,
|
|
6623
6399
|
sharedCachePolicyId: options.sharedCachePolicyId
|
|
6624
|
-
})
|
|
6400
|
+
})]
|
|
6625
6401
|
}
|
|
6626
6402
|
});
|
|
6627
6403
|
const applyDistributionConfigOverrides = (distributionConfig, overrides) => {
|
|
@@ -6659,7 +6435,6 @@ const buildDistributionConfig = (options) => sanitizeDistributionConfig({
|
|
|
6659
6435
|
Items: []
|
|
6660
6436
|
}
|
|
6661
6437
|
});
|
|
6662
|
-
|
|
6663
6438
|
//#endregion
|
|
6664
6439
|
//#region iac/cloudfrontPagination.ts
|
|
6665
6440
|
const findInPaginatedCloudFrontList = async ({ listPage, matches }) => {
|
|
@@ -6671,7 +6446,6 @@ const findInPaginatedCloudFrontList = async ({ listPage, matches }) => {
|
|
|
6671
6446
|
marker = nextMarker;
|
|
6672
6447
|
} while (marker);
|
|
6673
6448
|
};
|
|
6674
|
-
|
|
6675
6449
|
//#endregion
|
|
6676
6450
|
//#region iac/cloudfront.ts
|
|
6677
6451
|
var CloudFrontManager = class {
|
|
@@ -6700,28 +6474,9 @@ var CloudFrontManager = class {
|
|
|
6700
6474
|
if (!cachePolicyId) throw new Error("Failed to create shared cache policy");
|
|
6701
6475
|
return cachePolicyId;
|
|
6702
6476
|
}
|
|
6703
|
-
async getOrCreateLegacyCheckUpdateCachePolicy(cloudfrontClient) {
|
|
6704
|
-
const existingPolicyId = (await findInPaginatedCloudFrontList({
|
|
6705
|
-
listPage: async (marker) => {
|
|
6706
|
-
const listPoliciesResponse = await cloudfrontClient.listCachePolicies({
|
|
6707
|
-
Type: "custom",
|
|
6708
|
-
...marker ? { Marker: marker } : {}
|
|
6709
|
-
});
|
|
6710
|
-
return {
|
|
6711
|
-
items: listPoliciesResponse.CachePolicyList?.Items ?? [],
|
|
6712
|
-
nextMarker: listPoliciesResponse.CachePolicyList?.NextMarker
|
|
6713
|
-
};
|
|
6714
|
-
},
|
|
6715
|
-
matches: (policy) => policy.CachePolicy?.CachePolicyConfig?.Name === HOT_UPDATER_LEGACY_CHECK_UPDATE_CACHE_POLICY_CONFIG.Name
|
|
6716
|
-
}))?.CachePolicy?.Id;
|
|
6717
|
-
if (existingPolicyId) return existingPolicyId;
|
|
6718
|
-
const cachePolicyId = (await cloudfrontClient.createCachePolicy({ CachePolicyConfig: HOT_UPDATER_LEGACY_CHECK_UPDATE_CACHE_POLICY_CONFIG })).CachePolicy?.Id;
|
|
6719
|
-
if (!cachePolicyId) throw new Error("Failed to create legacy check-update cache policy");
|
|
6720
|
-
return cachePolicyId;
|
|
6721
|
-
}
|
|
6722
6477
|
async getOrCreateKeyGroup(publicKey) {
|
|
6723
6478
|
const publicKeyHash = crypto.default.createHash("sha256").update(publicKey).digest("hex").slice(0, 16);
|
|
6724
|
-
const cloudfrontClient = new
|
|
6479
|
+
const cloudfrontClient = new _aws_sdk_client_cloudfront.CloudFront({
|
|
6725
6480
|
region: this.region,
|
|
6726
6481
|
credentials: this.credentials
|
|
6727
6482
|
});
|
|
@@ -6750,14 +6505,14 @@ var CloudFrontManager = class {
|
|
|
6750
6505
|
};
|
|
6751
6506
|
const keyGroupId = (await cloudfrontClient.createKeyGroup({ KeyGroupConfig: keyGroupConfig })).KeyGroup?.Id;
|
|
6752
6507
|
if (!keyGroupId) throw new Error("Failed to create Key Group");
|
|
6753
|
-
|
|
6508
|
+
_hot_updater_cli_tools.p.log.success(`Created new Key Group: ${keyGroupConfig.Name}`);
|
|
6754
6509
|
return {
|
|
6755
6510
|
publicKeyId,
|
|
6756
6511
|
keyGroupId
|
|
6757
6512
|
};
|
|
6758
6513
|
}
|
|
6759
6514
|
async createOrUpdateDistribution(options) {
|
|
6760
|
-
const cloudfrontClient = new
|
|
6515
|
+
const cloudfrontClient = new _aws_sdk_client_cloudfront.CloudFront({
|
|
6761
6516
|
region: this.region,
|
|
6762
6517
|
credentials: this.credentials
|
|
6763
6518
|
});
|
|
@@ -6781,13 +6536,7 @@ var CloudFrontManager = class {
|
|
|
6781
6536
|
}
|
|
6782
6537
|
if (!oacId) throw new Error("Failed to get Origin Access Control ID");
|
|
6783
6538
|
const bucketDomain = `${options.bucketName}.s3.${this.region}.amazonaws.com`;
|
|
6784
|
-
let legacyCachePolicyId;
|
|
6785
6539
|
let sharedCachePolicyId;
|
|
6786
|
-
try {
|
|
6787
|
-
legacyCachePolicyId = await this.getOrCreateLegacyCheckUpdateCachePolicy(cloudfrontClient);
|
|
6788
|
-
} catch (error) {
|
|
6789
|
-
throw new Error(`Failed to get or create legacy check-update cache policy: ${error instanceof Error ? error.message : String(error)}`);
|
|
6790
|
-
}
|
|
6791
6540
|
try {
|
|
6792
6541
|
sharedCachePolicyId = await this.getOrCreateSharedCachePolicy(cloudfrontClient);
|
|
6793
6542
|
} catch (error) {
|
|
@@ -6806,14 +6555,14 @@ var CloudFrontManager = class {
|
|
|
6806
6555
|
let selectedDistribution = null;
|
|
6807
6556
|
if (matchingDistributions.length === 1) selectedDistribution = matchingDistributions[0];
|
|
6808
6557
|
else if (matchingDistributions.length > 1) {
|
|
6809
|
-
const selectedDistributionStr = await
|
|
6558
|
+
const selectedDistributionStr = await _hot_updater_cli_tools.p.select({
|
|
6810
6559
|
message: "Multiple CloudFront distributions found. Please select one to use:",
|
|
6811
6560
|
options: matchingDistributions.map((dist) => ({
|
|
6812
6561
|
value: JSON.stringify(dist),
|
|
6813
6562
|
label: `${dist.Id} (${dist.DomainName})`
|
|
6814
6563
|
}))
|
|
6815
6564
|
});
|
|
6816
|
-
if (
|
|
6565
|
+
if (_hot_updater_cli_tools.p.isCancel(selectedDistributionStr)) process.exit(0);
|
|
6817
6566
|
selectedDistribution = JSON.parse(selectedDistributionStr);
|
|
6818
6567
|
}
|
|
6819
6568
|
const newOverrides = buildDistributionConfigOverrides({
|
|
@@ -6822,11 +6571,10 @@ var CloudFrontManager = class {
|
|
|
6822
6571
|
functionArn: options.functionArn,
|
|
6823
6572
|
keyGroupId: options.keyGroupId,
|
|
6824
6573
|
oacId,
|
|
6825
|
-
legacyCachePolicyId,
|
|
6826
6574
|
sharedCachePolicyId
|
|
6827
6575
|
});
|
|
6828
6576
|
if (selectedDistribution) {
|
|
6829
|
-
|
|
6577
|
+
_hot_updater_cli_tools.p.log.success(`Existing CloudFront distribution selected. Distribution ID: ${selectedDistribution.Id}.`);
|
|
6830
6578
|
try {
|
|
6831
6579
|
const { DistributionConfig, ETag } = await cloudfrontClient.getDistributionConfig({ Id: selectedDistribution.Id });
|
|
6832
6580
|
if (!DistributionConfig) throw new Error("CloudFront distribution config was not returned");
|
|
@@ -6836,7 +6584,7 @@ var CloudFrontManager = class {
|
|
|
6836
6584
|
IfMatch: ETag,
|
|
6837
6585
|
DistributionConfig: finalConfig
|
|
6838
6586
|
});
|
|
6839
|
-
|
|
6587
|
+
_hot_updater_cli_tools.p.log.success("CloudFront distribution updated with new Lambda function ARN.");
|
|
6840
6588
|
await cloudfrontClient.createInvalidation({
|
|
6841
6589
|
DistributionId: selectedDistribution.Id,
|
|
6842
6590
|
InvalidationBatch: {
|
|
@@ -6847,13 +6595,13 @@ var CloudFrontManager = class {
|
|
|
6847
6595
|
}
|
|
6848
6596
|
}
|
|
6849
6597
|
});
|
|
6850
|
-
|
|
6598
|
+
_hot_updater_cli_tools.p.log.success("Cache invalidation request completed.");
|
|
6851
6599
|
return {
|
|
6852
6600
|
distributionId: selectedDistribution.Id,
|
|
6853
6601
|
distributionDomain: selectedDistribution.DomainName
|
|
6854
6602
|
};
|
|
6855
6603
|
} catch (err) {
|
|
6856
|
-
|
|
6604
|
+
_hot_updater_cli_tools.p.log.error(`Failed to update CloudFront distribution: ${err instanceof Error ? err.message : String(err)}`);
|
|
6857
6605
|
throw err;
|
|
6858
6606
|
}
|
|
6859
6607
|
}
|
|
@@ -6863,7 +6611,6 @@ var CloudFrontManager = class {
|
|
|
6863
6611
|
functionArn: options.functionArn,
|
|
6864
6612
|
keyGroupId: options.keyGroupId,
|
|
6865
6613
|
oacId,
|
|
6866
|
-
legacyCachePolicyId,
|
|
6867
6614
|
sharedCachePolicyId
|
|
6868
6615
|
});
|
|
6869
6616
|
try {
|
|
@@ -6871,9 +6618,9 @@ var CloudFrontManager = class {
|
|
|
6871
6618
|
if (!distResp.Distribution?.Id || !distResp.Distribution?.DomainName) throw new Error("Failed to create CloudFront distribution: No ID or DomainName returned");
|
|
6872
6619
|
const distributionId = distResp.Distribution.Id;
|
|
6873
6620
|
const distributionDomain = distResp.Distribution.DomainName;
|
|
6874
|
-
|
|
6621
|
+
_hot_updater_cli_tools.p.log.success(`Created new CloudFront distribution. Distribution ID: ${distributionId}`);
|
|
6875
6622
|
let retryCount = 0;
|
|
6876
|
-
await
|
|
6623
|
+
await _hot_updater_cli_tools.p.tasks([{
|
|
6877
6624
|
title: "Waiting for CloudFront distribution to complete...",
|
|
6878
6625
|
task: async (message) => {
|
|
6879
6626
|
while (retryCount < 600) try {
|
|
@@ -6883,7 +6630,7 @@ var CloudFrontManager = class {
|
|
|
6883
6630
|
if (retryCount++ >= 5) message(`CloudFront distribution is still in progress. This may take a few minutes. (${retryCount})`);
|
|
6884
6631
|
await delay(1e3);
|
|
6885
6632
|
}
|
|
6886
|
-
|
|
6633
|
+
_hot_updater_cli_tools.p.log.error("CloudFront distribution deployment timed out.");
|
|
6887
6634
|
process.exit(1);
|
|
6888
6635
|
}
|
|
6889
6636
|
}]);
|
|
@@ -6892,12 +6639,11 @@ var CloudFrontManager = class {
|
|
|
6892
6639
|
distributionDomain
|
|
6893
6640
|
};
|
|
6894
6641
|
} catch (error) {
|
|
6895
|
-
|
|
6642
|
+
_hot_updater_cli_tools.p.log.error(`CloudFront distribution creation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
6896
6643
|
throw error;
|
|
6897
6644
|
}
|
|
6898
6645
|
}
|
|
6899
6646
|
};
|
|
6900
|
-
|
|
6901
6647
|
//#endregion
|
|
6902
6648
|
//#region iac/iam.ts
|
|
6903
6649
|
var IAMManager = class {
|
|
@@ -6916,11 +6662,11 @@ var IAMManager = class {
|
|
|
6916
6662
|
});
|
|
6917
6663
|
}
|
|
6918
6664
|
async createOrSelectRole() {
|
|
6919
|
-
const iamClient = new
|
|
6665
|
+
const iamClient = new _aws_sdk_client_iam.IAM({
|
|
6920
6666
|
region: this.region,
|
|
6921
6667
|
credentials: this.credentials
|
|
6922
6668
|
});
|
|
6923
|
-
const accountId = (await new
|
|
6669
|
+
const accountId = (await new _aws_sdk_client_sts.STS({
|
|
6924
6670
|
region: this.region,
|
|
6925
6671
|
credentials: this.credentials
|
|
6926
6672
|
}).getCallerIdentity({})).Account;
|
|
@@ -6952,11 +6698,11 @@ var IAMManager = class {
|
|
|
6952
6698
|
PolicyName: "HotUpdaterSSMAccess",
|
|
6953
6699
|
PolicyDocument: ssmPolicyDocument
|
|
6954
6700
|
});
|
|
6955
|
-
|
|
6701
|
+
_hot_updater_cli_tools.p.log.info("Updated SSM access policy for existing IAM role");
|
|
6956
6702
|
} catch {
|
|
6957
|
-
|
|
6703
|
+
_hot_updater_cli_tools.p.log.warn("Failed to update SSM policy, continuing anyway");
|
|
6958
6704
|
}
|
|
6959
|
-
|
|
6705
|
+
_hot_updater_cli_tools.p.log.info(`Using existing IAM role: ${roleName} (${existingRole.Arn})`);
|
|
6960
6706
|
return existingRole.Arn;
|
|
6961
6707
|
}
|
|
6962
6708
|
} catch {
|
|
@@ -6968,25 +6714,24 @@ var IAMManager = class {
|
|
|
6968
6714
|
});
|
|
6969
6715
|
if (!createRoleResp.Role?.Arn) throw new Error("Failed to create IAM role: No ARN returned");
|
|
6970
6716
|
const lambdaRoleArn = createRoleResp.Role.Arn;
|
|
6971
|
-
|
|
6717
|
+
_hot_updater_cli_tools.p.log.info(`Created IAM role: ${roleName} (${lambdaRoleArn})`);
|
|
6972
6718
|
await this.ensureManagedPolicies(iamClient, roleName);
|
|
6973
|
-
|
|
6719
|
+
_hot_updater_cli_tools.p.log.info(`Attached managed policies to ${roleName}`);
|
|
6974
6720
|
await iamClient.putRolePolicy({
|
|
6975
6721
|
RoleName: roleName,
|
|
6976
6722
|
PolicyName: "HotUpdaterSSMAccess",
|
|
6977
6723
|
PolicyDocument: ssmPolicyDocument
|
|
6978
6724
|
});
|
|
6979
|
-
|
|
6725
|
+
_hot_updater_cli_tools.p.log.info(`Added SSM access inline policy to ${roleName}`);
|
|
6980
6726
|
return lambdaRoleArn;
|
|
6981
6727
|
} catch (createError) {
|
|
6982
|
-
if (createError instanceof Error)
|
|
6728
|
+
if (createError instanceof Error) _hot_updater_cli_tools.p.log.error(`Error setting up IAM role: ${createError.message}`);
|
|
6983
6729
|
process.exit(1);
|
|
6984
6730
|
}
|
|
6985
6731
|
}
|
|
6986
6732
|
throw new Error("Failed to create or get IAM role");
|
|
6987
6733
|
}
|
|
6988
6734
|
};
|
|
6989
|
-
|
|
6990
6735
|
//#endregion
|
|
6991
6736
|
//#region iac/lambdaEdge.ts
|
|
6992
6737
|
var LambdaEdgeDeployer = class {
|
|
@@ -6995,24 +6740,24 @@ var LambdaEdgeDeployer = class {
|
|
|
6995
6740
|
this.credentials = credentials;
|
|
6996
6741
|
}
|
|
6997
6742
|
async deploy(lambdaRoleArn, config) {
|
|
6998
|
-
const cwd = (0,
|
|
6999
|
-
const lambdaName = await
|
|
6743
|
+
const cwd = (0, _hot_updater_cli_tools.getCwd)();
|
|
6744
|
+
const lambdaName = await _hot_updater_cli_tools.p.text({
|
|
7000
6745
|
message: "Enter the name of the Lambda@Edge function",
|
|
7001
6746
|
defaultValue: "hot-updater-edge",
|
|
7002
6747
|
placeholder: "hot-updater-edge"
|
|
7003
6748
|
});
|
|
7004
|
-
if (
|
|
6749
|
+
if (_hot_updater_cli_tools.p.isCancel(lambdaName)) process.exit(1);
|
|
7005
6750
|
const lambdaPath = require.resolve("@hot-updater/aws/lambda");
|
|
7006
|
-
const { tmpDir, removeTmpDir } = await (0,
|
|
6751
|
+
const { tmpDir, removeTmpDir } = await (0, _hot_updater_cli_tools.copyDirToTmp)(path.default.dirname(lambdaPath));
|
|
7007
6752
|
const indexPath = path.default.join(tmpDir, "index.cjs");
|
|
7008
|
-
const code = (0,
|
|
6753
|
+
const code = (0, _hot_updater_cli_tools.transformEnv)(indexPath, {
|
|
7009
6754
|
CLOUDFRONT_KEY_PAIR_ID: config.publicKeyId,
|
|
7010
6755
|
SSM_PARAMETER_NAME: config.ssmParameterName,
|
|
7011
6756
|
SSM_REGION: config.ssmRegion,
|
|
7012
6757
|
S3_BUCKET_NAME: config.bucketName
|
|
7013
6758
|
});
|
|
7014
6759
|
await fs_promises.default.writeFile(indexPath, code);
|
|
7015
|
-
const lambdaClient = new
|
|
6760
|
+
const lambdaClient = new _aws_sdk_client_lambda.Lambda({
|
|
7016
6761
|
region: "us-east-1",
|
|
7017
6762
|
credentials: this.credentials
|
|
7018
6763
|
});
|
|
@@ -7021,12 +6766,12 @@ var LambdaEdgeDeployer = class {
|
|
|
7021
6766
|
version: null
|
|
7022
6767
|
};
|
|
7023
6768
|
const zipFilePath = path.default.join(cwd, `${lambdaName}.zip`);
|
|
7024
|
-
await
|
|
6769
|
+
await _hot_updater_cli_tools.p.tasks([
|
|
7025
6770
|
{
|
|
7026
6771
|
title: "Compressing Lambda code to zip",
|
|
7027
6772
|
task: async () => {
|
|
7028
6773
|
try {
|
|
7029
|
-
await (0,
|
|
6774
|
+
await (0, _hot_updater_cli_tools.createZip)({
|
|
7030
6775
|
outfile: zipFilePath,
|
|
7031
6776
|
targetDir: tmpDir
|
|
7032
6777
|
});
|
|
@@ -7078,13 +6823,13 @@ var LambdaEdgeDeployer = class {
|
|
|
7078
6823
|
MemorySize: 256,
|
|
7079
6824
|
Timeout: 10
|
|
7080
6825
|
});
|
|
7081
|
-
} catch (error
|
|
7082
|
-
|
|
6826
|
+
} catch (error) {
|
|
6827
|
+
_hot_updater_cli_tools.p.log.error(`Failed to update Lambda configuration: ${error instanceof Error ? error.message : String(error)}`);
|
|
7083
6828
|
}
|
|
7084
6829
|
functionArn.arn = updateResp.FunctionArn || null;
|
|
7085
6830
|
functionArn.version = updateResp.Version || "1";
|
|
7086
6831
|
} else {
|
|
7087
|
-
if (error instanceof Error)
|
|
6832
|
+
if (error instanceof Error) _hot_updater_cli_tools.p.log.error(`Failed to create or update Lambda function: ${error.message}`);
|
|
7088
6833
|
throw error;
|
|
7089
6834
|
}
|
|
7090
6835
|
return `Updated Lambda "${lambdaName}" function`;
|
|
@@ -7109,14 +6854,13 @@ var LambdaEdgeDeployer = class {
|
|
|
7109
6854
|
]);
|
|
7110
6855
|
if (!functionArn.arn || !functionArn.version) throw new Error("Failed to create or update Lambda function");
|
|
7111
6856
|
if (!functionArn.arn.endsWith(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
|
|
7112
|
-
|
|
6857
|
+
_hot_updater_cli_tools.p.log.info(`Using Lambda ARN: ${functionArn.arn}`);
|
|
7113
6858
|
return {
|
|
7114
6859
|
lambdaName,
|
|
7115
6860
|
functionArn: functionArn.arn
|
|
7116
6861
|
};
|
|
7117
6862
|
}
|
|
7118
6863
|
};
|
|
7119
|
-
|
|
7120
6864
|
//#endregion
|
|
7121
6865
|
//#region iac/migrations/migrator.ts
|
|
7122
6866
|
/**
|
|
@@ -7132,7 +6876,7 @@ var S3Migration = class {
|
|
|
7132
6876
|
backupMapping = /* @__PURE__ */ new Map();
|
|
7133
6877
|
async doUpdateFile(key, content, { cacheControl } = {}) {
|
|
7134
6878
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
7135
|
-
await new
|
|
6879
|
+
await new _aws_sdk_lib_storage.Upload({
|
|
7136
6880
|
client: this.s3,
|
|
7137
6881
|
params: {
|
|
7138
6882
|
Bucket: this.bucketName,
|
|
@@ -7146,7 +6890,7 @@ var S3Migration = class {
|
|
|
7146
6890
|
const keys = [];
|
|
7147
6891
|
let continuationToken;
|
|
7148
6892
|
do {
|
|
7149
|
-
const command = new
|
|
6893
|
+
const command = new _aws_sdk_client_s3.ListObjectsV2Command({
|
|
7150
6894
|
Bucket: this.bucketName,
|
|
7151
6895
|
Prefix: prefix.startsWith("/") ? prefix.substring(1) : prefix,
|
|
7152
6896
|
ContinuationToken: continuationToken
|
|
@@ -7161,7 +6905,7 @@ var S3Migration = class {
|
|
|
7161
6905
|
}
|
|
7162
6906
|
async readFile(key) {
|
|
7163
6907
|
try {
|
|
7164
|
-
const command = new
|
|
6908
|
+
const command = new _aws_sdk_client_s3.GetObjectCommand({
|
|
7165
6909
|
Bucket: this.bucketName,
|
|
7166
6910
|
Key: key.startsWith("/") ? key.substring(1) : key
|
|
7167
6911
|
});
|
|
@@ -7169,7 +6913,7 @@ var S3Migration = class {
|
|
|
7169
6913
|
if (response.Body) return await response.Body.transformToString();
|
|
7170
6914
|
return null;
|
|
7171
6915
|
} catch (error) {
|
|
7172
|
-
console.error(
|
|
6916
|
+
console.error(_hot_updater_cli_tools.colors.red(`Error reading file ${key}:`), error);
|
|
7173
6917
|
return null;
|
|
7174
6918
|
}
|
|
7175
6919
|
}
|
|
@@ -7178,7 +6922,7 @@ var S3Migration = class {
|
|
|
7178
6922
|
if (content) try {
|
|
7179
6923
|
return JSON.parse(content);
|
|
7180
6924
|
} catch (e) {
|
|
7181
|
-
console.error(
|
|
6925
|
+
console.error(_hot_updater_cli_tools.colors.red(`Error parsing JSON from ${key}:`), e);
|
|
7182
6926
|
}
|
|
7183
6927
|
return null;
|
|
7184
6928
|
}
|
|
@@ -7194,55 +6938,55 @@ var S3Migration = class {
|
|
|
7194
6938
|
async updateFile(key, content, { cacheControl } = {}) {
|
|
7195
6939
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
7196
6940
|
if (this.dryRun) {
|
|
7197
|
-
console.log(
|
|
6941
|
+
console.log(_hot_updater_cli_tools.colors.yellow(`[DRY RUN] Updated ${_hot_updater_cli_tools.colors.bold(normalizedKey)}`));
|
|
7198
6942
|
return;
|
|
7199
6943
|
}
|
|
7200
6944
|
if (await this.readFile(key) !== null) await this.backupFile(key);
|
|
7201
6945
|
await this.doUpdateFile(normalizedKey, content, { cacheControl });
|
|
7202
|
-
console.log(
|
|
6946
|
+
console.log(_hot_updater_cli_tools.colors.green(`Updated ${_hot_updater_cli_tools.colors.bold(normalizedKey)}`));
|
|
7203
6947
|
}
|
|
7204
6948
|
async moveFile(from, to) {
|
|
7205
6949
|
if (this.dryRun) {
|
|
7206
|
-
console.log(
|
|
6950
|
+
console.log(_hot_updater_cli_tools.colors.yellow(`[DRY RUN] ${_hot_updater_cli_tools.colors.bold(from)} -> ${_hot_updater_cli_tools.colors.bold(to)}`));
|
|
7207
6951
|
return;
|
|
7208
6952
|
}
|
|
7209
6953
|
await this.backupFile(from);
|
|
7210
6954
|
try {
|
|
7211
|
-
const copyCommand = new
|
|
6955
|
+
const copyCommand = new _aws_sdk_client_s3.CopyObjectCommand({
|
|
7212
6956
|
Bucket: this.bucketName,
|
|
7213
6957
|
CopySource: `${this.bucketName}/${from}`,
|
|
7214
6958
|
Key: to
|
|
7215
6959
|
});
|
|
7216
6960
|
await this.s3.send(copyCommand);
|
|
7217
6961
|
} catch (error) {
|
|
7218
|
-
console.error(
|
|
6962
|
+
console.error(_hot_updater_cli_tools.colors.red(`Error copying file from ${from} to ${to}:`), error);
|
|
7219
6963
|
throw error;
|
|
7220
6964
|
}
|
|
7221
6965
|
try {
|
|
7222
|
-
const deleteCommand = new
|
|
6966
|
+
const deleteCommand = new _aws_sdk_client_s3.DeleteObjectCommand({
|
|
7223
6967
|
Bucket: this.bucketName,
|
|
7224
6968
|
Key: from
|
|
7225
6969
|
});
|
|
7226
6970
|
await this.s3.send(deleteCommand);
|
|
7227
6971
|
} catch (error) {
|
|
7228
|
-
if (error?.message?.includes("NoSuchKey")) console.warn(
|
|
6972
|
+
if (error?.message?.includes("NoSuchKey")) console.warn(_hot_updater_cli_tools.colors.yellow(`Key ${from} not found during deletion, ignoring.`));
|
|
7229
6973
|
else {
|
|
7230
|
-
console.error(
|
|
6974
|
+
console.error(_hot_updater_cli_tools.colors.red(`Error deleting file ${from}:`), error);
|
|
7231
6975
|
throw error;
|
|
7232
6976
|
}
|
|
7233
6977
|
}
|
|
7234
|
-
console.log(
|
|
6978
|
+
console.log(_hot_updater_cli_tools.colors.green(`${_hot_updater_cli_tools.colors.bold(from)} -> ${_hot_updater_cli_tools.colors.bold(to)}`));
|
|
7235
6979
|
}
|
|
7236
6980
|
async deleteBackupFile(backupKey) {
|
|
7237
6981
|
if (this.dryRun) return;
|
|
7238
6982
|
try {
|
|
7239
|
-
const deleteCommand = new
|
|
6983
|
+
const deleteCommand = new _aws_sdk_client_s3.DeleteObjectCommand({
|
|
7240
6984
|
Bucket: this.bucketName,
|
|
7241
6985
|
Key: backupKey
|
|
7242
6986
|
});
|
|
7243
6987
|
await this.s3.send(deleteCommand);
|
|
7244
6988
|
} catch (error) {
|
|
7245
|
-
console.error(
|
|
6989
|
+
console.error(_hot_updater_cli_tools.colors.red(`Error deleting backup file ${backupKey}:`), error);
|
|
7246
6990
|
}
|
|
7247
6991
|
}
|
|
7248
6992
|
async cleanupBackups() {
|
|
@@ -7251,15 +6995,15 @@ var S3Migration = class {
|
|
|
7251
6995
|
this.backupMapping.clear();
|
|
7252
6996
|
}
|
|
7253
6997
|
async rollback() {
|
|
7254
|
-
console.log(
|
|
6998
|
+
console.log(_hot_updater_cli_tools.colors.magenta(`Starting rollback for migration ${this.name}...`));
|
|
7255
6999
|
for (const [originalKey, backupKey] of this.backupMapping.entries()) {
|
|
7256
7000
|
const backupContent = await this.readFile(backupKey);
|
|
7257
7001
|
if (backupContent !== null) {
|
|
7258
|
-
console.log(
|
|
7002
|
+
console.log(_hot_updater_cli_tools.colors.blue(`Restoring backup for ${originalKey} from ${backupKey}`));
|
|
7259
7003
|
await this.doUpdateFile(originalKey, backupContent);
|
|
7260
|
-
} else console.error(
|
|
7004
|
+
} else console.error(_hot_updater_cli_tools.colors.red(`Failed to read backup for ${originalKey} at ${backupKey}`));
|
|
7261
7005
|
}
|
|
7262
|
-
console.log(
|
|
7006
|
+
console.log(_hot_updater_cli_tools.colors.green(`Rollback completed for migration ${this.name}.`));
|
|
7263
7007
|
}
|
|
7264
7008
|
};
|
|
7265
7009
|
/**
|
|
@@ -7279,7 +7023,7 @@ var S3Migrator = class {
|
|
|
7279
7023
|
}
|
|
7280
7024
|
async loadMigrationRecords() {
|
|
7281
7025
|
try {
|
|
7282
|
-
const command = new
|
|
7026
|
+
const command = new _aws_sdk_client_s3.GetObjectCommand({
|
|
7283
7027
|
Bucket: this.bucketName,
|
|
7284
7028
|
Key: this.migrationRecordKey
|
|
7285
7029
|
});
|
|
@@ -7289,7 +7033,7 @@ var S3Migrator = class {
|
|
|
7289
7033
|
try {
|
|
7290
7034
|
this.migrationRecords = JSON.parse(bodyContents);
|
|
7291
7035
|
} catch (jsonError) {
|
|
7292
|
-
console.error(
|
|
7036
|
+
console.error(_hot_updater_cli_tools.colors.red("Failed to parse migration records JSON:"), jsonError);
|
|
7293
7037
|
this.migrationRecords = [];
|
|
7294
7038
|
}
|
|
7295
7039
|
}
|
|
@@ -7301,7 +7045,7 @@ var S3Migrator = class {
|
|
|
7301
7045
|
async saveMigrationRecords(dryRun) {
|
|
7302
7046
|
if (dryRun) return;
|
|
7303
7047
|
const body = JSON.stringify(this.migrationRecords, null, 2);
|
|
7304
|
-
await new
|
|
7048
|
+
await new _aws_sdk_lib_storage.Upload({
|
|
7305
7049
|
client: this.s3,
|
|
7306
7050
|
params: {
|
|
7307
7051
|
Bucket: this.bucketName,
|
|
@@ -7327,7 +7071,7 @@ var S3Migrator = class {
|
|
|
7327
7071
|
await this.loadMigrationRecords();
|
|
7328
7072
|
for (const migration of this.migrations) {
|
|
7329
7073
|
if (this.migrationRecords.some((record) => record.name === migration.name)) continue;
|
|
7330
|
-
console.log(
|
|
7074
|
+
console.log(_hot_updater_cli_tools.colors.magenta(`Applying migration ${migration.name}...`));
|
|
7331
7075
|
migration.s3 = this.s3;
|
|
7332
7076
|
migration.bucketName = this.bucketName;
|
|
7333
7077
|
migration.dryRun = dryRun;
|
|
@@ -7338,20 +7082,19 @@ var S3Migrator = class {
|
|
|
7338
7082
|
name: migration.name,
|
|
7339
7083
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
7340
7084
|
});
|
|
7341
|
-
console.log(
|
|
7085
|
+
console.log(_hot_updater_cli_tools.colors.green(`${_hot_updater_cli_tools.colors.bold(migration.name)} applied successfully.`));
|
|
7342
7086
|
await migration.cleanupBackups();
|
|
7343
|
-
} else console.log(
|
|
7087
|
+
} else console.log(_hot_updater_cli_tools.colors.yellow(`[DRY RUN] ${_hot_updater_cli_tools.colors.bold(migration.name)} applied successfully`));
|
|
7344
7088
|
} catch (error) {
|
|
7345
|
-
console.error(
|
|
7089
|
+
console.error(_hot_updater_cli_tools.colors.red(`Migration ${migration.name} failed. Initiating rollback...`), error);
|
|
7346
7090
|
await migration.rollback();
|
|
7347
7091
|
throw error;
|
|
7348
7092
|
}
|
|
7349
7093
|
}
|
|
7350
7094
|
await this.saveMigrationRecords(dryRun);
|
|
7351
|
-
if (!dryRun) console.log(
|
|
7095
|
+
if (!dryRun) console.log(_hot_updater_cli_tools.colors.blue("All migrations applied."));
|
|
7352
7096
|
}
|
|
7353
7097
|
};
|
|
7354
|
-
|
|
7355
7098
|
//#endregion
|
|
7356
7099
|
//#region iac/migrations/Migration0001HotUpdater0_13_0.ts
|
|
7357
7100
|
/**
|
|
@@ -7377,7 +7120,6 @@ var Migration0001HotUpdater0_13_0 = class extends S3Migration {
|
|
|
7377
7120
|
}
|
|
7378
7121
|
}
|
|
7379
7122
|
};
|
|
7380
|
-
|
|
7381
7123
|
//#endregion
|
|
7382
7124
|
//#region iac/migrations/Migration0001HotUpdater0_18_0.ts
|
|
7383
7125
|
/**
|
|
@@ -7400,7 +7142,6 @@ var Migration0001HotUpdater0_18_0 = class extends S3Migration {
|
|
|
7400
7142
|
}
|
|
7401
7143
|
}
|
|
7402
7144
|
};
|
|
7403
|
-
|
|
7404
7145
|
//#endregion
|
|
7405
7146
|
//#region iac/regionLocationMap.ts
|
|
7406
7147
|
const regionLocationMap = {
|
|
@@ -7438,7 +7179,6 @@ const regionLocationMap = {
|
|
|
7438
7179
|
"us-west-2": "Oregon, USA",
|
|
7439
7180
|
"eu-central-2": "Zurich, Switzerland"
|
|
7440
7181
|
};
|
|
7441
|
-
|
|
7442
7182
|
//#endregion
|
|
7443
7183
|
//#region iac/s3.ts
|
|
7444
7184
|
var S3Manager = class {
|
|
@@ -7447,7 +7187,7 @@ var S3Manager = class {
|
|
|
7447
7187
|
this.credentials = credentials;
|
|
7448
7188
|
}
|
|
7449
7189
|
async listBuckets() {
|
|
7450
|
-
const s3Client = new
|
|
7190
|
+
const s3Client = new _aws_sdk_client_s3.S3({
|
|
7451
7191
|
region: "us-east-1",
|
|
7452
7192
|
credentials: this.credentials
|
|
7453
7193
|
});
|
|
@@ -7461,18 +7201,18 @@ var S3Manager = class {
|
|
|
7461
7201
|
}));
|
|
7462
7202
|
}
|
|
7463
7203
|
async createBucket(bucketName, region) {
|
|
7464
|
-
await new
|
|
7204
|
+
await new _aws_sdk_client_s3.S3({
|
|
7465
7205
|
region,
|
|
7466
7206
|
credentials: this.credentials
|
|
7467
7207
|
}).createBucket({
|
|
7468
7208
|
Bucket: bucketName,
|
|
7469
7209
|
...region === "us-east-1" ? {} : { CreateBucketConfiguration: { LocationConstraint: region } }
|
|
7470
7210
|
});
|
|
7471
|
-
|
|
7211
|
+
_hot_updater_cli_tools.p.log.info(`Created S3 bucket: ${bucketName}`);
|
|
7472
7212
|
}
|
|
7473
7213
|
async runMigrations({ bucketName, region, migrations }) {
|
|
7474
7214
|
const migrator = new S3Migrator({
|
|
7475
|
-
s3: new
|
|
7215
|
+
s3: new _aws_sdk_client_s3.S3({
|
|
7476
7216
|
region,
|
|
7477
7217
|
credentials: this.credentials
|
|
7478
7218
|
}),
|
|
@@ -7482,18 +7222,18 @@ var S3Manager = class {
|
|
|
7482
7222
|
const { pending } = await migrator.list();
|
|
7483
7223
|
await migrator.migrate({ dryRun: true });
|
|
7484
7224
|
if (pending.length > 0) {
|
|
7485
|
-
|
|
7486
|
-
for (const m of pending)
|
|
7225
|
+
_hot_updater_cli_tools.p.log.step("Pending migrations:");
|
|
7226
|
+
for (const m of pending) _hot_updater_cli_tools.p.log.step(`- ${m.name}`);
|
|
7487
7227
|
}
|
|
7488
|
-
const confirm = await
|
|
7489
|
-
if (
|
|
7490
|
-
|
|
7228
|
+
const confirm = await _hot_updater_cli_tools.p.confirm({ message: "Do you want to continue?" });
|
|
7229
|
+
if (_hot_updater_cli_tools.p.isCancel(confirm) || !confirm) {
|
|
7230
|
+
_hot_updater_cli_tools.p.log.info("Migration cancelled.");
|
|
7491
7231
|
process.exit(1);
|
|
7492
7232
|
}
|
|
7493
7233
|
await migrator.migrate({ dryRun: false });
|
|
7494
7234
|
}
|
|
7495
7235
|
async updateBucketPolicy({ bucketName, region, distributionId, accountId }) {
|
|
7496
|
-
const s3Client = new
|
|
7236
|
+
const s3Client = new _aws_sdk_client_s3.S3({
|
|
7497
7237
|
region,
|
|
7498
7238
|
credentials: this.credentials
|
|
7499
7239
|
});
|
|
@@ -7513,10 +7253,9 @@ var S3Manager = class {
|
|
|
7513
7253
|
Bucket: bucketName,
|
|
7514
7254
|
Policy: JSON.stringify(bucketPolicy)
|
|
7515
7255
|
});
|
|
7516
|
-
|
|
7256
|
+
_hot_updater_cli_tools.p.log.success("S3 bucket policy updated to allow access from CloudFront distribution");
|
|
7517
7257
|
}
|
|
7518
7258
|
};
|
|
7519
|
-
|
|
7520
7259
|
//#endregion
|
|
7521
7260
|
//#region iac/ssm.ts
|
|
7522
7261
|
var SSMKeyPairManager = class {
|
|
@@ -7527,7 +7266,7 @@ var SSMKeyPairManager = class {
|
|
|
7527
7266
|
this.credentials = credentials;
|
|
7528
7267
|
}
|
|
7529
7268
|
async getParameter(name) {
|
|
7530
|
-
const ssm = new
|
|
7269
|
+
const ssm = new _aws_sdk_client_ssm.SSM({
|
|
7531
7270
|
region: this.region,
|
|
7532
7271
|
credentials: this.credentials
|
|
7533
7272
|
});
|
|
@@ -7538,12 +7277,12 @@ var SSMKeyPairManager = class {
|
|
|
7538
7277
|
});
|
|
7539
7278
|
return Parameter?.Value || null;
|
|
7540
7279
|
} catch (error) {
|
|
7541
|
-
if (error instanceof
|
|
7280
|
+
if (error instanceof _aws_sdk_client_ssm.ParameterNotFound) return null;
|
|
7542
7281
|
throw error;
|
|
7543
7282
|
}
|
|
7544
7283
|
}
|
|
7545
7284
|
async putParameter(name, value) {
|
|
7546
|
-
await new
|
|
7285
|
+
await new _aws_sdk_client_ssm.SSM({
|
|
7547
7286
|
region: this.region,
|
|
7548
7287
|
credentials: this.credentials
|
|
7549
7288
|
}).putParameter({
|
|
@@ -7556,9 +7295,9 @@ var SSMKeyPairManager = class {
|
|
|
7556
7295
|
async getOrCreateKeyPair(parameterName) {
|
|
7557
7296
|
const existing = await this.getParameter(parameterName);
|
|
7558
7297
|
if (existing) {
|
|
7559
|
-
const keyPair
|
|
7560
|
-
|
|
7561
|
-
return keyPair
|
|
7298
|
+
const keyPair = JSON.parse(existing);
|
|
7299
|
+
_hot_updater_cli_tools.p.log.info("Using existing CloudFront key pair from SSM Parameter Store");
|
|
7300
|
+
return keyPair;
|
|
7562
7301
|
}
|
|
7563
7302
|
const { publicKey, privateKey } = crypto.default.generateKeyPairSync("rsa", {
|
|
7564
7303
|
modulusLength: 2048,
|
|
@@ -7577,11 +7316,10 @@ var SSMKeyPairManager = class {
|
|
|
7577
7316
|
privateKey
|
|
7578
7317
|
};
|
|
7579
7318
|
await this.putParameter(parameterName, JSON.stringify(keyPair));
|
|
7580
|
-
|
|
7319
|
+
_hot_updater_cli_tools.p.log.success("Created and stored new CloudFront key pair in SSM Parameter Store");
|
|
7581
7320
|
return keyPair;
|
|
7582
7321
|
}
|
|
7583
7322
|
};
|
|
7584
|
-
|
|
7585
7323
|
//#endregion
|
|
7586
7324
|
//#region iac/templates.ts
|
|
7587
7325
|
const getConfigTemplate = (build, { profile }) => {
|
|
@@ -7618,7 +7356,7 @@ const commonOptions = {
|
|
|
7618
7356
|
secretAccessKey: process.env.HOT_UPDATER_S3_SECRET_ACCESS_KEY!,
|
|
7619
7357
|
},
|
|
7620
7358
|
};`.trim();
|
|
7621
|
-
const builder = new
|
|
7359
|
+
const builder = new _hot_updater_cli_tools.ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig);
|
|
7622
7360
|
if (profile) builder.addImport({
|
|
7623
7361
|
pkg: "@aws-sdk/credential-provider-sso",
|
|
7624
7362
|
named: ["fromSSO"]
|
|
@@ -7637,7 +7375,6 @@ export default HotUpdater.wrap({
|
|
|
7637
7375
|
updateStrategy: "appVersion", // or "fingerprint"
|
|
7638
7376
|
updateMode: "auto",
|
|
7639
7377
|
})(App);`;
|
|
7640
|
-
|
|
7641
7378
|
//#endregion
|
|
7642
7379
|
//#region iac/index.ts
|
|
7643
7380
|
const checkIfAwsCliInstalled = async () => {
|
|
@@ -7650,11 +7387,11 @@ const checkIfAwsCliInstalled = async () => {
|
|
|
7650
7387
|
};
|
|
7651
7388
|
const runInit = async ({ build }) => {
|
|
7652
7389
|
if (!await checkIfAwsCliInstalled()) {
|
|
7653
|
-
|
|
7390
|
+
_hot_updater_cli_tools.p.log.error(`AWS CLI is not installed. Please visit ${(0, _hot_updater_cli_tools.link)("https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")} for installation instructions`);
|
|
7654
7391
|
process.exit(1);
|
|
7655
7392
|
}
|
|
7656
7393
|
let credentials;
|
|
7657
|
-
const mode = await
|
|
7394
|
+
const mode = await _hot_updater_cli_tools.p.select({
|
|
7658
7395
|
message: "Select the mode to login to AWS",
|
|
7659
7396
|
options: [{
|
|
7660
7397
|
label: "AWS SSO Login",
|
|
@@ -7664,21 +7401,21 @@ const runInit = async ({ build }) => {
|
|
|
7664
7401
|
value: "account"
|
|
7665
7402
|
}]
|
|
7666
7403
|
});
|
|
7667
|
-
if (
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7404
|
+
if (_hot_updater_cli_tools.p.isCancel(mode)) process.exit(1);
|
|
7405
|
+
_hot_updater_cli_tools.p.log.message(_hot_updater_cli_tools.colors.blue("The following permissions are required:"));
|
|
7406
|
+
_hot_updater_cli_tools.p.log.message(`${_hot_updater_cli_tools.colors.blue("AmazonS3FullAccess")}: Create and read S3 buckets`);
|
|
7407
|
+
_hot_updater_cli_tools.p.log.message(`${_hot_updater_cli_tools.colors.blue("AWSLambda_FullAccess")}: Create and update Lambda functions`);
|
|
7408
|
+
_hot_updater_cli_tools.p.log.message(`${_hot_updater_cli_tools.colors.blue("CloudFrontFullAccess")}: Create and update CloudFront distributions`);
|
|
7409
|
+
_hot_updater_cli_tools.p.log.message(`${_hot_updater_cli_tools.colors.blue("IAMFullAccess")}: Get or create IAM roles for Lambda@Edge`);
|
|
7410
|
+
_hot_updater_cli_tools.p.log.message(`${_hot_updater_cli_tools.colors.blue("AmazonSSMFullAccess")}: Access to SSM Parameters for storing CloudFront key pairs`);
|
|
7674
7411
|
let ssoProfile = null;
|
|
7675
7412
|
if (mode === "sso") try {
|
|
7676
|
-
const profile = await
|
|
7413
|
+
const profile = await _hot_updater_cli_tools.p.text({
|
|
7677
7414
|
message: "Enter the SSO profile name",
|
|
7678
7415
|
defaultValue: "default",
|
|
7679
7416
|
placeholder: "default"
|
|
7680
7417
|
});
|
|
7681
|
-
if (
|
|
7418
|
+
if (_hot_updater_cli_tools.p.isCancel(profile)) process.exit(1);
|
|
7682
7419
|
ssoProfile = profile;
|
|
7683
7420
|
await execa("aws", [
|
|
7684
7421
|
"sso",
|
|
@@ -7689,47 +7426,47 @@ const runInit = async ({ build }) => {
|
|
|
7689
7426
|
stdio: "inherit",
|
|
7690
7427
|
shell: true
|
|
7691
7428
|
});
|
|
7692
|
-
credentials = await (0,
|
|
7429
|
+
credentials = await (0, _aws_sdk_credential_providers.fromSSO)({ profile })();
|
|
7693
7430
|
} catch (error) {
|
|
7694
|
-
if (error instanceof ExecaError)
|
|
7431
|
+
if (error instanceof ExecaError) _hot_updater_cli_tools.p.log.error(error.stdout || error.stderr || error.message);
|
|
7695
7432
|
process.exit(1);
|
|
7696
7433
|
}
|
|
7697
7434
|
else {
|
|
7698
|
-
const creds = await
|
|
7699
|
-
accessKeyId: () =>
|
|
7435
|
+
const creds = await _hot_updater_cli_tools.p.group({
|
|
7436
|
+
accessKeyId: () => _hot_updater_cli_tools.p.text({
|
|
7700
7437
|
message: "Enter your AWS Access Key ID",
|
|
7701
7438
|
validate: (value) => value ? void 0 : "Access Key ID is required"
|
|
7702
7439
|
}),
|
|
7703
|
-
secretAccessKey: () =>
|
|
7440
|
+
secretAccessKey: () => _hot_updater_cli_tools.p.password({
|
|
7704
7441
|
message: "Enter your AWS Secret Access Key",
|
|
7705
7442
|
validate: (value) => value ? void 0 : "Secret Access Key is required"
|
|
7706
7443
|
})
|
|
7707
7444
|
});
|
|
7708
|
-
if (
|
|
7445
|
+
if (_hot_updater_cli_tools.p.isCancel(creds)) process.exit(1);
|
|
7709
7446
|
credentials = {
|
|
7710
7447
|
accessKeyId: creds.accessKeyId,
|
|
7711
7448
|
secretAccessKey: creds.secretAccessKey
|
|
7712
7449
|
};
|
|
7713
7450
|
}
|
|
7714
7451
|
if (!credentials) {
|
|
7715
|
-
|
|
7452
|
+
_hot_updater_cli_tools.p.log.error("Couldn't fetch the credentials.");
|
|
7716
7453
|
process.exit(1);
|
|
7717
7454
|
}
|
|
7718
7455
|
const s3Manager = new S3Manager(credentials);
|
|
7719
7456
|
let availableBuckets = [];
|
|
7720
7457
|
try {
|
|
7721
|
-
await
|
|
7458
|
+
await _hot_updater_cli_tools.p.tasks([{
|
|
7722
7459
|
title: "Checking S3 Buckets...",
|
|
7723
7460
|
task: async () => {
|
|
7724
7461
|
availableBuckets = await s3Manager.listBuckets();
|
|
7725
7462
|
}
|
|
7726
7463
|
}]);
|
|
7727
7464
|
} catch (e) {
|
|
7728
|
-
if (e instanceof Error)
|
|
7465
|
+
if (e instanceof Error) _hot_updater_cli_tools.p.log.error(e.message);
|
|
7729
7466
|
throw e;
|
|
7730
7467
|
}
|
|
7731
7468
|
const createKey = `create/${Math.random().toString(36).substring(2, 15)}`;
|
|
7732
|
-
let bucketName = await
|
|
7469
|
+
let bucketName = await _hot_updater_cli_tools.p.select({
|
|
7733
7470
|
message: "S3 Bucket List",
|
|
7734
7471
|
options: [...availableBuckets.map((bucket) => ({
|
|
7735
7472
|
value: bucket.name,
|
|
@@ -7739,32 +7476,32 @@ const runInit = async ({ build }) => {
|
|
|
7739
7476
|
label: "Create New S3 Bucket"
|
|
7740
7477
|
}]
|
|
7741
7478
|
});
|
|
7742
|
-
if (
|
|
7479
|
+
if (_hot_updater_cli_tools.p.isCancel(bucketName)) process.exit(1);
|
|
7743
7480
|
let bucketRegion = availableBuckets.find((bucket) => bucket.name === bucketName)?.region;
|
|
7744
7481
|
if (bucketName === createKey) {
|
|
7745
|
-
const name = await
|
|
7482
|
+
const name = await _hot_updater_cli_tools.p.text({
|
|
7746
7483
|
message: "Enter the name of the new S3 Bucket",
|
|
7747
7484
|
defaultValue: "hot-updater-storage",
|
|
7748
7485
|
placeholder: "hot-updater-storage"
|
|
7749
7486
|
});
|
|
7750
|
-
if (
|
|
7487
|
+
if (_hot_updater_cli_tools.p.isCancel(name)) process.exit(1);
|
|
7751
7488
|
bucketName = name;
|
|
7752
|
-
const selectedRegion = await
|
|
7489
|
+
const selectedRegion = await _hot_updater_cli_tools.p.select({
|
|
7753
7490
|
message: "Enter AWS region for the S3 bucket",
|
|
7754
7491
|
options: Object.entries(regionLocationMap).map(([region, location]) => ({
|
|
7755
7492
|
label: `${region} (${location})`,
|
|
7756
7493
|
value: region
|
|
7757
7494
|
}))
|
|
7758
7495
|
});
|
|
7759
|
-
if (
|
|
7496
|
+
if (_hot_updater_cli_tools.p.isCancel(selectedRegion)) process.exit(1);
|
|
7760
7497
|
bucketRegion = selectedRegion;
|
|
7761
7498
|
await s3Manager.createBucket(bucketName, bucketRegion);
|
|
7762
7499
|
}
|
|
7763
7500
|
if (!bucketRegion) {
|
|
7764
|
-
|
|
7501
|
+
_hot_updater_cli_tools.p.log.error("Failed to get S3 bucket region");
|
|
7765
7502
|
process.exit(1);
|
|
7766
7503
|
}
|
|
7767
|
-
|
|
7504
|
+
_hot_updater_cli_tools.p.log.info(`Selected S3 Bucket: ${bucketName} (${bucketRegion})`);
|
|
7768
7505
|
await s3Manager.runMigrations({
|
|
7769
7506
|
bucketName,
|
|
7770
7507
|
region: bucketRegion,
|
|
@@ -7795,7 +7532,7 @@ const runInit = async ({ build }) => {
|
|
|
7795
7532
|
accountId
|
|
7796
7533
|
});
|
|
7797
7534
|
await fs.default.promises.writeFile("hot-updater.config.ts", getConfigTemplate(build, { profile: ssoProfile }));
|
|
7798
|
-
await (0,
|
|
7535
|
+
await (0, _hot_updater_cli_tools.makeEnv)({
|
|
7799
7536
|
HOT_UPDATER_S3_BUCKET_NAME: bucketName,
|
|
7800
7537
|
HOT_UPDATER_S3_REGION: bucketRegion,
|
|
7801
7538
|
...mode === "account" ? {
|
|
@@ -7811,14 +7548,13 @@ const runInit = async ({ build }) => {
|
|
|
7811
7548
|
...ssoProfile !== null ? { HOT_UPDATER_AWS_PROFILE: ssoProfile } : {},
|
|
7812
7549
|
HOT_UPDATER_CLOUDFRONT_DISTRIBUTION_ID: distributionId
|
|
7813
7550
|
});
|
|
7814
|
-
if (mode === "sso") await (0,
|
|
7815
|
-
|
|
7816
|
-
|
|
7551
|
+
if (mode === "sso") await (0, _hot_updater_cli_tools.ensureInstallPackages)({ devDependencies: ["@aws-sdk/credential-provider-sso"] });
|
|
7552
|
+
_hot_updater_cli_tools.p.log.success("Generated '.env.hotupdater' file with AWS settings.");
|
|
7553
|
+
_hot_updater_cli_tools.p.log.success("Generated 'hot-updater.config.ts' file with AWS settings.");
|
|
7817
7554
|
const sourceUrl = `https://${distributionDomain}/api/check-update`;
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7555
|
+
_hot_updater_cli_tools.p.note((0, _hot_updater_cli_tools.transformTemplate)(SOURCE_TEMPLATE, { source: sourceUrl }));
|
|
7556
|
+
_hot_updater_cli_tools.p.log.message(`Next step: ${(0, _hot_updater_cli_tools.link)("https://hot-updater.dev/docs/managed/aws#step-4-changeenv-file-optional")}`);
|
|
7557
|
+
_hot_updater_cli_tools.p.log.success("Done! 🎉");
|
|
7821
7558
|
};
|
|
7822
|
-
|
|
7823
7559
|
//#endregion
|
|
7824
|
-
exports.runInit = runInit;
|
|
7560
|
+
exports.runInit = runInit;
|