vite-plus 0.1.1 → 0.1.3
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/binding/index.cjs +2 -0
- package/binding/index.d.cts +32 -0
- package/dist/global/{prompts-CAIahN1u.js → agent-BE4Xze8Q.js} +380 -1280
- package/dist/global/{browser-CY4NBwxR.js → browser-CBapUTD0.js} +579 -1023
- package/dist/global/{browser-DFpJ6sKb.js → browser-EZnNDcaO.js} +2 -3
- package/dist/global/{chunk-CtfvYSle.js → chunk-CgnkrU7a.js} +13 -22
- package/dist/global/{cli-truncate-BxinOqz5.js → cli-truncate-Da6Y8aM8.js} +25 -74
- package/dist/global/config.js +95 -165
- package/dist/global/create.js +353 -496
- package/dist/global/{terminal-Cb-NuRkb.js → help-BAGHa8fD.js} +22 -54
- package/dist/global/{json-Bfvtp2rL.js → json-BRdVJ52a.js} +24 -58
- package/dist/global/{lib-CibYHP32.js → lib-DxappLRQ.js} +19 -43
- package/dist/global/{log-update-DdU6_LCN.js → log-update-C8WCYCbc.js} +102 -281
- package/dist/global/mcp.js +97 -169
- package/dist/global/migrate.js +223 -72
- package/dist/global/{package-Pq2biU7_.js → package-YAMvX5PJ.js} +6 -13
- package/dist/global/{slice-ansi-BhwAwMdF.js → slice-ansi-Fap0ehe9.js} +21 -52
- package/dist/global/{src-C6aLHRsS.js → src-DwSJ0s0I.js} +28 -110
- package/dist/global/staged.js +654 -1521
- package/dist/global/{strip-ansi-BL-dgd7n.js → strip-ansi-CE-VDMdw.js} +20 -67
- package/dist/global/version.js +16 -37
- package/dist/global/{workspace-De4OKHV7.js → workspace-lRm8huz4.js} +1645 -2806
- package/dist/global/wrap-ansi-Ou9oAs-a.js +3 -0
- package/dist/global/{wrap-ansi-Iww6Ak1s.js → wrap-ansi-eywLlPVQ.js} +29 -80
- package/dist/index.d.ts +1 -1
- package/dist/init-config.js +10 -2
- package/dist/run-config.d.ts +17 -0
- package/dist/utils/agent.d.ts +15 -1
- package/dist/utils/agent.js +104 -20
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +2 -0
- package/dist/utils/editor.d.ts +16 -3
- package/dist/utils/editor.js +55 -17
- package/dist/utils/prompts.d.ts +32 -3
- package/dist/utils/prompts.js +32 -8
- package/dist/utils/skills.js +18 -2
- package/dist/utils/tsconfig.d.ts +6 -0
- package/dist/utils/tsconfig.js +16 -0
- package/package.json +13 -13
- package/templates/monorepo/package.json +1 -1
- package/dist/global/wrap-ansi-BJxjUEQR.js +0 -4
- package/dist/oxlint-config.d.ts +0 -498
- package/dist/oxlint-config.js +0 -309
package/dist/global/staged.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-
|
|
2
|
-
import { t as lib_default } from "./lib-
|
|
3
|
-
import {
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-CgnkrU7a.js";
|
|
2
|
+
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
3
|
+
import { r as log, t as renderCliDoc } from "./help-BAGHa8fD.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { formatWithOptions, inspect, stripVTControlCharacters } from "node:util";
|
|
6
6
|
import process$1 from "node:process";
|
|
@@ -24,7 +24,6 @@ import { randomUUID } from "crypto";
|
|
|
24
24
|
import EventEmitter$1 from "events";
|
|
25
25
|
import { EOL as EOL$1 } from "node:os";
|
|
26
26
|
import crypto from "node:crypto";
|
|
27
|
-
|
|
28
27
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/colors.js
|
|
29
28
|
/**
|
|
30
29
|
* @example NO_COLOR
|
|
@@ -49,43 +48,27 @@ const FALSY_ENV_VAR_VALUES = ["0", "false"];
|
|
|
49
48
|
*/
|
|
50
49
|
const supportsAnsiColors = (p = process, isTty = nodeTty.isatty(1)) => {
|
|
51
50
|
const noColor = p?.env?.NO_COLOR?.toLowerCase();
|
|
52
|
-
if (TRUTHRY_ENV_VAR_VALUES.includes(noColor))
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
51
|
+
if (TRUTHRY_ENV_VAR_VALUES.includes(noColor)) return false;
|
|
55
52
|
const forceColor = p?.env?.FORCE_COLOR?.toLowerCase();
|
|
56
|
-
if (TRUTHRY_ENV_VAR_VALUES.includes(forceColor))
|
|
57
|
-
|
|
58
|
-
} else if (FALSY_ENV_VAR_VALUES.includes(forceColor)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
53
|
+
if (TRUTHRY_ENV_VAR_VALUES.includes(forceColor)) return true;
|
|
54
|
+
else if (FALSY_ENV_VAR_VALUES.includes(forceColor)) return false;
|
|
61
55
|
const forceTty = p?.env?.FORCE_TTY;
|
|
62
|
-
if (TRUTHRY_ENV_VAR_VALUES.includes(forceTty))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
if (isTty) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
56
|
+
if (TRUTHRY_ENV_VAR_VALUES.includes(forceTty)) return true;
|
|
57
|
+
else if (FALSY_ENV_VAR_VALUES.includes(forceTty)) return false;
|
|
58
|
+
if (isTty) return true;
|
|
70
59
|
/**
|
|
71
60
|
* Assume CI supports color
|
|
72
61
|
* @see {@link https://github.com/alexeyraspopov/picocolors/blob/0e7c4af2de299dd7bc5916f2bddd151fa2f66740/picocolors.js#L4}
|
|
73
62
|
* @see {@link https://github.com/tinylibs/tinyrainbow/blob/071034bf2eafa28d91ef0ba48a3837420d81a40a/src/index.ts#L91}
|
|
74
63
|
*/
|
|
75
|
-
if (TRUTHRY_ENV_VAR_VALUES.includes(p?.env?.CI))
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
if (p?.env?.TERM && p.env.TERM === "dumb") {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
64
|
+
if (TRUTHRY_ENV_VAR_VALUES.includes(p?.env?.CI)) return true;
|
|
65
|
+
if (p?.env?.TERM && p.env.TERM === "dumb") return false;
|
|
81
66
|
/**
|
|
82
67
|
* Assume Windows supports color
|
|
83
68
|
* @see {@link https://github.com/alexeyraspopov/picocolors/blob/0e7c4af2de299dd7bc5916f2bddd151fa2f66740/picocolors.js#L4}
|
|
84
69
|
* @see {@link https://github.com/tinylibs/tinyrainbow/blob/071034bf2eafa28d91ef0ba48a3837420d81a40a/src/index.ts#L89}
|
|
85
70
|
*/
|
|
86
|
-
if (p?.platform === "win32")
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
71
|
+
if (p?.platform === "win32") return true;
|
|
89
72
|
return false;
|
|
90
73
|
};
|
|
91
74
|
/**
|
|
@@ -109,26 +92,21 @@ const ANSI_RESET = "\x1B[0m";
|
|
|
109
92
|
*
|
|
110
93
|
*/
|
|
111
94
|
const wrapAnsiColor = (code, supported = SUPPORTS_COLOR) => {
|
|
112
|
-
if (supported)
|
|
113
|
-
return (text) => code + text + ANSI_RESET;
|
|
114
|
-
}
|
|
95
|
+
if (supported) return (text) => code + text + ANSI_RESET;
|
|
115
96
|
return (text) => text;
|
|
116
97
|
};
|
|
117
98
|
const red$1 = wrapAnsiColor("\x1B[0;31m");
|
|
118
|
-
|
|
99
|
+
wrapAnsiColor("\x1B[0;32m");
|
|
119
100
|
const yellow$1 = wrapAnsiColor("\x1B[0;33m");
|
|
120
101
|
const blue$1 = wrapAnsiColor("\x1B[0;34m");
|
|
121
102
|
const blackBright$1 = wrapAnsiColor("\x1B[0;90m");
|
|
122
103
|
const bold$1 = wrapAnsiColor("\x1B[1m");
|
|
123
|
-
|
|
124
104
|
//#endregion
|
|
125
105
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/debug.js
|
|
126
106
|
const format$1 = (...args) => formatWithOptions({ colors: SUPPORTS_COLOR }, ...args);
|
|
127
107
|
let activeLogger;
|
|
128
108
|
const enableDebug = (logger = console) => {
|
|
129
|
-
if (!activeLogger)
|
|
130
|
-
activeLogger = logger;
|
|
131
|
-
}
|
|
109
|
+
if (!activeLogger) activeLogger = logger;
|
|
132
110
|
};
|
|
133
111
|
/** @param {string} name */
|
|
134
112
|
const createDebug = (name) => {
|
|
@@ -141,7 +119,6 @@ const createDebug = (name) => {
|
|
|
141
119
|
activeLogger.debug(blackBright$1(name + ": ") + format$1(...args) + blackBright$1(` +${ms}ms`));
|
|
142
120
|
};
|
|
143
121
|
};
|
|
144
|
-
|
|
145
122
|
//#endregion
|
|
146
123
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/context.js
|
|
147
124
|
const getContext = (raw) => ({
|
|
@@ -156,7 +133,6 @@ const getContext = (raw) => ({
|
|
|
156
133
|
}
|
|
157
134
|
});
|
|
158
135
|
const getCommandPart = (part) => /[^\w./-]/.test(part) ? `'${part.replaceAll("'", "'\\''")}'` : part;
|
|
159
|
-
|
|
160
136
|
//#endregion
|
|
161
137
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/options.js
|
|
162
138
|
const getOptions = ({ stdin, stdout, stderr, stdio = [
|
|
@@ -168,12 +144,12 @@ const getOptions = ({ stdin, stdout, stderr, stdio = [
|
|
|
168
144
|
const env = envOption ? {
|
|
169
145
|
...process$1.env,
|
|
170
146
|
...envOption
|
|
171
|
-
} :
|
|
147
|
+
} : void 0;
|
|
172
148
|
const input = stdio[0]?.string;
|
|
173
149
|
return {
|
|
174
150
|
...options,
|
|
175
151
|
input,
|
|
176
|
-
stdio: input ===
|
|
152
|
+
stdio: input === void 0 ? stdio : ["pipe", ...stdio.slice(1)],
|
|
177
153
|
env: preferLocal ? addLocalPath(env ?? process$1.env, cwd) : env,
|
|
178
154
|
cwd
|
|
179
155
|
};
|
|
@@ -187,7 +163,6 @@ const addLocalPath = ({ Path = "", PATH = Path, ...env }, cwd) => {
|
|
|
187
163
|
};
|
|
188
164
|
};
|
|
189
165
|
const getLocalPaths = (localPaths, localPath) => localPaths.at(-1) === localPath ? localPaths : getLocalPaths([...localPaths, localPath], path.resolve(localPath, ".."));
|
|
190
|
-
|
|
191
166
|
//#endregion
|
|
192
167
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/windows.js
|
|
193
168
|
const applyForceShell = async (file, commandArguments, options) => await shouldForceShell(file, options) ? [
|
|
@@ -219,14 +194,11 @@ const mIsExe = memoize(async (file, cwd, PATH) => {
|
|
|
219
194
|
const exeExtensions = [".exe", ".com"];
|
|
220
195
|
const escapeArgument = (argument) => escapeFile(escapeFile(`"${argument.replaceAll(/(\\*)"/g, "$1$1\\\"").replace(/(\\*)$/, "$1$1")}"`));
|
|
221
196
|
const escapeFile = (file) => file.replaceAll(/([()\][%!^"`<>&|;, *?])/g, "^$1");
|
|
222
|
-
|
|
223
197
|
//#endregion
|
|
224
198
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/result.js
|
|
225
199
|
const getResult = async (nodeChildProcess, { input }, context) => {
|
|
226
200
|
const instance = await nodeChildProcess;
|
|
227
|
-
if (input !==
|
|
228
|
-
instance.stdin.end(input);
|
|
229
|
-
}
|
|
201
|
+
if (input !== void 0) instance.stdin.end(input);
|
|
230
202
|
const onClose = once(instance, "close");
|
|
231
203
|
try {
|
|
232
204
|
await Promise.race([onClose, ...instance.stdio.filter(Boolean).map((stream) => onStreamError(stream))]);
|
|
@@ -238,19 +210,11 @@ const getResult = async (nodeChildProcess, { input }, context) => {
|
|
|
238
210
|
}
|
|
239
211
|
};
|
|
240
212
|
const onStreamError = async (stream) => {
|
|
241
|
-
for await (const [error] of on(stream, "error"))
|
|
242
|
-
if (!["ERR_STREAM_PREMATURE_CLOSE", "EPIPE"].includes(error?.code)) {
|
|
243
|
-
throw error;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
213
|
+
for await (const [error] of on(stream, "error")) if (!["ERR_STREAM_PREMATURE_CLOSE", "EPIPE"].includes(error?.code)) throw error;
|
|
246
214
|
};
|
|
247
215
|
const checkFailure = ({ command }, { exitCode, signalName }) => {
|
|
248
|
-
if (signalName !==
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
if (exitCode !== undefined) {
|
|
252
|
-
throw new SubprocessError(`Command failed with exit code ${exitCode}: ${command}`);
|
|
253
|
-
}
|
|
216
|
+
if (signalName !== void 0) throw new SubprocessError(`Command was terminated with ${signalName}: ${command}`);
|
|
217
|
+
if (exitCode !== void 0) throw new SubprocessError(`Command failed with exit code ${exitCode}: ${command}`);
|
|
254
218
|
};
|
|
255
219
|
const getResultError = (error, instance, context) => Object.assign(getErrorInstance(error, context), getErrorOutput(instance), getOutputs(context));
|
|
256
220
|
const getErrorInstance = (error, { command }) => error instanceof SubprocessError ? error : new SubprocessError(`Command failed: ${command}`, { cause: error });
|
|
@@ -269,7 +233,6 @@ const getOutputs = ({ state: { stdout, stderr, output }, command, start }) => ({
|
|
|
269
233
|
durationMs: Number(process$1.hrtime.bigint() - start) / 1e6
|
|
270
234
|
});
|
|
271
235
|
const getOutput = (output) => output.at(-1) === "\n" ? output.slice(0, output.at(-2) === "\r" ? -2 : -1) : output;
|
|
272
|
-
|
|
273
236
|
//#endregion
|
|
274
237
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/spawn.js
|
|
275
238
|
const spawnSubprocess = async (file, commandArguments, options, context) => {
|
|
@@ -311,7 +274,6 @@ const bufferOutput = (stream, { state }, streamName) => {
|
|
|
311
274
|
}
|
|
312
275
|
}
|
|
313
276
|
};
|
|
314
|
-
|
|
315
277
|
//#endregion
|
|
316
278
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/pipe.js
|
|
317
279
|
const handlePipe = async (subprocesses) => {
|
|
@@ -320,9 +282,7 @@ const handlePipe = async (subprocesses) => {
|
|
|
320
282
|
to.reason.pipedFrom = from.reason ?? from.value;
|
|
321
283
|
throw to.reason;
|
|
322
284
|
}
|
|
323
|
-
if (from.reason)
|
|
324
|
-
throw from.reason;
|
|
325
|
-
}
|
|
285
|
+
if (from.reason) throw from.reason;
|
|
326
286
|
return {
|
|
327
287
|
...to.value,
|
|
328
288
|
pipedFrom: from.value
|
|
@@ -331,12 +291,8 @@ const handlePipe = async (subprocesses) => {
|
|
|
331
291
|
const pipeStreams = async (subprocesses) => {
|
|
332
292
|
try {
|
|
333
293
|
const [{ stdout }, { stdin }] = await Promise.all(subprocesses.map(({ nodeChildProcess }) => nodeChildProcess));
|
|
334
|
-
if (stdin === null)
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
if (stdout === null) {
|
|
338
|
-
throw new Error("The \"stdout\" option must be set on the last \"spawn()\" call in the pipeline.");
|
|
339
|
-
}
|
|
294
|
+
if (stdin === null) throw new Error("The \"stdin\" option must be set on the first \"spawn()\" call in the pipeline.");
|
|
295
|
+
if (stdout === null) throw new Error("The \"stdout\" option must be set on the last \"spawn()\" call in the pipeline.");
|
|
340
296
|
pipeline(stdout, stdin).catch(() => {});
|
|
341
297
|
} catch (error) {
|
|
342
298
|
await Promise.allSettled(subprocesses.map(({ nodeChildProcess }) => closeStdin(nodeChildProcess)));
|
|
@@ -347,14 +303,11 @@ const closeStdin = async (nodeChildProcess) => {
|
|
|
347
303
|
const { stdin } = await nodeChildProcess;
|
|
348
304
|
stdin.end();
|
|
349
305
|
};
|
|
350
|
-
|
|
351
306
|
//#endregion
|
|
352
307
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/iterable.js
|
|
353
308
|
const lineIterator = async function* (subprocess, { state }, streamName, index) {
|
|
354
|
-
if (state.isIterating[streamName] === false)
|
|
355
|
-
throw new Error(`The subprocess must be iterated right away, for example:
|
|
309
|
+
if (state.isIterating[streamName] === false) throw new Error(`The subprocess must be iterated right away, for example:
|
|
356
310
|
for await (const line of spawn(...)) { ... }`);
|
|
357
|
-
}
|
|
358
311
|
state.isIterating[streamName] = true;
|
|
359
312
|
try {
|
|
360
313
|
const { [streamName]: stream } = await subprocess.nodeChildProcess;
|
|
@@ -399,7 +352,6 @@ const getNext = async (iterator, index, { nonIterable }) => {
|
|
|
399
352
|
}
|
|
400
353
|
};
|
|
401
354
|
const shouldIgnoreError = (nonIterable, index) => nonIterable.every(Boolean) ? index !== nonIterable.length - 1 : nonIterable[index];
|
|
402
|
-
|
|
403
355
|
//#endregion
|
|
404
356
|
//#region ../../node_modules/.pnpm/nano-spawn@2.0.0/node_modules/nano-spawn/source/index.js
|
|
405
357
|
function spawn$2(file, second, third, previous) {
|
|
@@ -420,7 +372,6 @@ function spawn$2(file, second, third, previous) {
|
|
|
420
372
|
pipe: (file, second, third) => spawn$2(file, second, third, subprocess)
|
|
421
373
|
});
|
|
422
374
|
}
|
|
423
|
-
|
|
424
375
|
//#endregion
|
|
425
376
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/execGit.js
|
|
426
377
|
const debugLog$15 = createDebug("lint-staged:execGit");
|
|
@@ -429,28 +380,22 @@ const debugLog$15 = createDebug("lint-staged:execGit");
|
|
|
429
380
|
* @see https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulerecurse
|
|
430
381
|
*/
|
|
431
382
|
const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
|
|
432
|
-
|
|
383
|
+
[...NO_SUBMODULE_RECURSE];
|
|
433
384
|
/** @type {(cmd: string[], options?: import('nano-spawn').Options) => Promise<string>} */
|
|
434
385
|
const execGit = async (cmd, options) => {
|
|
435
386
|
debugLog$15("Running git command", cmd);
|
|
436
387
|
try {
|
|
437
|
-
|
|
388
|
+
return (await spawn$2("git", [...NO_SUBMODULE_RECURSE, ...cmd], {
|
|
438
389
|
...options,
|
|
439
390
|
cwd: options?.cwd ?? process.cwd(),
|
|
440
391
|
stdin: "ignore"
|
|
441
|
-
});
|
|
442
|
-
return result.stdout;
|
|
392
|
+
})).stdout;
|
|
443
393
|
} catch (error) {
|
|
444
|
-
if (error instanceof SubprocessError) {
|
|
445
|
-
throw new Error(error.output, { cause: error });
|
|
446
|
-
}
|
|
394
|
+
if (error instanceof SubprocessError) throw new Error(error.output, { cause: error });
|
|
447
395
|
throw error;
|
|
448
396
|
}
|
|
449
397
|
};
|
|
450
|
-
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
453
|
-
var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
398
|
+
var eventemitter3_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
454
399
|
var has = Object.prototype.hasOwnProperty, prefix = "~";
|
|
455
400
|
/**
|
|
456
401
|
* Constructor to create a storage for our `EE` objects.
|
|
@@ -490,9 +435,7 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
490
435
|
* @private
|
|
491
436
|
*/
|
|
492
437
|
function addListener(emitter, event, fn, context, once) {
|
|
493
|
-
if (typeof fn !== "function")
|
|
494
|
-
throw new TypeError("The listener must be a function");
|
|
495
|
-
}
|
|
438
|
+
if (typeof fn !== "function") throw new TypeError("The listener must be a function");
|
|
496
439
|
var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
|
|
497
440
|
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
498
441
|
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
@@ -531,12 +474,8 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
531
474
|
EventEmitter.prototype.eventNames = function eventNames() {
|
|
532
475
|
var names = [], events, name;
|
|
533
476
|
if (this._eventsCount === 0) return names;
|
|
534
|
-
for (name in events = this._events)
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
if (Object.getOwnPropertySymbols) {
|
|
538
|
-
return names.concat(Object.getOwnPropertySymbols(events));
|
|
539
|
-
}
|
|
477
|
+
for (name in events = this._events) if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
478
|
+
if (Object.getOwnPropertySymbols) return names.concat(Object.getOwnPropertySymbols(events));
|
|
540
479
|
return names;
|
|
541
480
|
};
|
|
542
481
|
/**
|
|
@@ -550,9 +489,7 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
550
489
|
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
551
490
|
if (!handlers) return [];
|
|
552
491
|
if (handlers.fn) return [handlers.fn];
|
|
553
|
-
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++)
|
|
554
|
-
ee[i] = handlers[i].fn;
|
|
555
|
-
}
|
|
492
|
+
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) ee[i] = handlers[i].fn;
|
|
556
493
|
return ee;
|
|
557
494
|
};
|
|
558
495
|
/**
|
|
@@ -580,7 +517,7 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
580
517
|
if (!this._events[evt]) return false;
|
|
581
518
|
var listeners = this._events[evt], len = arguments.length, args, i;
|
|
582
519
|
if (listeners.fn) {
|
|
583
|
-
if (listeners.once) this.removeListener(event, listeners.fn,
|
|
520
|
+
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
|
|
584
521
|
switch (len) {
|
|
585
522
|
case 1: return listeners.fn.call(listeners.context), true;
|
|
586
523
|
case 2: return listeners.fn.call(listeners.context, a1), true;
|
|
@@ -589,14 +526,12 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
589
526
|
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
590
527
|
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
591
528
|
}
|
|
592
|
-
for (i = 1, args = new Array(len - 1); i < len; i++)
|
|
593
|
-
args[i - 1] = arguments[i];
|
|
594
|
-
}
|
|
529
|
+
for (i = 1, args = new Array(len - 1); i < len; i++) args[i - 1] = arguments[i];
|
|
595
530
|
listeners.fn.apply(listeners.context, args);
|
|
596
531
|
} else {
|
|
597
532
|
var length = listeners.length, j;
|
|
598
533
|
for (i = 0; i < length; i++) {
|
|
599
|
-
if (listeners[i].once) this.removeListener(event, listeners[i].fn,
|
|
534
|
+
if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
|
|
600
535
|
switch (len) {
|
|
601
536
|
case 1:
|
|
602
537
|
listeners[i].fn.call(listeners[i].context);
|
|
@@ -611,9 +546,7 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
611
546
|
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
612
547
|
break;
|
|
613
548
|
default:
|
|
614
|
-
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++)
|
|
615
|
-
args[j - 1] = arguments[j];
|
|
616
|
-
}
|
|
549
|
+
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) args[j - 1] = arguments[j];
|
|
617
550
|
listeners[i].fn.apply(listeners[i].context, args);
|
|
618
551
|
}
|
|
619
552
|
}
|
|
@@ -663,15 +596,9 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
663
596
|
}
|
|
664
597
|
var listeners = this._events[evt];
|
|
665
598
|
if (listeners.fn) {
|
|
666
|
-
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context))
|
|
667
|
-
clearEvent(this, evt);
|
|
668
|
-
}
|
|
599
|
+
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) clearEvent(this, evt);
|
|
669
600
|
} else {
|
|
670
|
-
for (var i = 0, events = [], length = listeners.length; i < length; i++)
|
|
671
|
-
if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
|
672
|
-
events.push(listeners[i]);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
601
|
+
for (var i = 0, events = [], length = listeners.length; i < length; i++) if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) events.push(listeners[i]);
|
|
675
602
|
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
676
603
|
else clearEvent(this, evt);
|
|
677
604
|
}
|
|
@@ -699,16 +626,8 @@ var require_eventemitter3 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
699
626
|
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
700
627
|
EventEmitter.prefixed = prefix;
|
|
701
628
|
EventEmitter.EventEmitter = EventEmitter;
|
|
702
|
-
if ("undefined" !== typeof module)
|
|
703
|
-
|
|
704
|
-
}
|
|
705
|
-
}));
|
|
706
|
-
|
|
707
|
-
//#endregion
|
|
708
|
-
//#region ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
709
|
-
var import_eventemitter3 = /* @__PURE__ */ __toESM(require_eventemitter3(), 1);
|
|
710
|
-
var eventemitter3_default = import_eventemitter3.default;
|
|
711
|
-
|
|
629
|
+
if ("undefined" !== typeof module) module.exports = EventEmitter;
|
|
630
|
+
})))(), 1)).default;
|
|
712
631
|
//#endregion
|
|
713
632
|
//#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
|
|
714
633
|
const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
@@ -721,7 +640,7 @@ const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "C
|
|
|
721
640
|
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
722
641
|
const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
723
642
|
const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
724
|
-
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string ===
|
|
643
|
+
const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
|
|
725
644
|
const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
726
645
|
const colors = {
|
|
727
646
|
reset: init(0, 0),
|
|
@@ -771,29 +690,22 @@ const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors
|
|
|
771
690
|
[key]: String
|
|
772
691
|
}), {});
|
|
773
692
|
const { reset, bold, dim, italic, underline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
|
|
774
|
-
|
|
775
693
|
//#endregion
|
|
776
|
-
//#region ../../node_modules/.pnpm/
|
|
777
|
-
var
|
|
694
|
+
//#region ../../node_modules/.pnpm/listr2@9.0.5/node_modules/listr2/dist/index.js
|
|
695
|
+
var import_rfdc = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
778
696
|
module.exports = rfdc;
|
|
779
697
|
function copyBuffer(cur) {
|
|
780
|
-
if (cur instanceof Buffer)
|
|
781
|
-
return Buffer.from(cur);
|
|
782
|
-
}
|
|
698
|
+
if (cur instanceof Buffer) return Buffer.from(cur);
|
|
783
699
|
return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
|
|
784
700
|
}
|
|
785
701
|
function rfdc(opts) {
|
|
786
702
|
opts = opts || {};
|
|
787
703
|
if (opts.circles) return rfdcCircles(opts);
|
|
788
|
-
const constructorHandlers = new Map();
|
|
704
|
+
const constructorHandlers = /* @__PURE__ */ new Map();
|
|
789
705
|
constructorHandlers.set(Date, (o) => new Date(o));
|
|
790
706
|
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
|
791
707
|
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
|
792
|
-
if (opts.constructorHandlers)
|
|
793
|
-
for (const handler of opts.constructorHandlers) {
|
|
794
|
-
constructorHandlers.set(handler[0], handler[1]);
|
|
795
|
-
}
|
|
796
|
-
}
|
|
708
|
+
if (opts.constructorHandlers) for (const handler of opts.constructorHandlers) constructorHandlers.set(handler[0], handler[1]);
|
|
797
709
|
let handler = null;
|
|
798
710
|
return opts.proto ? cloneProto : clone;
|
|
799
711
|
function cloneArray(a, fn) {
|
|
@@ -802,58 +714,39 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
802
714
|
for (let i = 0; i < keys.length; i++) {
|
|
803
715
|
const k = keys[i];
|
|
804
716
|
const cur = a[k];
|
|
805
|
-
if (typeof cur !== "object" || cur === null)
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
810
|
-
a2[k] = copyBuffer(cur);
|
|
811
|
-
} else {
|
|
812
|
-
a2[k] = fn(cur);
|
|
813
|
-
}
|
|
717
|
+
if (typeof cur !== "object" || cur === null) a2[k] = cur;
|
|
718
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
|
|
719
|
+
else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
|
|
720
|
+
else a2[k] = fn(cur);
|
|
814
721
|
}
|
|
815
722
|
return a2;
|
|
816
723
|
}
|
|
817
724
|
function clone(o) {
|
|
818
725
|
if (typeof o !== "object" || o === null) return o;
|
|
819
726
|
if (Array.isArray(o)) return cloneArray(o, clone);
|
|
820
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor)))
|
|
821
|
-
return handler(o, clone);
|
|
822
|
-
}
|
|
727
|
+
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
|
|
823
728
|
const o2 = {};
|
|
824
729
|
for (const k in o) {
|
|
825
730
|
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
|
826
731
|
const cur = o[k];
|
|
827
|
-
if (typeof cur !== "object" || cur === null)
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
832
|
-
o2[k] = copyBuffer(cur);
|
|
833
|
-
} else {
|
|
834
|
-
o2[k] = clone(cur);
|
|
835
|
-
}
|
|
732
|
+
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
|
733
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
|
|
734
|
+
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
|
735
|
+
else o2[k] = clone(cur);
|
|
836
736
|
}
|
|
837
737
|
return o2;
|
|
838
738
|
}
|
|
839
739
|
function cloneProto(o) {
|
|
840
740
|
if (typeof o !== "object" || o === null) return o;
|
|
841
741
|
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
|
842
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor)))
|
|
843
|
-
return handler(o, cloneProto);
|
|
844
|
-
}
|
|
742
|
+
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
|
|
845
743
|
const o2 = {};
|
|
846
744
|
for (const k in o) {
|
|
847
745
|
const cur = o[k];
|
|
848
|
-
if (typeof cur !== "object" || cur === null)
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
853
|
-
o2[k] = copyBuffer(cur);
|
|
854
|
-
} else {
|
|
855
|
-
o2[k] = cloneProto(cur);
|
|
856
|
-
}
|
|
746
|
+
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
|
747
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
|
|
748
|
+
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
|
749
|
+
else o2[k] = cloneProto(cur);
|
|
857
750
|
}
|
|
858
751
|
return o2;
|
|
859
752
|
}
|
|
@@ -861,15 +754,11 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
861
754
|
function rfdcCircles(opts) {
|
|
862
755
|
const refs = [];
|
|
863
756
|
const refsNew = [];
|
|
864
|
-
const constructorHandlers = new Map();
|
|
757
|
+
const constructorHandlers = /* @__PURE__ */ new Map();
|
|
865
758
|
constructorHandlers.set(Date, (o) => new Date(o));
|
|
866
759
|
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
|
867
760
|
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
|
868
|
-
if (opts.constructorHandlers)
|
|
869
|
-
for (const handler of opts.constructorHandlers) {
|
|
870
|
-
constructorHandlers.set(handler[0], handler[1]);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
761
|
+
if (opts.constructorHandlers) for (const handler of opts.constructorHandlers) constructorHandlers.set(handler[0], handler[1]);
|
|
873
762
|
let handler = null;
|
|
874
763
|
return opts.proto ? cloneProto : clone;
|
|
875
764
|
function cloneArray(a, fn) {
|
|
@@ -878,19 +767,13 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
878
767
|
for (let i = 0; i < keys.length; i++) {
|
|
879
768
|
const k = keys[i];
|
|
880
769
|
const cur = a[k];
|
|
881
|
-
if (typeof cur !== "object" || cur === null)
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
886
|
-
a2[k] = copyBuffer(cur);
|
|
887
|
-
} else {
|
|
770
|
+
if (typeof cur !== "object" || cur === null) a2[k] = cur;
|
|
771
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
|
|
772
|
+
else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
|
|
773
|
+
else {
|
|
888
774
|
const index = refs.indexOf(cur);
|
|
889
|
-
if (index !== -1)
|
|
890
|
-
|
|
891
|
-
} else {
|
|
892
|
-
a2[k] = fn(cur);
|
|
893
|
-
}
|
|
775
|
+
if (index !== -1) a2[k] = refsNew[index];
|
|
776
|
+
else a2[k] = fn(cur);
|
|
894
777
|
}
|
|
895
778
|
}
|
|
896
779
|
return a2;
|
|
@@ -898,28 +781,20 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
898
781
|
function clone(o) {
|
|
899
782
|
if (typeof o !== "object" || o === null) return o;
|
|
900
783
|
if (Array.isArray(o)) return cloneArray(o, clone);
|
|
901
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor)))
|
|
902
|
-
return handler(o, clone);
|
|
903
|
-
}
|
|
784
|
+
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
|
|
904
785
|
const o2 = {};
|
|
905
786
|
refs.push(o);
|
|
906
787
|
refsNew.push(o2);
|
|
907
788
|
for (const k in o) {
|
|
908
789
|
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
|
909
790
|
const cur = o[k];
|
|
910
|
-
if (typeof cur !== "object" || cur === null)
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
915
|
-
o2[k] = copyBuffer(cur);
|
|
916
|
-
} else {
|
|
791
|
+
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
|
792
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
|
|
793
|
+
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
|
794
|
+
else {
|
|
917
795
|
const i = refs.indexOf(cur);
|
|
918
|
-
if (i !== -1)
|
|
919
|
-
|
|
920
|
-
} else {
|
|
921
|
-
o2[k] = clone(cur);
|
|
922
|
-
}
|
|
796
|
+
if (i !== -1) o2[k] = refsNew[i];
|
|
797
|
+
else o2[k] = clone(cur);
|
|
923
798
|
}
|
|
924
799
|
}
|
|
925
800
|
refs.pop();
|
|
@@ -929,27 +804,19 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
929
804
|
function cloneProto(o) {
|
|
930
805
|
if (typeof o !== "object" || o === null) return o;
|
|
931
806
|
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
|
932
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor)))
|
|
933
|
-
return handler(o, cloneProto);
|
|
934
|
-
}
|
|
807
|
+
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
|
|
935
808
|
const o2 = {};
|
|
936
809
|
refs.push(o);
|
|
937
810
|
refsNew.push(o2);
|
|
938
811
|
for (const k in o) {
|
|
939
812
|
const cur = o[k];
|
|
940
|
-
if (typeof cur !== "object" || cur === null)
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
945
|
-
o2[k] = copyBuffer(cur);
|
|
946
|
-
} else {
|
|
813
|
+
if (typeof cur !== "object" || cur === null) o2[k] = cur;
|
|
814
|
+
else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
|
|
815
|
+
else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
|
|
816
|
+
else {
|
|
947
817
|
const i = refs.indexOf(cur);
|
|
948
|
-
if (i !== -1)
|
|
949
|
-
|
|
950
|
-
} else {
|
|
951
|
-
o2[k] = cloneProto(cur);
|
|
952
|
-
}
|
|
818
|
+
if (i !== -1) o2[k] = refsNew[i];
|
|
819
|
+
else o2[k] = cloneProto(cur);
|
|
953
820
|
}
|
|
954
821
|
}
|
|
955
822
|
refs.pop();
|
|
@@ -957,21 +824,13 @@ var require_rfdc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
957
824
|
return o2;
|
|
958
825
|
}
|
|
959
826
|
}
|
|
960
|
-
}));
|
|
961
|
-
|
|
962
|
-
//#endregion
|
|
963
|
-
//#region ../../node_modules/.pnpm/listr2@9.0.5/node_modules/listr2/dist/index.js
|
|
964
|
-
var import_rfdc = /* @__PURE__ */ __toESM(require_rfdc(), 1);
|
|
965
|
-
/**
|
|
966
|
-
* Indicates an UNICODE characters is coming up.
|
|
967
|
-
*/
|
|
968
|
-
const ANSI_ESCAPE = "\x1B[";
|
|
827
|
+
})))(), 1);
|
|
969
828
|
/**
|
|
970
829
|
* Generic ANSI escape characters for terminal based operations.
|
|
971
830
|
*/
|
|
972
831
|
const ANSI_ESCAPE_CODES = {
|
|
973
|
-
CURSOR_HIDE:
|
|
974
|
-
CURSOR_SHOW:
|
|
832
|
+
CURSOR_HIDE: "\x1B[?25l",
|
|
833
|
+
CURSOR_SHOW: "\x1B[?25h"
|
|
975
834
|
};
|
|
976
835
|
/**
|
|
977
836
|
* Environment variables for Listr.
|
|
@@ -1100,11 +959,6 @@ var EventManager = class {
|
|
|
1100
959
|
}
|
|
1101
960
|
};
|
|
1102
961
|
/**
|
|
1103
|
-
* Give event map a set of indexes to not make it go crazy when some events are missing from it.
|
|
1104
|
-
* They are optional after all.
|
|
1105
|
-
*/
|
|
1106
|
-
var BaseEventMap = class {};
|
|
1107
|
-
/**
|
|
1108
962
|
* Tests to see if the object is an RxJS {@link Observable}
|
|
1109
963
|
* @param obj the object to test
|
|
1110
964
|
*/
|
|
@@ -1438,32 +1292,6 @@ function createWritable(cb) {
|
|
|
1438
1292
|
return writable;
|
|
1439
1293
|
}
|
|
1440
1294
|
/* istanbul ignore next */
|
|
1441
|
-
var ListrPromptAdapter = class {
|
|
1442
|
-
state;
|
|
1443
|
-
constructor(task, wrapper) {
|
|
1444
|
-
this.task = task;
|
|
1445
|
-
this.wrapper = wrapper;
|
|
1446
|
-
}
|
|
1447
|
-
reportStarted() {
|
|
1448
|
-
this.state = this.task.state;
|
|
1449
|
-
if (this.task.prompt) throw new PromptError("There is already an active prompt attached to this task which may not be cleaned up properly.");
|
|
1450
|
-
this.task.prompt = this;
|
|
1451
|
-
this.task.state$ = ListrTaskState.PROMPT;
|
|
1452
|
-
}
|
|
1453
|
-
reportFailed() {
|
|
1454
|
-
this.task.state$ = ListrTaskState.PROMPT_FAILED;
|
|
1455
|
-
this.restoreState();
|
|
1456
|
-
}
|
|
1457
|
-
reportCompleted() {
|
|
1458
|
-
this.task.state$ = ListrTaskState.PROMPT_COMPLETED;
|
|
1459
|
-
this.restoreState();
|
|
1460
|
-
}
|
|
1461
|
-
restoreState() {
|
|
1462
|
-
this.task.prompt = void 0;
|
|
1463
|
-
if (this.state) this.task.state = this.state;
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
/* istanbul ignore next */
|
|
1467
1295
|
var Spinner = class {
|
|
1468
1296
|
spinner = !isUnicodeSupported() ? [
|
|
1469
1297
|
"-",
|
|
@@ -1575,17 +1403,6 @@ const PRESET_TIMER = {
|
|
|
1575
1403
|
field: parseTimer,
|
|
1576
1404
|
format: () => color.dim
|
|
1577
1405
|
};
|
|
1578
|
-
/* istanbul ignore next */
|
|
1579
|
-
function parseTimestamp() {
|
|
1580
|
-
const now = /* @__PURE__ */ new Date();
|
|
1581
|
-
return String(now.getHours()).padStart(2, "0") + ":" + String(now.getMinutes()).padStart(2, "0") + ":" + String(now.getSeconds()).padStart(2, "0");
|
|
1582
|
-
}
|
|
1583
|
-
/* istanbul ignore next */
|
|
1584
|
-
const PRESET_TIMESTAMP = {
|
|
1585
|
-
condition: true,
|
|
1586
|
-
field: parseTimestamp,
|
|
1587
|
-
format: () => color.dim
|
|
1588
|
-
};
|
|
1589
1406
|
var DefaultRenderer = class DefaultRenderer {
|
|
1590
1407
|
static nonTTY = false;
|
|
1591
1408
|
static rendererOptions = {
|
|
@@ -1649,9 +1466,9 @@ var DefaultRenderer = class DefaultRenderer {
|
|
|
1649
1466
|
this.logger.options.color = this.options.color;
|
|
1650
1467
|
}
|
|
1651
1468
|
async render() {
|
|
1652
|
-
const { createLogUpdate } = await import("./log-update-
|
|
1653
|
-
const { default: truncate } = await import("./cli-truncate-
|
|
1654
|
-
const { default: wrap } = await import("./wrap-ansi-
|
|
1469
|
+
const { createLogUpdate } = await import("./log-update-C8WCYCbc.js");
|
|
1470
|
+
const { default: truncate } = await import("./cli-truncate-Da6Y8aM8.js");
|
|
1471
|
+
const { default: wrap } = await import("./wrap-ansi-Ou9oAs-a.js");
|
|
1655
1472
|
this.updater = createLogUpdate(this.logger.process.stdout);
|
|
1656
1473
|
this.truncate = truncate;
|
|
1657
1474
|
this.wrap = wrap;
|
|
@@ -2143,119 +1960,118 @@ var TestRenderer = class TestRenderer {
|
|
|
2143
1960
|
});
|
|
2144
1961
|
}
|
|
2145
1962
|
};
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
logger;
|
|
2157
|
-
cache = {
|
|
2158
|
-
rendererOptions: /* @__PURE__ */ new Map(),
|
|
2159
|
-
rendererTaskOptions: /* @__PURE__ */ new Map()
|
|
2160
|
-
};
|
|
2161
|
-
constructor(tasks, options) {
|
|
2162
|
-
this.tasks = tasks;
|
|
2163
|
-
this.options = options;
|
|
2164
|
-
this.options = {
|
|
2165
|
-
...VerboseRenderer.rendererOptions,
|
|
2166
|
-
...this.options,
|
|
2167
|
-
icon: {
|
|
2168
|
-
...LISTR_LOGGER_STYLE.icon,
|
|
2169
|
-
...options?.icon ?? {}
|
|
2170
|
-
},
|
|
2171
|
-
color: {
|
|
2172
|
-
...LISTR_LOGGER_STYLE.color,
|
|
2173
|
-
...options?.color ?? {}
|
|
1963
|
+
const RENDERERS = {
|
|
1964
|
+
default: DefaultRenderer,
|
|
1965
|
+
simple: SimpleRenderer,
|
|
1966
|
+
verbose: class VerboseRenderer {
|
|
1967
|
+
static nonTTY = true;
|
|
1968
|
+
static rendererOptions = {
|
|
1969
|
+
logTitleChange: false,
|
|
1970
|
+
pausedTimer: {
|
|
1971
|
+
...PRESET_TIMER,
|
|
1972
|
+
format: () => color.yellowBright
|
|
2174
1973
|
}
|
|
2175
1974
|
};
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
const rendererTaskOptions = this.cache.rendererTaskOptions.get(task.id);
|
|
2196
|
-
task.on(ListrTaskEventType.SUBTASK, (subtasks) => {
|
|
2197
|
-
this.renderer(subtasks);
|
|
2198
|
-
});
|
|
2199
|
-
task.on(ListrTaskEventType.STATE, (state) => {
|
|
2200
|
-
if (!task.hasTitle()) return;
|
|
2201
|
-
if (state === ListrTaskState.STARTED) this.logger.log(ListrLogLevels.STARTED, task.title);
|
|
2202
|
-
else if (state === ListrTaskState.COMPLETED) {
|
|
2203
|
-
const timer = rendererTaskOptions.timer;
|
|
2204
|
-
this.logger.log(ListrLogLevels.COMPLETED, task.title, timer && { suffix: {
|
|
2205
|
-
...timer,
|
|
2206
|
-
condition: !!task.message?.duration && timer.condition,
|
|
2207
|
-
args: [task.message.duration]
|
|
2208
|
-
} });
|
|
1975
|
+
static rendererTaskOptions;
|
|
1976
|
+
logger;
|
|
1977
|
+
cache = {
|
|
1978
|
+
rendererOptions: /* @__PURE__ */ new Map(),
|
|
1979
|
+
rendererTaskOptions: /* @__PURE__ */ new Map()
|
|
1980
|
+
};
|
|
1981
|
+
constructor(tasks, options) {
|
|
1982
|
+
this.tasks = tasks;
|
|
1983
|
+
this.options = options;
|
|
1984
|
+
this.options = {
|
|
1985
|
+
...VerboseRenderer.rendererOptions,
|
|
1986
|
+
...this.options,
|
|
1987
|
+
icon: {
|
|
1988
|
+
...LISTR_LOGGER_STYLE.icon,
|
|
1989
|
+
...options?.icon ?? {}
|
|
1990
|
+
},
|
|
1991
|
+
color: {
|
|
1992
|
+
...LISTR_LOGGER_STYLE.color,
|
|
1993
|
+
...options?.color ?? {}
|
|
2209
1994
|
}
|
|
1995
|
+
};
|
|
1996
|
+
this.logger = this.options.logger ?? new ListrLogger({
|
|
1997
|
+
useIcons: false,
|
|
1998
|
+
toStderr: LISTR_LOGGER_STDERR_LEVELS
|
|
2210
1999
|
});
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2000
|
+
this.logger.options.icon = this.options.icon;
|
|
2001
|
+
this.logger.options.color = this.options.color;
|
|
2002
|
+
if (this.options.timestamp) this.logger.options.fields.prefix.unshift(this.options.timestamp);
|
|
2003
|
+
}
|
|
2004
|
+
render() {
|
|
2005
|
+
this.renderer(this.tasks);
|
|
2006
|
+
}
|
|
2007
|
+
end() {}
|
|
2008
|
+
renderer(tasks) {
|
|
2009
|
+
tasks.forEach((task) => {
|
|
2010
|
+
this.calculate(task);
|
|
2011
|
+
task.once(ListrTaskEventType.CLOSED, () => {
|
|
2012
|
+
this.reset(task);
|
|
2013
|
+
});
|
|
2014
|
+
const rendererOptions = this.cache.rendererOptions.get(task.id);
|
|
2015
|
+
const rendererTaskOptions = this.cache.rendererTaskOptions.get(task.id);
|
|
2016
|
+
task.on(ListrTaskEventType.SUBTASK, (subtasks) => {
|
|
2017
|
+
this.renderer(subtasks);
|
|
2018
|
+
});
|
|
2019
|
+
task.on(ListrTaskEventType.STATE, (state) => {
|
|
2020
|
+
if (!task.hasTitle()) return;
|
|
2021
|
+
if (state === ListrTaskState.STARTED) this.logger.log(ListrLogLevels.STARTED, task.title);
|
|
2022
|
+
else if (state === ListrTaskState.COMPLETED) {
|
|
2023
|
+
const timer = rendererTaskOptions.timer;
|
|
2024
|
+
this.logger.log(ListrLogLevels.COMPLETED, task.title, timer && { suffix: {
|
|
2025
|
+
...timer,
|
|
2026
|
+
condition: !!task.message?.duration && timer.condition,
|
|
2027
|
+
args: [task.message.duration]
|
|
2028
|
+
} });
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
task.on(ListrTaskEventType.OUTPUT, (data) => {
|
|
2032
|
+
this.logger.log(ListrLogLevels.OUTPUT, data);
|
|
2033
|
+
});
|
|
2034
|
+
task.on(ListrTaskEventType.PROMPT, (prompt) => {
|
|
2035
|
+
const cleansed = cleanseAnsi(prompt);
|
|
2036
|
+
if (cleansed) this.logger.log(ListrLogLevels.PROMPT, cleansed);
|
|
2037
|
+
});
|
|
2038
|
+
if (this.options?.logTitleChange !== false) task.on(ListrTaskEventType.TITLE, (title) => {
|
|
2039
|
+
this.logger.log(ListrLogLevels.TITLE, title);
|
|
2040
|
+
});
|
|
2041
|
+
task.on(ListrTaskEventType.MESSAGE, (message) => {
|
|
2042
|
+
if (message?.error) this.logger.log(ListrLogLevels.FAILED, message.error);
|
|
2043
|
+
else if (message?.skip) this.logger.log(ListrLogLevels.SKIPPED, message.skip);
|
|
2044
|
+
else if (message?.rollback) this.logger.log(ListrLogLevels.ROLLBACK, message.rollback);
|
|
2045
|
+
else if (message?.retry) this.logger.log(ListrLogLevels.RETRY, task.title, { suffix: message.retry.count.toString() });
|
|
2046
|
+
else if (message?.paused) {
|
|
2047
|
+
const timer = rendererOptions?.pausedTimer;
|
|
2048
|
+
this.logger.log(ListrLogLevels.PAUSED, task.title, timer && { suffix: {
|
|
2049
|
+
...timer,
|
|
2050
|
+
condition: !!message?.paused && timer.condition,
|
|
2051
|
+
args: [message.paused - Date.now()]
|
|
2052
|
+
} });
|
|
2053
|
+
}
|
|
2054
|
+
});
|
|
2220
2055
|
});
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
}
|
|
2056
|
+
}
|
|
2057
|
+
calculate(task) {
|
|
2058
|
+
if (this.cache.rendererOptions.has(task.id) && this.cache.rendererTaskOptions.has(task.id)) return;
|
|
2059
|
+
const rendererOptions = {
|
|
2060
|
+
...this.options,
|
|
2061
|
+
...task.rendererOptions
|
|
2062
|
+
};
|
|
2063
|
+
this.cache.rendererOptions.set(task.id, rendererOptions);
|
|
2064
|
+
this.cache.rendererTaskOptions.set(task.id, {
|
|
2065
|
+
...VerboseRenderer.rendererTaskOptions,
|
|
2066
|
+
timer: rendererOptions.timer,
|
|
2067
|
+
...task.rendererTaskOptions
|
|
2234
2068
|
});
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
...task.rendererOptions
|
|
2242
|
-
};
|
|
2243
|
-
this.cache.rendererOptions.set(task.id, rendererOptions);
|
|
2244
|
-
this.cache.rendererTaskOptions.set(task.id, {
|
|
2245
|
-
...VerboseRenderer.rendererTaskOptions,
|
|
2246
|
-
timer: rendererOptions.timer,
|
|
2247
|
-
...task.rendererTaskOptions
|
|
2248
|
-
});
|
|
2249
|
-
}
|
|
2250
|
-
reset(task) {
|
|
2251
|
-
this.cache.rendererOptions.delete(task.id);
|
|
2252
|
-
this.cache.rendererTaskOptions.delete(task.id);
|
|
2253
|
-
}
|
|
2254
|
-
};
|
|
2255
|
-
const RENDERERS = {
|
|
2256
|
-
default: DefaultRenderer,
|
|
2257
|
-
simple: SimpleRenderer,
|
|
2258
|
-
verbose: VerboseRenderer,
|
|
2069
|
+
}
|
|
2070
|
+
reset(task) {
|
|
2071
|
+
this.cache.rendererOptions.delete(task.id);
|
|
2072
|
+
this.cache.rendererTaskOptions.delete(task.id);
|
|
2073
|
+
}
|
|
2074
|
+
},
|
|
2259
2075
|
test: TestRenderer,
|
|
2260
2076
|
silent: SilentRenderer
|
|
2261
2077
|
};
|
|
@@ -2909,13 +2725,11 @@ var Listr = class {
|
|
|
2909
2725
|
if (this.boundSignalHandler) process.removeListener("SIGINT", this.boundSignalHandler);
|
|
2910
2726
|
}
|
|
2911
2727
|
};
|
|
2912
|
-
|
|
2913
2728
|
//#endregion
|
|
2914
2729
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/figures.js
|
|
2915
2730
|
const info = blue$1(figures.arrowRight);
|
|
2916
2731
|
const error = red$1(figures.cross);
|
|
2917
2732
|
const warning = yellow$1(figures.warning);
|
|
2918
|
-
|
|
2919
2733
|
//#endregion
|
|
2920
2734
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/messages.js
|
|
2921
2735
|
const configurationError = (opt, helpMsg, value) => `${red$1(`${error} Validation Error:`)}
|
|
@@ -2931,8 +2745,7 @@ const NO_CONFIGURATION = `${error} lint-staged could not find any valid configur
|
|
|
2931
2745
|
const NO_STAGED_FILES = `${info} lint-staged could not find any staged files.`;
|
|
2932
2746
|
const NO_TASKS = `${info} lint-staged could not find any staged files matching configured tasks.`;
|
|
2933
2747
|
const skippingBackup = (hasInitialCommit, diff) => {
|
|
2934
|
-
|
|
2935
|
-
return yellow$1(`${warning} Skipping backup because ${reason}.\n`);
|
|
2748
|
+
return yellow$1(`${warning} Skipping backup because ${diff !== void 0 ? "`--diff` was used" : (hasInitialCommit ? "`--no-stash` was used" : "there’s no initial commit yet") + ". This might result in data loss"}.\n`);
|
|
2936
2749
|
};
|
|
2937
2750
|
const SKIPPING_HIDE_PARTIALLY_CHANGED = yellow$1(`${warning} Skipping hiding unstaged changes from partially staged files because \`--no-hide-partially-staged\` was used.\n`);
|
|
2938
2751
|
const DEPRECATED_GIT_ADD = yellow$1(`${warning} Some of your tasks use \`git add\` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.
|
|
@@ -2957,7 +2770,7 @@ const restoreStashExample = (hash = "h0a0s0h0") => `Any lost modifications can b
|
|
|
2957
2770
|
> git stash list --format="%h %s"
|
|
2958
2771
|
${hash} On main: lint-staged automatic backup
|
|
2959
2772
|
> git apply --index ${hash}`;
|
|
2960
|
-
|
|
2773
|
+
red$1(`${error} Failed to read config from stdin.`);
|
|
2961
2774
|
const failedToLoadConfig = (filepath) => red$1(`${error} Failed to read config from file "${filepath}".`);
|
|
2962
2775
|
const failedToParseConfig = (filepath, error) => `${red$1(`${error} Failed to parse config from file "${filepath}".`)}
|
|
2963
2776
|
|
|
@@ -2965,7 +2778,6 @@ ${error}
|
|
|
2965
2778
|
|
|
2966
2779
|
See https://github.com/okonet/lint-staged#configuration.`;
|
|
2967
2780
|
const UNSTAGED_CHANGES_BACKUP_STASH_LOCATION = `Unstaged changes have been kept back in a patch file:`;
|
|
2968
|
-
|
|
2969
2781
|
//#endregion
|
|
2970
2782
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/printTaskOutput.js
|
|
2971
2783
|
/**
|
|
@@ -2976,11 +2788,8 @@ const UNSTAGED_CHANGES_BACKUP_STASH_LOCATION = `Unstaged changes have been kept
|
|
|
2976
2788
|
const printTaskOutput = (ctx = {}, logger) => {
|
|
2977
2789
|
if (!Array.isArray(ctx.output)) return;
|
|
2978
2790
|
const log = ctx.errors?.size > 0 ? logger.error : logger.log;
|
|
2979
|
-
for (const line of ctx.output)
|
|
2980
|
-
log(line);
|
|
2981
|
-
}
|
|
2791
|
+
for (const line of ctx.output) log(line);
|
|
2982
2792
|
};
|
|
2983
|
-
|
|
2984
2793
|
//#endregion
|
|
2985
2794
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/normalizePath.js
|
|
2986
2795
|
/**
|
|
@@ -3009,21 +2818,14 @@ const WIN32_DEVICE_NS = "\\\\.\\";
|
|
|
3009
2818
|
* @returns String
|
|
3010
2819
|
*/
|
|
3011
2820
|
const normalizePath = (input) => {
|
|
3012
|
-
if (input === path.posix.sep || input === path.win32.sep)
|
|
3013
|
-
return path.posix.sep;
|
|
3014
|
-
}
|
|
2821
|
+
if (input === path.posix.sep || input === path.win32.sep) return path.posix.sep;
|
|
3015
2822
|
let normalized = input.split(/[/\\]+/).join(path.posix.sep);
|
|
3016
2823
|
/** Handle win32 Namespaced paths by changing e.g. \\.\ to //./ */
|
|
3017
|
-
if (input.startsWith(WIN32_FILE_NS) || input.startsWith(WIN32_DEVICE_NS))
|
|
3018
|
-
normalized = normalized.replace(/^\/(\.|\?)/, "//$1");
|
|
3019
|
-
}
|
|
2824
|
+
if (input.startsWith(WIN32_FILE_NS) || input.startsWith(WIN32_DEVICE_NS)) normalized = normalized.replace(/^\/(\.|\?)/, "//$1");
|
|
3020
2825
|
/** Remove trailing slash */
|
|
3021
|
-
if (normalized.endsWith(path.posix.sep))
|
|
3022
|
-
normalized = normalized.slice(0, -1);
|
|
3023
|
-
}
|
|
2826
|
+
if (normalized.endsWith(path.posix.sep)) normalized = normalized.slice(0, -1);
|
|
3024
2827
|
return normalized;
|
|
3025
2828
|
};
|
|
3026
|
-
|
|
3027
2829
|
//#endregion
|
|
3028
2830
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/chunkFiles.js
|
|
3029
2831
|
const debugLog$14 = createDebug("lint-staged:chunkFiles");
|
|
@@ -3075,17 +2877,12 @@ const chunkFiles = ({ files, baseDir, maxArgLength = null, relative = false }) =
|
|
|
3075
2877
|
debugLog$14(`Creating ${chunkCount} chunks for maxArgLength of ${maxArgLength}`);
|
|
3076
2878
|
return chunkArray(normalizedFiles, chunkCount);
|
|
3077
2879
|
};
|
|
3078
|
-
|
|
3079
2880
|
//#endregion
|
|
3080
2881
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
|
|
3081
2882
|
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3082
2883
|
exports.isInteger = (num) => {
|
|
3083
|
-
if (typeof num === "number")
|
|
3084
|
-
|
|
3085
|
-
}
|
|
3086
|
-
if (typeof num === "string" && num.trim() !== "") {
|
|
3087
|
-
return Number.isInteger(Number(num));
|
|
3088
|
-
}
|
|
2884
|
+
if (typeof num === "number") return Number.isInteger(num);
|
|
2885
|
+
if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
|
|
3089
2886
|
return false;
|
|
3090
2887
|
};
|
|
3091
2888
|
/**
|
|
@@ -3144,9 +2941,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3144
2941
|
* Returns true if a node is an open or close node
|
|
3145
2942
|
*/
|
|
3146
2943
|
exports.isOpenOrClose = (node) => {
|
|
3147
|
-
if (node.type === "open" || node.type === "close")
|
|
3148
|
-
return true;
|
|
3149
|
-
}
|
|
2944
|
+
if (node.type === "open" || node.type === "close") return true;
|
|
3150
2945
|
return node.open === true || node.close === true;
|
|
3151
2946
|
};
|
|
3152
2947
|
/**
|
|
@@ -3169,9 +2964,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3169
2964
|
flat(ele);
|
|
3170
2965
|
continue;
|
|
3171
2966
|
}
|
|
3172
|
-
if (ele !==
|
|
3173
|
-
result.push(ele);
|
|
3174
|
-
}
|
|
2967
|
+
if (ele !== void 0) result.push(ele);
|
|
3175
2968
|
}
|
|
3176
2969
|
return result;
|
|
3177
2970
|
};
|
|
@@ -3179,7 +2972,6 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3179
2972
|
return result;
|
|
3180
2973
|
};
|
|
3181
2974
|
}));
|
|
3182
|
-
|
|
3183
2975
|
//#endregion
|
|
3184
2976
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
|
|
3185
2977
|
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3190,25 +2982,16 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3190
2982
|
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
3191
2983
|
let output = "";
|
|
3192
2984
|
if (node.value) {
|
|
3193
|
-
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node))
|
|
3194
|
-
return "\\" + node.value;
|
|
3195
|
-
}
|
|
2985
|
+
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return "\\" + node.value;
|
|
3196
2986
|
return node.value;
|
|
3197
2987
|
}
|
|
3198
|
-
if (node.value)
|
|
3199
|
-
|
|
3200
|
-
}
|
|
3201
|
-
if (node.nodes) {
|
|
3202
|
-
for (const child of node.nodes) {
|
|
3203
|
-
output += stringify(child);
|
|
3204
|
-
}
|
|
3205
|
-
}
|
|
2988
|
+
if (node.value) return node.value;
|
|
2989
|
+
if (node.nodes) for (const child of node.nodes) output += stringify(child);
|
|
3206
2990
|
return output;
|
|
3207
2991
|
};
|
|
3208
2992
|
return stringify(ast);
|
|
3209
2993
|
};
|
|
3210
2994
|
}));
|
|
3211
|
-
|
|
3212
2995
|
//#endregion
|
|
3213
2996
|
//#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
|
|
3214
2997
|
/*!
|
|
@@ -3219,16 +3002,11 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3219
3002
|
*/
|
|
3220
3003
|
var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3221
3004
|
module.exports = function(num) {
|
|
3222
|
-
if (typeof num === "number")
|
|
3223
|
-
|
|
3224
|
-
}
|
|
3225
|
-
if (typeof num === "string" && num.trim() !== "") {
|
|
3226
|
-
return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
|
3227
|
-
}
|
|
3005
|
+
if (typeof num === "number") return num - num === 0;
|
|
3006
|
+
if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
|
3228
3007
|
return false;
|
|
3229
3008
|
};
|
|
3230
3009
|
}));
|
|
3231
|
-
|
|
3232
3010
|
//#endregion
|
|
3233
3011
|
//#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
|
|
3234
3012
|
/*!
|
|
@@ -3240,40 +3018,26 @@ var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3240
3018
|
var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3241
3019
|
const isNumber = require_is_number();
|
|
3242
3020
|
const toRegexRange = (min, max, options) => {
|
|
3243
|
-
if (isNumber(min) === false)
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
if (max === void 0 || min === max) {
|
|
3247
|
-
return String(min);
|
|
3248
|
-
}
|
|
3249
|
-
if (isNumber(max) === false) {
|
|
3250
|
-
throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
3251
|
-
}
|
|
3021
|
+
if (isNumber(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
3022
|
+
if (max === void 0 || min === max) return String(min);
|
|
3023
|
+
if (isNumber(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
3252
3024
|
let opts = {
|
|
3253
3025
|
relaxZeros: true,
|
|
3254
3026
|
...options
|
|
3255
3027
|
};
|
|
3256
|
-
if (typeof opts.strictZeros === "boolean")
|
|
3257
|
-
opts.relaxZeros = opts.strictZeros === false;
|
|
3258
|
-
}
|
|
3028
|
+
if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
|
|
3259
3029
|
let relax = String(opts.relaxZeros);
|
|
3260
3030
|
let shorthand = String(opts.shorthand);
|
|
3261
3031
|
let capture = String(opts.capture);
|
|
3262
3032
|
let wrap = String(opts.wrap);
|
|
3263
3033
|
let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
|
|
3264
|
-
if (toRegexRange.cache.hasOwnProperty(cacheKey))
|
|
3265
|
-
return toRegexRange.cache[cacheKey].result;
|
|
3266
|
-
}
|
|
3034
|
+
if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result;
|
|
3267
3035
|
let a = Math.min(min, max);
|
|
3268
3036
|
let b = Math.max(min, max);
|
|
3269
3037
|
if (Math.abs(a - b) === 1) {
|
|
3270
3038
|
let result = min + "|" + max;
|
|
3271
|
-
if (opts.capture) {
|
|
3272
|
-
|
|
3273
|
-
}
|
|
3274
|
-
if (opts.wrap === false) {
|
|
3275
|
-
return result;
|
|
3276
|
-
}
|
|
3039
|
+
if (opts.capture) return `(${result})`;
|
|
3040
|
+
if (opts.wrap === false) return result;
|
|
3277
3041
|
return `(?:${result})`;
|
|
3278
3042
|
}
|
|
3279
3043
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
@@ -3290,21 +3054,15 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3290
3054
|
state.maxLen = String(state.max).length;
|
|
3291
3055
|
}
|
|
3292
3056
|
if (a < 0) {
|
|
3293
|
-
|
|
3294
|
-
negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
|
|
3057
|
+
negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
|
|
3295
3058
|
a = state.a = 0;
|
|
3296
3059
|
}
|
|
3297
|
-
if (b >= 0)
|
|
3298
|
-
positives = splitToPatterns(a, b, state, opts);
|
|
3299
|
-
}
|
|
3060
|
+
if (b >= 0) positives = splitToPatterns(a, b, state, opts);
|
|
3300
3061
|
state.negatives = negatives;
|
|
3301
3062
|
state.positives = positives;
|
|
3302
3063
|
state.result = collatePatterns(negatives, positives, opts);
|
|
3303
|
-
if (opts.capture === true) {
|
|
3304
|
-
|
|
3305
|
-
} else if (opts.wrap !== false && positives.length + negatives.length > 1) {
|
|
3306
|
-
state.result = `(?:${state.result})`;
|
|
3307
|
-
}
|
|
3064
|
+
if (opts.capture === true) state.result = `(${state.result})`;
|
|
3065
|
+
else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
|
|
3308
3066
|
toRegexRange.cache[cacheKey] = state;
|
|
3309
3067
|
return state.result;
|
|
3310
3068
|
};
|
|
@@ -3312,8 +3070,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3312
3070
|
let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
|
|
3313
3071
|
let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
|
|
3314
3072
|
let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
|
|
3315
|
-
|
|
3316
|
-
return subpatterns.join("|");
|
|
3073
|
+
return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
|
|
3317
3074
|
}
|
|
3318
3075
|
function splitToRanges(min, max) {
|
|
3319
3076
|
let nines = 1;
|
|
@@ -3342,30 +3099,22 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3342
3099
|
* @return {String}
|
|
3343
3100
|
*/
|
|
3344
3101
|
function rangeToPattern(start, stop, options) {
|
|
3345
|
-
if (start === stop) {
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
};
|
|
3351
|
-
}
|
|
3102
|
+
if (start === stop) return {
|
|
3103
|
+
pattern: start,
|
|
3104
|
+
count: [],
|
|
3105
|
+
digits: 0
|
|
3106
|
+
};
|
|
3352
3107
|
let zipped = zip(start, stop);
|
|
3353
3108
|
let digits = zipped.length;
|
|
3354
3109
|
let pattern = "";
|
|
3355
3110
|
let count = 0;
|
|
3356
3111
|
for (let i = 0; i < digits; i++) {
|
|
3357
3112
|
let [startDigit, stopDigit] = zipped[i];
|
|
3358
|
-
if (startDigit === stopDigit)
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
pattern += toCharacterClass(startDigit, stopDigit, options);
|
|
3362
|
-
} else {
|
|
3363
|
-
count++;
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
if (count) {
|
|
3367
|
-
pattern += options.shorthand === true ? "\\d" : "[0-9]";
|
|
3113
|
+
if (startDigit === stopDigit) pattern += startDigit;
|
|
3114
|
+
else if (startDigit !== "0" || stopDigit !== "9") pattern += toCharacterClass(startDigit, stopDigit, options);
|
|
3115
|
+
else count++;
|
|
3368
3116
|
}
|
|
3117
|
+
if (count) pattern += options.shorthand === true ? "\\d" : "[0-9]";
|
|
3369
3118
|
return {
|
|
3370
3119
|
pattern,
|
|
3371
3120
|
count: [count],
|
|
@@ -3382,17 +3131,13 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3382
3131
|
let obj = rangeToPattern(String(start), String(max), options);
|
|
3383
3132
|
let zeros = "";
|
|
3384
3133
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
3385
|
-
if (prev.count.length > 1)
|
|
3386
|
-
prev.count.pop();
|
|
3387
|
-
}
|
|
3134
|
+
if (prev.count.length > 1) prev.count.pop();
|
|
3388
3135
|
prev.count.push(obj.count[0]);
|
|
3389
3136
|
prev.string = prev.pattern + toQuantifier(prev.count);
|
|
3390
3137
|
start = max + 1;
|
|
3391
3138
|
continue;
|
|
3392
3139
|
}
|
|
3393
|
-
if (tok.isPadded)
|
|
3394
|
-
zeros = padZeros(max, tok, options);
|
|
3395
|
-
}
|
|
3140
|
+
if (tok.isPadded) zeros = padZeros(max, tok, options);
|
|
3396
3141
|
obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
|
3397
3142
|
tokens.push(obj);
|
|
3398
3143
|
start = max + 1;
|
|
@@ -3404,12 +3149,8 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3404
3149
|
let result = [];
|
|
3405
3150
|
for (let ele of arr) {
|
|
3406
3151
|
let { string } = ele;
|
|
3407
|
-
if (!intersection && !contains(comparison, "string", string))
|
|
3408
|
-
|
|
3409
|
-
}
|
|
3410
|
-
if (intersection && contains(comparison, "string", string)) {
|
|
3411
|
-
result.push(prefix + string);
|
|
3412
|
-
}
|
|
3152
|
+
if (!intersection && !contains(comparison, "string", string)) result.push(prefix + string);
|
|
3153
|
+
if (intersection && contains(comparison, "string", string)) result.push(prefix + string);
|
|
3413
3154
|
}
|
|
3414
3155
|
return result;
|
|
3415
3156
|
}
|
|
@@ -3435,9 +3176,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3435
3176
|
}
|
|
3436
3177
|
function toQuantifier(digits) {
|
|
3437
3178
|
let [start = 0, stop = ""] = digits;
|
|
3438
|
-
if (stop || start > 1) {
|
|
3439
|
-
return `{${start + (stop ? "," + stop : "")}}`;
|
|
3440
|
-
}
|
|
3179
|
+
if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
|
|
3441
3180
|
return "";
|
|
3442
3181
|
}
|
|
3443
3182
|
function toCharacterClass(a, b, options) {
|
|
@@ -3447,18 +3186,14 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3447
3186
|
return /^-?(0+)\d/.test(str);
|
|
3448
3187
|
}
|
|
3449
3188
|
function padZeros(value, tok, options) {
|
|
3450
|
-
if (!tok.isPadded)
|
|
3451
|
-
return value;
|
|
3452
|
-
}
|
|
3189
|
+
if (!tok.isPadded) return value;
|
|
3453
3190
|
let diff = Math.abs(tok.maxLen - String(value).length);
|
|
3454
3191
|
let relax = options.relaxZeros !== false;
|
|
3455
3192
|
switch (diff) {
|
|
3456
3193
|
case 0: return "";
|
|
3457
3194
|
case 1: return relax ? "0?" : "0";
|
|
3458
3195
|
case 2: return relax ? "0{0,2}" : "00";
|
|
3459
|
-
default: {
|
|
3460
|
-
return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
|
3461
|
-
}
|
|
3196
|
+
default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
|
3462
3197
|
}
|
|
3463
3198
|
}
|
|
3464
3199
|
/**
|
|
@@ -3471,7 +3206,6 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3471
3206
|
*/
|
|
3472
3207
|
module.exports = toRegexRange;
|
|
3473
3208
|
}));
|
|
3474
|
-
|
|
3475
3209
|
//#endregion
|
|
3476
3210
|
//#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
|
|
3477
3211
|
/*!
|
|
@@ -3500,9 +3234,7 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3500
3234
|
return index > 0;
|
|
3501
3235
|
};
|
|
3502
3236
|
const stringify = (start, end, options) => {
|
|
3503
|
-
if (typeof start === "string" || typeof end === "string")
|
|
3504
|
-
return true;
|
|
3505
|
-
}
|
|
3237
|
+
if (typeof start === "string" || typeof end === "string") return true;
|
|
3506
3238
|
return options.stringify === true;
|
|
3507
3239
|
};
|
|
3508
3240
|
const pad = (input, maxLength, toNumber) => {
|
|
@@ -3511,9 +3243,7 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3511
3243
|
if (dash) input = input.slice(1);
|
|
3512
3244
|
input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
|
|
3513
3245
|
}
|
|
3514
|
-
if (toNumber === false)
|
|
3515
|
-
return String(input);
|
|
3516
|
-
}
|
|
3246
|
+
if (toNumber === false) return String(input);
|
|
3517
3247
|
return input;
|
|
3518
3248
|
};
|
|
3519
3249
|
const toMaxLen = (input, maxLength) => {
|
|
@@ -3532,33 +3262,21 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3532
3262
|
let positives = "";
|
|
3533
3263
|
let negatives = "";
|
|
3534
3264
|
let result;
|
|
3535
|
-
if (parts.positives.length)
|
|
3536
|
-
|
|
3537
|
-
}
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
}
|
|
3541
|
-
if (positives && negatives) {
|
|
3542
|
-
result = `${positives}|${negatives}`;
|
|
3543
|
-
} else {
|
|
3544
|
-
result = positives || negatives;
|
|
3545
|
-
}
|
|
3546
|
-
if (options.wrap) {
|
|
3547
|
-
return `(${prefix}${result})`;
|
|
3548
|
-
}
|
|
3265
|
+
if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
|
|
3266
|
+
if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
|
|
3267
|
+
if (positives && negatives) result = `${positives}|${negatives}`;
|
|
3268
|
+
else result = positives || negatives;
|
|
3269
|
+
if (options.wrap) return `(${prefix}${result})`;
|
|
3549
3270
|
return result;
|
|
3550
3271
|
};
|
|
3551
3272
|
const toRange = (a, b, isNumbers, options) => {
|
|
3552
|
-
if (isNumbers) {
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
});
|
|
3557
|
-
}
|
|
3273
|
+
if (isNumbers) return toRegexRange(a, b, {
|
|
3274
|
+
wrap: false,
|
|
3275
|
+
...options
|
|
3276
|
+
});
|
|
3558
3277
|
let start = String.fromCharCode(a);
|
|
3559
3278
|
if (a === b) return start;
|
|
3560
|
-
|
|
3561
|
-
return `[${start}-${stop}]`;
|
|
3279
|
+
return `[${start}-${String.fromCharCode(b)}]`;
|
|
3562
3280
|
};
|
|
3563
3281
|
const toRegex = (start, end, options) => {
|
|
3564
3282
|
if (Array.isArray(start)) {
|
|
@@ -3569,16 +3287,14 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3569
3287
|
return toRegexRange(start, end, options);
|
|
3570
3288
|
};
|
|
3571
3289
|
const rangeError = (...args) => {
|
|
3572
|
-
return new RangeError("Invalid range arguments: " + util$1.inspect(...args));
|
|
3290
|
+
return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
|
|
3573
3291
|
};
|
|
3574
3292
|
const invalidRange = (start, end, options) => {
|
|
3575
3293
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
3576
3294
|
return [];
|
|
3577
3295
|
};
|
|
3578
3296
|
const invalidStep = (step, options) => {
|
|
3579
|
-
if (options.strictRanges === true) {
|
|
3580
|
-
throw new TypeError(`Expected step "${step}" to be a number`);
|
|
3581
|
-
}
|
|
3297
|
+
if (options.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
|
|
3582
3298
|
return [];
|
|
3583
3299
|
};
|
|
3584
3300
|
const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
@@ -3599,9 +3315,7 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3599
3315
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
3600
3316
|
let toNumber = padded === false && stringify(start, end, options) === false;
|
|
3601
3317
|
let format = options.transform || transform(toNumber);
|
|
3602
|
-
if (options.toRegex && step === 1)
|
|
3603
|
-
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
3604
|
-
}
|
|
3318
|
+
if (options.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
3605
3319
|
let parts = {
|
|
3606
3320
|
negatives: [],
|
|
3607
3321
|
positives: []
|
|
@@ -3610,35 +3324,26 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3610
3324
|
let range = [];
|
|
3611
3325
|
let index = 0;
|
|
3612
3326
|
while (descending ? a >= b : a <= b) {
|
|
3613
|
-
if (options.toRegex === true && step > 1)
|
|
3614
|
-
|
|
3615
|
-
} else {
|
|
3616
|
-
range.push(pad(format(a, index), maxLen, toNumber));
|
|
3617
|
-
}
|
|
3327
|
+
if (options.toRegex === true && step > 1) push(a);
|
|
3328
|
+
else range.push(pad(format(a, index), maxLen, toNumber));
|
|
3618
3329
|
a = descending ? a - step : a + step;
|
|
3619
3330
|
index++;
|
|
3620
3331
|
}
|
|
3621
|
-
if (options.toRegex === true) {
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
});
|
|
3626
|
-
}
|
|
3332
|
+
if (options.toRegex === true) return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, {
|
|
3333
|
+
wrap: false,
|
|
3334
|
+
...options
|
|
3335
|
+
});
|
|
3627
3336
|
return range;
|
|
3628
3337
|
};
|
|
3629
3338
|
const fillLetters = (start, end, step = 1, options = {}) => {
|
|
3630
|
-
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1)
|
|
3631
|
-
return invalidRange(start, end, options);
|
|
3632
|
-
}
|
|
3339
|
+
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
|
|
3633
3340
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
3634
3341
|
let a = `${start}`.charCodeAt(0);
|
|
3635
3342
|
let b = `${end}`.charCodeAt(0);
|
|
3636
3343
|
let descending = a > b;
|
|
3637
3344
|
let min = Math.min(a, b);
|
|
3638
3345
|
let max = Math.max(a, b);
|
|
3639
|
-
if (options.toRegex && step === 1)
|
|
3640
|
-
return toRange(min, max, false, options);
|
|
3641
|
-
}
|
|
3346
|
+
if (options.toRegex && step === 1) return toRange(min, max, false, options);
|
|
3642
3347
|
let range = [];
|
|
3643
3348
|
let index = 0;
|
|
3644
3349
|
while (descending ? a >= b : a <= b) {
|
|
@@ -3646,27 +3351,17 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3646
3351
|
a = descending ? a - step : a + step;
|
|
3647
3352
|
index++;
|
|
3648
3353
|
}
|
|
3649
|
-
if (options.toRegex === true) {
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
});
|
|
3654
|
-
}
|
|
3354
|
+
if (options.toRegex === true) return toRegex(range, null, {
|
|
3355
|
+
wrap: false,
|
|
3356
|
+
options
|
|
3357
|
+
});
|
|
3655
3358
|
return range;
|
|
3656
3359
|
};
|
|
3657
3360
|
const fill = (start, end, step, options = {}) => {
|
|
3658
|
-
if (end == null && isValidValue(start))
|
|
3659
|
-
|
|
3660
|
-
}
|
|
3661
|
-
if (
|
|
3662
|
-
return invalidRange(start, end, options);
|
|
3663
|
-
}
|
|
3664
|
-
if (typeof step === "function") {
|
|
3665
|
-
return fill(start, end, 1, { transform: step });
|
|
3666
|
-
}
|
|
3667
|
-
if (isObject(step)) {
|
|
3668
|
-
return fill(start, end, 0, step);
|
|
3669
|
-
}
|
|
3361
|
+
if (end == null && isValidValue(start)) return [start];
|
|
3362
|
+
if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
|
|
3363
|
+
if (typeof step === "function") return fill(start, end, 1, { transform: step });
|
|
3364
|
+
if (isObject(step)) return fill(start, end, 0, step);
|
|
3670
3365
|
let opts = { ...options };
|
|
3671
3366
|
if (opts.capture === true) opts.wrap = true;
|
|
3672
3367
|
step = step || opts.step || 1;
|
|
@@ -3674,14 +3369,11 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3674
3369
|
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
|
3675
3370
|
return fill(start, end, 1, step);
|
|
3676
3371
|
}
|
|
3677
|
-
if (isNumber(start) && isNumber(end))
|
|
3678
|
-
return fillNumbers(start, end, step, opts);
|
|
3679
|
-
}
|
|
3372
|
+
if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
|
|
3680
3373
|
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
3681
3374
|
};
|
|
3682
3375
|
module.exports = fill;
|
|
3683
3376
|
}));
|
|
3684
|
-
|
|
3685
3377
|
//#endregion
|
|
3686
3378
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
|
|
3687
3379
|
var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3694,25 +3386,15 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3694
3386
|
const invalid = invalidBlock === true || invalidNode === true;
|
|
3695
3387
|
const prefix = options.escapeInvalid === true ? "\\" : "";
|
|
3696
3388
|
let output = "";
|
|
3697
|
-
if (node.isOpen === true)
|
|
3698
|
-
return prefix + node.value;
|
|
3699
|
-
}
|
|
3389
|
+
if (node.isOpen === true) return prefix + node.value;
|
|
3700
3390
|
if (node.isClose === true) {
|
|
3701
3391
|
console.log("node.isClose", prefix, node.value);
|
|
3702
3392
|
return prefix + node.value;
|
|
3703
3393
|
}
|
|
3704
|
-
if (node.type === "open")
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
if (node.
|
|
3708
|
-
return invalid ? prefix + node.value : ")";
|
|
3709
|
-
}
|
|
3710
|
-
if (node.type === "comma") {
|
|
3711
|
-
return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
|
3712
|
-
}
|
|
3713
|
-
if (node.value) {
|
|
3714
|
-
return node.value;
|
|
3715
|
-
}
|
|
3394
|
+
if (node.type === "open") return invalid ? prefix + node.value : "(";
|
|
3395
|
+
if (node.type === "close") return invalid ? prefix + node.value : ")";
|
|
3396
|
+
if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
|
3397
|
+
if (node.value) return node.value;
|
|
3716
3398
|
if (node.nodes && node.ranges > 0) {
|
|
3717
3399
|
const args = utils.reduce(node.nodes);
|
|
3718
3400
|
const range = fill(...args, {
|
|
@@ -3721,22 +3403,15 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3721
3403
|
toRegex: true,
|
|
3722
3404
|
strictZeros: true
|
|
3723
3405
|
});
|
|
3724
|
-
if (range.length !== 0) {
|
|
3725
|
-
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
3726
|
-
}
|
|
3727
|
-
}
|
|
3728
|
-
if (node.nodes) {
|
|
3729
|
-
for (const child of node.nodes) {
|
|
3730
|
-
output += walk(child, node);
|
|
3731
|
-
}
|
|
3406
|
+
if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
3732
3407
|
}
|
|
3408
|
+
if (node.nodes) for (const child of node.nodes) output += walk(child, node);
|
|
3733
3409
|
return output;
|
|
3734
3410
|
};
|
|
3735
3411
|
return walk(ast);
|
|
3736
3412
|
};
|
|
3737
3413
|
module.exports = compile;
|
|
3738
3414
|
}));
|
|
3739
|
-
|
|
3740
3415
|
//#endregion
|
|
3741
3416
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
|
|
3742
3417
|
var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3748,25 +3423,16 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3748
3423
|
queue = [].concat(queue);
|
|
3749
3424
|
stash = [].concat(stash);
|
|
3750
3425
|
if (!stash.length) return queue;
|
|
3751
|
-
if (!queue.length) {
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
for (const value of item) {
|
|
3757
|
-
result.push(append(value, stash, enclose));
|
|
3758
|
-
}
|
|
3759
|
-
} else {
|
|
3760
|
-
for (let ele of stash) {
|
|
3761
|
-
if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
|
|
3762
|
-
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
3763
|
-
}
|
|
3764
|
-
}
|
|
3426
|
+
if (!queue.length) return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
3427
|
+
for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
|
|
3428
|
+
else for (let ele of stash) {
|
|
3429
|
+
if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
|
|
3430
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
3765
3431
|
}
|
|
3766
3432
|
return utils.flatten(result);
|
|
3767
3433
|
};
|
|
3768
3434
|
const expand = (ast, options = {}) => {
|
|
3769
|
-
const rangeLimit = options.rangeLimit ===
|
|
3435
|
+
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
3770
3436
|
const walk = (node, parent = {}) => {
|
|
3771
3437
|
node.queue = [];
|
|
3772
3438
|
let p = parent;
|
|
@@ -3785,13 +3451,9 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3785
3451
|
}
|
|
3786
3452
|
if (node.nodes && node.ranges > 0) {
|
|
3787
3453
|
const args = utils.reduce(node.nodes);
|
|
3788
|
-
if (utils.exceedsLimit(...args, options.step, rangeLimit))
|
|
3789
|
-
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
3790
|
-
}
|
|
3454
|
+
if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
3791
3455
|
let range = fill(...args, options);
|
|
3792
|
-
if (range.length === 0)
|
|
3793
|
-
range = stringify(node, options);
|
|
3794
|
-
}
|
|
3456
|
+
if (range.length === 0) range = stringify(node, options);
|
|
3795
3457
|
q.push(append(q.pop(), range));
|
|
3796
3458
|
node.nodes = [];
|
|
3797
3459
|
return;
|
|
@@ -3818,9 +3480,7 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3818
3480
|
queue.push(append(queue.pop(), child.value));
|
|
3819
3481
|
continue;
|
|
3820
3482
|
}
|
|
3821
|
-
if (child.nodes)
|
|
3822
|
-
walk(child, node);
|
|
3823
|
-
}
|
|
3483
|
+
if (child.nodes) walk(child, node);
|
|
3824
3484
|
}
|
|
3825
3485
|
return queue;
|
|
3826
3486
|
};
|
|
@@ -3828,7 +3488,6 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3828
3488
|
};
|
|
3829
3489
|
module.exports = expand;
|
|
3830
3490
|
}));
|
|
3831
|
-
|
|
3832
3491
|
//#endregion
|
|
3833
3492
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
|
|
3834
3493
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3880,7 +3539,6 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3880
3539
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
|
|
3881
3540
|
};
|
|
3882
3541
|
}));
|
|
3883
|
-
|
|
3884
3542
|
//#endregion
|
|
3885
3543
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
|
|
3886
3544
|
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3893,14 +3551,10 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3893
3551
|
* parse
|
|
3894
3552
|
*/
|
|
3895
3553
|
const parse = (input, options = {}) => {
|
|
3896
|
-
if (typeof input !== "string")
|
|
3897
|
-
throw new TypeError("Expected a string");
|
|
3898
|
-
}
|
|
3554
|
+
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
3899
3555
|
const opts = options || {};
|
|
3900
3556
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3901
|
-
if (input.length > max) {
|
|
3902
|
-
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
3903
|
-
}
|
|
3557
|
+
if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
3904
3558
|
const ast = {
|
|
3905
3559
|
type: "root",
|
|
3906
3560
|
input,
|
|
@@ -3919,9 +3573,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3919
3573
|
*/
|
|
3920
3574
|
const advance = () => input[index++];
|
|
3921
3575
|
const push = (node) => {
|
|
3922
|
-
if (node.type === "text" && prev.type === "dot")
|
|
3923
|
-
prev.type = "text";
|
|
3924
|
-
}
|
|
3576
|
+
if (node.type === "text" && prev.type === "dot") prev.type = "text";
|
|
3925
3577
|
if (prev && prev.type === "text" && node.type === "text") {
|
|
3926
3578
|
prev.value += node.value;
|
|
3927
3579
|
return;
|
|
@@ -3939,9 +3591,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3939
3591
|
/**
|
|
3940
3592
|
* Invalid chars
|
|
3941
3593
|
*/
|
|
3942
|
-
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE)
|
|
3943
|
-
continue;
|
|
3944
|
-
}
|
|
3594
|
+
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
|
|
3945
3595
|
/**
|
|
3946
3596
|
* Escaped chars
|
|
3947
3597
|
*/
|
|
@@ -3980,9 +3630,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3980
3630
|
}
|
|
3981
3631
|
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
3982
3632
|
brackets--;
|
|
3983
|
-
if (brackets === 0)
|
|
3984
|
-
break;
|
|
3985
|
-
}
|
|
3633
|
+
if (brackets === 0) break;
|
|
3986
3634
|
}
|
|
3987
3635
|
}
|
|
3988
3636
|
push({
|
|
@@ -4028,9 +3676,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4028
3676
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
4029
3677
|
const open = value;
|
|
4030
3678
|
let next;
|
|
4031
|
-
if (options.keepQuotes !== true)
|
|
4032
|
-
value = "";
|
|
4033
|
-
}
|
|
3679
|
+
if (options.keepQuotes !== true) value = "";
|
|
4034
3680
|
while (index < length && (next = advance())) {
|
|
4035
3681
|
if (next === CHAR_BACKSLASH) {
|
|
4036
3682
|
value += next + advance();
|
|
@@ -4053,18 +3699,16 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4053
3699
|
*/
|
|
4054
3700
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
4055
3701
|
depth++;
|
|
4056
|
-
|
|
4057
|
-
const brace = {
|
|
3702
|
+
block = push({
|
|
4058
3703
|
type: "brace",
|
|
4059
3704
|
open: true,
|
|
4060
3705
|
close: false,
|
|
4061
|
-
dollar,
|
|
3706
|
+
dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
|
|
4062
3707
|
depth,
|
|
4063
3708
|
commas: 0,
|
|
4064
3709
|
ranges: 0,
|
|
4065
3710
|
nodes: []
|
|
4066
|
-
};
|
|
4067
|
-
block = push(brace);
|
|
3711
|
+
});
|
|
4068
3712
|
stack.push(block);
|
|
4069
3713
|
push({
|
|
4070
3714
|
type: "open",
|
|
@@ -4182,7 +3826,6 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4182
3826
|
};
|
|
4183
3827
|
module.exports = parse;
|
|
4184
3828
|
}));
|
|
4185
|
-
|
|
4186
3829
|
//#endregion
|
|
4187
3830
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
|
|
4188
3831
|
var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -4205,21 +3848,13 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4205
3848
|
*/
|
|
4206
3849
|
const braces = (input, options = {}) => {
|
|
4207
3850
|
let output = [];
|
|
4208
|
-
if (Array.isArray(input)) {
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
output.push(...result);
|
|
4213
|
-
} else {
|
|
4214
|
-
output.push(result);
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4217
|
-
} else {
|
|
4218
|
-
output = [].concat(braces.create(input, options));
|
|
4219
|
-
}
|
|
4220
|
-
if (options && options.expand === true && options.nodupes === true) {
|
|
4221
|
-
output = [...new Set(output)];
|
|
3851
|
+
if (Array.isArray(input)) for (const pattern of input) {
|
|
3852
|
+
const result = braces.create(pattern, options);
|
|
3853
|
+
if (Array.isArray(result)) output.push(...result);
|
|
3854
|
+
else output.push(result);
|
|
4222
3855
|
}
|
|
3856
|
+
else output = [].concat(braces.create(input, options));
|
|
3857
|
+
if (options && options.expand === true && options.nodupes === true) output = [...new Set(output)];
|
|
4223
3858
|
return output;
|
|
4224
3859
|
};
|
|
4225
3860
|
/**
|
|
@@ -4250,9 +3885,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4250
3885
|
* @api public
|
|
4251
3886
|
*/
|
|
4252
3887
|
braces.stringify = (input, options = {}) => {
|
|
4253
|
-
if (typeof input === "string")
|
|
4254
|
-
return stringify(braces.parse(input, options), options);
|
|
4255
|
-
}
|
|
3888
|
+
if (typeof input === "string") return stringify(braces.parse(input, options), options);
|
|
4256
3889
|
return stringify(input, options);
|
|
4257
3890
|
};
|
|
4258
3891
|
/**
|
|
@@ -4270,9 +3903,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4270
3903
|
* @api public
|
|
4271
3904
|
*/
|
|
4272
3905
|
braces.compile = (input, options = {}) => {
|
|
4273
|
-
if (typeof input === "string")
|
|
4274
|
-
input = braces.parse(input, options);
|
|
4275
|
-
}
|
|
3906
|
+
if (typeof input === "string") input = braces.parse(input, options);
|
|
4276
3907
|
return compile(input, options);
|
|
4277
3908
|
};
|
|
4278
3909
|
/**
|
|
@@ -4292,16 +3923,10 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4292
3923
|
* @api public
|
|
4293
3924
|
*/
|
|
4294
3925
|
braces.expand = (input, options = {}) => {
|
|
4295
|
-
if (typeof input === "string")
|
|
4296
|
-
input = braces.parse(input, options);
|
|
4297
|
-
}
|
|
3926
|
+
if (typeof input === "string") input = braces.parse(input, options);
|
|
4298
3927
|
let result = expand(input, options);
|
|
4299
|
-
if (options.noempty === true)
|
|
4300
|
-
|
|
4301
|
-
}
|
|
4302
|
-
if (options.nodupes === true) {
|
|
4303
|
-
result = [...new Set(result)];
|
|
4304
|
-
}
|
|
3928
|
+
if (options.noempty === true) result = result.filter(Boolean);
|
|
3929
|
+
if (options.nodupes === true) result = [...new Set(result)];
|
|
4305
3930
|
return result;
|
|
4306
3931
|
};
|
|
4307
3932
|
/**
|
|
@@ -4320,9 +3945,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4320
3945
|
* @api public
|
|
4321
3946
|
*/
|
|
4322
3947
|
braces.create = (input, options = {}) => {
|
|
4323
|
-
if (input === "" || input.length < 3)
|
|
4324
|
-
return [input];
|
|
4325
|
-
}
|
|
3948
|
+
if (input === "" || input.length < 3) return [input];
|
|
4326
3949
|
return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
|
|
4327
3950
|
};
|
|
4328
3951
|
/**
|
|
@@ -4330,7 +3953,6 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4330
3953
|
*/
|
|
4331
3954
|
module.exports = braces;
|
|
4332
3955
|
}));
|
|
4333
|
-
|
|
4334
3956
|
//#endregion
|
|
4335
3957
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
4336
3958
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -4349,12 +3971,6 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4349
3971
|
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
4350
3972
|
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
4351
3973
|
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
4352
|
-
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
4353
|
-
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
4354
|
-
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
4355
|
-
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
4356
|
-
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
4357
|
-
const STAR = `${QMARK}*?`;
|
|
4358
3974
|
const POSIX_CHARS = {
|
|
4359
3975
|
DOT_LITERAL,
|
|
4360
3976
|
PLUS_LITERAL,
|
|
@@ -4364,12 +3980,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4364
3980
|
QMARK,
|
|
4365
3981
|
END_ANCHOR,
|
|
4366
3982
|
DOTS_SLASH,
|
|
4367
|
-
NO_DOT
|
|
4368
|
-
NO_DOTS
|
|
4369
|
-
NO_DOT_SLASH,
|
|
4370
|
-
NO_DOTS_SLASH
|
|
4371
|
-
QMARK_NO_DOT
|
|
4372
|
-
STAR
|
|
3983
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
3984
|
+
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
3985
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
3986
|
+
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
3987
|
+
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
3988
|
+
STAR: `${QMARK}*?`,
|
|
4373
3989
|
START_ANCHOR
|
|
4374
3990
|
};
|
|
4375
3991
|
/**
|
|
@@ -4389,28 +4005,24 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4389
4005
|
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
4390
4006
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
4391
4007
|
};
|
|
4392
|
-
/**
|
|
4393
|
-
* POSIX Bracket Regex
|
|
4394
|
-
*/
|
|
4395
|
-
const POSIX_REGEX_SOURCE = {
|
|
4396
|
-
alnum: "a-zA-Z0-9",
|
|
4397
|
-
alpha: "a-zA-Z",
|
|
4398
|
-
ascii: "\\x00-\\x7F",
|
|
4399
|
-
blank: " \\t",
|
|
4400
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
4401
|
-
digit: "0-9",
|
|
4402
|
-
graph: "\\x21-\\x7E",
|
|
4403
|
-
lower: "a-z",
|
|
4404
|
-
print: "\\x20-\\x7E ",
|
|
4405
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
4406
|
-
space: " \\t\\r\\n\\v\\f",
|
|
4407
|
-
upper: "A-Z",
|
|
4408
|
-
word: "A-Za-z0-9_",
|
|
4409
|
-
xdigit: "A-Fa-f0-9"
|
|
4410
|
-
};
|
|
4411
4008
|
module.exports = {
|
|
4412
4009
|
MAX_LENGTH: 1024 * 64,
|
|
4413
|
-
POSIX_REGEX_SOURCE
|
|
4010
|
+
POSIX_REGEX_SOURCE: {
|
|
4011
|
+
alnum: "a-zA-Z0-9",
|
|
4012
|
+
alpha: "a-zA-Z",
|
|
4013
|
+
ascii: "\\x00-\\x7F",
|
|
4014
|
+
blank: " \\t",
|
|
4015
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
4016
|
+
digit: "0-9",
|
|
4017
|
+
graph: "\\x21-\\x7E",
|
|
4018
|
+
lower: "a-z",
|
|
4019
|
+
print: "\\x20-\\x7E ",
|
|
4020
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
4021
|
+
space: " \\t\\r\\n\\v\\f",
|
|
4022
|
+
upper: "A-Z",
|
|
4023
|
+
word: "A-Za-z0-9_",
|
|
4024
|
+
xdigit: "A-Fa-f0-9"
|
|
4025
|
+
},
|
|
4414
4026
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
4415
4027
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
4416
4028
|
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
@@ -4500,7 +4112,6 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4500
4112
|
}
|
|
4501
4113
|
};
|
|
4502
4114
|
}));
|
|
4503
|
-
|
|
4504
4115
|
//#endregion
|
|
4505
4116
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
4506
4117
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -4519,15 +4130,11 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4519
4130
|
};
|
|
4520
4131
|
exports.supportsLookbehinds = () => {
|
|
4521
4132
|
const segs = process.version.slice(1).split(".").map(Number);
|
|
4522
|
-
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10)
|
|
4523
|
-
return true;
|
|
4524
|
-
}
|
|
4133
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
|
|
4525
4134
|
return false;
|
|
4526
4135
|
};
|
|
4527
4136
|
exports.isWindows = (options) => {
|
|
4528
|
-
if (options && typeof options.windows === "boolean")
|
|
4529
|
-
return options.windows;
|
|
4530
|
-
}
|
|
4137
|
+
if (options && typeof options.windows === "boolean") return options.windows;
|
|
4531
4138
|
return win32 === true || path$2.sep === "\\";
|
|
4532
4139
|
};
|
|
4533
4140
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
@@ -4545,16 +4152,11 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4545
4152
|
return output;
|
|
4546
4153
|
};
|
|
4547
4154
|
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
let output = `${prepend}(?:${input})${append}`;
|
|
4551
|
-
if (state.negated === true) {
|
|
4552
|
-
output = `(?:^(?!${output}).*$)`;
|
|
4553
|
-
}
|
|
4155
|
+
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
4156
|
+
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
4554
4157
|
return output;
|
|
4555
4158
|
};
|
|
4556
4159
|
}));
|
|
4557
|
-
|
|
4558
4160
|
//#endregion
|
|
4559
4161
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
|
|
4560
4162
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -4564,9 +4166,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4564
4166
|
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
4565
4167
|
};
|
|
4566
4168
|
const depth = (token) => {
|
|
4567
|
-
if (token.isPrefix !== true)
|
|
4568
|
-
token.depth = token.isGlobstar ? Infinity : 1;
|
|
4569
|
-
}
|
|
4169
|
+
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
|
|
4570
4170
|
};
|
|
4571
4171
|
/**
|
|
4572
4172
|
* Quickly scans a glob pattern and returns an object with a handful of
|
|
@@ -4625,9 +4225,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4625
4225
|
if (code === CHAR_BACKWARD_SLASH) {
|
|
4626
4226
|
backslashes = token.backslashes = true;
|
|
4627
4227
|
code = advance();
|
|
4628
|
-
if (code === CHAR_LEFT_CURLY_BRACE)
|
|
4629
|
-
braceEscaped = true;
|
|
4630
|
-
}
|
|
4228
|
+
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
4631
4229
|
continue;
|
|
4632
4230
|
}
|
|
4633
4231
|
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
@@ -4646,18 +4244,14 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4646
4244
|
isBrace = token.isBrace = true;
|
|
4647
4245
|
isGlob = token.isGlob = true;
|
|
4648
4246
|
finished = true;
|
|
4649
|
-
if (scanToEnd === true)
|
|
4650
|
-
continue;
|
|
4651
|
-
}
|
|
4247
|
+
if (scanToEnd === true) continue;
|
|
4652
4248
|
break;
|
|
4653
4249
|
}
|
|
4654
4250
|
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
4655
4251
|
isBrace = token.isBrace = true;
|
|
4656
4252
|
isGlob = token.isGlob = true;
|
|
4657
4253
|
finished = true;
|
|
4658
|
-
if (scanToEnd === true)
|
|
4659
|
-
continue;
|
|
4660
|
-
}
|
|
4254
|
+
if (scanToEnd === true) continue;
|
|
4661
4255
|
break;
|
|
4662
4256
|
}
|
|
4663
4257
|
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
@@ -4670,9 +4264,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4670
4264
|
}
|
|
4671
4265
|
}
|
|
4672
4266
|
}
|
|
4673
|
-
if (scanToEnd === true)
|
|
4674
|
-
continue;
|
|
4675
|
-
}
|
|
4267
|
+
if (scanToEnd === true) continue;
|
|
4676
4268
|
break;
|
|
4677
4269
|
}
|
|
4678
4270
|
if (code === CHAR_FORWARD_SLASH) {
|
|
@@ -4692,14 +4284,11 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4692
4284
|
continue;
|
|
4693
4285
|
}
|
|
4694
4286
|
if (opts.noext !== true) {
|
|
4695
|
-
|
|
4696
|
-
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
4287
|
+
if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
4697
4288
|
isGlob = token.isGlob = true;
|
|
4698
4289
|
isExtglob = token.isExtglob = true;
|
|
4699
4290
|
finished = true;
|
|
4700
|
-
if (code === CHAR_EXCLAMATION_MARK && index === start)
|
|
4701
|
-
negatedExtglob = true;
|
|
4702
|
-
}
|
|
4291
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
4703
4292
|
if (scanToEnd === true) {
|
|
4704
4293
|
while (eos() !== true && (code = advance())) {
|
|
4705
4294
|
if (code === CHAR_BACKWARD_SLASH) {
|
|
@@ -4722,17 +4311,13 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4722
4311
|
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
4723
4312
|
isGlob = token.isGlob = true;
|
|
4724
4313
|
finished = true;
|
|
4725
|
-
if (scanToEnd === true)
|
|
4726
|
-
continue;
|
|
4727
|
-
}
|
|
4314
|
+
if (scanToEnd === true) continue;
|
|
4728
4315
|
break;
|
|
4729
4316
|
}
|
|
4730
4317
|
if (code === CHAR_QUESTION_MARK) {
|
|
4731
4318
|
isGlob = token.isGlob = true;
|
|
4732
4319
|
finished = true;
|
|
4733
|
-
if (scanToEnd === true)
|
|
4734
|
-
continue;
|
|
4735
|
-
}
|
|
4320
|
+
if (scanToEnd === true) continue;
|
|
4736
4321
|
break;
|
|
4737
4322
|
}
|
|
4738
4323
|
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
@@ -4749,9 +4334,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4749
4334
|
break;
|
|
4750
4335
|
}
|
|
4751
4336
|
}
|
|
4752
|
-
if (scanToEnd === true)
|
|
4753
|
-
continue;
|
|
4754
|
-
}
|
|
4337
|
+
if (scanToEnd === true) continue;
|
|
4755
4338
|
break;
|
|
4756
4339
|
}
|
|
4757
4340
|
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
@@ -4779,9 +4362,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4779
4362
|
}
|
|
4780
4363
|
if (isGlob === true) {
|
|
4781
4364
|
finished = true;
|
|
4782
|
-
if (scanToEnd === true)
|
|
4783
|
-
continue;
|
|
4784
|
-
}
|
|
4365
|
+
if (scanToEnd === true) continue;
|
|
4785
4366
|
break;
|
|
4786
4367
|
}
|
|
4787
4368
|
}
|
|
@@ -4803,19 +4384,13 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4803
4384
|
} else if (isGlob === true) {
|
|
4804
4385
|
base = "";
|
|
4805
4386
|
glob = str;
|
|
4806
|
-
} else
|
|
4807
|
-
base = str;
|
|
4808
|
-
}
|
|
4387
|
+
} else base = str;
|
|
4809
4388
|
if (base && base !== "" && base !== "/" && base !== str) {
|
|
4810
|
-
if (isPathSeparator(base.charCodeAt(base.length - 1)))
|
|
4811
|
-
base = base.slice(0, -1);
|
|
4812
|
-
}
|
|
4389
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
4813
4390
|
}
|
|
4814
4391
|
if (opts.unescape === true) {
|
|
4815
4392
|
if (glob) glob = utils.removeBackslashes(glob);
|
|
4816
|
-
if (base && backslashes === true)
|
|
4817
|
-
base = utils.removeBackslashes(base);
|
|
4818
|
-
}
|
|
4393
|
+
if (base && backslashes === true) base = utils.removeBackslashes(base);
|
|
4819
4394
|
}
|
|
4820
4395
|
const state = {
|
|
4821
4396
|
prefix,
|
|
@@ -4833,9 +4408,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4833
4408
|
};
|
|
4834
4409
|
if (opts.tokens === true) {
|
|
4835
4410
|
state.maxDepth = 0;
|
|
4836
|
-
if (!isPathSeparator(code))
|
|
4837
|
-
tokens.push(token);
|
|
4838
|
-
}
|
|
4411
|
+
if (!isPathSeparator(code)) tokens.push(token);
|
|
4839
4412
|
state.tokens = tokens;
|
|
4840
4413
|
}
|
|
4841
4414
|
if (opts.parts === true || opts.tokens === true) {
|
|
@@ -4848,15 +4421,11 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4848
4421
|
if (idx === 0 && start !== 0) {
|
|
4849
4422
|
tokens[idx].isPrefix = true;
|
|
4850
4423
|
tokens[idx].value = prefix;
|
|
4851
|
-
} else
|
|
4852
|
-
tokens[idx].value = value;
|
|
4853
|
-
}
|
|
4424
|
+
} else tokens[idx].value = value;
|
|
4854
4425
|
depth(tokens[idx]);
|
|
4855
4426
|
state.maxDepth += tokens[idx].depth;
|
|
4856
4427
|
}
|
|
4857
|
-
if (idx !== 0 || value !== "")
|
|
4858
|
-
parts.push(value);
|
|
4859
|
-
}
|
|
4428
|
+
if (idx !== 0 || value !== "") parts.push(value);
|
|
4860
4429
|
prevIndex = i;
|
|
4861
4430
|
}
|
|
4862
4431
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
@@ -4875,7 +4444,6 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4875
4444
|
};
|
|
4876
4445
|
module.exports = scan;
|
|
4877
4446
|
}));
|
|
4878
|
-
|
|
4879
4447
|
//#endregion
|
|
4880
4448
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
|
|
4881
4449
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -4889,9 +4457,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4889
4457
|
* Helpers
|
|
4890
4458
|
*/
|
|
4891
4459
|
const expandRange = (args, options) => {
|
|
4892
|
-
if (typeof options.expandRange === "function")
|
|
4893
|
-
return options.expandRange(...args, options);
|
|
4894
|
-
}
|
|
4460
|
+
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
|
|
4895
4461
|
args.sort();
|
|
4896
4462
|
const value = `[${args.join("-")}]`;
|
|
4897
4463
|
try {
|
|
@@ -4914,16 +4480,12 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4914
4480
|
* @return {Object}
|
|
4915
4481
|
*/
|
|
4916
4482
|
const parse = (input, options) => {
|
|
4917
|
-
if (typeof input !== "string")
|
|
4918
|
-
throw new TypeError("Expected a string");
|
|
4919
|
-
}
|
|
4483
|
+
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
4920
4484
|
input = REPLACEMENTS[input] || input;
|
|
4921
4485
|
const opts = { ...options };
|
|
4922
4486
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
4923
4487
|
let len = input.length;
|
|
4924
|
-
if (len > max) {
|
|
4925
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
4926
|
-
}
|
|
4488
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
4927
4489
|
const bos = {
|
|
4928
4490
|
type: "bos",
|
|
4929
4491
|
value: "",
|
|
@@ -4941,12 +4503,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4941
4503
|
const nodot = opts.dot ? "" : NO_DOT;
|
|
4942
4504
|
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
4943
4505
|
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
4944
|
-
if (opts.capture) {
|
|
4945
|
-
|
|
4946
|
-
}
|
|
4947
|
-
if (typeof opts.noext === "boolean") {
|
|
4948
|
-
opts.noextglob = opts.noext;
|
|
4949
|
-
}
|
|
4506
|
+
if (opts.capture) star = `(${star})`;
|
|
4507
|
+
if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
|
|
4950
4508
|
const state = {
|
|
4951
4509
|
input,
|
|
4952
4510
|
index: -1,
|
|
@@ -4993,9 +4551,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4993
4551
|
state.start++;
|
|
4994
4552
|
count++;
|
|
4995
4553
|
}
|
|
4996
|
-
if (count % 2 === 0)
|
|
4997
|
-
return false;
|
|
4998
|
-
}
|
|
4554
|
+
if (count % 2 === 0) return false;
|
|
4999
4555
|
state.negated = true;
|
|
5000
4556
|
state.start++;
|
|
5001
4557
|
return true;
|
|
@@ -5027,9 +4583,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5027
4583
|
state.output += prev.output;
|
|
5028
4584
|
}
|
|
5029
4585
|
}
|
|
5030
|
-
if (extglobs.length && tok.type !== "paren")
|
|
5031
|
-
extglobs[extglobs.length - 1].inner += tok.value;
|
|
5032
|
-
}
|
|
4586
|
+
if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
|
|
5033
4587
|
if (tok.value || tok.output) append(tok);
|
|
5034
4588
|
if (prev && prev.type === "text" && tok.type === "text") {
|
|
5035
4589
|
prev.value += tok.value;
|
|
@@ -5069,22 +4623,13 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5069
4623
|
let rest;
|
|
5070
4624
|
if (token.type === "negate") {
|
|
5071
4625
|
let extglobStar = star;
|
|
5072
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes("/"))
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
}
|
|
5078
|
-
if (token.
|
|
5079
|
-
const expression = parse(rest, {
|
|
5080
|
-
...options,
|
|
5081
|
-
fastpaths: false
|
|
5082
|
-
}).output;
|
|
5083
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
5084
|
-
}
|
|
5085
|
-
if (token.prev.type === "bos") {
|
|
5086
|
-
state.negatedExtglob = true;
|
|
5087
|
-
}
|
|
4626
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
|
|
4627
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
4628
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
|
|
4629
|
+
...options,
|
|
4630
|
+
fastpaths: false
|
|
4631
|
+
}).output})${extglobStar})`;
|
|
4632
|
+
if (token.prev.type === "bos") state.negatedExtglob = true;
|
|
5088
4633
|
}
|
|
5089
4634
|
push({
|
|
5090
4635
|
type: "paren",
|
|
@@ -5105,34 +4650,21 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5105
4650
|
return m;
|
|
5106
4651
|
}
|
|
5107
4652
|
if (first === "?") {
|
|
5108
|
-
if (esc)
|
|
5109
|
-
|
|
5110
|
-
}
|
|
5111
|
-
if (index === 0) {
|
|
5112
|
-
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
5113
|
-
}
|
|
4653
|
+
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
4654
|
+
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
5114
4655
|
return QMARK.repeat(chars.length);
|
|
5115
4656
|
}
|
|
5116
|
-
if (first === ".")
|
|
5117
|
-
return DOT_LITERAL.repeat(chars.length);
|
|
5118
|
-
}
|
|
4657
|
+
if (first === ".") return DOT_LITERAL.repeat(chars.length);
|
|
5119
4658
|
if (first === "*") {
|
|
5120
|
-
if (esc)
|
|
5121
|
-
return esc + first + (rest ? star : "");
|
|
5122
|
-
}
|
|
4659
|
+
if (esc) return esc + first + (rest ? star : "");
|
|
5123
4660
|
return star;
|
|
5124
4661
|
}
|
|
5125
4662
|
return esc ? m : `\\${m}`;
|
|
5126
4663
|
});
|
|
5127
|
-
if (backslashes === true)
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
output = output.replace(/\\+/g, (m) => {
|
|
5132
|
-
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
5133
|
-
});
|
|
5134
|
-
}
|
|
5135
|
-
}
|
|
4664
|
+
if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
|
|
4665
|
+
else output = output.replace(/\\+/g, (m) => {
|
|
4666
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
4667
|
+
});
|
|
5136
4668
|
if (output === input && opts.contains === true) {
|
|
5137
4669
|
state.output = input;
|
|
5138
4670
|
return state;
|
|
@@ -5145,20 +4677,14 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5145
4677
|
*/
|
|
5146
4678
|
while (!eos()) {
|
|
5147
4679
|
value = advance();
|
|
5148
|
-
if (value === "\0")
|
|
5149
|
-
continue;
|
|
5150
|
-
}
|
|
4680
|
+
if (value === "\0") continue;
|
|
5151
4681
|
/**
|
|
5152
4682
|
* Escaped characters
|
|
5153
4683
|
*/
|
|
5154
4684
|
if (value === "\\") {
|
|
5155
4685
|
const next = peek();
|
|
5156
|
-
if (next === "/" && opts.bash !== true)
|
|
5157
|
-
|
|
5158
|
-
}
|
|
5159
|
-
if (next === "." || next === ";") {
|
|
5160
|
-
continue;
|
|
5161
|
-
}
|
|
4686
|
+
if (next === "/" && opts.bash !== true) continue;
|
|
4687
|
+
if (next === "." || next === ";") continue;
|
|
5162
4688
|
if (!next) {
|
|
5163
4689
|
value += "\\";
|
|
5164
4690
|
push({
|
|
@@ -5172,15 +4698,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5172
4698
|
if (match && match[0].length > 2) {
|
|
5173
4699
|
slashes = match[0].length;
|
|
5174
4700
|
state.index += slashes;
|
|
5175
|
-
if (slashes % 2 !== 0)
|
|
5176
|
-
value += "\\";
|
|
5177
|
-
}
|
|
5178
|
-
}
|
|
5179
|
-
if (opts.unescape === true) {
|
|
5180
|
-
value = advance();
|
|
5181
|
-
} else {
|
|
5182
|
-
value += advance();
|
|
4701
|
+
if (slashes % 2 !== 0) value += "\\";
|
|
5183
4702
|
}
|
|
4703
|
+
if (opts.unescape === true) value = advance();
|
|
4704
|
+
else value += advance();
|
|
5184
4705
|
if (state.brackets === 0) {
|
|
5185
4706
|
push({
|
|
5186
4707
|
type: "text",
|
|
@@ -5201,29 +4722,20 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5201
4722
|
if (inner.includes(":")) {
|
|
5202
4723
|
const idx = prev.value.lastIndexOf("[");
|
|
5203
4724
|
const pre = prev.value.slice(0, idx);
|
|
5204
|
-
const
|
|
5205
|
-
const posix = POSIX_REGEX_SOURCE[rest];
|
|
4725
|
+
const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
5206
4726
|
if (posix) {
|
|
5207
4727
|
prev.value = pre + posix;
|
|
5208
4728
|
state.backtrack = true;
|
|
5209
4729
|
advance();
|
|
5210
|
-
if (!bos.output && tokens.indexOf(prev) === 1)
|
|
5211
|
-
bos.output = ONE_CHAR;
|
|
5212
|
-
}
|
|
4730
|
+
if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
|
|
5213
4731
|
continue;
|
|
5214
4732
|
}
|
|
5215
4733
|
}
|
|
5216
|
-
}
|
|
5217
|
-
}
|
|
5218
|
-
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
5219
|
-
value = `\\${value}`;
|
|
5220
|
-
}
|
|
5221
|
-
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
5222
|
-
value = `\\${value}`;
|
|
5223
|
-
}
|
|
5224
|
-
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
5225
|
-
value = "^";
|
|
4734
|
+
}
|
|
5226
4735
|
}
|
|
4736
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
|
|
4737
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
|
|
4738
|
+
if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
|
|
5227
4739
|
prev.value += value;
|
|
5228
4740
|
append({ value });
|
|
5229
4741
|
continue;
|
|
@@ -5243,12 +4755,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5243
4755
|
*/
|
|
5244
4756
|
if (value === "\"") {
|
|
5245
4757
|
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
5246
|
-
if (opts.keepQuotes === true) {
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
});
|
|
5251
|
-
}
|
|
4758
|
+
if (opts.keepQuotes === true) push({
|
|
4759
|
+
type: "text",
|
|
4760
|
+
value
|
|
4761
|
+
});
|
|
5252
4762
|
continue;
|
|
5253
4763
|
}
|
|
5254
4764
|
/**
|
|
@@ -5263,9 +4773,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5263
4773
|
continue;
|
|
5264
4774
|
}
|
|
5265
4775
|
if (value === ")") {
|
|
5266
|
-
if (state.parens === 0 && opts.strictBrackets === true)
|
|
5267
|
-
throw new SyntaxError(syntaxError("opening", "("));
|
|
5268
|
-
}
|
|
4776
|
+
if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
|
|
5269
4777
|
const extglob = extglobs[extglobs.length - 1];
|
|
5270
4778
|
if (extglob && state.parens === extglob.parens + 1) {
|
|
5271
4779
|
extglobClose(extglobs.pop());
|
|
@@ -5284,13 +4792,9 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5284
4792
|
*/
|
|
5285
4793
|
if (value === "[") {
|
|
5286
4794
|
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
5287
|
-
if (opts.nobracket !== true && opts.strictBrackets === true)
|
|
5288
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
5289
|
-
}
|
|
4795
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
5290
4796
|
value = `\\${value}`;
|
|
5291
|
-
} else
|
|
5292
|
-
increment("brackets");
|
|
5293
|
-
}
|
|
4797
|
+
} else increment("brackets");
|
|
5294
4798
|
push({
|
|
5295
4799
|
type: "bracket",
|
|
5296
4800
|
value
|
|
@@ -5307,9 +4811,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5307
4811
|
continue;
|
|
5308
4812
|
}
|
|
5309
4813
|
if (state.brackets === 0) {
|
|
5310
|
-
if (opts.strictBrackets === true)
|
|
5311
|
-
throw new SyntaxError(syntaxError("opening", "["));
|
|
5312
|
-
}
|
|
4814
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
|
|
5313
4815
|
push({
|
|
5314
4816
|
type: "text",
|
|
5315
4817
|
value,
|
|
@@ -5319,14 +4821,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5319
4821
|
}
|
|
5320
4822
|
decrement("brackets");
|
|
5321
4823
|
const prevValue = prev.value.slice(1);
|
|
5322
|
-
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
5323
|
-
value = `/${value}`;
|
|
5324
|
-
}
|
|
4824
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
|
|
5325
4825
|
prev.value += value;
|
|
5326
4826
|
append({ value });
|
|
5327
|
-
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue))
|
|
5328
|
-
continue;
|
|
5329
|
-
}
|
|
4827
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
|
|
5330
4828
|
const escaped = utils.escapeRegex(prev.value);
|
|
5331
4829
|
state.output = state.output.slice(0, -prev.value.length);
|
|
5332
4830
|
if (opts.literalBrackets === true) {
|
|
@@ -5370,12 +4868,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5370
4868
|
const range = [];
|
|
5371
4869
|
for (let i = arr.length - 1; i >= 0; i--) {
|
|
5372
4870
|
tokens.pop();
|
|
5373
|
-
if (arr[i].type === "brace")
|
|
5374
|
-
|
|
5375
|
-
}
|
|
5376
|
-
if (arr[i].type !== "dots") {
|
|
5377
|
-
range.unshift(arr[i].value);
|
|
5378
|
-
}
|
|
4871
|
+
if (arr[i].type === "brace") break;
|
|
4872
|
+
if (arr[i].type !== "dots") range.unshift(arr[i].value);
|
|
5379
4873
|
}
|
|
5380
4874
|
output = expandRange(range, opts);
|
|
5381
4875
|
state.backtrack = true;
|
|
@@ -5386,9 +4880,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5386
4880
|
brace.value = brace.output = "\\{";
|
|
5387
4881
|
value = output = "\\}";
|
|
5388
4882
|
state.output = out;
|
|
5389
|
-
for (const t of toks)
|
|
5390
|
-
state.output += t.output || t.value;
|
|
5391
|
-
}
|
|
4883
|
+
for (const t of toks) state.output += t.output || t.value;
|
|
5392
4884
|
}
|
|
5393
4885
|
push({
|
|
5394
4886
|
type: "brace",
|
|
@@ -5403,9 +4895,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5403
4895
|
* Pipes
|
|
5404
4896
|
*/
|
|
5405
4897
|
if (value === "|") {
|
|
5406
|
-
if (extglobs.length > 0)
|
|
5407
|
-
extglobs[extglobs.length - 1].conditions++;
|
|
5408
|
-
}
|
|
4898
|
+
if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
|
|
5409
4899
|
push({
|
|
5410
4900
|
type: "text",
|
|
5411
4901
|
value
|
|
@@ -5480,20 +4970,15 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5480
4970
|
* Question marks
|
|
5481
4971
|
*/
|
|
5482
4972
|
if (value === "?") {
|
|
5483
|
-
|
|
5484
|
-
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
4973
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
5485
4974
|
extglobOpen("qmark", value);
|
|
5486
4975
|
continue;
|
|
5487
4976
|
}
|
|
5488
4977
|
if (prev && prev.type === "paren") {
|
|
5489
4978
|
const next = peek();
|
|
5490
4979
|
let output = value;
|
|
5491
|
-
if (next === "<" && !utils.supportsLookbehinds())
|
|
5492
|
-
|
|
5493
|
-
}
|
|
5494
|
-
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
5495
|
-
output = `\\${value}`;
|
|
5496
|
-
}
|
|
4980
|
+
if (next === "<" && !utils.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
4981
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
5497
4982
|
push({
|
|
5498
4983
|
type: "text",
|
|
5499
4984
|
value,
|
|
@@ -5583,9 +5068,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5583
5068
|
* Plain text
|
|
5584
5069
|
*/
|
|
5585
5070
|
if (value !== "*") {
|
|
5586
|
-
if (value === "$" || value === "^") {
|
|
5587
|
-
value = `\\${value}`;
|
|
5588
|
-
}
|
|
5071
|
+
if (value === "$" || value === "^") value = `\\${value}`;
|
|
5589
5072
|
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
5590
5073
|
if (match) {
|
|
5591
5074
|
value += match[0];
|
|
@@ -5644,9 +5127,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5644
5127
|
}
|
|
5645
5128
|
while (rest.slice(0, 3) === "/**") {
|
|
5646
5129
|
const after = input[state.index + 4];
|
|
5647
|
-
if (after && after !== "/")
|
|
5648
|
-
break;
|
|
5649
|
-
}
|
|
5130
|
+
if (after && after !== "/") break;
|
|
5650
5131
|
rest = rest.slice(3);
|
|
5651
5132
|
consume("/**", 3);
|
|
5652
5133
|
}
|
|
@@ -5717,9 +5198,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5717
5198
|
};
|
|
5718
5199
|
if (opts.bash === true) {
|
|
5719
5200
|
token.output = ".*?";
|
|
5720
|
-
if (prev.type === "bos" || prev.type === "slash")
|
|
5721
|
-
token.output = nodot + token.output;
|
|
5722
|
-
}
|
|
5201
|
+
if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
|
|
5723
5202
|
push(token);
|
|
5724
5203
|
continue;
|
|
5725
5204
|
}
|
|
@@ -5761,20 +5240,16 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5761
5240
|
state.output = utils.escapeLast(state.output, "{");
|
|
5762
5241
|
decrement("braces");
|
|
5763
5242
|
}
|
|
5764
|
-
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
});
|
|
5770
|
-
}
|
|
5243
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
|
|
5244
|
+
type: "maybe_slash",
|
|
5245
|
+
value: "",
|
|
5246
|
+
output: `${SLASH_LITERAL}?`
|
|
5247
|
+
});
|
|
5771
5248
|
if (state.backtrack === true) {
|
|
5772
5249
|
state.output = "";
|
|
5773
5250
|
for (const token of state.tokens) {
|
|
5774
5251
|
state.output += token.output != null ? token.output : token.value;
|
|
5775
|
-
if (token.suffix)
|
|
5776
|
-
state.output += token.suffix;
|
|
5777
|
-
}
|
|
5252
|
+
if (token.suffix) state.output += token.suffix;
|
|
5778
5253
|
}
|
|
5779
5254
|
}
|
|
5780
5255
|
return state;
|
|
@@ -5788,9 +5263,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5788
5263
|
const opts = { ...options };
|
|
5789
5264
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
5790
5265
|
const len = input.length;
|
|
5791
|
-
if (len > max) {
|
|
5792
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
5793
|
-
}
|
|
5266
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
5794
5267
|
input = REPLACEMENTS[input] || input;
|
|
5795
5268
|
const win32 = utils.isWindows(options);
|
|
5796
5269
|
const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32);
|
|
@@ -5802,9 +5275,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5802
5275
|
prefix: ""
|
|
5803
5276
|
};
|
|
5804
5277
|
let star = opts.bash === true ? ".*?" : STAR;
|
|
5805
|
-
if (opts.capture) {
|
|
5806
|
-
star = `(${star})`;
|
|
5807
|
-
}
|
|
5278
|
+
if (opts.capture) star = `(${star})`;
|
|
5808
5279
|
const globstar = (opts) => {
|
|
5809
5280
|
if (opts.noglobstar === true) return star;
|
|
5810
5281
|
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
@@ -5828,16 +5299,12 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5828
5299
|
}
|
|
5829
5300
|
}
|
|
5830
5301
|
};
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
if (source && opts.strictSlashes !== true) {
|
|
5834
|
-
source += `${SLASH_LITERAL}?`;
|
|
5835
|
-
}
|
|
5302
|
+
let source = create(utils.removePrefix(input, state));
|
|
5303
|
+
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
|
|
5836
5304
|
return source;
|
|
5837
5305
|
};
|
|
5838
5306
|
module.exports = parse;
|
|
5839
5307
|
}));
|
|
5840
|
-
|
|
5841
5308
|
//#endregion
|
|
5842
5309
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
5843
5310
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -5881,9 +5348,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5881
5348
|
return arrayMatcher;
|
|
5882
5349
|
}
|
|
5883
5350
|
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
5884
|
-
if (glob === "" || typeof glob !== "string" && !isState)
|
|
5885
|
-
throw new TypeError("Expected pattern to be a non-empty string");
|
|
5886
|
-
}
|
|
5351
|
+
if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
5887
5352
|
const opts = options || {};
|
|
5888
5353
|
const posix = utils.isWindows(options);
|
|
5889
5354
|
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
@@ -5914,28 +5379,20 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5914
5379
|
match,
|
|
5915
5380
|
isMatch
|
|
5916
5381
|
};
|
|
5917
|
-
if (typeof opts.onResult === "function")
|
|
5918
|
-
opts.onResult(result);
|
|
5919
|
-
}
|
|
5382
|
+
if (typeof opts.onResult === "function") opts.onResult(result);
|
|
5920
5383
|
if (isMatch === false) {
|
|
5921
5384
|
result.isMatch = false;
|
|
5922
5385
|
return returnObject ? result : false;
|
|
5923
5386
|
}
|
|
5924
5387
|
if (isIgnored(input)) {
|
|
5925
|
-
if (typeof opts.onIgnore === "function")
|
|
5926
|
-
opts.onIgnore(result);
|
|
5927
|
-
}
|
|
5388
|
+
if (typeof opts.onIgnore === "function") opts.onIgnore(result);
|
|
5928
5389
|
result.isMatch = false;
|
|
5929
5390
|
return returnObject ? result : false;
|
|
5930
5391
|
}
|
|
5931
|
-
if (typeof opts.onMatch === "function")
|
|
5932
|
-
opts.onMatch(result);
|
|
5933
|
-
}
|
|
5392
|
+
if (typeof opts.onMatch === "function") opts.onMatch(result);
|
|
5934
5393
|
return returnObject ? result : true;
|
|
5935
5394
|
};
|
|
5936
|
-
if (returnState)
|
|
5937
|
-
matcher.state = state;
|
|
5938
|
-
}
|
|
5395
|
+
if (returnState) matcher.state = state;
|
|
5939
5396
|
return matcher;
|
|
5940
5397
|
};
|
|
5941
5398
|
/**
|
|
@@ -5955,15 +5412,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5955
5412
|
* @api public
|
|
5956
5413
|
*/
|
|
5957
5414
|
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
5958
|
-
if (typeof input !== "string")
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
isMatch: false,
|
|
5964
|
-
output: ""
|
|
5965
|
-
};
|
|
5966
|
-
}
|
|
5415
|
+
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
5416
|
+
if (input === "") return {
|
|
5417
|
+
isMatch: false,
|
|
5418
|
+
output: ""
|
|
5419
|
+
};
|
|
5967
5420
|
const opts = options || {};
|
|
5968
5421
|
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
5969
5422
|
let match = input === glob;
|
|
@@ -5972,13 +5425,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5972
5425
|
output = format ? format(input) : input;
|
|
5973
5426
|
match = output === glob;
|
|
5974
5427
|
}
|
|
5975
|
-
if (match === false || opts.capture === true)
|
|
5976
|
-
|
|
5977
|
-
match = picomatch.matchBase(input, regex, options, posix);
|
|
5978
|
-
} else {
|
|
5979
|
-
match = regex.exec(output);
|
|
5980
|
-
}
|
|
5981
|
-
}
|
|
5428
|
+
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
|
|
5429
|
+
else match = regex.exec(output);
|
|
5982
5430
|
return {
|
|
5983
5431
|
isMatch: Boolean(match),
|
|
5984
5432
|
match,
|
|
@@ -5999,8 +5447,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5999
5447
|
* @api public
|
|
6000
5448
|
*/
|
|
6001
5449
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
6002
|
-
|
|
6003
|
-
return regex.test(path$1.basename(input));
|
|
5450
|
+
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$1.basename(input));
|
|
6004
5451
|
};
|
|
6005
5452
|
/**
|
|
6006
5453
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -6078,20 +5525,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6078
5525
|
* @api public
|
|
6079
5526
|
*/
|
|
6080
5527
|
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
6081
|
-
if (returnOutput === true)
|
|
6082
|
-
return state.output;
|
|
6083
|
-
}
|
|
5528
|
+
if (returnOutput === true) return state.output;
|
|
6084
5529
|
const opts = options || {};
|
|
6085
5530
|
const prepend = opts.contains ? "" : "^";
|
|
6086
5531
|
const append = opts.contains ? "" : "$";
|
|
6087
5532
|
let source = `${prepend}(?:${state.output})${append}`;
|
|
6088
|
-
if (state && state.negated === true) {
|
|
6089
|
-
source = `^(?!${source}).*$`;
|
|
6090
|
-
}
|
|
5533
|
+
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
6091
5534
|
const regex = picomatch.toRegex(source, options);
|
|
6092
|
-
if (returnState === true)
|
|
6093
|
-
regex.state = state;
|
|
6094
|
-
}
|
|
5535
|
+
if (returnState === true) regex.state = state;
|
|
6095
5536
|
return regex;
|
|
6096
5537
|
};
|
|
6097
5538
|
/**
|
|
@@ -6113,19 +5554,13 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6113
5554
|
* @api public
|
|
6114
5555
|
*/
|
|
6115
5556
|
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
6116
|
-
if (!input || typeof input !== "string")
|
|
6117
|
-
throw new TypeError("Expected a non-empty string");
|
|
6118
|
-
}
|
|
5557
|
+
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
|
|
6119
5558
|
let parsed = {
|
|
6120
5559
|
negated: false,
|
|
6121
5560
|
fastpaths: true
|
|
6122
5561
|
};
|
|
6123
|
-
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*"))
|
|
6124
|
-
|
|
6125
|
-
}
|
|
6126
|
-
if (!parsed.output) {
|
|
6127
|
-
parsed = parse(input, options);
|
|
6128
|
-
}
|
|
5562
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
|
|
5563
|
+
if (!parsed.output) parsed = parse(input, options);
|
|
6129
5564
|
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
6130
5565
|
};
|
|
6131
5566
|
/**
|
|
@@ -6163,16 +5598,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6163
5598
|
*/
|
|
6164
5599
|
module.exports = picomatch;
|
|
6165
5600
|
}));
|
|
6166
|
-
|
|
6167
5601
|
//#endregion
|
|
6168
5602
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
|
|
6169
5603
|
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6170
5604
|
module.exports = require_picomatch$1();
|
|
6171
5605
|
}));
|
|
6172
|
-
|
|
6173
5606
|
//#endregion
|
|
6174
|
-
//#region ../../node_modules/.pnpm/
|
|
6175
|
-
var
|
|
5607
|
+
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/generateTasks.js
|
|
5608
|
+
var import_micromatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6176
5609
|
const util = __require("util");
|
|
6177
5610
|
const braces = require_braces();
|
|
6178
5611
|
const picomatch = require_picomatch();
|
|
@@ -6202,15 +5635,13 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6202
5635
|
const micromatch = (list, patterns, options) => {
|
|
6203
5636
|
patterns = [].concat(patterns);
|
|
6204
5637
|
list = [].concat(list);
|
|
6205
|
-
let omit = new Set();
|
|
6206
|
-
let keep = new Set();
|
|
6207
|
-
let items = new Set();
|
|
5638
|
+
let omit = /* @__PURE__ */ new Set();
|
|
5639
|
+
let keep = /* @__PURE__ */ new Set();
|
|
5640
|
+
let items = /* @__PURE__ */ new Set();
|
|
6208
5641
|
let negatives = 0;
|
|
6209
5642
|
let onResult = (state) => {
|
|
6210
5643
|
items.add(state.output);
|
|
6211
|
-
if (options && options.onResult)
|
|
6212
|
-
options.onResult(state);
|
|
6213
|
-
}
|
|
5644
|
+
if (options && options.onResult) options.onResult(state);
|
|
6214
5645
|
};
|
|
6215
5646
|
for (let i = 0; i < patterns.length; i++) {
|
|
6216
5647
|
let isMatch = picomatch(String(patterns[i]), {
|
|
@@ -6221,25 +5652,18 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6221
5652
|
if (negated) negatives++;
|
|
6222
5653
|
for (let item of list) {
|
|
6223
5654
|
let matched = isMatch(item, true);
|
|
6224
|
-
|
|
6225
|
-
if (
|
|
6226
|
-
|
|
6227
|
-
omit.add(matched.output);
|
|
6228
|
-
} else {
|
|
5655
|
+
if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
|
|
5656
|
+
if (negated) omit.add(matched.output);
|
|
5657
|
+
else {
|
|
6229
5658
|
omit.delete(matched.output);
|
|
6230
5659
|
keep.add(matched.output);
|
|
6231
5660
|
}
|
|
6232
5661
|
}
|
|
6233
5662
|
}
|
|
6234
|
-
let
|
|
6235
|
-
let matches = result.filter((item) => !omit.has(item));
|
|
5663
|
+
let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
|
|
6236
5664
|
if (options && matches.length === 0) {
|
|
6237
|
-
if (options.failglob === true) {
|
|
6238
|
-
|
|
6239
|
-
}
|
|
6240
|
-
if (options.nonull === true || options.nullglob === true) {
|
|
6241
|
-
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
6242
|
-
}
|
|
5665
|
+
if (options.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
5666
|
+
if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
6243
5667
|
}
|
|
6244
5668
|
return matches;
|
|
6245
5669
|
};
|
|
@@ -6305,7 +5729,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6305
5729
|
*/
|
|
6306
5730
|
micromatch.not = (list, patterns, options = {}) => {
|
|
6307
5731
|
patterns = [].concat(patterns).map(String);
|
|
6308
|
-
let result = new Set();
|
|
5732
|
+
let result = /* @__PURE__ */ new Set();
|
|
6309
5733
|
let items = [];
|
|
6310
5734
|
let onResult = (state) => {
|
|
6311
5735
|
if (options.onResult) options.onResult(state);
|
|
@@ -6315,11 +5739,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6315
5739
|
...options,
|
|
6316
5740
|
onResult
|
|
6317
5741
|
}));
|
|
6318
|
-
for (let item of items)
|
|
6319
|
-
if (!matches.has(item)) {
|
|
6320
|
-
result.add(item);
|
|
6321
|
-
}
|
|
6322
|
-
}
|
|
5742
|
+
for (let item of items) if (!matches.has(item)) result.add(item);
|
|
6323
5743
|
return [...result];
|
|
6324
5744
|
};
|
|
6325
5745
|
/**
|
|
@@ -6342,19 +5762,11 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6342
5762
|
* @api public
|
|
6343
5763
|
*/
|
|
6344
5764
|
micromatch.contains = (str, pattern, options) => {
|
|
6345
|
-
if (typeof str !== "string") {
|
|
6346
|
-
|
|
6347
|
-
}
|
|
6348
|
-
if (Array.isArray(pattern)) {
|
|
6349
|
-
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
6350
|
-
}
|
|
5765
|
+
if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
5766
|
+
if (Array.isArray(pattern)) return pattern.some((p) => micromatch.contains(str, p, options));
|
|
6351
5767
|
if (typeof pattern === "string") {
|
|
6352
|
-
if (isEmptyString(str) || isEmptyString(pattern))
|
|
6353
|
-
|
|
6354
|
-
}
|
|
6355
|
-
if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
|
|
6356
|
-
return true;
|
|
6357
|
-
}
|
|
5768
|
+
if (isEmptyString(str) || isEmptyString(pattern)) return false;
|
|
5769
|
+
if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) return true;
|
|
6358
5770
|
}
|
|
6359
5771
|
return micromatch.isMatch(str, pattern, {
|
|
6360
5772
|
...options,
|
|
@@ -6381,9 +5793,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6381
5793
|
* @api public
|
|
6382
5794
|
*/
|
|
6383
5795
|
micromatch.matchKeys = (obj, patterns, options) => {
|
|
6384
|
-
if (!utils.isObject(obj))
|
|
6385
|
-
throw new TypeError("Expected the first argument to be an object");
|
|
6386
|
-
}
|
|
5796
|
+
if (!utils.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
|
|
6387
5797
|
let keys = micromatch(Object.keys(obj), patterns, options);
|
|
6388
5798
|
let res = {};
|
|
6389
5799
|
for (let key of keys) res[key] = obj[key];
|
|
@@ -6411,9 +5821,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6411
5821
|
let items = [].concat(list);
|
|
6412
5822
|
for (let pattern of [].concat(patterns)) {
|
|
6413
5823
|
let isMatch = picomatch(String(pattern), options);
|
|
6414
|
-
if (items.some((item) => isMatch(item)))
|
|
6415
|
-
return true;
|
|
6416
|
-
}
|
|
5824
|
+
if (items.some((item) => isMatch(item))) return true;
|
|
6417
5825
|
}
|
|
6418
5826
|
return false;
|
|
6419
5827
|
};
|
|
@@ -6444,9 +5852,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6444
5852
|
let items = [].concat(list);
|
|
6445
5853
|
for (let pattern of [].concat(patterns)) {
|
|
6446
5854
|
let isMatch = picomatch(String(pattern), options);
|
|
6447
|
-
if (!items.every((item) => isMatch(item)))
|
|
6448
|
-
return false;
|
|
6449
|
-
}
|
|
5855
|
+
if (!items.every((item) => isMatch(item))) return false;
|
|
6450
5856
|
}
|
|
6451
5857
|
return true;
|
|
6452
5858
|
};
|
|
@@ -6477,9 +5883,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6477
5883
|
* @api public
|
|
6478
5884
|
*/
|
|
6479
5885
|
micromatch.all = (str, patterns, options) => {
|
|
6480
|
-
if (typeof str !== "string") {
|
|
6481
|
-
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
6482
|
-
}
|
|
5886
|
+
if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
6483
5887
|
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
6484
5888
|
};
|
|
6485
5889
|
/**
|
|
@@ -6502,14 +5906,11 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6502
5906
|
*/
|
|
6503
5907
|
micromatch.capture = (glob, input, options) => {
|
|
6504
5908
|
let posix = utils.isWindows(options);
|
|
6505
|
-
let
|
|
5909
|
+
let match = picomatch.makeRe(String(glob), {
|
|
6506
5910
|
...options,
|
|
6507
5911
|
capture: true
|
|
6508
|
-
});
|
|
6509
|
-
|
|
6510
|
-
if (match) {
|
|
6511
|
-
return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
6512
|
-
}
|
|
5912
|
+
}).exec(posix ? utils.toPosixSlashes(input) : input);
|
|
5913
|
+
if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
6513
5914
|
};
|
|
6514
5915
|
/**
|
|
6515
5916
|
* Create a regular expression from the given glob `pattern`.
|
|
@@ -6556,11 +5957,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6556
5957
|
*/
|
|
6557
5958
|
micromatch.parse = (patterns, options) => {
|
|
6558
5959
|
let res = [];
|
|
6559
|
-
for (let pattern of [].concat(patterns || []))
|
|
6560
|
-
for (let str of braces(String(pattern), options)) {
|
|
6561
|
-
res.push(picomatch.parse(str, options));
|
|
6562
|
-
}
|
|
6563
|
-
}
|
|
5960
|
+
for (let pattern of [].concat(patterns || [])) for (let str of braces(String(pattern), options)) res.push(picomatch.parse(str, options));
|
|
6564
5961
|
return res;
|
|
6565
5962
|
};
|
|
6566
5963
|
/**
|
|
@@ -6581,9 +5978,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6581
5978
|
*/
|
|
6582
5979
|
micromatch.braces = (pattern, options) => {
|
|
6583
5980
|
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
6584
|
-
if (options && options.nobrace === true || !hasBraces(pattern))
|
|
6585
|
-
return [pattern];
|
|
6586
|
-
}
|
|
5981
|
+
if (options && options.nobrace === true || !hasBraces(pattern)) return [pattern];
|
|
6587
5982
|
return braces(pattern, options);
|
|
6588
5983
|
};
|
|
6589
5984
|
/**
|
|
@@ -6601,11 +5996,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6601
5996
|
*/
|
|
6602
5997
|
micromatch.hasBraces = hasBraces;
|
|
6603
5998
|
module.exports = micromatch;
|
|
6604
|
-
}));
|
|
6605
|
-
|
|
6606
|
-
//#endregion
|
|
6607
|
-
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/generateTasks.js
|
|
6608
|
-
var import_micromatch = /* @__PURE__ */ __toESM(require_micromatch(), 1);
|
|
5999
|
+
})))(), 1);
|
|
6609
6000
|
const debugLog$13 = createDebug("lint-staged:generateTasks");
|
|
6610
6001
|
/**
|
|
6611
6002
|
* Generates all task commands, and filelist
|
|
@@ -6636,20 +6027,18 @@ const generateTasks = ({ config, cwd = process.cwd(), files, relative = false })
|
|
|
6636
6027
|
posixSlashes: true,
|
|
6637
6028
|
strictBrackets: true
|
|
6638
6029
|
});
|
|
6639
|
-
const fileList = filteredFiles.flatMap((file) => matches.includes(file.filepath) ? [{
|
|
6640
|
-
filepath: normalizePath(relative ? file.filepath : path.resolve(cwd, file.filepath)),
|
|
6641
|
-
status: file.status
|
|
6642
|
-
}] : []);
|
|
6643
6030
|
const task = {
|
|
6644
6031
|
pattern,
|
|
6645
6032
|
commands,
|
|
6646
|
-
fileList
|
|
6033
|
+
fileList: filteredFiles.flatMap((file) => matches.includes(file.filepath) ? [{
|
|
6034
|
+
filepath: normalizePath(relative ? file.filepath : path.resolve(cwd, file.filepath)),
|
|
6035
|
+
status: file.status
|
|
6036
|
+
}] : [])
|
|
6647
6037
|
};
|
|
6648
6038
|
debugLog$13("Generated task: \n%O", task);
|
|
6649
6039
|
return task;
|
|
6650
6040
|
});
|
|
6651
6041
|
};
|
|
6652
|
-
|
|
6653
6042
|
//#endregion
|
|
6654
6043
|
//#region ../../node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/bin.js
|
|
6655
6044
|
var require_bin = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -6657,8 +6046,7 @@ var require_bin = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6657
6046
|
function stripStderr(stderr) {
|
|
6658
6047
|
if (!stderr) return;
|
|
6659
6048
|
stderr = stderr.trim();
|
|
6660
|
-
|
|
6661
|
-
stderr = stderr.replace(regex, "");
|
|
6049
|
+
stderr = stderr.replace(/your \d+x\d+ screen size is bogus\. expect trouble/gi, "");
|
|
6662
6050
|
return stderr.trim();
|
|
6663
6051
|
}
|
|
6664
6052
|
/**
|
|
@@ -6671,7 +6059,7 @@ var require_bin = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6671
6059
|
function run(cmd, args, options, done) {
|
|
6672
6060
|
if (typeof options === "function") {
|
|
6673
6061
|
done = options;
|
|
6674
|
-
options =
|
|
6062
|
+
options = void 0;
|
|
6675
6063
|
}
|
|
6676
6064
|
var executed = false;
|
|
6677
6065
|
var ch = spawn$1(cmd, args, options);
|
|
@@ -6692,15 +6080,12 @@ var require_bin = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6692
6080
|
if (executed) return;
|
|
6693
6081
|
executed = true;
|
|
6694
6082
|
stderr = stripStderr(stderr);
|
|
6695
|
-
if (stderr)
|
|
6696
|
-
return done(new Error(stderr));
|
|
6697
|
-
}
|
|
6083
|
+
if (stderr) return done(new Error(stderr));
|
|
6698
6084
|
done(null, stdout, code);
|
|
6699
6085
|
});
|
|
6700
6086
|
}
|
|
6701
6087
|
module.exports = run;
|
|
6702
6088
|
}));
|
|
6703
|
-
|
|
6704
6089
|
//#endregion
|
|
6705
6090
|
//#region ../../node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/ps.js
|
|
6706
6091
|
var require_ps = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -6711,16 +6096,13 @@ var require_ps = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6711
6096
|
* @param {Function} callback(err, list)
|
|
6712
6097
|
*/
|
|
6713
6098
|
function ps(callback) {
|
|
6714
|
-
|
|
6099
|
+
bin("ps", [
|
|
6715
6100
|
"-A",
|
|
6716
6101
|
"-o",
|
|
6717
6102
|
"ppid,pid"
|
|
6718
|
-
]
|
|
6719
|
-
bin("ps", args, function(err, stdout, code) {
|
|
6103
|
+
], function(err, stdout, code) {
|
|
6720
6104
|
if (err) return callback(err);
|
|
6721
|
-
if (code !== 0)
|
|
6722
|
-
return callback(new Error("pidtree ps command exited with code " + code));
|
|
6723
|
-
}
|
|
6105
|
+
if (code !== 0) return callback(/* @__PURE__ */ new Error("pidtree ps command exited with code " + code));
|
|
6724
6106
|
try {
|
|
6725
6107
|
stdout = stdout.split(os$2.EOL);
|
|
6726
6108
|
var list = [];
|
|
@@ -6740,7 +6122,6 @@ var require_ps = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6740
6122
|
}
|
|
6741
6123
|
module.exports = ps;
|
|
6742
6124
|
}));
|
|
6743
|
-
|
|
6744
6125
|
//#endregion
|
|
6745
6126
|
//#region ../../node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/wmic.js
|
|
6746
6127
|
var require_wmic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -6751,22 +6132,20 @@ var require_wmic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6751
6132
|
* @param {Function} callback(err, list)
|
|
6752
6133
|
*/
|
|
6753
6134
|
function wmic(callback) {
|
|
6754
|
-
|
|
6135
|
+
bin("wmic", [
|
|
6755
6136
|
"PROCESS",
|
|
6756
6137
|
"get",
|
|
6757
6138
|
"ParentProcessId,ProcessId"
|
|
6758
|
-
]
|
|
6759
|
-
var options = {
|
|
6139
|
+
], {
|
|
6760
6140
|
windowsHide: true,
|
|
6761
6141
|
windowsVerbatimArguments: true
|
|
6762
|
-
}
|
|
6763
|
-
bin("wmic", args, options, function(err, stdout, code) {
|
|
6142
|
+
}, function(err, stdout, code) {
|
|
6764
6143
|
if (err) {
|
|
6765
6144
|
callback(err);
|
|
6766
6145
|
return;
|
|
6767
6146
|
}
|
|
6768
6147
|
if (code !== 0) {
|
|
6769
|
-
callback(new Error("pidtree wmic command exited with code " + code));
|
|
6148
|
+
callback(/* @__PURE__ */ new Error("pidtree wmic command exited with code " + code));
|
|
6770
6149
|
return;
|
|
6771
6150
|
}
|
|
6772
6151
|
try {
|
|
@@ -6788,7 +6167,6 @@ var require_wmic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6788
6167
|
}
|
|
6789
6168
|
module.exports = wmic;
|
|
6790
6169
|
}));
|
|
6791
|
-
|
|
6792
6170
|
//#endregion
|
|
6793
6171
|
//#region ../../node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/get.js
|
|
6794
6172
|
var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -6807,24 +6185,18 @@ var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6807
6185
|
wmic: () => require_wmic()
|
|
6808
6186
|
};
|
|
6809
6187
|
var platform = os.platform();
|
|
6810
|
-
if (platform.startsWith("win"))
|
|
6811
|
-
platform = "win";
|
|
6812
|
-
}
|
|
6188
|
+
if (platform.startsWith("win")) platform = "win";
|
|
6813
6189
|
var method = platformToMethod[platform];
|
|
6814
6190
|
/**
|
|
6815
6191
|
* Gets the list of all the pids of the system.
|
|
6816
6192
|
* @param {Function} callback Called when the list is ready.
|
|
6817
6193
|
*/
|
|
6818
6194
|
function get(callback) {
|
|
6819
|
-
if (method ===
|
|
6820
|
-
|
|
6821
|
-
}
|
|
6822
|
-
var list = methodToRequireFn[method]();
|
|
6823
|
-
list(callback);
|
|
6195
|
+
if (method === void 0) callback(/* @__PURE__ */ new Error(os.platform() + " is not supported yet, please open an issue (https://github.com/simonepri/pidtree)"));
|
|
6196
|
+
methodToRequireFn[method]()(callback);
|
|
6824
6197
|
}
|
|
6825
6198
|
module.exports = get;
|
|
6826
6199
|
}));
|
|
6827
|
-
|
|
6828
6200
|
//#endregion
|
|
6829
6201
|
//#region ../../node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/pidtree.js
|
|
6830
6202
|
var require_pidtree$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -6843,12 +6215,10 @@ var require_pidtree$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6843
6215
|
callback = options;
|
|
6844
6216
|
options = {};
|
|
6845
6217
|
}
|
|
6846
|
-
if (typeof options !== "object") {
|
|
6847
|
-
options = {};
|
|
6848
|
-
}
|
|
6218
|
+
if (typeof options !== "object") options = {};
|
|
6849
6219
|
PID = parseInt(PID, 10);
|
|
6850
6220
|
if (isNaN(PID) || PID < -1) {
|
|
6851
|
-
callback(new TypeError("The pid provided is invalid"));
|
|
6221
|
+
callback(/* @__PURE__ */ new TypeError("The pid provided is invalid"));
|
|
6852
6222
|
return;
|
|
6853
6223
|
}
|
|
6854
6224
|
getAll(function(err, list) {
|
|
@@ -6857,12 +6227,10 @@ var require_pidtree$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6857
6227
|
return;
|
|
6858
6228
|
}
|
|
6859
6229
|
if (PID === -1) {
|
|
6860
|
-
for (var i = 0; i < list.length; i++) {
|
|
6861
|
-
list[i]
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
} : list[i] = list[i][1];
|
|
6865
|
-
}
|
|
6230
|
+
for (var i = 0; i < list.length; i++) list[i] = options.advanced ? {
|
|
6231
|
+
ppid: list[i][0],
|
|
6232
|
+
pid: list[i][1]
|
|
6233
|
+
} : list[i] = list[i][1];
|
|
6866
6234
|
callback(null, list);
|
|
6867
6235
|
return;
|
|
6868
6236
|
}
|
|
@@ -6875,22 +6243,17 @@ var require_pidtree$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6875
6243
|
} : PID;
|
|
6876
6244
|
break;
|
|
6877
6245
|
}
|
|
6878
|
-
if (list[l][0] === PID) {
|
|
6879
|
-
root = options.advanced ? { pid: PID } : PID;
|
|
6880
|
-
}
|
|
6246
|
+
if (list[l][0] === PID) root = options.advanced ? { pid: PID } : PID;
|
|
6881
6247
|
}
|
|
6882
6248
|
if (!root) {
|
|
6883
|
-
callback(new Error("No matching pid found"));
|
|
6249
|
+
callback(/* @__PURE__ */ new Error("No matching pid found"));
|
|
6884
6250
|
return;
|
|
6885
6251
|
}
|
|
6886
6252
|
var tree = {};
|
|
6887
6253
|
while (list.length > 0) {
|
|
6888
6254
|
var element = list.pop();
|
|
6889
|
-
if (tree[element[0]])
|
|
6890
|
-
|
|
6891
|
-
} else {
|
|
6892
|
-
tree[element[0]] = [element[1]];
|
|
6893
|
-
}
|
|
6255
|
+
if (tree[element[0]]) tree[element[0]].push(element[1]);
|
|
6256
|
+
else tree[element[0]] = [element[1]];
|
|
6894
6257
|
}
|
|
6895
6258
|
var idx = 0;
|
|
6896
6259
|
var pids = [root];
|
|
@@ -6898,26 +6261,21 @@ var require_pidtree$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6898
6261
|
var curpid = options.advanced ? pids[idx++].pid : pids[idx++];
|
|
6899
6262
|
if (!tree[curpid]) continue;
|
|
6900
6263
|
var length = tree[curpid].length;
|
|
6901
|
-
for (var j = 0; j < length; j++) {
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
} : tree[curpid][j]);
|
|
6906
|
-
}
|
|
6264
|
+
for (var j = 0; j < length; j++) pids.push(options.advanced ? {
|
|
6265
|
+
ppid: curpid,
|
|
6266
|
+
pid: tree[curpid][j]
|
|
6267
|
+
} : tree[curpid][j]);
|
|
6907
6268
|
delete tree[curpid];
|
|
6908
6269
|
}
|
|
6909
|
-
if (!options.root)
|
|
6910
|
-
pids.shift();
|
|
6911
|
-
}
|
|
6270
|
+
if (!options.root) pids.shift();
|
|
6912
6271
|
callback(null, pids);
|
|
6913
6272
|
});
|
|
6914
6273
|
}
|
|
6915
6274
|
module.exports = list;
|
|
6916
6275
|
}));
|
|
6917
|
-
|
|
6918
6276
|
//#endregion
|
|
6919
|
-
//#region ../../node_modules/.pnpm/
|
|
6920
|
-
var
|
|
6277
|
+
//#region ../../node_modules/.pnpm/string-argv@0.3.2/node_modules/string-argv/index.js
|
|
6278
|
+
var import_pidtree = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6921
6279
|
function pify(fn, arg1, arg2) {
|
|
6922
6280
|
return new Promise(function(resolve, reject) {
|
|
6923
6281
|
fn(arg1, arg2, function(err, data) {
|
|
@@ -6927,11 +6285,9 @@ var require_pidtree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6927
6285
|
});
|
|
6928
6286
|
}
|
|
6929
6287
|
/* istanbul ignore if */
|
|
6930
|
-
if (!String.prototype.startsWith) {
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
};
|
|
6934
|
-
}
|
|
6288
|
+
if (!String.prototype.startsWith) String.prototype.startsWith = function(suffix) {
|
|
6289
|
+
return this.substring(0, suffix.length) === suffix;
|
|
6290
|
+
};
|
|
6935
6291
|
var pidtree = require_pidtree$1();
|
|
6936
6292
|
/**
|
|
6937
6293
|
* Get the list of children pids of the given pid.
|
|
@@ -6948,7 +6304,7 @@ var require_pidtree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6948
6304
|
function list(pid, options, callback) {
|
|
6949
6305
|
if (typeof options === "function") {
|
|
6950
6306
|
callback = options;
|
|
6951
|
-
options =
|
|
6307
|
+
options = void 0;
|
|
6952
6308
|
}
|
|
6953
6309
|
if (typeof callback === "function") {
|
|
6954
6310
|
pidtree(pid, options, callback);
|
|
@@ -6957,66 +6313,50 @@ var require_pidtree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6957
6313
|
return pify(pidtree, pid, options);
|
|
6958
6314
|
}
|
|
6959
6315
|
module.exports = list;
|
|
6960
|
-
}));
|
|
6961
|
-
|
|
6962
|
-
//#endregion
|
|
6963
|
-
//#region ../../node_modules/.pnpm/string-argv@0.3.2/node_modules/string-argv/index.js
|
|
6964
|
-
var import_pidtree = /* @__PURE__ */ __toESM(require_pidtree(), 1);
|
|
6316
|
+
})))(), 1);
|
|
6965
6317
|
function parseArgsStringToArgv(value, env, file) {
|
|
6966
6318
|
var myRegexp = /([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi;
|
|
6967
6319
|
var myString = value;
|
|
6968
6320
|
var myArray = [];
|
|
6969
|
-
if (env)
|
|
6970
|
-
|
|
6971
|
-
}
|
|
6972
|
-
if (file) {
|
|
6973
|
-
myArray.push(file);
|
|
6974
|
-
}
|
|
6321
|
+
if (env) myArray.push(env);
|
|
6322
|
+
if (file) myArray.push(file);
|
|
6975
6323
|
var match;
|
|
6976
6324
|
do {
|
|
6977
6325
|
match = myRegexp.exec(myString);
|
|
6978
|
-
if (match !== null)
|
|
6979
|
-
myArray.push(firstString(match[1], match[6], match[0]));
|
|
6980
|
-
}
|
|
6326
|
+
if (match !== null) myArray.push(firstString(match[1], match[6], match[0]));
|
|
6981
6327
|
} while (match !== null);
|
|
6982
6328
|
return myArray;
|
|
6983
6329
|
}
|
|
6984
6330
|
function firstString() {
|
|
6985
6331
|
var args = [];
|
|
6986
|
-
for (var _i = 0; _i < arguments.length; _i++)
|
|
6987
|
-
args[_i] = arguments[_i];
|
|
6988
|
-
}
|
|
6332
|
+
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
6989
6333
|
for (var i = 0; i < args.length; i++) {
|
|
6990
6334
|
var arg = args[i];
|
|
6991
|
-
if (typeof arg === "string")
|
|
6992
|
-
return arg;
|
|
6993
|
-
}
|
|
6335
|
+
if (typeof arg === "string") return arg;
|
|
6994
6336
|
}
|
|
6995
6337
|
}
|
|
6996
|
-
|
|
6997
6338
|
//#endregion
|
|
6998
6339
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/symbols.js
|
|
6999
6340
|
const ApplyEmptyCommitError = Symbol("ApplyEmptyCommitError");
|
|
7000
|
-
const ConfigNotFoundError = new Error("Configuration could not be found");
|
|
7001
|
-
const ConfigFormatError = new Error("Configuration should be an object or a function");
|
|
7002
|
-
const ConfigEmptyError = new Error("Configuration should not be empty");
|
|
6341
|
+
const ConfigNotFoundError = /* @__PURE__ */ new Error("Configuration could not be found");
|
|
6342
|
+
const ConfigFormatError = /* @__PURE__ */ new Error("Configuration should be an object or a function");
|
|
6343
|
+
const ConfigEmptyError = /* @__PURE__ */ new Error("Configuration should not be empty");
|
|
7003
6344
|
const GetBackupStashError = Symbol("GetBackupStashError");
|
|
7004
6345
|
const GetStagedFilesError = Symbol("GetStagedFilesError");
|
|
7005
6346
|
const GitError = Symbol("GitError");
|
|
7006
6347
|
const GitRepoError = Symbol("GitRepoError");
|
|
7007
6348
|
const HideUnstagedChangesError = Symbol("HideUnstagedChangesError");
|
|
7008
|
-
const InvalidOptionsError = new Error("Invalid Options");
|
|
6349
|
+
const InvalidOptionsError = /* @__PURE__ */ new Error("Invalid Options");
|
|
7009
6350
|
const RestoreMergeStatusError = Symbol("RestoreMergeStatusError");
|
|
7010
6351
|
const RestoreOriginalStateError = Symbol("RestoreOriginalStateError");
|
|
7011
6352
|
const RestoreUnstagedChangesError = Symbol("RestoreUnstagedChangesError");
|
|
7012
6353
|
const TaskError = Symbol("TaskError");
|
|
7013
6354
|
const FailOnChangesError = Symbol("FailOnChangesError");
|
|
7014
|
-
|
|
7015
6355
|
//#endregion
|
|
7016
6356
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/state.js
|
|
7017
6357
|
const getInitialState = ({ failOnChanges = false, hideUnstaged = false, hidePartiallyStaged = !hideUnstaged, quiet = false, revert = true } = {}) => ({
|
|
7018
6358
|
backupHash: null,
|
|
7019
|
-
errors: new Set([]),
|
|
6359
|
+
errors: /* @__PURE__ */ new Set([]),
|
|
7020
6360
|
events: new EventEmitter$1(),
|
|
7021
6361
|
shouldFailOnChanges: failOnChanges,
|
|
7022
6362
|
hasFilesToHide: null,
|
|
@@ -7033,43 +6373,24 @@ const shouldHidePartiallyStagedFiles = (ctx) => ctx.shouldHidePartiallyStaged &&
|
|
|
7033
6373
|
const shouldRestoreUnstagedChanges = (ctx) => (ctx.shouldHideUnstaged || ctx.shouldHidePartiallyStaged) && ctx.hasFilesToHide;
|
|
7034
6374
|
const applyModificationsSkipped = (ctx) => {
|
|
7035
6375
|
if (!ctx.shouldRevert || !ctx.shouldBackup) return false;
|
|
7036
|
-
if (ctx.errors.has(GitError))
|
|
7037
|
-
|
|
7038
|
-
}
|
|
7039
|
-
if (ctx.errors.has(TaskError)) {
|
|
7040
|
-
return TASK_ERROR$1;
|
|
7041
|
-
}
|
|
6376
|
+
if (ctx.errors.has(GitError)) return GIT_ERROR;
|
|
6377
|
+
if (ctx.errors.has(TaskError)) return TASK_ERROR$1;
|
|
7042
6378
|
};
|
|
7043
6379
|
const restoreUnstagedChangesSkipped = (ctx) => {
|
|
7044
|
-
if (ctx.errors.has(GitError))
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
if (!ctx.shouldRevert) {
|
|
7048
|
-
false;
|
|
7049
|
-
}
|
|
7050
|
-
if (ctx.errors.has(TaskError)) {
|
|
7051
|
-
return TASK_ERROR$1;
|
|
7052
|
-
}
|
|
6380
|
+
if (ctx.errors.has(GitError)) return GIT_ERROR;
|
|
6381
|
+
if (!ctx.shouldRevert) {}
|
|
6382
|
+
if (ctx.errors.has(TaskError)) return TASK_ERROR$1;
|
|
7053
6383
|
};
|
|
7054
6384
|
const restoreOriginalStateEnabled = (ctx) => !!ctx.shouldRevert && !!ctx.shouldBackup && (ctx.errors.has(FailOnChangesError) || ctx.errors.has(TaskError) || ctx.errors.has(RestoreUnstagedChangesError));
|
|
7055
6385
|
const restoreOriginalStateSkipped = (ctx) => {
|
|
7056
|
-
if (ctx.errors.has(GitError) && !ctx.errors.has(RestoreUnstagedChangesError))
|
|
7057
|
-
return GIT_ERROR;
|
|
7058
|
-
}
|
|
6386
|
+
if (ctx.errors.has(GitError) && !ctx.errors.has(RestoreUnstagedChangesError)) return GIT_ERROR;
|
|
7059
6387
|
};
|
|
7060
6388
|
const cleanupEnabled = (ctx) => ctx.shouldBackup;
|
|
7061
6389
|
const cleanupSkipped = (ctx) => {
|
|
7062
|
-
if (ctx.errors.has(FailOnChangesError) && !ctx.shouldRevert)
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
if (restoreOriginalStateSkipped(ctx)) {
|
|
7066
|
-
return GIT_ERROR;
|
|
7067
|
-
}
|
|
7068
|
-
if (ctx.errors.has(RestoreOriginalStateError)) {
|
|
7069
|
-
return GIT_ERROR;
|
|
7070
|
-
}
|
|
6390
|
+
if (ctx.errors.has(FailOnChangesError) && !ctx.shouldRevert) return true;
|
|
6391
|
+
if (restoreOriginalStateSkipped(ctx)) return GIT_ERROR;
|
|
6392
|
+
if (ctx.errors.has(RestoreOriginalStateError)) return GIT_ERROR;
|
|
7071
6393
|
};
|
|
7072
|
-
|
|
7073
6394
|
//#endregion
|
|
7074
6395
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getSpawnedTask.js
|
|
7075
6396
|
const TASK_ERROR = "lint-staged:taskError";
|
|
@@ -7093,14 +6414,10 @@ const handleOutput = (command, result, ctx, isError = false) => {
|
|
|
7093
6414
|
ctx.output.push(output.join("\n"));
|
|
7094
6415
|
return;
|
|
7095
6416
|
}
|
|
7096
|
-
if (ctx.quiet)
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
ctx.output.push(red$1(`\n${error} ${command} failed to spawn:`), result.message, result.cause);
|
|
7101
|
-
} else if (isError) {
|
|
7102
|
-
const tag = getTag(result);
|
|
7103
|
-
const message = red$1(`\n${error} ${command} failed without output (${tag}).`);
|
|
6417
|
+
if (ctx.quiet) return;
|
|
6418
|
+
if (result instanceof SubprocessError) ctx.output.push(red$1(`\n${error} ${command} failed to spawn:`), result.message, result.cause);
|
|
6419
|
+
else if (isError) {
|
|
6420
|
+
const message = red$1(`\n${error} ${command} failed without output (${getTag(result)}).`);
|
|
7104
6421
|
ctx.output.push(message);
|
|
7105
6422
|
}
|
|
7106
6423
|
};
|
|
@@ -7113,18 +6430,14 @@ const killSubprocess = async (subprocess) => {
|
|
|
7113
6430
|
try {
|
|
7114
6431
|
childProcess = await subprocess.nodeChildProcess;
|
|
7115
6432
|
} catch {}
|
|
7116
|
-
if (childProcess?.pid !==
|
|
7117
|
-
try {
|
|
7118
|
-
|
|
7119
|
-
try {
|
|
7120
|
-
process.kill(childPid, "SIGKILL");
|
|
7121
|
-
} catch (error) {
|
|
7122
|
-
debugLog$12(`Failed to kill process with pid "%d": %o`, childPid, error);
|
|
7123
|
-
}
|
|
7124
|
-
}
|
|
6433
|
+
if (childProcess?.pid !== void 0) try {
|
|
6434
|
+
for (const childPid of await (0, import_pidtree.default)(childProcess.pid)) try {
|
|
6435
|
+
process.kill(childPid, "SIGKILL");
|
|
7125
6436
|
} catch (error) {
|
|
7126
|
-
debugLog$12(`Failed to
|
|
6437
|
+
debugLog$12(`Failed to kill process with pid "%d": %o`, childPid, error);
|
|
7127
6438
|
}
|
|
6439
|
+
} catch (error) {
|
|
6440
|
+
debugLog$12(`Failed to list child processes of pid "%d": %o`, childProcess.pid, error);
|
|
7128
6441
|
}
|
|
7129
6442
|
childProcess?.kill("SIGKILL");
|
|
7130
6443
|
};
|
|
@@ -7146,9 +6459,7 @@ const interruptExecutionOnError = (ctx, subprocess) => {
|
|
|
7146
6459
|
ctx.events.on(TASK_ERROR, errorListener, { once: true });
|
|
7147
6460
|
return async () => {
|
|
7148
6461
|
ctx.events.off(TASK_ERROR, errorListener);
|
|
7149
|
-
if (killPromise)
|
|
7150
|
-
await killPromise;
|
|
7151
|
-
}
|
|
6462
|
+
if (killPromise) await killPromise;
|
|
7152
6463
|
};
|
|
7153
6464
|
};
|
|
7154
6465
|
/**
|
|
@@ -7164,7 +6475,7 @@ const makeErr = (command, error, ctx) => {
|
|
|
7164
6475
|
ctx.events.emit(TASK_ERROR, TaskError);
|
|
7165
6476
|
handleOutput(command, error, ctx, true);
|
|
7166
6477
|
const tag = getTag(error);
|
|
7167
|
-
return new Error(`${red$1(command)} ${blackBright$1(`[${tag}]`)}`);
|
|
6478
|
+
return /* @__PURE__ */ new Error(`${red$1(command)} ${blackBright$1(`[${tag}]`)}`);
|
|
7168
6479
|
};
|
|
7169
6480
|
/**
|
|
7170
6481
|
* Returns the task function for the linter.
|
|
@@ -7195,23 +6506,16 @@ const getSpawnedTask = ({ color, command, continueOnError = false, cwd = process
|
|
|
7195
6506
|
let quitInterruptCheck;
|
|
7196
6507
|
try {
|
|
7197
6508
|
const subprocess = spawn$2(cmd, isFn ? args : args.concat(files), spawnOptions);
|
|
7198
|
-
if (!continueOnError)
|
|
7199
|
-
quitInterruptCheck = interruptExecutionOnError(ctx, subprocess);
|
|
7200
|
-
}
|
|
6509
|
+
if (!continueOnError) quitInterruptCheck = interruptExecutionOnError(ctx, subprocess);
|
|
7201
6510
|
const result = await subprocess;
|
|
7202
|
-
if (verbose)
|
|
7203
|
-
handleOutput(command, result, ctx);
|
|
7204
|
-
}
|
|
6511
|
+
if (verbose) handleOutput(command, result, ctx);
|
|
7205
6512
|
} catch (error) {
|
|
7206
6513
|
throw makeErr(command, error, ctx);
|
|
7207
6514
|
} finally {
|
|
7208
|
-
if (quitInterruptCheck)
|
|
7209
|
-
await quitInterruptCheck();
|
|
7210
|
-
}
|
|
6515
|
+
if (quitInterruptCheck) await quitInterruptCheck();
|
|
7211
6516
|
}
|
|
7212
6517
|
};
|
|
7213
6518
|
};
|
|
7214
|
-
|
|
7215
6519
|
//#endregion
|
|
7216
6520
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getFunctionTask.js
|
|
7217
6521
|
const debugLog$11 = createDebug("lint-staged:getFunctionTasks");
|
|
@@ -7242,7 +6546,6 @@ const getFunctionTask = async (command, files) => {
|
|
|
7242
6546
|
task
|
|
7243
6547
|
}];
|
|
7244
6548
|
};
|
|
7245
|
-
|
|
7246
6549
|
//#endregion
|
|
7247
6550
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getRenderer.js
|
|
7248
6551
|
const EOLRegex = new RegExp(EOL$1 + "$");
|
|
@@ -7251,27 +6554,19 @@ const bindLogger = (consoleLogMethod) => new Writable({ write: function(chunk, e
|
|
|
7251
6554
|
next();
|
|
7252
6555
|
} });
|
|
7253
6556
|
const getMainRendererOptions = ({ color, debug, quiet }, logger, env) => {
|
|
7254
|
-
if (quiet) {
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
rendererOptions: { logger: new ListrLogger({ processOutput: new ProcessOutput(bindLogger(logger.log), bindLogger(logger.error)) }) }
|
|
7261
|
-
};
|
|
7262
|
-
}
|
|
7263
|
-
if (debug || !color) {
|
|
7264
|
-
return { renderer: "verbose" };
|
|
7265
|
-
}
|
|
6557
|
+
if (quiet) return { renderer: "silent" };
|
|
6558
|
+
if (env.NODE_ENV === "test") return {
|
|
6559
|
+
renderer: "test",
|
|
6560
|
+
rendererOptions: { logger: new ListrLogger({ processOutput: new ProcessOutput(bindLogger(logger.log), bindLogger(logger.error)) }) }
|
|
6561
|
+
};
|
|
6562
|
+
if (debug || !color) return { renderer: "verbose" };
|
|
7266
6563
|
return {
|
|
7267
6564
|
renderer: "update",
|
|
7268
6565
|
rendererOptions: { formatOutput: "truncate" }
|
|
7269
6566
|
};
|
|
7270
6567
|
};
|
|
7271
6568
|
const getFallbackRenderer = ({ renderer }, { color = false }) => {
|
|
7272
|
-
if (renderer === "silent" || renderer === "test" || !color)
|
|
7273
|
-
return renderer;
|
|
7274
|
-
}
|
|
6569
|
+
if (renderer === "silent" || renderer === "test" || !color) return renderer;
|
|
7275
6570
|
return "verbose";
|
|
7276
6571
|
};
|
|
7277
6572
|
const getRenderer = ({ color, debug, quiet }, logger, env = process.env) => {
|
|
@@ -7285,7 +6580,6 @@ const getRenderer = ({ color, debug, quiet }, logger, env = process.env) => {
|
|
|
7285
6580
|
fallbackRenderer: getFallbackRenderer(mainRendererOptions, { color })
|
|
7286
6581
|
};
|
|
7287
6582
|
};
|
|
7288
|
-
|
|
7289
6583
|
//#endregion
|
|
7290
6584
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getSpawnedTasks.js
|
|
7291
6585
|
const debugLog$10 = createDebug("lint-staged:getSpawnedTasks");
|
|
@@ -7312,9 +6606,7 @@ const getSpawnedTasks = async ({ color, commands, continueOnError, cwd, files, t
|
|
|
7312
6606
|
const resolved = isFn ? await cmd([...filepaths]) : cmd;
|
|
7313
6607
|
const resolvedArray = Array.isArray(resolved) ? resolved : [resolved];
|
|
7314
6608
|
for (const command of resolvedArray) {
|
|
7315
|
-
if (isFn && typeof command !== "string")
|
|
7316
|
-
throw new Error(configurationError("[Function]", "Function task should return a string or an array of strings", resolved));
|
|
7317
|
-
}
|
|
6609
|
+
if (isFn && typeof command !== "string") throw new Error(configurationError("[Function]", "Function task should return a string or an array of strings", resolved));
|
|
7318
6610
|
const task = getSpawnedTask({
|
|
7319
6611
|
color,
|
|
7320
6612
|
command,
|
|
@@ -7334,7 +6626,6 @@ const getSpawnedTasks = async ({ color, commands, continueOnError, cwd, files, t
|
|
|
7334
6626
|
}
|
|
7335
6627
|
return cmdTasks;
|
|
7336
6628
|
};
|
|
7337
|
-
|
|
7338
6629
|
//#endregion
|
|
7339
6630
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getDiffCommand.js
|
|
7340
6631
|
/** @type {(diff?: string, diffFilter?: string) => string[]} */
|
|
@@ -7343,21 +6634,15 @@ const getDiffCommand = (diff, diffFilter) => {
|
|
|
7343
6634
|
* Docs for --diff-filter option:
|
|
7344
6635
|
* @see https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203
|
|
7345
6636
|
*/
|
|
7346
|
-
const diffFilterArg = diffFilter !==
|
|
6637
|
+
const diffFilterArg = diffFilter !== void 0 ? diffFilter.trim() : "ACMR";
|
|
7347
6638
|
/** Use `--diff branch1...branch2` or `--diff="branch1 branch2", or fall back to default staged files */
|
|
7348
|
-
const diffArgs = diff !==
|
|
7349
|
-
|
|
7350
|
-
* Docs for -z option:
|
|
7351
|
-
* @see https://git-scm.com/docs/git-diff#Documentation/git-diff.txt--z
|
|
7352
|
-
*/
|
|
7353
|
-
const diffCommand = [
|
|
6639
|
+
const diffArgs = diff !== void 0 ? diff.trim().split(" ") : ["--staged"];
|
|
6640
|
+
return [
|
|
7354
6641
|
"diff",
|
|
7355
6642
|
`--diff-filter=${diffFilterArg}`,
|
|
7356
6643
|
...diffArgs
|
|
7357
6644
|
];
|
|
7358
|
-
return diffCommand;
|
|
7359
6645
|
};
|
|
7360
|
-
|
|
7361
6646
|
//#endregion
|
|
7362
6647
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/parseGitZOutput.js
|
|
7363
6648
|
/**
|
|
@@ -7366,7 +6651,6 @@ const getDiffCommand = (diff, diffFilter) => {
|
|
|
7366
6651
|
* remove the last occurrence of `\u0000` before splitting
|
|
7367
6652
|
*/
|
|
7368
6653
|
const parseGitZOutput = (input) => input ? input.replace(/\u0000$/, "").split("\0") : [];
|
|
7369
|
-
|
|
7370
6654
|
//#endregion
|
|
7371
6655
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/getStagedFiles.js
|
|
7372
6656
|
/**
|
|
@@ -7412,9 +6696,7 @@ const getStagedFiles = async ({ cwd = process.cwd(), diff, diffFilter } = {}) =>
|
|
|
7412
6696
|
* Filter out submodules and symlinks
|
|
7413
6697
|
* @see https://github.com/git/git/blob/cb96e1697ad6e54d11fc920c95f82977f8e438f8/Documentation/git-fast-import.adoc?plain=1#L634-L646
|
|
7414
6698
|
*/
|
|
7415
|
-
if (dstMode === "160000" || dstMode === "120000")
|
|
7416
|
-
return [];
|
|
7417
|
-
}
|
|
6699
|
+
if (dstMode === "160000" || dstMode === "120000") return [];
|
|
7418
6700
|
/**
|
|
7419
6701
|
* @example "M"
|
|
7420
6702
|
* @example "R86"
|
|
@@ -7440,7 +6722,6 @@ const getStagedFiles = async ({ cwd = process.cwd(), diff, diffFilter } = {}) =>
|
|
|
7440
6722
|
return null;
|
|
7441
6723
|
}
|
|
7442
6724
|
};
|
|
7443
|
-
|
|
7444
6725
|
//#endregion
|
|
7445
6726
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/file.js
|
|
7446
6727
|
const debugLog$9 = createDebug("lint-staged:file");
|
|
@@ -7458,9 +6739,7 @@ const readFile$1 = async (filename, ignoreENOENT = true) => {
|
|
|
7458
6739
|
if (ignoreENOENT && error.code === "ENOENT") {
|
|
7459
6740
|
debugLog$9("File `%s` doesn't exist, ignoring...", filename);
|
|
7460
6741
|
return null;
|
|
7461
|
-
} else
|
|
7462
|
-
throw error;
|
|
7463
|
-
}
|
|
6742
|
+
} else throw error;
|
|
7464
6743
|
}
|
|
7465
6744
|
};
|
|
7466
6745
|
/**
|
|
@@ -7473,11 +6752,8 @@ const unlink = async (filename, ignoreENOENT = true) => {
|
|
|
7473
6752
|
try {
|
|
7474
6753
|
await fsPromises.unlink(filename);
|
|
7475
6754
|
} catch (error) {
|
|
7476
|
-
if (ignoreENOENT && error.code === "ENOENT")
|
|
7477
|
-
|
|
7478
|
-
} else {
|
|
7479
|
-
throw error;
|
|
7480
|
-
}
|
|
6755
|
+
if (ignoreENOENT && error.code === "ENOENT") debugLog$9("File `%s` doesn't exist, ignoring...", filename);
|
|
6756
|
+
else throw error;
|
|
7481
6757
|
}
|
|
7482
6758
|
};
|
|
7483
6759
|
/**
|
|
@@ -7489,7 +6765,6 @@ const writeFile = async (filename, buffer) => {
|
|
|
7489
6765
|
debugLog$9("Writing file `%s`", filename);
|
|
7490
6766
|
await fsPromises.writeFile(filename, buffer);
|
|
7491
6767
|
};
|
|
7492
|
-
|
|
7493
6768
|
//#endregion
|
|
7494
6769
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/gitWorkflow.js
|
|
7495
6770
|
const debugLog$8 = createDebug("lint-staged:GitWorkflow");
|
|
@@ -7507,9 +6782,7 @@ const processRenames = (files, includeRenameFrom = true) => files.reduce((flatte
|
|
|
7507
6782
|
const [to, from] = file.split(RENAME);
|
|
7508
6783
|
if (includeRenameFrom) flattened.push(from);
|
|
7509
6784
|
flattened.push(to);
|
|
7510
|
-
} else
|
|
7511
|
-
flattened.push(file);
|
|
7512
|
-
}
|
|
6785
|
+
} else flattened.push(file);
|
|
7513
6786
|
return flattened;
|
|
7514
6787
|
}, []);
|
|
7515
6788
|
const STASH = "lint-staged automatic backup";
|
|
@@ -7579,14 +6852,12 @@ var GitWorkflow = class {
|
|
|
7579
6852
|
* Get name of backup stash
|
|
7580
6853
|
*/
|
|
7581
6854
|
async getBackupStash(ctx) {
|
|
7582
|
-
|
|
7583
|
-
const stashes = await this.execGit([
|
|
6855
|
+
const index = (await this.execGit([
|
|
7584
6856
|
"stash",
|
|
7585
6857
|
"list",
|
|
7586
6858
|
"--format=\"%h %s\"",
|
|
7587
6859
|
"-z"
|
|
7588
|
-
]).then(parseGitZOutput).then(cleanGitStashOutput);
|
|
7589
|
-
const index = stashes.findIndex((line) => line.startsWith(ctx.backupHash));
|
|
6860
|
+
]).then(parseGitZOutput).then(cleanGitStashOutput)).findIndex((line) => line.startsWith(ctx.backupHash));
|
|
7590
6861
|
if (index === -1) {
|
|
7591
6862
|
ctx.errors.add(GetBackupStashError);
|
|
7592
6863
|
throw new Error("lint-staged automatic backup is missing!");
|
|
@@ -7598,8 +6869,7 @@ var GitWorkflow = class {
|
|
|
7598
6869
|
*/
|
|
7599
6870
|
async getDeletedFiles() {
|
|
7600
6871
|
debugLog$8("Getting deleted files...");
|
|
7601
|
-
const
|
|
7602
|
-
const deletedFiles = lsFiles.split("\n").filter(Boolean).map((file) => path.resolve(this.topLevelDir, file));
|
|
6872
|
+
const deletedFiles = (await this.execGit(["ls-files", "--deleted"])).split("\n").filter(Boolean).map((file) => path.resolve(this.topLevelDir, file));
|
|
7603
6873
|
debugLog$8("Found deleted files:", deletedFiles);
|
|
7604
6874
|
return deletedFiles;
|
|
7605
6875
|
}
|
|
@@ -7630,7 +6900,7 @@ var GitWorkflow = class {
|
|
|
7630
6900
|
} catch (error) {
|
|
7631
6901
|
debugLog$8("Failed restoring merge state with error:");
|
|
7632
6902
|
debugLog$8(error);
|
|
7633
|
-
handleError(new Error("Merge state could not be restored due to an error!"), ctx, RestoreMergeStatusError);
|
|
6903
|
+
handleError(/* @__PURE__ */ new Error("Merge state could not be restored due to an error!"), ctx, RestoreMergeStatusError);
|
|
7634
6904
|
}
|
|
7635
6905
|
}
|
|
7636
6906
|
/**
|
|
@@ -7640,7 +6910,6 @@ var GitWorkflow = class {
|
|
|
7640
6910
|
*/
|
|
7641
6911
|
async getUnstagedFiles({ onlyPartial = false } = {}) {
|
|
7642
6912
|
debugLog$8("Getting partially staged files...");
|
|
7643
|
-
const status = await this.execGit(["status", "-z"]);
|
|
7644
6913
|
/**
|
|
7645
6914
|
* See https://git-scm.com/docs/git-status#_short_format
|
|
7646
6915
|
* Entries returned in machine format are separated by a NUL character.
|
|
@@ -7650,13 +6919,11 @@ var GitWorkflow = class {
|
|
|
7650
6919
|
* renamed file, the file names are separated by a NUL character
|
|
7651
6920
|
* (e.g. `to`\0`from`)
|
|
7652
6921
|
*/
|
|
7653
|
-
const unstagedFiles = status.split(/\x00(?=[ AMDRCU?!]{2} |$)/).filter((line) => {
|
|
6922
|
+
const unstagedFiles = (await this.execGit(["status", "-z"])).split(/\x00(?=[ AMDRCU?!]{2} |$)/).filter((line) => {
|
|
7654
6923
|
const [index, workingTree] = line;
|
|
7655
6924
|
const updatedInIndex = index !== " " && index !== "?";
|
|
7656
6925
|
const updatedInWorkingTree = workingTree !== " " && workingTree !== "?";
|
|
7657
|
-
if (onlyPartial)
|
|
7658
|
-
return updatedInIndex && updatedInWorkingTree;
|
|
7659
|
-
}
|
|
6926
|
+
if (onlyPartial) return updatedInIndex && updatedInWorkingTree;
|
|
7660
6927
|
return updatedInWorkingTree;
|
|
7661
6928
|
}).map((line) => line.slice(3)).filter(Boolean);
|
|
7662
6929
|
debugLog$8(`Found ${onlyPartial ? "partially staged" : "unstaged"} files:`, unstagedFiles);
|
|
@@ -7702,15 +6969,13 @@ var GitWorkflow = class {
|
|
|
7702
6969
|
"--message",
|
|
7703
6970
|
STASH
|
|
7704
6971
|
]);
|
|
7705
|
-
/**
|
|
7706
|
-
|
|
6972
|
+
/** The stash line starts with the short hash, so we split from space and choose the first part */
|
|
6973
|
+
ctx.backupHash = (await this.execGit([
|
|
7707
6974
|
"stash",
|
|
7708
6975
|
"list",
|
|
7709
6976
|
"--format=\"%h %s\"",
|
|
7710
6977
|
"-z"
|
|
7711
|
-
]).then(parseGitZOutput).then(cleanGitStashOutput);
|
|
7712
|
-
/** The stash line starts with the short hash, so we split from space and choose the first part */
|
|
7713
|
-
ctx.backupHash = stashes.find((line) => line.includes(STASH))?.split(" ")[0];
|
|
6978
|
+
]).then(parseGitZOutput).then(cleanGitStashOutput)).find((line) => line.includes(STASH))?.split(" ")[0];
|
|
7714
6979
|
} else {
|
|
7715
6980
|
/** Save stash of all changes, keeping all files as-is */
|
|
7716
6981
|
const stashHash = await this.execGit(["stash", "create"]);
|
|
@@ -7755,12 +7020,11 @@ var GitWorkflow = class {
|
|
|
7755
7020
|
async runTasks(ctx, task, { listrTasks, concurrent }) {
|
|
7756
7021
|
if (ctx.shouldFailOnChanges) {
|
|
7757
7022
|
debugLog$8("Calculating SHA-256 hash of unstaged changes because \"--fail-on-changes\" was used...");
|
|
7758
|
-
|
|
7023
|
+
ctx.unstagedDiffSha256 = calculateSha256(await this.execGit([
|
|
7759
7024
|
"diff",
|
|
7760
7025
|
"--patch",
|
|
7761
7026
|
"--unified=0"
|
|
7762
|
-
]);
|
|
7763
|
-
ctx.unstagedDiffSha256 = calculateSha256(diff);
|
|
7027
|
+
]));
|
|
7764
7028
|
debugLog$8("SHA-256 hash of unstaged changes is %s", ctx.unstagedDiffSha256);
|
|
7765
7029
|
}
|
|
7766
7030
|
return task.newListr(listrTasks, { concurrent });
|
|
@@ -7772,12 +7036,11 @@ var GitWorkflow = class {
|
|
|
7772
7036
|
async applyModifications(ctx) {
|
|
7773
7037
|
if (ctx.shouldFailOnChanges) {
|
|
7774
7038
|
debugLog$8("Calculating SHA-256 hash of changes after tasks because \"--fail-on-changes\" was used...");
|
|
7775
|
-
const
|
|
7039
|
+
const diffSha256 = calculateSha256(await this.execGit([
|
|
7776
7040
|
"diff",
|
|
7777
7041
|
"--patch",
|
|
7778
7042
|
"--unified=0"
|
|
7779
|
-
]);
|
|
7780
|
-
const diffSha256 = calculateSha256(diff);
|
|
7043
|
+
]));
|
|
7781
7044
|
debugLog$8("SHA-256 hash of changes after tasks is %s", diffSha256);
|
|
7782
7045
|
if (ctx.unstagedDiffSha256 !== diffSha256) {
|
|
7783
7046
|
ctx.errors.add(FailOnChangesError);
|
|
@@ -7786,15 +7049,12 @@ var GitWorkflow = class {
|
|
|
7786
7049
|
}
|
|
7787
7050
|
debugLog$8("Adding task modifications to index...");
|
|
7788
7051
|
for (const files of this.matchedFileChunks) {
|
|
7789
|
-
const
|
|
7052
|
+
const addableFiles = (await Promise.allSettled(files.map(async (f) => {
|
|
7790
7053
|
if (f.status === "D") {
|
|
7791
7054
|
await fsPromises.access(f.filepath);
|
|
7792
7055
|
return f.filepath;
|
|
7793
|
-
} else
|
|
7794
|
-
|
|
7795
|
-
}
|
|
7796
|
-
}));
|
|
7797
|
-
const addableFiles = accessCheckedFiles.flatMap((r) => r.status === "fulfilled" ? [r.value] : []);
|
|
7056
|
+
} else return f.filepath;
|
|
7057
|
+
}))).flatMap((r) => r.status === "fulfilled" ? [r.value] : []);
|
|
7798
7058
|
await this.execGit([
|
|
7799
7059
|
"add",
|
|
7800
7060
|
"--",
|
|
@@ -7802,14 +7062,11 @@ var GitWorkflow = class {
|
|
|
7802
7062
|
]);
|
|
7803
7063
|
}
|
|
7804
7064
|
debugLog$8("Done adding task modifications to index!");
|
|
7805
|
-
|
|
7065
|
+
if (!await this.execGit([
|
|
7806
7066
|
...getDiffCommand(this.diff, this.diffFilter),
|
|
7807
7067
|
"--name-only",
|
|
7808
7068
|
"-z"
|
|
7809
|
-
]);
|
|
7810
|
-
if (!stagedFilesAfterAdd && !this.allowEmpty) {
|
|
7811
|
-
handleError(new Error("Prevented an empty git commit!"), ctx, ApplyEmptyCommitError);
|
|
7812
|
-
}
|
|
7069
|
+
]) && !this.allowEmpty) handleError(/* @__PURE__ */ new Error("Prevented an empty git commit!"), ctx, ApplyEmptyCommitError);
|
|
7813
7070
|
}
|
|
7814
7071
|
/**
|
|
7815
7072
|
* Restore unstaged changes to partially changed files. If it at first fails,
|
|
@@ -7839,7 +7096,7 @@ var GitWorkflow = class {
|
|
|
7839
7096
|
} catch (threeWayApplyError) {
|
|
7840
7097
|
debugLog$8("Error while restoring unstaged changes using 3-way merge:");
|
|
7841
7098
|
debugLog$8(threeWayApplyError);
|
|
7842
|
-
handleError(new Error("Unstaged changes could not be restored due to a merge conflict!"), ctx, RestoreUnstagedChangesError);
|
|
7099
|
+
handleError(/* @__PURE__ */ new Error("Unstaged changes could not be restored due to a merge conflict!"), ctx, RestoreUnstagedChangesError);
|
|
7843
7100
|
}
|
|
7844
7101
|
}
|
|
7845
7102
|
}
|
|
@@ -7887,7 +7144,6 @@ var GitWorkflow = class {
|
|
|
7887
7144
|
}
|
|
7888
7145
|
}
|
|
7889
7146
|
};
|
|
7890
|
-
|
|
7891
7147
|
//#endregion
|
|
7892
7148
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/groupFilesByConfig.js
|
|
7893
7149
|
const debugLog$7 = createDebug("lint-staged:groupFilesByConfig");
|
|
@@ -7919,18 +7175,14 @@ const groupFilesByConfig = async ({ configs, files, singleConfigMode }) => {
|
|
|
7919
7175
|
};
|
|
7920
7176
|
/** This config should match all files since it has a parent glob */
|
|
7921
7177
|
const includeAllFiles = Object.keys(config).some((glob) => glob.startsWith(".."));
|
|
7922
|
-
const scopedFiles = new Set(includeAllFiles ? filesSet :
|
|
7178
|
+
const scopedFiles = new Set(includeAllFiles ? filesSet : void 0);
|
|
7923
7179
|
/**
|
|
7924
7180
|
* Without a parent glob, if file is inside the config file's directory,
|
|
7925
7181
|
* assign it to that configuration.
|
|
7926
7182
|
*/
|
|
7927
|
-
if (!includeAllFiles) {
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
scopedFiles.add(file);
|
|
7931
|
-
}
|
|
7932
|
-
});
|
|
7933
|
-
}
|
|
7183
|
+
if (!includeAllFiles) filesSet.forEach((file) => {
|
|
7184
|
+
if (isInsideDir(file)) scopedFiles.add(file);
|
|
7185
|
+
});
|
|
7934
7186
|
/** Files should only match a single config */
|
|
7935
7187
|
scopedFiles.forEach((file) => {
|
|
7936
7188
|
filesSet.delete(file);
|
|
@@ -7942,7 +7194,6 @@ const groupFilesByConfig = async ({ configs, files, singleConfigMode }) => {
|
|
|
7942
7194
|
}
|
|
7943
7195
|
return filesByConfig;
|
|
7944
7196
|
};
|
|
7945
|
-
|
|
7946
7197
|
//#endregion
|
|
7947
7198
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/resolveGitRepo.js
|
|
7948
7199
|
const debugLog$6 = createDebug("lint-staged:resolveGitRepo");
|
|
@@ -7978,14 +7229,12 @@ const resolveGitRepo = async (cwd = process.cwd()) => {
|
|
|
7978
7229
|
delete process.env.GIT_DIR;
|
|
7979
7230
|
debugLog$6("Unset GIT_WORK_TREE (was `%s`)", process.env.GIT_WORK_TREE);
|
|
7980
7231
|
delete process.env.GIT_WORK_TREE;
|
|
7981
|
-
|
|
7982
|
-
const revParseOutput = await execGit([
|
|
7232
|
+
const [relativeTopLevelDir, topLevel, absoluteGitDir] = (await execGit([
|
|
7983
7233
|
"rev-parse",
|
|
7984
7234
|
CDUP,
|
|
7985
7235
|
TOPLEVEL,
|
|
7986
7236
|
ABSOLUTE_GIT_DIR
|
|
7987
|
-
], { cwd });
|
|
7988
|
-
const [relativeTopLevelDir, topLevel, absoluteGitDir] = revParseOutput.split("\n");
|
|
7237
|
+
], { cwd })).split("\n");
|
|
7989
7238
|
const topLevelDir = normalizePath(path.join(cwd, relativeTopLevelDir));
|
|
7990
7239
|
debugLog$6("Resolved git repository top-level directory to be `%s`", topLevelDir);
|
|
7991
7240
|
const relativeGitConfigDir = path.relative(topLevel, absoluteGitDir);
|
|
@@ -8004,7 +7253,6 @@ const resolveGitRepo = async (cwd = process.cwd()) => {
|
|
|
8004
7253
|
};
|
|
8005
7254
|
}
|
|
8006
7255
|
};
|
|
8007
|
-
|
|
8008
7256
|
//#endregion
|
|
8009
7257
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/configFiles.js
|
|
8010
7258
|
const CONFIG_NAME = "lint-staged";
|
|
@@ -8034,7 +7282,6 @@ const CONFIG_FILE_NAMES = [
|
|
|
8034
7282
|
"lint-staged.config.cjs",
|
|
8035
7283
|
"lint-staged.config.cts"
|
|
8036
7284
|
];
|
|
8037
|
-
|
|
8038
7285
|
//#endregion
|
|
8039
7286
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/resolveConfig.js
|
|
8040
7287
|
/**
|
|
@@ -8049,7 +7296,6 @@ function resolveConfig(configPath) {
|
|
|
8049
7296
|
return configPath;
|
|
8050
7297
|
}
|
|
8051
7298
|
}
|
|
8052
|
-
|
|
8053
7299
|
//#endregion
|
|
8054
7300
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/loadConfig.js
|
|
8055
7301
|
/** @typedef {import('./index').Logger} Logger */
|
|
@@ -8062,9 +7308,9 @@ const jsonParse = async (filename) => {
|
|
|
8062
7308
|
const json = JSON.parse(content);
|
|
8063
7309
|
return isPackageFile ? json[CONFIG_NAME] : json;
|
|
8064
7310
|
} catch (error) {
|
|
8065
|
-
if (path.basename(filename) ===
|
|
7311
|
+
if (path.basename(filename) === "package.json") {
|
|
8066
7312
|
debugLog$5("Ignoring invalid JSON file %s", filename);
|
|
8067
|
-
return
|
|
7313
|
+
return;
|
|
8068
7314
|
}
|
|
8069
7315
|
throw error;
|
|
8070
7316
|
}
|
|
@@ -8072,13 +7318,13 @@ const jsonParse = async (filename) => {
|
|
|
8072
7318
|
const yamlParse = async (filename) => {
|
|
8073
7319
|
const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
|
|
8074
7320
|
try {
|
|
8075
|
-
const [YAML, content] = await Promise.all([import("./browser-
|
|
7321
|
+
const [YAML, content] = await Promise.all([import("./browser-EZnNDcaO.js"), readFile(filename)]);
|
|
8076
7322
|
const yaml = YAML.parse(content);
|
|
8077
7323
|
return isPackageFile ? yaml[CONFIG_NAME] : yaml;
|
|
8078
7324
|
} catch (error) {
|
|
8079
7325
|
if (isPackageFile) {
|
|
8080
7326
|
debugLog$5("Ignoring invalid YAML file %s", filename);
|
|
8081
|
-
return
|
|
7327
|
+
return;
|
|
8082
7328
|
}
|
|
8083
7329
|
throw error;
|
|
8084
7330
|
}
|
|
@@ -8105,11 +7351,9 @@ const loaders = {
|
|
|
8105
7351
|
};
|
|
8106
7352
|
const loadConfigByExt = async (filename) => {
|
|
8107
7353
|
const filepath = path.resolve(filename);
|
|
8108
|
-
const
|
|
8109
|
-
const loader = loaders[ext];
|
|
8110
|
-
const config = await loader(filepath);
|
|
7354
|
+
const loader = loaders[path.extname(filepath) || NO_EXT];
|
|
8111
7355
|
return {
|
|
8112
|
-
config,
|
|
7356
|
+
config: await loader(filepath),
|
|
8113
7357
|
filepath
|
|
8114
7358
|
};
|
|
8115
7359
|
};
|
|
@@ -8120,11 +7364,8 @@ const loadConfig = async (configPath, logger) => {
|
|
|
8120
7364
|
const result = await loadConfigByExt(resolveConfig(configPath));
|
|
8121
7365
|
const config = await result.config ?? null;
|
|
8122
7366
|
const filepath = result.filepath;
|
|
8123
|
-
if (config)
|
|
8124
|
-
|
|
8125
|
-
} else {
|
|
8126
|
-
debugLog$5("Found no config in %s", filepath);
|
|
8127
|
-
}
|
|
7367
|
+
if (config) debugLog$5("Successfully loaded config from `%s`:\n%O", filepath, config);
|
|
7368
|
+
else debugLog$5("Found no config in %s", filepath);
|
|
8128
7369
|
return {
|
|
8129
7370
|
config,
|
|
8130
7371
|
filepath
|
|
@@ -8135,7 +7376,6 @@ const loadConfig = async (configPath, logger) => {
|
|
|
8135
7376
|
return {};
|
|
8136
7377
|
}
|
|
8137
7378
|
};
|
|
8138
|
-
|
|
8139
7379
|
//#endregion
|
|
8140
7380
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/validateBraces.js
|
|
8141
7381
|
/**
|
|
@@ -8212,21 +7452,16 @@ const stripDoubleBraces = (pattern) => {
|
|
|
8212
7452
|
*/
|
|
8213
7453
|
const validateBraces = (pattern, logger) => {
|
|
8214
7454
|
const fixedPattern = stripDoubleBraces(stripIncorrectBraces(pattern));
|
|
8215
|
-
if (fixedPattern !== pattern)
|
|
8216
|
-
logger.warn(incorrectBraces(pattern, fixedPattern));
|
|
8217
|
-
}
|
|
7455
|
+
if (fixedPattern !== pattern) logger.warn(incorrectBraces(pattern, fixedPattern));
|
|
8218
7456
|
return fixedPattern;
|
|
8219
7457
|
};
|
|
8220
|
-
|
|
8221
7458
|
//#endregion
|
|
8222
7459
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/validateConfig.js
|
|
8223
7460
|
/** @typedef {import('./index').Logger} Logger */
|
|
8224
7461
|
const debugLog$4 = createDebug("lint-staged:validateConfig");
|
|
8225
7462
|
const validateConfigLogic = (config, configPath, logger) => {
|
|
8226
7463
|
debugLog$4("Validating config from `%s`...", configPath);
|
|
8227
|
-
if (!config || typeof config !== "object" && typeof config !== "function")
|
|
8228
|
-
throw ConfigFormatError;
|
|
8229
|
-
}
|
|
7464
|
+
if (!config || typeof config !== "object" && typeof config !== "function") throw ConfigFormatError;
|
|
8230
7465
|
/**
|
|
8231
7466
|
* Function configurations receive all staged files as their argument.
|
|
8232
7467
|
* They are not further validated here to make sure the function gets
|
|
@@ -8234,12 +7469,8 @@ const validateConfigLogic = (config, configPath, logger) => {
|
|
|
8234
7469
|
*
|
|
8235
7470
|
* @see getSpawnedTasks
|
|
8236
7471
|
*/
|
|
8237
|
-
if (typeof config === "function") {
|
|
8238
|
-
|
|
8239
|
-
}
|
|
8240
|
-
if (Object.entries(config).length === 0) {
|
|
8241
|
-
throw ConfigEmptyError;
|
|
8242
|
-
}
|
|
7472
|
+
if (typeof config === "function") return { "*": config };
|
|
7473
|
+
if (Object.entries(config).length === 0) throw ConfigEmptyError;
|
|
8243
7474
|
const errors = [];
|
|
8244
7475
|
/**
|
|
8245
7476
|
* Create a new validated config because the keys (patterns) might change.
|
|
@@ -8249,18 +7480,13 @@ const validateConfigLogic = (config, configPath, logger) => {
|
|
|
8249
7480
|
const validatedConfig = Object.entries(config).reduce((collection, [pattern, task]) => {
|
|
8250
7481
|
if (Array.isArray(task)) {
|
|
8251
7482
|
/** Array with invalid values */
|
|
8252
|
-
if (task.some((item) => typeof item !== "string" && typeof item !== "function"))
|
|
8253
|
-
errors.push(configurationError(pattern, "Should be an array of strings or functions.", task));
|
|
8254
|
-
}
|
|
7483
|
+
if (task.some((item) => typeof item !== "string" && typeof item !== "function")) errors.push(configurationError(pattern, "Should be an array of strings or functions.", task));
|
|
8255
7484
|
} else if (typeof task === "object") {
|
|
8256
7485
|
/** Invalid function task */
|
|
8257
|
-
if (typeof task.title !== "string" || typeof task.task !== "function")
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
/** Singular invalid value */
|
|
8262
|
-
errors.push(configurationError(pattern, "Should be a string, a function, an object or an array of strings and functions.", task));
|
|
8263
|
-
}
|
|
7486
|
+
if (typeof task.title !== "string" || typeof task.task !== "function") errors.push(configurationError(pattern, "Function task should contain `title` and `task` fields, where `title` should be a string and `task` should be a function.", task));
|
|
7487
|
+
} else if (typeof task !== "string" && typeof task !== "function")
|
|
7488
|
+
/** Singular invalid value */
|
|
7489
|
+
errors.push(configurationError(pattern, "Should be a string, a function, an object or an array of strings and functions.", task));
|
|
8264
7490
|
/**
|
|
8265
7491
|
* A typical configuration error is using invalid brace expansion, like `*.{js}`.
|
|
8266
7492
|
* These are automatically fixed and warned about.
|
|
@@ -8292,7 +7518,6 @@ const validateConfig = (config, configPath, logger) => {
|
|
|
8292
7518
|
throw error;
|
|
8293
7519
|
}
|
|
8294
7520
|
};
|
|
8295
|
-
|
|
8296
7521
|
//#endregion
|
|
8297
7522
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/searchConfigs.js
|
|
8298
7523
|
/** @typedef {import('./index').Logger} Logger */
|
|
@@ -8329,12 +7554,9 @@ const listConfigFilesFromGit = async ({ cwd, topLevelDir }) => execGit([
|
|
|
8329
7554
|
* The "S" status means a tracked file that is "skip-worktree"
|
|
8330
7555
|
* @see https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt--t
|
|
8331
7556
|
*/
|
|
8332
|
-
if (line.startsWith("S "))
|
|
8333
|
-
return [];
|
|
8334
|
-
}
|
|
7557
|
+
if (line.startsWith("S ")) return [];
|
|
8335
7558
|
const relativePath = line.replace(/^[HSMRCK?U] /, "");
|
|
8336
|
-
|
|
8337
|
-
return [absolutePath];
|
|
7559
|
+
return [normalizePath(path.join(topLevelDir, relativePath))];
|
|
8338
7560
|
});
|
|
8339
7561
|
debugLog$3("Found possible config files from git:", possibleConfigFiles);
|
|
8340
7562
|
return possibleConfigFiles;
|
|
@@ -8350,20 +7572,17 @@ const listConfigFilesFromGit = async ({ cwd, topLevelDir }) => execGit([
|
|
|
8350
7572
|
*/
|
|
8351
7573
|
const listConfigFilesFromFs = async ({ cwd }) => {
|
|
8352
7574
|
debugLog$3("Listing possible configs from filesystem starting from \"%s\"...", cwd);
|
|
8353
|
-
const
|
|
7575
|
+
const possibleConfigFiles = (await Promise.allSettled(CONFIG_FILE_NAMES.map(async (f) => {
|
|
8354
7576
|
const filepath = path.join(cwd, f);
|
|
8355
7577
|
await fsPromises.access(filepath, constants$1.F_OK);
|
|
8356
7578
|
return filepath;
|
|
8357
|
-
}));
|
|
8358
|
-
const possibleConfigFiles = results.flatMap((r) => r.status === "fulfilled" ? [normalizePath(r.value)] : []);
|
|
7579
|
+
}))).flatMap((r) => r.status === "fulfilled" ? [normalizePath(r.value)] : []);
|
|
8359
7580
|
if (possibleConfigFiles.length > 0) {
|
|
8360
7581
|
debugLog$3("Found possible config files from filesystem:", possibleConfigFiles);
|
|
8361
7582
|
return possibleConfigFiles;
|
|
8362
7583
|
}
|
|
8363
7584
|
const parentDir = path.dirname(cwd);
|
|
8364
|
-
if (parentDir === cwd)
|
|
8365
|
-
return [];
|
|
8366
|
-
}
|
|
7585
|
+
if (parentDir === cwd) return [];
|
|
8367
7586
|
return listConfigFilesFromFs({ cwd: parentDir });
|
|
8368
7587
|
};
|
|
8369
7588
|
/**
|
|
@@ -8390,7 +7609,7 @@ const searchConfigs = async ({ configObject, configPath, cwd = process.cwd(), to
|
|
|
8390
7609
|
if (!config) return {};
|
|
8391
7610
|
return { [configPath]: validateConfig(config, filepath, logger) };
|
|
8392
7611
|
}
|
|
8393
|
-
const possibleConfigFiles = new Set();
|
|
7612
|
+
const possibleConfigFiles = /* @__PURE__ */ new Set();
|
|
8394
7613
|
const addToSet = (files) => {
|
|
8395
7614
|
files.forEach((f) => {
|
|
8396
7615
|
possibleConfigFiles.add(f);
|
|
@@ -8405,23 +7624,18 @@ const searchConfigs = async ({ configObject, configPath, cwd = process.cwd(), to
|
|
|
8405
7624
|
/** Load and validate all configs to the above object */
|
|
8406
7625
|
await Promise.all(Object.keys(configs).map((configPath) => loadConfig(configPath, logger).then(({ config, filepath }) => {
|
|
8407
7626
|
if (config) {
|
|
8408
|
-
if (configPath !== filepath)
|
|
8409
|
-
debugLog$3("Config file \"%s\" resolved to \"%s\"", configPath, filepath);
|
|
8410
|
-
}
|
|
7627
|
+
if (configPath !== filepath) debugLog$3("Config file \"%s\" resolved to \"%s\"", configPath, filepath);
|
|
8411
7628
|
configs[configPath] = validateConfig(config, filepath, logger);
|
|
8412
7629
|
}
|
|
8413
7630
|
})));
|
|
8414
7631
|
/** Get validated configs from the above object, without any `null` values (not found) */
|
|
8415
7632
|
const foundConfigs = Object.entries(configs).reduce((acc, [key, value]) => {
|
|
8416
|
-
if (value) {
|
|
8417
|
-
Object.assign(acc, { [key]: value });
|
|
8418
|
-
}
|
|
7633
|
+
if (value) Object.assign(acc, { [key]: value });
|
|
8419
7634
|
return acc;
|
|
8420
7635
|
}, {});
|
|
8421
7636
|
debugLog$3("Found %d config files", Object.keys(foundConfigs).length);
|
|
8422
7637
|
return foundConfigs;
|
|
8423
7638
|
};
|
|
8424
|
-
|
|
8425
7639
|
//#endregion
|
|
8426
7640
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/runAll.js
|
|
8427
7641
|
/** @typedef {import('./index').Logger} Logger */
|
|
@@ -8457,7 +7671,7 @@ const createError = (ctx, cause) => Object.assign(new Error("lint-staged failed"
|
|
|
8457
7671
|
* @param {Logger} logger
|
|
8458
7672
|
* @returns {Promise}
|
|
8459
7673
|
*/
|
|
8460
|
-
const runAll = async ({ allowEmpty = false, color = false, concurrent = true, configObject, configPath, continueOnError = false, cwd, debug = false, diff, diffFilter, failOnChanges = false, hideUnstaged = false, hidePartiallyStaged = !hideUnstaged, maxArgLength, quiet = false, relative = false, stash = diff ===
|
|
7674
|
+
const runAll = async ({ allowEmpty = false, color = false, concurrent = true, configObject, configPath, continueOnError = false, cwd, debug = false, diff, diffFilter, failOnChanges = false, hideUnstaged = false, hidePartiallyStaged = !hideUnstaged, maxArgLength, quiet = false, relative = false, stash = diff === void 0, revert = stash, verbose = false }, logger = console) => {
|
|
8461
7675
|
debugLog$2("Running all linter scripts...");
|
|
8462
7676
|
const hasExplicitCwd = !!cwd;
|
|
8463
7677
|
cwd = hasExplicitCwd ? path.resolve(cwd) : process.cwd();
|
|
@@ -8477,12 +7691,8 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8477
7691
|
}
|
|
8478
7692
|
const hasInitialCommit = await execGit(["log", "-1"], { cwd: topLevelDir }).then(() => true).catch(() => false);
|
|
8479
7693
|
ctx.shouldBackup = hasInitialCommit && stash;
|
|
8480
|
-
if (!ctx.shouldBackup && !quiet)
|
|
8481
|
-
|
|
8482
|
-
}
|
|
8483
|
-
if (!ctx.shouldHidePartiallyStaged && !ctx.shouldHideUnstaged && !quiet) {
|
|
8484
|
-
logger.warn(SKIPPING_HIDE_PARTIALLY_CHANGED);
|
|
8485
|
-
}
|
|
7694
|
+
if (!ctx.shouldBackup && !quiet) logger.warn(skippingBackup(hasInitialCommit, diff));
|
|
7695
|
+
if (!ctx.shouldHidePartiallyStaged && !ctx.shouldHideUnstaged && !quiet) logger.warn(SKIPPING_HIDE_PARTIALLY_CHANGED);
|
|
8486
7696
|
const [stagedFiles, foundConfigs] = await Promise.all([getStagedFiles({
|
|
8487
7697
|
cwd: topLevelDir,
|
|
8488
7698
|
diff,
|
|
@@ -8511,7 +7721,7 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8511
7721
|
const filesByConfig = await groupFilesByConfig({
|
|
8512
7722
|
configs: foundConfigs,
|
|
8513
7723
|
files: stagedFiles,
|
|
8514
|
-
singleConfigMode: configObject || configPath !==
|
|
7724
|
+
singleConfigMode: configObject || configPath !== void 0
|
|
8515
7725
|
});
|
|
8516
7726
|
const hasMultipleConfigs = numberOfConfigs > 1;
|
|
8517
7727
|
let hasDeprecatedGitAdd = false;
|
|
@@ -8534,7 +7744,7 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8534
7744
|
let listrTaskCount = 0;
|
|
8535
7745
|
const listrTasks = [];
|
|
8536
7746
|
/** @type {Set<import('./getStagedFiles.js').StagedFile>} */
|
|
8537
|
-
const matchedFiles = new Set();
|
|
7747
|
+
const matchedFiles = /* @__PURE__ */ new Set();
|
|
8538
7748
|
for (const [configPath, { config, files }] of Object.entries(filesByConfig)) {
|
|
8539
7749
|
const configName = configPath ? normalizePath(path.relative(cwd, configPath)) : "Config object";
|
|
8540
7750
|
const stagedFileChunks = chunkFiles({
|
|
@@ -8545,9 +7755,7 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8545
7755
|
});
|
|
8546
7756
|
const groupCwd = hasMultipleConfigs && !hasExplicitCwd ? path.dirname(configPath) : cwd;
|
|
8547
7757
|
const chunkCount = stagedFileChunks.length;
|
|
8548
|
-
if (chunkCount > 1)
|
|
8549
|
-
debugLog$2("Chunked staged files from `%s` into %d part", configPath, chunkCount);
|
|
8550
|
-
}
|
|
7758
|
+
if (chunkCount > 1) debugLog$2("Chunked staged files from `%s` into %d part", configPath, chunkCount);
|
|
8551
7759
|
for (const [index, files] of stagedFileChunks.entries()) {
|
|
8552
7760
|
const chunkListrTasks = await Promise.all(generateTasks({
|
|
8553
7761
|
config,
|
|
@@ -8579,9 +7787,7 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8579
7787
|
exitOnError: !continueOnError
|
|
8580
7788
|
}),
|
|
8581
7789
|
skip: () => {
|
|
8582
|
-
if (fileCount === 0) {
|
|
8583
|
-
return `${task.pattern}${blackBright$1(" — no files")}`;
|
|
8584
|
-
}
|
|
7790
|
+
if (fileCount === 0) return `${task.pattern}${blackBright$1(" — no files")}`;
|
|
8585
7791
|
return false;
|
|
8586
7792
|
}
|
|
8587
7793
|
};
|
|
@@ -8595,35 +7801,29 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8595
7801
|
}),
|
|
8596
7802
|
skip: () => {
|
|
8597
7803
|
if (ctx.errors.has(GitError)) return SKIPPED_GIT_ERROR;
|
|
8598
|
-
if (chunkListrTasks.every((task) => task.skip())) {
|
|
8599
|
-
return `${configName}${blackBright$1(" — no tasks to run")}`;
|
|
8600
|
-
}
|
|
7804
|
+
if (chunkListrTasks.every((task) => task.skip())) return `${configName}${blackBright$1(" — no tasks to run")}`;
|
|
8601
7805
|
return false;
|
|
8602
7806
|
}
|
|
8603
7807
|
});
|
|
8604
7808
|
}
|
|
8605
7809
|
}
|
|
8606
|
-
if (hasDeprecatedGitAdd && !quiet)
|
|
8607
|
-
logger.warn(DEPRECATED_GIT_ADD);
|
|
8608
|
-
}
|
|
7810
|
+
if (hasDeprecatedGitAdd && !quiet) logger.warn(DEPRECATED_GIT_ADD);
|
|
8609
7811
|
if (listrTasks.every((task) => task.skip())) {
|
|
8610
7812
|
if (!quiet) ctx.output.push(NO_TASKS);
|
|
8611
7813
|
return ctx;
|
|
8612
7814
|
}
|
|
8613
|
-
/** @type {import('./getStagedFiles.js').StagedFile[][]} */
|
|
8614
|
-
const matchedFileChunks = chunkFiles({
|
|
8615
|
-
baseDir: cwd,
|
|
8616
|
-
files: Array.from(matchedFiles),
|
|
8617
|
-
maxArgLength,
|
|
8618
|
-
relative: false
|
|
8619
|
-
});
|
|
8620
7815
|
const git = new GitWorkflow({
|
|
8621
7816
|
allowEmpty,
|
|
8622
7817
|
diff,
|
|
8623
7818
|
diffFilter,
|
|
8624
7819
|
failOnChanges,
|
|
8625
7820
|
gitConfigDir,
|
|
8626
|
-
matchedFileChunks
|
|
7821
|
+
matchedFileChunks: chunkFiles({
|
|
7822
|
+
baseDir: cwd,
|
|
7823
|
+
files: Array.from(matchedFiles),
|
|
7824
|
+
maxArgLength,
|
|
7825
|
+
relative: false
|
|
7826
|
+
}),
|
|
8627
7827
|
topLevelDir
|
|
8628
7828
|
});
|
|
8629
7829
|
const runner = new Listr([
|
|
@@ -8671,12 +7871,9 @@ const runAll = async ({ allowEmpty = false, color = false, concurrent = true, co
|
|
|
8671
7871
|
debugLog$2("Set max event listeners to the number of tasks: %i", listrTaskCount);
|
|
8672
7872
|
ctx.events.setMaxListeners(listrTaskCount);
|
|
8673
7873
|
await runner.run();
|
|
8674
|
-
if (ctx.errors.size > 0)
|
|
8675
|
-
throw createError(ctx);
|
|
8676
|
-
}
|
|
7874
|
+
if (ctx.errors.size > 0) throw createError(ctx);
|
|
8677
7875
|
return ctx;
|
|
8678
7876
|
};
|
|
8679
|
-
|
|
8680
7877
|
//#endregion
|
|
8681
7878
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/validateOptions.js
|
|
8682
7879
|
const debugLog$1 = createDebug("lint-staged:validateOptions");
|
|
@@ -8689,26 +7886,21 @@ const debugLog$1 = createDebug("lint-staged:validateOptions");
|
|
|
8689
7886
|
const validateOptions = async (options = {}, logger) => {
|
|
8690
7887
|
debugLog$1("Validating options...");
|
|
8691
7888
|
/** Ensure the passed cwd option exists; it might also be relative */
|
|
8692
|
-
if (typeof options.cwd === "string") {
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
throw InvalidOptionsError;
|
|
8700
|
-
}
|
|
7889
|
+
if (typeof options.cwd === "string") try {
|
|
7890
|
+
const resolved = path.resolve(options.cwd);
|
|
7891
|
+
await fsPromises.access(resolved, constants.F_OK);
|
|
7892
|
+
} catch (error) {
|
|
7893
|
+
debugLog$1("Failed to validate options: %o", options);
|
|
7894
|
+
logger.error(invalidOption("cwd", options.cwd, error.message));
|
|
7895
|
+
throw InvalidOptionsError;
|
|
8701
7896
|
}
|
|
8702
7897
|
debugLog$1("Validated options: %o", options);
|
|
8703
7898
|
};
|
|
8704
|
-
|
|
8705
7899
|
//#endregion
|
|
8706
7900
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/version.js
|
|
8707
7901
|
const getVersion = async () => {
|
|
8708
|
-
|
|
8709
|
-
return packageJson.version;
|
|
7902
|
+
return JSON.parse(await fsPromises.readFile(new URL("../package.json", import.meta.url))).version;
|
|
8710
7903
|
};
|
|
8711
|
-
|
|
8712
7904
|
//#endregion
|
|
8713
7905
|
//#region ../../node_modules/.pnpm/lint-staged@16.2.7/node_modules/lint-staged/lib/index.js
|
|
8714
7906
|
const debugLog = createDebug("lint-staged");
|
|
@@ -8756,13 +7948,12 @@ const getMaxArgLength = () => {
|
|
|
8756
7948
|
*
|
|
8757
7949
|
* @returns {Promise<boolean>} Promise of whether the task passed or failed
|
|
8758
7950
|
*/
|
|
8759
|
-
const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurrent = true, config: configObject, configPath, continueOnError = false, cwd, debug = false, diff, diffFilter, failOnChanges = false, hideUnstaged = false, hidePartiallyStaged = !hideUnstaged, maxArgLength = getMaxArgLength() / 2, quiet = false, relative = false, stash = diff ===
|
|
7951
|
+
const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurrent = true, config: configObject, configPath, continueOnError = false, cwd, debug = false, diff, diffFilter, failOnChanges = false, hideUnstaged = false, hidePartiallyStaged = !hideUnstaged, maxArgLength = getMaxArgLength() / 2, quiet = false, relative = false, stash = diff === void 0, revert = !failOnChanges && !!stash, verbose = false } = {}, logger = console) => {
|
|
8760
7952
|
if (debug) {
|
|
8761
7953
|
enableDebug(logger);
|
|
8762
7954
|
debugLog("Running `lint-staged@%s` on Node.js %s (%s)", await getVersion(), process.version, process.platform);
|
|
8763
7955
|
}
|
|
8764
|
-
|
|
8765
|
-
debugLog("%s", gitVersion);
|
|
7956
|
+
debugLog("%s", await execGit(["version", "--build-options"], { cwd }));
|
|
8766
7957
|
const options = {
|
|
8767
7958
|
allowEmpty,
|
|
8768
7959
|
color,
|
|
@@ -8795,11 +7986,9 @@ const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurre
|
|
|
8795
7986
|
} catch (runAllError) {
|
|
8796
7987
|
if (runAllError?.ctx?.errors) {
|
|
8797
7988
|
const { ctx } = runAllError;
|
|
8798
|
-
if (ctx.errors.has(ConfigNotFoundError))
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
logger.warn(PREVENTED_EMPTY_COMMIT);
|
|
8802
|
-
} else if (ctx.errors.has(FailOnChangesError)) {
|
|
7989
|
+
if (ctx.errors.has(ConfigNotFoundError)) logger.error(NO_CONFIGURATION);
|
|
7990
|
+
else if (ctx.errors.has(ApplyEmptyCommitError)) logger.warn(PREVENTED_EMPTY_COMMIT);
|
|
7991
|
+
else if (ctx.errors.has(FailOnChangesError)) {
|
|
8803
7992
|
logger.warn(PREVENTED_TASK_MODIFICATIONS + "\n");
|
|
8804
7993
|
logger.warn(restoreStashExample(ctx.backupHash));
|
|
8805
7994
|
} else if (ctx.errors.has(RestoreUnstagedChangesError)) {
|
|
@@ -8807,9 +7996,7 @@ const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurre
|
|
|
8807
7996
|
logger.warn(ctx.unstagedPatch);
|
|
8808
7997
|
} else if ((ctx.errors.has(GitError) || cleanupSkipped(ctx)) && !ctx.errors.has(GetBackupStashError)) {
|
|
8809
7998
|
logger.error(GIT_ERROR);
|
|
8810
|
-
if (ctx.shouldBackup)
|
|
8811
|
-
logger.error(restoreStashExample(ctx.backupHash) + "\n");
|
|
8812
|
-
}
|
|
7999
|
+
if (ctx.shouldBackup) logger.error(restoreStashExample(ctx.backupHash) + "\n");
|
|
8813
8000
|
}
|
|
8814
8001
|
printTaskOutput(ctx, logger);
|
|
8815
8002
|
return false;
|
|
@@ -8817,35 +8004,15 @@ const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurre
|
|
|
8817
8004
|
throw runAllError;
|
|
8818
8005
|
}
|
|
8819
8006
|
};
|
|
8820
|
-
|
|
8821
8007
|
//#endregion
|
|
8822
8008
|
//#region src/resolve-vite-config.ts
|
|
8823
8009
|
/**
|
|
8824
8010
|
* Resolve vite.config.ts and return the config object.
|
|
8825
8011
|
*/
|
|
8826
8012
|
async function resolveViteConfig(cwd) {
|
|
8827
|
-
const { resolveConfig } = await import("./src-
|
|
8013
|
+
const { resolveConfig } = await import("./src-DwSJ0s0I.js");
|
|
8828
8014
|
return resolveConfig({ root: cwd }, "build");
|
|
8829
8015
|
}
|
|
8830
|
-
async function resolveUniversalViteConfig(err, viteConfigCwd) {
|
|
8831
|
-
if (err) {
|
|
8832
|
-
throw err;
|
|
8833
|
-
}
|
|
8834
|
-
try {
|
|
8835
|
-
const config = await resolveViteConfig(viteConfigCwd);
|
|
8836
|
-
return JSON.stringify({
|
|
8837
|
-
configFile: config.configFile,
|
|
8838
|
-
lint: config.lint,
|
|
8839
|
-
fmt: config.fmt,
|
|
8840
|
-
run: config.run,
|
|
8841
|
-
staged: config.staged
|
|
8842
|
-
});
|
|
8843
|
-
} catch (resolveErr) {
|
|
8844
|
-
console.error("[Vite+] resolve universal vite config error:", resolveErr);
|
|
8845
|
-
throw resolveErr;
|
|
8846
|
-
}
|
|
8847
|
-
}
|
|
8848
|
-
|
|
8849
8016
|
//#endregion
|
|
8850
8017
|
//#region src/staged/bin.ts
|
|
8851
8018
|
const args = lib_default(process.argv.slice(3), {
|
|
@@ -8956,51 +8123,26 @@ if (args.help) {
|
|
|
8956
8123
|
log(helpMessage);
|
|
8957
8124
|
} else {
|
|
8958
8125
|
const options = {};
|
|
8959
|
-
if (args["allow-empty"] != null)
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
if (args
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
if (args
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
if (args
|
|
8969
|
-
|
|
8970
|
-
}
|
|
8971
|
-
if (args["hide-partially-staged"] != null) {
|
|
8972
|
-
options.hidePartiallyStaged = args["hide-partially-staged"];
|
|
8973
|
-
}
|
|
8974
|
-
if (args["hide-unstaged"] != null) {
|
|
8975
|
-
options.hideUnstaged = args["hide-unstaged"];
|
|
8976
|
-
}
|
|
8977
|
-
if (args.quiet != null) {
|
|
8978
|
-
options.quiet = args.quiet;
|
|
8979
|
-
}
|
|
8980
|
-
if (args.relative != null) {
|
|
8981
|
-
options.relative = args.relative;
|
|
8982
|
-
}
|
|
8983
|
-
if (args.revert != null) {
|
|
8984
|
-
options.revert = args.revert;
|
|
8985
|
-
}
|
|
8986
|
-
if (args.stash != null) {
|
|
8987
|
-
options.stash = args.stash;
|
|
8988
|
-
}
|
|
8989
|
-
if (args.verbose != null) {
|
|
8990
|
-
options.verbose = args.verbose;
|
|
8991
|
-
}
|
|
8126
|
+
if (args["allow-empty"] != null) options.allowEmpty = args["allow-empty"];
|
|
8127
|
+
if (args.debug != null) options.debug = args.debug;
|
|
8128
|
+
if (args["continue-on-error"] != null) options.continueOnError = args["continue-on-error"];
|
|
8129
|
+
if (args["fail-on-changes"] != null) options.failOnChanges = args["fail-on-changes"];
|
|
8130
|
+
if (args["hide-partially-staged"] != null) options.hidePartiallyStaged = args["hide-partially-staged"];
|
|
8131
|
+
if (args["hide-unstaged"] != null) options.hideUnstaged = args["hide-unstaged"];
|
|
8132
|
+
if (args.quiet != null) options.quiet = args.quiet;
|
|
8133
|
+
if (args.relative != null) options.relative = args.relative;
|
|
8134
|
+
if (args.revert != null) options.revert = args.revert;
|
|
8135
|
+
if (args.stash != null) options.stash = args.stash;
|
|
8136
|
+
if (args.verbose != null) options.verbose = args.verbose;
|
|
8992
8137
|
let stagedConfig;
|
|
8993
8138
|
try {
|
|
8994
|
-
|
|
8995
|
-
stagedConfig = viteConfig.staged;
|
|
8139
|
+
stagedConfig = (await resolveViteConfig(args.cwd ?? process.cwd())).staged;
|
|
8996
8140
|
} catch (err) {
|
|
8997
|
-
|
|
8998
|
-
log(`Failed to load vite.config: ${message}`);
|
|
8141
|
+
log(`Failed to load vite.config: ${err instanceof Error ? err.message : String(err)}`);
|
|
8999
8142
|
process.exit(1);
|
|
9000
8143
|
}
|
|
9001
|
-
if (stagedConfig)
|
|
9002
|
-
|
|
9003
|
-
} else {
|
|
8144
|
+
if (stagedConfig) options.config = stagedConfig;
|
|
8145
|
+
else {
|
|
9004
8146
|
log("No \"staged\" config found in vite.config.ts. Please add a staged config:");
|
|
9005
8147
|
log("");
|
|
9006
8148
|
log(" // vite.config.ts");
|
|
@@ -9009,22 +8151,14 @@ if (args.help) {
|
|
|
9009
8151
|
log(" });");
|
|
9010
8152
|
process.exit(1);
|
|
9011
8153
|
}
|
|
9012
|
-
if (args.cwd != null)
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
if (args.diff != null) {
|
|
9016
|
-
options.diff = args.diff;
|
|
9017
|
-
}
|
|
9018
|
-
if (args["diff-filter"] != null) {
|
|
9019
|
-
options.diffFilter = args["diff-filter"];
|
|
9020
|
-
}
|
|
8154
|
+
if (args.cwd != null) options.cwd = args.cwd;
|
|
8155
|
+
if (args.diff != null) options.diff = args.diff;
|
|
8156
|
+
if (args["diff-filter"] != null) options.diffFilter = args["diff-filter"];
|
|
9021
8157
|
if (args.concurrent != null) {
|
|
9022
8158
|
const val = args.concurrent;
|
|
9023
|
-
if (val === "true")
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
options.concurrent = false;
|
|
9027
|
-
} else {
|
|
8159
|
+
if (val === "true") options.concurrent = true;
|
|
8160
|
+
else if (val === "false") options.concurrent = false;
|
|
8161
|
+
else {
|
|
9028
8162
|
const num = Number(val);
|
|
9029
8163
|
options.concurrent = Number.isNaN(num) || val === "" ? true : num;
|
|
9030
8164
|
}
|
|
@@ -9032,5 +8166,4 @@ if (args.help) {
|
|
|
9032
8166
|
const success = await lintStaged(options);
|
|
9033
8167
|
process.exit(success ? 0 : 1);
|
|
9034
8168
|
}
|
|
9035
|
-
|
|
9036
|
-
//#endregion
|
|
8169
|
+
//#endregion
|