knip 6.45.1 → 6.46.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 (208) hide show
  1. package/README.md +42 -18
  2. package/dist/ConfigurationChief.d.ts +6 -0
  3. package/dist/ConfigurationChief.js +2 -2
  4. package/dist/DependencyDeputy.d.ts +12 -14
  5. package/dist/DependencyDeputy.js +33 -21
  6. package/dist/IssueCollector.d.ts +1 -0
  7. package/dist/IssueCollector.js +4 -1
  8. package/dist/PackagePeeker.d.ts +0 -9
  9. package/dist/PackagePeeker.js +0 -38
  10. package/dist/ProjectPrincipal.d.ts +1 -1
  11. package/dist/ProjectPrincipal.js +3 -1
  12. package/dist/WorkspaceWorker.js +7 -7
  13. package/dist/binaries/bash-parser.js +5 -8
  14. package/dist/binaries/command.js +2 -2
  15. package/dist/binaries/fallback.d.ts +5 -1
  16. package/dist/binaries/fallback.js +41 -10
  17. package/dist/binaries/plugins.d.ts +1 -0
  18. package/dist/binaries/plugins.js +75 -39
  19. package/dist/binaries/resolvers/bun.js +2 -2
  20. package/dist/binaries/resolvers/npm.js +2 -2
  21. package/dist/binaries/resolvers/npx.js +2 -2
  22. package/dist/binaries/resolvers/nub.js +2 -2
  23. package/dist/binaries/resolvers/pnpm.js +29 -21
  24. package/dist/binaries/resolvers/pnpx.js +20 -8
  25. package/dist/binaries/resolvers/vp.js +1 -1
  26. package/dist/binaries/resolvers/yarn.js +1 -1
  27. package/dist/binaries/util.d.ts +4 -1
  28. package/dist/binaries/util.js +10 -13
  29. package/dist/constants.js +18 -0
  30. package/dist/graph/SubpathReferences.d.ts +1 -1
  31. package/dist/graph/SubpathReferences.js +4 -3
  32. package/dist/graph/build.js +11 -12
  33. package/dist/plugins/_template/index.js +2 -2
  34. package/dist/plugins/angular/index.js +3 -8
  35. package/dist/plugins/astro/resolveFromAST.js +2 -2
  36. package/dist/plugins/astro-markdoc/index.js +2 -2
  37. package/dist/plugins/aws-cdk/index.js +3 -3
  38. package/dist/plugins/babel/index.js +5 -3
  39. package/dist/plugins/borp/index.js +2 -2
  40. package/dist/plugins/bun/index.js +3 -3
  41. package/dist/plugins/capacitor/index.js +33 -6
  42. package/dist/plugins/capacitor/types.d.ts +10 -0
  43. package/dist/plugins/changesets/index.js +2 -2
  44. package/dist/plugins/commitizen/index.js +2 -2
  45. package/dist/plugins/commitlint/index.js +2 -2
  46. package/dist/plugins/convex/index.js +2 -2
  47. package/dist/plugins/cspell/index.js +2 -2
  48. package/dist/plugins/cucumber/index.js +2 -2
  49. package/dist/plugins/cypress/index.js +3 -3
  50. package/dist/plugins/docusaurus/helpers.js +4 -4
  51. package/dist/plugins/docusaurus/index.js +3 -3
  52. package/dist/plugins/dotenv/index.js +6 -2
  53. package/dist/plugins/drizzle/index.js +2 -2
  54. package/dist/plugins/electron-builder/index.d.ts +3 -0
  55. package/dist/plugins/electron-builder/index.js +61 -0
  56. package/dist/plugins/electron-forge/index.js +2 -2
  57. package/dist/plugins/electron-vite/index.js +4 -3
  58. package/dist/plugins/electron-vite/types.d.ts +3 -0
  59. package/dist/plugins/eleventy/index.js +2 -2
  60. package/dist/plugins/ember/compiler.d.ts +2 -0
  61. package/dist/plugins/ember/compiler.js +14 -0
  62. package/dist/plugins/ember/index.d.ts +6 -0
  63. package/dist/plugins/ember/index.js +160 -0
  64. package/dist/plugins/ember/types.d.ts +13 -0
  65. package/dist/plugins/ember/types.js +1 -0
  66. package/dist/plugins/ember/visitors/importSync.d.ts +2 -0
  67. package/dist/plugins/ember/visitors/importSync.js +32 -0
  68. package/dist/plugins/ember-template-lint/index.d.ts +3 -0
  69. package/dist/plugins/ember-template-lint/index.js +20 -0
  70. package/dist/plugins/env-cmd/index.d.ts +3 -0
  71. package/dist/plugins/env-cmd/index.js +16 -0
  72. package/dist/plugins/esbuild/index.js +2 -2
  73. package/dist/plugins/eslint/helpers.js +6 -6
  74. package/dist/plugins/eslint/index.js +0 -1
  75. package/dist/plugins/eslint/resolveFromAST.js +11 -3
  76. package/dist/plugins/evalite/index.js +2 -2
  77. package/dist/plugins/expo/helpers.js +10 -10
  78. package/dist/plugins/expo-router/index.js +3 -3
  79. package/dist/plugins/filesystem-routing/index.js +4 -4
  80. package/dist/plugins/flue/index.js +4 -4
  81. package/dist/plugins/gatsby/index.js +3 -3
  82. package/dist/plugins/github-action/index.js +2 -2
  83. package/dist/plugins/github-actions/index.js +2 -2
  84. package/dist/plugins/graphql-codegen/index.js +8 -6
  85. package/dist/plugins/index.d.ts +6 -0
  86. package/dist/plugins/index.js +12 -0
  87. package/dist/plugins/jasmine/index.js +3 -4
  88. package/dist/plugins/jest/index.js +3 -3
  89. package/dist/plugins/karma/helpers.js +2 -2
  90. package/dist/plugins/karma/index.js +5 -1
  91. package/dist/plugins/knex/index.js +13 -7
  92. package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
  93. package/dist/plugins/linthtml/index.js +2 -2
  94. package/dist/plugins/lunaria/index.js +3 -3
  95. package/dist/plugins/maestro/index.d.ts +3 -0
  96. package/dist/plugins/maestro/index.js +54 -0
  97. package/dist/plugins/maestro/types.d.ts +21 -0
  98. package/dist/plugins/maestro/types.js +1 -0
  99. package/dist/plugins/markdownlint/index.js +3 -3
  100. package/dist/plugins/marko/index.js +4 -4
  101. package/dist/plugins/mastra/index.js +3 -3
  102. package/dist/plugins/mdx/index.js +3 -3
  103. package/dist/plugins/mdxlint/index.js +2 -2
  104. package/dist/plugins/metro/index.js +5 -5
  105. package/dist/plugins/mikro-orm/index.js +3 -4
  106. package/dist/plugins/mise/scripts.js +2 -3
  107. package/dist/plugins/mocha/index.js +8 -7
  108. package/dist/plugins/netlify/index.js +3 -3
  109. package/dist/plugins/next/index.js +5 -5
  110. package/dist/plugins/next-mdx/resolveFromAST.js +2 -2
  111. package/dist/plugins/nitro/index.js +4 -4
  112. package/dist/plugins/node/index.d.ts +16 -0
  113. package/dist/plugins/node/index.js +89 -23
  114. package/dist/plugins/nodemon/index.js +1 -1
  115. package/dist/plugins/npm-package-json-lint/index.js +2 -2
  116. package/dist/plugins/nuxt/index.js +16 -14
  117. package/dist/plugins/nx/index.js +3 -3
  118. package/dist/plugins/nyc/index.js +39 -2
  119. package/dist/plugins/oclif/index.js +2 -2
  120. package/dist/plugins/openclaw/index.js +5 -5
  121. package/dist/plugins/oxlint/index.js +2 -2
  122. package/dist/plugins/panda-css/index.js +2 -2
  123. package/dist/plugins/parcel/index.js +2 -2
  124. package/dist/plugins/payload/index.js +3 -3
  125. package/dist/plugins/playwright/index.js +4 -4
  126. package/dist/plugins/pm2/index.js +2 -2
  127. package/dist/plugins/pnpm/index.js +1 -1
  128. package/dist/plugins/postcss/index.js +2 -2
  129. package/dist/plugins/preconstruct/index.js +2 -2
  130. package/dist/plugins/prettier/index.js +4 -3
  131. package/dist/plugins/prisma/index.js +5 -5
  132. package/dist/plugins/quasar/resolveFromAST.js +6 -6
  133. package/dist/plugins/qwik/resolveFromAST.js +3 -3
  134. package/dist/plugins/raycast/index.js +2 -2
  135. package/dist/plugins/react-cosmos/index.js +2 -2
  136. package/dist/plugins/react-router/index.js +6 -6
  137. package/dist/plugins/relay/index.js +3 -3
  138. package/dist/plugins/release-it/index.js +2 -5
  139. package/dist/plugins/remark/helpers.js +2 -2
  140. package/dist/plugins/retry-cli/index.js +0 -1
  141. package/dist/plugins/rolldown/index.js +2 -2
  142. package/dist/plugins/rollup/index.js +2 -2
  143. package/dist/plugins/rsbuild/index.js +3 -3
  144. package/dist/plugins/rslib/index.js +2 -2
  145. package/dist/plugins/rslint/index.d.ts +3 -0
  146. package/dist/plugins/rslint/index.js +16 -0
  147. package/dist/plugins/rspack/index.js +4 -0
  148. package/dist/plugins/rstest/index.js +4 -4
  149. package/dist/plugins/semantic-release/index.js +2 -2
  150. package/dist/plugins/serverless-framework/index.js +4 -4
  151. package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +3 -3
  152. package/dist/plugins/sst/resolveFromAST.js +2 -2
  153. package/dist/plugins/starlight/resolveFromAST.js +3 -3
  154. package/dist/plugins/stencil/resolveFromAST.js +5 -5
  155. package/dist/plugins/storybook/index.js +2 -2
  156. package/dist/plugins/stryker/index.js +2 -2
  157. package/dist/plugins/stylelint/index.js +4 -4
  158. package/dist/plugins/sveltekit/resolveFromAST.js +7 -5
  159. package/dist/plugins/swc/index.js +2 -2
  160. package/dist/plugins/tailwind/index.js +3 -2
  161. package/dist/plugins/tanstack-router/index.js +5 -2
  162. package/dist/plugins/textlint/helpers.js +2 -2
  163. package/dist/plugins/ts-node/index.js +23 -6
  164. package/dist/plugins/tsd/index.js +1 -1
  165. package/dist/plugins/tsdown/index.js +4 -4
  166. package/dist/plugins/tsup/index.js +3 -3
  167. package/dist/plugins/tsx/index.js +4 -3
  168. package/dist/plugins/turbo/index.js +2 -2
  169. package/dist/plugins/typedoc/index.js +4 -3
  170. package/dist/plugins/typescript/index.js +4 -4
  171. package/dist/plugins/varlock/scan.js +6 -3
  172. package/dist/plugins/vite/helpers.js +2 -2
  173. package/dist/plugins/vite-plugin-pages/index.js +2 -2
  174. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  175. package/dist/plugins/vite-plugin-vue-layouts-next/index.js +2 -2
  176. package/dist/plugins/vitest/index.js +14 -18
  177. package/dist/plugins/webdriver-io/index.js +13 -1
  178. package/dist/plugins/webpack/index.js +5 -8
  179. package/dist/plugins/wrangler/index.js +3 -3
  180. package/dist/plugins/wxt/index.js +2 -2
  181. package/dist/plugins/yarn/index.js +5 -5
  182. package/dist/session/incremental.d.ts +1 -1
  183. package/dist/types/PluginNames.d.ts +2 -2
  184. package/dist/types/PluginNames.js +6 -0
  185. package/dist/types/args.d.ts +4 -3
  186. package/dist/types/config.d.ts +2 -0
  187. package/dist/types/module-graph.d.ts +1 -1
  188. package/dist/types/package-json.d.ts +1 -0
  189. package/dist/types/workspace.d.ts +10 -8
  190. package/dist/typescript/ast-nodes.js +4 -5
  191. package/dist/typescript/get-imports-and-exports.js +5 -2
  192. package/dist/typescript/visitors/exports.js +6 -32
  193. package/dist/typescript/visitors/imports.d.ts +1 -1
  194. package/dist/typescript/visitors/imports.js +15 -24
  195. package/dist/typescript/visitors/walk.d.ts +5 -0
  196. package/dist/typescript/visitors/walk.js +75 -30
  197. package/dist/util/codeowners.js +4 -1
  198. package/dist/util/input.d.ts +3 -6
  199. package/dist/util/input.js +6 -20
  200. package/dist/util/parse-and-convert-gitignores.js +5 -4
  201. package/dist/util/parse-args.d.ts +2 -1
  202. package/dist/util/parse-args.js +13 -3
  203. package/dist/util/plugin.js +6 -4
  204. package/dist/util/watch.js +1 -1
  205. package/dist/version.d.ts +1 -1
  206. package/dist/version.js +1 -1
  207. package/package.json +1 -1
  208. package/schema.json +36 -5
@@ -1,6 +1,6 @@
1
1
  import { isDirectory } from '../../util/fs.js';
2
- import { toDeferResolveEntry, toEntry } from '../../util/input.js';
3
- import { join } from '../../util/path.js';
2
+ import { toEntryPath, toEntry } from '../../util/input.js';
3
+ import { join, toAbsolute } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  import compiler from './compiler.js';
6
6
  const title = 'Prisma';
@@ -14,9 +14,9 @@ const config = [
14
14
  ];
15
15
  const resolveSchema = (path, cwd) => {
16
16
  if (!isDirectory(cwd, path)) {
17
- return toDeferResolveEntry(path, { dir: cwd });
17
+ return toEntryPath(path, { dir: cwd });
18
18
  }
19
- return toEntry(join(path, '**/*.prisma'));
19
+ return toEntry(join(toAbsolute(path, cwd), '**/*.prisma'));
20
20
  };
21
21
  const resolveConfig = async (config, options) => {
22
22
  const inputs = [];
@@ -27,7 +27,7 @@ const resolveConfig = async (config, options) => {
27
27
  inputs.push(...options.getInputsFromScripts(config.migrations.seed));
28
28
  }
29
29
  if (config.schema) {
30
- inputs.push(resolveSchema(config.schema, options.cwd));
30
+ inputs.push(resolveSchema(config.schema, options.configFileDir));
31
31
  }
32
32
  return inputs;
33
33
  };
@@ -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 { toDependency, toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
3
+ import { toDependency, toEntryPath, toEntry } from '../../util/input.js';
4
4
  import { join } from '../../util/path.js';
5
5
  const sourceFilesEntries = [
6
6
  ['rootComponent', ['src/App.vue']],
@@ -39,13 +39,13 @@ export const resolveFromAST = (program, options) => {
39
39
  for (const [key, defaults] of sourceFilesEntries) {
40
40
  const override = getFirstPropertyValue(sourceFiles, key);
41
41
  if (override)
42
- inputs.push(toDeferResolveProductionEntry(join(configFileDir, override)));
42
+ inputs.push(toEntryPath(join(configFileDir, override), { production: true }));
43
43
  else
44
44
  for (const id of defaults)
45
- inputs.push(toProductionEntry(join(configFileDir, id)));
45
+ inputs.push(toEntry(join(configFileDir, id), { production: true }));
46
46
  }
47
47
  for (const id of staticEntries)
48
- inputs.push(toProductionEntry(join(configFileDir, id)));
48
+ inputs.push(toEntry(join(configFileDir, id), { production: true }));
49
49
  const boot = findProperty(config, 'boot');
50
50
  if (boot?.type === 'ArrayExpression') {
51
51
  for (const element of boot.elements ?? []) {
@@ -55,14 +55,14 @@ export const resolveFromAST = (program, options) => {
55
55
  if (id.startsWith('~'))
56
56
  inputs.push(toDependency(id.slice(1)));
57
57
  else
58
- inputs.push(toDeferResolveProductionEntry(join(configFileDir, 'src/boot', id)));
58
+ inputs.push(toEntryPath(join(configFileDir, 'src/boot', id), { production: true }));
59
59
  }
60
60
  }
61
61
  for (const id of getStringValues(findProperty(config, 'css'))) {
62
62
  if (id.startsWith('~'))
63
63
  inputs.push(toDependency(id.slice(1)));
64
64
  else
65
- inputs.push(toDeferResolveProductionEntry(join(configFileDir, 'src/css', id)));
65
+ inputs.push(toEntryPath(join(configFileDir, 'src/css', id), { production: true }));
66
66
  }
67
67
  return inputs;
68
68
  };
@@ -1,5 +1,5 @@
1
1
  import { findCallArg, getFirstPropertyValue, getPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toEntry, toIgnore, toProductionEntry } from '../../util/input.js';
2
+ import { toEntry, toIgnore } from '../../util/input.js';
3
3
  export const entry = ['src/entry.dev.tsx'];
4
4
  export const production = ['src/root.tsx', 'src/entry.*.tsx'];
5
5
  export const routeProduction = ['src/routes/**/*.{tsx,ts,md,mdx}'];
@@ -24,12 +24,12 @@ export const resolveFromAST = program => {
24
24
  const routeEntries = [];
25
25
  for (const routesDir of routesDirs) {
26
26
  for (const pattern of routeProduction) {
27
- routeEntries.push(toProductionEntry(setRoutesDir(pattern, routesDir)));
27
+ routeEntries.push(toEntry(setRoutesDir(pattern, routesDir), { production: true }));
28
28
  }
29
29
  }
30
30
  return [
31
31
  ...entry.map(setSrcDir).map(path => toEntry(path)),
32
- ...production.map(setSrcDir).map(path => toProductionEntry(path)),
32
+ ...production.map(setSrcDir).map(path => toEntry(path, { production: true })),
33
33
  ...routeEntries,
34
34
  toIgnore('@qwik-city-plan', 'unlisted'),
35
35
  toIgnore('@qwik-city-sw-register', 'unlisted'),
@@ -1,5 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Raycast';
5
5
  const enablers = ['@raycast/api'];
@@ -8,7 +8,7 @@ const config = ['package.json'];
8
8
  const packageJsonPath = (manifest) => manifest;
9
9
  const mapEntries = (items, directory) => {
10
10
  const names = compact((items ?? []).map(item => (typeof item.name === 'string' ? item.name : undefined)));
11
- return names.map(name => toProductionEntry(`${directory}${name}.{js,jsx,ts,tsx}`));
11
+ return names.map(name => toEntry(`${directory}${name}.{js,jsx,ts,tsx}`, { production: true }));
12
12
  };
13
13
  const resolveConfig = async (manifest) => [
14
14
  ...mapEntries(manifest.commands, 'src/'),
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toEntry } from '../../util/input.js';
1
+ import { toModule, toEntry } from '../../util/input.js';
2
2
  import { join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'React Cosmos';
@@ -18,7 +18,7 @@ const resolveConfig = async (localConfig) => {
18
18
  ];
19
19
  return [...entries, ...decoratorEntry]
20
20
  .map(id => toEntry(id))
21
- .concat((localConfig?.plugins ?? []).map(id => toDeferResolve(id)));
21
+ .concat((localConfig?.plugins ?? []).map(id => toModule(id)));
22
22
  };
23
23
  const plugin = {
24
24
  title,
@@ -1,6 +1,6 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { _glob } from '../../util/glob.js';
3
- import { toDeferResolveProductionEntry, toEntry, toProductionDependency, toProductionEntry } from '../../util/input.js';
3
+ import { toEntryPath, toEntry, toDependency } 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';
@@ -26,17 +26,17 @@ const resolveConfig = async (localConfig, options) => {
26
26
  const routes = routeConfig.flatMap(mapRoute);
27
27
  const resolved = [
28
28
  toEntry(join(appDir, `routes.${entryExtsGlob}`)),
29
- toProductionEntry(join(appDir, `root.${entryExtsGlob}`)),
30
- toProductionEntry(join(appDir, `entry.{client,server}.${entryExtsGlob}`)),
31
- ...routes.map(id => toDeferResolveProductionEntry(id)),
29
+ toEntry(join(appDir, `root.${entryExtsGlob}`), { production: true }),
30
+ toEntry(join(appDir, `entry.{client,server}.${entryExtsGlob}`), { production: true }),
31
+ ...routes.map(id => toEntryPath(id, { production: true })),
32
32
  ];
33
33
  const serverEntries = await _glob({
34
34
  cwd: appDir,
35
35
  patterns: [`entry.server.${entryExtsGlob}`],
36
36
  });
37
37
  if (serverEntries.length === 0) {
38
- resolved.push(toProductionDependency('@react-router/node'));
39
- resolved.push(toProductionDependency('isbot'));
38
+ resolved.push(toDependency('@react-router/node', { production: true }));
39
+ resolved.push(toDependency('isbot', { production: true }));
40
40
  }
41
41
  return resolved;
42
42
  };
@@ -1,5 +1,5 @@
1
1
  import parseArgs from '../../util/parse-args.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { join } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'Relay';
@@ -11,9 +11,9 @@ const resolveConfig = async (config) => {
11
11
  return projects.map(project => {
12
12
  const artifactDirectory = project.artifactDirectory;
13
13
  if (artifactDirectory == null) {
14
- return toProductionEntry('**/__generated__/*');
14
+ return toEntry('**/__generated__/*', { production: true });
15
15
  }
16
- return toProductionEntry(join(artifactDirectory, '**'));
16
+ return toEntry(join(artifactDirectory, '**'), { production: true });
17
17
  });
18
18
  };
19
19
  const args = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDependency } from '../../util/input.js';
1
+ import { toModule, toDependency } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Release It!';
@@ -15,10 +15,7 @@ const resolveConfig = (config, options) => {
15
15
  scripts.push(config.gitlab.releaseNotes);
16
16
  }
17
17
  const inputs = options.getInputsFromScripts(scripts);
18
- return [
19
- ...plugins.map(id => (isInternal(id) ? toDeferResolve(id, { dir: options.cwd }) : toDependency(id))),
20
- ...inputs,
21
- ];
18
+ return [...plugins.map(id => (isInternal(id) ? toModule(id, { dir: options.cwd }) : toDependency(id))), ...inputs];
22
19
  };
23
20
  const plugin = {
24
21
  title,
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDependency } from '../../util/input.js';
1
+ import { toModule, toDependency } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  const getCandidates = (prefix, identifier) => {
4
4
  if (isInternal(identifier))
@@ -38,5 +38,5 @@ const pickCandidate = (prefix, identifier, manifest) => {
38
38
  export const resolveLoadPluginStylePluginName = (prefix, identifier, manifest) => {
39
39
  prefix = prefix + (prefix.at(-1) === '-' ? '' : '-');
40
40
  const candidate = pickCandidate(prefix, identifier, manifest);
41
- return isInternal(candidate) ? toDeferResolve(candidate) : toDependency(candidate);
41
+ return isInternal(candidate) ? toModule(candidate) : toDependency(candidate);
42
42
  };
@@ -2,7 +2,6 @@ import { spawningArgs } from '../../binaries/util.js';
2
2
  const title = 'retry-cli';
3
3
  const args = {
4
4
  binaries: ['retry', 'retry-cli'],
5
- string: ['factor', 'max-timeout', 'min-timeout', 'retries'],
6
5
  boolean: ['help', 'randomize'],
7
6
  alias: { factor: ['f'], help: ['h'], 'min-timeout': ['t'], retries: ['n'] },
8
7
  fromArgs: spawningArgs,
@@ -1,11 +1,11 @@
1
1
  import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Rolldown';
5
5
  const enablers = ['rolldown'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['rolldown.config.{js,cjs,mjs,ts,cts,mts}'];
8
- const resolveFromAST = program => Array.from(collectPropertyValues(program, 'input'), id => toProductionEntry(id));
8
+ const resolveFromAST = program => Array.from(collectPropertyValues(program, 'input'), id => toEntry(id, { production: true }));
9
9
  const plugin = {
10
10
  title,
11
11
  enablers,
@@ -1,5 +1,5 @@
1
1
  import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Rollup';
5
5
  const enablers = ['rollup'];
@@ -12,7 +12,7 @@ const args = {
12
12
  fromArgs: ['_exec'],
13
13
  resolve: ['plugin', 'configPlugin'],
14
14
  };
15
- const resolveFromAST = program => Array.from(collectPropertyValues(program, 'input'), id => toProductionEntry(id));
15
+ const resolveFromAST = program => Array.from(collectPropertyValues(program, 'input'), id => toEntry(id, { production: true }));
16
16
  const plugin = {
17
17
  title,
18
18
  enablers,
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toProductionEntry } from '../../util/input.js';
1
+ import { toModule, toEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  import { resolveConfig as resolveRspackConfig } from '../rspack/index.js';
4
4
  import { getSwcPluginSpecifiers } from '../webpack/index.js';
@@ -74,7 +74,7 @@ const resolveConfig = async (configOrFn, options) => {
74
74
  const swc = localConfig.tools?.swc;
75
75
  if (swc && typeof swc === 'object') {
76
76
  for (const specifier of getSwcPluginSpecifiers(swc))
77
- inputs.push(toDeferResolve(specifier));
77
+ inputs.push(toModule(specifier));
78
78
  }
79
79
  if (!localConfig.tools?.rspack)
80
80
  return;
@@ -117,7 +117,7 @@ const resolveConfig = async (configOrFn, options) => {
117
117
  }
118
118
  }
119
119
  for (const entry of entries)
120
- inputs.push(toProductionEntry(entry));
120
+ inputs.push(toEntry(entry, { production: true }));
121
121
  return inputs;
122
122
  };
123
123
  const plugin = {
@@ -1,11 +1,11 @@
1
1
  import { collectPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Rslib';
5
5
  const enablers = ['@rslib/core'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['rslib*.config.{mjs,ts,js,cjs,mts,cts}'];
8
- const resolveFromAST = program => Array.from(collectPropertyValues(program, 'entry'), id => toProductionEntry(id, { allowIncludeExports: true }));
8
+ const resolveFromAST = program => Array.from(collectPropertyValues(program, 'entry'), id => toEntry(id, { production: true, allowIncludeExports: true }));
9
9
  const plugin = {
10
10
  title,
11
11
  enablers,
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,16 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ const title = 'Rslint';
3
+ const enablers = ['@rslint/core'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const entry = ['rslint.config.{js,mjs,ts,mts}'];
6
+ const args = {
7
+ config: true,
8
+ };
9
+ const plugin = {
10
+ title,
11
+ enablers,
12
+ isEnabled,
13
+ entry,
14
+ args,
15
+ };
16
+ export default plugin;
@@ -12,6 +12,9 @@ export const resolveConfig = async (localConfig, options) => {
12
12
  const registerVisitors = ({ ctx, registerVisitor }) => {
13
13
  registerVisitor(createRequireContextVisitor(ctx));
14
14
  };
15
+ const args = {
16
+ config: true,
17
+ };
15
18
  const plugin = {
16
19
  title,
17
20
  enablers,
@@ -19,5 +22,6 @@ const plugin = {
19
22
  config,
20
23
  resolveConfig,
21
24
  registerVisitors,
25
+ args,
22
26
  };
23
27
  export default plugin;
@@ -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, toDeferResolveEntry, toDependency, toEntry, } from '../../util/input.js';
4
+ import { toAlias, toConfig, toModule, toEntryPath, 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,12 +39,12 @@ 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(exclude.length === 0 ? toEntry(entry) : toDeferResolveEntry(entry));
42
+ inputs.push(exclude.length === 0 ? toEntry(entry) : toEntryPath(entry));
43
43
  }
44
44
  const env = project.testEnvironment;
45
45
  inputs.push(...getEnvironmentDependency(typeof env === 'string' ? env : env?.name));
46
46
  for (const specifier of [project.setupFiles ?? [], project.globalSetup ?? []].flat()) {
47
- inputs.push(toDeferResolve(replaceRootDir(specifier, projectRoot), { dir: projectRoot }));
47
+ inputs.push(toModule(replaceRootDir(specifier, projectRoot), { dir: projectRoot }));
48
48
  }
49
49
  if (project.browser?.enabled) {
50
50
  inputs.push(toDependency('@rstest/browser'), toDependency('playwright'));
@@ -94,7 +94,7 @@ const resolveConfig = async (localConfig, options) => {
94
94
  inputs.push(toConfig('rstest', filePath));
95
95
  continue;
96
96
  }
97
- inputs.push(toDeferResolveEntry(filePath));
97
+ inputs.push(toEntryPath(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, toDependency } from '../../util/input.js';
1
+ import { toConfig, toModule, 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';
@@ -24,7 +24,7 @@ const resolveConfig = (config, options) => {
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)))
27
- inputs.push(toDeferResolve(id));
27
+ inputs.push(toModule(id));
28
28
  return inputs;
29
29
  };
30
30
  const args = {
@@ -1,5 +1,5 @@
1
1
  import { arrayify } from '../../util/array.js';
2
- import { toDeferResolveProductionEntry, toDependency } from '../../util/input.js';
2
+ import { toEntryPath, 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';
@@ -25,9 +25,9 @@ const resolveFileVariable = async (value, dir) => {
25
25
  const handlerToEntry = (handler, dir) => {
26
26
  const dot = handler.lastIndexOf('.');
27
27
  const file = handler.slice(0, dot);
28
- return toDeferResolveProductionEntry(file, { dir });
28
+ return toEntryPath(file, { production: true, dir });
29
29
  };
30
- const pluginToInput = (plugin, dir) => isInternal(plugin) ? toDeferResolveProductionEntry(toAbsolute(plugin, dir)) : toDependency(plugin);
30
+ const pluginToInput = (plugin, dir) => isInternal(plugin) ? toEntryPath(toAbsolute(plugin, dir), { production: true }) : toDependency(plugin);
31
31
  const getFunctionEntries = async (functions, dir, cwd) => {
32
32
  const entries = [];
33
33
  const resolved = await resolveFileVariable(functions, dir);
@@ -44,7 +44,7 @@ const getFunctionEntries = async (functions, dir, cwd) => {
44
44
  return entries;
45
45
  };
46
46
  const getInjectEntries = (esbuild, dir) => esbuild && typeof esbuild === 'object'
47
- ? arrayify(esbuild.inject).map(id => toDeferResolveProductionEntry(join(dir, id)))
47
+ ? arrayify(esbuild.inject).map(id => toEntryPath(join(dir, id), { production: true }))
48
48
  : [];
49
49
  export const resolveConfig = async (config, options) => {
50
50
  const functions = await getFunctionEntries(config.functions, options.configFileDir, options.cwd);
@@ -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 { toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
4
+ import { toEntryPath, toEntry } 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'];
@@ -69,8 +69,8 @@ export const resolveFromAST = (program, options) => {
69
69
  }
70
70
  const inputs = [];
71
71
  for (const pattern of patterns)
72
- inputs.push(toProductionEntry(join(root, pattern)));
72
+ inputs.push(toEntry(join(root, pattern), { production: true }));
73
73
  for (const id of paths)
74
- inputs.push(toDeferResolveProductionEntry(toAbsolute(id, root)));
74
+ inputs.push(toEntryPath(toAbsolute(id, root), { production: true }));
75
75
  return inputs;
76
76
  };
@@ -1,7 +1,7 @@
1
1
  import { Visitor } from 'oxc-parser';
2
2
  import { collectPropertyValues, getImportMap } from '../../typescript/ast-helpers.js';
3
3
  import { _parseFile } from '../../typescript/ast-nodes.js';
4
- import { toDeferResolveProductionEntry } from '../../util/input.js';
4
+ import { toEntryPath } from '../../util/input.js';
5
5
  import { dirname } from '../../util/path.js';
6
6
  import { _resolveSync } from '../../util/resolve.js';
7
7
  export const resolveFromAST = (program, options) => {
@@ -44,5 +44,5 @@ export const resolveFromAST = (program, options) => {
44
44
  visitor.visit(program);
45
45
  }
46
46
  catch { }
47
- return Array.from(entries).map(specifier => toDeferResolveProductionEntry(specifier));
47
+ return Array.from(entries).map(specifier => toEntryPath(specifier, { production: true }));
48
48
  };
@@ -1,13 +1,13 @@
1
1
  import { findImportedCallArg, getPropertyValues } from '../../typescript/ast-helpers.js';
2
- import { toProductionEntry } from '../../util/input.js';
2
+ import { toEntry } from '../../util/input.js';
3
3
  export const resolveFromAST = program => {
4
4
  const starlightConfig = findImportedCallArg(program, '@astrojs/starlight');
5
5
  if (!starlightConfig)
6
6
  return [];
7
7
  const inputs = [];
8
8
  for (const id of getPropertyValues(starlightConfig, 'components'))
9
- inputs.push(toProductionEntry(id));
9
+ inputs.push(toEntry(id, { production: true }));
10
10
  for (const id of getPropertyValues(starlightConfig, 'customCss'))
11
- inputs.push(toProductionEntry(id));
11
+ inputs.push(toEntry(id, { production: true }));
12
12
  return inputs;
13
13
  };
@@ -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, toDeferResolveProductionEntry, toEntry, toProductionEntry } from '../../util/input.js';
3
+ import { toConfig, toEntryPath, toEntry } from '../../util/input.js';
4
4
  export const entry = ['**/*.spec.{ts,tsx}', '**/*.e2e.{ts,tsx}'];
5
5
  export const resolveFromAST = (program, { cwd }) => {
6
6
  const inputs = [];
7
7
  const srcDir = collectFirstPropertyValue(program, 'srcDir') ?? 'src';
8
- inputs.push(toProductionEntry(`${srcDir}/**/*.tsx`));
8
+ inputs.push(toEntry(`${srcDir}/**/*.tsx`, { production: true }));
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(toDeferResolveProductionEntry(script, { dir: cwd }));
12
+ inputs.push(toEntryPath(script, { production: true, dir: cwd }));
13
13
  }
14
14
  for (const style of collectPropertyValues(program, 'globalStyle')) {
15
- inputs.push(toDeferResolveProductionEntry(style, { dir: cwd }));
15
+ inputs.push(toEntryPath(style, { production: true, dir: cwd }));
16
16
  }
17
17
  new Visitor({
18
18
  ObjectExpression(node) {
@@ -20,7 +20,7 @@ export const resolveFromAST = (program, { cwd }) => {
20
20
  if (!typeValues.has('global-style'))
21
21
  return;
22
22
  for (const input of getPropertyValues(node, 'input'))
23
- inputs.push(toDeferResolveProductionEntry(input, { dir: cwd }));
23
+ inputs.push(toEntryPath(input, { production: true, dir: cwd }));
24
24
  },
25
25
  }).visit(program);
26
26
  for (const tsconfig of collectPropertyValues(program, 'tsconfig')) {
@@ -1,5 +1,5 @@
1
1
  import MDX from '../../compilers/mdx.js';
2
- import { toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
2
+ import { toConfig, toModule, toDependency, toEntry } from '../../util/input.js';
3
3
  import { join, toAbsolute } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  import { getBabelInputs } from '../vite/helpers.js';
@@ -53,7 +53,7 @@ const resolveConfig = async (localConfig, options) => {
53
53
  : [];
54
54
  return [
55
55
  ...patterns.map(id => toEntry(id)),
56
- ...addons.map(id => toDeferResolve(id)),
56
+ ...addons.map(id => toModule(id)),
57
57
  ...builderPackages.map(id => toDependency(id)),
58
58
  ...frameworks.map(id => toDependency(id)),
59
59
  ...coverageDeps,
@@ -1,4 +1,4 @@
1
- import { toConfig, toDeferResolve, toDependency } from '../../util/input.js';
1
+ import { toConfig, toModule, 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].map(id => toDependency(id)).concat(plugins.map(id => toDeferResolve(id)));
13
+ return [...runners, ...checkers].map(id => toDependency(id)).concat(plugins.map(id => toModule(id)));
14
14
  };
15
15
  const args = {
16
16
  boolean: ['allowEmpty', 'disableBail', 'dryRunOnly', 'force', 'ignoreStatic', 'incremental', 'inPlace'],
@@ -1,4 +1,4 @@
1
- import { toConfig, toDeferResolve } from '../../util/input.js';
1
+ import { toConfig, toModule } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  import { toCosmiconfig } from '../../util/plugin-config.js';
4
4
  const title = 'Stylelint';
@@ -10,16 +10,16 @@ const resolveConfig = async (config, options) => {
10
10
  const extend = Array.isArray(config.extends) ? config.extends : config.extends ? [config.extends] : [];
11
11
  for (const id of extend) {
12
12
  if (typeof id === 'string')
13
- inputs.push(toDeferResolve(id), toConfig('stylelint', id));
13
+ inputs.push(toModule(id), toConfig('stylelint', id));
14
14
  else
15
15
  for (const x of await resolveConfig(id, options))
16
16
  inputs.push(x);
17
17
  }
18
18
  for (const plugin of config.plugins ?? [])
19
19
  if (typeof plugin === 'string')
20
- inputs.push(toDeferResolve(plugin));
20
+ inputs.push(toModule(plugin));
21
21
  if (typeof config.customSyntax === 'string')
22
- inputs.push(toDeferResolve(config.customSyntax));
22
+ inputs.push(toModule(config.customSyntax));
23
23
  for (const override of config.overrides ?? []) {
24
24
  for (const input of await resolveConfig(override, options))
25
25
  inputs.push(input);
@@ -1,7 +1,7 @@
1
1
  import { collectFirstPropertyValue, findCallArg, findProperty, getFirstPropertyValue, hasImportSpecifier, } from '../../typescript/ast-helpers.js';
2
2
  import { _parseFile } from '../../typescript/ast-nodes.js';
3
3
  import { _syncGlob } from '../../util/glob.js';
4
- import { toAlias, toIgnore, toProductionEntry } from '../../util/input.js';
4
+ import { toAlias, toIgnore, toEntry } from '../../util/input.js';
5
5
  import { config as viteConfig } from '../vite/index.js';
6
6
  const production = [
7
7
  'src/routes/**/+{page,server,page.server,error,layout,layout.server}{,@*}.{js,ts,svelte}',
@@ -11,22 +11,23 @@ const production = [
11
11
  'src/service-worker/index.{js,ts}',
12
12
  'src/instrumentation.server.{js,ts}',
13
13
  ];
14
+ const findKitOptions = (program) => findCallArg(program, 'sveltekit') ?? findCallArg(program, 'withPwa');
14
15
  const isConfigInViteConfig = (dir, readFile) => {
15
16
  for (const filePath of _syncGlob({ cwd: dir, patterns: viteConfig })) {
16
17
  const text = readFile(filePath);
17
- if (text && findCallArg(_parseFile(filePath, text).program, 'sveltekit'))
18
+ if (text && findKitOptions(_parseFile(filePath, text).program))
18
19
  return true;
19
20
  }
20
21
  return false;
21
22
  };
22
23
  const getLibFromViteConfig = (program) => {
23
- const call = findCallArg(program, 'sveltekit');
24
+ const call = findKitOptions(program);
24
25
  const files = call ? findProperty(call, 'files') : undefined;
25
26
  return (files && getFirstPropertyValue(files, 'lib')) ?? 'src/lib';
26
27
  };
27
28
  const getLibFromSvelteConfig = (program) => collectFirstPropertyValue(program, 'lib') ?? 'src/lib';
28
29
  const toInputs = (lib) => [
29
- ...production.map(pattern => toProductionEntry(pattern)),
30
+ ...production.map(pattern => toEntry(pattern, { production: true })),
30
31
  toAlias('$lib', [`./${lib}`]),
31
32
  toAlias('$lib/*', [`./${lib}/*`]),
32
33
  toIgnore('\\$app/.+', 'unresolved'),
@@ -35,7 +36,8 @@ const toInputs = (lib) => [
35
36
  ];
36
37
  export const resolveFromAST = (program, options) => {
37
38
  if (options.configFileName.startsWith('vite.config')) {
38
- if (!hasImportSpecifier(program, '@sveltejs/kit/vite', 'sveltekit'))
39
+ const isKit = hasImportSpecifier(program, '@sveltejs/kit/vite', 'sveltekit');
40
+ if (!isKit && !hasImportSpecifier(program, '@vite-pwa/sveltekit', 'withPwa'))
39
41
  return [];
40
42
  return toInputs(getLibFromViteConfig(program));
41
43
  }
@@ -1,5 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toDeferResolve, toDependency } from '../../util/input.js';
2
+ import { toModule, toDependency } from '../../util/input.js';
3
3
  import { isInternal } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'SWC';
@@ -14,7 +14,7 @@ const resolveConfig = async (config, options) => {
14
14
  if (item?.jsc?.externalHelpers)
15
15
  dependencies.push('@swc/helpers');
16
16
  }
17
- return compact(dependencies).map(id => isInternal(id) ? toDeferResolve(id, { dir: options.cwd }) : toDependency(id));
17
+ return compact(dependencies).map(id => (isInternal(id) ? toModule(id, { dir: options.cwd }) : toDependency(id)));
18
18
  };
19
19
  const plugin = {
20
20
  title,