knip 6.38.0 → 6.40.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 (77) hide show
  1. package/dist/ConfigurationChief.d.ts +18 -0
  2. package/dist/WorkspaceWorker.d.ts +3 -4
  3. package/dist/WorkspaceWorker.js +12 -38
  4. package/dist/compilers/compilers.js +1 -1
  5. package/dist/constants.js +1 -0
  6. package/dist/graph/analyze.js +14 -5
  7. package/dist/graph/build.js +17 -10
  8. package/dist/graph-explorer/explorer.d.ts +1 -1
  9. package/dist/graph-explorer/operations/is-referenced.d.ts +1 -1
  10. package/dist/graph-explorer/operations/is-referenced.js +8 -4
  11. package/dist/plugins/_vue/auto-import.js +17 -10
  12. package/dist/plugins/angular/index.js +1 -1
  13. package/dist/plugins/capacitor/index.js +1 -1
  14. package/dist/plugins/commitlint/index.js +34 -9
  15. package/dist/plugins/cucumber/index.js +36 -4
  16. package/dist/plugins/cucumber/types.d.ts +2 -1
  17. package/dist/plugins/eslint/resolveFromAST.d.ts +0 -1
  18. package/dist/plugins/eslint/resolveFromAST.js +1 -1
  19. package/dist/plugins/index.d.ts +3 -0
  20. package/dist/plugins/index.js +6 -0
  21. package/dist/plugins/jasmine/index.d.ts +3 -0
  22. package/dist/plugins/jasmine/index.js +55 -0
  23. package/dist/plugins/jasmine/types.d.ts +7 -0
  24. package/dist/plugins/jasmine/types.js +1 -0
  25. package/dist/plugins/jest/helpers.d.ts +1 -0
  26. package/dist/plugins/jest/helpers.js +2 -0
  27. package/dist/plugins/jest/index.js +20 -11
  28. package/dist/plugins/osls/index.d.ts +3 -0
  29. package/dist/plugins/osls/index.js +13 -0
  30. package/dist/plugins/oxlint/index.d.ts +3 -0
  31. package/dist/plugins/oxlint/index.js +4 -31
  32. package/dist/plugins/oxlint/types.d.ts +1 -0
  33. package/dist/plugins/playwright/index.js +20 -3
  34. package/dist/plugins/playwright/types.d.ts +5 -0
  35. package/dist/plugins/postcss/index.js +5 -1
  36. package/dist/plugins/railway/index.d.ts +3 -0
  37. package/dist/plugins/railway/index.js +129 -0
  38. package/dist/plugins/rsbuild/index.js +42 -4
  39. package/dist/plugins/rsbuild/types.d.ts +18 -1
  40. package/dist/plugins/rspack/index.d.ts +3 -1
  41. package/dist/plugins/rspack/index.js +1 -1
  42. package/dist/plugins/rstest/index.js +116 -17
  43. package/dist/plugins/rstest/types.d.ts +29 -5
  44. package/dist/plugins/rstest/visitors/mock.d.ts +2 -0
  45. package/dist/plugins/rstest/visitors/mock.js +52 -0
  46. package/dist/plugins/serverless-framework/index.d.ts +4 -1
  47. package/dist/plugins/serverless-framework/index.js +40 -7
  48. package/dist/plugins/serverless-framework/types.d.ts +4 -2
  49. package/dist/plugins/simple-git-hooks/index.js +1 -1
  50. package/dist/plugins/vite/helpers.d.ts +1 -1
  51. package/dist/plugins/vite/helpers.js +7 -8
  52. package/dist/plugins/vitest/index.js +31 -7
  53. package/dist/plugins/vitest/types.d.ts +12 -0
  54. package/dist/schema/configuration.d.ts +45 -0
  55. package/dist/schema/plugins.d.ts +15 -0
  56. package/dist/schema/plugins.js +3 -0
  57. package/dist/types/PluginNames.d.ts +2 -2
  58. package/dist/types/PluginNames.js +3 -0
  59. package/dist/types/package-json.d.ts +5 -0
  60. package/dist/typescript/ast-nodes.js +291 -0
  61. package/dist/typescript/resolve-module-names.js +15 -4
  62. package/dist/typescript/visitors/walk.js +12 -0
  63. package/dist/util/create-options.d.ts +30 -0
  64. package/dist/util/filter-transitive-dependencies.d.ts +2 -0
  65. package/dist/util/filter-transitive-dependencies.js +38 -0
  66. package/dist/util/git.d.ts +1 -0
  67. package/dist/util/git.js +23 -1
  68. package/dist/util/package-json.d.ts +1 -348
  69. package/dist/util/package-json.js +56 -10
  70. package/dist/util/tag.d.ts +1 -0
  71. package/dist/util/tag.js +1 -1
  72. package/dist/util/to-source-path.d.ts +1 -1
  73. package/dist/util/to-source-path.js +7 -5
  74. package/dist/version.d.ts +1 -1
  75. package/dist/version.js +1 -1
  76. package/package.json +1 -1
  77. package/schema.json +12 -0
@@ -5,7 +5,7 @@ const title = 'Rspack';
5
5
  const enablers = ['@rspack/core'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
7
  const config = ['rspack.config*.{js,ts,mjs,mts,cjs,cts}'];
8
- const resolveConfig = async (localConfig, options) => {
8
+ export const resolveConfig = async (localConfig, options) => {
9
9
  const inputs = await findWebpackDependenciesFromConfig(localConfig, options);
10
10
  return inputs.filter(input => !input.specifier.startsWith('builtin:'));
11
11
  };
@@ -1,31 +1,130 @@
1
- import { toDeferResolve, toEntry } from '../../util/input.js';
2
- import { hasDependency } from '../../util/plugin.js';
1
+ import { arrayify } from '../../util/array.js';
2
+ import { findFileWithExtensions } from '../../util/fs.js';
3
+ import { _dirGlob, _glob, negate } from '../../util/glob.js';
4
+ import { toAlias, toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
5
+ import { dirname, join, relative, toAbsolute } from '../../util/path.js';
6
+ import { hasDependency, load } from '../../util/plugin.js';
7
+ import { createRstestMockVisitor } from './visitors/mock.js';
3
8
  const title = 'Rstest';
4
9
  const enablers = ['@rstest/core'];
5
10
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
11
+ const configExtensions = ['.mts', '.mjs', '.ts', '.js', '.cjs', '.cts'];
6
12
  const config = ['rstest.config.{js,cjs,mjs,ts,cts,mts}'];
7
13
  const mocks = ['**/__mocks__/**/*.?(c|m)[jt]s?(x)'];
8
- const entry = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
9
- function testEnvironment(config) {
10
- const environment = typeof config.testEnvironment === 'string' ? config.testEnvironment : config.testEnvironment?.name;
11
- if (!environment || environment === 'node')
12
- return [];
13
- return [environment];
14
- }
15
- const resolveConfig = async (config) => {
16
- const entries = (config.include ?? entry)
17
- .concat(...mocks)
18
- .map(toEntry)
19
- .concat(...(config.exclude ?? []).map(id => toEntry(`!${id}`)));
20
- const environments = testEnvironment(config);
21
- const setupFiles = config.setupFiles ?? [];
22
- return [...environments, ...setupFiles, ...entries].map(id => (typeof id === 'string' ? toDeferResolve(id) : id));
14
+ const testEntry = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
15
+ const entry = [...testEntry, ...mocks];
16
+ const getEnvironmentDependency = (name) => (name && name !== 'node' ? [toDependency(name)] : []);
17
+ const replaceRootDir = (path, root) => path.replace('<rootDir>', root);
18
+ const configParams = { env: 'test', command: 'run', envMode: 'test' };
19
+ const getConfig = async (config) => typeof config === 'function' ? await config(configParams) : config;
20
+ const resolveConfig = async (localConfig, options) => {
21
+ const { cwd, configFileDir, configFilePath, getManifest, isResolvedConfigFile } = options;
22
+ const cfg = await getConfig(localConfig);
23
+ const runnerRoot = toAbsolute(cfg.root ?? '.', isResolvedConfigFile ? configFileDir : cwd);
24
+ const manifest = getManifest(cwd);
25
+ const seen = new Set([configFilePath]);
26
+ const inputs = [];
27
+ const addProject = async (project, projectRoot) => {
28
+ const toPattern = (pattern) => relative(cwd, toAbsolute(replaceRootDir(pattern, projectRoot), projectRoot));
29
+ if (!options.config.entry) {
30
+ const include = [];
31
+ const exclude = [...(Array.isArray(project.exclude) ? project.exclude : (project.exclude?.patterns ?? []))];
32
+ for (const pattern of [...(project.include ?? testEntry), ...mocks]) {
33
+ if (pattern.startsWith('!'))
34
+ exclude.push(pattern.slice(1));
35
+ else
36
+ include.push(toPattern(pattern));
37
+ }
38
+ const entries = exclude.length === 0
39
+ ? include
40
+ : await _glob({ cwd, patterns: [...include, ...exclude.map(pattern => negate(toPattern(pattern)))] });
41
+ for (const entry of entries)
42
+ inputs.push(toEntry(entry));
43
+ }
44
+ const env = project.testEnvironment;
45
+ inputs.push(...getEnvironmentDependency(typeof env === 'string' ? env : env?.name));
46
+ for (const specifier of [project.setupFiles ?? [], project.globalSetup ?? []].flat()) {
47
+ inputs.push(toDeferResolve(replaceRootDir(specifier, projectRoot), { dir: projectRoot }));
48
+ }
49
+ if (project.browser?.enabled) {
50
+ inputs.push(toDependency('@rstest/browser'), toDependency('playwright'));
51
+ }
52
+ for (const [name, value] of Object.entries(project.resolve?.alias ?? {})) {
53
+ const prefixes = [];
54
+ for (const target of arrayify(value))
55
+ prefixes.push(target.startsWith('.') ? join(runnerRoot, target) : target);
56
+ if (name.endsWith('$')) {
57
+ inputs.push(toAlias(name.slice(0, -1), prefixes));
58
+ }
59
+ else {
60
+ inputs.push(toAlias(name, prefixes), toAlias(`${name}/*`, prefixes.map(prefix => `${prefix}/*`)));
61
+ }
62
+ }
63
+ };
64
+ const addProjects = async (projects, projectsRoot) => {
65
+ const patterns = [];
66
+ for (const project of projects) {
67
+ if (typeof project === 'string')
68
+ patterns.push(replaceRootDir(project, projectsRoot));
69
+ else
70
+ await addProject(project, toAbsolute(replaceRootDir(project.root ?? projectsRoot, projectsRoot), runnerRoot));
71
+ }
72
+ const [files, dirs] = await Promise.all([
73
+ _glob({ cwd: projectsRoot, patterns, gitignore: false }),
74
+ _dirGlob({ cwd: projectsRoot, patterns, gitignore: false }),
75
+ ]);
76
+ for (const dir of dirs) {
77
+ const projectRoot = toAbsolute(dir, projectsRoot);
78
+ const filePath = findFileWithExtensions(join(projectRoot, 'rstest.config'), configExtensions);
79
+ if (filePath)
80
+ files.push(filePath);
81
+ else
82
+ await addProject({}, projectRoot);
83
+ }
84
+ for (const filePath of files) {
85
+ if (seen.has(filePath))
86
+ continue;
87
+ seen.add(filePath);
88
+ const project = getManifest(dirname(filePath)) === manifest
89
+ ? await load(filePath)
90
+ .then(getConfig)
91
+ .catch(() => undefined)
92
+ : undefined;
93
+ if (!project) {
94
+ inputs.push(toConfig('rstest', filePath, { containingFilePath: configFilePath }));
95
+ continue;
96
+ }
97
+ inputs.push(toEntry(filePath));
98
+ if (project.projects)
99
+ await addProjects(project.projects, dirname(filePath));
100
+ else
101
+ await addProject(project, toAbsolute(project.root ?? dirname(filePath), runnerRoot));
102
+ }
103
+ };
104
+ if (cfg.projects)
105
+ await addProjects(cfg.projects, runnerRoot);
106
+ else
107
+ await addProject(cfg, runnerRoot);
108
+ if (!isResolvedConfigFile) {
109
+ inputs.push(toDependency(`@rstest/coverage-${cfg.coverage?.provider ?? 'istanbul'}`, { optional: true }));
110
+ }
111
+ return inputs;
112
+ };
113
+ const args = {
114
+ config: true,
115
+ resolveInputs: parsed => getEnvironmentDependency(parsed.testEnvironment),
116
+ };
117
+ const registerVisitors = ({ ctx, registerVisitor }) => {
118
+ registerVisitor(createRstestMockVisitor(ctx));
23
119
  };
24
120
  const plugin = {
25
121
  title,
26
122
  enablers,
27
123
  isEnabled,
28
124
  config,
125
+ entry,
29
126
  resolveConfig,
127
+ args,
128
+ registerVisitors,
30
129
  };
31
130
  export default plugin;
@@ -1,8 +1,32 @@
1
- export type RstestConfig = {
1
+ type TestEnvironment = 'node' | 'jsdom' | 'happy-dom';
2
+ export type RstestProjectConfig = {
3
+ root?: string;
2
4
  include?: string[];
3
- exclude?: string[];
4
- testEnvironment?: 'node' | 'jsdom' | 'happy-dom' | {
5
- name: 'node' | 'jsdom' | 'happy-dom';
5
+ exclude?: string[] | {
6
+ patterns: string[];
6
7
  };
7
- setupFiles?: string[];
8
+ testEnvironment?: TestEnvironment | {
9
+ name: TestEnvironment;
10
+ };
11
+ setupFiles?: string | string[];
12
+ globalSetup?: string | string[];
13
+ browser?: {
14
+ enabled?: boolean;
15
+ };
16
+ resolve?: {
17
+ alias?: Record<string, string | false | (string | false)[]>;
18
+ };
19
+ };
20
+ type RstestConfig = RstestProjectConfig & {
21
+ projects?: (string | RstestProjectConfig)[];
22
+ coverage?: {
23
+ provider?: 'istanbul' | 'v8';
24
+ };
25
+ };
26
+ type ConfigParams = {
27
+ env: string;
28
+ command: string;
29
+ envMode: string;
8
30
  };
31
+ export type RstestConfigOrFn = RstestConfig | ((params: ConfigParams) => RstestConfig | Promise<RstestConfig>);
32
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { PluginVisitorContext, PluginVisitorObject } from '../../../types/config.ts';
2
+ export declare function createRstestMockVisitor(ctx: PluginVisitorContext): PluginVisitorObject;
@@ -0,0 +1,52 @@
1
+ import { IMPORT_FLAGS } from '../../../constants.js';
2
+ import { getStringValue, isStringLiteral } from '../../../typescript/ast-nodes.js';
3
+ import { isShadowed } from '../../../typescript/visitors/walk.js';
4
+ const rstestApiNames = new Set(['rs', 'rstest']);
5
+ const mockMethods = new Set(['mock', 'doMock']);
6
+ export function createRstestMockVisitor(ctx) {
7
+ const rsNames = new Set();
8
+ return {
9
+ Program(node) {
10
+ rsNames.clear();
11
+ for (const statement of node.body) {
12
+ if (statement.type !== 'ImportDeclaration' ||
13
+ !isStringLiteral(statement.source) ||
14
+ getStringValue(statement.source) !== '@rstest/core')
15
+ continue;
16
+ for (const specifier of statement.specifiers ?? []) {
17
+ if (specifier.type === 'ImportSpecifier' &&
18
+ specifier.imported.type === 'Identifier' &&
19
+ rstestApiNames.has(specifier.imported.name)) {
20
+ rsNames.add(specifier.local.name);
21
+ }
22
+ }
23
+ }
24
+ },
25
+ CallExpression(node) {
26
+ const argument = node.arguments[0];
27
+ const factory = node.arguments[1];
28
+ const factoryBody = factory?.type === 'ArrowFunctionExpression' &&
29
+ factory.body.type === 'ParenthesizedExpression' &&
30
+ factory.body.expression.type === 'ObjectExpression'
31
+ ? factory.body.expression
32
+ : undefined;
33
+ if (argument?.type !== 'ImportExpression' ||
34
+ !isStringLiteral(argument.source) ||
35
+ factory?.type !== 'ArrowFunctionExpression' ||
36
+ !factoryBody ||
37
+ factory.async ||
38
+ factory.params.length > 0 ||
39
+ factoryBody.properties.some(property => property.type === 'SpreadElement') ||
40
+ node.callee.type !== 'MemberExpression' ||
41
+ node.callee.computed ||
42
+ node.callee.object.type !== 'Identifier' ||
43
+ !rsNames.has(node.callee.object.name) ||
44
+ isShadowed(node.callee.object.name, node.callee.object.start) ||
45
+ node.callee.property.type !== 'Identifier' ||
46
+ !mockMethods.has(node.callee.property.name))
47
+ return;
48
+ ctx.markImportExpressionHandled(argument.start);
49
+ ctx.addImport(getStringValue(argument.source), argument.source.start, IMPORT_FLAGS.SIDE_EFFECTS);
50
+ },
51
+ };
52
+ }
@@ -1,3 +1,6 @@
1
- import type { Plugin } from '../../types/config.ts';
1
+ import type { Plugin, ResolveConfig } from '../../types/config.ts';
2
+ import type { PluginConfig } from './types.ts';
3
+ export declare const config: string[];
4
+ export declare const resolveConfig: ResolveConfig<PluginConfig>;
2
5
  declare const plugin: Plugin;
3
6
  export default plugin;
@@ -1,22 +1,55 @@
1
1
  import { arrayify } from '../../util/array.js';
2
2
  import { toDependency, toProductionEntry } from '../../util/input.js';
3
- import { isInternal, join } from '../../util/path.js';
3
+ import { _load } from '../../util/loader.js';
4
+ import { get } from '../../util/object.js';
5
+ import { isInternal, join, toAbsolute } from '../../util/path.js';
4
6
  import { hasDependency } from '../../util/plugin.js';
5
7
  const title = 'Serverless Framework';
6
8
  const enablers = ['serverless'];
7
9
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
- const config = ['serverless.{js,cjs,mjs,ts,cts,mts,yml,yaml}'];
10
+ export const config = ['serverless.{js,cjs,mjs,ts,cts,mts,yml,yaml}'];
11
+ const fileVariable = /^\$\{file\(([^()$]+)\)(?::([^\s,}]+))?/;
12
+ const isRecord = (value) => typeof value === 'object' && value !== null;
13
+ const resolveFileVariable = async (value, dir) => {
14
+ const match = typeof value === 'string' && value.match(fileVariable);
15
+ if (!match)
16
+ return value;
17
+ try {
18
+ const content = await _load(toAbsolute(match[1].trim(), dir));
19
+ return match[2] ? get(content, match[2]) : content;
20
+ }
21
+ catch {
22
+ return undefined;
23
+ }
24
+ };
9
25
  const handlerToEntry = (handler) => {
10
26
  const dot = handler.lastIndexOf('.');
11
- return toProductionEntry(`${handler.slice(0, dot)}.{js,ts}`);
27
+ const file = handler.slice(0, dot);
28
+ return toProductionEntry(/\.(?:[cm]?[jt]s|[jt]sx)$/.test(file) ? file : `${file}.{js,ts}`);
12
29
  };
13
30
  const pluginToInput = (plugin, dir) => isInternal(plugin) ? toProductionEntry(join(dir, plugin)) : toDependency(plugin);
31
+ const getFunctionEntries = async (functions, dir) => {
32
+ const entries = [];
33
+ const resolved = await resolveFileVariable(functions, dir);
34
+ for (const group of Array.isArray(resolved) ? resolved : [resolved]) {
35
+ const fns = await resolveFileVariable(group, dir);
36
+ if (!isRecord(fns))
37
+ continue;
38
+ for (const name in fns) {
39
+ const fn = await resolveFileVariable(fns[name], dir);
40
+ if (isRecord(fn) && typeof fn.handler === 'string')
41
+ entries.push(handlerToEntry(fn.handler));
42
+ }
43
+ }
44
+ return entries;
45
+ };
14
46
  const getInjectEntries = (esbuild, dir) => esbuild && typeof esbuild === 'object' ? arrayify(esbuild.inject).map(id => toProductionEntry(join(dir, id))) : [];
15
- const resolveConfig = async (config, options) => {
16
- const functions = config.functions
17
- ? Object.values(config.functions).flatMap(fn => (fn.handler ? [handlerToEntry(fn.handler)] : []))
47
+ export const resolveConfig = async (config, options) => {
48
+ const functions = await getFunctionEntries(config.functions, options.configFileDir);
49
+ const resolvedPlugins = await resolveFileVariable(config.plugins, options.configFileDir);
50
+ const plugins = Array.isArray(resolvedPlugins)
51
+ ? resolvedPlugins.filter((plugin) => typeof plugin === 'string')
18
52
  : [];
19
- const plugins = config.plugins?.filter((plugin) => typeof plugin === 'string') ?? [];
20
53
  const esbuild = config.custom?.esbuild || config.build?.esbuild ? [toDependency('esbuild', { optional: true })] : [];
21
54
  const injectEntries = [
22
55
  ...getInjectEntries(config.custom?.esbuild, options.configFileDir),
@@ -5,9 +5,11 @@ export type PluginConfig = {
5
5
  custom?: {
6
6
  esbuild?: EsbuildConfig;
7
7
  };
8
- functions?: Record<string, ServerlessFunction>;
9
- plugins?: unknown[];
8
+ functions?: Functions | Array<Functions | FileVariable> | FileVariable;
9
+ plugins?: unknown[] | FileVariable;
10
10
  };
11
+ type FileVariable = string;
12
+ type Functions = Record<string, ServerlessFunction | FileVariable>;
11
13
  export type EsbuildConfig = {
12
14
  inject?: string[];
13
15
  } | boolean;
@@ -3,7 +3,7 @@ import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'simple-git-hooks';
4
4
  const enablers = ['simple-git-hooks'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['.simple-git-hooks.{js,cjs,json}', 'simple-git-hooks.{js,cjs,json}', 'package.json'];
6
+ const config = ['.simple-git-hooks.{js,cjs,mjs,json}', 'simple-git-hooks.{js,cjs,mjs,json}', 'package.json'];
7
7
  const resolveConfig = async (config, options) => {
8
8
  if (options.isProduction)
9
9
  return [];
@@ -1,6 +1,6 @@
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 getHtmlScriptEntries: (htmlPath: string, publicDir?: string) => Promise<Input[]>;
4
+ export declare const getHtmlScriptEntries: (htmlPath: string, rootDir?: string, publicDir?: string) => Promise<Input[]>;
5
5
  export declare const getIndexHtmlEntries: (rootDir: string, publicDir?: string) => Promise<Input[]>;
6
6
  export declare const getVitePluginDirs: (program: Program, specifiers: string[], key: string) => string[] | undefined;
@@ -25,9 +25,9 @@ const moduleTypePattern = /\btype\s*=\s*["']?module["']?/i;
25
25
  const srcAttrPattern = /\bsrc\s*=\s*["']([^"']+)["']/i;
26
26
  const importSpecPattern = /\bimport\b(?:\s*\(\s*|(?:[\w$*,{}\s]*\bfrom\b)?\s*)(['"])([^'"]+)\1/g;
27
27
  const isFilePath = (specifier) => specifier.startsWith('/') || specifier.startsWith('./') || specifier.startsWith('../');
28
- const normalizeModuleScriptSrc = (value) => value.trim().replace(/^\//, '');
29
- const getScriptSources = (html, publicDir) => {
28
+ const getScriptSources = (html, htmlDir, rootDir, publicDir) => {
30
29
  const sources = [];
30
+ const resolveSource = (src) => (src.startsWith('/') ? join(rootDir, src) : toAbsolute(src, htmlDir));
31
31
  for (const [, attrs, body] of html.matchAll(scriptExtractor)) {
32
32
  const srcMatch = attrs.match(srcAttrPattern);
33
33
  if (srcMatch) {
@@ -42,7 +42,7 @@ const getScriptSources = (html, publicDir) => {
42
42
  }
43
43
  }
44
44
  if (moduleTypePattern.test(attrs))
45
- sources.push(normalizeModuleScriptSrc(src));
45
+ sources.push(resolveSource(src));
46
46
  continue;
47
47
  }
48
48
  if (moduleTypePattern.test(attrs) && body) {
@@ -50,20 +50,19 @@ const getScriptSources = (html, publicDir) => {
50
50
  for (const importMatch of code.matchAll(importSpecPattern)) {
51
51
  const specifier = importMatch[2];
52
52
  if (isFilePath(specifier))
53
- sources.push(normalizeModuleScriptSrc(specifier));
53
+ sources.push(resolveSource(specifier));
54
54
  }
55
55
  }
56
56
  }
57
57
  return sources;
58
58
  };
59
- export const getHtmlScriptEntries = async (htmlPath, publicDir) => {
59
+ export const getHtmlScriptEntries = async (htmlPath, rootDir = dirname(htmlPath), publicDir) => {
60
60
  if (!isFile(htmlPath))
61
61
  return [];
62
62
  const html = await loadFile(htmlPath);
63
- const dir = dirname(htmlPath);
64
- return getScriptSources(html, publicDir).map(src => toProductionEntry(toAbsolute(src, dir)));
63
+ return getScriptSources(html, dirname(htmlPath), rootDir, publicDir).map(src => toProductionEntry(src));
65
64
  };
66
- export const getIndexHtmlEntries = (rootDir, publicDir) => getHtmlScriptEntries(join(rootDir, 'index.html'), publicDir);
65
+ export const getIndexHtmlEntries = (rootDir, publicDir) => getHtmlScriptEntries(join(rootDir, 'index.html'), rootDir, publicDir);
67
66
  export const getVitePluginDirs = (program, specifiers, key) => {
68
67
  let dirs;
69
68
  for (const call of findImportedCalls(program, specifiers)) {
@@ -1,10 +1,12 @@
1
1
  import { DEFAULT_EXTENSIONS } from '../../constants.js';
2
+ import { filterTransitiveDependencies } from '../../util/filter-transitive-dependencies.js';
2
3
  import { _glob } from '../../util/glob.js';
3
- import { toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
4
+ import { toConfig, toDeferResolve, toDependency, toEntry, toProductionEntry } from '../../util/input.js';
4
5
  import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
5
6
  import { isAbsolute, isInternal, join, toAbsolute, toPosix } from '../../util/path.js';
6
7
  import { hasDependency } from '../../util/plugin.js';
7
- import { getIndexHtmlEntries } from '../vite/helpers.js';
8
+ import { resolveExtendedConfig } from '../oxlint/index.js';
9
+ import { getHtmlScriptEntries, getIndexHtmlEntries } from '../vite/helpers.js';
8
10
  import { getAliasInputs, getEnvSpecifier, getExternalReporters } from './helpers.js';
9
11
  import { createVitestMockVisitor } from './visitors/mock.js';
10
12
  const title = 'Vitest';
@@ -107,6 +109,7 @@ const getConfigs = async (localConfig) => {
107
109
  };
108
110
  export const resolveConfig = async (localConfig, options) => {
109
111
  const inputs = new Set();
112
+ const lintInputs = [];
110
113
  inputs.add(toEntry(join(options.cwd, 'src/vite-env.d.ts')));
111
114
  const configs = await getConfigs(localConfig);
112
115
  for (const cfg of configs) {
@@ -134,19 +137,25 @@ export const resolveConfig = async (localConfig, options) => {
134
137
  };
135
138
  const seenRoots = new Set();
136
139
  for (const cfg of configs) {
140
+ const lint = cfg.lint;
141
+ if (lint && options.enabledPlugins.includes('oxlint')) {
142
+ for (const input of resolveExtendedConfig(lint, options.configFilePath))
143
+ lintInputs.push(input);
144
+ }
137
145
  const viteRoot = toAbsolute(cfg.root ?? '.', options.cwd);
146
+ const publicDir = cfg.publicDir === false || cfg.publicDir === ''
147
+ ? undefined
148
+ : toAbsolute(toPosix(cfg.publicDir ?? 'public'), viteRoot);
138
149
  if (!seenRoots.has(viteRoot)) {
139
150
  seenRoots.add(viteRoot);
140
- const publicDir = cfg.publicDir === false || cfg.publicDir === ''
141
- ? undefined
142
- : toAbsolute(toPosix(cfg.publicDir ?? 'public'), viteRoot);
143
151
  for (const entry of await getIndexHtmlEntries(viteRoot, publicDir))
144
152
  inputs.add(entry);
145
153
  }
146
- const vitestRoot = cfg.test?.root || !options.isResolvedConfigFile
154
+ const testRoot = cfg.test?.root || !options.isResolvedConfigFile
147
155
  ? toAbsolute(cfg.test?.root ?? '.', options.cwd)
148
156
  : toAbsolute('.', options.configFileDir);
149
- const dir = cfg.test?.dir ? toAbsolute(cfg.test.dir, vitestRoot) : vitestRoot;
157
+ const vitestRoot = !cfg.test?.root && cfg.root && !options.isResolvedConfigFile ? toAbsolute(cfg.root, options.cwd) : testRoot;
158
+ const dir = cfg.test?.dir ? toAbsolute(cfg.test.dir, testRoot) : vitestRoot;
150
159
  if (cfg.test) {
151
160
  if (cfg.test?.include) {
152
161
  for (const dependency of cfg.test.include)
@@ -189,12 +198,27 @@ export const resolveConfig = async (localConfig, options) => {
189
198
  }
190
199
  for (const dependency of findConfigDependencies(cfg, options, vitestRoot))
191
200
  inputs.add(dependency);
201
+ const _input = cfg.build?.rolldownOptions?.input ?? cfg.build?.rollupOptions?.input ?? [];
202
+ const inputSpecifiers = typeof _input === 'string' ? [_input] : Array.isArray(_input) ? _input : Object.values(_input).flat();
203
+ for (const specifier of inputSpecifiers) {
204
+ const resolved = toAbsolute(specifier, viteRoot);
205
+ inputs.add(toProductionEntry(resolved));
206
+ if (resolved.endsWith('.html')) {
207
+ for (const input of await getHtmlScriptEntries(resolved, viteRoot, publicDir))
208
+ inputs.add(input);
209
+ }
210
+ }
192
211
  const _entry = cfg.build?.lib?.entry ?? [];
193
212
  const entries = typeof _entry === 'string' ? [_entry] : Array.isArray(_entry) ? _entry : Object.values(_entry).flat();
194
213
  const deps = entries.map(specifier => join(viteRoot, specifier)).map(id => toEntry(id));
195
214
  for (const dependency of deps)
196
215
  inputs.add(dependency);
197
216
  }
217
+ if (lintInputs.length > 0) {
218
+ filterTransitiveDependencies(lintInputs, options.configFilePath);
219
+ for (const input of lintInputs)
220
+ inputs.add(input);
221
+ }
198
222
  return Array.from(inputs);
199
223
  };
200
224
  const args = {
@@ -1,3 +1,4 @@
1
+ import type { OxlintConfig } from '../oxlint/types.ts';
1
2
  interface Alias {
2
3
  find: string | RegExp;
3
4
  replacement: string;
@@ -37,11 +38,22 @@ interface VitestConfig {
37
38
  };
38
39
  }
39
40
  export interface ViteConfig extends VitestConfig {
41
+ lint?: OxlintConfig;
40
42
  extends?: string | true;
41
43
  root?: string;
42
44
  publicDir?: string | false;
43
45
  plugins?: unknown[];
44
46
  build?: {
47
+ rolldownOptions?: {
48
+ input?: string | string[] | {
49
+ [entryAlias: string]: string | string[];
50
+ };
51
+ };
52
+ rollupOptions?: {
53
+ input?: string | string[] | {
54
+ [entryAlias: string]: string | string[];
55
+ };
56
+ };
45
57
  lib?: {
46
58
  entry: string | string[] | {
47
59
  [entryAlias: string]: string | string[];
@@ -236,6 +236,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
236
236
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
237
237
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
238
238
  }, z.core.$strip>]>>;
239
+ jasmine: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
240
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
241
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
242
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
243
+ }, z.core.$strip>]>>;
239
244
  jest: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
240
245
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
241
246
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -441,6 +446,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
441
446
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
442
447
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
443
448
  }, z.core.$strip>]>>;
449
+ osls: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
450
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
451
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
452
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
453
+ }, z.core.$strip>]>>;
444
454
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
445
455
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
446
456
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -536,6 +546,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
536
546
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
537
547
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
538
548
  }, z.core.$strip>]>>;
549
+ railway: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
550
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
551
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
552
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
553
+ }, z.core.$strip>]>>;
539
554
  raycast: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
540
555
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
541
556
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1188,6 +1203,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1188
1203
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1189
1204
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1190
1205
  }, z.core.$strip>]>>;
1206
+ jasmine: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1207
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1208
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1209
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1210
+ }, z.core.$strip>]>>;
1191
1211
  jest: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1192
1212
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1193
1213
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1393,6 +1413,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1393
1413
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1394
1414
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1395
1415
  }, z.core.$strip>]>>;
1416
+ osls: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1417
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1418
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1419
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1420
+ }, z.core.$strip>]>>;
1396
1421
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1397
1422
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1398
1423
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1488,6 +1513,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1488
1513
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1489
1514
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1490
1515
  }, z.core.$strip>]>>;
1516
+ railway: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1517
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1518
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1519
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1520
+ }, z.core.$strip>]>>;
1491
1521
  raycast: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1492
1522
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1493
1523
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2159,6 +2189,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2159
2189
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2160
2190
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2161
2191
  }, z.core.$strip>]>>;
2192
+ jasmine: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2193
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2194
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2195
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2196
+ }, z.core.$strip>]>>;
2162
2197
  jest: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2163
2198
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2164
2199
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2364,6 +2399,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2364
2399
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2365
2400
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2366
2401
  }, z.core.$strip>]>>;
2402
+ osls: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2403
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2404
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2405
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2406
+ }, z.core.$strip>]>>;
2367
2407
  oxfmt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2368
2408
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2369
2409
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2459,6 +2499,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2459
2499
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2460
2500
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2461
2501
  }, z.core.$strip>]>>;
2502
+ railway: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2503
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2504
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2505
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2506
+ }, z.core.$strip>]>>;
2462
2507
  raycast: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2463
2508
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2464
2509
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;