knip 5.61.3 → 5.63.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.
Files changed (77) hide show
  1. package/README.md +22 -24
  2. package/dist/ConfigurationChief.d.ts +3 -0
  3. package/dist/ConfigurationChief.js +14 -6
  4. package/dist/IssueCollector.js +1 -1
  5. package/dist/ProjectPrincipal.d.ts +1 -0
  6. package/dist/ProjectPrincipal.js +9 -3
  7. package/dist/binaries/fallback.js +4 -2
  8. package/dist/binaries/package-manager/bun.js +15 -1
  9. package/dist/cli.js +3 -2
  10. package/dist/compilers/index.d.ts +20 -0
  11. package/dist/graph/analyze.js +1 -1
  12. package/dist/graph/build.js +19 -9
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +2 -1
  15. package/dist/plugins/angular/index.js +6 -2
  16. package/dist/plugins/astro/index.d.ts +1 -0
  17. package/dist/plugins/astro/index.js +7 -7
  18. package/dist/plugins/astro/resolveFromAST.js +1 -2
  19. package/dist/plugins/biome/index.js +10 -2
  20. package/dist/plugins/eslint/helpers.js +2 -1
  21. package/dist/plugins/index.d.ts +19 -1
  22. package/dist/plugins/index.js +4 -0
  23. package/dist/plugins/lefthook/index.js +2 -0
  24. package/dist/plugins/node-modules-inspector/index.d.ts +12 -0
  25. package/dist/plugins/node-modules-inspector/index.js +17 -0
  26. package/dist/plugins/playwright/index.js +8 -1
  27. package/dist/plugins/playwright/types.d.ts +20 -14
  28. package/dist/plugins/postcss/index.js +1 -1
  29. package/dist/plugins/preconstruct/index.js +2 -1
  30. package/dist/plugins/react-router/index.js +18 -8
  31. package/dist/plugins/rsbuild/index.js +11 -2
  32. package/dist/plugins/rsbuild/types.d.ts +8 -0
  33. package/dist/plugins/rslib/index.d.ts +10 -0
  34. package/dist/plugins/rslib/index.js +15 -0
  35. package/dist/plugins/rslib/types.d.ts +1 -0
  36. package/dist/plugins/rslib/types.js +1 -0
  37. package/dist/plugins/rspack/index.js +1 -1
  38. package/dist/plugins/size-limit/index.js +1 -1
  39. package/dist/plugins/typescript/index.d.ts +1 -1
  40. package/dist/plugins/vitest/index.js +41 -1
  41. package/dist/plugins/vitest/types.d.ts +5 -0
  42. package/dist/reporters/symbols.js +3 -1
  43. package/dist/reporters/util/configuration-hints.d.ts +1 -1
  44. package/dist/reporters/util/configuration-hints.js +55 -19
  45. package/dist/reporters/util/util.d.ts +0 -2
  46. package/dist/reporters/util/util.js +2 -2
  47. package/dist/schema/configuration.d.ts +112 -0
  48. package/dist/schema/plugins.d.ts +46 -0
  49. package/dist/schema/plugins.js +2 -0
  50. package/dist/types/PluginNames.d.ts +2 -2
  51. package/dist/types/PluginNames.js +2 -0
  52. package/dist/types/entries.d.ts +3 -0
  53. package/dist/types/entries.js +1 -0
  54. package/dist/types/issues.d.ts +3 -1
  55. package/dist/types/package-json.d.ts +4 -0
  56. package/dist/types/tsconfig-json.d.ts +14 -0
  57. package/dist/types/tsconfig-json.js +1 -0
  58. package/dist/typescript/ast-helpers.js +2 -2
  59. package/dist/util/fs.d.ts +1 -1
  60. package/dist/util/glob-core.d.ts +1 -1
  61. package/dist/util/glob-core.js +8 -7
  62. package/dist/util/glob.d.ts +1 -0
  63. package/dist/util/glob.js +1 -1
  64. package/dist/util/is-identifier-referenced.js +17 -17
  65. package/dist/util/package-json.d.ts +2 -1
  66. package/dist/util/package-json.js +24 -12
  67. package/dist/util/parse-and-convert-gitignores.js +2 -0
  68. package/dist/util/plugin-config.js +1 -1
  69. package/dist/util/reporter.js +3 -3
  70. package/dist/util/resolve.js +1 -1
  71. package/dist/util/table.js +1 -3
  72. package/dist/version.d.ts +1 -1
  73. package/dist/version.js +1 -1
  74. package/package.json +9 -14
  75. package/schema.json +8 -0
  76. /package/dist/util/{tsconfig-loader.d.ts → load-tsconfig.d.ts} +0 -0
  77. /package/dist/util/{tsconfig-loader.js → load-tsconfig.js} +0 -0
@@ -696,6 +696,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
696
696
  entry?: string | string[] | undefined;
697
697
  project?: string | string[] | undefined;
698
698
  }>]>>;
699
+ 'node-modules-inspector': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
700
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
701
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
702
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
703
+ }, "strip", z.ZodTypeAny, {
704
+ config?: string | string[] | undefined;
705
+ entry?: string | string[] | undefined;
706
+ project?: string | string[] | undefined;
707
+ }, {
708
+ config?: string | string[] | undefined;
709
+ entry?: string | string[] | undefined;
710
+ project?: string | string[] | undefined;
711
+ }>]>>;
699
712
  nodemon: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
700
713
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
701
714
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -995,6 +1008,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
995
1008
  entry?: string | string[] | undefined;
996
1009
  project?: string | string[] | undefined;
997
1010
  }>]>>;
1011
+ rslib: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1012
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1013
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1014
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1015
+ }, "strip", z.ZodTypeAny, {
1016
+ config?: string | string[] | undefined;
1017
+ entry?: string | string[] | undefined;
1018
+ project?: string | string[] | undefined;
1019
+ }, {
1020
+ config?: string | string[] | undefined;
1021
+ entry?: string | string[] | undefined;
1022
+ project?: string | string[] | undefined;
1023
+ }>]>>;
998
1024
  rspack: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
999
1025
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1000
1026
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1708,6 +1734,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1708
1734
  entry?: string | string[] | undefined;
1709
1735
  project?: string | string[] | undefined;
1710
1736
  } | undefined;
1737
+ 'node-modules-inspector'?: string | boolean | string[] | {
1738
+ config?: string | string[] | undefined;
1739
+ entry?: string | string[] | undefined;
1740
+ project?: string | string[] | undefined;
1741
+ } | undefined;
1711
1742
  nodemon?: string | boolean | string[] | {
1712
1743
  config?: string | string[] | undefined;
1713
1744
  entry?: string | string[] | undefined;
@@ -1823,6 +1854,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
1823
1854
  entry?: string | string[] | undefined;
1824
1855
  project?: string | string[] | undefined;
1825
1856
  } | undefined;
1857
+ rslib?: string | boolean | string[] | {
1858
+ config?: string | string[] | undefined;
1859
+ entry?: string | string[] | undefined;
1860
+ project?: string | string[] | undefined;
1861
+ } | undefined;
1826
1862
  rspack?: string | boolean | string[] | {
1827
1863
  config?: string | string[] | undefined;
1828
1864
  entry?: string | string[] | undefined;
@@ -2263,6 +2299,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
2263
2299
  entry?: string | string[] | undefined;
2264
2300
  project?: string | string[] | undefined;
2265
2301
  } | undefined;
2302
+ 'node-modules-inspector'?: string | boolean | string[] | {
2303
+ config?: string | string[] | undefined;
2304
+ entry?: string | string[] | undefined;
2305
+ project?: string | string[] | undefined;
2306
+ } | undefined;
2266
2307
  nodemon?: string | boolean | string[] | {
2267
2308
  config?: string | string[] | undefined;
2268
2309
  entry?: string | string[] | undefined;
@@ -2378,6 +2419,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
2378
2419
  entry?: string | string[] | undefined;
2379
2420
  project?: string | string[] | undefined;
2380
2421
  } | undefined;
2422
+ rslib?: string | boolean | string[] | {
2423
+ config?: string | string[] | undefined;
2424
+ entry?: string | string[] | undefined;
2425
+ project?: string | string[] | undefined;
2426
+ } | undefined;
2381
2427
  rspack?: string | boolean | string[] | {
2382
2428
  config?: string | string[] | undefined;
2383
2429
  entry?: string | string[] | undefined;
@@ -3225,6 +3271,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
3225
3271
  entry?: string | string[] | undefined;
3226
3272
  project?: string | string[] | undefined;
3227
3273
  }>]>>;
3274
+ 'node-modules-inspector': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3275
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3276
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3277
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3278
+ }, "strip", z.ZodTypeAny, {
3279
+ config?: string | string[] | undefined;
3280
+ entry?: string | string[] | undefined;
3281
+ project?: string | string[] | undefined;
3282
+ }, {
3283
+ config?: string | string[] | undefined;
3284
+ entry?: string | string[] | undefined;
3285
+ project?: string | string[] | undefined;
3286
+ }>]>>;
3228
3287
  nodemon: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3229
3288
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3230
3289
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3524,6 +3583,19 @@ export declare const knipConfigurationSchema: z.ZodObject<{
3524
3583
  entry?: string | string[] | undefined;
3525
3584
  project?: string | string[] | undefined;
3526
3585
  }>]>>;
3586
+ rslib: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3587
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3588
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3589
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3590
+ }, "strip", z.ZodTypeAny, {
3591
+ config?: string | string[] | undefined;
3592
+ entry?: string | string[] | undefined;
3593
+ project?: string | string[] | undefined;
3594
+ }, {
3595
+ config?: string | string[] | undefined;
3596
+ entry?: string | string[] | undefined;
3597
+ project?: string | string[] | undefined;
3598
+ }>]>>;
3527
3599
  rspack: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3528
3600
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3529
3601
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -4240,6 +4312,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4240
4312
  entry?: string | string[] | undefined;
4241
4313
  project?: string | string[] | undefined;
4242
4314
  } | undefined;
4315
+ 'node-modules-inspector'?: string | boolean | string[] | {
4316
+ config?: string | string[] | undefined;
4317
+ entry?: string | string[] | undefined;
4318
+ project?: string | string[] | undefined;
4319
+ } | undefined;
4243
4320
  nodemon?: string | boolean | string[] | {
4244
4321
  config?: string | string[] | undefined;
4245
4322
  entry?: string | string[] | undefined;
@@ -4355,6 +4432,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4355
4432
  entry?: string | string[] | undefined;
4356
4433
  project?: string | string[] | undefined;
4357
4434
  } | undefined;
4435
+ rslib?: string | boolean | string[] | {
4436
+ config?: string | string[] | undefined;
4437
+ entry?: string | string[] | undefined;
4438
+ project?: string | string[] | undefined;
4439
+ } | undefined;
4358
4440
  rspack?: string | boolean | string[] | {
4359
4441
  config?: string | string[] | undefined;
4360
4442
  entry?: string | string[] | undefined;
@@ -4803,6 +4885,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4803
4885
  entry?: string | string[] | undefined;
4804
4886
  project?: string | string[] | undefined;
4805
4887
  } | undefined;
4888
+ 'node-modules-inspector'?: string | boolean | string[] | {
4889
+ config?: string | string[] | undefined;
4890
+ entry?: string | string[] | undefined;
4891
+ project?: string | string[] | undefined;
4892
+ } | undefined;
4806
4893
  nodemon?: string | boolean | string[] | {
4807
4894
  config?: string | string[] | undefined;
4808
4895
  entry?: string | string[] | undefined;
@@ -4918,6 +5005,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
4918
5005
  entry?: string | string[] | undefined;
4919
5006
  project?: string | string[] | undefined;
4920
5007
  } | undefined;
5008
+ rslib?: string | boolean | string[] | {
5009
+ config?: string | string[] | undefined;
5010
+ entry?: string | string[] | undefined;
5011
+ project?: string | string[] | undefined;
5012
+ } | undefined;
4921
5013
  rspack?: string | boolean | string[] | {
4922
5014
  config?: string | string[] | undefined;
4923
5015
  entry?: string | string[] | undefined;
@@ -5362,6 +5454,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
5362
5454
  entry?: string | string[] | undefined;
5363
5455
  project?: string | string[] | undefined;
5364
5456
  } | undefined;
5457
+ 'node-modules-inspector'?: string | boolean | string[] | {
5458
+ config?: string | string[] | undefined;
5459
+ entry?: string | string[] | undefined;
5460
+ project?: string | string[] | undefined;
5461
+ } | undefined;
5365
5462
  nodemon?: string | boolean | string[] | {
5366
5463
  config?: string | string[] | undefined;
5367
5464
  entry?: string | string[] | undefined;
@@ -5477,6 +5574,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
5477
5574
  entry?: string | string[] | undefined;
5478
5575
  project?: string | string[] | undefined;
5479
5576
  } | undefined;
5577
+ rslib?: string | boolean | string[] | {
5578
+ config?: string | string[] | undefined;
5579
+ entry?: string | string[] | undefined;
5580
+ project?: string | string[] | undefined;
5581
+ } | undefined;
5480
5582
  rspack?: string | boolean | string[] | {
5481
5583
  config?: string | string[] | undefined;
5482
5584
  entry?: string | string[] | undefined;
@@ -5925,6 +6027,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
5925
6027
  entry?: string | string[] | undefined;
5926
6028
  project?: string | string[] | undefined;
5927
6029
  } | undefined;
6030
+ 'node-modules-inspector'?: string | boolean | string[] | {
6031
+ config?: string | string[] | undefined;
6032
+ entry?: string | string[] | undefined;
6033
+ project?: string | string[] | undefined;
6034
+ } | undefined;
5928
6035
  nodemon?: string | boolean | string[] | {
5929
6036
  config?: string | string[] | undefined;
5930
6037
  entry?: string | string[] | undefined;
@@ -6040,6 +6147,11 @@ export declare const knipConfigurationSchema: z.ZodObject<{
6040
6147
  entry?: string | string[] | undefined;
6041
6148
  project?: string | string[] | undefined;
6042
6149
  } | undefined;
6150
+ rslib?: string | boolean | string[] | {
6151
+ config?: string | string[] | undefined;
6152
+ entry?: string | string[] | undefined;
6153
+ project?: string | string[] | undefined;
6154
+ } | undefined;
6043
6155
  rspack?: string | boolean | string[] | {
6044
6156
  config?: string | string[] | undefined;
6045
6157
  entry?: string | string[] | undefined;
@@ -677,6 +677,19 @@ export declare const pluginsSchema: z.ZodObject<{
677
677
  entry?: string | string[] | undefined;
678
678
  project?: string | string[] | undefined;
679
679
  }>]>;
680
+ 'node-modules-inspector': z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
681
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
682
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
683
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ config?: string | string[] | undefined;
686
+ entry?: string | string[] | undefined;
687
+ project?: string | string[] | undefined;
688
+ }, {
689
+ config?: string | string[] | undefined;
690
+ entry?: string | string[] | undefined;
691
+ project?: string | string[] | undefined;
692
+ }>]>;
680
693
  nodemon: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
681
694
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
682
695
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -976,6 +989,19 @@ export declare const pluginsSchema: z.ZodObject<{
976
989
  entry?: string | string[] | undefined;
977
990
  project?: string | string[] | undefined;
978
991
  }>]>;
992
+ rslib: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
993
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
994
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
995
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
996
+ }, "strip", z.ZodTypeAny, {
997
+ config?: string | string[] | undefined;
998
+ entry?: string | string[] | undefined;
999
+ project?: string | string[] | undefined;
1000
+ }, {
1001
+ config?: string | string[] | undefined;
1002
+ entry?: string | string[] | undefined;
1003
+ project?: string | string[] | undefined;
1004
+ }>]>;
979
1005
  rspack: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
980
1006
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
981
1007
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1687,6 +1713,11 @@ export declare const pluginsSchema: z.ZodObject<{
1687
1713
  entry?: string | string[] | undefined;
1688
1714
  project?: string | string[] | undefined;
1689
1715
  };
1716
+ 'node-modules-inspector': string | boolean | string[] | {
1717
+ config?: string | string[] | undefined;
1718
+ entry?: string | string[] | undefined;
1719
+ project?: string | string[] | undefined;
1720
+ };
1690
1721
  nodemon: string | boolean | string[] | {
1691
1722
  config?: string | string[] | undefined;
1692
1723
  entry?: string | string[] | undefined;
@@ -1802,6 +1833,11 @@ export declare const pluginsSchema: z.ZodObject<{
1802
1833
  entry?: string | string[] | undefined;
1803
1834
  project?: string | string[] | undefined;
1804
1835
  };
1836
+ rslib: string | boolean | string[] | {
1837
+ config?: string | string[] | undefined;
1838
+ entry?: string | string[] | undefined;
1839
+ project?: string | string[] | undefined;
1840
+ };
1805
1841
  rspack: string | boolean | string[] | {
1806
1842
  config?: string | string[] | undefined;
1807
1843
  entry?: string | string[] | undefined;
@@ -2233,6 +2269,11 @@ export declare const pluginsSchema: z.ZodObject<{
2233
2269
  entry?: string | string[] | undefined;
2234
2270
  project?: string | string[] | undefined;
2235
2271
  };
2272
+ 'node-modules-inspector': string | boolean | string[] | {
2273
+ config?: string | string[] | undefined;
2274
+ entry?: string | string[] | undefined;
2275
+ project?: string | string[] | undefined;
2276
+ };
2236
2277
  nodemon: string | boolean | string[] | {
2237
2278
  config?: string | string[] | undefined;
2238
2279
  entry?: string | string[] | undefined;
@@ -2348,6 +2389,11 @@ export declare const pluginsSchema: z.ZodObject<{
2348
2389
  entry?: string | string[] | undefined;
2349
2390
  project?: string | string[] | undefined;
2350
2391
  };
2392
+ rslib: string | boolean | string[] | {
2393
+ config?: string | string[] | undefined;
2394
+ entry?: string | string[] | undefined;
2395
+ project?: string | string[] | undefined;
2396
+ };
2351
2397
  rspack: string | boolean | string[] | {
2352
2398
  config?: string | string[] | undefined;
2353
2399
  entry?: string | string[] | undefined;
@@ -61,6 +61,7 @@ export const pluginsSchema = z.object({
61
61
  netlify: pluginSchema,
62
62
  next: pluginSchema,
63
63
  node: pluginSchema,
64
+ 'node-modules-inspector': pluginSchema,
64
65
  nodemon: pluginSchema,
65
66
  'npm-package-json-lint': pluginSchema,
66
67
  nuxt: pluginSchema,
@@ -84,6 +85,7 @@ export const pluginsSchema = z.object({
84
85
  remix: pluginSchema,
85
86
  rollup: pluginSchema,
86
87
  rsbuild: pluginSchema,
88
+ rslib: pluginSchema,
87
89
  rspack: pluginSchema,
88
90
  'semantic-release': pluginSchema,
89
91
  sentry: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'biome' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
- export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "biome", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
1
+ export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'biome' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
+ export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "biome", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rslib", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
@@ -50,6 +50,7 @@ export const pluginNames = [
50
50
  'netlify',
51
51
  'next',
52
52
  'node',
53
+ 'node-modules-inspector',
53
54
  'nodemon',
54
55
  'npm-package-json-lint',
55
56
  'nuxt',
@@ -73,6 +74,7 @@ export const pluginNames = [
73
74
  'remix',
74
75
  'rollup',
75
76
  'rsbuild',
77
+ 'rslib',
76
78
  'rspack',
77
79
  'semantic-release',
78
80
  'sentry',
@@ -0,0 +1,3 @@
1
+ export type Entries<T> = Array<{
2
+ [K in keyof T]: [K, T[K]];
3
+ }[keyof T]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -69,16 +69,18 @@ export type ReporterOptions = {
69
69
  options: string;
70
70
  preprocessorOptions: string;
71
71
  includedWorkspaces: Workspace[];
72
+ configFilePath?: string;
72
73
  };
73
74
  export type Reporter = (options: ReporterOptions) => void;
74
75
  export type Preprocessor = (options: ReporterOptions) => ReporterOptions;
75
76
  export type IssueSeverity = 'error' | 'warn' | 'off';
76
77
  export type Rules = Record<IssueType, IssueSeverity>;
77
78
  export type ConfigurationHints = Set<ConfigurationHint>;
78
- export type ConfigurationHintType = 'ignoreBinaries' | 'ignoreDependencies' | 'ignoreUnresolved' | 'ignoreWorkspaces' | 'entry-redundant' | 'project-redundant' | 'entry-top-level' | 'project-top-level' | 'entry-empty' | 'project-empty' | 'workspace-unconfigured';
79
+ export type ConfigurationHintType = 'ignoreBinaries' | 'ignoreDependencies' | 'ignoreUnresolved' | 'ignoreWorkspaces' | 'entry-redundant' | 'project-redundant' | 'entry-top-level' | 'project-top-level' | 'entry-empty' | 'project-empty' | 'package-entry' | 'workspace-unconfigured';
79
80
  export type ConfigurationHint = {
80
81
  type: ConfigurationHintType;
81
82
  identifier: string | RegExp;
83
+ filePath?: string;
82
84
  workspaceName?: string;
83
85
  size?: number;
84
86
  };
@@ -9,6 +9,9 @@ type Exports = null | string | string[] | {
9
9
  } | {
10
10
  [key: string]: Exports;
11
11
  };
12
+ type Imports = {
13
+ [key: `#${string}`]: Exports;
14
+ };
12
15
  type PackageJsonPath<T> = T extends {
13
16
  packageJsonPath: infer P;
14
17
  } ? (P extends string ? P : never) : never;
@@ -29,6 +32,7 @@ export type PackageJson = {
29
32
  packages?: string[];
30
33
  };
31
34
  exports?: Exports;
35
+ imports?: Imports;
32
36
  scripts?: Scripts;
33
37
  dependencies?: Dependencies;
34
38
  devDependencies?: Dependencies;
@@ -0,0 +1,14 @@
1
+ export interface TsConfigJson {
2
+ extends?: string | string[];
3
+ compilerOptions?: {
4
+ types?: string[];
5
+ jsxImportSource?: string;
6
+ plugins?: Array<string | {
7
+ name: string;
8
+ }>;
9
+ [key: string]: unknown;
10
+ };
11
+ references?: Array<{
12
+ path: string;
13
+ }>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -149,7 +149,7 @@ const getMemberStringLiterals = (typeChecker, node) => {
149
149
  return type.types.map(type => type.value);
150
150
  }
151
151
  if (ts.isPropertyAccessExpression(node)) {
152
- return [node.name.escapedText];
152
+ return [node.name.getText()];
153
153
  }
154
154
  };
155
155
  export const getAccessMembers = (typeChecker, node) => {
@@ -177,7 +177,7 @@ export const isConsiderReferencedNS = (node) => ts.isPropertyAssignment(node.par
177
177
  ts.isArrayLiteralExpression(node.parent) ||
178
178
  ts.isExportAssignment(node.parent) ||
179
179
  (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) ||
180
- ts.isTypeQueryNode(node.parent);
180
+ ts.isTypeQueryNode(node.parent.parent);
181
181
  const objectEnumerationMethods = new Set(['keys', 'entries', 'values', 'getOwnPropertyNames']);
182
182
  export const isObjectEnumerationCallExpressionArgument = (node) => ts.isCallExpression(node.parent) &&
183
183
  node.parent.arguments.includes(node) &&
package/dist/util/fs.d.ts CHANGED
@@ -4,6 +4,6 @@ export declare const findFile: (workingDir: string, fileName: string) => string
4
4
  export declare const loadFile: (filePath: string) => Promise<string>;
5
5
  export declare const loadJSON: (filePath: string) => Promise<any>;
6
6
  export declare const loadYAML: (filePath: string) => Promise<unknown>;
7
- export declare const loadTOML: (filePath: string) => Promise<Record<string, import("smol-toml").TomlPrimitive>>;
7
+ export declare const loadTOML: (filePath: string) => Promise<import("smol-toml").TomlTable>;
8
8
  export declare const parseJSON: (filePath: string, contents: string) => Promise<any>;
9
9
  export declare const parseYAML: (contents: string) => unknown;
@@ -14,6 +14,6 @@ export declare const findAndParseGitignores: (cwd: string) => Promise<{
14
14
  ignores: Set<string>;
15
15
  unignores: string[];
16
16
  }>;
17
- export declare function glob(patterns: string | string[], options: GlobOptions): Promise<string[]>;
17
+ export declare function glob(_patterns: string[], options: GlobOptions): Promise<string[]>;
18
18
  export declare function getGitIgnoredHandler(options: Options): Promise<(path: string) => boolean>;
19
19
  export {};
@@ -5,7 +5,7 @@ import fg, {} from 'fast-glob';
5
5
  import picomatch from 'picomatch';
6
6
  import { GLOBAL_IGNORE_PATTERNS, ROOT_WORKSPACE_NAME } from '../constants.js';
7
7
  import { timerify } from './Performance.js';
8
- import { compact } from './array.js';
8
+ import { compact, partition } from './array.js';
9
9
  import { debugLogObject } from './debug.js';
10
10
  import { isDirectory, isFile } from './fs.js';
11
11
  import { parseAndConvertGitignorePatterns } from './parse-and-convert-gitignores.js';
@@ -126,13 +126,14 @@ export const findAndParseGitignores = async (cwd) => {
126
126
  return { gitignoreFiles, ignores, unignores };
127
127
  };
128
128
  const _parseFindGitignores = timerify(findAndParseGitignores);
129
- export async function glob(patterns, options) {
130
- if (Array.isArray(patterns) && patterns.length === 0)
129
+ export async function glob(_patterns, options) {
130
+ if (Array.isArray(_patterns) && _patterns.length === 0)
131
131
  return [];
132
132
  const hasCache = cachedGlobIgnores.has(options.dir);
133
133
  const willCache = !hasCache && options.gitignore && options.label;
134
134
  const cachedIgnores = options.gitignore ? cachedGlobIgnores.get(options.dir) : undefined;
135
- const _ignore = options.gitignore && Array.isArray(options.ignore) ? [...options.ignore] : [];
135
+ const _ignore = [];
136
+ const [negatedPatterns, patterns] = partition(_patterns, pattern => pattern.startsWith('!'));
136
137
  if (options.gitignore) {
137
138
  if (willCache) {
138
139
  let dir = options.dir;
@@ -151,16 +152,16 @@ export async function glob(patterns, options) {
151
152
  else {
152
153
  _ignore.push(...GLOBAL_IGNORE_PATTERNS);
153
154
  }
154
- const ignore = cachedIgnores || compact(_ignore);
155
155
  if (willCache)
156
156
  cachedGlobIgnores.set(options.dir, compact(_ignore));
157
- const { dir, label, ...fgOptions } = { ...options, ignore };
157
+ const ignorePatterns = (cachedIgnores || _ignore).concat(negatedPatterns);
158
+ const { dir, label, ...fgOptions } = { ...options, ignore: ignorePatterns };
158
159
  const paths = await fg.glob(patterns, fgOptions);
159
160
  const name = relative(options.cwd, dir) || ROOT_WORKSPACE_NAME;
160
161
  debugLogObject(name, label ? `Finding ${label}` : 'Finding paths', () => ({
161
162
  patterns,
162
163
  ...fgOptions,
163
- ignore: hasCache ? `// using cache from ${name}` : ignore,
164
+ ignore: hasCache ? `// using cache from ${name}` : ignorePatterns,
164
165
  paths,
165
166
  }));
166
167
  return paths;
@@ -6,6 +6,7 @@ interface GlobOptions {
6
6
  name?: boolean;
7
7
  label?: string;
8
8
  }
9
+ export declare const removeProductionSuffix: (pattern: string) => string;
9
10
  export declare const prependDirToPattern: (dir: string, pattern: string) => string;
10
11
  export declare const negate: (pattern: string) => string;
11
12
  export declare const hasProductionSuffix: (pattern: string) => boolean;
package/dist/util/glob.js CHANGED
@@ -9,7 +9,7 @@ const prependDirToPatterns = (cwd, dir, patterns) => {
9
9
  const relativePath = relative(cwd, dir);
10
10
  return compact([patterns].flat().map(p => removeProductionSuffix(prepend(p, relativePath)))).sort(negatedLast);
11
11
  };
12
- const removeProductionSuffix = (pattern) => pattern.replace(/!$/, '');
12
+ export const removeProductionSuffix = (pattern) => pattern.replace(/!$/, '');
13
13
  const negatedLast = (pattern) => (pattern.startsWith('!') ? 1 : -1);
14
14
  export const prependDirToPattern = (dir, pattern) => {
15
15
  if (pattern.startsWith('!'))
@@ -86,23 +86,6 @@ export const getIsIdentifierReferencedHandler = (graph, entryPaths) => {
86
86
  }
87
87
  }
88
88
  }
89
- const reExported = file.reExported.get(identifier) ?? file.reExported.get(IMPORT_STAR);
90
- if (reExported) {
91
- for (const byFilePath of reExported) {
92
- if (!seen.has(byFilePath)) {
93
- const child = createNode(byFilePath);
94
- traceNode.children.add(child);
95
- const result = isIdentifierReferenced(byFilePath, id, isIncludeEntryExports, child, seen);
96
- if (result.reExportingEntryFile)
97
- reExportingEntryFile = result.reExportingEntryFile;
98
- if (result.isReferenced) {
99
- isReferenced = true;
100
- if (!isTrace)
101
- return { isReferenced, reExportingEntryFile, traceNode };
102
- }
103
- }
104
- }
105
- }
106
89
  const reExportedAs = file.reExportedAs.get(identifier);
107
90
  if (reExportedAs) {
108
91
  for (const [alias, byFilePaths] of reExportedAs) {
@@ -123,6 +106,23 @@ export const getIsIdentifierReferencedHandler = (graph, entryPaths) => {
123
106
  }
124
107
  }
125
108
  }
109
+ const reExported = file.reExported.get(identifier) ?? file.reExported.get(IMPORT_STAR);
110
+ if (reExported) {
111
+ for (const byFilePath of reExported) {
112
+ if (!seen.has(byFilePath)) {
113
+ const child = createNode(byFilePath);
114
+ traceNode.children.add(child);
115
+ const result = isIdentifierReferenced(byFilePath, id, isIncludeEntryExports, child, seen);
116
+ if (result.reExportingEntryFile)
117
+ reExportingEntryFile = result.reExportingEntryFile;
118
+ if (result.isReferenced) {
119
+ isReferenced = true;
120
+ if (!isTrace)
121
+ return { isReferenced, reExportingEntryFile, traceNode };
122
+ }
123
+ }
124
+ }
125
+ }
126
126
  for (const [namespace, byFilePaths] of file.reExportedNs.entries()) {
127
127
  for (const byFilePath of byFilePaths) {
128
128
  if (!seen.has(byFilePath)) {
@@ -7,5 +7,6 @@ interface ExtendedPackageJson extends PackageJson {
7
7
  }
8
8
  export declare const load: (filePath: string) => Promise<ExtendedPackageJson>;
9
9
  export declare const save: (filePath: string, content: ExtendedPackageJson) => Promise<void>;
10
- export declare const getEntryPathsFromManifest: (manifest: PackageJson) => Set<string>;
10
+ export declare const getEntrySpecifiersFromManifest: (manifest: PackageJson) => Set<string>;
11
+ export declare const getManifestImportDependencies: (manifest: PackageJson) => Set<string>;
11
12
  export {};
@@ -45,7 +45,7 @@ export const save = async (filePath, content) => {
45
45
  const fileContent = `${JSON.stringify(content, null, space)}\n`.replace(/\n/g, EOL);
46
46
  await writeFile(filePath, fileContent);
47
47
  };
48
- export const getEntryPathsFromManifest = (manifest) => {
48
+ export const getEntrySpecifiersFromManifest = (manifest) => {
49
49
  const { main, module, browser, bin, exports, types, typings } = manifest;
50
50
  const entryPaths = new Set();
51
51
  if (typeof main === 'string')
@@ -54,13 +54,15 @@ export const getEntryPathsFromManifest = (manifest) => {
54
54
  entryPaths.add(module);
55
55
  if (typeof browser === 'string')
56
56
  entryPaths.add(browser);
57
- if (bin) {
58
- if (typeof bin === 'string')
59
- entryPaths.add(bin);
60
- if (typeof bin === 'object')
61
- for (const id of Object.values(bin))
62
- entryPaths.add(id);
63
- }
57
+ if (typeof bin === 'string')
58
+ entryPaths.add(bin);
59
+ if (bin && typeof bin === 'object')
60
+ for (const id of Object.values(bin))
61
+ entryPaths.add(id);
62
+ if (typeof types === 'string')
63
+ entryPaths.add(types);
64
+ if (typeof typings === 'string')
65
+ entryPaths.add(typings);
64
66
  if (exports) {
65
67
  for (const item of getEntriesFromExports(exports)) {
66
68
  if (item === './*')
@@ -72,9 +74,19 @@ export const getEntryPathsFromManifest = (manifest) => {
72
74
  entryPaths.add(expanded);
73
75
  }
74
76
  }
75
- if (typeof types === 'string')
76
- entryPaths.add(types);
77
- if (typeof typings === 'string')
78
- entryPaths.add(typings);
79
77
  return entryPaths;
80
78
  };
79
+ export const getManifestImportDependencies = (manifest) => {
80
+ const dependencies = new Set();
81
+ if (!manifest.imports)
82
+ return dependencies;
83
+ for (const [entry, exportValue] of Object.entries(manifest.imports)) {
84
+ if (!entry.startsWith('#'))
85
+ continue;
86
+ for (const item of getEntriesFromExports(exportValue)) {
87
+ if (!item.startsWith('.') && !item.startsWith('!'))
88
+ dependencies.add(item);
89
+ }
90
+ }
91
+ return dependencies;
92
+ };