knip 5.52.0 → 5.54.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/dist/ConfigurationChief.d.ts +1 -0
- package/dist/IssueFixer.d.ts +1 -1
- package/dist/IssueFixer.js +13 -3
- package/dist/PrincipalFactory.js +3 -17
- package/dist/ProjectPrincipal.d.ts +2 -2
- package/dist/ProjectPrincipal.js +14 -3
- package/dist/WorkspaceWorker.d.ts +0 -1
- package/dist/WorkspaceWorker.js +4 -19
- package/dist/cli.js +10 -6
- package/dist/compilers/index.d.ts +10 -0
- package/dist/graph/build.js +12 -7
- package/dist/index.js +15 -4
- package/dist/plugins/ava/index.d.ts +1 -2
- package/dist/plugins/ava/index.js +2 -7
- package/dist/plugins/bun/index.d.ts +2 -2
- package/dist/plugins/bun/index.js +2 -2
- package/dist/plugins/cucumber/index.d.ts +1 -2
- package/dist/plugins/cucumber/index.js +2 -5
- package/dist/plugins/cypress/index.d.ts +1 -2
- package/dist/plugins/cypress/index.js +6 -9
- package/dist/plugins/cypress/types.d.ts +8 -0
- package/dist/plugins/eleventy/helpers.d.ts +10 -2
- package/dist/plugins/eleventy/index.d.ts +3 -6
- package/dist/plugins/eleventy/index.js +11 -16
- package/dist/plugins/eleventy/types.d.ts +9 -7
- package/dist/plugins/expo/index.d.ts +2 -5
- package/dist/plugins/expo/index.js +4 -6
- package/dist/plugins/github-action/index.d.ts +2 -2
- package/dist/plugins/github-action/index.js +2 -2
- package/dist/plugins/index.d.ts +20 -28
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/jest/index.d.ts +1 -2
- package/dist/plugins/jest/index.js +4 -12
- package/dist/plugins/karma/index.d.ts +1 -3
- package/dist/plugins/karma/index.js +0 -10
- package/dist/plugins/ladle/index.d.ts +1 -2
- package/dist/plugins/ladle/index.js +4 -7
- package/dist/plugins/metro/index.d.ts +2 -3
- package/dist/plugins/metro/index.js +17 -14
- package/dist/plugins/mocha/index.d.ts +1 -2
- package/dist/plugins/mocha/index.js +2 -6
- package/dist/plugins/msw/index.d.ts +2 -2
- package/dist/plugins/msw/index.js +2 -2
- package/dist/plugins/netlify/index.d.ts +1 -2
- package/dist/plugins/netlify/index.js +4 -7
- package/dist/plugins/node/index.d.ts +2 -2
- package/dist/plugins/node/index.js +2 -2
- package/dist/plugins/nuxt/index.d.ts +2 -2
- package/dist/plugins/nuxt/index.js +2 -2
- package/dist/plugins/playwright/index.d.ts +1 -3
- package/dist/plugins/playwright/index.js +5 -7
- package/dist/plugins/playwright-ct/index.d.ts +0 -1
- package/dist/plugins/playwright-ct/index.js +1 -2
- package/dist/plugins/postcss/index.js +3 -1
- package/dist/plugins/preconstruct/index.d.ts +1 -1
- package/dist/plugins/preconstruct/index.js +2 -2
- package/dist/plugins/react-cosmos/index.d.ts +1 -2
- package/dist/plugins/react-cosmos/index.js +4 -6
- package/dist/plugins/react-router/index.d.ts +2 -2
- package/dist/plugins/react-router/index.js +2 -2
- package/dist/plugins/relay/index.d.ts +2 -2
- package/dist/plugins/relay/index.js +2 -2
- package/dist/plugins/rspack/index.js +2 -3
- package/dist/plugins/size-limit/index.d.ts +2 -1
- package/dist/plugins/size-limit/index.js +10 -0
- package/dist/plugins/storybook/index.d.ts +1 -2
- package/dist/plugins/storybook/index.js +2 -5
- package/dist/plugins/svelte/index.d.ts +2 -1
- package/dist/plugins/svelte/index.js +7 -0
- package/dist/plugins/svgo/index.d.ts +8 -0
- package/dist/plugins/svgo/index.js +11 -0
- package/dist/plugins/vite/index.d.ts +0 -1
- package/dist/plugins/vite/index.js +1 -2
- package/dist/plugins/vitest/index.d.ts +1 -3
- package/dist/plugins/vitest/index.js +35 -24
- package/dist/plugins/vitest/types.d.ts +12 -0
- package/dist/plugins/vue/index.js +2 -5
- package/dist/plugins/webpack/index.d.ts +1 -5
- package/dist/plugins/webpack/index.js +36 -17
- package/dist/plugins/wrangler/index.d.ts +2 -2
- package/dist/plugins/wrangler/index.js +2 -2
- package/dist/plugins.js +1 -1
- package/dist/reporters/watch.js +1 -1
- package/dist/schema/configuration.d.ts +56 -0
- package/dist/schema/plugins.d.ts +23 -0
- package/dist/schema/plugins.js +1 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +1 -0
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/config.d.ts +0 -2
- package/dist/types/project.d.ts +0 -1
- package/dist/util/Performance.d.ts +25 -7
- package/dist/util/Performance.js +70 -34
- package/dist/util/cli-arguments.d.ts +4 -1
- package/dist/util/cli-arguments.js +7 -1
- package/dist/util/glob-core.d.ts +5 -6
- package/dist/util/glob-core.js +30 -29
- package/dist/util/input.d.ts +7 -1
- package/dist/util/input.js +7 -0
- package/dist/util/string.d.ts +1 -0
- package/dist/util/string.js +10 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/schema.json +4 -0
|
@@ -5,13 +5,10 @@ const enablers = ['mocha'];
|
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['.mocharc.{js,cjs,json,jsonc,yml,yaml}', 'package.json'];
|
|
7
7
|
const entry = ['**/test/*.{js,cjs,mjs}'];
|
|
8
|
-
const resolveEntryPaths = localConfig => {
|
|
9
|
-
const entryPatterns = localConfig.spec ? [localConfig.spec].flat() : [];
|
|
10
|
-
return [...entryPatterns].map(id => toEntry(id));
|
|
11
|
-
};
|
|
12
8
|
const resolveConfig = localConfig => {
|
|
9
|
+
const entryPatterns = localConfig.spec ? [localConfig.spec].flat() : entry;
|
|
13
10
|
const require = localConfig.require ? [localConfig.require].flat() : [];
|
|
14
|
-
return [...require].map(id => toEntry(id));
|
|
11
|
+
return [...entryPatterns, ...require].map(id => toEntry(id));
|
|
15
12
|
};
|
|
16
13
|
const args = {
|
|
17
14
|
nodeImportArgs: true,
|
|
@@ -23,6 +20,5 @@ export default {
|
|
|
23
20
|
config,
|
|
24
21
|
entry,
|
|
25
22
|
resolveConfig,
|
|
26
|
-
resolveEntryPaths,
|
|
27
23
|
args,
|
|
28
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { MSWConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,6 +6,6 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
|
-
|
|
9
|
+
resolveConfig: ResolveConfig<MSWConfig>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -6,7 +6,7 @@ const enablers = ['msw'];
|
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
7
|
const config = ['package.json'];
|
|
8
8
|
const entry = ['mockServiceWorker.js'];
|
|
9
|
-
const
|
|
9
|
+
const resolveConfig = async (localConfig) => {
|
|
10
10
|
const workerDirectory = localConfig?.workerDirectory;
|
|
11
11
|
const dir = workerDirectory ? [workerDirectory].flat()[0] : '.';
|
|
12
12
|
return entry.map(pattern => toEntry(join(dir, pattern)));
|
|
@@ -17,5 +17,5 @@ export default {
|
|
|
17
17
|
isEnabled,
|
|
18
18
|
config,
|
|
19
19
|
entry,
|
|
20
|
-
|
|
20
|
+
resolveConfig,
|
|
21
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { NetlifyConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,7 +6,6 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
production: string[];
|
|
9
|
-
resolveEntryPaths: ResolveEntryPaths<NetlifyConfig>;
|
|
10
9
|
resolveConfig: ResolveConfig<NetlifyConfig>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -9,19 +9,17 @@ const config = ['netlify.toml'];
|
|
|
9
9
|
const NETLIFY_FUNCTIONS_DIR = 'netlify/functions';
|
|
10
10
|
const NETLIFY_FUNCTIONS_EXTS = 'js,mjs,cjs,ts,mts,cts';
|
|
11
11
|
const production = [`${NETLIFY_FUNCTIONS_DIR}/**/*.{${NETLIFY_FUNCTIONS_EXTS}}`];
|
|
12
|
-
const
|
|
12
|
+
const resolveConfig = async (localConfig) => {
|
|
13
13
|
return [
|
|
14
14
|
...extractFunctionsConfigProperty(localConfig.functions || {}, 'included_files'),
|
|
15
15
|
join(localConfig.functions?.directory ?? NETLIFY_FUNCTIONS_DIR, `**/*.{${NETLIFY_FUNCTIONS_EXTS}}`),
|
|
16
16
|
]
|
|
17
17
|
.filter(file => !file.startsWith('!'))
|
|
18
|
-
.map(id => toProductionEntry(id))
|
|
19
|
-
|
|
20
|
-
const resolveConfig = async (localConfig) => {
|
|
21
|
-
return [
|
|
18
|
+
.map(id => toProductionEntry(id))
|
|
19
|
+
.concat([
|
|
22
20
|
...(localConfig?.plugins?.map(plugin => plugin.package) ?? []).map(id => toDependency(id)),
|
|
23
21
|
...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(id => toDependency(id)),
|
|
24
|
-
];
|
|
22
|
+
]);
|
|
25
23
|
};
|
|
26
24
|
export default {
|
|
27
25
|
title,
|
|
@@ -29,6 +27,5 @@ export default {
|
|
|
29
27
|
isEnabled,
|
|
30
28
|
config,
|
|
31
29
|
production,
|
|
32
|
-
resolveEntryPaths,
|
|
33
30
|
resolveConfig,
|
|
34
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { PackageJson } from '../../types/package-json.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
packageJsonPath: (id: PackageJson) => PackageJson;
|
|
7
7
|
config: string[];
|
|
8
|
-
|
|
8
|
+
resolveConfig: ResolveConfig<PackageJson>;
|
|
9
9
|
args: {
|
|
10
10
|
positional: boolean;
|
|
11
11
|
nodeImportArgs: boolean;
|
|
@@ -3,7 +3,7 @@ const title = 'Node.js';
|
|
|
3
3
|
const isEnabled = () => true;
|
|
4
4
|
const config = ['package.json'];
|
|
5
5
|
const packageJsonPath = (id) => id;
|
|
6
|
-
const
|
|
6
|
+
const resolveConfig = localConfig => {
|
|
7
7
|
const scripts = localConfig.scripts;
|
|
8
8
|
const entries = [toProductionEntry('server.js')];
|
|
9
9
|
if (scripts && Object.keys(scripts).some(script => /(?<=^|\s)node\s(.*)--test/.test(scripts[script]))) {
|
|
@@ -23,6 +23,6 @@ export default {
|
|
|
23
23
|
isEnabled,
|
|
24
24
|
packageJsonPath,
|
|
25
25
|
config,
|
|
26
|
-
|
|
26
|
+
resolveConfig,
|
|
27
27
|
args,
|
|
28
28
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { NuxtConfig } from './types.js';
|
|
3
3
|
export declare const docs: {
|
|
4
4
|
note: string;
|
|
@@ -9,6 +9,6 @@ declare const _default: {
|
|
|
9
9
|
isEnabled: IsPluginEnabled;
|
|
10
10
|
config: string[];
|
|
11
11
|
production: string[];
|
|
12
|
-
|
|
12
|
+
resolveConfig: ResolveConfig<NuxtConfig>;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
@@ -21,7 +21,7 @@ const production = [
|
|
|
21
21
|
'server/middleware/**/*.ts',
|
|
22
22
|
'server/plugins/**/*.ts',
|
|
23
23
|
];
|
|
24
|
-
const
|
|
24
|
+
const resolveConfig = async (localConfig) => {
|
|
25
25
|
const srcDir = localConfig.srcDir ?? '.';
|
|
26
26
|
const patterns = [
|
|
27
27
|
'app.{vue,jsx,tsx}',
|
|
@@ -45,5 +45,5 @@ export default {
|
|
|
45
45
|
isEnabled,
|
|
46
46
|
config,
|
|
47
47
|
production,
|
|
48
|
-
|
|
48
|
+
resolveConfig,
|
|
49
49
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { PlaywrightTestConfig } from './types.js';
|
|
3
3
|
export declare const entry: string[];
|
|
4
|
-
export declare const resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
5
4
|
export declare const resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
6
5
|
declare const _default: {
|
|
7
6
|
title: string;
|
|
@@ -10,7 +9,6 @@ declare const _default: {
|
|
|
10
9
|
config: string[];
|
|
11
10
|
entry: string[];
|
|
12
11
|
resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
13
|
-
resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
14
12
|
args: {
|
|
15
13
|
binaries: string[];
|
|
16
14
|
positional: boolean;
|
|
@@ -13,19 +13,18 @@ const toEntryPatterns = (testMatch, cwd, configDir, localConfig, rootConfig) =>
|
|
|
13
13
|
return patterns.map(pattern => toEntry(join(dir, pattern)));
|
|
14
14
|
};
|
|
15
15
|
const builtinReporters = ['dot', 'line', 'list', 'junit', 'html', 'blob', 'json', 'github'];
|
|
16
|
-
export const
|
|
16
|
+
export const resolveConfig = async (localConfig, options) => {
|
|
17
17
|
const { cwd, configFileDir } = options;
|
|
18
18
|
const projects = localConfig.projects ? [localConfig, ...localConfig.projects] : [localConfig];
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
export const resolveConfig = async (config) => {
|
|
22
|
-
const reporters = [config.reporter].flat().flatMap(reporter => {
|
|
19
|
+
const reporters = [localConfig.reporter].flat().flatMap(reporter => {
|
|
23
20
|
const name = typeof reporter === 'string' ? reporter : reporter?.[0];
|
|
24
21
|
if (!name || builtinReporters.includes(name))
|
|
25
22
|
return [];
|
|
26
23
|
return [name];
|
|
27
24
|
});
|
|
28
|
-
return
|
|
25
|
+
return projects
|
|
26
|
+
.flatMap(config => toEntryPatterns(config.testMatch ?? entry, cwd, configFileDir, config, localConfig))
|
|
27
|
+
.concat(reporters.map(toDeferResolve));
|
|
29
28
|
};
|
|
30
29
|
const args = {
|
|
31
30
|
binaries: ['playwright'],
|
|
@@ -40,6 +39,5 @@ export default {
|
|
|
40
39
|
config,
|
|
41
40
|
entry,
|
|
42
41
|
resolveConfig,
|
|
43
|
-
resolveEntryPaths,
|
|
44
42
|
args,
|
|
45
43
|
};
|
|
@@ -5,7 +5,6 @@ declare const _default: {
|
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
7
|
entry: string[];
|
|
8
|
-
resolveEntryPaths: import("../../types/config.js").ResolveEntryPaths<import("../playwright/types.js").PlaywrightTestConfig>;
|
|
9
8
|
resolveConfig: import("../../types/config.js").ResolveConfig<import("../playwright/types.js").PlaywrightTestConfig>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
-
import { entry, resolveConfig
|
|
2
|
+
import { entry, resolveConfig } from '../playwright/index.js';
|
|
3
3
|
const title = 'Playwright for components';
|
|
4
4
|
const enablers = [/^@playwright\/experimental-ct-/];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -10,6 +10,5 @@ export default {
|
|
|
10
10
|
isEnabled,
|
|
11
11
|
config,
|
|
12
12
|
entry,
|
|
13
|
-
resolveEntryPaths,
|
|
14
13
|
resolveConfig,
|
|
15
14
|
};
|
|
@@ -20,7 +20,9 @@ const resolveConfig = config => {
|
|
|
20
20
|
})
|
|
21
21
|
: [];
|
|
22
22
|
const inputs = plugins.map(toDeferResolve);
|
|
23
|
-
return
|
|
23
|
+
return ['tailwindcss', '@tailwindcss/postcss'].some(tailwindPlugin => plugins.includes(tailwindPlugin))
|
|
24
|
+
? [...inputs, toDependency('postcss')]
|
|
25
|
+
: inputs;
|
|
24
26
|
};
|
|
25
27
|
export default {
|
|
26
28
|
title,
|
|
@@ -4,7 +4,7 @@ const title = 'Preconstruct';
|
|
|
4
4
|
const enablers = ['@preconstruct/cli'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['package.json'];
|
|
7
|
-
const
|
|
7
|
+
const resolveConfig = async (config) => {
|
|
8
8
|
return (config.entrypoints ?? []).map(id => toProductionEntry(id, { allowIncludeExports: true }));
|
|
9
9
|
};
|
|
10
10
|
export default {
|
|
@@ -12,5 +12,5 @@ export default {
|
|
|
12
12
|
enablers,
|
|
13
13
|
isEnabled,
|
|
14
14
|
config,
|
|
15
|
-
|
|
15
|
+
resolveConfig,
|
|
16
16
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { ReactCosmosConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -7,6 +7,5 @@ declare const _default: {
|
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
9
|
resolveConfig: ResolveConfig<ReactCosmosConfig>;
|
|
10
|
-
resolveEntryPaths: ResolveEntryPaths<ReactCosmosConfig>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -9,17 +9,16 @@ const ext = '{js,jsx,ts,tsx,md,mdx}';
|
|
|
9
9
|
const fixtureEntry = [`**/*.fixture.${ext}`, `__fixtures__/**/*.${ext}`, `**/fixture.${ext}`];
|
|
10
10
|
const decoratorEntry = ['**/cosmos.decorator.{jsx,tsx}'];
|
|
11
11
|
const entry = [...fixtureEntry, ...decoratorEntry];
|
|
12
|
-
const
|
|
12
|
+
const resolveConfig = async (localConfig) => {
|
|
13
13
|
const { fixturesDir, fixtureFileSuffix } = localConfig;
|
|
14
14
|
const entries = [
|
|
15
15
|
join(fixturesDir ?? '__fixtures__', `**/*.${ext}`),
|
|
16
16
|
join(fixturesDir ?? '', `**/*.${fixtureFileSuffix ?? 'fixture'}.${ext}`),
|
|
17
17
|
join(fixturesDir ?? '', `**/${fixtureFileSuffix ?? 'fixture'}.${ext}`),
|
|
18
18
|
];
|
|
19
|
-
return [...entries, ...decoratorEntry]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return (localConfig?.plugins ?? []).map(toDeferResolve);
|
|
19
|
+
return [...entries, ...decoratorEntry]
|
|
20
|
+
.map(id => toEntry(id))
|
|
21
|
+
.concat((localConfig?.plugins ?? []).map(toDeferResolve));
|
|
23
22
|
};
|
|
24
23
|
export default {
|
|
25
24
|
title,
|
|
@@ -28,5 +27,4 @@ export default {
|
|
|
28
27
|
config,
|
|
29
28
|
entry,
|
|
30
29
|
resolveConfig,
|
|
31
|
-
resolveEntryPaths,
|
|
32
30
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { PluginConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
|
|
8
|
+
resolveConfig: ResolveConfig<PluginConfig>;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -7,7 +7,7 @@ const title = 'React Router';
|
|
|
7
7
|
const enablers = ['@react-router/dev'];
|
|
8
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
9
9
|
const config = ['react-router.config.{js,ts}', ...vite.config];
|
|
10
|
-
const
|
|
10
|
+
const resolveConfig = async (localConfig, options) => {
|
|
11
11
|
const { configFileDir } = options;
|
|
12
12
|
const appDirectory = localConfig.appDirectory ?? 'app';
|
|
13
13
|
const appDir = join(configFileDir, appDirectory);
|
|
@@ -39,5 +39,5 @@ export default {
|
|
|
39
39
|
enablers,
|
|
40
40
|
isEnabled,
|
|
41
41
|
config,
|
|
42
|
-
|
|
42
|
+
resolveConfig,
|
|
43
43
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IsPluginEnabled,
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { RelayConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
|
|
8
|
+
resolveConfig: ResolveConfig<RelayConfig>;
|
|
9
9
|
args: {
|
|
10
10
|
binaries: string[];
|
|
11
11
|
args: (args: string[]) => string[];
|
|
@@ -6,7 +6,7 @@ const title = 'Relay';
|
|
|
6
6
|
const enablers = ['vite-plugin-relay', '@swc/plugin-relay', 'babel-plugin-relay'];
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['relay.config.json', 'relay.config.js'];
|
|
9
|
-
const
|
|
9
|
+
const resolveConfig = async (config) => {
|
|
10
10
|
const projects = 'projects' in config ? Object.values(config.projects) : [config];
|
|
11
11
|
return projects.map(project => {
|
|
12
12
|
const artifactDirectory = project.artifactDirectory;
|
|
@@ -26,6 +26,6 @@ export default {
|
|
|
26
26
|
enablers,
|
|
27
27
|
isEnabled,
|
|
28
28
|
config,
|
|
29
|
-
|
|
29
|
+
resolveConfig,
|
|
30
30
|
args,
|
|
31
31
|
};
|
|
@@ -5,9 +5,8 @@ const enablers = ['@rspack/core'];
|
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['rspack.config*.{js,ts,mjs,cjs}'];
|
|
7
7
|
const resolveConfig = async (localConfig, options) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
return Array.from(inputs).filter(input => !input.specifier.startsWith('builtin:'));
|
|
8
|
+
const inputs = await findWebpackDependenciesFromConfig(localConfig, options);
|
|
9
|
+
return inputs.filter(input => !input.specifier.startsWith('builtin:'));
|
|
11
10
|
};
|
|
12
11
|
export default {
|
|
13
12
|
title,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { IsPluginEnabled } from '../../types/config.js';
|
|
1
|
+
import type { IsPluginEnabled, Resolve } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
enablers: string[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
|
+
resolve: Resolve;
|
|
7
8
|
};
|
|
8
9
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
1
2
|
import { toLilconfig } from '../../util/plugin-config.js';
|
|
2
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
4
|
const title = 'size-limit';
|
|
@@ -7,9 +8,18 @@ const config = [
|
|
|
7
8
|
'package.json',
|
|
8
9
|
...toLilconfig('size-limit', { configDir: false, additionalExtensions: ['ts', 'mts', 'cts'], rcSuffix: '' }),
|
|
9
10
|
];
|
|
11
|
+
const resolve = options => {
|
|
12
|
+
const allDeps = [
|
|
13
|
+
...Object.keys(options.manifest.dependencies || {}),
|
|
14
|
+
...Object.keys(options.manifest.devDependencies || {}),
|
|
15
|
+
];
|
|
16
|
+
const sizeLimitDeps = allDeps.filter(dep => dep.startsWith('@size-limit/'));
|
|
17
|
+
return sizeLimitDeps.map(dep => toDependency(dep));
|
|
18
|
+
};
|
|
10
19
|
export default {
|
|
11
20
|
title,
|
|
12
21
|
enablers,
|
|
13
22
|
isEnabled,
|
|
14
23
|
config,
|
|
24
|
+
resolve,
|
|
15
25
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { StorybookConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -7,7 +7,6 @@ declare const _default: {
|
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
9
9
|
project: string[];
|
|
10
|
-
resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
|
|
11
10
|
resolveConfig: ResolveConfig<StorybookConfig>;
|
|
12
11
|
};
|
|
13
12
|
export default _default;
|
|
@@ -9,7 +9,7 @@ const stories = ['**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))'];
|
|
|
9
9
|
const restEntry = ['.storybook/{manager,preview}.{js,jsx,ts,tsx}'];
|
|
10
10
|
const entry = [...restEntry, ...stories];
|
|
11
11
|
const project = ['.storybook/**/*.{js,jsx,ts,tsx,mts}'];
|
|
12
|
-
const
|
|
12
|
+
const resolveConfig = async (localConfig, options) => {
|
|
13
13
|
const { cwd, configFileDir } = options;
|
|
14
14
|
const strs = typeof localConfig?.stories === 'function' ? await localConfig.stories(stories) : localConfig?.stories;
|
|
15
15
|
const relativePatterns = strs?.map(pattern => {
|
|
@@ -21,9 +21,6 @@ const resolveEntryPaths = async (localConfig, options) => {
|
|
|
21
21
|
...(options.config.entry ?? restEntry),
|
|
22
22
|
...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories),
|
|
23
23
|
];
|
|
24
|
-
return patterns.map(id => toEntry(id));
|
|
25
|
-
};
|
|
26
|
-
const resolveConfig = async (localConfig) => {
|
|
27
24
|
const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
|
|
28
25
|
const builder = localConfig?.core?.builder &&
|
|
29
26
|
(typeof localConfig.core.builder === 'string' ? localConfig.core.builder : localConfig.core.builder.name);
|
|
@@ -35,6 +32,7 @@ const resolveConfig = async (localConfig) => {
|
|
|
35
32
|
const framework = typeof localConfig.framework === 'string' ? localConfig.framework : localConfig.framework?.name;
|
|
36
33
|
const frameworks = framework ? [framework] : [];
|
|
37
34
|
return [
|
|
35
|
+
...patterns.map(id => toEntry(id)),
|
|
38
36
|
...addons.map(toDeferResolve),
|
|
39
37
|
...builderPackages.map(id => toDependency(id)),
|
|
40
38
|
...frameworks.map(id => toDependency(id)),
|
|
@@ -47,6 +45,5 @@ export default {
|
|
|
47
45
|
config,
|
|
48
46
|
entry,
|
|
49
47
|
project,
|
|
50
|
-
resolveEntryPaths,
|
|
51
48
|
resolveConfig,
|
|
52
49
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { IsPluginEnabled } from '../../types/config.js';
|
|
1
|
+
import type { IsPluginEnabled, Resolve } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
enablers: string[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
entry: string[];
|
|
7
7
|
production: string[];
|
|
8
|
+
resolve: Resolve;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { toAlias } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
1
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
import { config as viteConfig } from '../vite/index.js';
|
|
3
5
|
const title = 'Svelte';
|
|
@@ -9,10 +11,15 @@ const production = [
|
|
|
9
11
|
'src/hooks.{server,client}.{js,ts}',
|
|
10
12
|
'src/params/*.{js,ts}',
|
|
11
13
|
];
|
|
14
|
+
const resolve = options => {
|
|
15
|
+
const alias = toAlias('$app/*', [join(options.cwd, 'node_modules/@sveltejs/kit/src/runtime/app/*')]);
|
|
16
|
+
return [alias];
|
|
17
|
+
};
|
|
12
18
|
export default {
|
|
13
19
|
title,
|
|
14
20
|
enablers,
|
|
15
21
|
isEnabled,
|
|
16
22
|
entry,
|
|
17
23
|
production,
|
|
24
|
+
resolve,
|
|
18
25
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
const title = 'SVGO';
|
|
3
|
+
const enablers = ['svgo'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['svgo.config.{js,cjs,mjs}'];
|
|
6
|
+
export default {
|
|
7
|
+
title,
|
|
8
|
+
enablers,
|
|
9
|
+
isEnabled,
|
|
10
|
+
entry,
|
|
11
|
+
};
|
|
@@ -5,7 +5,6 @@ declare const _default: {
|
|
|
5
5
|
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
|
-
resolveEntryPaths: import("../../types/config.js").ResolveEntryPaths<import("../vitest/types.js").ViteConfigOrFn | import("../vitest/types.js").VitestWorkspaceConfig>;
|
|
9
8
|
resolveConfig: import("../../types/config.js").ResolveConfig<import("../vitest/types.js").ViteConfigOrFn | import("../vitest/types.js").VitestWorkspaceConfig>;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
-
import { resolveConfig
|
|
2
|
+
import { resolveConfig } from '../vitest/index.js';
|
|
3
3
|
const title = 'Vite';
|
|
4
4
|
const enablers = ['vite', 'vitest'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -9,6 +9,5 @@ export default {
|
|
|
9
9
|
enablers,
|
|
10
10
|
isEnabled,
|
|
11
11
|
config,
|
|
12
|
-
resolveEntryPaths,
|
|
13
12
|
resolveConfig,
|
|
14
13
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { ViteConfigOrFn, VitestWorkspaceConfig } from './types.js';
|
|
3
|
-
export declare const resolveEntryPaths: ResolveEntryPaths<ViteConfigOrFn | VitestWorkspaceConfig>;
|
|
4
3
|
export declare const resolveConfig: ResolveConfig<ViteConfigOrFn | VitestWorkspaceConfig>;
|
|
5
4
|
declare const _default: {
|
|
6
5
|
title: string;
|
|
@@ -8,7 +7,6 @@ declare const _default: {
|
|
|
8
7
|
isEnabled: IsPluginEnabled;
|
|
9
8
|
config: string[];
|
|
10
9
|
entry: string[];
|
|
11
|
-
resolveEntryPaths: ResolveEntryPaths<ViteConfigOrFn | VitestWorkspaceConfig>;
|
|
12
10
|
resolveConfig: ResolveConfig<ViteConfigOrFn | VitestWorkspaceConfig>;
|
|
13
11
|
args: {
|
|
14
12
|
config: boolean;
|