storybook 10.1.0-alpha.12 → 10.1.0-alpha.14
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/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
- package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
- package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
- package/dist/_browser-chunks/{chunk-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
- package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
- package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
- package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-FQ5J6V3U.js} +32 -22
- package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-VGUYV77Z.js} +8 -8
- package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-2JR3QBT2.js} +7 -7
- package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
- package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-4ZFHN3ZY.js} +6 -6
- package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-63PL4NNE.js} +1104 -13
- package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-A4KENTXT.js} +7 -7
- package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-ALIA3J6S.js} +44 -10
- package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-C2HKH2XQ.js} +5710 -2414
- package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-DQNBAQYT.js} +6 -6
- package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-F74UHHR6.js} +7 -7
- package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-H5XWXVWR.js} +6 -6
- package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-JMP7YFX2.js} +6 -6
- package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-JZR4DHG2.js} +19 -7
- package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-KEA7CVMZ.js} +122 -32
- package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-KF3WTAEP.js} +7 -7
- package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-LPPM7L5D.js} +51 -71
- package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-MJUDR7HQ.js} +7 -7
- package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
- package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
- package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-Q2QUNQK6.js} +7 -7
- package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-TMCKISJR.js} +101 -118
- package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
- package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-V7CXWJXC.js} +7 -7
- package/dist/_node-chunks/chunk-W4F3T6CY.js +3781 -0
- package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-WACDSFMO.js} +9 -9
- package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-WVXZFQQU.js} +14 -8
- package/dist/_node-chunks/chunk-XBPE4PT7.js +78 -0
- package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
- package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-ZGZKNZ5S.js} +6 -6
- package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-DR3AP3RJ.js} +9 -9
- package/dist/_node-chunks/{globby-6THB7HVX.js → globby-D4FPSHY2.js} +9 -9
- package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-ZEFOVNTK.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
- package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-CYQOFYPV.js} +7 -7
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +33 -26
- package/dist/bin/dispatcher.js +31 -20
- package/dist/bin/loader.js +10 -13
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -5159
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +136 -26
- package/dist/components/index.js +3163 -2859
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +112 -1486
- package/dist/core-server/presets/common-manager.js +5 -5
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +272 -81
- package/dist/csf/index.js +2 -2
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +21557 -21133
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +6695 -720
- package/dist/manager-api/index.d.ts +1802 -1
- package/dist/manager-api/index.js +105 -11
- package/dist/manager-errors.d.ts +6 -0
- package/dist/manager-errors.js +2 -2
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -3148
- package/dist/preview/runtime.js +35 -3
- package/dist/preview-api/index.d.ts +69 -68
- package/dist/preview-api/index.js +2 -2
- package/dist/preview-errors.d.ts +6 -0
- package/dist/preview-errors.js +2 -2
- package/dist/server-errors.d.ts +31 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/types/index.d.ts +71 -8
- package/dist/types/index.js +25 -1
- package/package.json +11 -9
- package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
- package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
- package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
- package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
- package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
- package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
- package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
- package/dist/_node-chunks/chunk-QYQIZBS6.js +0 -26
- package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
- package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
- package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
- package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
- package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
- package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
|
@@ -1,3171 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
any,
|
|
14
|
-
up,
|
|
15
|
-
up2
|
|
16
|
-
} from "./chunk-DWXTZT3D.js";
|
|
17
|
-
import {
|
|
18
|
-
__commonJS,
|
|
19
|
-
__require,
|
|
20
|
-
__toESM
|
|
21
|
-
} from "./chunk-OP3INKUD.js";
|
|
22
|
-
|
|
23
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
|
|
24
|
-
var require_constants = __commonJS({
|
|
25
|
-
"../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
26
|
-
"use strict";
|
|
27
|
-
var WIN_NO_SLASH = "[^\\\\/]", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOT = "(?!\\.)", NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = "[^.\\/]", STAR = `${QMARK}*?`, SEP = "/", POSIX_CHARS = {
|
|
28
|
-
DOT_LITERAL: "\\.",
|
|
29
|
-
PLUS_LITERAL: "\\+",
|
|
30
|
-
QMARK_LITERAL: "\\?",
|
|
31
|
-
SLASH_LITERAL: "\\/",
|
|
32
|
-
ONE_CHAR,
|
|
33
|
-
QMARK,
|
|
34
|
-
END_ANCHOR,
|
|
35
|
-
DOTS_SLASH,
|
|
36
|
-
NO_DOT,
|
|
37
|
-
NO_DOTS,
|
|
38
|
-
NO_DOT_SLASH,
|
|
39
|
-
NO_DOTS_SLASH,
|
|
40
|
-
QMARK_NO_DOT,
|
|
41
|
-
STAR,
|
|
42
|
-
START_ANCHOR,
|
|
43
|
-
SEP
|
|
44
|
-
}, WINDOWS_CHARS = {
|
|
45
|
-
...POSIX_CHARS,
|
|
46
|
-
SLASH_LITERAL: "[\\\\/]",
|
|
47
|
-
QMARK: WIN_NO_SLASH,
|
|
48
|
-
STAR: `${WIN_NO_SLASH}*?`,
|
|
49
|
-
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
|
50
|
-
NO_DOT: "(?!\\.)",
|
|
51
|
-
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
|
52
|
-
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
|
53
|
-
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
|
54
|
-
QMARK_NO_DOT: "[^.\\\\/]",
|
|
55
|
-
START_ANCHOR: "(?:^|[\\\\/])",
|
|
56
|
-
END_ANCHOR: "(?:[\\\\/]|$)",
|
|
57
|
-
SEP: "\\"
|
|
58
|
-
}, POSIX_REGEX_SOURCE = {
|
|
59
|
-
alnum: "a-zA-Z0-9",
|
|
60
|
-
alpha: "a-zA-Z",
|
|
61
|
-
ascii: "\\x00-\\x7F",
|
|
62
|
-
blank: " \\t",
|
|
63
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
64
|
-
digit: "0-9",
|
|
65
|
-
graph: "\\x21-\\x7E",
|
|
66
|
-
lower: "a-z",
|
|
67
|
-
print: "\\x20-\\x7E ",
|
|
68
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
69
|
-
space: " \\t\\r\\n\\v\\f",
|
|
70
|
-
upper: "A-Z",
|
|
71
|
-
word: "A-Za-z0-9_",
|
|
72
|
-
xdigit: "A-Fa-f0-9"
|
|
73
|
-
};
|
|
74
|
-
module.exports = {
|
|
75
|
-
MAX_LENGTH: 1024 * 64,
|
|
76
|
-
POSIX_REGEX_SOURCE,
|
|
77
|
-
// regular expressions
|
|
78
|
-
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
79
|
-
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
80
|
-
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
81
|
-
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
82
|
-
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
83
|
-
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
84
|
-
// Replace globs with equivalent patterns to reduce parsing time.
|
|
85
|
-
REPLACEMENTS: {
|
|
86
|
-
__proto__: null,
|
|
87
|
-
"***": "*",
|
|
88
|
-
"**/**": "**",
|
|
89
|
-
"**/**/**": "**"
|
|
90
|
-
},
|
|
91
|
-
// Digits
|
|
92
|
-
CHAR_0: 48,
|
|
93
|
-
/* 0 */
|
|
94
|
-
CHAR_9: 57,
|
|
95
|
-
/* 9 */
|
|
96
|
-
// Alphabet chars.
|
|
97
|
-
CHAR_UPPERCASE_A: 65,
|
|
98
|
-
/* A */
|
|
99
|
-
CHAR_LOWERCASE_A: 97,
|
|
100
|
-
/* a */
|
|
101
|
-
CHAR_UPPERCASE_Z: 90,
|
|
102
|
-
/* Z */
|
|
103
|
-
CHAR_LOWERCASE_Z: 122,
|
|
104
|
-
/* z */
|
|
105
|
-
CHAR_LEFT_PARENTHESES: 40,
|
|
106
|
-
/* ( */
|
|
107
|
-
CHAR_RIGHT_PARENTHESES: 41,
|
|
108
|
-
/* ) */
|
|
109
|
-
CHAR_ASTERISK: 42,
|
|
110
|
-
/* * */
|
|
111
|
-
// Non-alphabetic chars.
|
|
112
|
-
CHAR_AMPERSAND: 38,
|
|
113
|
-
/* & */
|
|
114
|
-
CHAR_AT: 64,
|
|
115
|
-
/* @ */
|
|
116
|
-
CHAR_BACKWARD_SLASH: 92,
|
|
117
|
-
/* \ */
|
|
118
|
-
CHAR_CARRIAGE_RETURN: 13,
|
|
119
|
-
/* \r */
|
|
120
|
-
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
121
|
-
/* ^ */
|
|
122
|
-
CHAR_COLON: 58,
|
|
123
|
-
/* : */
|
|
124
|
-
CHAR_COMMA: 44,
|
|
125
|
-
/* , */
|
|
126
|
-
CHAR_DOT: 46,
|
|
127
|
-
/* . */
|
|
128
|
-
CHAR_DOUBLE_QUOTE: 34,
|
|
129
|
-
/* " */
|
|
130
|
-
CHAR_EQUAL: 61,
|
|
131
|
-
/* = */
|
|
132
|
-
CHAR_EXCLAMATION_MARK: 33,
|
|
133
|
-
/* ! */
|
|
134
|
-
CHAR_FORM_FEED: 12,
|
|
135
|
-
/* \f */
|
|
136
|
-
CHAR_FORWARD_SLASH: 47,
|
|
137
|
-
/* / */
|
|
138
|
-
CHAR_GRAVE_ACCENT: 96,
|
|
139
|
-
/* ` */
|
|
140
|
-
CHAR_HASH: 35,
|
|
141
|
-
/* # */
|
|
142
|
-
CHAR_HYPHEN_MINUS: 45,
|
|
143
|
-
/* - */
|
|
144
|
-
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
145
|
-
/* < */
|
|
146
|
-
CHAR_LEFT_CURLY_BRACE: 123,
|
|
147
|
-
/* { */
|
|
148
|
-
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
149
|
-
/* [ */
|
|
150
|
-
CHAR_LINE_FEED: 10,
|
|
151
|
-
/* \n */
|
|
152
|
-
CHAR_NO_BREAK_SPACE: 160,
|
|
153
|
-
/* \u00A0 */
|
|
154
|
-
CHAR_PERCENT: 37,
|
|
155
|
-
/* % */
|
|
156
|
-
CHAR_PLUS: 43,
|
|
157
|
-
/* + */
|
|
158
|
-
CHAR_QUESTION_MARK: 63,
|
|
159
|
-
/* ? */
|
|
160
|
-
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
161
|
-
/* > */
|
|
162
|
-
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
163
|
-
/* } */
|
|
164
|
-
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
165
|
-
/* ] */
|
|
166
|
-
CHAR_SEMICOLON: 59,
|
|
167
|
-
/* ; */
|
|
168
|
-
CHAR_SINGLE_QUOTE: 39,
|
|
169
|
-
/* ' */
|
|
170
|
-
CHAR_SPACE: 32,
|
|
171
|
-
/* */
|
|
172
|
-
CHAR_TAB: 9,
|
|
173
|
-
/* \t */
|
|
174
|
-
CHAR_UNDERSCORE: 95,
|
|
175
|
-
/* _ */
|
|
176
|
-
CHAR_VERTICAL_LINE: 124,
|
|
177
|
-
/* | */
|
|
178
|
-
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
179
|
-
/* \uFEFF */
|
|
180
|
-
/**
|
|
181
|
-
* Create EXTGLOB_CHARS
|
|
182
|
-
*/
|
|
183
|
-
extglobChars(chars) {
|
|
184
|
-
return {
|
|
185
|
-
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
186
|
-
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
187
|
-
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
188
|
-
"*": { type: "star", open: "(?:", close: ")*" },
|
|
189
|
-
"@": { type: "at", open: "(?:", close: ")" }
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
/**
|
|
193
|
-
* Create GLOB_CHARS
|
|
194
|
-
*/
|
|
195
|
-
globChars(win32) {
|
|
196
|
-
return win32 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
|
|
203
|
-
var require_utils = __commonJS({
|
|
204
|
-
"../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports) {
|
|
205
|
-
"use strict";
|
|
206
|
-
var {
|
|
207
|
-
REGEX_BACKSLASH,
|
|
208
|
-
REGEX_REMOVE_BACKSLASH,
|
|
209
|
-
REGEX_SPECIAL_CHARS,
|
|
210
|
-
REGEX_SPECIAL_CHARS_GLOBAL
|
|
211
|
-
} = require_constants();
|
|
212
|
-
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
|
|
213
|
-
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
214
|
-
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
215
|
-
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
216
|
-
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
217
|
-
exports.isWindows = () => {
|
|
218
|
-
if (typeof navigator < "u" && navigator.platform) {
|
|
219
|
-
let platform = navigator.platform.toLowerCase();
|
|
220
|
-
return platform === "win32" || platform === "windows";
|
|
221
|
-
}
|
|
222
|
-
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
|
223
|
-
};
|
|
224
|
-
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
|
|
225
|
-
exports.escapeLast = (input, char, lastIdx) => {
|
|
226
|
-
let idx = input.lastIndexOf(char, lastIdx);
|
|
227
|
-
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
228
|
-
};
|
|
229
|
-
exports.removePrefix = (input, state = {}) => {
|
|
230
|
-
let output = input;
|
|
231
|
-
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
|
|
232
|
-
};
|
|
233
|
-
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
234
|
-
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
|
|
235
|
-
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
|
|
236
|
-
};
|
|
237
|
-
exports.basename = (path4, { windows } = {}) => {
|
|
238
|
-
let segs = path4.split(windows ? /[\\/]/ : "/"), last = segs[segs.length - 1];
|
|
239
|
-
return last === "" ? segs[segs.length - 2] : last;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js
|
|
245
|
-
var require_scan = __commonJS({
|
|
246
|
-
"../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
247
|
-
"use strict";
|
|
248
|
-
var utils = require_utils(), {
|
|
249
|
-
CHAR_ASTERISK,
|
|
250
|
-
/* * */
|
|
251
|
-
CHAR_AT,
|
|
252
|
-
/* @ */
|
|
253
|
-
CHAR_BACKWARD_SLASH,
|
|
254
|
-
/* \ */
|
|
255
|
-
CHAR_COMMA,
|
|
256
|
-
/* , */
|
|
257
|
-
CHAR_DOT,
|
|
258
|
-
/* . */
|
|
259
|
-
CHAR_EXCLAMATION_MARK,
|
|
260
|
-
/* ! */
|
|
261
|
-
CHAR_FORWARD_SLASH,
|
|
262
|
-
/* / */
|
|
263
|
-
CHAR_LEFT_CURLY_BRACE,
|
|
264
|
-
/* { */
|
|
265
|
-
CHAR_LEFT_PARENTHESES,
|
|
266
|
-
/* ( */
|
|
267
|
-
CHAR_LEFT_SQUARE_BRACKET,
|
|
268
|
-
/* [ */
|
|
269
|
-
CHAR_PLUS,
|
|
270
|
-
/* + */
|
|
271
|
-
CHAR_QUESTION_MARK,
|
|
272
|
-
/* ? */
|
|
273
|
-
CHAR_RIGHT_CURLY_BRACE,
|
|
274
|
-
/* } */
|
|
275
|
-
CHAR_RIGHT_PARENTHESES,
|
|
276
|
-
/* ) */
|
|
277
|
-
CHAR_RIGHT_SQUARE_BRACKET
|
|
278
|
-
/* ] */
|
|
279
|
-
} = require_constants(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
|
|
280
|
-
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
281
|
-
}, scan = (input, options) => {
|
|
282
|
-
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
|
|
283
|
-
for (; index < length; ) {
|
|
284
|
-
code = advance();
|
|
285
|
-
let next;
|
|
286
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
287
|
-
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
288
|
-
continue;
|
|
289
|
-
}
|
|
290
|
-
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
|
|
291
|
-
for (braces++; eos() !== !0 && (code = advance()); ) {
|
|
292
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
293
|
-
backslashes = token.backslashes = !0, advance();
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
297
|
-
braces++;
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
301
|
-
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
302
|
-
continue;
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
if (braceEscaped !== !0 && code === CHAR_COMMA) {
|
|
306
|
-
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
307
|
-
continue;
|
|
308
|
-
break;
|
|
309
|
-
}
|
|
310
|
-
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
|
|
311
|
-
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (scanToEnd === !0)
|
|
316
|
-
continue;
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
if (code === CHAR_FORWARD_SLASH) {
|
|
320
|
-
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished === !0) continue;
|
|
321
|
-
if (prev === CHAR_DOT && index === start + 1) {
|
|
322
|
-
start += 2;
|
|
323
|
-
continue;
|
|
324
|
-
}
|
|
325
|
-
lastIndex = index + 1;
|
|
326
|
-
continue;
|
|
327
|
-
}
|
|
328
|
-
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
|
|
329
|
-
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
|
|
330
|
-
for (; eos() !== !0 && (code = advance()); ) {
|
|
331
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
332
|
-
backslashes = token.backslashes = !0, code = advance();
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
336
|
-
isGlob = token.isGlob = !0, finished = !0;
|
|
337
|
-
break;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
continue;
|
|
341
|
-
}
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
if (code === CHAR_ASTERISK) {
|
|
345
|
-
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
346
|
-
continue;
|
|
347
|
-
break;
|
|
348
|
-
}
|
|
349
|
-
if (code === CHAR_QUESTION_MARK) {
|
|
350
|
-
if (isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
351
|
-
continue;
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
355
|
-
for (; eos() !== !0 && (next = advance()); ) {
|
|
356
|
-
if (next === CHAR_BACKWARD_SLASH) {
|
|
357
|
-
backslashes = token.backslashes = !0, advance();
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
361
|
-
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
if (scanToEnd === !0)
|
|
366
|
-
continue;
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
370
|
-
negated = token.negated = !0, start++;
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
|
|
374
|
-
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
|
|
375
|
-
for (; eos() !== !0 && (code = advance()); ) {
|
|
376
|
-
if (code === CHAR_LEFT_PARENTHESES) {
|
|
377
|
-
backslashes = token.backslashes = !0, code = advance();
|
|
378
|
-
continue;
|
|
379
|
-
}
|
|
380
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
381
|
-
finished = !0;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
continue;
|
|
386
|
-
}
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
if (isGlob === !0) {
|
|
390
|
-
if (finished = !0, scanToEnd === !0)
|
|
391
|
-
continue;
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
|
|
396
|
-
let base = str, prefix = "", glob = "";
|
|
397
|
-
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
|
|
398
|
-
let state = {
|
|
399
|
-
prefix,
|
|
400
|
-
input,
|
|
401
|
-
start,
|
|
402
|
-
base,
|
|
403
|
-
glob,
|
|
404
|
-
isBrace,
|
|
405
|
-
isBracket,
|
|
406
|
-
isGlob,
|
|
407
|
-
isExtglob,
|
|
408
|
-
isGlobstar,
|
|
409
|
-
negated,
|
|
410
|
-
negatedExtglob
|
|
411
|
-
};
|
|
412
|
-
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
|
|
413
|
-
let prevIndex;
|
|
414
|
-
for (let idx = 0; idx < slashes.length; idx++) {
|
|
415
|
-
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
|
416
|
-
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (idx !== 0 || value !== "") && parts.push(value), prevIndex = i;
|
|
417
|
-
}
|
|
418
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
419
|
-
let value = input.slice(prevIndex + 1);
|
|
420
|
-
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
|
421
|
-
}
|
|
422
|
-
state.slashes = slashes, state.parts = parts;
|
|
423
|
-
}
|
|
424
|
-
return state;
|
|
425
|
-
};
|
|
426
|
-
module.exports = scan;
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js
|
|
431
|
-
var require_parse = __commonJS({
|
|
432
|
-
"../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
433
|
-
"use strict";
|
|
434
|
-
var constants3 = require_constants(), utils = require_utils(), {
|
|
435
|
-
MAX_LENGTH,
|
|
436
|
-
POSIX_REGEX_SOURCE,
|
|
437
|
-
REGEX_NON_SPECIAL_CHARS,
|
|
438
|
-
REGEX_SPECIAL_CHARS_BACKREF,
|
|
439
|
-
REPLACEMENTS
|
|
440
|
-
} = constants3, expandRange = (args, options) => {
|
|
441
|
-
if (typeof options.expandRange == "function")
|
|
442
|
-
return options.expandRange(...args, options);
|
|
443
|
-
args.sort();
|
|
444
|
-
let value = `[${args.join("-")}]`;
|
|
445
|
-
try {
|
|
446
|
-
new RegExp(value);
|
|
447
|
-
} catch {
|
|
448
|
-
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
449
|
-
}
|
|
450
|
-
return value;
|
|
451
|
-
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options) => {
|
|
452
|
-
if (typeof input != "string")
|
|
453
|
-
throw new TypeError("Expected a string");
|
|
454
|
-
input = REPLACEMENTS[input] || input;
|
|
455
|
-
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
456
|
-
if (len > max)
|
|
457
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
458
|
-
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", PLATFORM_CHARS = constants3.globChars(opts.windows), EXTGLOB_CHARS = constants3.extglobChars(PLATFORM_CHARS), {
|
|
459
|
-
DOT_LITERAL,
|
|
460
|
-
PLUS_LITERAL,
|
|
461
|
-
SLASH_LITERAL,
|
|
462
|
-
ONE_CHAR,
|
|
463
|
-
DOTS_SLASH,
|
|
464
|
-
NO_DOT,
|
|
465
|
-
NO_DOT_SLASH,
|
|
466
|
-
NO_DOTS_SLASH,
|
|
467
|
-
QMARK,
|
|
468
|
-
QMARK_NO_DOT,
|
|
469
|
-
STAR,
|
|
470
|
-
START_ANCHOR
|
|
471
|
-
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
|
|
472
|
-
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
|
|
473
|
-
let state = {
|
|
474
|
-
input,
|
|
475
|
-
index: -1,
|
|
476
|
-
start: 0,
|
|
477
|
-
dot: opts.dot === !0,
|
|
478
|
-
consumed: "",
|
|
479
|
-
output: "",
|
|
480
|
-
prefix: "",
|
|
481
|
-
backtrack: !1,
|
|
482
|
-
negated: !1,
|
|
483
|
-
brackets: 0,
|
|
484
|
-
braces: 0,
|
|
485
|
-
parens: 0,
|
|
486
|
-
quotes: 0,
|
|
487
|
-
globstar: !1,
|
|
488
|
-
tokens
|
|
489
|
-
};
|
|
490
|
-
input = utils.removePrefix(input, state), len = input.length;
|
|
491
|
-
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
|
|
492
|
-
state.consumed += value2, state.index += num;
|
|
493
|
-
}, append = (token) => {
|
|
494
|
-
state.output += token.output != null ? token.output : token.value, consume(token.value);
|
|
495
|
-
}, negate = () => {
|
|
496
|
-
let count = 1;
|
|
497
|
-
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
|
|
498
|
-
advance(), state.start++, count++;
|
|
499
|
-
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
|
|
500
|
-
}, increment = (type) => {
|
|
501
|
-
state[type]++, stack.push(type);
|
|
502
|
-
}, decrement = (type) => {
|
|
503
|
-
state[type]--, stack.pop();
|
|
504
|
-
}, push = (tok) => {
|
|
505
|
-
if (prev.type === "globstar") {
|
|
506
|
-
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
507
|
-
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
|
|
508
|
-
}
|
|
509
|
-
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
|
|
510
|
-
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
514
|
-
}, extglobOpen = (type, value2) => {
|
|
515
|
-
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
516
|
-
token.prev = prev, token.parens = state.parens, token.output = state.output;
|
|
517
|
-
let output = (opts.capture ? "(" : "") + token.open;
|
|
518
|
-
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
|
|
519
|
-
}, extglobClose = (token) => {
|
|
520
|
-
let output = token.close + (opts.capture ? ")" : ""), rest;
|
|
521
|
-
if (token.type === "negate") {
|
|
522
|
-
let extglobStar = star;
|
|
523
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
524
|
-
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
|
|
525
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
526
|
-
}
|
|
527
|
-
token.prev.type === "bos" && (state.negatedExtglob = !0);
|
|
528
|
-
}
|
|
529
|
-
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
|
|
530
|
-
};
|
|
531
|
-
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
532
|
-
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
|
|
533
|
-
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
|
|
534
|
-
}
|
|
535
|
-
for (; !eos(); ) {
|
|
536
|
-
if (value = advance(), value === "\0")
|
|
537
|
-
continue;
|
|
538
|
-
if (value === "\\") {
|
|
539
|
-
let next = peek();
|
|
540
|
-
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
|
|
541
|
-
continue;
|
|
542
|
-
if (!next) {
|
|
543
|
-
value += "\\", push({ type: "text", value });
|
|
544
|
-
continue;
|
|
545
|
-
}
|
|
546
|
-
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
547
|
-
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
|
|
548
|
-
push({ type: "text", value });
|
|
549
|
-
continue;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
553
|
-
if (opts.posix !== !1 && value === ":") {
|
|
554
|
-
let inner = prev.value.slice(1);
|
|
555
|
-
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
|
|
556
|
-
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix2 = POSIX_REGEX_SOURCE[rest2];
|
|
557
|
-
if (posix2) {
|
|
558
|
-
prev.value = pre + posix2, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
|
|
564
|
-
continue;
|
|
565
|
-
}
|
|
566
|
-
if (state.quotes === 1 && value !== '"') {
|
|
567
|
-
value = utils.escapeRegex(value), prev.value += value, append({ value });
|
|
568
|
-
continue;
|
|
569
|
-
}
|
|
570
|
-
if (value === '"') {
|
|
571
|
-
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
|
|
572
|
-
continue;
|
|
573
|
-
}
|
|
574
|
-
if (value === "(") {
|
|
575
|
-
increment("parens"), push({ type: "paren", value });
|
|
576
|
-
continue;
|
|
577
|
-
}
|
|
578
|
-
if (value === ")") {
|
|
579
|
-
if (state.parens === 0 && opts.strictBrackets === !0)
|
|
580
|
-
throw new SyntaxError(syntaxError("opening", "("));
|
|
581
|
-
let extglob = extglobs[extglobs.length - 1];
|
|
582
|
-
if (extglob && state.parens === extglob.parens + 1) {
|
|
583
|
-
extglobClose(extglobs.pop());
|
|
584
|
-
continue;
|
|
585
|
-
}
|
|
586
|
-
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
|
|
587
|
-
continue;
|
|
588
|
-
}
|
|
589
|
-
if (value === "[") {
|
|
590
|
-
if (opts.nobracket === !0 || !remaining().includes("]")) {
|
|
591
|
-
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
|
|
592
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
593
|
-
value = `\\${value}`;
|
|
594
|
-
} else
|
|
595
|
-
increment("brackets");
|
|
596
|
-
push({ type: "bracket", value });
|
|
597
|
-
continue;
|
|
598
|
-
}
|
|
599
|
-
if (value === "]") {
|
|
600
|
-
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
601
|
-
push({ type: "text", value, output: `\\${value}` });
|
|
602
|
-
continue;
|
|
603
|
-
}
|
|
604
|
-
if (state.brackets === 0) {
|
|
605
|
-
if (opts.strictBrackets === !0)
|
|
606
|
-
throw new SyntaxError(syntaxError("opening", "["));
|
|
607
|
-
push({ type: "text", value, output: `\\${value}` });
|
|
608
|
-
continue;
|
|
609
|
-
}
|
|
610
|
-
decrement("brackets");
|
|
611
|
-
let prevValue = prev.value.slice(1);
|
|
612
|
-
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
|
|
613
|
-
continue;
|
|
614
|
-
let escaped = utils.escapeRegex(prev.value);
|
|
615
|
-
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
|
|
616
|
-
state.output += escaped, prev.value = escaped;
|
|
617
|
-
continue;
|
|
618
|
-
}
|
|
619
|
-
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
620
|
-
continue;
|
|
621
|
-
}
|
|
622
|
-
if (value === "{" && opts.nobrace !== !0) {
|
|
623
|
-
increment("braces");
|
|
624
|
-
let open = {
|
|
625
|
-
type: "brace",
|
|
626
|
-
value,
|
|
627
|
-
output: "(",
|
|
628
|
-
outputIndex: state.output.length,
|
|
629
|
-
tokensIndex: state.tokens.length
|
|
630
|
-
};
|
|
631
|
-
braces.push(open), push(open);
|
|
632
|
-
continue;
|
|
633
|
-
}
|
|
634
|
-
if (value === "}") {
|
|
635
|
-
let brace = braces[braces.length - 1];
|
|
636
|
-
if (opts.nobrace === !0 || !brace) {
|
|
637
|
-
push({ type: "text", value, output: value });
|
|
638
|
-
continue;
|
|
639
|
-
}
|
|
640
|
-
let output = ")";
|
|
641
|
-
if (brace.dots === !0) {
|
|
642
|
-
let arr = tokens.slice(), range = [];
|
|
643
|
-
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
|
|
644
|
-
arr[i].type !== "dots" && range.unshift(arr[i].value);
|
|
645
|
-
output = expandRange(range, opts), state.backtrack = !0;
|
|
646
|
-
}
|
|
647
|
-
if (brace.comma !== !0 && brace.dots !== !0) {
|
|
648
|
-
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
649
|
-
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
|
|
650
|
-
for (let t of toks)
|
|
651
|
-
state.output += t.output || t.value;
|
|
652
|
-
}
|
|
653
|
-
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
if (value === "|") {
|
|
657
|
-
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
|
|
658
|
-
continue;
|
|
659
|
-
}
|
|
660
|
-
if (value === ",") {
|
|
661
|
-
let output = value, brace = braces[braces.length - 1];
|
|
662
|
-
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
|
|
663
|
-
continue;
|
|
664
|
-
}
|
|
665
|
-
if (value === "/") {
|
|
666
|
-
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
667
|
-
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
|
|
668
|
-
continue;
|
|
669
|
-
}
|
|
670
|
-
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
671
|
-
continue;
|
|
672
|
-
}
|
|
673
|
-
if (value === ".") {
|
|
674
|
-
if (state.braces > 0 && prev.type === "dot") {
|
|
675
|
-
prev.value === "." && (prev.output = DOT_LITERAL);
|
|
676
|
-
let brace = braces[braces.length - 1];
|
|
677
|
-
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
|
|
678
|
-
continue;
|
|
679
|
-
}
|
|
680
|
-
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
681
|
-
push({ type: "text", value, output: DOT_LITERAL });
|
|
682
|
-
continue;
|
|
683
|
-
}
|
|
684
|
-
push({ type: "dot", value, output: DOT_LITERAL });
|
|
685
|
-
continue;
|
|
686
|
-
}
|
|
687
|
-
if (value === "?") {
|
|
688
|
-
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
689
|
-
extglobOpen("qmark", value);
|
|
690
|
-
continue;
|
|
691
|
-
}
|
|
692
|
-
if (prev && prev.type === "paren") {
|
|
693
|
-
let next = peek(), output = value;
|
|
694
|
-
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
|
|
695
|
-
continue;
|
|
696
|
-
}
|
|
697
|
-
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
|
|
698
|
-
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
699
|
-
continue;
|
|
700
|
-
}
|
|
701
|
-
push({ type: "qmark", value, output: QMARK });
|
|
702
|
-
continue;
|
|
703
|
-
}
|
|
704
|
-
if (value === "!") {
|
|
705
|
-
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
|
|
706
|
-
extglobOpen("negate", value);
|
|
707
|
-
continue;
|
|
708
|
-
}
|
|
709
|
-
if (opts.nonegate !== !0 && state.index === 0) {
|
|
710
|
-
negate();
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
if (value === "+") {
|
|
715
|
-
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
716
|
-
extglobOpen("plus", value);
|
|
717
|
-
continue;
|
|
718
|
-
}
|
|
719
|
-
if (prev && prev.value === "(" || opts.regex === !1) {
|
|
720
|
-
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
721
|
-
continue;
|
|
722
|
-
}
|
|
723
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
724
|
-
push({ type: "plus", value });
|
|
725
|
-
continue;
|
|
726
|
-
}
|
|
727
|
-
push({ type: "plus", value: PLUS_LITERAL });
|
|
728
|
-
continue;
|
|
729
|
-
}
|
|
730
|
-
if (value === "@") {
|
|
731
|
-
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
732
|
-
push({ type: "at", extglob: !0, value, output: "" });
|
|
733
|
-
continue;
|
|
734
|
-
}
|
|
735
|
-
push({ type: "text", value });
|
|
736
|
-
continue;
|
|
737
|
-
}
|
|
738
|
-
if (value !== "*") {
|
|
739
|
-
(value === "$" || value === "^") && (value = `\\${value}`);
|
|
740
|
-
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
741
|
-
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
|
|
742
|
-
continue;
|
|
743
|
-
}
|
|
744
|
-
if (prev && (prev.type === "globstar" || prev.star === !0)) {
|
|
745
|
-
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
746
|
-
continue;
|
|
747
|
-
}
|
|
748
|
-
let rest = remaining();
|
|
749
|
-
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
|
|
750
|
-
extglobOpen("star", value);
|
|
751
|
-
continue;
|
|
752
|
-
}
|
|
753
|
-
if (prev.type === "star") {
|
|
754
|
-
if (opts.noglobstar === !0) {
|
|
755
|
-
consume(value);
|
|
756
|
-
continue;
|
|
757
|
-
}
|
|
758
|
-
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
759
|
-
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
760
|
-
push({ type: "star", value, output: "" });
|
|
761
|
-
continue;
|
|
762
|
-
}
|
|
763
|
-
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
764
|
-
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
765
|
-
push({ type: "star", value, output: "" });
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
for (; rest.slice(0, 3) === "/**"; ) {
|
|
769
|
-
let after = input[state.index + 4];
|
|
770
|
-
if (after && after !== "/")
|
|
771
|
-
break;
|
|
772
|
-
rest = rest.slice(3), consume("/**", 3);
|
|
773
|
-
}
|
|
774
|
-
if (prior.type === "bos" && eos()) {
|
|
775
|
-
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
776
|
-
continue;
|
|
777
|
-
}
|
|
778
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
779
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
780
|
-
continue;
|
|
781
|
-
}
|
|
782
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
783
|
-
let end = rest[1] !== void 0 ? "|$" : "";
|
|
784
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
785
|
-
continue;
|
|
786
|
-
}
|
|
787
|
-
if (prior.type === "bos" && rest[0] === "/") {
|
|
788
|
-
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
789
|
-
continue;
|
|
790
|
-
}
|
|
791
|
-
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
792
|
-
continue;
|
|
793
|
-
}
|
|
794
|
-
let token = { type: "star", value, output: star };
|
|
795
|
-
if (opts.bash === !0) {
|
|
796
|
-
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
|
|
797
|
-
continue;
|
|
798
|
-
}
|
|
799
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
|
|
800
|
-
token.output = value, push(token);
|
|
801
|
-
continue;
|
|
802
|
-
}
|
|
803
|
-
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
804
|
-
}
|
|
805
|
-
for (; state.brackets > 0; ) {
|
|
806
|
-
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
|
|
807
|
-
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
|
|
808
|
-
}
|
|
809
|
-
for (; state.parens > 0; ) {
|
|
810
|
-
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
|
|
811
|
-
state.output = utils.escapeLast(state.output, "("), decrement("parens");
|
|
812
|
-
}
|
|
813
|
-
for (; state.braces > 0; ) {
|
|
814
|
-
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
|
|
815
|
-
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
|
|
816
|
-
}
|
|
817
|
-
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
|
|
818
|
-
state.output = "";
|
|
819
|
-
for (let token of state.tokens)
|
|
820
|
-
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
821
|
-
}
|
|
822
|
-
return state;
|
|
823
|
-
};
|
|
824
|
-
parse.fastpaths = (input, options) => {
|
|
825
|
-
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
826
|
-
if (len > max)
|
|
827
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
828
|
-
input = REPLACEMENTS[input] || input;
|
|
829
|
-
let {
|
|
830
|
-
DOT_LITERAL,
|
|
831
|
-
SLASH_LITERAL,
|
|
832
|
-
ONE_CHAR,
|
|
833
|
-
DOTS_SLASH,
|
|
834
|
-
NO_DOT,
|
|
835
|
-
NO_DOTS,
|
|
836
|
-
NO_DOTS_SLASH,
|
|
837
|
-
STAR,
|
|
838
|
-
START_ANCHOR
|
|
839
|
-
} = constants3.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
|
|
840
|
-
opts.capture && (star = `(${star})`);
|
|
841
|
-
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
|
|
842
|
-
switch (str) {
|
|
843
|
-
case "*":
|
|
844
|
-
return `${nodot}${ONE_CHAR}${star}`;
|
|
845
|
-
case ".*":
|
|
846
|
-
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
847
|
-
case "*.*":
|
|
848
|
-
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
849
|
-
case "*/*":
|
|
850
|
-
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
851
|
-
case "**":
|
|
852
|
-
return nodot + globstar(opts);
|
|
853
|
-
case "**/*":
|
|
854
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
855
|
-
case "**/*.*":
|
|
856
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
857
|
-
case "**/.*":
|
|
858
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
859
|
-
default: {
|
|
860
|
-
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
861
|
-
if (!match) return;
|
|
862
|
-
let source2 = create(match[1]);
|
|
863
|
-
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}, output = utils.removePrefix(input, state), source = create(output);
|
|
867
|
-
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
|
|
868
|
-
};
|
|
869
|
-
module.exports = parse;
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
|
|
873
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js
|
|
874
|
-
var require_picomatch = __commonJS({
|
|
875
|
-
"../node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
876
|
-
"use strict";
|
|
877
|
-
var scan = require_scan(), parse = require_parse(), utils = require_utils(), constants3 = require_constants(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch2 = (glob, options, returnState = !1) => {
|
|
878
|
-
if (Array.isArray(glob)) {
|
|
879
|
-
let fns = glob.map((input) => picomatch2(input, options, returnState));
|
|
880
|
-
return (str) => {
|
|
881
|
-
for (let isMatch of fns) {
|
|
882
|
-
let state2 = isMatch(str);
|
|
883
|
-
if (state2) return state2;
|
|
884
|
-
}
|
|
885
|
-
return !1;
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
let isState = isObject(glob) && glob.tokens && glob.input;
|
|
889
|
-
if (glob === "" || typeof glob != "string" && !isState)
|
|
890
|
-
throw new TypeError("Expected pattern to be a non-empty string");
|
|
891
|
-
let opts = options || {}, posix2 = opts.windows, regex = isState ? picomatch2.compileRe(glob, options) : picomatch2.makeRe(glob, options, !1, !0), state = regex.state;
|
|
892
|
-
delete regex.state;
|
|
893
|
-
let isIgnored = () => !1;
|
|
894
|
-
if (opts.ignore) {
|
|
895
|
-
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
896
|
-
isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
|
|
897
|
-
}
|
|
898
|
-
let matcher = (input, returnObject = !1) => {
|
|
899
|
-
let { isMatch, match, output } = picomatch2.test(input, regex, options, { glob, posix: posix2 }), result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
|
|
900
|
-
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
|
|
901
|
-
};
|
|
902
|
-
return returnState && (matcher.state = state), matcher;
|
|
903
|
-
};
|
|
904
|
-
picomatch2.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
|
|
905
|
-
if (typeof input != "string")
|
|
906
|
-
throw new TypeError("Expected input to be a string");
|
|
907
|
-
if (input === "")
|
|
908
|
-
return { isMatch: !1, output: "" };
|
|
909
|
-
let opts = options || {}, format = opts.format || (posix2 ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
910
|
-
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch2.matchBase(input, regex, options, posix2) : match = regex.exec(output)), { isMatch: !!match, match, output };
|
|
911
|
-
};
|
|
912
|
-
picomatch2.matchBase = (input, glob, options) => (glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options)).test(utils.basename(input));
|
|
913
|
-
picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str);
|
|
914
|
-
picomatch2.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch2.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
|
|
915
|
-
picomatch2.scan = (input, options) => scan(input, options);
|
|
916
|
-
picomatch2.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
|
|
917
|
-
if (returnOutput === !0)
|
|
918
|
-
return state.output;
|
|
919
|
-
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
|
|
920
|
-
state && state.negated === !0 && (source = `^(?!${source}).*$`);
|
|
921
|
-
let regex = picomatch2.toRegex(source, options);
|
|
922
|
-
return returnState === !0 && (regex.state = state), regex;
|
|
923
|
-
};
|
|
924
|
-
picomatch2.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
|
|
925
|
-
if (!input || typeof input != "string")
|
|
926
|
-
throw new TypeError("Expected a non-empty string");
|
|
927
|
-
let parsed = { negated: !1, fastpaths: !0 };
|
|
928
|
-
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch2.compileRe(parsed, options, returnOutput, returnState);
|
|
929
|
-
};
|
|
930
|
-
picomatch2.toRegex = (source, options) => {
|
|
931
|
-
try {
|
|
932
|
-
let opts = options || {};
|
|
933
|
-
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
934
|
-
} catch (err) {
|
|
935
|
-
if (options && options.debug === !0) throw err;
|
|
936
|
-
return /$^/;
|
|
937
|
-
}
|
|
938
|
-
};
|
|
939
|
-
picomatch2.constants = constants3;
|
|
940
|
-
module.exports = picomatch2;
|
|
941
|
-
}
|
|
942
|
-
});
|
|
943
|
-
|
|
944
|
-
// ../node_modules/tinyglobby/node_modules/picomatch/index.js
|
|
945
|
-
var require_picomatch2 = __commonJS({
|
|
946
|
-
"../node_modules/tinyglobby/node_modules/picomatch/index.js"(exports, module) {
|
|
947
|
-
"use strict";
|
|
948
|
-
var pico = require_picomatch(), utils = require_utils();
|
|
949
|
-
function picomatch2(glob, options, returnState = !1) {
|
|
950
|
-
return options && (options.windows === null || options.windows === void 0) && (options = { ...options, windows: utils.isWindows() }), pico(glob, options, returnState);
|
|
951
|
-
}
|
|
952
|
-
Object.assign(picomatch2, pico);
|
|
953
|
-
module.exports = picomatch2;
|
|
954
|
-
}
|
|
955
|
-
});
|
|
956
|
-
|
|
957
|
-
// ../node_modules/isexe/windows.js
|
|
958
|
-
var require_windows = __commonJS({
|
|
959
|
-
"../node_modules/isexe/windows.js"(exports, module) {
|
|
960
|
-
module.exports = isexe;
|
|
961
|
-
isexe.sync = sync2;
|
|
962
|
-
var fs = __require("fs");
|
|
963
|
-
function checkPathExt(path4, options) {
|
|
964
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
965
|
-
if (!pathext || (pathext = pathext.split(";"), pathext.indexOf("") !== -1))
|
|
966
|
-
return !0;
|
|
967
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
968
|
-
var p = pathext[i].toLowerCase();
|
|
969
|
-
if (p && path4.substr(-p.length).toLowerCase() === p)
|
|
970
|
-
return !0;
|
|
971
|
-
}
|
|
972
|
-
return !1;
|
|
973
|
-
}
|
|
974
|
-
function checkStat(stat, path4, options) {
|
|
975
|
-
return !stat.isSymbolicLink() && !stat.isFile() ? !1 : checkPathExt(path4, options);
|
|
976
|
-
}
|
|
977
|
-
function isexe(path4, options, cb) {
|
|
978
|
-
fs.stat(path4, function(er, stat) {
|
|
979
|
-
cb(er, er ? !1 : checkStat(stat, path4, options));
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
function sync2(path4, options) {
|
|
983
|
-
return checkStat(fs.statSync(path4), path4, options);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
|
|
988
|
-
// ../node_modules/isexe/mode.js
|
|
989
|
-
var require_mode = __commonJS({
|
|
990
|
-
"../node_modules/isexe/mode.js"(exports, module) {
|
|
991
|
-
module.exports = isexe;
|
|
992
|
-
isexe.sync = sync2;
|
|
993
|
-
var fs = __require("fs");
|
|
994
|
-
function isexe(path4, options, cb) {
|
|
995
|
-
fs.stat(path4, function(er, stat) {
|
|
996
|
-
cb(er, er ? !1 : checkStat(stat, options));
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
function sync2(path4, options) {
|
|
1000
|
-
return checkStat(fs.statSync(path4), options);
|
|
1001
|
-
}
|
|
1002
|
-
function checkStat(stat, options) {
|
|
1003
|
-
return stat.isFile() && checkMode(stat, options);
|
|
1004
|
-
}
|
|
1005
|
-
function checkMode(stat, options) {
|
|
1006
|
-
var mod = stat.mode, uid = stat.uid, gid = stat.gid, myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(), myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(), u = parseInt("100", 8), g = parseInt("010", 8), o = parseInt("001", 8), ug = u | g, ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
1007
|
-
return ret;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
});
|
|
1011
|
-
|
|
1012
|
-
// ../node_modules/isexe/index.js
|
|
1013
|
-
var require_isexe = __commonJS({
|
|
1014
|
-
"../node_modules/isexe/index.js"(exports, module) {
|
|
1015
|
-
var fs = __require("fs"), core;
|
|
1016
|
-
process.platform === "win32" || global.TESTING_WINDOWS ? core = require_windows() : core = require_mode();
|
|
1017
|
-
module.exports = isexe;
|
|
1018
|
-
isexe.sync = sync2;
|
|
1019
|
-
function isexe(path4, options, cb) {
|
|
1020
|
-
if (typeof options == "function" && (cb = options, options = {}), !cb) {
|
|
1021
|
-
if (typeof Promise != "function")
|
|
1022
|
-
throw new TypeError("callback not provided");
|
|
1023
|
-
return new Promise(function(resolve3, reject) {
|
|
1024
|
-
isexe(path4, options || {}, function(er, is) {
|
|
1025
|
-
er ? reject(er) : resolve3(is);
|
|
1026
|
-
});
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
core(path4, options || {}, function(er, is) {
|
|
1030
|
-
er && (er.code === "EACCES" || options && options.ignoreErrors) && (er = null, is = !1), cb(er, is);
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
function sync2(path4, options) {
|
|
1034
|
-
try {
|
|
1035
|
-
return core.sync(path4, options || {});
|
|
1036
|
-
} catch (er) {
|
|
1037
|
-
if (options && options.ignoreErrors || er.code === "EACCES")
|
|
1038
|
-
return !1;
|
|
1039
|
-
throw er;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
|
|
1045
|
-
// ../node_modules/which/which.js
|
|
1046
|
-
var require_which = __commonJS({
|
|
1047
|
-
"../node_modules/which/which.js"(exports, module) {
|
|
1048
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", path4 = __require("path"), COLON = isWindows ? ";" : ":", isexe = require_isexe(), getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), getPathInfo = (cmd, opt) => {
|
|
1049
|
-
let colon = opt.colon || COLON, pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
1050
|
-
// windows always checks the cwd first
|
|
1051
|
-
...isWindows ? [process.cwd()] : [],
|
|
1052
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
1053
|
-
"").split(colon)
|
|
1054
|
-
], pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
1055
|
-
return isWindows && cmd.indexOf(".") !== -1 && pathExt[0] !== "" && pathExt.unshift(""), {
|
|
1056
|
-
pathEnv,
|
|
1057
|
-
pathExt,
|
|
1058
|
-
pathExtExe
|
|
1059
|
-
};
|
|
1060
|
-
}, which = (cmd, opt, cb) => {
|
|
1061
|
-
typeof opt == "function" && (cb = opt, opt = {}), opt || (opt = {});
|
|
1062
|
-
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((resolve3, reject) => {
|
|
1063
|
-
if (i === pathEnv.length)
|
|
1064
|
-
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
1065
|
-
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path4.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1066
|
-
resolve3(subStep(p, i, 0));
|
|
1067
|
-
}), subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
1068
|
-
if (ii === pathExt.length)
|
|
1069
|
-
return resolve3(step(i + 1));
|
|
1070
|
-
let ext = pathExt[ii];
|
|
1071
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
1072
|
-
if (!er && is)
|
|
1073
|
-
if (opt.all)
|
|
1074
|
-
found.push(p + ext);
|
|
1075
|
-
else
|
|
1076
|
-
return resolve3(p + ext);
|
|
1077
|
-
return resolve3(subStep(p, i, ii + 1));
|
|
1078
|
-
});
|
|
1079
|
-
});
|
|
1080
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
1081
|
-
}, whichSync = (cmd, opt) => {
|
|
1082
|
-
opt = opt || {};
|
|
1083
|
-
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [];
|
|
1084
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
1085
|
-
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path4.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1086
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
1087
|
-
let cur = p + pathExt[j];
|
|
1088
|
-
try {
|
|
1089
|
-
if (isexe.sync(cur, { pathExt: pathExtExe }))
|
|
1090
|
-
if (opt.all)
|
|
1091
|
-
found.push(cur);
|
|
1092
|
-
else
|
|
1093
|
-
return cur;
|
|
1094
|
-
} catch {
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
if (opt.all && found.length)
|
|
1099
|
-
return found;
|
|
1100
|
-
if (opt.nothrow)
|
|
1101
|
-
return null;
|
|
1102
|
-
throw getNotFoundError(cmd);
|
|
1103
|
-
};
|
|
1104
|
-
module.exports = which;
|
|
1105
|
-
which.sync = whichSync;
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
|
|
1109
|
-
// ../node_modules/path-key/index.js
|
|
1110
|
-
var require_path_key = __commonJS({
|
|
1111
|
-
"../node_modules/path-key/index.js"(exports, module) {
|
|
1112
|
-
"use strict";
|
|
1113
|
-
var pathKey2 = (options = {}) => {
|
|
1114
|
-
let environment = options.env || process.env;
|
|
1115
|
-
return (options.platform || process.platform) !== "win32" ? "PATH" : Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
1116
|
-
};
|
|
1117
|
-
module.exports = pathKey2;
|
|
1118
|
-
module.exports.default = pathKey2;
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
// ../node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
1123
|
-
var require_resolveCommand = __commonJS({
|
|
1124
|
-
"../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
1125
|
-
"use strict";
|
|
1126
|
-
var path4 = __require("path"), which = require_which(), getPathKey = require_path_key();
|
|
1127
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
1128
|
-
let env = parsed.options.env || process.env, cwd = process.cwd(), hasCustomCwd = parsed.options.cwd != null, shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
1129
|
-
if (shouldSwitchCwd)
|
|
1130
|
-
try {
|
|
1131
|
-
process.chdir(parsed.options.cwd);
|
|
1132
|
-
} catch {
|
|
1133
|
-
}
|
|
1134
|
-
let resolved;
|
|
1135
|
-
try {
|
|
1136
|
-
resolved = which.sync(parsed.command, {
|
|
1137
|
-
path: env[getPathKey({ env })],
|
|
1138
|
-
pathExt: withoutPathExt ? path4.delimiter : void 0
|
|
1139
|
-
});
|
|
1140
|
-
} catch {
|
|
1141
|
-
} finally {
|
|
1142
|
-
shouldSwitchCwd && process.chdir(cwd);
|
|
1143
|
-
}
|
|
1144
|
-
return resolved && (resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved)), resolved;
|
|
1145
|
-
}
|
|
1146
|
-
function resolveCommand(parsed) {
|
|
1147
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, !0);
|
|
1148
|
-
}
|
|
1149
|
-
module.exports = resolveCommand;
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
|
|
1153
|
-
// ../node_modules/cross-spawn/lib/util/escape.js
|
|
1154
|
-
var require_escape = __commonJS({
|
|
1155
|
-
"../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
1156
|
-
"use strict";
|
|
1157
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
1158
|
-
function escapeCommand(arg) {
|
|
1159
|
-
return arg = arg.replace(metaCharsRegExp, "^$1"), arg;
|
|
1160
|
-
}
|
|
1161
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
1162
|
-
return arg = `${arg}`, arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'), arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1"), arg = `"${arg}"`, arg = arg.replace(metaCharsRegExp, "^$1"), doubleEscapeMetaChars && (arg = arg.replace(metaCharsRegExp, "^$1")), arg;
|
|
1163
|
-
}
|
|
1164
|
-
module.exports.command = escapeCommand;
|
|
1165
|
-
module.exports.argument = escapeArgument;
|
|
1166
|
-
}
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
|
-
// ../node_modules/shebang-regex/index.js
|
|
1170
|
-
var require_shebang_regex = __commonJS({
|
|
1171
|
-
"../node_modules/shebang-regex/index.js"(exports, module) {
|
|
1172
|
-
"use strict";
|
|
1173
|
-
module.exports = /^#!(.*)/;
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
|
|
1177
|
-
// ../node_modules/shebang-command/index.js
|
|
1178
|
-
var require_shebang_command = __commonJS({
|
|
1179
|
-
"../node_modules/shebang-command/index.js"(exports, module) {
|
|
1180
|
-
"use strict";
|
|
1181
|
-
var shebangRegex = require_shebang_regex();
|
|
1182
|
-
module.exports = (string = "") => {
|
|
1183
|
-
let match = string.match(shebangRegex);
|
|
1184
|
-
if (!match)
|
|
1185
|
-
return null;
|
|
1186
|
-
let [path4, argument] = match[0].replace(/#! ?/, "").split(" "), binary = path4.split("/").pop();
|
|
1187
|
-
return binary === "env" ? argument : argument ? `${binary} ${argument}` : binary;
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
|
|
1192
|
-
// ../node_modules/cross-spawn/lib/util/readShebang.js
|
|
1193
|
-
var require_readShebang = __commonJS({
|
|
1194
|
-
"../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
1195
|
-
"use strict";
|
|
1196
|
-
var fs = __require("fs"), shebangCommand = require_shebang_command();
|
|
1197
|
-
function readShebang(command) {
|
|
1198
|
-
let buffer = Buffer.alloc(150), fd;
|
|
1199
|
-
try {
|
|
1200
|
-
fd = fs.openSync(command, "r"), fs.readSync(fd, buffer, 0, 150, 0), fs.closeSync(fd);
|
|
1201
|
-
} catch {
|
|
1202
|
-
}
|
|
1203
|
-
return shebangCommand(buffer.toString());
|
|
1204
|
-
}
|
|
1205
|
-
module.exports = readShebang;
|
|
1206
|
-
}
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
// ../node_modules/cross-spawn/lib/parse.js
|
|
1210
|
-
var require_parse2 = __commonJS({
|
|
1211
|
-
"../node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
1212
|
-
"use strict";
|
|
1213
|
-
var path4 = __require("path"), resolveCommand = require_resolveCommand(), escape = require_escape(), readShebang = require_readShebang(), isWin2 = process.platform === "win32", isExecutableRegExp = /\.(?:com|exe)$/i, isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
1214
|
-
function detectShebang(parsed) {
|
|
1215
|
-
parsed.file = resolveCommand(parsed);
|
|
1216
|
-
let shebang = parsed.file && readShebang(parsed.file);
|
|
1217
|
-
return shebang ? (parsed.args.unshift(parsed.file), parsed.command = shebang, resolveCommand(parsed)) : parsed.file;
|
|
1218
|
-
}
|
|
1219
|
-
function parseNonShell(parsed) {
|
|
1220
|
-
if (!isWin2)
|
|
1221
|
-
return parsed;
|
|
1222
|
-
let commandFile = detectShebang(parsed), needsShell = !isExecutableRegExp.test(commandFile);
|
|
1223
|
-
if (parsed.options.forceShell || needsShell) {
|
|
1224
|
-
let needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
1225
|
-
parsed.command = path4.normalize(parsed.command), parsed.command = escape.command(parsed.command), parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
1226
|
-
let shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
1227
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`], parsed.command = process.env.comspec || "cmd.exe", parsed.options.windowsVerbatimArguments = !0;
|
|
1228
|
-
}
|
|
1229
|
-
return parsed;
|
|
1230
|
-
}
|
|
1231
|
-
function parse(command, args, options) {
|
|
1232
|
-
args && !Array.isArray(args) && (options = args, args = null), args = args ? args.slice(0) : [], options = Object.assign({}, options);
|
|
1233
|
-
let parsed = {
|
|
1234
|
-
command,
|
|
1235
|
-
args,
|
|
1236
|
-
options,
|
|
1237
|
-
file: void 0,
|
|
1238
|
-
original: {
|
|
1239
|
-
command,
|
|
1240
|
-
args
|
|
1241
|
-
}
|
|
1242
|
-
};
|
|
1243
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
1244
|
-
}
|
|
1245
|
-
module.exports = parse;
|
|
1246
|
-
}
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
// ../node_modules/cross-spawn/lib/enoent.js
|
|
1250
|
-
var require_enoent = __commonJS({
|
|
1251
|
-
"../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
1252
|
-
"use strict";
|
|
1253
|
-
var isWin2 = process.platform === "win32";
|
|
1254
|
-
function notFoundError(original, syscall) {
|
|
1255
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
1256
|
-
code: "ENOENT",
|
|
1257
|
-
errno: "ENOENT",
|
|
1258
|
-
syscall: `${syscall} ${original.command}`,
|
|
1259
|
-
path: original.command,
|
|
1260
|
-
spawnargs: original.args
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
function hookChildProcess(cp, parsed) {
|
|
1264
|
-
if (!isWin2)
|
|
1265
|
-
return;
|
|
1266
|
-
let originalEmit = cp.emit;
|
|
1267
|
-
cp.emit = function(name, arg1) {
|
|
1268
|
-
if (name === "exit") {
|
|
1269
|
-
let err = verifyENOENT(arg1, parsed);
|
|
1270
|
-
if (err)
|
|
1271
|
-
return originalEmit.call(cp, "error", err);
|
|
1272
|
-
}
|
|
1273
|
-
return originalEmit.apply(cp, arguments);
|
|
1274
|
-
};
|
|
1275
|
-
}
|
|
1276
|
-
function verifyENOENT(status, parsed) {
|
|
1277
|
-
return isWin2 && status === 1 && !parsed.file ? notFoundError(parsed.original, "spawn") : null;
|
|
1278
|
-
}
|
|
1279
|
-
function verifyENOENTSync(status, parsed) {
|
|
1280
|
-
return isWin2 && status === 1 && !parsed.file ? notFoundError(parsed.original, "spawnSync") : null;
|
|
1281
|
-
}
|
|
1282
|
-
module.exports = {
|
|
1283
|
-
hookChildProcess,
|
|
1284
|
-
verifyENOENT,
|
|
1285
|
-
verifyENOENTSync,
|
|
1286
|
-
notFoundError
|
|
1287
|
-
};
|
|
1288
|
-
}
|
|
1289
|
-
});
|
|
1290
|
-
|
|
1291
|
-
// ../node_modules/cross-spawn/index.js
|
|
1292
|
-
var require_cross_spawn = __commonJS({
|
|
1293
|
-
"../node_modules/cross-spawn/index.js"(exports, module) {
|
|
1294
|
-
"use strict";
|
|
1295
|
-
var cp = __require("child_process"), parse = require_parse2(), enoent = require_enoent();
|
|
1296
|
-
function spawn(command, args, options) {
|
|
1297
|
-
let parsed = parse(command, args, options), spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
1298
|
-
return enoent.hookChildProcess(spawned, parsed), spawned;
|
|
1299
|
-
}
|
|
1300
|
-
function spawnSync(command, args, options) {
|
|
1301
|
-
let parsed = parse(command, args, options), result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
1302
|
-
return result.error = result.error || enoent.verifyENOENTSync(result.status, parsed), result;
|
|
1303
|
-
}
|
|
1304
|
-
module.exports = spawn;
|
|
1305
|
-
module.exports.spawn = spawn;
|
|
1306
|
-
module.exports.sync = spawnSync;
|
|
1307
|
-
module.exports._parse = parse;
|
|
1308
|
-
module.exports._enoent = enoent;
|
|
1309
|
-
}
|
|
1310
|
-
});
|
|
1311
|
-
|
|
1312
|
-
// ../node_modules/merge-stream/index.js
|
|
1313
|
-
var require_merge_stream = __commonJS({
|
|
1314
|
-
"../node_modules/merge-stream/index.js"(exports, module) {
|
|
1315
|
-
"use strict";
|
|
1316
|
-
var { PassThrough } = __require("stream");
|
|
1317
|
-
module.exports = function() {
|
|
1318
|
-
var sources = [], output = new PassThrough({ objectMode: !0 });
|
|
1319
|
-
return output.setMaxListeners(0), output.add = add, output.isEmpty = isEmpty, output.on("unpipe", remove), Array.prototype.slice.call(arguments).forEach(add), output;
|
|
1320
|
-
function add(source) {
|
|
1321
|
-
return Array.isArray(source) ? (source.forEach(add), this) : (sources.push(source), source.once("end", remove.bind(null, source)), source.once("error", output.emit.bind(output, "error")), source.pipe(output, { end: !1 }), this);
|
|
1322
|
-
}
|
|
1323
|
-
function isEmpty() {
|
|
1324
|
-
return sources.length == 0;
|
|
1325
|
-
}
|
|
1326
|
-
function remove(source) {
|
|
1327
|
-
sources = sources.filter(function(it) {
|
|
1328
|
-
return it !== source;
|
|
1329
|
-
}), !sources.length && output.readable && output.end();
|
|
1330
|
-
}
|
|
1331
|
-
};
|
|
1332
|
-
}
|
|
1333
|
-
});
|
|
1334
|
-
|
|
1335
|
-
// src/common/utils/paths.ts
|
|
1336
|
-
import { join, relative as relative2, resolve as resolve2, sep as sep2 } from "node:path";
|
|
1337
|
-
|
|
1338
|
-
// ../node_modules/tinyglobby/dist/index.mjs
|
|
1339
|
-
import nativeFs2 from "fs";
|
|
1340
|
-
import path, { posix } from "path";
|
|
1341
|
-
import { fileURLToPath } from "url";
|
|
1342
|
-
|
|
1343
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/index.mjs
|
|
1344
|
-
import { createRequire } from "module";
|
|
1345
|
-
import { basename, dirname, normalize, relative, resolve, sep } from "path";
|
|
1346
|
-
import * as nativeFs from "fs";
|
|
1347
|
-
var __require2 = createRequire(import.meta.url);
|
|
1348
|
-
function cleanPath(path4) {
|
|
1349
|
-
let normalized = normalize(path4);
|
|
1350
|
-
return normalized.length > 1 && normalized[normalized.length - 1] === sep && (normalized = normalized.substring(0, normalized.length - 1)), normalized;
|
|
1351
|
-
}
|
|
1352
|
-
var SLASHES_REGEX = /[\\/]/g;
|
|
1353
|
-
function convertSlashes(path4, separator) {
|
|
1354
|
-
return path4.replace(SLASHES_REGEX, separator);
|
|
1355
|
-
}
|
|
1356
|
-
var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
1357
|
-
function isRootDirectory(path4) {
|
|
1358
|
-
return path4 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path4);
|
|
1359
|
-
}
|
|
1360
|
-
function normalizePath(path4, options) {
|
|
1361
|
-
let { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options, pathNeedsCleaning = process.platform === "win32" && path4.includes("/") || path4.startsWith(".");
|
|
1362
|
-
if (resolvePaths && (path4 = resolve(path4)), (normalizePath$1 || pathNeedsCleaning) && (path4 = cleanPath(path4)), path4 === ".") return "";
|
|
1363
|
-
let needsSeperator = path4[path4.length - 1] !== pathSeparator;
|
|
1364
|
-
return convertSlashes(needsSeperator ? path4 + pathSeparator : path4, pathSeparator);
|
|
1365
|
-
}
|
|
1366
|
-
function joinPathWithBasePath(filename, directoryPath) {
|
|
1367
|
-
return directoryPath + filename;
|
|
1368
|
-
}
|
|
1369
|
-
function joinPathWithRelativePath(root, options) {
|
|
1370
|
-
return function(filename, directoryPath) {
|
|
1371
|
-
return directoryPath.startsWith(root) ? directoryPath.slice(root.length) + filename : convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
1372
|
-
};
|
|
1373
|
-
}
|
|
1374
|
-
function joinPath(filename) {
|
|
1375
|
-
return filename;
|
|
1376
|
-
}
|
|
1377
|
-
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
1378
|
-
return directoryPath + filename + separator;
|
|
1379
|
-
}
|
|
1380
|
-
function build$7(root, options) {
|
|
1381
|
-
let { relativePaths, includeBasePath } = options;
|
|
1382
|
-
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
1383
|
-
}
|
|
1384
|
-
function pushDirectoryWithRelativePath(root) {
|
|
1385
|
-
return function(directoryPath, paths) {
|
|
1386
|
-
paths.push(directoryPath.substring(root.length) || ".");
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
function pushDirectoryFilterWithRelativePath(root) {
|
|
1390
|
-
return function(directoryPath, paths, filters) {
|
|
1391
|
-
let relativePath = directoryPath.substring(root.length) || ".";
|
|
1392
|
-
filters.every((filter) => filter(relativePath, !0)) && paths.push(relativePath);
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
var pushDirectory = (directoryPath, paths) => {
|
|
1396
|
-
paths.push(directoryPath || ".");
|
|
1397
|
-
}, pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
1398
|
-
let path4 = directoryPath || ".";
|
|
1399
|
-
filters.every((filter) => filter(path4, !0)) && paths.push(path4);
|
|
1400
|
-
}, empty$2 = () => {
|
|
1401
|
-
};
|
|
1402
|
-
function build$6(root, options) {
|
|
1403
|
-
let { includeDirs, filters, relativePaths } = options;
|
|
1404
|
-
return includeDirs ? relativePaths ? filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root) : filters && filters.length ? pushDirectoryFilter : pushDirectory : empty$2;
|
|
1405
|
-
}
|
|
1406
|
-
var pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
|
1407
|
-
filters.every((filter) => filter(filename, !1)) && counts.files++;
|
|
1408
|
-
}, pushFileFilter = (filename, paths, _counts, filters) => {
|
|
1409
|
-
filters.every((filter) => filter(filename, !1)) && paths.push(filename);
|
|
1410
|
-
}, pushFileCount = (_filename, _paths, counts, _filters) => {
|
|
1411
|
-
counts.files++;
|
|
1412
|
-
}, pushFile = (filename, paths) => {
|
|
1413
|
-
paths.push(filename);
|
|
1414
|
-
}, empty$1 = () => {
|
|
1415
|
-
};
|
|
1416
|
-
function build$5(options) {
|
|
1417
|
-
let { excludeFiles, filters, onlyCounts } = options;
|
|
1418
|
-
return excludeFiles ? empty$1 : filters && filters.length ? onlyCounts ? pushFileFilterAndCount : pushFileFilter : onlyCounts ? pushFileCount : pushFile;
|
|
1419
|
-
}
|
|
1420
|
-
var getArray = (paths) => paths, getArrayGroup = () => [""].slice(0, 0);
|
|
1421
|
-
function build$4(options) {
|
|
1422
|
-
return options.group ? getArrayGroup : getArray;
|
|
1423
|
-
}
|
|
1424
|
-
var groupFiles = (groups, directory, files) => {
|
|
1425
|
-
groups.push({
|
|
1426
|
-
directory,
|
|
1427
|
-
files,
|
|
1428
|
-
dir: directory
|
|
1429
|
-
});
|
|
1430
|
-
}, empty = () => {
|
|
1431
|
-
};
|
|
1432
|
-
function build$3(options) {
|
|
1433
|
-
return options.group ? groupFiles : empty;
|
|
1434
|
-
}
|
|
1435
|
-
var resolveSymlinksAsync = function(path4, state, callback$1) {
|
|
1436
|
-
let { queue, fs, options: { suppressErrors } } = state;
|
|
1437
|
-
queue.enqueue(), fs.realpath(path4, (error, resolvedPath) => {
|
|
1438
|
-
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
1439
|
-
fs.stat(resolvedPath, (error$1, stat) => {
|
|
1440
|
-
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
1441
|
-
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state)) return queue.dequeue(null, state);
|
|
1442
|
-
callback$1(stat, resolvedPath), queue.dequeue(null, state);
|
|
1443
|
-
});
|
|
1444
|
-
});
|
|
1445
|
-
}, resolveSymlinks = function(path4, state, callback$1) {
|
|
1446
|
-
let { queue, fs, options: { suppressErrors } } = state;
|
|
1447
|
-
queue.enqueue();
|
|
1448
|
-
try {
|
|
1449
|
-
let resolvedPath = fs.realpathSync(path4), stat = fs.statSync(resolvedPath);
|
|
1450
|
-
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state)) return;
|
|
1451
|
-
callback$1(stat, resolvedPath);
|
|
1452
|
-
} catch (e) {
|
|
1453
|
-
if (!suppressErrors) throw e;
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
function build$2(options, isSynchronous) {
|
|
1457
|
-
return !options.resolveSymlinks || options.excludeSymlinks ? null : isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
1458
|
-
}
|
|
1459
|
-
function isRecursive(path4, resolved, state) {
|
|
1460
|
-
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
1461
|
-
let parent = dirname(path4), depth = 1;
|
|
1462
|
-
for (; parent !== state.root && depth < 2; ) {
|
|
1463
|
-
let resolvedPath = state.symlinks.get(parent);
|
|
1464
|
-
!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)) ? depth++ : parent = dirname(parent);
|
|
1465
|
-
}
|
|
1466
|
-
return state.symlinks.set(path4, resolved), depth > 1;
|
|
1467
|
-
}
|
|
1468
|
-
function isRecursiveUsingRealPaths(resolved, state) {
|
|
1469
|
-
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
1470
|
-
}
|
|
1471
|
-
var onlyCountsSync = (state) => state.counts, groupsSync = (state) => state.groups, defaultSync = (state) => state.paths, limitFilesSync = (state) => state.paths.slice(0, state.options.maxFiles), onlyCountsAsync = (state, error, callback$1) => (report(error, callback$1, state.counts, state.options.suppressErrors), null), defaultAsync = (state, error, callback$1) => (report(error, callback$1, state.paths, state.options.suppressErrors), null), limitFilesAsync = (state, error, callback$1) => (report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors), null), groupsAsync = (state, error, callback$1) => (report(error, callback$1, state.groups, state.options.suppressErrors), null);
|
|
1472
|
-
function report(error, callback$1, output, suppressErrors) {
|
|
1473
|
-
callback$1(error && !suppressErrors ? error : null, output);
|
|
1474
|
-
}
|
|
1475
|
-
function build$1(options, isSynchronous) {
|
|
1476
|
-
let { onlyCounts, group, maxFiles } = options;
|
|
1477
|
-
return onlyCounts ? isSynchronous ? onlyCountsSync : onlyCountsAsync : group ? isSynchronous ? groupsSync : groupsAsync : maxFiles ? isSynchronous ? limitFilesSync : limitFilesAsync : isSynchronous ? defaultSync : defaultAsync;
|
|
1478
|
-
}
|
|
1479
|
-
var readdirOpts = { withFileTypes: !0 }, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
1480
|
-
if (state.queue.enqueue(), currentDepth < 0) return state.queue.dequeue(null, state);
|
|
1481
|
-
let { fs } = state;
|
|
1482
|
-
state.visited.push(crawlPath), state.counts.directories++, fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
|
1483
|
-
callback$1(entries, directoryPath, currentDepth), state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
1484
|
-
});
|
|
1485
|
-
}, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
1486
|
-
let { fs } = state;
|
|
1487
|
-
if (currentDepth < 0) return;
|
|
1488
|
-
state.visited.push(crawlPath), state.counts.directories++;
|
|
1489
|
-
let entries = [];
|
|
1490
|
-
try {
|
|
1491
|
-
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
1492
|
-
} catch (e) {
|
|
1493
|
-
if (!state.options.suppressErrors) throw e;
|
|
1494
|
-
}
|
|
1495
|
-
callback$1(entries, directoryPath, currentDepth);
|
|
1496
|
-
};
|
|
1497
|
-
function build(isSynchronous) {
|
|
1498
|
-
return isSynchronous ? walkSync : walkAsync;
|
|
1499
|
-
}
|
|
1500
|
-
var Queue = class {
|
|
1501
|
-
count = 0;
|
|
1502
|
-
constructor(onQueueEmpty) {
|
|
1503
|
-
this.onQueueEmpty = onQueueEmpty;
|
|
1504
|
-
}
|
|
1505
|
-
enqueue() {
|
|
1506
|
-
return this.count++, this.count;
|
|
1507
|
-
}
|
|
1508
|
-
dequeue(error, output) {
|
|
1509
|
-
this.onQueueEmpty && (--this.count <= 0 || error) && (this.onQueueEmpty(error, output), error && (output.controller.abort(), this.onQueueEmpty = void 0));
|
|
1510
|
-
}
|
|
1511
|
-
}, Counter = class {
|
|
1512
|
-
_files = 0;
|
|
1513
|
-
_directories = 0;
|
|
1514
|
-
set files(num) {
|
|
1515
|
-
this._files = num;
|
|
1516
|
-
}
|
|
1517
|
-
get files() {
|
|
1518
|
-
return this._files;
|
|
1519
|
-
}
|
|
1520
|
-
set directories(num) {
|
|
1521
|
-
this._directories = num;
|
|
1522
|
-
}
|
|
1523
|
-
get directories() {
|
|
1524
|
-
return this._directories;
|
|
1525
|
-
}
|
|
1526
|
-
/**
|
|
1527
|
-
* @deprecated use `directories` instead
|
|
1528
|
-
*/
|
|
1529
|
-
/* c8 ignore next 3 */
|
|
1530
|
-
get dirs() {
|
|
1531
|
-
return this._directories;
|
|
1532
|
-
}
|
|
1533
|
-
}, Aborter = class {
|
|
1534
|
-
aborted = !1;
|
|
1535
|
-
abort() {
|
|
1536
|
-
this.aborted = !0;
|
|
1537
|
-
}
|
|
1538
|
-
}, Walker = class {
|
|
1539
|
-
root;
|
|
1540
|
-
isSynchronous;
|
|
1541
|
-
state;
|
|
1542
|
-
joinPath;
|
|
1543
|
-
pushDirectory;
|
|
1544
|
-
pushFile;
|
|
1545
|
-
getArray;
|
|
1546
|
-
groupFiles;
|
|
1547
|
-
resolveSymlink;
|
|
1548
|
-
walkDirectory;
|
|
1549
|
-
callbackInvoker;
|
|
1550
|
-
constructor(root, options, callback$1) {
|
|
1551
|
-
this.isSynchronous = !callback$1, this.callbackInvoker = build$1(options, this.isSynchronous), this.root = normalizePath(root, options), this.state = {
|
|
1552
|
-
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
1553
|
-
paths: [""].slice(0, 0),
|
|
1554
|
-
groups: [],
|
|
1555
|
-
counts: new Counter(),
|
|
1556
|
-
options,
|
|
1557
|
-
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
|
1558
|
-
symlinks: /* @__PURE__ */ new Map(),
|
|
1559
|
-
visited: [""].slice(0, 0),
|
|
1560
|
-
controller: new Aborter(),
|
|
1561
|
-
fs: options.fs || nativeFs
|
|
1562
|
-
}, this.joinPath = build$7(this.root, options), this.pushDirectory = build$6(this.root, options), this.pushFile = build$5(options), this.getArray = build$4(options), this.groupFiles = build$3(options), this.resolveSymlink = build$2(options, this.isSynchronous), this.walkDirectory = build(this.isSynchronous);
|
|
1563
|
-
}
|
|
1564
|
-
start() {
|
|
1565
|
-
return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
1566
|
-
}
|
|
1567
|
-
walk = (entries, directoryPath, depth) => {
|
|
1568
|
-
let { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
1569
|
-
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
1570
|
-
let files = this.getArray(this.state.paths);
|
|
1571
|
-
for (let i = 0; i < entries.length; ++i) {
|
|
1572
|
-
let entry = entries[i];
|
|
1573
|
-
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
1574
|
-
let filename = this.joinPath(entry.name, directoryPath);
|
|
1575
|
-
this.pushFile(filename, files, this.state.counts, filters);
|
|
1576
|
-
} else if (entry.isDirectory()) {
|
|
1577
|
-
let path4 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
1578
|
-
if (exclude && exclude(entry.name, path4)) continue;
|
|
1579
|
-
this.pushDirectory(path4, paths, filters), this.walkDirectory(this.state, path4, path4, depth - 1, this.walk);
|
|
1580
|
-
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
1581
|
-
let path4 = joinPathWithBasePath(entry.name, directoryPath);
|
|
1582
|
-
this.resolveSymlink(path4, this.state, (stat, resolvedPath) => {
|
|
1583
|
-
if (stat.isDirectory()) {
|
|
1584
|
-
if (resolvedPath = normalizePath(resolvedPath, this.state.options), exclude && exclude(entry.name, useRealPaths ? resolvedPath : path4 + pathSeparator)) return;
|
|
1585
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path4 + pathSeparator, depth - 1, this.walk);
|
|
1586
|
-
} else {
|
|
1587
|
-
resolvedPath = useRealPaths ? resolvedPath : path4;
|
|
1588
|
-
let filename = basename(resolvedPath), directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
|
|
1589
|
-
resolvedPath = this.joinPath(filename, directoryPath$1), this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
this.groupFiles(this.state.groups, directoryPath, files);
|
|
1595
|
-
};
|
|
1596
|
-
};
|
|
1597
|
-
function promise(root, options) {
|
|
1598
|
-
return new Promise((resolve$1, reject) => {
|
|
1599
|
-
callback(root, options, (err, output) => {
|
|
1600
|
-
if (err) return reject(err);
|
|
1601
|
-
resolve$1(output);
|
|
1602
|
-
});
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
function callback(root, options, callback$1) {
|
|
1606
|
-
new Walker(root, options, callback$1).start();
|
|
1607
|
-
}
|
|
1608
|
-
function sync(root, options) {
|
|
1609
|
-
return new Walker(root, options).start();
|
|
1610
|
-
}
|
|
1611
|
-
var APIBuilder = class {
|
|
1612
|
-
constructor(root, options) {
|
|
1613
|
-
this.root = root, this.options = options;
|
|
1614
|
-
}
|
|
1615
|
-
withPromise() {
|
|
1616
|
-
return promise(this.root, this.options);
|
|
1617
|
-
}
|
|
1618
|
-
withCallback(cb) {
|
|
1619
|
-
callback(this.root, this.options, cb);
|
|
1620
|
-
}
|
|
1621
|
-
sync() {
|
|
1622
|
-
return sync(this.root, this.options);
|
|
1623
|
-
}
|
|
1624
|
-
}, pm = null;
|
|
1625
|
-
try {
|
|
1626
|
-
__require2.resolve("picomatch"), pm = __require2("picomatch");
|
|
1627
|
-
} catch {
|
|
1628
|
-
}
|
|
1629
|
-
var Builder = class {
|
|
1630
|
-
globCache = {};
|
|
1631
|
-
options = {
|
|
1632
|
-
maxDepth: 1 / 0,
|
|
1633
|
-
suppressErrors: !0,
|
|
1634
|
-
pathSeparator: sep,
|
|
1635
|
-
filters: []
|
|
1636
|
-
};
|
|
1637
|
-
globFunction;
|
|
1638
|
-
constructor(options) {
|
|
1639
|
-
this.options = {
|
|
1640
|
-
...this.options,
|
|
1641
|
-
...options
|
|
1642
|
-
}, this.globFunction = this.options.globFunction;
|
|
1643
|
-
}
|
|
1644
|
-
group() {
|
|
1645
|
-
return this.options.group = !0, this;
|
|
1646
|
-
}
|
|
1647
|
-
withPathSeparator(separator) {
|
|
1648
|
-
return this.options.pathSeparator = separator, this;
|
|
1649
|
-
}
|
|
1650
|
-
withBasePath() {
|
|
1651
|
-
return this.options.includeBasePath = !0, this;
|
|
1652
|
-
}
|
|
1653
|
-
withRelativePaths() {
|
|
1654
|
-
return this.options.relativePaths = !0, this;
|
|
1655
|
-
}
|
|
1656
|
-
withDirs() {
|
|
1657
|
-
return this.options.includeDirs = !0, this;
|
|
1658
|
-
}
|
|
1659
|
-
withMaxDepth(depth) {
|
|
1660
|
-
return this.options.maxDepth = depth, this;
|
|
1661
|
-
}
|
|
1662
|
-
withMaxFiles(limit) {
|
|
1663
|
-
return this.options.maxFiles = limit, this;
|
|
1664
|
-
}
|
|
1665
|
-
withFullPaths() {
|
|
1666
|
-
return this.options.resolvePaths = !0, this.options.includeBasePath = !0, this;
|
|
1667
|
-
}
|
|
1668
|
-
withErrors() {
|
|
1669
|
-
return this.options.suppressErrors = !1, this;
|
|
1670
|
-
}
|
|
1671
|
-
withSymlinks({ resolvePaths = !0 } = {}) {
|
|
1672
|
-
return this.options.resolveSymlinks = !0, this.options.useRealPaths = resolvePaths, this.withFullPaths();
|
|
1673
|
-
}
|
|
1674
|
-
withAbortSignal(signal) {
|
|
1675
|
-
return this.options.signal = signal, this;
|
|
1676
|
-
}
|
|
1677
|
-
normalize() {
|
|
1678
|
-
return this.options.normalizePath = !0, this;
|
|
1679
|
-
}
|
|
1680
|
-
filter(predicate) {
|
|
1681
|
-
return this.options.filters.push(predicate), this;
|
|
1682
|
-
}
|
|
1683
|
-
onlyDirs() {
|
|
1684
|
-
return this.options.excludeFiles = !0, this.options.includeDirs = !0, this;
|
|
1685
|
-
}
|
|
1686
|
-
exclude(predicate) {
|
|
1687
|
-
return this.options.exclude = predicate, this;
|
|
1688
|
-
}
|
|
1689
|
-
onlyCounts() {
|
|
1690
|
-
return this.options.onlyCounts = !0, this;
|
|
1691
|
-
}
|
|
1692
|
-
crawl(root) {
|
|
1693
|
-
return new APIBuilder(root || ".", this.options);
|
|
1694
|
-
}
|
|
1695
|
-
withGlobFunction(fn) {
|
|
1696
|
-
return this.globFunction = fn, this;
|
|
1697
|
-
}
|
|
1698
|
-
/**
|
|
1699
|
-
* @deprecated Pass options using the constructor instead:
|
|
1700
|
-
* ```ts
|
|
1701
|
-
* new fdir(options).crawl("/path/to/root");
|
|
1702
|
-
* ```
|
|
1703
|
-
* This method will be removed in v7.0
|
|
1704
|
-
*/
|
|
1705
|
-
/* c8 ignore next 4 */
|
|
1706
|
-
crawlWithOptions(root, options) {
|
|
1707
|
-
return this.options = {
|
|
1708
|
-
...this.options,
|
|
1709
|
-
...options
|
|
1710
|
-
}, new APIBuilder(root || ".", this.options);
|
|
1711
|
-
}
|
|
1712
|
-
glob(...patterns) {
|
|
1713
|
-
return this.globFunction ? this.globWithOptions(patterns) : this.globWithOptions(patterns, { dot: !0 });
|
|
1714
|
-
}
|
|
1715
|
-
globWithOptions(patterns, ...options) {
|
|
1716
|
-
let globFn = this.globFunction || pm;
|
|
1717
|
-
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
1718
|
-
var isMatch = this.globCache[patterns.join("\0")];
|
|
1719
|
-
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path4) => isMatch(path4)), this;
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
|
-
// ../node_modules/tinyglobby/dist/index.mjs
|
|
1724
|
-
var import_picomatch = __toESM(require_picomatch2(), 1), isReadonlyArray = Array.isArray, isWin = process.platform === "win32", ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
1725
|
-
function getPartialMatcher(patterns, options = {}) {
|
|
1726
|
-
let patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount), globstarEnabled = !options.noglobstar;
|
|
1727
|
-
for (let i = 0; i < patternsCount; i++) {
|
|
1728
|
-
let parts = splitPattern(patterns[i]);
|
|
1729
|
-
patternsParts[i] = parts;
|
|
1730
|
-
let partsCount = parts.length, partMatchers = Array(partsCount);
|
|
1731
|
-
for (let j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
|
|
1732
|
-
matchers[i] = partMatchers;
|
|
1733
|
-
}
|
|
1734
|
-
return (input) => {
|
|
1735
|
-
let inputParts = input.split("/");
|
|
1736
|
-
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
|
|
1737
|
-
for (let i = 0; i < patterns.length; i++) {
|
|
1738
|
-
let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length), j = 0;
|
|
1739
|
-
for (; j < minParts; ) {
|
|
1740
|
-
let part = patternParts[j];
|
|
1741
|
-
if (part.includes("/")) return !0;
|
|
1742
|
-
if (!matcher[j](inputParts[j])) break;
|
|
1743
|
-
if (globstarEnabled && part === "**") return !0;
|
|
1744
|
-
j++;
|
|
1745
|
-
}
|
|
1746
|
-
if (j === inputPatternCount) return !0;
|
|
1747
|
-
}
|
|
1748
|
-
return !1;
|
|
1749
|
-
};
|
|
1750
|
-
}
|
|
1751
|
-
var WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
|
|
1752
|
-
function buildFormat(cwd, root, absolute) {
|
|
1753
|
-
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
1754
|
-
if (absolute) {
|
|
1755
|
-
let start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
1756
|
-
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
|
|
1757
|
-
}
|
|
1758
|
-
let prefix = root.slice(cwd.length + 1);
|
|
1759
|
-
return prefix ? (p, isDir) => {
|
|
1760
|
-
if (p === ".") return prefix;
|
|
1761
|
-
let result = `${prefix}/${p}`;
|
|
1762
|
-
return isDir ? result.slice(0, -1) : result;
|
|
1763
|
-
} : (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
|
|
1764
|
-
}
|
|
1765
|
-
return absolute ? (p) => posix.relative(cwd, p) || "." : (p) => posix.relative(cwd, `${root}/${p}`) || ".";
|
|
1766
|
-
}
|
|
1767
|
-
function buildRelative(cwd, root) {
|
|
1768
|
-
if (root.startsWith(`${cwd}/`)) {
|
|
1769
|
-
let prefix = root.slice(cwd.length + 1);
|
|
1770
|
-
return (p) => `${prefix}/${p}`;
|
|
1771
|
-
}
|
|
1772
|
-
return (p) => {
|
|
1773
|
-
let result = posix.relative(cwd, `${root}/${p}`);
|
|
1774
|
-
return p.endsWith("/") && result !== "" ? `${result}/` : result || ".";
|
|
1775
|
-
};
|
|
1776
|
-
}
|
|
1777
|
-
var splitPatternOptions = { parts: !0 };
|
|
1778
|
-
function splitPattern(path$1) {
|
|
1779
|
-
var _result$parts;
|
|
1780
|
-
let result = import_picomatch.default.scan(path$1, splitPatternOptions);
|
|
1781
|
-
return !((_result$parts = result.parts) === null || _result$parts === void 0) && _result$parts.length ? result.parts : [path$1];
|
|
1782
|
-
}
|
|
1783
|
-
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
1784
|
-
function isDynamicPattern(pattern, options) {
|
|
1785
|
-
if (options?.caseSensitiveMatch === !1) return !0;
|
|
1786
|
-
let scan = import_picomatch.default.scan(pattern);
|
|
1787
|
-
return scan.isGlob || scan.negated;
|
|
1788
|
-
}
|
|
1789
|
-
function log(...tasks) {
|
|
1790
|
-
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
1791
|
-
}
|
|
1792
|
-
var PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g, BACKSLASHES = /\\/g;
|
|
1793
|
-
function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
1794
|
-
let result = pattern;
|
|
1795
|
-
pattern.endsWith("/") && (result = pattern.slice(0, -1)), !result.endsWith("*") && expandDirectories && (result += "/**");
|
|
1796
|
-
let escapedCwd = escapePath(cwd);
|
|
1797
|
-
path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? result = posix.relative(escapedCwd, result) : result = posix.normalize(result);
|
|
1798
|
-
let parentDirectoryMatch = PARENT_DIRECTORY.exec(result), parts = splitPattern(result);
|
|
1799
|
-
if (parentDirectoryMatch?.[0]) {
|
|
1800
|
-
let n = (parentDirectoryMatch[0].length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
|
|
1801
|
-
for (; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]; )
|
|
1802
|
-
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
|
|
1803
|
-
let potentialRoot = posix.join(cwd, parentDirectoryMatch[0].slice(i * 3));
|
|
1804
|
-
!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
|
|
1805
|
-
}
|
|
1806
|
-
if (!isIgnore && props.depthOffset >= 0) {
|
|
1807
|
-
var _props$commonPath;
|
|
1808
|
-
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
|
|
1809
|
-
let newCommonPath = [], length = Math.min(props.commonPath.length, parts.length);
|
|
1810
|
-
for (let i = 0; i < length; i++) {
|
|
1811
|
-
let part = parts[i];
|
|
1812
|
-
if (part === "**" && !parts[i + 1]) {
|
|
1813
|
-
newCommonPath.pop();
|
|
1814
|
-
break;
|
|
1815
|
-
}
|
|
1816
|
-
if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) break;
|
|
1817
|
-
newCommonPath.push(part);
|
|
1818
|
-
}
|
|
1819
|
-
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
|
|
1820
|
-
}
|
|
1821
|
-
return result;
|
|
1822
|
-
}
|
|
1823
|
-
function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories = !0 }, cwd, props) {
|
|
1824
|
-
typeof patterns == "string" && (patterns = [patterns]), typeof ignore == "string" && (ignore = [ignore]);
|
|
1825
|
-
let matchPatterns = [], ignorePatterns = [];
|
|
1826
|
-
for (let pattern of ignore)
|
|
1827
|
-
pattern && (pattern[0] !== "!" || pattern[1] === "(") && ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !0));
|
|
1828
|
-
for (let pattern of patterns)
|
|
1829
|
-
pattern && (pattern[0] !== "!" || pattern[1] === "(" ? matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !1)) : (pattern[1] !== "!" || pattern[2] === "(") && ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, !0)));
|
|
1830
|
-
return {
|
|
1831
|
-
match: matchPatterns,
|
|
1832
|
-
ignore: ignorePatterns
|
|
1833
|
-
};
|
|
1834
|
-
}
|
|
1835
|
-
function formatPaths(paths, relative3) {
|
|
1836
|
-
for (let i = paths.length - 1; i >= 0; i--) {
|
|
1837
|
-
let path$1 = paths[i];
|
|
1838
|
-
paths[i] = relative3(path$1);
|
|
1839
|
-
}
|
|
1840
|
-
return paths;
|
|
1841
|
-
}
|
|
1842
|
-
function normalizeCwd(cwd) {
|
|
1843
|
-
return cwd ? cwd instanceof URL ? fileURLToPath(cwd).replace(BACKSLASHES, "/") : path.resolve(cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
1844
|
-
}
|
|
1845
|
-
function getCrawler(patterns, inputOptions = {}) {
|
|
1846
|
-
let options = process.env.TINYGLOBBY_DEBUG ? {
|
|
1847
|
-
...inputOptions,
|
|
1848
|
-
debug: !0
|
|
1849
|
-
} : inputOptions, cwd = normalizeCwd(options.cwd);
|
|
1850
|
-
if (options.debug && log("globbing with:", {
|
|
1851
|
-
patterns,
|
|
1852
|
-
options,
|
|
1853
|
-
cwd
|
|
1854
|
-
}), Array.isArray(patterns) && patterns.length === 0) return [{
|
|
1855
|
-
sync: () => [],
|
|
1856
|
-
withPromise: async () => []
|
|
1857
|
-
}, !1];
|
|
1858
|
-
let props = {
|
|
1859
|
-
root: cwd,
|
|
1860
|
-
commonPath: null,
|
|
1861
|
-
depthOffset: 0
|
|
1862
|
-
}, processed = processPatterns({
|
|
1863
|
-
...options,
|
|
1864
|
-
patterns
|
|
1865
|
-
}, cwd, props);
|
|
1866
|
-
options.debug && log("internal processing patterns:", processed);
|
|
1867
|
-
let matchOptions = {
|
|
1868
|
-
dot: options.dot,
|
|
1869
|
-
nobrace: options.braceExpansion === !1,
|
|
1870
|
-
nocase: options.caseSensitiveMatch === !1,
|
|
1871
|
-
noextglob: options.extglob === !1,
|
|
1872
|
-
noglobstar: options.globstar === !1,
|
|
1873
|
-
posix: !0
|
|
1874
|
-
}, matcher = (0, import_picomatch.default)(processed.match, {
|
|
1875
|
-
...matchOptions,
|
|
1876
|
-
ignore: processed.ignore
|
|
1877
|
-
}), ignore = (0, import_picomatch.default)(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, props.root, options.absolute), formatExclude = options.absolute ? format : buildFormat(cwd, props.root, !0), fdirOptions = {
|
|
1878
|
-
filters: [options.debug ? (p, isDirectory) => {
|
|
1879
|
-
let path$1 = format(p, isDirectory), matches = matcher(path$1);
|
|
1880
|
-
return matches && log(`matched ${path$1}`), matches;
|
|
1881
|
-
} : (p, isDirectory) => matcher(format(p, isDirectory))],
|
|
1882
|
-
exclude: options.debug ? (_, p) => {
|
|
1883
|
-
let relativePath = formatExclude(p, !0), skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
1884
|
-
return log(skipped ? `skipped ${p}` : `crawling ${p}`), skipped;
|
|
1885
|
-
} : (_, p) => {
|
|
1886
|
-
let relativePath = formatExclude(p, !0);
|
|
1887
|
-
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
1888
|
-
},
|
|
1889
|
-
fs: options.fs ? {
|
|
1890
|
-
readdir: options.fs.readdir || nativeFs2.readdir,
|
|
1891
|
-
readdirSync: options.fs.readdirSync || nativeFs2.readdirSync,
|
|
1892
|
-
realpath: options.fs.realpath || nativeFs2.realpath,
|
|
1893
|
-
realpathSync: options.fs.realpathSync || nativeFs2.realpathSync,
|
|
1894
|
-
stat: options.fs.stat || nativeFs2.stat,
|
|
1895
|
-
statSync: options.fs.statSync || nativeFs2.statSync
|
|
1896
|
-
} : void 0,
|
|
1897
|
-
pathSeparator: "/",
|
|
1898
|
-
relativePaths: !0,
|
|
1899
|
-
resolveSymlinks: !0,
|
|
1900
|
-
signal: options.signal
|
|
1901
|
-
};
|
|
1902
|
-
options.deep !== void 0 && (fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset)), options.absolute && (fdirOptions.relativePaths = !1, fdirOptions.resolvePaths = !0, fdirOptions.includeBasePath = !0), options.followSymbolicLinks === !1 && (fdirOptions.resolveSymlinks = !1, fdirOptions.excludeSymlinks = !0), options.onlyDirectories ? (fdirOptions.excludeFiles = !0, fdirOptions.includeDirs = !0) : options.onlyFiles === !1 && (fdirOptions.includeDirs = !0), props.root = props.root.replace(BACKSLASHES, "");
|
|
1903
|
-
let root = props.root;
|
|
1904
|
-
options.debug && log("internal properties:", props);
|
|
1905
|
-
let relative3 = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
|
|
1906
|
-
return [new Builder(fdirOptions).crawl(root), relative3];
|
|
1907
|
-
}
|
|
1908
|
-
function globSync(patternsOrOptions, options) {
|
|
1909
|
-
if (patternsOrOptions && options?.patterns) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
1910
|
-
let isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions == "string", opts = isModern ? options : patternsOrOptions, patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns, [crawler, relative3] = getCrawler(patterns, opts);
|
|
1911
|
-
return relative3 ? formatPaths(crawler.sync(), relative3) : crawler.sync();
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
// src/common/js-package-manager/constants.ts
|
|
1915
|
-
var NPM_LOCKFILE = "package-lock.json", PNPM_LOCKFILE = "pnpm-lock.yaml", YARN_LOCKFILE = "yarn.lock", BUN_LOCKFILE = "bun.lock", BUN_LOCKFILE_BINARY = "bun.lockb", LOCK_FILES = [
|
|
1916
|
-
NPM_LOCKFILE,
|
|
1917
|
-
PNPM_LOCKFILE,
|
|
1918
|
-
YARN_LOCKFILE,
|
|
1919
|
-
BUN_LOCKFILE,
|
|
1920
|
-
BUN_LOCKFILE_BINARY
|
|
1921
|
-
];
|
|
1922
|
-
|
|
1923
|
-
// src/common/utils/paths.ts
|
|
1924
|
-
var projectRoot, getProjectRoot = () => {
|
|
1925
|
-
if (projectRoot)
|
|
1926
|
-
return projectRoot;
|
|
1927
|
-
if (process.env.STORYBOOK_PROJECT_ROOT)
|
|
1928
|
-
return process.env.STORYBOOK_PROJECT_ROOT;
|
|
1929
|
-
try {
|
|
1930
|
-
let found = up2(".git") || up2(".svn") || up2(".hg");
|
|
1931
|
-
if (found)
|
|
1932
|
-
return projectRoot = join(found, ".."), projectRoot;
|
|
1933
|
-
} catch (e) {
|
|
1934
|
-
process.stdout.write(`
|
|
1935
|
-
error searching for repository root: ${e}
|
|
1936
|
-
`);
|
|
1937
|
-
}
|
|
1938
|
-
try {
|
|
1939
|
-
let found = any(LOCK_FILES);
|
|
1940
|
-
if (found)
|
|
1941
|
-
return projectRoot = join(found, ".."), projectRoot;
|
|
1942
|
-
} catch (e) {
|
|
1943
|
-
process.stdout.write(`
|
|
1944
|
-
error searching for lock file: ${e}
|
|
1945
|
-
`);
|
|
1946
|
-
}
|
|
1947
|
-
try {
|
|
1948
|
-
let [basePath, rest] = __dirname.split(`${sep2}node_modules${sep2}`, 2);
|
|
1949
|
-
if (rest && !basePath.includes(`${sep2}npm-cache${sep2}`) && !relative2(basePath, process.cwd()).startsWith(".."))
|
|
1950
|
-
return projectRoot = basePath, projectRoot;
|
|
1951
|
-
} catch (e) {
|
|
1952
|
-
process.stdout.write(`
|
|
1953
|
-
error searching for splitDirname: ${e}
|
|
1954
|
-
`);
|
|
1955
|
-
}
|
|
1956
|
-
return projectRoot = process.cwd(), projectRoot;
|
|
1957
|
-
}, invalidateProjectRootCache = () => {
|
|
1958
|
-
projectRoot = void 0;
|
|
1959
|
-
}, findFilesUp = (matchers, baseDir = process.cwd()) => {
|
|
1960
|
-
let matchingFiles = [];
|
|
1961
|
-
for (let directory of up(baseDir, { last: getProjectRoot() }))
|
|
1962
|
-
matchingFiles.push(...globSync(matchers, { cwd: directory, absolute: !0 }));
|
|
1963
|
-
return matchingFiles;
|
|
1964
|
-
}, nodePathsToArray = (nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) => resolve2("./", p)), relativePattern = /^\.{1,2}([/\\]|$)/;
|
|
1965
|
-
function normalizeStoryPath(filename) {
|
|
1966
|
-
return relativePattern.test(filename) ? filename : `.${sep2}${filename}`;
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
// src/common/utils/envs.ts
|
|
1970
|
-
async function loadEnvs(options = {}) {
|
|
1971
|
-
let { getEnvironment } = await import("./lib-5NKX4YGG.js"), defaultNodeEnv = options.production ? "production" : "development", env = {
|
|
1972
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
1973
|
-
NODE_ENV: process.env.NODE_ENV || defaultNodeEnv,
|
|
1974
|
-
NODE_PATH: process.env.NODE_PATH || "",
|
|
1975
|
-
STORYBOOK: process.env.STORYBOOK || "true",
|
|
1976
|
-
// This is to support CRA's public folder feature.
|
|
1977
|
-
// In production we set this to dot(.) to allow the browser to access these assets
|
|
1978
|
-
// even when deployed inside a subpath. (like in GitHub pages)
|
|
1979
|
-
// In development this is just empty as we always serves from the root.
|
|
1980
|
-
PUBLIC_URL: options.production ? "." : ""
|
|
1981
|
-
};
|
|
1982
|
-
Object.keys(process.env).filter((name) => /^STORYBOOK_/.test(name)).forEach((name) => {
|
|
1983
|
-
env[name] = process.env[name];
|
|
1984
|
-
});
|
|
1985
|
-
let base = Object.entries(env).reduce(
|
|
1986
|
-
(acc, [k, v]) => Object.assign(acc, { [k]: JSON.stringify(v) }),
|
|
1987
|
-
{}
|
|
1988
|
-
), { stringified, raw } = getEnvironment({ nodeEnv: env.NODE_ENV }), fullRaw = { ...env, ...raw };
|
|
1989
|
-
return fullRaw.NODE_PATH = nodePathsToArray(fullRaw.NODE_PATH || ""), {
|
|
1990
|
-
stringified: { ...base, ...stringified },
|
|
1991
|
-
raw: fullRaw
|
|
1992
|
-
};
|
|
1993
|
-
}
|
|
1994
|
-
var stringifyEnvs = (raw) => Object.entries(raw).reduce((acc, [key, value]) => (acc[key] = JSON.stringify(value), acc), {}), stringifyProcessEnvs = (raw) => Object.entries(raw).reduce((acc, [key, value]) => (acc[`process.env.${key}`] = JSON.stringify(value), acc), {}), optionalEnvToBoolean = (input) => {
|
|
1995
|
-
if (input !== void 0)
|
|
1996
|
-
return input.toUpperCase() === "FALSE" || input === "0" ? !1 : input.toUpperCase() === "TRUE" || input === "1" ? !0 : !!input;
|
|
1997
|
-
};
|
|
1998
|
-
function isCI() {
|
|
1999
|
-
return optionalEnvToBoolean(process.env.CI);
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
// node_modules/execa/index.js
|
|
2003
|
-
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
2004
|
-
import { Buffer as Buffer3 } from "node:buffer";
|
|
2005
|
-
import path3 from "node:path";
|
|
2006
|
-
import childProcess from "node:child_process";
|
|
2007
|
-
import process6 from "node:process";
|
|
2008
|
-
|
|
2009
|
-
// ../node_modules/strip-final-newline/index.js
|
|
2010
|
-
function stripFinalNewline(input) {
|
|
2011
|
-
let LF = typeof input == "string" ? `
|
|
2012
|
-
` : 10, CR = typeof input == "string" ? "\r" : 13;
|
|
2013
|
-
return input[input.length - 1] === LF && (input = input.slice(0, -1)), input[input.length - 1] === CR && (input = input.slice(0, -1)), input;
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
// node_modules/npm-run-path/index.js
|
|
2017
|
-
import process2 from "node:process";
|
|
2018
|
-
import path2 from "node:path";
|
|
2019
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2020
|
-
|
|
2021
|
-
// node_modules/path-key/index.js
|
|
2022
|
-
function pathKey(options = {}) {
|
|
2023
|
-
let {
|
|
2024
|
-
env = process.env,
|
|
2025
|
-
platform = process.platform
|
|
2026
|
-
} = options;
|
|
2027
|
-
return platform !== "win32" ? "PATH" : Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
// node_modules/npm-run-path/index.js
|
|
2031
|
-
var npmRunPath = ({
|
|
2032
|
-
cwd = process2.cwd(),
|
|
2033
|
-
path: pathOption = process2.env[pathKey()],
|
|
2034
|
-
preferLocal = !0,
|
|
2035
|
-
execPath = process2.execPath,
|
|
2036
|
-
addExecPath = !0
|
|
2037
|
-
} = {}) => {
|
|
2038
|
-
let cwdString = cwd instanceof URL ? fileURLToPath2(cwd) : cwd, cwdPath = path2.resolve(cwdString), result = [];
|
|
2039
|
-
return preferLocal && applyPreferLocal(result, cwdPath), addExecPath && applyExecPath(result, execPath, cwdPath), [...result, pathOption].join(path2.delimiter);
|
|
2040
|
-
}, applyPreferLocal = (result, cwdPath) => {
|
|
2041
|
-
let previous;
|
|
2042
|
-
for (; previous !== cwdPath; )
|
|
2043
|
-
result.push(path2.join(cwdPath, "node_modules/.bin")), previous = cwdPath, cwdPath = path2.resolve(cwdPath, "..");
|
|
2044
|
-
}, applyExecPath = (result, execPath, cwdPath) => {
|
|
2045
|
-
let execPathString = execPath instanceof URL ? fileURLToPath2(execPath) : execPath;
|
|
2046
|
-
result.push(path2.resolve(cwdPath, execPathString, ".."));
|
|
2047
|
-
}, npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
|
|
2048
|
-
env = { ...env };
|
|
2049
|
-
let pathName = pathKey({ env });
|
|
2050
|
-
return options.path = env[pathName], env[pathName] = npmRunPath(options), env;
|
|
2051
|
-
};
|
|
2052
|
-
|
|
2053
|
-
// node_modules/mimic-fn/index.js
|
|
2054
|
-
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
2055
|
-
if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
|
|
2056
|
-
return;
|
|
2057
|
-
let toDescriptor = Object.getOwnPropertyDescriptor(to, property), fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
2058
|
-
!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable || Object.defineProperty(to, property, fromDescriptor);
|
|
2059
|
-
}, canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
2060
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
2061
|
-
}, changePrototype = (to, from) => {
|
|
2062
|
-
let fromPrototype = Object.getPrototypeOf(from);
|
|
2063
|
-
fromPrototype !== Object.getPrototypeOf(to) && Object.setPrototypeOf(to, fromPrototype);
|
|
2064
|
-
}, wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
2065
|
-
${fromBody}`, toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"), changeToString = (to, from, name) => {
|
|
2066
|
-
let withName = name === "" ? "" : `with ${name.trim()}() `, newToString = wrappedToString.bind(null, withName, from.toString());
|
|
2067
|
-
Object.defineProperty(newToString, "name", toStringName), Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
2068
|
-
};
|
|
2069
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = !1 } = {}) {
|
|
2070
|
-
let { name } = to;
|
|
2071
|
-
for (let property of Reflect.ownKeys(from))
|
|
2072
|
-
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
2073
|
-
return changePrototype(to, from), changeToString(to, from, name), to;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
// node_modules/onetime/index.js
|
|
2077
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap(), onetime = (function_, options = {}) => {
|
|
2078
|
-
if (typeof function_ != "function")
|
|
2079
|
-
throw new TypeError("Expected a function");
|
|
2080
|
-
let returnValue, callCount = 0, functionName = function_.displayName || function_.name || "<anonymous>", onetime2 = function(...arguments_) {
|
|
2081
|
-
if (calledFunctions.set(onetime2, ++callCount), callCount === 1)
|
|
2082
|
-
returnValue = function_.apply(this, arguments_), function_ = null;
|
|
2083
|
-
else if (options.throw === !0)
|
|
2084
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
2085
|
-
return returnValue;
|
|
2086
|
-
};
|
|
2087
|
-
return mimicFunction(onetime2, function_), calledFunctions.set(onetime2, callCount), onetime2;
|
|
2088
|
-
};
|
|
2089
|
-
onetime.callCount = (function_) => {
|
|
2090
|
-
if (!calledFunctions.has(function_))
|
|
2091
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
2092
|
-
return calledFunctions.get(function_);
|
|
2093
|
-
};
|
|
2094
|
-
var onetime_default = onetime;
|
|
2095
|
-
|
|
2096
|
-
// node_modules/execa/lib/error.js
|
|
2097
|
-
import process3 from "node:process";
|
|
2098
|
-
|
|
2099
|
-
// node_modules/human-signals/build/src/main.js
|
|
2100
|
-
import { constants as constants2 } from "node:os";
|
|
2101
|
-
|
|
2102
|
-
// node_modules/human-signals/build/src/realtime.js
|
|
2103
|
-
var getRealtimeSignals = () => {
|
|
2104
|
-
let length = SIGRTMAX - SIGRTMIN + 1;
|
|
2105
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
2106
|
-
}, getRealtimeSignal = (value, index) => ({
|
|
2107
|
-
name: `SIGRT${index + 1}`,
|
|
2108
|
-
number: SIGRTMIN + index,
|
|
2109
|
-
action: "terminate",
|
|
2110
|
-
description: "Application-specific signal (realtime)",
|
|
2111
|
-
standard: "posix"
|
|
2112
|
-
}), SIGRTMIN = 34, SIGRTMAX = 64;
|
|
2113
|
-
|
|
2114
|
-
// node_modules/human-signals/build/src/signals.js
|
|
2115
|
-
import { constants } from "node:os";
|
|
2116
|
-
|
|
2117
|
-
// node_modules/human-signals/build/src/core.js
|
|
2118
|
-
var SIGNALS = [
|
|
2119
|
-
{
|
|
2120
|
-
name: "SIGHUP",
|
|
2121
|
-
number: 1,
|
|
2122
|
-
action: "terminate",
|
|
2123
|
-
description: "Terminal closed",
|
|
2124
|
-
standard: "posix"
|
|
2125
|
-
},
|
|
2126
|
-
{
|
|
2127
|
-
name: "SIGINT",
|
|
2128
|
-
number: 2,
|
|
2129
|
-
action: "terminate",
|
|
2130
|
-
description: "User interruption with CTRL-C",
|
|
2131
|
-
standard: "ansi"
|
|
2132
|
-
},
|
|
2133
|
-
{
|
|
2134
|
-
name: "SIGQUIT",
|
|
2135
|
-
number: 3,
|
|
2136
|
-
action: "core",
|
|
2137
|
-
description: "User interruption with CTRL-\\",
|
|
2138
|
-
standard: "posix"
|
|
2139
|
-
},
|
|
2140
|
-
{
|
|
2141
|
-
name: "SIGILL",
|
|
2142
|
-
number: 4,
|
|
2143
|
-
action: "core",
|
|
2144
|
-
description: "Invalid machine instruction",
|
|
2145
|
-
standard: "ansi"
|
|
2146
|
-
},
|
|
2147
|
-
{
|
|
2148
|
-
name: "SIGTRAP",
|
|
2149
|
-
number: 5,
|
|
2150
|
-
action: "core",
|
|
2151
|
-
description: "Debugger breakpoint",
|
|
2152
|
-
standard: "posix"
|
|
2153
|
-
},
|
|
2154
|
-
{
|
|
2155
|
-
name: "SIGABRT",
|
|
2156
|
-
number: 6,
|
|
2157
|
-
action: "core",
|
|
2158
|
-
description: "Aborted",
|
|
2159
|
-
standard: "ansi"
|
|
2160
|
-
},
|
|
2161
|
-
{
|
|
2162
|
-
name: "SIGIOT",
|
|
2163
|
-
number: 6,
|
|
2164
|
-
action: "core",
|
|
2165
|
-
description: "Aborted",
|
|
2166
|
-
standard: "bsd"
|
|
2167
|
-
},
|
|
2168
|
-
{
|
|
2169
|
-
name: "SIGBUS",
|
|
2170
|
-
number: 7,
|
|
2171
|
-
action: "core",
|
|
2172
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
2173
|
-
standard: "bsd"
|
|
2174
|
-
},
|
|
2175
|
-
{
|
|
2176
|
-
name: "SIGEMT",
|
|
2177
|
-
number: 7,
|
|
2178
|
-
action: "terminate",
|
|
2179
|
-
description: "Command should be emulated but is not implemented",
|
|
2180
|
-
standard: "other"
|
|
2181
|
-
},
|
|
2182
|
-
{
|
|
2183
|
-
name: "SIGFPE",
|
|
2184
|
-
number: 8,
|
|
2185
|
-
action: "core",
|
|
2186
|
-
description: "Floating point arithmetic error",
|
|
2187
|
-
standard: "ansi"
|
|
2188
|
-
},
|
|
2189
|
-
{
|
|
2190
|
-
name: "SIGKILL",
|
|
2191
|
-
number: 9,
|
|
2192
|
-
action: "terminate",
|
|
2193
|
-
description: "Forced termination",
|
|
2194
|
-
standard: "posix",
|
|
2195
|
-
forced: !0
|
|
2196
|
-
},
|
|
2197
|
-
{
|
|
2198
|
-
name: "SIGUSR1",
|
|
2199
|
-
number: 10,
|
|
2200
|
-
action: "terminate",
|
|
2201
|
-
description: "Application-specific signal",
|
|
2202
|
-
standard: "posix"
|
|
2203
|
-
},
|
|
2204
|
-
{
|
|
2205
|
-
name: "SIGSEGV",
|
|
2206
|
-
number: 11,
|
|
2207
|
-
action: "core",
|
|
2208
|
-
description: "Segmentation fault",
|
|
2209
|
-
standard: "ansi"
|
|
2210
|
-
},
|
|
2211
|
-
{
|
|
2212
|
-
name: "SIGUSR2",
|
|
2213
|
-
number: 12,
|
|
2214
|
-
action: "terminate",
|
|
2215
|
-
description: "Application-specific signal",
|
|
2216
|
-
standard: "posix"
|
|
2217
|
-
},
|
|
2218
|
-
{
|
|
2219
|
-
name: "SIGPIPE",
|
|
2220
|
-
number: 13,
|
|
2221
|
-
action: "terminate",
|
|
2222
|
-
description: "Broken pipe or socket",
|
|
2223
|
-
standard: "posix"
|
|
2224
|
-
},
|
|
2225
|
-
{
|
|
2226
|
-
name: "SIGALRM",
|
|
2227
|
-
number: 14,
|
|
2228
|
-
action: "terminate",
|
|
2229
|
-
description: "Timeout or timer",
|
|
2230
|
-
standard: "posix"
|
|
2231
|
-
},
|
|
2232
|
-
{
|
|
2233
|
-
name: "SIGTERM",
|
|
2234
|
-
number: 15,
|
|
2235
|
-
action: "terminate",
|
|
2236
|
-
description: "Termination",
|
|
2237
|
-
standard: "ansi"
|
|
2238
|
-
},
|
|
2239
|
-
{
|
|
2240
|
-
name: "SIGSTKFLT",
|
|
2241
|
-
number: 16,
|
|
2242
|
-
action: "terminate",
|
|
2243
|
-
description: "Stack is empty or overflowed",
|
|
2244
|
-
standard: "other"
|
|
2245
|
-
},
|
|
2246
|
-
{
|
|
2247
|
-
name: "SIGCHLD",
|
|
2248
|
-
number: 17,
|
|
2249
|
-
action: "ignore",
|
|
2250
|
-
description: "Child process terminated, paused or unpaused",
|
|
2251
|
-
standard: "posix"
|
|
2252
|
-
},
|
|
2253
|
-
{
|
|
2254
|
-
name: "SIGCLD",
|
|
2255
|
-
number: 17,
|
|
2256
|
-
action: "ignore",
|
|
2257
|
-
description: "Child process terminated, paused or unpaused",
|
|
2258
|
-
standard: "other"
|
|
2259
|
-
},
|
|
2260
|
-
{
|
|
2261
|
-
name: "SIGCONT",
|
|
2262
|
-
number: 18,
|
|
2263
|
-
action: "unpause",
|
|
2264
|
-
description: "Unpaused",
|
|
2265
|
-
standard: "posix",
|
|
2266
|
-
forced: !0
|
|
2267
|
-
},
|
|
2268
|
-
{
|
|
2269
|
-
name: "SIGSTOP",
|
|
2270
|
-
number: 19,
|
|
2271
|
-
action: "pause",
|
|
2272
|
-
description: "Paused",
|
|
2273
|
-
standard: "posix",
|
|
2274
|
-
forced: !0
|
|
2275
|
-
},
|
|
2276
|
-
{
|
|
2277
|
-
name: "SIGTSTP",
|
|
2278
|
-
number: 20,
|
|
2279
|
-
action: "pause",
|
|
2280
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
2281
|
-
standard: "posix"
|
|
2282
|
-
},
|
|
2283
|
-
{
|
|
2284
|
-
name: "SIGTTIN",
|
|
2285
|
-
number: 21,
|
|
2286
|
-
action: "pause",
|
|
2287
|
-
description: "Background process cannot read terminal input",
|
|
2288
|
-
standard: "posix"
|
|
2289
|
-
},
|
|
2290
|
-
{
|
|
2291
|
-
name: "SIGBREAK",
|
|
2292
|
-
number: 21,
|
|
2293
|
-
action: "terminate",
|
|
2294
|
-
description: "User interruption with CTRL-BREAK",
|
|
2295
|
-
standard: "other"
|
|
2296
|
-
},
|
|
2297
|
-
{
|
|
2298
|
-
name: "SIGTTOU",
|
|
2299
|
-
number: 22,
|
|
2300
|
-
action: "pause",
|
|
2301
|
-
description: "Background process cannot write to terminal output",
|
|
2302
|
-
standard: "posix"
|
|
2303
|
-
},
|
|
2304
|
-
{
|
|
2305
|
-
name: "SIGURG",
|
|
2306
|
-
number: 23,
|
|
2307
|
-
action: "ignore",
|
|
2308
|
-
description: "Socket received out-of-band data",
|
|
2309
|
-
standard: "bsd"
|
|
2310
|
-
},
|
|
2311
|
-
{
|
|
2312
|
-
name: "SIGXCPU",
|
|
2313
|
-
number: 24,
|
|
2314
|
-
action: "core",
|
|
2315
|
-
description: "Process timed out",
|
|
2316
|
-
standard: "bsd"
|
|
2317
|
-
},
|
|
2318
|
-
{
|
|
2319
|
-
name: "SIGXFSZ",
|
|
2320
|
-
number: 25,
|
|
2321
|
-
action: "core",
|
|
2322
|
-
description: "File too big",
|
|
2323
|
-
standard: "bsd"
|
|
2324
|
-
},
|
|
2325
|
-
{
|
|
2326
|
-
name: "SIGVTALRM",
|
|
2327
|
-
number: 26,
|
|
2328
|
-
action: "terminate",
|
|
2329
|
-
description: "Timeout or timer",
|
|
2330
|
-
standard: "bsd"
|
|
2331
|
-
},
|
|
2332
|
-
{
|
|
2333
|
-
name: "SIGPROF",
|
|
2334
|
-
number: 27,
|
|
2335
|
-
action: "terminate",
|
|
2336
|
-
description: "Timeout or timer",
|
|
2337
|
-
standard: "bsd"
|
|
2338
|
-
},
|
|
2339
|
-
{
|
|
2340
|
-
name: "SIGWINCH",
|
|
2341
|
-
number: 28,
|
|
2342
|
-
action: "ignore",
|
|
2343
|
-
description: "Terminal window size changed",
|
|
2344
|
-
standard: "bsd"
|
|
2345
|
-
},
|
|
2346
|
-
{
|
|
2347
|
-
name: "SIGIO",
|
|
2348
|
-
number: 29,
|
|
2349
|
-
action: "terminate",
|
|
2350
|
-
description: "I/O is available",
|
|
2351
|
-
standard: "other"
|
|
2352
|
-
},
|
|
2353
|
-
{
|
|
2354
|
-
name: "SIGPOLL",
|
|
2355
|
-
number: 29,
|
|
2356
|
-
action: "terminate",
|
|
2357
|
-
description: "Watched event",
|
|
2358
|
-
standard: "other"
|
|
2359
|
-
},
|
|
2360
|
-
{
|
|
2361
|
-
name: "SIGINFO",
|
|
2362
|
-
number: 29,
|
|
2363
|
-
action: "ignore",
|
|
2364
|
-
description: "Request for process information",
|
|
2365
|
-
standard: "other"
|
|
2366
|
-
},
|
|
2367
|
-
{
|
|
2368
|
-
name: "SIGPWR",
|
|
2369
|
-
number: 30,
|
|
2370
|
-
action: "terminate",
|
|
2371
|
-
description: "Device running out of power",
|
|
2372
|
-
standard: "systemv"
|
|
2373
|
-
},
|
|
2374
|
-
{
|
|
2375
|
-
name: "SIGSYS",
|
|
2376
|
-
number: 31,
|
|
2377
|
-
action: "core",
|
|
2378
|
-
description: "Invalid system call",
|
|
2379
|
-
standard: "other"
|
|
2380
|
-
},
|
|
2381
|
-
{
|
|
2382
|
-
name: "SIGUNUSED",
|
|
2383
|
-
number: 31,
|
|
2384
|
-
action: "terminate",
|
|
2385
|
-
description: "Invalid system call",
|
|
2386
|
-
standard: "other"
|
|
2387
|
-
}
|
|
2388
|
-
];
|
|
2389
|
-
|
|
2390
|
-
// node_modules/human-signals/build/src/signals.js
|
|
2391
|
-
var getSignals = () => {
|
|
2392
|
-
let realtimeSignals = getRealtimeSignals();
|
|
2393
|
-
return [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
2394
|
-
}, normalizeSignal = ({
|
|
2395
|
-
name,
|
|
2396
|
-
number: defaultNumber,
|
|
2397
|
-
description,
|
|
2398
|
-
action,
|
|
2399
|
-
forced = !1,
|
|
2400
|
-
standard
|
|
2401
|
-
}) => {
|
|
2402
|
-
let {
|
|
2403
|
-
signals: { [name]: constantSignal }
|
|
2404
|
-
} = constants, supported = constantSignal !== void 0;
|
|
2405
|
-
return { name, number: supported ? constantSignal : defaultNumber, description, supported, action, forced, standard };
|
|
2406
|
-
};
|
|
2407
|
-
|
|
2408
|
-
// node_modules/human-signals/build/src/main.js
|
|
2409
|
-
var getSignalsByName = () => {
|
|
2410
|
-
let signals2 = getSignals();
|
|
2411
|
-
return Object.fromEntries(signals2.map(getSignalByName));
|
|
2412
|
-
}, getSignalByName = ({
|
|
2413
|
-
name,
|
|
2414
|
-
number,
|
|
2415
|
-
description,
|
|
2416
|
-
supported,
|
|
2417
|
-
action,
|
|
2418
|
-
forced,
|
|
2419
|
-
standard
|
|
2420
|
-
}) => [name, { name, number, description, supported, action, forced, standard }], signalsByName = getSignalsByName(), getSignalsByNumber = () => {
|
|
2421
|
-
let signals2 = getSignals(), length = 65, signalsA = Array.from(
|
|
2422
|
-
{ length },
|
|
2423
|
-
(value, number) => getSignalByNumber(number, signals2)
|
|
2424
|
-
);
|
|
2425
|
-
return Object.assign({}, ...signalsA);
|
|
2426
|
-
}, getSignalByNumber = (number, signals2) => {
|
|
2427
|
-
let signal = findSignalByNumber(number, signals2);
|
|
2428
|
-
if (signal === void 0)
|
|
2429
|
-
return {};
|
|
2430
|
-
let { name, description, supported, action, forced, standard } = signal;
|
|
2431
|
-
return {
|
|
2432
|
-
[number]: {
|
|
2433
|
-
name,
|
|
2434
|
-
number,
|
|
2435
|
-
description,
|
|
2436
|
-
supported,
|
|
2437
|
-
action,
|
|
2438
|
-
forced,
|
|
2439
|
-
standard
|
|
2440
|
-
}
|
|
2441
|
-
};
|
|
2442
|
-
}, findSignalByNumber = (number, signals2) => {
|
|
2443
|
-
let signal = signals2.find(({ name }) => constants2.signals[name] === number);
|
|
2444
|
-
return signal !== void 0 ? signal : signals2.find((signalA) => signalA.number === number);
|
|
2445
|
-
}, signalsByNumber = getSignalsByNumber();
|
|
2446
|
-
|
|
2447
|
-
// node_modules/execa/lib/error.js
|
|
2448
|
-
var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => timedOut ? `timed out after ${timeout} milliseconds` : isCanceled ? "was canceled" : errorCode !== void 0 ? `failed with ${errorCode}` : signal !== void 0 ? `was killed with ${signal} (${signalDescription})` : exitCode !== void 0 ? `failed with exit code ${exitCode}` : "failed", makeError = ({
|
|
2449
|
-
stdout,
|
|
2450
|
-
stderr,
|
|
2451
|
-
all,
|
|
2452
|
-
error,
|
|
2453
|
-
signal,
|
|
2454
|
-
exitCode,
|
|
2455
|
-
command,
|
|
2456
|
-
escapedCommand,
|
|
2457
|
-
timedOut,
|
|
2458
|
-
isCanceled,
|
|
2459
|
-
killed,
|
|
2460
|
-
parsed: { options: { timeout, cwd = process3.cwd() } }
|
|
2461
|
-
}) => {
|
|
2462
|
-
exitCode = exitCode === null ? void 0 : exitCode, signal = signal === null ? void 0 : signal;
|
|
2463
|
-
let signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description, errorCode = error && error.code, execaMessage = `Command ${getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled })}: ${command}`, isError = Object.prototype.toString.call(error) === "[object Error]", shortMessage = isError ? `${execaMessage}
|
|
2464
|
-
${error.message}` : execaMessage, message = [shortMessage, stderr, stdout].filter(Boolean).join(`
|
|
2465
|
-
`);
|
|
2466
|
-
return isError ? (error.originalMessage = error.message, error.message = message) : error = new Error(message), error.shortMessage = shortMessage, error.command = command, error.escapedCommand = escapedCommand, error.exitCode = exitCode, error.signal = signal, error.signalDescription = signalDescription, error.stdout = stdout, error.stderr = stderr, error.cwd = cwd, all !== void 0 && (error.all = all), "bufferedData" in error && delete error.bufferedData, error.failed = !0, error.timedOut = !!timedOut, error.isCanceled = isCanceled, error.killed = killed && !timedOut, error;
|
|
2467
|
-
};
|
|
2468
|
-
|
|
2469
|
-
// node_modules/execa/lib/stdio.js
|
|
2470
|
-
var aliases = ["stdin", "stdout", "stderr"], hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0), normalizeStdio = (options) => {
|
|
2471
|
-
if (!options)
|
|
2472
|
-
return;
|
|
2473
|
-
let { stdio } = options;
|
|
2474
|
-
if (stdio === void 0)
|
|
2475
|
-
return aliases.map((alias) => options[alias]);
|
|
2476
|
-
if (hasAlias(options))
|
|
2477
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
2478
|
-
if (typeof stdio == "string")
|
|
2479
|
-
return stdio;
|
|
2480
|
-
if (!Array.isArray(stdio))
|
|
2481
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
2482
|
-
let length = Math.max(stdio.length, aliases.length);
|
|
2483
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
2484
|
-
};
|
|
2485
|
-
|
|
2486
|
-
// node_modules/execa/lib/kill.js
|
|
2487
|
-
import os from "node:os";
|
|
2488
|
-
|
|
2489
|
-
// node_modules/signal-exit/dist/mjs/signals.js
|
|
2490
|
-
var signals = [];
|
|
2491
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
2492
|
-
process.platform !== "win32" && signals.push(
|
|
2493
|
-
"SIGALRM",
|
|
2494
|
-
"SIGABRT",
|
|
2495
|
-
"SIGVTALRM",
|
|
2496
|
-
"SIGXCPU",
|
|
2497
|
-
"SIGXFSZ",
|
|
2498
|
-
"SIGUSR2",
|
|
2499
|
-
"SIGTRAP",
|
|
2500
|
-
"SIGSYS",
|
|
2501
|
-
"SIGQUIT",
|
|
2502
|
-
"SIGIOT"
|
|
2503
|
-
// should detect profiler and enable/disable accordingly.
|
|
2504
|
-
// see #21
|
|
2505
|
-
// 'SIGPROF'
|
|
2506
|
-
);
|
|
2507
|
-
process.platform === "linux" && signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
2508
|
-
|
|
2509
|
-
// node_modules/signal-exit/dist/mjs/index.js
|
|
2510
|
-
var processOk = (process7) => !!process7 && typeof process7 == "object" && typeof process7.removeListener == "function" && typeof process7.emit == "function" && typeof process7.reallyExit == "function" && typeof process7.listeners == "function" && typeof process7.kill == "function" && typeof process7.pid == "number" && typeof process7.on == "function", kExitEmitter = Symbol.for("signal-exit emitter"), global2 = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object), Emitter = class {
|
|
2511
|
-
emitted = {
|
|
2512
|
-
afterExit: !1,
|
|
2513
|
-
exit: !1
|
|
2514
|
-
};
|
|
2515
|
-
listeners = {
|
|
2516
|
-
afterExit: [],
|
|
2517
|
-
exit: []
|
|
2518
|
-
};
|
|
2519
|
-
count = 0;
|
|
2520
|
-
id = Math.random();
|
|
2521
|
-
constructor() {
|
|
2522
|
-
if (global2[kExitEmitter])
|
|
2523
|
-
return global2[kExitEmitter];
|
|
2524
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
2525
|
-
value: this,
|
|
2526
|
-
writable: !1,
|
|
2527
|
-
enumerable: !1,
|
|
2528
|
-
configurable: !1
|
|
2529
|
-
});
|
|
2530
|
-
}
|
|
2531
|
-
on(ev, fn) {
|
|
2532
|
-
this.listeners[ev].push(fn);
|
|
2533
|
-
}
|
|
2534
|
-
removeListener(ev, fn) {
|
|
2535
|
-
let list = this.listeners[ev], i = list.indexOf(fn);
|
|
2536
|
-
i !== -1 && (i === 0 && list.length === 1 ? list.length = 0 : list.splice(i, 1));
|
|
2537
|
-
}
|
|
2538
|
-
emit(ev, code, signal) {
|
|
2539
|
-
if (this.emitted[ev])
|
|
2540
|
-
return !1;
|
|
2541
|
-
this.emitted[ev] = !0;
|
|
2542
|
-
let ret = !1;
|
|
2543
|
-
for (let fn of this.listeners[ev])
|
|
2544
|
-
ret = fn(code, signal) === !0 || ret;
|
|
2545
|
-
return ev === "exit" && (ret = this.emit("afterExit", code, signal) || ret), ret;
|
|
2546
|
-
}
|
|
2547
|
-
}, SignalExitBase = class {
|
|
2548
|
-
}, signalExitWrap = (handler) => ({
|
|
2549
|
-
onExit(cb, opts) {
|
|
2550
|
-
return handler.onExit(cb, opts);
|
|
2551
|
-
},
|
|
2552
|
-
load() {
|
|
2553
|
-
return handler.load();
|
|
2554
|
-
},
|
|
2555
|
-
unload() {
|
|
2556
|
-
return handler.unload();
|
|
2557
|
-
}
|
|
2558
|
-
}), SignalExitFallback = class extends SignalExitBase {
|
|
2559
|
-
onExit() {
|
|
2560
|
-
return () => {
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
load() {
|
|
2564
|
-
}
|
|
2565
|
-
unload() {
|
|
2566
|
-
}
|
|
2567
|
-
}, SignalExit = class extends SignalExitBase {
|
|
2568
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
2569
|
-
// so use a supported signal instead
|
|
2570
|
-
/* c8 ignore start */
|
|
2571
|
-
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
2572
|
-
/* c8 ignore stop */
|
|
2573
|
-
#emitter = new Emitter();
|
|
2574
|
-
#process;
|
|
2575
|
-
#originalProcessEmit;
|
|
2576
|
-
#originalProcessReallyExit;
|
|
2577
|
-
#sigListeners = {};
|
|
2578
|
-
#loaded = !1;
|
|
2579
|
-
constructor(process7) {
|
|
2580
|
-
super(), this.#process = process7, this.#sigListeners = {};
|
|
2581
|
-
for (let sig of signals)
|
|
2582
|
-
this.#sigListeners[sig] = () => {
|
|
2583
|
-
let listeners = this.#process.listeners(sig), { count } = this.#emitter, p = process7;
|
|
2584
|
-
if (typeof p.__signal_exit_emitter__ == "object" && typeof p.__signal_exit_emitter__.count == "number" && (count += p.__signal_exit_emitter__.count), listeners.length === count) {
|
|
2585
|
-
this.unload();
|
|
2586
|
-
let ret = this.#emitter.emit("exit", null, sig), s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
2587
|
-
ret || process7.kill(process7.pid, s);
|
|
2588
|
-
}
|
|
2589
|
-
};
|
|
2590
|
-
this.#originalProcessReallyExit = process7.reallyExit, this.#originalProcessEmit = process7.emit;
|
|
2591
|
-
}
|
|
2592
|
-
onExit(cb, opts) {
|
|
2593
|
-
if (!processOk(this.#process))
|
|
2594
|
-
return () => {
|
|
2595
|
-
};
|
|
2596
|
-
this.#loaded === !1 && this.load();
|
|
2597
|
-
let ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
2598
|
-
return this.#emitter.on(ev, cb), () => {
|
|
2599
|
-
this.#emitter.removeListener(ev, cb), this.#emitter.listeners.exit.length === 0 && this.#emitter.listeners.afterExit.length === 0 && this.unload();
|
|
2600
|
-
};
|
|
2601
|
-
}
|
|
2602
|
-
load() {
|
|
2603
|
-
if (!this.#loaded) {
|
|
2604
|
-
this.#loaded = !0, this.#emitter.count += 1;
|
|
2605
|
-
for (let sig of signals)
|
|
2606
|
-
try {
|
|
2607
|
-
let fn = this.#sigListeners[sig];
|
|
2608
|
-
fn && this.#process.on(sig, fn);
|
|
2609
|
-
} catch {
|
|
2610
|
-
}
|
|
2611
|
-
this.#process.emit = (ev, ...a) => this.#processEmit(ev, ...a), this.#process.reallyExit = (code) => this.#processReallyExit(code);
|
|
2612
|
-
}
|
|
2613
|
-
}
|
|
2614
|
-
unload() {
|
|
2615
|
-
this.#loaded && (this.#loaded = !1, signals.forEach((sig) => {
|
|
2616
|
-
let listener = this.#sigListeners[sig];
|
|
2617
|
-
if (!listener)
|
|
2618
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
2619
|
-
try {
|
|
2620
|
-
this.#process.removeListener(sig, listener);
|
|
2621
|
-
} catch {
|
|
2622
|
-
}
|
|
2623
|
-
}), this.#process.emit = this.#originalProcessEmit, this.#process.reallyExit = this.#originalProcessReallyExit, this.#emitter.count -= 1);
|
|
2624
|
-
}
|
|
2625
|
-
#processReallyExit(code) {
|
|
2626
|
-
return processOk(this.#process) ? (this.#process.exitCode = code || 0, this.#emitter.emit("exit", this.#process.exitCode, null), this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode)) : 0;
|
|
2627
|
-
}
|
|
2628
|
-
#processEmit(ev, ...args) {
|
|
2629
|
-
let og = this.#originalProcessEmit;
|
|
2630
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
2631
|
-
typeof args[0] == "number" && (this.#process.exitCode = args[0]);
|
|
2632
|
-
let ret = og.call(this.#process, ev, ...args);
|
|
2633
|
-
return this.#emitter.emit("exit", this.#process.exitCode, null), ret;
|
|
2634
|
-
} else
|
|
2635
|
-
return og.call(this.#process, ev, ...args);
|
|
2636
|
-
}
|
|
2637
|
-
}, process4 = globalThis.process, {
|
|
2638
|
-
/**
|
|
2639
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
2640
|
-
* exit, or running out of stuff to do.
|
|
2641
|
-
*
|
|
2642
|
-
* If the global process object is not suitable for instrumentation,
|
|
2643
|
-
* then this will be a no-op.
|
|
2644
|
-
*
|
|
2645
|
-
* Returns a function that may be used to unload signal-exit.
|
|
2646
|
-
*/
|
|
2647
|
-
onExit,
|
|
2648
|
-
/**
|
|
2649
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
2650
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2651
|
-
* Mostly exposed for the benefit of testing.
|
|
2652
|
-
*
|
|
2653
|
-
* @internal
|
|
2654
|
-
*/
|
|
2655
|
-
load,
|
|
2656
|
-
/**
|
|
2657
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
2658
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2659
|
-
* Mostly exposed for the benefit of testing.
|
|
2660
|
-
*
|
|
2661
|
-
* @internal
|
|
2662
|
-
*/
|
|
2663
|
-
unload
|
|
2664
|
-
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
|
|
2665
|
-
|
|
2666
|
-
// node_modules/execa/lib/kill.js
|
|
2667
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5, spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
2668
|
-
let killResult = kill(signal);
|
|
2669
|
-
return setKillTimeout(kill, signal, options, killResult), killResult;
|
|
2670
|
-
}, setKillTimeout = (kill, signal, options, killResult) => {
|
|
2671
|
-
if (!shouldForceKill(signal, options, killResult))
|
|
2672
|
-
return;
|
|
2673
|
-
let timeout = getForceKillAfterTimeout(options), t = setTimeout(() => {
|
|
2674
|
-
kill("SIGKILL");
|
|
2675
|
-
}, timeout);
|
|
2676
|
-
t.unref && t.unref();
|
|
2677
|
-
}, shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== !1 && killResult, isSigterm = (signal) => signal === os.constants.signals.SIGTERM || typeof signal == "string" && signal.toUpperCase() === "SIGTERM", getForceKillAfterTimeout = ({ forceKillAfterTimeout = !0 }) => {
|
|
2678
|
-
if (forceKillAfterTimeout === !0)
|
|
2679
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
2680
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0)
|
|
2681
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
2682
|
-
return forceKillAfterTimeout;
|
|
2683
|
-
}, spawnedCancel = (spawned, context) => {
|
|
2684
|
-
spawned.kill() && (context.isCanceled = !0);
|
|
2685
|
-
}, timeoutKill = (spawned, signal, reject) => {
|
|
2686
|
-
spawned.kill(signal), reject(Object.assign(new Error("Timed out"), { timedOut: !0, signal }));
|
|
2687
|
-
}, setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
2688
|
-
if (timeout === 0 || timeout === void 0)
|
|
2689
|
-
return spawnedPromise;
|
|
2690
|
-
let timeoutId, timeoutPromise = new Promise((resolve3, reject) => {
|
|
2691
|
-
timeoutId = setTimeout(() => {
|
|
2692
|
-
timeoutKill(spawned, killSignal, reject);
|
|
2693
|
-
}, timeout);
|
|
2694
|
-
}), safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
2695
|
-
clearTimeout(timeoutId);
|
|
2696
|
-
});
|
|
2697
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
2698
|
-
}, validateTimeout = ({ timeout }) => {
|
|
2699
|
-
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0))
|
|
2700
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
2701
|
-
}, setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
2702
|
-
if (!cleanup || detached)
|
|
2703
|
-
return timedPromise;
|
|
2704
|
-
let removeExitHandler = onExit(() => {
|
|
2705
|
-
spawned.kill();
|
|
2706
|
-
});
|
|
2707
|
-
return timedPromise.finally(() => {
|
|
2708
|
-
removeExitHandler();
|
|
2709
|
-
});
|
|
2710
|
-
};
|
|
2711
|
-
|
|
2712
|
-
// node_modules/execa/lib/pipe.js
|
|
2713
|
-
import { createWriteStream } from "node:fs";
|
|
2714
|
-
import { ChildProcess } from "node:child_process";
|
|
2715
|
-
|
|
2716
|
-
// node_modules/is-stream/index.js
|
|
2717
|
-
function isStream(stream) {
|
|
2718
|
-
return stream !== null && typeof stream == "object" && typeof stream.pipe == "function";
|
|
2719
|
-
}
|
|
2720
|
-
function isWritableStream(stream) {
|
|
2721
|
-
return isStream(stream) && stream.writable !== !1 && typeof stream._write == "function" && typeof stream._writableState == "object";
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
// node_modules/execa/lib/pipe.js
|
|
2725
|
-
var isExecaChildProcess = (target) => target instanceof ChildProcess && typeof target.then == "function", pipeToTarget = (spawned, streamName, target) => {
|
|
2726
|
-
if (typeof target == "string")
|
|
2727
|
-
return spawned[streamName].pipe(createWriteStream(target)), spawned;
|
|
2728
|
-
if (isWritableStream(target))
|
|
2729
|
-
return spawned[streamName].pipe(target), spawned;
|
|
2730
|
-
if (!isExecaChildProcess(target))
|
|
2731
|
-
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
2732
|
-
if (!isWritableStream(target.stdin))
|
|
2733
|
-
throw new TypeError("The target child process's stdin must be available.");
|
|
2734
|
-
return spawned[streamName].pipe(target.stdin), target;
|
|
2735
|
-
}, addPipeMethods = (spawned) => {
|
|
2736
|
-
spawned.stdout !== null && (spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout")), spawned.stderr !== null && (spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr")), spawned.all !== void 0 && (spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all"));
|
|
2737
|
-
};
|
|
2738
|
-
|
|
2739
|
-
// node_modules/execa/lib/stream.js
|
|
2740
|
-
import { createReadStream, readFileSync } from "node:fs";
|
|
2741
|
-
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
2742
|
-
|
|
2743
|
-
// node_modules/get-stream/source/contents.js
|
|
2744
|
-
var getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
2745
|
-
if (!isAsyncIterable(stream))
|
|
2746
|
-
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
2747
|
-
let state = init();
|
|
2748
|
-
state.length = 0;
|
|
2749
|
-
try {
|
|
2750
|
-
for await (let chunk of stream) {
|
|
2751
|
-
let chunkType = getChunkType(chunk), convertedChunk = convertChunk[chunkType](chunk, state);
|
|
2752
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
2753
|
-
}
|
|
2754
|
-
return appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }), finalize(state);
|
|
2755
|
-
} catch (error) {
|
|
2756
|
-
throw error.bufferedData = finalize(state), error;
|
|
2757
|
-
}
|
|
2758
|
-
}, appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
2759
|
-
let convertedChunk = getFinalChunk(state);
|
|
2760
|
-
convertedChunk !== void 0 && appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
2761
|
-
}, appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
2762
|
-
let chunkSize = getSize(convertedChunk), newLength = state.length + chunkSize;
|
|
2763
|
-
if (newLength <= maxBuffer) {
|
|
2764
|
-
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
2765
|
-
return;
|
|
2766
|
-
}
|
|
2767
|
-
let truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
2768
|
-
throw truncatedChunk !== void 0 && addNewChunk(truncatedChunk, state, addChunk, maxBuffer), new MaxBufferError();
|
|
2769
|
-
}, addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
2770
|
-
state.contents = addChunk(convertedChunk, state, newLength), state.length = newLength;
|
|
2771
|
-
}, isAsyncIterable = (stream) => typeof stream == "object" && stream !== null && typeof stream[Symbol.asyncIterator] == "function", getChunkType = (chunk) => {
|
|
2772
|
-
let typeOfChunk = typeof chunk;
|
|
2773
|
-
if (typeOfChunk === "string")
|
|
2774
|
-
return "string";
|
|
2775
|
-
if (typeOfChunk !== "object" || chunk === null)
|
|
2776
|
-
return "others";
|
|
2777
|
-
if (globalThis.Buffer?.isBuffer(chunk))
|
|
2778
|
-
return "buffer";
|
|
2779
|
-
let prototypeName = objectToString.call(chunk);
|
|
2780
|
-
return prototypeName === "[object ArrayBuffer]" ? "arrayBuffer" : prototypeName === "[object DataView]" ? "dataView" : Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]" ? "typedArray" : "others";
|
|
2781
|
-
}, { toString: objectToString } = Object.prototype, MaxBufferError = class extends Error {
|
|
2782
|
-
name = "MaxBufferError";
|
|
2783
|
-
constructor() {
|
|
2784
|
-
super("maxBuffer exceeded");
|
|
2785
|
-
}
|
|
2786
|
-
};
|
|
2787
|
-
|
|
2788
|
-
// node_modules/get-stream/source/utils.js
|
|
2789
|
-
var identity = (value) => value, noop = () => {
|
|
2790
|
-
}, getContentsProp = ({ contents }) => contents, throwObjectStream = (chunk) => {
|
|
2791
|
-
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
2792
|
-
}, getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
2793
|
-
|
|
2794
|
-
// node_modules/get-stream/source/array-buffer.js
|
|
2795
|
-
async function getStreamAsArrayBuffer(stream, options) {
|
|
2796
|
-
return getStreamContents(stream, arrayBufferMethods, options);
|
|
2797
|
-
}
|
|
2798
|
-
var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) }), useTextEncoder = (chunk) => textEncoder.encode(chunk), textEncoder = new TextEncoder(), useUint8Array = (chunk) => new Uint8Array(chunk), useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength), truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
2799
|
-
let newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
2800
|
-
return new Uint8Array(newContents).set(convertedChunk, previousLength), newContents;
|
|
2801
|
-
}, resizeArrayBufferSlow = (contents, length) => {
|
|
2802
|
-
if (length <= contents.byteLength)
|
|
2803
|
-
return contents;
|
|
2804
|
-
let arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
2805
|
-
return new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0), arrayBuffer;
|
|
2806
|
-
}, resizeArrayBuffer = (contents, length) => {
|
|
2807
|
-
if (length <= contents.maxByteLength)
|
|
2808
|
-
return contents.resize(length), contents;
|
|
2809
|
-
let arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
2810
|
-
return new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0), arrayBuffer;
|
|
2811
|
-
}, getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)), SCALE_FACTOR = 2, finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length), hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype, arrayBufferMethods = {
|
|
2812
|
-
init: initArrayBuffer,
|
|
2813
|
-
convertChunk: {
|
|
2814
|
-
string: useTextEncoder,
|
|
2815
|
-
buffer: useUint8Array,
|
|
2816
|
-
arrayBuffer: useUint8Array,
|
|
2817
|
-
dataView: useUint8ArrayWithOffset,
|
|
2818
|
-
typedArray: useUint8ArrayWithOffset,
|
|
2819
|
-
others: throwObjectStream
|
|
2820
|
-
},
|
|
2821
|
-
getSize: getLengthProp,
|
|
2822
|
-
truncateChunk: truncateArrayBufferChunk,
|
|
2823
|
-
addChunk: addArrayBufferChunk,
|
|
2824
|
-
getFinalChunk: noop,
|
|
2825
|
-
finalize: finalizeArrayBuffer
|
|
2826
|
-
};
|
|
2827
|
-
|
|
2828
|
-
// node_modules/get-stream/source/buffer.js
|
|
2829
|
-
async function getStreamAsBuffer(stream, options) {
|
|
2830
|
-
if (!("Buffer" in globalThis))
|
|
2831
|
-
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
2832
|
-
try {
|
|
2833
|
-
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
2834
|
-
} catch (error) {
|
|
2835
|
-
throw error.bufferedData !== void 0 && (error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData)), error;
|
|
2836
|
-
}
|
|
2837
|
-
}
|
|
2838
|
-
var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
2839
|
-
|
|
2840
|
-
// node_modules/get-stream/source/string.js
|
|
2841
|
-
async function getStreamAsString(stream, options) {
|
|
2842
|
-
return getStreamContents(stream, stringMethods, options);
|
|
2843
|
-
}
|
|
2844
|
-
var initString = () => ({ contents: "", textDecoder: new TextDecoder() }), useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: !0 }), addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk, truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), getFinalStringChunk = ({ textDecoder }) => {
|
|
2845
|
-
let finalChunk = textDecoder.decode();
|
|
2846
|
-
return finalChunk === "" ? void 0 : finalChunk;
|
|
2847
|
-
}, stringMethods = {
|
|
2848
|
-
init: initString,
|
|
2849
|
-
convertChunk: {
|
|
2850
|
-
string: identity,
|
|
2851
|
-
buffer: useTextDecoder,
|
|
2852
|
-
arrayBuffer: useTextDecoder,
|
|
2853
|
-
dataView: useTextDecoder,
|
|
2854
|
-
typedArray: useTextDecoder,
|
|
2855
|
-
others: throwObjectStream
|
|
2856
|
-
},
|
|
2857
|
-
getSize: getLengthProp,
|
|
2858
|
-
truncateChunk: truncateStringChunk,
|
|
2859
|
-
addChunk: addStringChunk,
|
|
2860
|
-
getFinalChunk: getFinalStringChunk,
|
|
2861
|
-
finalize: getContentsProp
|
|
2862
|
-
};
|
|
2863
|
-
|
|
2864
|
-
// node_modules/execa/lib/stream.js
|
|
2865
|
-
var import_merge_stream = __toESM(require_merge_stream(), 1), validateInputOptions = (input) => {
|
|
2866
|
-
if (input !== void 0)
|
|
2867
|
-
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
2868
|
-
}, getInputSync = ({ input, inputFile }) => typeof inputFile != "string" ? input : (validateInputOptions(input), readFileSync(inputFile)), handleInputSync = (options) => {
|
|
2869
|
-
let input = getInputSync(options);
|
|
2870
|
-
if (isStream(input))
|
|
2871
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
2872
|
-
return input;
|
|
2873
|
-
}, getInput = ({ input, inputFile }) => typeof inputFile != "string" ? input : (validateInputOptions(input), createReadStream(inputFile)), handleInput = (spawned, options) => {
|
|
2874
|
-
let input = getInput(options);
|
|
2875
|
-
input !== void 0 && (isStream(input) ? input.pipe(spawned.stdin) : spawned.stdin.end(input));
|
|
2876
|
-
}, makeAllStream = (spawned, { all }) => {
|
|
2877
|
-
if (!all || !spawned.stdout && !spawned.stderr)
|
|
2878
|
-
return;
|
|
2879
|
-
let mixed = (0, import_merge_stream.default)();
|
|
2880
|
-
return spawned.stdout && mixed.add(spawned.stdout), spawned.stderr && mixed.add(spawned.stderr), mixed;
|
|
2881
|
-
}, getBufferedData = async (stream, streamPromise) => {
|
|
2882
|
-
if (!(!stream || streamPromise === void 0)) {
|
|
2883
|
-
await setTimeout2(0), stream.destroy();
|
|
2884
|
-
try {
|
|
2885
|
-
return await streamPromise;
|
|
2886
|
-
} catch (error) {
|
|
2887
|
-
return error.bufferedData;
|
|
2888
|
-
}
|
|
2889
|
-
}
|
|
2890
|
-
}, getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
2891
|
-
if (!(!stream || !buffer))
|
|
2892
|
-
return encoding === "utf8" || encoding === "utf-8" ? getStreamAsString(stream, { maxBuffer }) : encoding === null || encoding === "buffer" ? getStreamAsBuffer(stream, { maxBuffer }) : applyEncoding(stream, maxBuffer, encoding);
|
|
2893
|
-
}, applyEncoding = async (stream, maxBuffer, encoding) => (await getStreamAsBuffer(stream, { maxBuffer })).toString(encoding), getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
2894
|
-
let stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer }), stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer }), allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
2895
|
-
try {
|
|
2896
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
2897
|
-
} catch (error) {
|
|
2898
|
-
return Promise.all([
|
|
2899
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
2900
|
-
getBufferedData(stdout, stdoutPromise),
|
|
2901
|
-
getBufferedData(stderr, stderrPromise),
|
|
2902
|
-
getBufferedData(all, allPromise)
|
|
2903
|
-
]);
|
|
2904
|
-
}
|
|
2905
|
-
};
|
|
2906
|
-
|
|
2907
|
-
// node_modules/execa/lib/promise.js
|
|
2908
|
-
var nativePromisePrototype = (async () => {
|
|
2909
|
-
})().constructor.prototype, descriptors = ["then", "catch", "finally"].map((property) => [
|
|
2910
|
-
property,
|
|
2911
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
2912
|
-
]), mergePromise = (spawned, promise2) => {
|
|
2913
|
-
for (let [property, descriptor] of descriptors) {
|
|
2914
|
-
let value = typeof promise2 == "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
|
|
2915
|
-
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
2916
|
-
}
|
|
2917
|
-
}, getSpawnedPromise = (spawned) => new Promise((resolve3, reject) => {
|
|
2918
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
2919
|
-
resolve3({ exitCode, signal });
|
|
2920
|
-
}), spawned.on("error", (error) => {
|
|
2921
|
-
reject(error);
|
|
2922
|
-
}), spawned.stdin && spawned.stdin.on("error", (error) => {
|
|
2923
|
-
reject(error);
|
|
2924
|
-
});
|
|
2925
|
-
});
|
|
2926
|
-
|
|
2927
|
-
// node_modules/execa/lib/command.js
|
|
2928
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
2929
|
-
import { ChildProcess as ChildProcess2 } from "node:child_process";
|
|
2930
|
-
var normalizeArgs = (file, args = []) => Array.isArray(args) ? [file, ...args] : [file], NO_ESCAPE_REGEXP = /^[\w.-]+$/, escapeArg = (arg) => typeof arg != "string" || NO_ESCAPE_REGEXP.test(arg) ? arg : `"${arg.replaceAll('"', '\\"')}"`, joinCommand = (file, args) => normalizeArgs(file, args).join(" "), getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), SPACES_REGEXP = / +/g, parseCommand = (command) => {
|
|
2931
|
-
let tokens = [];
|
|
2932
|
-
for (let token of command.trim().split(SPACES_REGEXP)) {
|
|
2933
|
-
let previousToken = tokens.at(-1);
|
|
2934
|
-
previousToken && previousToken.endsWith("\\") ? tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}` : tokens.push(token);
|
|
2935
|
-
}
|
|
2936
|
-
return tokens;
|
|
2937
|
-
}, parseExpression = (expression) => {
|
|
2938
|
-
let typeOfExpression = typeof expression;
|
|
2939
|
-
if (typeOfExpression === "string")
|
|
2940
|
-
return expression;
|
|
2941
|
-
if (typeOfExpression === "number")
|
|
2942
|
-
return String(expression);
|
|
2943
|
-
if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
|
|
2944
|
-
let typeOfStdout = typeof expression.stdout;
|
|
2945
|
-
if (typeOfStdout === "string")
|
|
2946
|
-
return expression.stdout;
|
|
2947
|
-
if (Buffer2.isBuffer(expression.stdout))
|
|
2948
|
-
return expression.stdout.toString();
|
|
2949
|
-
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
2950
|
-
}
|
|
2951
|
-
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
2952
|
-
}, concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
2953
|
-
...tokens.slice(0, -1),
|
|
2954
|
-
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
2955
|
-
...nextTokens.slice(1)
|
|
2956
|
-
], parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
2957
|
-
let templateString = template ?? templates.raw[index], templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean), newTokens = concatTokens(
|
|
2958
|
-
tokens,
|
|
2959
|
-
templateTokens,
|
|
2960
|
-
templateString.startsWith(" ")
|
|
2961
|
-
);
|
|
2962
|
-
if (index === expressions.length)
|
|
2963
|
-
return newTokens;
|
|
2964
|
-
let expression = expressions[index], expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
2965
|
-
return concatTokens(
|
|
2966
|
-
newTokens,
|
|
2967
|
-
expressionTokens,
|
|
2968
|
-
templateString.endsWith(" ")
|
|
2969
|
-
);
|
|
2970
|
-
}, parseTemplates = (templates, expressions) => {
|
|
2971
|
-
let tokens = [];
|
|
2972
|
-
for (let [index, template] of templates.entries())
|
|
2973
|
-
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
2974
|
-
return tokens;
|
|
2975
|
-
};
|
|
2976
|
-
|
|
2977
|
-
// node_modules/execa/lib/verbose.js
|
|
2978
|
-
import { debuglog } from "node:util";
|
|
2979
|
-
import process5 from "node:process";
|
|
2980
|
-
var verboseDefault = debuglog("execa").enabled, padField = (field, padding) => String(field).padStart(padding, "0"), getTimestamp = () => {
|
|
2981
|
-
let date = /* @__PURE__ */ new Date();
|
|
2982
|
-
return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
|
|
2983
|
-
}, logCommand = (escapedCommand, { verbose }) => {
|
|
2984
|
-
verbose && process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
2985
|
-
`);
|
|
2986
|
-
};
|
|
2987
|
-
|
|
2988
|
-
// node_modules/execa/index.js
|
|
2989
|
-
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100, getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
2990
|
-
let env = extendEnv ? { ...process6.env, ...envOption } : envOption;
|
|
2991
|
-
return preferLocal ? npmRunPathEnv({ env, cwd: localDir, execPath }) : env;
|
|
2992
|
-
}, handleArguments = (file, args, options = {}) => {
|
|
2993
|
-
let parsed = import_cross_spawn.default._parse(file, args, options);
|
|
2994
|
-
return file = parsed.command, args = parsed.args, options = parsed.options, options = {
|
|
2995
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
2996
|
-
buffer: !0,
|
|
2997
|
-
stripFinalNewline: !0,
|
|
2998
|
-
extendEnv: !0,
|
|
2999
|
-
preferLocal: !1,
|
|
3000
|
-
localDir: options.cwd || process6.cwd(),
|
|
3001
|
-
execPath: process6.execPath,
|
|
3002
|
-
encoding: "utf8",
|
|
3003
|
-
reject: !0,
|
|
3004
|
-
cleanup: !0,
|
|
3005
|
-
all: !1,
|
|
3006
|
-
windowsHide: !0,
|
|
3007
|
-
verbose: verboseDefault,
|
|
3008
|
-
...options
|
|
3009
|
-
}, options.env = getEnv(options), options.stdio = normalizeStdio(options), process6.platform === "win32" && path3.basename(file, ".exe") === "cmd" && args.unshift("/q"), { file, args, options, parsed };
|
|
3010
|
-
}, handleOutput = (options, value, error) => typeof value != "string" && !Buffer3.isBuffer(value) ? error === void 0 ? void 0 : "" : options.stripFinalNewline ? stripFinalNewline(value) : value;
|
|
3011
|
-
function execa(file, args, options) {
|
|
3012
|
-
let parsed = handleArguments(file, args, options), command = joinCommand(file, args), escapedCommand = getEscapedCommand(file, args);
|
|
3013
|
-
logCommand(escapedCommand, parsed.options), validateTimeout(parsed.options);
|
|
3014
|
-
let spawned;
|
|
3015
|
-
try {
|
|
3016
|
-
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
3017
|
-
} catch (error) {
|
|
3018
|
-
let dummySpawned = new childProcess.ChildProcess(), errorPromise = Promise.reject(makeError({
|
|
3019
|
-
error,
|
|
3020
|
-
stdout: "",
|
|
3021
|
-
stderr: "",
|
|
3022
|
-
all: "",
|
|
3023
|
-
command,
|
|
3024
|
-
escapedCommand,
|
|
3025
|
-
parsed,
|
|
3026
|
-
timedOut: !1,
|
|
3027
|
-
isCanceled: !1,
|
|
3028
|
-
killed: !1
|
|
3029
|
-
}));
|
|
3030
|
-
return mergePromise(dummySpawned, errorPromise), dummySpawned;
|
|
3031
|
-
}
|
|
3032
|
-
let spawnedPromise = getSpawnedPromise(spawned), timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise), processDone = setExitHandler(spawned, parsed.options, timedPromise), context = { isCanceled: !1 };
|
|
3033
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)), spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
3034
|
-
let handlePromiseOnce = onetime_default(async () => {
|
|
3035
|
-
let [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone), stdout = handleOutput(parsed.options, stdoutResult), stderr = handleOutput(parsed.options, stderrResult), all = handleOutput(parsed.options, allResult);
|
|
3036
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
3037
|
-
let returnedError = makeError({
|
|
3038
|
-
error,
|
|
3039
|
-
exitCode,
|
|
3040
|
-
signal,
|
|
3041
|
-
stdout,
|
|
3042
|
-
stderr,
|
|
3043
|
-
all,
|
|
3044
|
-
command,
|
|
3045
|
-
escapedCommand,
|
|
3046
|
-
parsed,
|
|
3047
|
-
timedOut,
|
|
3048
|
-
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : !1),
|
|
3049
|
-
killed: spawned.killed
|
|
3050
|
-
});
|
|
3051
|
-
if (!parsed.options.reject)
|
|
3052
|
-
return returnedError;
|
|
3053
|
-
throw returnedError;
|
|
3054
|
-
}
|
|
3055
|
-
return {
|
|
3056
|
-
command,
|
|
3057
|
-
escapedCommand,
|
|
3058
|
-
exitCode: 0,
|
|
3059
|
-
stdout,
|
|
3060
|
-
stderr,
|
|
3061
|
-
all,
|
|
3062
|
-
failed: !1,
|
|
3063
|
-
timedOut: !1,
|
|
3064
|
-
isCanceled: !1,
|
|
3065
|
-
killed: !1
|
|
3066
|
-
};
|
|
3067
|
-
});
|
|
3068
|
-
return handleInput(spawned, parsed.options), spawned.all = makeAllStream(spawned, parsed.options), addPipeMethods(spawned), mergePromise(spawned, handlePromiseOnce), spawned;
|
|
3069
|
-
}
|
|
3070
|
-
function execaSync(file, args, options) {
|
|
3071
|
-
let parsed = handleArguments(file, args, options), command = joinCommand(file, args), escapedCommand = getEscapedCommand(file, args);
|
|
3072
|
-
logCommand(escapedCommand, parsed.options);
|
|
3073
|
-
let input = handleInputSync(parsed.options), result;
|
|
3074
|
-
try {
|
|
3075
|
-
result = childProcess.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
3076
|
-
} catch (error) {
|
|
3077
|
-
throw makeError({
|
|
3078
|
-
error,
|
|
3079
|
-
stdout: "",
|
|
3080
|
-
stderr: "",
|
|
3081
|
-
all: "",
|
|
3082
|
-
command,
|
|
3083
|
-
escapedCommand,
|
|
3084
|
-
parsed,
|
|
3085
|
-
timedOut: !1,
|
|
3086
|
-
isCanceled: !1,
|
|
3087
|
-
killed: !1
|
|
3088
|
-
});
|
|
3089
|
-
}
|
|
3090
|
-
let stdout = handleOutput(parsed.options, result.stdout, result.error), stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
3091
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
3092
|
-
let error = makeError({
|
|
3093
|
-
stdout,
|
|
3094
|
-
stderr,
|
|
3095
|
-
error: result.error,
|
|
3096
|
-
signal: result.signal,
|
|
3097
|
-
exitCode: result.status,
|
|
3098
|
-
command,
|
|
3099
|
-
escapedCommand,
|
|
3100
|
-
parsed,
|
|
3101
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
3102
|
-
isCanceled: !1,
|
|
3103
|
-
killed: result.signal !== null
|
|
3104
|
-
});
|
|
3105
|
-
if (!parsed.options.reject)
|
|
3106
|
-
return error;
|
|
3107
|
-
throw error;
|
|
3108
|
-
}
|
|
3109
|
-
return {
|
|
3110
|
-
command,
|
|
3111
|
-
escapedCommand,
|
|
3112
|
-
exitCode: 0,
|
|
3113
|
-
stdout,
|
|
3114
|
-
stderr,
|
|
3115
|
-
failed: !1,
|
|
3116
|
-
timedOut: !1,
|
|
3117
|
-
isCanceled: !1,
|
|
3118
|
-
killed: !1
|
|
3119
|
-
};
|
|
3120
|
-
}
|
|
3121
|
-
var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}, normalizeScriptOptions = (options = {}) => ({
|
|
3122
|
-
preferLocal: !0,
|
|
3123
|
-
...normalizeScriptStdin(options),
|
|
3124
|
-
...options
|
|
3125
|
-
});
|
|
3126
|
-
function create$(options) {
|
|
3127
|
-
function $2(templatesOrOptions, ...expressions) {
|
|
3128
|
-
if (!Array.isArray(templatesOrOptions))
|
|
3129
|
-
return create$({ ...options, ...templatesOrOptions });
|
|
3130
|
-
let [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
3131
|
-
return execa(file, args, normalizeScriptOptions(options));
|
|
3132
|
-
}
|
|
3133
|
-
return $2.sync = (templates, ...expressions) => {
|
|
3134
|
-
if (!Array.isArray(templates))
|
|
3135
|
-
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
3136
|
-
let [file, ...args] = parseTemplates(templates, expressions);
|
|
3137
|
-
return execaSync(file, args, normalizeScriptOptions(options));
|
|
3138
|
-
}, $2;
|
|
3139
|
-
}
|
|
3140
|
-
var $ = create$();
|
|
3141
|
-
function execaCommand(command, options) {
|
|
3142
|
-
let [file, ...args] = parseCommand(command);
|
|
3143
|
-
return execa(file, args, options);
|
|
3144
|
-
}
|
|
3145
|
-
function execaCommandSync(command, options) {
|
|
3146
|
-
let [file, ...args] = parseCommand(command);
|
|
3147
|
-
return execaSync(file, args, options);
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
export {
|
|
3151
|
-
NPM_LOCKFILE,
|
|
3152
|
-
PNPM_LOCKFILE,
|
|
3153
|
-
YARN_LOCKFILE,
|
|
3154
|
-
BUN_LOCKFILE,
|
|
3155
|
-
BUN_LOCKFILE_BINARY,
|
|
3156
|
-
getProjectRoot,
|
|
3157
|
-
invalidateProjectRootCache,
|
|
3158
|
-
findFilesUp,
|
|
3159
|
-
nodePathsToArray,
|
|
3160
|
-
normalizeStoryPath,
|
|
3161
|
-
loadEnvs,
|
|
3162
|
-
stringifyEnvs,
|
|
3163
|
-
stringifyProcessEnvs,
|
|
3164
|
-
optionalEnvToBoolean,
|
|
3165
|
-
isCI,
|
|
3166
|
-
require_cross_spawn,
|
|
3167
|
-
execa,
|
|
3168
|
-
execaSync,
|
|
3169
|
-
execaCommand,
|
|
3170
|
-
execaCommandSync
|
|
3171
|
-
};
|