@voidzero-dev/vite-plus-core 0.1.22 → 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.
- package/LICENSE +37 -26
- package/dist/pluginutils/filter/index.d.mts +194 -0
- package/dist/pluginutils/filter/index.mjs +2 -0
- package/dist/pluginutils/filter-B_mD-HGz.mjs +323 -0
- package/dist/pluginutils/index.d.mts +2 -0
- package/dist/pluginutils/index.mjs +2 -0
- package/dist/rolldown/cli.mjs +7 -7
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +3 -3
- package/dist/rolldown/experimental-index.d.mts +21 -4
- package/dist/rolldown/experimental-index.mjs +14 -9
- package/dist/rolldown/filter-index.d.mts +8 -9
- package/dist/rolldown/filter-index.mjs +2 -8
- package/dist/rolldown/get-log-filter.d.mts +3 -3
- package/dist/rolldown/index.d.mts +4 -4
- package/dist/rolldown/index.mjs +5 -5
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-zH1vcmbM.d.mts → binding-BaCZTfMx.d.mts} +32 -3
- package/dist/rolldown/shared/{binding-ESkOU1xr.mjs → binding-CXquf8ay.mjs} +27 -26
- package/dist/rolldown/shared/{bindingify-input-options-wZdDRbfo.mjs → bindingify-input-options-D2ORek5s.mjs} +14 -14
- package/dist/rolldown/shared/{constructors-D6i2Tbyl.mjs → constructors-BiPdtLBB.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-D0W3rNfA.d.mts → constructors-CbNaT434.d.mts} +2 -2
- package/dist/rolldown/shared/{define-config-5HJ1b9vG.d.mts → define-config-3BX_X2Am.d.mts} +70 -16
- package/dist/rolldown/shared/{error-BrnLyQ-g.mjs → error-BuvQYXuZ.mjs} +1 -1
- package/dist/rolldown/shared/{get-log-filter-semyr3Lj.d.mts → get-log-filter-BpNVNJ5-.d.mts} +1 -1
- package/dist/rolldown/shared/{load-config-BZFgt8GH.mjs → load-config-uvbpmLwO.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-dAjLOSbp.mjs → normalize-string-or-regex-CNPF6PU9.mjs} +2 -2
- package/dist/rolldown/shared/{parse-DFts7Hyl.mjs → parse-1VOPJ1Lj.mjs} +2 -2
- package/dist/rolldown/shared/{prompt-Bm9aMQjm.mjs → prompt-DV1XbtjC.mjs} +1 -1
- package/dist/rolldown/shared/{resolve-tsconfig-DCdBlPeK.mjs → resolve-tsconfig-CcfxWrib.mjs} +15 -4
- package/dist/rolldown/shared/{rolldown-Cs2eRf4R.mjs → rolldown-BZYLlfsv.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-CNhzgsn2.mjs → rolldown-build-CgMNHFY3.mjs} +54 -65
- package/dist/rolldown/shared/{transform-DgZ3paSD.d.mts → transform-7xCUVrpL.d.mts} +2 -2
- package/dist/rolldown/shared/{watch-De_8Tgeq.mjs → watch-BX_aH1Oh.mjs} +6 -6
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-5FURNVr0-D2dbyiC6.js → build-BZshaq8i-C7uS6x65.js} +1173 -93
- package/dist/tsdown/{detect-DN3DXXYt-8gmDjZqp.js → detect-B97OSl92-CgjrIbmD.js} +1 -1
- package/dist/tsdown/{dist-DTzJRoOQ.js → dist-BHLOKn-2.js} +526 -224
- package/dist/tsdown/index-types.d.ts +30 -12
- package/dist/tsdown/index.js +3 -4
- package/dist/tsdown/main-nVIFtu2j.js +938 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +11 -11
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +6 -6
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +2 -2
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +1 -1
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/{resolver-DkvdaW3s-BeVUoOo-.js → resolver-DtsKFXi2-QB-x8j3e.js} +1 -1
- package/dist/tsdown/run.js +5 -6
- package/dist/tsdown/{tsc-Dr9kCkDm.js → tsc-WMktM0FW.js} +3 -3
- package/dist/tsdown/{tsc-context-CANQEB9U.js → tsc-context-DKufFI_s.js} +2 -2
- package/dist/vite/client/client.mjs +61 -27
- package/dist/vite/node/chunks/build.js +21 -21
- package/dist/vite/node/chunks/dist.js +1 -1
- package/dist/vite/node/chunks/dist2.js +136 -110
- package/dist/vite/node/chunks/lib.js +1 -1
- package/dist/vite/node/chunks/logger.js +36 -3
- package/dist/vite/node/chunks/node.js +490 -277
- package/dist/vite/node/chunks/postcss-import.js +11 -11
- package/dist/vite/node/cli.js +1 -2
- package/dist/vite/node/index.d.ts +29 -14
- package/dist/vite/node/module-runner.d.ts +1 -2
- package/dist/vite/node/module-runner.js +19 -18
- package/dist/vite/types/customEvent.d.ts +1 -1
- package/package.json +17 -23
- package/dist/pluginutils/filter/composable-filters.d.ts +0 -90
- package/dist/pluginutils/filter/composable-filters.js +0 -256
- package/dist/pluginutils/filter/filter-vite-plugins.d.ts +0 -28
- package/dist/pluginutils/filter/filter-vite-plugins.js +0 -75
- package/dist/pluginutils/filter/index.d.ts +0 -3
- package/dist/pluginutils/filter/index.js +0 -3
- package/dist/pluginutils/filter/simple-filters.d.ts +0 -71
- package/dist/pluginutils/filter/simple-filters.js +0 -70
- package/dist/pluginutils/index.d.ts +0 -1
- package/dist/pluginutils/index.js +0 -1
- package/dist/pluginutils/utils.d.ts +0 -2
- package/dist/pluginutils/utils.js +0 -17
- package/dist/tsdown/chunk-N93fKeF6.js +0 -34
- package/dist/tsdown/debug-CLlnG64L-BkAqwHVS.js +0 -16
- package/dist/tsdown/dist-Cv2Z0Bi_.js +0 -1012
- package/dist/tsdown/filename-DQnUJlio-D7-CzKqs.js +0 -29
- package/dist/tsdown/main-BNUO6D3N.js +0 -893
- package/dist/tsdown/node-B3Gdtau1.js +0 -268
- package/dist/vite/node/chunks/chunk.js +0 -35
- /package/dist/rolldown/shared/{define-config-DJOr6Iwt.mjs → define-config-Demdg3_4.mjs} +0 -0
- /package/dist/rolldown/shared/{logging-C6h4g8dA.d.mts → logging-BSNejiLS.d.mts} +0 -0
- /package/dist/rolldown/shared/{logs-D80CXhvg.mjs → logs-aMKUxRpj.mjs} +0 -0
- /package/dist/rolldown/shared/{misc-DJYbNKZX.mjs → misc-CoQm4NHO.mjs} +0 -0
- /package/dist/tsdown/{dist-JaOach5K.js → dist-CZtGyfn3.js} +0 -0
|
@@ -0,0 +1,938 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import process$1, { cwd } from "node:process";
|
|
3
|
+
import readline from "node:readline";
|
|
4
|
+
import { isatty } from "node:tty";
|
|
5
|
+
import { formatWithOptions, inspect } from "node:util";
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import { basename, delimiter, dirname, normalize, resolve } from "node:path";
|
|
8
|
+
import { pipeline } from "node:stream/promises";
|
|
9
|
+
import { PassThrough } from "node:stream";
|
|
10
|
+
import { closeSync, openSync, readSync, statSync } from "node:fs";
|
|
11
|
+
//#region \0rolldown/runtime.js
|
|
12
|
+
var __create = Object.create;
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
19
|
+
var __exportAll = (all, no_symbols) => {
|
|
20
|
+
let target = {};
|
|
21
|
+
for (var name in all) __defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true
|
|
24
|
+
});
|
|
25
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
26
|
+
return target;
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
30
|
+
key = keys[i];
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
32
|
+
get: ((k) => from[k]).bind(null, key),
|
|
33
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return to;
|
|
37
|
+
};
|
|
38
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
39
|
+
value: mod,
|
|
40
|
+
enumerable: true
|
|
41
|
+
}) : target, mod));
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/general-Cp4NiJNK.mjs
|
|
44
|
+
const picomatch = createRequire(import.meta.url)("./npm_entry_picomatch.cjs");
|
|
45
|
+
function toArray(val, defaultValue) {
|
|
46
|
+
if (Array.isArray(val)) return val;
|
|
47
|
+
else if (val == null) {
|
|
48
|
+
if (defaultValue) return [defaultValue];
|
|
49
|
+
return [];
|
|
50
|
+
} else return [val];
|
|
51
|
+
}
|
|
52
|
+
function resolveComma(arr) {
|
|
53
|
+
return arr.flatMap((format) => format.split(","));
|
|
54
|
+
}
|
|
55
|
+
function resolveRegex(str) {
|
|
56
|
+
if (typeof str === "string" && str.length > 2 && str[0] === "/" && str.at(-1) === "/") return new RegExp(str.slice(1, -1));
|
|
57
|
+
return str;
|
|
58
|
+
}
|
|
59
|
+
function slash(string) {
|
|
60
|
+
return string.replaceAll("\\", "/");
|
|
61
|
+
}
|
|
62
|
+
const noop = (v) => v;
|
|
63
|
+
function matchPattern(id, patterns) {
|
|
64
|
+
return patterns.some((pattern) => {
|
|
65
|
+
if (pattern instanceof RegExp) {
|
|
66
|
+
pattern.lastIndex = 0;
|
|
67
|
+
return pattern.test(id);
|
|
68
|
+
}
|
|
69
|
+
return id === pattern || picomatch(pattern)(id);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function pkgExists(moduleName) {
|
|
73
|
+
try {
|
|
74
|
+
import.meta.resolve(moduleName);
|
|
75
|
+
return true;
|
|
76
|
+
} catch {}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
async function importWithError(moduleName) {
|
|
80
|
+
try {
|
|
81
|
+
return await import(moduleName);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function promiseWithResolvers() {
|
|
87
|
+
let resolve;
|
|
88
|
+
return {
|
|
89
|
+
promise: new Promise((res) => {
|
|
90
|
+
resolve = res;
|
|
91
|
+
}),
|
|
92
|
+
resolve
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function debounce(fn, delay) {
|
|
96
|
+
let timer;
|
|
97
|
+
const debounced = (...args) => {
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
timer = setTimeout(() => fn(...args), delay);
|
|
100
|
+
};
|
|
101
|
+
debounced.cancel = () => clearTimeout(timer);
|
|
102
|
+
return debounced;
|
|
103
|
+
}
|
|
104
|
+
const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, link, 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) => {
|
|
105
|
+
let e, r, { defineProperty: t, setPrototypeOf: n, create: l, keys: o } = Object, i = "", { round: s, max: f } = Math, u = (e) => {
|
|
106
|
+
let r = /([a-f\d]{3,6})/i.exec(e)?.[1], t = r?.length, n = parseInt(6 ^ t ? 3 ^ t ? "0" : r[0] + r[0] + r[1] + r[1] + r[2] + r[2] : r, 16);
|
|
107
|
+
return [
|
|
108
|
+
n >> 16 & 255,
|
|
109
|
+
n >> 8 & 255,
|
|
110
|
+
255 & n
|
|
111
|
+
];
|
|
112
|
+
}, a = (e, r, t) => e ^ r || r ^ t ? 16 + 36 * s(e / 51) + 6 * s(r / 51) + s(t / 51) : 8 > e ? 16 : e > 248 ? 231 : s(24 * (e - 8) / 247) + 232, c = (e) => {
|
|
113
|
+
let r, t, n, l, o;
|
|
114
|
+
return 8 > e ? 30 + e : 16 > e ? 82 + e : (232 > e ? (o = (e -= 16) % 36, r = (e / 36 | 0) / 5, t = (o / 6 | 0) / 5, n = o % 6 / 5) : r = t = n = (10 * (e - 232) + 8) / 255, l = 2 * f(r, t, n), l ? 30 + (s(n) << 2 | s(t) << 1 | s(r)) + (2 ^ l ? 0 : 60) : 30);
|
|
115
|
+
}, g = {
|
|
116
|
+
open: i,
|
|
117
|
+
close: i
|
|
118
|
+
}, b = 39, d = 49, p = {}, $ = ({ p: e }, { open: t = "", close: l = "", f: o }) => {
|
|
119
|
+
let s = (e, ...r) => {
|
|
120
|
+
if (!e) {
|
|
121
|
+
if (t && t === l) return t;
|
|
122
|
+
if ((e ?? i) === i) return i;
|
|
123
|
+
}
|
|
124
|
+
let n, f = s.p, u = f.o, a = f.c, c = o ? o(e, ...r) : e.raw ? String.raw({ raw: e }, ...r) : i + e;
|
|
125
|
+
if (c.includes("\x1B")) for (; f; f = f.p) {
|
|
126
|
+
let { t: e, l: r } = f, t = r.length, l = i, o = 0;
|
|
127
|
+
if (t) for (; ~(n = c.indexOf(r, o)); o = n + t) l += c.slice(o, n) + e;
|
|
128
|
+
c = l + c.slice(o);
|
|
129
|
+
}
|
|
130
|
+
return u + (c.includes("\n") ? c.replace(/(\r?\n)/g, a + "$1" + u) : c) + a;
|
|
131
|
+
}, f = t, u = l;
|
|
132
|
+
return e && (f = e.o + t, u = l + e.c), n(s, r), s.p = {
|
|
133
|
+
t,
|
|
134
|
+
l,
|
|
135
|
+
o: s.open = f,
|
|
136
|
+
c: s.close = u,
|
|
137
|
+
p: e
|
|
138
|
+
}, s;
|
|
139
|
+
};
|
|
140
|
+
const h = new function s(f = globalThis) {
|
|
141
|
+
let h, y, m = "number" == typeof f ? f : ((r) => {
|
|
142
|
+
let t = r.process ?? {}, n = t.argv ?? [], l = t.env ?? {}, i = 0;
|
|
143
|
+
try {
|
|
144
|
+
i = ((r, t, n) => (e = t.TERM, {
|
|
145
|
+
"24bit": 3,
|
|
146
|
+
truecolor: 3,
|
|
147
|
+
ansi256: 2,
|
|
148
|
+
ansi: 1
|
|
149
|
+
}[t.COLORTERM] || (t.CI ? /,GITHUB/.test(n) ? 3 : 1 : (t.PM2_HOME || /edge/.test(t.NEXT_RUNTIME) || r.stdout?.isTTY) && "dumb" !== e ? "win32" === r.platform ? 3 : /-256/.test(e) ? 2 : 1 : 0)))(t, l, "," + o(l).join(","));
|
|
150
|
+
} catch (e) {
|
|
151
|
+
l = {};
|
|
152
|
+
}
|
|
153
|
+
let s, f = i || 1, u = "FORCE_COLOR", a = {
|
|
154
|
+
false: 0,
|
|
155
|
+
0: 0,
|
|
156
|
+
1: 1,
|
|
157
|
+
2: 2,
|
|
158
|
+
3: 3
|
|
159
|
+
}[l[u]] ?? f, c = -1;
|
|
160
|
+
for (s of n) /^--color=?(true|always)?$/.test(s) && (c = f), /^--(no-color|color=(false|never))$/.test(s) && (c = 0);
|
|
161
|
+
return r.window?.chrome ? 3 : u in l ? a : ~c ? c : l.NO_COLOR ? 0 : i;
|
|
162
|
+
})(f), w = {
|
|
163
|
+
Ansis: s,
|
|
164
|
+
level: m,
|
|
165
|
+
isSupported: () => v,
|
|
166
|
+
strip: (e) => e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
|
|
167
|
+
extend(e) {
|
|
168
|
+
for (let r in e) {
|
|
169
|
+
let t = e[r], n = (typeof t)[0];
|
|
170
|
+
"s" === n && (O(B(r), I(...u(t))), t = H(...u(t))), O(r, t, "f" === n);
|
|
171
|
+
}
|
|
172
|
+
return n(w, r = l({}, p)), w;
|
|
173
|
+
}
|
|
174
|
+
}, O = (e, r, n) => {
|
|
175
|
+
p[e] = { get() {
|
|
176
|
+
let l = n ? (...e) => $(this, r(...e)) : $(this, r);
|
|
177
|
+
return t(this, e, { value: l }), l;
|
|
178
|
+
} };
|
|
179
|
+
}, v = m > 0, _ = (e, r) => v ? {
|
|
180
|
+
open: `[${e}m`,
|
|
181
|
+
close: `[${r}m`
|
|
182
|
+
} : g, k = (e) => (r) => e(...u(r)), x = (e, r) => (t, n, l) => _(`${e}8;2;${t};${n};${l}`, r), R = (e) => (r, t, n) => e(a(r, t, n)), A = (e, r) => (t, n, l) => _(c(a(t, n, l)) + e, r), B = (e) => "bg" + e[0].toUpperCase() + e.slice(1), C = "Bright", H = x(3, b), I = x(4, d), P = (e) => _("38;5;" + e, b), S = (e) => _("48;5;" + e, d);
|
|
183
|
+
return 2 === m ? (H = R(P), I = R(S)) : 1 === m && (H = A(0, b), I = A(10, d), P = (e) => _(c(e), b), S = (e) => _(c(e) + 10, d)), y = {
|
|
184
|
+
fg: P,
|
|
185
|
+
bg: S,
|
|
186
|
+
rgb: H,
|
|
187
|
+
bgRgb: I,
|
|
188
|
+
hex: k(H),
|
|
189
|
+
bgHex: k(I),
|
|
190
|
+
visible: g,
|
|
191
|
+
reset: _(0, 0),
|
|
192
|
+
bold: _(1, 22),
|
|
193
|
+
dim: _(2, 22),
|
|
194
|
+
italic: _(3, 23),
|
|
195
|
+
underline: _(4, 24),
|
|
196
|
+
inverse: _(7, 27),
|
|
197
|
+
hidden: _(8, 28),
|
|
198
|
+
strikethrough: _(9, 29),
|
|
199
|
+
link: { f: (e, r = e) => v ? `]8;;${e}${r}]8;;` : r != e ? `${r} (${e})` : e }
|
|
200
|
+
}, "gray,black,red,green,yellow,blue,magenta,cyan,white".split(",").map(((e, r) => {
|
|
201
|
+
h = B(e), r ? (y[e + C] = _(89 + r, b), y[h + C] = _(99 + r, d)) : r = 61, y[e] = _(29 + r, b), y[h] = _(39 + r, d);
|
|
202
|
+
})), w.extend(y);
|
|
203
|
+
}();
|
|
204
|
+
module.exports = h.default = h;
|
|
205
|
+
})))(), 1)).default;
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/logger-BxuhTmAE.mjs
|
|
208
|
+
const LogLevels = {
|
|
209
|
+
silent: 0,
|
|
210
|
+
error: 1,
|
|
211
|
+
warn: 2,
|
|
212
|
+
info: 3
|
|
213
|
+
};
|
|
214
|
+
function format(msgs) {
|
|
215
|
+
return msgs.filter((arg) => arg !== void 0 && arg !== false).join(" ");
|
|
216
|
+
}
|
|
217
|
+
function clearScreen() {
|
|
218
|
+
const repeatCount = process$1.stdout.rows - 2;
|
|
219
|
+
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
|
|
220
|
+
console.info(blank);
|
|
221
|
+
readline.cursorTo(process$1.stdout, 0, 0);
|
|
222
|
+
readline.clearScreenDown(process$1.stdout);
|
|
223
|
+
}
|
|
224
|
+
const warnedMessages = /* @__PURE__ */ new Set();
|
|
225
|
+
function createLogger(level = "info", options = {}) {
|
|
226
|
+
const resolvedOptions = {
|
|
227
|
+
allowClearScreen: true,
|
|
228
|
+
failOnWarn: false,
|
|
229
|
+
console: globalThis.console,
|
|
230
|
+
...options
|
|
231
|
+
};
|
|
232
|
+
const { allowClearScreen, console, customLogger, failOnWarn } = resolvedOptions;
|
|
233
|
+
if (customLogger) return customLogger;
|
|
234
|
+
function output(type, msg) {
|
|
235
|
+
if (LogLevels[logger.level] < LogLevels[type]) return;
|
|
236
|
+
console[type === "info" ? "log" : type](msg);
|
|
237
|
+
}
|
|
238
|
+
const clear = allowClearScreen && process$1.stdout.isTTY && !process$1.env.CI ? clearScreen : () => {};
|
|
239
|
+
const isWindowsTerminal = !!process$1.env.WT_SESSION;
|
|
240
|
+
const emojiDivier = " ".repeat(isWindowsTerminal ? 2 : 1);
|
|
241
|
+
const logger = {
|
|
242
|
+
level,
|
|
243
|
+
options: resolvedOptions,
|
|
244
|
+
info(...msgs) {
|
|
245
|
+
output("info", `${blue`ℹ`}${emojiDivier}${format(msgs)}`);
|
|
246
|
+
},
|
|
247
|
+
warn(...msgs) {
|
|
248
|
+
if (failOnWarn) return this.error(...msgs);
|
|
249
|
+
const message = format(msgs);
|
|
250
|
+
warnedMessages.add(message);
|
|
251
|
+
output("warn", `${bold(yellow`warn:`)} ${message}`);
|
|
252
|
+
},
|
|
253
|
+
warnOnce(...msgs) {
|
|
254
|
+
const message = format(msgs);
|
|
255
|
+
if (failOnWarn) return this.error(...msgs);
|
|
256
|
+
if (warnedMessages.has(message)) return;
|
|
257
|
+
warnedMessages.add(message);
|
|
258
|
+
output("warn", `${bold(yellow`warn:`)} ${message}`);
|
|
259
|
+
},
|
|
260
|
+
error(...msgs) {
|
|
261
|
+
output("error", `${bold(red`error:`)} ${format(msgs).replace(/^([A-Za-z]*Error):\s*/, "")}`);
|
|
262
|
+
process$1.exitCode = 1;
|
|
263
|
+
},
|
|
264
|
+
success(...msgs) {
|
|
265
|
+
output("info", `${green`✔`}${emojiDivier}${format(msgs)}`);
|
|
266
|
+
},
|
|
267
|
+
clearScreen(type) {
|
|
268
|
+
if (LogLevels[logger.level] >= LogLevels[type]) clear();
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
return logger;
|
|
272
|
+
}
|
|
273
|
+
const globalLogger = createLogger();
|
|
274
|
+
function getNameLabel(ansis, name) {
|
|
275
|
+
if (!name) return void 0;
|
|
276
|
+
return ansis(`[${name}]`);
|
|
277
|
+
}
|
|
278
|
+
function prettyFormat(format) {
|
|
279
|
+
const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
|
|
280
|
+
let formatText;
|
|
281
|
+
switch (format) {
|
|
282
|
+
case "es":
|
|
283
|
+
formatText = "ESM";
|
|
284
|
+
break;
|
|
285
|
+
default:
|
|
286
|
+
formatText = format.toUpperCase();
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
return formatColor(`[${formatText}]`);
|
|
290
|
+
}
|
|
291
|
+
const colors$1 = /* @__PURE__ */ new Map();
|
|
292
|
+
function generateColor(name = "default") {
|
|
293
|
+
if (colors$1.has(name)) return colors$1.get(name);
|
|
294
|
+
let color;
|
|
295
|
+
if (name === "default") color = blue;
|
|
296
|
+
else {
|
|
297
|
+
let hash = 0;
|
|
298
|
+
for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
299
|
+
color = rgb(...hslToRgb(hash % 360, 35, 55));
|
|
300
|
+
}
|
|
301
|
+
colors$1.set(name, color);
|
|
302
|
+
return color;
|
|
303
|
+
}
|
|
304
|
+
function hslToRgb(h, s, l) {
|
|
305
|
+
h = h % 360;
|
|
306
|
+
h /= 360;
|
|
307
|
+
s /= 100;
|
|
308
|
+
l /= 100;
|
|
309
|
+
let r, g, b;
|
|
310
|
+
if (s === 0) r = g = b = l;
|
|
311
|
+
else {
|
|
312
|
+
const q = l < .5 ? l * (1 + s) : l + s - l * s;
|
|
313
|
+
const p = 2 * l - q;
|
|
314
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
315
|
+
g = hue2rgb(p, q, h);
|
|
316
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
317
|
+
}
|
|
318
|
+
return [
|
|
319
|
+
Math.max(0, Math.round(r * 255)),
|
|
320
|
+
Math.max(0, Math.round(g * 255)),
|
|
321
|
+
Math.max(0, Math.round(b * 255))
|
|
322
|
+
];
|
|
323
|
+
}
|
|
324
|
+
function hue2rgb(p, q, t) {
|
|
325
|
+
if (t < 0) t += 1;
|
|
326
|
+
if (t > 1) t -= 1;
|
|
327
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
328
|
+
if (t < 1 / 2) return q;
|
|
329
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
330
|
+
return p;
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
|
|
334
|
+
function coerce(value) {
|
|
335
|
+
if (value instanceof Error) return value.stack || value.message;
|
|
336
|
+
return value;
|
|
337
|
+
}
|
|
338
|
+
function selectColor(colors, namespace) {
|
|
339
|
+
let hash = 0;
|
|
340
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
341
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
342
|
+
hash |= 0;
|
|
343
|
+
}
|
|
344
|
+
return colors[Math.abs(hash) % colors.length];
|
|
345
|
+
}
|
|
346
|
+
function matchesTemplate(search, template) {
|
|
347
|
+
let searchIndex = 0;
|
|
348
|
+
let templateIndex = 0;
|
|
349
|
+
let starIndex = -1;
|
|
350
|
+
let matchIndex = 0;
|
|
351
|
+
while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
|
|
352
|
+
starIndex = templateIndex;
|
|
353
|
+
matchIndex = searchIndex;
|
|
354
|
+
templateIndex++;
|
|
355
|
+
} else {
|
|
356
|
+
searchIndex++;
|
|
357
|
+
templateIndex++;
|
|
358
|
+
}
|
|
359
|
+
else if (starIndex !== -1) {
|
|
360
|
+
templateIndex = starIndex + 1;
|
|
361
|
+
matchIndex++;
|
|
362
|
+
searchIndex = matchIndex;
|
|
363
|
+
} else return false;
|
|
364
|
+
while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
|
|
365
|
+
return templateIndex === template.length;
|
|
366
|
+
}
|
|
367
|
+
function humanize(value) {
|
|
368
|
+
if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
|
|
369
|
+
return `${value}ms`;
|
|
370
|
+
}
|
|
371
|
+
let globalNamespaces = "";
|
|
372
|
+
function namespaces() {
|
|
373
|
+
return globalNamespaces;
|
|
374
|
+
}
|
|
375
|
+
function createDebug$1(namespace, options) {
|
|
376
|
+
let prevTime;
|
|
377
|
+
let enableOverride;
|
|
378
|
+
let namespacesCache;
|
|
379
|
+
let enabledCache;
|
|
380
|
+
const debug = (...args) => {
|
|
381
|
+
if (!debug.enabled) return;
|
|
382
|
+
const curr = Date.now();
|
|
383
|
+
const diff = curr - (prevTime || curr);
|
|
384
|
+
prevTime = curr;
|
|
385
|
+
args[0] = coerce(args[0]);
|
|
386
|
+
if (typeof args[0] !== "string") args.unshift("%O");
|
|
387
|
+
let index = 0;
|
|
388
|
+
args[0] = args[0].replace(/%([a-z%])/gi, (match, format) => {
|
|
389
|
+
if (match === "%%") return "%";
|
|
390
|
+
index++;
|
|
391
|
+
const formatter = options.formatters[format];
|
|
392
|
+
if (typeof formatter === "function") {
|
|
393
|
+
const value = args[index];
|
|
394
|
+
match = formatter.call(debug, value);
|
|
395
|
+
args.splice(index, 1);
|
|
396
|
+
index--;
|
|
397
|
+
}
|
|
398
|
+
return match;
|
|
399
|
+
});
|
|
400
|
+
options.formatArgs.call(debug, diff, args);
|
|
401
|
+
debug.log(...args);
|
|
402
|
+
};
|
|
403
|
+
debug.extend = function(namespace$1, delimiter = ":") {
|
|
404
|
+
return createDebug$1(this.namespace + delimiter + namespace$1, {
|
|
405
|
+
useColors: this.useColors,
|
|
406
|
+
color: this.color,
|
|
407
|
+
formatArgs: this.formatArgs,
|
|
408
|
+
formatters: this.formatters,
|
|
409
|
+
inspectOpts: this.inspectOpts,
|
|
410
|
+
log: this.log,
|
|
411
|
+
humanize: this.humanize
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
Object.assign(debug, options);
|
|
415
|
+
debug.namespace = namespace;
|
|
416
|
+
Object.defineProperty(debug, "enabled", {
|
|
417
|
+
enumerable: true,
|
|
418
|
+
configurable: false,
|
|
419
|
+
get: () => {
|
|
420
|
+
if (enableOverride != null) return enableOverride;
|
|
421
|
+
if (namespacesCache !== globalNamespaces) {
|
|
422
|
+
namespacesCache = globalNamespaces;
|
|
423
|
+
enabledCache = enabled(namespace);
|
|
424
|
+
}
|
|
425
|
+
return enabledCache;
|
|
426
|
+
},
|
|
427
|
+
set: (v) => {
|
|
428
|
+
enableOverride = v;
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
return debug;
|
|
432
|
+
}
|
|
433
|
+
let names = [];
|
|
434
|
+
let skips = [];
|
|
435
|
+
function enable$1(namespaces$1) {
|
|
436
|
+
globalNamespaces = namespaces$1;
|
|
437
|
+
names = [];
|
|
438
|
+
skips = [];
|
|
439
|
+
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
440
|
+
for (const ns of split) if (ns[0] === "-") skips.push(ns.slice(1));
|
|
441
|
+
else names.push(ns);
|
|
442
|
+
}
|
|
443
|
+
function enabled(name) {
|
|
444
|
+
for (const skip of skips) if (matchesTemplate(name, skip)) return false;
|
|
445
|
+
for (const ns of names) if (matchesTemplate(name, ns)) return true;
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
|
|
450
|
+
const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
|
|
451
|
+
20,
|
|
452
|
+
21,
|
|
453
|
+
26,
|
|
454
|
+
27,
|
|
455
|
+
32,
|
|
456
|
+
33,
|
|
457
|
+
38,
|
|
458
|
+
39,
|
|
459
|
+
40,
|
|
460
|
+
41,
|
|
461
|
+
42,
|
|
462
|
+
43,
|
|
463
|
+
44,
|
|
464
|
+
45,
|
|
465
|
+
56,
|
|
466
|
+
57,
|
|
467
|
+
62,
|
|
468
|
+
63,
|
|
469
|
+
68,
|
|
470
|
+
69,
|
|
471
|
+
74,
|
|
472
|
+
75,
|
|
473
|
+
76,
|
|
474
|
+
77,
|
|
475
|
+
78,
|
|
476
|
+
79,
|
|
477
|
+
80,
|
|
478
|
+
81,
|
|
479
|
+
92,
|
|
480
|
+
93,
|
|
481
|
+
98,
|
|
482
|
+
99,
|
|
483
|
+
112,
|
|
484
|
+
113,
|
|
485
|
+
128,
|
|
486
|
+
129,
|
|
487
|
+
134,
|
|
488
|
+
135,
|
|
489
|
+
148,
|
|
490
|
+
149,
|
|
491
|
+
160,
|
|
492
|
+
161,
|
|
493
|
+
162,
|
|
494
|
+
163,
|
|
495
|
+
164,
|
|
496
|
+
165,
|
|
497
|
+
166,
|
|
498
|
+
167,
|
|
499
|
+
168,
|
|
500
|
+
169,
|
|
501
|
+
170,
|
|
502
|
+
171,
|
|
503
|
+
172,
|
|
504
|
+
173,
|
|
505
|
+
178,
|
|
506
|
+
179,
|
|
507
|
+
184,
|
|
508
|
+
185,
|
|
509
|
+
196,
|
|
510
|
+
197,
|
|
511
|
+
198,
|
|
512
|
+
199,
|
|
513
|
+
200,
|
|
514
|
+
201,
|
|
515
|
+
202,
|
|
516
|
+
203,
|
|
517
|
+
204,
|
|
518
|
+
205,
|
|
519
|
+
206,
|
|
520
|
+
207,
|
|
521
|
+
208,
|
|
522
|
+
209,
|
|
523
|
+
214,
|
|
524
|
+
215,
|
|
525
|
+
220,
|
|
526
|
+
221
|
|
527
|
+
] : [
|
|
528
|
+
6,
|
|
529
|
+
2,
|
|
530
|
+
3,
|
|
531
|
+
4,
|
|
532
|
+
5,
|
|
533
|
+
1
|
|
534
|
+
];
|
|
535
|
+
const inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => {
|
|
536
|
+
const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase());
|
|
537
|
+
let value = process.env[key];
|
|
538
|
+
const lowerCase = typeof value === "string" && value.toLowerCase();
|
|
539
|
+
if (value === "null") value = null;
|
|
540
|
+
else if (lowerCase === "yes" || lowerCase === "on" || lowerCase === "true" || lowerCase === "enabled") value = true;
|
|
541
|
+
else if (lowerCase === "no" || lowerCase === "off" || lowerCase === "false" || lowerCase === "disabled") value = false;
|
|
542
|
+
else value = Number(value);
|
|
543
|
+
obj[prop] = value;
|
|
544
|
+
return obj;
|
|
545
|
+
}, {});
|
|
546
|
+
function useColors() {
|
|
547
|
+
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
|
|
548
|
+
}
|
|
549
|
+
function getDate() {
|
|
550
|
+
if (inspectOpts.hideDate) return "";
|
|
551
|
+
return `${(/* @__PURE__ */ new Date()).toISOString()} `;
|
|
552
|
+
}
|
|
553
|
+
function formatArgs(diff, args) {
|
|
554
|
+
const { namespace: name, useColors: useColors$1 } = this;
|
|
555
|
+
if (useColors$1) {
|
|
556
|
+
const c = this.color;
|
|
557
|
+
const colorCode = `\u001B[3${c < 8 ? c : `8;5;${c}`}`;
|
|
558
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
559
|
+
args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
|
|
560
|
+
args.push(`${colorCode}m+${this.humanize(diff)}\u001B[0m`);
|
|
561
|
+
} else args[0] = `${getDate()}${name} ${args[0]}`;
|
|
562
|
+
}
|
|
563
|
+
function log(...args) {
|
|
564
|
+
process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
|
|
565
|
+
}
|
|
566
|
+
const defaultOptions = {
|
|
567
|
+
useColors: useColors(),
|
|
568
|
+
formatArgs,
|
|
569
|
+
formatters: {
|
|
570
|
+
o(v) {
|
|
571
|
+
this.inspectOpts.colors = this.useColors;
|
|
572
|
+
return inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
573
|
+
},
|
|
574
|
+
O(v) {
|
|
575
|
+
this.inspectOpts.colors = this.useColors;
|
|
576
|
+
return inspect(v, this.inspectOpts);
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
inspectOpts,
|
|
580
|
+
log,
|
|
581
|
+
humanize
|
|
582
|
+
};
|
|
583
|
+
function createDebug(namespace, options) {
|
|
584
|
+
var _ref;
|
|
585
|
+
const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
|
|
586
|
+
return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
|
|
587
|
+
}
|
|
588
|
+
function save(namespaces$1) {
|
|
589
|
+
if (namespaces$1) process.env.DEBUG = namespaces$1;
|
|
590
|
+
else delete process.env.DEBUG;
|
|
591
|
+
}
|
|
592
|
+
function enable(namespaces$1) {
|
|
593
|
+
save(namespaces$1);
|
|
594
|
+
enable$1(namespaces$1);
|
|
595
|
+
}
|
|
596
|
+
enable$1(process.env.DEBUG || "");
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/debug-CiHXNOc4.mjs
|
|
599
|
+
var version = "0.22.1";
|
|
600
|
+
const debugLog = createDebug("tsdown:debug");
|
|
601
|
+
function enableDebug(debug) {
|
|
602
|
+
if (!debug) return;
|
|
603
|
+
let namespace;
|
|
604
|
+
if (debug === true) namespace = "tsdown:*";
|
|
605
|
+
else namespace = resolveComma(toArray(debug)).map((v) => `tsdown:${v}`).join(",");
|
|
606
|
+
const ns = namespaces();
|
|
607
|
+
if (ns) namespace += `,${ns}`;
|
|
608
|
+
enable(namespace);
|
|
609
|
+
debugLog("Debugging enabled", namespace);
|
|
610
|
+
}
|
|
611
|
+
//#endregion
|
|
612
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
|
|
613
|
+
const h = /^path$/i;
|
|
614
|
+
const g = {
|
|
615
|
+
key: "PATH",
|
|
616
|
+
value: ""
|
|
617
|
+
};
|
|
618
|
+
function _(e) {
|
|
619
|
+
for (const t in e) {
|
|
620
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
|
|
621
|
+
const n = e[t];
|
|
622
|
+
if (!n) return g;
|
|
623
|
+
return {
|
|
624
|
+
key: t,
|
|
625
|
+
value: n
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
return g;
|
|
629
|
+
}
|
|
630
|
+
function v(e, t) {
|
|
631
|
+
const n = t.value.split(delimiter);
|
|
632
|
+
const r = [];
|
|
633
|
+
let o = e;
|
|
634
|
+
let c;
|
|
635
|
+
do {
|
|
636
|
+
r.push(resolve(o, "node_modules", ".bin"));
|
|
637
|
+
c = o;
|
|
638
|
+
o = dirname(o);
|
|
639
|
+
} while (o !== c);
|
|
640
|
+
r.push(dirname(process.execPath));
|
|
641
|
+
const l = r.concat(n).join(delimiter);
|
|
642
|
+
return {
|
|
643
|
+
key: t.key,
|
|
644
|
+
value: l
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
function y(e, t, n = true) {
|
|
648
|
+
const r = {
|
|
649
|
+
...process.env,
|
|
650
|
+
...t
|
|
651
|
+
};
|
|
652
|
+
if (!n) return r;
|
|
653
|
+
const i = v(e, _(r));
|
|
654
|
+
r[i.key] = i.value;
|
|
655
|
+
return r;
|
|
656
|
+
}
|
|
657
|
+
const b = (e) => {
|
|
658
|
+
let t = e.length;
|
|
659
|
+
const n = new PassThrough();
|
|
660
|
+
const r = () => {
|
|
661
|
+
if (--t === 0) n.end();
|
|
662
|
+
};
|
|
663
|
+
for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
|
|
664
|
+
return n;
|
|
665
|
+
};
|
|
666
|
+
const x = /([()\][%!^"`<>&|;, *?])/g;
|
|
667
|
+
const S = /^#!\s*(.+)/;
|
|
668
|
+
const C = /\.(?:com|exe)$/i;
|
|
669
|
+
const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
|
|
670
|
+
const T = process.platform === "win32";
|
|
671
|
+
const E = [
|
|
672
|
+
".EXE",
|
|
673
|
+
".CMD",
|
|
674
|
+
".BAT",
|
|
675
|
+
".COM"
|
|
676
|
+
];
|
|
677
|
+
/**
|
|
678
|
+
* Normalizes the command and arguments to work cross-platform.
|
|
679
|
+
* On Windows, this basically handles things like shebangs, calling
|
|
680
|
+
* `node_modules/.bin` commands, and escaping meta characters.
|
|
681
|
+
* On other platforms, it just returns the command and arguments as-is.
|
|
682
|
+
*/
|
|
683
|
+
function D(e, t = [], n = {}) {
|
|
684
|
+
if (n.shell === true || !T) return {
|
|
685
|
+
command: e,
|
|
686
|
+
args: t,
|
|
687
|
+
options: n
|
|
688
|
+
};
|
|
689
|
+
let i = O(e, n);
|
|
690
|
+
let a = null;
|
|
691
|
+
if (i !== null) {
|
|
692
|
+
const e = 150;
|
|
693
|
+
const t = Buffer.alloc(e);
|
|
694
|
+
let n = null;
|
|
695
|
+
try {
|
|
696
|
+
n = openSync(i, "r");
|
|
697
|
+
readSync(n, t, 0, e, 0);
|
|
698
|
+
} catch {} finally {
|
|
699
|
+
if (n !== null) closeSync(n);
|
|
700
|
+
}
|
|
701
|
+
const o = t.toString().match(S);
|
|
702
|
+
if (o !== null) {
|
|
703
|
+
const e = o[1].trim();
|
|
704
|
+
const t = e.indexOf(" ");
|
|
705
|
+
const n = t !== -1 ? e.slice(0, t) : e;
|
|
706
|
+
const i = t !== -1 ? e.slice(t + 1) : "";
|
|
707
|
+
const s = basename(n);
|
|
708
|
+
a = s === "env" ? i || null : s;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (a !== null && i !== null) {
|
|
712
|
+
t = [i, ...t];
|
|
713
|
+
e = a;
|
|
714
|
+
i = O(e, n);
|
|
715
|
+
}
|
|
716
|
+
if (i === null || !C.test(i)) {
|
|
717
|
+
const r = i !== null && w.test(i);
|
|
718
|
+
e = normalize(e);
|
|
719
|
+
e = e.replace(x, "^$1");
|
|
720
|
+
t = t.map((e) => {
|
|
721
|
+
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
722
|
+
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
723
|
+
e = `"${e}"`;
|
|
724
|
+
e = e.replace(x, "^$1");
|
|
725
|
+
if (r) e = e.replace(x, "^$1");
|
|
726
|
+
return e;
|
|
727
|
+
});
|
|
728
|
+
t = [
|
|
729
|
+
"/d",
|
|
730
|
+
"/s",
|
|
731
|
+
"/c",
|
|
732
|
+
`"${[e, ...t].join(" ")}"`
|
|
733
|
+
];
|
|
734
|
+
e = n.env?.comspec ?? "cmd.exe";
|
|
735
|
+
n = {
|
|
736
|
+
...n,
|
|
737
|
+
windowsVerbatimArguments: true
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
return {
|
|
741
|
+
command: e,
|
|
742
|
+
args: t,
|
|
743
|
+
options: n
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Resolves the command to an absolute path if possible.
|
|
748
|
+
* Handles things like traversing PATH and adding extensions from PATHEXT
|
|
749
|
+
*/
|
|
750
|
+
function O(e, t) {
|
|
751
|
+
const r = (t.cwd ?? cwd()).toString();
|
|
752
|
+
const a = t.env ?? process.env;
|
|
753
|
+
const o = _(a).value;
|
|
754
|
+
const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
|
|
755
|
+
const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
|
|
756
|
+
if (e.includes(".") && l[0] !== "") l.unshift("");
|
|
757
|
+
for (const t of c) {
|
|
758
|
+
const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
|
|
759
|
+
for (const e of l) {
|
|
760
|
+
const t = n + e;
|
|
761
|
+
try {
|
|
762
|
+
if (statSync(t).isFile()) return t;
|
|
763
|
+
} catch {}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return null;
|
|
767
|
+
}
|
|
768
|
+
var k = class extends Error {
|
|
769
|
+
result;
|
|
770
|
+
output;
|
|
771
|
+
get exitCode() {
|
|
772
|
+
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
773
|
+
}
|
|
774
|
+
constructor(e, t) {
|
|
775
|
+
super(`Process exited with non-zero status (${e.exitCode})`);
|
|
776
|
+
this.result = e;
|
|
777
|
+
this.output = t;
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
const j = {
|
|
781
|
+
timeout: void 0,
|
|
782
|
+
persist: false
|
|
783
|
+
};
|
|
784
|
+
const N = { windowsHide: true };
|
|
785
|
+
function P(e) {
|
|
786
|
+
const t = new AbortController();
|
|
787
|
+
for (const n of e) {
|
|
788
|
+
if (n.aborted) {
|
|
789
|
+
t.abort();
|
|
790
|
+
return n;
|
|
791
|
+
}
|
|
792
|
+
const e = () => {
|
|
793
|
+
t.abort(n.reason);
|
|
794
|
+
};
|
|
795
|
+
n.addEventListener("abort", e, { signal: t.signal });
|
|
796
|
+
}
|
|
797
|
+
return t.signal;
|
|
798
|
+
}
|
|
799
|
+
async function F(e) {
|
|
800
|
+
let t = "";
|
|
801
|
+
try {
|
|
802
|
+
for await (const n of e) t += n.toString();
|
|
803
|
+
} catch {}
|
|
804
|
+
return t;
|
|
805
|
+
}
|
|
806
|
+
var I = class {
|
|
807
|
+
_process;
|
|
808
|
+
_aborted = false;
|
|
809
|
+
_options;
|
|
810
|
+
_command;
|
|
811
|
+
_args;
|
|
812
|
+
_resolveClose;
|
|
813
|
+
_processClosed;
|
|
814
|
+
_thrownError;
|
|
815
|
+
get process() {
|
|
816
|
+
return this._process;
|
|
817
|
+
}
|
|
818
|
+
get pid() {
|
|
819
|
+
return this._process?.pid;
|
|
820
|
+
}
|
|
821
|
+
get exitCode() {
|
|
822
|
+
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
823
|
+
}
|
|
824
|
+
constructor(e, t, n) {
|
|
825
|
+
this._options = {
|
|
826
|
+
...j,
|
|
827
|
+
...n
|
|
828
|
+
};
|
|
829
|
+
this._command = e;
|
|
830
|
+
this._args = t ?? [];
|
|
831
|
+
this._processClosed = new Promise((e) => {
|
|
832
|
+
this._resolveClose = e;
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
kill(e) {
|
|
836
|
+
return this._process?.kill(e) === true;
|
|
837
|
+
}
|
|
838
|
+
get aborted() {
|
|
839
|
+
return this._aborted;
|
|
840
|
+
}
|
|
841
|
+
get killed() {
|
|
842
|
+
return this._process?.killed === true;
|
|
843
|
+
}
|
|
844
|
+
pipe(e, t, n) {
|
|
845
|
+
return z(e, t, {
|
|
846
|
+
...n,
|
|
847
|
+
stdin: this
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
async *[Symbol.asyncIterator]() {
|
|
851
|
+
const e = this._process;
|
|
852
|
+
if (!e) return;
|
|
853
|
+
const t = [];
|
|
854
|
+
if (this._streamErr) t.push(this._streamErr);
|
|
855
|
+
if (this._streamOut) t.push(this._streamOut);
|
|
856
|
+
const n = b(t);
|
|
857
|
+
const r = readline.createInterface({ input: n });
|
|
858
|
+
for await (const e of r) yield e.toString();
|
|
859
|
+
await this._processClosed;
|
|
860
|
+
e.removeAllListeners();
|
|
861
|
+
if (this._thrownError) throw this._thrownError;
|
|
862
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
|
|
863
|
+
}
|
|
864
|
+
async _waitForOutput() {
|
|
865
|
+
const e = this._process;
|
|
866
|
+
if (!e) throw new Error("No process was started");
|
|
867
|
+
const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
|
|
868
|
+
await this._processClosed;
|
|
869
|
+
const { stdin: r } = this._options;
|
|
870
|
+
if (r && typeof r !== "string") await r;
|
|
871
|
+
e.removeAllListeners();
|
|
872
|
+
if (this._thrownError) throw this._thrownError;
|
|
873
|
+
const i = {
|
|
874
|
+
stderr: n,
|
|
875
|
+
stdout: t,
|
|
876
|
+
exitCode: this.exitCode
|
|
877
|
+
};
|
|
878
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
|
|
879
|
+
return i;
|
|
880
|
+
}
|
|
881
|
+
then(e, t) {
|
|
882
|
+
return this._waitForOutput().then(e, t);
|
|
883
|
+
}
|
|
884
|
+
_streamOut;
|
|
885
|
+
_streamErr;
|
|
886
|
+
spawn() {
|
|
887
|
+
const t = cwd();
|
|
888
|
+
const r = this._options;
|
|
889
|
+
const i = {
|
|
890
|
+
...N,
|
|
891
|
+
...r.nodeOptions
|
|
892
|
+
};
|
|
893
|
+
const a = [];
|
|
894
|
+
this._resetState();
|
|
895
|
+
if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
|
|
896
|
+
if (r.signal !== void 0) a.push(r.signal);
|
|
897
|
+
if (r.persist === true) i.detached = true;
|
|
898
|
+
if (a.length > 0) i.signal = P(a);
|
|
899
|
+
i.env = y(t, i.env, r.nodePath);
|
|
900
|
+
const o = D(this._command, this._args, i);
|
|
901
|
+
const s = spawn(o.command, o.args, o.options);
|
|
902
|
+
if (s.stderr) this._streamErr = s.stderr;
|
|
903
|
+
if (s.stdout) this._streamOut = s.stdout;
|
|
904
|
+
this._process = s;
|
|
905
|
+
s.once("error", this._onError);
|
|
906
|
+
s.once("close", this._onClose);
|
|
907
|
+
if (s.stdin) {
|
|
908
|
+
const { stdin: e } = r;
|
|
909
|
+
if (typeof e === "string") s.stdin.end(e);
|
|
910
|
+
else e?.process?.stdout?.pipe(s.stdin);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
_resetState() {
|
|
914
|
+
this._aborted = false;
|
|
915
|
+
this._processClosed = new Promise((e) => {
|
|
916
|
+
this._resolveClose = e;
|
|
917
|
+
});
|
|
918
|
+
this._thrownError = void 0;
|
|
919
|
+
}
|
|
920
|
+
_onError = (e) => {
|
|
921
|
+
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
|
|
922
|
+
this._aborted = true;
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
this._thrownError = e;
|
|
926
|
+
};
|
|
927
|
+
_onClose = () => {
|
|
928
|
+
if (this._resolveClose) this._resolveClose();
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
const R = (e, t, n) => {
|
|
932
|
+
const r = new I(e, t, n);
|
|
933
|
+
r.spawn();
|
|
934
|
+
return r;
|
|
935
|
+
};
|
|
936
|
+
const z = R;
|
|
937
|
+
//#endregion
|
|
938
|
+
export { __commonJSMin as A, noop as C, resolveRegex as D, resolveComma as E, __toESM as M, slash as O, matchPattern as S, promiseWithResolvers as T, red as _, createDebug as a, debounce as b, generateColor as c, prettyFormat as d, blue as f, hex as g, green as h, version as i, __exportAll as j, toArray as k, getNameLabel as l, dim as m, z as n, LogLevels as o, bold as p, enableDebug as r, createLogger as s, R as t, globalLogger as u, underline as v, pkgExists as w, importWithError as x, yellow as y };
|