knip 6.45.1 → 6.46.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 (210) 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/astro-og-canvas/index.js +1 -1
  38. package/dist/plugins/aws-cdk/index.js +3 -3
  39. package/dist/plugins/babel/index.js +5 -3
  40. package/dist/plugins/borp/index.js +2 -2
  41. package/dist/plugins/bun/index.js +3 -3
  42. package/dist/plugins/capacitor/index.js +33 -6
  43. package/dist/plugins/capacitor/types.d.ts +10 -0
  44. package/dist/plugins/changesets/index.js +2 -2
  45. package/dist/plugins/commitizen/index.js +2 -2
  46. package/dist/plugins/commitlint/index.js +2 -2
  47. package/dist/plugins/convex/index.js +2 -2
  48. package/dist/plugins/cspell/index.js +2 -2
  49. package/dist/plugins/cucumber/index.js +2 -2
  50. package/dist/plugins/cypress/index.js +3 -3
  51. package/dist/plugins/docusaurus/helpers.js +6 -6
  52. package/dist/plugins/docusaurus/index.js +3 -3
  53. package/dist/plugins/dotenv/index.js +6 -2
  54. package/dist/plugins/drizzle/index.js +2 -2
  55. package/dist/plugins/electron-builder/index.d.ts +3 -0
  56. package/dist/plugins/electron-builder/index.js +61 -0
  57. package/dist/plugins/electron-forge/index.js +2 -2
  58. package/dist/plugins/electron-vite/index.js +4 -3
  59. package/dist/plugins/electron-vite/types.d.ts +3 -0
  60. package/dist/plugins/eleventy/index.js +2 -2
  61. package/dist/plugins/ember/compiler.d.ts +2 -0
  62. package/dist/plugins/ember/compiler.js +14 -0
  63. package/dist/plugins/ember/index.d.ts +6 -0
  64. package/dist/plugins/ember/index.js +160 -0
  65. package/dist/plugins/ember/types.d.ts +13 -0
  66. package/dist/plugins/ember/types.js +1 -0
  67. package/dist/plugins/ember/visitors/importSync.d.ts +2 -0
  68. package/dist/plugins/ember/visitors/importSync.js +32 -0
  69. package/dist/plugins/ember-template-lint/index.d.ts +3 -0
  70. package/dist/plugins/ember-template-lint/index.js +20 -0
  71. package/dist/plugins/env-cmd/index.d.ts +3 -0
  72. package/dist/plugins/env-cmd/index.js +16 -0
  73. package/dist/plugins/esbuild/index.js +2 -2
  74. package/dist/plugins/eslint/helpers.js +6 -6
  75. package/dist/plugins/eslint/index.js +0 -1
  76. package/dist/plugins/eslint/resolveFromAST.js +11 -3
  77. package/dist/plugins/evalite/index.js +2 -2
  78. package/dist/plugins/expo/helpers.js +10 -10
  79. package/dist/plugins/expo-router/index.js +3 -3
  80. package/dist/plugins/filesystem-routing/index.js +4 -4
  81. package/dist/plugins/flue/index.js +4 -4
  82. package/dist/plugins/gatsby/index.js +3 -3
  83. package/dist/plugins/github-action/index.js +2 -2
  84. package/dist/plugins/github-actions/index.js +2 -2
  85. package/dist/plugins/graphql-codegen/index.js +8 -6
  86. package/dist/plugins/index.d.ts +6 -0
  87. package/dist/plugins/index.js +12 -0
  88. package/dist/plugins/jasmine/index.js +3 -4
  89. package/dist/plugins/jest/index.js +3 -3
  90. package/dist/plugins/karma/helpers.js +2 -2
  91. package/dist/plugins/karma/index.js +5 -1
  92. package/dist/plugins/knex/index.js +13 -7
  93. package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
  94. package/dist/plugins/linthtml/index.js +2 -2
  95. package/dist/plugins/lunaria/index.js +3 -3
  96. package/dist/plugins/maestro/index.d.ts +3 -0
  97. package/dist/plugins/maestro/index.js +54 -0
  98. package/dist/plugins/maestro/types.d.ts +21 -0
  99. package/dist/plugins/maestro/types.js +1 -0
  100. package/dist/plugins/markdownlint/index.js +3 -3
  101. package/dist/plugins/marko/index.js +4 -4
  102. package/dist/plugins/mastra/index.js +3 -3
  103. package/dist/plugins/mdx/index.js +3 -3
  104. package/dist/plugins/mdxlint/index.js +2 -2
  105. package/dist/plugins/metro/index.js +5 -5
  106. package/dist/plugins/mikro-orm/index.js +3 -4
  107. package/dist/plugins/mise/scripts.js +2 -3
  108. package/dist/plugins/mocha/index.js +8 -7
  109. package/dist/plugins/netlify/index.js +4 -4
  110. package/dist/plugins/next/index.js +5 -5
  111. package/dist/plugins/next-mdx/resolveFromAST.js +2 -2
  112. package/dist/plugins/nitro/index.js +4 -4
  113. package/dist/plugins/node/index.d.ts +16 -0
  114. package/dist/plugins/node/index.js +89 -23
  115. package/dist/plugins/nodemon/index.js +1 -1
  116. package/dist/plugins/npm-package-json-lint/index.js +2 -2
  117. package/dist/plugins/nuxt/index.js +16 -14
  118. package/dist/plugins/nx/index.js +3 -3
  119. package/dist/plugins/nyc/index.js +39 -2
  120. package/dist/plugins/oclif/index.js +5 -3
  121. package/dist/plugins/openclaw/index.js +5 -5
  122. package/dist/plugins/oxlint/index.js +2 -2
  123. package/dist/plugins/panda-css/index.js +2 -2
  124. package/dist/plugins/parcel/index.js +2 -2
  125. package/dist/plugins/payload/index.js +3 -3
  126. package/dist/plugins/playwright/index.js +4 -4
  127. package/dist/plugins/pm2/index.js +2 -2
  128. package/dist/plugins/pnpm/index.js +1 -1
  129. package/dist/plugins/postcss/index.js +2 -2
  130. package/dist/plugins/preconstruct/index.js +2 -2
  131. package/dist/plugins/prettier/index.js +4 -3
  132. package/dist/plugins/prisma/index.js +5 -5
  133. package/dist/plugins/quasar/resolveFromAST.js +8 -8
  134. package/dist/plugins/qwik/resolveFromAST.js +3 -3
  135. package/dist/plugins/raycast/index.js +2 -2
  136. package/dist/plugins/react-cosmos/index.js +2 -2
  137. package/dist/plugins/react-native/index.js +1 -1
  138. package/dist/plugins/react-router/index.js +6 -6
  139. package/dist/plugins/relay/index.js +3 -3
  140. package/dist/plugins/release-it/index.js +2 -5
  141. package/dist/plugins/remark/helpers.js +2 -2
  142. package/dist/plugins/retry-cli/index.js +0 -1
  143. package/dist/plugins/rolldown/index.js +2 -2
  144. package/dist/plugins/rollup/index.js +2 -2
  145. package/dist/plugins/rsbuild/index.js +3 -3
  146. package/dist/plugins/rslib/index.js +2 -2
  147. package/dist/plugins/rslint/index.d.ts +3 -0
  148. package/dist/plugins/rslint/index.js +16 -0
  149. package/dist/plugins/rspack/index.js +4 -0
  150. package/dist/plugins/rstest/index.js +4 -4
  151. package/dist/plugins/semantic-release/index.js +2 -2
  152. package/dist/plugins/serverless-framework/index.js +4 -4
  153. package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +3 -3
  154. package/dist/plugins/sst/resolveFromAST.js +2 -2
  155. package/dist/plugins/starlight/resolveFromAST.js +3 -3
  156. package/dist/plugins/stencil/resolveFromAST.js +5 -5
  157. package/dist/plugins/storybook/index.js +2 -2
  158. package/dist/plugins/stryker/index.js +2 -2
  159. package/dist/plugins/stylelint/index.js +4 -4
  160. package/dist/plugins/sveltekit/resolveFromAST.js +7 -5
  161. package/dist/plugins/swc/index.js +8 -5
  162. package/dist/plugins/tailwind/index.js +3 -2
  163. package/dist/plugins/tanstack-router/index.js +5 -2
  164. package/dist/plugins/textlint/helpers.js +2 -2
  165. package/dist/plugins/ts-node/index.js +23 -6
  166. package/dist/plugins/tsd/index.js +1 -1
  167. package/dist/plugins/tsdown/index.js +4 -4
  168. package/dist/plugins/tsup/index.js +3 -3
  169. package/dist/plugins/tsx/index.js +4 -3
  170. package/dist/plugins/turbo/index.js +2 -2
  171. package/dist/plugins/typedoc/index.js +4 -3
  172. package/dist/plugins/typescript/index.js +4 -4
  173. package/dist/plugins/varlock/scan.js +6 -3
  174. package/dist/plugins/vite/helpers.js +2 -2
  175. package/dist/plugins/vite-plugin-pages/index.js +2 -2
  176. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  177. package/dist/plugins/vite-plugin-vue-layouts-next/index.js +2 -2
  178. package/dist/plugins/vitest/index.js +14 -18
  179. package/dist/plugins/webdriver-io/index.js +13 -1
  180. package/dist/plugins/webpack/index.js +7 -12
  181. package/dist/plugins/wrangler/index.js +3 -3
  182. package/dist/plugins/wxt/index.js +2 -2
  183. package/dist/plugins/yarn/index.js +5 -5
  184. package/dist/session/incremental.d.ts +1 -1
  185. package/dist/types/PluginNames.d.ts +2 -2
  186. package/dist/types/PluginNames.js +6 -0
  187. package/dist/types/args.d.ts +4 -3
  188. package/dist/types/config.d.ts +2 -0
  189. package/dist/types/module-graph.d.ts +1 -1
  190. package/dist/types/package-json.d.ts +1 -0
  191. package/dist/types/workspace.d.ts +10 -8
  192. package/dist/typescript/ast-nodes.js +4 -5
  193. package/dist/typescript/get-imports-and-exports.js +5 -2
  194. package/dist/typescript/visitors/exports.js +6 -32
  195. package/dist/typescript/visitors/imports.d.ts +1 -1
  196. package/dist/typescript/visitors/imports.js +15 -24
  197. package/dist/typescript/visitors/walk.d.ts +5 -0
  198. package/dist/typescript/visitors/walk.js +75 -30
  199. package/dist/util/codeowners.js +4 -1
  200. package/dist/util/input.d.ts +3 -6
  201. package/dist/util/input.js +6 -20
  202. package/dist/util/parse-and-convert-gitignores.js +5 -4
  203. package/dist/util/parse-args.d.ts +2 -1
  204. package/dist/util/parse-args.js +13 -3
  205. package/dist/util/plugin.js +6 -4
  206. package/dist/util/watch.js +1 -1
  207. package/dist/version.d.ts +1 -1
  208. package/dist/version.js +1 -1
  209. package/package.json +1 -1
  210. package/schema.json +36 -5
@@ -29,9 +29,13 @@ import { default as dependencyCruiser } from './dependency-cruiser/index.js';
29
29
  import { default as docusaurus } from './docusaurus/index.js';
30
30
  import { default as dotenv } from './dotenv/index.js';
31
31
  import { default as drizzle } from './drizzle/index.js';
32
+ import { default as electronBuilder } from './electron-builder/index.js';
32
33
  import { default as electronForge } from './electron-forge/index.js';
33
34
  import { default as electronVite } from './electron-vite/index.js';
34
35
  import { default as eleventy } from './eleventy/index.js';
36
+ import { default as ember } from './ember/index.js';
37
+ import { default as emberTemplateLint } from './ember-template-lint/index.js';
38
+ import { default as envCmd } from './env-cmd/index.js';
35
39
  import { default as esbuild } from './esbuild/index.js';
36
40
  import { default as eslint } from './eslint/index.js';
37
41
  import { default as evalite } from './evalite/index.js';
@@ -67,6 +71,7 @@ import { default as lit } from './lit/index.js';
67
71
  import { default as lockfileLint } from './lockfile-lint/index.js';
68
72
  import { default as lostPixel } from './lost-pixel/index.js';
69
73
  import { default as lunaria } from './lunaria/index.js';
74
+ import { default as maestro } from './maestro/index.js';
70
75
  import { default as markdownlint } from './markdownlint/index.js';
71
76
  import { default as marko } from './marko/index.js';
72
77
  import { default as mastra } from './mastra/index.js';
@@ -135,6 +140,7 @@ import { default as rolldown } from './rolldown/index.js';
135
140
  import { default as rollup } from './rollup/index.js';
136
141
  import { default as rsbuild } from './rsbuild/index.js';
137
142
  import { default as rslib } from './rslib/index.js';
143
+ import { default as rslint } from './rslint/index.js';
138
144
  import { default as rspack } from './rspack/index.js';
139
145
  import { default as rstest } from './rstest/index.js';
140
146
  import { default as sanity } from './sanity/index.js';
@@ -237,9 +243,13 @@ export const Plugins = {
237
243
  docusaurus,
238
244
  dotenv,
239
245
  drizzle,
246
+ 'electron-builder': electronBuilder,
240
247
  'electron-forge': electronForge,
241
248
  'electron-vite': electronVite,
242
249
  eleventy,
250
+ ember,
251
+ 'ember-template-lint': emberTemplateLint,
252
+ 'env-cmd': envCmd,
243
253
  esbuild,
244
254
  eslint,
245
255
  evalite,
@@ -275,6 +285,7 @@ export const Plugins = {
275
285
  'lockfile-lint': lockfileLint,
276
286
  'lost-pixel': lostPixel,
277
287
  lunaria,
288
+ maestro,
278
289
  markdownlint,
279
290
  marko,
280
291
  mastra,
@@ -343,6 +354,7 @@ export const Plugins = {
343
354
  rollup,
344
355
  rsbuild,
345
356
  rslib,
357
+ rslint,
346
358
  rspack,
347
359
  rstest,
348
360
  sanity,
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toEntry } from '../../util/input.js';
1
+ import { toModule, toEntry } from '../../util/input.js';
2
2
  import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Jasmine';
@@ -22,15 +22,14 @@ const resolveConfig = (localConfig, options) => {
22
22
  for (const id of [...specFiles, ...helpers])
23
23
  inputs.push(toEntry(id));
24
24
  for (const id of requires)
25
- inputs.push(toDeferResolve(id, { dir: options.cwd }));
25
+ inputs.push(toModule(id, { dir: options.cwd }));
26
26
  if (localConfig.loader)
27
- inputs.push(toDeferResolve(localConfig.loader, { dir: options.cwd }));
27
+ inputs.push(toModule(localConfig.loader, { dir: options.cwd }));
28
28
  return inputs;
29
29
  };
30
30
  const commands = new Set(['init', 'examples', 'help', 'version']);
31
31
  const args = {
32
32
  boolean: ['color', 'fail-fast', 'list-not-applicable', 'no-color'],
33
- string: ['config', 'reporter', 'require'],
34
33
  config: ['config'],
35
34
  resolve: ['require', 'reporter'],
36
35
  resolveInputs: (parsed) => {
@@ -1,6 +1,6 @@
1
1
  import { arrayify } from '../../util/array.js';
2
2
  import { _glob } from '../../util/glob.js';
3
- import { toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
3
+ import { toConfig, toModule, toDependency, toEntry } from '../../util/input.js';
4
4
  import { extname, isInternal, join, normalize, toAbsolute } from '../../util/path.js';
5
5
  import { hasDependency } from '../../util/plugin.js';
6
6
  import { getDependenciesFromConfig } from '../babel/index.js';
@@ -55,7 +55,7 @@ const resolveDependencies = async (config, rootDir, options) => {
55
55
  environments.push(toDependency('jest-environment-jsdom'));
56
56
  }
57
57
  else if (config.testEnvironment) {
58
- environments.push(toDeferResolve(resolveWithPrefix('jest-environment-', config.testEnvironment, rootDir)));
58
+ environments.push(toModule(resolveWithPrefix('jest-environment-', config.testEnvironment, rootDir)));
59
59
  }
60
60
  const resolvers = config.resolver ? [config.resolver] : [];
61
61
  const reporters = getReportersDependencies(config, options);
@@ -107,7 +107,7 @@ const resolveDependencies = async (config, rootDir, options) => {
107
107
  ...testSequencer,
108
108
  ...globalSetup,
109
109
  ...globalTeardown,
110
- ].map(id => (typeof id === 'string' ? toDeferResolve(id) : id));
110
+ ].map(id => (typeof id === 'string' ? toModule(id) : id));
111
111
  };
112
112
  const resolveConfig = async (localConfig, options) => {
113
113
  const { configFileDir } = options;
@@ -1,4 +1,4 @@
1
- import { toDeferResolveEntry, toDependency } from '../../util/input.js';
1
+ import { toEntryPath, toDependency } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  export const configFiles = ['karma.conf.js', 'karma.conf.ts', '.config/karma.conf.js', '.config/karma.conf.ts'];
4
4
  export const inputsFromFrameworks = (frameworks) => frameworks.map(framework => {
@@ -13,7 +13,7 @@ export const inputsFromPlugins = (plugins, devDependencies) => {
13
13
  .map(plugin => {
14
14
  if (typeof plugin !== 'string')
15
15
  return;
16
- return isInternal(plugin) ? toDeferResolveEntry(plugin) : toDependency(plugin);
16
+ return isInternal(plugin) ? toEntryPath(plugin) : toDependency(plugin);
17
17
  })
18
18
  .filter((input) => !!input);
19
19
  };
@@ -1,4 +1,4 @@
1
- import { toEntry } from '../../util/input.js';
1
+ import { toConfig, toEntry } from '../../util/input.js';
2
2
  import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { configFiles, inputsFromFrameworks, inputsFromPlugins, loadConfig } from './helpers.js';
@@ -31,11 +31,15 @@ const resolveConfig = async (localConfig, options) => {
31
31
  }
32
32
  return Array.from(inputs);
33
33
  };
34
+ const args = {
35
+ resolveInputs: parsed => (parsed._[0] === 'start' && parsed._[1] ? [toConfig('karma', parsed._[1])] : []),
36
+ };
34
37
  const plugin = {
35
38
  title,
36
39
  enablers,
37
40
  isEnabled,
38
41
  config,
39
42
  resolveConfig,
43
+ args,
40
44
  };
41
45
  export default plugin;
@@ -1,4 +1,5 @@
1
- import { toEntry, toProductionDependency } from '../../util/input.js';
1
+ import { toConfig, toEntry, toDependency } from '../../util/input.js';
2
+ import { toAbsolute } from '../../util/path.js';
2
3
  import { hasDependency } from '../../util/plugin.js';
3
4
  import { clientToPackages } from './helpers.js';
4
5
  import { createKnexClientVisitor } from './visitors/clientCall.js';
@@ -6,31 +7,35 @@ const title = 'Knex';
6
7
  const enablers = ['knex'];
7
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
9
  const config = ['knexfile.{js,cjs,mjs,ts,cts,mts}'];
9
- const processKnexConfig = (config) => {
10
+ const processKnexConfig = (config, dir) => {
10
11
  const inputs = [];
11
12
  if (config.client) {
12
13
  const packages = clientToPackages(config.client);
13
- inputs.push(...packages.map(pkg => toProductionDependency(pkg, { optional: true })));
14
+ inputs.push(...packages.map(pkg => toDependency(pkg, { production: true, optional: true })));
14
15
  }
15
16
  if (config.migrations?.directory) {
16
17
  const dirs = Array.isArray(config.migrations.directory)
17
18
  ? config.migrations.directory
18
19
  : [config.migrations.directory];
19
- inputs.push(...dirs.map(dir => toEntry(`${dir}/*.{js,ts}`)));
20
+ inputs.push(...dirs.map(directory => toEntry(`${directory}/*.{js,ts}`, { dir })));
20
21
  }
21
22
  if (config.seeds?.directory) {
22
23
  const dirs = Array.isArray(config.seeds.directory) ? config.seeds.directory : [config.seeds.directory];
23
- inputs.push(...dirs.map(dir => toEntry(`${dir}/*.{js,ts}`)));
24
+ inputs.push(...dirs.map(directory => toEntry(`${directory}/*.{js,ts}`, { dir })));
24
25
  }
25
26
  return inputs;
26
27
  };
27
- const resolveConfig = config => {
28
+ const resolveConfig = (config, { configFileDir }) => {
28
29
  const configs = 'client' in config && config.client ? [config] : Object.values(config);
29
- return configs.flatMap(cfg => (typeof cfg === 'object' && cfg !== null ? processKnexConfig(cfg) : []));
30
+ return configs.flatMap(cfg => (typeof cfg === 'object' && cfg !== null ? processKnexConfig(cfg, configFileDir) : []));
30
31
  };
31
32
  const registerVisitors = ({ ctx, registerVisitor }) => {
32
33
  registerVisitor(createKnexClientVisitor(ctx));
33
34
  };
35
+ const args = {
36
+ string: ['cwd', 'knexfile'],
37
+ resolveInputs: (parsed, { cwd }) => parsed.knexfile ? [toConfig('knex', parsed.knexfile, { dir: parsed.cwd ? toAbsolute(parsed.cwd, cwd) : cwd })] : [],
38
+ };
34
39
  const plugin = {
35
40
  title,
36
41
  enablers,
@@ -38,5 +43,6 @@ const plugin = {
38
43
  config,
39
44
  resolveConfig,
40
45
  registerVisitors,
46
+ args,
41
47
  };
42
48
  export default plugin;
@@ -1,6 +1,6 @@
1
1
  import { findImportedCalls, findProperty, getStringValues } from '../../typescript/ast-helpers.js';
2
2
  import { getStringValue } from '../../typescript/ast-nodes.js';
3
- import { toDeferResolveProductionEntry } from '../../util/input.js';
3
+ import { toEntryPath } from '../../util/input.js';
4
4
  import { join } from '../../util/path.js';
5
5
  const enablers = ['laravel-vite-plugin'];
6
6
  const addStringOrArray = (values, node) => {
@@ -21,7 +21,7 @@ export const resolveFromAST = (program, options) => {
21
21
  addStringOrArray(specifiers, findProperty(arg, 'input'));
22
22
  addStringOrArray(specifiers, findProperty(arg, 'ssr'));
23
23
  for (const id of specifiers)
24
- inputs.push(toDeferResolveProductionEntry(join(options.configFileDir, id)));
24
+ inputs.push(toEntryPath(join(options.configFileDir, id), { production: true }));
25
25
  }
26
26
  return inputs;
27
27
  };
@@ -1,4 +1,4 @@
1
- import { toDeferResolve } from '../../util/input.js';
1
+ import { 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 = 'LintHTML';
@@ -9,7 +9,7 @@ const config = ['package.json', ...toCosmiconfig('linthtml')];
9
9
  const resolveConfig = config => {
10
10
  const extensions = config.extends ?? [];
11
11
  const plugins = config.plugins ?? [];
12
- return [extensions, plugins].flat().map(id => toDeferResolve(id));
12
+ return [extensions, plugins].flat().map(id => toModule(id));
13
13
  };
14
14
  const plugin = {
15
15
  title,
@@ -1,5 +1,5 @@
1
1
  import { toAbsolute } from '../../util/path.js';
2
- import { toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
2
+ import { toEntryPath, toEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Lunaria';
5
5
  const enablers = ['@lunariajs/core', '@lunariajs/starlight'];
@@ -14,8 +14,8 @@ const resolveConfig = async (localConfig, options) => {
14
14
  const favicon = localConfig.dashboard?.favicon?.inline ? [localConfig.dashboard.favicon.inline] : [];
15
15
  const baseDir = options.configFileDir;
16
16
  return [
17
- ...files.map(id => toProductionEntry(toAbsolute(id, baseDir))),
18
- ...[...renderer, ...customCss, ...favicon].map(id => toDeferResolveProductionEntry(toAbsolute(id, baseDir))),
17
+ ...files.map(id => toEntry(toAbsolute(id, baseDir), { production: true })),
18
+ ...[...renderer, ...customCss, ...favicon].map(id => toEntryPath(toAbsolute(id, baseDir), { production: true })),
19
19
  ];
20
20
  };
21
21
  const args = {
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,54 @@
1
+ import { isDirectory } from '../../util/fs.js';
2
+ import { toConfig, toEntryPath } from '../../util/input.js';
3
+ const title = 'Maestro';
4
+ const enablers = 'This plugin is enabled when a `.maestro` folder is found.';
5
+ const isEnabled = ({ cwd }) => isDirectory(cwd, '.maestro');
6
+ const config = ['.maestro/**/*.{yaml,yml}'];
7
+ const parseConfig = async (source) => {
8
+ const { parseAllDocuments } = await import('yaml');
9
+ return parseAllDocuments(source, { logLevel: 'error' }).map(document => {
10
+ if (document.errors.length > 0)
11
+ throw document.errors[0];
12
+ return document.toJS();
13
+ });
14
+ };
15
+ const getFile = (value) => (typeof value === 'string' ? value : value?.file);
16
+ const addInputs = (commands, inputs) => {
17
+ if (!Array.isArray(commands))
18
+ return;
19
+ for (const command of commands) {
20
+ if (!command || typeof command !== 'object')
21
+ continue;
22
+ const script = getFile(command.runScript);
23
+ if (typeof script === 'string')
24
+ inputs.push(toEntryPath(script));
25
+ for (const nested of [command.runFlow, command.retry]) {
26
+ const flow = getFile(nested);
27
+ if (typeof flow === 'string')
28
+ inputs.push(toConfig('maestro', flow));
29
+ }
30
+ for (const nested of [command.runFlow, command.repeat, command.retry]) {
31
+ if (nested && typeof nested === 'object')
32
+ addInputs(nested.commands, inputs);
33
+ }
34
+ }
35
+ };
36
+ const resolveConfig = config => {
37
+ const inputs = [];
38
+ if (config.length === 2) {
39
+ const [header, commands] = config;
40
+ addInputs(header?.onFlowStart, inputs);
41
+ addInputs(header?.onFlowComplete, inputs);
42
+ addInputs(commands, inputs);
43
+ }
44
+ return inputs;
45
+ };
46
+ const plugin = {
47
+ title,
48
+ enablers,
49
+ isEnabled,
50
+ config,
51
+ parseConfig,
52
+ resolveConfig,
53
+ };
54
+ export default plugin;
@@ -0,0 +1,21 @@
1
+ export type File = string | {
2
+ file?: string;
3
+ };
4
+ type Commands = {
5
+ file?: string;
6
+ commands?: Command[];
7
+ };
8
+ export type Command = string | {
9
+ runScript?: File;
10
+ runFlow?: string | Commands;
11
+ repeat?: {
12
+ commands?: Command[];
13
+ };
14
+ retry?: Commands;
15
+ };
16
+ type Header = {
17
+ onFlowStart?: Command[];
18
+ onFlowComplete?: Command[];
19
+ };
20
+ export type MaestroConfig = [Header?, Command[]?];
21
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -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
  import { getArgumentValues } from './helpers.js';
@@ -37,10 +37,10 @@ const resolveConfig = (config, options) => {
37
37
  .filter(script => script.includes('markdownlint ') || script.includes('markdownlint-cli2 '))
38
38
  .flatMap(script => getArgumentValues(script, / (--rules|-r)[ =]([^ ]+)/g));
39
39
  return [
40
- ...dependencies.filter(id => !isBundled(id)).map(id => (isInternal(id) ? toDeferResolve(id) : toDependency(id))),
40
+ ...dependencies.filter(id => !isBundled(id)).map(id => (isInternal(id) ? toModule(id) : toDependency(id))),
41
41
  ...uses
42
42
  .filter(id => !isBundled(id))
43
- .map(id => (isInternal(id) ? toDeferResolve(id, { dir: options.cwd }) : toDependency(id))),
43
+ .map(id => (isInternal(id) ? toModule(id, { dir: options.cwd }) : toDependency(id))),
44
44
  ];
45
45
  };
46
46
  const plugin = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toProductionEntry } 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
  import { createCompiler } from './compiler.js';
@@ -30,16 +30,16 @@ const tagDefFields = [
30
30
  ];
31
31
  const resolveConfig = (localConfig, options) => {
32
32
  const { configFileName, configFileDir } = options;
33
- const inputs = production.map(pattern => toProductionEntry(pattern));
33
+ const inputs = production.map(pattern => toEntry(pattern, { production: true }));
34
34
  if (!localConfig)
35
35
  return inputs;
36
36
  if (configFileName === 'marko.json') {
37
- return tagProduction.map(pattern => toProductionEntry(join(configFileDir, pattern)));
37
+ return tagProduction.map(pattern => toEntry(join(configFileDir, pattern), { production: true }));
38
38
  }
39
39
  for (const field of tagDefFields) {
40
40
  for (const id of [localConfig[field]].flat()) {
41
41
  if (typeof id === 'string')
42
- inputs.push(toDeferResolve(id));
42
+ inputs.push(toModule(id));
43
43
  }
44
44
  }
45
45
  return inputs;
@@ -1,6 +1,6 @@
1
1
  import { join } from '../../util/path.js';
2
2
  import { isDirectory } from '../../util/fs.js';
3
- import { toProductionEntry } from '../../util/input.js';
3
+ import { toEntry } from '../../util/input.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  const title = 'Mastra';
6
6
  const enablers = ['mastra'];
@@ -33,7 +33,7 @@ const args = {
33
33
  const inputs = [];
34
34
  if (parsed.dir) {
35
35
  for (const pattern of getProductionPatterns(parsed.dir))
36
- inputs.push(toProductionEntry(pattern));
36
+ inputs.push(toEntry(pattern, { production: true }));
37
37
  }
38
38
  if (parsed.tools) {
39
39
  for (const tool of String(parsed.tools).split(',')) {
@@ -41,7 +41,7 @@ const args = {
41
41
  if (!specifier)
42
42
  continue;
43
43
  const pattern = isDirectory(join(cwd, specifier)) ? `${specifier}/index.${extensions}` : specifier;
44
- inputs.push(toProductionEntry(pattern));
44
+ inputs.push(toEntry(pattern, { production: true }));
45
45
  }
46
46
  }
47
47
  return inputs;
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDeferResolveProductionEntry, toDependency } from '../../util/input.js';
1
+ import { toModule, toEntryPath, 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 = 'MDX';
@@ -20,8 +20,8 @@ const takeDependencies = (plugins) => {
20
20
  export const contentMappers = ['mdx-content-mapper', '@mdx-js/content-mapper'];
21
21
  const bundledPlugins = ['remark-mdx-frontmatter'];
22
22
  export const toProviderInput = (provider, dir) => isInternal(provider) || provider.startsWith('#')
23
- ? toDeferResolveProductionEntry(provider)
24
- : toDeferResolve(provider, { dir, production: true });
23
+ ? toEntryPath(provider, { production: true })
24
+ : toModule(provider, { dir, production: true });
25
25
  export const resolveContentMapperOptions = (options, dir) => {
26
26
  const inputs = takeDependencies(options.remarkPlugins).filter(input => !bundledPlugins.includes(input.specifier));
27
27
  const provider = options.providerImportSource;
@@ -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 = 'mdxlint';
@@ -18,7 +18,7 @@ const resolveConfig = config => {
18
18
  if (typeof id !== 'string')
19
19
  continue;
20
20
  if (isInternal(id))
21
- inputs.push(toDeferResolve(id));
21
+ inputs.push(toModule(id));
22
22
  else
23
23
  inputs.push(toDependency(toPluginName(id)));
24
24
  }
@@ -1,5 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toDeferResolve, toProductionEntry } from '../../util/input.js';
2
+ import { toModule, 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 = 'Metro';
@@ -24,14 +24,14 @@ const resolveConfig = async (config) => {
24
24
  const sourceExts = config.resolver?.sourceExts ?? DEFAULT_EXTENSIONS;
25
25
  const pattern = `src/**/*.{${platformEntryPatterns.join(',')}}.{${sourceExts.join(',')}}`;
26
26
  if (!config.projectRoot) {
27
- i.add(toProductionEntry(pattern));
27
+ i.add(toEntry(pattern, { production: true }));
28
28
  }
29
29
  else {
30
30
  const entryFilePattern = 'index.{js,jsx,ts,tsx}';
31
31
  const entryFilePath = join(config.projectRoot, entryFilePattern);
32
32
  const entryFilePaths = join(config.projectRoot, pattern);
33
- i.add(toProductionEntry(entryFilePath));
34
- i.add(toProductionEntry(entryFilePaths));
33
+ i.add(toEntry(entryFilePath, { production: true }));
34
+ i.add(toEntry(entryFilePaths, { production: true }));
35
35
  }
36
36
  if (transformerPath)
37
37
  inputs.push(transformerPath);
@@ -41,7 +41,7 @@ const resolveConfig = async (config) => {
41
41
  inputs.push(transformer.minifierPath);
42
42
  if (transformer?.babelTransformerPath)
43
43
  inputs.push(transformer.babelTransformerPath);
44
- return Array.from(i).concat(Array.from(inputs, id => toDeferResolve(id, {
44
+ return Array.from(i).concat(Array.from(inputs, id => toModule(id, {
45
45
  optional: id === DEFAULT_TRANSFORMER_PACKAGE || id === DEFAULT_MINIFIER_PACKAGE,
46
46
  })));
47
47
  };
@@ -1,4 +1,4 @@
1
- import { toConfig, toProductionEntry } from '../../util/input.js';
1
+ import { toConfig, toEntry } from '../../util/input.js';
2
2
  import { join, toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'MikroORM';
@@ -28,9 +28,9 @@ const toEntityEntry = (specifier, extensions, baseDir) => {
28
28
  const hasPattern = entitySpecialRegex.test(specifier);
29
29
  const hasExtension = entityFileExtensionRegex.test(specifier);
30
30
  const pattern = hasPattern || hasExtension ? specifier : join(specifier, `**/*.{${extensions}}`);
31
- return toProductionEntry(toAbsolute(pattern, baseDir));
31
+ return toEntry(toAbsolute(pattern, baseDir), { production: true });
32
32
  };
33
- const toFolderEntries = (paths, glob, baseDir) => paths.map(path => toProductionEntry(toAbsolute(join(path, glob), baseDir)));
33
+ const toFolderEntries = (paths, glob, baseDir) => paths.map(path => toEntry(toAbsolute(join(path, glob), baseDir), { production: true }));
34
34
  const resolveConfig = async (config, options) => {
35
35
  if (options.configFileName === 'package.json') {
36
36
  if (!isMikroOrmPackageJson(config))
@@ -64,7 +64,6 @@ const resolveConfig = async (config, options) => {
64
64
  const args = {
65
65
  binaries: ['mikro-orm'],
66
66
  config: true,
67
- string: ['contextName'],
68
67
  };
69
68
  const plugin = {
70
69
  title,
@@ -1,9 +1,8 @@
1
1
  import { forEachChild, parse } from 'unbash';
2
2
  import { getDependenciesFromCommand, getInputsFromNodeOptions } from '../../binaries/command.js';
3
3
  import { spawningBinaries } from '../../binaries/fallback.js';
4
- import { isWrapper } from '../../binaries/plugins.js';
4
+ import { isWrapper, toForwardedScript } from '../../binaries/plugins.js';
5
5
  import { isPackageManager } from '../../binaries/resolvers/index.js';
6
- import { toScript } from '../../binaries/util.js';
7
6
  import { SCRIPT_INTERPOLATION } from '../../constants.js';
8
7
  import { isBinary } from '../../util/input.js';
9
8
  import { extractBinary, isRelativeNodeModulesBin } from '../../util/modules.js';
@@ -56,7 +55,7 @@ export const getInputsFromMiseScript = (script, options, hasLocalBinPath) => {
56
55
  inputs.push(...getInputsFromMiseScript(script, options, isLocal));
57
56
  return [];
58
57
  };
59
- const fromArgs = args => fromScript(toScript(args));
58
+ const fromArgs = args => fromScript(toForwardedScript(args));
60
59
  commandInputs = getDependenciesFromCommand(marked, { ...options, fromArgs });
61
60
  if (spawningBinaries.includes(binary))
62
61
  commandInputs.push(...getInputsFromNodeOptions(marked.prefix));
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDeferResolveEntry, toEntry } from '../../util/input.js';
1
+ import { toModule, toEntryPath, toEntry } from '../../util/input.js';
2
2
  import { isDirectory } from '../../util/fs.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Mocha';
@@ -48,10 +48,10 @@ const resolveConfig = (localConfig, options) => {
48
48
  const require = localConfig.require ? [localConfig.require].flat() : [];
49
49
  const inputs = [];
50
50
  inputs.push(...entryPatterns.map(id => toEntry(id)));
51
- inputs.push(...files.map(id => toDeferResolveEntry(id, { dir: options.cwd })));
52
- inputs.push(...require.map(id => toDeferResolve(id, { dir: options.cwd })));
51
+ inputs.push(...files.map(id => toEntryPath(id, { dir: options.cwd })));
52
+ inputs.push(...require.map(id => toModule(id, { dir: options.cwd })));
53
53
  if (isExternalReporter(localConfig.reporter))
54
- inputs.push(toDeferResolve(localConfig.reporter, { dir: options.cwd }));
54
+ inputs.push(toModule(localConfig.reporter, { dir: options.cwd }));
55
55
  return inputs;
56
56
  };
57
57
  const args = {
@@ -93,7 +93,7 @@ const args = {
93
93
  ui: ['u'],
94
94
  watch: ['w'],
95
95
  },
96
- string: ['config', 'extension', 'fgrep', 'file', 'grep', 'ignore', 'package', 'reporter', 'spec', 'ui'],
96
+ string: ['extension', 'file', 'ignore', 'reporter', 'spec'],
97
97
  config: ['config'],
98
98
  resolveInputs: (parsed, { cwd }) => {
99
99
  const extensions = [parsed.extension ?? []]
@@ -103,7 +103,8 @@ const args = {
103
103
  const list = extensions.length > 0 ? extensions : defaultExtensions;
104
104
  const suffix = list.length === 1 ? `*.${list[0]}` : `*.{${list.join(',')}}`;
105
105
  const inputs = [];
106
- for (const value of [...parsed._, ...[parsed.spec ?? []].flat(), ...[parsed.file ?? []].flat()].map(String)) {
106
+ const operands = [...parsed._, ...(parsed['--'] ?? []).filter(value => !value.startsWith('-'))];
107
+ for (const value of [...operands, ...[parsed.spec ?? []].flat(), ...[parsed.file ?? []].flat()].map(String)) {
107
108
  if (isDirectory(cwd, value))
108
109
  inputs.push(toEntry(`${value.replace(/\/$/, '')}/${parsed.recursive ? '**/' : ''}${suffix}`));
109
110
  else
@@ -112,7 +113,7 @@ const args = {
112
113
  for (const value of [parsed.ignore ?? []].flat())
113
114
  inputs.push(toEntry(`!${String(value)}`));
114
115
  if (isExternalReporter(parsed.reporter))
115
- inputs.push(toDeferResolve(parsed.reporter));
116
+ inputs.push(toModule(parsed.reporter));
116
117
  return inputs;
117
118
  },
118
119
  };
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDependency, toProductionEntry } from '../../util/input.js';
1
+ import { toModule, toDependency, toEntry } from '../../util/input.js';
2
2
  import { isInternal, join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { extractFunctionsConfigProperty } from './helpers.js';
@@ -11,7 +11,7 @@ const NETLIFY_FUNCTIONS_EXTS = 'js,mjs,cjs,ts,mts,cts';
11
11
  const production = [`${NETLIFY_FUNCTIONS_DIR}/**/*.{${NETLIFY_FUNCTIONS_EXTS}}`];
12
12
  const toPluginInput = (id) => {
13
13
  const specifier = id.startsWith('/') ? `.${id}` : id;
14
- return isInternal(specifier) ? toDeferResolve(specifier) : toDependency(id);
14
+ return isInternal(specifier) ? toModule(specifier) : toDependency(id);
15
15
  };
16
16
  const resolveConfig = async (localConfig) => {
17
17
  return [
@@ -19,10 +19,10 @@ const resolveConfig = async (localConfig) => {
19
19
  join(localConfig.functions?.directory ?? NETLIFY_FUNCTIONS_DIR, `**/*.{${NETLIFY_FUNCTIONS_EXTS}}`),
20
20
  ]
21
21
  .filter(file => !file.startsWith('!'))
22
- .map(id => toProductionEntry(id))
22
+ .map(id => toEntry(id, { production: true }))
23
23
  .concat([
24
24
  ...(localConfig?.plugins?.map(plugin => plugin.package) ?? []).map(toPluginInput),
25
- ...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(id => toDependency(id)),
25
+ ...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(id => toDependency(id, { production: true })),
26
26
  ]);
27
27
  };
28
28
  const plugin = {
@@ -2,7 +2,7 @@ import { Visitor, } from 'oxc-parser';
2
2
  import { findProperty, getPropertyValues, resolveObjectArg } from '../../typescript/ast-helpers.js';
3
3
  import { getStringValue } from '../../typescript/ast-nodes.js';
4
4
  import { isDirectory } from '../../util/fs.js';
5
- import { toConfig, toDeferResolve, toDeferResolveProductionEntry, toProductionEntry } from '../../util/input.js';
5
+ import { toConfig, toModule, toEntryPath, toEntry } from '../../util/input.js';
6
6
  import { isInNodeModules, join, toAbsolute } from '../../util/path.js';
7
7
  import { hasDependency } from '../../util/plugin.js';
8
8
  const title = 'Next.js';
@@ -42,13 +42,13 @@ const production = getEntryFilePatterns();
42
42
  const getInputs = (pageExtensions, loaders, aliasTargets, files, configFileDir) => {
43
43
  const extensions = pageExtensions.length > 0 ? pageExtensions : defaultPageExtensions;
44
44
  const patterns = [...getEntryFilePatterns(extensions, configFileDir), 'next-env.d.ts'];
45
- const inputs = patterns.map(id => toProductionEntry(join(configFileDir, id)));
45
+ const inputs = patterns.map(id => toEntry(join(configFileDir, id), { production: true }));
46
46
  for (const loader of loaders)
47
- inputs.push(toDeferResolve(loader));
47
+ inputs.push(toModule(loader));
48
48
  for (const target of aliasTargets)
49
- inputs.push(toDeferResolve(target, { dir: configFileDir, production: true }));
49
+ inputs.push(toModule(target, { dir: configFileDir, production: true }));
50
50
  for (const file of files)
51
- inputs.push(toDeferResolveProductionEntry(toAbsolute(file, configFileDir)));
51
+ inputs.push(toEntryPath(toAbsolute(file, configFileDir), { production: true }));
52
52
  return inputs;
53
53
  };
54
54
  const isObject = (value) => typeof value === 'object' && value !== null;