knip 6.14.1 → 6.15.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 (84) hide show
  1. package/README.md +1 -1
  2. package/dist/CacheConsultant.d.ts +1 -0
  3. package/dist/CacheConsultant.js +2 -0
  4. package/dist/ConfigurationChief.d.ts +12 -0
  5. package/dist/ConfigurationChief.js +7 -10
  6. package/dist/DependencyDeputy.d.ts +0 -4
  7. package/dist/DependencyDeputy.js +6 -18
  8. package/dist/IssueCollector.d.ts +1 -0
  9. package/dist/IssueCollector.js +10 -20
  10. package/dist/IssueFixer.js +10 -15
  11. package/dist/ProjectPrincipal.d.ts +0 -2
  12. package/dist/ProjectPrincipal.js +1 -9
  13. package/dist/WorkspaceWorker.js +6 -1
  14. package/dist/binaries/resolvers/bun.js +9 -8
  15. package/dist/cli.js +3 -1
  16. package/dist/compilers/compilers.d.ts +3 -0
  17. package/dist/compilers/compilers.js +9 -13
  18. package/dist/compilers/index.d.ts +21 -0
  19. package/dist/compilers/scss.js +9 -3
  20. package/dist/graph/analyze.js +7 -1
  21. package/dist/graph/build.js +0 -2
  22. package/dist/manifest/index.js +11 -14
  23. package/dist/plugins/astro/index.js +1 -0
  24. package/dist/plugins/graphql-codegen/index.js +4 -0
  25. package/dist/plugins/index.d.ts +2 -0
  26. package/dist/plugins/index.js +4 -0
  27. package/dist/plugins/nano-spawn/index.d.ts +3 -0
  28. package/dist/plugins/nano-spawn/index.js +15 -0
  29. package/dist/plugins/nano-spawn/visitors/nano-spawn.d.ts +2 -0
  30. package/dist/plugins/nano-spawn/visitors/nano-spawn.js +25 -0
  31. package/dist/plugins/orval/index.d.ts +3 -0
  32. package/dist/plugins/orval/index.js +16 -0
  33. package/dist/plugins/orval/resolveFromAST.d.ts +2 -0
  34. package/dist/plugins/orval/resolveFromAST.js +11 -0
  35. package/dist/plugins/orval/types.d.ts +9 -0
  36. package/dist/plugins/orval/types.js +1 -0
  37. package/dist/plugins/serverless-framework/index.js +11 -6
  38. package/dist/plugins/serverless-framework/types.d.ts +7 -0
  39. package/dist/plugins/typescript/index.js +1 -1
  40. package/dist/plugins/vite/helpers.d.ts +1 -1
  41. package/dist/plugins/vite/helpers.js +43 -36
  42. package/dist/plugins/vite/index.js +2 -6
  43. package/dist/plugins/webdriver-io/index.js +3 -3
  44. package/dist/plugins/webdriver-io/types.d.ts +5 -1
  45. package/dist/reporters/github-actions.d.ts +1 -1
  46. package/dist/reporters/github-actions.js +19 -1
  47. package/dist/reporters/index.d.ts +1 -1
  48. package/dist/reporters/symbols.js +2 -1
  49. package/dist/reporters/trace.d.ts +3 -1
  50. package/dist/reporters/trace.js +48 -16
  51. package/dist/reporters/util/configuration-hints.d.ts +1 -1
  52. package/dist/reporters/util/configuration-hints.js +3 -2
  53. package/dist/schema/configuration.d.ts +32 -1
  54. package/dist/schema/configuration.js +1 -0
  55. package/dist/schema/plugins.d.ts +10 -0
  56. package/dist/schema/plugins.js +2 -0
  57. package/dist/types/PluginNames.d.ts +2 -2
  58. package/dist/types/PluginNames.js +2 -0
  59. package/dist/types/issues.d.ts +1 -0
  60. package/dist/types/project.d.ts +0 -1
  61. package/dist/typescript/resolve-module-names.d.ts +0 -1
  62. package/dist/typescript/resolve-module-names.js +0 -17
  63. package/dist/typescript/visitors/walk.js +7 -0
  64. package/dist/util/Performance.d.ts +13 -28
  65. package/dist/util/Performance.js +41 -72
  66. package/dist/util/cli-arguments.d.ts +3 -1
  67. package/dist/util/cli-arguments.js +4 -0
  68. package/dist/util/create-input-handler.js +3 -1
  69. package/dist/util/create-options.d.ts +22 -0
  70. package/dist/util/create-options.js +2 -1
  71. package/dist/util/disk-cache.d.ts +1 -0
  72. package/dist/util/disk-cache.js +8 -0
  73. package/dist/util/gitignore-cache.js +5 -11
  74. package/dist/util/glob-cache.js +2 -8
  75. package/dist/util/glob-core.js +4 -7
  76. package/dist/util/jiti.js +1 -0
  77. package/dist/util/load-tsconfig.js +0 -3
  78. package/dist/util/trace.js +1 -1
  79. package/dist/version.d.ts +1 -1
  80. package/dist/version.js +1 -1
  81. package/package.json +3 -4
  82. package/schema.json +12 -0
  83. package/dist/util/math.d.ts +0 -6
  84. package/dist/util/math.js +0 -11
@@ -276,6 +276,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
276
276
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
277
277
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
278
278
  }, z.core.$strip>]>>;
279
+ 'nano-spawn': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
280
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
281
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
282
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
283
+ }, z.core.$strip>]>>;
279
284
  'nano-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
280
285
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
281
286
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -356,6 +361,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
356
361
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
357
362
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
358
363
  }, z.core.$strip>]>>;
364
+ orval: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
365
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
366
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
367
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
368
+ }, z.core.$strip>]>>;
359
369
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
360
370
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
361
371
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1038,6 +1048,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1038
1048
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1039
1049
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1040
1050
  }, z.core.$strip>]>>;
1051
+ 'nano-spawn': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1052
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1053
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1054
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1055
+ }, z.core.$strip>]>>;
1041
1056
  'nano-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1042
1057
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1043
1058
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1118,6 +1133,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1118
1133
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1119
1134
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1120
1135
  }, z.core.$strip>]>>;
1136
+ orval: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1137
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1138
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1139
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1140
+ }, z.core.$strip>]>>;
1121
1141
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1122
1142
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1123
1143
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1529,7 +1549,7 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1529
1549
  ignoreMembers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
1530
1550
  ignoreUnresolved: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniCustom<RegExp, RegExp>]>>>;
1531
1551
  ignoreExportsUsedInFile: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniObject<{
1532
- [k: string]: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
1552
+ [x: string]: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
1533
1553
  }, z.core.$strict>]>>;
1534
1554
  ignoreIssues: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"files">, z.ZodMiniLiteral<"dependencies">, z.ZodMiniLiteral<"devDependencies">, z.ZodMiniLiteral<"optionalPeerDependencies">, z.ZodMiniLiteral<"unlisted">, z.ZodMiniLiteral<"binaries">, z.ZodMiniLiteral<"unresolved">, z.ZodMiniLiteral<"exports">, z.ZodMiniLiteral<"types">, z.ZodMiniLiteral<"nsExports">, z.ZodMiniLiteral<"nsTypes">, z.ZodMiniLiteral<"duplicates">, z.ZodMiniLiteral<"enumMembers">, z.ZodMiniLiteral<"namespaceMembers">, z.ZodMiniLiteral<"catalog">]>>>>;
1535
1555
  ignoreWorkspaces: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -1539,6 +1559,7 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1539
1559
  asyncCompilers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniCustom<CompilerAsync, CompilerAsync>>>;
1540
1560
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
1541
1561
  treatConfigHintsAsErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
1562
+ treatTagHintsAsErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
1542
1563
  include: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"files">, z.ZodMiniLiteral<"dependencies">, z.ZodMiniLiteral<"devDependencies">, z.ZodMiniLiteral<"optionalPeerDependencies">, z.ZodMiniLiteral<"unlisted">, z.ZodMiniLiteral<"binaries">, z.ZodMiniLiteral<"unresolved">, z.ZodMiniLiteral<"exports">, z.ZodMiniLiteral<"types">, z.ZodMiniLiteral<"nsExports">, z.ZodMiniLiteral<"nsTypes">, z.ZodMiniLiteral<"duplicates">, z.ZodMiniLiteral<"enumMembers">, z.ZodMiniLiteral<"namespaceMembers">, z.ZodMiniLiteral<"catalog">]>>>;
1543
1564
  exclude: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"files">, z.ZodMiniLiteral<"dependencies">, z.ZodMiniLiteral<"devDependencies">, z.ZodMiniLiteral<"optionalPeerDependencies">, z.ZodMiniLiteral<"unlisted">, z.ZodMiniLiteral<"binaries">, z.ZodMiniLiteral<"unresolved">, z.ZodMiniLiteral<"exports">, z.ZodMiniLiteral<"types">, z.ZodMiniLiteral<"nsExports">, z.ZodMiniLiteral<"nsTypes">, z.ZodMiniLiteral<"duplicates">, z.ZodMiniLiteral<"enumMembers">, z.ZodMiniLiteral<"namespaceMembers">, z.ZodMiniLiteral<"catalog">]>>>;
1544
1565
  workspaces: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
@@ -1817,6 +1838,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1817
1838
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1818
1839
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1819
1840
  }, z.core.$strip>]>>;
1841
+ 'nano-spawn': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1842
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1843
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1844
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1845
+ }, z.core.$strip>]>>;
1820
1846
  'nano-staged': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1821
1847
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1822
1848
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1897,6 +1923,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1897
1923
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1898
1924
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1899
1925
  }, z.core.$strip>]>>;
1926
+ orval: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1927
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1928
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1929
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1930
+ }, z.core.$strip>]>>;
1900
1931
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1901
1932
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1902
1933
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -50,6 +50,7 @@ const rootConfigurationSchema = z.object({
50
50
  asyncCompilers: z.optional(z.record(z.string(), asyncCompilerSchema)),
51
51
  tags: z.optional(z.array(z.string())),
52
52
  treatConfigHintsAsErrors: z.optional(z.boolean()),
53
+ treatTagHintsAsErrors: z.optional(z.boolean()),
53
54
  });
54
55
  const reportConfigSchema = z.object({
55
56
  include: z.optional(z.array(issueTypeSchema)),
@@ -281,6 +281,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
281
281
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
282
282
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
283
283
  }, z.core.$strip>]>;
284
+ 'nano-spawn': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
285
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
286
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
287
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
288
+ }, z.core.$strip>]>;
284
289
  'nano-staged': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
285
290
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
286
291
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -361,6 +366,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
361
366
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
362
367
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
363
368
  }, z.core.$strip>]>;
369
+ orval: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
370
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
371
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
372
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
373
+ }, z.core.$strip>]>;
364
374
  oxfmt: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
365
375
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
366
376
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -65,6 +65,7 @@ export const pluginsSchema = z.object({
65
65
  mocha: pluginSchema,
66
66
  moonrepo: pluginSchema,
67
67
  msw: pluginSchema,
68
+ 'nano-spawn': pluginSchema,
68
69
  'nano-staged': pluginSchema,
69
70
  nest: pluginSchema,
70
71
  netlify: pluginSchema,
@@ -81,6 +82,7 @@ export const pluginsSchema = z.object({
81
82
  nyc: pluginSchema,
82
83
  oclif: pluginSchema,
83
84
  'openapi-ts': pluginSchema,
85
+ orval: pluginSchema,
84
86
  oxfmt: pluginSchema,
85
87
  oxlint: pluginSchema,
86
88
  'panda-css': pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
- export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'eleventy', 'eslint', 'execa', 'expo', 'expressive-code', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'lefthook', 'lint-staged', 'linthtml', 'lockfile-lint', 'lost-pixel', 'markdownlint', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nx', 'nyc', 'oclif', 'openapi-ts', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'vercel', 'vercel-og', 'vike', 'vite', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'execa' | 'expo' | 'expressive-code' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
+ export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'eleventy', 'eslint', 'execa', 'expo', 'expressive-code', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'lefthook', 'lint-staged', 'linthtml', 'lockfile-lint', 'lost-pixel', 'markdownlint', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nx', 'nyc', 'oclif', 'openapi-ts', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'vercel', 'vercel-og', 'vike', 'vite', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
@@ -54,6 +54,7 @@ export const pluginNames = [
54
54
  'mocha',
55
55
  'moonrepo',
56
56
  'msw',
57
+ 'nano-spawn',
57
58
  'nano-staged',
58
59
  'nest',
59
60
  'netlify',
@@ -70,6 +71,7 @@ export const pluginNames = [
70
71
  'nyc',
71
72
  'oclif',
72
73
  'openapi-ts',
74
+ 'orval',
73
75
  'oxfmt',
74
76
  'oxlint',
75
77
  'panda-css',
@@ -56,6 +56,7 @@ export type ReporterOptions = {
56
56
  isDisableConfigHints: boolean;
57
57
  isDisableTagHints: boolean;
58
58
  isTreatConfigHintsAsErrors: boolean;
59
+ isTreatTagHintsAsErrors: boolean;
59
60
  cwd: string;
60
61
  isProduction: boolean;
61
62
  isShowProgress: boolean;
@@ -22,7 +22,6 @@ export interface CompilerOptions {
22
22
  name: string;
23
23
  } | string>;
24
24
  rootDir?: string;
25
- rootDirs?: string[];
26
25
  skipDefaultLibCheck?: boolean;
27
26
  skipLibCheck?: boolean;
28
27
  sourceMap?: boolean;
@@ -3,5 +3,4 @@ import type { ResolveModule } from './ast-nodes.ts';
3
3
  export declare function clearModuleResolutionCaches(): void;
4
4
  export declare function createCustomModuleResolver(compilerOptions: {
5
5
  paths?: Record<string, string[]>;
6
- rootDirs?: string[];
7
6
  }, customCompilerExtensions: string[], toSourceFilePath: ToSourceFilePath, findWorkspaceManifestImports?: WorkspaceManifestHandler): ResolveModule;
@@ -48,7 +48,6 @@ export function createCustomModuleResolver(compilerOptions, customCompilerExtens
48
48
  const extensions = [...DEFAULT_EXTENSIONS, ...customCompilerExtensions, ...DTS_EXTENSIONS];
49
49
  const resolveSync = hasCustomExts ? _createSyncModuleResolver(extensions) : _resolveModuleSync;
50
50
  const pathMappings = compilePathMappings(compilerOptions.paths);
51
- const rootDirs = compilerOptions.rootDirs;
52
51
  function toSourcePath(resolvedFileName) {
53
52
  if (!hasCustomExts || !customCompilerExtensionsSet.has(extname(resolvedFileName))) {
54
53
  return toSourceFilePath(resolvedFileName) || resolvedFileName;
@@ -111,22 +110,6 @@ export function createCustomModuleResolver(compilerOptions, customCompilerExtens
111
110
  }
112
111
  }
113
112
  }
114
- if (rootDirs && !isAbsolute(specifier)) {
115
- const containingDir = dirname(containingFile);
116
- for (const srcRoot of rootDirs) {
117
- if (!containingDir.startsWith(srcRoot))
118
- continue;
119
- const relPath = containingDir.slice(srcRoot.length);
120
- for (const targetRoot of rootDirs) {
121
- if (targetRoot === srcRoot)
122
- continue;
123
- const mapped = join(targetRoot, relPath, specifier);
124
- const resolved = resolveSync(mapped, containingFile);
125
- if (resolved)
126
- return toResult(resolved);
127
- }
128
- }
129
- }
130
113
  const candidate = isAbsolute(specifier) ? specifier : join(dirname(containingFile), specifier);
131
114
  if (existsSync(candidate)) {
132
115
  return { resolvedFileName: candidate, isExternalLibraryImport: false };
@@ -104,6 +104,13 @@ const _collectRefsInType = (node, exportName, signatureOnly, seen = new Set(), i
104
104
  return;
105
105
  }
106
106
  break;
107
+ case 'VariableDeclarator':
108
+ if (inBody) {
109
+ if (node.init)
110
+ _collectRefsInType(node.init, exportName, signatureOnly, seen, inBody);
111
+ return;
112
+ }
113
+ break;
107
114
  }
108
115
  const keys = visitorKeys[type];
109
116
  if (!keys)
@@ -1,38 +1,22 @@
1
- import { type PerformanceEntry, PerformanceObserver } from 'node:perf_hooks';
2
- export declare const timerify: <T extends (...params: any[]) => any>(fn: T, name?: string) => T;
3
- type MemInfo = {
4
- label: string;
5
- heapUsed: number;
6
- heapTotal: number;
7
- rss: number;
8
- };
9
- interface MemoryEntry extends PerformanceEntry {
10
- detail: MemInfo;
11
- }
1
+ import { type RecordableHistogram } from 'node:perf_hooks';
12
2
  declare class Performance {
13
- isEnabled: boolean;
14
- isTimerifyFunctions: boolean;
15
- isMemoryUsageEnabled: boolean;
16
- isDurationEnabled: boolean;
17
- startTime: number;
18
- endTime: number;
19
- perfEntries: PerformanceEntry[];
20
- memEntries: MemoryEntry[];
21
- perfId?: string;
22
- memId?: string;
23
- fnObserver?: PerformanceObserver;
24
- memObserver?: PerformanceObserver;
3
+ readonly isEnabled: boolean;
4
+ readonly isTimerifyFunctions: boolean;
5
+ readonly isMemoryUsageEnabled: boolean;
6
+ readonly isDurationEnabled: boolean;
7
+ private readonly startTime;
8
+ private readonly memId;
9
+ private readonly histograms;
10
+ private readonly memEntries;
11
+ private readonly memObserver?;
25
12
  constructor({ isTimerifyFunctions, isMemoryUsageEnabled, isDurationEnabled }: {
26
13
  isDurationEnabled?: boolean | undefined;
27
14
  isMemoryUsageEnabled?: boolean | undefined;
28
15
  isTimerifyFunctions?: boolean | undefined;
29
16
  });
30
- private setMark;
31
- private clearMark;
32
- private flush;
33
- private getPerfEntriesByName;
34
- getTimerifiedFunctionsTable(): string;
17
+ registerHistogram(name: string): RecordableHistogram;
35
18
  addMemoryMark(label: string): void;
19
+ getTimerifiedFunctionsTable(): string;
36
20
  getMemoryUsageTable(): string;
37
21
  getCurrentDurationInMs(): number;
38
22
  getMemHeapUsage(): number;
@@ -41,4 +25,5 @@ declare class Performance {
41
25
  reset(): void;
42
26
  }
43
27
  export declare const perfObserver: Performance;
28
+ export declare const timerify: <T extends (...params: any[]) => any>(fn: T, name?: string) => T;
44
29
  export {};
@@ -1,7 +1,6 @@
1
- import { PerformanceObserver, performance } from 'node:perf_hooks';
1
+ import { PerformanceObserver, createHistogram, performance, } from 'node:perf_hooks';
2
2
  import { memoryUsage } from 'node:process';
3
3
  import { parseArgs } from 'node:util';
4
- import { getStats } from './math.js';
5
4
  import { Table } from './table.js';
6
5
  const { values } = parseArgs({
7
6
  strict: false,
@@ -18,13 +17,6 @@ const isMemoryRealtime = !!values['memory-realtime'];
18
17
  const isTimerifyFunctions = !!values.performance || !!timerifyOnlyFnName;
19
18
  const isMemoryUsageEnabled = !!values.memory || isMemoryRealtime;
20
19
  const isDurationEnabled = !!values.duration;
21
- export const timerify = (fn, name = fn.name) => {
22
- if (!isTimerifyFunctions)
23
- return fn;
24
- if (timerifyOnlyFnName && !timerifyOnlyFnName.includes(name))
25
- return fn;
26
- return performance.timerify(Object.defineProperty(fn, 'name', { get: () => name }));
27
- };
28
20
  const getMemInfo = (label) => {
29
21
  const usage = memoryUsage();
30
22
  return { label, heapUsed: usage.heapUsed, heapTotal: usage.heapTotal, rss: usage.rss };
@@ -39,36 +31,20 @@ class Performance {
39
31
  isTimerifyFunctions;
40
32
  isMemoryUsageEnabled;
41
33
  isDurationEnabled;
42
- startTime = 0;
43
- endTime = 0;
44
- perfEntries = [];
34
+ startTime = performance.now();
35
+ memId = `mem-${Math.floor(performance.now() * 100)}`;
36
+ histograms = new Map();
45
37
  memEntries = [];
46
- perfId;
47
- memId;
48
- fnObserver;
49
38
  memObserver;
50
39
  constructor({ isTimerifyFunctions = false, isMemoryUsageEnabled = false, isDurationEnabled = false }) {
51
40
  this.isEnabled = isTimerifyFunctions || isMemoryUsageEnabled;
52
41
  this.isTimerifyFunctions = isTimerifyFunctions;
53
42
  this.isMemoryUsageEnabled = isMemoryUsageEnabled;
54
43
  this.isDurationEnabled = isDurationEnabled;
55
- this.startTime = performance.now();
56
- const instanceId = Math.floor(performance.now() * 100);
57
- this.perfId = `perf-${instanceId}`;
58
- this.memId = `mem-${instanceId}`;
59
- if (isTimerifyFunctions) {
60
- this.fnObserver = new PerformanceObserver(items => {
61
- for (const entry of items.getEntries()) {
62
- this.perfEntries.push(entry);
63
- }
64
- });
65
- this.fnObserver.observe({ type: 'function' });
66
- }
67
44
  if (isMemoryUsageEnabled) {
68
45
  this.memObserver = new PerformanceObserver(items => {
69
- for (const entry of items.getEntries()) {
46
+ for (const entry of items.getEntries())
70
47
  this.memEntries.push(entry);
71
- }
72
48
  });
73
49
  this.memObserver.observe({ type: 'mark' });
74
50
  if (isMemoryRealtime)
@@ -76,57 +52,42 @@ class Performance {
76
52
  this.addMemoryMark('start');
77
53
  }
78
54
  }
79
- setMark(name) {
80
- const id = `${this.perfId}:${name}`;
81
- performance.mark(`${id}:start`);
82
- }
83
- clearMark(name) {
84
- const id = `${this.perfId}:${name}`;
85
- performance.mark(`${id}:end`);
86
- performance.measure(id, `${id}:start`, `${id}:end`);
87
- performance.clearMarks(`${id}:start`);
88
- performance.clearMarks(`${id}:end`);
89
- }
90
- async flush() {
91
- this.setMark('_flush');
92
- await new Promise(resolve => setTimeout(resolve, 1));
93
- this.clearMark('_flush');
55
+ registerHistogram(name) {
56
+ let histogram = this.histograms.get(name);
57
+ if (!histogram) {
58
+ histogram = createHistogram();
59
+ this.histograms.set(name, histogram);
60
+ }
61
+ return histogram;
94
62
  }
95
- getPerfEntriesByName() {
96
- return this.perfEntries.reduce((entries, entry) => {
97
- const name = entry.name.replace(`${this.perfId}:`, '');
98
- entries[name] = entries[name] ?? [];
99
- entries[name].push(entry.duration);
100
- return entries;
101
- }, {});
63
+ addMemoryMark(label) {
64
+ if (!this.isMemoryUsageEnabled)
65
+ return;
66
+ const detail = getMemInfo(label);
67
+ performance.mark(`${this.memId}:${label}`, { detail });
68
+ if (isMemoryRealtime)
69
+ log(detail);
102
70
  }
103
71
  getTimerifiedFunctionsTable() {
104
- const entriesByName = this.getPerfEntriesByName();
105
72
  const totalDuration = this.getCurrentDurationInMs();
106
73
  const table = new Table({ header: true });
107
- for (const [name, values] of Object.entries(entriesByName)) {
108
- const stats = getStats(values);
74
+ for (const [name, h] of this.histograms) {
75
+ if (h.count === 0)
76
+ continue;
77
+ const meanMs = h.mean / 1e6;
78
+ const sumMs = meanMs * h.count;
109
79
  table.row();
110
80
  table.cell('Name', name);
111
- table.cell('size', values.length);
112
- table.cell('min', stats.min, twoFixed);
113
- table.cell('max', stats.max, twoFixed);
114
- table.cell('median', stats.median, twoFixed);
115
- table.cell('sum', stats.sum, twoFixed);
116
- table.cell('%', (stats.sum / totalDuration) * 100, v => (typeof v === 'number' ? `${v.toFixed(0)}%` : ''));
81
+ table.cell('size', h.count);
82
+ table.cell('min', h.min / 1e6, twoFixed);
83
+ table.cell('max', h.max / 1e6, twoFixed);
84
+ table.cell('median', h.percentile(50) / 1e6, twoFixed);
85
+ table.cell('sum', sumMs, twoFixed);
86
+ table.cell('%', (sumMs / totalDuration) * 100, v => (typeof v === 'number' ? `${v.toFixed(0)}%` : ''));
117
87
  }
118
88
  table.sort('sum', 'desc');
119
89
  return table.toString();
120
90
  }
121
- addMemoryMark(label) {
122
- if (!this.isMemoryUsageEnabled)
123
- return;
124
- const id = `${this.memId}:${label}`;
125
- const detail = getMemInfo(label);
126
- performance.mark(id, { detail });
127
- if (isMemoryRealtime)
128
- log(detail);
129
- }
130
91
  getMemoryUsageTable() {
131
92
  const table = new Table({ header: true });
132
93
  let prevHeapUsed = 0;
@@ -168,12 +129,20 @@ class Performance {
168
129
  if (!this.isEnabled)
169
130
  return;
170
131
  this.addMemoryMark('end');
171
- await this.flush();
132
+ await new Promise(resolve => setTimeout(resolve, 1));
172
133
  }
173
134
  reset() {
174
- this.perfEntries = [];
175
- this.fnObserver?.disconnect();
135
+ this.histograms.clear();
136
+ this.memEntries.length = 0;
176
137
  this.memObserver?.disconnect();
177
138
  }
178
139
  }
179
140
  export const perfObserver = new Performance({ isTimerifyFunctions, isMemoryUsageEnabled, isDurationEnabled });
141
+ export const timerify = (fn, name = fn.name) => {
142
+ if (!isTimerifyFunctions)
143
+ return fn;
144
+ if (timerifyOnlyFnName && !timerifyOnlyFnName.includes(name))
145
+ return fn;
146
+ const histogram = perfObserver.registerHistogram(name);
147
+ return performance.timerify(Object.defineProperty(fn, 'name', { value: name }), { histogram });
148
+ };
@@ -1,4 +1,4 @@
1
- export declare const helpText = "\u2702\uFE0F Find unused dependencies, exports and files in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -h, --help Print this help text\n -V, --version Print version\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\n -c, --config [file] Configuration file path\n (default: [.]knip.json[c], knip.(js|ts), knip.config.(js|ts) or package.json#knip)\n --use-tsconfig-files Use tsconfig.json to define project files (override `project` patterns)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n\nMode\n --cache Enable caching\n --cache-location Change cache location (default: node_modules/.cache/knip)\n --include-entry-exports Include entry files when reporting unused exports\n --no-gitignore Don't respect .gitignore\n -p, --production Analyze only production source files (e.g. no test files, devDependencies)\n -s, --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n -w, --watch Watch mode\n\nScope\n -W, --workspace [filter] Filter workspaces by name, directory, or glob (can be repeated)\n -D, --directory [dir] Run process from a different directory (default: cwd)\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,binaries,unresolved,catalog\n --exports Shortcut for --include exports,nsExports,types,nsTypes,enumMembers,namespaceMembers,duplicates\n --files Shortcut for --include files\n --tags Include or exclude tagged exports\n\nFix\n -f, --fix Fix issues (modifies files in your repo)\n --fix-type Fix only issues of type, can be comma-separated or repeated (2)\n --allow-remove-files Allow Knip to remove files (with --fix)\n -F, --format Format modified files after --fix using the local formatter\n\nOutput\n --preprocessor Preprocess the results before providing it to the reporter(s), can be repeated\n --preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)\n --reporter Select reporter (default: symbols), can be repeated (3)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-config-hints Suppress configuration hints\n --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints\n --max-issues Maximum number of total issues before non-zero exit code (default: 0)\n --max-show-issues Maximum number of issues to display per type\n --no-exit-code Always exit with code zero (0)\n\nTroubleshooting\n -d, --debug Show debug output\n --memory Measure memory usage and display data table\n --memory-realtime Log memory usage in realtime\n --performance Measure count and running time of key functions and display stats table\n --performance-fn [name] Measure only function [name]\n -u, --duration Print total running time (zero overhead, no instrumentation)\n --trace Show trace output\n --trace-dependency [name] Show files that import the named dependency\n --trace-export [name] Show trace output for named export(s)\n --trace-file [file] Show trace output for exports in file\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, types, nsTypes, enumMembers, namespaceMembers, duplicates, catalog\n(2) Fixable issue types: dependencies, exports, types, files, catalog\n(3) Built-in reporters: symbols (default), compact, codeowners, json, codeclimate, markdown, disclosure, github-actions\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip --workspace @myorg/* --workspace '!@myorg/legacy'\n$ knip --workspace './apps/*' --workspace '@shared/utils'\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --tags=-lintignore\n\nWebsite: https://knip.dev";
1
+ export declare const helpText = "\u2702\uFE0F Find unused dependencies, exports and files in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -h, --help Print this help text\n -V, --version Print version\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\n -c, --config [file] Configuration file path\n (default: [.]knip.json[c], knip.(js|ts), knip.config.(js|ts) or package.json#knip)\n --use-tsconfig-files Use tsconfig.json to define project files (override `project` patterns)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n\nMode\n --cache Enable caching\n --cache-location Change cache location (default: node_modules/.cache/knip)\n --include-entry-exports Include entry files when reporting unused exports\n --no-gitignore Don't respect .gitignore\n -p, --production Analyze only production source files (e.g. no test files, devDependencies)\n -s, --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n -w, --watch Watch mode\n\nScope\n -W, --workspace [filter] Filter workspaces by name, directory, or glob (can be repeated)\n -D, --directory [dir] Run process from a different directory (default: cwd)\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,binaries,unresolved,catalog\n --exports Shortcut for --include exports,nsExports,types,nsTypes,enumMembers,namespaceMembers,duplicates\n --files Shortcut for --include files\n --tags Include or exclude tagged exports\n\nFix\n -f, --fix Fix issues (modifies files in your repo)\n --fix-type Fix only issues of type, can be comma-separated or repeated (2)\n --allow-remove-files Allow Knip to remove files (with --fix)\n -F, --format Format modified files after --fix using the local formatter\n\nOutput\n --preprocessor Preprocess the results before providing it to the reporter(s), can be repeated\n --preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)\n --reporter Select reporter (default: symbols), can be repeated (3)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-config-hints Suppress configuration hints\n --no-tag-hints Suppress tag hints\n --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints\n --treat-tag-hints-as-errors Exit with non-zero code (1) if there are any tag hints\n --max-issues Maximum number of total issues before non-zero exit code (default: 0)\n --max-show-issues Maximum number of issues to display per type\n --no-exit-code Always exit with code zero (0)\n\nTroubleshooting\n -d, --debug Show debug output\n --memory Measure memory usage and display data table\n --memory-realtime Log memory usage in realtime\n --performance Measure count and running time of key functions and display stats table\n --performance-fn [name] Measure only function [name]\n -u, --duration Print total running time (zero overhead, no instrumentation)\n --trace Show trace output\n --trace-dependency [name] Show files that import the named dependency\n --trace-export [name] Show trace output for named export(s)\n --trace-file [file] Show trace output for exports in file\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, types, nsTypes, enumMembers, namespaceMembers, duplicates, catalog\n(2) Fixable issue types: dependencies, exports, types, files, catalog\n(3) Built-in reporters: symbols (default), compact, codeowners, json, codeclimate, markdown, disclosure, github-actions\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip --workspace @myorg/* --workspace '!@myorg/legacy'\n$ knip --workspace './apps/*' --workspace '@shared/utils'\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --tags=-lintignore\n\nWebsite: https://knip.dev";
2
2
  export type ParsedCLIArgs = ReturnType<typeof parseCLIArgs>;
3
3
  export default function parseCLIArgs(): {
4
4
  cache?: boolean | undefined;
@@ -26,6 +26,7 @@ export default function parseCLIArgs(): {
26
26
  'no-exit-code'?: boolean | undefined;
27
27
  'no-gitignore'?: boolean | undefined;
28
28
  'no-progress'?: boolean | undefined;
29
+ 'no-tag-hints'?: boolean | undefined;
29
30
  performance?: boolean | undefined;
30
31
  'performance-fn'?: string | undefined;
31
32
  production?: boolean | undefined;
@@ -40,6 +41,7 @@ export default function parseCLIArgs(): {
40
41
  'trace-export'?: string | undefined;
41
42
  'trace-file'?: string | undefined;
42
43
  'treat-config-hints-as-errors'?: boolean | undefined;
44
+ 'treat-tag-hints-as-errors'?: boolean | undefined;
43
45
  tsConfig?: string | undefined;
44
46
  'use-tsconfig-files'?: boolean | undefined;
45
47
  version?: boolean | undefined;
@@ -43,7 +43,9 @@ Output
43
43
  --reporter Select reporter (default: symbols), can be repeated (3)
44
44
  --reporter-options Pass extra options to the reporter (as JSON string, see example)
45
45
  --no-config-hints Suppress configuration hints
46
+ --no-tag-hints Suppress tag hints
46
47
  --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints
48
+ --treat-tag-hints-as-errors Exit with non-zero code (1) if there are any tag hints
47
49
  --max-issues Maximum number of total issues before non-zero exit code (default: 0)
48
50
  --max-show-issues Maximum number of issues to display per type
49
51
  --no-exit-code Always exit with code zero (0)
@@ -104,6 +106,7 @@ export default function parseCLIArgs() {
104
106
  'no-exit-code': { type: 'boolean' },
105
107
  'no-gitignore': { type: 'boolean' },
106
108
  'no-progress': { type: 'boolean', short: 'n' },
109
+ 'no-tag-hints': { type: 'boolean' },
107
110
  performance: { type: 'boolean' },
108
111
  'performance-fn': { type: 'string' },
109
112
  production: { type: 'boolean', short: 'p' },
@@ -118,6 +121,7 @@ export default function parseCLIArgs() {
118
121
  'trace-export': { type: 'string' },
119
122
  'trace-file': { type: 'string' },
120
123
  'treat-config-hints-as-errors': { type: 'boolean' },
124
+ 'treat-tag-hints-as-errors': { type: 'boolean' },
121
125
  tsConfig: { type: 'string', short: 't' },
122
126
  'use-tsconfig-files': { type: 'boolean' },
123
127
  version: { type: 'boolean', short: 'V' },
@@ -18,7 +18,7 @@ const addExternalRef = (map, containingFilePath, ref) => {
18
18
  };
19
19
  export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, externalRefs, options) => (input, workspace) => {
20
20
  const { specifier, containingFilePath } = input;
21
- if (!containingFilePath || IGNORED_RUNTIME_DEPENDENCIES.has(specifier))
21
+ if (!containingFilePath)
22
22
  return;
23
23
  if (isBinary(input)) {
24
24
  const binaryName = fromBinary(input);
@@ -44,6 +44,8 @@ export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, extern
44
44
  });
45
45
  return;
46
46
  }
47
+ if (IGNORED_RUNTIME_DEPENDENCIES.has(specifier))
48
+ return;
47
49
  const packageName = getPackageNameFromSpecifier(specifier);
48
50
  if (packageName &&
49
51
  (isDependency(input) ||