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,9 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { AngularCLIWorkspaceConfiguration } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
title: string;
|
|
5
|
+
enablers: string[];
|
|
6
|
+
isEnabled: IsPluginEnabled;
|
|
7
|
+
config: string[];
|
|
8
|
+
production: string[];
|
|
9
|
+
resolveConfig: ResolveConfig<AngularCLIWorkspaceConfiguration>;
|
|
8
10
|
};
|
|
9
11
|
export default _default;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { join } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
1
|
+
import { join } from '#p/util/path.js';
|
|
2
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
3
|
+
import { toProductionEntryPattern } from '#p/util/protocols.js';
|
|
4
|
+
const title = 'Angular';
|
|
5
|
+
const enablers = ['@angular/cli'];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['angular.json'];
|
|
8
|
+
const production = [];
|
|
9
|
+
const resolveConfig = async (config, options) => {
|
|
10
10
|
const { cwd } = options;
|
|
11
|
-
|
|
12
|
-
if (!localConfig?.projects)
|
|
11
|
+
if (!config?.projects)
|
|
13
12
|
return [];
|
|
14
13
|
const dependencies = new Set();
|
|
15
|
-
for (const project of Object.values(
|
|
14
|
+
for (const project of Object.values(config.projects)) {
|
|
16
15
|
if (!project.architect)
|
|
17
16
|
return [];
|
|
18
17
|
for (const target of Object.values(project.architect)) {
|
|
@@ -22,22 +21,18 @@ const findPluginDependencies = async (configFilePath, options) => {
|
|
|
22
21
|
dependencies.add(packageName);
|
|
23
22
|
if (opts) {
|
|
24
23
|
if ('main' in opts && typeof opts.main === 'string') {
|
|
25
|
-
dependencies.add(join(cwd, opts.main));
|
|
26
|
-
}
|
|
27
|
-
if ('tsConfig' in opts && typeof opts.tsConfig === 'string') {
|
|
28
|
-
const tsConfigDependencies = await findTypeScriptDependencies(join(cwd, opts.tsConfig), options);
|
|
29
|
-
tsConfigDependencies.forEach(dependency => dependencies.add(dependency));
|
|
24
|
+
dependencies.add(toProductionEntryPattern(join(cwd, opts.main)));
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
29
|
return Array.from(dependencies);
|
|
35
30
|
};
|
|
36
|
-
const findDependencies = timerify(findPluginDependencies);
|
|
37
31
|
export default {
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
title,
|
|
33
|
+
enablers,
|
|
40
34
|
isEnabled,
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
config,
|
|
36
|
+
production,
|
|
37
|
+
resolveConfig,
|
|
43
38
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, Resolve } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
readonly title: "Astro";
|
|
4
|
+
readonly enablers: string[];
|
|
5
|
+
readonly isEnabled: IsPluginEnabled;
|
|
6
|
+
readonly entry: string[];
|
|
7
|
+
readonly production: string[];
|
|
8
|
+
readonly resolve: Resolve;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const dependencies = config.entry
|
|
11
|
-
? config.entry.map(toProductionEntryPattern)
|
|
12
|
-
: [...ENTRY_FILE_PATTERNS.map(toEntryPattern), ...PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern)];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Astro';
|
|
3
|
+
const enablers = ['astro'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts'];
|
|
6
|
+
const production = ['src/pages/**/*.{astro,mdx,js,ts}', 'src/content/**/*.mdx'];
|
|
7
|
+
const resolve = options => {
|
|
8
|
+
const { isProduction, manifest } = options;
|
|
9
|
+
const dependencies = [];
|
|
13
10
|
if (!isProduction &&
|
|
14
11
|
manifest.scripts &&
|
|
15
12
|
Object.values(manifest.scripts).some(script => /(?<=^|\s)astro(\s|\s.+\s)check(?=\s|$)/.test(script))) {
|
|
@@ -18,10 +15,10 @@ const findDependencies = async (configFilePath, options) => {
|
|
|
18
15
|
return dependencies;
|
|
19
16
|
};
|
|
20
17
|
export default {
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
title,
|
|
19
|
+
enablers,
|
|
23
20
|
isEnabled,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
entry,
|
|
22
|
+
production,
|
|
23
|
+
resolve,
|
|
27
24
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
|
+
import type { AvaConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "Ava";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly entry: string[];
|
|
9
|
+
readonly resolveEntryPaths: ResolveEntryPaths<AvaConfig>;
|
|
10
|
+
readonly resolveConfig: ResolveConfig<AvaConfig>;
|
|
9
11
|
};
|
|
10
12
|
export default _default;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { timerify } from '../../util/Performance.js';
|
|
3
|
-
import { getDependenciesFromScripts, hasDependency, load } from '../../util/plugin.js';
|
|
1
|
+
import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
|
|
4
2
|
import { toEntryPattern } from '../../util/protocols.js';
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies,
|
|
8
|
-
const
|
|
9
|
-
const
|
|
3
|
+
const title = 'Ava';
|
|
4
|
+
const enablers = ['ava'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const config = ['ava.config.{js,cjs,mjs}', 'package.json'];
|
|
7
|
+
const entry = [
|
|
10
8
|
`test.{js,cjs,mjs,ts}`,
|
|
11
9
|
`{src,source}/test.{js,cjs,mjs,ts}`,
|
|
12
10
|
`**/__tests__/**/*.{js,cjs,mjs,ts}`,
|
|
@@ -18,26 +16,26 @@ const ENTRY_FILE_PATTERNS = [
|
|
|
18
16
|
'!**/__tests__/**/__{helper,fixture}?(s)__/**/*',
|
|
19
17
|
'!**/test?(s)/**/{helper,fixture}?(s)/**/*',
|
|
20
18
|
];
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const resolveEntryPaths = localConfig => {
|
|
20
|
+
if (typeof localConfig === 'function')
|
|
21
|
+
localConfig = localConfig();
|
|
22
|
+
return (localConfig?.files ?? []).map(toEntryPattern);
|
|
23
|
+
};
|
|
24
|
+
const resolveConfig = async (localConfig, options) => {
|
|
24
25
|
if (typeof localConfig === 'function')
|
|
25
26
|
localConfig = localConfig();
|
|
26
|
-
const entryPatterns = (config.entry ?? localConfig?.files ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
|
|
27
|
-
if (isProduction || !localConfig)
|
|
28
|
-
return entryPatterns;
|
|
29
27
|
const nodeArgs = localConfig.nodeArguments ?? [];
|
|
30
28
|
const requireArgs = (localConfig.require ?? []).map(require => `--require ${require}`);
|
|
31
29
|
const fakeCommand = `node ${nodeArgs.join(' ')} ${requireArgs.join(' ')}`;
|
|
32
30
|
const dependencies = getDependenciesFromScripts([fakeCommand], { ...options, knownGlobalsOnly: true });
|
|
33
|
-
return [...
|
|
31
|
+
return [...dependencies];
|
|
34
32
|
};
|
|
35
|
-
const findDependencies = timerify(findAvaDependencies);
|
|
36
33
|
export default {
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
title,
|
|
35
|
+
enablers,
|
|
39
36
|
isEnabled,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
config,
|
|
38
|
+
entry,
|
|
39
|
+
resolveEntryPaths,
|
|
40
|
+
resolveConfig,
|
|
43
41
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { BabelConfig, BabelConfigObj } from './types.js';
|
|
3
3
|
export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
|
|
4
4
|
declare const _default: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
isEnabled:
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
title: string;
|
|
6
|
+
enablers: RegExp[];
|
|
7
|
+
isEnabled: IsPluginEnabled;
|
|
8
|
+
config: string[];
|
|
9
|
+
resolveConfig: ResolveConfig<BabelConfig>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import {
|
|
3
|
-
import { timerify } from '../../util/Performance.js';
|
|
4
|
-
import { hasDependency, load } from '../../util/plugin.js';
|
|
1
|
+
import { compact } from '#p/util/array.js';
|
|
2
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
5
3
|
import { resolveName, api } from './helpers.js';
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies,
|
|
9
|
-
const
|
|
10
|
-
'babel.config.{json,js,cjs,mjs,cts}',
|
|
11
|
-
'.babelrc.{json,js,cjs,mjs,cts}',
|
|
12
|
-
'.babelrc',
|
|
13
|
-
'package.json',
|
|
14
|
-
];
|
|
4
|
+
const title = 'Babel';
|
|
5
|
+
const enablers = [/^@babel\//];
|
|
6
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
+
const config = ['babel.config.{json,js,cjs,mjs,cts}', '.babelrc.{json,js,cjs,mjs,cts}', '.babelrc', 'package.json'];
|
|
15
8
|
const getName = (value) => typeof value === 'string' ? [value] : Array.isArray(value) ? [value[0]] : [];
|
|
16
9
|
export const getDependenciesFromConfig = (config) => {
|
|
17
10
|
const presets = config.presets?.flatMap(getName).map(name => resolveName(name, 'preset')) ?? [];
|
|
@@ -19,21 +12,17 @@ export const getDependenciesFromConfig = (config) => {
|
|
|
19
12
|
const nested = config.env ? Object.values(config.env).flatMap(getDependenciesFromConfig) : [];
|
|
20
13
|
return compact([...presets, ...plugins, ...nested]);
|
|
21
14
|
};
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
15
|
+
const resolveConfig = async (config) => {
|
|
16
|
+
if (typeof config === 'function')
|
|
17
|
+
config = config(api);
|
|
18
|
+
if (!config)
|
|
24
19
|
return [];
|
|
25
|
-
|
|
26
|
-
if (typeof localConfig === 'function')
|
|
27
|
-
localConfig = localConfig(api);
|
|
28
|
-
if (!localConfig)
|
|
29
|
-
return [];
|
|
30
|
-
return getDependenciesFromConfig(localConfig);
|
|
20
|
+
return getDependenciesFromConfig(config);
|
|
31
21
|
};
|
|
32
|
-
const findDependencies = timerify(findBabelDependencies);
|
|
33
22
|
export default {
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
title,
|
|
24
|
+
enablers,
|
|
36
25
|
isEnabled,
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
config,
|
|
27
|
+
resolveConfig,
|
|
39
28
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { CapacitorConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "Capacitor";
|
|
5
|
+
readonly enablers: RegExp[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<CapacitorConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
if (isProduction)
|
|
9
|
-
return [];
|
|
10
|
-
const localConfig = await load(configFilePath);
|
|
11
|
-
if (!localConfig)
|
|
12
|
-
return [];
|
|
13
|
-
return localConfig.includePlugins ?? [];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Capacitor';
|
|
3
|
+
const enablers = [/^@capacitor\//];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['capacitor.config.{json,ts}'];
|
|
6
|
+
const resolveConfig = config => {
|
|
7
|
+
return config.includePlugins ?? [];
|
|
14
8
|
};
|
|
15
|
-
const findDependencies = timerify(findCapacitorDependencies);
|
|
16
9
|
export default {
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
title,
|
|
11
|
+
enablers,
|
|
19
12
|
isEnabled,
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
config,
|
|
14
|
+
resolveConfig,
|
|
22
15
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { ChangesetsConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "Changesets";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<ChangesetsConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!localConfig)
|
|
12
|
-
return [];
|
|
13
|
-
return Array.isArray(localConfig.changelog)
|
|
14
|
-
? [localConfig.changelog[0]]
|
|
15
|
-
: typeof localConfig.changelog === 'string'
|
|
16
|
-
? [localConfig.changelog]
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Changesets';
|
|
3
|
+
const enablers = ['@changesets/cli'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = ['.changeset/config.json'];
|
|
6
|
+
const resolveConfig = config => {
|
|
7
|
+
return Array.isArray(config.changelog)
|
|
8
|
+
? [config.changelog[0]]
|
|
9
|
+
: typeof config.changelog === 'string'
|
|
10
|
+
? [config.changelog]
|
|
17
11
|
: [];
|
|
18
12
|
};
|
|
19
|
-
const findDependencies = timerify(findChangesetsDependencies);
|
|
20
13
|
export default {
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
title,
|
|
15
|
+
enablers,
|
|
23
16
|
isEnabled,
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
config,
|
|
18
|
+
resolveConfig,
|
|
26
19
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
|
|
2
|
+
import type { CommitizenConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
readonly title: "Commitizen";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly packageJsonPath: "config.commitizen";
|
|
8
|
+
readonly config: string[];
|
|
9
|
+
readonly resolveConfig: ResolveConfig<CommitizenConfig>;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const findPluginDependencies = async (configFilePath, { manifest, isProduction }) => {
|
|
10
|
-
if (isProduction)
|
|
11
|
-
return [];
|
|
12
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest.config?.commitizen : await load(configFilePath);
|
|
13
|
-
if (!localConfig)
|
|
14
|
-
return [];
|
|
15
|
-
return localConfig.path ? [localConfig.path] : [];
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'Commitizen';
|
|
3
|
+
const enablers = ['commitizen'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const packageJsonPath = 'config.commitizen';
|
|
6
|
+
const config = ['.czrc', '.cz.json', 'package.json'];
|
|
7
|
+
const resolveConfig = config => {
|
|
8
|
+
return config.path ? [config.path] : [];
|
|
16
9
|
};
|
|
17
|
-
const findDependencies = timerify(findPluginDependencies);
|
|
18
10
|
export default {
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
title,
|
|
12
|
+
enablers,
|
|
21
13
|
isEnabled,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
packageJsonPath,
|
|
15
|
+
config,
|
|
16
|
+
resolveConfig,
|
|
25
17
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
type CommitLintConfig = {
|
|
3
|
+
extends: string[];
|
|
4
|
+
};
|
|
2
5
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
readonly title: "commitlint";
|
|
7
|
+
readonly enablers: string[];
|
|
8
|
+
readonly isEnabled: IsPluginEnabled;
|
|
9
|
+
readonly config: string[];
|
|
10
|
+
readonly resolveConfig: ResolveConfig<CommitLintConfig>;
|
|
8
11
|
};
|
|
9
12
|
export default _default;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
7
|
-
const CONFIG_FILE_PATTERNS = [
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'commitlint';
|
|
3
|
+
const enablers = ['@commitlint/cli'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = [
|
|
8
6
|
'.commitlintrc',
|
|
9
7
|
'.commitlintrc.{json,yaml,yml,js,cjs,ts,cts}',
|
|
10
8
|
'commitlint.config.{js,cjs,ts,cts}',
|
|
11
9
|
'package.json',
|
|
12
10
|
];
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
return [];
|
|
16
|
-
const localConfig = basename(configFilePath) === 'package.json' ? manifest.commitlint : await load(configFilePath);
|
|
17
|
-
if (!localConfig)
|
|
18
|
-
return [];
|
|
19
|
-
return localConfig.extends ? [localConfig.extends].flat() : [];
|
|
11
|
+
const resolveConfig = config => {
|
|
12
|
+
return config.extends ? [config.extends].flat() : [];
|
|
20
13
|
};
|
|
21
|
-
const findDependencies = timerify(findCommitLintDependencies);
|
|
22
14
|
export default {
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
title,
|
|
16
|
+
enablers,
|
|
25
17
|
isEnabled,
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
config,
|
|
19
|
+
resolveConfig,
|
|
28
20
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
|
|
2
|
+
import type { CSpellConfig } from './types.js';
|
|
2
3
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly title: "CSpell";
|
|
5
|
+
readonly enablers: string[];
|
|
6
|
+
readonly isEnabled: IsPluginEnabled;
|
|
7
|
+
readonly config: string[];
|
|
8
|
+
readonly resolveConfig: ResolveConfig<CSpellConfig>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const CONFIG_FILE_PATTERNS = [
|
|
1
|
+
import { hasDependency } from '#p/util/plugin.js';
|
|
2
|
+
const title = 'CSpell';
|
|
3
|
+
const enablers = ['cspell'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const config = [
|
|
7
6
|
'cspell.config.{js,cjs,json,yaml,yml}',
|
|
8
7
|
'cspell.{json,yaml,yml}',
|
|
9
8
|
'.c{s,S}pell.json',
|
|
10
|
-
'
|
|
9
|
+
'c{s,S}pell.json',
|
|
11
10
|
];
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
return [];
|
|
15
|
-
const localConfig = await load(configFilePath);
|
|
16
|
-
if (!localConfig)
|
|
17
|
-
return [];
|
|
18
|
-
const imports = localConfig.import ?? [];
|
|
19
|
-
return imports;
|
|
11
|
+
const resolveConfig = config => {
|
|
12
|
+
return config.import ?? [];
|
|
20
13
|
};
|
|
21
|
-
const findDependencies = timerify(findCspellDependencies);
|
|
22
14
|
export default {
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
title,
|
|
16
|
+
enablers,
|
|
25
17
|
isEnabled,
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
config,
|
|
19
|
+
resolveConfig,
|
|
28
20
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IsPluginEnabled, ResolveEntryPaths } from '#p/types/plugins.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isEnabled:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: string[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
config: string[];
|
|
7
|
+
entry: string[];
|
|
8
|
+
resolveEntryPaths: ResolveEntryPaths;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|