knip 6.44.2 → 6.45.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 (218) hide show
  1. package/dist/ConfigurationChief.d.ts +23 -1033
  2. package/dist/ConfigurationChief.js +71 -15
  3. package/dist/DependencyDeputy.d.ts +10 -6
  4. package/dist/DependencyDeputy.js +51 -27
  5. package/dist/IssueCollector.d.ts +14 -11
  6. package/dist/IssueCollector.js +25 -20
  7. package/dist/IssueFixer.js +1 -1
  8. package/dist/PackagePeeker.d.ts +6 -0
  9. package/dist/PackagePeeker.js +43 -14
  10. package/dist/ProjectPrincipal.d.ts +6 -3
  11. package/dist/ProjectPrincipal.js +83 -32
  12. package/dist/WorkspaceWorker.d.ts +5 -1
  13. package/dist/WorkspaceWorker.js +39 -22
  14. package/dist/binaries/bash-parser.js +1 -7
  15. package/dist/binaries/command.d.ts +3 -3
  16. package/dist/binaries/command.js +6 -2
  17. package/dist/binaries/fallback.js +1 -1
  18. package/dist/binaries/plugins.d.ts +4 -1
  19. package/dist/binaries/plugins.js +66 -18
  20. package/dist/binaries/resolvers/npm.js +7 -5
  21. package/dist/binaries/resolvers/npx.js +8 -40
  22. package/dist/binaries/util.d.ts +13 -1
  23. package/dist/binaries/util.js +35 -1
  24. package/dist/cli.js +10 -84
  25. package/dist/configuration-hints.d.ts +16 -0
  26. package/dist/configuration-hints.js +64 -0
  27. package/dist/constants.d.ts +2 -1
  28. package/dist/constants.js +2 -0
  29. package/dist/graph/SubpathReferences.d.ts +33 -0
  30. package/dist/graph/SubpathReferences.js +114 -0
  31. package/dist/graph/analyze.d.ts +4 -1
  32. package/dist/graph/analyze.js +16 -5
  33. package/dist/graph/build.d.ts +3 -1
  34. package/dist/graph/build.js +47 -23
  35. package/dist/graph-explorer/operations/resolve-export-origins.js +1 -1
  36. package/dist/plugins/angular/index.js +10 -17
  37. package/dist/plugins/aws-cdk/index.d.ts +3 -0
  38. package/dist/plugins/aws-cdk/index.js +32 -0
  39. package/dist/plugins/aws-cdk/types.d.ts +5 -0
  40. package/dist/plugins/aws-cdk/types.js +1 -0
  41. package/dist/plugins/babel/index.d.ts +1 -1
  42. package/dist/plugins/babel/index.js +19 -5
  43. package/dist/plugins/bun/index.js +8 -7
  44. package/dist/plugins/c8/index.js +17 -4
  45. package/dist/plugins/changesets/index.js +3 -2
  46. package/dist/plugins/commitizen/index.js +6 -3
  47. package/dist/plugins/commitlint/index.js +10 -11
  48. package/dist/plugins/cypress/index.js +4 -2
  49. package/dist/plugins/danger/index.js +1 -1
  50. package/dist/plugins/docusaurus/helpers.js +6 -6
  51. package/dist/plugins/docusaurus/index.js +2 -2
  52. package/dist/plugins/electron-forge/index.js +2 -2
  53. package/dist/plugins/electron-vite/index.js +2 -2
  54. package/dist/plugins/eleventy/index.js +3 -2
  55. package/dist/plugins/eslint/helpers.js +4 -3
  56. package/dist/plugins/eslint/resolveFromAST.js +2 -2
  57. package/dist/plugins/evalite/index.d.ts +3 -0
  58. package/dist/plugins/evalite/index.js +26 -0
  59. package/dist/plugins/flue/index.js +2 -2
  60. package/dist/plugins/github-action/index.js +2 -2
  61. package/dist/plugins/github-actions/index.js +2 -2
  62. package/dist/plugins/graphql-codegen/index.js +13 -9
  63. package/dist/plugins/index.d.ts +5 -0
  64. package/dist/plugins/index.js +10 -0
  65. package/dist/plugins/jest/index.js +5 -5
  66. package/dist/plugins/knex/index.js +2 -2
  67. package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
  68. package/dist/plugins/lunaria/index.js +5 -2
  69. package/dist/plugins/markdownlint/index.js +8 -2
  70. package/dist/plugins/marko/index.js +2 -2
  71. package/dist/plugins/marko/taglibs.d.ts +1 -1
  72. package/dist/plugins/marko/taglibs.js +4 -28
  73. package/dist/plugins/mdx/index.d.ts +2 -1
  74. package/dist/plugins/mdx/index.js +7 -4
  75. package/dist/plugins/mdxlint/index.js +18 -15
  76. package/dist/plugins/mikro-orm/index.d.ts +3 -0
  77. package/dist/plugins/mikro-orm/index.js +77 -0
  78. package/dist/plugins/mikro-orm/types.d.ts +21 -0
  79. package/dist/plugins/mikro-orm/types.js +1 -0
  80. package/dist/plugins/msw/index.js +6 -3
  81. package/dist/plugins/msw/types.d.ts +1 -1
  82. package/dist/plugins/netlify/index.js +7 -3
  83. package/dist/plugins/next/index.js +63 -9
  84. package/dist/plugins/next/types.d.ts +5 -0
  85. package/dist/plugins/next-mdx/resolveFromAST.js +15 -10
  86. package/dist/plugins/nitro/index.js +5 -6
  87. package/dist/plugins/node/index.js +4 -4
  88. package/dist/plugins/npm-package-json-lint/index.js +10 -3
  89. package/dist/plugins/nuxt/index.js +18 -10
  90. package/dist/plugins/nuxt/types.d.ts +4 -0
  91. package/dist/plugins/nx/index.js +6 -3
  92. package/dist/plugins/openclaw/index.js +11 -11
  93. package/dist/plugins/oxlint/index.js +2 -2
  94. package/dist/plugins/payload/index.js +1 -1
  95. package/dist/plugins/playwright/index.js +3 -3
  96. package/dist/plugins/pm2/index.js +7 -7
  97. package/dist/plugins/prettier/index.js +2 -1
  98. package/dist/plugins/prisma/index.js +2 -2
  99. package/dist/plugins/quasar/resolveFromAST.js +14 -9
  100. package/dist/plugins/react-router/index.js +2 -2
  101. package/dist/plugins/release-it/index.js +6 -2
  102. package/dist/plugins/remix/index.js +3 -3
  103. package/dist/plugins/retry-cli/index.d.ts +3 -0
  104. package/dist/plugins/retry-cli/index.js +14 -0
  105. package/dist/plugins/rollup/index.js +1 -4
  106. package/dist/plugins/rstest/index.js +3 -3
  107. package/dist/plugins/semantic-release/index.js +3 -3
  108. package/dist/plugins/serverless-framework/index.js +10 -8
  109. package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +2 -2
  110. package/dist/plugins/stencil/resolveFromAST.js +5 -5
  111. package/dist/plugins/stryker/index.js +2 -2
  112. package/dist/plugins/swc/index.js +4 -3
  113. package/dist/plugins/tailwind/index.js +2 -2
  114. package/dist/plugins/tanstack-router/index.js +2 -2
  115. package/dist/plugins/ts-node/index.js +6 -1
  116. package/dist/plugins/turbo/index.js +3 -3
  117. package/dist/plugins/typedoc/index.js +2 -2
  118. package/dist/plugins/typescript/content-mappers.d.ts +1 -1
  119. package/dist/plugins/typescript/index.js +6 -9
  120. package/dist/plugins/varlock/scan.js +1 -1
  121. package/dist/plugins/vite/helpers.d.ts +1 -0
  122. package/dist/plugins/vite/helpers.js +13 -3
  123. package/dist/plugins/vite/index.js +5 -2
  124. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  125. package/dist/plugins/vitest/index.js +14 -16
  126. package/dist/plugins/vue/index.js +1 -1
  127. package/dist/plugins/web-test-runner/index.d.ts +3 -0
  128. package/dist/plugins/web-test-runner/index.js +86 -0
  129. package/dist/plugins/wrangler/index.js +3 -3
  130. package/dist/plugins/yarn/index.js +5 -5
  131. package/dist/plugins.js +2 -5
  132. package/dist/reporters/github-actions.js +3 -7
  133. package/dist/reporters/json.d.ts +1 -0
  134. package/dist/reporters/json.js +1 -0
  135. package/dist/reporters/util/configuration-hints.d.ts +3 -1
  136. package/dist/reporters/util/configuration-hints.js +40 -21
  137. package/dist/reporters/util/util.d.ts +1 -1
  138. package/dist/run-cli.d.ts +2 -0
  139. package/dist/run-cli.js +82 -0
  140. package/dist/run.js +12 -0
  141. package/dist/session/incremental.d.ts +1 -0
  142. package/dist/session/incremental.js +1 -0
  143. package/dist/session/watch.js +2 -1
  144. package/dist/types/PluginNames.d.ts +2 -2
  145. package/dist/types/PluginNames.js +5 -0
  146. package/dist/types/args.d.ts +3 -1
  147. package/dist/types/config.d.ts +17 -10
  148. package/dist/types/configuration.d.ts +45 -0
  149. package/dist/types/configuration.js +1 -0
  150. package/dist/types/issues.d.ts +4 -0
  151. package/dist/types/module-graph.d.ts +1 -0
  152. package/dist/types/options.d.ts +1 -0
  153. package/dist/types/package-json.d.ts +3 -8
  154. package/dist/types/workspace.d.ts +1 -0
  155. package/dist/typescript/get-imports-and-exports.js +18 -6
  156. package/dist/typescript/resolve-module-names.js +7 -45
  157. package/dist/typescript/visitors/calls.d.ts +1 -1
  158. package/dist/typescript/visitors/calls.js +14 -10
  159. package/dist/typescript/visitors/exports.js +16 -26
  160. package/dist/typescript/visitors/imports.d.ts +2 -1
  161. package/dist/typescript/visitors/imports.js +41 -24
  162. package/dist/typescript/visitors/members.d.ts +1 -1
  163. package/dist/typescript/visitors/members.js +38 -24
  164. package/dist/typescript/visitors/shadow.d.ts +2 -0
  165. package/dist/typescript/visitors/shadow.js +25 -0
  166. package/dist/typescript/visitors/walk.d.ts +20 -12
  167. package/dist/typescript/visitors/walk.js +78 -48
  168. package/dist/util/Performance.d.ts +25 -3
  169. package/dist/util/Performance.js +51 -27
  170. package/dist/util/cli-arguments.d.ts +2 -1
  171. package/dist/util/cli-arguments.js +4 -2
  172. package/dist/util/create-input-handler.js +138 -119
  173. package/dist/util/create-options.d.ts +4 -2071
  174. package/dist/util/create-options.js +6 -4
  175. package/dist/util/create-workspace-graph.js +2 -1
  176. package/dist/util/errors.d.ts +5 -2
  177. package/dist/util/errors.js +11 -18
  178. package/dist/util/fs.js +4 -2
  179. package/dist/util/input.d.ts +2 -2
  180. package/dist/util/input.js +2 -2
  181. package/dist/util/is-plugin-name.d.ts +2 -0
  182. package/dist/util/is-plugin-name.js +3 -0
  183. package/dist/util/jiti.d.ts +2 -1
  184. package/dist/util/jiti.js +10 -3
  185. package/dist/util/load-config.d.ts +1 -1
  186. package/dist/util/load-config.js +3 -2
  187. package/dist/util/loader.js +3 -2
  188. package/dist/util/map-workspaces.js +23 -1
  189. package/dist/util/module-graph.js +1 -0
  190. package/dist/util/modules.d.ts +2 -0
  191. package/dist/util/modules.js +78 -0
  192. package/dist/util/package-json.d.ts +12 -5
  193. package/dist/util/package-json.js +54 -26
  194. package/dist/util/parse-and-convert-gitignores.d.ts +2 -2
  195. package/dist/util/parse-and-convert-gitignores.js +5 -5
  196. package/dist/util/parse-configuration.d.ts +2 -0
  197. package/dist/util/parse-configuration.js +66 -0
  198. package/dist/util/plugin.js +8 -12
  199. package/dist/util/resolve.d.ts +1 -0
  200. package/dist/util/resolve.js +3 -2
  201. package/dist/util/scripts.d.ts +0 -5
  202. package/dist/util/scripts.js +1 -32
  203. package/dist/util/to-source-path.d.ts +4 -1
  204. package/dist/util/to-source-path.js +2 -2
  205. package/dist/util/unhandled-rejection.d.ts +8 -0
  206. package/dist/util/unhandled-rejection.js +29 -0
  207. package/dist/util/validation.d.ts +11 -0
  208. package/dist/util/validation.js +68 -0
  209. package/dist/util/watch.d.ts +3 -1
  210. package/dist/util/watch.js +5 -2
  211. package/dist/version.d.ts +1 -1
  212. package/dist/version.js +1 -1
  213. package/package.json +6 -7
  214. package/schema.json +34 -0
  215. package/dist/schema/configuration.d.ts +0 -3103
  216. package/dist/schema/configuration.js +0 -94
  217. package/dist/schema/plugins.d.ts +0 -1019
  218. package/dist/schema/plugins.js +0 -215
@@ -5,6 +5,7 @@ import type { DependencyDeputy } from '../DependencyDeputy.ts';
5
5
  import type { IssueCollector } from '../IssueCollector.ts';
6
6
  import type { ModuleGraph } from '../types/module-graph.ts';
7
7
  import type { MainOptions } from '../util/create-options.ts';
8
+ import type { SubpathReferences } from './SubpathReferences.ts';
8
9
  interface AnalyzeOptions {
9
10
  analyzedFiles: Set<string>;
10
11
  counselor: CatalogCounselor;
@@ -13,9 +14,11 @@ interface AnalyzeOptions {
13
14
  deputy: DependencyDeputy;
14
15
  entryPaths: Set<string>;
15
16
  graph: ModuleGraph;
17
+ isGitIgnored: (filePath: string) => boolean;
16
18
  streamer: ConsoleStreamer;
19
+ subpathReferences: SubpathReferences;
17
20
  unreferencedFiles: Set<string>;
18
21
  options: MainOptions;
19
22
  }
20
- export declare const analyze: ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, graph, streamer, unreferencedFiles, options, }: AnalyzeOptions) => Promise<() => Promise<void>>;
23
+ export declare const analyze: ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, graph, isGitIgnored, streamer, subpathReferences, unreferencedFiles, options, }: AnalyzeOptions) => Promise<() => Promise<void>>;
21
24
  export {};
@@ -1,3 +1,4 @@
1
+ import { getUnusedIgnorePatternHints, settleConfigurationHints } from '../configuration-hints.js';
1
2
  import { createGraphExplorer } from '../graph-explorer/explorer.js';
2
3
  import { getIgnoredCycleImportFlags, getIssueType, getRuntimeImport, hasStrictlyEnumReferences, } from '../graph-explorer/utils.js';
3
4
  import traceReporter from '../reporters/trace.js';
@@ -22,7 +23,7 @@ const getAllowedCyclePaths = (cycles) => {
22
23
  return paths;
23
24
  };
24
25
  const isAllowedCycle = (symbols, paths) => paths?.has(toCyclePathKey(symbols.map(s => s.symbol))) ?? false;
25
- export const analyze = async ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, graph, streamer, unreferencedFiles, options, }) => {
26
+ export const analyze = async ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, graph, isGitIgnored, streamer, subpathReferences, unreferencedFiles, options, }) => {
26
27
  const shouldIgnore = getShouldIgnoreHandler(options.isProduction);
27
28
  const shouldIgnoreTags = getShouldIgnoreTagHandler(options.tags);
28
29
  const explorer = createGraphExplorer(graph, entryPaths, options.isSession);
@@ -102,7 +103,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
102
103
  }
103
104
  }
104
105
  };
105
- const analyzeGraph = async () => {
106
+ const analyzeGraph = timerify(async () => {
106
107
  if (options.isReportValues || options.isReportTypes) {
107
108
  streamer.cast('Connecting the dots');
108
109
  for (const [filePath, file] of graph) {
@@ -289,6 +290,8 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
289
290
  if (options.isReportFiles)
290
291
  collector.addFilesIssues(unusedFiles);
291
292
  collector.addFileCounts({ processed: analyzedFiles.size, unused: unusedFiles.length });
293
+ for (const issue of subpathReferences.getIssues())
294
+ collector.addIssue(issue);
292
295
  if (options.isReportDependencies) {
293
296
  const { dependencyIssues, devDependencyIssues, optionalPeerDependencyIssues } = deputy.settleDependencyIssues();
294
297
  for (const issue of dependencyIssues)
@@ -314,12 +317,20 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
314
317
  for (const identifier of unusedIgnoredWorkspaces) {
315
318
  collector.addConfigurationHint({ type: 'ignoreWorkspaces', identifier });
316
319
  }
317
- for (const hint of collector.getUnusedIgnorePatternHints(options)) {
318
- collector.addConfigurationHint(hint);
320
+ if (options.isReportFiles) {
321
+ const patterns = collector.getUnusedIgnorePatterns();
322
+ const filePaths = [graph.keys(), unreferencedFiles];
323
+ const context = { cwd: options.cwd, filePaths, isGitIgnored };
324
+ for (const hint of getUnusedIgnorePatternHints(patterns, context))
325
+ collector.addConfigurationHint(hint);
319
326
  }
320
327
  for (const hint of chief.getConfigurationHints())
321
328
  collector.addConfigurationHint(hint);
322
- };
329
+ const hints = settleConfigurationHints(collector.getConfigurationHintCandidates(), {
330
+ countWorkspaces: configKey => chief.countWorkspacesForConfigKey(configKey),
331
+ });
332
+ collector.setConfigurationHints(hints);
333
+ }, 'analyzeGraph');
323
334
  await analyzeGraph();
324
335
  perfObserver.addMemoryMark('analyze');
325
336
  if (options.isTrace) {
@@ -8,6 +8,7 @@ import type { ProjectPrincipal } from '../ProjectPrincipal.ts';
8
8
  import type { ModuleGraph } from '../types/module-graph.ts';
9
9
  import type { MainOptions } from '../util/create-options.ts';
10
10
  import { ConfigurationFiles } from '../session/configuration.ts';
11
+ import type { SubpathReferences } from './SubpathReferences.ts';
11
12
  interface BuildOptions {
12
13
  chief: ConfigurationChief;
13
14
  collector: IssueCollector;
@@ -17,10 +18,11 @@ interface BuildOptions {
17
18
  isGitIgnored: (path: string) => boolean;
18
19
  scriptParserContext: ScriptParserContext;
19
20
  streamer: ConsoleStreamer;
21
+ subpathReferences: SubpathReferences;
20
22
  workspaces: Workspace[];
21
23
  options: MainOptions;
22
24
  }
23
- export declare function build({ chief, collector, counselor, deputy, principal, isGitIgnored, scriptParserContext, streamer, workspaces, options, }: BuildOptions): Promise<{
25
+ export declare const build: ({ chief, collector, counselor, deputy, principal, isGitIgnored, scriptParserContext, streamer, subpathReferences, workspaces, options, }: BuildOptions) => Promise<{
24
26
  graph: ModuleGraph;
25
27
  configurationFiles: ConfigurationFiles | undefined;
26
28
  entryPaths: Set<string>;
@@ -8,24 +8,25 @@ import { ConfigurationFiles } from '../session/configuration.js';
8
8
  import { debugLog, debugLogArray } from '../util/debug.js';
9
9
  import { existsSync } from 'node:fs';
10
10
  import picomatch from 'picomatch';
11
+ import { isDynamicPattern } from 'tinyglobby';
11
12
  import { tryRealpath } from '../util/fs.js';
12
13
  import { createManifest } from '../util/package-json.js';
13
14
  import { _glob, _syncGlob, prependDirToPattern as prependDir, rebasePattern, removeProductionSuffix, } from '../util/glob.js';
14
- import { isAlias, isCatalog, isConfig, isDeferResolveEntry, isDeferResolveProductionEntry, isEntry, isIgnore, isProductionEntry, isProject, toDeferResolveEntry, toDependency, toProductionEntry, } from '../util/input.js';
15
+ import { isAlias, isCatalog, isConfig, isEntry, isIgnore, isProductionEntry, isProject, toDeferResolveEntry, toDependency, toProductionEntry, } from '../util/input.js';
15
16
  import { isAmbientDeclarationFile } from '../typescript/ast-nodes.js';
16
17
  import { resolveImportGlobs } from '../typescript/glob-imports.js';
17
18
  import { createPublishedTypeDependencyAnalyzer } from '../typescript/get-published-type-dependencies.js';
18
19
  import { loadTSConfig } from '../util/load-tsconfig.js';
19
20
  import { createFileNode, updateImportMap } from '../util/module-graph.js';
20
21
  import { getPackageNameFromModuleSpecifier, isStartsLikePackageName, sanitizeSpecifier } from '../util/modules.js';
21
- import { perfObserver } from '../util/Performance.js';
22
+ import { perfObserver, timerify } from '../util/Performance.js';
22
23
  import { getEntrySpecifiersFromManifest, getManifestImportDependencies } from '../util/package-json.js';
23
24
  import { expandIgnorePatterns } from '../util/parse-and-convert-gitignores.js';
24
25
  import { dirname, extname, isAbsolute, isInNodeModules, isInternal, join, relative } from '../util/path.js';
25
26
  import { extensionAlias } from '../util/resolve.js';
26
27
  import { augmentWorkspace, getToSourcePathsHandler, toSourceMappedSpecifiers } from '../util/to-source-path.js';
27
28
  import { WorkspaceWorker } from '../WorkspaceWorker.js';
28
- export async function build({ chief, collector, counselor, deputy, principal, isGitIgnored, scriptParserContext, streamer, workspaces, options, }) {
29
+ export const build = timerify(async function build({ chief, collector, counselor, deputy, principal, isGitIgnored, scriptParserContext, streamer, subpathReferences, workspaces, options, }) {
29
30
  const configFilesMap = new Map();
30
31
  const configurationFiles = options.isSession ? new ConfigurationFiles(options) : undefined;
31
32
  const enabledPluginsStore = new Map();
@@ -33,7 +34,11 @@ export async function build({ chief, collector, counselor, deputy, principal, is
33
34
  const toSourceFilePaths = getToSourcePathsHandler(chief);
34
35
  const addIssue = (issue) => collector.addIssue(issue) && options.isSession && collector.retainIssue(issue);
35
36
  const externalRefsFromInputs = options.isSession ? new Map() : undefined;
36
- const handleInput = createInputHandler(deputy, chief, isGitIgnored, addIssue, externalRefsFromInputs, options);
37
+ const resolveInput = createInputHandler(deputy, chief, isGitIgnored, addIssue, externalRefsFromInputs, options);
38
+ const handleInput = (input, workspace, owner = workspace.manifestPath) => {
39
+ subpathReferences.addInput(input, owner);
40
+ return resolveInput(input, workspace);
41
+ };
37
42
  const getPublishedTypeDependencies = options.isReportDependencies
38
43
  ? createPublishedTypeDependencyAnalyzer()
39
44
  : undefined;
@@ -88,9 +93,11 @@ export async function build({ chief, collector, counselor, deputy, principal, is
88
93
  const worker = new WorkspaceWorker({
89
94
  name,
90
95
  dir,
96
+ configKey: workspace.configKey,
91
97
  config: baseConfig,
92
98
  manifest,
93
99
  dependencies,
100
+ allDependencies: deputy.getAllDependencies(name),
94
101
  rootManifest,
95
102
  handleInput: (input) => handleInput(input, workspace),
96
103
  handleConfigLoadError: () => collector.addConfigLoadError(),
@@ -127,10 +134,15 @@ export async function build({ chief, collector, counselor, deputy, principal, is
127
134
  inputs.add(toProductionEntry(tryRealpath(id), { containingFilePath: tsConfigFilePath }));
128
135
  }
129
136
  const sharedGlobOptions = { cwd: options.cwd, dir, gitignore: options.gitignore };
130
- const fn = (id) => ({ pattern: prependDir(name, id), id, workspaceName: name });
137
+ const fn = (id) => ({
138
+ pattern: prependDir(name, id),
139
+ id,
140
+ workspaceName: name,
141
+ configKey: workspace.configKey,
142
+ });
131
143
  collector.addIgnorePatterns(config.ignore.map(fn));
132
144
  collector.addIgnoreFilesPatterns(config.ignoreFiles.map(fn));
133
- const entrySpecifiersFromManifest = getEntrySpecifiersFromManifest(manifest);
145
+ const entrySpecifiersFromManifest = getEntrySpecifiersFromManifest(manifest, config.isIncludeSubpathExports);
134
146
  const label = 'entry paths from package.json';
135
147
  for (const filePath of await toSourceFilePaths(entrySpecifiersFromManifest, dir, extensionGlobStr, label)) {
136
148
  if (!isGitIgnored(filePath))
@@ -200,6 +212,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
200
212
  const productionPatterns = createPatternMap();
201
213
  const productionPatternsSkipExports = createPatternMap();
202
214
  const projectFilePatterns = new Set();
215
+ const developmentFilePaths = new Set();
203
216
  const addPattern = (map, group, pattern) => {
204
217
  let patterns = map.get(group);
205
218
  if (!patterns)
@@ -252,12 +265,12 @@ export async function build({ chief, collector, counselor, deputy, principal, is
252
265
  const ws = (input.containingFilePath && chief.findWorkspaceByFilePath(input.containingFilePath)) || workspace;
253
266
  const resolvedFilePath = handleInput(input, ws);
254
267
  if (resolvedFilePath) {
255
- if (isDeferResolveEntry(input) && options.isProduction && !isDeferResolveProductionEntry(input)) {
268
+ if (options.isProduction && !input.production) {
256
269
  if (!input.optional)
257
- addPattern(entryPatternsSkipExports, input.group ?? DEFAULT_GROUP, resolvedFilePath);
270
+ developmentFilePaths.add(resolvedFilePath);
258
271
  }
259
272
  else {
260
- principal.addEntryPath(resolvedFilePath, { skipExportsAnalysis: true });
273
+ principal.addEntryPath(resolvedFilePath, { skipExportsAnalysis: input.skipExportsAnalysis ?? true });
261
274
  }
262
275
  }
263
276
  }
@@ -359,8 +372,10 @@ export async function build({ chief, collector, counselor, deputy, principal, is
359
372
  for (const hint of hints)
360
373
  collector.addConfigurationHint(hint);
361
374
  }
362
- for (const projectPath of productionPaths(projectPaths))
363
- principal.addProjectPath(projectPath);
375
+ for (const projectPath of productionPaths(projectPaths)) {
376
+ if (!developmentFilePaths.has(projectPath))
377
+ principal.addProjectPath(projectPath);
378
+ }
364
379
  }
365
380
  worker.onDispose();
366
381
  perfObserver.addMemoryMark(name);
@@ -369,8 +384,6 @@ export async function build({ chief, collector, counselor, deputy, principal, is
369
384
  const graph = new Map();
370
385
  const analyzedFiles = new Set();
371
386
  const unreferencedFiles = new Set();
372
- const entryPaths = new Set();
373
- const isInternalWorkspace = (packageName) => chief.availableWorkspacePkgNames.has(packageName);
374
387
  const analyzeOpts = {
375
388
  isFixExports: options.isFixUnusedExports,
376
389
  isFixTypes: options.isFixUnusedTypes,
@@ -382,6 +395,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
382
395
  if (!options.isSession && analyzedFiles.has(filePath))
383
396
  return;
384
397
  analyzedFiles.add(filePath);
398
+ subpathReferences.release(filePath);
385
399
  const workspace = chief.findWorkspaceByFilePath(filePath);
386
400
  if (workspace) {
387
401
  const file = principal.analyzeSourceFile(filePath, sourceText, analyzeOpts, workspace.config.ignoreExportsUsedInFile, parseResult, cachedFile);
@@ -393,6 +407,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
393
407
  const sanitizedSpecifier = sanitizeSpecifier(specifier);
394
408
  if (isStartsLikePackageName(sanitizedSpecifier)) {
395
409
  file.imports.external.add({ ...unresolvedImport, specifier: sanitizedSpecifier });
410
+ subpathReferences.add(sanitizedSpecifier, filePath);
396
411
  }
397
412
  else {
398
413
  const candidate = join(dirname(filePath), sanitizedSpecifier);
@@ -423,6 +438,10 @@ export async function build({ chief, collector, counselor, deputy, principal, is
423
438
  if (!isIgnored)
424
439
  principal.addEntryPath(filePath, { skipExportsAnalysis: true });
425
440
  }
441
+ if (file.imports.subpathImports) {
442
+ for (const specifier of file.imports.subpathImports)
443
+ subpathReferences.add(specifier, filePath);
444
+ }
426
445
  const wsDependencies = deputy.getDependencies(workspace.name);
427
446
  for (const _import of file.imports.imports) {
428
447
  if (!_import.filePath)
@@ -430,12 +449,11 @@ export async function build({ chief, collector, counselor, deputy, principal, is
430
449
  const packageName = getPackageNameFromModuleSpecifier(_import.specifier);
431
450
  if (!packageName)
432
451
  continue;
433
- const isWorkspace = isInternalWorkspace(packageName);
452
+ const isWorkspace = chief.isWorkspacePackageName(packageName);
434
453
  if (isWorkspace || wsDependencies.has(packageName)) {
435
454
  file.imports.external.add({ ..._import, specifier: packageName });
436
- if (isWorkspace && !isGitIgnored(_import.filePath)) {
437
- principal.addProgramPath(_import.filePath);
438
- }
455
+ if (isWorkspace)
456
+ subpathReferences.add(_import.specifier, filePath);
439
457
  }
440
458
  }
441
459
  const manifest = chief.getManifestForWorkspace(workspace.name);
@@ -462,7 +480,14 @@ export async function build({ chief, collector, counselor, deputy, principal, is
462
480
  input.dir ??= dir;
463
481
  if (options.isProduction)
464
482
  input.production = true;
465
- const specifierFilePath = handleInput(input, workspace);
483
+ if (input.type === 'entry' && isDynamicPattern(input.specifier)) {
484
+ for (const entryPath of _syncGlob({ patterns: input.specifier, cwd: input.dir })) {
485
+ if (!isGitIgnored(entryPath))
486
+ principal.addEntryPath(entryPath, { skipExportsAnalysis: true });
487
+ }
488
+ continue;
489
+ }
490
+ const specifierFilePath = handleInput(input, workspace, filePath);
466
491
  if (specifierFilePath)
467
492
  principal.addEntryPath(specifierFilePath, { skipExportsAnalysis: true });
468
493
  }
@@ -504,6 +529,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
504
529
  }
505
530
  };
506
531
  principal.init();
532
+ subpathReferences.reset();
507
533
  streamer.cast('Analyzing source files');
508
534
  await principal.walkAndAnalyze((filePath, parseResult, sourceText, cachedFile) => {
509
535
  analyzeSourceFile(filePath, sourceText, parseResult, cachedFile);
@@ -516,7 +542,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
516
542
  paths.push(importPath);
517
543
  }
518
544
  return paths;
519
- });
545
+ }, (specifier, filePath) => subpathReferences.add(specifier, filePath));
520
546
  for (const filePath of principal.getUnreferencedFiles()) {
521
547
  if (IS_DTS.test(filePath)) {
522
548
  const loaded = principal.fileManager.loadSourceText(filePath);
@@ -527,8 +553,6 @@ export async function build({ chief, collector, counselor, deputy, principal, is
527
553
  }
528
554
  unreferencedFiles.add(filePath);
529
555
  }
530
- for (const filePath of principal.entryPaths)
531
- entryPaths.add(filePath);
532
556
  principal.reconcileCache();
533
557
  perfObserver.addMemoryMark('build');
534
558
  if (externalRefsFromInputs) {
@@ -542,7 +566,7 @@ export async function build({ chief, collector, counselor, deputy, principal, is
542
566
  return {
543
567
  graph,
544
568
  configurationFiles,
545
- entryPaths,
569
+ entryPaths: principal.entryPaths,
546
570
  analyzedFiles,
547
571
  unreferencedFiles,
548
572
  analyzeSourceFile: async (filePath) => {
@@ -552,4 +576,4 @@ export async function build({ chief, collector, counselor, deputy, principal, is
552
576
  },
553
577
  enabledPluginsStore,
554
578
  };
555
- }
579
+ });
@@ -1,5 +1,5 @@
1
- import { isBuiltin } from 'node:module';
2
1
  import { IMPORT_FLAGS, IMPORT_STAR } from '../../constants.js';
2
+ import { isBuiltin } from '../../util/modules.js';
3
3
  import { getCachedExportTable, setCachedExportTable } from '../cache.js';
4
4
  import { forEachAliasReExport, forEachNamespaceReExport, forEachPassThroughReExport, getStarReExportSources, } from '../visitors.js';
5
5
  const originKey = (origin) => origin.filePath + '\0' + origin.identifier;
@@ -1,6 +1,4 @@
1
- import { existsSync } from 'node:fs';
2
- import { toConfig, toDeferResolve, toDependency, toEntry, toProductionEntry } from '../../util/input.js';
3
- import { isInternal, join } from '../../util/path.js';
1
+ import { toConfig, toDeferResolve, toDeferResolveEntry, toDeferResolveProductionEntry, toDependency, toEntry, } from '../../util/input.js';
4
2
  import { hasDependency } from '../../util/plugin.js';
5
3
  import { createComponentStyleUrlsVisitor } from '../_component-style-urls/component-style-urls-visitor.js';
6
4
  import * as karma from '../karma/helpers.js';
@@ -29,30 +27,25 @@ const resolveConfig = async (config, options) => {
29
27
  const entriesByOptionByConfig = new Map(configs ? Object.entries(configs).map(([name, opts]) => [name, entriesByOption(opts)]) : []);
30
28
  const productionEntriesByOption = entriesByOptionByConfig.get(PRODUCTION_CONFIG_NAME) ?? new Map();
31
29
  const isBuildTarget = targetName === BUILD_TARGET_NAME;
32
- const maybeExternal = (option) => option === 'polyfills';
33
- const toInput = (specifier, opts) => {
34
- const normalizedPath = join(options.cwd, specifier);
35
- if (opts.maybeExternal && !isInternal(specifier) && !existsSync(normalizedPath)) {
36
- return toDeferResolve(specifier);
30
+ const toInput = (option, specifier, isProduction) => {
31
+ const opts = { dir: options.cwd };
32
+ if (option === 'polyfills') {
33
+ return isProduction
34
+ ? toDeferResolve(specifier, { ...opts, production: true })
35
+ : toDeferResolve(specifier, opts);
37
36
  }
38
- return opts.isProduction ? toProductionEntry(normalizedPath) : toEntry(normalizedPath);
37
+ return isProduction ? toDeferResolveProductionEntry(specifier, opts) : toDeferResolveEntry(specifier, opts);
39
38
  };
40
39
  for (const [configName, entriesByOption] of entriesByOptionByConfig) {
41
40
  for (const [option, entries] of entriesByOption) {
42
41
  for (const entry of entries) {
43
- inputs.add(toInput(entry, {
44
- isProduction: isBuildTarget && configName === PRODUCTION_CONFIG_NAME,
45
- maybeExternal: maybeExternal(option),
46
- }));
42
+ inputs.add(toInput(option, entry, isBuildTarget && configName === PRODUCTION_CONFIG_NAME));
47
43
  }
48
44
  }
49
45
  }
50
46
  for (const [option, entries] of defaultEntriesByOption) {
51
47
  for (const entry of entries) {
52
- inputs.add(toInput(entry, {
53
- isProduction: isBuildTarget && !productionEntriesByOption.get(option)?.length,
54
- maybeExternal: maybeExternal(option),
55
- }));
48
+ inputs.add(toInput(option, entry, isBuildTarget && !productionEntriesByOption.get(option)?.length));
56
49
  }
57
50
  }
58
51
  if (target.builder && isAngularBuilderRefWithName({ builderRef: target.builder, name: 'karma' }) && opts) {
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,32 @@
1
+ import { isDirectory } from '../../util/fs.js';
2
+ import { toDeferResolve } from '../../util/input.js';
3
+ import { toAbsolute } from '../../util/path.js';
4
+ import { hasDependency } from '../../util/plugin.js';
5
+ const title = 'AWS CDK';
6
+ const enablers = ['aws-cdk', 'aws-cdk-lib'];
7
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
+ const config = ['cdk.json'];
9
+ const resolveConfig = (localConfig, options) => {
10
+ const scripts = [localConfig.build, localConfig.app].filter((script) => typeof script === 'string');
11
+ const inputs = options.getInputsFromScripts(scripts, { optionalBinaries: true, cwd: options.configFileDir });
12
+ for (const id of localConfig.plugin ?? [])
13
+ inputs.push(toDeferResolve(id));
14
+ return inputs;
15
+ };
16
+ const args = {
17
+ binaries: ['cdk'],
18
+ string: ['app'],
19
+ alias: { app: ['a'] },
20
+ fromArgs: (parsed, _, { cwd }) => typeof parsed.app === 'string' && parsed.app.includes(' ') && !isDirectory(toAbsolute(parsed.app, cwd))
21
+ ? parsed.app.split(' ')
22
+ : [],
23
+ };
24
+ const plugin = {
25
+ title,
26
+ enablers,
27
+ isEnabled,
28
+ config,
29
+ resolveConfig,
30
+ args,
31
+ };
32
+ export default plugin;
@@ -0,0 +1,5 @@
1
+ export type AwsCdkConfig = {
2
+ app?: string;
3
+ build?: string;
4
+ plugin?: string[];
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { Plugin } from '../../types/config.ts';
2
2
  import { type Input } from '../../util/input.ts';
3
3
  import type { BabelConfigObj } from './types.ts';
4
- export declare const getDependenciesFromConfig: (config: BabelConfigObj) => Input[];
4
+ export declare const getDependenciesFromConfig: (config: BabelConfigObj, isProduction?: boolean) => Input[];
5
5
  declare const plugin: Plugin;
6
6
  export default plugin;
@@ -1,5 +1,6 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toConfig, toDeferResolve } from '../../util/input.js';
2
+ import { toConfig, toDeferResolve, toDependency } from '../../util/input.js';
3
+ import { getPackageNameFromSpecifier } from '../../util/modules.js';
3
4
  import { hasDependency } from '../../util/plugin.js';
4
5
  import { api, resolveName } from './helpers.js';
5
6
  const title = 'Babel';
@@ -12,16 +13,29 @@ const config = [
12
13
  'package.json',
13
14
  ];
14
15
  const getName = (value) => [Array.isArray(value) ? value[0] : value].filter(name => typeof name === 'string');
15
- export const getDependenciesFromConfig = (config) => {
16
+ const DECORATOR_TRANSFORMS = 'decorator-transforms';
17
+ const isRuntimeImportPlugin = (value) => {
18
+ if (!Array.isArray(value) || typeof value[0] !== 'string')
19
+ return false;
20
+ if (getPackageNameFromSpecifier(resolveName(value[0], 'plugin')) !== DECORATOR_TRANSFORMS)
21
+ return false;
22
+ const runtime = value[1]?.runtime;
23
+ return typeof runtime?.import === 'string';
24
+ };
25
+ export const getDependenciesFromConfig = (config, isProduction = true) => {
16
26
  const presets = config.presets?.flatMap(getName).map(name => resolveName(name, 'preset')) ?? [];
17
27
  const plugins = config.plugins?.flatMap(getName).map(name => resolveName(name, 'plugin')) ?? [];
18
- const nested = config.env ? Object.values(config.env).flatMap(getDependenciesFromConfig) : [];
19
- const overrides = config.overrides ? [config.overrides].flat().flatMap(getDependenciesFromConfig) : [];
28
+ const toInputs = (config) => getDependenciesFromConfig(config, isProduction);
29
+ const nested = config.env ? Object.values(config.env).flatMap(toInputs) : [];
30
+ const overrides = config.overrides ? [config.overrides].flat().flatMap(toInputs) : [];
20
31
  return compact([
21
32
  ...presets.map(id => toDeferResolve(id)),
22
33
  ...plugins.map(id => toDeferResolve(id)),
23
34
  ...(plugins.includes('@babel/plugin-transform-runtime')
24
- ? [toDeferResolve('@babel/runtime', { optional: true })]
35
+ ? [toDependency('@babel/runtime', { optional: true, production: isProduction })]
36
+ : []),
37
+ ...(config.plugins?.some(isRuntimeImportPlugin)
38
+ ? [toDependency(DECORATOR_TRANSFORMS, { production: isProduction })]
25
39
  : []),
26
40
  ...nested,
27
41
  ...overrides,
@@ -1,12 +1,11 @@
1
1
  import { isFile } from '../../util/fs.js';
2
2
  import { toDeferResolve, toEntry, toIgnore } from '../../util/input.js';
3
3
  import parseArgs from '../../util/parse-args.js';
4
- import { getScriptCommands } from '../../util/scripts.js';
5
4
  const title = 'Bun';
6
5
  const enablers = 'This plugin is enabled when a `bun.lock` or `bun.lockb` file is found or a `bun test` script is configured.';
7
6
  const patterns = ['**/*.{test,spec}.{js,jsx,ts,tsx}', '**/*_{test,spec}.{js,jsx,ts,tsx}'];
8
- const getBunTest = (script) => {
9
- for (const { binary, args } of getScriptCommands(script)) {
7
+ const getBunTest = (script, cwd, getScriptCommands) => {
8
+ for (const { binary, args } of getScriptCommands(script, cwd)) {
10
9
  if (binary !== 'bun')
11
10
  continue;
12
11
  const parsed = parseArgs(args, { string: ['timeout', 'rerun-each', 'preload'] });
@@ -14,8 +13,9 @@ const getBunTest = (script) => {
14
13
  return parsed;
15
14
  }
16
15
  };
17
- const hasBunTest = (scripts) => scripts && Object.values(scripts).some(script => typeof script === 'string' && getBunTest(script));
18
- const isEnabled = ({ cwd, manifest }) => isFile(cwd, 'bun.lock') || isFile(cwd, 'bun.lockb') || !!hasBunTest(manifest.scripts);
16
+ const hasBunTest = (scripts, cwd, getScriptCommands) => scripts &&
17
+ Object.values(scripts).some(script => typeof script === 'string' && getBunTest(script, cwd, getScriptCommands));
18
+ const isEnabled = ({ cwd, manifest, getScriptCommands }) => isFile(cwd, 'bun.lock') || isFile(cwd, 'bun.lockb') || !!hasBunTest(manifest.scripts, cwd, getScriptCommands);
19
19
  const config = ['bunfig.toml'];
20
20
  const resolveConfig = localConfig => {
21
21
  const preload = localConfig.test?.preload ?? [];
@@ -45,10 +45,11 @@ const toPatterns = (arg) => {
45
45
  const resolve = options => {
46
46
  const scripts = { ...options.rootManifest?.scripts, ...options.manifest.scripts };
47
47
  const inputs = [toIgnore('bun', 'dependencies')];
48
- for (const script of Object.values(scripts)) {
48
+ for (const [name, script] of Object.entries(scripts)) {
49
49
  if (typeof script !== 'string')
50
50
  continue;
51
- const parsed = getBunTest(script);
51
+ const cwd = options.manifest.scripts?.[name] !== undefined ? options.cwd : options.rootCwd;
52
+ const parsed = getBunTest(script, cwd, options.getScriptCommands);
52
53
  if (!parsed)
53
54
  continue;
54
55
  const targets = parsed._.slice(1);
@@ -1,9 +1,22 @@
1
- import { argsFrom } from '../../binaries/util.js';
1
+ import { spawningArgs } from '../../binaries/util.js';
2
2
  const title = 'c8';
3
+ const commands = new Set(['check-coverage', 'report']);
3
4
  const args = {
4
- args: (args) => args.filter(arg => arg !== 'check-coverage'),
5
- boolean: ['all', 'check-coverage', 'clean', 'exclude-after-remap', 'per-file', 'skip-full'],
6
- fromArgs: (parsed, args) => (parsed._[0] ? argsFrom(args, parsed._[0]) : (parsed['--'] ?? [])),
5
+ boolean: [
6
+ '100',
7
+ 'all',
8
+ 'allowExternal',
9
+ 'check-coverage',
10
+ 'clean',
11
+ 'exclude-after-remap',
12
+ 'exclude-node-modules',
13
+ 'experimental-monocart',
14
+ 'merge-async',
15
+ 'omit-relative',
16
+ 'per-file',
17
+ 'skip-full',
18
+ ],
19
+ fromArgs: (parsed, args) => (commands.has(parsed._[0]) ? [] : spawningArgs(parsed, args)),
7
20
  };
8
21
  const plugin = {
9
22
  title,
@@ -1,5 +1,6 @@
1
- import { toDependency } from '../../util/input.js';
1
+ import { toDeferResolve, toDependency } from '../../util/input.js';
2
2
  import { getPackageNameFromFilePath } from '../../util/modules.js';
3
+ import { isInternal } from '../../util/path.js';
3
4
  import { hasDependency } from '../../util/plugin.js';
4
5
  const title = 'Changesets';
5
6
  const enablers = ['@changesets/cli'];
@@ -11,7 +12,7 @@ const resolveConfig = config => {
11
12
  ? [config.changelog[0]]
12
13
  : typeof config.changelog === 'string'
13
14
  ? [config.changelog]
14
- : []).map(id => toDependency(id));
15
+ : []).map(id => (isInternal(id) ? toDeferResolve(id) : toDependency(id)));
15
16
  if (config.$schema?.includes('node_modules/')) {
16
17
  const packageName = getPackageNameFromFilePath(config.$schema);
17
18
  if (packageName)
@@ -1,4 +1,5 @@
1
- import { toDependency } from '../../util/input.js';
1
+ import { toDeferResolve, toDependency } from '../../util/input.js';
2
+ import { isInternal } from '../../util/path.js';
2
3
  import { hasDependency } from '../../util/plugin.js';
3
4
  const title = 'Commitizen';
4
5
  const enablers = ['commitizen'];
@@ -6,8 +7,10 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
7
  const isRootOnly = true;
7
8
  const packageJsonPath = 'config.commitizen';
8
9
  const config = ['.czrc', '.cz.json', 'package.json'];
9
- const resolveConfig = config => {
10
- return config.path ? [toDependency(config.path)] : [];
10
+ const resolveConfig = (config, options) => {
11
+ if (!config.path)
12
+ return [];
13
+ return [isInternal(config.path) ? toDeferResolve(config.path, { dir: options.cwd }) : toDependency(config.path)];
11
14
  };
12
15
  const plugin = {
13
16
  title,
@@ -1,4 +1,4 @@
1
- import { toConfig, toDependency } from '../../util/input.js';
1
+ import { toConfig, toDeferResolve, toDependency } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { toCosmiconfig } from '../../util/plugin-config.js';
@@ -39,17 +39,16 @@ const resolveConfig = async (config) => {
39
39
  if (typeof id === 'string')
40
40
  plugins.push(toPluginSpecifier(id));
41
41
  }
42
- const formatter = config.formatter ? [config.formatter] : [];
43
- const parserPreset = await config.parserPreset;
44
- const parserPresetPaths = parserPreset
45
- ? typeof parserPreset === 'string'
46
- ? [parserPreset]
47
- : parserPreset.path
48
- ? [parserPreset.path ?? parserPreset]
49
- : []
50
- : [];
51
- for (const id of [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths])
42
+ for (const id of [...extendsConfigs, ...plugins])
52
43
  inputs.push(toDependency(id));
44
+ const parserPreset = await config.parserPreset;
45
+ const modules = config.formatter ? [config.formatter] : [];
46
+ if (typeof parserPreset === 'string')
47
+ modules.push(parserPreset);
48
+ for (const id of modules)
49
+ inputs.push(isInternal(id) ? toDeferResolve(id) : toDependency(id));
50
+ if (typeof parserPreset === 'object' && parserPreset.path)
51
+ inputs.push(toDependency(parserPreset.path));
53
52
  return inputs;
54
53
  };
55
54
  const plugin = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toEntry } from '../../util/input.js';
1
+ import { toDeferResolve, toDeferResolveEntry, toEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  import { resolveDependencies } from './helpers.js';
4
4
  const title = 'Cypress';
@@ -20,7 +20,9 @@ const resolveConfig = async (localConfig, options) => {
20
20
  return [
21
21
  ...inputs.map(id => toDeferResolve(id)),
22
22
  ...(specPatterns.length > 0 ? specPatterns : TEST_FILE_PATTERNS).map(id => toEntry(id)),
23
- ...(supportFiles.length > 0 ? supportFiles : SUPPORT_FILE_PATTERNS).map(id => toEntry(id)),
23
+ ...(supportFiles.length > 0
24
+ ? supportFiles.map(id => toDeferResolveEntry(id, { dir: options.cwd }))
25
+ : SUPPORT_FILE_PATTERNS.map(id => toEntry(id))),
24
26
  ];
25
27
  };
26
28
  const plugin = {
@@ -2,7 +2,7 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Danger';
3
3
  const enablers = ['danger'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const entry = ['dangerfile.{js,cjs,mjs,ts}'];
5
+ const entry = ['dangerfile.{js,cjs,mjs,ts,mts}', 'Dangerfile.{js,mjs,ts,mts}'];
6
6
  const plugin = {
7
7
  title,
8
8
  enablers,