@voidzero-dev/vite-plus-core 0.1.22 → 0.1.23
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 +35 -24
- 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-5FURNVr0-CsM6vj3e.js} +1046 -17
- package/dist/tsdown/{detect-DN3DXXYt-8gmDjZqp.js → detect-DN3DXXYt-TsZBbdhI.js} +1 -1
- package/dist/tsdown/{dist-DTzJRoOQ.js → dist-wWM45aJq.js} +2185 -1087
- package/dist/tsdown/index-types.d.ts +7 -5
- package/dist/tsdown/index.js +3 -4
- package/dist/tsdown/{main-BNUO6D3N.js → main-Cq8Is40L.js} +288 -8
- 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-DkvdaW3s-Dz1U-gxd.js} +1 -1
- package/dist/tsdown/run.js +3 -4
- package/dist/tsdown/{tsc-Dr9kCkDm.js → tsc-Dp9emiKb.js} +3 -3
- package/dist/tsdown/{tsc-context-CANQEB9U.js → tsc-context-DXovbMXp.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 +288 -181
- 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 +13 -19
- 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/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/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/{chunk-N93fKeF6.js → chunk-DJK8HYOj.js} +0 -0
- /package/dist/tsdown/{dist-JaOach5K.js → dist-CZtGyfn3.js} +0 -0
|
@@ -1,1012 +0,0 @@
|
|
|
1
|
-
import module from "node:module";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import re from "node:fs";
|
|
4
|
-
import Ue from "fs";
|
|
5
|
-
import Ie from "os";
|
|
6
|
-
import Se from "path";
|
|
7
|
-
//#region ../../node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs
|
|
8
|
-
const A = (r) => r !== null && typeof r == "object", a = (r, t) => Object.assign(/* @__PURE__ */ new Error(`[${r}]: ${t}`), { code: r }), _$1 = "ERR_INVALID_PACKAGE_CONFIG", E = "ERR_INVALID_PACKAGE_TARGET", I$1 = "ERR_PACKAGE_PATH_NOT_EXPORTED", R$1 = /^\d+$/, O = /^(\.{1,2}|node_modules)$/i, w = /\/|\\/;
|
|
9
|
-
var h = ((r) => (r.Export = "exports", r.Import = "imports", r))(h || {});
|
|
10
|
-
const f = (r, t, e, o, c) => {
|
|
11
|
-
if (t == null) return [];
|
|
12
|
-
if (typeof t == "string") {
|
|
13
|
-
const [n, ...i] = t.split(w);
|
|
14
|
-
if (n === ".." || i.some((l) => O.test(l))) throw a(E, `Invalid "${r}" target "${t}" defined in the package config`);
|
|
15
|
-
return [c ? t.replace(/\*/g, c) : t];
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(t)) return t.flatMap((n) => f(r, n, e, o, c));
|
|
18
|
-
if (A(t)) {
|
|
19
|
-
for (const n of Object.keys(t)) {
|
|
20
|
-
if (R$1.test(n)) throw a(_$1, "Cannot contain numeric property keys");
|
|
21
|
-
if (n === "default" || o.includes(n)) return f(r, t[n], e, o, c);
|
|
22
|
-
}
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
throw a(E, `Invalid "${r}" target "${t}"`);
|
|
26
|
-
}, s = "*", m = (r, t) => {
|
|
27
|
-
const e = r.indexOf(s), o = t.indexOf(s);
|
|
28
|
-
return e === o ? t.length > r.length : o > e;
|
|
29
|
-
};
|
|
30
|
-
function d(r, t) {
|
|
31
|
-
if (!t.includes(s) && r.hasOwnProperty(t)) return [t];
|
|
32
|
-
let e, o;
|
|
33
|
-
for (const c of Object.keys(r)) if (c.includes(s)) {
|
|
34
|
-
const [n, i, l] = c.split(s);
|
|
35
|
-
if (l === void 0 && t.startsWith(n) && t.endsWith(i)) {
|
|
36
|
-
const g = t.slice(n.length, -i.length || void 0);
|
|
37
|
-
g && (!e || m(e, c)) && (e = c, o = g);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return [e, o];
|
|
41
|
-
}
|
|
42
|
-
const p = (r) => Object.keys(r).reduce((t, e) => {
|
|
43
|
-
const o = e === "" || e[0] !== ".";
|
|
44
|
-
if (t === void 0 || t === o) return o;
|
|
45
|
-
throw a(_$1, "\"exports\" cannot contain some keys starting with \".\" and some not");
|
|
46
|
-
}, void 0), u = /^\w+:/, v = (r, t, e) => {
|
|
47
|
-
if (!r) throw new Error("\"exports\" is required");
|
|
48
|
-
t = t === "" ? "." : `./${t}`, (typeof r == "string" || Array.isArray(r) || A(r) && p(r)) && (r = { ".": r });
|
|
49
|
-
const [o, c] = d(r, t), n = f(h.Export, r[o], t, e, c);
|
|
50
|
-
if (n.length === 0) throw a(I$1, t === "." ? "No \"exports\" main defined" : `Package subpath '${t}' is not defined by "exports"`);
|
|
51
|
-
for (const i of n) if (!i.startsWith("./") && !u.test(i)) throw a(E, `Invalid "exports" target "${i}" defined in the package config`);
|
|
52
|
-
return n;
|
|
53
|
-
};
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region ../../node_modules/.pnpm/get-tsconfig@5.0.0-beta.5/node_modules/get-tsconfig/dist/index.mjs
|
|
56
|
-
var Le = Object.defineProperty;
|
|
57
|
-
var i = (e, n) => Le(e, "name", {
|
|
58
|
-
value: n,
|
|
59
|
-
configurable: !0
|
|
60
|
-
});
|
|
61
|
-
function x(e) {
|
|
62
|
-
return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
|
|
63
|
-
}
|
|
64
|
-
i(x, "slash");
|
|
65
|
-
const _e = i((e, n) => {
|
|
66
|
-
const s = `readFileSync:${n}`;
|
|
67
|
-
let t = e?.get(s);
|
|
68
|
-
return t === void 0 && (t = re.readFileSync(n, "utf8"), e?.set(s, t)), t;
|
|
69
|
-
}, "readFile"), F = i((e, n) => {
|
|
70
|
-
const s = `tryStat:${n}`;
|
|
71
|
-
let t = e?.get(s);
|
|
72
|
-
if (t === void 0) {
|
|
73
|
-
try {
|
|
74
|
-
t = re.statSync(n);
|
|
75
|
-
} catch {
|
|
76
|
-
t = null;
|
|
77
|
-
}
|
|
78
|
-
e?.set(s, t);
|
|
79
|
-
}
|
|
80
|
-
return t ?? void 0;
|
|
81
|
-
}, "tryStat"), R = i((e, n, s) => {
|
|
82
|
-
for (;;) {
|
|
83
|
-
const t = path.posix.join(e, n);
|
|
84
|
-
if (F(s, t)) return t;
|
|
85
|
-
const o = path.dirname(e);
|
|
86
|
-
if (o === e) return;
|
|
87
|
-
e = o;
|
|
88
|
-
}
|
|
89
|
-
}, "findUp");
|
|
90
|
-
function Ne(e, n = !1) {
|
|
91
|
-
const s = e.length;
|
|
92
|
-
let t = 0, o = "", r = 0, l = 16, g = 0, m = 0, k = 0, w = 0, u = 0;
|
|
93
|
-
function A(f, y) {
|
|
94
|
-
let j = 0, v = 0;
|
|
95
|
-
for (; j < f;) {
|
|
96
|
-
let d = e.charCodeAt(t);
|
|
97
|
-
if (d >= 48 && d <= 57) v = v * 16 + d - 48;
|
|
98
|
-
else if (d >= 65 && d <= 70) v = v * 16 + d - 65 + 10;
|
|
99
|
-
else if (d >= 97 && d <= 102) v = v * 16 + d - 97 + 10;
|
|
100
|
-
else break;
|
|
101
|
-
t++, j++;
|
|
102
|
-
}
|
|
103
|
-
return j < f && (v = -1), v;
|
|
104
|
-
}
|
|
105
|
-
i(A, "scanHexDigits");
|
|
106
|
-
function O(f) {
|
|
107
|
-
t = f, o = "", r = 0, l = 16, u = 0;
|
|
108
|
-
}
|
|
109
|
-
i(O, "setPosition");
|
|
110
|
-
function h() {
|
|
111
|
-
let f = t;
|
|
112
|
-
if (e.charCodeAt(t) === 48) t++;
|
|
113
|
-
else for (t++; t < e.length && S(e.charCodeAt(t));) t++;
|
|
114
|
-
if (t < e.length && e.charCodeAt(t) === 46) if (t++, t < e.length && S(e.charCodeAt(t))) for (t++; t < e.length && S(e.charCodeAt(t));) t++;
|
|
115
|
-
else return u = 3, e.substring(f, t);
|
|
116
|
-
let y = t;
|
|
117
|
-
if (t < e.length && (e.charCodeAt(t) === 69 || e.charCodeAt(t) === 101)) if (t++, (t < e.length && e.charCodeAt(t) === 43 || e.charCodeAt(t) === 45) && t++, t < e.length && S(e.charCodeAt(t))) {
|
|
118
|
-
for (t++; t < e.length && S(e.charCodeAt(t));) t++;
|
|
119
|
-
y = t;
|
|
120
|
-
} else u = 3;
|
|
121
|
-
return e.substring(f, y);
|
|
122
|
-
}
|
|
123
|
-
i(h, "scanNumber");
|
|
124
|
-
function D() {
|
|
125
|
-
let f = "", y = t;
|
|
126
|
-
for (;;) {
|
|
127
|
-
if (t >= s) {
|
|
128
|
-
f += e.substring(y, t), u = 2;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
const j = e.charCodeAt(t);
|
|
132
|
-
if (j === 34) {
|
|
133
|
-
f += e.substring(y, t), t++;
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
if (j === 92) {
|
|
137
|
-
if (f += e.substring(y, t), t++, t >= s) {
|
|
138
|
-
u = 2;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
switch (e.charCodeAt(t++)) {
|
|
142
|
-
case 34:
|
|
143
|
-
f += "\"";
|
|
144
|
-
break;
|
|
145
|
-
case 92:
|
|
146
|
-
f += "\\";
|
|
147
|
-
break;
|
|
148
|
-
case 47:
|
|
149
|
-
f += "/";
|
|
150
|
-
break;
|
|
151
|
-
case 98:
|
|
152
|
-
f += "\b";
|
|
153
|
-
break;
|
|
154
|
-
case 102:
|
|
155
|
-
f += "\f";
|
|
156
|
-
break;
|
|
157
|
-
case 110:
|
|
158
|
-
f += `
|
|
159
|
-
`;
|
|
160
|
-
break;
|
|
161
|
-
case 114:
|
|
162
|
-
f += "\r";
|
|
163
|
-
break;
|
|
164
|
-
case 116:
|
|
165
|
-
f += " ";
|
|
166
|
-
break;
|
|
167
|
-
case 117:
|
|
168
|
-
const d = A(4);
|
|
169
|
-
d >= 0 ? f += String.fromCharCode(d) : u = 4;
|
|
170
|
-
break;
|
|
171
|
-
default: u = 5;
|
|
172
|
-
}
|
|
173
|
-
y = t;
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
if (j >= 0 && j <= 31) if (P(j)) {
|
|
177
|
-
f += e.substring(y, t), u = 2;
|
|
178
|
-
break;
|
|
179
|
-
} else u = 6;
|
|
180
|
-
t++;
|
|
181
|
-
}
|
|
182
|
-
return f;
|
|
183
|
-
}
|
|
184
|
-
i(D, "scanString");
|
|
185
|
-
function c() {
|
|
186
|
-
if (o = "", u = 0, r = t, m = g, w = k, t >= s) return r = s, l = 17;
|
|
187
|
-
let f = e.charCodeAt(t);
|
|
188
|
-
if (X(f)) {
|
|
189
|
-
do
|
|
190
|
-
t++, o += String.fromCharCode(f), f = e.charCodeAt(t);
|
|
191
|
-
while (X(f));
|
|
192
|
-
return l = 15;
|
|
193
|
-
}
|
|
194
|
-
if (P(f)) return t++, o += String.fromCharCode(f), f === 13 && e.charCodeAt(t) === 10 && (t++, o += `
|
|
195
|
-
`), g++, k = t, l = 14;
|
|
196
|
-
switch (f) {
|
|
197
|
-
case 123: return t++, l = 1;
|
|
198
|
-
case 125: return t++, l = 2;
|
|
199
|
-
case 91: return t++, l = 3;
|
|
200
|
-
case 93: return t++, l = 4;
|
|
201
|
-
case 58: return t++, l = 6;
|
|
202
|
-
case 44: return t++, l = 5;
|
|
203
|
-
case 34: return t++, o = D(), l = 10;
|
|
204
|
-
case 47:
|
|
205
|
-
const y = t - 1;
|
|
206
|
-
if (e.charCodeAt(t + 1) === 47) {
|
|
207
|
-
for (t += 2; t < s && !P(e.charCodeAt(t));) t++;
|
|
208
|
-
return o = e.substring(y, t), l = 12;
|
|
209
|
-
}
|
|
210
|
-
if (e.charCodeAt(t + 1) === 42) {
|
|
211
|
-
t += 2;
|
|
212
|
-
const j = s - 1;
|
|
213
|
-
let v = !1;
|
|
214
|
-
for (; t < j;) {
|
|
215
|
-
const d = e.charCodeAt(t);
|
|
216
|
-
if (d === 42 && e.charCodeAt(t + 1) === 47) {
|
|
217
|
-
t += 2, v = !0;
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
t++, P(d) && (d === 13 && e.charCodeAt(t) === 10 && t++, g++, k = t);
|
|
221
|
-
}
|
|
222
|
-
return v || (t++, u = 1), o = e.substring(y, t), l = 13;
|
|
223
|
-
}
|
|
224
|
-
return o += String.fromCharCode(f), t++, l = 16;
|
|
225
|
-
case 45: if (o += String.fromCharCode(f), t++, t === s || !S(e.charCodeAt(t))) return l = 16;
|
|
226
|
-
case 48:
|
|
227
|
-
case 49:
|
|
228
|
-
case 50:
|
|
229
|
-
case 51:
|
|
230
|
-
case 52:
|
|
231
|
-
case 53:
|
|
232
|
-
case 54:
|
|
233
|
-
case 55:
|
|
234
|
-
case 56:
|
|
235
|
-
case 57: return o += h(), l = 11;
|
|
236
|
-
default:
|
|
237
|
-
for (; t < s && p(f);) t++, f = e.charCodeAt(t);
|
|
238
|
-
if (r !== t) {
|
|
239
|
-
switch (o = e.substring(r, t), o) {
|
|
240
|
-
case "true": return l = 8;
|
|
241
|
-
case "false": return l = 9;
|
|
242
|
-
case "null": return l = 7;
|
|
243
|
-
}
|
|
244
|
-
return l = 16;
|
|
245
|
-
}
|
|
246
|
-
return o += String.fromCharCode(f), t++, l = 16;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
i(c, "scanNext");
|
|
250
|
-
function p(f) {
|
|
251
|
-
if (X(f) || P(f)) return !1;
|
|
252
|
-
switch (f) {
|
|
253
|
-
case 125:
|
|
254
|
-
case 93:
|
|
255
|
-
case 123:
|
|
256
|
-
case 91:
|
|
257
|
-
case 34:
|
|
258
|
-
case 58:
|
|
259
|
-
case 44:
|
|
260
|
-
case 47: return !1;
|
|
261
|
-
}
|
|
262
|
-
return !0;
|
|
263
|
-
}
|
|
264
|
-
i(p, "isUnknownContentCharacter");
|
|
265
|
-
function b() {
|
|
266
|
-
let f;
|
|
267
|
-
do
|
|
268
|
-
f = c();
|
|
269
|
-
while (f >= 12 && f <= 15);
|
|
270
|
-
return f;
|
|
271
|
-
}
|
|
272
|
-
return i(b, "scanNextNonTrivia"), {
|
|
273
|
-
setPosition: O,
|
|
274
|
-
getPosition: i(() => t, "getPosition"),
|
|
275
|
-
scan: n ? b : c,
|
|
276
|
-
getToken: i(() => l, "getToken"),
|
|
277
|
-
getTokenValue: i(() => o, "getTokenValue"),
|
|
278
|
-
getTokenOffset: i(() => r, "getTokenOffset"),
|
|
279
|
-
getTokenLength: i(() => t - r, "getTokenLength"),
|
|
280
|
-
getTokenStartLine: i(() => m, "getTokenStartLine"),
|
|
281
|
-
getTokenStartCharacter: i(() => r - w, "getTokenStartCharacter"),
|
|
282
|
-
getTokenError: i(() => u, "getTokenError")
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
i(Ne, "createScanner");
|
|
286
|
-
function X(e) {
|
|
287
|
-
return e === 32 || e === 9;
|
|
288
|
-
}
|
|
289
|
-
i(X, "isWhiteSpace");
|
|
290
|
-
function P(e) {
|
|
291
|
-
return e === 10 || e === 13;
|
|
292
|
-
}
|
|
293
|
-
i(P, "isLineBreak");
|
|
294
|
-
function S(e) {
|
|
295
|
-
return e >= 48 && e <= 57;
|
|
296
|
-
}
|
|
297
|
-
i(S, "isDigit");
|
|
298
|
-
var ce;
|
|
299
|
-
(function(e) {
|
|
300
|
-
e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
|
|
301
|
-
})(ce || (ce = {})), new Array(20).fill(0).map((e, n) => " ".repeat(n));
|
|
302
|
-
const _ = 200;
|
|
303
|
-
new Array(_).fill(0).map((e, n) => `
|
|
304
|
-
` + " ".repeat(n)), new Array(_).fill(0).map((e, n) => "\r" + " ".repeat(n)), new Array(_).fill(0).map((e, n) => `\r
|
|
305
|
-
` + " ".repeat(n)), new Array(_).fill(0).map((e, n) => `
|
|
306
|
-
` + " ".repeat(n)), new Array(_).fill(0).map((e, n) => "\r" + " ".repeat(n)), new Array(_).fill(0).map((e, n) => `\r
|
|
307
|
-
` + " ".repeat(n));
|
|
308
|
-
var W;
|
|
309
|
-
(function(e) {
|
|
310
|
-
e.DEFAULT = { allowTrailingComma: !1 };
|
|
311
|
-
})(W || (W = {}));
|
|
312
|
-
function Re(e, n = [], s = W.DEFAULT) {
|
|
313
|
-
let t = null, o = [];
|
|
314
|
-
const r = [];
|
|
315
|
-
function l(m) {
|
|
316
|
-
Array.isArray(o) ? o.push(m) : t !== null && (o[t] = m);
|
|
317
|
-
}
|
|
318
|
-
return i(l, "onValue"), Pe(e, {
|
|
319
|
-
onObjectBegin: i(() => {
|
|
320
|
-
const m = {};
|
|
321
|
-
l(m), r.push(o), o = m, t = null;
|
|
322
|
-
}, "onObjectBegin"),
|
|
323
|
-
onObjectProperty: i((m) => {
|
|
324
|
-
t = m;
|
|
325
|
-
}, "onObjectProperty"),
|
|
326
|
-
onObjectEnd: i(() => {
|
|
327
|
-
o = r.pop();
|
|
328
|
-
}, "onObjectEnd"),
|
|
329
|
-
onArrayBegin: i(() => {
|
|
330
|
-
const m = [];
|
|
331
|
-
l(m), r.push(o), o = m, t = null;
|
|
332
|
-
}, "onArrayBegin"),
|
|
333
|
-
onArrayEnd: i(() => {
|
|
334
|
-
o = r.pop();
|
|
335
|
-
}, "onArrayEnd"),
|
|
336
|
-
onLiteralValue: l,
|
|
337
|
-
onError: i((m, k, w) => {
|
|
338
|
-
n.push({
|
|
339
|
-
error: m,
|
|
340
|
-
offset: k,
|
|
341
|
-
length: w
|
|
342
|
-
});
|
|
343
|
-
}, "onError")
|
|
344
|
-
}, s), o[0];
|
|
345
|
-
}
|
|
346
|
-
i(Re, "parse$1");
|
|
347
|
-
function Pe(e, n, s = W.DEFAULT) {
|
|
348
|
-
const t = Ne(e, !1), o = [];
|
|
349
|
-
let r = 0;
|
|
350
|
-
function l(T) {
|
|
351
|
-
return T ? () => r === 0 && T(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter()) : () => !0;
|
|
352
|
-
}
|
|
353
|
-
i(l, "toNoArgVisit");
|
|
354
|
-
function g(T) {
|
|
355
|
-
return T ? (E) => r === 0 && T(E, t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter()) : () => !0;
|
|
356
|
-
}
|
|
357
|
-
i(g, "toOneArgVisit");
|
|
358
|
-
function m(T) {
|
|
359
|
-
return T ? (E) => r === 0 && T(E, t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter(), () => o.slice()) : () => !0;
|
|
360
|
-
}
|
|
361
|
-
i(m, "toOneArgVisitWithPath");
|
|
362
|
-
function k(T) {
|
|
363
|
-
return T ? () => {
|
|
364
|
-
r > 0 ? r++ : T(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter(), () => o.slice()) === !1 && (r = 1);
|
|
365
|
-
} : () => !0;
|
|
366
|
-
}
|
|
367
|
-
i(k, "toBeginVisit");
|
|
368
|
-
function w(T) {
|
|
369
|
-
return T ? () => {
|
|
370
|
-
r > 0 && r--, r === 0 && T(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter());
|
|
371
|
-
} : () => !0;
|
|
372
|
-
}
|
|
373
|
-
i(w, "toEndVisit");
|
|
374
|
-
const u = k(n.onObjectBegin), A = m(n.onObjectProperty), O = w(n.onObjectEnd), h = k(n.onArrayBegin), D = w(n.onArrayEnd), c = m(n.onLiteralValue), p = g(n.onSeparator), b = l(n.onComment), f = g(n.onError), y = s && s.disallowComments, j = s && s.allowTrailingComma;
|
|
375
|
-
function v() {
|
|
376
|
-
for (;;) {
|
|
377
|
-
const T = t.scan();
|
|
378
|
-
switch (t.getTokenError()) {
|
|
379
|
-
case 4:
|
|
380
|
-
d(14);
|
|
381
|
-
break;
|
|
382
|
-
case 5:
|
|
383
|
-
d(15);
|
|
384
|
-
break;
|
|
385
|
-
case 3:
|
|
386
|
-
d(13);
|
|
387
|
-
break;
|
|
388
|
-
case 1:
|
|
389
|
-
y || d(11);
|
|
390
|
-
break;
|
|
391
|
-
case 2:
|
|
392
|
-
d(12);
|
|
393
|
-
break;
|
|
394
|
-
case 6:
|
|
395
|
-
d(16);
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
switch (T) {
|
|
399
|
-
case 12:
|
|
400
|
-
case 13:
|
|
401
|
-
y ? d(10) : b();
|
|
402
|
-
break;
|
|
403
|
-
case 16:
|
|
404
|
-
d(1);
|
|
405
|
-
break;
|
|
406
|
-
case 15:
|
|
407
|
-
case 14: break;
|
|
408
|
-
default: return T;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
i(v, "scanNext");
|
|
413
|
-
function d(T, E = [], ie = []) {
|
|
414
|
-
if (f(T), E.length + ie.length > 0) {
|
|
415
|
-
let V = t.getToken();
|
|
416
|
-
for (; V !== 17;) {
|
|
417
|
-
if (E.indexOf(V) !== -1) {
|
|
418
|
-
v();
|
|
419
|
-
break;
|
|
420
|
-
} else if (ie.indexOf(V) !== -1) break;
|
|
421
|
-
V = v();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
i(d, "handleError");
|
|
426
|
-
function L(T) {
|
|
427
|
-
const E = t.getTokenValue();
|
|
428
|
-
return T ? c(E) : (A(E), o.push(E)), v(), !0;
|
|
429
|
-
}
|
|
430
|
-
i(L, "parseString");
|
|
431
|
-
function B() {
|
|
432
|
-
switch (t.getToken()) {
|
|
433
|
-
case 11:
|
|
434
|
-
const T = t.getTokenValue();
|
|
435
|
-
let E = Number(T);
|
|
436
|
-
isNaN(E) && (d(2), E = 0), c(E);
|
|
437
|
-
break;
|
|
438
|
-
case 7:
|
|
439
|
-
c(null);
|
|
440
|
-
break;
|
|
441
|
-
case 8:
|
|
442
|
-
c(!0);
|
|
443
|
-
break;
|
|
444
|
-
case 9:
|
|
445
|
-
c(!1);
|
|
446
|
-
break;
|
|
447
|
-
default: return !1;
|
|
448
|
-
}
|
|
449
|
-
return v(), !0;
|
|
450
|
-
}
|
|
451
|
-
i(B, "parseLiteral");
|
|
452
|
-
function $() {
|
|
453
|
-
return t.getToken() !== 10 ? (d(3, [], [2, 5]), !1) : (L(!1), t.getToken() === 6 ? (p(":"), v(), H() || d(4, [], [2, 5])) : d(5, [], [2, 5]), o.pop(), !0);
|
|
454
|
-
}
|
|
455
|
-
i($, "parseProperty");
|
|
456
|
-
function N() {
|
|
457
|
-
u(), v();
|
|
458
|
-
let T = !1;
|
|
459
|
-
for (; t.getToken() !== 2 && t.getToken() !== 17;) {
|
|
460
|
-
if (t.getToken() === 5) {
|
|
461
|
-
if (T || d(4, [], []), p(","), v(), t.getToken() === 2 && j) break;
|
|
462
|
-
} else T && d(6, [], []);
|
|
463
|
-
$() || d(4, [], [2, 5]), T = !0;
|
|
464
|
-
}
|
|
465
|
-
return O(), t.getToken() !== 2 ? d(7, [2], []) : v(), !0;
|
|
466
|
-
}
|
|
467
|
-
i(N, "parseObject");
|
|
468
|
-
function $e() {
|
|
469
|
-
h(), v();
|
|
470
|
-
let T = !0, E = !1;
|
|
471
|
-
for (; t.getToken() !== 4 && t.getToken() !== 17;) {
|
|
472
|
-
if (t.getToken() === 5) {
|
|
473
|
-
if (E || d(4, [], []), p(","), v(), t.getToken() === 4 && j) break;
|
|
474
|
-
} else E && d(6, [], []);
|
|
475
|
-
T ? (o.push(0), T = !1) : o[o.length - 1]++, H() || d(4, [], [4, 5]), E = !0;
|
|
476
|
-
}
|
|
477
|
-
return D(), T || o.pop(), t.getToken() !== 4 ? d(8, [4], []) : v(), !0;
|
|
478
|
-
}
|
|
479
|
-
i($e, "parseArray");
|
|
480
|
-
function H() {
|
|
481
|
-
switch (t.getToken()) {
|
|
482
|
-
case 3: return $e();
|
|
483
|
-
case 1: return N();
|
|
484
|
-
case 10: return L(!0);
|
|
485
|
-
default: return B();
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
return i(H, "parseValue"), v(), t.getToken() === 17 ? s.allowEmptyContent ? !0 : (d(4, [], []), !1) : H() ? (t.getToken() !== 17 && d(9, [], []), !0) : (d(4, [], []), !1);
|
|
489
|
-
}
|
|
490
|
-
i(Pe, "visit");
|
|
491
|
-
var fe;
|
|
492
|
-
(function(e) {
|
|
493
|
-
e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
|
|
494
|
-
})(fe || (fe = {}));
|
|
495
|
-
var ue;
|
|
496
|
-
(function(e) {
|
|
497
|
-
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
498
|
-
})(ue || (ue = {}));
|
|
499
|
-
const Ve = Re;
|
|
500
|
-
var ae;
|
|
501
|
-
(function(e) {
|
|
502
|
-
e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
|
|
503
|
-
})(ae || (ae = {}));
|
|
504
|
-
const Y = i((e, n) => Ve(_e(n, e)), "readJsonc"), pe = i(() => {
|
|
505
|
-
const { findPnpApi: e } = module;
|
|
506
|
-
return e && e(process.cwd());
|
|
507
|
-
}, "getPnpApi"), We = "detectTypeScriptVersion:", Me = i((e, n) => {
|
|
508
|
-
const s = `${We}${e}`, t = n?.get(s);
|
|
509
|
-
if (t !== void 0) return t ?? void 0;
|
|
510
|
-
let o;
|
|
511
|
-
const r = pe();
|
|
512
|
-
if (r) try {
|
|
513
|
-
o = r.resolveRequest("typescript/package.json", e) ?? void 0;
|
|
514
|
-
} catch {}
|
|
515
|
-
o ??= R(path.resolve(e), path.join("node_modules", "typescript", "package.json"), n);
|
|
516
|
-
let l;
|
|
517
|
-
if (o) try {
|
|
518
|
-
const g = Y(o, n);
|
|
519
|
-
typeof g?.version == "string" && (l = g.version);
|
|
520
|
-
} catch {}
|
|
521
|
-
return n?.set(s, l ?? null), l;
|
|
522
|
-
}, "detectTypeScriptVersion"), I = "package.json", M = "tsconfig.json", Je = i((e, n, s) => {
|
|
523
|
-
const t = module.createRequire(path.join(s, "tsconfig.json"));
|
|
524
|
-
if (e !== n) try {
|
|
525
|
-
return t.resolve(e);
|
|
526
|
-
} catch {}
|
|
527
|
-
try {
|
|
528
|
-
return t.resolve(n);
|
|
529
|
-
} catch {}
|
|
530
|
-
try {
|
|
531
|
-
return t.resolve(`${n}/${I}`);
|
|
532
|
-
} catch {}
|
|
533
|
-
}, "resolvePackageEntryWithNode"), Z = i((e, n, s, t) => {
|
|
534
|
-
const o = `resolveFromPackageJsonPath:${e}:${n}:${s}`;
|
|
535
|
-
if (t?.has(o)) return t.get(o) || !1;
|
|
536
|
-
const r = Y(e, t);
|
|
537
|
-
if (!r) return;
|
|
538
|
-
let l = n || M;
|
|
539
|
-
if (!s && r.exports) try {
|
|
540
|
-
const [g] = v(r.exports, n, ["require", "types"]);
|
|
541
|
-
l = g;
|
|
542
|
-
} catch {
|
|
543
|
-
return t?.set(o, ""), !1;
|
|
544
|
-
}
|
|
545
|
-
else !n && r.tsconfig && (l = r.tsconfig);
|
|
546
|
-
return l = path.join(e, "..", l), t?.set(o, l), l;
|
|
547
|
-
}, "resolveFromPackageJsonPath"), ze = i((e, n, s) => {
|
|
548
|
-
const t = `resolveExtendsPath:${e}:${n}`;
|
|
549
|
-
if (s?.has(t)) return s.get(t) || void 0;
|
|
550
|
-
const o = Ge(e, n, s);
|
|
551
|
-
return s?.set(t, o || ""), o;
|
|
552
|
-
}, "resolveExtendsPath"), Ge = i((e, n, s) => {
|
|
553
|
-
let t = e;
|
|
554
|
-
if (e === ".." && (t = path.join(t, M)), e[0] === "." && (t = path.resolve(n, t)), path.isAbsolute(t)) {
|
|
555
|
-
const c = F(s, t);
|
|
556
|
-
if (c) {
|
|
557
|
-
if (c.isFile()) return t;
|
|
558
|
-
} else if (!t.endsWith(".json")) {
|
|
559
|
-
const p = `${t}.json`;
|
|
560
|
-
if (F(s, p)) return p;
|
|
561
|
-
}
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
const [o, ...r] = e.split("/"), l = o[0] === "@" ? `${o}/${r.shift()}` : o, g = r.join("/"), m = pe();
|
|
565
|
-
if (m) {
|
|
566
|
-
const { resolveRequest: c } = m;
|
|
567
|
-
try {
|
|
568
|
-
if (l === e) {
|
|
569
|
-
const p = c(path.join(l, I), n);
|
|
570
|
-
if (p) {
|
|
571
|
-
const b = Z(p, g, !1, s);
|
|
572
|
-
if (b && F(s, b)) return b;
|
|
573
|
-
}
|
|
574
|
-
} else {
|
|
575
|
-
let p;
|
|
576
|
-
try {
|
|
577
|
-
p = c(e, n, { extensions: [".json"] });
|
|
578
|
-
} catch {
|
|
579
|
-
p = c(path.join(e, M), n);
|
|
580
|
-
}
|
|
581
|
-
if (p) return p;
|
|
582
|
-
}
|
|
583
|
-
} catch {}
|
|
584
|
-
}
|
|
585
|
-
const k = Je(e, l, n);
|
|
586
|
-
let w;
|
|
587
|
-
if (k) {
|
|
588
|
-
if (path.basename(k) !== I && k.endsWith(".json")) return k;
|
|
589
|
-
w = path.basename(k) === I ? k : R(path.dirname(k), I, s);
|
|
590
|
-
}
|
|
591
|
-
const u = w && path.dirname(w) || R(path.resolve(n), path.join("node_modules", l), s);
|
|
592
|
-
if (!u || !F(s, u)?.isDirectory()) return;
|
|
593
|
-
const A = path.join(u, I);
|
|
594
|
-
if (F(s, A)) {
|
|
595
|
-
const c = Z(A, g, !1, s);
|
|
596
|
-
if (c === !1) return;
|
|
597
|
-
if (c && F(s, c)?.isFile()) return c;
|
|
598
|
-
}
|
|
599
|
-
const O = path.join(u, g), h = O.endsWith(".json");
|
|
600
|
-
if (!h) {
|
|
601
|
-
const c = `${O}.json`;
|
|
602
|
-
if (F(s, c)) return c;
|
|
603
|
-
}
|
|
604
|
-
const D = F(s, O);
|
|
605
|
-
if (D) {
|
|
606
|
-
if (D.isDirectory()) {
|
|
607
|
-
const c = path.join(O, I);
|
|
608
|
-
if (F(s, c)) {
|
|
609
|
-
const b = Z(c, "", !0, s);
|
|
610
|
-
if (b && F(s, b)) return b;
|
|
611
|
-
}
|
|
612
|
-
const p = path.join(O, M);
|
|
613
|
-
if (F(s, p)) return p;
|
|
614
|
-
} else if (h) return O;
|
|
615
|
-
}
|
|
616
|
-
}, "resolveExtendsPathUncached"), q = Symbol("implicitBaseUrl"), U = "${configDir}", K = /^\.{1,2}(\/.*)?$/, J = i((e) => {
|
|
617
|
-
const n = x(e);
|
|
618
|
-
return K.test(n) ? n : `./${n}`;
|
|
619
|
-
}, "normalizeRelativePath"), Qe = i((e) => {
|
|
620
|
-
const n = { ...e };
|
|
621
|
-
if (n.strict) for (const t of [
|
|
622
|
-
"noImplicitAny",
|
|
623
|
-
"noImplicitThis",
|
|
624
|
-
"strictNullChecks",
|
|
625
|
-
"strictFunctionTypes",
|
|
626
|
-
"strictBindCallApply",
|
|
627
|
-
"strictPropertyInitialization",
|
|
628
|
-
"strictBuiltinIteratorReturn",
|
|
629
|
-
"alwaysStrict",
|
|
630
|
-
"useUnknownInCatchVariables"
|
|
631
|
-
]) n[t] === void 0 && (n[t] = !0);
|
|
632
|
-
if (n.composite && (n.declaration ??= !0, n.incremental ??= !0), n.target) {
|
|
633
|
-
let s = n.target.toLowerCase();
|
|
634
|
-
s === "es2015" && (s = "es6"), n.target = s, s === "esnext" && (n.module ??= "es6", n.useDefineForClassFields ??= !0), (s === "es6" || s === "es2016" || s === "es2017" || s === "es2018" || s === "es2019" || s === "es2020" || s === "es2021" || s === "es2022" || s === "es2023" || s === "es2024" || s === "es2025") && (n.module ??= "es6"), (s === "es2022" || s === "es2023" || s === "es2024" || s === "es2025") && (n.useDefineForClassFields ??= !0);
|
|
635
|
-
}
|
|
636
|
-
if (n.module) {
|
|
637
|
-
let s = n.module.toLowerCase();
|
|
638
|
-
if (s === "es2015" && (s = "es6"), n.module = s, (s === "es6" || s === "es2020" || s === "es2022" || s === "esnext" || s === "none" || s === "system" || s === "umd" || s === "amd") && (n.moduleResolution ??= "classic"), s === "system" && (n.allowSyntheticDefaultImports ??= !0), (s === "node16" || s === "node18" || s === "node20" || s === "nodenext" || s === "preserve") && (n.esModuleInterop ??= !0, n.allowSyntheticDefaultImports ??= !0), (s === "node16" || s === "node18" || s === "node20" || s === "nodenext") && (n.moduleDetection ??= "force"), (s === "node16" || s === "node18") && (n.target ??= "es2022", n.moduleResolution ??= "node16"), s === "node20" && (n.target ??= "es2023", n.moduleResolution ??= "node16", n.resolveJsonModule ??= !0), s === "nodenext" && (n.target ??= "esnext", n.moduleResolution ??= "nodenext", n.resolveJsonModule ??= !0), s === "node16" || s === "node18" || s === "node20" || s === "nodenext") {
|
|
639
|
-
const t = n.target;
|
|
640
|
-
(t === "es3" || t === "es2022" || t === "es2023" || t === "es2024" || t === "esnext") && (n.useDefineForClassFields ??= !0);
|
|
641
|
-
}
|
|
642
|
-
s === "preserve" && (n.moduleResolution ??= "bundler");
|
|
643
|
-
}
|
|
644
|
-
if (n.moduleResolution) {
|
|
645
|
-
let s = n.moduleResolution.toLowerCase();
|
|
646
|
-
s === "node" && (s = "node10"), n.moduleResolution = s, (s === "node16" || s === "nodenext" || s === "bundler") && (n.resolvePackageJsonExports ??= !0, n.resolvePackageJsonImports ??= !0), s === "bundler" && (n.allowSyntheticDefaultImports ??= !0, n.resolveJsonModule ??= !0);
|
|
647
|
-
}
|
|
648
|
-
for (const s of [
|
|
649
|
-
"jsx",
|
|
650
|
-
"moduleDetection",
|
|
651
|
-
"importsNotUsedAsValues",
|
|
652
|
-
"newLine"
|
|
653
|
-
]) n[s] && (n[s] = n[s].toLowerCase());
|
|
654
|
-
return n.esModuleInterop && (n.allowSyntheticDefaultImports ??= !0), n.verbatimModuleSyntax && (n.isolatedModules ??= !0, n.preserveConstEnums ??= !0), n.isolatedModules && (n.preserveConstEnums ??= !0), n.rewriteRelativeImportExtensions && (n.allowImportingTsExtensions ??= !0), n.lib && (n.lib = n.lib.map((s) => s.toLowerCase())), n.checkJs && (n.allowJs ??= !0), n;
|
|
655
|
-
}, "normalizeCompilerOptions"), He = i((e, n) => {
|
|
656
|
-
!n.has("target") && !Xe(e.module) && (e.target = "es3");
|
|
657
|
-
}, "applyV4Defaults"), Xe = i((e) => e === "node16" || e === "node18" || e === "node20" || e === "nodenext", "moduleDictatesTarget$1"), Ye = i((e, n) => {
|
|
658
|
-
!n.has("target") && !Ze(e.module) && (e.target = "es5");
|
|
659
|
-
}, "applyV5Defaults"), Ze = i((e) => e === "node16" || e === "node18" || e === "node20" || e === "nodenext", "moduleDictatesTarget"), qe = i((e, n) => {
|
|
660
|
-
n.has("strict") || (e.strict = !0), n.has("target") || (e.target = "es2025"), n.has("module") || (e.module = "es2022"), n.has("moduleResolution") || (e.moduleResolution = "bundler"), n.has("rootDir") || (e.rootDir = "."), n.has("types") || (e.types = []), n.has("noUncheckedSideEffectImports") || (e.noUncheckedSideEffectImports = !0), n.has("libReplacement") || (e.libReplacement = !1);
|
|
661
|
-
}, "applyV6Defaults"), Ke = [
|
|
662
|
-
[4, He],
|
|
663
|
-
[5, Ye],
|
|
664
|
-
[6, qe]
|
|
665
|
-
], Ce = i((e) => {
|
|
666
|
-
const n = /^v?(\d+)/.exec(e);
|
|
667
|
-
return n ? Number(n[1]) : void 0;
|
|
668
|
-
}, "parseMajor"), et = i((e, n) => {
|
|
669
|
-
const s = Ce(n);
|
|
670
|
-
if (s === void 0) return;
|
|
671
|
-
const t = new Set(Object.keys(e));
|
|
672
|
-
for (const [o, r] of Ke) o <= s && r(e, t);
|
|
673
|
-
}, "applyVersionDefaults"), C = i((e, n) => J(path.relative(e, n)), "pathRelative"), me = [
|
|
674
|
-
"files",
|
|
675
|
-
"include",
|
|
676
|
-
"exclude"
|
|
677
|
-
], ge = i((e, n, s) => {
|
|
678
|
-
const t = path.join(n, s);
|
|
679
|
-
return x(path.relative(e, t)) || "./";
|
|
680
|
-
}, "resolveAndRelativize"), tt = i((e, n, s) => {
|
|
681
|
-
const t = path.relative(e, n);
|
|
682
|
-
if (!t) return s;
|
|
683
|
-
return x(`${t}/${s.startsWith("./") ? s.slice(2) : s}`);
|
|
684
|
-
}, "prefixPattern"), de = ["outDir", "declarationDir"], z = i((e, n) => {
|
|
685
|
-
if (e.startsWith(U)) return x(path.join(n, e.slice(12)));
|
|
686
|
-
}, "interpolateConfigDir"), nt = [
|
|
687
|
-
"outDir",
|
|
688
|
-
"declarationDir",
|
|
689
|
-
"outFile",
|
|
690
|
-
"rootDir",
|
|
691
|
-
"baseUrl",
|
|
692
|
-
"tsBuildInfoFile"
|
|
693
|
-
], ke = i((e, n = {}) => {
|
|
694
|
-
if (e.length === 0) throw new Error("Chain must not be empty");
|
|
695
|
-
const { typescriptVersion: s } = n, t = new Map(e.map((u) => [u.path, u])), o = /* @__PURE__ */ new Map(), r = i((u) => {
|
|
696
|
-
const A = o.get(u);
|
|
697
|
-
if (A) return A;
|
|
698
|
-
const O = t.get(u);
|
|
699
|
-
if (!O) throw new Error(`Config not found in chain: ${u}`);
|
|
700
|
-
const h = O.config, D = path.dirname(u);
|
|
701
|
-
let c = {
|
|
702
|
-
...h,
|
|
703
|
-
...h.compilerOptions && { compilerOptions: { ...h.compilerOptions } },
|
|
704
|
-
...h.watchOptions && { watchOptions: { ...h.watchOptions } }
|
|
705
|
-
};
|
|
706
|
-
if (delete c.extends, c.compilerOptions?.paths && !c.compilerOptions.baseUrl && (c.compilerOptions[q] = D), h.extends) {
|
|
707
|
-
const p = Array.isArray(h.extends) ? h.extends : [h.extends];
|
|
708
|
-
for (const b of p.toReversed()) {
|
|
709
|
-
const f = r(b), y = path.dirname(b), { references: j, ...v } = f;
|
|
710
|
-
if (v.compilerOptions) {
|
|
711
|
-
const L = { ...v.compilerOptions };
|
|
712
|
-
for (const B of [
|
|
713
|
-
"baseUrl",
|
|
714
|
-
"outDir",
|
|
715
|
-
"declarationDir",
|
|
716
|
-
"rootDir"
|
|
717
|
-
]) {
|
|
718
|
-
const $ = L[B];
|
|
719
|
-
$ && !$.startsWith(U) && (L[B] = ge(D, y, $));
|
|
720
|
-
}
|
|
721
|
-
for (const B of ["rootDirs", "typeRoots"]) {
|
|
722
|
-
const $ = L[B];
|
|
723
|
-
$ && (L[B] = $.map((N) => N.startsWith(U) ? N : ge(D, y, N)));
|
|
724
|
-
}
|
|
725
|
-
v.compilerOptions = L;
|
|
726
|
-
}
|
|
727
|
-
for (const L of me) {
|
|
728
|
-
const B = v[L];
|
|
729
|
-
B && (v[L] = B.map(($) => $.startsWith(U) ? $ : tt(D, y, $)));
|
|
730
|
-
}
|
|
731
|
-
const d = {
|
|
732
|
-
...v,
|
|
733
|
-
...c,
|
|
734
|
-
compilerOptions: {
|
|
735
|
-
...v.compilerOptions,
|
|
736
|
-
...c.compilerOptions
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
v.watchOptions && (d.watchOptions = {
|
|
740
|
-
...v.watchOptions,
|
|
741
|
-
...c.watchOptions
|
|
742
|
-
}), c = d;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
if (c.compilerOptions) {
|
|
746
|
-
const { compilerOptions: p } = c;
|
|
747
|
-
for (const f of ["baseUrl", "rootDir"]) {
|
|
748
|
-
const y = p[f];
|
|
749
|
-
if (y && !y.startsWith(U)) p[f] = C(D, path.resolve(D, y));
|
|
750
|
-
}
|
|
751
|
-
for (const f of de) {
|
|
752
|
-
let y = p[f];
|
|
753
|
-
y && (Array.isArray(c.exclude) || (c.exclude = de.map((j) => p[j]).filter(Boolean)), y.startsWith(U) || (y = J(y)), p[f] = y);
|
|
754
|
-
}
|
|
755
|
-
} else c.compilerOptions = {};
|
|
756
|
-
if (c.include && (c.include = c.include.map(x)), c.files && (c.files = c.files.map((p) => p.startsWith(U) ? p : J(p))), c.watchOptions) {
|
|
757
|
-
const { watchOptions: p } = c;
|
|
758
|
-
for (const b of ["excludeDirectories", "excludeFiles"]) p[b] && (p[b] = p[b].map((f) => x(path.resolve(D, f))));
|
|
759
|
-
for (const b of [
|
|
760
|
-
"watchFile",
|
|
761
|
-
"watchDirectory",
|
|
762
|
-
"fallbackPolling"
|
|
763
|
-
]) if (p[b]) {
|
|
764
|
-
const f = p;
|
|
765
|
-
f[b] = p[b].toLowerCase();
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
return o.set(u, c), c;
|
|
769
|
-
}, "resolveEntry"), l = e[0], g = r(l.path), m = path.dirname(l.path), k = {
|
|
770
|
-
...g,
|
|
771
|
-
compilerOptions: g.compilerOptions ? { ...g.compilerOptions } : {}
|
|
772
|
-
}, { compilerOptions: w } = k;
|
|
773
|
-
if (w) {
|
|
774
|
-
for (const u of nt) {
|
|
775
|
-
const A = w[u];
|
|
776
|
-
if (A) {
|
|
777
|
-
const O = z(A, m);
|
|
778
|
-
w[u] = O ? C(m, O) : A;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
for (const u of ["rootDirs", "typeRoots"]) {
|
|
782
|
-
const A = w[u];
|
|
783
|
-
A && (w[u] = A.map((O) => {
|
|
784
|
-
const h = z(O, m);
|
|
785
|
-
return h ? C(m, h) : J(O);
|
|
786
|
-
}));
|
|
787
|
-
}
|
|
788
|
-
if (w.paths) {
|
|
789
|
-
const u = {};
|
|
790
|
-
for (const [A, O] of Object.entries(w.paths)) u[A] = O.map((h) => z(h, m) ?? h);
|
|
791
|
-
w.paths = u;
|
|
792
|
-
}
|
|
793
|
-
s && et(w, s), k.compilerOptions = Qe(w);
|
|
794
|
-
}
|
|
795
|
-
for (const u of me) {
|
|
796
|
-
const A = k[u];
|
|
797
|
-
A && (k[u] = A.map((O) => z(O, m) ?? O));
|
|
798
|
-
}
|
|
799
|
-
return {
|
|
800
|
-
path: l.path,
|
|
801
|
-
config: k,
|
|
802
|
-
sources: e.map((u) => u.path)
|
|
803
|
-
};
|
|
804
|
-
}, "resolveExtendsChain"), we = i((e, n = {}) => {
|
|
805
|
-
const { cache: s = /* @__PURE__ */ new Map() } = n, t = path.resolve(e), o = [], r = /* @__PURE__ */ new Set(), l = i((g, m) => {
|
|
806
|
-
const k = x(g);
|
|
807
|
-
if (r.has(k)) return;
|
|
808
|
-
r.add(k);
|
|
809
|
-
let w;
|
|
810
|
-
try {
|
|
811
|
-
w = Y(g, s) || {};
|
|
812
|
-
} catch {
|
|
813
|
-
throw new Error(`Cannot resolve tsconfig at path: ${g}`);
|
|
814
|
-
}
|
|
815
|
-
if (typeof w != "object") throw new SyntaxError(`Failed to parse tsconfig at: ${g}`);
|
|
816
|
-
const u = path.dirname(g);
|
|
817
|
-
if (w.extends) {
|
|
818
|
-
const A = Array.isArray(w.extends), h = (A ? w.extends : [w.extends]).map((c) => {
|
|
819
|
-
const p = ze(c, u, s);
|
|
820
|
-
if (!p) throw new Error(`File '${c}' not found.`);
|
|
821
|
-
const b = x(p);
|
|
822
|
-
if (m.has(b) || b === k) throw new Error(`Circularity detected while resolving configuration: ${b}`);
|
|
823
|
-
return b;
|
|
824
|
-
});
|
|
825
|
-
w.extends = A ? h : h[0], o.push({
|
|
826
|
-
path: k,
|
|
827
|
-
config: w
|
|
828
|
-
});
|
|
829
|
-
const D = new Set(m);
|
|
830
|
-
D.add(k);
|
|
831
|
-
for (const c of [...h].reverse()) l(c, D);
|
|
832
|
-
} else o.push({
|
|
833
|
-
path: k,
|
|
834
|
-
config: w
|
|
835
|
-
});
|
|
836
|
-
}, "collect");
|
|
837
|
-
return l(t, /* @__PURE__ */ new Set()), o;
|
|
838
|
-
}, "getExtendsChain"), ee = i((e, n = {}) => {
|
|
839
|
-
const { cache: s = /* @__PURE__ */ new Map(), typescriptVersion: t = "auto" } = n, o = we(e, { cache: s });
|
|
840
|
-
let r;
|
|
841
|
-
return t === "auto" ? r = Me(path.dirname(o[0].path), s) : t !== !1 && (r = t), ke(o, { typescriptVersion: r });
|
|
842
|
-
}, "readTsconfig");
|
|
843
|
-
var st = Object.defineProperty, G = i((e, n) => st(e, "name", {
|
|
844
|
-
value: n,
|
|
845
|
-
configurable: !0
|
|
846
|
-
}), "s");
|
|
847
|
-
const ve = G((e) => {
|
|
848
|
-
let n = "";
|
|
849
|
-
for (let s = 0; s < e.length; s += 1) {
|
|
850
|
-
const t = e[s], o = t.toUpperCase();
|
|
851
|
-
n += t === o ? t.toLowerCase() : o;
|
|
852
|
-
}
|
|
853
|
-
return n;
|
|
854
|
-
}, "invertCase"), te = /* @__PURE__ */ new Map(), be = G((e, n) => {
|
|
855
|
-
const s = Se.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
|
|
856
|
-
try {
|
|
857
|
-
return n.writeFileSync(s, ""), !n.existsSync(ve(s));
|
|
858
|
-
} finally {
|
|
859
|
-
try {
|
|
860
|
-
n.unlinkSync(s);
|
|
861
|
-
} catch {}
|
|
862
|
-
}
|
|
863
|
-
}, "checkDirectoryCaseWithWrite"), ot = G((e, n, s) => {
|
|
864
|
-
try {
|
|
865
|
-
return be(e, s);
|
|
866
|
-
} catch (t) {
|
|
867
|
-
if (n === void 0) return be(Ie.tmpdir(), s);
|
|
868
|
-
throw t;
|
|
869
|
-
}
|
|
870
|
-
}, "checkDirectoryCaseWithFallback"), it = G((e, n = Ue, s = !0) => {
|
|
871
|
-
const t = e ?? process.cwd();
|
|
872
|
-
if (s && te.has(t)) return te.get(t);
|
|
873
|
-
let o;
|
|
874
|
-
const r = ve(t);
|
|
875
|
-
return r !== t && n.existsSync(t) ? o = !n.existsSync(r) : o = ot(t, e, n), s && te.set(t, o), o;
|
|
876
|
-
}, "isFsCaseSensitive"), { join: ye } = path.posix, ne = {
|
|
877
|
-
ts: [
|
|
878
|
-
".ts",
|
|
879
|
-
".tsx",
|
|
880
|
-
".d.ts"
|
|
881
|
-
],
|
|
882
|
-
cts: [".cts", ".d.cts"],
|
|
883
|
-
mts: [".mts", ".d.mts"]
|
|
884
|
-
}, rt = i((e) => {
|
|
885
|
-
const n = [...ne.ts], s = [...ne.cts], t = [...ne.mts];
|
|
886
|
-
return e?.allowJs && (n.push(".js", ".jsx"), s.push(".cjs"), t.push(".mjs")), [
|
|
887
|
-
...n,
|
|
888
|
-
...s,
|
|
889
|
-
...t
|
|
890
|
-
];
|
|
891
|
-
}, "getSupportedExtensions"), lt = i((e) => {
|
|
892
|
-
const n = [];
|
|
893
|
-
if (!e) return n;
|
|
894
|
-
const { outDir: s, declarationDir: t } = e;
|
|
895
|
-
return s && n.push(s), t && n.push(t), n;
|
|
896
|
-
}, "getDefaultExcludeSpec"), Te = i((e) => e.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`), "escapeForRegexp"), se = `(?!(${[
|
|
897
|
-
"node_modules",
|
|
898
|
-
"bower_components",
|
|
899
|
-
"jspm_packages"
|
|
900
|
-
].join("|")})(/|$))`, ft = /(?:^|\/)[^.*?]+$/, he = "**/*", Q = "[^/]", oe = "[^./]", Oe = process.platform === "win32", ut = i(({ config: e, path: n }, s) => {
|
|
901
|
-
if ("extends" in e) throw new Error("tsconfig#extends must be resolved. Use getTsconfig or readTsconfig to resolve it.");
|
|
902
|
-
if (!path.isAbsolute(n)) throw new Error("The tsconfig path must be absolute");
|
|
903
|
-
Oe && (n = x(n));
|
|
904
|
-
const t = path.dirname(n), { files: o, include: r, exclude: l, compilerOptions: g } = e, m = i((c) => path.isAbsolute(c) ? c : ye(t, c), "resolvePattern"), k = o ? new Set(o.map(m)) : void 0, w = rt(g), u = s ? "" : "i", O = (l || lt(g)).map((c) => {
|
|
905
|
-
const b = Te(m(c)).replaceAll(String.raw`\*\*/`, "(.+/)?").replaceAll(String.raw`\*`, `${Q}*`).replaceAll(String.raw`\?`, Q);
|
|
906
|
-
return new RegExp(`^${b}($|/)`, u);
|
|
907
|
-
}), h = o || r ? r : [he];
|
|
908
|
-
return {
|
|
909
|
-
filesSet: k,
|
|
910
|
-
extensions: w,
|
|
911
|
-
excludePatterns: O,
|
|
912
|
-
includePatterns: h ? h.map((c) => {
|
|
913
|
-
let p = m(c);
|
|
914
|
-
ft.test(p) && (p = ye(p, he));
|
|
915
|
-
const b = Te(p).replaceAll(String.raw`/\*\*`, `(/${se}${oe}${Q}*)*?`).replaceAll(/(\/)?\\\*/g, (f, y) => {
|
|
916
|
-
const j = String.raw`(${oe}|(\.(?!min\.js$))?)*`;
|
|
917
|
-
return y ? `/${se}${oe}${j}` : j;
|
|
918
|
-
}).replaceAll(/(\/)?\\\?/g, (f, y) => {
|
|
919
|
-
const j = Q;
|
|
920
|
-
return y ? `/${se}${j}` : j;
|
|
921
|
-
});
|
|
922
|
-
return new RegExp(`^${b}$`, u);
|
|
923
|
-
}) : void 0
|
|
924
|
-
};
|
|
925
|
-
}, "compilePatterns"), Ae = /* @__PURE__ */ new WeakMap(), je = i((e, n) => {
|
|
926
|
-
if (!path.isAbsolute(n)) return !1;
|
|
927
|
-
Oe && (n = x(n));
|
|
928
|
-
let s = Ae.get(e);
|
|
929
|
-
s || (s = ut(e, it()), Ae.set(e, s));
|
|
930
|
-
const { filesSet: t, extensions: o, excludePatterns: r, includePatterns: l } = s;
|
|
931
|
-
return t?.has(n) ? !0 : !o.some((g) => n.endsWith(g)) || r.some((g) => g.test(n)) ? !1 : !!(l && l.some((g) => g.test(n)));
|
|
932
|
-
}, "isFileIncluded"), De = i((e, n, s, t) => {
|
|
933
|
-
const o = path.resolve(e);
|
|
934
|
-
let r = x(e);
|
|
935
|
-
for (;;) {
|
|
936
|
-
const l = R(r, n, s);
|
|
937
|
-
if (!l) return;
|
|
938
|
-
const m = ee(path.resolve(l), {
|
|
939
|
-
cache: s,
|
|
940
|
-
typescriptVersion: t
|
|
941
|
-
});
|
|
942
|
-
if (je(m, o)) return m;
|
|
943
|
-
const k = path.dirname(l), w = path.dirname(k);
|
|
944
|
-
if (w === k) return;
|
|
945
|
-
r = w;
|
|
946
|
-
}
|
|
947
|
-
}, "findConfigApplicable"), Ee = i((e = process.cwd(), n = {}) => {
|
|
948
|
-
const { configName: s = "tsconfig.json", cache: t = /* @__PURE__ */ new Map(), includes: o = !1 } = n;
|
|
949
|
-
if (!o) {
|
|
950
|
-
const r = path.resolve(e);
|
|
951
|
-
return path.basename(r) === s && F(t, r)?.isFile() ? x(r) : R(x(e), s, t);
|
|
952
|
-
}
|
|
953
|
-
return De(e, s, t, !1)?.path;
|
|
954
|
-
}, "findTsconfig"), at = i((e = process.cwd(), n = {}) => {
|
|
955
|
-
const { configName: s = "tsconfig.json", cache: t = /* @__PURE__ */ new Map(), includes: o = !1, typescriptVersion: r = "auto" } = n;
|
|
956
|
-
if (!o) {
|
|
957
|
-
const l = Ee(e, {
|
|
958
|
-
configName: s,
|
|
959
|
-
cache: t
|
|
960
|
-
});
|
|
961
|
-
return l ? ee(l, {
|
|
962
|
-
cache: t,
|
|
963
|
-
typescriptVersion: r
|
|
964
|
-
}) : void 0;
|
|
965
|
-
}
|
|
966
|
-
return De(e, s, t, r);
|
|
967
|
-
}, "getTsconfig"), pt = /\*/g, xe = i((e, n) => {
|
|
968
|
-
const s = e.match(pt);
|
|
969
|
-
if (s && s.length > 1) throw new Error(n);
|
|
970
|
-
}, "assertStarCount"), mt = i((e) => {
|
|
971
|
-
if (e.includes("*")) {
|
|
972
|
-
const [n, s] = e.split("*");
|
|
973
|
-
return {
|
|
974
|
-
prefix: n,
|
|
975
|
-
suffix: s
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
return e;
|
|
979
|
-
}, "parsePattern"), gt = i(({ prefix: e, suffix: n }, s) => s.startsWith(e) && s.endsWith(n), "isPatternMatch"), dt = i((e, n, s) => Object.entries(e).map(([t, o]) => (xe(t, `Pattern '${t}' can have at most one '*' character.`), {
|
|
980
|
-
pattern: mt(t),
|
|
981
|
-
substitutions: o.map((r) => {
|
|
982
|
-
if (xe(r, `Substitution '${r}' in pattern '${t}' can have at most one '*' character.`), !n && !K.test(r) && !path.isAbsolute(r)) throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");
|
|
983
|
-
return path.resolve(s, r);
|
|
984
|
-
})
|
|
985
|
-
})), "parsePaths"), kt = i((e) => {
|
|
986
|
-
const { compilerOptions: n } = e.config;
|
|
987
|
-
if (!n) return null;
|
|
988
|
-
const { baseUrl: s, paths: t } = n;
|
|
989
|
-
if (!s && !t) return null;
|
|
990
|
-
const o = q in n && n[q], r = path.resolve(path.dirname(e.path), s || o || "."), l = t ? dt(t, s, r) : [], g = /* @__PURE__ */ new Map(), m = [];
|
|
991
|
-
for (const k of l) typeof k.pattern == "string" ? g.set(k.pattern, k.substitutions) : m.push(k);
|
|
992
|
-
return {
|
|
993
|
-
exactEntries: g,
|
|
994
|
-
patternEntries: m,
|
|
995
|
-
resolvedBaseUrl: r,
|
|
996
|
-
baseUrl: s
|
|
997
|
-
};
|
|
998
|
-
}, "compilePaths"), Fe = /* @__PURE__ */ new WeakMap();
|
|
999
|
-
i((e, n) => {
|
|
1000
|
-
let s = Fe.get(e);
|
|
1001
|
-
if (s === void 0 && (s = kt(e), Fe.set(e, s)), !s) return [];
|
|
1002
|
-
if (K.test(n)) return [];
|
|
1003
|
-
const { exactEntries: t, patternEntries: o, resolvedBaseUrl: r, baseUrl: l } = s, g = t.get(n);
|
|
1004
|
-
if (g) return g.map(x);
|
|
1005
|
-
let m, k = -1;
|
|
1006
|
-
for (const u of o) gt(u.pattern, n) && u.pattern.prefix.length > k && (k = u.pattern.prefix.length, m = u);
|
|
1007
|
-
if (!m) return l ? [x(path.join(r, n))] : [];
|
|
1008
|
-
const w = n.slice(m.pattern.prefix.length, n.length - m.pattern.suffix.length);
|
|
1009
|
-
return m.substitutions.map((u) => x(u.replace("*", w)));
|
|
1010
|
-
}, "resolvePathAlias");
|
|
1011
|
-
//#endregion
|
|
1012
|
-
export { ee as n, at as t };
|