knip 0.0.0-graph.3 → 0.0.0-node-types.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.
- package/README.md +7 -915
- package/bin/knip.js +2 -0
- package/dist/ConfigurationChief.d.ts +14 -6
- package/dist/ConfigurationChief.js +104 -70
- package/dist/ConfigurationValidator.d.ts +553 -321
- package/dist/ConfigurationValidator.js +7 -1
- package/dist/DependencyDeputy.d.ts +4 -1
- package/dist/DependencyDeputy.js +13 -11
- package/dist/PrincipalFactory.d.ts +5 -2
- package/dist/PrincipalFactory.js +11 -7
- package/dist/ProjectPrincipal.d.ts +18 -15
- package/dist/ProjectPrincipal.js +43 -25
- package/dist/WorkspaceWorker.d.ts +9 -7
- package/dist/WorkspaceWorker.js +45 -63
- package/dist/binaries/bash-parser.js +1 -1
- package/dist/binaries/index.js +12 -3
- package/dist/binaries/resolvers/c8.js +2 -1
- package/dist/binaries/resolvers/dotenv.js +2 -1
- package/dist/binaries/resolvers/fallback.js +4 -2
- package/dist/binaries/resolvers/index.d.ts +1 -0
- package/dist/binaries/resolvers/index.js +1 -0
- package/dist/binaries/resolvers/node.js +1 -1
- package/dist/binaries/resolvers/nodemon.js +2 -1
- package/dist/binaries/resolvers/npx.js +2 -1
- package/dist/binaries/resolvers/nx.js +1 -1
- package/dist/binaries/resolvers/pnpm.js +1 -1
- package/dist/binaries/resolvers/rollup.js +2 -1
- package/dist/binaries/resolvers/tsx.d.ts +2 -0
- package/dist/binaries/resolvers/tsx.js +6 -0
- package/dist/binaries/resolvers/yarn.js +1 -1
- package/dist/binaries/util.d.ts +0 -3
- package/dist/binaries/util.js +1 -3
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +10 -9
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +5 -4
- package/dist/index.js +101 -65
- package/dist/manifest/index.js +8 -4
- package/dist/plugins/_template/index.js +15 -3
- package/dist/plugins/_template/types.d.ts +1 -0
- package/dist/plugins/angular/index.js +11 -11
- package/dist/plugins/astro/index.d.ts +7 -0
- package/dist/plugins/astro/index.js +19 -0
- package/dist/plugins/ava/index.d.ts +1 -1
- package/dist/plugins/ava/index.js +28 -7
- package/dist/plugins/ava/types.d.ts +5 -1
- package/dist/plugins/babel/helpers.d.ts +1 -2
- package/dist/plugins/babel/helpers.js +28 -20
- package/dist/plugins/babel/index.js +17 -14
- package/dist/plugins/capacitor/index.js +7 -3
- package/dist/plugins/changesets/index.js +10 -6
- package/dist/plugins/commitizen/index.d.ts +1 -0
- package/dist/plugins/commitizen/index.js +8 -4
- package/dist/plugins/commitizen/types.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +7 -3
- package/dist/plugins/cspell/index.js +7 -3
- package/dist/plugins/cspell/types.d.ts +1 -1
- package/dist/plugins/cypress/index.d.ts +3 -1
- package/dist/plugins/cypress/index.js +17 -4
- package/dist/plugins/drizzle/index.js +5 -7
- package/dist/plugins/eslint/fallback.js +6 -1
- package/dist/plugins/eslint/helpers.d.ts +4 -11
- package/dist/plugins/eslint/helpers.js +24 -26
- package/dist/plugins/eslint/index.d.ts +1 -1
- package/dist/plugins/eslint/index.js +14 -4
- package/dist/plugins/gatsby/index.js +11 -5
- package/dist/plugins/github-actions/index.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +7 -4
- package/dist/plugins/graphql-codegen/index.d.ts +7 -0
- package/dist/plugins/graphql-codegen/index.js +46 -0
- package/dist/plugins/graphql-codegen/types.d.ts +25 -0
- package/dist/plugins/graphql-codegen/types.js +3 -0
- package/dist/plugins/husky/index.js +9 -4
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/jest/index.d.ts +1 -1
- package/dist/plugins/jest/index.js +21 -12
- package/dist/plugins/jest/types.d.ts +3 -0
- package/dist/plugins/lefthook/index.js +12 -8
- package/dist/plugins/lint-staged/index.d.ts +1 -0
- package/dist/plugins/lint-staged/index.js +10 -7
- package/dist/plugins/markdownlint/index.js +7 -4
- package/dist/plugins/mocha/index.d.ts +1 -0
- package/dist/plugins/mocha/index.js +12 -7
- package/dist/plugins/mocha/types.d.ts +4 -0
- package/dist/plugins/mocha/types.js +1 -0
- package/dist/plugins/next/index.d.ts +2 -1
- package/dist/plugins/next/index.js +7 -0
- package/dist/plugins/node-test-runner/index.d.ts +6 -0
- package/dist/plugins/node-test-runner/index.js +19 -0
- package/dist/plugins/npm-package-json-lint/index.d.ts +1 -0
- package/dist/plugins/npm-package-json-lint/index.js +8 -4
- package/dist/plugins/nx/index.js +13 -10
- package/dist/plugins/nyc/index.js +6 -3
- package/dist/plugins/nyc/types.d.ts +3 -0
- package/dist/plugins/nyc/types.js +1 -0
- package/dist/plugins/playwright/index.d.ts +5 -1
- package/dist/plugins/playwright/index.js +25 -2
- package/dist/plugins/playwright-ct/index.d.ts +3 -1
- package/dist/plugins/playwright-ct/index.js +18 -2
- package/dist/plugins/postcss/index.js +12 -9
- package/dist/plugins/prettier/index.js +11 -6
- package/dist/plugins/prettier/types.d.ts +8 -0
- package/dist/plugins/prettier/types.js +1 -0
- package/dist/plugins/release-it/index.d.ts +1 -0
- package/dist/plugins/release-it/index.js +14 -10
- package/dist/plugins/remark/index.d.ts +1 -0
- package/dist/plugins/remark/index.js +20 -4
- package/dist/plugins/remark/types.d.ts +3 -0
- package/dist/plugins/remark/types.js +1 -0
- package/dist/plugins/remix/index.d.ts +2 -1
- package/dist/plugins/remix/index.js +9 -0
- package/dist/plugins/rollup/index.d.ts +2 -1
- package/dist/plugins/rollup/index.js +8 -1
- package/dist/plugins/semantic-release/index.d.ts +1 -0
- package/dist/plugins/semantic-release/index.js +10 -4
- package/dist/plugins/semantic-release/types.d.ts +1 -1
- package/dist/plugins/sentry/index.d.ts +2 -1
- package/dist/plugins/sentry/index.js +7 -0
- package/dist/plugins/storybook/index.js +28 -10
- package/dist/plugins/storybook/types.d.ts +7 -0
- package/dist/plugins/stryker/index.js +13 -9
- package/dist/plugins/stylelint/index.js +8 -5
- package/dist/plugins/svelte/index.d.ts +2 -1
- package/dist/plugins/svelte/index.js +6 -0
- package/dist/plugins/tsup/index.d.ts +6 -0
- package/dist/plugins/tsup/index.js +23 -0
- package/dist/plugins/tsup/types.d.ts +7 -0
- package/dist/plugins/tsup/types.js +1 -0
- package/dist/plugins/typedoc/index.d.ts +1 -0
- package/dist/plugins/typedoc/index.js +8 -4
- package/dist/plugins/typedoc/types.d.ts +1 -1
- package/dist/plugins/typescript/index.js +16 -11
- package/dist/plugins/vite/index.js +7 -5
- package/dist/plugins/vitest/helpers.d.ts +2 -2
- package/dist/plugins/vitest/index.d.ts +4 -4
- package/dist/plugins/vitest/index.js +55 -26
- package/dist/plugins/vitest/types.d.ts +23 -2
- package/dist/plugins/webpack/index.js +31 -19
- package/dist/plugins/webpack/types.d.ts +2 -1
- package/dist/reporters/codeowners.js +2 -2
- package/dist/reporters/json.js +14 -9
- package/dist/reporters/symbols.js +3 -2
- package/dist/reporters/util.d.ts +8 -2
- package/dist/reporters/util.js +7 -1
- package/dist/types/cli.d.ts +1 -1
- package/dist/types/config.d.ts +9 -4
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/imports.d.ts +6 -0
- package/dist/types/issues.d.ts +11 -1
- package/dist/types/package-json.d.ts +41 -0
- package/dist/types/package-json.js +1 -0
- package/dist/types/plugins.d.ts +5 -7
- package/dist/types/util.d.ts +16 -0
- package/dist/types/util.js +1 -0
- package/dist/types/workspace.d.ts +4 -1
- package/dist/typescript/SourceFile.d.ts +5 -0
- package/dist/typescript/SourceFileManager.js +3 -3
- package/dist/typescript/ast-helpers.d.ts +7 -14
- package/dist/typescript/ast-helpers.js +11 -9
- package/dist/typescript/createHosts.d.ts +1 -0
- package/dist/typescript/createHosts.js +1 -1
- package/dist/typescript/getImportsAndExports.d.ts +7 -5
- package/dist/typescript/getImportsAndExports.js +35 -18
- package/dist/typescript/resolveModuleNames.d.ts +1 -1
- package/dist/typescript/resolveModuleNames.js +38 -12
- package/dist/typescript/visitors/exports/exportDeclaration.js +14 -1
- package/dist/typescript/visitors/exports/exportKeyword.js +5 -2
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.js +29 -21
- package/dist/typescript/visitors/imports/importCall.js +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.js +3 -3
- package/dist/typescript/visitors/imports/importEqualsDeclaration.js +1 -1
- package/dist/typescript/visitors/imports/jsDocType.js +37 -5
- package/dist/typescript/visitors/imports/propertyAccessCall.js +1 -1
- package/dist/typescript/visitors/imports/reExportDeclaration.js +8 -3
- package/dist/typescript/visitors/imports/requireCall.js +5 -5
- package/dist/util/array.d.ts +3 -1
- package/dist/util/cli-arguments.d.ts +3 -2
- package/dist/util/cli-arguments.js +6 -6
- package/dist/util/compilers.d.ts +122 -80
- package/dist/util/debug.d.ts +3 -3
- package/dist/util/debug.js +12 -18
- package/dist/util/fs.d.ts +2 -0
- package/dist/util/fs.js +22 -3
- package/dist/util/get-included-issue-types.js +14 -18
- package/dist/util/git.js +1 -1
- package/dist/util/glob.js +1 -1
- package/dist/util/loader.d.ts +2 -0
- package/dist/util/loader.js +23 -3
- package/dist/util/modules.d.ts +7 -1
- package/dist/util/modules.js +20 -10
- package/dist/util/object.d.ts +1 -0
- package/dist/util/object.js +3 -0
- package/dist/util/parse-args.d.ts +3 -0
- package/dist/util/parse-args.js +8 -0
- package/dist/util/path.d.ts +1 -0
- package/dist/util/path.js +5 -3
- package/dist/util/plugin.d.ts +4 -3
- package/dist/util/plugin.js +11 -4
- package/dist/util/protocols.d.ts +9 -0
- package/dist/util/protocols.js +9 -0
- package/dist/util/register.d.ts +2 -1
- package/dist/util/register.js +9 -13
- package/dist/util/require.js +7 -5
- package/dist/util/tsconfig-loader.js +2 -1
- package/dist/util/unwrap-function.d.ts +1 -0
- package/dist/util/unwrap-function.js +13 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +86 -85
- package/schema-jsonc.json +11 -0
- package/schema.json +27 -3
- package/dist/plugins/vite/types.d.ts +0 -4
- /package/dist/plugins/{vite → jest}/types.js +0 -0
|
@@ -2,6 +2,7 @@ import { timerify } from '../../util/Performance.js';
|
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
3
|
export const NAME = 'Remark';
|
|
4
4
|
export const ENABLERS = ['remark-cli'];
|
|
5
|
+
export const PACKAGE_JSON_PATH = 'remarkConfig';
|
|
5
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
7
|
export const CONFIG_FILE_PATTERNS = [
|
|
7
8
|
'package.json',
|
|
@@ -10,9 +11,24 @@ export const CONFIG_FILE_PATTERNS = [
|
|
|
10
11
|
'.remarkrc.{js,cjs,mjs}',
|
|
11
12
|
'.remarkrc.{yml,yaml}',
|
|
12
13
|
];
|
|
13
|
-
const findRemarkDependencies = async (configFilePath,
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const findRemarkDependencies = async (configFilePath, options) => {
|
|
15
|
+
const { manifest, isProduction } = options;
|
|
16
|
+
if (isProduction)
|
|
17
|
+
return [];
|
|
18
|
+
const localConfig = configFilePath.endsWith('package.json')
|
|
19
|
+
? manifest[PACKAGE_JSON_PATH]
|
|
20
|
+
: await load(configFilePath);
|
|
21
|
+
if (!localConfig)
|
|
22
|
+
return [];
|
|
23
|
+
const plugins = localConfig.plugins
|
|
24
|
+
?.flatMap(plugin => {
|
|
25
|
+
if (typeof plugin === 'string')
|
|
26
|
+
return plugin;
|
|
27
|
+
if (Array.isArray(plugin) && typeof plugin[0] === 'string')
|
|
28
|
+
return plugin[0];
|
|
29
|
+
return [];
|
|
30
|
+
})
|
|
31
|
+
.map(plugin => (plugin.startsWith('remark-') ? plugin : `remark-${plugin}`)) ?? [];
|
|
32
|
+
return plugins;
|
|
17
33
|
};
|
|
18
34
|
export const findDependencies = timerify(findRemarkDependencies);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
1
|
+
import type { GenericPluginCallback, IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "Remix";
|
|
3
3
|
export declare const ENABLERS: RegExp[];
|
|
4
4
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
5
|
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
6
6
|
export declare const PRODUCTION_ENTRY_FILE_PATTERNS: string[];
|
|
7
|
+
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { timerify } from '../../util/Performance.js';
|
|
1
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toEntryPattern, toProductionEntryPattern } from '../../util/protocols.js';
|
|
2
4
|
export const NAME = 'Remix';
|
|
3
5
|
export const ENABLERS = [/^@remix-run\//];
|
|
4
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
@@ -9,3 +11,10 @@ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
|
9
11
|
'app/routes/**/*.{js,ts,tsx}',
|
|
10
12
|
'server.{js,ts}',
|
|
11
13
|
];
|
|
14
|
+
const findRemixDependencies = async (configFilePath, options) => {
|
|
15
|
+
const { config } = options;
|
|
16
|
+
return config.entry
|
|
17
|
+
? config.entry.map(toProductionEntryPattern)
|
|
18
|
+
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
19
|
+
};
|
|
20
|
+
export const findDependencies = timerify(findRemixDependencies);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
1
|
+
import type { GenericPluginCallback, IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "Rollup";
|
|
3
3
|
export declare const ENABLERS: string[];
|
|
4
4
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
5
|
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
6
|
+
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { timerify } from '../../util/Performance.js';
|
|
1
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
2
4
|
export const NAME = 'Rollup';
|
|
3
5
|
export const ENABLERS = ['rollup'];
|
|
4
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
5
|
-
export const ENTRY_FILE_PATTERNS = ['rollup.config.{js,mjs,ts}'];
|
|
7
|
+
export const ENTRY_FILE_PATTERNS = ['rollup.config.{js,cjs,mjs,ts}'];
|
|
8
|
+
const findRollupDependencies = async () => {
|
|
9
|
+
const entryPatterns = ENTRY_FILE_PATTERNS.map(toEntryPattern);
|
|
10
|
+
return entryPatterns;
|
|
11
|
+
};
|
|
12
|
+
export const findDependencies = timerify(findRollupDependencies);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "Semantic Release";
|
|
3
3
|
export declare const ENABLERS: string[];
|
|
4
|
+
export declare const PACKAGE_JSON_PATH = "release";
|
|
4
5
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
6
|
export declare const CONFIG_FILE_PATTERNS: string[];
|
|
6
7
|
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -2,6 +2,7 @@ import { timerify } from '../../util/Performance.js';
|
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
3
|
export const NAME = 'Semantic Release';
|
|
4
4
|
export const ENABLERS = ['semantic-release'];
|
|
5
|
+
export const PACKAGE_JSON_PATH = 'release';
|
|
5
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
7
|
export const CONFIG_FILE_PATTERNS = [
|
|
7
8
|
'.releaserc',
|
|
@@ -9,9 +10,14 @@ export const CONFIG_FILE_PATTERNS = [
|
|
|
9
10
|
'release.config.{js,cjs}',
|
|
10
11
|
'package.json',
|
|
11
12
|
];
|
|
12
|
-
const findSemanticReleaseDependencies = async (configFilePath,
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const findSemanticReleaseDependencies = async (configFilePath, options) => {
|
|
14
|
+
const { manifest, isProduction } = options;
|
|
15
|
+
if (isProduction)
|
|
16
|
+
return [];
|
|
17
|
+
const localConfig = configFilePath.endsWith('package.json')
|
|
18
|
+
? manifest[PACKAGE_JSON_PATH]
|
|
19
|
+
: await load(configFilePath);
|
|
20
|
+
const plugins = (localConfig?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
|
|
21
|
+
return plugins;
|
|
16
22
|
};
|
|
17
23
|
export const findDependencies = timerify(findSemanticReleaseDependencies);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
1
|
+
import type { GenericPluginCallback, IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "Sentry";
|
|
3
3
|
export declare const ENABLERS: RegExp[];
|
|
4
4
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
5
|
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
6
|
+
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { timerify } from '../../util/Performance.js';
|
|
1
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
2
4
|
export const NAME = 'Sentry';
|
|
3
5
|
export const ENABLERS = [/^@sentry\//];
|
|
4
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
5
7
|
export const ENTRY_FILE_PATTERNS = ['sentry.{client,server,edge}.config.{js,ts}'];
|
|
8
|
+
const findSentryDependencies = async () => {
|
|
9
|
+
const entryPatterns = ENTRY_FILE_PATTERNS.map(toEntryPattern);
|
|
10
|
+
return entryPatterns;
|
|
11
|
+
};
|
|
12
|
+
export const findDependencies = timerify(findSentryDependencies);
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import { dirname, join, relative } from '../../util/path.js';
|
|
1
2
|
import { timerify } from '../../util/Performance.js';
|
|
2
3
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
4
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
3
5
|
export const NAME = 'Storybook';
|
|
4
6
|
export const ENABLERS = [/^@storybook\//, '@nrwl/storybook'];
|
|
5
7
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
|
-
export const CONFIG_FILE_PATTERNS = ['.storybook/{main,
|
|
7
|
-
|
|
8
|
+
export const CONFIG_FILE_PATTERNS = ['.storybook/{main,test-runner}.{js,ts}'];
|
|
9
|
+
const STORIES_FILE_PATTERNS = ['**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))'];
|
|
10
|
+
const REST_ENTRY_FILE_PATTERNS = ['.storybook/{manager,preview}.{js,jsx,ts,tsx}'];
|
|
11
|
+
export const ENTRY_FILE_PATTERNS = [...REST_ENTRY_FILE_PATTERNS, ...STORIES_FILE_PATTERNS];
|
|
8
12
|
export const PROJECT_FILE_PATTERNS = ['.storybook/**/*.{js,jsx,ts,tsx}'];
|
|
9
|
-
const findStorybookDependencies = async (configFilePath) => {
|
|
10
|
-
const config =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const findStorybookDependencies = async (configFilePath, options) => {
|
|
14
|
+
const { isProduction, cwd, config } = options;
|
|
15
|
+
const localConfig = await load(configFilePath);
|
|
16
|
+
const stories = typeof localConfig?.stories === 'function'
|
|
17
|
+
? await localConfig.stories(STORIES_FILE_PATTERNS)
|
|
18
|
+
: localConfig?.stories;
|
|
19
|
+
const relativePatterns = stories?.map(pattern => {
|
|
20
|
+
if (typeof pattern === 'string')
|
|
21
|
+
return relative(cwd, join(dirname(configFilePath), pattern));
|
|
22
|
+
return relative(cwd, join(dirname(configFilePath), pattern.directory, pattern.files ?? STORIES_FILE_PATTERNS[0]));
|
|
23
|
+
});
|
|
24
|
+
const patterns = [
|
|
25
|
+
...(config?.entry ?? REST_ENTRY_FILE_PATTERNS),
|
|
26
|
+
...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : STORIES_FILE_PATTERNS),
|
|
27
|
+
];
|
|
28
|
+
const entryPatterns = patterns.map(toEntryPattern);
|
|
29
|
+
if (!localConfig || isProduction)
|
|
30
|
+
return entryPatterns;
|
|
31
|
+
const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
|
|
32
|
+
const builder = localConfig?.core?.builder;
|
|
15
33
|
const builderPackages = builder && /webpack/.test(builder) ? [`@storybook/builder-${builder}`, `@storybook/manager-${builder}`] : [];
|
|
16
|
-
const frameworks =
|
|
17
|
-
return [...addons, ...builderPackages, ...frameworks];
|
|
34
|
+
const frameworks = localConfig.framework?.name ? [localConfig.framework.name] : [];
|
|
35
|
+
return [...entryPatterns, ...addons, ...builderPackages, ...frameworks];
|
|
18
36
|
};
|
|
19
37
|
export const findDependencies = timerify(findStorybookDependencies);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
type Stories = (string | {
|
|
2
|
+
directory: string;
|
|
3
|
+
files?: string;
|
|
4
|
+
titlePrefix?: string;
|
|
5
|
+
})[];
|
|
1
6
|
export type StorybookConfig = {
|
|
7
|
+
stories?: Stories | ((patterns: string[]) => Promise<string[]>);
|
|
2
8
|
addons?: (string | {
|
|
3
9
|
name: string;
|
|
4
10
|
})[];
|
|
@@ -9,3 +15,4 @@ export type StorybookConfig = {
|
|
|
9
15
|
name?: string;
|
|
10
16
|
};
|
|
11
17
|
};
|
|
18
|
+
export {};
|
|
@@ -4,14 +4,18 @@ export const NAME = 'Stryker';
|
|
|
4
4
|
export const ENABLERS = ['@stryker-mutator/core'];
|
|
5
5
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
6
|
export const CONFIG_FILE_PATTERNS = ['?(.)stryker.{conf,config}.{js,mjs,cjs,json}'];
|
|
7
|
-
const findStrykerDependencies = async (configFilePath) => {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return [
|
|
14
|
-
}
|
|
15
|
-
|
|
7
|
+
const findStrykerDependencies = async (configFilePath, options) => {
|
|
8
|
+
const { isProduction } = options;
|
|
9
|
+
if (isProduction)
|
|
10
|
+
return [];
|
|
11
|
+
const localConfig = await load(configFilePath);
|
|
12
|
+
if (!localConfig)
|
|
13
|
+
return [];
|
|
14
|
+
const runners = localConfig.testRunner ? [`@stryker-mutator/${localConfig.testRunner}-runner`] : [];
|
|
15
|
+
const checkers = localConfig.checkers
|
|
16
|
+
? localConfig.checkers.map(checker => `@stryker-mutator/${checker}-checker`)
|
|
17
|
+
: [];
|
|
18
|
+
const plugins = localConfig.plugins ?? [];
|
|
19
|
+
return [...runners, ...checkers, ...plugins];
|
|
16
20
|
};
|
|
17
21
|
export const findDependencies = timerify(findStrykerDependencies);
|
|
@@ -9,14 +9,17 @@ export const CONFIG_FILE_PATTERNS = [
|
|
|
9
9
|
'.stylelintrc.{cjs,js,json,yaml,yml}',
|
|
10
10
|
'stylelint.config.{cjs,mjs,js}',
|
|
11
11
|
];
|
|
12
|
-
const findPluginDependencies = async (configFilePath,
|
|
13
|
-
const
|
|
12
|
+
const findPluginDependencies = async (configFilePath, options) => {
|
|
13
|
+
const { manifest, isProduction } = options;
|
|
14
|
+
if (isProduction)
|
|
15
|
+
return [];
|
|
16
|
+
const localConfig = configFilePath.endsWith('package.json')
|
|
14
17
|
? manifest.stylelint
|
|
15
18
|
: await load(configFilePath);
|
|
16
|
-
if (!
|
|
19
|
+
if (!localConfig)
|
|
17
20
|
return [];
|
|
18
|
-
const extend =
|
|
19
|
-
const plugins =
|
|
21
|
+
const extend = localConfig.extends ? [localConfig.extends].flat().filter(extend => !isInternal(extend)) : [];
|
|
22
|
+
const plugins = localConfig.plugins ? [localConfig.plugins].flat().filter(plugin => !isInternal(plugin)) : [];
|
|
20
23
|
return [...extend, ...plugins];
|
|
21
24
|
};
|
|
22
25
|
export const findDependencies = timerify(findPluginDependencies);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
1
|
+
import type { GenericPluginCallback, IsPluginEnabledCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "Svelte";
|
|
3
3
|
export declare const ENABLERS: string[];
|
|
4
4
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
5
|
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
6
6
|
export declare const PRODUCTION_ENTRY_FILE_PATTERNS: string[];
|
|
7
7
|
export declare const PROJECT_FILE_PATTERNS: string[];
|
|
8
|
+
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { timerify } from '../../util/Performance.js';
|
|
1
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toEntryPattern, toProductionEntryPattern } from '../../util/protocols.js';
|
|
2
4
|
export const NAME = 'Svelte';
|
|
3
5
|
export const ENABLERS = ['svelte'];
|
|
4
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
@@ -7,3 +9,7 @@ export const PRODUCTION_ENTRY_FILE_PATTERNS = [
|
|
|
7
9
|
'src/routes/**/+{page,server,page.server,error,layout,layout.server}{,@*}.{js,ts,svelte}',
|
|
8
10
|
];
|
|
9
11
|
export const PROJECT_FILE_PATTERNS = ['src/**/*.{js,ts,svelte}'];
|
|
12
|
+
const findSvelteDependencies = async () => {
|
|
13
|
+
return [...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern), ...ENTRY_FILE_PATTERNS.map(toEntryPattern)];
|
|
14
|
+
};
|
|
15
|
+
export const findDependencies = timerify(findSvelteDependencies);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
|
|
2
|
+
export declare const NAME = "tsup";
|
|
3
|
+
export declare const ENABLERS: string[];
|
|
4
|
+
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
|
+
export declare const CONFIG_FILE_PATTERNS: string[];
|
|
6
|
+
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { timerify } from '../../util/Performance.js';
|
|
2
|
+
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
4
|
+
export const NAME = 'tsup';
|
|
5
|
+
export const ENABLERS = ['tsup'];
|
|
6
|
+
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
7
|
+
export const CONFIG_FILE_PATTERNS = ['tsup.config.js'];
|
|
8
|
+
const findTsupDependencies = async (configFilePath) => {
|
|
9
|
+
let localConfig = await load(configFilePath);
|
|
10
|
+
if (typeof localConfig === 'function')
|
|
11
|
+
localConfig = await localConfig({});
|
|
12
|
+
if (!localConfig)
|
|
13
|
+
return [];
|
|
14
|
+
const entryPatterns = [localConfig].flat().flatMap(config => {
|
|
15
|
+
if (!config.entry)
|
|
16
|
+
return [];
|
|
17
|
+
if (Array.isArray(config.entry))
|
|
18
|
+
return config.entry.map(toEntryPattern);
|
|
19
|
+
return Object.values(config.entry).map(toEntryPattern);
|
|
20
|
+
});
|
|
21
|
+
return entryPatterns;
|
|
22
|
+
};
|
|
23
|
+
export const findDependencies = timerify(findTsupDependencies);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
|
|
2
2
|
export declare const NAME = "TypeDoc";
|
|
3
3
|
export declare const ENABLERS: string[];
|
|
4
|
+
export declare const PACKAGE_JSON_PATH = "typedocOptions";
|
|
4
5
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
5
6
|
export declare const CONFIG_FILE_PATTERNS: string[];
|
|
6
7
|
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -2,6 +2,7 @@ import { timerify } from '../../util/Performance.js';
|
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
3
|
export const NAME = 'TypeDoc';
|
|
4
4
|
export const ENABLERS = ['typedoc'];
|
|
5
|
+
export const PACKAGE_JSON_PATH = 'typedocOptions';
|
|
5
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
6
7
|
export const CONFIG_FILE_PATTERNS = [
|
|
7
8
|
'typedoc.{js,cjs,json,jsonc}',
|
|
@@ -11,12 +12,15 @@ export const CONFIG_FILE_PATTERNS = [
|
|
|
11
12
|
'package.json',
|
|
12
13
|
'tsconfig.json',
|
|
13
14
|
];
|
|
14
|
-
const findTypeDocDependencies = async (configFilePath,
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const findTypeDocDependencies = async (configFilePath, options) => {
|
|
16
|
+
const { manifest, isProduction } = options;
|
|
17
|
+
if (isProduction)
|
|
18
|
+
return [];
|
|
19
|
+
const localConfig = configFilePath.endsWith('package.json')
|
|
20
|
+
? manifest[PACKAGE_JSON_PATH]
|
|
17
21
|
: configFilePath.endsWith('tsconfig.json')
|
|
18
22
|
? (await load(configFilePath)).typedocOptions
|
|
19
23
|
: await load(configFilePath);
|
|
20
|
-
return
|
|
24
|
+
return localConfig?.plugin ?? [];
|
|
21
25
|
};
|
|
22
26
|
export const findDependencies = timerify(findTypeDocDependencies);
|
|
@@ -8,31 +8,36 @@ export const ENABLERS = ['typescript'];
|
|
|
8
8
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
9
9
|
export const CONFIG_FILE_PATTERNS = ['tsconfig.json', 'tsconfig.*.json'];
|
|
10
10
|
const resolveExtensibleConfig = async (configFilePath) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const localConfig = await load(configFilePath);
|
|
12
|
+
if (!localConfig)
|
|
13
|
+
return;
|
|
14
|
+
localConfig.extends = localConfig.extends ? [localConfig.extends].flat() : [];
|
|
15
|
+
if (localConfig?.extends) {
|
|
16
|
+
for (const extend of [localConfig.extends].flat()) {
|
|
15
17
|
if (isInternal(extend)) {
|
|
16
18
|
const presetConfigPath = toAbsolute(extend, dirname(configFilePath));
|
|
17
19
|
const presetConfig = await resolveExtensibleConfig(presetConfigPath);
|
|
18
|
-
|
|
20
|
+
localConfig.extends.push(...(presetConfig?.extends ? [presetConfig.extends].flat() : []));
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
return
|
|
24
|
+
return localConfig;
|
|
23
25
|
};
|
|
24
|
-
export const findTypeScriptDependencies = async (configFilePath) => {
|
|
26
|
+
export const findTypeScriptDependencies = async (configFilePath, options) => {
|
|
27
|
+
const { isProduction } = options;
|
|
25
28
|
const { compilerOptions } = await loadTSConfig(configFilePath);
|
|
26
|
-
const
|
|
27
|
-
if (!compilerOptions || !
|
|
29
|
+
const localConfig = await resolveExtensibleConfig(configFilePath);
|
|
30
|
+
if (!compilerOptions || !localConfig)
|
|
28
31
|
return [];
|
|
29
|
-
const
|
|
32
|
+
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
33
|
+
if (isProduction)
|
|
34
|
+
return [...jsx];
|
|
35
|
+
const extend = localConfig.extends ? [localConfig.extends].flat().filter(extend => !isInternal(extend)) : [];
|
|
30
36
|
const types = compilerOptions.types ?? [];
|
|
31
37
|
const plugins = Array.isArray(compilerOptions?.plugins)
|
|
32
38
|
? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
|
|
33
39
|
: [];
|
|
34
40
|
const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
|
|
35
|
-
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
36
41
|
return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
|
|
37
42
|
};
|
|
38
43
|
export const findDependencies = timerify(findTypeScriptDependencies);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { timerify } from '../../util/Performance.js';
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
|
-
import {
|
|
3
|
+
import { findVitestDependencies } from '../vitest/index.js';
|
|
4
4
|
export const NAME = 'Vite';
|
|
5
5
|
export const ENABLERS = ['vite'];
|
|
6
6
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
7
|
-
export const CONFIG_FILE_PATTERNS = ['vite.config.{js,ts}'];
|
|
8
|
-
const findViteDependencies = async (configFilePath) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
7
|
+
export const CONFIG_FILE_PATTERNS = ['vite.config.{js,mjs,ts,cjs,mts,cts}'];
|
|
8
|
+
const findViteDependencies = async (configFilePath, options) => {
|
|
9
|
+
const localConfig = await load(configFilePath);
|
|
10
|
+
if (!localConfig)
|
|
11
|
+
return [];
|
|
12
|
+
return findVitestDependencies(configFilePath, localConfig, options);
|
|
11
13
|
};
|
|
12
14
|
export const findDependencies = timerify(findViteDependencies);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ViteConfig } from './types.js';
|
|
2
2
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
3
3
|
type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
|
|
4
4
|
export declare const getEnvPackageName: (env: VitestEnvironment) => any;
|
|
5
|
-
export declare const getExternalReporters: (reporters?:
|
|
5
|
+
export declare const getExternalReporters: (reporters?: ViteConfig['test']['reporters']) => unknown[];
|
|
6
6
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
|
|
1
|
+
import type { ViteConfigOrFn } from './types.js';
|
|
2
|
+
import type { IsPluginEnabledCallback, GenericPluginCallback, GenericPluginCallbackOptions } from '../../types/plugins.js';
|
|
3
3
|
export declare const NAME = "Vitest";
|
|
4
4
|
export declare const ENABLERS: string[];
|
|
5
5
|
export declare const isEnabled: IsPluginEnabledCallback;
|
|
6
6
|
export declare const CONFIG_FILE_PATTERNS: string[];
|
|
7
|
-
export declare const ENTRY_FILE_PATTERNS:
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const ENTRY_FILE_PATTERNS: string[];
|
|
8
|
+
export declare const findVitestDependencies: (configFilePath: string, localConfig: ViteConfigOrFn, options: GenericPluginCallbackOptions) => Promise<any[]>;
|
|
9
9
|
export declare const findDependencies: GenericPluginCallback;
|
|
@@ -1,37 +1,66 @@
|
|
|
1
1
|
import { compact } from '../../util/array.js';
|
|
2
|
+
import { dirname, isAbsolute, join, relative } from '../../util/path.js';
|
|
2
3
|
import { timerify } from '../../util/Performance.js';
|
|
3
|
-
import { hasDependency, load } from '../../util/plugin.js';
|
|
4
|
+
import { hasDependency, load, tryResolve } from '../../util/plugin.js';
|
|
5
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
4
6
|
import { getEnvPackageName, getExternalReporters } from './helpers.js';
|
|
5
7
|
export const NAME = 'Vitest';
|
|
6
8
|
export const ENABLERS = ['vitest'];
|
|
7
9
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
8
|
-
export const CONFIG_FILE_PATTERNS = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
export const CONFIG_FILE_PATTERNS = [
|
|
11
|
+
'vitest.config.{js,mjs,ts,cjs,mts,cts}',
|
|
12
|
+
'vitest.{workspace,projects}.{ts,js,json}',
|
|
13
|
+
];
|
|
14
|
+
export const ENTRY_FILE_PATTERNS = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
|
|
15
|
+
const resolveEntry = (containingFilePath, specifier) => {
|
|
16
|
+
const dir = dirname(containingFilePath);
|
|
17
|
+
const resolvedPath = isAbsolute(specifier) ? specifier : tryResolve(join(dir, specifier), containingFilePath);
|
|
18
|
+
if (resolvedPath)
|
|
19
|
+
return toEntryPattern(relative(dir, resolvedPath));
|
|
20
|
+
return specifier;
|
|
21
|
+
};
|
|
22
|
+
const findConfigDependencies = (configFilePath, localConfig, options) => {
|
|
23
|
+
const { isProduction, config } = options;
|
|
24
|
+
const testConfig = localConfig.test;
|
|
25
|
+
const entryPatterns = (config?.entry ?? testConfig?.include ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
26
|
+
if (!testConfig || isProduction)
|
|
27
|
+
return entryPatterns;
|
|
28
|
+
const environments = testConfig.environment ? [getEnvPackageName(testConfig.environment)] : [];
|
|
29
|
+
const reporters = getExternalReporters(testConfig.reporters);
|
|
30
|
+
const coverage = testConfig.coverage && testConfig.coverage.enabled !== false
|
|
31
|
+
? [`@vitest/coverage-${testConfig.coverage.provider ?? 'v8'}`]
|
|
32
|
+
: [];
|
|
33
|
+
const setupFiles = [testConfig.setupFiles ?? []].flat().map(v => resolveEntry(configFilePath, v));
|
|
34
|
+
const globalSetup = [testConfig.globalSetup ?? []].flat().map(v => resolveEntry(configFilePath, v));
|
|
35
|
+
return [...entryPatterns, ...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup];
|
|
20
36
|
};
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
export const findVitestDependencies = async (configFilePath, localConfig, options) => {
|
|
38
|
+
if (!localConfig)
|
|
39
|
+
return [];
|
|
40
|
+
if (typeof localConfig === 'function') {
|
|
41
|
+
const dependencies = new Set();
|
|
42
|
+
for (const command of ['dev', 'serve', 'build']) {
|
|
43
|
+
for (const mode of ['development', 'production']) {
|
|
44
|
+
const config = await localConfig({ command, mode, ssrBuild: undefined });
|
|
45
|
+
findConfigDependencies(configFilePath, config, options).forEach(dependency => dependencies.add(dependency));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return Array.from(dependencies);
|
|
27
49
|
}
|
|
28
|
-
|
|
50
|
+
const entry = localConfig.build?.lib?.entry ?? [];
|
|
51
|
+
const dependencies = (typeof entry === 'string' ? [entry] : Object.values(entry)).map(specifier => resolveEntry(configFilePath, specifier));
|
|
52
|
+
if (!localConfig.test)
|
|
53
|
+
return dependencies;
|
|
54
|
+
return [...dependencies, ...findConfigDependencies(configFilePath, localConfig, options)];
|
|
29
55
|
};
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
56
|
+
const findVitestWorkspaceDependencies = async (configFilePath, options) => {
|
|
57
|
+
const localConfig = await load(configFilePath);
|
|
58
|
+
const dependencies = new Set();
|
|
59
|
+
for (const config of [localConfig].flat()) {
|
|
60
|
+
if (config && typeof config !== 'string') {
|
|
61
|
+
(await findVitestDependencies(configFilePath, config, options)).forEach(dependency => dependencies.add(dependency));
|
|
62
|
+
}
|
|
34
63
|
}
|
|
35
|
-
return
|
|
64
|
+
return compact(dependencies);
|
|
36
65
|
};
|
|
37
|
-
export const findDependencies = timerify(
|
|
66
|
+
export const findDependencies = timerify(findVitestWorkspaceDependencies);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface VitestConfig {
|
|
2
2
|
test: {
|
|
3
|
+
include: string[];
|
|
3
4
|
coverage?: {
|
|
5
|
+
enabled?: boolean;
|
|
4
6
|
provider: string;
|
|
5
7
|
};
|
|
6
8
|
environment?: string;
|
|
@@ -9,4 +11,23 @@ export interface VitestConfig {
|
|
|
9
11
|
setupFiles?: string | string[];
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
|
-
export
|
|
14
|
+
export interface ViteConfig extends VitestConfig {
|
|
15
|
+
plugins?: unknown[];
|
|
16
|
+
build?: {
|
|
17
|
+
lib?: {
|
|
18
|
+
entry: string | string[] | {
|
|
19
|
+
[entryAlias: string]: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export type COMMAND = 'dev' | 'serve' | 'build';
|
|
25
|
+
export type MODE = 'development' | 'production';
|
|
26
|
+
interface Options {
|
|
27
|
+
command: COMMAND;
|
|
28
|
+
mode: MODE;
|
|
29
|
+
ssrBuild?: boolean | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type ViteConfigOrFn = ViteConfig | ((options: Options) => ViteConfig) | ((options: Options) => Promise<ViteConfig>);
|
|
32
|
+
export type VitestWorkspaceConfig = (string | ViteConfig)[];
|
|
33
|
+
export {};
|