@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
|
@@ -1,893 +0,0 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "./chunk-N93fKeF6.js";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import process$1, { cwd } from "node:process";
|
|
4
|
-
import readline from "node:readline";
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
import { delimiter, dirname, resolve } from "node:path";
|
|
7
|
-
import { pipeline } from "node:stream/promises";
|
|
8
|
-
import { PassThrough } from "node:stream";
|
|
9
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_d181d85b1bafdbf27821083f8481d00c/node_modules/tsdown/dist/general-D3muxt2f.mjs
|
|
10
|
-
const picomatch = createRequire(import.meta.url)("picomatch");
|
|
11
|
-
function toArray(val, defaultValue) {
|
|
12
|
-
if (Array.isArray(val)) return val;
|
|
13
|
-
else if (val == null) {
|
|
14
|
-
if (defaultValue) return [defaultValue];
|
|
15
|
-
return [];
|
|
16
|
-
} else return [val];
|
|
17
|
-
}
|
|
18
|
-
function resolveComma(arr) {
|
|
19
|
-
return arr.flatMap((format) => format.split(","));
|
|
20
|
-
}
|
|
21
|
-
function resolveRegex(str) {
|
|
22
|
-
if (typeof str === "string" && str.length > 2 && str[0] === "/" && str.at(-1) === "/") return new RegExp(str.slice(1, -1));
|
|
23
|
-
return str;
|
|
24
|
-
}
|
|
25
|
-
function slash(string) {
|
|
26
|
-
return string.replaceAll("\\", "/");
|
|
27
|
-
}
|
|
28
|
-
const noop = (v) => v;
|
|
29
|
-
function matchPattern(id, patterns) {
|
|
30
|
-
return patterns.some((pattern) => {
|
|
31
|
-
if (pattern instanceof RegExp) {
|
|
32
|
-
pattern.lastIndex = 0;
|
|
33
|
-
return pattern.test(id);
|
|
34
|
-
}
|
|
35
|
-
return id === pattern || picomatch(pattern)(id);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function pkgExists(moduleName) {
|
|
39
|
-
try {
|
|
40
|
-
import.meta.resolve(moduleName);
|
|
41
|
-
return true;
|
|
42
|
-
} catch {}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
async function importWithError(moduleName) {
|
|
46
|
-
try {
|
|
47
|
-
return await import(moduleName);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
throw new Error(`Failed to import module "${moduleName}". Please ensure it is installed.`, { cause: error });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function promiseWithResolvers() {
|
|
53
|
-
let resolve;
|
|
54
|
-
return {
|
|
55
|
-
promise: new Promise((res) => {
|
|
56
|
-
resolve = res;
|
|
57
|
-
}),
|
|
58
|
-
resolve
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function debounce(fn, delay) {
|
|
62
|
-
let timer;
|
|
63
|
-
const debounced = (...args) => {
|
|
64
|
-
clearTimeout(timer);
|
|
65
|
-
timer = setTimeout(() => fn(...args), delay);
|
|
66
|
-
};
|
|
67
|
-
debounced.cancel = () => clearTimeout(timer);
|
|
68
|
-
return debounced;
|
|
69
|
-
}
|
|
70
|
-
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) => {
|
|
71
|
-
let e, t, r, { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object, i = "", { round: c, max: a } = Math, p = (e) => {
|
|
72
|
-
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);
|
|
73
|
-
return [
|
|
74
|
-
l >> 16 & 255,
|
|
75
|
-
l >> 8 & 255,
|
|
76
|
-
255 & l
|
|
77
|
-
];
|
|
78
|
-
}, 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) => {
|
|
79
|
-
let t, r, l, n, o;
|
|
80
|
-
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);
|
|
81
|
-
}, f = (() => {
|
|
82
|
-
let r = (e) => o.some(((t) => e.test(t))), l = globalThis, n = l.process ?? {}, o = n.argv ?? [], i = n.env ?? {}, c = -1;
|
|
83
|
-
try {
|
|
84
|
-
e = "," + s(i).join(",");
|
|
85
|
-
} catch (e) {
|
|
86
|
-
i = {}, c = 0;
|
|
87
|
-
}
|
|
88
|
-
let a = "FORCE_COLOR", p = {
|
|
89
|
-
false: 0,
|
|
90
|
-
0: 0,
|
|
91
|
-
1: 1,
|
|
92
|
-
2: 2,
|
|
93
|
-
3: 3
|
|
94
|
-
}[i[a]] ?? -1, u = a in i && p || r(/^--color=?(true|always)?$/);
|
|
95
|
-
return u && (c = p), ~c || (c = ((r, l, n) => (t = r.TERM, {
|
|
96
|
-
"24bit": 3,
|
|
97
|
-
truecolor: 3,
|
|
98
|
-
ansi256: 2,
|
|
99
|
-
ansi: 1
|
|
100
|
-
}[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;
|
|
101
|
-
})(), g = {
|
|
102
|
-
open: i,
|
|
103
|
-
close: i
|
|
104
|
-
}, h = 39, b = 49, O = {}, m = ({ p: e }, { open: t, close: l }) => {
|
|
105
|
-
let o = (e, ...r) => {
|
|
106
|
-
if (!e) {
|
|
107
|
-
if (t && t === l) return t;
|
|
108
|
-
if ((e ?? i) === i) return i;
|
|
109
|
-
}
|
|
110
|
-
let n, s = e.raw ? String.raw({ raw: e }, ...r) : i + e, c = o.p, a = c.o, p = c.c;
|
|
111
|
-
if (s.includes("\x1B")) for (; c; c = c.p) {
|
|
112
|
-
let { open: e, close: t } = c, r = t.length, l = i, o = 0;
|
|
113
|
-
if (r) for (; ~(n = s.indexOf(t, o)); o = n + r) l += s.slice(o, n) + e;
|
|
114
|
-
s = l + s.slice(o);
|
|
115
|
-
}
|
|
116
|
-
return a + (s.includes("\n") ? s.replace(/(\r?\n)/g, p + "$1" + a) : s) + p;
|
|
117
|
-
}, s = t, c = l;
|
|
118
|
-
return e && (s = e.o + t, c = l + e.c), n(o, r), o.p = {
|
|
119
|
-
open: t,
|
|
120
|
-
close: l,
|
|
121
|
-
o: s,
|
|
122
|
-
c,
|
|
123
|
-
p: e
|
|
124
|
-
}, o.open = s, o.close = c, o;
|
|
125
|
-
};
|
|
126
|
-
const w = new function e(t = f) {
|
|
127
|
-
let s = {
|
|
128
|
-
Ansis: e,
|
|
129
|
-
level: t,
|
|
130
|
-
isSupported: () => a,
|
|
131
|
-
strip: (e) => e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
|
|
132
|
-
extend(e) {
|
|
133
|
-
for (let t in e) {
|
|
134
|
-
let r = e[t], l = (typeof r)[0];
|
|
135
|
-
"s" === l ? (c(t, T(...p(r))), c(_(t), v(...p(r)))) : c(t, r, "f" === l);
|
|
136
|
-
}
|
|
137
|
-
return r = o({}, O), n(s, r), s;
|
|
138
|
-
}
|
|
139
|
-
}, c = (e, t, r) => {
|
|
140
|
-
O[e] = { get() {
|
|
141
|
-
let n = r ? (...e) => m(this, t(...e)) : m(this, t);
|
|
142
|
-
return l(this, e, { value: n }), n;
|
|
143
|
-
} };
|
|
144
|
-
}, a = t > 0, w = (e, t) => a ? {
|
|
145
|
-
open: `[${e}m`,
|
|
146
|
-
close: `[${t}m`
|
|
147
|
-
} : 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);
|
|
148
|
-
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));
|
|
149
|
-
let M, I = {
|
|
150
|
-
fg: C,
|
|
151
|
-
bg: E,
|
|
152
|
-
rgb: T,
|
|
153
|
-
bgRgb: v,
|
|
154
|
-
hex: y(T),
|
|
155
|
-
bgHex: y(v),
|
|
156
|
-
visible: g,
|
|
157
|
-
reset: w(0, 0),
|
|
158
|
-
bold: w(1, 22),
|
|
159
|
-
dim: w(2, 22),
|
|
160
|
-
italic: w(3, 23),
|
|
161
|
-
underline: w(4, 24),
|
|
162
|
-
inverse: w(7, 27),
|
|
163
|
-
hidden: w(8, 28),
|
|
164
|
-
strikethrough: w(9, 29)
|
|
165
|
-
}, _ = (e) => "bg" + e[0].toUpperCase() + e.slice(1), k = "Bright";
|
|
166
|
-
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e, t) => {
|
|
167
|
-
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);
|
|
168
|
-
})), s.extend(I);
|
|
169
|
-
}();
|
|
170
|
-
module.exports = w, w.default = w;
|
|
171
|
-
})))(), 1)).default;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_d181d85b1bafdbf27821083f8481d00c/node_modules/tsdown/dist/logger-uV8l1UFa.mjs
|
|
174
|
-
const LogLevels = {
|
|
175
|
-
silent: 0,
|
|
176
|
-
error: 1,
|
|
177
|
-
warn: 2,
|
|
178
|
-
info: 3
|
|
179
|
-
};
|
|
180
|
-
function format(msgs) {
|
|
181
|
-
return msgs.filter((arg) => arg !== void 0 && arg !== false).join(" ");
|
|
182
|
-
}
|
|
183
|
-
function clearScreen() {
|
|
184
|
-
const repeatCount = process$1.stdout.rows - 2;
|
|
185
|
-
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
|
|
186
|
-
console.info(blank);
|
|
187
|
-
readline.cursorTo(process$1.stdout, 0, 0);
|
|
188
|
-
readline.clearScreenDown(process$1.stdout);
|
|
189
|
-
}
|
|
190
|
-
const warnedMessages = /* @__PURE__ */ new Set();
|
|
191
|
-
function createLogger(level = "info", options = {}) {
|
|
192
|
-
const resolvedOptions = {
|
|
193
|
-
allowClearScreen: true,
|
|
194
|
-
failOnWarn: false,
|
|
195
|
-
console: globalThis.console,
|
|
196
|
-
...options
|
|
197
|
-
};
|
|
198
|
-
const { allowClearScreen, console, customLogger, failOnWarn } = resolvedOptions;
|
|
199
|
-
if (customLogger) return customLogger;
|
|
200
|
-
function output(type, msg) {
|
|
201
|
-
if (LogLevels[logger.level] < LogLevels[type]) return;
|
|
202
|
-
console[type === "info" ? "log" : type](msg);
|
|
203
|
-
}
|
|
204
|
-
const clear = allowClearScreen && process$1.stdout.isTTY && !process$1.env.CI ? clearScreen : () => {};
|
|
205
|
-
const logger = {
|
|
206
|
-
level,
|
|
207
|
-
options: resolvedOptions,
|
|
208
|
-
info(...msgs) {
|
|
209
|
-
output("info", `${blue`ℹ`} ${format(msgs)}`);
|
|
210
|
-
},
|
|
211
|
-
warn(...msgs) {
|
|
212
|
-
if (failOnWarn) return this.error(...msgs);
|
|
213
|
-
const message = format(msgs);
|
|
214
|
-
warnedMessages.add(message);
|
|
215
|
-
output("warn", `${bold(yellow`warn:`)} ${message}`);
|
|
216
|
-
},
|
|
217
|
-
warnOnce(...msgs) {
|
|
218
|
-
const message = format(msgs);
|
|
219
|
-
if (warnedMessages.has(message)) return;
|
|
220
|
-
if (failOnWarn) return this.error(...msgs);
|
|
221
|
-
warnedMessages.add(message);
|
|
222
|
-
output("warn", `${bold(yellow`warn:`)} ${message}`);
|
|
223
|
-
},
|
|
224
|
-
error(...msgs) {
|
|
225
|
-
output("error", `${bold(red`error:`)} ${format(msgs).replace(/^([A-Za-z]*Error):\s*/, "")}`);
|
|
226
|
-
process$1.exitCode = 1;
|
|
227
|
-
},
|
|
228
|
-
success(...msgs) {
|
|
229
|
-
output("info", `${green`✔`} ${format(msgs)}`);
|
|
230
|
-
},
|
|
231
|
-
clearScreen(type) {
|
|
232
|
-
if (LogLevels[logger.level] >= LogLevels[type]) clear();
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
return logger;
|
|
236
|
-
}
|
|
237
|
-
const globalLogger = createLogger();
|
|
238
|
-
function getNameLabel(ansis, name) {
|
|
239
|
-
if (!name) return void 0;
|
|
240
|
-
return ansis(`[${name}]`);
|
|
241
|
-
}
|
|
242
|
-
function prettyFormat(format) {
|
|
243
|
-
const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
|
|
244
|
-
let formatText;
|
|
245
|
-
switch (format) {
|
|
246
|
-
case "es":
|
|
247
|
-
formatText = "ESM";
|
|
248
|
-
break;
|
|
249
|
-
default:
|
|
250
|
-
formatText = format.toUpperCase();
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
return formatColor(`[${formatText}]`);
|
|
254
|
-
}
|
|
255
|
-
const colors = /* @__PURE__ */ new Map();
|
|
256
|
-
function generateColor(name = "default") {
|
|
257
|
-
if (colors.has(name)) return colors.get(name);
|
|
258
|
-
let color;
|
|
259
|
-
if (name === "default") color = blue;
|
|
260
|
-
else {
|
|
261
|
-
let hash = 0;
|
|
262
|
-
for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
263
|
-
color = rgb(...hslToRgb(hash % 360, 35, 55));
|
|
264
|
-
}
|
|
265
|
-
colors.set(name, color);
|
|
266
|
-
return color;
|
|
267
|
-
}
|
|
268
|
-
function hslToRgb(h, s, l) {
|
|
269
|
-
h = h % 360;
|
|
270
|
-
h /= 360;
|
|
271
|
-
s /= 100;
|
|
272
|
-
l /= 100;
|
|
273
|
-
let r, g, b;
|
|
274
|
-
if (s === 0) r = g = b = l;
|
|
275
|
-
else {
|
|
276
|
-
const q = l < .5 ? l * (1 + s) : l + s - l * s;
|
|
277
|
-
const p = 2 * l - q;
|
|
278
|
-
r = hue2rgb(p, q, h + 1 / 3);
|
|
279
|
-
g = hue2rgb(p, q, h);
|
|
280
|
-
b = hue2rgb(p, q, h - 1 / 3);
|
|
281
|
-
}
|
|
282
|
-
return [
|
|
283
|
-
Math.max(0, Math.round(r * 255)),
|
|
284
|
-
Math.max(0, Math.round(g * 255)),
|
|
285
|
-
Math.max(0, Math.round(b * 255))
|
|
286
|
-
];
|
|
287
|
-
}
|
|
288
|
-
function hue2rgb(p, q, t) {
|
|
289
|
-
if (t < 0) t += 1;
|
|
290
|
-
if (t > 1) t -= 1;
|
|
291
|
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
292
|
-
if (t < 1 / 2) return q;
|
|
293
|
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
294
|
-
return p;
|
|
295
|
-
}
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_d181d85b1bafdbf27821083f8481d00c/node_modules/tsdown/dist/package-Dzmmm_a2.mjs
|
|
298
|
-
var version = "0.22.0";
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region ../../node_modules/.pnpm/tinyexec@1.1.2/node_modules/tinyexec/dist/main.mjs
|
|
301
|
-
var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
|
|
302
|
-
var d = /* @__PURE__ */ createRequire(import.meta.url);
|
|
303
|
-
const f = /^path$/i;
|
|
304
|
-
const p = {
|
|
305
|
-
key: "PATH",
|
|
306
|
-
value: ""
|
|
307
|
-
};
|
|
308
|
-
function m(e) {
|
|
309
|
-
for (const t in e) {
|
|
310
|
-
if (!Object.prototype.hasOwnProperty.call(e, t) || !f.test(t)) continue;
|
|
311
|
-
const n = e[t];
|
|
312
|
-
if (!n) return p;
|
|
313
|
-
return {
|
|
314
|
-
key: t,
|
|
315
|
-
value: n
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
return p;
|
|
319
|
-
}
|
|
320
|
-
function h(e, t) {
|
|
321
|
-
const n = t.value.split(delimiter);
|
|
322
|
-
const r = [];
|
|
323
|
-
let s = e;
|
|
324
|
-
let c;
|
|
325
|
-
do {
|
|
326
|
-
r.push(resolve(s, "node_modules", ".bin"));
|
|
327
|
-
c = s;
|
|
328
|
-
s = dirname(s);
|
|
329
|
-
} while (s !== c);
|
|
330
|
-
r.push(dirname(process.execPath));
|
|
331
|
-
const l = r.concat(n).join(delimiter);
|
|
332
|
-
return {
|
|
333
|
-
key: t.key,
|
|
334
|
-
value: l
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function g(e, t) {
|
|
338
|
-
const n = {
|
|
339
|
-
...process.env,
|
|
340
|
-
...t
|
|
341
|
-
};
|
|
342
|
-
const r = h(e, m(n));
|
|
343
|
-
n[r.key] = r.value;
|
|
344
|
-
return n;
|
|
345
|
-
}
|
|
346
|
-
const _ = (e) => {
|
|
347
|
-
let t = e.length;
|
|
348
|
-
const n = new PassThrough();
|
|
349
|
-
const r = () => {
|
|
350
|
-
if (--t === 0) n.end();
|
|
351
|
-
};
|
|
352
|
-
for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
|
|
353
|
-
return n;
|
|
354
|
-
};
|
|
355
|
-
var v = /* @__PURE__ */ u(((e, t) => {
|
|
356
|
-
t.exports = a;
|
|
357
|
-
a.sync = o;
|
|
358
|
-
var n = d("fs");
|
|
359
|
-
function r(e, t) {
|
|
360
|
-
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
|
|
361
|
-
if (!n) return true;
|
|
362
|
-
n = n.split(";");
|
|
363
|
-
if (n.indexOf("") !== -1) return true;
|
|
364
|
-
for (var r = 0; r < n.length; r++) {
|
|
365
|
-
var i = n[r].toLowerCase();
|
|
366
|
-
if (i && e.substr(-i.length).toLowerCase() === i) return true;
|
|
367
|
-
}
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
function i(e, t, n) {
|
|
371
|
-
if (!e.isSymbolicLink() && !e.isFile()) return false;
|
|
372
|
-
return r(t, n);
|
|
373
|
-
}
|
|
374
|
-
function a(e, t, r) {
|
|
375
|
-
n.stat(e, function(n, a) {
|
|
376
|
-
r(n, n ? false : i(a, e, t));
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
function o(e, t) {
|
|
380
|
-
return i(n.statSync(e), e, t);
|
|
381
|
-
}
|
|
382
|
-
}));
|
|
383
|
-
var y = /* @__PURE__ */ u(((e, t) => {
|
|
384
|
-
t.exports = r;
|
|
385
|
-
r.sync = i;
|
|
386
|
-
var n = d("fs");
|
|
387
|
-
function r(e, t, r) {
|
|
388
|
-
n.stat(e, function(e, n) {
|
|
389
|
-
r(e, e ? false : a(n, t));
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
function i(e, t) {
|
|
393
|
-
return a(n.statSync(e), t);
|
|
394
|
-
}
|
|
395
|
-
function a(e, t) {
|
|
396
|
-
return e.isFile() && o(e, t);
|
|
397
|
-
}
|
|
398
|
-
function o(e, t) {
|
|
399
|
-
var n = e.mode;
|
|
400
|
-
var r = e.uid;
|
|
401
|
-
var i = e.gid;
|
|
402
|
-
var a = t.uid !== void 0 ? t.uid : process.getuid && process.getuid();
|
|
403
|
-
var o = t.gid !== void 0 ? t.gid : process.getgid && process.getgid();
|
|
404
|
-
var s = parseInt("100", 8);
|
|
405
|
-
var c = parseInt("010", 8);
|
|
406
|
-
var l = parseInt("001", 8);
|
|
407
|
-
var u = s | c;
|
|
408
|
-
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
409
|
-
}
|
|
410
|
-
}));
|
|
411
|
-
var b = /* @__PURE__ */ u(((e, t) => {
|
|
412
|
-
d("fs");
|
|
413
|
-
var n;
|
|
414
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
|
|
415
|
-
else n = y();
|
|
416
|
-
t.exports = r;
|
|
417
|
-
r.sync = i;
|
|
418
|
-
function r(e, t, i) {
|
|
419
|
-
if (typeof t === "function") {
|
|
420
|
-
i = t;
|
|
421
|
-
t = {};
|
|
422
|
-
}
|
|
423
|
-
if (!i) {
|
|
424
|
-
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
425
|
-
return new Promise(function(n, i) {
|
|
426
|
-
r(e, t || {}, function(e, t) {
|
|
427
|
-
if (e) i(e);
|
|
428
|
-
else n(t);
|
|
429
|
-
});
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
n(e, t || {}, function(e, n) {
|
|
433
|
-
if (e) {
|
|
434
|
-
if (e.code === "EACCES" || t && t.ignoreErrors) {
|
|
435
|
-
e = null;
|
|
436
|
-
n = false;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
i(e, n);
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
function i(e, t) {
|
|
443
|
-
try {
|
|
444
|
-
return n.sync(e, t || {});
|
|
445
|
-
} catch (e) {
|
|
446
|
-
if (t && t.ignoreErrors || e.code === "EACCES") return false;
|
|
447
|
-
else throw e;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}));
|
|
451
|
-
var x = /* @__PURE__ */ u(((e, t) => {
|
|
452
|
-
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
453
|
-
const r = d("path");
|
|
454
|
-
const i = n ? ";" : ":";
|
|
455
|
-
const a = b();
|
|
456
|
-
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
457
|
-
const s = (e, t) => {
|
|
458
|
-
const r = t.colon || i;
|
|
459
|
-
const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
|
|
460
|
-
const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
461
|
-
const s = n ? o.split(r) : [""];
|
|
462
|
-
if (n) {
|
|
463
|
-
if (e.indexOf(".") !== -1 && s[0] !== "") s.unshift("");
|
|
464
|
-
}
|
|
465
|
-
return {
|
|
466
|
-
pathEnv: a,
|
|
467
|
-
pathExt: s,
|
|
468
|
-
pathExtExe: o
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
|
-
const c = (e, t, n) => {
|
|
472
|
-
if (typeof t === "function") {
|
|
473
|
-
n = t;
|
|
474
|
-
t = {};
|
|
475
|
-
}
|
|
476
|
-
if (!t) t = {};
|
|
477
|
-
const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
|
|
478
|
-
const u = [];
|
|
479
|
-
const d = (n) => new Promise((a, s) => {
|
|
480
|
-
if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
|
|
481
|
-
const c = i[n];
|
|
482
|
-
const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
|
|
483
|
-
const d = r.join(l, e);
|
|
484
|
-
a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
|
|
485
|
-
});
|
|
486
|
-
const f = (e, n, r) => new Promise((i, o) => {
|
|
487
|
-
if (r === c.length) return i(d(n + 1));
|
|
488
|
-
const s = c[r];
|
|
489
|
-
a(e + s, { pathExt: l }, (a, o) => {
|
|
490
|
-
if (!a && o) if (t.all) u.push(e + s);
|
|
491
|
-
else return i(e + s);
|
|
492
|
-
return i(f(e, n, r + 1));
|
|
493
|
-
});
|
|
494
|
-
});
|
|
495
|
-
return n ? d(0).then((e) => n(null, e), n) : d(0);
|
|
496
|
-
};
|
|
497
|
-
const l = (e, t) => {
|
|
498
|
-
t = t || {};
|
|
499
|
-
const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
|
|
500
|
-
const l = [];
|
|
501
|
-
for (let o = 0; o < n.length; o++) {
|
|
502
|
-
const s = n[o];
|
|
503
|
-
const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
|
|
504
|
-
const d = r.join(u, e);
|
|
505
|
-
const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
|
|
506
|
-
for (let e = 0; e < i.length; e++) {
|
|
507
|
-
const n = f + i[e];
|
|
508
|
-
try {
|
|
509
|
-
if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
|
|
510
|
-
else return n;
|
|
511
|
-
} catch (e) {}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
if (t.all && l.length) return l;
|
|
515
|
-
if (t.nothrow) return null;
|
|
516
|
-
throw o(e);
|
|
517
|
-
};
|
|
518
|
-
t.exports = c;
|
|
519
|
-
c.sync = l;
|
|
520
|
-
}));
|
|
521
|
-
var S = /* @__PURE__ */ u(((e, t) => {
|
|
522
|
-
const n = (e = {}) => {
|
|
523
|
-
const t = e.env || process.env;
|
|
524
|
-
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
525
|
-
return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
|
|
526
|
-
};
|
|
527
|
-
t.exports = n;
|
|
528
|
-
t.exports.default = n;
|
|
529
|
-
}));
|
|
530
|
-
var C = /* @__PURE__ */ u(((e, t) => {
|
|
531
|
-
const n = d("path");
|
|
532
|
-
const r = x();
|
|
533
|
-
const i = S();
|
|
534
|
-
function a(e, t) {
|
|
535
|
-
const a = e.options.env || process.env;
|
|
536
|
-
const o = process.cwd();
|
|
537
|
-
const s = e.options.cwd != null;
|
|
538
|
-
const c = s && process.chdir !== void 0 && !process.chdir.disabled;
|
|
539
|
-
if (c) try {
|
|
540
|
-
process.chdir(e.options.cwd);
|
|
541
|
-
} catch (e) {}
|
|
542
|
-
let l;
|
|
543
|
-
try {
|
|
544
|
-
l = r.sync(e.command, {
|
|
545
|
-
path: a[i({ env: a })],
|
|
546
|
-
pathExt: t ? n.delimiter : void 0
|
|
547
|
-
});
|
|
548
|
-
} catch (e) {} finally {
|
|
549
|
-
if (c) process.chdir(o);
|
|
550
|
-
}
|
|
551
|
-
if (l) l = n.resolve(s ? e.options.cwd : "", l);
|
|
552
|
-
return l;
|
|
553
|
-
}
|
|
554
|
-
function o(e) {
|
|
555
|
-
return a(e) || a(e, true);
|
|
556
|
-
}
|
|
557
|
-
t.exports = o;
|
|
558
|
-
}));
|
|
559
|
-
var w = /* @__PURE__ */ u(((e, t) => {
|
|
560
|
-
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
561
|
-
function r(e) {
|
|
562
|
-
e = e.replace(n, "^$1");
|
|
563
|
-
return e;
|
|
564
|
-
}
|
|
565
|
-
function i(e, t) {
|
|
566
|
-
e = `${e}`;
|
|
567
|
-
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
568
|
-
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
569
|
-
e = `"${e}"`;
|
|
570
|
-
e = e.replace(n, "^$1");
|
|
571
|
-
if (t) e = e.replace(n, "^$1");
|
|
572
|
-
return e;
|
|
573
|
-
}
|
|
574
|
-
t.exports.command = r;
|
|
575
|
-
t.exports.argument = i;
|
|
576
|
-
}));
|
|
577
|
-
var T = /* @__PURE__ */ u(((e, t) => {
|
|
578
|
-
t.exports = /^#!(.*)/;
|
|
579
|
-
}));
|
|
580
|
-
var E = /* @__PURE__ */ u(((e, t) => {
|
|
581
|
-
const n = T();
|
|
582
|
-
t.exports = (e = "") => {
|
|
583
|
-
const t = e.match(n);
|
|
584
|
-
if (!t) return null;
|
|
585
|
-
const [r, i] = t[0].replace(/#! ?/, "").split(" ");
|
|
586
|
-
const a = r.split("/").pop();
|
|
587
|
-
if (a === "env") return i;
|
|
588
|
-
return i ? `${a} ${i}` : a;
|
|
589
|
-
};
|
|
590
|
-
}));
|
|
591
|
-
var D = /* @__PURE__ */ u(((e, t) => {
|
|
592
|
-
const n = d("fs");
|
|
593
|
-
const r = E();
|
|
594
|
-
function i(e) {
|
|
595
|
-
const t = 150;
|
|
596
|
-
const i = Buffer.alloc(t);
|
|
597
|
-
let a;
|
|
598
|
-
try {
|
|
599
|
-
a = n.openSync(e, "r");
|
|
600
|
-
n.readSync(a, i, 0, t, 0);
|
|
601
|
-
n.closeSync(a);
|
|
602
|
-
} catch (e) {}
|
|
603
|
-
return r(i.toString());
|
|
604
|
-
}
|
|
605
|
-
t.exports = i;
|
|
606
|
-
}));
|
|
607
|
-
var O = /* @__PURE__ */ u(((e, t) => {
|
|
608
|
-
const n = d("path");
|
|
609
|
-
const r = C();
|
|
610
|
-
const i = w();
|
|
611
|
-
const a = D();
|
|
612
|
-
const o = process.platform === "win32";
|
|
613
|
-
const s = /\.(?:com|exe)$/i;
|
|
614
|
-
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
615
|
-
function l(e) {
|
|
616
|
-
e.file = r(e);
|
|
617
|
-
const t = e.file && a(e.file);
|
|
618
|
-
if (t) {
|
|
619
|
-
e.args.unshift(e.file);
|
|
620
|
-
e.command = t;
|
|
621
|
-
return r(e);
|
|
622
|
-
}
|
|
623
|
-
return e.file;
|
|
624
|
-
}
|
|
625
|
-
function u(e) {
|
|
626
|
-
if (!o) return e;
|
|
627
|
-
const t = l(e);
|
|
628
|
-
const r = !s.test(t);
|
|
629
|
-
if (e.options.forceShell || r) {
|
|
630
|
-
const r = c.test(t);
|
|
631
|
-
e.command = n.normalize(e.command);
|
|
632
|
-
e.command = i.command(e.command);
|
|
633
|
-
e.args = e.args.map((e) => i.argument(e, r));
|
|
634
|
-
e.args = [
|
|
635
|
-
"/d",
|
|
636
|
-
"/s",
|
|
637
|
-
"/c",
|
|
638
|
-
`"${[e.command].concat(e.args).join(" ")}"`
|
|
639
|
-
];
|
|
640
|
-
e.command = process.env.comspec || "cmd.exe";
|
|
641
|
-
e.options.windowsVerbatimArguments = true;
|
|
642
|
-
}
|
|
643
|
-
return e;
|
|
644
|
-
}
|
|
645
|
-
function f(e, t, n) {
|
|
646
|
-
if (t && !Array.isArray(t)) {
|
|
647
|
-
n = t;
|
|
648
|
-
t = null;
|
|
649
|
-
}
|
|
650
|
-
t = t ? t.slice(0) : [];
|
|
651
|
-
n = Object.assign({}, n);
|
|
652
|
-
const r = {
|
|
653
|
-
command: e,
|
|
654
|
-
args: t,
|
|
655
|
-
options: n,
|
|
656
|
-
file: void 0,
|
|
657
|
-
original: {
|
|
658
|
-
command: e,
|
|
659
|
-
args: t
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
return n.shell ? r : u(r);
|
|
663
|
-
}
|
|
664
|
-
t.exports = f;
|
|
665
|
-
}));
|
|
666
|
-
var k = /* @__PURE__ */ u(((e, t) => {
|
|
667
|
-
const n = process.platform === "win32";
|
|
668
|
-
function r(e, t) {
|
|
669
|
-
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
670
|
-
code: "ENOENT",
|
|
671
|
-
errno: "ENOENT",
|
|
672
|
-
syscall: `${t} ${e.command}`,
|
|
673
|
-
path: e.command,
|
|
674
|
-
spawnargs: e.args
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
function i(e, t) {
|
|
678
|
-
if (!n) return;
|
|
679
|
-
const r = e.emit;
|
|
680
|
-
e.emit = function(n, i) {
|
|
681
|
-
if (n === "exit") {
|
|
682
|
-
const n = a(i, t);
|
|
683
|
-
if (n) return r.call(e, "error", n);
|
|
684
|
-
}
|
|
685
|
-
return r.apply(e, arguments);
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
function a(e, t) {
|
|
689
|
-
if (n && e === 1 && !t.file) return r(t.original, "spawn");
|
|
690
|
-
return null;
|
|
691
|
-
}
|
|
692
|
-
function o(e, t) {
|
|
693
|
-
if (n && e === 1 && !t.file) return r(t.original, "spawnSync");
|
|
694
|
-
return null;
|
|
695
|
-
}
|
|
696
|
-
t.exports = {
|
|
697
|
-
hookChildProcess: i,
|
|
698
|
-
verifyENOENT: a,
|
|
699
|
-
verifyENOENTSync: o,
|
|
700
|
-
notFoundError: r
|
|
701
|
-
};
|
|
702
|
-
}));
|
|
703
|
-
var j = (/* @__PURE__ */ u(((e, t) => {
|
|
704
|
-
const n = d("child_process");
|
|
705
|
-
const r = O();
|
|
706
|
-
const i = k();
|
|
707
|
-
function a(e, t, a) {
|
|
708
|
-
const o = r(e, t, a);
|
|
709
|
-
const s = n.spawn(o.command, o.args, o.options);
|
|
710
|
-
i.hookChildProcess(s, o);
|
|
711
|
-
return s;
|
|
712
|
-
}
|
|
713
|
-
function o(e, t, a) {
|
|
714
|
-
const o = r(e, t, a);
|
|
715
|
-
const s = n.spawnSync(o.command, o.args, o.options);
|
|
716
|
-
s.error = s.error || i.verifyENOENTSync(s.status, o);
|
|
717
|
-
return s;
|
|
718
|
-
}
|
|
719
|
-
t.exports = a;
|
|
720
|
-
t.exports.spawn = a;
|
|
721
|
-
t.exports.sync = o;
|
|
722
|
-
t.exports._parse = r;
|
|
723
|
-
t.exports._enoent = i;
|
|
724
|
-
})))();
|
|
725
|
-
var M = class extends Error {
|
|
726
|
-
get exitCode() {
|
|
727
|
-
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
728
|
-
}
|
|
729
|
-
constructor(e, t) {
|
|
730
|
-
super(`Process exited with non-zero status (${e.exitCode})`);
|
|
731
|
-
this.result = e;
|
|
732
|
-
this.output = t;
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
|
-
const P = {
|
|
736
|
-
timeout: void 0,
|
|
737
|
-
persist: false
|
|
738
|
-
};
|
|
739
|
-
const I = { windowsHide: true };
|
|
740
|
-
function L(e) {
|
|
741
|
-
const t = new AbortController();
|
|
742
|
-
for (const n of e) {
|
|
743
|
-
if (n.aborted) {
|
|
744
|
-
t.abort();
|
|
745
|
-
return n;
|
|
746
|
-
}
|
|
747
|
-
const e = () => {
|
|
748
|
-
t.abort(n.reason);
|
|
749
|
-
};
|
|
750
|
-
n.addEventListener("abort", e, { signal: t.signal });
|
|
751
|
-
}
|
|
752
|
-
return t.signal;
|
|
753
|
-
}
|
|
754
|
-
async function R(e) {
|
|
755
|
-
let t = "";
|
|
756
|
-
try {
|
|
757
|
-
for await (const n of e) t += n.toString();
|
|
758
|
-
} catch {}
|
|
759
|
-
return t;
|
|
760
|
-
}
|
|
761
|
-
var z = class {
|
|
762
|
-
_process;
|
|
763
|
-
_aborted = false;
|
|
764
|
-
_options;
|
|
765
|
-
_command;
|
|
766
|
-
_args;
|
|
767
|
-
_resolveClose;
|
|
768
|
-
_processClosed;
|
|
769
|
-
_thrownError;
|
|
770
|
-
get process() {
|
|
771
|
-
return this._process;
|
|
772
|
-
}
|
|
773
|
-
get pid() {
|
|
774
|
-
return this._process?.pid;
|
|
775
|
-
}
|
|
776
|
-
get exitCode() {
|
|
777
|
-
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
778
|
-
}
|
|
779
|
-
constructor(e, t, n) {
|
|
780
|
-
this._options = {
|
|
781
|
-
...P,
|
|
782
|
-
...n
|
|
783
|
-
};
|
|
784
|
-
this._command = e;
|
|
785
|
-
this._args = t ?? [];
|
|
786
|
-
this._processClosed = new Promise((e) => {
|
|
787
|
-
this._resolveClose = e;
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
kill(e) {
|
|
791
|
-
return this._process?.kill(e) === true;
|
|
792
|
-
}
|
|
793
|
-
get aborted() {
|
|
794
|
-
return this._aborted;
|
|
795
|
-
}
|
|
796
|
-
get killed() {
|
|
797
|
-
return this._process?.killed === true;
|
|
798
|
-
}
|
|
799
|
-
pipe(e, t, n) {
|
|
800
|
-
return H(e, t, {
|
|
801
|
-
...n,
|
|
802
|
-
stdin: this
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
async *[Symbol.asyncIterator]() {
|
|
806
|
-
const e = this._process;
|
|
807
|
-
if (!e) return;
|
|
808
|
-
const t = [];
|
|
809
|
-
if (this._streamErr) t.push(this._streamErr);
|
|
810
|
-
if (this._streamOut) t.push(this._streamOut);
|
|
811
|
-
const n = _(t);
|
|
812
|
-
const r = readline.createInterface({ input: n });
|
|
813
|
-
for await (const e of r) yield e.toString();
|
|
814
|
-
await this._processClosed;
|
|
815
|
-
e.removeAllListeners();
|
|
816
|
-
if (this._thrownError) throw this._thrownError;
|
|
817
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this);
|
|
818
|
-
}
|
|
819
|
-
async _waitForOutput() {
|
|
820
|
-
const e = this._process;
|
|
821
|
-
if (!e) throw new Error("No process was started");
|
|
822
|
-
const [t, n] = await Promise.all([this._streamOut ? R(this._streamOut) : "", this._streamErr ? R(this._streamErr) : ""]);
|
|
823
|
-
await this._processClosed;
|
|
824
|
-
const { stdin: r } = this._options;
|
|
825
|
-
if (r && typeof r !== "string") await r;
|
|
826
|
-
e.removeAllListeners();
|
|
827
|
-
if (this._thrownError) throw this._thrownError;
|
|
828
|
-
const i = {
|
|
829
|
-
stderr: n,
|
|
830
|
-
stdout: t,
|
|
831
|
-
exitCode: this.exitCode
|
|
832
|
-
};
|
|
833
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this, i);
|
|
834
|
-
return i;
|
|
835
|
-
}
|
|
836
|
-
then(e, t) {
|
|
837
|
-
return this._waitForOutput().then(e, t);
|
|
838
|
-
}
|
|
839
|
-
_streamOut;
|
|
840
|
-
_streamErr;
|
|
841
|
-
spawn() {
|
|
842
|
-
const e = cwd();
|
|
843
|
-
const n = this._options;
|
|
844
|
-
const i = {
|
|
845
|
-
...I,
|
|
846
|
-
...n.nodeOptions
|
|
847
|
-
};
|
|
848
|
-
const a = [];
|
|
849
|
-
this._resetState();
|
|
850
|
-
if (n.timeout !== void 0) a.push(AbortSignal.timeout(n.timeout));
|
|
851
|
-
if (n.signal !== void 0) a.push(n.signal);
|
|
852
|
-
if (n.persist === true) i.detached = true;
|
|
853
|
-
if (a.length > 0) i.signal = L(a);
|
|
854
|
-
i.env = g(e, i.env);
|
|
855
|
-
const o = (0, j._parse)(this._command, this._args, i);
|
|
856
|
-
const s = spawn(o.command, o.args, o.options);
|
|
857
|
-
if (s.stderr) this._streamErr = s.stderr;
|
|
858
|
-
if (s.stdout) this._streamOut = s.stdout;
|
|
859
|
-
this._process = s;
|
|
860
|
-
s.once("error", this._onError);
|
|
861
|
-
s.once("close", this._onClose);
|
|
862
|
-
if (s.stdin) {
|
|
863
|
-
const { stdin: e } = n;
|
|
864
|
-
if (typeof e === "string") s.stdin.end(e);
|
|
865
|
-
else e?.process?.stdout?.pipe(s.stdin);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
_resetState() {
|
|
869
|
-
this._aborted = false;
|
|
870
|
-
this._processClosed = new Promise((e) => {
|
|
871
|
-
this._resolveClose = e;
|
|
872
|
-
});
|
|
873
|
-
this._thrownError = void 0;
|
|
874
|
-
}
|
|
875
|
-
_onError = (e) => {
|
|
876
|
-
if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
|
|
877
|
-
this._aborted = true;
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
this._thrownError = e;
|
|
881
|
-
};
|
|
882
|
-
_onClose = () => {
|
|
883
|
-
if (this._resolveClose) this._resolveClose();
|
|
884
|
-
};
|
|
885
|
-
};
|
|
886
|
-
const V = (e, t, n) => {
|
|
887
|
-
const r = new z(e, t, n);
|
|
888
|
-
r.spawn();
|
|
889
|
-
return r;
|
|
890
|
-
};
|
|
891
|
-
const H = V;
|
|
892
|
-
//#endregion
|
|
893
|
-
export { promiseWithResolvers as C, toArray as D, slash as E, pkgExists as S, resolveRegex as T, yellow as _, createLogger as a, matchPattern as b, globalLogger as c, bold as d, dim as f, underline as g, red as h, LogLevels as i, prettyFormat as l, hex as m, V as n, generateColor as o, green as p, version as r, getNameLabel as s, H as t, blue as u, debounce as v, resolveComma as w, noop as x, importWithError as y };
|