ts-checker-rspack-plugin 1.7.2 → 1.8.0

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 CHANGED
@@ -108,6 +108,8 @@ Supported options include:
108
108
  It also supports `tsconfig.json` compiler options used by `tsgo`,
109
109
  including `incremental` and `composite`.
110
110
 
111
+ With TypeScript 7.1+, configuring `contentMappers` in `tsconfig.json` automatically enables `--runExternalCode`.
112
+
111
113
  Install TypeScript >= 7.0.0 to enable `tsgo` automatically:
112
114
 
113
115
  ```sh
@@ -3,5 +3,10 @@ interface FilesMatch {
3
3
  dirs: string[];
4
4
  excluded: string[];
5
5
  extensions: string[];
6
+ contentMappers?: {
7
+ extensions: string[];
8
+ };
6
9
  }
10
+ declare function isContentMapperFile(file: string, contentMappers: FilesMatch['contentMappers']): boolean;
11
+ export { isContentMapperFile };
7
12
  export type { FilesMatch };
package/lib/index.js CHANGED
@@ -3318,6 +3318,9 @@ var __webpack_exports__ = {};
3318
3318
  deletedFiles: Array.from(deletedFilesSet)
3319
3319
  };
3320
3320
  }
3321
+ function isContentMapperFile(file, contentMappers) {
3322
+ return contentMappers?.extensions.some((extension)=>file.endsWith(extension)) || false;
3323
+ }
3321
3324
  function isInsideAnotherPath(parent, directory) {
3322
3325
  const relativePart = (0, external_node_path_namespaceObject.relative)(parent, directory);
3323
3326
  if (relativePart.startsWith('..')) return false;
@@ -3328,6 +3331,977 @@ var __webpack_exports__ = {};
3328
3331
  const external_node_child_process_namespaceObject = require("node:child_process");
3329
3332
  const external_node_url_namespaceObject = require("node:url");
3330
3333
  const external_node_util_namespaceObject = require("node:util");
3334
+ const external_node_module_namespaceObject = require("node:module");
3335
+ const dist_A = (r)=>null !== r && "object" == typeof r, dist_a = (r, t)=>Object.assign(new Error(`[${r}]: ${t}`), {
3336
+ code: r
3337
+ }), dist_ = "ERR_INVALID_PACKAGE_CONFIG", E = "ERR_INVALID_PACKAGE_TARGET", dist_I = "ERR_PACKAGE_PATH_NOT_EXPORTED", R = /^\d+$/, O = /^(\.{1,2}|node_modules)$/i, dist_w = /\/|\\/;
3338
+ var dist_h = ((r)=>(r.Export = "exports", r.Import = "imports", r))(dist_h || {});
3339
+ const dist_f = (r, t, e, o, c)=>{
3340
+ if (null == t) return [];
3341
+ if ("string" == typeof t) {
3342
+ const [n, ...i] = t.split(dist_w);
3343
+ if (".." === n || i.some((l)=>O.test(l))) throw dist_a(E, `Invalid "${r}" target "${t}" defined in the package config`);
3344
+ return [
3345
+ c ? t.replace(/\*/g, c) : t
3346
+ ];
3347
+ }
3348
+ if (Array.isArray(t)) return t.flatMap((n)=>dist_f(r, n, e, o, c));
3349
+ if (dist_A(t)) {
3350
+ for (const n of Object.keys(t)){
3351
+ if (R.test(n)) throw dist_a(dist_, "Cannot contain numeric property keys");
3352
+ if ("default" === n || o.includes(n)) return dist_f(r, t[n], e, o, c);
3353
+ }
3354
+ return [];
3355
+ }
3356
+ throw dist_a(E, `Invalid "${r}" target "${t}"`);
3357
+ }, dist_s = "*", dist_m = (r, t)=>{
3358
+ const e = r.indexOf(dist_s), o = t.indexOf(dist_s);
3359
+ return e === o ? t.length > r.length : o > e;
3360
+ };
3361
+ function dist_d(r, t) {
3362
+ if (!t.includes(dist_s) && r.hasOwnProperty(t)) return [
3363
+ t
3364
+ ];
3365
+ let e, o;
3366
+ for (const c of Object.keys(r))if (c.includes(dist_s)) {
3367
+ const [n, i, l] = c.split(dist_s);
3368
+ if (void 0 === l && t.startsWith(n) && t.endsWith(i)) {
3369
+ const g = t.slice(n.length, -i.length || void 0);
3370
+ g && (!e || dist_m(e, c)) && (e = c, o = g);
3371
+ }
3372
+ }
3373
+ return [
3374
+ e,
3375
+ o
3376
+ ];
3377
+ }
3378
+ const dist_p = (r)=>Object.keys(r).reduce((t, e)=>{
3379
+ const o = "" === e || "." !== e[0];
3380
+ if (void 0 === t || t === o) return o;
3381
+ throw dist_a(dist_, '"exports" cannot contain some keys starting with "." and some not');
3382
+ }, void 0), dist_u = /^\w+:/, dist_v = (r, t, e)=>{
3383
+ if (!r) throw new Error('"exports" is required');
3384
+ t = "" === t ? "." : `./${t}`, ("string" == typeof r || Array.isArray(r) || dist_A(r) && dist_p(r)) && (r = {
3385
+ ".": r
3386
+ });
3387
+ const [o, c] = dist_d(r, t), n = dist_f(dist_h.Export, r[o], t, e, c);
3388
+ if (0 === n.length) throw dist_a(dist_I, "." === t ? 'No "exports" main defined' : `Package subpath '${t}' is not defined by "exports"`);
3389
+ for (const i of n)if (!i.startsWith("./") && !dist_u.test(i)) throw dist_a(E, `Invalid "exports" target "${i}" defined in the package config`);
3390
+ return n;
3391
+ };
3392
+ const external_fs_namespaceObject = require("fs");
3393
+ const external_os_namespaceObject = require("os");
3394
+ const external_path_namespaceObject = require("path");
3395
+ var xe = Object.defineProperty;
3396
+ var dist_r = (e, t)=>xe(e, "name", {
3397
+ value: t,
3398
+ configurable: !0
3399
+ });
3400
+ function L(e) {
3401
+ return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
3402
+ }
3403
+ dist_r(L, "slash");
3404
+ const Q = dist_r((e)=>{
3405
+ const t = external_node_fs_namespaceObject[e];
3406
+ return (l, ...n)=>{
3407
+ const s = `${e}:${n.join(":")}`;
3408
+ let i = null == l ? void 0 : l.get(s);
3409
+ return void 0 === i && (i = Reflect.apply(t, external_node_fs_namespaceObject, n), null == l || l.set(s, i)), i;
3410
+ };
3411
+ }, "cacheFs"), dist_x = Q("existsSync"), Se = Q("readFileSync"), H = Q("statSync"), Ne = Q("realpathSync"), Pe = dist_r((...[e, t])=>{
3412
+ const l = Ne(e, t);
3413
+ if ("string" != typeof l) throw new TypeError(`Unexpected resolved path type for ${l} in ${t}`);
3414
+ return l;
3415
+ }, "realpath"), dist_O = dist_r((e, t, l)=>{
3416
+ for(;;){
3417
+ const n = external_node_path_namespaceObject.posix.join(e, t);
3418
+ if (dist_x(l, n)) return n;
3419
+ const s = external_node_path_namespaceObject.dirname(e);
3420
+ if (s === e) return;
3421
+ e = s;
3422
+ }
3423
+ }, "findUp"), C = /^\.{1,2}(\/.*)?$/, X = dist_r((e)=>{
3424
+ const t = L(e);
3425
+ return C.test(t) ? t : `./${t}`;
3426
+ }, "normalizeRelativePath");
3427
+ function We(e, t = !1) {
3428
+ const l = e.length;
3429
+ let n = 0, s = "", i = 0, o = 16, f = 0, u = 0, c = 0, w = 0, p = 0;
3430
+ function _(g, j) {
3431
+ let y = 0, A = 0;
3432
+ for(; y < g;){
3433
+ let k = e.charCodeAt(n);
3434
+ if (k >= 48 && k <= 57) A = 16 * A + k - 48;
3435
+ else if (k >= 65 && k <= 70) A = 16 * A + k - 65 + 10;
3436
+ else if (k >= 97 && k <= 102) A = 16 * A + k - 97 + 10;
3437
+ else break;
3438
+ n++, y++;
3439
+ }
3440
+ return y < g && (A = -1), A;
3441
+ }
3442
+ dist_r(_, "scanHexDigits");
3443
+ function h(g) {
3444
+ n = g, s = "", i = 0, o = 16, p = 0;
3445
+ }
3446
+ dist_r(h, "setPosition");
3447
+ function D() {
3448
+ let g = n;
3449
+ if (48 === e.charCodeAt(n)) n++;
3450
+ else for(n++; n < e.length && dist_R(e.charCodeAt(n));)n++;
3451
+ if (n < e.length && 46 === e.charCodeAt(n)) if (n++, !(n < e.length && dist_R(e.charCodeAt(n)))) return p = 3, e.substring(g, n);
3452
+ else for(n++; n < e.length && dist_R(e.charCodeAt(n));)n++;
3453
+ let j = n;
3454
+ if (n < e.length && (69 === e.charCodeAt(n) || 101 === e.charCodeAt(n))) if (n++, (n < e.length && 43 === e.charCodeAt(n) || 45 === e.charCodeAt(n)) && n++, n < e.length && dist_R(e.charCodeAt(n))) {
3455
+ for(n++; n < e.length && dist_R(e.charCodeAt(n));)n++;
3456
+ j = n;
3457
+ } else p = 3;
3458
+ return e.substring(g, j);
3459
+ }
3460
+ dist_r(D, "scanNumber");
3461
+ function T() {
3462
+ let g = "", j = n;
3463
+ for(;;){
3464
+ if (n >= l) {
3465
+ g += e.substring(j, n), p = 2;
3466
+ break;
3467
+ }
3468
+ const y = e.charCodeAt(n);
3469
+ if (34 === y) {
3470
+ g += e.substring(j, n), n++;
3471
+ break;
3472
+ }
3473
+ if (92 === y) {
3474
+ if (g += e.substring(j, n), n++, n >= l) {
3475
+ p = 2;
3476
+ break;
3477
+ }
3478
+ switch(e.charCodeAt(n++)){
3479
+ case 34:
3480
+ g += '"';
3481
+ break;
3482
+ case 92:
3483
+ g += "\\";
3484
+ break;
3485
+ case 47:
3486
+ g += "/";
3487
+ break;
3488
+ case 98:
3489
+ g += "\b";
3490
+ break;
3491
+ case 102:
3492
+ g += "\f";
3493
+ break;
3494
+ case 110:
3495
+ g += `
3496
+ `;
3497
+ break;
3498
+ case 114:
3499
+ g += "\r";
3500
+ break;
3501
+ case 116:
3502
+ g += " ";
3503
+ break;
3504
+ case 117:
3505
+ const k = _(4);
3506
+ k >= 0 ? g += String.fromCharCode(k) : p = 4;
3507
+ break;
3508
+ default:
3509
+ p = 5;
3510
+ }
3511
+ j = n;
3512
+ continue;
3513
+ }
3514
+ if (y >= 0 && y <= 31) if (J(y)) {
3515
+ g += e.substring(j, n), p = 2;
3516
+ break;
3517
+ } else p = 6;
3518
+ n++;
3519
+ }
3520
+ return g;
3521
+ }
3522
+ dist_r(T, "scanString");
3523
+ function d() {
3524
+ if (s = "", p = 0, i = n, u = f, w = c, n >= l) return i = l, o = 17;
3525
+ let g = e.charCodeAt(n);
3526
+ if (ee(g)) {
3527
+ do n++, s += String.fromCharCode(g), g = e.charCodeAt(n);
3528
+ while (ee(g));
3529
+ return o = 15;
3530
+ }
3531
+ if (J(g)) return n++, s += String.fromCharCode(g), 13 === g && 10 === e.charCodeAt(n) && (n++, s += `
3532
+ `), f++, c = n, o = 14;
3533
+ switch(g){
3534
+ case 123:
3535
+ return n++, o = 1;
3536
+ case 125:
3537
+ return n++, o = 2;
3538
+ case 91:
3539
+ return n++, o = 3;
3540
+ case 93:
3541
+ return n++, o = 4;
3542
+ case 58:
3543
+ return n++, o = 6;
3544
+ case 44:
3545
+ return n++, o = 5;
3546
+ case 34:
3547
+ return n++, s = T(), o = 10;
3548
+ case 47:
3549
+ const j = n - 1;
3550
+ if (47 === e.charCodeAt(n + 1)) {
3551
+ for(n += 2; n < l && !J(e.charCodeAt(n));)n++;
3552
+ return s = e.substring(j, n), o = 12;
3553
+ }
3554
+ if (42 === e.charCodeAt(n + 1)) {
3555
+ n += 2;
3556
+ const y = l - 1;
3557
+ let A = !1;
3558
+ for(; n < y;){
3559
+ const k = e.charCodeAt(n);
3560
+ if (42 === k && 47 === e.charCodeAt(n + 1)) {
3561
+ n += 2, A = !0;
3562
+ break;
3563
+ }
3564
+ n++, J(k) && (13 === k && 10 === e.charCodeAt(n) && n++, f++, c = n);
3565
+ }
3566
+ return A || (n++, p = 1), s = e.substring(j, n), o = 13;
3567
+ }
3568
+ return s += String.fromCharCode(g), n++, o = 16;
3569
+ case 45:
3570
+ if (s += String.fromCharCode(g), n++, n === l || !dist_R(e.charCodeAt(n))) return o = 16;
3571
+ case 48:
3572
+ case 49:
3573
+ case 50:
3574
+ case 51:
3575
+ case 52:
3576
+ case 53:
3577
+ case 54:
3578
+ case 55:
3579
+ case 56:
3580
+ case 57:
3581
+ return s += D(), o = 11;
3582
+ default:
3583
+ for(; n < l && v(g);)n++, g = e.charCodeAt(n);
3584
+ if (i !== n) {
3585
+ switch(s = e.substring(i, n)){
3586
+ case "true":
3587
+ return o = 8;
3588
+ case "false":
3589
+ return o = 9;
3590
+ case "null":
3591
+ return o = 7;
3592
+ }
3593
+ return o = 16;
3594
+ }
3595
+ return s += String.fromCharCode(g), n++, o = 16;
3596
+ }
3597
+ }
3598
+ dist_r(d, "scanNext");
3599
+ function v(g) {
3600
+ if (ee(g) || J(g)) return !1;
3601
+ switch(g){
3602
+ case 125:
3603
+ case 93:
3604
+ case 123:
3605
+ case 91:
3606
+ case 34:
3607
+ case 58:
3608
+ case 44:
3609
+ case 47:
3610
+ return !1;
3611
+ }
3612
+ return !0;
3613
+ }
3614
+ dist_r(v, "isUnknownContentCharacter");
3615
+ function $() {
3616
+ let g;
3617
+ do g = d();
3618
+ while (g >= 12 && g <= 15);
3619
+ return g;
3620
+ }
3621
+ return dist_r($, "scanNextNonTrivia"), {
3622
+ setPosition: h,
3623
+ getPosition: dist_r(()=>n, "getPosition"),
3624
+ scan: t ? $ : d,
3625
+ getToken: dist_r(()=>o, "getToken"),
3626
+ getTokenValue: dist_r(()=>s, "getTokenValue"),
3627
+ getTokenOffset: dist_r(()=>i, "getTokenOffset"),
3628
+ getTokenLength: dist_r(()=>n - i, "getTokenLength"),
3629
+ getTokenStartLine: dist_r(()=>u, "getTokenStartLine"),
3630
+ getTokenStartCharacter: dist_r(()=>i - w, "getTokenStartCharacter"),
3631
+ getTokenError: dist_r(()=>p, "getTokenError")
3632
+ };
3633
+ }
3634
+ dist_r(We, "createScanner");
3635
+ function ee(e) {
3636
+ return 32 === e || 9 === e;
3637
+ }
3638
+ dist_r(ee, "isWhiteSpace");
3639
+ function J(e) {
3640
+ return 10 === e || 13 === e;
3641
+ }
3642
+ dist_r(J, "isLineBreak");
3643
+ function dist_R(e) {
3644
+ return e >= 48 && e <= 57;
3645
+ }
3646
+ dist_r(dist_R, "isDigit");
3647
+ var ge;
3648
+ (function(e) {
3649
+ 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";
3650
+ })(ge || (ge = {})), new Array(20).fill(0).map((e, t)=>" ".repeat(t));
3651
+ const S = 200;
3652
+ new Array(S).fill(0).map((e, t)=>`
3653
+ ` + " ".repeat(t)), new Array(S).fill(0).map((e, t)=>"\r" + " ".repeat(t)), new Array(S).fill(0).map((e, t)=>`\r
3654
+ ` + " ".repeat(t)), new Array(S).fill(0).map((e, t)=>`
3655
+ ` + " ".repeat(t)), new Array(S).fill(0).map((e, t)=>"\r" + " ".repeat(t)), new Array(S).fill(0).map((e, t)=>`\r
3656
+ ` + " ".repeat(t));
3657
+ var Y;
3658
+ (function(e) {
3659
+ e.DEFAULT = {
3660
+ allowTrailingComma: !1
3661
+ };
3662
+ })(Y || (Y = {}));
3663
+ function Je(e, t = [], l = Y.DEFAULT) {
3664
+ let n = null, s = [];
3665
+ const i = [];
3666
+ function o(u) {
3667
+ Array.isArray(s) ? s.push(u) : null !== n && (s[n] = u);
3668
+ }
3669
+ return dist_r(o, "onValue"), Me(e, {
3670
+ onObjectBegin: dist_r(()=>{
3671
+ const u = {};
3672
+ o(u), i.push(s), s = u, n = null;
3673
+ }, "onObjectBegin"),
3674
+ onObjectProperty: dist_r((u)=>{
3675
+ n = u;
3676
+ }, "onObjectProperty"),
3677
+ onObjectEnd: dist_r(()=>{
3678
+ s = i.pop();
3679
+ }, "onObjectEnd"),
3680
+ onArrayBegin: dist_r(()=>{
3681
+ const u = [];
3682
+ o(u), i.push(s), s = u, n = null;
3683
+ }, "onArrayBegin"),
3684
+ onArrayEnd: dist_r(()=>{
3685
+ s = i.pop();
3686
+ }, "onArrayEnd"),
3687
+ onLiteralValue: o,
3688
+ onError: dist_r((u, c, w)=>{
3689
+ t.push({
3690
+ error: u,
3691
+ offset: c,
3692
+ length: w
3693
+ });
3694
+ }, "onError")
3695
+ }, l), s[0];
3696
+ }
3697
+ dist_r(Je, "parse$1");
3698
+ function Me(e, t, l = Y.DEFAULT) {
3699
+ const n = We(e, !1), s = [];
3700
+ let i = 0;
3701
+ function o(b) {
3702
+ return b ? ()=>0 === i && b(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : ()=>!0;
3703
+ }
3704
+ dist_r(o, "toNoArgVisit");
3705
+ function f(b) {
3706
+ return b ? (F)=>0 === i && b(F, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : ()=>!0;
3707
+ }
3708
+ dist_r(f, "toOneArgVisit");
3709
+ function u(b) {
3710
+ return b ? (F)=>0 === i && b(F, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), ()=>s.slice()) : ()=>!0;
3711
+ }
3712
+ dist_r(u, "toOneArgVisitWithPath");
3713
+ function c(b) {
3714
+ return b ? ()=>{
3715
+ i > 0 ? i++ : !1 === b(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), ()=>s.slice()) && (i = 1);
3716
+ } : ()=>!0;
3717
+ }
3718
+ dist_r(c, "toBeginVisit");
3719
+ function w(b) {
3720
+ return b ? ()=>{
3721
+ i > 0 && i--, 0 === i && b(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
3722
+ } : ()=>!0;
3723
+ }
3724
+ dist_r(w, "toEndVisit");
3725
+ const p = c(t.onObjectBegin), _ = u(t.onObjectProperty), h = w(t.onObjectEnd), D = c(t.onArrayBegin), T = w(t.onArrayEnd), d = u(t.onLiteralValue), v = f(t.onSeparator), $ = o(t.onComment), g = f(t.onError), j = l && l.disallowComments, y = l && l.allowTrailingComma;
3726
+ function A() {
3727
+ for(;;){
3728
+ const b = n.scan();
3729
+ switch(n.getTokenError()){
3730
+ case 4:
3731
+ k(14);
3732
+ break;
3733
+ case 5:
3734
+ k(15);
3735
+ break;
3736
+ case 3:
3737
+ k(13);
3738
+ break;
3739
+ case 1:
3740
+ j || k(11);
3741
+ break;
3742
+ case 2:
3743
+ k(12);
3744
+ break;
3745
+ case 6:
3746
+ k(16);
3747
+ break;
3748
+ }
3749
+ switch(b){
3750
+ case 12:
3751
+ case 13:
3752
+ j ? k(10) : $();
3753
+ break;
3754
+ case 16:
3755
+ k(1);
3756
+ break;
3757
+ case 15:
3758
+ case 14:
3759
+ break;
3760
+ default:
3761
+ return b;
3762
+ }
3763
+ }
3764
+ }
3765
+ dist_r(A, "scanNext");
3766
+ function k(b, F = [], W = []) {
3767
+ if (g(b), F.length + W.length > 0) {
3768
+ let I = n.getToken();
3769
+ for(; 17 !== I;){
3770
+ if (-1 !== F.indexOf(I)) {
3771
+ A();
3772
+ break;
3773
+ } else if (-1 !== W.indexOf(I)) break;
3774
+ I = A();
3775
+ }
3776
+ }
3777
+ }
3778
+ dist_r(k, "handleError");
3779
+ function P(b) {
3780
+ const F = n.getTokenValue();
3781
+ return b ? d(F) : (_(F), s.push(F)), A(), !0;
3782
+ }
3783
+ dist_r(P, "parseString");
3784
+ function M() {
3785
+ switch(n.getToken()){
3786
+ case 11:
3787
+ const b = n.getTokenValue();
3788
+ let F = Number(b);
3789
+ isNaN(F) && (k(2), F = 0), d(F);
3790
+ break;
3791
+ case 7:
3792
+ d(null);
3793
+ break;
3794
+ case 8:
3795
+ d(!0);
3796
+ break;
3797
+ case 9:
3798
+ d(!1);
3799
+ break;
3800
+ default:
3801
+ return !1;
3802
+ }
3803
+ return A(), !0;
3804
+ }
3805
+ dist_r(M, "parseLiteral");
3806
+ function V() {
3807
+ return 10 !== n.getToken() ? (k(3, [], [
3808
+ 2,
3809
+ 5
3810
+ ]), !1) : (P(!1), 6 === n.getToken() ? (v(":"), A(), U() || k(4, [], [
3811
+ 2,
3812
+ 5
3813
+ ])) : k(5, [], [
3814
+ 2,
3815
+ 5
3816
+ ]), s.pop(), !0);
3817
+ }
3818
+ dist_r(V, "parseProperty");
3819
+ function z() {
3820
+ p(), A();
3821
+ let b = !1;
3822
+ for(; 2 !== n.getToken() && 17 !== n.getToken();){
3823
+ if (5 === n.getToken()) {
3824
+ if (b || k(4, [], []), v(","), A(), 2 === n.getToken() && y) break;
3825
+ } else b && k(6, [], []);
3826
+ V() || k(4, [], [
3827
+ 2,
3828
+ 5
3829
+ ]), b = !0;
3830
+ }
3831
+ return h(), 2 !== n.getToken() ? k(7, [
3832
+ 2
3833
+ ], []) : A(), !0;
3834
+ }
3835
+ dist_r(z, "parseObject");
3836
+ function G() {
3837
+ D(), A();
3838
+ let b = !0, F = !1;
3839
+ for(; 4 !== n.getToken() && 17 !== n.getToken();){
3840
+ if (5 === n.getToken()) {
3841
+ if (F || k(4, [], []), v(","), A(), 4 === n.getToken() && y) break;
3842
+ } else F && k(6, [], []);
3843
+ b ? (s.push(0), b = !1) : s[s.length - 1]++, U() || k(4, [], [
3844
+ 4,
3845
+ 5
3846
+ ]), F = !0;
3847
+ }
3848
+ return T(), b || s.pop(), 4 !== n.getToken() ? k(8, [
3849
+ 4
3850
+ ], []) : A(), !0;
3851
+ }
3852
+ dist_r(G, "parseArray");
3853
+ function U() {
3854
+ switch(n.getToken()){
3855
+ case 3:
3856
+ return G();
3857
+ case 1:
3858
+ return z();
3859
+ case 10:
3860
+ return P(!0);
3861
+ default:
3862
+ return M();
3863
+ }
3864
+ }
3865
+ return dist_r(U, "parseValue"), A(), 17 === n.getToken() ? l.allowEmptyContent ? !0 : (k(4, [], []), !1) : U() ? (17 !== n.getToken() && k(9, [], []), !0) : (k(4, [], []), !1);
3866
+ }
3867
+ dist_r(Me, "visit");
3868
+ var ke;
3869
+ (function(e) {
3870
+ 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";
3871
+ })(ke || (ke = {}));
3872
+ var dist_me;
3873
+ (function(e) {
3874
+ 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";
3875
+ })(dist_me || (dist_me = {}));
3876
+ const Ve = Je;
3877
+ var de;
3878
+ (function(e) {
3879
+ 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";
3880
+ })(de || (de = {}));
3881
+ const we = dist_r((e, t)=>Ve(Se(t, e, "utf8")), "readJsonc"), ne = Symbol("implicitBaseUrl"), dist_E = "${configDir}", ze = dist_r(()=>{
3882
+ const { findPnpApi: e } = external_node_module_namespaceObject;
3883
+ return e && e(process.cwd());
3884
+ }, "getPnpApi"), te = dist_r((e, t, l, n)=>{
3885
+ const s = `resolveFromPackageJsonPath:${e}:${t}:${l}`;
3886
+ if (null != n && n.has(s)) return n.get(s);
3887
+ const i = we(e, n);
3888
+ if (!i) return;
3889
+ let o = t || "tsconfig.json";
3890
+ if (!l && i.exports) try {
3891
+ const [f] = dist_v(i.exports, t, [
3892
+ "require",
3893
+ "types"
3894
+ ]);
3895
+ o = f;
3896
+ } catch {
3897
+ return !1;
3898
+ }
3899
+ else !t && i.tsconfig && (o = i.tsconfig);
3900
+ return o = external_node_path_namespaceObject.join(e, "..", o), null == n || n.set(s, o), o;
3901
+ }, "resolveFromPackageJsonPath"), se = "package.json", le = "tsconfig.json", Ge = dist_r((e, t, l)=>{
3902
+ var n;
3903
+ let s = e;
3904
+ if (".." === e && (s = external_node_path_namespaceObject.join(s, le)), "." === e[0] && (s = external_node_path_namespaceObject.resolve(t, s)), external_node_path_namespaceObject.isAbsolute(s)) {
3905
+ if (dist_x(l, s)) {
3906
+ if (H(l, s).isFile()) return s;
3907
+ } else if (!s.endsWith(".json")) {
3908
+ const T = `${s}.json`;
3909
+ if (dist_x(l, T)) return T;
3910
+ }
3911
+ return;
3912
+ }
3913
+ const [i, ...o] = e.split("/"), f = "@" === i[0] ? `${i}/${o.shift()}` : i, u = o.join("/"), c = ze();
3914
+ if (c) {
3915
+ const { resolveRequest: T } = c;
3916
+ try {
3917
+ if (f === e) {
3918
+ const d = T(external_node_path_namespaceObject.join(f, se), t);
3919
+ if (d) {
3920
+ const v = te(d, u, !1, l);
3921
+ if (v && dist_x(l, v)) return v;
3922
+ }
3923
+ } else {
3924
+ let d;
3925
+ try {
3926
+ d = T(e, t, {
3927
+ extensions: [
3928
+ ".json"
3929
+ ]
3930
+ });
3931
+ } catch {
3932
+ d = T(external_node_path_namespaceObject.join(e, le), t);
3933
+ }
3934
+ if (d) return d;
3935
+ }
3936
+ } catch {}
3937
+ }
3938
+ const w = dist_O(external_node_path_namespaceObject.resolve(t), external_node_path_namespaceObject.join("node_modules", f), l);
3939
+ if (!w || !(null != (n = H(l, w)) && n.isDirectory())) return;
3940
+ const p = Pe(l, w), _ = external_node_path_namespaceObject.join(p, se);
3941
+ if (dist_x(l, _)) {
3942
+ const T = te(_, u, !1, l);
3943
+ if (!1 === T) return;
3944
+ if (T && dist_x(l, T) && H(l, T).isFile()) return T;
3945
+ }
3946
+ const h = external_node_path_namespaceObject.join(p, u), D = h.endsWith(".json");
3947
+ if (!D) {
3948
+ const T = `${h}.json`;
3949
+ if (dist_x(l, T)) return T;
3950
+ }
3951
+ if (dist_x(l, h)) {
3952
+ if (H(l, h).isDirectory()) {
3953
+ const T = external_node_path_namespaceObject.join(h, se);
3954
+ if (dist_x(l, T)) {
3955
+ const v = te(T, "", !0, l);
3956
+ if (v && dist_x(l, v)) return v;
3957
+ }
3958
+ const d = external_node_path_namespaceObject.join(h, le);
3959
+ if (dist_x(l, d)) return d;
3960
+ } else if (D) return h;
3961
+ }
3962
+ }, "resolveExtendsPath"), oe = dist_r((e, t)=>X(external_node_path_namespaceObject.relative(e, t)), "pathRelative"), pe = [
3963
+ "files",
3964
+ "include",
3965
+ "exclude"
3966
+ ], dist_N = dist_r((e, t, l)=>{
3967
+ const n = external_node_path_namespaceObject.join(t, l), s = external_node_path_namespaceObject.relative(e, n);
3968
+ return L(s) || "./";
3969
+ }, "resolveAndRelativize"), Qe = dist_r((e, t, l)=>{
3970
+ const n = external_node_path_namespaceObject.relative(e, t);
3971
+ if (!n) return l;
3972
+ const s = l.startsWith("./") ? l.slice(2) : l;
3973
+ return L(`${n}/${s}`);
3974
+ }, "prefixPattern"), He = dist_r((e, t, l, n)=>{
3975
+ const s = Ge(e, t, n);
3976
+ if (!s) throw new Error(`File '${e}' not found.`);
3977
+ if (l.has(s)) throw new Error(`Circularity detected while resolving configuration: ${s}`);
3978
+ l.add(s);
3979
+ const i = external_node_path_namespaceObject.dirname(s), o = ve(s, n, l, !0);
3980
+ delete o.references;
3981
+ const { compilerOptions: f } = o;
3982
+ if (f) {
3983
+ const { baseUrl: u } = f;
3984
+ u && !u.startsWith(dist_E) && (f.baseUrl = dist_N(t, i, u));
3985
+ const { outDir: c } = f;
3986
+ c && !c.startsWith(dist_E) && (f.outDir = dist_N(t, i, c));
3987
+ const { declarationDir: w } = f;
3988
+ w && !w.startsWith(dist_E) && (f.declarationDir = dist_N(t, i, w));
3989
+ const { rootDir: p } = f;
3990
+ p && !p.startsWith(dist_E) && (f.rootDir = dist_N(t, i, p));
3991
+ const { rootDirs: _ } = f;
3992
+ _ && (f.rootDirs = _.map((D)=>D.startsWith(dist_E) ? D : dist_N(t, i, D)));
3993
+ const { typeRoots: h } = f;
3994
+ h && (f.typeRoots = h.map((D)=>D.startsWith(dist_E) ? D : dist_N(t, i, D)));
3995
+ }
3996
+ for (const u of pe){
3997
+ const c = o[u];
3998
+ c && (o[u] = c.map((w)=>w.startsWith(dist_E) ? w : Qe(t, i, w)));
3999
+ }
4000
+ return o;
4001
+ }, "resolveExtends"), be = [
4002
+ "outDir",
4003
+ "declarationDir"
4004
+ ], ve = dist_r((e, t, l = new Set, n = !1)=>{
4005
+ let s;
4006
+ try {
4007
+ s = we(e, t) || {};
4008
+ } catch {
4009
+ throw new Error(`Cannot resolve tsconfig at path: ${e}`);
4010
+ }
4011
+ if ("object" != typeof s) throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);
4012
+ const i = external_node_path_namespaceObject.dirname(e);
4013
+ if (s.compilerOptions) {
4014
+ const { compilerOptions: o } = s;
4015
+ o.paths && !o.baseUrl && (o[ne] = i);
4016
+ }
4017
+ if (s.extends) {
4018
+ const o = Array.isArray(s.extends) ? s.extends : [
4019
+ s.extends
4020
+ ];
4021
+ delete s.extends;
4022
+ for (const f of o.reverse()){
4023
+ const u = He(f, i, new Set(l), t), c = {
4024
+ ...u,
4025
+ ...s,
4026
+ compilerOptions: {
4027
+ ...u.compilerOptions,
4028
+ ...s.compilerOptions
4029
+ }
4030
+ };
4031
+ u.watchOptions && (c.watchOptions = {
4032
+ ...u.watchOptions,
4033
+ ...s.watchOptions
4034
+ }), s = c;
4035
+ }
4036
+ }
4037
+ if (s.compilerOptions) {
4038
+ const { compilerOptions: o } = s, f = [
4039
+ "baseUrl",
4040
+ "rootDir"
4041
+ ];
4042
+ for (const u of f){
4043
+ const c = o[u];
4044
+ if (c && !c.startsWith(dist_E)) {
4045
+ const w = external_node_path_namespaceObject.resolve(i, c), p = oe(i, w);
4046
+ o[u] = p;
4047
+ }
4048
+ }
4049
+ for (const u of be){
4050
+ let c = o[u];
4051
+ c && (n || Array.isArray(s.exclude) || (s.exclude = be.map((w)=>o[w]).filter(Boolean)), c.startsWith(dist_E) || (c = X(c)), o[u] = c);
4052
+ }
4053
+ } else s.compilerOptions = {};
4054
+ if (s.include && (s.include = s.include.map(L)), s.files && (s.files = s.files.map((o)=>o.startsWith(dist_E) ? o : X(o))), s.watchOptions) {
4055
+ const { watchOptions: o } = s;
4056
+ o.excludeDirectories && (o.excludeDirectories = o.excludeDirectories.map((f)=>L(external_node_path_namespaceObject.resolve(i, f)))), o.excludeFiles && (o.excludeFiles = o.excludeFiles.map((f)=>L(external_node_path_namespaceObject.resolve(i, f)))), o.watchFile && (o.watchFile = o.watchFile.toLowerCase()), o.watchDirectory && (o.watchDirectory = o.watchDirectory.toLowerCase()), o.fallbackPolling && (o.fallbackPolling = o.fallbackPolling.toLowerCase());
4057
+ }
4058
+ return s;
4059
+ }, "_parseTsconfig"), Z = dist_r((e, t)=>{
4060
+ if (e.startsWith(dist_E)) return L(external_node_path_namespaceObject.join(t, e.slice(dist_E.length)));
4061
+ }, "interpolateConfigDir"), Xe = [
4062
+ "outDir",
4063
+ "declarationDir",
4064
+ "outFile",
4065
+ "rootDir",
4066
+ "baseUrl",
4067
+ "tsBuildInfoFile"
4068
+ ], Ye = dist_r((e)=>{
4069
+ if (e.strict) {
4070
+ const a = [
4071
+ "noImplicitAny",
4072
+ "noImplicitThis",
4073
+ "strictNullChecks",
4074
+ "strictFunctionTypes",
4075
+ "strictBindCallApply",
4076
+ "strictPropertyInitialization",
4077
+ "strictBuiltinIteratorReturn",
4078
+ "alwaysStrict",
4079
+ "useUnknownInCatchVariables"
4080
+ ];
4081
+ for (const B of a)void 0 === e[B] && (e[B] = !0);
4082
+ }
4083
+ if (e.composite && (null != e.declaration || (e.declaration = !0), null != e.incremental || (e.incremental = !0)), e.target) {
4084
+ let a = e.target.toLowerCase();
4085
+ "es2015" === a && (a = "es6"), e.target = a, "esnext" === a && (null != e.module || (e.module = "es6"), null != e.useDefineForClassFields || (e.useDefineForClassFields = !0)), ("es6" === a || "es2016" === a || "es2017" === a || "es2018" === a || "es2019" === a || "es2020" === a || "es2021" === a || "es2022" === a || "es2023" === a || "es2024" === a) && (null != e.module || (e.module = "es6")), ("es2022" === a || "es2023" === a || "es2024" === a) && (null != e.useDefineForClassFields || (e.useDefineForClassFields = !0));
4086
+ }
4087
+ if (e.module) {
4088
+ let a = e.module.toLowerCase();
4089
+ if ("es2015" === a && (a = "es6"), e.module = a, ("es6" === a || "es2020" === a || "es2022" === a || "esnext" === a || "none" === a || "system" === a || "umd" === a || "amd" === a) && (null != e.moduleResolution || (e.moduleResolution = "classic")), "system" === a && (null != e.allowSyntheticDefaultImports || (e.allowSyntheticDefaultImports = !0)), ("node16" === a || "node18" === a || "node20" === a || "nodenext" === a || "preserve" === a) && (null != e.esModuleInterop || (e.esModuleInterop = !0), null != e.allowSyntheticDefaultImports || (e.allowSyntheticDefaultImports = !0)), ("node16" === a || "node18" === a || "node20" === a || "nodenext" === a) && (null != e.moduleDetection || (e.moduleDetection = "force")), "node16" === a && (null != e.target || (e.target = "es2022"), null != e.moduleResolution || (e.moduleResolution = "node16")), "node18" === a && (null != e.target || (e.target = "es2022"), null != e.moduleResolution || (e.moduleResolution = "node16")), "node20" === a && (null != e.target || (e.target = "es2023"), null != e.moduleResolution || (e.moduleResolution = "node16"), null != e.resolveJsonModule || (e.resolveJsonModule = !0)), "nodenext" === a && (null != e.target || (e.target = "esnext"), null != e.moduleResolution || (e.moduleResolution = "nodenext"), null != e.resolveJsonModule || (e.resolveJsonModule = !0)), "node16" === a || "node18" === a || "node20" === a || "nodenext" === a) {
4090
+ const B = e.target;
4091
+ ("es3" === B || "es2022" === B || "es2023" === B || "es2024" === B || "esnext" === B) && (null != e.useDefineForClassFields || (e.useDefineForClassFields = !0));
4092
+ }
4093
+ "preserve" === a && (null != e.moduleResolution || (e.moduleResolution = "bundler"));
4094
+ }
4095
+ if (e.moduleResolution) {
4096
+ let a = e.moduleResolution.toLowerCase();
4097
+ "node" === a && (a = "node10"), e.moduleResolution = a, ("node16" === a || "nodenext" === a || "bundler" === a) && (null != e.resolvePackageJsonExports || (e.resolvePackageJsonExports = !0), null != e.resolvePackageJsonImports || (e.resolvePackageJsonImports = !0)), "bundler" === a && (null != e.allowSyntheticDefaultImports || (e.allowSyntheticDefaultImports = !0), null != e.resolveJsonModule || (e.resolveJsonModule = !0));
4098
+ }
4099
+ e.jsx && (e.jsx = e.jsx.toLowerCase()), e.moduleDetection && (e.moduleDetection = e.moduleDetection.toLowerCase()), e.importsNotUsedAsValues && (e.importsNotUsedAsValues = e.importsNotUsedAsValues.toLowerCase()), e.newLine && (e.newLine = e.newLine.toLowerCase()), e.esModuleInterop && (null != e.allowSyntheticDefaultImports || (e.allowSyntheticDefaultImports = !0)), e.verbatimModuleSyntax && (null != e.isolatedModules || (e.isolatedModules = !0), null != e.preserveConstEnums || (e.preserveConstEnums = !0)), e.isolatedModules && (null != e.preserveConstEnums || (e.preserveConstEnums = !0)), e.rewriteRelativeImportExtensions && (null != e.allowImportingTsExtensions || (e.allowImportingTsExtensions = !0)), e.lib && (e.lib = e.lib.map((a)=>a.toLowerCase())), e.checkJs && (null != e.allowJs || (e.allowJs = !0));
4100
+ }, "normalizeCompilerOptions"), ie = dist_r((e, t = new Map)=>{
4101
+ const l = external_node_path_namespaceObject.resolve(e), n = ve(l, t), s = external_node_path_namespaceObject.dirname(l), { compilerOptions: i } = n;
4102
+ if (i) {
4103
+ for (const f of Xe){
4104
+ const u = i[f];
4105
+ if (u) {
4106
+ const c = Z(u, s);
4107
+ i[f] = c ? oe(s, c) : u;
4108
+ }
4109
+ }
4110
+ for (const f of [
4111
+ "rootDirs",
4112
+ "typeRoots"
4113
+ ]){
4114
+ const u = i[f];
4115
+ u && (i[f] = u.map((c)=>{
4116
+ const w = Z(c, s);
4117
+ return w ? oe(s, w) : X(c);
4118
+ }));
4119
+ }
4120
+ const { paths: o } = i;
4121
+ if (o) for (const f of Object.keys(o))o[f] = o[f].map((u)=>{
4122
+ var c;
4123
+ return null != (c = Z(u, s)) ? c : u;
4124
+ });
4125
+ Ye(i);
4126
+ }
4127
+ for (const o of pe){
4128
+ const f = n[o];
4129
+ f && (n[o] = f.map((u)=>{
4130
+ var c;
4131
+ return null != (c = Z(u, s)) ? c : u;
4132
+ }));
4133
+ }
4134
+ return n;
4135
+ }, "parseTsconfig");
4136
+ var Ze = Object.defineProperty, q = dist_r((e, t)=>Ze(e, "name", {
4137
+ value: t,
4138
+ configurable: !0
4139
+ }), "s");
4140
+ const Te = q((e)=>{
4141
+ let t = "";
4142
+ for(let l = 0; l < e.length; l += 1){
4143
+ const n = e[l], s = n.toUpperCase();
4144
+ t += n === s ? n.toLowerCase() : s;
4145
+ }
4146
+ return t;
4147
+ }, "invertCase"), dist_re = new Map, Ae = q((e, t)=>{
4148
+ const l = external_path_namespaceObject.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
4149
+ try {
4150
+ return t.writeFileSync(l, ""), !t.existsSync(Te(l));
4151
+ } finally{
4152
+ try {
4153
+ t.unlinkSync(l);
4154
+ } catch {}
4155
+ }
4156
+ }, "checkDirectoryCaseWithWrite"), qe = q((e, t, l)=>{
4157
+ try {
4158
+ return Ae(e, l);
4159
+ } catch (n) {
4160
+ if (void 0 === t) return Ae(external_os_namespaceObject.tmpdir(), l);
4161
+ throw n;
4162
+ }
4163
+ }, "checkDirectoryCaseWithFallback"), Ke = q((e, t = external_fs_namespaceObject, l = !0)=>{
4164
+ const n = null != e ? e : process.cwd();
4165
+ if (l && dist_re.has(n)) return dist_re.get(n);
4166
+ let s;
4167
+ const i = Te(n);
4168
+ return i !== n && t.existsSync(n) ? s = !t.existsSync(i) : s = qe(n, e, t), l && dist_re.set(n, s), s;
4169
+ }, "isFsCaseSensitive"), { join: Oe } = external_node_path_namespaceObject.posix, _e = dist_r((e, t)=>{
4170
+ const l = Oe(e, t);
4171
+ return e.startsWith("//") && !l.startsWith("//") ? `/${l}` : l;
4172
+ }, "pathJoin"), ue = {
4173
+ ts: [
4174
+ ".ts",
4175
+ ".tsx",
4176
+ ".d.ts"
4177
+ ],
4178
+ cts: [
4179
+ ".cts",
4180
+ ".d.cts"
4181
+ ],
4182
+ mts: [
4183
+ ".mts",
4184
+ ".d.mts"
4185
+ ]
4186
+ }, Ce = dist_r((e)=>{
4187
+ const t = [
4188
+ ...ue.ts
4189
+ ], l = [
4190
+ ...ue.cts
4191
+ ], n = [
4192
+ ...ue.mts
4193
+ ];
4194
+ return null != e && e.allowJs && (t.push(".js", ".jsx"), l.push(".cjs"), n.push(".mjs")), [
4195
+ ...t,
4196
+ ...l,
4197
+ ...n
4198
+ ];
4199
+ }, "getSupportedExtensions"), en = dist_r((e)=>{
4200
+ const t = [];
4201
+ if (!e) return t;
4202
+ const { outDir: l, declarationDir: n } = e;
4203
+ return l && t.push(l), n && t.push(n), t;
4204
+ }, "getDefaultExcludeSpec"), ye = dist_r((e)=>e.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`), "escapeForRegexp"), nn = [
4205
+ "node_modules",
4206
+ "bower_components",
4207
+ "jspm_packages"
4208
+ ], fe = `(?!(${nn.join("|")})(/|$))`, tn = /(?:^|\/)[^.*?]+$/, je = "**/*", K = "[^/]", ae = "[^./]", Fe = "win32" === process.platform, De = dist_r(({ config: e, path: t }, l = Ke())=>{
4209
+ if ("extends" in e) throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");
4210
+ if (!external_node_path_namespaceObject.isAbsolute(t)) throw new Error("The tsconfig path must be absolute");
4211
+ Fe && (t = L(t));
4212
+ const n = external_node_path_namespaceObject.dirname(t), { files: s, include: i, exclude: o, compilerOptions: f } = e, u = dist_r((d)=>external_node_path_namespaceObject.isAbsolute(d) ? d : _e(n, d), "resolvePattern"), c = null == s ? void 0 : s.map(u), w = Ce(f), p = l ? "" : "i", h = (o || en(f)).map((d)=>{
4213
+ const v = u(d), $ = ye(v).replaceAll(String.raw`\*\*/`, "(.+/)?").replaceAll(String.raw`\*`, `${K}*`).replaceAll(String.raw`\?`, K);
4214
+ return new RegExp(`^${$}($|/)`, p);
4215
+ }), D = s || i ? i : [
4216
+ je
4217
+ ], T = D ? D.map((d)=>{
4218
+ let v = u(d);
4219
+ tn.test(v) && (v = _e(v, je));
4220
+ const $ = ye(v).replaceAll(String.raw`/\*\*`, `(/${fe}${ae}${K}*)*?`).replaceAll(/(\/)?\\\*/g, (g, j)=>{
4221
+ const y = `(${ae}|(\\.(?!min\\.js$))?)*`;
4222
+ return j ? `/${fe}${ae}${y}` : y;
4223
+ }).replaceAll(/(\/)?\\\?/g, (g, j)=>{
4224
+ const y = K;
4225
+ return j ? `/${fe}${y}` : y;
4226
+ });
4227
+ return new RegExp(`^${$}$`, p);
4228
+ }) : void 0;
4229
+ return (d)=>{
4230
+ if (!external_node_path_namespaceObject.isAbsolute(d)) throw new Error("filePath must be absolute");
4231
+ if (Fe && (d = L(d)), null != c && c.includes(d)) return e;
4232
+ if (!(!w.some((v)=>d.endsWith(v)) || h.some((v)=>v.test(d))) && T && T.some((v)=>v.test(d))) return e;
4233
+ };
4234
+ }, "createFilesMatcher"), he = dist_r((e, t, l)=>{
4235
+ const n = external_node_path_namespaceObject.resolve(e);
4236
+ let s = L(e);
4237
+ for(;;){
4238
+ const i = dist_O(s, t, l);
4239
+ if (!i) return;
4240
+ const o = external_node_path_namespaceObject.resolve(i), f = ie(o, l), u = {
4241
+ path: L(o),
4242
+ config: f
4243
+ };
4244
+ if (De(u)(n)) return u;
4245
+ const w = external_node_path_namespaceObject.dirname(i), p = external_node_path_namespaceObject.dirname(w);
4246
+ if (p === w) return;
4247
+ s = p;
4248
+ }
4249
+ }, "findConfigApplicable"), Le = dist_r((e = process.cwd(), t = "tsconfig.json", l = new Map, n = !1)=>{
4250
+ var s;
4251
+ return n ? null == (s = he(e, t, l)) ? void 0 : s.path : dist_O(L(e), t, l);
4252
+ }, "findTsconfig"), ln = (dist_r((e = process.cwd(), t = "tsconfig.json", l = new Map, n = !1)=>{
4253
+ var s;
4254
+ if (!n) {
4255
+ const i = Le(e, t, l);
4256
+ if (!i) return null;
4257
+ const o = ie(i, l);
4258
+ return {
4259
+ path: i,
4260
+ config: o
4261
+ };
4262
+ }
4263
+ return null != (s = he(e, t, l)) ? s : null;
4264
+ }, "getTsconfig"), /\*/g), Ee = dist_r((e, t)=>{
4265
+ const l = e.match(ln);
4266
+ if (l && l.length > 1) throw new Error(t);
4267
+ }, "assertStarCount"), on = dist_r((e)=>{
4268
+ if (e.includes("*")) {
4269
+ const [t, l] = e.split("*");
4270
+ return {
4271
+ prefix: t,
4272
+ suffix: l
4273
+ };
4274
+ }
4275
+ return e;
4276
+ }, "parsePattern"), rn = dist_r(({ prefix: e, suffix: t }, l)=>l.startsWith(e) && l.endsWith(t), "isPatternMatch"), un = dist_r((e, t, l)=>Object.entries(e).map(([n, s])=>(Ee(n, `Pattern '${n}' can have at most one '*' character.`), {
4277
+ pattern: on(n),
4278
+ substitutions: s.map((i)=>{
4279
+ if (Ee(i, `Substitution '${i}' in pattern '${n}' can have at most one '*' character.`), !t && !C.test(i) && !external_node_path_namespaceObject.isAbsolute(i)) throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");
4280
+ return external_node_path_namespaceObject.resolve(l, i);
4281
+ })
4282
+ })), "parsePaths");
4283
+ dist_r((e)=>{
4284
+ const { compilerOptions: t } = e.config;
4285
+ if (!t) return null;
4286
+ const { baseUrl: l, paths: n } = t;
4287
+ if (!l && !n) return null;
4288
+ const s = ne in t && t[ne], i = external_node_path_namespaceObject.resolve(external_node_path_namespaceObject.dirname(e.path), l || s || "."), o = n ? un(n, l, i) : [];
4289
+ return (f)=>{
4290
+ if (C.test(f)) return [];
4291
+ const u = [];
4292
+ for (const _ of o){
4293
+ if (_.pattern === f) return _.substitutions.map(L);
4294
+ "string" != typeof _.pattern && u.push(_);
4295
+ }
4296
+ let c, w = -1;
4297
+ for (const _ of u)rn(_.pattern, f) && _.pattern.prefix.length > w && (w = _.pattern.prefix.length, c = _);
4298
+ if (!c) return l ? [
4299
+ L(external_node_path_namespaceObject.join(i, f))
4300
+ ] : [];
4301
+ const p = f.slice(c.pattern.prefix.length, f.length - c.pattern.suffix.length);
4302
+ return c.substitutions.map((_)=>L(_.replace("*", p)));
4303
+ };
4304
+ }, "createPathsMatcher");
3331
4305
  class AbortError extends Error {
3332
4306
  static throwIfAborted(signal) {
3333
4307
  if (signal?.aborted) throw new AbortError();
@@ -3341,6 +4315,32 @@ var __webpack_exports__ = {};
3341
4315
  const TYPESCRIPT_PACKAGE_JSON = `${TYPESCRIPT_PACKAGE}/package.json`;
3342
4316
  const TYPESCRIPT_PREVIEW_PACKAGE = "@typescript/native-preview";
3343
4317
  const TYPESCRIPT_PREVIEW_PACKAGE_JSON = `${TYPESCRIPT_PREVIEW_PACKAGE}/package.json`;
4318
+ function readTsgoPackageJson(packageJsonPath) {
4319
+ return require(packageJsonPath);
4320
+ }
4321
+ function getTsgoPackage(packageJson) {
4322
+ if (packageJson.name === TYPESCRIPT_PACKAGE) {
4323
+ const versionMatch = packageJson.version?.match(/^(\d+)\.(\d+)(?:\.|$|-)/);
4324
+ if (versionMatch && Number(versionMatch[1]) >= 7) return "typescript";
4325
+ }
4326
+ if (packageJson.name === TYPESCRIPT_PREVIEW_PACKAGE) return 'preview';
4327
+ }
4328
+ function resolveTypeScriptGoPackage(packageJsonPath) {
4329
+ if (!external_node_path_default().isAbsolute(packageJsonPath) || 'package.json' !== external_node_path_default().basename(packageJsonPath)) return;
4330
+ try {
4331
+ const tsgoPackage = getTsgoPackage(readTsgoPackageJson(packageJsonPath));
4332
+ return tsgoPackage ? {
4333
+ packageJsonPath,
4334
+ tsgoPackage
4335
+ } : void 0;
4336
+ } catch {
4337
+ return;
4338
+ }
4339
+ }
4340
+ function supportsContentMappers(config) {
4341
+ const [major = 0, minor = 0] = (readTsgoPackageJson(config.typescriptPath).version || '').split('.').map(Number);
4342
+ return major > 7 || 7 === major && minor >= 1;
4343
+ }
3344
4344
  function resolveTypeScriptGoPackageJsonPath(config) {
3345
4345
  if (!external_node_path_default().isAbsolute(config.typescriptPath) || 'package.json' !== external_node_path_default().basename(config.typescriptPath)) throw new Error("The typescriptPath option must be an absolute path to a package.json file when tsgo is enabled.");
3346
4346
  if (!config.tsgoPackage) throw new Error(`The typescriptPath option must point to "${TYPESCRIPT_PREVIEW_PACKAGE_JSON}" or "${TYPESCRIPT_PACKAGE}@>=7".`);
@@ -3512,10 +4512,14 @@ var __webpack_exports__ = {};
3512
4512
  const message = error?.message;
3513
4513
  return 'string' == typeof message && message.includes("TSGO:");
3514
4514
  }
3515
- async function runTypeScriptGo(config, logger, defaultSeverity = 'auto', signal, emittedFiles) {
4515
+ async function runTypeScriptGo(config, logger, defaultSeverity = 'auto', signal, emittedFiles, dependencies) {
3516
4516
  AbortError.throwIfAborted(signal);
3517
4517
  const executable = await resolveTypeScriptGoExecutable(config);
3518
4518
  const args = createTypeScriptGoArgs(config);
4519
+ if (supportsContentMappers(config)) {
4520
+ const resolvedDependencies = await dependencies || await getTypeScriptGoDependencies(config);
4521
+ if (resolvedDependencies.contentMappers) args.push('--runExternalCode');
4522
+ }
3519
4523
  if (emittedFiles) args.push('--listEmittedFiles');
3520
4524
  AbortError.throwIfAborted(signal);
3521
4525
  return new Promise((resolve, reject)=>{
@@ -3586,6 +4590,8 @@ var __webpack_exports__ = {};
3586
4590
  const dirs = new Set();
3587
4591
  const excluded = new Set();
3588
4592
  const visitedConfigs = new Set();
4593
+ const canRunContentMappers = supportsContentMappers(config);
4594
+ let contentMappers;
3589
4595
  const collectConfigDependencies = async (configFile, fallbackRoot, collectExcluded)=>{
3590
4596
  const normalizedConfigFile = external_node_path_default().normalize(configFile);
3591
4597
  const configKey = toComparisonPath(normalizedConfigFile);
@@ -3596,6 +4602,18 @@ var __webpack_exports__ = {};
3596
4602
  files.add(normalizedConfigFile);
3597
4603
  if (!Array.from(dirs).some((dir)=>'' === external_node_path_default().relative(dir, normalizedRoot) || isInsideAnotherPath(dir, normalizedRoot))) dirs.add(normalizedRoot);
3598
4604
  excluded.add(external_node_path_default().join(normalizedRoot, 'node_modules'));
4605
+ if (canRunContentMappers) try {
4606
+ const resolvedConfig = ie(normalizedConfigFile);
4607
+ const mappers = 'contentMappers' in resolvedConfig ? resolvedConfig.contentMappers : void 0;
4608
+ if (Array.isArray(mappers) && mappers.length) {
4609
+ contentMappers ||= {
4610
+ extensions: []
4611
+ };
4612
+ for (const mapper of mappers)if (Array.isArray(mapper?.extensions)) {
4613
+ for (const extension of mapper.extensions)if ('string' == typeof extension && extension.length > 0 && !contentMappers.extensions.includes(extension)) contentMappers.extensions.push(extension);
4614
+ }
4615
+ }
4616
+ } catch {}
3599
4617
  let parsedConfig;
3600
4618
  try {
3601
4619
  parsedConfig = await runTypeScriptGoShowConfig(executable, normalizedConfigFile);
@@ -3625,7 +4643,10 @@ var __webpack_exports__ = {};
3625
4643
  '.mjs',
3626
4644
  '.cjs',
3627
4645
  '.json'
3628
- ]
4646
+ ],
4647
+ ...contentMappers ? {
4648
+ contentMappers
4649
+ } : {}
3629
4650
  };
3630
4651
  }
3631
4652
  function _define_property(obj, key, value) {
@@ -3743,7 +4764,7 @@ var __webpack_exports__ = {};
3743
4764
  if (this.paused) return;
3744
4765
  const extension = (0, external_node_path_namespaceObject.extname)(file);
3745
4766
  const supportedExtensions = this.pluginState.lastDependencies?.extensions || [];
3746
- if (!supportedExtensions.includes(extension)) return void debug('Detected new file add but extension is not supported', file);
4767
+ if (!supportedExtensions.includes(extension) && !isContentMapperFile(file, this.pluginState.lastDependencies?.contentMappers)) return void debug('Detected new file add but extension is not supported', file);
3747
4768
  this.deletedFiles.delete(file);
3748
4769
  if (this.pluginState.emittedFiles) {
3749
4770
  await this.pluginState.issuesPromise.catch(()=>void 0);
@@ -3766,7 +4787,7 @@ var __webpack_exports__ = {};
3766
4787
  this.pluginState.emittedFiles?.delete(toComparisonPath(file));
3767
4788
  const extension = (0, external_node_path_namespaceObject.extname)(file);
3768
4789
  const supportedExtensions = this.pluginState.lastDependencies?.extensions || [];
3769
- if (!supportedExtensions.includes(extension)) return void debug('Detected new file remove but extension is not supported', file);
4790
+ if (!supportedExtensions.includes(extension) && !isContentMapperFile(file, this.pluginState.lastDependencies?.contentMappers)) return void debug('Detected new file remove but extension is not supported', file);
3770
4791
  if (this.deletedFiles.has(file)) return void debug('Skipping duplicated unlink event.');
3771
4792
  debug('Detected new file remove', file);
3772
4793
  this.deletedFiles.add(file);
@@ -4286,28 +5307,6 @@ var __webpack_exports__ = {};
4286
5307
  });
4287
5308
  });
4288
5309
  }
4289
- function readTsgoPackageJson(packageJsonPath) {
4290
- return require(packageJsonPath);
4291
- }
4292
- function getTsgoPackage(packageJson) {
4293
- if (packageJson.name === TYPESCRIPT_PACKAGE) {
4294
- const versionMatch = packageJson.version?.match(/^(\d+)\.(\d+)(?:\.|$|-)/);
4295
- if (versionMatch && Number(versionMatch[1]) >= 7) return "typescript";
4296
- }
4297
- if (packageJson.name === TYPESCRIPT_PREVIEW_PACKAGE) return 'preview';
4298
- }
4299
- function resolveTypeScriptGoPackage(packageJsonPath) {
4300
- if (!external_node_path_default().isAbsolute(packageJsonPath) || 'package.json' !== external_node_path_default().basename(packageJsonPath)) return;
4301
- try {
4302
- const tsgoPackage = getTsgoPackage(readTsgoPackageJson(packageJsonPath));
4303
- return tsgoPackage ? {
4304
- packageJsonPath,
4305
- tsgoPackage
4306
- } : void 0;
4307
- } catch {
4308
- return;
4309
- }
4310
- }
4311
5310
  function isDefaultTypeScriptGoPath(typescriptPath) {
4312
5311
  if (typescriptPath === TYPESCRIPT_PREVIEW_PACKAGE_JSON) return true;
4313
5312
  try {
@@ -4442,7 +5441,7 @@ var __webpack_exports__ = {};
4442
5441
  ...compiler.modifiedFiles || []
4443
5442
  ];
4444
5443
  const dependencyPaths = new Set(state.lastDependencies?.files.map((file)=>toComparisonPath(file)));
4445
- if (state.watching && canReuseIssues && state.lastDependencies && 0 === hooks.start.taps.length && !filesChange.deletedFiles?.length && !compiler.removedFiles?.size && changedFiles.length > 0 && changedFiles.every((file)=>STYLE_FILE.test(file) && !dependencyPaths.has(toComparisonPath(file)))) {
5444
+ if (state.watching && canReuseIssues && state.lastDependencies && 0 === hooks.start.taps.length && !filesChange.deletedFiles?.length && !compiler.removedFiles?.size && changedFiles.length > 0 && changedFiles.every((file)=>STYLE_FILE.test(file) && !dependencyPaths.has(toComparisonPath(file)) && !isContentMapperFile(file, state.lastDependencies.contentMappers))) {
4446
5445
  debug('Reusing tsgo issues for style-only changes.');
4447
5446
  state.issuesPromise = state.issuesPromise.then((issues)=>issues);
4448
5447
  return;
@@ -4460,7 +5459,7 @@ var __webpack_exports__ = {};
4460
5459
  ].join('\n')) : log('Calling tsgo for single check.');
4461
5460
  const cacheGeneration = ++dependenciesCacheGeneration;
4462
5461
  const startPromise = hooks.start.promise(filesChange, compilation);
4463
- state.dependenciesPromise = startPromise.then((nextFilesChange)=>{
5462
+ const currentDependenciesPromise = startPromise.then((nextFilesChange)=>{
4464
5463
  if (cacheGeneration !== dependenciesCacheGeneration) return;
4465
5464
  if (state.watching && dependenciesPromise && !shouldRefreshTypeScriptGoDependencies(state.lastDependencies, nextFilesChange)) {
4466
5465
  debug(`Reusing cached tsgo dependencies, iteration ${iteration}.`);
@@ -4478,6 +5477,7 @@ var __webpack_exports__ = {};
4478
5477
  }
4479
5478
  return nextDependenciesPromise;
4480
5479
  });
5480
+ state.dependenciesPromise = currentDependenciesPromise;
4481
5481
  filesChange = await startPromise;
4482
5482
  let aggregatedFilesChange = filesChange;
4483
5483
  if (state.aggregatedFilesChange) {
@@ -4502,7 +5502,7 @@ var __webpack_exports__ = {};
4502
5502
  try {
4503
5503
  if (iteration !== state.iteration) return;
4504
5504
  debug(`Running tsgo, iteration ${iteration}.`);
4505
- const issues = await runTypeScriptGo(config.typescript, config.logger, config.issue.defaultSeverity, signal, state.emittedFiles);
5505
+ const issues = await runTypeScriptGo(config.typescript, config.logger, config.issue.defaultSeverity, signal, state.emittedFiles, currentDependenciesPromise);
4506
5506
  if (iteration !== state.iteration) return;
4507
5507
  if (state.aggregatedFilesChange === aggregatedFilesChange) state.aggregatedFilesChange = void 0;
4508
5508
  if (state.abortController === abortController) {
@@ -18,6 +18,6 @@ declare function parseTypeScriptGoIssues(output: string, config: TypeScriptWorke
18
18
  declare function createTypeScriptGoExitIssues(output: string, signal: NodeJS.Signals | null, config: TypeScriptWorkerConfig, defaultSeverity?: IssueDefaultSeverity): Issue[];
19
19
  declare function isTypeScriptGoIssue(issue: Issue): boolean;
20
20
  declare function isTypeScriptGoStatsError(error: unknown): boolean;
21
- declare function runTypeScriptGo(config: TypeScriptWorkerConfig, logger: Pick<Logger, 'error'>, defaultSeverity?: IssueDefaultSeverity, signal?: AbortSignal, emittedFiles?: Map<string, number>): Promise<Issue[]>;
21
+ declare function runTypeScriptGo(config: TypeScriptWorkerConfig, logger: Pick<Logger, 'error'>, defaultSeverity?: IssueDefaultSeverity, signal?: AbortSignal, emittedFiles?: Map<string, number>, dependencies?: FilesMatch | Promise<FilesMatch | undefined>): Promise<Issue[]>;
22
22
  declare function getTypeScriptGoDependencies(config: TypeScriptWorkerConfig): Promise<FilesMatch>;
23
23
  export { createTypeScriptGoArgs, createTypeScriptGoExitIssues, getTypeScriptGoDependencies, getTypeScriptGoErrorCount, isTypeScriptGoIssue, isTypeScriptGoStatsError, parseTypeScriptGoIssues, resolveTypeScriptGoExecutable, resolveTypeScriptGoBinPath, resolveTypeScriptGoPackageJsonPath, runTypeScriptGo, shouldRefreshTypeScriptGoDependencies, toComparisonPath, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-checker-rspack-plugin",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "rspack",
@@ -37,11 +37,13 @@
37
37
  "@types/node": "^24.19.2",
38
38
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
39
39
  "cross-env": "^10.1.0",
40
+ "get-tsconfig": "4.14.3",
40
41
  "is-glob": "^4.0.3",
41
42
  "minimatch": "^10.2.6",
42
43
  "rstack": "^0.8.3",
43
44
  "strip-ansi": "^7.2.0",
44
- "typescript": "^6.0.3"
45
+ "typescript": "^6.0.3",
46
+ "typescript-7-1": "npm:typescript@7.1.0-beta"
45
47
  },
46
48
  "peerDependencies": {
47
49
  "@rspack/core": "^1.0.0 || ^2.0.0",