@voidzero-dev/vite-plus-core 0.3.0 → 0.3.2
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 +0 -29
- package/dist/rolldown/cli.mjs +6 -6
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +38 -4
- package/dist/rolldown/experimental-index.mjs +35 -9
- package/dist/rolldown/experimental-runtime-types.d.ts +2 -2
- package/dist/rolldown/experimental-runtime.d.ts +2 -2
- package/dist/rolldown/experimental-runtime.mjs +2 -2
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/filter-index.mjs +1 -3
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +4 -4
- 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 +1 -1
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-C__LJDBG.mjs → binding-DH95uVkp.mjs} +27 -27
- package/dist/rolldown/shared/{binding-Bvw14S3g.d.mts → binding-DZuNHVw4.d.mts} +19 -5
- package/dist/rolldown/shared/{bindingify-input-options-V9YvAjrr.mjs → bindingify-input-options-BL4xrXys.mjs} +11 -9
- package/dist/rolldown/shared/{constructors-CRumnw21.d.mts → constructors-BnIg8feC.d.mts} +2 -2
- package/dist/rolldown/shared/{constructors-DklcHr18.mjs → constructors-CrhQ-yy_.mjs} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-DbV2ud0B.mjs → create-bundler-option-Dk9AZBn_.mjs} +72 -6
- package/dist/rolldown/shared/{define-config-DwTNhgWB.d.mts → define-config-DjHYbH6S.d.mts} +40 -3
- package/dist/rolldown/shared/{error-NcRuXAVN.mjs → error-CRNyaqoL.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-Dd7jKGUy.mjs → load-config-CKqTUKwB.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-CFtim40S.mjs → normalize-string-or-regex-BgP6W4eD.mjs} +1 -1
- package/dist/rolldown/shared/{parse-rvxTD36n.mjs → parse-DYyNe0IU.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-D2vSIIkR.mjs → resolve-tsconfig-jh43hFM_.mjs} +10 -6
- package/dist/rolldown/shared/{rolldown-Bblizyw1.mjs → rolldown-BpXK1q5_.mjs} +5 -4
- package/dist/rolldown/shared/{transform--WSMLt1x.d.mts → transform-CVse9_mH.d.mts} +8 -4
- package/dist/rolldown/shared/{watch-DPvOlccK.mjs → watch-Due6uYkS.mjs} +4 -4
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-D_enfyvD-tOzhITac.js → build-JVmLFaZt-BN9yuB6k.js} +683 -682
- package/dist/tsdown/{debug-CKcBYQLP-By_AQqN8.js → debug-CpC4hV25-BeCITV83.js} +18 -14
- package/dist/tsdown/{detect-DGhJGEqb-LL52mV6u.js → detect-Bg-d8iUV-Cr_BRLVW.js} +10 -12
- package/dist/tsdown/{dist-BsS7BOcb.js → dist-ByW_jJfv.js} +1226 -893
- package/dist/tsdown/index-types.d.ts +239 -317
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/internal-DTYQdXId.js +3 -0
- package/dist/tsdown/{main-Bcv7jU2b.js → main-bgV9NlwM.js} +24 -145
- package/dist/tsdown/{resolver-cwLsPb2o-Bb9SDBm6.js → resolver-DE0_sy8o-UMsN-SXx.js} +4 -4
- package/dist/tsdown/rolldown-runtime-B4iAMlE-.js +35 -0
- package/dist/tsdown/run.js +44 -8
- package/dist/tsdown/{src-JVSpR8xt.js → src-D5xv98Iu.js} +5 -5
- package/dist/tsdown/{target-Bab3CUeB-8PBzMh3p.js → target-DgdLrXba-DaJJ11xX.js} +78 -74
- package/dist/tsdown/{tsc-B8FD48Oc.js → tsc-BFDF_Im9.js} +26 -20
- package/dist/tsdown/tsdown-css.js +19 -11
- package/dist/tsdown/tsdown-exe.js +4 -4
- package/dist/vite/client/bundledDevClient.mjs +77 -42
- package/dist/vite/client/client.mjs +288 -260
- package/dist/vite/node/chunks/build.js +21 -21
- package/dist/vite/node/chunks/lib.js +2 -2
- package/dist/vite/node/chunks/node.js +32781 -32305
- package/dist/vite/node/chunks/postcss-import.js +10 -10
- package/dist/vite/node/cli.js +12 -8
- package/dist/vite/node/index.d.ts +1568 -1577
- package/dist/vite/node/index.js +1 -1
- package/dist/vite/node/module-runner.d.ts +1 -1
- package/dist/vite/node/module-runner.js +201 -202
- package/dist/vite/types/customEvent.d.ts +2 -0
- package/dist/vite/types/hmrPayload.d.ts +2 -0
- package/dist/vite/types/internal/cssPreprocessorOptions.d.ts +2 -2
- package/dist/vite/types/internal/devtoolsOptions.d.ts +9 -0
- package/package.json +28 -31
- package/dist/tsdown/internal-DSmmwu4u.js +0 -3
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as __toESM, n as __exportAll$1, t as __commonJSMin } from "./rolldown-runtime-B4iAMlE-.js";
|
|
2
|
+
import { c as importWithError, d as pkgExists, f as resolveComma, g as toArray, h as styleText$1, l as matchPattern, m as slash, n as x, o as createConcurrencyExecutor, p as resolveRegex, r as createDebug, s as debounce, t as exec, u as noop } from "./main-bgV9NlwM.js";
|
|
3
|
+
import { a as createSuppressWarnings, c as globalLogger, i as createLogger, l as prettyFormat, n as version, o as generateColor, r as LogLevels, s as getNameLabel } from "./debug-CpC4hV25-BeCITV83.js";
|
|
4
|
+
import { A as fsStat, D as fsCopy, E as formatBytes, M as stripExtname, O as fsExists, a as resolveTarget, g as RE_JS, j as lowestCommonAncestor, k as fsRemove, l as parseRange, m as RE_DTS, o as validateSea, p as RE_CSS, r as buildExe, s as coerce, u as satisfies, v as RE_NODE_MODULES$1 } from "./target-DgdLrXba-DaJJ11xX.js";
|
|
4
5
|
import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
5
6
|
import process$1 from "node:process";
|
|
6
|
-
import readline from "node:readline";
|
|
7
7
|
import { formatWithOptions, inspect, isDeepStrictEqual, parseEnv, promisify } from "node:util";
|
|
8
|
+
import readline from "node:readline";
|
|
8
9
|
import path, { dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
9
|
-
import
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
import X, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
10
12
|
import { VERSION, build, watch } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
11
13
|
import { chmod, mkdtemp, readFile, readdir, writeFile } from "node:fs/promises";
|
|
12
14
|
import { and, id, importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
13
15
|
import * as nativeFs from "fs";
|
|
14
16
|
import Ue, { readdir as readdir$1, readdirSync, realpath, realpathSync, stat as stat$1, statSync as statSync$1 } from "fs";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
+
import Se from "os";
|
|
18
|
+
import Ie, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
|
|
17
19
|
import { Visitor, parse as parse$1 } from "@voidzero-dev/vite-plus-core/rolldown/utils";
|
|
18
20
|
import { tmpdir } from "node:os";
|
|
19
|
-
import { fileURLToPath } from "url";
|
|
21
|
+
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
20
22
|
import { createRequire as createRequire$1 } from "module";
|
|
21
|
-
import { fileURLToPath as fileURLToPath$1, pathToFileURL } from "node:url";
|
|
22
23
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
23
24
|
import { Buffer } from "node:buffer";
|
|
24
25
|
import { brotliCompress, gzip } from "node:zlib";
|
|
@@ -27,7 +28,7 @@ import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experime
|
|
|
27
28
|
const A = (r) => r !== null && typeof r == "object";
|
|
28
29
|
const a = (r, t) => Object.assign(/* @__PURE__ */ new Error(`[${r}]: ${t}`), { code: r });
|
|
29
30
|
const _$1 = "ERR_INVALID_PACKAGE_CONFIG";
|
|
30
|
-
const E = "ERR_INVALID_PACKAGE_TARGET";
|
|
31
|
+
const E$1 = "ERR_INVALID_PACKAGE_TARGET";
|
|
31
32
|
const I$1 = "ERR_PACKAGE_PATH_NOT_EXPORTED";
|
|
32
33
|
const R$1 = /^\d+$/;
|
|
33
34
|
const O = /^(\.{1,2}|node_modules)$/i;
|
|
@@ -37,7 +38,7 @@ const f = (r, t, e, o, c) => {
|
|
|
37
38
|
if (t == null) return [];
|
|
38
39
|
if (typeof t == "string") {
|
|
39
40
|
const [n, ...i] = t.split(w);
|
|
40
|
-
if (n === ".." || i.some((l) => O.test(l))) throw a(E, `Invalid "${r}" target "${t}" defined in the package config`);
|
|
41
|
+
if (n === ".." || i.some((l) => O.test(l))) throw a(E$1, `Invalid "${r}" target "${t}" defined in the package config`);
|
|
41
42
|
return [c ? t.replace(/\*/g, c) : t];
|
|
42
43
|
}
|
|
43
44
|
if (Array.isArray(t)) return t.flatMap((n) => f(r, n, e, o, c));
|
|
@@ -48,7 +49,7 @@ const f = (r, t, e, o, c) => {
|
|
|
48
49
|
}
|
|
49
50
|
return [];
|
|
50
51
|
}
|
|
51
|
-
throw a(E, `Invalid "${r}" target "${t}"`);
|
|
52
|
+
throw a(E$1, `Invalid "${r}" target "${t}"`);
|
|
52
53
|
};
|
|
53
54
|
const s = "*";
|
|
54
55
|
const m = (r, t) => {
|
|
@@ -78,31 +79,36 @@ const v = (r, t, e) => {
|
|
|
78
79
|
t = t === "" ? "." : `./${t}`, (typeof r == "string" || Array.isArray(r) || A(r) && p(r)) && (r = { ".": r });
|
|
79
80
|
const [o, c] = d(r, t), n = f(h.Export, r[o], t, e, c);
|
|
80
81
|
if (n.length === 0) throw a(I$1, t === "." ? "No \"exports\" main defined" : `Package subpath '${t}' is not defined by "exports"`);
|
|
81
|
-
for (const i of n) if (!i.startsWith("./") && !u.test(i)) throw a(E, `Invalid "exports" target "${i}" defined in the package config`);
|
|
82
|
+
for (const i of n) if (!i.startsWith("./") && !u.test(i)) throw a(E$1, `Invalid "exports" target "${i}" defined in the package config`);
|
|
82
83
|
return n;
|
|
83
84
|
};
|
|
84
85
|
//#endregion
|
|
85
|
-
//#region ../../node_modules/.pnpm/get-tsconfig@5.0.0-beta.
|
|
86
|
+
//#region ../../node_modules/.pnpm/get-tsconfig@5.0.0-beta.6/node_modules/get-tsconfig/dist/index.mjs
|
|
86
87
|
var Le = Object.defineProperty;
|
|
87
88
|
var i = (e, n) => Le(e, "name", {
|
|
88
89
|
value: n,
|
|
89
90
|
configurable: !0
|
|
90
91
|
});
|
|
91
|
-
function
|
|
92
|
+
function E(e) {
|
|
92
93
|
return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
|
|
93
94
|
}
|
|
94
|
-
i(
|
|
95
|
+
i(E, "slash");
|
|
95
96
|
const _e = i((e, n) => {
|
|
96
97
|
const s = `readFileSync:${n}`;
|
|
97
98
|
let t = e?.get(s);
|
|
98
|
-
return t === void 0 && (t =
|
|
99
|
+
return t === void 0 && (t = X.readFileSync(n, "utf8"), e?.set(s, t)), t;
|
|
99
100
|
}, "readFile");
|
|
100
|
-
const
|
|
101
|
+
const Ne = i((e, n) => {
|
|
102
|
+
const s = `realpathSync:${n}`;
|
|
103
|
+
let t = e?.get(s);
|
|
104
|
+
return t === void 0 && (t = X.realpathSync(n), e?.set(s, t)), t;
|
|
105
|
+
}, "realpath");
|
|
106
|
+
const $ = i((e, n) => {
|
|
101
107
|
const s = `tryStat:${n}`;
|
|
102
108
|
let t = e?.get(s);
|
|
103
109
|
if (t === void 0) {
|
|
104
110
|
try {
|
|
105
|
-
t =
|
|
111
|
+
t = X.statSync(n);
|
|
106
112
|
} catch {
|
|
107
113
|
t = null;
|
|
108
114
|
}
|
|
@@ -113,148 +119,148 @@ const F = i((e, n) => {
|
|
|
113
119
|
const R = i((e, n, s) => {
|
|
114
120
|
for (;;) {
|
|
115
121
|
const t = path.posix.join(e, n);
|
|
116
|
-
if (
|
|
122
|
+
if ($(s, t)) return t;
|
|
117
123
|
const o = path.dirname(e);
|
|
118
124
|
if (o === e) return;
|
|
119
125
|
e = o;
|
|
120
126
|
}
|
|
121
127
|
}, "findUp");
|
|
122
|
-
function
|
|
128
|
+
function Re(e, n = !1) {
|
|
123
129
|
const s = e.length;
|
|
124
|
-
let t = 0, o = "", r = 0,
|
|
125
|
-
function
|
|
126
|
-
let
|
|
127
|
-
for (;
|
|
130
|
+
let t = 0, o = "", r = 0, c = 16, g = 0, m = 0, k = 0, v = 0, f = 0;
|
|
131
|
+
function O(l, T) {
|
|
132
|
+
let A = 0, b = 0;
|
|
133
|
+
for (; A < l;) {
|
|
128
134
|
let d = e.charCodeAt(t);
|
|
129
|
-
if (d >= 48 && d <= 57)
|
|
130
|
-
else if (d >= 65 && d <= 70)
|
|
131
|
-
else if (d >= 97 && d <= 102)
|
|
135
|
+
if (d >= 48 && d <= 57) b = b * 16 + d - 48;
|
|
136
|
+
else if (d >= 65 && d <= 70) b = b * 16 + d - 65 + 10;
|
|
137
|
+
else if (d >= 97 && d <= 102) b = b * 16 + d - 97 + 10;
|
|
132
138
|
else break;
|
|
133
|
-
t++,
|
|
139
|
+
t++, A++;
|
|
134
140
|
}
|
|
135
|
-
return
|
|
141
|
+
return A < l && (b = -1), b;
|
|
136
142
|
}
|
|
137
|
-
i(
|
|
138
|
-
function
|
|
139
|
-
t =
|
|
143
|
+
i(O, "scanHexDigits");
|
|
144
|
+
function j(l) {
|
|
145
|
+
t = l, o = "", r = 0, c = 16, f = 0;
|
|
140
146
|
}
|
|
141
|
-
i(
|
|
142
|
-
function
|
|
143
|
-
let
|
|
147
|
+
i(j, "setPosition");
|
|
148
|
+
function y() {
|
|
149
|
+
let l = t;
|
|
144
150
|
if (e.charCodeAt(t) === 48) t++;
|
|
145
|
-
else for (t++; t < e.length &&
|
|
146
|
-
if (t < e.length && e.charCodeAt(t) === 46) if (t++, t < e.length &&
|
|
147
|
-
else return
|
|
148
|
-
let
|
|
149
|
-
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 &&
|
|
150
|
-
for (t++; t < e.length &&
|
|
151
|
-
|
|
152
|
-
} else
|
|
153
|
-
return e.substring(
|
|
154
|
-
}
|
|
155
|
-
i(
|
|
156
|
-
function
|
|
157
|
-
let
|
|
151
|
+
else for (t++; t < e.length && I(e.charCodeAt(t));) t++;
|
|
152
|
+
if (t < e.length && e.charCodeAt(t) === 46) if (t++, t < e.length && I(e.charCodeAt(t))) for (t++; t < e.length && I(e.charCodeAt(t));) t++;
|
|
153
|
+
else return f = 3, e.substring(l, t);
|
|
154
|
+
let T = t;
|
|
155
|
+
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 && I(e.charCodeAt(t))) {
|
|
156
|
+
for (t++; t < e.length && I(e.charCodeAt(t));) t++;
|
|
157
|
+
T = t;
|
|
158
|
+
} else f = 3;
|
|
159
|
+
return e.substring(l, T);
|
|
160
|
+
}
|
|
161
|
+
i(y, "scanNumber");
|
|
162
|
+
function x() {
|
|
163
|
+
let l = "", T = t;
|
|
158
164
|
for (;;) {
|
|
159
165
|
if (t >= s) {
|
|
160
|
-
|
|
166
|
+
l += e.substring(T, t), f = 2;
|
|
161
167
|
break;
|
|
162
168
|
}
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
|
|
169
|
+
const A = e.charCodeAt(t);
|
|
170
|
+
if (A === 34) {
|
|
171
|
+
l += e.substring(T, t), t++;
|
|
166
172
|
break;
|
|
167
173
|
}
|
|
168
|
-
if (
|
|
169
|
-
if (
|
|
170
|
-
|
|
174
|
+
if (A === 92) {
|
|
175
|
+
if (l += e.substring(T, t), t++, t >= s) {
|
|
176
|
+
f = 2;
|
|
171
177
|
break;
|
|
172
178
|
}
|
|
173
179
|
switch (e.charCodeAt(t++)) {
|
|
174
180
|
case 34:
|
|
175
|
-
|
|
181
|
+
l += "\"";
|
|
176
182
|
break;
|
|
177
183
|
case 92:
|
|
178
|
-
|
|
184
|
+
l += "\\";
|
|
179
185
|
break;
|
|
180
186
|
case 47:
|
|
181
|
-
|
|
187
|
+
l += "/";
|
|
182
188
|
break;
|
|
183
189
|
case 98:
|
|
184
|
-
|
|
190
|
+
l += "\b";
|
|
185
191
|
break;
|
|
186
192
|
case 102:
|
|
187
|
-
|
|
193
|
+
l += "\f";
|
|
188
194
|
break;
|
|
189
195
|
case 110:
|
|
190
|
-
|
|
196
|
+
l += `
|
|
191
197
|
`;
|
|
192
198
|
break;
|
|
193
199
|
case 114:
|
|
194
|
-
|
|
200
|
+
l += "\r";
|
|
195
201
|
break;
|
|
196
202
|
case 116:
|
|
197
|
-
|
|
203
|
+
l += " ";
|
|
198
204
|
break;
|
|
199
205
|
case 117:
|
|
200
|
-
const d =
|
|
201
|
-
d >= 0 ?
|
|
206
|
+
const d = O(4);
|
|
207
|
+
d >= 0 ? l += String.fromCharCode(d) : f = 4;
|
|
202
208
|
break;
|
|
203
|
-
default:
|
|
209
|
+
default: f = 5;
|
|
204
210
|
}
|
|
205
|
-
|
|
211
|
+
T = t;
|
|
206
212
|
continue;
|
|
207
213
|
}
|
|
208
|
-
if (
|
|
209
|
-
|
|
214
|
+
if (A >= 0 && A <= 31) if (P(A)) {
|
|
215
|
+
l += e.substring(T, t), f = 2;
|
|
210
216
|
break;
|
|
211
|
-
} else
|
|
217
|
+
} else f = 6;
|
|
212
218
|
t++;
|
|
213
219
|
}
|
|
214
|
-
return
|
|
220
|
+
return l;
|
|
215
221
|
}
|
|
216
|
-
i(
|
|
217
|
-
function
|
|
218
|
-
if (o = "",
|
|
219
|
-
let
|
|
220
|
-
if (
|
|
222
|
+
i(x, "scanString");
|
|
223
|
+
function p() {
|
|
224
|
+
if (o = "", f = 0, r = t, m = g, v = k, t >= s) return r = s, c = 17;
|
|
225
|
+
let l = e.charCodeAt(t);
|
|
226
|
+
if (Y(l)) {
|
|
221
227
|
do
|
|
222
|
-
t++, o += String.fromCharCode(
|
|
223
|
-
while (
|
|
224
|
-
return
|
|
228
|
+
t++, o += String.fromCharCode(l), l = e.charCodeAt(t);
|
|
229
|
+
while (Y(l));
|
|
230
|
+
return c = 15;
|
|
225
231
|
}
|
|
226
|
-
if (P(
|
|
227
|
-
`), g++, k = t,
|
|
228
|
-
switch (
|
|
229
|
-
case 123: return t++,
|
|
230
|
-
case 125: return t++,
|
|
231
|
-
case 91: return t++,
|
|
232
|
-
case 93: return t++,
|
|
233
|
-
case 58: return t++,
|
|
234
|
-
case 44: return t++,
|
|
235
|
-
case 34: return t++, o =
|
|
232
|
+
if (P(l)) return t++, o += String.fromCharCode(l), l === 13 && e.charCodeAt(t) === 10 && (t++, o += `
|
|
233
|
+
`), g++, k = t, c = 14;
|
|
234
|
+
switch (l) {
|
|
235
|
+
case 123: return t++, c = 1;
|
|
236
|
+
case 125: return t++, c = 2;
|
|
237
|
+
case 91: return t++, c = 3;
|
|
238
|
+
case 93: return t++, c = 4;
|
|
239
|
+
case 58: return t++, c = 6;
|
|
240
|
+
case 44: return t++, c = 5;
|
|
241
|
+
case 34: return t++, o = x(), c = 10;
|
|
236
242
|
case 47:
|
|
237
|
-
const
|
|
243
|
+
const T = t - 1;
|
|
238
244
|
if (e.charCodeAt(t + 1) === 47) {
|
|
239
245
|
for (t += 2; t < s && !P(e.charCodeAt(t));) t++;
|
|
240
|
-
return o = e.substring(
|
|
246
|
+
return o = e.substring(T, t), c = 12;
|
|
241
247
|
}
|
|
242
248
|
if (e.charCodeAt(t + 1) === 42) {
|
|
243
249
|
t += 2;
|
|
244
|
-
const
|
|
245
|
-
let
|
|
246
|
-
for (; t <
|
|
250
|
+
const A = s - 1;
|
|
251
|
+
let b = !1;
|
|
252
|
+
for (; t < A;) {
|
|
247
253
|
const d = e.charCodeAt(t);
|
|
248
254
|
if (d === 42 && e.charCodeAt(t + 1) === 47) {
|
|
249
|
-
t += 2,
|
|
255
|
+
t += 2, b = !0;
|
|
250
256
|
break;
|
|
251
257
|
}
|
|
252
258
|
t++, P(d) && (d === 13 && e.charCodeAt(t) === 10 && t++, g++, k = t);
|
|
253
259
|
}
|
|
254
|
-
return
|
|
260
|
+
return b || (t++, f = 1), o = e.substring(T, t), c = 13;
|
|
255
261
|
}
|
|
256
|
-
return o += String.fromCharCode(
|
|
257
|
-
case 45: if (o += String.fromCharCode(
|
|
262
|
+
return o += String.fromCharCode(l), t++, c = 16;
|
|
263
|
+
case 45: if (o += String.fromCharCode(l), t++, t === s || !I(e.charCodeAt(t))) return c = 16;
|
|
258
264
|
case 48:
|
|
259
265
|
case 49:
|
|
260
266
|
case 50:
|
|
@@ -264,24 +270,24 @@ function Ne(e, n = !1) {
|
|
|
264
270
|
case 54:
|
|
265
271
|
case 55:
|
|
266
272
|
case 56:
|
|
267
|
-
case 57: return o +=
|
|
273
|
+
case 57: return o += y(), c = 11;
|
|
268
274
|
default:
|
|
269
|
-
for (; t < s &&
|
|
275
|
+
for (; t < s && u(l);) t++, l = e.charCodeAt(t);
|
|
270
276
|
if (r !== t) {
|
|
271
277
|
switch (o = e.substring(r, t), o) {
|
|
272
|
-
case "true": return
|
|
273
|
-
case "false": return
|
|
274
|
-
case "null": return
|
|
278
|
+
case "true": return c = 8;
|
|
279
|
+
case "false": return c = 9;
|
|
280
|
+
case "null": return c = 7;
|
|
275
281
|
}
|
|
276
|
-
return
|
|
282
|
+
return c = 16;
|
|
277
283
|
}
|
|
278
|
-
return o += String.fromCharCode(
|
|
284
|
+
return o += String.fromCharCode(l), t++, c = 16;
|
|
279
285
|
}
|
|
280
286
|
}
|
|
281
|
-
i(
|
|
282
|
-
function
|
|
283
|
-
if (
|
|
284
|
-
switch (
|
|
287
|
+
i(p, "scanNext");
|
|
288
|
+
function u(l) {
|
|
289
|
+
if (Y(l) || P(l)) return !1;
|
|
290
|
+
switch (l) {
|
|
285
291
|
case 125:
|
|
286
292
|
case 93:
|
|
287
293
|
case 123:
|
|
@@ -293,40 +299,40 @@ function Ne(e, n = !1) {
|
|
|
293
299
|
}
|
|
294
300
|
return !0;
|
|
295
301
|
}
|
|
296
|
-
i(
|
|
297
|
-
function
|
|
298
|
-
let
|
|
302
|
+
i(u, "isUnknownContentCharacter");
|
|
303
|
+
function w() {
|
|
304
|
+
let l;
|
|
299
305
|
do
|
|
300
|
-
|
|
301
|
-
while (
|
|
302
|
-
return
|
|
306
|
+
l = p();
|
|
307
|
+
while (l >= 12 && l <= 15);
|
|
308
|
+
return l;
|
|
303
309
|
}
|
|
304
|
-
return i(
|
|
305
|
-
setPosition:
|
|
310
|
+
return i(w, "scanNextNonTrivia"), {
|
|
311
|
+
setPosition: j,
|
|
306
312
|
getPosition: i(() => t, "getPosition"),
|
|
307
|
-
scan: n ?
|
|
308
|
-
getToken: i(() =>
|
|
313
|
+
scan: n ? w : p,
|
|
314
|
+
getToken: i(() => c, "getToken"),
|
|
309
315
|
getTokenValue: i(() => o, "getTokenValue"),
|
|
310
316
|
getTokenOffset: i(() => r, "getTokenOffset"),
|
|
311
317
|
getTokenLength: i(() => t - r, "getTokenLength"),
|
|
312
318
|
getTokenStartLine: i(() => m, "getTokenStartLine"),
|
|
313
|
-
getTokenStartCharacter: i(() => r -
|
|
314
|
-
getTokenError: i(() =>
|
|
319
|
+
getTokenStartCharacter: i(() => r - v, "getTokenStartCharacter"),
|
|
320
|
+
getTokenError: i(() => f, "getTokenError")
|
|
315
321
|
};
|
|
316
322
|
}
|
|
317
|
-
i(
|
|
318
|
-
function
|
|
323
|
+
i(Re, "createScanner");
|
|
324
|
+
function Y(e) {
|
|
319
325
|
return e === 32 || e === 9;
|
|
320
326
|
}
|
|
321
|
-
i(
|
|
327
|
+
i(Y, "isWhiteSpace");
|
|
322
328
|
function P(e) {
|
|
323
329
|
return e === 10 || e === 13;
|
|
324
330
|
}
|
|
325
331
|
i(P, "isLineBreak");
|
|
326
|
-
function
|
|
332
|
+
function I(e) {
|
|
327
333
|
return e >= 48 && e <= 57;
|
|
328
334
|
}
|
|
329
|
-
i(
|
|
335
|
+
i(I, "isDigit");
|
|
330
336
|
var ce;
|
|
331
337
|
(function(e) {
|
|
332
338
|
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";
|
|
@@ -341,16 +347,16 @@ var W;
|
|
|
341
347
|
(function(e) {
|
|
342
348
|
e.DEFAULT = { allowTrailingComma: !1 };
|
|
343
349
|
})(W || (W = {}));
|
|
344
|
-
function
|
|
350
|
+
function Pe(e, n = [], s = W.DEFAULT) {
|
|
345
351
|
let t = null, o = [];
|
|
346
352
|
const r = [];
|
|
347
|
-
function
|
|
353
|
+
function c(m) {
|
|
348
354
|
Array.isArray(o) ? o.push(m) : t !== null && (o[t] = m);
|
|
349
355
|
}
|
|
350
|
-
return i(
|
|
356
|
+
return i(c, "onValue"), Ve(e, {
|
|
351
357
|
onObjectBegin: i(() => {
|
|
352
358
|
const m = {};
|
|
353
|
-
|
|
359
|
+
c(m), r.push(o), o = m, t = null;
|
|
354
360
|
}, "onObjectBegin"),
|
|
355
361
|
onObjectProperty: i((m) => {
|
|
356
362
|
t = m;
|
|
@@ -360,53 +366,53 @@ function Re(e, n = [], s = W.DEFAULT) {
|
|
|
360
366
|
}, "onObjectEnd"),
|
|
361
367
|
onArrayBegin: i(() => {
|
|
362
368
|
const m = [];
|
|
363
|
-
|
|
369
|
+
c(m), r.push(o), o = m, t = null;
|
|
364
370
|
}, "onArrayBegin"),
|
|
365
371
|
onArrayEnd: i(() => {
|
|
366
372
|
o = r.pop();
|
|
367
373
|
}, "onArrayEnd"),
|
|
368
|
-
onLiteralValue:
|
|
369
|
-
onError: i((m, k,
|
|
374
|
+
onLiteralValue: c,
|
|
375
|
+
onError: i((m, k, v) => {
|
|
370
376
|
n.push({
|
|
371
377
|
error: m,
|
|
372
378
|
offset: k,
|
|
373
|
-
length:
|
|
379
|
+
length: v
|
|
374
380
|
});
|
|
375
381
|
}, "onError")
|
|
376
382
|
}, s), o[0];
|
|
377
383
|
}
|
|
378
|
-
i(
|
|
379
|
-
function
|
|
380
|
-
const t =
|
|
384
|
+
i(Pe, "parse$1");
|
|
385
|
+
function Ve(e, n, s = W.DEFAULT) {
|
|
386
|
+
const t = Re(e, !1), o = [];
|
|
381
387
|
let r = 0;
|
|
382
|
-
function
|
|
383
|
-
return
|
|
388
|
+
function c(h) {
|
|
389
|
+
return h ? () => r === 0 && h(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter()) : () => !0;
|
|
384
390
|
}
|
|
385
|
-
i(
|
|
386
|
-
function g(
|
|
387
|
-
return
|
|
391
|
+
i(c, "toNoArgVisit");
|
|
392
|
+
function g(h) {
|
|
393
|
+
return h ? (D) => r === 0 && h(D, t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter()) : () => !0;
|
|
388
394
|
}
|
|
389
395
|
i(g, "toOneArgVisit");
|
|
390
|
-
function m(
|
|
391
|
-
return
|
|
396
|
+
function m(h) {
|
|
397
|
+
return h ? (D) => r === 0 && h(D, t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter(), () => o.slice()) : () => !0;
|
|
392
398
|
}
|
|
393
399
|
i(m, "toOneArgVisitWithPath");
|
|
394
|
-
function k(
|
|
395
|
-
return
|
|
396
|
-
r > 0 ? r++ :
|
|
400
|
+
function k(h) {
|
|
401
|
+
return h ? () => {
|
|
402
|
+
r > 0 ? r++ : h(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter(), () => o.slice()) === !1 && (r = 1);
|
|
397
403
|
} : () => !0;
|
|
398
404
|
}
|
|
399
405
|
i(k, "toBeginVisit");
|
|
400
|
-
function
|
|
401
|
-
return
|
|
402
|
-
r > 0 && r--, r === 0 &&
|
|
406
|
+
function v(h) {
|
|
407
|
+
return h ? () => {
|
|
408
|
+
r > 0 && r--, r === 0 && h(t.getTokenOffset(), t.getTokenLength(), t.getTokenStartLine(), t.getTokenStartCharacter());
|
|
403
409
|
} : () => !0;
|
|
404
410
|
}
|
|
405
|
-
i(
|
|
406
|
-
const
|
|
407
|
-
function
|
|
411
|
+
i(v, "toEndVisit");
|
|
412
|
+
const f = k(n.onObjectBegin), O = m(n.onObjectProperty), j = v(n.onObjectEnd), y = k(n.onArrayBegin), x = v(n.onArrayEnd), p = m(n.onLiteralValue), u = g(n.onSeparator), w = c(n.onComment), l = g(n.onError), T = s && s.disallowComments, A = s && s.allowTrailingComma;
|
|
413
|
+
function b() {
|
|
408
414
|
for (;;) {
|
|
409
|
-
const
|
|
415
|
+
const h = t.scan();
|
|
410
416
|
switch (t.getTokenError()) {
|
|
411
417
|
case 4:
|
|
412
418
|
d(14);
|
|
@@ -418,106 +424,106 @@ function Pe(e, n, s = W.DEFAULT) {
|
|
|
418
424
|
d(13);
|
|
419
425
|
break;
|
|
420
426
|
case 1:
|
|
421
|
-
|
|
427
|
+
T || d(11);
|
|
422
428
|
break;
|
|
423
429
|
case 2:
|
|
424
430
|
d(12);
|
|
425
431
|
break;
|
|
426
432
|
case 6: d(16);
|
|
427
433
|
}
|
|
428
|
-
switch (
|
|
434
|
+
switch (h) {
|
|
429
435
|
case 12:
|
|
430
436
|
case 13:
|
|
431
|
-
|
|
437
|
+
T ? d(10) : w();
|
|
432
438
|
break;
|
|
433
439
|
case 16:
|
|
434
440
|
d(1);
|
|
435
441
|
break;
|
|
436
442
|
case 15:
|
|
437
443
|
case 14: break;
|
|
438
|
-
default: return
|
|
444
|
+
default: return h;
|
|
439
445
|
}
|
|
440
446
|
}
|
|
441
447
|
}
|
|
442
|
-
i(
|
|
443
|
-
function d(
|
|
444
|
-
if (
|
|
448
|
+
i(b, "scanNext");
|
|
449
|
+
function d(h, D = [], re = []) {
|
|
450
|
+
if (l(h), D.length + re.length > 0) {
|
|
445
451
|
let V = t.getToken();
|
|
446
452
|
for (; V !== 17;) {
|
|
447
|
-
if (
|
|
448
|
-
|
|
453
|
+
if (D.indexOf(V) !== -1) {
|
|
454
|
+
b();
|
|
449
455
|
break;
|
|
450
|
-
} else if (
|
|
451
|
-
V =
|
|
456
|
+
} else if (re.indexOf(V) !== -1) break;
|
|
457
|
+
V = b();
|
|
452
458
|
}
|
|
453
459
|
}
|
|
454
460
|
}
|
|
455
461
|
i(d, "handleError");
|
|
456
|
-
function L(
|
|
457
|
-
const
|
|
458
|
-
return
|
|
462
|
+
function L(h) {
|
|
463
|
+
const D = t.getTokenValue();
|
|
464
|
+
return h ? p(D) : (O(D), o.push(D)), b(), !0;
|
|
459
465
|
}
|
|
460
466
|
i(L, "parseString");
|
|
461
467
|
function B() {
|
|
462
468
|
switch (t.getToken()) {
|
|
463
469
|
case 11:
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
isNaN(
|
|
470
|
+
const h = t.getTokenValue();
|
|
471
|
+
let D = Number(h);
|
|
472
|
+
isNaN(D) && (d(2), D = 0), p(D);
|
|
467
473
|
break;
|
|
468
474
|
case 7:
|
|
469
|
-
|
|
475
|
+
p(null);
|
|
470
476
|
break;
|
|
471
477
|
case 8:
|
|
472
|
-
|
|
478
|
+
p(!0);
|
|
473
479
|
break;
|
|
474
480
|
case 9:
|
|
475
|
-
|
|
481
|
+
p(!1);
|
|
476
482
|
break;
|
|
477
483
|
default: return !1;
|
|
478
484
|
}
|
|
479
|
-
return
|
|
485
|
+
return b(), !0;
|
|
480
486
|
}
|
|
481
487
|
i(B, "parseLiteral");
|
|
482
|
-
function
|
|
483
|
-
return t.getToken() !== 10 ? (d(3, [], [2, 5]), !1) : (L(!1), t.getToken() === 6 ? (
|
|
488
|
+
function F() {
|
|
489
|
+
return t.getToken() !== 10 ? (d(3, [], [2, 5]), !1) : (L(!1), t.getToken() === 6 ? (u(":"), b(), H() || d(4, [], [2, 5])) : d(5, [], [2, 5]), o.pop(), !0);
|
|
484
490
|
}
|
|
485
|
-
i(
|
|
491
|
+
i(F, "parseProperty");
|
|
486
492
|
function N() {
|
|
487
|
-
|
|
488
|
-
let
|
|
493
|
+
f(), b();
|
|
494
|
+
let h = !1;
|
|
489
495
|
for (; t.getToken() !== 2 && t.getToken() !== 17;) {
|
|
490
496
|
if (t.getToken() === 5) {
|
|
491
|
-
if (
|
|
492
|
-
} else
|
|
493
|
-
|
|
497
|
+
if (h || d(4, [], []), u(","), b(), t.getToken() === 2 && A) break;
|
|
498
|
+
} else h && d(6, [], []);
|
|
499
|
+
F() || d(4, [], [2, 5]), h = !0;
|
|
494
500
|
}
|
|
495
|
-
return
|
|
501
|
+
return j(), t.getToken() !== 2 ? d(7, [2], []) : b(), !0;
|
|
496
502
|
}
|
|
497
503
|
i(N, "parseObject");
|
|
498
|
-
function
|
|
499
|
-
|
|
500
|
-
let
|
|
504
|
+
function Fe() {
|
|
505
|
+
y(), b();
|
|
506
|
+
let h = !0, D = !1;
|
|
501
507
|
for (; t.getToken() !== 4 && t.getToken() !== 17;) {
|
|
502
508
|
if (t.getToken() === 5) {
|
|
503
|
-
if (
|
|
504
|
-
} else
|
|
505
|
-
|
|
509
|
+
if (D || d(4, [], []), u(","), b(), t.getToken() === 4 && A) break;
|
|
510
|
+
} else D && d(6, [], []);
|
|
511
|
+
h ? (o.push(0), h = !1) : o[o.length - 1]++, H() || d(4, [], [4, 5]), D = !0;
|
|
506
512
|
}
|
|
507
|
-
return
|
|
513
|
+
return x(), h || o.pop(), t.getToken() !== 4 ? d(8, [4], []) : b(), !0;
|
|
508
514
|
}
|
|
509
|
-
i(
|
|
515
|
+
i(Fe, "parseArray");
|
|
510
516
|
function H() {
|
|
511
517
|
switch (t.getToken()) {
|
|
512
|
-
case 3: return
|
|
518
|
+
case 3: return Fe();
|
|
513
519
|
case 1: return N();
|
|
514
520
|
case 10: return L(!0);
|
|
515
521
|
default: return B();
|
|
516
522
|
}
|
|
517
523
|
}
|
|
518
|
-
return i(H, "parseValue"),
|
|
524
|
+
return i(H, "parseValue"), b(), t.getToken() === 17 ? s.allowEmptyContent ? !0 : (d(4, [], []), !1) : H() ? (t.getToken() !== 17 && d(9, [], []), !0) : (d(4, [], []), !1);
|
|
519
525
|
}
|
|
520
|
-
i(
|
|
526
|
+
i(Ve, "visit");
|
|
521
527
|
var fe;
|
|
522
528
|
(function(e) {
|
|
523
529
|
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";
|
|
@@ -526,19 +532,19 @@ var ue;
|
|
|
526
532
|
(function(e) {
|
|
527
533
|
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";
|
|
528
534
|
})(ue || (ue = {}));
|
|
529
|
-
const
|
|
535
|
+
const We = Pe;
|
|
530
536
|
var ae;
|
|
531
537
|
(function(e) {
|
|
532
538
|
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";
|
|
533
539
|
})(ae || (ae = {}));
|
|
534
|
-
const
|
|
540
|
+
const Z = i((e, n) => We(_e(n, e)), "readJsonc");
|
|
535
541
|
const pe = i(() => {
|
|
536
542
|
const { findPnpApi: e } = module$1;
|
|
537
543
|
return e && e(process.cwd());
|
|
538
544
|
}, "getPnpApi");
|
|
539
|
-
const
|
|
540
|
-
const
|
|
541
|
-
const s = `${
|
|
545
|
+
const Me = "detectTypeScriptVersion:";
|
|
546
|
+
const Je = i((e, n) => {
|
|
547
|
+
const s = `${Me}${e}`, t = n?.get(s);
|
|
542
548
|
if (t !== void 0) return t ?? void 0;
|
|
543
549
|
let o;
|
|
544
550
|
const r = pe();
|
|
@@ -546,16 +552,16 @@ const Me = i((e, n) => {
|
|
|
546
552
|
o = r.resolveRequest("typescript/package.json", e) ?? void 0;
|
|
547
553
|
} catch {}
|
|
548
554
|
o ??= R(path.resolve(e), path.join("node_modules", "typescript", "package.json"), n);
|
|
549
|
-
let
|
|
555
|
+
let c;
|
|
550
556
|
if (o) try {
|
|
551
|
-
const g =
|
|
552
|
-
typeof g?.version == "string" && (
|
|
557
|
+
const g = Z(o, n);
|
|
558
|
+
typeof g?.version == "string" && (c = g.version);
|
|
553
559
|
} catch {}
|
|
554
|
-
return n?.set(s,
|
|
560
|
+
return n?.set(s, c ?? null), c;
|
|
555
561
|
}, "detectTypeScriptVersion");
|
|
556
|
-
const
|
|
562
|
+
const S = "package.json";
|
|
557
563
|
const M = "tsconfig.json";
|
|
558
|
-
const
|
|
564
|
+
const ze = i((e, n, s) => {
|
|
559
565
|
const t = module$1.createRequire(path.join(s, "tsconfig.json"));
|
|
560
566
|
if (e !== n) try {
|
|
561
567
|
return t.resolve(e);
|
|
@@ -564,103 +570,103 @@ const Je = i((e, n, s) => {
|
|
|
564
570
|
return t.resolve(n);
|
|
565
571
|
} catch {}
|
|
566
572
|
try {
|
|
567
|
-
return t.resolve(`${n}/${
|
|
573
|
+
return t.resolve(`${n}/${S}`);
|
|
568
574
|
} catch {}
|
|
569
575
|
}, "resolvePackageEntryWithNode");
|
|
570
|
-
const
|
|
576
|
+
const q = i((e, n, s, t) => {
|
|
571
577
|
const o = `resolveFromPackageJsonPath:${e}:${n}:${s}`;
|
|
572
578
|
if (t?.has(o)) return t.get(o) || !1;
|
|
573
|
-
const r =
|
|
579
|
+
const r = Z(e, t);
|
|
574
580
|
if (!r) return;
|
|
575
|
-
let
|
|
581
|
+
let c = n || M;
|
|
576
582
|
if (!s && r.exports) try {
|
|
577
583
|
const [g] = v(r.exports, n, ["require", "types"]);
|
|
578
|
-
|
|
584
|
+
c = g;
|
|
579
585
|
} catch {
|
|
580
586
|
return t?.set(o, ""), !1;
|
|
581
587
|
}
|
|
582
|
-
else !n && r.tsconfig && (
|
|
583
|
-
return
|
|
588
|
+
else !n && r.tsconfig && (c = r.tsconfig);
|
|
589
|
+
return c = path.join(e, "..", c), t?.set(o, c), c;
|
|
584
590
|
}, "resolveFromPackageJsonPath");
|
|
585
|
-
const
|
|
591
|
+
const Ge = i((e, n, s) => {
|
|
586
592
|
const t = `resolveExtendsPath:${e}:${n}`;
|
|
587
593
|
if (s?.has(t)) return s.get(t) || void 0;
|
|
588
|
-
const o =
|
|
594
|
+
const o = Qe(e, n, s);
|
|
589
595
|
return s?.set(t, o || ""), o;
|
|
590
596
|
}, "resolveExtendsPath");
|
|
591
|
-
const
|
|
597
|
+
const Qe = i((e, n, s) => {
|
|
592
598
|
let t = e;
|
|
593
599
|
if (e === ".." && (t = path.join(t, M)), e[0] === "." && (t = path.resolve(n, t)), path.isAbsolute(t)) {
|
|
594
|
-
const
|
|
595
|
-
if (
|
|
596
|
-
if (
|
|
600
|
+
const u = $(s, t);
|
|
601
|
+
if (u) {
|
|
602
|
+
if (u.isFile()) return t;
|
|
597
603
|
} else if (!t.endsWith(".json")) {
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
604
|
+
const w = `${t}.json`;
|
|
605
|
+
if ($(s, w)) return w;
|
|
600
606
|
}
|
|
601
607
|
return;
|
|
602
608
|
}
|
|
603
|
-
const [o, ...r] = e.split("/"),
|
|
609
|
+
const [o, ...r] = e.split("/"), c = o[0] === "@" ? `${o}/${r.shift()}` : o, g = r.join("/"), m = pe();
|
|
604
610
|
if (m) {
|
|
605
|
-
const { resolveRequest:
|
|
611
|
+
const { resolveRequest: u } = m;
|
|
606
612
|
try {
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
613
|
+
if (c === e) {
|
|
614
|
+
const w = u(path.join(c, S), n);
|
|
615
|
+
if (w) {
|
|
616
|
+
const l = q(w, g, !1, s);
|
|
617
|
+
if (l && $(s, l)) return l;
|
|
612
618
|
}
|
|
613
619
|
} else {
|
|
614
|
-
let
|
|
620
|
+
let w;
|
|
615
621
|
try {
|
|
616
|
-
|
|
622
|
+
w = u(e, n, { extensions: [".json"] });
|
|
617
623
|
} catch {
|
|
618
|
-
|
|
624
|
+
w = u(path.join(e, M), n);
|
|
619
625
|
}
|
|
620
|
-
if (
|
|
626
|
+
if (w) return w;
|
|
621
627
|
}
|
|
622
628
|
} catch {}
|
|
623
629
|
}
|
|
624
|
-
const k =
|
|
625
|
-
let
|
|
630
|
+
const k = ze(e, c, n);
|
|
631
|
+
let v;
|
|
626
632
|
if (k) {
|
|
627
|
-
if (path.basename(k) !==
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
const
|
|
631
|
-
if (!
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
636
|
-
if (
|
|
637
|
-
}
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
640
|
-
const
|
|
641
|
-
if (
|
|
642
|
-
}
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
645
|
-
if (
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
633
|
+
if (path.basename(k) !== S && k.endsWith(".json")) return k;
|
|
634
|
+
v = path.basename(k) === S ? k : R(path.dirname(k), S, s);
|
|
635
|
+
}
|
|
636
|
+
const f = v && path.dirname(v) || R(path.resolve(n), path.join("node_modules", c), s);
|
|
637
|
+
if (!f || !$(s, f)?.isDirectory()) return;
|
|
638
|
+
const O = Ne(s, f), j = path.join(O, S);
|
|
639
|
+
if ($(s, j)) {
|
|
640
|
+
const u = q(j, g, !1, s);
|
|
641
|
+
if (u === !1) return;
|
|
642
|
+
if (u && $(s, u)?.isFile()) return u;
|
|
643
|
+
}
|
|
644
|
+
const y = path.join(O, g), x = y.endsWith(".json");
|
|
645
|
+
if (!x) {
|
|
646
|
+
const u = `${y}.json`;
|
|
647
|
+
if ($(s, u)) return u;
|
|
648
|
+
}
|
|
649
|
+
const p = $(s, y);
|
|
650
|
+
if (p) {
|
|
651
|
+
if (p.isDirectory()) {
|
|
652
|
+
const u = path.join(y, S);
|
|
653
|
+
if ($(s, u)) {
|
|
654
|
+
const l = q(u, "", !0, s);
|
|
655
|
+
if (l && $(s, l)) return l;
|
|
650
656
|
}
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
} else if (
|
|
657
|
+
const w = path.join(y, M);
|
|
658
|
+
if ($(s, w)) return w;
|
|
659
|
+
} else if (x) return y;
|
|
654
660
|
}
|
|
655
661
|
}, "resolveExtendsPathUncached");
|
|
656
|
-
const
|
|
662
|
+
const K = Symbol("implicitBaseUrl");
|
|
657
663
|
const U = "${configDir}";
|
|
658
|
-
const
|
|
664
|
+
const C = /^\.{1,2}(\/.*)?$/;
|
|
659
665
|
const J = i((e) => {
|
|
660
|
-
const n =
|
|
661
|
-
return
|
|
666
|
+
const n = E(e);
|
|
667
|
+
return C.test(n) ? n : `./${n}`;
|
|
662
668
|
}, "normalizeRelativePath");
|
|
663
|
-
const
|
|
669
|
+
const He = i((e) => {
|
|
664
670
|
const n = { ...e };
|
|
665
671
|
if (n.strict) for (const t of [
|
|
666
672
|
"noImplicitAny",
|
|
@@ -697,33 +703,33 @@ const Qe = i((e) => {
|
|
|
697
703
|
]) n[s] && (n[s] = n[s].toLowerCase());
|
|
698
704
|
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;
|
|
699
705
|
}, "normalizeCompilerOptions");
|
|
700
|
-
const
|
|
701
|
-
!n.has("target") && !
|
|
706
|
+
const Xe = i((e, n) => {
|
|
707
|
+
!n.has("target") && !Ye(e.module) && (e.target = "es3");
|
|
702
708
|
}, "applyV4Defaults");
|
|
703
|
-
const
|
|
704
|
-
const
|
|
705
|
-
!n.has("target") && !
|
|
709
|
+
const Ye = i((e) => e === "node16" || e === "node18" || e === "node20" || e === "nodenext", "moduleDictatesTarget$1");
|
|
710
|
+
const Ze = i((e, n) => {
|
|
711
|
+
!n.has("target") && !qe(e.module) && (e.target = "es5");
|
|
706
712
|
}, "applyV5Defaults");
|
|
707
|
-
const
|
|
708
|
-
const
|
|
713
|
+
const qe = i((e) => e === "node16" || e === "node18" || e === "node20" || e === "nodenext", "moduleDictatesTarget");
|
|
714
|
+
const Ke = i((e, n) => {
|
|
709
715
|
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);
|
|
710
716
|
}, "applyV6Defaults");
|
|
711
|
-
const
|
|
712
|
-
[4,
|
|
713
|
-
[5,
|
|
714
|
-
[6,
|
|
717
|
+
const Ce = [
|
|
718
|
+
[4, Xe],
|
|
719
|
+
[5, Ze],
|
|
720
|
+
[6, Ke]
|
|
715
721
|
];
|
|
716
|
-
const
|
|
722
|
+
const et = i((e) => {
|
|
717
723
|
const n = /^v?(\d+)/.exec(e);
|
|
718
724
|
return n ? Number(n[1]) : void 0;
|
|
719
725
|
}, "parseMajor");
|
|
720
|
-
const
|
|
721
|
-
const s =
|
|
726
|
+
const tt = i((e, n) => {
|
|
727
|
+
const s = et(n);
|
|
722
728
|
if (s === void 0) return;
|
|
723
729
|
const t = new Set(Object.keys(e));
|
|
724
|
-
for (const [o, r] of
|
|
730
|
+
for (const [o, r] of Ce) o <= s && r(e, t);
|
|
725
731
|
}, "applyVersionDefaults");
|
|
726
|
-
const
|
|
732
|
+
const ee = i((e, n) => J(path.relative(e, n)), "pathRelative");
|
|
727
733
|
const me = [
|
|
728
734
|
"files",
|
|
729
735
|
"include",
|
|
@@ -731,18 +737,18 @@ const me = [
|
|
|
731
737
|
];
|
|
732
738
|
const ge = i((e, n, s) => {
|
|
733
739
|
const t = path.join(n, s);
|
|
734
|
-
return
|
|
740
|
+
return E(path.relative(e, t)) || "./";
|
|
735
741
|
}, "resolveAndRelativize");
|
|
736
|
-
const
|
|
742
|
+
const nt = i((e, n, s) => {
|
|
737
743
|
const t = path.relative(e, n);
|
|
738
744
|
if (!t) return s;
|
|
739
|
-
return
|
|
745
|
+
return E(`${t}/${s.startsWith("./") ? s.slice(2) : s}`);
|
|
740
746
|
}, "prefixPattern");
|
|
741
747
|
const de = ["outDir", "declarationDir"];
|
|
742
748
|
const z = i((e, n) => {
|
|
743
|
-
if (e.startsWith(U)) return
|
|
749
|
+
if (e.startsWith(U)) return E(path.join(n, e.slice(12)));
|
|
744
750
|
}, "interpolateConfigDir");
|
|
745
|
-
const
|
|
751
|
+
const st = [
|
|
746
752
|
"outDir",
|
|
747
753
|
"declarationDir",
|
|
748
754
|
"outFile",
|
|
@@ -752,194 +758,197 @@ const nt = [
|
|
|
752
758
|
];
|
|
753
759
|
const ke = i((e, n = {}) => {
|
|
754
760
|
if (e.length === 0) throw new Error("Chain must not be empty");
|
|
755
|
-
const { typescriptVersion: s } = n, t = new Map(e.map((
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
758
|
-
const
|
|
759
|
-
if (!
|
|
760
|
-
const
|
|
761
|
-
let
|
|
762
|
-
...
|
|
763
|
-
...
|
|
764
|
-
...
|
|
761
|
+
const { typescriptVersion: s } = n, t = new Map(e.map((f) => [f.path, f])), o = /* @__PURE__ */ new Map(), r = i((f) => {
|
|
762
|
+
const O = o.get(f);
|
|
763
|
+
if (O) return O;
|
|
764
|
+
const j = t.get(f);
|
|
765
|
+
if (!j) throw new Error(`Config not found in chain: ${f}`);
|
|
766
|
+
const y = j.config, x = path.dirname(f);
|
|
767
|
+
let p = {
|
|
768
|
+
...y,
|
|
769
|
+
...y.compilerOptions && { compilerOptions: { ...y.compilerOptions } },
|
|
770
|
+
...y.watchOptions && { watchOptions: { ...y.watchOptions } }
|
|
765
771
|
};
|
|
766
|
-
if (delete
|
|
767
|
-
const
|
|
768
|
-
for (const
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
771
|
-
const L = { ...
|
|
772
|
+
if (delete p.extends, p.compilerOptions?.paths && !p.compilerOptions.baseUrl && (p.compilerOptions[K] = x), y.extends) {
|
|
773
|
+
const u = Array.isArray(y.extends) ? y.extends : [y.extends];
|
|
774
|
+
for (const w of u.toReversed()) {
|
|
775
|
+
const l = r(w), T = path.dirname(w), { references: A, ...b } = l;
|
|
776
|
+
if (b.compilerOptions) {
|
|
777
|
+
const L = { ...b.compilerOptions };
|
|
772
778
|
for (const B of [
|
|
773
779
|
"baseUrl",
|
|
774
780
|
"outDir",
|
|
775
781
|
"declarationDir",
|
|
776
782
|
"rootDir"
|
|
777
783
|
]) {
|
|
778
|
-
const
|
|
779
|
-
|
|
784
|
+
const F = L[B];
|
|
785
|
+
F && !F.startsWith(U) && (L[B] = ge(x, T, F));
|
|
780
786
|
}
|
|
781
787
|
for (const B of ["rootDirs", "typeRoots"]) {
|
|
782
|
-
const
|
|
783
|
-
|
|
788
|
+
const F = L[B];
|
|
789
|
+
F && (L[B] = F.map((N) => N.startsWith(U) ? N : ge(x, T, N)));
|
|
784
790
|
}
|
|
785
|
-
|
|
791
|
+
b.compilerOptions = L;
|
|
786
792
|
}
|
|
787
793
|
for (const L of me) {
|
|
788
|
-
const B =
|
|
789
|
-
B && (
|
|
794
|
+
const B = b[L];
|
|
795
|
+
B && (b[L] = B.map((F) => F.startsWith(U) ? F : nt(x, T, F)));
|
|
790
796
|
}
|
|
791
797
|
const d = {
|
|
792
|
-
...
|
|
793
|
-
...
|
|
798
|
+
...b,
|
|
799
|
+
...p,
|
|
794
800
|
compilerOptions: {
|
|
795
|
-
...
|
|
796
|
-
...
|
|
801
|
+
...b.compilerOptions,
|
|
802
|
+
...p.compilerOptions
|
|
797
803
|
}
|
|
798
804
|
};
|
|
799
|
-
|
|
800
|
-
...
|
|
801
|
-
...
|
|
802
|
-
}),
|
|
805
|
+
b.watchOptions && (d.watchOptions = {
|
|
806
|
+
...b.watchOptions,
|
|
807
|
+
...p.watchOptions
|
|
808
|
+
}), p = d;
|
|
803
809
|
}
|
|
804
810
|
}
|
|
805
|
-
if (
|
|
806
|
-
const { compilerOptions:
|
|
807
|
-
for (const
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
|
|
811
|
+
if (p.compilerOptions) {
|
|
812
|
+
const { compilerOptions: u } = p;
|
|
813
|
+
for (const l of ["baseUrl", "rootDir"]) {
|
|
814
|
+
const T = u[l];
|
|
815
|
+
if (T && !T.startsWith(U)) {
|
|
816
|
+
const A = path.resolve(x, T);
|
|
817
|
+
u[l] = ee(x, A);
|
|
812
818
|
}
|
|
813
819
|
}
|
|
814
|
-
for (const
|
|
815
|
-
let
|
|
816
|
-
|
|
820
|
+
for (const l of de) {
|
|
821
|
+
let T = u[l];
|
|
822
|
+
T && (Array.isArray(p.exclude) || (p.exclude = de.map((A) => u[A]).filter(Boolean)), T.startsWith(U) || (T = J(T)), u[l] = T);
|
|
817
823
|
}
|
|
818
|
-
} else
|
|
819
|
-
if (
|
|
820
|
-
const { watchOptions:
|
|
821
|
-
for (const
|
|
822
|
-
for (const
|
|
824
|
+
} else p.compilerOptions = {};
|
|
825
|
+
if (p.include && (p.include = p.include.map(E)), p.files && (p.files = p.files.map((u) => u.startsWith(U) ? u : J(u))), p.watchOptions) {
|
|
826
|
+
const { watchOptions: u } = p;
|
|
827
|
+
for (const w of ["excludeDirectories", "excludeFiles"]) u[w] && (u[w] = u[w].map((l) => E(path.resolve(x, l))));
|
|
828
|
+
for (const w of [
|
|
823
829
|
"watchFile",
|
|
824
830
|
"watchDirectory",
|
|
825
831
|
"fallbackPolling"
|
|
826
|
-
]) if (
|
|
827
|
-
const
|
|
828
|
-
|
|
832
|
+
]) if (u[w]) {
|
|
833
|
+
const l = u;
|
|
834
|
+
l[w] = u[w].toLowerCase();
|
|
829
835
|
}
|
|
830
836
|
}
|
|
831
|
-
return o.set(
|
|
832
|
-
}, "resolveEntry"),
|
|
837
|
+
return o.set(f, p), p;
|
|
838
|
+
}, "resolveEntry"), c = e[0], g = r(c.path), m = path.dirname(c.path), k = {
|
|
833
839
|
...g,
|
|
834
840
|
compilerOptions: g.compilerOptions ? { ...g.compilerOptions } : {}
|
|
835
|
-
}, { compilerOptions:
|
|
836
|
-
if (
|
|
837
|
-
for (const
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
const
|
|
841
|
-
|
|
841
|
+
}, { compilerOptions: v } = k;
|
|
842
|
+
if (v) {
|
|
843
|
+
for (const f of st) {
|
|
844
|
+
const O = v[f];
|
|
845
|
+
if (O) {
|
|
846
|
+
const j = z(O, m);
|
|
847
|
+
v[f] = j ? ee(m, j) : O;
|
|
842
848
|
}
|
|
843
849
|
}
|
|
844
|
-
for (const
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
return
|
|
850
|
+
for (const f of ["rootDirs", "typeRoots"]) {
|
|
851
|
+
const O = v[f];
|
|
852
|
+
O && (v[f] = O.map((j) => {
|
|
853
|
+
const y = z(j, m);
|
|
854
|
+
return y ? ee(m, y) : J(j);
|
|
849
855
|
}));
|
|
850
856
|
}
|
|
851
|
-
if (
|
|
852
|
-
const
|
|
853
|
-
for (const [
|
|
854
|
-
|
|
857
|
+
if (v.paths) {
|
|
858
|
+
const f = {};
|
|
859
|
+
for (const [O, j] of Object.entries(v.paths)) f[O] = j.map((y) => z(y, m) ?? y);
|
|
860
|
+
v.paths = f;
|
|
855
861
|
}
|
|
856
|
-
s &&
|
|
862
|
+
s && tt(v, s), k.compilerOptions = He(v);
|
|
857
863
|
}
|
|
858
|
-
for (const
|
|
859
|
-
const
|
|
860
|
-
|
|
864
|
+
for (const f of me) {
|
|
865
|
+
const O = k[f];
|
|
866
|
+
O && (k[f] = O.map((j) => z(j, m) ?? j));
|
|
861
867
|
}
|
|
862
868
|
return {
|
|
863
|
-
path:
|
|
869
|
+
path: c.path,
|
|
864
870
|
config: k,
|
|
865
|
-
sources: e.map((
|
|
871
|
+
sources: e.map((f) => f.path)
|
|
866
872
|
};
|
|
867
873
|
}, "resolveExtendsChain");
|
|
868
|
-
const
|
|
869
|
-
const { cache: s = /* @__PURE__ */ new Map() } = n, t = path.resolve(e), o = [], r = /* @__PURE__ */ new Set(),
|
|
870
|
-
const k =
|
|
874
|
+
const ve = i((e, n = {}) => {
|
|
875
|
+
const { cache: s = /* @__PURE__ */ new Map() } = n, t = path.resolve(e), o = [], r = /* @__PURE__ */ new Set(), c = i((g, m) => {
|
|
876
|
+
const k = E(g);
|
|
871
877
|
if (r.has(k)) return;
|
|
872
878
|
r.add(k);
|
|
873
|
-
let
|
|
879
|
+
let v;
|
|
874
880
|
try {
|
|
875
|
-
|
|
881
|
+
v = Z(g, s) || {};
|
|
876
882
|
} catch {
|
|
877
883
|
throw new Error(`Cannot resolve tsconfig at path: ${g}`);
|
|
878
884
|
}
|
|
879
|
-
if (typeof
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
if (!
|
|
885
|
-
const
|
|
886
|
-
if (m.has(
|
|
887
|
-
return
|
|
885
|
+
if (typeof v != "object") throw new SyntaxError(`Failed to parse tsconfig at: ${g}`);
|
|
886
|
+
const f = path.dirname(g);
|
|
887
|
+
if (v.extends) {
|
|
888
|
+
const O = Array.isArray(v.extends), y = (O ? v.extends : [v.extends]).map((p) => {
|
|
889
|
+
const u = Ge(p, f, s);
|
|
890
|
+
if (!u) throw new Error(`File '${p}' not found.`);
|
|
891
|
+
const w = E(u);
|
|
892
|
+
if (m.has(w) || w === k) throw new Error(`Circularity detected while resolving configuration: ${w}`);
|
|
893
|
+
return w;
|
|
888
894
|
});
|
|
889
|
-
|
|
895
|
+
v.extends = O ? y : y[0], o.push({
|
|
890
896
|
path: k,
|
|
891
|
-
config:
|
|
897
|
+
config: v
|
|
892
898
|
});
|
|
893
|
-
const
|
|
894
|
-
|
|
895
|
-
for (const
|
|
899
|
+
const x = new Set(m);
|
|
900
|
+
x.add(k);
|
|
901
|
+
for (const p of [...y].reverse()) c(p, x);
|
|
896
902
|
} else o.push({
|
|
897
903
|
path: k,
|
|
898
|
-
config:
|
|
904
|
+
config: v
|
|
899
905
|
});
|
|
900
906
|
}, "collect");
|
|
901
|
-
return
|
|
907
|
+
return c(t, /* @__PURE__ */ new Set()), o;
|
|
902
908
|
}, "getExtendsChain");
|
|
903
|
-
const
|
|
904
|
-
const { cache: s = /* @__PURE__ */ new Map(), typescriptVersion: t = "auto" } = n, o =
|
|
909
|
+
const te = i((e, n = {}) => {
|
|
910
|
+
const { cache: s = /* @__PURE__ */ new Map(), typescriptVersion: t = "auto" } = n, o = ve(e, { cache: s });
|
|
905
911
|
let r;
|
|
906
|
-
return t === "auto" ? r =
|
|
912
|
+
return t === "auto" ? r = Je(path.dirname(o[0].path), s) : t !== !1 && (r = t), ke(o, { typescriptVersion: r });
|
|
907
913
|
}, "readTsconfig");
|
|
908
|
-
var
|
|
909
|
-
var G = i((e, n) =>
|
|
914
|
+
var ot = Object.defineProperty;
|
|
915
|
+
var G = i((e, n) => ot(e, "name", {
|
|
910
916
|
value: n,
|
|
911
917
|
configurable: !0
|
|
912
918
|
}), "s");
|
|
913
|
-
const
|
|
919
|
+
const we = G((e) => {
|
|
914
920
|
let n = "";
|
|
915
921
|
for (let s = 0; s < e.length; s += 1) {
|
|
916
922
|
const t = e[s], o = t.toUpperCase();
|
|
917
923
|
n += t === o ? t.toLowerCase() : o;
|
|
918
924
|
}
|
|
919
925
|
return n;
|
|
920
|
-
}, "invertCase"),
|
|
921
|
-
const s =
|
|
926
|
+
}, "invertCase"), ne = /* @__PURE__ */ new Map(), be = G((e, n) => {
|
|
927
|
+
const s = Ie.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
|
|
922
928
|
try {
|
|
923
|
-
return n.writeFileSync(s, ""), !n.existsSync(
|
|
929
|
+
return n.writeFileSync(s, ""), !n.existsSync(we(s));
|
|
924
930
|
} finally {
|
|
925
931
|
try {
|
|
926
932
|
n.unlinkSync(s);
|
|
927
933
|
} catch {}
|
|
928
934
|
}
|
|
929
|
-
}, "checkDirectoryCaseWithWrite"),
|
|
935
|
+
}, "checkDirectoryCaseWithWrite"), it = G((e, n, s) => {
|
|
930
936
|
try {
|
|
931
937
|
return be(e, s);
|
|
932
938
|
} catch (t) {
|
|
933
|
-
if (n === void 0) return be(
|
|
939
|
+
if (n === void 0) return be(Se.tmpdir(), s);
|
|
934
940
|
throw t;
|
|
935
941
|
}
|
|
936
|
-
}, "checkDirectoryCaseWithFallback"),
|
|
942
|
+
}, "checkDirectoryCaseWithFallback"), rt = G((e, n = Ue, s = !0) => {
|
|
937
943
|
const t = e ?? process.cwd();
|
|
938
|
-
if (s &&
|
|
944
|
+
if (s && ne.has(t)) return ne.get(t);
|
|
939
945
|
let o;
|
|
940
|
-
const r =
|
|
941
|
-
return r !== t && n.existsSync(t) ? o = !n.existsSync(r) : o =
|
|
942
|
-
}, "isFsCaseSensitive"), { join:
|
|
946
|
+
const r = we(t);
|
|
947
|
+
return r !== t && n.existsSync(t) ? o = !n.existsSync(r) : o = it(t, e, n), s && ne.set(t, o), o;
|
|
948
|
+
}, "isFsCaseSensitive"), { join: lt } = path.posix, ye = i((e, n) => {
|
|
949
|
+
const s = lt(e, n);
|
|
950
|
+
return e.startsWith("//") && !s.startsWith("//") ? `/${s}` : s;
|
|
951
|
+
}, "pathJoin"), se = {
|
|
943
952
|
ts: [
|
|
944
953
|
".ts",
|
|
945
954
|
".tsx",
|
|
@@ -947,93 +956,93 @@ const ve = G((e) => {
|
|
|
947
956
|
],
|
|
948
957
|
cts: [".cts", ".d.cts"],
|
|
949
958
|
mts: [".mts", ".d.mts"]
|
|
950
|
-
},
|
|
951
|
-
const n = [...
|
|
959
|
+
}, ct = i((e) => {
|
|
960
|
+
const n = [...se.ts], s = [...se.cts], t = [...se.mts];
|
|
952
961
|
return e?.allowJs && (n.push(".js", ".jsx"), s.push(".cjs"), t.push(".mjs")), [
|
|
953
962
|
...n,
|
|
954
963
|
...s,
|
|
955
964
|
...t
|
|
956
965
|
];
|
|
957
|
-
}, "getSupportedExtensions"),
|
|
966
|
+
}, "getSupportedExtensions"), ft = i((e) => {
|
|
958
967
|
const n = [];
|
|
959
968
|
if (!e) return n;
|
|
960
969
|
const { outDir: s, declarationDir: t } = e;
|
|
961
970
|
return s && n.push(s), t && n.push(t), n;
|
|
962
|
-
}, "getDefaultExcludeSpec"), Te = i((e) => e.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`), "escapeForRegexp"),
|
|
971
|
+
}, "getDefaultExcludeSpec"), Te = i((e) => e.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`), "escapeForRegexp"), oe = `(?!(${[
|
|
963
972
|
"node_modules",
|
|
964
973
|
"bower_components",
|
|
965
974
|
"jspm_packages"
|
|
966
|
-
].join("|")})(/|$))`,
|
|
975
|
+
].join("|")})(/|$))`, at = /(?:^|\/)[^.*?]+$/, he = "**/*", Q = "[^/]", ie = "[^./]", Oe = process.platform === "win32", pt = i(({ config: e, path: n }, s) => {
|
|
967
976
|
if ("extends" in e) throw new Error("tsconfig#extends must be resolved. Use getTsconfig or readTsconfig to resolve it.");
|
|
968
977
|
if (!path.isAbsolute(n)) throw new Error("The tsconfig path must be absolute");
|
|
969
|
-
Oe && (n =
|
|
970
|
-
const t = path.dirname(n), { files: o, include: r, exclude:
|
|
971
|
-
const
|
|
972
|
-
return new RegExp(`^${
|
|
973
|
-
}),
|
|
978
|
+
Oe && (n = E(n));
|
|
979
|
+
const t = path.dirname(n), { files: o, include: r, exclude: c, compilerOptions: g } = e, m = i((p) => path.isAbsolute(p) ? p : ye(t, p), "resolvePattern"), k = o ? new Set(o.map(m)) : void 0, v = ct(g), f = s ? "" : "i", j = (c || ft(g)).map((p) => {
|
|
980
|
+
const u = m(p), w = Te(u).replaceAll(String.raw`\*\*/`, "(.+/)?").replaceAll(String.raw`\*`, `${Q}*`).replaceAll(String.raw`\?`, Q);
|
|
981
|
+
return new RegExp(`^${w}($|/)`, f);
|
|
982
|
+
}), y = o || r ? r : [he];
|
|
974
983
|
return {
|
|
975
984
|
filesSet: k,
|
|
976
|
-
extensions:
|
|
977
|
-
excludePatterns:
|
|
978
|
-
includePatterns:
|
|
979
|
-
let
|
|
980
|
-
|
|
981
|
-
const
|
|
982
|
-
const
|
|
983
|
-
return
|
|
984
|
-
}).replaceAll(/(\/)?\\\?/g, (
|
|
985
|
-
const
|
|
986
|
-
return
|
|
985
|
+
extensions: v,
|
|
986
|
+
excludePatterns: j,
|
|
987
|
+
includePatterns: y ? y.map((p) => {
|
|
988
|
+
let u = m(p);
|
|
989
|
+
at.test(u) && (u = ye(u, he));
|
|
990
|
+
const w = Te(u).replaceAll(String.raw`/\*\*`, `(/${oe}${ie}${Q}*)*?`).replaceAll(/(\/)?\\\*/g, (l, T) => {
|
|
991
|
+
const A = String.raw`(${ie}|(\.(?!min\.js$))?)*`;
|
|
992
|
+
return T ? `/${oe}${ie}${A}` : A;
|
|
993
|
+
}).replaceAll(/(\/)?\\\?/g, (l, T) => {
|
|
994
|
+
const A = Q;
|
|
995
|
+
return T ? `/${oe}${A}` : A;
|
|
987
996
|
});
|
|
988
|
-
return new RegExp(`^${
|
|
997
|
+
return new RegExp(`^${w}$`, f);
|
|
989
998
|
}) : void 0
|
|
990
999
|
};
|
|
991
1000
|
}, "compilePatterns"), Ae = /* @__PURE__ */ new WeakMap(), je = i((e, n) => {
|
|
992
1001
|
if (!path.isAbsolute(n)) return !1;
|
|
993
|
-
Oe && (n =
|
|
1002
|
+
Oe && (n = E(n));
|
|
994
1003
|
let s = Ae.get(e);
|
|
995
|
-
s || (s =
|
|
996
|
-
const { filesSet: t, extensions: o, excludePatterns: r, includePatterns:
|
|
997
|
-
return t?.has(n) ? !0 : !o.some((g) => n.endsWith(g)) || r.some((g) => g.test(n)) ? !1 : !!(
|
|
998
|
-
}, "isFileIncluded"),
|
|
1004
|
+
s || (s = pt(e, rt()), Ae.set(e, s));
|
|
1005
|
+
const { filesSet: t, extensions: o, excludePatterns: r, includePatterns: c } = s;
|
|
1006
|
+
return t?.has(n) ? !0 : !o.some((g) => n.endsWith(g)) || r.some((g) => g.test(n)) ? !1 : !!(c && c.some((g) => g.test(n)));
|
|
1007
|
+
}, "isFileIncluded"), xe = i((e, n, s, t) => {
|
|
999
1008
|
const o = path.resolve(e);
|
|
1000
|
-
let r =
|
|
1009
|
+
let r = E(e);
|
|
1001
1010
|
for (;;) {
|
|
1002
|
-
const
|
|
1003
|
-
if (!
|
|
1004
|
-
const g = path.resolve(
|
|
1011
|
+
const c = R(r, n, s);
|
|
1012
|
+
if (!c) return;
|
|
1013
|
+
const g = path.resolve(c), m = te(g, {
|
|
1005
1014
|
cache: s,
|
|
1006
1015
|
typescriptVersion: t
|
|
1007
1016
|
});
|
|
1008
1017
|
if (je(m, o)) return m;
|
|
1009
|
-
const k = path.dirname(
|
|
1010
|
-
if (
|
|
1011
|
-
r =
|
|
1018
|
+
const k = path.dirname(c), v = path.dirname(k);
|
|
1019
|
+
if (v === k) return;
|
|
1020
|
+
r = v;
|
|
1012
1021
|
}
|
|
1013
|
-
}, "findConfigApplicable"),
|
|
1022
|
+
}, "findConfigApplicable"), De = i((e = process.cwd(), n = {}) => {
|
|
1014
1023
|
const { configName: s = "tsconfig.json", cache: t = /* @__PURE__ */ new Map(), includes: o = !1 } = n;
|
|
1015
1024
|
if (!o) {
|
|
1016
1025
|
const r = path.resolve(e);
|
|
1017
|
-
return path.basename(r) === s &&
|
|
1026
|
+
return path.basename(r) === s && $(t, r)?.isFile() ? E(r) : R(E(e), s, t);
|
|
1018
1027
|
}
|
|
1019
|
-
return
|
|
1020
|
-
}, "findTsconfig"),
|
|
1028
|
+
return xe(e, s, t, !1)?.path;
|
|
1029
|
+
}, "findTsconfig"), mt = i((e = process.cwd(), n = {}) => {
|
|
1021
1030
|
const { configName: s = "tsconfig.json", cache: t = /* @__PURE__ */ new Map(), includes: o = !1, typescriptVersion: r = "auto" } = n;
|
|
1022
1031
|
if (!o) {
|
|
1023
|
-
const
|
|
1032
|
+
const c = De(e, {
|
|
1024
1033
|
configName: s,
|
|
1025
1034
|
cache: t
|
|
1026
1035
|
});
|
|
1027
|
-
return
|
|
1036
|
+
return c ? te(c, {
|
|
1028
1037
|
cache: t,
|
|
1029
1038
|
typescriptVersion: r
|
|
1030
1039
|
}) : void 0;
|
|
1031
1040
|
}
|
|
1032
|
-
return
|
|
1033
|
-
}, "getTsconfig"),
|
|
1034
|
-
const s = e.match(
|
|
1041
|
+
return xe(e, s, t, r);
|
|
1042
|
+
}, "getTsconfig"), gt = /\*/g, Ee = i((e, n) => {
|
|
1043
|
+
const s = e.match(gt);
|
|
1035
1044
|
if (s && s.length > 1) throw new Error(n);
|
|
1036
|
-
}, "assertStarCount"),
|
|
1045
|
+
}, "assertStarCount"), dt = i((e) => {
|
|
1037
1046
|
if (e.includes("*")) {
|
|
1038
1047
|
const [n, s] = e.split("*");
|
|
1039
1048
|
return {
|
|
@@ -1042,40 +1051,40 @@ const ve = G((e) => {
|
|
|
1042
1051
|
};
|
|
1043
1052
|
}
|
|
1044
1053
|
return e;
|
|
1045
|
-
}, "parsePattern"),
|
|
1046
|
-
pattern:
|
|
1054
|
+
}, "parsePattern"), kt = i(({ prefix: e, suffix: n }, s) => s.startsWith(e) && s.endsWith(n), "isPatternMatch"), vt = i((e, n, s) => Object.entries(e).map(([t, o]) => (Ee(t, `Pattern '${t}' can have at most one '*' character.`), {
|
|
1055
|
+
pattern: dt(t),
|
|
1047
1056
|
substitutions: o.map((r) => {
|
|
1048
|
-
if (
|
|
1057
|
+
if (Ee(r, `Substitution '${r}' in pattern '${t}' can have at most one '*' character.`), !n && !C.test(r) && !path.isAbsolute(r)) throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");
|
|
1049
1058
|
return path.resolve(s, r);
|
|
1050
1059
|
})
|
|
1051
|
-
})), "parsePaths"),
|
|
1060
|
+
})), "parsePaths"), wt = i((e) => {
|
|
1052
1061
|
const { compilerOptions: n } = e.config;
|
|
1053
1062
|
if (!n) return null;
|
|
1054
1063
|
const { baseUrl: s, paths: t } = n;
|
|
1055
1064
|
if (!s && !t) return null;
|
|
1056
|
-
const o =
|
|
1057
|
-
for (const k of
|
|
1065
|
+
const o = K in n && n[K], r = path.resolve(path.dirname(e.path), s || o || "."), c = t ? vt(t, s, r) : [], g = /* @__PURE__ */ new Map(), m = [];
|
|
1066
|
+
for (const k of c) typeof k.pattern == "string" ? g.set(k.pattern, k.substitutions) : m.push(k);
|
|
1058
1067
|
return {
|
|
1059
1068
|
exactEntries: g,
|
|
1060
1069
|
patternEntries: m,
|
|
1061
1070
|
resolvedBaseUrl: r,
|
|
1062
1071
|
baseUrl: s
|
|
1063
1072
|
};
|
|
1064
|
-
}, "compilePaths"),
|
|
1073
|
+
}, "compilePaths"), $e = /* @__PURE__ */ new WeakMap();
|
|
1065
1074
|
i((e, n) => {
|
|
1066
|
-
let s =
|
|
1067
|
-
if (s === void 0 && (s =
|
|
1068
|
-
if (
|
|
1069
|
-
const { exactEntries: t, patternEntries: o, resolvedBaseUrl: r, baseUrl:
|
|
1070
|
-
if (g) return g.map(
|
|
1075
|
+
let s = $e.get(e);
|
|
1076
|
+
if (s === void 0 && (s = wt(e), $e.set(e, s)), !s) return [];
|
|
1077
|
+
if (C.test(n)) return [];
|
|
1078
|
+
const { exactEntries: t, patternEntries: o, resolvedBaseUrl: r, baseUrl: c } = s, g = t.get(n);
|
|
1079
|
+
if (g) return g.map(E);
|
|
1071
1080
|
let m, k = -1;
|
|
1072
|
-
for (const
|
|
1073
|
-
if (!m) return
|
|
1074
|
-
const
|
|
1075
|
-
return m.substitutions.map((
|
|
1081
|
+
for (const f of o) kt(f.pattern, n) && f.pattern.prefix.length > k && (k = f.pattern.prefix.length, m = f);
|
|
1082
|
+
if (!m) return c ? [E(path.join(r, n))] : [];
|
|
1083
|
+
const v = n.slice(m.pattern.prefix.length, n.length - m.pattern.suffix.length);
|
|
1084
|
+
return m.substitutions.map((f) => E(f.replace("*", v)));
|
|
1076
1085
|
}, "resolvePathAlias");
|
|
1077
1086
|
//#endregion
|
|
1078
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
1087
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@type_298964156353ef75a02894ab80b3a2e6/node_modules/tsdown/dist/deps-DCK8g4G9.mjs
|
|
1079
1088
|
const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
|
|
1080
1089
|
const shimsInject = {
|
|
1081
1090
|
__dirname: [shimFile, "__dirname"],
|
|
@@ -1110,7 +1119,7 @@ const debug$7 = createDebug("tsdown:deps");
|
|
|
1110
1119
|
*/
|
|
1111
1120
|
const RE_PACKAGE_SPECIFIER = /^(?:@[a-z0-9-][a-z0-9-._]*\/)?[a-z0-9-][a-z0-9-._]*(?:\/|$)/;
|
|
1112
1121
|
function resolveDepsConfig(config, logger) {
|
|
1113
|
-
let { neverBundle, alwaysBundle, onlyBundle, onlyImport,
|
|
1122
|
+
let { neverBundle, alwaysBundle, onlyBundle, onlyImport, resolveDepSubpath } = config.deps || {};
|
|
1114
1123
|
if (config.external != null) {
|
|
1115
1124
|
if (neverBundle != null) throw new TypeError("`external` is deprecated. Cannot be used with `deps.neverBundle`.");
|
|
1116
1125
|
logger?.warn("`external` is deprecated. Use `deps.neverBundle` instead.");
|
|
@@ -1121,32 +1130,12 @@ function resolveDepsConfig(config, logger) {
|
|
|
1121
1130
|
logger?.warn("`noExternal` is deprecated. Use `deps.alwaysBundle` instead.");
|
|
1122
1131
|
alwaysBundle = config.noExternal;
|
|
1123
1132
|
}
|
|
1124
|
-
if (config.inlineOnly != null) {
|
|
1125
|
-
if (onlyBundle != null) throw new TypeError("`inlineOnly` is deprecated. Cannot be used with `deps.onlyBundle`.");
|
|
1126
|
-
logger?.warn("`inlineOnly` is deprecated. Use `deps.onlyBundle` instead.");
|
|
1127
|
-
onlyBundle = config.inlineOnly;
|
|
1128
|
-
}
|
|
1129
|
-
if (config.deps?.onlyAllowBundle != null) {
|
|
1130
|
-
if (onlyBundle != null) throw new TypeError("`deps.onlyAllowBundle` is deprecated. Cannot be used with `deps.onlyBundle`.");
|
|
1131
|
-
logger?.warn("`deps.onlyAllowBundle` is deprecated. Use `deps.onlyBundle` instead.");
|
|
1132
|
-
onlyBundle = config.deps.onlyAllowBundle;
|
|
1133
|
-
}
|
|
1134
|
-
if (config.skipNodeModulesBundle != null) {
|
|
1135
|
-
if (config.deps?.skipNodeModulesBundle != null) throw new TypeError("`skipNodeModulesBundle` is deprecated. Cannot be used with `deps.skipNodeModulesBundle`.");
|
|
1136
|
-
logger?.warn("`skipNodeModulesBundle` is deprecated. Use `deps.neverBundle: true` instead.");
|
|
1137
|
-
skipNodeModulesBundle = config.skipNodeModulesBundle;
|
|
1138
|
-
} else if (skipNodeModulesBundle != null) logger?.warn("`deps.skipNodeModulesBundle` is deprecated. Use `deps.neverBundle: true` instead.");
|
|
1139
|
-
if (skipNodeModulesBundle) {
|
|
1140
|
-
if (neverBundle === true) throw new TypeError("`deps.skipNodeModulesBundle` is deprecated. Cannot be used with `deps.neverBundle: true`.");
|
|
1141
|
-
if (alwaysBundle != null) throw new TypeError("`deps.skipNodeModulesBundle` and `deps.alwaysBundle` are mutually exclusive options and cannot be used together.");
|
|
1142
|
-
}
|
|
1143
1133
|
if (onlyBundle != null && onlyBundle !== false) onlyBundle = toArray(onlyBundle);
|
|
1144
1134
|
if (onlyImport != null) onlyImport = toArray(onlyImport);
|
|
1145
1135
|
return {
|
|
1146
1136
|
...normalizeDepsOptions(alwaysBundle, neverBundle),
|
|
1147
1137
|
onlyBundle,
|
|
1148
1138
|
onlyImport,
|
|
1149
|
-
skipNodeModulesBundle,
|
|
1150
1139
|
resolveDepSubpath,
|
|
1151
1140
|
dts: normalizeDepsOptions(config.deps?.dts?.alwaysBundle, config.deps?.dts?.neverBundle)
|
|
1152
1141
|
};
|
|
@@ -1161,7 +1150,7 @@ function normalizeDepsOptions(alwaysBundle, neverBundle) {
|
|
|
1161
1150
|
neverBundle: resolveRegex(neverBundle)
|
|
1162
1151
|
};
|
|
1163
1152
|
}
|
|
1164
|
-
function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, onlyBundle, onlyImport,
|
|
1153
|
+
function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, onlyBundle, onlyImport, resolveDepSubpath: shouldResolveDepSubpath, dts }, logger, nameLabel, platform }, tsdownBundle) {
|
|
1165
1154
|
const deps = pkg && Array.from(getProductionDeps(pkg));
|
|
1166
1155
|
return {
|
|
1167
1156
|
name: "tsdown:deps",
|
|
@@ -1209,7 +1198,7 @@ function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, on
|
|
|
1209
1198
|
if (source[0] === ".") continue;
|
|
1210
1199
|
if (platform === "node" && isBuiltin(source)) continue;
|
|
1211
1200
|
if (matchPattern(parsePackageSpecifier(source)[0], onlyImport)) continue;
|
|
1212
|
-
errors.push(`${yellow(source)} is imported in ${blue(chunk.fileName)} but is not included in ${blue`deps.onlyImport`} option.\nTo fix this, either add it to ${blue`deps.onlyImport`} or bundle it manually by adding it to ${blue`deps.alwaysBundle`} option.`);
|
|
1201
|
+
errors.push(`${styleText$1.yellow(source)} is imported in ${styleText$1.blue(chunk.fileName)} but is not included in ${styleText$1.blue(`deps.onlyImport`)} option.\nTo fix this, either add it to ${styleText$1.blue(`deps.onlyImport`)} or bundle it manually by adding it to ${styleText$1.blue(`deps.alwaysBundle`)} option.`);
|
|
1213
1202
|
}
|
|
1214
1203
|
}
|
|
1215
1204
|
for (const id of chunk.moduleIds) {
|
|
@@ -1224,12 +1213,12 @@ function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, on
|
|
|
1224
1213
|
}
|
|
1225
1214
|
}
|
|
1226
1215
|
debug$7("found deps in bundle: %o", deps);
|
|
1227
|
-
if (onlyBundle) errors.push(...Array.from(deps).filter((dep) => !matchPattern(dep, onlyBundle)).map((dep) => `${yellow(dep)} is located in ${blue`node_modules`} but is not included in ${blue`deps.onlyBundle`} option.\nTo fix this, either add it to ${blue`deps.onlyBundle`}, declare it as a production or peer dependency in your package.json, or externalize it manually.\nImported by\n${[...importers.get(dep) || []].map((s) => `- ${underline(s)}`).join("\n")}`));
|
|
1216
|
+
if (onlyBundle) errors.push(...Array.from(deps).filter((dep) => !matchPattern(dep, onlyBundle)).map((dep) => `${styleText$1.yellow(dep)} is located in ${styleText$1.blue(`node_modules`)} but is not included in ${styleText$1.blue(`deps.onlyBundle`)} option.\nTo fix this, either add it to ${styleText$1.blue(`deps.onlyBundle`)}, declare it as a production or peer dependency in your package.json, or externalize it manually.\nImported by\n${[...importers.get(dep) || []].map((s) => `- ${styleText$1.underline(s)}`).join("\n")}`));
|
|
1228
1217
|
if (errors.length) this.error(errors.join("\n\n"));
|
|
1229
1218
|
if (onlyBundle) {
|
|
1230
1219
|
const unusedPatterns = onlyBundle.filter((pattern) => Array.from(deps).every((dep) => !matchPattern(dep, [pattern])));
|
|
1231
|
-
if (unusedPatterns.length) logger.info(nameLabel, `The following entries in ${blue`deps.onlyBundle`} are not used in the bundle:\n${unusedPatterns.map((pattern) => `- ${yellow(pattern)}`).join("\n")}\nConsider removing them to keep your configuration clean.`);
|
|
1232
|
-
} else if (onlyBundle == null && deps.size) logger.info(nameLabel, `Hint: consider adding ${blue`deps.onlyBundle`} option to avoid unintended bundling of dependencies, or set ${blue`deps.onlyBundle: false`} to disable this hint.\nSee more at ${underline`https://tsdown.dev/options/dependencies#deps-onlybundle`}\nDetected dependencies in bundle:\n${Array.from(deps, (dep) => `- ${blue(dep)}`).join("\n")}`);
|
|
1220
|
+
if (unusedPatterns.length) logger.info(nameLabel, `The following entries in ${styleText$1.blue(`deps.onlyBundle`)} are not used in the bundle:\n${unusedPatterns.map((pattern) => `- ${styleText$1.yellow(String(pattern))}`).join("\n")}\nConsider removing them to keep your configuration clean.`);
|
|
1221
|
+
} else if (onlyBundle == null && deps.size) logger.info(nameLabel, `Hint: consider adding ${styleText$1.blue(`deps.onlyBundle`)} option to avoid unintended bundling of dependencies, or set ${styleText$1.blue(`deps.onlyBundle: false`)} to disable this hint.\nSee more at ${styleText$1.underline(`https://tsdown.dev/options/dependencies#deps-onlybundle`)}\nDetected dependencies in bundle:\n${Array.from(deps, (dep) => `- ${styleText$1.blue(dep)}`).join("\n")}`);
|
|
1233
1222
|
}
|
|
1234
1223
|
}
|
|
1235
1224
|
};
|
|
@@ -1238,7 +1227,7 @@ function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, on
|
|
|
1238
1227
|
* - `[true, resolvedId]`: external with custom resolved ID
|
|
1239
1228
|
* - `false`: skip, let other plugins handle it
|
|
1240
1229
|
* - `'absolute'`: external as absolute path
|
|
1241
|
-
* - `'no-external'`: skip, but mark as non-external for
|
|
1230
|
+
* - `'no-external'`: skip, but mark as non-external for onlyBundle check
|
|
1242
1231
|
*/
|
|
1243
1232
|
async function externalStrategy(id, importer, resolve) {
|
|
1244
1233
|
if (id === shimFile) return false;
|
|
@@ -1246,16 +1235,13 @@ function DepsPlugin({ pkg, deps: { neverBundle, alwaysBundle: jsAlwaysBundle, on
|
|
|
1246
1235
|
if ((isDts && dts?.alwaysBundle || jsAlwaysBundle)?.(id, importer)) return "no-external";
|
|
1247
1236
|
if ((isDts && dts?.neverBundle != null ? dts.neverBundle : neverBundle) === true) {
|
|
1248
1237
|
if (id[0] === "\0" || id.startsWith("data:") || path.isAbsolute(id)) return false;
|
|
1249
|
-
if (isBuiltin(id)
|
|
1250
|
-
|
|
1251
|
-
return !!resolved && (!!resolved.external || RE_NODE_MODULES$1.test(resolved.id));
|
|
1252
|
-
}
|
|
1253
|
-
if (skipNodeModulesBundle) {
|
|
1254
|
-
const resolved = await resolve();
|
|
1255
|
-
if (resolved && (resolved.external || RE_NODE_MODULES$1.test(resolved.id))) {
|
|
1238
|
+
if (isBuiltin(id)) return true;
|
|
1239
|
+
if (RE_PACKAGE_SPECIFIER.test(id)) {
|
|
1256
1240
|
const resolvedDep = shouldResolveDepSubpath && await resolveDepSubpath(id, resolve);
|
|
1257
1241
|
return resolvedDep ? [true, resolvedDep] : true;
|
|
1258
1242
|
}
|
|
1243
|
+
const resolved = await resolve();
|
|
1244
|
+
return !!resolved && (!!resolved.external || RE_NODE_MODULES$1.test(resolved.id));
|
|
1259
1245
|
}
|
|
1260
1246
|
if (deps) {
|
|
1261
1247
|
if (deps.includes(id) || deps.some((dep) => id.startsWith(`${dep}/`))) {
|
|
@@ -1386,7 +1372,7 @@ function createDefu(merger) {
|
|
|
1386
1372
|
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
1387
1373
|
}
|
|
1388
1374
|
//#endregion
|
|
1389
|
-
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.
|
|
1375
|
+
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.7/node_modules/fdir/dist/index.mjs
|
|
1390
1376
|
var __require$1 = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
1391
1377
|
function cleanPath(path) {
|
|
1392
1378
|
let normalized = normalize$1(path);
|
|
@@ -1894,7 +1880,7 @@ var Builder = class {
|
|
|
1894
1880
|
}
|
|
1895
1881
|
};
|
|
1896
1882
|
//#endregion
|
|
1897
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
1883
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/constants.js
|
|
1898
1884
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1899
1885
|
const WIN_SLASH = "\\\\/";
|
|
1900
1886
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
@@ -2063,7 +2049,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2063
2049
|
};
|
|
2064
2050
|
}));
|
|
2065
2051
|
//#endregion
|
|
2066
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
2052
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/utils.js
|
|
2067
2053
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2068
2054
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
2069
2055
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -2111,7 +2097,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2111
2097
|
};
|
|
2112
2098
|
}));
|
|
2113
2099
|
//#endregion
|
|
2114
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
2100
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/scan.js
|
|
2115
2101
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2116
2102
|
const utils = require_utils();
|
|
2117
2103
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
@@ -2140,7 +2126,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2140
2126
|
const scan = (input, options) => {
|
|
2141
2127
|
const opts = options || {};
|
|
2142
2128
|
const length = input.length - 1;
|
|
2143
|
-
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
2129
|
+
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
|
|
2144
2130
|
const slashes = [];
|
|
2145
2131
|
const tokens = [];
|
|
2146
2132
|
const parts = [];
|
|
@@ -2243,14 +2229,18 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2243
2229
|
finished = true;
|
|
2244
2230
|
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
2245
2231
|
if (scanToEnd === true) {
|
|
2232
|
+
let parens = 0;
|
|
2246
2233
|
while (eos() !== true && (code = advance())) {
|
|
2247
2234
|
if (code === CHAR_BACKWARD_SLASH) {
|
|
2248
2235
|
backslashes = token.backslashes = true;
|
|
2249
|
-
|
|
2236
|
+
advance();
|
|
2237
|
+
continue;
|
|
2238
|
+
}
|
|
2239
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
2240
|
+
parens++;
|
|
2250
2241
|
continue;
|
|
2251
2242
|
}
|
|
2252
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
2253
|
-
isGlob = token.isGlob = true;
|
|
2243
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
2254
2244
|
finished = true;
|
|
2255
2245
|
break;
|
|
2256
2246
|
}
|
|
@@ -2298,13 +2288,18 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2298
2288
|
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
2299
2289
|
isGlob = token.isGlob = true;
|
|
2300
2290
|
if (scanToEnd === true) {
|
|
2291
|
+
let parens = 1;
|
|
2301
2292
|
while (eos() !== true && (code = advance())) {
|
|
2302
|
-
if (code ===
|
|
2293
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
2303
2294
|
backslashes = token.backslashes = true;
|
|
2304
|
-
|
|
2295
|
+
advance();
|
|
2296
|
+
continue;
|
|
2297
|
+
}
|
|
2298
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
2299
|
+
parens++;
|
|
2305
2300
|
continue;
|
|
2306
2301
|
}
|
|
2307
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
2302
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
2308
2303
|
finished = true;
|
|
2309
2304
|
break;
|
|
2310
2305
|
}
|
|
@@ -2367,7 +2362,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2367
2362
|
if (opts.parts === true || opts.tokens === true) {
|
|
2368
2363
|
let prevIndex;
|
|
2369
2364
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2370
|
-
const n = prevIndex ? prevIndex + 1 : start;
|
|
2365
|
+
const n = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
2371
2366
|
const i = slashes[idx];
|
|
2372
2367
|
const value = input.slice(n, i);
|
|
2373
2368
|
if (opts.tokens) {
|
|
@@ -2378,18 +2373,19 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2378
2373
|
depth(tokens[idx]);
|
|
2379
2374
|
state.maxDepth += tokens[idx].depth;
|
|
2380
2375
|
}
|
|
2381
|
-
if (
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2385
|
-
const value = input.slice(prevIndex + 1);
|
|
2386
|
-
parts.push(value);
|
|
2387
|
-
if (opts.tokens) {
|
|
2388
|
-
tokens[tokens.length - 1].value = value;
|
|
2389
|
-
depth(tokens[tokens.length - 1]);
|
|
2390
|
-
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
2376
|
+
if (i >= start) {
|
|
2377
|
+
parts.push(value);
|
|
2378
|
+
prevIndex = i;
|
|
2391
2379
|
}
|
|
2392
2380
|
}
|
|
2381
|
+
const n = prevIndex !== void 0 ? prevIndex + 1 : start;
|
|
2382
|
+
const value = input.slice(n);
|
|
2383
|
+
parts.push(value);
|
|
2384
|
+
if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
|
|
2385
|
+
tokens[tokens.length - 1].value = value;
|
|
2386
|
+
depth(tokens[tokens.length - 1]);
|
|
2387
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
2388
|
+
}
|
|
2393
2389
|
state.slashes = slashes;
|
|
2394
2390
|
state.parts = parts;
|
|
2395
2391
|
}
|
|
@@ -2398,7 +2394,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2398
2394
|
module.exports = scan;
|
|
2399
2395
|
}));
|
|
2400
2396
|
//#endregion
|
|
2401
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
2397
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/parse.js
|
|
2402
2398
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2403
2399
|
const constants = require_constants();
|
|
2404
2400
|
const utils = require_utils();
|
|
@@ -3300,6 +3296,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3300
3296
|
rest = rest.slice(3);
|
|
3301
3297
|
consume("/**", 3);
|
|
3302
3298
|
}
|
|
3299
|
+
const isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate");
|
|
3303
3300
|
if (prior.type === "bos" && eos()) {
|
|
3304
3301
|
prev.type = "globstar";
|
|
3305
3302
|
prev.value += value;
|
|
@@ -3309,7 +3306,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3309
3306
|
consume(value);
|
|
3310
3307
|
continue;
|
|
3311
3308
|
}
|
|
3312
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar &&
|
|
3309
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) {
|
|
3313
3310
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
3314
3311
|
prior.output = `(?:${prior.output}`;
|
|
3315
3312
|
prev.type = "globstar";
|
|
@@ -3474,7 +3471,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3474
3471
|
module.exports = parse;
|
|
3475
3472
|
}));
|
|
3476
3473
|
//#endregion
|
|
3477
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
3474
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/picomatch.js
|
|
3478
3475
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3479
3476
|
const scan = require_scan();
|
|
3480
3477
|
const parse = require_parse();
|
|
@@ -4052,7 +4049,7 @@ const defaultOptions$1 = {
|
|
|
4052
4049
|
function getOptions(options) {
|
|
4053
4050
|
const opts = Object.assign({}, options);
|
|
4054
4051
|
for (const key in defaultOptions$1) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions$1[key] });
|
|
4055
|
-
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
|
|
4052
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
|
|
4056
4053
|
opts.ignore = ensureStringArray(opts.ignore);
|
|
4057
4054
|
opts.fs && (opts.fs = {
|
|
4058
4055
|
readdir: opts.fs.readdir || readdir$1,
|
|
@@ -4160,7 +4157,7 @@ function init({ skipNodeModules } = {}) {
|
|
|
4160
4157
|
const parentUUID = getParentUUID(context.parentURL);
|
|
4161
4158
|
if (!noCache && !parentUUID) return resolved;
|
|
4162
4159
|
const deps = depsStore.getStore();
|
|
4163
|
-
if (deps) deps.add(fileURLToPath
|
|
4160
|
+
if (deps) deps.add(fileURLToPath(resolved.url));
|
|
4164
4161
|
resolved.url = appendUUID(resolved.url, parentUUID || crypto.randomUUID());
|
|
4165
4162
|
return resolved;
|
|
4166
4163
|
},
|
|
@@ -4290,87 +4287,87 @@ quansync$1({
|
|
|
4290
4287
|
*/
|
|
4291
4288
|
const quansync = quansync$1;
|
|
4292
4289
|
quansync$1({
|
|
4293
|
-
sync:
|
|
4294
|
-
async:
|
|
4290
|
+
sync: X.readFileSync,
|
|
4291
|
+
async: X.promises.readFile
|
|
4295
4292
|
});
|
|
4296
4293
|
quansync$1({
|
|
4297
|
-
sync:
|
|
4298
|
-
async:
|
|
4294
|
+
sync: X.writeFileSync,
|
|
4295
|
+
async: X.promises.writeFile
|
|
4299
4296
|
});
|
|
4300
4297
|
quansync$1({
|
|
4301
|
-
sync:
|
|
4302
|
-
async:
|
|
4298
|
+
sync: X.unlinkSync,
|
|
4299
|
+
async: X.promises.unlink
|
|
4303
4300
|
});
|
|
4304
4301
|
quansync$1({
|
|
4305
|
-
sync:
|
|
4306
|
-
async:
|
|
4302
|
+
sync: X.accessSync,
|
|
4303
|
+
async: X.promises.access
|
|
4307
4304
|
});
|
|
4308
4305
|
/**
|
|
4309
4306
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
4310
4307
|
*/
|
|
4311
4308
|
const stat$2 = quansync$1({
|
|
4312
|
-
sync:
|
|
4313
|
-
async:
|
|
4309
|
+
sync: X.statSync,
|
|
4310
|
+
async: X.promises.stat
|
|
4314
4311
|
});
|
|
4315
4312
|
const lstat = quansync$1({
|
|
4316
|
-
sync:
|
|
4317
|
-
async:
|
|
4313
|
+
sync: X.lstatSync,
|
|
4314
|
+
async: X.promises.lstat
|
|
4318
4315
|
});
|
|
4319
4316
|
quansync$1({
|
|
4320
|
-
sync:
|
|
4321
|
-
async:
|
|
4317
|
+
sync: X.copyFileSync,
|
|
4318
|
+
async: X.promises.copyFile
|
|
4322
4319
|
});
|
|
4323
4320
|
quansync$1({
|
|
4324
|
-
sync:
|
|
4325
|
-
async:
|
|
4321
|
+
sync: X.rmSync,
|
|
4322
|
+
async: X.promises.rm
|
|
4326
4323
|
});
|
|
4327
4324
|
quansync$1({
|
|
4328
|
-
sync:
|
|
4329
|
-
async:
|
|
4325
|
+
sync: X.mkdirSync,
|
|
4326
|
+
async: X.promises.mkdir
|
|
4330
4327
|
});
|
|
4331
4328
|
quansync$1({
|
|
4332
|
-
sync:
|
|
4333
|
-
async:
|
|
4329
|
+
sync: X.renameSync,
|
|
4330
|
+
async: X.promises.rename
|
|
4334
4331
|
});
|
|
4335
4332
|
quansync$1({
|
|
4336
|
-
sync:
|
|
4337
|
-
async:
|
|
4333
|
+
sync: X.readdirSync,
|
|
4334
|
+
async: X.promises.readdir
|
|
4338
4335
|
});
|
|
4339
4336
|
quansync$1({
|
|
4340
|
-
sync:
|
|
4341
|
-
async:
|
|
4337
|
+
sync: X.realpathSync,
|
|
4338
|
+
async: X.promises.realpath
|
|
4342
4339
|
});
|
|
4343
4340
|
quansync$1({
|
|
4344
|
-
sync:
|
|
4345
|
-
async:
|
|
4341
|
+
sync: X.readlinkSync,
|
|
4342
|
+
async: X.promises.readlink
|
|
4346
4343
|
});
|
|
4347
4344
|
quansync$1({
|
|
4348
|
-
sync:
|
|
4349
|
-
async:
|
|
4345
|
+
sync: X.symlinkSync,
|
|
4346
|
+
async: X.promises.symlink
|
|
4350
4347
|
});
|
|
4351
4348
|
quansync$1({
|
|
4352
|
-
sync:
|
|
4353
|
-
async:
|
|
4349
|
+
sync: X.chownSync,
|
|
4350
|
+
async: X.promises.chown
|
|
4354
4351
|
});
|
|
4355
4352
|
quansync$1({
|
|
4356
|
-
sync:
|
|
4357
|
-
async:
|
|
4353
|
+
sync: X.lchownSync,
|
|
4354
|
+
async: X.promises.lchown
|
|
4358
4355
|
});
|
|
4359
4356
|
quansync$1({
|
|
4360
|
-
sync:
|
|
4361
|
-
async:
|
|
4357
|
+
sync: X.chmodSync,
|
|
4358
|
+
async: X.promises.chmod
|
|
4362
4359
|
});
|
|
4363
4360
|
quansync$1({
|
|
4364
|
-
sync:
|
|
4365
|
-
async:
|
|
4361
|
+
sync: X.utimesSync,
|
|
4362
|
+
async: X.promises.utimes
|
|
4366
4363
|
});
|
|
4367
4364
|
quansync$1({
|
|
4368
|
-
sync:
|
|
4369
|
-
async:
|
|
4365
|
+
sync: X.lutimesSync,
|
|
4366
|
+
async: X.promises.lutimes
|
|
4370
4367
|
});
|
|
4371
4368
|
quansync$1({
|
|
4372
|
-
sync:
|
|
4373
|
-
async:
|
|
4369
|
+
sync: X.mkdtempSync,
|
|
4370
|
+
async: X.promises.mkdtemp
|
|
4374
4371
|
});
|
|
4375
4372
|
//#endregion
|
|
4376
4373
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -4553,7 +4550,8 @@ async function resolveArrayEntry(entries, cwd, root) {
|
|
|
4553
4550
|
const computedRoot = root || lowestCommonAncestor(...resolvedEntries);
|
|
4554
4551
|
const base = root && !isGlob ? path.relative(cwd, root) || "." : computedRoot;
|
|
4555
4552
|
const arrayEntryMap = Object.fromEntries(resolvedEntries.map((file) => {
|
|
4556
|
-
|
|
4553
|
+
const relative = path.relative(base, file);
|
|
4554
|
+
return [slash(stripExtname(relative)), file];
|
|
4557
4555
|
}));
|
|
4558
4556
|
const resolvedObjectEntries = await Promise.all(objectEntries.map(async (entry) => {
|
|
4559
4557
|
const [entryMap] = await resolveObjectEntry(entry, cwd);
|
|
@@ -4638,10 +4636,13 @@ async function generateExports(pkg, chunks, options, inlinedDeps) {
|
|
|
4638
4636
|
const distFile = join$1(pkgRoot, chunk.outDir, normalizedName);
|
|
4639
4637
|
if (isIndex) {
|
|
4640
4638
|
name = ".";
|
|
4641
|
-
if (format === "cjs")
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
else
|
|
4639
|
+
if (format === "cjs") {
|
|
4640
|
+
if (isDts) cjsTypes = distFile;
|
|
4641
|
+
else main = distFile;
|
|
4642
|
+
} else if (format === "es") {
|
|
4643
|
+
if (isDts) esmTypes = distFile;
|
|
4644
|
+
else module = distFile;
|
|
4645
|
+
}
|
|
4645
4646
|
} else if (name.endsWith("/index")) name = `./${name.slice(0, -6)}`;
|
|
4646
4647
|
else name = `./${name}`;
|
|
4647
4648
|
if (extensions && name !== ".") name = `${name}.js`;
|
|
@@ -4822,17 +4823,17 @@ async function resolveTsconfig(logger, tsconfig, cwd, color, nameLabel) {
|
|
|
4822
4823
|
if (tsconfig !== false) {
|
|
4823
4824
|
if (tsconfig === true || tsconfig == null) {
|
|
4824
4825
|
tsconfig = findTsconfig(cwd);
|
|
4825
|
-
if (original && !tsconfig) logger.warn(`No tsconfig found in ${blue(cwd)}`);
|
|
4826
|
+
if (original && !tsconfig) logger.warn(`No tsconfig found in ${styleText$1.blue(cwd)}`);
|
|
4826
4827
|
} else {
|
|
4827
4828
|
const tsconfigPath = path.resolve(cwd, tsconfig);
|
|
4828
4829
|
const stat = await fsStat(tsconfigPath);
|
|
4829
4830
|
if (stat?.isFile()) tsconfig = tsconfigPath;
|
|
4830
4831
|
else if (stat?.isDirectory()) {
|
|
4831
4832
|
tsconfig = findTsconfig(tsconfigPath);
|
|
4832
|
-
if (!tsconfig) logger.warn(`No tsconfig found in ${blue(tsconfigPath)}`);
|
|
4833
|
+
if (!tsconfig) logger.warn(`No tsconfig found in ${styleText$1.blue(tsconfigPath)}`);
|
|
4833
4834
|
} else {
|
|
4834
4835
|
tsconfig = findTsconfig(cwd, tsconfig);
|
|
4835
|
-
if (!tsconfig) logger.warn(`tsconfig ${blue(original)} doesn't exist`);
|
|
4836
|
+
if (!tsconfig) logger.warn(`tsconfig ${styleText$1.blue(original)} doesn't exist`);
|
|
4836
4837
|
}
|
|
4837
4838
|
}
|
|
4838
4839
|
if (tsconfig) logger.info(nameLabel, `tsconfig: ${color(path.relative(cwd, tsconfig))}`);
|
|
@@ -4891,7 +4892,7 @@ async function loadViteConfig(prefix, cwd, configLoader) {
|
|
|
4891
4892
|
}).load(true);
|
|
4892
4893
|
if (!result) return;
|
|
4893
4894
|
let { config: [exported, deps], source } = result;
|
|
4894
|
-
globalLogger.info(`Using Vite config: ${underline(source)}`);
|
|
4895
|
+
globalLogger.info(`Using Vite config: ${styleText$1.underline(source)}`);
|
|
4895
4896
|
exported = await exported;
|
|
4896
4897
|
if (typeof exported === "function") exported = await exported({
|
|
4897
4898
|
command: "build",
|
|
@@ -4903,7 +4904,7 @@ async function loadViteConfig(prefix, cwd, configLoader) {
|
|
|
4903
4904
|
};
|
|
4904
4905
|
}
|
|
4905
4906
|
const configPrefix = "tsdown.config";
|
|
4906
|
-
async function loadConfigFile(inlineConfig,
|
|
4907
|
+
async function loadConfigFile(inlineConfig, context, workspace) {
|
|
4907
4908
|
let cwd = inlineConfig.cwd || process$1.cwd();
|
|
4908
4909
|
let { config: filePath } = inlineConfig;
|
|
4909
4910
|
if (filePath === false) return { configs: [{}] };
|
|
@@ -4951,12 +4952,9 @@ async function loadConfigFile(inlineConfig, workspace, rootConfig) {
|
|
|
4951
4952
|
let deps;
|
|
4952
4953
|
if (result) {
|
|
4953
4954
|
({config: [exported, deps], source: file} = result);
|
|
4954
|
-
globalLogger.info(`config file: ${underline(file)}`, loader === "native" ? "" : `(${loader})`);
|
|
4955
|
+
globalLogger.info(`config file: ${styleText$1.underline(file)}`, loader === "native" ? "" : `(${loader})`);
|
|
4955
4956
|
exported = await exported;
|
|
4956
|
-
if (typeof exported === "function") exported = await exported(inlineConfig,
|
|
4957
|
-
ci: isInCI(),
|
|
4958
|
-
rootConfig
|
|
4959
|
-
});
|
|
4957
|
+
if (typeof exported === "function") exported = await exported(inlineConfig, context);
|
|
4960
4958
|
}
|
|
4961
4959
|
exported = toArray(exported);
|
|
4962
4960
|
if (exported.length === 0) exported.push({});
|
|
@@ -5033,7 +5031,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps, runBuild
|
|
|
5033
5031
|
if (result) userConfig = mergeConfig(userConfig, result);
|
|
5034
5032
|
}
|
|
5035
5033
|
}
|
|
5036
|
-
let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, suppressWarnings, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy,
|
|
5034
|
+
let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, suppressWarnings, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy, hash = true, cwd = process$1.cwd(), name, workspace, exports = false, unbundle = false, root, nodeProtocol = false, cjsDefault = true, globImport = true, css, outExtensions, fixedExtension = platform === "node", devtools = false, write = true, exe = false } = userConfig;
|
|
5037
5035
|
const pkg = await readPackageJson(cwd);
|
|
5038
5036
|
if (workspace) name ||= pkg?.name;
|
|
5039
5037
|
const color = generateColor(name);
|
|
@@ -5047,12 +5045,6 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps, runBuild
|
|
|
5047
5045
|
failOnWarn: resolveFeatureOption(failOnWarn, true),
|
|
5048
5046
|
suppressWarnings
|
|
5049
5047
|
});
|
|
5050
|
-
if (typeof bundle === "boolean") logger.warn("`bundle` option is deprecated. Use `unbundle` instead.");
|
|
5051
|
-
if (removeNodeProtocol) {
|
|
5052
|
-
if (nodeProtocol) throw new TypeError("`removeNodeProtocol` is deprecated. Please only use `nodeProtocol` instead.");
|
|
5053
|
-
logger.warn("`removeNodeProtocol` is deprecated. Use `nodeProtocol: \"strip\"` instead.");
|
|
5054
|
-
}
|
|
5055
|
-
nodeProtocol = nodeProtocol ?? (removeNodeProtocol ? "strip" : false);
|
|
5056
5048
|
outDir = path.resolve(cwd, outDir);
|
|
5057
5049
|
clean = resolveClean(clean, outDir, cwd);
|
|
5058
5050
|
const rawEntry = entry;
|
|
@@ -5065,32 +5057,20 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps, runBuild
|
|
|
5065
5057
|
unused = resolveFeatureOption(unused, {});
|
|
5066
5058
|
report = resolveFeatureOption(report, {});
|
|
5067
5059
|
exe = resolveFeatureOption(exe, {});
|
|
5068
|
-
if (dts == null)
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5060
|
+
if (dts == null) {
|
|
5061
|
+
if (exe) dts = false;
|
|
5062
|
+
else if (pkg?.types || pkg?.typings || hasExportsTypes(pkg?.exports)) dts = true;
|
|
5063
|
+
else if (tsconfig) {
|
|
5064
|
+
const { config } = te(tsconfig);
|
|
5065
|
+
dts = !!config.compilerOptions?.declaration;
|
|
5066
|
+
} else dts = false;
|
|
5067
|
+
}
|
|
5074
5068
|
dts = resolveFeatureOption(dts, {});
|
|
5075
5069
|
if (!pkg) {
|
|
5076
5070
|
if (exports) throw new Error("`package.json` not found, cannot write exports");
|
|
5077
5071
|
if (publint) logger.warn(nameLabel, "publint is enabled but package.json is not found");
|
|
5078
5072
|
if (attw) logger.warn(nameLabel, "attw is enabled but package.json is not found");
|
|
5079
5073
|
}
|
|
5080
|
-
if (injectStyle != null) if (css?.inject == null) {
|
|
5081
|
-
logger.warn(`${blue`injectStyle`} is deprecated. Use ${blue`css.inject`} instead.`);
|
|
5082
|
-
css = {
|
|
5083
|
-
...css,
|
|
5084
|
-
inject: injectStyle
|
|
5085
|
-
};
|
|
5086
|
-
} else throw new TypeError("`injectStyle` is deprecated. Cannot be used with `css.inject`");
|
|
5087
|
-
if (publicDir) if (copy) throw new TypeError("`publicDir` is deprecated. Cannot be used with `copy`");
|
|
5088
|
-
else logger.warn(`${blue`publicDir`} is deprecated. Use ${blue`copy`} instead.`);
|
|
5089
|
-
if (outExtension) {
|
|
5090
|
-
if (outExtensions) throw new TypeError("`outExtension` is deprecated. Cannot be used with `outExtensions`");
|
|
5091
|
-
logger.warn(`${blue`outExtension`} is deprecated. Use ${blue`outExtensions`} instead.`);
|
|
5092
|
-
outExtensions = outExtension;
|
|
5093
|
-
}
|
|
5094
5074
|
envPrefix = toArray(envPrefix);
|
|
5095
5075
|
if (envPrefix.includes("")) logger.warn("`envPrefix` includes an empty string; filtering is disabled. All environment variables from the env file and process.env will be injected into the build. Ensure this is intended to avoid accidental leakage of sensitive information.");
|
|
5096
5076
|
const envFromProcess = filterEnv(process$1.env, envPrefix);
|
|
@@ -5129,10 +5109,12 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps, runBuild
|
|
|
5129
5109
|
});
|
|
5130
5110
|
const depsConfig = resolveDepsConfig(userConfig, logger);
|
|
5131
5111
|
devtools = resolveFeatureOption(devtools, {});
|
|
5132
|
-
if (devtools)
|
|
5133
|
-
if (
|
|
5134
|
-
|
|
5135
|
-
|
|
5112
|
+
if (devtools) {
|
|
5113
|
+
if (watch) {
|
|
5114
|
+
if (devtools.ui) logger.warn("Devtools UI is not supported in watch mode, disabling it.");
|
|
5115
|
+
devtools.ui = false;
|
|
5116
|
+
} else devtools.ui ??= !!pkgExists("@vitejs/devtools/cli");
|
|
5117
|
+
}
|
|
5136
5118
|
const config = {
|
|
5137
5119
|
...userConfig,
|
|
5138
5120
|
alias,
|
|
@@ -5140,7 +5122,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps, runBuild
|
|
|
5140
5122
|
cjsDefault,
|
|
5141
5123
|
clean,
|
|
5142
5124
|
configDeps,
|
|
5143
|
-
copy
|
|
5125
|
+
copy,
|
|
5144
5126
|
css,
|
|
5145
5127
|
cwd,
|
|
5146
5128
|
deps: depsConfig,
|
|
@@ -5239,7 +5221,7 @@ function filterConfig(filter, configCwd, name) {
|
|
|
5239
5221
|
return toArray(filter).some((value) => name && name === value || cwd === value);
|
|
5240
5222
|
}
|
|
5241
5223
|
//#endregion
|
|
5242
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
5224
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@type_298964156353ef75a02894ab80b3a2e6/node_modules/tsdown/dist/watch-UrMX4y5g.mjs
|
|
5243
5225
|
async function copy(options) {
|
|
5244
5226
|
if (!options.copy) return;
|
|
5245
5227
|
const resolved = await resolveCopyEntries(options);
|
|
@@ -5320,7 +5302,8 @@ const gzipAsync = promisify(gzip);
|
|
|
5320
5302
|
const defaultOptions = {
|
|
5321
5303
|
gzip: true,
|
|
5322
5304
|
brotli: false,
|
|
5323
|
-
maxCompressSize: 1e6
|
|
5305
|
+
maxCompressSize: 1e6,
|
|
5306
|
+
summary: false
|
|
5324
5307
|
};
|
|
5325
5308
|
function ReportPlugin(config, cjsDts, isDualFormat) {
|
|
5326
5309
|
return {
|
|
@@ -5359,10 +5342,10 @@ async function outputReport(config, chunks, outDir, cjsDts, isDualFormat) {
|
|
|
5359
5342
|
return b.raw - a.raw;
|
|
5360
5343
|
});
|
|
5361
5344
|
const formatLabel = isDualFormat && prettyFormat(cjsDts ? "cjs" : config.format);
|
|
5362
|
-
for (const size of sizes) {
|
|
5363
|
-
const filenameColor = size.dts ? green : noop;
|
|
5345
|
+
if (!options.summary) for (const size of sizes) {
|
|
5346
|
+
const filenameColor = size.dts ? styleText$1.green : noop;
|
|
5364
5347
|
const filename = path.normalize(size.filename);
|
|
5365
|
-
config.logger.info(config.nameLabel, formatLabel, dim(outDir + path.sep) + filenameColor(
|
|
5348
|
+
config.logger.info(config.nameLabel, formatLabel, styleText$1.dim(outDir + path.sep) + filenameColor(size.isEntry ? styleText$1.bold(filename) : filename), ` `.repeat(filenameLength - size.filename.length), styleText$1.dim(size.rawText), options.gzip && size.gzipText && styleText$1.dim(`│ gzip: ${size.gzipText}`), options.brotli && size.brotliText && styleText$1.dim(`│ brotli: ${size.brotliText}`));
|
|
5366
5349
|
}
|
|
5367
5350
|
const totalSizeText = formatBytes(totalRaw);
|
|
5368
5351
|
config.logger.info(config.nameLabel, formatLabel, `${sizes.length} files, total: ${totalSizeText}`);
|
|
@@ -5407,7 +5390,7 @@ function ShebangPlugin(logger, cwd, nameLabel, isDualFormat) {
|
|
|
5407
5390
|
if (!RE_SHEBANG.test(chunk.code)) continue;
|
|
5408
5391
|
const filepath = path.resolve(cwd, options.file || path.join(options.dir, chunk.fileName));
|
|
5409
5392
|
if (await fsExists(filepath)) {
|
|
5410
|
-
logger.info(nameLabel, isDualFormat && prettyFormat(options.format), `Granting execute permission to ${underline(path.relative(cwd, filepath))}`);
|
|
5393
|
+
logger.info(nameLabel, isDualFormat && prettyFormat(options.format), `Granting execute permission to ${styleText$1.underline(path.relative(cwd, filepath))}`);
|
|
5411
5394
|
await chmod(filepath, 493);
|
|
5412
5395
|
}
|
|
5413
5396
|
}
|
|
@@ -5619,8 +5602,8 @@ var Hookable = class {
|
|
|
5619
5602
|
}
|
|
5620
5603
|
};
|
|
5621
5604
|
//#endregion
|
|
5622
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
5623
|
-
var
|
|
5605
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@type_298964156353ef75a02894ab80b3a2e6/node_modules/tsdown/dist/build-JVmLFaZt.mjs
|
|
5606
|
+
var build_JVmLFaZt_exports = /* @__PURE__ */ __exportAll$1({
|
|
5624
5607
|
n: () => buildWithConfigs,
|
|
5625
5608
|
r: () => build_exports,
|
|
5626
5609
|
t: () => build$1
|
|
@@ -5643,7 +5626,7 @@ const DEFAULT_EXCLUDE_WORKSPACE = [
|
|
|
5643
5626
|
"**/test?(s)/**",
|
|
5644
5627
|
"**/t?(e)mp/**"
|
|
5645
5628
|
];
|
|
5646
|
-
async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
5629
|
+
async function resolveWorkspace(config, inlineConfig, context, rootDeps) {
|
|
5647
5630
|
const normalized = mergeConfig(config, inlineConfig);
|
|
5648
5631
|
const rootCwd = normalized.cwd || process$1.cwd();
|
|
5649
5632
|
const deps = new Set(rootDeps);
|
|
@@ -5668,6 +5651,10 @@ async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
|
5668
5651
|
expandDirectories: false
|
|
5669
5652
|
})).map((file) => slash(path.resolve(file)));
|
|
5670
5653
|
if (packages.length === 0) throw new Error("No workspace packages found, please check your config");
|
|
5654
|
+
context = {
|
|
5655
|
+
...context,
|
|
5656
|
+
rootConfig: normalized
|
|
5657
|
+
};
|
|
5671
5658
|
return {
|
|
5672
5659
|
configs: (await Promise.all(packages.map(async (cwd) => {
|
|
5673
5660
|
debug$5("loading workspace config %s", cwd);
|
|
@@ -5675,7 +5662,7 @@ async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
|
5675
5662
|
...inlineConfig,
|
|
5676
5663
|
config: workspaceConfig,
|
|
5677
5664
|
cwd
|
|
5678
|
-
},
|
|
5665
|
+
}, context, cwd);
|
|
5679
5666
|
workspaceDeps?.forEach((dep) => deps.add(dep));
|
|
5680
5667
|
return configs.map((config) => mergeConfig(normalized, config));
|
|
5681
5668
|
}))).flat(),
|
|
@@ -5683,14 +5670,18 @@ async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
|
5683
5670
|
};
|
|
5684
5671
|
}
|
|
5685
5672
|
const debug$4 = createDebug("tsdown:config");
|
|
5686
|
-
async function resolveConfig(inlineConfig) {
|
|
5673
|
+
async function resolveConfig(inlineConfig, watch) {
|
|
5687
5674
|
debug$4("inline config %O", inlineConfig);
|
|
5688
5675
|
if (inlineConfig.cwd) inlineConfig.cwd = path.resolve(inlineConfig.cwd);
|
|
5689
|
-
const
|
|
5676
|
+
const context = {
|
|
5677
|
+
ci: isInCI(),
|
|
5678
|
+
watch
|
|
5679
|
+
};
|
|
5680
|
+
const { configs: rootConfigs, deps: rootDeps } = await loadConfigFile(inlineConfig, context);
|
|
5690
5681
|
const globalDeps = new Set(rootDeps);
|
|
5691
5682
|
const runBuild = createConcurrencyExecutor(inlineConfig.concurrency);
|
|
5692
5683
|
const configs = (await Promise.all(rootConfigs.map(async (rootConfig) => {
|
|
5693
|
-
const { configs: workspaceConfigs, deps: workspaceDeps } = await resolveWorkspace(rootConfig, inlineConfig, rootDeps);
|
|
5684
|
+
const { configs: workspaceConfigs, deps: workspaceDeps } = await resolveWorkspace(rootConfig, inlineConfig, context, rootDeps);
|
|
5694
5685
|
debug$4("workspace configs %O", workspaceConfigs);
|
|
5695
5686
|
const configs = (await Promise.all(workspaceConfigs.filter((config) => !config.workspace || config.entry).map((config) => resolveUserConfig(config, inlineConfig, workspaceDeps, runBuild)))).flat().filter((config) => !!config);
|
|
5696
5687
|
workspaceDeps.forEach((dep) => globalDeps.add(dep));
|
|
@@ -5712,23 +5703,6 @@ function warnLegacyCJS(config) {
|
|
|
5712
5703
|
return version && satisfies(version, RANGE_REQUIRING_ESM);
|
|
5713
5704
|
})) config.logger.warnOnce("We recommend using the ESM format instead of CommonJS.\nThe ESM format is compatible with modern platforms and runtimes, and most new libraries are now distributed only in ESM format.\nLearn more at https://nodejs.org/en/learn/modules/publishing-a-package#how-did-we-get-here");
|
|
5714
5705
|
}
|
|
5715
|
-
function CjsDtsReexportPlugin() {
|
|
5716
|
-
return {
|
|
5717
|
-
name: "tsdown:cjs-dts-reexport",
|
|
5718
|
-
generateBundle(_options, bundle) {
|
|
5719
|
-
for (const chunk of Object.values(bundle)) {
|
|
5720
|
-
if (chunk.type !== "chunk" || !chunk.isEntry) continue;
|
|
5721
|
-
if (!chunk.fileName.endsWith(".cjs") && !chunk.fileName.endsWith(".js")) continue;
|
|
5722
|
-
const content = `export type * from './${path.basename(chunk.fileName.replace(RE_JS, ".d.mts"))}'\n`;
|
|
5723
|
-
this.emitFile({
|
|
5724
|
-
type: "prebuilt-chunk",
|
|
5725
|
-
fileName: filename_js_to_dts(chunk.fileName),
|
|
5726
|
-
code: content
|
|
5727
|
-
});
|
|
5728
|
-
}
|
|
5729
|
-
}
|
|
5730
|
-
};
|
|
5731
|
-
}
|
|
5732
5706
|
async function startDevtoolsUI(config) {
|
|
5733
5707
|
const { start } = await importWithError("@vitejs/devtools/cli-commands");
|
|
5734
5708
|
await start({
|
|
@@ -5768,7 +5742,7 @@ function executeOnSuccess(config) {
|
|
|
5768
5742
|
return ab;
|
|
5769
5743
|
}
|
|
5770
5744
|
const debug$3 = createDebug("tsdown:attw");
|
|
5771
|
-
const label$1 = dim`[attw]
|
|
5745
|
+
const label$1 = styleText$1.dim(`[attw]`);
|
|
5772
5746
|
const problemFlags = {
|
|
5773
5747
|
NoResolution: "no-resolution",
|
|
5774
5748
|
UntypedResolution: "untyped-resolution",
|
|
@@ -5800,7 +5774,7 @@ async function attw(options, tarball) {
|
|
|
5800
5774
|
options.logger.warn("attw is enabled but package.json is not found");
|
|
5801
5775
|
return;
|
|
5802
5776
|
}
|
|
5803
|
-
const { profile = "
|
|
5777
|
+
const { profile = "esm-only", level = "warn", ignoreRules = [], ...attwOptions } = options.attw;
|
|
5804
5778
|
const invalidRules = ignoreRules.filter((rule) => !Object.values(problemFlags).includes(rule));
|
|
5805
5779
|
if (invalidRules.length) options.logger.warn(`attw config option 'ignoreRules' contains invalid value '${invalidRules.join(", ")}'.`);
|
|
5806
5780
|
const t = performance.now();
|
|
@@ -5818,7 +5792,7 @@ async function attw(options, tarball) {
|
|
|
5818
5792
|
if (problems.length) errorMessage = `problems found:\n${problems.map((problem) => formatProblem(checkResult.packageName, problem)).join("\n")}`;
|
|
5819
5793
|
} else errorMessage = `Package has no types`;
|
|
5820
5794
|
if (errorMessage) options.logger[level](options.nameLabel, label$1, errorMessage);
|
|
5821
|
-
else options.logger.success(options.nameLabel, label$1, "No problems found", dim`(${Math.round(performance.now() - t)}ms)`);
|
|
5795
|
+
else options.logger.success(options.nameLabel, label$1, "No problems found", styleText$1.dim(`(${Math.round(performance.now() - t)}ms)`));
|
|
5822
5796
|
}
|
|
5823
5797
|
/**
|
|
5824
5798
|
* Format an ATTW problem for display
|
|
@@ -5846,7 +5820,7 @@ function formatProblem(packageName, problem) {
|
|
|
5846
5820
|
}
|
|
5847
5821
|
}
|
|
5848
5822
|
const debug$2 = createDebug("tsdown:publint");
|
|
5849
|
-
const label = dim`[publint]
|
|
5823
|
+
const label = styleText$1.dim(`[publint]`);
|
|
5850
5824
|
async function publint(options, tarball) {
|
|
5851
5825
|
if (!options.publint) return;
|
|
5852
5826
|
if (!options.pkg) {
|
|
@@ -5863,7 +5837,7 @@ async function publint(options, tarball) {
|
|
|
5863
5837
|
});
|
|
5864
5838
|
debug$2("Found %d issues", messages.length);
|
|
5865
5839
|
if (!messages.length) {
|
|
5866
|
-
options.logger.success(options.nameLabel, label, "No issues found", dim`(${Math.round(performance.now() - t)}ms)`);
|
|
5840
|
+
options.logger.success(options.nameLabel, label, "No issues found", styleText$1.dim(`(${Math.round(performance.now() - t)}ms)`));
|
|
5867
5841
|
return;
|
|
5868
5842
|
}
|
|
5869
5843
|
for (const message of messages) {
|
|
@@ -5908,9 +5882,9 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
5908
5882
|
if (exportsConfigs.length) {
|
|
5909
5883
|
if (exportsConfigs.length > 1) throw new Error(`Conflicting exports options for package at ${pkg.packageJsonPath}. Please merge them:\n${exportsConfigs.map((config) => `- ${formatWithOptions({ colors: true }, config.exports)}`).join("\n")}`);
|
|
5910
5884
|
const chunks = {};
|
|
5911
|
-
const
|
|
5912
|
-
|
|
5913
|
-
|
|
5885
|
+
const exportsBundles = ctx.bundles.filter((bundle) => bundle.config.exports);
|
|
5886
|
+
const inlinedDeps = mergeInlinedDeps(exportsBundles);
|
|
5887
|
+
for (const bundle of exportsBundles) {
|
|
5914
5888
|
chunks[bundle.config.format] ||= [];
|
|
5915
5889
|
chunks[bundle.config.format].push(...bundle.chunks);
|
|
5916
5890
|
}
|
|
@@ -5934,7 +5908,7 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
5934
5908
|
async function packTarball(packageJsonPath) {
|
|
5935
5909
|
const pkgDir = path.dirname(packageJsonPath);
|
|
5936
5910
|
const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
|
|
5937
|
-
const { detect } = await import("./detect-
|
|
5911
|
+
const { detect } = await import("./detect-Bg-d8iUV-Cr_BRLVW.js");
|
|
5938
5912
|
try {
|
|
5939
5913
|
const detected = await detect({ cwd: pkgDir });
|
|
5940
5914
|
debug$1("Detected package manager: %o", detected);
|
|
@@ -5992,20 +5966,16 @@ async function pack(dir, pm, destination, ignoreScripts) {
|
|
|
5992
5966
|
case "bun":
|
|
5993
5967
|
args.push("--destination", destination);
|
|
5994
5968
|
break;
|
|
5995
|
-
default:
|
|
5996
|
-
args.push("--pack-destination", destination);
|
|
5997
|
-
break;
|
|
5969
|
+
default: args.push("--pack-destination", destination);
|
|
5998
5970
|
}
|
|
5999
5971
|
if (ignoreScripts) switch (pm.agent) {
|
|
6000
5972
|
case "pnpm":
|
|
6001
5973
|
args.push("--config.ignore-scripts=true");
|
|
6002
5974
|
break;
|
|
6003
5975
|
case "yarn@berry": break;
|
|
6004
|
-
default:
|
|
6005
|
-
args.push("--ignore-scripts");
|
|
6006
|
-
break;
|
|
5976
|
+
default: args.push("--ignore-scripts");
|
|
6007
5977
|
}
|
|
6008
|
-
const output = await x
|
|
5978
|
+
const output = await x(command, args, {
|
|
6009
5979
|
nodePath: false,
|
|
6010
5980
|
nodeOptions: { cwd: dir }
|
|
6011
5981
|
});
|
|
@@ -6077,14 +6047,13 @@ async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, i
|
|
|
6077
6047
|
const isSuppressed = createSuppressWarnings(logger.options?.suppressWarnings);
|
|
6078
6048
|
const plugins = [];
|
|
6079
6049
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
6080
|
-
if (config.pkg || config.deps.
|
|
6050
|
+
if (config.pkg || config.deps.neverBundle === true || config.deps.dts.neverBundle === true) plugins.push(DepsPlugin(config, bundle));
|
|
6081
6051
|
if (dts) {
|
|
6082
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
6083
|
-
const { cjsReexport: _, ...dtsPluginOptions } = dts;
|
|
6052
|
+
const { dts: dtsPlugin } = await import("./dist-ByW_jJfv.js");
|
|
6084
6053
|
const options = {
|
|
6085
6054
|
tsconfig,
|
|
6086
6055
|
logger,
|
|
6087
|
-
...
|
|
6056
|
+
...dts
|
|
6088
6057
|
};
|
|
6089
6058
|
if (format === "es") plugins.push(dtsPlugin(options));
|
|
6090
6059
|
else if (cjsDts) plugins.push(dtsPlugin({
|
|
@@ -6092,7 +6061,6 @@ async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, i
|
|
|
6092
6061
|
emitDtsOnly: true,
|
|
6093
6062
|
cjsDefault
|
|
6094
6063
|
}));
|
|
6095
|
-
else if (dts.cjsReexport && isDualFormat) plugins.push(CjsDtsReexportPlugin());
|
|
6096
6064
|
}
|
|
6097
6065
|
let cssPostPlugins;
|
|
6098
6066
|
if (!cjsDts) {
|
|
@@ -6208,14 +6176,15 @@ async function debugBuildOptions(dir, name, format, buildOptions) {
|
|
|
6208
6176
|
maxArrayLength: null,
|
|
6209
6177
|
maxStringLength: null
|
|
6210
6178
|
}, buildOptions);
|
|
6211
|
-
|
|
6179
|
+
const code = `/*
|
|
6212
6180
|
Auto-generated rolldown config for tsdown debug purposes
|
|
6213
6181
|
tsdown v${version}, rolldown v${VERSION}
|
|
6214
6182
|
Generated on ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
6215
6183
|
Package name: ${name || "not specified"}
|
|
6216
6184
|
*/
|
|
6217
6185
|
|
|
6218
|
-
export default ${serialized}\n
|
|
6186
|
+
export default ${serialized}\n`;
|
|
6187
|
+
await writeFile(outFile, code);
|
|
6219
6188
|
debug("Wrote debug rolldown config for \"%s\" (%s) -> %s", name || "default name", format, outFile);
|
|
6220
6189
|
}
|
|
6221
6190
|
function handlePluginInspect(plugins) {
|
|
@@ -6256,9 +6225,7 @@ function shortcuts(restart) {
|
|
|
6256
6225
|
{
|
|
6257
6226
|
key: "r",
|
|
6258
6227
|
description: "reload config and rebuild",
|
|
6259
|
-
action
|
|
6260
|
-
restart();
|
|
6261
|
-
}
|
|
6228
|
+
action: restart
|
|
6262
6229
|
},
|
|
6263
6230
|
{
|
|
6264
6231
|
key: "c",
|
|
@@ -6282,7 +6249,7 @@ function shortcuts(restart) {
|
|
|
6282
6249
|
if (loggedKeys.has(shortcut.key)) continue;
|
|
6283
6250
|
loggedKeys.add(shortcut.key);
|
|
6284
6251
|
if (shortcut.action == null) continue;
|
|
6285
|
-
globalLogger.info(dim` press ` + bold`${shortcut.key} + enter` + dim` to ${shortcut.description}`);
|
|
6252
|
+
globalLogger.info(styleText$1.dim(` press `) + styleText$1.bold(`${shortcut.key} + enter`) + styleText$1.dim(` to ${shortcut.description}`));
|
|
6286
6253
|
}
|
|
6287
6254
|
return;
|
|
6288
6255
|
}
|
|
@@ -6300,14 +6267,27 @@ var build_exports = /* @__PURE__ */ __exportAll({
|
|
|
6300
6267
|
build: () => build$1,
|
|
6301
6268
|
buildWithConfigs: () => buildWithConfigs
|
|
6302
6269
|
});
|
|
6303
|
-
const asyncDispose = Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose");
|
|
6304
6270
|
/**
|
|
6305
6271
|
* Build with tsdown.
|
|
6306
6272
|
*/
|
|
6307
6273
|
async function build$1(inlineConfig = {}) {
|
|
6308
6274
|
globalLogger.level = inlineConfig.logLevel || "info";
|
|
6309
|
-
|
|
6310
|
-
|
|
6275
|
+
let isConfigResolved = false;
|
|
6276
|
+
const { configs, deps } = await resolveConfig(inlineConfig, {
|
|
6277
|
+
restart,
|
|
6278
|
+
close
|
|
6279
|
+
});
|
|
6280
|
+
const handlePromise = buildWithConfigs(configs, deps, () => build$1(inlineConfig));
|
|
6281
|
+
isConfigResolved = true;
|
|
6282
|
+
return await handlePromise;
|
|
6283
|
+
async function restart() {
|
|
6284
|
+
if (!isConfigResolved) throw new Error("`watch.restart` cannot be called before config resolution is complete.");
|
|
6285
|
+
return (await handlePromise).watch.restart();
|
|
6286
|
+
}
|
|
6287
|
+
async function close() {
|
|
6288
|
+
if (!isConfigResolved) throw new Error("`watch.close` cannot be called before config resolution is complete.");
|
|
6289
|
+
return (await handlePromise).watch.close();
|
|
6290
|
+
}
|
|
6311
6291
|
}
|
|
6312
6292
|
/**
|
|
6313
6293
|
* Build with `ResolvedConfigs`.
|
|
@@ -6315,20 +6295,29 @@ async function build$1(inlineConfig = {}) {
|
|
|
6315
6295
|
* **Internal API, not for public use**
|
|
6316
6296
|
* @private
|
|
6317
6297
|
*/
|
|
6318
|
-
async function buildWithConfigs(configs, configDeps,
|
|
6298
|
+
async function buildWithConfigs(configs, configDeps, rebuild) {
|
|
6299
|
+
const hasWatchConfig = configs.some((config) => config.watch);
|
|
6319
6300
|
let cleanPromise;
|
|
6320
6301
|
const clean = () => {
|
|
6321
6302
|
if (cleanPromise) return cleanPromise;
|
|
6322
6303
|
return cleanPromise = cleanOutDir(configs);
|
|
6323
6304
|
};
|
|
6324
6305
|
const disposeCbs = [];
|
|
6325
|
-
let
|
|
6326
|
-
|
|
6327
|
-
if (
|
|
6328
|
-
|
|
6306
|
+
let restarted = false;
|
|
6307
|
+
function assertWatchMode() {
|
|
6308
|
+
if (!hasWatchConfig) throw new Error("`watch` is only available in watch mode.");
|
|
6309
|
+
}
|
|
6310
|
+
async function close() {
|
|
6311
|
+
assertWatchMode();
|
|
6329
6312
|
await Promise.all(disposeCbs.map((cb) => cb()));
|
|
6313
|
+
}
|
|
6314
|
+
async function restart() {
|
|
6315
|
+
assertWatchMode();
|
|
6316
|
+
if (restarted) throw new Error("`watch.restart` can only be called once per handle.");
|
|
6317
|
+
restarted = true;
|
|
6318
|
+
await close();
|
|
6330
6319
|
clearRequireCache();
|
|
6331
|
-
|
|
6320
|
+
return rebuild();
|
|
6332
6321
|
}
|
|
6333
6322
|
const configChunksByPkg = initBundleByPkg(configs);
|
|
6334
6323
|
function done(bundle) {
|
|
@@ -6336,14 +6325,23 @@ async function buildWithConfigs(configs, configDeps, _restart) {
|
|
|
6336
6325
|
}
|
|
6337
6326
|
globalLogger.info("Build start");
|
|
6338
6327
|
const bundles = await Promise.all(configs.map((options) => {
|
|
6339
|
-
return buildSingle(options, configDeps, options.pkg ? configChunksByPkg[options.pkg.packageJsonPath].formats.size > 1 : true, clean,
|
|
6328
|
+
return buildSingle(options, configDeps, options.pkg ? configChunksByPkg[options.pkg.packageJsonPath].formats.size > 1 : true, clean, () => {
|
|
6329
|
+
if (restarted) return;
|
|
6330
|
+
restart().catch((error) => globalLogger.error(error));
|
|
6331
|
+
}, done);
|
|
6340
6332
|
}));
|
|
6341
6333
|
const firstDevtoolsConfig = configs.find((config) => config.devtools && config.devtools.ui);
|
|
6342
|
-
if (
|
|
6334
|
+
if (hasWatchConfig) {
|
|
6343
6335
|
disposeCbs.push(shortcuts(restart));
|
|
6344
|
-
for (const bundle of bundles) disposeCbs.push(bundle[asyncDispose]);
|
|
6336
|
+
for (const bundle of bundles) disposeCbs.push(bundle[Symbol.asyncDispose]);
|
|
6345
6337
|
} else if (firstDevtoolsConfig) startDevtoolsUI(firstDevtoolsConfig.devtools);
|
|
6346
|
-
return
|
|
6338
|
+
return {
|
|
6339
|
+
bundles,
|
|
6340
|
+
watch: {
|
|
6341
|
+
restart,
|
|
6342
|
+
close
|
|
6343
|
+
}
|
|
6344
|
+
};
|
|
6347
6345
|
}
|
|
6348
6346
|
/**
|
|
6349
6347
|
* Build a single configuration, without watch and shortcuts features.
|
|
@@ -6368,7 +6366,7 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6368
6366
|
chunks,
|
|
6369
6367
|
config,
|
|
6370
6368
|
inlinedDeps: /* @__PURE__ */ new Map(),
|
|
6371
|
-
async [asyncDispose]() {
|
|
6369
|
+
async [Symbol.asyncDispose]() {
|
|
6372
6370
|
debouncedPostBuild.cancel();
|
|
6373
6371
|
ab?.abort();
|
|
6374
6372
|
await watcher?.close();
|
|
@@ -6377,17 +6375,18 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6377
6375
|
const configs = await initBuildOptions();
|
|
6378
6376
|
if (watch$1) {
|
|
6379
6377
|
watcher = watch(configs);
|
|
6380
|
-
handleWatcher(watcher);
|
|
6378
|
+
await handleWatcher(watcher);
|
|
6381
6379
|
} else {
|
|
6382
6380
|
const outputs = await config.runBuild(() => build(configs));
|
|
6383
6381
|
for (const { output } of outputs) chunks.push(...addOutDirToChunks(output, outDir));
|
|
6384
6382
|
}
|
|
6385
6383
|
if (!watch$1) {
|
|
6386
|
-
logger.success(config.nameLabel, `Build complete in ${green(`${Math.round(performance.now() - startTime)}ms`)}`);
|
|
6384
|
+
logger.success(config.nameLabel, `Build complete in ${styleText$1.green(`${Math.round(performance.now() - startTime)}ms`)}`);
|
|
6387
6385
|
await postBuild();
|
|
6388
6386
|
}
|
|
6389
6387
|
return bundle;
|
|
6390
6388
|
function handleWatcher(watcher) {
|
|
6389
|
+
const ready = Promise.withResolvers();
|
|
6391
6390
|
const changedFile = [];
|
|
6392
6391
|
let hasError = false;
|
|
6393
6392
|
watcher.on("change", async (id, event) => {
|
|
@@ -6415,6 +6414,7 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6415
6414
|
if (config.clean.length) await cleanChunks(config.outDir, chunks);
|
|
6416
6415
|
chunks.length = 0;
|
|
6417
6416
|
hasError = false;
|
|
6417
|
+
ready.resolve();
|
|
6418
6418
|
break;
|
|
6419
6419
|
case "END":
|
|
6420
6420
|
if (!hasError) debouncedPostBuild();
|
|
@@ -6422,7 +6422,7 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6422
6422
|
case "BUNDLE_START":
|
|
6423
6423
|
if (changedFile.length) {
|
|
6424
6424
|
logger.clearScreen("info");
|
|
6425
|
-
logger.info(`Found ${bold(changedFile.join(", "))} changed, rebuilding...`);
|
|
6425
|
+
logger.info(`Found ${styleText$1.bold(changedFile.join(", "))} changed, rebuilding...`);
|
|
6426
6426
|
}
|
|
6427
6427
|
changedFile.length = 0;
|
|
6428
6428
|
break;
|
|
@@ -6436,6 +6436,7 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6436
6436
|
hasError = true;
|
|
6437
6437
|
}
|
|
6438
6438
|
});
|
|
6439
|
+
return ready.promise;
|
|
6439
6440
|
}
|
|
6440
6441
|
async function initBuildOptions() {
|
|
6441
6442
|
const buildOptions = await getBuildOptions(config, format, configDeps, bundle, false, isDualFormat);
|
|
@@ -6445,7 +6446,7 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6445
6446
|
});
|
|
6446
6447
|
if (debugRolldownConfigDir) await debugBuildOptions(debugRolldownConfigDir, config.name, format, buildOptions);
|
|
6447
6448
|
const configs = [buildOptions];
|
|
6448
|
-
if (format === "cjs" && dts
|
|
6449
|
+
if (format === "cjs" && dts) configs.push(await getBuildOptions(config, format, configDeps, bundle, true, isDualFormat));
|
|
6449
6450
|
return configs;
|
|
6450
6451
|
}
|
|
6451
6452
|
async function postBuild() {
|
|
@@ -6462,4 +6463,4 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6462
6463
|
}
|
|
6463
6464
|
}
|
|
6464
6465
|
//#endregion
|
|
6465
|
-
export { resolveUserConfig as a, mergeConfig as i, buildWithConfigs as n,
|
|
6466
|
+
export { resolveUserConfig as a, mergeConfig as i, buildWithConfigs as n, mt as o, build_JVmLFaZt_exports as r, te as s, build$1 as t };
|