knip 6.44.2 → 6.45.1

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 (226) 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/panda-css/index.js +5 -0
  95. package/dist/plugins/payload/index.js +1 -1
  96. package/dist/plugins/playwright/index.js +3 -3
  97. package/dist/plugins/pm2/index.js +7 -7
  98. package/dist/plugins/prettier/index.js +2 -1
  99. package/dist/plugins/prisma/index.js +2 -2
  100. package/dist/plugins/quasar/resolveFromAST.js +14 -9
  101. package/dist/plugins/react-router/index.js +2 -2
  102. package/dist/plugins/release-it/index.js +6 -2
  103. package/dist/plugins/remix/index.js +3 -3
  104. package/dist/plugins/retry-cli/index.d.ts +3 -0
  105. package/dist/plugins/retry-cli/index.js +14 -0
  106. package/dist/plugins/rollup/index.js +1 -4
  107. package/dist/plugins/rstest/index.js +3 -3
  108. package/dist/plugins/semantic-release/index.js +3 -3
  109. package/dist/plugins/serverless-framework/index.js +10 -8
  110. package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +2 -2
  111. package/dist/plugins/stencil/resolveFromAST.js +5 -5
  112. package/dist/plugins/stryker/index.js +2 -2
  113. package/dist/plugins/swc/index.js +4 -3
  114. package/dist/plugins/tailwind/index.js +2 -2
  115. package/dist/plugins/tanstack-router/index.js +2 -2
  116. package/dist/plugins/ts-node/index.js +6 -1
  117. package/dist/plugins/turbo/index.js +3 -3
  118. package/dist/plugins/typedoc/index.js +2 -2
  119. package/dist/plugins/typescript/content-mappers.d.ts +1 -1
  120. package/dist/plugins/typescript/index.js +6 -9
  121. package/dist/plugins/varlock/scan.js +1 -1
  122. package/dist/plugins/vite/helpers.d.ts +1 -0
  123. package/dist/plugins/vite/helpers.js +13 -3
  124. package/dist/plugins/vite/index.js +5 -2
  125. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  126. package/dist/plugins/vitest/index.js +14 -16
  127. package/dist/plugins/vue/index.js +1 -1
  128. package/dist/plugins/web-test-runner/index.d.ts +3 -0
  129. package/dist/plugins/web-test-runner/index.js +86 -0
  130. package/dist/plugins/webdriver-io/index.js +22 -17
  131. package/dist/plugins/webdriver-io/types.d.ts +3 -2
  132. package/dist/plugins/wrangler/index.js +3 -3
  133. package/dist/plugins/yarn/index.js +5 -5
  134. package/dist/plugins.js +2 -5
  135. package/dist/reporters/github-actions.js +3 -7
  136. package/dist/reporters/json.d.ts +1 -0
  137. package/dist/reporters/json.js +1 -0
  138. package/dist/reporters/util/configuration-hints.d.ts +3 -1
  139. package/dist/reporters/util/configuration-hints.js +40 -21
  140. package/dist/reporters/util/util.d.ts +1 -1
  141. package/dist/run-cli.d.ts +2 -0
  142. package/dist/run-cli.js +82 -0
  143. package/dist/run.js +12 -0
  144. package/dist/session/incremental.d.ts +1 -0
  145. package/dist/session/incremental.js +1 -0
  146. package/dist/session/index.d.ts +1 -0
  147. package/dist/session/index.js +1 -0
  148. package/dist/session/watch.js +2 -1
  149. package/dist/types/PluginNames.d.ts +2 -2
  150. package/dist/types/PluginNames.js +5 -0
  151. package/dist/types/args.d.ts +3 -1
  152. package/dist/types/config.d.ts +17 -10
  153. package/dist/types/configuration.d.ts +45 -0
  154. package/dist/types/configuration.js +1 -0
  155. package/dist/types/issues.d.ts +4 -0
  156. package/dist/types/module-graph.d.ts +1 -0
  157. package/dist/types/options.d.ts +1 -0
  158. package/dist/types/package-json.d.ts +3 -8
  159. package/dist/types/workspace.d.ts +1 -0
  160. package/dist/typescript/ast-nodes.js +47 -1
  161. package/dist/typescript/get-imports-and-exports.js +18 -6
  162. package/dist/typescript/resolve-module-names.js +7 -45
  163. package/dist/typescript/visitors/calls.d.ts +1 -1
  164. package/dist/typescript/visitors/calls.js +14 -10
  165. package/dist/typescript/visitors/exports.js +16 -26
  166. package/dist/typescript/visitors/imports.d.ts +2 -1
  167. package/dist/typescript/visitors/imports.js +41 -24
  168. package/dist/typescript/visitors/members.d.ts +1 -1
  169. package/dist/typescript/visitors/members.js +38 -24
  170. package/dist/typescript/visitors/shadow.d.ts +2 -0
  171. package/dist/typescript/visitors/shadow.js +25 -0
  172. package/dist/typescript/visitors/walk.d.ts +20 -12
  173. package/dist/typescript/visitors/walk.js +78 -48
  174. package/dist/util/Performance.d.ts +25 -3
  175. package/dist/util/Performance.js +51 -27
  176. package/dist/util/cli-arguments.d.ts +2 -1
  177. package/dist/util/cli-arguments.js +4 -2
  178. package/dist/util/create-input-handler.js +138 -119
  179. package/dist/util/create-options.d.ts +4 -2071
  180. package/dist/util/create-options.js +6 -4
  181. package/dist/util/create-workspace-graph.js +2 -1
  182. package/dist/util/errors.d.ts +5 -2
  183. package/dist/util/errors.js +11 -18
  184. package/dist/util/fs.js +4 -2
  185. package/dist/util/get-included-issue-types.js +1 -0
  186. package/dist/util/input.d.ts +2 -2
  187. package/dist/util/input.js +2 -2
  188. package/dist/util/is-plugin-name.d.ts +2 -0
  189. package/dist/util/is-plugin-name.js +3 -0
  190. package/dist/util/jiti.d.ts +2 -1
  191. package/dist/util/jiti.js +10 -3
  192. package/dist/util/load-config.d.ts +1 -1
  193. package/dist/util/load-config.js +3 -2
  194. package/dist/util/loader.js +3 -2
  195. package/dist/util/map-workspaces.js +23 -1
  196. package/dist/util/module-graph.js +1 -0
  197. package/dist/util/modules.d.ts +2 -0
  198. package/dist/util/modules.js +78 -0
  199. package/dist/util/package-json.d.ts +12 -5
  200. package/dist/util/package-json.js +54 -26
  201. package/dist/util/parse-and-convert-gitignores.d.ts +2 -2
  202. package/dist/util/parse-and-convert-gitignores.js +5 -5
  203. package/dist/util/parse-configuration.d.ts +2 -0
  204. package/dist/util/parse-configuration.js +66 -0
  205. package/dist/util/plugin.js +8 -12
  206. package/dist/util/regex.js +10 -1
  207. package/dist/util/resolve.d.ts +1 -0
  208. package/dist/util/resolve.js +3 -2
  209. package/dist/util/scripts.d.ts +0 -5
  210. package/dist/util/scripts.js +1 -32
  211. package/dist/util/to-source-path.d.ts +4 -1
  212. package/dist/util/to-source-path.js +2 -2
  213. package/dist/util/unhandled-rejection.d.ts +8 -0
  214. package/dist/util/unhandled-rejection.js +29 -0
  215. package/dist/util/validation.d.ts +11 -0
  216. package/dist/util/validation.js +68 -0
  217. package/dist/util/watch.d.ts +3 -1
  218. package/dist/util/watch.js +5 -2
  219. package/dist/version.d.ts +1 -1
  220. package/dist/version.js +1 -1
  221. package/package.json +6 -7
  222. package/schema.json +34 -0
  223. package/dist/schema/configuration.d.ts +0 -3103
  224. package/dist/schema/configuration.js +0 -94
  225. package/dist/schema/plugins.d.ts +0 -1019
  226. package/dist/schema/plugins.js +0 -215
@@ -8,11 +8,16 @@ const resolveConfig = config => {
8
8
  const presets = (config.presets ?? []).filter((preset) => typeof preset === 'string');
9
9
  return [...presets.map(id => toDeferResolve(id)), toDependency('postcss')];
10
10
  };
11
+ const args = {
12
+ binaries: ['panda', 'pandacss'],
13
+ config: true,
14
+ };
11
15
  const plugin = {
12
16
  title,
13
17
  enablers,
14
18
  isEnabled,
15
19
  config,
16
20
  resolveConfig,
21
+ args,
17
22
  };
18
23
  export default plugin;
@@ -3,7 +3,7 @@ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Payload CMS';
4
4
  const enablers = ['payload'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['payload.config.ts', 'src/payload.config.ts'];
6
+ const config = ['payload.config.{js,ts}', 'src/payload.config.{js,ts}'];
7
7
  const resolveConfig = async (config) => {
8
8
  const awaitedConfig = await config;
9
9
  const importMapFile = awaitedConfig?.admin?.importMap?.importMapFile;
@@ -1,5 +1,5 @@
1
1
  import { arrayify } from '../../util/array.js';
2
- import { toDeferResolve, toEntry } from '../../util/input.js';
2
+ import { toDeferResolve, toDeferResolveEntry, toEntry } from '../../util/input.js';
3
3
  import { join, toAbsolute } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'Playwright';
@@ -18,9 +18,9 @@ export const resolveConfig = async (localConfig, options) => {
18
18
  const { configFileDir } = options;
19
19
  const inputs = [];
20
20
  for (const id of arrayify(localConfig.globalSetup))
21
- inputs.push(toEntry(toAbsolute(id, configFileDir)));
21
+ inputs.push(toDeferResolveEntry(toAbsolute(id, configFileDir)));
22
22
  for (const id of arrayify(localConfig.globalTeardown))
23
- inputs.push(toEntry(toAbsolute(id, configFileDir)));
23
+ inputs.push(toDeferResolveEntry(toAbsolute(id, configFileDir)));
24
24
  for (const server of [localConfig.webServer].flat()) {
25
25
  if (!server?.command)
26
26
  continue;
@@ -1,27 +1,27 @@
1
- import { toEntry } from '../../util/input.js';
1
+ import { toDeferResolveEntry } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'pm2';
5
5
  const enablers = ['pm2'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['pm2.config.{json,js,cjs,mjs}', 'ecosystem.config.{json,js,cjs,mjs}'];
8
- const addApplicationEntry = (application, entries) => {
8
+ const addApplicationEntry = (application, entries, cwd) => {
9
9
  if (application.script && isInternal(application.script))
10
- entries.push(toEntry(application.script));
10
+ entries.push(toDeferResolveEntry(application.script, { dir: cwd }));
11
11
  };
12
- const resolveConfig = config => {
12
+ const resolveConfig = (config, { cwd }) => {
13
13
  const entries = [];
14
14
  if (Array.isArray(config)) {
15
15
  for (const application of config)
16
- addApplicationEntry(application, entries);
16
+ addApplicationEntry(application, entries, cwd);
17
17
  return entries;
18
18
  }
19
- addApplicationEntry(config, entries);
19
+ addApplicationEntry(config, entries, cwd);
20
20
  if (!config.apps)
21
21
  return entries;
22
22
  const applications = Array.isArray(config.apps) ? config.apps : [config.apps];
23
23
  for (const application of applications)
24
- addApplicationEntry(application, entries);
24
+ addApplicationEntry(application, entries, cwd);
25
25
  return entries;
26
26
  };
27
27
  const plugin = {
@@ -1,4 +1,5 @@
1
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 = 'Prettier';
4
5
  const enablers = ['prettier'];
@@ -17,7 +18,7 @@ const resolveConfig = config => {
17
18
  if (Array.isArray(options.plugins)) {
18
19
  for (const plugin of options.plugins) {
19
20
  if (typeof plugin === 'string') {
20
- result.add(toDependency(plugin));
21
+ result.add(isInternal(plugin) ? toDeferResolve(plugin) : toDependency(plugin));
21
22
  }
22
23
  }
23
24
  }
@@ -1,5 +1,5 @@
1
1
  import { isDirectory } from '../../util/fs.js';
2
- import { toEntry } from '../../util/input.js';
2
+ import { toDeferResolveEntry, toEntry } from '../../util/input.js';
3
3
  import { join } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  import compiler from './compiler.js';
@@ -14,7 +14,7 @@ const config = [
14
14
  ];
15
15
  const resolveSchema = (path, cwd) => {
16
16
  if (!isDirectory(cwd, path)) {
17
- return toEntry(path);
17
+ return toDeferResolveEntry(path, { dir: cwd });
18
18
  }
19
19
  return toEntry(join(path, '**/*.prisma'));
20
20
  };
@@ -1,6 +1,6 @@
1
1
  import { findProperty, getFirstPropertyValue, getStringValues, resolveObjectArg, } from '../../typescript/ast-helpers.js';
2
2
  import { getStringValue } from '../../typescript/ast-nodes.js';
3
- import { toDeferResolve, toProductionEntry } from '../../util/input.js';
3
+ import { toDependency, toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
4
4
  import { join } from '../../util/path.js';
5
5
  const sourceFilesEntries = [
6
6
  ['rootComponent', ['src/App.vue']],
@@ -31,7 +31,6 @@ const getConfigObject = (program) => {
31
31
  }
32
32
  }
33
33
  };
34
- const withExtensions = (id) => (id.includes('.') ? id : `${id}.{js,ts}`);
35
34
  export const resolveFromAST = (program, options) => {
36
35
  const { configFileDir } = options;
37
36
  const inputs = [];
@@ -39,9 +38,11 @@ export const resolveFromAST = (program, options) => {
39
38
  const sourceFiles = findProperty(config, 'sourceFiles');
40
39
  for (const [key, defaults] of sourceFilesEntries) {
41
40
  const override = getFirstPropertyValue(sourceFiles, key);
42
- for (const id of override ? [withExtensions(override)] : defaults) {
43
- inputs.push(toProductionEntry(join(configFileDir, id)));
44
- }
41
+ if (override)
42
+ inputs.push(toDeferResolveProductionEntry(join(configFileDir, override)));
43
+ else
44
+ for (const id of defaults)
45
+ inputs.push(toProductionEntry(join(configFileDir, id)));
45
46
  }
46
47
  for (const id of staticEntries)
47
48
  inputs.push(toProductionEntry(join(configFileDir, id)));
@@ -49,15 +50,19 @@ export const resolveFromAST = (program, options) => {
49
50
  if (boot?.type === 'ArrayExpression') {
50
51
  for (const element of boot.elements ?? []) {
51
52
  const id = getStringValue(element) ?? getFirstPropertyValue(element, 'path');
52
- if (id)
53
- inputs.push(toProductionEntry(join(configFileDir, 'src/boot', withExtensions(id))));
53
+ if (!id)
54
+ continue;
55
+ if (id.startsWith('~'))
56
+ inputs.push(toDependency(id.slice(1)));
57
+ else
58
+ inputs.push(toDeferResolveProductionEntry(join(configFileDir, 'src/boot', id)));
54
59
  }
55
60
  }
56
61
  for (const id of getStringValues(findProperty(config, 'css'))) {
57
62
  if (id.startsWith('~'))
58
- inputs.push(toDeferResolve(id.slice(1)));
63
+ inputs.push(toDependency(id.slice(1)));
59
64
  else
60
- inputs.push(toProductionEntry(join(configFileDir, 'src/css', id)));
65
+ inputs.push(toDeferResolveProductionEntry(join(configFileDir, 'src/css', id)));
61
66
  }
62
67
  return inputs;
63
68
  };
@@ -1,6 +1,6 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { _glob } from '../../util/glob.js';
3
- import { toEntry, toProductionDependency, toProductionEntry } from '../../util/input.js';
3
+ import { toDeferResolveProductionEntry, toEntry, toProductionDependency, toProductionEntry } from '../../util/input.js';
4
4
  import { join, toAbsolute } from '../../util/path.js';
5
5
  import { hasDependency, load } from '../../util/plugin.js';
6
6
  import vite from '../vite/index.js';
@@ -28,7 +28,7 @@ const resolveConfig = async (localConfig, options) => {
28
28
  toEntry(join(appDir, `routes.${entryExtsGlob}`)),
29
29
  toProductionEntry(join(appDir, `root.${entryExtsGlob}`)),
30
30
  toProductionEntry(join(appDir, `entry.{client,server}.${entryExtsGlob}`)),
31
- ...routes.map(id => toProductionEntry(id)),
31
+ ...routes.map(id => toDeferResolveProductionEntry(id)),
32
32
  ];
33
33
  const serverEntries = await _glob({
34
34
  cwd: appDir,
@@ -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 = 'Release It!';
4
5
  const enablers = ['release-it'];
@@ -14,7 +15,10 @@ const resolveConfig = (config, options) => {
14
15
  scripts.push(config.gitlab.releaseNotes);
15
16
  }
16
17
  const inputs = options.getInputsFromScripts(scripts);
17
- return [...plugins.map(id => toDependency(id)), ...inputs];
18
+ return [
19
+ ...plugins.map(id => (isInternal(id) ? toDeferResolve(id, { dir: options.cwd }) : toDependency(id))),
20
+ ...inputs,
21
+ ];
18
22
  };
19
23
  const plugin = {
20
24
  title,
@@ -2,11 +2,11 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Remix';
3
3
  const enablers = ['@remix-run/dev'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const entry = ['remix.config.js', 'remix.init/index.js'];
5
+ const entry = ['remix.config.{js,cjs,mjs}', 'remix.init/index.js'];
6
6
  const production = [
7
- 'app/root.tsx',
7
+ 'app/root.{js,jsx,ts,tsx}',
8
8
  'app/entry.{client,server}.{js,jsx,ts,tsx}',
9
- 'app/routes/**/*.{js,ts,tsx}',
9
+ 'app/routes/**/*.{js,jsx,ts,tsx}',
10
10
  'server.{js,ts}',
11
11
  ];
12
12
  const plugin = {
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,14 @@
1
+ import { spawningArgs } from '../../binaries/util.js';
2
+ const title = 'retry-cli';
3
+ const args = {
4
+ binaries: ['retry', 'retry-cli'],
5
+ string: ['factor', 'max-timeout', 'min-timeout', 'retries'],
6
+ boolean: ['help', 'randomize'],
7
+ alias: { factor: ['f'], help: ['h'], 'min-timeout': ['t'], retries: ['n'] },
8
+ fromArgs: spawningArgs,
9
+ };
10
+ const plugin = {
11
+ title,
12
+ args,
13
+ };
14
+ export default plugin;
@@ -7,11 +7,8 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['rollup.config.{js,cjs,mjs,ts}'];
8
8
  const args = {
9
9
  alias: { plugin: ['p'] },
10
- string: ['config'],
11
10
  config: ['config'],
12
- args: (args) => args
13
- .filter((arg, index) => !(arg === '--config' && (args[index + 1] === undefined || args[index + 1].startsWith('-'))))
14
- .map(arg => (arg.startsWith('--watch.onEnd') ? `--_exec${arg.slice(13)}` : arg)),
11
+ args: (args) => args.map(arg => (arg.startsWith('--watch.onEnd') ? `--_exec${arg.slice(13)}` : arg)),
15
12
  fromArgs: ['_exec'],
16
13
  resolve: ['plugin', 'configPlugin'],
17
14
  };
@@ -1,7 +1,7 @@
1
1
  import { arrayify } from '../../util/array.js';
2
2
  import { findFileWithExtensions } from '../../util/fs.js';
3
3
  import { _dirGlob, _glob, negate } from '../../util/glob.js';
4
- import { toAlias, toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
4
+ import { toAlias, toConfig, toDeferResolve, toDeferResolveEntry, toDependency, toEntry, } from '../../util/input.js';
5
5
  import { dirname, join, toAbsolute } from '../../util/path.js';
6
6
  import { hasDependency, load } from '../../util/plugin.js';
7
7
  import { createRstestMockVisitor } from './visitors/mock.js';
@@ -39,7 +39,7 @@ const resolveConfig = async (localConfig, options) => {
39
39
  ? include
40
40
  : await _glob({ cwd, patterns: [...include, ...exclude.map(pattern => negate(toPattern(pattern)))] });
41
41
  for (const entry of entries)
42
- inputs.push(toEntry(entry));
42
+ inputs.push(exclude.length === 0 ? toEntry(entry) : toDeferResolveEntry(entry));
43
43
  }
44
44
  const env = project.testEnvironment;
45
45
  inputs.push(...getEnvironmentDependency(typeof env === 'string' ? env : env?.name));
@@ -94,7 +94,7 @@ const resolveConfig = async (localConfig, options) => {
94
94
  inputs.push(toConfig('rstest', filePath));
95
95
  continue;
96
96
  }
97
- inputs.push(toEntry(filePath));
97
+ inputs.push(toDeferResolveEntry(filePath));
98
98
  if (project.projects)
99
99
  await addProjects(project.projects, dirname(filePath));
100
100
  else
@@ -1,4 +1,4 @@
1
- import { toConfig, toDeferResolve } 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';
@@ -20,7 +20,7 @@ const resolveConfig = (config, options) => {
20
20
  if (isInternal(id))
21
21
  inputs.push(toConfig('semantic-release', id, { containingFilePath: options.configFilePath }));
22
22
  else
23
- inputs.push(toDeferResolve(id));
23
+ inputs.push(toDependency(id));
24
24
  }
25
25
  const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
26
26
  for (const id of plugins.filter(plugin => !excludePackages.includes(plugin)))
@@ -39,7 +39,7 @@ const args = {
39
39
  if (isInternal(id))
40
40
  inputs.push(toConfig('semantic-release', id, { dir: cwd }));
41
41
  else
42
- inputs.push(toDeferResolve(id));
42
+ inputs.push(toDependency(id));
43
43
  }
44
44
  }
45
45
  return inputs;
@@ -1,5 +1,5 @@
1
1
  import { arrayify } from '../../util/array.js';
2
- import { toDependency, toProductionEntry } from '../../util/input.js';
2
+ import { toDeferResolveProductionEntry, toDependency } from '../../util/input.js';
3
3
  import { _load } from '../../util/loader.js';
4
4
  import { get } from '../../util/object.js';
5
5
  import { isInternal, join, toAbsolute } from '../../util/path.js';
@@ -22,13 +22,13 @@ const resolveFileVariable = async (value, dir) => {
22
22
  return undefined;
23
23
  }
24
24
  };
25
- const handlerToEntry = (handler) => {
25
+ const handlerToEntry = (handler, dir) => {
26
26
  const dot = handler.lastIndexOf('.');
27
27
  const file = handler.slice(0, dot);
28
- return toProductionEntry(/\.(?:[cm]?[jt]s|[jt]sx)$/.test(file) ? file : `${file}.{js,ts}`);
28
+ return toDeferResolveProductionEntry(file, { dir });
29
29
  };
30
- const pluginToInput = (plugin, dir) => isInternal(plugin) ? toProductionEntry(toAbsolute(plugin, dir)) : toDependency(plugin);
31
- const getFunctionEntries = async (functions, dir) => {
30
+ const pluginToInput = (plugin, dir) => isInternal(plugin) ? toDeferResolveProductionEntry(toAbsolute(plugin, dir)) : toDependency(plugin);
31
+ const getFunctionEntries = async (functions, dir, cwd) => {
32
32
  const entries = [];
33
33
  const resolved = await resolveFileVariable(functions, dir);
34
34
  for (const group of Array.isArray(resolved) ? resolved : [resolved]) {
@@ -38,14 +38,16 @@ const getFunctionEntries = async (functions, dir) => {
38
38
  for (const name in fns) {
39
39
  const fn = await resolveFileVariable(fns[name], dir);
40
40
  if (isRecord(fn) && typeof fn.handler === 'string')
41
- entries.push(handlerToEntry(fn.handler));
41
+ entries.push(handlerToEntry(fn.handler, cwd));
42
42
  }
43
43
  }
44
44
  return entries;
45
45
  };
46
- const getInjectEntries = (esbuild, dir) => esbuild && typeof esbuild === 'object' ? arrayify(esbuild.inject).map(id => toProductionEntry(join(dir, id))) : [];
46
+ const getInjectEntries = (esbuild, dir) => esbuild && typeof esbuild === 'object'
47
+ ? arrayify(esbuild.inject).map(id => toDeferResolveProductionEntry(join(dir, id)))
48
+ : [];
47
49
  export const resolveConfig = async (config, options) => {
48
- const functions = await getFunctionEntries(config.functions, options.configFileDir);
50
+ const functions = await getFunctionEntries(config.functions, options.configFileDir, options.cwd);
49
51
  const resolvedPlugins = await resolveFileVariable(config.plugins, options.configFileDir);
50
52
  const plugins = Array.isArray(resolvedPlugins)
51
53
  ? resolvedPlugins.filter((plugin) => typeof plugin === 'string')
@@ -1,7 +1,7 @@
1
1
  import { findImportedCalls, findProperty } from '../../typescript/ast-helpers.js';
2
2
  import { getStringValue } from '../../typescript/ast-nodes.js';
3
3
  import { isFile } from '../../util/fs.js';
4
- import { toProductionEntry } from '../../util/input.js';
4
+ import { toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
5
5
  import { join, toAbsolute } from '../../util/path.js';
6
6
  import { getViteRoot } from '../vite/helpers.js';
7
7
  const entryExtensions = ['tsx', 'jsx', 'ts', 'js', 'mjs', 'tsrx'];
@@ -71,6 +71,6 @@ export const resolveFromAST = (program, options) => {
71
71
  for (const pattern of patterns)
72
72
  inputs.push(toProductionEntry(join(root, pattern)));
73
73
  for (const id of paths)
74
- inputs.push(toProductionEntry(toAbsolute(id, root)));
74
+ inputs.push(toDeferResolveProductionEntry(toAbsolute(id, root)));
75
75
  return inputs;
76
76
  };
@@ -1,18 +1,18 @@
1
1
  import { Visitor } from 'oxc-parser';
2
2
  import { collectFirstPropertyValue, collectPropertyValues, getPropertyValues } from '../../typescript/ast-helpers.js';
3
- import { toConfig, toEntry, toProductionEntry } from '../../util/input.js';
3
+ import { toConfig, toDeferResolveProductionEntry, toEntry, toProductionEntry } from '../../util/input.js';
4
4
  export const entry = ['**/*.spec.{ts,tsx}', '**/*.e2e.{ts,tsx}'];
5
- export const resolveFromAST = program => {
5
+ export const resolveFromAST = (program, { cwd }) => {
6
6
  const inputs = [];
7
7
  const srcDir = collectFirstPropertyValue(program, 'srcDir') ?? 'src';
8
8
  inputs.push(toProductionEntry(`${srcDir}/**/*.tsx`));
9
9
  for (const pattern of entry)
10
10
  inputs.push(toEntry(pattern));
11
11
  for (const script of collectPropertyValues(program, 'globalScript')) {
12
- inputs.push(toProductionEntry(script));
12
+ inputs.push(toDeferResolveProductionEntry(script, { dir: cwd }));
13
13
  }
14
14
  for (const style of collectPropertyValues(program, 'globalStyle')) {
15
- inputs.push(toProductionEntry(style));
15
+ inputs.push(toDeferResolveProductionEntry(style, { dir: cwd }));
16
16
  }
17
17
  new Visitor({
18
18
  ObjectExpression(node) {
@@ -20,7 +20,7 @@ export const resolveFromAST = program => {
20
20
  if (!typeValues.has('global-style'))
21
21
  return;
22
22
  for (const input of getPropertyValues(node, 'input'))
23
- inputs.push(toProductionEntry(input));
23
+ inputs.push(toDeferResolveProductionEntry(input, { dir: cwd }));
24
24
  },
25
25
  }).visit(program);
26
26
  for (const tsconfig of collectPropertyValues(program, 'tsconfig')) {
@@ -1,4 +1,4 @@
1
- import { toConfig, toDeferResolve } from '../../util/input.js';
1
+ import { toConfig, toDeferResolve, toDependency } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Stryker';
4
4
  const enablers = ['@stryker-mutator/core'];
@@ -10,7 +10,7 @@ const resolveConfig = localConfig => {
10
10
  ? localConfig.checkers.map(checker => `@stryker-mutator/${checker}-checker`)
11
11
  : [];
12
12
  const plugins = localConfig.plugins ?? [];
13
- return [...runners, ...checkers, ...plugins].map(id => toDeferResolve(id));
13
+ return [...runners, ...checkers].map(id => toDependency(id)).concat(plugins.map(id => toDeferResolve(id)));
14
14
  };
15
15
  const args = {
16
16
  boolean: ['allowEmpty', 'disableBail', 'dryRunOnly', 'force', 'ignoreStatic', 'incremental', 'inPlace'],
@@ -1,11 +1,12 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toDependency } from '../../util/input.js';
2
+ import { toDeferResolve, toDependency } from '../../util/input.js';
3
+ import { isInternal } from '../../util/path.js';
3
4
  import { hasDependency } from '../../util/plugin.js';
4
5
  const title = 'SWC';
5
6
  const enablers = ['@swc/core'];
6
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
8
  const config = ['.swcrc'];
8
- const resolveConfig = async (config) => {
9
+ const resolveConfig = async (config, options) => {
9
10
  const dependencies = [];
10
11
  for (const item of [config].flat()) {
11
12
  for (const [id] of item?.jsc?.experimental?.plugins ?? [])
@@ -13,7 +14,7 @@ const resolveConfig = async (config) => {
13
14
  if (item?.jsc?.externalHelpers)
14
15
  dependencies.push('@swc/helpers');
15
16
  }
16
- return compact(dependencies).map(id => toDependency(id));
17
+ return compact(dependencies).map(id => isInternal(id) ? toDeferResolve(id, { dir: options.cwd }) : toDependency(id));
17
18
  };
18
19
  const plugin = {
19
20
  title,
@@ -1,4 +1,4 @@
1
- import { toProductionEntry } from '../../util/input.js';
1
+ import { toDeferResolveProductionEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  import compiler from './compiler.js';
4
4
  const title = 'Tailwind';
@@ -23,7 +23,7 @@ const args = {
23
23
  binaries: ['tailwindcss'],
24
24
  string: ['input'],
25
25
  alias: { input: ['i'] },
26
- resolveInputs: parsed => (parsed.input ? [toProductionEntry(parsed.input)] : []),
26
+ resolveInputs: (parsed, { cwd }) => (parsed.input ? [toDeferResolveProductionEntry(parsed.input, { dir: cwd })] : []),
27
27
  };
28
28
  const plugin = {
29
29
  title,
@@ -1,4 +1,4 @@
1
- import { toProductionEntry } from '../../util/input.js';
1
+ import { toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
2
2
  import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'TanStack Router';
@@ -20,7 +20,7 @@ const resolveConfig = async (localConfig, options) => {
20
20
  const { configFileDir } = options;
21
21
  const generatedRouteTree = localConfig.generatedRouteTree ?? './src/routeTree.gen.ts';
22
22
  const routeTreePath = toAbsolute(generatedRouteTree, configFileDir);
23
- return [toProductionEntry(routeTreePath), ...routerEntries.map(id => toProductionEntry(id))];
23
+ return [toDeferResolveProductionEntry(routeTreePath), ...routerEntries.map(id => toProductionEntry(id))];
24
24
  };
25
25
  const plugin = {
26
26
  title,
@@ -3,7 +3,12 @@ const args = {
3
3
  positional: true,
4
4
  nodeImportArgs: true,
5
5
  boolean: ['transpileOnly', 'compilerHost', 'ignoreDiagnostics', 'swc', 'preferTsExts'],
6
- alias: { transpileOnly: ['T'], compilerHost: ['H'], ignoreDiagnostics: ['D'] },
6
+ alias: {
7
+ transpileOnly: ['T', 'transpile-only'],
8
+ compilerHost: ['H', 'compiler-host'],
9
+ ignoreDiagnostics: ['D'],
10
+ preferTsExts: ['prefer-ts-exts'],
11
+ },
7
12
  };
8
13
  const plugin = {
9
14
  title,
@@ -1,4 +1,4 @@
1
- import { toEntry } from '../../util/input.js';
1
+ import { toDeferResolveEntry, toEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Turborepo';
4
4
  const enablers = ['turbo', '@turbo/gen'];
@@ -8,8 +8,8 @@ const entry = [`turbo/generators/config.${extensions}`];
8
8
  const resolve = ({ cwd, rootCwd }) => (cwd === rootCwd ? [toEntry(`plopfile.${extensions}`)] : []);
9
9
  const args = {
10
10
  string: ['config'],
11
- resolveInputs: parsed => (parsed._[0] === 'gen' || parsed._[0] === 'generate') && typeof parsed.config === 'string'
12
- ? [toEntry(parsed.config)]
11
+ resolveInputs: (parsed, { cwd }) => (parsed._[0] === 'gen' || parsed._[0] === 'generate') && typeof parsed.config === 'string'
12
+ ? [toDeferResolveEntry(parsed.config, { dir: cwd })]
13
13
  : [],
14
14
  };
15
15
  const plugin = {
@@ -1,5 +1,5 @@
1
1
  import { arrayify } from '../../util/array.js';
2
- import { toDeferResolve, toEntry } from '../../util/input.js';
2
+ import { toDeferResolve, toDeferResolveEntry } from '../../util/input.js';
3
3
  import { join } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'TypeDoc';
@@ -21,7 +21,7 @@ const resolveConfig = (config, options) => {
21
21
  const inputs = [...plugins, ...themes].map(id => toDeferResolve(id));
22
22
  for (const file of [cfg?.customCss, cfg?.customJs]) {
23
23
  if (file)
24
- inputs.push(toEntry(join(options.configFileDir, file)));
24
+ inputs.push(toDeferResolveEntry(join(options.configFileDir, file)));
25
25
  }
26
26
  return inputs;
27
27
  };
@@ -1,4 +1,4 @@
1
1
  import type { Input } from '../../util/input.ts';
2
- type ResolveContentMapperOptions = (options: Record<string, unknown>) => Input[];
2
+ type ResolveContentMapperOptions = (options: Record<string, unknown>, dir: string) => Input[];
3
3
  export declare const contentMapperResolvers: Map<string, ResolveContentMapperOptions>;
4
4
  export {};
@@ -7,13 +7,13 @@ const title = 'TypeScript';
7
7
  const enablers = ['typescript', '@typescript/native', '@typescript/native-preview'];
8
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
9
  export const config = ['tsconfig.json'];
10
- const resolveContentMappers = (localConfig) => {
10
+ const resolveContentMappers = (localConfig, dir) => {
11
11
  const inputs = [];
12
12
  for (const { package: name, options } of localConfig.contentMappers ?? []) {
13
13
  inputs.push(toDependency(name));
14
14
  const resolveOptions = contentMapperResolvers.get(name);
15
15
  if (resolveOptions && options)
16
- inputs.push(...resolveOptions(options));
16
+ inputs.push(...resolveOptions(options, dir));
17
17
  }
18
18
  return inputs;
19
19
  };
@@ -23,14 +23,10 @@ export const resolveConfig = (localConfig, options) => {
23
23
  ? [localConfig.extends].flat().map(specifier => toConfig(options.pluginName, specifier))
24
24
  : [];
25
25
  const references = localConfig.references?.map(({ path }) => toConfig(options.pluginName, path.endsWith('.json') ? path : toAbsolute(join(path, 'tsconfig.json'), options.configFileDir))) ?? [];
26
- const contentMappers = resolveContentMappers(localConfig);
26
+ const contentMappers = resolveContentMappers(localConfig, options.configFileDir);
27
27
  if (!(compilerOptions && localConfig))
28
28
  return compact([...contentMappers, ...extend, ...references]);
29
- const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(id => ({
30
- ...toProductionDependency(id),
31
- dir: options.cwd,
32
- alsoReferenceOwner: true,
33
- }));
29
+ const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(id => toProductionDependency(id, { dir: options.cwd, alsoReferenceOwner: true }));
34
30
  const types = compilerOptions.types ?? [];
35
31
  const plugins = Array.isArray(compilerOptions?.plugins)
36
32
  ? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
@@ -41,7 +37,8 @@ export const resolveConfig = (localConfig, options) => {
41
37
  ...extend,
42
38
  ...references,
43
39
  ...types.map(id => toDeferResolve(id, { isTypeOnly: true, dir: options.cwd, alsoReferenceOwner: true })),
44
- ...[...plugins, ...importHelpers].map(id => toDeferResolve(id, { dir: options.cwd, alsoReferenceOwner: true })),
40
+ ...plugins.map(id => toDependency(id, { dir: options.cwd, alsoReferenceOwner: true })),
41
+ ...importHelpers.map(id => toProductionDependency(id, { dir: options.cwd, alsoReferenceOwner: true })),
45
42
  ...jsx,
46
43
  ]);
47
44
  };
@@ -59,7 +59,7 @@ export const scanVarlockFiles = (paths, cwd) => {
59
59
  else {
60
60
  const packageName = getPackageNameFromModuleSpecifier(descriptor);
61
61
  if (packageName) {
62
- inputs.push({ ...toDependency(packageName, { containingFilePath: realPath }), production: true });
62
+ inputs.push(toDependency(packageName, { containingFilePath: realPath, production: true }));
63
63
  }
64
64
  }
65
65
  continue;
@@ -1,6 +1,7 @@
1
1
  import type { Program } from 'oxc-parser';
2
2
  import { type Input } from '../../util/input.ts';
3
3
  export declare const getBabelInputs: (program: Program) => Input[];
4
+ export declare const getMdxInputs: (program: Program, dir: string) => Input[];
4
5
  export declare const getHtmlScriptEntries: (htmlPath: string, rootDir?: string, publicDir?: string) => Promise<Input[]>;
5
6
  export declare const getIndexHtmlEntries: (rootDir: string, publicDir?: string) => Promise<Input[]>;
6
7
  export declare const getVitePluginDirs: (program: Program, specifiers: string[], key: string) => string[] | undefined;