knip 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/ConfigurationChief.d.ts +3 -3
  2. package/dist/ConfigurationValidator.d.ts +21 -21
  3. package/dist/ProjectPrincipal.d.ts +1 -1
  4. package/dist/ProjectPrincipal.js +3 -5
  5. package/dist/WorkspaceWorker.d.ts +2 -2
  6. package/dist/WorkspaceWorker.js +61 -44
  7. package/dist/binaries/index.js +2 -2
  8. package/dist/binaries/resolvers/index.d.ts +12 -12
  9. package/dist/compilers/index.d.ts +6 -7
  10. package/dist/compilers/index.js +0 -3
  11. package/dist/constants.d.ts +1 -2
  12. package/dist/constants.js +8 -4
  13. package/dist/plugins/_template/index.d.ts +10 -9
  14. package/dist/plugins/_template/index.js +16 -30
  15. package/dist/plugins/angular/index.d.ts +8 -6
  16. package/dist/plugins/angular/index.js +17 -22
  17. package/dist/plugins/astro/index.d.ts +7 -7
  18. package/dist/plugins/astro/index.js +14 -17
  19. package/dist/plugins/ava/index.d.ts +9 -7
  20. package/dist/plugins/ava/index.js +19 -21
  21. package/dist/plugins/babel/helpers.js +1 -1
  22. package/dist/plugins/babel/index.d.ts +7 -7
  23. package/dist/plugins/babel/index.js +15 -26
  24. package/dist/plugins/capacitor/index.d.ts +7 -6
  25. package/dist/plugins/capacitor/index.js +11 -18
  26. package/dist/plugins/changesets/index.d.ts +7 -6
  27. package/dist/plugins/changesets/index.js +14 -21
  28. package/dist/plugins/changesets/types.d.ts +3 -0
  29. package/dist/plugins/changesets/types.js +1 -0
  30. package/dist/plugins/commitizen/index.d.ts +8 -7
  31. package/dist/plugins/commitizen/index.js +13 -21
  32. package/dist/plugins/commitlint/index.d.ts +9 -6
  33. package/dist/plugins/commitlint/index.js +11 -19
  34. package/dist/plugins/cspell/index.d.ts +7 -6
  35. package/dist/plugins/cspell/index.js +12 -20
  36. package/dist/plugins/cypress/index.d.ts +7 -7
  37. package/dist/plugins/cypress/index.js +13 -21
  38. package/dist/plugins/drizzle/index.d.ts +7 -6
  39. package/dist/plugins/drizzle/index.js +13 -16
  40. package/dist/plugins/eleventy/index.d.ts +11 -9
  41. package/dist/plugins/eleventy/index.js +35 -41
  42. package/dist/plugins/eslint/helpers.d.ts +3 -5
  43. package/dist/plugins/eslint/helpers.js +10 -15
  44. package/dist/plugins/eslint/index.d.ts +10 -8
  45. package/dist/plugins/eslint/index.js +15 -29
  46. package/dist/plugins/gatsby/index.d.ts +8 -7
  47. package/dist/plugins/gatsby/index.js +15 -22
  48. package/dist/plugins/github-actions/index.d.ts +6 -6
  49. package/dist/plugins/github-actions/index.js +15 -25
  50. package/dist/plugins/graphql-codegen/index.d.ts +8 -7
  51. package/dist/plugins/graphql-codegen/index.js +15 -23
  52. package/dist/plugins/husky/index.d.ts +6 -6
  53. package/dist/plugins/husky/index.js +10 -16
  54. package/dist/plugins/jest/index.d.ts +9 -7
  55. package/dist/plugins/jest/index.js +50 -31
  56. package/dist/plugins/lefthook/index.d.ts +6 -6
  57. package/dist/plugins/lefthook/index.js +19 -24
  58. package/dist/plugins/lint-staged/index.d.ts +8 -7
  59. package/dist/plugins/lint-staged/index.js +16 -23
  60. package/dist/plugins/linthtml/index.d.ts +8 -7
  61. package/dist/plugins/linthtml/index.js +16 -24
  62. package/dist/plugins/markdownlint/index.d.ts +7 -6
  63. package/dist/plugins/markdownlint/index.js +12 -17
  64. package/dist/plugins/mocha/index.d.ts +9 -7
  65. package/dist/plugins/mocha/index.js +19 -22
  66. package/dist/plugins/msw/index.d.ts +8 -7
  67. package/dist/plugins/msw/index.js +12 -15
  68. package/dist/plugins/netlify/index.d.ts +9 -7
  69. package/dist/plugins/netlify/index.js +23 -27
  70. package/dist/plugins/next/index.d.ts +6 -7
  71. package/dist/plugins/next/index.js +10 -18
  72. package/dist/plugins/node-test-runner/index.d.ts +5 -6
  73. package/dist/plugins/node-test-runner/index.js +6 -18
  74. package/dist/plugins/npm-package-json-lint/index.d.ts +8 -7
  75. package/dist/plugins/npm-package-json-lint/index.js +12 -19
  76. package/dist/plugins/nx/index.d.ts +7 -6
  77. package/dist/plugins/nx/index.js +18 -27
  78. package/dist/plugins/nyc/index.d.ts +7 -6
  79. package/dist/plugins/nyc/index.js +11 -17
  80. package/dist/plugins/playwright/index.d.ts +11 -13
  81. package/dist/plugins/playwright/index.js +23 -30
  82. package/dist/plugins/playwright-ct/index.d.ts +8 -7
  83. package/dist/plugins/playwright-ct/index.js +12 -24
  84. package/dist/plugins/postcss/index.d.ts +7 -6
  85. package/dist/plugins/postcss/index.js +12 -21
  86. package/dist/plugins/prettier/index.d.ts +7 -6
  87. package/dist/plugins/prettier/index.js +14 -20
  88. package/dist/plugins/release-it/index.d.ts +8 -7
  89. package/dist/plugins/release-it/index.js +18 -27
  90. package/dist/plugins/remark/index.d.ts +8 -7
  91. package/dist/plugins/remark/index.js +13 -28
  92. package/dist/plugins/remix/index.d.ts +6 -7
  93. package/dist/plugins/remix/index.js +10 -20
  94. package/dist/plugins/rollup/index.d.ts +5 -6
  95. package/dist/plugins/rollup/index.js +8 -16
  96. package/dist/plugins/semantic-release/index.d.ts +8 -7
  97. package/dist/plugins/semantic-release/index.js +13 -25
  98. package/dist/plugins/sentry/index.d.ts +5 -6
  99. package/dist/plugins/sentry/index.js +8 -16
  100. package/dist/plugins/storybook/index.d.ts +10 -8
  101. package/dist/plugins/storybook/index.js +28 -35
  102. package/dist/plugins/stryker/index.d.ts +7 -6
  103. package/dist/plugins/stryker/index.js +10 -18
  104. package/dist/plugins/stylelint/index.d.ts +7 -6
  105. package/dist/plugins/stylelint/index.js +13 -23
  106. package/dist/plugins/svelte/index.d.ts +7 -8
  107. package/dist/plugins/svelte/index.js +13 -23
  108. package/dist/plugins/tailwind/index.d.ts +5 -6
  109. package/dist/plugins/tailwind/index.js +8 -14
  110. package/dist/plugins/tsup/index.d.ts +7 -6
  111. package/dist/plugins/tsup/index.js +14 -21
  112. package/dist/plugins/typedoc/index.d.ts +10 -7
  113. package/dist/plugins/typedoc/index.js +14 -24
  114. package/dist/plugins/typescript/index.d.ts +8 -7
  115. package/dist/plugins/typescript/index.js +31 -25
  116. package/dist/plugins/unbuild/index.d.ts +7 -6
  117. package/dist/plugins/unbuild/index.js +12 -17
  118. package/dist/plugins/vercel-og/index.d.ts +5 -6
  119. package/dist/plugins/vercel-og/index.js +8 -16
  120. package/dist/plugins/vite/index.d.ts +9 -7
  121. package/dist/plugins/vite/index.js +13 -18
  122. package/dist/plugins/vitest/index.d.ts +11 -9
  123. package/dist/plugins/vitest/index.js +62 -49
  124. package/dist/plugins/vue/index.d.ts +7 -6
  125. package/dist/plugins/vue/index.js +14 -26
  126. package/dist/plugins/webpack/index.d.ts +7 -6
  127. package/dist/plugins/webpack/index.js +17 -20
  128. package/dist/plugins/wireit/index.d.ts +8 -7
  129. package/dist/plugins/wireit/index.js +12 -20
  130. package/dist/plugins/yorkie/index.d.ts +8 -7
  131. package/dist/plugins/yorkie/index.js +13 -21
  132. package/dist/plugins.d.ts +3 -0
  133. package/dist/plugins.js +14 -0
  134. package/dist/reporters/index.d.ts +5 -5
  135. package/dist/types/config.d.ts +1 -1
  136. package/dist/types/package-json.d.ts +12 -13
  137. package/dist/types/plugins.d.ts +20 -14
  138. package/dist/types/util.d.ts +0 -13
  139. package/dist/typescript/SourceFileManager.js +3 -0
  140. package/dist/typescript/createHosts.js +4 -3
  141. package/dist/typescript/resolveModuleNames.js +26 -41
  142. package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
  143. package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
  144. package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
  145. package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
  146. package/dist/typescript/visitors/dynamic-imports/propertyAccessCall.d.ts +1 -1
  147. package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
  148. package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
  149. package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
  150. package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
  151. package/dist/typescript/visitors/exports/index.d.ts +1 -1
  152. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
  153. package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
  154. package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
  155. package/dist/typescript/visitors/imports/index.d.ts +1 -1
  156. package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
  157. package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
  158. package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
  159. package/dist/typescript/visitors/scripts/index.d.ts +1 -1
  160. package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
  161. package/dist/util/Performance.d.ts +1 -4
  162. package/dist/util/Performance.js +5 -1
  163. package/dist/util/fs.js +0 -3
  164. package/dist/util/loader.d.ts +0 -2
  165. package/dist/util/loader.js +8 -16
  166. package/dist/util/object.d.ts +1 -1
  167. package/dist/util/path.d.ts +0 -3
  168. package/dist/util/path.js +0 -1
  169. package/dist/util/plugin.d.ts +4 -1
  170. package/dist/util/plugin.js +28 -1
  171. package/dist/util/require.d.ts +1 -0
  172. package/dist/util/require.js +13 -0
  173. package/dist/util/tsconfig-loader.js +1 -2
  174. package/dist/util/type.d.ts +1 -1
  175. package/dist/version.d.ts +1 -1
  176. package/dist/version.js +1 -1
  177. package/package.json +5 -1
  178. package/dist/plugins/eslint/fallback.d.ts +0 -1
  179. package/dist/plugins/eslint/fallback.js +0 -18
@@ -40,7 +40,7 @@ export declare class ConfigurationChief {
40
40
  constructor({ cwd, isProduction, isStrict, isIncludeEntryExports }: ConfigurationManagerOptions);
41
41
  init(): Promise<void>;
42
42
  private loadResolvedConfigurationFile;
43
- getRules(): import("src/types/issues.js").Rules;
43
+ getRules(): import("#p/types/issues.ts").Rules;
44
44
  getFilters(): {
45
45
  dir: string;
46
46
  } | {
@@ -68,7 +68,6 @@ export declare class ConfigurationChief {
68
68
  ignoreDependencies: (string | RegExp)[];
69
69
  };
70
70
  getConfigForWorkspace(workspaceName: string, extensions: string[]): {
71
- typescript?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
72
71
  astro?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
73
72
  svelte?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
74
73
  vue?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -108,6 +107,7 @@ export declare class ConfigurationChief {
108
107
  tailwind?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
109
108
  tsup?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
110
109
  typedoc?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
110
+ typescript?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
111
111
  unbuild?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
112
112
  vite?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
113
113
  vitest?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -130,7 +130,7 @@ export declare class ConfigurationChief {
130
130
  ignore: string[];
131
131
  isIncludeEntryExports: any;
132
132
  };
133
- getIncludedIssueTypes(): import("src/types/issues.js").Report;
133
+ getIncludedIssueTypes(): import("#p/types/issues.ts").Report;
134
134
  findWorkspaceByFilePath(filePath: string): Workspace | undefined;
135
135
  findWorkspaceByName(name: string): Workspace | undefined;
136
136
  getUnusedIgnoredWorkspaces(): string[];
@@ -13,28 +13,28 @@ export declare const pluginSchema: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodSt
13
13
  project?: string | string[] | undefined;
14
14
  }>]>;
15
15
  export declare const ConfigurationValidator: z.ZodObject<{
16
- ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
17
- ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
18
- ignoreWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
16
  exclude: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"files">, z.ZodLiteral<"dependencies">, z.ZodLiteral<"devDependencies">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"binaries">, z.ZodLiteral<"unresolved">, z.ZodLiteral<"exports">, z.ZodLiteral<"types">, z.ZodLiteral<"nsExports">, z.ZodLiteral<"nsTypes">, z.ZodLiteral<"duplicates">, z.ZodLiteral<"enumMembers">, z.ZodLiteral<"classMembers">]>, "many">>;
20
17
  rules: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodLiteral<"files">, z.ZodLiteral<"dependencies">, z.ZodLiteral<"devDependencies">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"binaries">, z.ZodLiteral<"unresolved">, z.ZodLiteral<"exports">, z.ZodLiteral<"types">, z.ZodLiteral<"nsExports">, z.ZodLiteral<"nsTypes">, z.ZodLiteral<"duplicates">, z.ZodLiteral<"enumMembers">, z.ZodLiteral<"classMembers">]>, z.ZodEnum<["error", "warn", "off"]>>>;
21
18
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
22
19
  project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
23
20
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
24
21
  ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
22
+ ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
23
+ ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
25
24
  ignoreExportsUsedInFile: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodUnion<[z.ZodLiteral<"class">, z.ZodLiteral<"enum">, z.ZodLiteral<"function">, z.ZodLiteral<"interface">, z.ZodLiteral<"member">, z.ZodLiteral<"type">]>, z.ZodBoolean>]>>;
25
+ ignoreWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
26
  includeEntryExports: z.ZodOptional<z.ZodBoolean>;
27
27
  compilers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodString>>]>>>;
28
28
  syncCompilers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodString>>>;
29
29
  asyncCompilers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodString>>>>;
30
30
  include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"files">, z.ZodLiteral<"dependencies">, z.ZodLiteral<"devDependencies">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"binaries">, z.ZodLiteral<"unresolved">, z.ZodLiteral<"exports">, z.ZodLiteral<"types">, z.ZodLiteral<"nsExports">, z.ZodLiteral<"nsTypes">, z.ZodLiteral<"duplicates">, z.ZodLiteral<"enumMembers">, z.ZodLiteral<"classMembers">]>, "many">>;
31
31
  workspaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
32
- ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
33
- ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
34
32
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
35
33
  project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
36
34
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
37
35
  ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
36
+ ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
37
+ ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
38
38
  includeEntryExports: z.ZodOptional<z.ZodBoolean>;
39
39
  astro: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
40
40
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -752,12 +752,12 @@ export declare const ConfigurationValidator: z.ZodObject<{
752
752
  project?: string | string[] | undefined;
753
753
  }>]>>;
754
754
  }, "strip", z.ZodTypeAny, {
755
- ignoreBinaries?: (string | RegExp)[] | undefined;
756
- ignoreDependencies?: (string | RegExp)[] | undefined;
757
755
  entry?: string | string[] | undefined;
758
756
  project?: string | string[] | undefined;
759
757
  paths?: Record<string, string[]> | undefined;
760
758
  ignore?: string | string[] | undefined;
759
+ ignoreBinaries?: (string | RegExp)[] | undefined;
760
+ ignoreDependencies?: (string | RegExp)[] | undefined;
761
761
  includeEntryExports?: boolean | undefined;
762
762
  astro?: string | boolean | string[] | {
763
763
  config?: string | string[] | undefined;
@@ -1035,12 +1035,12 @@ export declare const ConfigurationValidator: z.ZodObject<{
1035
1035
  project?: string | string[] | undefined;
1036
1036
  } | undefined;
1037
1037
  }, {
1038
- ignoreBinaries?: (string | RegExp)[] | undefined;
1039
- ignoreDependencies?: (string | RegExp)[] | undefined;
1040
1038
  entry?: string | string[] | undefined;
1041
1039
  project?: string | string[] | undefined;
1042
1040
  paths?: Record<string, string[]> | undefined;
1043
1041
  ignore?: string | string[] | undefined;
1042
+ ignoreBinaries?: (string | RegExp)[] | undefined;
1043
+ ignoreDependencies?: (string | RegExp)[] | undefined;
1044
1044
  includeEntryExports?: boolean | undefined;
1045
1045
  astro?: string | boolean | string[] | {
1046
1046
  config?: string | string[] | undefined;
@@ -2034,28 +2034,28 @@ export declare const ConfigurationValidator: z.ZodObject<{
2034
2034
  project?: string | string[] | undefined;
2035
2035
  }>]>>;
2036
2036
  }, "strip", z.ZodTypeAny, {
2037
- ignoreBinaries?: (string | RegExp)[] | undefined;
2038
- ignoreDependencies?: (string | RegExp)[] | undefined;
2039
- ignoreWorkspaces?: string[] | undefined;
2040
2037
  exclude?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
2041
2038
  rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
2042
2039
  entry?: string | string[] | undefined;
2043
2040
  project?: string | string[] | undefined;
2044
2041
  paths?: Record<string, string[]> | undefined;
2045
2042
  ignore?: string | string[] | undefined;
2046
- ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "interface" | "enum" | "class" | "member", boolean>> | undefined;
2043
+ ignoreBinaries?: (string | RegExp)[] | undefined;
2044
+ ignoreDependencies?: (string | RegExp)[] | undefined;
2045
+ ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
2046
+ ignoreWorkspaces?: string[] | undefined;
2047
2047
  includeEntryExports?: boolean | undefined;
2048
2048
  compilers?: Record<string, ((args_0: string, args_1: string, ...args_2: unknown[]) => string) | ((args_0: string, args_1: string, ...args_2: unknown[]) => Promise<string>)> | undefined;
2049
2049
  syncCompilers?: Record<string, (args_0: string, args_1: string, ...args_2: unknown[]) => string> | undefined;
2050
2050
  asyncCompilers?: Record<string, (args_0: string, args_1: string, ...args_2: unknown[]) => Promise<string>> | undefined;
2051
2051
  include?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
2052
2052
  workspaces?: Record<string, {
2053
- ignoreBinaries?: (string | RegExp)[] | undefined;
2054
- ignoreDependencies?: (string | RegExp)[] | undefined;
2055
2053
  entry?: string | string[] | undefined;
2056
2054
  project?: string | string[] | undefined;
2057
2055
  paths?: Record<string, string[]> | undefined;
2058
2056
  ignore?: string | string[] | undefined;
2057
+ ignoreBinaries?: (string | RegExp)[] | undefined;
2058
+ ignoreDependencies?: (string | RegExp)[] | undefined;
2059
2059
  includeEntryExports?: boolean | undefined;
2060
2060
  astro?: string | boolean | string[] | {
2061
2061
  config?: string | string[] | undefined;
@@ -2609,28 +2609,28 @@ export declare const ConfigurationValidator: z.ZodObject<{
2609
2609
  project?: string | string[] | undefined;
2610
2610
  } | undefined;
2611
2611
  }, {
2612
- ignoreBinaries?: (string | RegExp)[] | undefined;
2613
- ignoreDependencies?: (string | RegExp)[] | undefined;
2614
- ignoreWorkspaces?: string[] | undefined;
2615
2612
  exclude?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
2616
2613
  rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
2617
2614
  entry?: string | string[] | undefined;
2618
2615
  project?: string | string[] | undefined;
2619
2616
  paths?: Record<string, string[]> | undefined;
2620
2617
  ignore?: string | string[] | undefined;
2621
- ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "interface" | "enum" | "class" | "member", boolean>> | undefined;
2618
+ ignoreBinaries?: (string | RegExp)[] | undefined;
2619
+ ignoreDependencies?: (string | RegExp)[] | undefined;
2620
+ ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
2621
+ ignoreWorkspaces?: string[] | undefined;
2622
2622
  includeEntryExports?: boolean | undefined;
2623
2623
  compilers?: Record<string, ((args_0: string, args_1: string, ...args_2: unknown[]) => string) | ((args_0: string, args_1: string, ...args_2: unknown[]) => Promise<string>)> | undefined;
2624
2624
  syncCompilers?: Record<string, (args_0: string, args_1: string, ...args_2: unknown[]) => string> | undefined;
2625
2625
  asyncCompilers?: Record<string, (args_0: string, args_1: string, ...args_2: unknown[]) => Promise<string>> | undefined;
2626
2626
  include?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
2627
2627
  workspaces?: Record<string, {
2628
- ignoreBinaries?: (string | RegExp)[] | undefined;
2629
- ignoreDependencies?: (string | RegExp)[] | undefined;
2630
2628
  entry?: string | string[] | undefined;
2631
2629
  project?: string | string[] | undefined;
2632
2630
  paths?: Record<string, string[]> | undefined;
2633
2631
  ignore?: string | string[] | undefined;
2632
+ ignoreBinaries?: (string | RegExp)[] | undefined;
2633
+ ignoreDependencies?: (string | RegExp)[] | undefined;
2634
2634
  includeEntryExports?: boolean | undefined;
2635
2635
  astro?: string | boolean | string[] | {
2636
2636
  config?: string | string[] | undefined;
@@ -60,7 +60,7 @@ export declare class ProjectPrincipal {
60
60
  };
61
61
  exports: {
62
62
  exported: import("./types/exports.js").SerializableExports;
63
- duplicate: import("src/types/issues.js").IssueSymbol[][];
63
+ duplicate: import("#p/types/issues.ts").IssueSymbol[][];
64
64
  };
65
65
  scripts: Set<string>;
66
66
  };
@@ -1,7 +1,6 @@
1
1
  import ts from 'typescript';
2
- import { dummyCompilers, getCompilerExtensions } from './compilers/index.js';
3
- import { DEFAULT_EXTENSIONS } from './constants.js';
4
- import { IGNORED_FILE_EXTENSIONS } from './constants.js';
2
+ import { getCompilerExtensions } from './compilers/index.js';
3
+ import { DEFAULT_EXTENSIONS, FOREIGN_FILE_EXTENSIONS } from './constants.js';
5
4
  import { createHosts } from './typescript/createHosts.js';
6
5
  import { _getImportsAndExports } from './typescript/getImportsAndExports.js';
7
6
  import { createCustomModuleResolver } from './typescript/resolveModuleNames.js';
@@ -58,7 +57,6 @@ export class ProjectPrincipal {
58
57
  this.isSkipLibs = isSkipLibs;
59
58
  }
60
59
  init() {
61
- this.addCompilers([dummyCompilers, new Map()]);
62
60
  const { fileManager, compilerHost, resolveModuleNames, languageServiceHost } = createHosts({
63
61
  cwd: this.cwd,
64
62
  compilerOptions: this.compilerOptions,
@@ -166,7 +164,7 @@ export class ProjectPrincipal {
166
164
  const isIgnored = this.isGitIgnored(join(dirname(filePath), sanitizedSpecifier));
167
165
  if (!isIgnored) {
168
166
  const ext = extname(sanitizedSpecifier);
169
- const hasIgnoredExtension = IGNORED_FILE_EXTENSIONS.has(ext);
167
+ const hasIgnoredExtension = FOREIGN_FILE_EXTENSIONS.has(ext);
170
168
  if (!ext || (ext !== '.json' && !hasIgnoredExtension)) {
171
169
  unresolvedImports.add(unresolvedImport);
172
170
  }
@@ -27,7 +27,7 @@ export declare class WorkspaceWorker {
27
27
  isStrict: boolean;
28
28
  rootIgnore: Configuration['ignore'];
29
29
  negatedWorkspacePatterns: string[];
30
- enabledPluginsMap: Record<"typescript" | "astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
30
+ enabledPluginsMap: Record<"astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
31
31
  enabledPlugins: PluginName[];
32
32
  enabledPluginsInAncestors: string[];
33
33
  constructor({ name, dir, cwd, config, manifest, dependencies, isProduction, isStrict, rootIgnore, negatedWorkspacePatterns, enabledPluginsInAncestors, }: WorkspaceManagerOptions);
@@ -46,7 +46,7 @@ export declare class WorkspaceWorker {
46
46
  entryFilePatterns: Set<string>;
47
47
  productionEntryFilePatterns: Set<string>;
48
48
  referencedDependencies: ReferencedDependencies;
49
- enabledPlugins: ("typescript" | "astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
49
+ enabledPlugins: ("astro" | "svelte" | "vue" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "msw" | "netlify" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vite" | "vitest" | "webpack" | "wireit" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
50
50
  }>;
51
51
  }
52
52
  export {};
@@ -1,9 +1,9 @@
1
- import * as plugins from './plugins/index.js';
1
+ import { plugins } from './plugins.js';
2
2
  import { debugLogArray, debugLogObject } from './util/debug.js';
3
3
  import { _pureGlob, negate, hasProductionSuffix, hasNoProductionSuffix, prependDirToPattern } from './util/glob.js';
4
- import { FAKE_PATH } from './util/loader.js';
5
4
  import { get, getKeysByValue } from './util/object.js';
6
- import { basename, toPosix } from './util/path.js';
5
+ import { basename, dirname, join, toPosix } from './util/path.js';
6
+ import { getFinalEntryPaths, loadConfigForPlugin } from './util/plugin.js';
7
7
  import { fromEntryPattern, fromProductionEntryPattern, isEntryPattern, isProductionEntryPattern, } from './util/protocols.js';
8
8
  const nullConfig = { config: null, entry: null, project: null };
9
9
  const initEnabledPluginsMap = () => Object.keys(plugins).reduce((enabled, pluginName) => ({ ...enabled, [pluginName]: false }), {});
@@ -56,8 +56,8 @@ export class WorkspaceWorker {
56
56
  }
57
57
  }
58
58
  const enabledPlugins = getKeysByValue(this.enabledPluginsMap, true);
59
- const enabledPluginNames = enabledPlugins.map(name => plugins[name].NAME);
60
- debugLogObject(this.name, 'Enabled plugins', enabledPluginNames);
59
+ const enabledPluginTitles = enabledPlugins.map(name => plugins[name].title);
60
+ debugLogObject(this.name, 'Enabled plugins', enabledPluginTitles);
61
61
  return enabledPlugins;
62
62
  }
63
63
  getConfigForPlugin(pluginName) {
@@ -92,7 +92,7 @@ export class WorkspaceWorker {
92
92
  const pluginConfig = this.getConfigForPlugin(pluginName);
93
93
  if (this.enabledPluginsMap[pluginName]) {
94
94
  const { entry, project } = pluginConfig;
95
- patterns.push(...(project ?? entry ?? ('PROJECT_FILE_PATTERNS' in plugin ? plugin.PROJECT_FILE_PATTERNS : [])));
95
+ patterns.push(...(project ?? entry ?? plugin.project ?? []));
96
96
  }
97
97
  }
98
98
  return [patterns, this.negatedWorkspacePatterns].flat();
@@ -103,8 +103,7 @@ export class WorkspaceWorker {
103
103
  const pluginConfig = this.getConfigForPlugin(pluginName);
104
104
  if (this.enabledPluginsMap[pluginName] && pluginConfig) {
105
105
  const { config } = pluginConfig;
106
- const defaultConfigFiles = 'CONFIG_FILE_PATTERNS' in plugin ? plugin.CONFIG_FILE_PATTERNS : [];
107
- patterns.push(...(config ?? defaultConfigFiles));
106
+ patterns.push(...(config ?? plugin.config ?? []));
108
107
  }
109
108
  }
110
109
  return patterns;
@@ -141,8 +140,7 @@ export class WorkspaceWorker {
141
140
  const plugin = plugins[pluginName];
142
141
  const pluginConfig = this.getConfigForPlugin(pluginName);
143
142
  if (pluginConfig) {
144
- const defaultConfig = 'CONFIG_FILE_PATTERNS' in plugin ? plugin.CONFIG_FILE_PATTERNS : [];
145
- return pluginConfig.config ?? defaultConfig;
143
+ return pluginConfig.config ?? plugin.config ?? [];
146
144
  }
147
145
  return [];
148
146
  }
@@ -155,46 +153,65 @@ export class WorkspaceWorker {
155
153
  const referencedDependencies = new Set();
156
154
  const name = this.name;
157
155
  const cwd = this.dir;
156
+ const baseOptions = {
157
+ cwd,
158
+ manifest: this.manifest,
159
+ manifestScriptNames: this.manifestScriptNames,
160
+ dependencies: this.dependencies,
161
+ isProduction: this.isProduction,
162
+ enabledPlugins: this.enabledPlugins,
163
+ };
158
164
  for (const [pluginName, plugin] of Object.entries(plugins)) {
159
165
  if (this.enabledPluginsMap[pluginName]) {
160
- const hasDependencyFinder = 'findDependencies' in plugin && typeof plugin.findDependencies === 'function';
161
- if (hasDependencyFinder) {
162
- const pluginConfig = this.getConfigForPlugin(pluginName);
163
- if (!pluginConfig)
164
- continue;
165
- const patterns = this.getConfigurationFilePatterns(pluginName);
166
- const allConfigFilePaths = await _pureGlob({ patterns, cwd, gitignore: false });
167
- const configFilePaths = allConfigFilePaths.filter(filePath => basename(filePath) !== 'package.json' ||
168
- get(this.manifest, 'PACKAGE_JSON_PATH' in plugin ? plugin.PACKAGE_JSON_PATH : pluginName));
169
- debugLogArray([name, plugin.NAME], 'config file paths', configFilePaths);
170
- if (configFilePaths.length === 0)
171
- configFilePaths.push(FAKE_PATH);
172
- const pluginDependencies = new Set();
173
- for (const configFilePath of configFilePaths) {
174
- const dependencies = await plugin.findDependencies(configFilePath, {
175
- cwd,
176
- manifest: this.manifest,
177
- manifestScriptNames: this.manifestScriptNames,
178
- dependencies: this.dependencies,
179
- config: pluginConfig,
180
- isProduction: this.isProduction,
181
- enabledPlugins: this.enabledPlugins,
182
- });
183
- dependencies.forEach(specifier => {
184
- pluginDependencies.add(specifier);
185
- if (isEntryPattern(specifier)) {
186
- entryFilePatterns.add(fromEntryPattern(specifier));
187
- }
188
- else if (isProductionEntryPattern(specifier)) {
189
- productionEntryFilePatterns.add(fromProductionEntryPattern(specifier));
166
+ const hasResolveEntryPaths = typeof plugin.resolveEntryPaths === 'function';
167
+ const hasResolveConfig = typeof plugin.resolveConfig === 'function';
168
+ const shouldRunConfigResolver = hasResolveConfig && (!this.isProduction || (this.isProduction && 'production' in plugin));
169
+ const hasResolve = typeof plugin.resolve === 'function';
170
+ const pluginConfig = this.getConfigForPlugin(pluginName);
171
+ if (!pluginConfig)
172
+ continue;
173
+ const patterns = this.getConfigurationFilePatterns(pluginName);
174
+ const allConfigFilePaths = await _pureGlob({ patterns, cwd, gitignore: false });
175
+ const configFilePaths = allConfigFilePaths.filter(filePath => basename(filePath) !== 'package.json' || get(this.manifest, plugin.packageJsonPath ?? pluginName));
176
+ debugLogArray([name, plugin.title], 'config file paths', configFilePaths);
177
+ const pluginDependencies = new Set();
178
+ const addDependency = (specifier, configFilePath) => {
179
+ pluginDependencies.add(specifier);
180
+ if (isEntryPattern(specifier)) {
181
+ entryFilePatterns.add(fromEntryPattern(specifier));
182
+ }
183
+ else if (isProductionEntryPattern(specifier)) {
184
+ productionEntryFilePatterns.add(fromProductionEntryPattern(specifier));
185
+ }
186
+ else if (configFilePath) {
187
+ referencedDependencies.add([configFilePath, toPosix(specifier)]);
188
+ }
189
+ };
190
+ const options = { ...baseOptions, config: pluginConfig, configFileDir: cwd, configFileName: '' };
191
+ const configEntryPaths = [];
192
+ for (const configFilePath of configFilePaths) {
193
+ const opts = { ...options, configFileDir: dirname(configFilePath), configFileName: basename(configFilePath) };
194
+ if (hasResolveEntryPaths || shouldRunConfigResolver) {
195
+ const config = await loadConfigForPlugin(configFilePath, plugin, opts, pluginName);
196
+ if (config) {
197
+ if (hasResolveEntryPaths) {
198
+ const dependencies = await plugin.resolveEntryPaths(config, opts);
199
+ dependencies.forEach(id => configEntryPaths.push(id));
190
200
  }
191
- else {
192
- referencedDependencies.add([configFilePath, toPosix(specifier)]);
201
+ if (shouldRunConfigResolver) {
202
+ const dependencies = await plugin.resolveConfig(config, opts);
203
+ dependencies.forEach(id => addDependency(id, configFilePath));
193
204
  }
194
- });
205
+ }
195
206
  }
196
- debugLogArray([name, plugin.NAME], 'dependencies', pluginDependencies);
197
207
  }
208
+ const finalEntryPaths = getFinalEntryPaths(plugin, options, configEntryPaths);
209
+ finalEntryPaths.forEach(id => addDependency(id));
210
+ if (hasResolve) {
211
+ const dependencies = await plugin.resolve(options);
212
+ dependencies.forEach(id => addDependency(id, join(cwd, 'package.json')));
213
+ }
214
+ debugLogArray([name, plugin.title], 'dependencies', pluginDependencies);
198
215
  }
199
216
  }
200
217
  return {
@@ -1,4 +1,4 @@
1
- import { IGNORED_FILE_EXTENSIONS } from '../constants.js';
1
+ import { FOREIGN_FILE_EXTENSIONS } from '../constants.js';
2
2
  import { compact } from '../util/array.js';
3
3
  import { getPackageNameFromModuleSpecifier } from '../util/modules.js';
4
4
  import { extname, isInternal } from '../util/path.js';
@@ -18,7 +18,7 @@ const getDependenciesFromScripts = (npmScripts, options) => {
18
18
  }
19
19
  if (isInternal(identifier)) {
20
20
  const ext = extname(identifier);
21
- if (ext && IGNORED_FILE_EXTENSIONS.has(ext))
21
+ if (ext && FOREIGN_FILE_EXTENSIONS.has(ext))
22
22
  return;
23
23
  return identifier;
24
24
  }
@@ -1,15 +1,15 @@
1
1
  declare const _default: {
2
- bun: import("src/binaries/types.js").Resolver;
3
- c8: import("src/binaries/types.js").Resolver;
4
- dotenv: import("src/binaries/types.js").Resolver;
5
- node: import("src/binaries/types.js").Resolver;
6
- nodemon: import("src/binaries/types.js").Resolver;
7
- npx: import("src/binaries/types.js").Resolver;
8
- nx: import("src/binaries/types.js").Resolver;
9
- pnpm: import("src/binaries/types.js").Resolver;
10
- rollup: import("src/binaries/types.js").Resolver;
11
- 'ts-node': import("src/binaries/types.js").Resolver;
12
- tsx: import("src/binaries/types.js").Resolver;
13
- yarn: import("src/binaries/types.js").Resolver;
2
+ bun: import("#p/binaries/types.ts").Resolver;
3
+ c8: import("#p/binaries/types.ts").Resolver;
4
+ dotenv: import("#p/binaries/types.ts").Resolver;
5
+ node: import("#p/binaries/types.ts").Resolver;
6
+ nodemon: import("#p/binaries/types.ts").Resolver;
7
+ npx: import("#p/binaries/types.ts").Resolver;
8
+ nx: import("#p/binaries/types.ts").Resolver;
9
+ pnpm: import("#p/binaries/types.ts").Resolver;
10
+ rollup: import("#p/binaries/types.ts").Resolver;
11
+ 'ts-node': import("#p/binaries/types.ts").Resolver;
12
+ tsx: import("#p/binaries/types.ts").Resolver;
13
+ yarn: import("#p/binaries/types.ts").Resolver;
14
14
  };
15
15
  export default _default;
@@ -4,26 +4,26 @@ import type { DependencySet } from '../types/workspace.js';
4
4
  export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
5
5
  syncCompilers: Record<string, SyncCompilerFn>;
6
6
  asyncCompilers: Record<string, AsyncCompilerFn>;
7
- ignoreBinaries?: (string | RegExp)[] | undefined;
8
- ignoreDependencies?: (string | RegExp)[] | undefined;
9
- ignoreWorkspaces?: string[] | undefined;
10
7
  exclude?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
11
8
  rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
12
9
  entry?: string | string[] | undefined;
13
10
  project?: string | string[] | undefined;
14
11
  paths?: Record<string, string[]> | undefined;
15
12
  ignore?: string | string[] | undefined;
16
- ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "interface" | "enum" | "class" | "member", boolean>> | undefined;
13
+ ignoreBinaries?: (string | RegExp)[] | undefined;
14
+ ignoreDependencies?: (string | RegExp)[] | undefined;
15
+ ignoreExportsUsedInFile?: boolean | Partial<Record<"function" | "type" | "enum" | "class" | "interface" | "member", boolean>> | undefined;
16
+ ignoreWorkspaces?: string[] | undefined;
17
17
  includeEntryExports?: boolean | undefined;
18
18
  compilers?: Record<string, ((args_0: string, args_1: string, ...args_2: unknown[]) => string) | ((args_0: string, args_1: string, ...args_2: unknown[]) => Promise<string>)> | undefined;
19
19
  include?: ("files" | "dependencies" | "devDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
20
20
  workspaces?: Record<string, {
21
- ignoreBinaries?: (string | RegExp)[] | undefined;
22
- ignoreDependencies?: (string | RegExp)[] | undefined;
23
21
  entry?: string | string[] | undefined;
24
22
  project?: string | string[] | undefined;
25
23
  paths?: Record<string, string[]> | undefined;
26
24
  ignore?: string | string[] | undefined;
25
+ ignoreBinaries?: (string | RegExp)[] | undefined;
26
+ ignoreDependencies?: (string | RegExp)[] | undefined;
27
27
  includeEntryExports?: boolean | undefined;
28
28
  astro?: string | boolean | string[] | {
29
29
  config?: string | string[] | undefined;
@@ -577,6 +577,5 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
577
577
  project?: string | string[] | undefined;
578
578
  } | undefined;
579
579
  };
580
- export declare const dummyCompilers: Map<string, SyncCompilerFn>;
581
580
  export declare const getIncludedCompilers: (syncCompilers: SyncCompilers, asyncCompilers: AsyncCompilers, dependencies: DependencySet) => [SyncCompilers, AsyncCompilers];
582
581
  export declare const getCompilerExtensions: (compilers: [SyncCompilers, AsyncCompilers]) => string[];
@@ -1,4 +1,3 @@
1
- import { DUMMY_VIRTUAL_FILE_EXTENSIONS } from '../constants.js';
2
1
  import Astro from './astro.js';
3
2
  import MDX from './mdx.js';
4
3
  import Svelte from './svelte.js';
@@ -29,8 +28,6 @@ const compilers = new Map([
29
28
  ['.svelte', Svelte],
30
29
  ['.vue', Vue],
31
30
  ]);
32
- const dummyCompiler = () => '';
33
- export const dummyCompilers = new Map(Array.from(DUMMY_VIRTUAL_FILE_EXTENSIONS).map(ext => [ext, dummyCompiler]));
34
31
  export const getIncludedCompilers = (syncCompilers, asyncCompilers, dependencies) => {
35
32
  const hasDependency = (packageName) => dependencies.has(packageName);
36
33
  for (const [extension, { condition, compiler }] of compilers.entries()) {
@@ -6,8 +6,7 @@ export declare const GLOBAL_IGNORE_PATTERNS: string[];
6
6
  export declare const IGNORED_GLOBAL_BINARIES: Set<string>;
7
7
  export declare const IGNORED_DEPENDENCIES: Set<string>;
8
8
  export declare const IGNORED_RUNTIME_DEPENDENCIES: Set<string>;
9
- export declare const DUMMY_VIRTUAL_FILE_EXTENSIONS: Set<string>;
10
- export declare const IGNORED_FILE_EXTENSIONS: Set<string>;
9
+ export declare const FOREIGN_FILE_EXTENSIONS: Set<string>;
11
10
  export declare const IGNORE_DEFINITELY_TYPED: string[];
12
11
  export declare const ISSUE_TYPES: IssueType[];
13
12
  export declare const ISSUE_TYPE_TITLE: Record<IssueType, string>;
package/dist/constants.js CHANGED
@@ -51,23 +51,27 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
51
51
  ]);
52
52
  export const IGNORED_DEPENDENCIES = new Set(['knip', 'typescript']);
53
53
  export const IGNORED_RUNTIME_DEPENDENCIES = new Set(['bun']);
54
- export const DUMMY_VIRTUAL_FILE_EXTENSIONS = new Set(['.html', '.jpeg', '.jpg', '.png', '.svg', '.webp']);
55
- export const IGNORED_FILE_EXTENSIONS = new Set([
54
+ export const FOREIGN_FILE_EXTENSIONS = new Set([
56
55
  '.avif',
57
- '.css',
58
56
  '.eot',
59
57
  '.gif',
58
+ '.html',
60
59
  '.ico',
60
+ '.jpeg',
61
+ '.jpg',
61
62
  '.less',
63
+ '.mp3',
64
+ '.png',
62
65
  '.sass',
63
66
  '.scss',
64
67
  '.sh',
68
+ '.svg',
65
69
  '.ttf',
70
+ '.webp',
66
71
  '.woff',
67
72
  '.woff2',
68
73
  '.yaml',
69
74
  '.yml',
70
- ...DUMMY_VIRTUAL_FILE_EXTENSIONS,
71
75
  ]);
72
76
  export const IGNORE_DEFINITELY_TYPED = ['node', 'bun'];
73
77
  export const ISSUE_TYPES = [
@@ -1,12 +1,13 @@
1
- import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
1
+ import type { IgnorePatterns } from '#p/types/config.js';
2
+ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
3
+ import type { PluginConfig } from './types.js';
2
4
  declare const _default: {
3
- NAME: string;
4
- ENABLERS: string[];
5
- isEnabled: IsPluginEnabledCallback;
6
- CONFIG_FILE_PATTERNS: string[];
7
- ENTRY_FILE_PATTERNS: string[];
8
- PRODUCTION_ENTRY_FILE_PATTERNS: string[];
9
- PROJECT_FILE_PATTERNS: string[];
10
- findDependencies: GenericPluginCallback;
5
+ title: string;
6
+ enablers: IgnorePatterns;
7
+ isEnabled: IsPluginEnabled;
8
+ config: string[];
9
+ entry: string[];
10
+ production: string[];
11
+ resolveConfig: ResolveConfig<PluginConfig>;
11
12
  };
12
13
  export default _default;
@@ -1,34 +1,20 @@
1
- import { basename } from '../../util/path.js';
2
- import { timerify } from '../../util/Performance.js';
3
- import { hasDependency, load } from '../../util/plugin.js';
4
- import { toEntryPattern, toProductionEntryPattern } from '../../util/protocols.js';
5
- const NAME = '';
6
- const ENABLERS = [''];
7
- const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
8
- const CONFIG_FILE_PATTERNS = [];
9
- const ENTRY_FILE_PATTERNS = [];
10
- const PRODUCTION_ENTRY_FILE_PATTERNS = [];
11
- const PROJECT_FILE_PATTERNS = [];
12
- const findPluginDependencies = async (configFilePath, options) => {
13
- const { manifest, config, isProduction } = options;
14
- const localConfig = basename(configFilePath) === 'package.json' ? manifest.plugin : await load(configFilePath);
15
- if (!localConfig)
16
- return [];
17
- const entryPatterns = (config?.entry ?? localConfig.entryPathsOrPatterns ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
18
- const productionPatterns = config.entry ? [] : PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern);
19
- if (isProduction)
20
- return [...entryPatterns, ...productionPatterns];
21
- const dependencies = localConfig?.plugins ?? [];
22
- return [...dependencies, ...entryPatterns, ...productionPatterns];
1
+ import { hasDependency } from '#p/util/plugin.js';
2
+ const title = '_template';
3
+ const enablers = ['_template'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const config = [];
6
+ const entry = [];
7
+ const production = [];
8
+ const resolveConfig = async (config) => {
9
+ const dependencies = config?.plugins ?? [];
10
+ return [...dependencies];
23
11
  };
24
- const findDependencies = timerify(findPluginDependencies);
25
12
  export default {
26
- NAME,
27
- ENABLERS,
13
+ title,
14
+ enablers,
28
15
  isEnabled,
29
- CONFIG_FILE_PATTERNS,
30
- ENTRY_FILE_PATTERNS,
31
- PRODUCTION_ENTRY_FILE_PATTERNS,
32
- PROJECT_FILE_PATTERNS,
33
- findDependencies,
16
+ config,
17
+ entry,
18
+ production,
19
+ resolveConfig,
34
20
  };