@voidzero-dev/vite-plus-core 0.1.23 → 0.1.24

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.
@@ -1,1173 +0,0 @@
1
- import { r as __toESM, t as __commonJSMin } from "./chunk-DJK8HYOj.js";
2
- import { createRequire } from "node:module";
3
- import process$1, { cwd } from "node:process";
4
- import readline from "node:readline";
5
- import { isatty } from "node:tty";
6
- import { formatWithOptions, inspect } from "node:util";
7
- import { spawn } from "node:child_process";
8
- import { delimiter, dirname, resolve } from "node:path";
9
- import { pipeline } from "node:stream/promises";
10
- import { PassThrough } from "node:stream";
11
- //#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_e80978d33a319eb1e0c97ec71b684e94/node_modules/tsdown/dist/general-D3muxt2f.mjs
12
- const picomatch = createRequire(import.meta.url)("picomatch");
13
- function toArray(val, defaultValue) {
14
- if (Array.isArray(val)) return val;
15
- else if (val == null) {
16
- if (defaultValue) return [defaultValue];
17
- return [];
18
- } else return [val];
19
- }
20
- function resolveComma(arr) {
21
- return arr.flatMap((format) => format.split(","));
22
- }
23
- function resolveRegex(str) {
24
- if (typeof str === "string" && str.length > 2 && str[0] === "/" && str.at(-1) === "/") return new RegExp(str.slice(1, -1));
25
- return str;
26
- }
27
- function slash(string) {
28
- return string.replaceAll("\\", "/");
29
- }
30
- const noop = (v) => v;
31
- function matchPattern(id, patterns) {
32
- return patterns.some((pattern) => {
33
- if (pattern instanceof RegExp) {
34
- pattern.lastIndex = 0;
35
- return pattern.test(id);
36
- }
37
- return id === pattern || picomatch(pattern)(id);
38
- });
39
- }
40
- function pkgExists(moduleName) {
41
- try {
42
- import.meta.resolve(moduleName);
43
- return true;
44
- } catch {}
45
- return false;
46
- }
47
- async function importWithError(moduleName) {
48
- try {
49
- return await import(moduleName);
50
- } catch (error) {
51
- throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
52
- }
53
- }
54
- function promiseWithResolvers() {
55
- let resolve;
56
- return {
57
- promise: new Promise((res) => {
58
- resolve = res;
59
- }),
60
- resolve
61
- };
62
- }
63
- function debounce(fn, delay) {
64
- let timer;
65
- const debounced = (...args) => {
66
- clearTimeout(timer);
67
- timer = setTimeout(() => fn(...args), delay);
68
- };
69
- debounced.cancel = () => clearTimeout(timer);
70
- return debounced;
71
- }
72
- const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
73
- let e, t, r, { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object, i = "", { round: c, max: a } = Math, p = (e) => {
74
- let t = /([a-f\d]{3,6})/i.exec(e)?.[1], r = t?.length, l = parseInt(6 ^ r ? 3 ^ r ? "0" : t[0] + t[0] + t[1] + t[1] + t[2] + t[2] : t, 16);
75
- return [
76
- l >> 16 & 255,
77
- l >> 8 & 255,
78
- 255 & l
79
- ];
80
- }, u = (e, t, r) => e ^ t || t ^ r ? 16 + 36 * c(e / 51) + 6 * c(t / 51) + c(r / 51) : 8 > e ? 16 : e > 248 ? 231 : c(24 * (e - 8) / 247) + 232, d = (e) => {
81
- let t, r, l, n, o;
82
- return 8 > e ? 30 + e : 16 > e ? e - 8 + 90 : (232 > e ? (o = (e -= 16) % 36, t = (e / 36 | 0) / 5, r = (o / 6 | 0) / 5, l = o % 6 / 5) : t = r = l = (10 * (e - 232) + 8) / 255, n = 2 * a(t, r, l), n ? 30 + (c(l) << 2 | c(r) << 1 | c(t)) + (2 ^ n ? 0 : 60) : 30);
83
- }, f = (() => {
84
- let r = (e) => o.some(((t) => e.test(t))), l = globalThis, n = l.process ?? {}, o = n.argv ?? [], i = n.env ?? {}, c = -1;
85
- try {
86
- e = "," + s(i).join(",");
87
- } catch (e) {
88
- i = {}, c = 0;
89
- }
90
- let a = "FORCE_COLOR", p = {
91
- false: 0,
92
- 0: 0,
93
- 1: 1,
94
- 2: 2,
95
- 3: 3
96
- }[i[a]] ?? -1, u = a in i && p || r(/^--color=?(true|always)?$/);
97
- return u && (c = p), ~c || (c = ((r, l, n) => (t = r.TERM, {
98
- "24bit": 3,
99
- truecolor: 3,
100
- ansi256: 2,
101
- ansi: 1
102
- }[r.COLORTERM] || (r.CI ? /,GITHUB/.test(e) ? 3 : 1 : l && "dumb" !== t ? n ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i, !!i.PM2_HOME || i.NEXT_RUNTIME?.includes("edge") || !!n.stdout?.isTTY, "win32" === n.platform)), !p || i.NO_COLOR || r(/^--(no-color|color=(false|never))$/) ? 0 : l.window?.chrome || u && !c ? 3 : c;
103
- })(), g = {
104
- open: i,
105
- close: i
106
- }, h = 39, b = 49, O = {}, m = ({ p: e }, { open: t, close: l }) => {
107
- let o = (e, ...r) => {
108
- if (!e) {
109
- if (t && t === l) return t;
110
- if ((e ?? i) === i) return i;
111
- }
112
- let n, s = e.raw ? String.raw({ raw: e }, ...r) : i + e, c = o.p, a = c.o, p = c.c;
113
- if (s.includes("\x1B")) for (; c; c = c.p) {
114
- let { open: e, close: t } = c, r = t.length, l = i, o = 0;
115
- if (r) for (; ~(n = s.indexOf(t, o)); o = n + r) l += s.slice(o, n) + e;
116
- s = l + s.slice(o);
117
- }
118
- return a + (s.includes("\n") ? s.replace(/(\r?\n)/g, p + "$1" + a) : s) + p;
119
- }, s = t, c = l;
120
- return e && (s = e.o + t, c = l + e.c), n(o, r), o.p = {
121
- open: t,
122
- close: l,
123
- o: s,
124
- c,
125
- p: e
126
- }, o.open = s, o.close = c, o;
127
- };
128
- const w = new function e(t = f) {
129
- let s = {
130
- Ansis: e,
131
- level: t,
132
- isSupported: () => a,
133
- strip: (e) => e.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
134
- extend(e) {
135
- for (let t in e) {
136
- let r = e[t], l = (typeof r)[0];
137
- "s" === l ? (c(t, T(...p(r))), c(_(t), v(...p(r)))) : c(t, r, "f" === l);
138
- }
139
- return r = o({}, O), n(s, r), s;
140
- }
141
- }, c = (e, t, r) => {
142
- O[e] = { get() {
143
- let n = r ? (...e) => m(this, t(...e)) : m(this, t);
144
- return l(this, e, { value: n }), n;
145
- } };
146
- }, a = t > 0, w = (e, t) => a ? {
147
- open: `[${e}m`,
148
- close: `[${t}m`
149
- } : g, y = (e) => (t) => e(...p(t)), R = (e, t) => (r, l, n) => w(`${e}8;2;${r};${l};${n}`, t), $ = (e, t) => (r, l, n) => w(((e, t, r) => d(u(e, t, r)))(r, l, n) + e, t), x = (e) => (t, r, l) => e(u(t, r, l)), T = R(3, h), v = R(4, b), C = (e) => w("38;5;" + e, h), E = (e) => w("48;5;" + e, b);
150
- 2 === t ? (T = x(C), v = x(E)) : 1 === t && (T = $(0, h), v = $(10, b), C = (e) => w(d(e), h), E = (e) => w(d(e) + 10, b));
151
- let M, I = {
152
- fg: C,
153
- bg: E,
154
- rgb: T,
155
- bgRgb: v,
156
- hex: y(T),
157
- bgHex: y(v),
158
- visible: g,
159
- reset: w(0, 0),
160
- bold: w(1, 22),
161
- dim: w(2, 22),
162
- italic: w(3, 23),
163
- underline: w(4, 24),
164
- inverse: w(7, 27),
165
- hidden: w(8, 28),
166
- strikethrough: w(9, 29)
167
- }, _ = (e) => "bg" + e[0].toUpperCase() + e.slice(1), k = "Bright";
168
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e, t) => {
169
- M = _(e), 8 > t ? (I[e + k] = w(90 + t, h), I[M + k] = w(100 + t, b)) : t = 60, I[e] = w(30 + t, h), I[M] = w(40 + t, b);
170
- })), s.extend(I);
171
- }();
172
- module.exports = w, w.default = w;
173
- })))(), 1)).default;
174
- //#endregion
175
- //#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_e80978d33a319eb1e0c97ec71b684e94/node_modules/tsdown/dist/logger-uV8l1UFa.mjs
176
- const LogLevels = {
177
- silent: 0,
178
- error: 1,
179
- warn: 2,
180
- info: 3
181
- };
182
- function format(msgs) {
183
- return msgs.filter((arg) => arg !== void 0 && arg !== false).join(" ");
184
- }
185
- function clearScreen() {
186
- const repeatCount = process$1.stdout.rows - 2;
187
- const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
188
- console.info(blank);
189
- readline.cursorTo(process$1.stdout, 0, 0);
190
- readline.clearScreenDown(process$1.stdout);
191
- }
192
- const warnedMessages = /* @__PURE__ */ new Set();
193
- function createLogger(level = "info", options = {}) {
194
- const resolvedOptions = {
195
- allowClearScreen: true,
196
- failOnWarn: false,
197
- console: globalThis.console,
198
- ...options
199
- };
200
- const { allowClearScreen, console, customLogger, failOnWarn } = resolvedOptions;
201
- if (customLogger) return customLogger;
202
- function output(type, msg) {
203
- if (LogLevels[logger.level] < LogLevels[type]) return;
204
- console[type === "info" ? "log" : type](msg);
205
- }
206
- const clear = allowClearScreen && process$1.stdout.isTTY && !process$1.env.CI ? clearScreen : () => {};
207
- const logger = {
208
- level,
209
- options: resolvedOptions,
210
- info(...msgs) {
211
- output("info", `${blue`ℹ`} ${format(msgs)}`);
212
- },
213
- warn(...msgs) {
214
- if (failOnWarn) return this.error(...msgs);
215
- const message = format(msgs);
216
- warnedMessages.add(message);
217
- output("warn", `${bold(yellow`warn:`)} ${message}`);
218
- },
219
- warnOnce(...msgs) {
220
- const message = format(msgs);
221
- if (warnedMessages.has(message)) return;
222
- if (failOnWarn) return this.error(...msgs);
223
- warnedMessages.add(message);
224
- output("warn", `${bold(yellow`warn:`)} ${message}`);
225
- },
226
- error(...msgs) {
227
- output("error", `${bold(red`error:`)} ${format(msgs).replace(/^([A-Za-z]*Error):\s*/, "")}`);
228
- process$1.exitCode = 1;
229
- },
230
- success(...msgs) {
231
- output("info", `${green`✔`} ${format(msgs)}`);
232
- },
233
- clearScreen(type) {
234
- if (LogLevels[logger.level] >= LogLevels[type]) clear();
235
- }
236
- };
237
- return logger;
238
- }
239
- const globalLogger = createLogger();
240
- function getNameLabel(ansis, name) {
241
- if (!name) return void 0;
242
- return ansis(`[${name}]`);
243
- }
244
- function prettyFormat(format) {
245
- const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
246
- let formatText;
247
- switch (format) {
248
- case "es":
249
- formatText = "ESM";
250
- break;
251
- default:
252
- formatText = format.toUpperCase();
253
- break;
254
- }
255
- return formatColor(`[${formatText}]`);
256
- }
257
- const colors$1 = /* @__PURE__ */ new Map();
258
- function generateColor(name = "default") {
259
- if (colors$1.has(name)) return colors$1.get(name);
260
- let color;
261
- if (name === "default") color = blue;
262
- else {
263
- let hash = 0;
264
- for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash);
265
- color = rgb(...hslToRgb(hash % 360, 35, 55));
266
- }
267
- colors$1.set(name, color);
268
- return color;
269
- }
270
- function hslToRgb(h, s, l) {
271
- h = h % 360;
272
- h /= 360;
273
- s /= 100;
274
- l /= 100;
275
- let r, g, b;
276
- if (s === 0) r = g = b = l;
277
- else {
278
- const q = l < .5 ? l * (1 + s) : l + s - l * s;
279
- const p = 2 * l - q;
280
- r = hue2rgb(p, q, h + 1 / 3);
281
- g = hue2rgb(p, q, h);
282
- b = hue2rgb(p, q, h - 1 / 3);
283
- }
284
- return [
285
- Math.max(0, Math.round(r * 255)),
286
- Math.max(0, Math.round(g * 255)),
287
- Math.max(0, Math.round(b * 255))
288
- ];
289
- }
290
- function hue2rgb(p, q, t) {
291
- if (t < 0) t += 1;
292
- if (t > 1) t -= 1;
293
- if (t < 1 / 6) return p + (q - p) * 6 * t;
294
- if (t < 1 / 2) return q;
295
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
296
- return p;
297
- }
298
- //#endregion
299
- //#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_e80978d33a319eb1e0c97ec71b684e94/node_modules/tsdown/dist/package-Dzmmm_a2.mjs
300
- var version = "0.22.0";
301
- //#endregion
302
- //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
303
- function coerce(value) {
304
- if (value instanceof Error) return value.stack || value.message;
305
- return value;
306
- }
307
- function selectColor(colors, namespace) {
308
- let hash = 0;
309
- for (let i = 0; i < namespace.length; i++) {
310
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
311
- hash |= 0;
312
- }
313
- return colors[Math.abs(hash) % colors.length];
314
- }
315
- function matchesTemplate(search, template) {
316
- let searchIndex = 0;
317
- let templateIndex = 0;
318
- let starIndex = -1;
319
- let matchIndex = 0;
320
- while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
321
- starIndex = templateIndex;
322
- matchIndex = searchIndex;
323
- templateIndex++;
324
- } else {
325
- searchIndex++;
326
- templateIndex++;
327
- }
328
- else if (starIndex !== -1) {
329
- templateIndex = starIndex + 1;
330
- matchIndex++;
331
- searchIndex = matchIndex;
332
- } else return false;
333
- while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
334
- return templateIndex === template.length;
335
- }
336
- function humanize(value) {
337
- if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
338
- return `${value}ms`;
339
- }
340
- let globalNamespaces = "";
341
- function namespaces() {
342
- return globalNamespaces;
343
- }
344
- function createDebug$1(namespace, options) {
345
- let prevTime;
346
- let enableOverride;
347
- let namespacesCache;
348
- let enabledCache;
349
- const debug = (...args) => {
350
- if (!debug.enabled) return;
351
- const curr = Date.now();
352
- const diff = curr - (prevTime || curr);
353
- prevTime = curr;
354
- args[0] = coerce(args[0]);
355
- if (typeof args[0] !== "string") args.unshift("%O");
356
- let index = 0;
357
- args[0] = args[0].replace(/%([a-z%])/gi, (match, format) => {
358
- if (match === "%%") return "%";
359
- index++;
360
- const formatter = options.formatters[format];
361
- if (typeof formatter === "function") {
362
- const value = args[index];
363
- match = formatter.call(debug, value);
364
- args.splice(index, 1);
365
- index--;
366
- }
367
- return match;
368
- });
369
- options.formatArgs.call(debug, diff, args);
370
- debug.log(...args);
371
- };
372
- debug.extend = function(namespace$1, delimiter = ":") {
373
- return createDebug$1(this.namespace + delimiter + namespace$1, {
374
- useColors: this.useColors,
375
- color: this.color,
376
- formatArgs: this.formatArgs,
377
- formatters: this.formatters,
378
- inspectOpts: this.inspectOpts,
379
- log: this.log,
380
- humanize: this.humanize
381
- });
382
- };
383
- Object.assign(debug, options);
384
- debug.namespace = namespace;
385
- Object.defineProperty(debug, "enabled", {
386
- enumerable: true,
387
- configurable: false,
388
- get: () => {
389
- if (enableOverride != null) return enableOverride;
390
- if (namespacesCache !== globalNamespaces) {
391
- namespacesCache = globalNamespaces;
392
- enabledCache = enabled(namespace);
393
- }
394
- return enabledCache;
395
- },
396
- set: (v) => {
397
- enableOverride = v;
398
- }
399
- });
400
- return debug;
401
- }
402
- let names = [];
403
- let skips = [];
404
- function enable$1(namespaces$1) {
405
- globalNamespaces = namespaces$1;
406
- names = [];
407
- skips = [];
408
- const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
409
- for (const ns of split) if (ns[0] === "-") skips.push(ns.slice(1));
410
- else names.push(ns);
411
- }
412
- function enabled(name) {
413
- for (const skip of skips) if (matchesTemplate(name, skip)) return false;
414
- for (const ns of names) if (matchesTemplate(name, ns)) return true;
415
- return false;
416
- }
417
- //#endregion
418
- //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
419
- const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
420
- 20,
421
- 21,
422
- 26,
423
- 27,
424
- 32,
425
- 33,
426
- 38,
427
- 39,
428
- 40,
429
- 41,
430
- 42,
431
- 43,
432
- 44,
433
- 45,
434
- 56,
435
- 57,
436
- 62,
437
- 63,
438
- 68,
439
- 69,
440
- 74,
441
- 75,
442
- 76,
443
- 77,
444
- 78,
445
- 79,
446
- 80,
447
- 81,
448
- 92,
449
- 93,
450
- 98,
451
- 99,
452
- 112,
453
- 113,
454
- 128,
455
- 129,
456
- 134,
457
- 135,
458
- 148,
459
- 149,
460
- 160,
461
- 161,
462
- 162,
463
- 163,
464
- 164,
465
- 165,
466
- 166,
467
- 167,
468
- 168,
469
- 169,
470
- 170,
471
- 171,
472
- 172,
473
- 173,
474
- 178,
475
- 179,
476
- 184,
477
- 185,
478
- 196,
479
- 197,
480
- 198,
481
- 199,
482
- 200,
483
- 201,
484
- 202,
485
- 203,
486
- 204,
487
- 205,
488
- 206,
489
- 207,
490
- 208,
491
- 209,
492
- 214,
493
- 215,
494
- 220,
495
- 221
496
- ] : [
497
- 6,
498
- 2,
499
- 3,
500
- 4,
501
- 5,
502
- 1
503
- ];
504
- const inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => {
505
- const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase());
506
- let value = process.env[key];
507
- const lowerCase = typeof value === "string" && value.toLowerCase();
508
- if (value === "null") value = null;
509
- else if (lowerCase === "yes" || lowerCase === "on" || lowerCase === "true" || lowerCase === "enabled") value = true;
510
- else if (lowerCase === "no" || lowerCase === "off" || lowerCase === "false" || lowerCase === "disabled") value = false;
511
- else value = Number(value);
512
- obj[prop] = value;
513
- return obj;
514
- }, {});
515
- function useColors() {
516
- return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
517
- }
518
- function getDate() {
519
- if (inspectOpts.hideDate) return "";
520
- return `${(/* @__PURE__ */ new Date()).toISOString()} `;
521
- }
522
- function formatArgs(diff, args) {
523
- const { namespace: name, useColors: useColors$1 } = this;
524
- if (useColors$1) {
525
- const c = this.color;
526
- const colorCode = `\u001B[3${c < 8 ? c : `8;5;${c}`}`;
527
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
528
- args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
529
- args.push(`${colorCode}m+${this.humanize(diff)}\u001B[0m`);
530
- } else args[0] = `${getDate()}${name} ${args[0]}`;
531
- }
532
- function log(...args) {
533
- process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
534
- }
535
- const defaultOptions = {
536
- useColors: useColors(),
537
- formatArgs,
538
- formatters: {
539
- o(v) {
540
- this.inspectOpts.colors = this.useColors;
541
- return inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
542
- },
543
- O(v) {
544
- this.inspectOpts.colors = this.useColors;
545
- return inspect(v, this.inspectOpts);
546
- }
547
- },
548
- inspectOpts,
549
- log,
550
- humanize
551
- };
552
- function createDebug(namespace, options) {
553
- var _ref;
554
- const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
555
- return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
556
- }
557
- function save(namespaces$1) {
558
- if (namespaces$1) process.env.DEBUG = namespaces$1;
559
- else delete process.env.DEBUG;
560
- }
561
- function enable(namespaces$1) {
562
- save(namespaces$1);
563
- enable$1(namespaces$1);
564
- }
565
- enable$1(process.env.DEBUG || "");
566
- //#endregion
567
- //#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_e80978d33a319eb1e0c97ec71b684e94/node_modules/tsdown/dist/debug-CLlnG64L.mjs
568
- const debugLog = createDebug("tsdown:debug");
569
- function enableDebug(debug) {
570
- if (!debug) return;
571
- let namespace;
572
- if (debug === true) namespace = "tsdown:*";
573
- else namespace = resolveComma(toArray(debug)).map((v) => `tsdown:${v}`).join(",");
574
- const ns = namespaces();
575
- if (ns) namespace += `,${ns}`;
576
- enable(namespace);
577
- debugLog("Debugging enabled", namespace);
578
- }
579
- //#endregion
580
- //#region ../../node_modules/.pnpm/tinyexec@1.1.2/node_modules/tinyexec/dist/main.mjs
581
- var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
582
- var d = /* @__PURE__ */ createRequire(import.meta.url);
583
- const f = /^path$/i;
584
- const p = {
585
- key: "PATH",
586
- value: ""
587
- };
588
- function m(e) {
589
- for (const t in e) {
590
- if (!Object.prototype.hasOwnProperty.call(e, t) || !f.test(t)) continue;
591
- const n = e[t];
592
- if (!n) return p;
593
- return {
594
- key: t,
595
- value: n
596
- };
597
- }
598
- return p;
599
- }
600
- function h(e, t) {
601
- const n = t.value.split(delimiter);
602
- const r = [];
603
- let s = e;
604
- let c;
605
- do {
606
- r.push(resolve(s, "node_modules", ".bin"));
607
- c = s;
608
- s = dirname(s);
609
- } while (s !== c);
610
- r.push(dirname(process.execPath));
611
- const l = r.concat(n).join(delimiter);
612
- return {
613
- key: t.key,
614
- value: l
615
- };
616
- }
617
- function g(e, t) {
618
- const n = {
619
- ...process.env,
620
- ...t
621
- };
622
- const r = h(e, m(n));
623
- n[r.key] = r.value;
624
- return n;
625
- }
626
- const _ = (e) => {
627
- let t = e.length;
628
- const n = new PassThrough();
629
- const r = () => {
630
- if (--t === 0) n.end();
631
- };
632
- for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
633
- return n;
634
- };
635
- var v = /* @__PURE__ */ u(((e, t) => {
636
- t.exports = a;
637
- a.sync = o;
638
- var n = d("fs");
639
- function r(e, t) {
640
- var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
641
- if (!n) return true;
642
- n = n.split(";");
643
- if (n.indexOf("") !== -1) return true;
644
- for (var r = 0; r < n.length; r++) {
645
- var i = n[r].toLowerCase();
646
- if (i && e.substr(-i.length).toLowerCase() === i) return true;
647
- }
648
- return false;
649
- }
650
- function i(e, t, n) {
651
- if (!e.isSymbolicLink() && !e.isFile()) return false;
652
- return r(t, n);
653
- }
654
- function a(e, t, r) {
655
- n.stat(e, function(n, a) {
656
- r(n, n ? false : i(a, e, t));
657
- });
658
- }
659
- function o(e, t) {
660
- return i(n.statSync(e), e, t);
661
- }
662
- }));
663
- var y = /* @__PURE__ */ u(((e, t) => {
664
- t.exports = r;
665
- r.sync = i;
666
- var n = d("fs");
667
- function r(e, t, r) {
668
- n.stat(e, function(e, n) {
669
- r(e, e ? false : a(n, t));
670
- });
671
- }
672
- function i(e, t) {
673
- return a(n.statSync(e), t);
674
- }
675
- function a(e, t) {
676
- return e.isFile() && o(e, t);
677
- }
678
- function o(e, t) {
679
- var n = e.mode;
680
- var r = e.uid;
681
- var i = e.gid;
682
- var a = t.uid !== void 0 ? t.uid : process.getuid && process.getuid();
683
- var o = t.gid !== void 0 ? t.gid : process.getgid && process.getgid();
684
- var s = parseInt("100", 8);
685
- var c = parseInt("010", 8);
686
- var l = parseInt("001", 8);
687
- var u = s | c;
688
- return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
689
- }
690
- }));
691
- var b = /* @__PURE__ */ u(((e, t) => {
692
- d("fs");
693
- var n;
694
- if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
695
- else n = y();
696
- t.exports = r;
697
- r.sync = i;
698
- function r(e, t, i) {
699
- if (typeof t === "function") {
700
- i = t;
701
- t = {};
702
- }
703
- if (!i) {
704
- if (typeof Promise !== "function") throw new TypeError("callback not provided");
705
- return new Promise(function(n, i) {
706
- r(e, t || {}, function(e, t) {
707
- if (e) i(e);
708
- else n(t);
709
- });
710
- });
711
- }
712
- n(e, t || {}, function(e, n) {
713
- if (e) {
714
- if (e.code === "EACCES" || t && t.ignoreErrors) {
715
- e = null;
716
- n = false;
717
- }
718
- }
719
- i(e, n);
720
- });
721
- }
722
- function i(e, t) {
723
- try {
724
- return n.sync(e, t || {});
725
- } catch (e) {
726
- if (t && t.ignoreErrors || e.code === "EACCES") return false;
727
- else throw e;
728
- }
729
- }
730
- }));
731
- var x = /* @__PURE__ */ u(((e, t) => {
732
- const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
733
- const r = d("path");
734
- const i = n ? ";" : ":";
735
- const a = b();
736
- const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
737
- const s = (e, t) => {
738
- const r = t.colon || i;
739
- const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
740
- const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
741
- const s = n ? o.split(r) : [""];
742
- if (n) {
743
- if (e.indexOf(".") !== -1 && s[0] !== "") s.unshift("");
744
- }
745
- return {
746
- pathEnv: a,
747
- pathExt: s,
748
- pathExtExe: o
749
- };
750
- };
751
- const c = (e, t, n) => {
752
- if (typeof t === "function") {
753
- n = t;
754
- t = {};
755
- }
756
- if (!t) t = {};
757
- const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
758
- const u = [];
759
- const d = (n) => new Promise((a, s) => {
760
- if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
761
- const c = i[n];
762
- const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
763
- const d = r.join(l, e);
764
- a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
765
- });
766
- const f = (e, n, r) => new Promise((i, o) => {
767
- if (r === c.length) return i(d(n + 1));
768
- const s = c[r];
769
- a(e + s, { pathExt: l }, (a, o) => {
770
- if (!a && o) if (t.all) u.push(e + s);
771
- else return i(e + s);
772
- return i(f(e, n, r + 1));
773
- });
774
- });
775
- return n ? d(0).then((e) => n(null, e), n) : d(0);
776
- };
777
- const l = (e, t) => {
778
- t = t || {};
779
- const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
780
- const l = [];
781
- for (let o = 0; o < n.length; o++) {
782
- const s = n[o];
783
- const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
784
- const d = r.join(u, e);
785
- const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
786
- for (let e = 0; e < i.length; e++) {
787
- const n = f + i[e];
788
- try {
789
- if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
790
- else return n;
791
- } catch (e) {}
792
- }
793
- }
794
- if (t.all && l.length) return l;
795
- if (t.nothrow) return null;
796
- throw o(e);
797
- };
798
- t.exports = c;
799
- c.sync = l;
800
- }));
801
- var S = /* @__PURE__ */ u(((e, t) => {
802
- const n = (e = {}) => {
803
- const t = e.env || process.env;
804
- if ((e.platform || process.platform) !== "win32") return "PATH";
805
- return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
806
- };
807
- t.exports = n;
808
- t.exports.default = n;
809
- }));
810
- var C = /* @__PURE__ */ u(((e, t) => {
811
- const n = d("path");
812
- const r = x();
813
- const i = S();
814
- function a(e, t) {
815
- const a = e.options.env || process.env;
816
- const o = process.cwd();
817
- const s = e.options.cwd != null;
818
- const c = s && process.chdir !== void 0 && !process.chdir.disabled;
819
- if (c) try {
820
- process.chdir(e.options.cwd);
821
- } catch (e) {}
822
- let l;
823
- try {
824
- l = r.sync(e.command, {
825
- path: a[i({ env: a })],
826
- pathExt: t ? n.delimiter : void 0
827
- });
828
- } catch (e) {} finally {
829
- if (c) process.chdir(o);
830
- }
831
- if (l) l = n.resolve(s ? e.options.cwd : "", l);
832
- return l;
833
- }
834
- function o(e) {
835
- return a(e) || a(e, true);
836
- }
837
- t.exports = o;
838
- }));
839
- var w = /* @__PURE__ */ u(((e, t) => {
840
- const n = /([()\][%!^"`<>&|;, *?])/g;
841
- function r(e) {
842
- e = e.replace(n, "^$1");
843
- return e;
844
- }
845
- function i(e, t) {
846
- e = `${e}`;
847
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
848
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
849
- e = `"${e}"`;
850
- e = e.replace(n, "^$1");
851
- if (t) e = e.replace(n, "^$1");
852
- return e;
853
- }
854
- t.exports.command = r;
855
- t.exports.argument = i;
856
- }));
857
- var T = /* @__PURE__ */ u(((e, t) => {
858
- t.exports = /^#!(.*)/;
859
- }));
860
- var E = /* @__PURE__ */ u(((e, t) => {
861
- const n = T();
862
- t.exports = (e = "") => {
863
- const t = e.match(n);
864
- if (!t) return null;
865
- const [r, i] = t[0].replace(/#! ?/, "").split(" ");
866
- const a = r.split("/").pop();
867
- if (a === "env") return i;
868
- return i ? `${a} ${i}` : a;
869
- };
870
- }));
871
- var D = /* @__PURE__ */ u(((e, t) => {
872
- const n = d("fs");
873
- const r = E();
874
- function i(e) {
875
- const t = 150;
876
- const i = Buffer.alloc(t);
877
- let a;
878
- try {
879
- a = n.openSync(e, "r");
880
- n.readSync(a, i, 0, t, 0);
881
- n.closeSync(a);
882
- } catch (e) {}
883
- return r(i.toString());
884
- }
885
- t.exports = i;
886
- }));
887
- var O = /* @__PURE__ */ u(((e, t) => {
888
- const n = d("path");
889
- const r = C();
890
- const i = w();
891
- const a = D();
892
- const o = process.platform === "win32";
893
- const s = /\.(?:com|exe)$/i;
894
- const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
895
- function l(e) {
896
- e.file = r(e);
897
- const t = e.file && a(e.file);
898
- if (t) {
899
- e.args.unshift(e.file);
900
- e.command = t;
901
- return r(e);
902
- }
903
- return e.file;
904
- }
905
- function u(e) {
906
- if (!o) return e;
907
- const t = l(e);
908
- const r = !s.test(t);
909
- if (e.options.forceShell || r) {
910
- const r = c.test(t);
911
- e.command = n.normalize(e.command);
912
- e.command = i.command(e.command);
913
- e.args = e.args.map((e) => i.argument(e, r));
914
- e.args = [
915
- "/d",
916
- "/s",
917
- "/c",
918
- `"${[e.command].concat(e.args).join(" ")}"`
919
- ];
920
- e.command = process.env.comspec || "cmd.exe";
921
- e.options.windowsVerbatimArguments = true;
922
- }
923
- return e;
924
- }
925
- function f(e, t, n) {
926
- if (t && !Array.isArray(t)) {
927
- n = t;
928
- t = null;
929
- }
930
- t = t ? t.slice(0) : [];
931
- n = Object.assign({}, n);
932
- const r = {
933
- command: e,
934
- args: t,
935
- options: n,
936
- file: void 0,
937
- original: {
938
- command: e,
939
- args: t
940
- }
941
- };
942
- return n.shell ? r : u(r);
943
- }
944
- t.exports = f;
945
- }));
946
- var k = /* @__PURE__ */ u(((e, t) => {
947
- const n = process.platform === "win32";
948
- function r(e, t) {
949
- return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
950
- code: "ENOENT",
951
- errno: "ENOENT",
952
- syscall: `${t} ${e.command}`,
953
- path: e.command,
954
- spawnargs: e.args
955
- });
956
- }
957
- function i(e, t) {
958
- if (!n) return;
959
- const r = e.emit;
960
- e.emit = function(n, i) {
961
- if (n === "exit") {
962
- const n = a(i, t);
963
- if (n) return r.call(e, "error", n);
964
- }
965
- return r.apply(e, arguments);
966
- };
967
- }
968
- function a(e, t) {
969
- if (n && e === 1 && !t.file) return r(t.original, "spawn");
970
- return null;
971
- }
972
- function o(e, t) {
973
- if (n && e === 1 && !t.file) return r(t.original, "spawnSync");
974
- return null;
975
- }
976
- t.exports = {
977
- hookChildProcess: i,
978
- verifyENOENT: a,
979
- verifyENOENTSync: o,
980
- notFoundError: r
981
- };
982
- }));
983
- var j = (/* @__PURE__ */ u(((e, t) => {
984
- const n = d("child_process");
985
- const r = O();
986
- const i = k();
987
- function a(e, t, a) {
988
- const o = r(e, t, a);
989
- const s = n.spawn(o.command, o.args, o.options);
990
- i.hookChildProcess(s, o);
991
- return s;
992
- }
993
- function o(e, t, a) {
994
- const o = r(e, t, a);
995
- const s = n.spawnSync(o.command, o.args, o.options);
996
- s.error = s.error || i.verifyENOENTSync(s.status, o);
997
- return s;
998
- }
999
- t.exports = a;
1000
- t.exports.spawn = a;
1001
- t.exports.sync = o;
1002
- t.exports._parse = r;
1003
- t.exports._enoent = i;
1004
- })))();
1005
- var M = class extends Error {
1006
- get exitCode() {
1007
- if (this.result.exitCode !== null) return this.result.exitCode;
1008
- }
1009
- constructor(e, t) {
1010
- super(`Process exited with non-zero status (${e.exitCode})`);
1011
- this.result = e;
1012
- this.output = t;
1013
- }
1014
- };
1015
- const P = {
1016
- timeout: void 0,
1017
- persist: false
1018
- };
1019
- const I = { windowsHide: true };
1020
- function L(e) {
1021
- const t = new AbortController();
1022
- for (const n of e) {
1023
- if (n.aborted) {
1024
- t.abort();
1025
- return n;
1026
- }
1027
- const e = () => {
1028
- t.abort(n.reason);
1029
- };
1030
- n.addEventListener("abort", e, { signal: t.signal });
1031
- }
1032
- return t.signal;
1033
- }
1034
- async function R(e) {
1035
- let t = "";
1036
- try {
1037
- for await (const n of e) t += n.toString();
1038
- } catch {}
1039
- return t;
1040
- }
1041
- var z = class {
1042
- _process;
1043
- _aborted = false;
1044
- _options;
1045
- _command;
1046
- _args;
1047
- _resolveClose;
1048
- _processClosed;
1049
- _thrownError;
1050
- get process() {
1051
- return this._process;
1052
- }
1053
- get pid() {
1054
- return this._process?.pid;
1055
- }
1056
- get exitCode() {
1057
- if (this._process && this._process.exitCode !== null) return this._process.exitCode;
1058
- }
1059
- constructor(e, t, n) {
1060
- this._options = {
1061
- ...P,
1062
- ...n
1063
- };
1064
- this._command = e;
1065
- this._args = t ?? [];
1066
- this._processClosed = new Promise((e) => {
1067
- this._resolveClose = e;
1068
- });
1069
- }
1070
- kill(e) {
1071
- return this._process?.kill(e) === true;
1072
- }
1073
- get aborted() {
1074
- return this._aborted;
1075
- }
1076
- get killed() {
1077
- return this._process?.killed === true;
1078
- }
1079
- pipe(e, t, n) {
1080
- return H(e, t, {
1081
- ...n,
1082
- stdin: this
1083
- });
1084
- }
1085
- async *[Symbol.asyncIterator]() {
1086
- const e = this._process;
1087
- if (!e) return;
1088
- const t = [];
1089
- if (this._streamErr) t.push(this._streamErr);
1090
- if (this._streamOut) t.push(this._streamOut);
1091
- const n = _(t);
1092
- const r = readline.createInterface({ input: n });
1093
- for await (const e of r) yield e.toString();
1094
- await this._processClosed;
1095
- e.removeAllListeners();
1096
- if (this._thrownError) throw this._thrownError;
1097
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this);
1098
- }
1099
- async _waitForOutput() {
1100
- const e = this._process;
1101
- if (!e) throw new Error("No process was started");
1102
- const [t, n] = await Promise.all([this._streamOut ? R(this._streamOut) : "", this._streamErr ? R(this._streamErr) : ""]);
1103
- await this._processClosed;
1104
- const { stdin: r } = this._options;
1105
- if (r && typeof r !== "string") await r;
1106
- e.removeAllListeners();
1107
- if (this._thrownError) throw this._thrownError;
1108
- const i = {
1109
- stderr: n,
1110
- stdout: t,
1111
- exitCode: this.exitCode
1112
- };
1113
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this, i);
1114
- return i;
1115
- }
1116
- then(e, t) {
1117
- return this._waitForOutput().then(e, t);
1118
- }
1119
- _streamOut;
1120
- _streamErr;
1121
- spawn() {
1122
- const e = cwd();
1123
- const n = this._options;
1124
- const i = {
1125
- ...I,
1126
- ...n.nodeOptions
1127
- };
1128
- const a = [];
1129
- this._resetState();
1130
- if (n.timeout !== void 0) a.push(AbortSignal.timeout(n.timeout));
1131
- if (n.signal !== void 0) a.push(n.signal);
1132
- if (n.persist === true) i.detached = true;
1133
- if (a.length > 0) i.signal = L(a);
1134
- i.env = g(e, i.env);
1135
- const o = (0, j._parse)(this._command, this._args, i);
1136
- const s = spawn(o.command, o.args, o.options);
1137
- if (s.stderr) this._streamErr = s.stderr;
1138
- if (s.stdout) this._streamOut = s.stdout;
1139
- this._process = s;
1140
- s.once("error", this._onError);
1141
- s.once("close", this._onClose);
1142
- if (s.stdin) {
1143
- const { stdin: e } = n;
1144
- if (typeof e === "string") s.stdin.end(e);
1145
- else e?.process?.stdout?.pipe(s.stdin);
1146
- }
1147
- }
1148
- _resetState() {
1149
- this._aborted = false;
1150
- this._processClosed = new Promise((e) => {
1151
- this._resolveClose = e;
1152
- });
1153
- this._thrownError = void 0;
1154
- }
1155
- _onError = (e) => {
1156
- if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
1157
- this._aborted = true;
1158
- return;
1159
- }
1160
- this._thrownError = e;
1161
- };
1162
- _onClose = () => {
1163
- if (this._resolveClose) this._resolveClose();
1164
- };
1165
- };
1166
- const V = (e, t, n) => {
1167
- const r = new z(e, t, n);
1168
- r.spawn();
1169
- return r;
1170
- };
1171
- const H = V;
1172
- //#endregion
1173
- export { noop as C, resolveRegex as D, resolveComma as E, slash as O, matchPattern as S, promiseWithResolvers as T, red as _, version as a, debounce as b, generateColor as c, prettyFormat as d, blue as f, hex as g, green as h, createDebug as i, toArray as k, getNameLabel as l, dim as m, V as n, LogLevels as o, bold as p, enableDebug as r, createLogger as s, H as t, globalLogger as u, underline as v, pkgExists as w, importWithError as x, yellow as y };