@ariestools/toolchain 9.0.1 → 9.0.3
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/README.md +28 -0
- package/dist/actions/enable/editXyConfigCompile.d.ts +32 -0
- package/dist/actions/enable/editXyConfigCompile.d.ts.map +1 -0
- package/dist/actions/enable/index.d.ts +3 -0
- package/dist/actions/enable/index.d.ts.map +1 -0
- package/dist/actions/enable/tsNative.d.ts +36 -0
- package/dist/actions/enable/tsNative.d.ts.map +1 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/lint.d.ts +10 -1
- package/dist/actions/lint.d.ts.map +1 -1
- package/dist/actions/lintMode.d.ts +18 -0
- package/dist/actions/lintMode.d.ts.map +1 -0
- package/dist/actions/lintNext.d.ts +7 -1
- package/dist/actions/lintNext.d.ts.map +1 -1
- package/dist/actions/lintNextRun.d.ts +3 -1
- package/dist/actions/lintNextRun.d.ts.map +1 -1
- package/dist/actions/lintNextWorker.d.ts +6 -0
- package/dist/actions/lintNextWorker.d.ts.map +1 -1
- package/dist/actions/lintSharedTypecheck.d.ts +10 -0
- package/dist/actions/lintSharedTypecheck.d.ts.map +1 -0
- package/dist/actions/lintSharedTypecheckRules.d.ts +24 -0
- package/dist/actions/lintSharedTypecheckRules.d.ts.map +1 -0
- package/dist/actions/package/compile/XyConfig.d.ts +7 -2
- package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
- package/dist/actions/package/compile/resolveTscBin.d.ts +10 -0
- package/dist/actions/package/compile/resolveTscBin.d.ts.map +1 -1
- package/dist/actions/package/compile/runTsc.d.ts.map +1 -1
- package/dist/actions/relint.d.ts +10 -1
- package/dist/actions/relint.d.ts.map +1 -1
- package/dist/actions/tsc-validate/sharedValidate.d.ts +18 -0
- package/dist/actions/tsc-validate/sharedValidate.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +127 -86
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +34 -1
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +133 -89
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +34 -1
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +127 -86
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/sync-layout.mjs +40 -4
- package/dist/bin/package/sync-layout.mjs.map +1 -1
- package/dist/bin/xy.mjs +962 -120
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/xy/common/enable/index.d.ts +3 -0
- package/dist/xy/common/enable/index.d.ts.map +1 -0
- package/dist/xy/common/index.d.ts.map +1 -1
- package/dist/xy/lint/lint/runCommand.d.ts.map +1 -1
- package/dist/xy/lint/relintCommand.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import $e, { builtinModules, createRequire } from "node:module";
|
|
3
3
|
import process$1, { cwd, execPath } from "node:process";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import tty from "node:tty";
|
|
@@ -16,7 +16,7 @@ import Re from "path";
|
|
|
16
16
|
import { spawn } from "node:child_process";
|
|
17
17
|
import readline from "node:readline";
|
|
18
18
|
import Ue from "os";
|
|
19
|
-
import {
|
|
19
|
+
import { createJiti } from "jiti";
|
|
20
20
|
import util from "node:util";
|
|
21
21
|
import ts, { formatDiagnosticsWithColorAndContext, sys } from "typescript";
|
|
22
22
|
import { build } from "esbuild";
|
|
@@ -634,7 +634,7 @@ function Ut(n, t = {}) {
|
|
|
634
634
|
function es(n, t = {}) {
|
|
635
635
|
return new I$1(n, t).iterate();
|
|
636
636
|
}
|
|
637
|
-
var Gt, ce, ss, fe$1, ue$1, qt, de$1, pe$1, is, rs, ns, os$2, hs, as, ls, cs, fs$5, us, ds, at, Ss, lt, Es, we$1, ye$1, W, xs, be$1, vs, Ct, Cs, Ts, As, ks, Kt, Se$1, Ee$1, Q$1, tt, O$2, Rs, Os, Fs, Ds, Ms, Ns, _s, Ls, Ws, Ps, js, Is, zs, Bs, Us, $s, Gs, Hs, Ce$1, Te$1, Ae$1, xe$1, A$1, Vs, Ys, Xs, Js, N$1, Zs, ke$1, Qs, ti, ve$1, ei, D, si, Oe$1, Vt, Fe$1, At, Re$1, ii, q$1, De$1, Tt, ri, ft, Ne$1, oi, hi, ai, G, H$1, K$1, kt, ut, Rt, _e$1, Ot, Le$1, P, et, v$1, dt, st, C$1, F, T, Yt, Ft, k, x$2, Xt, Jt, We$1, Zt, B, Qt, Dt, pt, Y$1, M, mt, li, ci, fi, ui, Mt, te$1, di, pi, V, vi, wt, Ue$1, $e, Ri, Oi, L$1, Ge$1, He$1, U, qe$1, Ke$1, X$1, Ve$1, _$1, gt, se$1, je$1, yt, j, Nt, Lt, Ie$1, Fi, ie$1, ze$1, bt, Be
|
|
637
|
+
var Gt, ce, ss, fe$1, ue$1, qt, de$1, pe$1, is, rs, ns, os$2, hs, as, ls, cs, fs$5, us, ds, at, Ss, lt, Es, we$1, ye$1, W, xs, be$1, vs, Ct, Cs, Ts, As, ks, Kt, Se$1, Ee$1, Q$1, tt, O$2, Rs, Os, Fs, Ds, Ms, Ns, _s, Ls, Ws, Ps, js, Is, zs, Bs, Us, $s, Gs, Hs, Ce$1, Te$1, Ae$1, xe$1, A$1, Vs, Ys, Xs, Js, N$1, Zs, ke$1, Qs, ti, ve$1, ei, D, si, Oe$1, Vt, Fe$1, At, Re$1, ii, q$1, De$1, Tt, ri, ft, Ne$1, oi, hi, ai, G, H$1, K$1, kt, ut, Rt, _e$1, Ot, Le$1, P, et, v$1, dt, st, C$1, F, T, Yt, Ft, k, x$2, Xt, Jt, We$1, Zt, B, Qt, Dt, pt, Y$1, M, mt, li, ci, fi, ui, Mt, te$1, di, pi, V, vi, wt, Ue$1, $e$1, Ri, Oi, L$1, Ge$1, He$1, U, qe$1, Ke$1, X$1, Ve$1, _$1, gt, se$1, je$1, yt, j, Nt, Lt, Ie$1, Fi, ie$1, ze$1, bt, Be, _t, Wt, ne$1, Ye$1, R$2, Pt, jt, It, it, rt, St, Xe$1, Di, Mi, Ni, nt, _i, ot, oe$1, he$1, ae$1, Et, Li, zt, xt, vt, Pi, I$1, le$1, ji, Ii, zi, Bi, Ui, Ze$1;
|
|
638
638
|
var init_index_min = __esmMin((() => {
|
|
639
639
|
Gt = (n, t, e) => {
|
|
640
640
|
let s = n instanceof RegExp ? ce(n, e) : n, i = t instanceof RegExp ? ce(t, e) : t, r = s !== null && i != null && ss(s, i, e);
|
|
@@ -2411,8 +2411,8 @@ while (this[Le$1](this[Ft]()) && this[C$1].length);
|
|
|
2411
2411
|
...n.promises || {}
|
|
2412
2412
|
}
|
|
2413
2413
|
};
|
|
2414
|
-
$e = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
2415
|
-
Ri = (n) => n.replace(/\//g, "\\").replace($e, "$1\\");
|
|
2414
|
+
$e$1 = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
2415
|
+
Ri = (n) => n.replace(/\//g, "\\").replace($e$1, "$1\\");
|
|
2416
2416
|
Oi = /[\\\/]/;
|
|
2417
2417
|
L$1 = 0;
|
|
2418
2418
|
Ge$1 = 1;
|
|
@@ -2440,12 +2440,12 @@ while (this[Le$1](this[Ft]()) && this[C$1].length);
|
|
|
2440
2440
|
let e = n.normalize("NFKD");
|
|
2441
2441
|
return ze$1.set(n, e), e;
|
|
2442
2442
|
};
|
|
2443
|
-
Be
|
|
2443
|
+
Be = new ft({ max: 4096 });
|
|
2444
2444
|
_t = (n) => {
|
|
2445
|
-
let t = Be
|
|
2445
|
+
let t = Be.get(n);
|
|
2446
2446
|
if (t) return t;
|
|
2447
2447
|
let e = bt(n.toLowerCase());
|
|
2448
|
-
return Be
|
|
2448
|
+
return Be.set(n, e), e;
|
|
2449
2449
|
};
|
|
2450
2450
|
Wt = class extends ft {
|
|
2451
2451
|
constructor() {
|
|
@@ -2893,7 +2893,7 @@ while (this[Le$1](this[Ft]()) && this[C$1].length);
|
|
|
2893
2893
|
return this.roots[t] = new it(t, this).root;
|
|
2894
2894
|
}
|
|
2895
2895
|
sameRoot(t, e = this.root.name) {
|
|
2896
|
-
return t = t.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t === e;
|
|
2896
|
+
return t = t.toUpperCase().replace(/\//g, "\\").replace($e$1, "$1\\"), t === e;
|
|
2897
2897
|
}
|
|
2898
2898
|
};
|
|
2899
2899
|
jt = class n extends R$2 {
|
|
@@ -8468,6 +8468,39 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
8468
8468
|
exports.cosmiconfigSync = cosmiconfigSync;
|
|
8469
8469
|
}));
|
|
8470
8470
|
//#endregion
|
|
8471
|
+
//#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.2.0_cosmiconfig@10.0.0_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/typescript-compile-error.mjs
|
|
8472
|
+
var TypeScriptCompileError = class _TypeScriptCompileError extends Error {
|
|
8473
|
+
constructor(message) {
|
|
8474
|
+
super(message);
|
|
8475
|
+
this.name = this.constructor.name;
|
|
8476
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
8477
|
+
}
|
|
8478
|
+
static fromError(error) {
|
|
8479
|
+
const message = `TypeScriptLoader failed to compile TypeScript:
|
|
8480
|
+
${error.message}`;
|
|
8481
|
+
const newError = new _TypeScriptCompileError(message);
|
|
8482
|
+
newError.stack = error.stack;
|
|
8483
|
+
return newError;
|
|
8484
|
+
}
|
|
8485
|
+
};
|
|
8486
|
+
//#endregion
|
|
8487
|
+
//#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.2.0_cosmiconfig@10.0.0_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/loader.mjs
|
|
8488
|
+
function TypeScriptLoader(options) {
|
|
8489
|
+
const loader = createJiti("", {
|
|
8490
|
+
interopDefault: true,
|
|
8491
|
+
...options
|
|
8492
|
+
});
|
|
8493
|
+
return async (path, _content) => {
|
|
8494
|
+
try {
|
|
8495
|
+
const result = await loader.import(path);
|
|
8496
|
+
return result.default || result;
|
|
8497
|
+
} catch (error) {
|
|
8498
|
+
if (error instanceof Error) throw TypeScriptCompileError.fromError(error);
|
|
8499
|
+
throw error;
|
|
8500
|
+
}
|
|
8501
|
+
};
|
|
8502
|
+
}
|
|
8503
|
+
//#endregion
|
|
8471
8504
|
//#region src/lib/ruleCommandRegistry.ts
|
|
8472
8505
|
const RULE_COMMANDS = {
|
|
8473
8506
|
apiExposure: {
|
|
@@ -11192,7 +11225,7 @@ const v = (r, t, e) => {
|
|
|
11192
11225
|
return n;
|
|
11193
11226
|
};
|
|
11194
11227
|
//#endregion
|
|
11195
|
-
//#region ../../node_modules/.pnpm/get-tsconfig@4.14.
|
|
11228
|
+
//#region ../../node_modules/.pnpm/get-tsconfig@4.14.2/node_modules/get-tsconfig/dist/index.mjs
|
|
11196
11229
|
var xe = Object.defineProperty;
|
|
11197
11230
|
var i = (e, t) => xe(e, "name", {
|
|
11198
11231
|
value: t,
|
|
@@ -11235,7 +11268,7 @@ const X = i((e) => {
|
|
|
11235
11268
|
}, "normalizeRelativePath");
|
|
11236
11269
|
function We(e, t = !1) {
|
|
11237
11270
|
const s = e.length;
|
|
11238
|
-
let n = 0, o = "", l = 0, r = 16, f = 0, u = 0, g = 0,
|
|
11271
|
+
let n = 0, o = "", l = 0, r = 16, f = 0, u = 0, g = 0, w = 0, b = 0;
|
|
11239
11272
|
function _(c, j) {
|
|
11240
11273
|
let y = 0, A = 0;
|
|
11241
11274
|
for (; y < c;) {
|
|
@@ -11328,8 +11361,8 @@ function We(e, t = !1) {
|
|
|
11328
11361
|
return c;
|
|
11329
11362
|
}
|
|
11330
11363
|
i(T, "scanString");
|
|
11331
|
-
function
|
|
11332
|
-
if (o = "", b = 0, l = n, u = f,
|
|
11364
|
+
function d() {
|
|
11365
|
+
if (o = "", b = 0, l = n, u = f, w = g, n >= s) return l = s, r = 17;
|
|
11333
11366
|
let c = e.charCodeAt(n);
|
|
11334
11367
|
if (ee(c)) {
|
|
11335
11368
|
do
|
|
@@ -11392,7 +11425,7 @@ function We(e, t = !1) {
|
|
|
11392
11425
|
return o += String.fromCharCode(c), n++, r = 16;
|
|
11393
11426
|
}
|
|
11394
11427
|
}
|
|
11395
|
-
i(
|
|
11428
|
+
i(d, "scanNext");
|
|
11396
11429
|
function v(c) {
|
|
11397
11430
|
if (ee(c) || J(c)) return !1;
|
|
11398
11431
|
switch (c) {
|
|
@@ -11408,23 +11441,23 @@ function We(e, t = !1) {
|
|
|
11408
11441
|
return !0;
|
|
11409
11442
|
}
|
|
11410
11443
|
i(v, "isUnknownContentCharacter");
|
|
11411
|
-
function
|
|
11444
|
+
function $() {
|
|
11412
11445
|
let c;
|
|
11413
11446
|
do
|
|
11414
|
-
c =
|
|
11447
|
+
c = d();
|
|
11415
11448
|
while (c >= 12 && c <= 15);
|
|
11416
11449
|
return c;
|
|
11417
11450
|
}
|
|
11418
|
-
return i(
|
|
11451
|
+
return i($, "scanNextNonTrivia"), {
|
|
11419
11452
|
setPosition: h,
|
|
11420
11453
|
getPosition: i(() => n, "getPosition"),
|
|
11421
|
-
scan: t ?
|
|
11454
|
+
scan: t ? $ : d,
|
|
11422
11455
|
getToken: i(() => r, "getToken"),
|
|
11423
11456
|
getTokenValue: i(() => o, "getTokenValue"),
|
|
11424
11457
|
getTokenOffset: i(() => l, "getTokenOffset"),
|
|
11425
11458
|
getTokenLength: i(() => n - l, "getTokenLength"),
|
|
11426
11459
|
getTokenStartLine: i(() => u, "getTokenStartLine"),
|
|
11427
|
-
getTokenStartCharacter: i(() => l -
|
|
11460
|
+
getTokenStartCharacter: i(() => l - w, "getTokenStartCharacter"),
|
|
11428
11461
|
getTokenError: i(() => b, "getTokenError")
|
|
11429
11462
|
};
|
|
11430
11463
|
}
|
|
@@ -11480,11 +11513,11 @@ function Je(e, t = [], s = Y.DEFAULT) {
|
|
|
11480
11513
|
o = l.pop();
|
|
11481
11514
|
}, "onArrayEnd"),
|
|
11482
11515
|
onLiteralValue: r,
|
|
11483
|
-
onError: i((u, g,
|
|
11516
|
+
onError: i((u, g, w) => {
|
|
11484
11517
|
t.push({
|
|
11485
11518
|
error: u,
|
|
11486
11519
|
offset: g,
|
|
11487
|
-
length:
|
|
11520
|
+
length: w
|
|
11488
11521
|
});
|
|
11489
11522
|
}, "onError")
|
|
11490
11523
|
}, s), o[0];
|
|
@@ -11511,13 +11544,13 @@ function Me(e, t, s = Y.DEFAULT) {
|
|
|
11511
11544
|
} : () => !0;
|
|
11512
11545
|
}
|
|
11513
11546
|
i(g, "toBeginVisit");
|
|
11514
|
-
function
|
|
11547
|
+
function w(p) {
|
|
11515
11548
|
return p ? () => {
|
|
11516
11549
|
l > 0 && l--, l === 0 && p(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
11517
11550
|
} : () => !0;
|
|
11518
11551
|
}
|
|
11519
|
-
i(
|
|
11520
|
-
const b = g(t.onObjectBegin), _ = u(t.onObjectProperty), h =
|
|
11552
|
+
i(w, "toEndVisit");
|
|
11553
|
+
const b = g(t.onObjectBegin), _ = u(t.onObjectProperty), h = w(t.onObjectEnd), D = g(t.onArrayBegin), T = w(t.onArrayEnd), d = u(t.onLiteralValue), v = f(t.onSeparator), $ = r(t.onComment), c = f(t.onError), j = s && s.disallowComments, y = s && s.allowTrailingComma;
|
|
11521
11554
|
function A() {
|
|
11522
11555
|
for (;;) {
|
|
11523
11556
|
const p = n.scan();
|
|
@@ -11542,7 +11575,7 @@ function Me(e, t, s = Y.DEFAULT) {
|
|
|
11542
11575
|
switch (p) {
|
|
11543
11576
|
case 12:
|
|
11544
11577
|
case 13:
|
|
11545
|
-
j ? k(10) :
|
|
11578
|
+
j ? k(10) : $();
|
|
11546
11579
|
break;
|
|
11547
11580
|
case 16:
|
|
11548
11581
|
k(1);
|
|
@@ -11569,7 +11602,7 @@ function Me(e, t, s = Y.DEFAULT) {
|
|
|
11569
11602
|
i(k, "handleError");
|
|
11570
11603
|
function P(p) {
|
|
11571
11604
|
const F = n.getTokenValue();
|
|
11572
|
-
return p ?
|
|
11605
|
+
return p ? d(F) : (_(F), o.push(F)), A(), !0;
|
|
11573
11606
|
}
|
|
11574
11607
|
i(P, "parseString");
|
|
11575
11608
|
function M() {
|
|
@@ -11577,16 +11610,16 @@ function Me(e, t, s = Y.DEFAULT) {
|
|
|
11577
11610
|
case 11:
|
|
11578
11611
|
const p = n.getTokenValue();
|
|
11579
11612
|
let F = Number(p);
|
|
11580
|
-
isNaN(F) && (k(2), F = 0),
|
|
11613
|
+
isNaN(F) && (k(2), F = 0), d(F);
|
|
11581
11614
|
break;
|
|
11582
11615
|
case 7:
|
|
11583
|
-
|
|
11616
|
+
d(null);
|
|
11584
11617
|
break;
|
|
11585
11618
|
case 8:
|
|
11586
|
-
|
|
11619
|
+
d(!0);
|
|
11587
11620
|
break;
|
|
11588
11621
|
case 9:
|
|
11589
|
-
|
|
11622
|
+
d(!1);
|
|
11590
11623
|
break;
|
|
11591
11624
|
default: return !1;
|
|
11592
11625
|
}
|
|
@@ -11641,21 +11674,21 @@ var me;
|
|
|
11641
11674
|
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";
|
|
11642
11675
|
})(me || (me = {}));
|
|
11643
11676
|
const Ve = Je;
|
|
11644
|
-
var
|
|
11677
|
+
var de;
|
|
11645
11678
|
(function(e) {
|
|
11646
11679
|
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";
|
|
11647
|
-
})(
|
|
11648
|
-
const
|
|
11680
|
+
})(de || (de = {}));
|
|
11681
|
+
const we = i((e, t) => Ve(Se(t, e, "utf8")), "readJsonc");
|
|
11649
11682
|
const ne = Symbol("implicitBaseUrl");
|
|
11650
11683
|
const E = "${configDir}";
|
|
11651
11684
|
const ze = i(() => {
|
|
11652
|
-
const { findPnpApi: e } =
|
|
11685
|
+
const { findPnpApi: e } = $e;
|
|
11653
11686
|
return e && e(process.cwd());
|
|
11654
11687
|
}, "getPnpApi");
|
|
11655
11688
|
const te = i((e, t, s, n) => {
|
|
11656
11689
|
const o = `resolveFromPackageJsonPath:${e}:${t}:${s}`;
|
|
11657
11690
|
if (n != null && n.has(o)) return n.get(o);
|
|
11658
|
-
const l =
|
|
11691
|
+
const l = we(e, n);
|
|
11659
11692
|
if (!l) return;
|
|
11660
11693
|
let r = t || "tsconfig.json";
|
|
11661
11694
|
if (!s && l.exports) try {
|
|
@@ -11686,25 +11719,25 @@ const Ge = i((e, t, s) => {
|
|
|
11686
11719
|
const { resolveRequest: T } = g;
|
|
11687
11720
|
try {
|
|
11688
11721
|
if (f === e) {
|
|
11689
|
-
const
|
|
11690
|
-
if (
|
|
11691
|
-
const v = te(
|
|
11722
|
+
const d = T(PATH.join(f, se), t);
|
|
11723
|
+
if (d) {
|
|
11724
|
+
const v = te(d, u, !1, s);
|
|
11692
11725
|
if (v && x$1(s, v)) return v;
|
|
11693
11726
|
}
|
|
11694
11727
|
} else {
|
|
11695
|
-
let
|
|
11728
|
+
let d;
|
|
11696
11729
|
try {
|
|
11697
|
-
|
|
11730
|
+
d = T(e, t, { extensions: [".json"] });
|
|
11698
11731
|
} catch {
|
|
11699
|
-
|
|
11732
|
+
d = T(PATH.join(e, le), t);
|
|
11700
11733
|
}
|
|
11701
|
-
if (
|
|
11734
|
+
if (d) return d;
|
|
11702
11735
|
}
|
|
11703
11736
|
} catch {}
|
|
11704
11737
|
}
|
|
11705
|
-
const
|
|
11706
|
-
if (!
|
|
11707
|
-
const b = Pe$1(s,
|
|
11738
|
+
const w = O(PATH.resolve(t), PATH.join("node_modules", f), s);
|
|
11739
|
+
if (!w || !((n = H(s, w)) != null && n.isDirectory())) return;
|
|
11740
|
+
const b = Pe$1(s, w), _ = PATH.join(b, se);
|
|
11708
11741
|
if (x$1(s, _)) {
|
|
11709
11742
|
const T = te(_, u, !1, s);
|
|
11710
11743
|
if (T === !1) return;
|
|
@@ -11722,8 +11755,8 @@ const Ge = i((e, t, s) => {
|
|
|
11722
11755
|
const v = te(T, "", !0, s);
|
|
11723
11756
|
if (v && x$1(s, v)) return v;
|
|
11724
11757
|
}
|
|
11725
|
-
const
|
|
11726
|
-
if (x$1(s,
|
|
11758
|
+
const d = PATH.join(h, le);
|
|
11759
|
+
if (x$1(s, d)) return d;
|
|
11727
11760
|
} else if (D) return h;
|
|
11728
11761
|
}
|
|
11729
11762
|
}, "resolveExtendsPath");
|
|
@@ -11755,8 +11788,8 @@ const He = i((e, t, s, n) => {
|
|
|
11755
11788
|
u && !u.startsWith(E) && (f.baseUrl = N(t, l, u));
|
|
11756
11789
|
const { outDir: g } = f;
|
|
11757
11790
|
g && !g.startsWith(E) && (f.outDir = N(t, l, g));
|
|
11758
|
-
const { declarationDir:
|
|
11759
|
-
|
|
11791
|
+
const { declarationDir: w } = f;
|
|
11792
|
+
w && !w.startsWith(E) && (f.declarationDir = N(t, l, w));
|
|
11760
11793
|
const { rootDir: b } = f;
|
|
11761
11794
|
b && !b.startsWith(E) && (f.rootDir = N(t, l, b));
|
|
11762
11795
|
const { rootDirs: _ } = f;
|
|
@@ -11766,7 +11799,7 @@ const He = i((e, t, s, n) => {
|
|
|
11766
11799
|
}
|
|
11767
11800
|
for (const u of pe) {
|
|
11768
11801
|
const g = r[u];
|
|
11769
|
-
g && (r[u] = g.map((
|
|
11802
|
+
g && (r[u] = g.map((w) => w.startsWith(E) ? w : Qe(t, l, w)));
|
|
11770
11803
|
}
|
|
11771
11804
|
return r;
|
|
11772
11805
|
}, "resolveExtends");
|
|
@@ -11774,7 +11807,7 @@ const be = ["outDir", "declarationDir"];
|
|
|
11774
11807
|
const ve = i((e, t, s = /* @__PURE__ */ new Set()) => {
|
|
11775
11808
|
let n;
|
|
11776
11809
|
try {
|
|
11777
|
-
n =
|
|
11810
|
+
n = we(e, t) || {};
|
|
11778
11811
|
} catch {
|
|
11779
11812
|
throw new Error(`Cannot resolve tsconfig at path: ${e}`);
|
|
11780
11813
|
}
|
|
@@ -11834,7 +11867,7 @@ const Xe = [
|
|
|
11834
11867
|
"tsBuildInfoFile"
|
|
11835
11868
|
];
|
|
11836
11869
|
const Ye = i((e) => {
|
|
11837
|
-
if (e.strict) for (const
|
|
11870
|
+
if (e.strict) for (const B of [
|
|
11838
11871
|
"noImplicitAny",
|
|
11839
11872
|
"noImplicitThis",
|
|
11840
11873
|
"strictNullChecks",
|
|
@@ -11844,7 +11877,7 @@ const Ye = i((e) => {
|
|
|
11844
11877
|
"strictBuiltinIteratorReturn",
|
|
11845
11878
|
"alwaysStrict",
|
|
11846
11879
|
"useUnknownInCatchVariables"
|
|
11847
|
-
]) e[
|
|
11880
|
+
]) e[B] === void 0 && (e[B] = !0);
|
|
11848
11881
|
if (e.composite && (e.declaration ??= !0, e.incremental ??= !0), e.target) {
|
|
11849
11882
|
let a = e.target.toLowerCase();
|
|
11850
11883
|
a === "es2015" && (a = "es6"), e.target = a, a === "esnext" && (e.module ??= "es6", e.useDefineForClassFields ??= !0), (a === "es6" || a === "es2016" || a === "es2017" || a === "es2018" || a === "es2019" || a === "es2020" || a === "es2021" || a === "es2022" || a === "es2023" || a === "es2024") && (e.module ??= "es6"), (a === "es2022" || a === "es2023" || a === "es2024") && (e.useDefineForClassFields ??= !0);
|
|
@@ -11852,8 +11885,8 @@ const Ye = i((e) => {
|
|
|
11852
11885
|
if (e.module) {
|
|
11853
11886
|
let a = e.module.toLowerCase();
|
|
11854
11887
|
if (a === "es2015" && (a = "es6"), e.module = a, (a === "es6" || a === "es2020" || a === "es2022" || a === "esnext" || a === "none" || a === "system" || a === "umd" || a === "amd") && (e.moduleResolution ??= "classic"), a === "system" && (e.allowSyntheticDefaultImports ??= !0), (a === "node16" || a === "node18" || a === "node20" || a === "nodenext" || a === "preserve") && (e.esModuleInterop ??= !0, e.allowSyntheticDefaultImports ??= !0), (a === "node16" || a === "node18" || a === "node20" || a === "nodenext") && (e.moduleDetection ??= "force"), a === "node16" && (e.target ??= "es2022", e.moduleResolution ??= "node16"), a === "node18" && (e.target ??= "es2022", e.moduleResolution ??= "node16"), a === "node20" && (e.target ??= "es2023", e.moduleResolution ??= "node16", e.resolveJsonModule ??= !0), a === "nodenext" && (e.target ??= "esnext", e.moduleResolution ??= "nodenext", e.resolveJsonModule ??= !0), a === "node16" || a === "node18" || a === "node20" || a === "nodenext") {
|
|
11855
|
-
const
|
|
11856
|
-
(
|
|
11888
|
+
const B = e.target;
|
|
11889
|
+
(B === "es3" || B === "es2022" || B === "es2023" || B === "es2024" || B === "esnext") && (e.useDefineForClassFields ??= !0);
|
|
11857
11890
|
}
|
|
11858
11891
|
a === "preserve" && (e.moduleResolution ??= "bundler");
|
|
11859
11892
|
}
|
|
@@ -11876,8 +11909,8 @@ const ie = i((e, t = /* @__PURE__ */ new Map()) => {
|
|
|
11876
11909
|
for (const f of ["rootDirs", "typeRoots"]) {
|
|
11877
11910
|
const u = l[f];
|
|
11878
11911
|
u && (l[f] = u.map((g) => {
|
|
11879
|
-
const
|
|
11880
|
-
return
|
|
11912
|
+
const w = Z(g, o);
|
|
11913
|
+
return w ? oe(o, w) : X(g);
|
|
11881
11914
|
}));
|
|
11882
11915
|
}
|
|
11883
11916
|
const { paths: r } = l;
|
|
@@ -11930,7 +11963,10 @@ const Te = q((e) => {
|
|
|
11930
11963
|
let o;
|
|
11931
11964
|
const l = Te(n);
|
|
11932
11965
|
return l !== n && t.existsSync(n) ? o = !t.existsSync(l) : o = qe(n, e, t), s && re.set(n, o), o;
|
|
11933
|
-
}, "isFsCaseSensitive"), { join:
|
|
11966
|
+
}, "isFsCaseSensitive"), { join: Oe } = PATH.posix, _e = i((e, t) => {
|
|
11967
|
+
const s = Oe(e, t);
|
|
11968
|
+
return e.startsWith("//") && !s.startsWith("//") ? `/${s}` : s;
|
|
11969
|
+
}, "pathJoin"), ue = {
|
|
11934
11970
|
ts: [
|
|
11935
11971
|
".ts",
|
|
11936
11972
|
".tsx",
|
|
@@ -11938,14 +11974,14 @@ const Te = q((e) => {
|
|
|
11938
11974
|
],
|
|
11939
11975
|
cts: [".cts", ".d.cts"],
|
|
11940
11976
|
mts: [".mts", ".d.mts"]
|
|
11941
|
-
},
|
|
11977
|
+
}, Ce = i((e) => {
|
|
11942
11978
|
const t = [...ue.ts], s = [...ue.cts], n = [...ue.mts];
|
|
11943
11979
|
return e != null && e.allowJs && (t.push(".js", ".jsx"), s.push(".cjs"), n.push(".mjs")), [
|
|
11944
11980
|
...t,
|
|
11945
11981
|
...s,
|
|
11946
11982
|
...n
|
|
11947
11983
|
];
|
|
11948
|
-
}, "getSupportedExtensions"),
|
|
11984
|
+
}, "getSupportedExtensions"), en = i((e) => {
|
|
11949
11985
|
const t = [];
|
|
11950
11986
|
if (!e) return t;
|
|
11951
11987
|
const { outDir: s, declarationDir: n } = e;
|
|
@@ -11954,29 +11990,29 @@ const Te = q((e) => {
|
|
|
11954
11990
|
"node_modules",
|
|
11955
11991
|
"bower_components",
|
|
11956
11992
|
"jspm_packages"
|
|
11957
|
-
].join("|")})(/|$))`,
|
|
11993
|
+
].join("|")})(/|$))`, tn = /(?:^|\/)[^.*?]+$/, je = "**/*", K = "[^/]", ae = "[^./]", Fe = process.platform === "win32", De = i(({ config: e, path: t }, s = Ke()) => {
|
|
11958
11994
|
if ("extends" in e) throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");
|
|
11959
11995
|
if (!PATH.isAbsolute(t)) throw new Error("The tsconfig path must be absolute");
|
|
11960
11996
|
Fe && (t = L(t));
|
|
11961
|
-
const n = PATH.dirname(t), { files: o, include: l, exclude: r, compilerOptions: f } = e, u = i((
|
|
11962
|
-
const v = u(
|
|
11963
|
-
return new RegExp(`^${
|
|
11964
|
-
}), D = o || l ? l : [je], T = D ? D.map((
|
|
11965
|
-
let v = u(
|
|
11966
|
-
|
|
11967
|
-
const
|
|
11997
|
+
const n = PATH.dirname(t), { files: o, include: l, exclude: r, compilerOptions: f } = e, u = i((d) => PATH.isAbsolute(d) ? d : _e(n, d), "resolvePattern"), g = o == null ? void 0 : o.map(u), w = Ce(f), b = s ? "" : "i", h = (r || en(f)).map((d) => {
|
|
11998
|
+
const v = u(d), $ = ye(v).replaceAll(String.raw`\*\*/`, "(.+/)?").replaceAll(String.raw`\*`, `${K}*`).replaceAll(String.raw`\?`, K);
|
|
11999
|
+
return new RegExp(`^${$}($|/)`, b);
|
|
12000
|
+
}), D = o || l ? l : [je], T = D ? D.map((d) => {
|
|
12001
|
+
let v = u(d);
|
|
12002
|
+
tn.test(v) && (v = _e(v, je));
|
|
12003
|
+
const $ = ye(v).replaceAll(String.raw`/\*\*`, `(/${fe}${ae}${K}*)*?`).replaceAll(/(\/)?\\\*/g, (c, j) => {
|
|
11968
12004
|
const y = `(${ae}|(\\.(?!min\\.js$))?)*`;
|
|
11969
12005
|
return j ? `/${fe}${ae}${y}` : y;
|
|
11970
12006
|
}).replaceAll(/(\/)?\\\?/g, (c, j) => {
|
|
11971
12007
|
const y = K;
|
|
11972
12008
|
return j ? `/${fe}${y}` : y;
|
|
11973
12009
|
});
|
|
11974
|
-
return new RegExp(`^${
|
|
12010
|
+
return new RegExp(`^${$}$`, b);
|
|
11975
12011
|
}) : void 0;
|
|
11976
|
-
return (
|
|
11977
|
-
if (!PATH.isAbsolute(
|
|
11978
|
-
if (Fe && (
|
|
11979
|
-
if (!(!
|
|
12012
|
+
return (d) => {
|
|
12013
|
+
if (!PATH.isAbsolute(d)) throw new Error("filePath must be absolute");
|
|
12014
|
+
if (Fe && (d = L(d)), g != null && g.includes(d)) return e;
|
|
12015
|
+
if (!(!w.some((v) => d.endsWith(v)) || h.some((v) => v.test(d))) && T && T.some((v) => v.test(d))) return e;
|
|
11980
12016
|
};
|
|
11981
12017
|
}, "createFilesMatcher"), he = i((e, t, s) => {
|
|
11982
12018
|
const n = PATH.resolve(e);
|
|
@@ -11989,14 +12025,14 @@ const Te = q((e) => {
|
|
|
11989
12025
|
config: f
|
|
11990
12026
|
};
|
|
11991
12027
|
if (De(u)(n)) return u;
|
|
11992
|
-
const
|
|
11993
|
-
if (b ===
|
|
12028
|
+
const w = PATH.dirname(l), b = PATH.dirname(w);
|
|
12029
|
+
if (b === w) return;
|
|
11994
12030
|
o = b;
|
|
11995
12031
|
}
|
|
11996
12032
|
}, "findConfigApplicable"), Le = i((e = process.cwd(), t = "tsconfig.json", s = /* @__PURE__ */ new Map(), n = !1) => {
|
|
11997
12033
|
var o;
|
|
11998
12034
|
return n ? (o = he(e, t, s)) == null ? void 0 : o.path : O(L(e), t, s);
|
|
11999
|
-
}, "findTsconfig"),
|
|
12035
|
+
}, "findTsconfig"), sn = i((e = process.cwd(), t = "tsconfig.json", s = /* @__PURE__ */ new Map(), n = !1) => {
|
|
12000
12036
|
var o;
|
|
12001
12037
|
if (!n) {
|
|
12002
12038
|
const l = Le(e, t, s);
|
|
@@ -12007,10 +12043,10 @@ const Te = q((e) => {
|
|
|
12007
12043
|
};
|
|
12008
12044
|
}
|
|
12009
12045
|
return (o = he(e, t, s)) != null ? o : null;
|
|
12010
|
-
}, "getTsconfig"),
|
|
12011
|
-
const s = e.match(
|
|
12046
|
+
}, "getTsconfig"), ln = /\*/g, Ee = i((e, t) => {
|
|
12047
|
+
const s = e.match(ln);
|
|
12012
12048
|
if (s && s.length > 1) throw new Error(t);
|
|
12013
|
-
}, "assertStarCount"),
|
|
12049
|
+
}, "assertStarCount"), on = i((e) => {
|
|
12014
12050
|
if (e.includes("*")) {
|
|
12015
12051
|
const [t, s] = e.split("*");
|
|
12016
12052
|
return {
|
|
@@ -12019,8 +12055,8 @@ const Te = q((e) => {
|
|
|
12019
12055
|
};
|
|
12020
12056
|
}
|
|
12021
12057
|
return e;
|
|
12022
|
-
}, "parsePattern"),
|
|
12023
|
-
pattern:
|
|
12058
|
+
}, "parsePattern"), rn = i(({ prefix: e, suffix: t }, s) => s.startsWith(e) && s.endsWith(t), "isPatternMatch"), un = i((e, t, s) => Object.entries(e).map(([n, o]) => (Ee(n, `Pattern '${n}' can have at most one '*' character.`), {
|
|
12059
|
+
pattern: on(n),
|
|
12024
12060
|
substitutions: o.map((l) => {
|
|
12025
12061
|
if (Ee(l, `Substitution '${l}' in pattern '${n}' can have at most one '*' character.`), !t && !C.test(l) && !PATH.isAbsolute(l)) throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");
|
|
12026
12062
|
return PATH.resolve(s, l);
|
|
@@ -12031,7 +12067,7 @@ i((e) => {
|
|
|
12031
12067
|
if (!t) return null;
|
|
12032
12068
|
const { baseUrl: s, paths: n } = t;
|
|
12033
12069
|
if (!s && !n) return null;
|
|
12034
|
-
const o = ne in t && t[ne], l = PATH.resolve(PATH.dirname(e.path), s || o || "."), r = n ?
|
|
12070
|
+
const o = ne in t && t[ne], l = PATH.resolve(PATH.dirname(e.path), s || o || "."), r = n ? un(n, s, l) : [];
|
|
12035
12071
|
return (f) => {
|
|
12036
12072
|
if (C.test(f)) return [];
|
|
12037
12073
|
const u = [];
|
|
@@ -12039,8 +12075,8 @@ i((e) => {
|
|
|
12039
12075
|
if (_.pattern === f) return _.substitutions.map(L);
|
|
12040
12076
|
typeof _.pattern != "string" && u.push(_);
|
|
12041
12077
|
}
|
|
12042
|
-
let g,
|
|
12043
|
-
for (const _ of u)
|
|
12078
|
+
let g, w = -1;
|
|
12079
|
+
for (const _ of u) rn(_.pattern, f) && _.pattern.prefix.length > w && (w = _.pattern.prefix.length, g = _);
|
|
12044
12080
|
if (!g) return s ? [L(PATH.join(l, f))] : [];
|
|
12045
12081
|
const b = f.slice(g.pattern.prefix.length, f.length - g.pattern.suffix.length);
|
|
12046
12082
|
return g.substitutions.map((_) => L(_.replace("*", b)));
|
|
@@ -12055,7 +12091,7 @@ const readRootTsconfigModule = (pkg) => {
|
|
|
12055
12091
|
return typeof module === "string" ? module : void 0;
|
|
12056
12092
|
};
|
|
12057
12093
|
const readResolvedTsconfigTypes = (pkg) => {
|
|
12058
|
-
const compilerOptions =
|
|
12094
|
+
const compilerOptions = sn(PATH.resolve(pkg), "tsconfig.json")?.config?.compilerOptions;
|
|
12059
12095
|
if (!compilerOptions || !("types" in compilerOptions)) return;
|
|
12060
12096
|
const { types } = compilerOptions;
|
|
12061
12097
|
if (!Array.isArray(types)) return;
|
|
@@ -12303,6 +12339,10 @@ const warnDeprecatedEmptyObjectTargets = (targets) => {
|
|
|
12303
12339
|
* `compile.nativePackage`.
|
|
12304
12340
|
*/
|
|
12305
12341
|
const DEFAULT_NATIVE_PACKAGE = "typescript-native";
|
|
12342
|
+
/**
|
|
12343
|
+
* Full `package.json` alias spec for {@link DEFAULT_NATIVE_PACKAGE}.
|
|
12344
|
+
*/
|
|
12345
|
+
const DEFAULT_NATIVE_ALIAS_SPEC = `npm:typescript@~7.0.2`;
|
|
12306
12346
|
const readTscBinEntry = (packageJsonPath) => {
|
|
12307
12347
|
const { bin } = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
12308
12348
|
if (typeof bin === "string") return bin;
|
|
@@ -12344,7 +12384,8 @@ const resolveCached = (packageName, fromDir) => {
|
|
|
12344
12384
|
const missingNativeMessage = (packageName) => [
|
|
12345
12385
|
`Compile: compile.compiler is "native" but "${packageName}" is not installed.`,
|
|
12346
12386
|
" Add it as an alias so it does not collide with the compiler API package:",
|
|
12347
|
-
` "${packageName}": "
|
|
12387
|
+
` "${packageName}": "${DEFAULT_NATIVE_ALIAS_SPEC}"`,
|
|
12388
|
+
" Or run: xy enable ts-native",
|
|
12348
12389
|
" Keep \"typescript\" pinned to 6.x — ESLint and the xy analyzers load the compiler API from it."
|
|
12349
12390
|
].join("\n");
|
|
12350
12391
|
/**
|