knip 5.1.2 → 5.1.3
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 +3 -3
- package/dist/ConfigurationValidator.d.ts +21 -21
- package/dist/ProjectPrincipal.d.ts +1 -1
- package/dist/ProjectPrincipal.js +3 -5
- package/dist/WorkspaceWorker.d.ts +2 -2
- package/dist/WorkspaceWorker.js +61 -44
- package/dist/binaries/index.js +2 -2
- package/dist/binaries/resolvers/index.d.ts +12 -12
- package/dist/compilers/index.d.ts +6 -7
- package/dist/compilers/index.js +0 -3
- package/dist/constants.d.ts +1 -2
- package/dist/constants.js +8 -4
- package/dist/plugins/_template/index.d.ts +10 -9
- package/dist/plugins/_template/index.js +16 -30
- package/dist/plugins/angular/index.d.ts +8 -6
- package/dist/plugins/angular/index.js +17 -22
- package/dist/plugins/astro/index.d.ts +7 -7
- package/dist/plugins/astro/index.js +14 -17
- package/dist/plugins/ava/index.d.ts +9 -7
- package/dist/plugins/ava/index.js +19 -21
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.d.ts +7 -7
- package/dist/plugins/babel/index.js +15 -26
- package/dist/plugins/capacitor/index.d.ts +7 -6
- package/dist/plugins/capacitor/index.js +11 -18
- package/dist/plugins/changesets/index.d.ts +7 -6
- package/dist/plugins/changesets/index.js +14 -21
- package/dist/plugins/changesets/types.d.ts +3 -0
- package/dist/plugins/changesets/types.js +1 -0
- package/dist/plugins/commitizen/index.d.ts +8 -7
- package/dist/plugins/commitizen/index.js +13 -21
- package/dist/plugins/commitlint/index.d.ts +9 -6
- package/dist/plugins/commitlint/index.js +11 -19
- package/dist/plugins/cspell/index.d.ts +7 -6
- package/dist/plugins/cspell/index.js +12 -20
- package/dist/plugins/cypress/index.d.ts +7 -7
- package/dist/plugins/cypress/index.js +13 -21
- package/dist/plugins/drizzle/index.d.ts +7 -6
- package/dist/plugins/drizzle/index.js +13 -16
- package/dist/plugins/eleventy/index.d.ts +11 -9
- package/dist/plugins/eleventy/index.js +35 -41
- package/dist/plugins/eslint/helpers.d.ts +3 -5
- package/dist/plugins/eslint/helpers.js +10 -15
- package/dist/plugins/eslint/index.d.ts +10 -8
- package/dist/plugins/eslint/index.js +15 -29
- package/dist/plugins/gatsby/index.d.ts +8 -7
- package/dist/plugins/gatsby/index.js +15 -22
- package/dist/plugins/github-actions/index.d.ts +6 -6
- package/dist/plugins/github-actions/index.js +15 -25
- package/dist/plugins/graphql-codegen/index.d.ts +8 -7
- package/dist/plugins/graphql-codegen/index.js +15 -23
- package/dist/plugins/husky/index.d.ts +6 -6
- package/dist/plugins/husky/index.js +10 -16
- package/dist/plugins/jest/index.d.ts +9 -7
- package/dist/plugins/jest/index.js +50 -31
- package/dist/plugins/lefthook/index.d.ts +6 -6
- package/dist/plugins/lefthook/index.js +19 -24
- package/dist/plugins/lint-staged/index.d.ts +8 -7
- package/dist/plugins/lint-staged/index.js +16 -23
- package/dist/plugins/linthtml/index.d.ts +8 -7
- package/dist/plugins/linthtml/index.js +16 -24
- package/dist/plugins/markdownlint/index.d.ts +7 -6
- package/dist/plugins/markdownlint/index.js +12 -17
- package/dist/plugins/mocha/index.d.ts +9 -7
- package/dist/plugins/mocha/index.js +19 -22
- package/dist/plugins/msw/index.d.ts +8 -7
- package/dist/plugins/msw/index.js +12 -15
- package/dist/plugins/netlify/index.d.ts +9 -7
- package/dist/plugins/netlify/index.js +23 -27
- package/dist/plugins/next/index.d.ts +6 -7
- package/dist/plugins/next/index.js +10 -18
- package/dist/plugins/node-test-runner/index.d.ts +5 -6
- package/dist/plugins/node-test-runner/index.js +6 -18
- package/dist/plugins/npm-package-json-lint/index.d.ts +8 -7
- package/dist/plugins/npm-package-json-lint/index.js +12 -19
- package/dist/plugins/nx/index.d.ts +7 -6
- package/dist/plugins/nx/index.js +18 -27
- package/dist/plugins/nyc/index.d.ts +7 -6
- package/dist/plugins/nyc/index.js +11 -17
- package/dist/plugins/playwright/index.d.ts +11 -13
- package/dist/plugins/playwright/index.js +23 -30
- package/dist/plugins/playwright-ct/index.d.ts +8 -7
- package/dist/plugins/playwright-ct/index.js +12 -24
- package/dist/plugins/postcss/index.d.ts +7 -6
- package/dist/plugins/postcss/index.js +12 -21
- package/dist/plugins/prettier/index.d.ts +7 -6
- package/dist/plugins/prettier/index.js +14 -20
- package/dist/plugins/release-it/index.d.ts +8 -7
- package/dist/plugins/release-it/index.js +18 -27
- package/dist/plugins/remark/index.d.ts +8 -7
- package/dist/plugins/remark/index.js +13 -28
- package/dist/plugins/remix/index.d.ts +6 -7
- package/dist/plugins/remix/index.js +10 -20
- package/dist/plugins/rollup/index.d.ts +5 -6
- package/dist/plugins/rollup/index.js +8 -16
- package/dist/plugins/semantic-release/index.d.ts +8 -7
- package/dist/plugins/semantic-release/index.js +13 -25
- package/dist/plugins/sentry/index.d.ts +5 -6
- package/dist/plugins/sentry/index.js +8 -16
- package/dist/plugins/storybook/index.d.ts +10 -8
- package/dist/plugins/storybook/index.js +28 -35
- package/dist/plugins/stryker/index.d.ts +7 -6
- package/dist/plugins/stryker/index.js +10 -18
- package/dist/plugins/stylelint/index.d.ts +7 -6
- package/dist/plugins/stylelint/index.js +13 -23
- package/dist/plugins/svelte/index.d.ts +7 -8
- package/dist/plugins/svelte/index.js +13 -23
- package/dist/plugins/tailwind/index.d.ts +5 -6
- package/dist/plugins/tailwind/index.js +8 -14
- package/dist/plugins/tsup/index.d.ts +7 -6
- package/dist/plugins/tsup/index.js +14 -21
- package/dist/plugins/typedoc/index.d.ts +10 -7
- package/dist/plugins/typedoc/index.js +14 -24
- package/dist/plugins/typescript/index.d.ts +8 -7
- package/dist/plugins/typescript/index.js +31 -25
- package/dist/plugins/unbuild/index.d.ts +7 -6
- package/dist/plugins/unbuild/index.js +12 -17
- package/dist/plugins/vercel-og/index.d.ts +5 -6
- package/dist/plugins/vercel-og/index.js +8 -16
- package/dist/plugins/vite/index.d.ts +9 -7
- package/dist/plugins/vite/index.js +13 -18
- package/dist/plugins/vitest/index.d.ts +11 -9
- package/dist/plugins/vitest/index.js +62 -49
- package/dist/plugins/vue/index.d.ts +7 -6
- package/dist/plugins/vue/index.js +14 -26
- package/dist/plugins/webpack/index.d.ts +7 -6
- package/dist/plugins/webpack/index.js +17 -20
- package/dist/plugins/wireit/index.d.ts +8 -7
- package/dist/plugins/wireit/index.js +12 -20
- package/dist/plugins/yorkie/index.d.ts +8 -7
- package/dist/plugins/yorkie/index.js +13 -21
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +14 -0
- package/dist/reporters/index.d.ts +5 -5
- package/dist/types/config.d.ts +1 -1
- package/dist/types/package-json.d.ts +12 -13
- package/dist/types/plugins.d.ts +20 -14
- package/dist/types/util.d.ts +0 -13
- package/dist/typescript/SourceFileManager.js +3 -0
- package/dist/typescript/createHosts.js +4 -3
- package/dist/typescript/resolveModuleNames.js +26 -41
- package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/propertyAccessCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
- package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
- package/dist/typescript/visitors/scripts/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
- package/dist/util/Performance.d.ts +1 -4
- package/dist/util/Performance.js +5 -1
- package/dist/util/fs.js +0 -3
- package/dist/util/loader.d.ts +0 -2
- package/dist/util/loader.js +8 -16
- package/dist/util/object.d.ts +1 -1
- package/dist/util/path.d.ts +0 -3
- package/dist/util/path.js +0 -1
- package/dist/util/plugin.d.ts +4 -1
- package/dist/util/plugin.js +28 -1
- package/dist/util/require.d.ts +1 -0
- package/dist/util/require.js +13 -0
- package/dist/util/tsconfig-loader.js +1 -2
- package/dist/util/type.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
- package/dist/plugins/eslint/fallback.d.ts +0 -1
- package/dist/plugins/eslint/fallback.js +0 -18
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: string[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
entry: string[];
|
|
7
|
+
production: string[];
|
|
9
8
|
};
|
|
10
9
|
export default _default;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const ENTRY_FILE_PATTERNS = ['next.config.{js,ts,cjs,mjs}'];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Next.js';
|
|
3
|
+
const enablers = ['next'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['next.config.{js,ts,cjs,mjs}'];
|
|
7
6
|
const productionEntryFilePatternsWithoutSrc = [
|
|
8
7
|
'{instrumentation,middleware}.{js,ts}',
|
|
9
8
|
'app/global-error.{js,jsx,ts,tsx}',
|
|
@@ -14,21 +13,14 @@ const productionEntryFilePatternsWithoutSrc = [
|
|
|
14
13
|
'app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}',
|
|
15
14
|
'pages/**/*.{js,jsx,ts,tsx}',
|
|
16
15
|
];
|
|
17
|
-
const
|
|
16
|
+
const production = [
|
|
18
17
|
...productionEntryFilePatternsWithoutSrc,
|
|
19
18
|
...productionEntryFilePatternsWithoutSrc.map(pattern => `src/${pattern}`),
|
|
20
19
|
];
|
|
21
|
-
const findDependencies = async (configFilePath, options) => {
|
|
22
|
-
const { config } = options;
|
|
23
|
-
return config.entry
|
|
24
|
-
? config.entry.map(toProductionEntryPattern)
|
|
25
|
-
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
26
|
-
};
|
|
27
20
|
export default {
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
title,
|
|
22
|
+
enablers,
|
|
30
23
|
isEnabled,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
findDependencies,
|
|
24
|
+
entry,
|
|
25
|
+
production,
|
|
34
26
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
findDependencies: GenericPluginCallback;
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: string;
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
entry: string[];
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const NAME = 'Node.js Test Runner';
|
|
4
|
-
const ENABLERS = 'This plugin is enabled when any script in `package.json` includes `node --test`';
|
|
1
|
+
const title = 'Node.js Test Runner';
|
|
2
|
+
const enablers = 'This plugin is enabled when any script in `package.json` includes `node --test`';
|
|
5
3
|
const isEnabled = ({ manifest }) => Object.keys(manifest.scripts ?? {}).some(script => manifest.scripts && /(?<=^|\s)node (.*)--test/.test(manifest.scripts[script]));
|
|
6
|
-
const
|
|
7
|
-
'**/*{.,-,_}test.?(c|m)js',
|
|
8
|
-
'**/test-*.?(c|m)js',
|
|
9
|
-
'**/test.?(c|m)js',
|
|
10
|
-
'**/test/**/*.?(c|m)js',
|
|
11
|
-
];
|
|
12
|
-
const findNodeTestRunnerDependencies = async (configFilePath, options) => {
|
|
13
|
-
return (options.config?.entry ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
14
|
-
};
|
|
15
|
-
const findDependencies = timerify(findNodeTestRunnerDependencies);
|
|
4
|
+
const entry = ['**/*{.,-,_}test.?(c|m)js', '**/test-*.?(c|m)js', '**/test.?(c|m)js', '**/test/**/*.?(c|m)js'];
|
|
16
5
|
export default {
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
title,
|
|
7
|
+
enablers,
|
|
19
8
|
isEnabled,
|
|
20
|
-
|
|
21
|
-
findDependencies,
|
|
9
|
+
entry,
|
|
22
10
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { NpmPkgJsonLintConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "npm-package-json-lint";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly packageJsonPath: "npmpackagejsonlint";
|
|
8
|
+
readonly config: string[];
|
|
9
|
+
readonly resolveConfig: ResolveConfig<NpmPkgJsonLintConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const CONFIG_FILE_PATTERNS = ['.npmpackagejsonlintrc.json', 'npmpackagejsonlint.config.js', 'package.json'];
|
|
9
|
-
const findNpmPkgJsonLintConfigDependencies = async (configFilePath, options) => {
|
|
10
|
-
const { manifest, isProduction } = options;
|
|
11
|
-
if (isProduction)
|
|
12
|
-
return [];
|
|
13
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest[PACKAGE_JSON_PATH] : await load(configFilePath);
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'npm-package-json-lint';
|
|
3
|
+
const enablers = ['npm-package-json-lint'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const packageJsonPath = 'npmpackagejsonlint';
|
|
6
|
+
const config = ['.npmpackagejsonlintrc.json', 'npmpackagejsonlint.config.js', 'package.json'];
|
|
7
|
+
const resolveConfig = localConfig => {
|
|
14
8
|
return localConfig?.extends ? [localConfig.extends] : [];
|
|
15
9
|
};
|
|
16
|
-
const findDependencies = timerify(findNpmPkgJsonLintConfigDependencies);
|
|
17
10
|
export default {
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
title,
|
|
12
|
+
enablers,
|
|
20
13
|
isEnabled,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
packageJsonPath,
|
|
15
|
+
config,
|
|
16
|
+
resolveConfig,
|
|
24
17
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { NxConfigRoot, NxProjectConfiguration } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
title: string;
|
|
5
|
+
enablers: (string | RegExp)[];
|
|
6
|
+
isEnabled: IsPluginEnabled;
|
|
7
|
+
config: string[];
|
|
8
|
+
resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
package/dist/plugins/nx/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import { getPackageNameFromModuleSpecifier } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const findNxDependenciesInNxJson = async (configFilePath) => {
|
|
10
|
-
const localConfig = await load(configFilePath);
|
|
11
|
-
if (!localConfig)
|
|
12
|
-
return [];
|
|
1
|
+
import { compact } from '#p/util/array.js';
|
|
2
|
+
import { getPackageNameFromModuleSpecifier } from '#p/util/modules.js';
|
|
3
|
+
import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
|
|
4
|
+
const title = 'Nx';
|
|
5
|
+
const enablers = ['nx', /^@nrwl\//, /^@nx\//];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['nx.json', 'project.json', '{apps,libs}/**/project.json'];
|
|
8
|
+
const findNxDependenciesInNxJson = async (localConfig) => {
|
|
13
9
|
const targetsDefault = localConfig.targetDefaults
|
|
14
10
|
? Object.keys(localConfig.targetDefaults)
|
|
15
11
|
.filter(it => it.includes(':') && it.startsWith('@'))
|
|
@@ -28,17 +24,13 @@ const findNxDependenciesInNxJson = async (configFilePath) => {
|
|
|
28
24
|
: [];
|
|
29
25
|
return compact([...targetsDefault, ...plugins, ...generators]);
|
|
30
26
|
};
|
|
31
|
-
const
|
|
32
|
-
const {
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
35
|
-
if (configFilePath.endsWith('nx.json')) {
|
|
36
|
-
return findNxDependenciesInNxJson(configFilePath, options);
|
|
27
|
+
const resolveConfig = async (localConfig, options) => {
|
|
28
|
+
const { configFileName } = options;
|
|
29
|
+
if (configFileName === 'nx.json') {
|
|
30
|
+
return findNxDependenciesInNxJson(localConfig, options);
|
|
37
31
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
return [];
|
|
41
|
-
const targets = localConfig.targets ? Object.values(localConfig.targets) : [];
|
|
32
|
+
const config = localConfig;
|
|
33
|
+
const targets = config.targets ? Object.values(config.targets) : [];
|
|
42
34
|
const executors = targets
|
|
43
35
|
.map(target => target?.executor)
|
|
44
36
|
.filter(executor => executor && !executor.startsWith('.'))
|
|
@@ -49,11 +41,10 @@ const findNxDependencies = async (configFilePath, options) => {
|
|
|
49
41
|
const dependencies = getDependenciesFromScripts(scripts, options);
|
|
50
42
|
return compact([...executors, ...dependencies]);
|
|
51
43
|
};
|
|
52
|
-
const findDependencies = timerify(findNxDependencies);
|
|
53
44
|
export default {
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
title,
|
|
46
|
+
enablers,
|
|
56
47
|
isEnabled,
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
config,
|
|
49
|
+
resolveConfig,
|
|
59
50
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { NycConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "nyc";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<NycConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const { isProduction } = options;
|
|
9
|
-
if (isProduction)
|
|
10
|
-
return [];
|
|
11
|
-
const localConfig = await load(configFilePath);
|
|
12
|
-
return localConfig?.extends ? [localConfig.extends].flat() : [];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'nyc';
|
|
3
|
+
const enablers = ['nyc'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['.nycrc', '.nycrc.json', '.nycrc.{yml,yaml}', 'nyc.config.js'];
|
|
6
|
+
const resolveConfig = config => {
|
|
7
|
+
return config?.extends ? [config.extends].flat() : [];
|
|
13
8
|
};
|
|
14
|
-
const findDependencies = timerify(findNycDependencies);
|
|
15
9
|
export default {
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
title,
|
|
11
|
+
enablers,
|
|
18
12
|
isEnabled,
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
config,
|
|
14
|
+
resolveConfig,
|
|
21
15
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveEntryPaths, ResolveConfig } from '#p/types/plugins.js';
|
|
2
2
|
import type { PlaywrightTestConfig } from 'playwright/test';
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
configFilePath: string;
|
|
7
|
-
defaultPatterns: string[];
|
|
8
|
-
}) => string[];
|
|
3
|
+
export declare const entry: string[];
|
|
4
|
+
export declare const resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
5
|
+
export declare const resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
9
6
|
declare const _default: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isEnabled:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
title: string;
|
|
8
|
+
enablers: string[];
|
|
9
|
+
isEnabled: IsPluginEnabled;
|
|
10
|
+
config: string[];
|
|
11
|
+
entry: string[];
|
|
12
|
+
resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
13
|
+
resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
16
14
|
};
|
|
17
15
|
export default _default;
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const toEntryPatterns = (testMatch, cwd, configFilePath, config) => {
|
|
1
|
+
import { join, relative } from '#p/util/path.js';
|
|
2
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
3
|
+
import { toEntryPattern } from '#p/util/protocols.js';
|
|
4
|
+
const title = 'Playwright';
|
|
5
|
+
const enablers = ['@playwright/test'];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['playwright.config.{js,ts}'];
|
|
8
|
+
export const entry = ['**/*.@(spec|test).?(c|m)[jt]s?(x)'];
|
|
9
|
+
const toEntryPatterns = (testMatch, cwd, configDir, localConfig) => {
|
|
11
10
|
if (!testMatch)
|
|
12
11
|
return [];
|
|
13
|
-
const dir = relative(cwd,
|
|
12
|
+
const dir = relative(cwd, localConfig.testDir ? join(configDir, localConfig.testDir) : configDir);
|
|
14
13
|
const patterns = [testMatch].flat().filter((p) => typeof p === 'string');
|
|
15
14
|
return patterns.map(pattern => toEntryPattern(join(dir, pattern)));
|
|
16
15
|
};
|
|
17
16
|
const builtinReporters = ['dot', 'line', 'list', 'junit', 'html', 'blob', 'json', 'github'];
|
|
18
|
-
export const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
17
|
+
export const resolveEntryPaths = async (localConfig, options) => {
|
|
18
|
+
const { cwd, configFileDir } = options;
|
|
19
|
+
const projects = localConfig.projects ? [localConfig, ...localConfig.projects] : [localConfig];
|
|
20
|
+
return projects.flatMap(config => toEntryPatterns(config.testMatch, cwd, configFileDir, config));
|
|
21
|
+
};
|
|
22
|
+
export const resolveConfig = async (config) => {
|
|
21
23
|
const reporters = [config.reporter].flat().flatMap(reporter => {
|
|
22
24
|
const name = typeof reporter === 'string' ? reporter : reporter?.[0];
|
|
23
25
|
if (!name || builtinReporters.includes(name))
|
|
24
26
|
return [];
|
|
25
27
|
return [name];
|
|
26
28
|
});
|
|
27
|
-
return [...
|
|
28
|
-
};
|
|
29
|
-
const findPlaywrightDependencies = async (configFilePath, options) => {
|
|
30
|
-
const { cwd, config } = options;
|
|
31
|
-
const localConfig = await load(configFilePath);
|
|
32
|
-
const defaultPatterns = (config?.entry ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
33
|
-
if (localConfig) {
|
|
34
|
-
return findPlaywrightDependenciesFromConfig({ cwd, configFilePath, config: localConfig, defaultPatterns });
|
|
35
|
-
}
|
|
36
|
-
return defaultPatterns;
|
|
29
|
+
return [...reporters];
|
|
37
30
|
};
|
|
38
|
-
const findDependencies = timerify(findPlaywrightDependencies);
|
|
39
31
|
export default {
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
title,
|
|
33
|
+
enablers,
|
|
42
34
|
isEnabled,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
config,
|
|
36
|
+
entry,
|
|
37
|
+
resolveConfig,
|
|
38
|
+
resolveEntryPaths,
|
|
46
39
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: RegExp[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
config: string[];
|
|
7
|
+
entry: string[];
|
|
8
|
+
resolveEntryPaths: import("#p/types/plugins.js").ResolveEntryPaths<import("playwright/test").PlaywrightTestConfig>;
|
|
9
|
+
resolveConfig: import("#p/types/plugins.js").ResolveConfig<import("playwright/test").PlaywrightTestConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
8
|
-
const CONFIG_FILE_PATTERNS = ['playwright-ct.config.{js,ts}', 'playwright/index.{js,ts,jsx,tsx}'];
|
|
9
|
-
const ENTRY_FILE_PATTERNS = ['**/*.@(spec|test).?(c|m)[jt]s?(x)'];
|
|
10
|
-
const findPlaywrightCTDependencies = async (configFilePath, options) => {
|
|
11
|
-
const { cwd, config } = options;
|
|
12
|
-
const localConfig = await load(configFilePath);
|
|
13
|
-
const defaultPatterns = (config?.entry ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
14
|
-
if (localConfig) {
|
|
15
|
-
return findPlaywrightDependenciesFromConfig({ config: localConfig, cwd, configFilePath, defaultPatterns });
|
|
16
|
-
}
|
|
17
|
-
return defaultPatterns;
|
|
18
|
-
};
|
|
19
|
-
const findDependencies = timerify(findPlaywrightCTDependencies);
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
import { resolveConfig, entry, resolveEntryPaths } from '../playwright/index.js';
|
|
3
|
+
const title = 'Playwright for components';
|
|
4
|
+
const enablers = [/^@playwright\/experimental-ct-/];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const config = ['playwright-ct.config.{js,ts}', 'playwright/index.{js,ts,jsx,tsx}'];
|
|
20
7
|
export default {
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
title,
|
|
9
|
+
enablers,
|
|
23
10
|
isEnabled,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
config,
|
|
12
|
+
entry,
|
|
13
|
+
resolveEntryPaths,
|
|
14
|
+
resolveConfig,
|
|
27
15
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { PostCSSConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "PostCSS";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<PostCSSConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { manifest, isProduction } = options;
|
|
10
|
-
if (isProduction)
|
|
11
|
-
return [];
|
|
12
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest?.postcss : await load(configFilePath);
|
|
13
|
-
if (!localConfig)
|
|
14
|
-
return [];
|
|
15
|
-
return localConfig.plugins
|
|
16
|
-
? (Array.isArray(localConfig.plugins) ? localConfig.plugins : Object.keys(localConfig.plugins)).flatMap(plugin => {
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'PostCSS';
|
|
3
|
+
const enablers = ['postcss', 'postcss-cli', 'next'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['postcss.config.{cjs,js}', 'postcss.config.json', 'package.json'];
|
|
6
|
+
const resolveConfig = config => {
|
|
7
|
+
return config.plugins
|
|
8
|
+
? (Array.isArray(config.plugins) ? config.plugins : Object.keys(config.plugins)).flatMap(plugin => {
|
|
17
9
|
if (typeof plugin === 'string')
|
|
18
10
|
return plugin;
|
|
19
11
|
if (Array.isArray(plugin) && typeof plugin[0] === 'string')
|
|
@@ -22,11 +14,10 @@ const findPostCSSDependencies = async (configFilePath, options) => {
|
|
|
22
14
|
})
|
|
23
15
|
: [];
|
|
24
16
|
};
|
|
25
|
-
const findDependencies = timerify(findPostCSSDependencies);
|
|
26
17
|
export default {
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
title,
|
|
19
|
+
enablers,
|
|
29
20
|
isEnabled,
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
config,
|
|
22
|
+
resolveConfig,
|
|
32
23
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { PrettierConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "Prettier";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<PrettierConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, ENABLERS) || 'prettier' in config;
|
|
7
|
-
const CONFIG_FILE_PATTERNS = [
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Prettier';
|
|
3
|
+
const enablers = ['prettier'];
|
|
4
|
+
const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'prettier' in config;
|
|
5
|
+
const config = [
|
|
8
6
|
'.prettierrc',
|
|
9
7
|
'.prettierrc.{json,js,cjs,mjs,yml,yaml}',
|
|
10
8
|
'prettier.config.{js,cjs,mjs}',
|
|
11
9
|
'package.json',
|
|
12
10
|
];
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return [];
|
|
16
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest.prettier : await load(configFilePath);
|
|
17
|
-
if (typeof localConfig === 'string') {
|
|
18
|
-
return [localConfig];
|
|
11
|
+
const resolveConfig = config => {
|
|
12
|
+
if (typeof config === 'string') {
|
|
13
|
+
return [config];
|
|
19
14
|
}
|
|
20
|
-
return
|
|
21
|
-
?
|
|
15
|
+
return Array.isArray(config.plugins)
|
|
16
|
+
? config.plugins.filter((plugin) => typeof plugin === 'string')
|
|
22
17
|
: [];
|
|
23
18
|
};
|
|
24
|
-
const findDependencies = timerify(findPrettierDependencies);
|
|
25
19
|
export default {
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
title,
|
|
21
|
+
enablers,
|
|
28
22
|
isEnabled,
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
config,
|
|
24
|
+
resolveConfig,
|
|
31
25
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { ReleaseItConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "Release It";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly packageJsonPath: "release-it";
|
|
8
|
+
readonly config: string[];
|
|
9
|
+
readonly resolveConfig: ResolveConfig<ReleaseItConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|