knip 5.33.3 → 5.34.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 +27 -27
- package/dist/ConfigurationChief.js +20 -36
- package/dist/ConfigurationValidator.d.ts +392 -0
- package/dist/ConfigurationValidator.js +7 -0
- package/dist/DependencyDeputy.js +5 -2
- package/dist/PrincipalFactory.d.ts +3 -20
- package/dist/PrincipalFactory.js +4 -4
- package/dist/ProjectPrincipal.d.ts +2 -5
- package/dist/ProjectPrincipal.js +0 -5
- package/dist/WorkspaceWorker.d.ts +15 -13
- package/dist/WorkspaceWorker.js +144 -105
- package/dist/binaries/bash-parser.d.ts +3 -2
- package/dist/binaries/bash-parser.js +33 -22
- package/dist/binaries/fallback.d.ts +2 -0
- package/dist/binaries/fallback.js +12 -0
- package/dist/binaries/index.d.ts +2 -2
- package/dist/binaries/index.js +15 -26
- package/dist/binaries/package-manager/bun.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/bun.js +6 -4
- package/dist/binaries/package-manager/index.d.ts +8 -0
- package/dist/binaries/package-manager/index.js +12 -0
- package/dist/binaries/{resolvers → package-manager}/node.d.ts +0 -2
- package/dist/binaries/package-manager/node.js +5 -0
- package/dist/binaries/package-manager/npm.d.ts +2 -0
- package/dist/binaries/package-manager/npm.js +8 -0
- package/dist/binaries/package-manager/npx.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/npx.js +6 -6
- package/dist/binaries/package-manager/pnpm.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/pnpm.js +6 -3
- package/dist/binaries/package-manager/yarn.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/yarn.js +9 -7
- package/dist/binaries/plugins.d.ts +2 -0
- package/dist/binaries/plugins.js +61 -0
- package/dist/binaries/util.d.ts +0 -2
- package/dist/binaries/util.js +0 -25
- package/dist/compilers/index.d.ts +70 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/index.js +74 -46
- package/dist/manifest/helpers.d.ts +1 -5
- package/dist/manifest/helpers.js +8 -7
- package/dist/plugins/_template/index.d.ts +2 -2
- package/dist/plugins/_template/index.js +4 -3
- package/dist/plugins/angular/index.d.ts +1 -1
- package/dist/plugins/angular/index.js +13 -10
- package/dist/plugins/astro/index.d.ts +1 -1
- package/dist/plugins/astro/index.js +6 -5
- package/dist/plugins/ava/index.d.ts +1 -1
- package/dist/plugins/ava/index.js +4 -5
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.d.ts +3 -2
- package/dist/plugins/babel/index.js +4 -3
- package/dist/plugins/c8/index.d.ts +10 -0
- package/dist/plugins/c8/index.js +11 -0
- package/dist/plugins/capacitor/index.d.ts +1 -1
- package/dist/plugins/capacitor/index.js +5 -4
- package/dist/plugins/changesets/index.d.ts +1 -1
- package/dist/plugins/changesets/index.js +4 -3
- package/dist/plugins/commitizen/index.d.ts +1 -1
- package/dist/plugins/commitizen/index.js +3 -2
- package/dist/plugins/commitlint/index.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +4 -2
- package/dist/plugins/cspell/index.d.ts +1 -1
- package/dist/plugins/cspell/index.js +3 -2
- package/dist/plugins/cucumber/index.d.ts +2 -2
- package/dist/plugins/cucumber/index.js +4 -4
- package/dist/plugins/cypress/helpers.d.ts +1 -1
- package/dist/plugins/cypress/helpers.js +3 -4
- package/dist/plugins/cypress/index.d.ts +1 -1
- package/dist/plugins/cypress/index.js +6 -5
- package/dist/plugins/dotenv/index.d.ts +8 -0
- package/dist/plugins/dotenv/index.js +9 -0
- package/dist/plugins/drizzle/index.d.ts +1 -1
- package/dist/plugins/drizzle/index.js +3 -3
- package/dist/plugins/eleventy/index.d.ts +1 -1
- package/dist/plugins/eleventy/index.js +6 -6
- package/dist/plugins/eslint/helpers.d.ts +4 -5
- package/dist/plugins/eslint/helpers.js +10 -32
- package/dist/plugins/eslint/index.d.ts +1 -1
- package/dist/plugins/eslint/index.js +3 -6
- package/dist/plugins/gatsby/index.d.ts +1 -1
- package/dist/plugins/gatsby/index.js +6 -3
- package/dist/plugins/github-actions/index.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +23 -7
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.js +7 -7
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/husky/index.js +4 -3
- package/dist/plugins/index.d.ts +685 -77
- package/dist/plugins/index.js +170 -77
- package/dist/plugins/jest/index.d.ts +1 -1
- package/dist/plugins/jest/index.js +22 -24
- package/dist/plugins/ladle/index.d.ts +2 -2
- package/dist/plugins/ladle/index.js +4 -4
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lefthook/index.js +18 -14
- package/dist/plugins/lint-staged/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.js +6 -5
- package/dist/plugins/linthtml/index.d.ts +1 -1
- package/dist/plugins/linthtml/index.js +6 -8
- package/dist/plugins/lockfile-lint/index.d.ts +2 -2
- package/dist/plugins/lockfile-lint/index.js +2 -1
- package/dist/plugins/lost-pixel/index.d.ts +2 -2
- package/dist/plugins/lost-pixel/index.js +1 -1
- package/dist/plugins/markdownlint/index.d.ts +1 -1
- package/dist/plugins/markdownlint/index.js +3 -2
- package/dist/plugins/mocha/index.d.ts +4 -1
- package/dist/plugins/mocha/index.js +8 -4
- package/dist/plugins/moonrepo/index.d.ts +2 -2
- package/dist/plugins/moonrepo/index.js +4 -4
- package/dist/plugins/msw/index.d.ts +1 -1
- package/dist/plugins/msw/index.js +4 -4
- package/dist/plugins/nest/index.d.ts +2 -2
- package/dist/plugins/nest/index.js +4 -3
- package/dist/plugins/netlify/index.d.ts +1 -1
- package/dist/plugins/netlify/index.js +6 -6
- package/dist/plugins/next/index.d.ts +1 -1
- package/dist/plugins/next/index.js +1 -1
- package/dist/plugins/node/index.d.ts +8 -0
- package/dist/plugins/node/index.js +9 -0
- package/dist/plugins/node-test-runner/index.d.ts +1 -1
- package/dist/plugins/nodemon/index.d.ts +10 -0
- package/dist/plugins/nodemon/index.js +11 -0
- package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +4 -2
- package/dist/plugins/nuxt/index.d.ts +1 -1
- package/dist/plugins/nuxt/index.js +4 -4
- package/dist/plugins/nx/index.d.ts +5 -1
- package/dist/plugins/nx/index.js +10 -8
- package/dist/plugins/nyc/index.d.ts +1 -1
- package/dist/plugins/nyc/index.js +3 -2
- package/dist/plugins/oclif/index.d.ts +2 -2
- package/dist/plugins/oclif/index.js +3 -2
- package/dist/plugins/playwright/index.d.ts +13 -1
- package/dist/plugins/playwright/index.js +13 -6
- package/dist/plugins/playwright-ct/index.d.ts +9 -3
- package/dist/plugins/playwright-ct/index.js +3 -2
- package/dist/plugins/playwright-test/index.d.ts +13 -0
- package/dist/plugins/playwright-test/index.js +16 -0
- package/dist/plugins/postcss/index.d.ts +1 -1
- package/dist/plugins/postcss/index.js +5 -2
- package/dist/plugins/preconstruct/index.d.ts +1 -1
- package/dist/plugins/preconstruct/index.js +3 -3
- package/dist/plugins/prettier/index.d.ts +1 -1
- package/dist/plugins/prettier/index.js +5 -5
- package/dist/plugins/react-cosmos/index.d.ts +2 -2
- package/dist/plugins/react-cosmos/index.js +5 -6
- package/dist/plugins/release-it/index.d.ts +1 -1
- package/dist/plugins/release-it/index.js +4 -3
- package/dist/plugins/remark/index.d.ts +1 -1
- package/dist/plugins/remark/index.js +3 -2
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rollup/index.d.ts +3 -1
- package/dist/plugins/rollup/index.js +8 -1
- package/dist/plugins/rsbuild/index.d.ts +2 -2
- package/dist/plugins/rsbuild/index.js +1 -1
- package/dist/plugins/rspack/index.d.ts +2 -2
- package/dist/plugins/rspack/index.js +4 -8
- package/dist/plugins/semantic-release/index.d.ts +1 -1
- package/dist/plugins/semantic-release/index.js +4 -2
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/sentry/index.js +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +2 -2
- package/dist/plugins/simple-git-hooks/index.js +5 -5
- package/dist/plugins/size-limit/index.d.ts +2 -2
- package/dist/plugins/size-limit/index.js +2 -1
- package/dist/plugins/storybook/index.d.ts +1 -1
- package/dist/plugins/storybook/index.js +5 -5
- package/dist/plugins/stryker/index.d.ts +1 -1
- package/dist/plugins/stryker/index.js +3 -2
- package/dist/plugins/stylelint/index.d.ts +1 -1
- package/dist/plugins/stylelint/index.js +4 -3
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/svelte/index.js +1 -1
- package/dist/plugins/syncpack/index.d.ts +2 -3
- package/dist/plugins/syncpack/index.js +2 -4
- package/dist/plugins/tailwind/index.d.ts +1 -1
- package/dist/plugins/tailwind/index.js +1 -1
- package/dist/plugins/travis/index.d.ts +1 -1
- package/dist/plugins/travis/index.js +2 -3
- package/dist/plugins/ts-node/index.d.ts +15 -0
- package/dist/plugins/ts-node/index.js +12 -0
- package/dist/plugins/tsup/index.d.ts +4 -1
- package/dist/plugins/tsup/index.js +7 -3
- package/dist/plugins/tsx/index.d.ts +9 -0
- package/dist/plugins/tsx/index.js +10 -0
- package/dist/plugins/typedoc/index.d.ts +4 -1
- package/dist/plugins/typedoc/index.js +10 -3
- package/dist/plugins/typedoc/types.d.ts +1 -0
- package/dist/plugins/typescript/index.d.ts +11 -2
- package/dist/plugins/typescript/index.js +19 -34
- package/dist/plugins/unbuild/index.d.ts +1 -1
- package/dist/plugins/unbuild/index.js +3 -3
- package/dist/plugins/unocss/index.d.ts +2 -2
- package/dist/plugins/unocss/index.js +2 -1
- package/dist/plugins/vercel-og/index.d.ts +1 -1
- package/dist/plugins/vercel-og/index.js +1 -1
- package/dist/plugins/vike/index.d.ts +2 -2
- package/dist/plugins/vike/index.js +1 -1
- package/dist/plugins/vite/index.d.ts +3 -3
- package/dist/plugins/vite/index.js +2 -2
- package/dist/plugins/vitest/index.d.ts +4 -1
- package/dist/plugins/vitest/index.js +31 -20
- package/dist/plugins/vue/index.d.ts +1 -1
- package/dist/plugins/vue/index.js +10 -10
- package/dist/plugins/webdriver-io/index.d.ts +1 -1
- package/dist/plugins/webdriver-io/index.js +3 -2
- package/dist/plugins/webpack/index.d.ts +3 -5
- package/dist/plugins/webpack/index.js +18 -19
- package/dist/plugins/wireit/index.d.ts +1 -1
- package/dist/plugins/wireit/index.js +2 -2
- package/dist/plugins/wrangler/index.d.ts +1 -1
- package/dist/plugins/wrangler/index.js +3 -2
- package/dist/plugins/xo/index.d.ts +2 -2
- package/dist/plugins/xo/index.js +4 -4
- package/dist/plugins/yorkie/index.d.ts +1 -1
- package/dist/plugins/yorkie/index.js +6 -5
- package/dist/plugins.d.ts +7 -4
- package/dist/plugins.js +17 -10
- package/dist/reporters/symbols.js +1 -1
- package/dist/types/PluginNames.d.ts +2 -0
- package/dist/types/PluginNames.js +86 -0
- package/dist/types/args.d.ts +14 -0
- package/dist/types/config.d.ts +84 -21
- package/dist/types/package-json.d.ts +10 -0
- package/dist/types/project.d.ts +18 -0
- package/dist/typescript/get-imports-and-exports.d.ts +1 -11
- package/dist/typescript/get-imports-and-exports.js +3 -1
- 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/requireCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/resolveCall.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/exportsAccessExpression.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/index.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/create-workspace-graph.d.ts +1 -1
- package/dist/util/create-workspace-graph.js +7 -7
- package/dist/util/debug.d.ts +2 -2
- package/dist/util/debug.js +1 -1
- package/dist/util/glob.js +2 -2
- package/dist/util/{handle-dependency.d.ts → handle-referenced-dependency.d.ts} +2 -1
- package/dist/util/handle-referenced-dependency.js +82 -0
- package/dist/util/input.d.ts +37 -0
- package/dist/util/input.js +36 -0
- package/dist/util/map-workspaces.d.ts +5 -2
- package/dist/util/map-workspaces.js +6 -6
- package/dist/util/modules.d.ts +1 -0
- package/dist/util/modules.js +4 -3
- package/dist/util/object.d.ts +1 -0
- package/dist/util/object.js +19 -0
- package/dist/util/plugin-config.d.ts +24 -0
- package/dist/util/plugin-config.js +32 -0
- package/dist/util/plugin.d.ts +3 -31
- package/dist/util/plugin.js +9 -54
- package/dist/util/regex.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -10
- package/schema.json +28 -0
- package/dist/binaries/resolvers/bun.d.ts +0 -2
- package/dist/binaries/resolvers/c8.d.ts +0 -2
- package/dist/binaries/resolvers/c8.js +0 -11
- package/dist/binaries/resolvers/dotenv.d.ts +0 -2
- package/dist/binaries/resolvers/dotenv.js +0 -7
- package/dist/binaries/resolvers/fallback.d.ts +0 -2
- package/dist/binaries/resolvers/fallback.js +0 -26
- package/dist/binaries/resolvers/index.d.ts +0 -15
- package/dist/binaries/resolvers/index.js +0 -26
- package/dist/binaries/resolvers/node.js +0 -11
- package/dist/binaries/resolvers/nodemon.d.ts +0 -2
- package/dist/binaries/resolvers/nodemon.js +0 -16
- package/dist/binaries/resolvers/npx.d.ts +0 -2
- package/dist/binaries/resolvers/nx.d.ts +0 -2
- package/dist/binaries/resolvers/nx.js +0 -9
- package/dist/binaries/resolvers/pnpm.d.ts +0 -2
- package/dist/binaries/resolvers/rollup.d.ts +0 -2
- package/dist/binaries/resolvers/rollup.js +0 -12
- package/dist/binaries/resolvers/ts-node.d.ts +0 -2
- package/dist/binaries/resolvers/ts-node.js +0 -16
- package/dist/binaries/resolvers/tsx.d.ts +0 -2
- package/dist/binaries/resolvers/tsx.js +0 -6
- package/dist/binaries/resolvers/yarn.d.ts +0 -2
- package/dist/binaries/types.d.ts +0 -11
- package/dist/types/plugins.d.ts +0 -42
- package/dist/util/handle-dependency.js +0 -63
- package/dist/util/protocols.d.ts +0 -9
- package/dist/util/protocols.js +0 -9
- /package/dist/{binaries/types.js → types/args.js} +0 -0
- /package/dist/types/{plugins.js → project.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Remark';
|
|
3
4
|
const enablers = ['remark-cli'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -14,7 +15,7 @@ const resolveConfig = config => {
|
|
|
14
15
|
return [];
|
|
15
16
|
})
|
|
16
17
|
.map(plugin => (plugin.startsWith('remark-') ? plugin : `remark-${plugin}`)) ?? [];
|
|
17
|
-
return plugins;
|
|
18
|
+
return plugins.map(toDeferResolve);
|
|
18
19
|
};
|
|
19
20
|
export default {
|
|
20
21
|
title,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Args } from '../../types/args.js';
|
|
2
|
+
import type { IsPluginEnabled } from '../../types/config.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
entry: string[];
|
|
8
|
+
args: Args;
|
|
7
9
|
};
|
|
8
10
|
export default _default;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
2
|
const title = 'Rollup';
|
|
3
3
|
const enablers = ['rollup'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const entry = ['rollup.config.{js,cjs,mjs,ts}'];
|
|
6
|
+
const args = {
|
|
7
|
+
alias: { plugin: ['p'] },
|
|
8
|
+
args: (args) => args.map(arg => (arg.startsWith('--watch.onEnd') ? `--_exec${arg.slice(13)}` : arg)),
|
|
9
|
+
fromArgs: ['_exec'],
|
|
10
|
+
resolve: ['plugin', 'configPlugin'],
|
|
11
|
+
};
|
|
6
12
|
export default {
|
|
7
13
|
title,
|
|
8
14
|
enablers,
|
|
9
15
|
isEnabled,
|
|
10
16
|
entry,
|
|
17
|
+
args,
|
|
11
18
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { RsbuildConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<RsbuildConfig>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { WebpackConfig } from '../webpack/types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<WebpackConfig>;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
2
|
import { findWebpackDependenciesFromConfig } from '../webpack/index.js';
|
|
4
3
|
const title = 'Rspack';
|
|
5
4
|
const enablers = ['@rspack/core'];
|
|
6
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
6
|
const config = ['rspack.config*.{js,ts,mjs,cjs}'];
|
|
8
7
|
const resolveConfig = async (localConfig, options) => {
|
|
9
|
-
const { cwd
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
if (isProduction)
|
|
13
|
-
return [...entryPatterns];
|
|
14
|
-
return compact([...entryPatterns, ...deps]);
|
|
8
|
+
const { cwd } = options;
|
|
9
|
+
const inputs = await findWebpackDependenciesFromConfig({ config: localConfig, cwd });
|
|
10
|
+
return Array.from(inputs).filter(input => !input.specifier.startsWith('builtin:'));
|
|
15
11
|
};
|
|
16
12
|
export default {
|
|
17
13
|
title,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
const title = 'Semantic Release';
|
|
3
5
|
const enablers = ['semantic-release'];
|
|
4
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -6,7 +8,7 @@ const packageJsonPath = 'release';
|
|
|
6
8
|
const config = ['package.json', ...toCosmiconfig('release')];
|
|
7
9
|
const resolveConfig = config => {
|
|
8
10
|
const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
|
|
9
|
-
return plugins;
|
|
11
|
+
return plugins.map(toDeferResolve);
|
|
10
12
|
};
|
|
11
13
|
export default {
|
|
12
14
|
title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
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
|
-
enablers:
|
|
5
|
+
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
packageJsonPath: string;
|
|
8
8
|
config: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
2
|
const title = 'simple-git-hooks';
|
|
3
3
|
const enablers = ['simple-git-hooks'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -15,12 +15,12 @@ const resolveConfig = async (config, options) => {
|
|
|
15
15
|
config = config();
|
|
16
16
|
if (!config)
|
|
17
17
|
return [];
|
|
18
|
-
const
|
|
18
|
+
const inputs = new Set();
|
|
19
19
|
for (const hook of Object.values(config)) {
|
|
20
|
-
for (const id of
|
|
21
|
-
|
|
20
|
+
for (const id of options.getInputsFromScripts(hook))
|
|
21
|
+
inputs.add(id);
|
|
22
22
|
}
|
|
23
|
-
return Array.from(
|
|
23
|
+
return Array.from(inputs);
|
|
24
24
|
};
|
|
25
25
|
export default {
|
|
26
26
|
title,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IsPluginEnabled } from '
|
|
1
|
+
import type { IsPluginEnabled } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
enablers:
|
|
4
|
+
enablers: string[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
7
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toLilconfig } from '../../util/plugin-config.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'size-limit';
|
|
3
4
|
const enablers = ['size-limit'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import type { StorybookConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toDeferResolve, toDependency, toEntry } from '../../util/input.js';
|
|
2
|
+
import { join, relative } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Storybook';
|
|
5
5
|
const enablers = [/^@storybook\//, '@nrwl/storybook'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -18,7 +18,7 @@ const resolveEntryPaths = async (localConfig, options) => {
|
|
|
18
18
|
return relative(cwd, join(configFileDir, pattern.directory, pattern.files ?? stories[0]));
|
|
19
19
|
});
|
|
20
20
|
const patterns = [...restEntry, ...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories)];
|
|
21
|
-
return patterns.map(
|
|
21
|
+
return patterns.map(toEntry);
|
|
22
22
|
};
|
|
23
23
|
const resolveConfig = async (localConfig) => {
|
|
24
24
|
const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
|
|
@@ -30,7 +30,7 @@ const resolveConfig = async (localConfig) => {
|
|
|
30
30
|
: [builder]
|
|
31
31
|
: [];
|
|
32
32
|
const frameworks = localConfig.framework?.name ? [localConfig.framework.name] : [];
|
|
33
|
-
return [...addons, ...builderPackages, ...frameworks];
|
|
33
|
+
return [...addons.map(toDeferResolve), ...builderPackages.map(toDependency), ...frameworks.map(toDependency)];
|
|
34
34
|
};
|
|
35
35
|
export default {
|
|
36
36
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Stryker';
|
|
3
4
|
const enablers = ['@stryker-mutator/core'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -9,7 +10,7 @@ const resolveConfig = localConfig => {
|
|
|
9
10
|
? localConfig.checkers.map(checker => `@stryker-mutator/${checker}-checker`)
|
|
10
11
|
: [];
|
|
11
12
|
const plugins = localConfig.plugins ?? [];
|
|
12
|
-
return [...runners, ...checkers, ...plugins];
|
|
13
|
+
return [...runners, ...checkers, ...plugins].map(toDeferResolve);
|
|
13
14
|
};
|
|
14
15
|
export default {
|
|
15
16
|
title,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
4
|
const title = 'Stylelint';
|
|
4
5
|
const enablers = ['stylelint'];
|
|
5
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -9,7 +10,7 @@ const resolve = (config) => {
|
|
|
9
10
|
const plugins = config.plugins ? [config.plugins].flat() : [];
|
|
10
11
|
const customSyntax = config.customSyntax ? [config.customSyntax] : [];
|
|
11
12
|
const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(resolve) : [];
|
|
12
|
-
return [...extend, ...plugins, ...
|
|
13
|
+
return [...[...extend, ...plugins, ...customSyntax].map(toDeferResolve), ...overrideConfigs];
|
|
13
14
|
};
|
|
14
15
|
const resolveConfig = config => resolve(config);
|
|
15
16
|
export default {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled } from '
|
|
1
|
+
import type { IsPluginEnabled } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
enablers:
|
|
4
|
+
enablers: string[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
|
-
packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { hasDependency
|
|
1
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Syncpack';
|
|
4
4
|
const enablers = ['syncpack'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['package.json', ...toCosmiconfig('syncpack')];
|
|
7
|
-
const packageJsonPath = manifest => get(manifest, 'syncpack');
|
|
8
7
|
export default {
|
|
9
8
|
title,
|
|
10
9
|
enablers,
|
|
11
10
|
isEnabled,
|
|
12
11
|
config,
|
|
13
|
-
packageJsonPath,
|
|
14
12
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { _glob } from '
|
|
2
|
-
import { getDependenciesFromScripts } from '../../util/plugin.js';
|
|
1
|
+
import { _glob } from '../../util/glob.js';
|
|
3
2
|
const title = 'Travis CI';
|
|
4
3
|
const enablers = 'This plugin is enabled when a `.travis.yml` file is found in the root folder.';
|
|
5
4
|
const isEnabled = async ({ cwd }) => (await _glob({ cwd, patterns: ['.travis.yml'] })).length > 0;
|
|
@@ -11,7 +10,7 @@ const resolveConfig = async (config, options) => {
|
|
|
11
10
|
const beforeInstall = [config.before_install ?? []].flat();
|
|
12
11
|
const beforeScript = [config.before_script ?? []].flat();
|
|
13
12
|
const scripts = [...beforeDeploy, ...beforeInstall, ...beforeScript];
|
|
14
|
-
return
|
|
13
|
+
return options.getInputsFromScripts(scripts, { knownBinsOnly: true });
|
|
15
14
|
};
|
|
16
15
|
export default {
|
|
17
16
|
title,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
args: {
|
|
4
|
+
binaries: string[];
|
|
5
|
+
positional: boolean;
|
|
6
|
+
nodeImportArgs: boolean;
|
|
7
|
+
boolean: string[];
|
|
8
|
+
alias: {
|
|
9
|
+
transpileOnly: string[];
|
|
10
|
+
compilerHost: string[];
|
|
11
|
+
ignoreDiagnostics: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const title = 'ts-node';
|
|
2
|
+
const args = {
|
|
3
|
+
binaries: [title],
|
|
4
|
+
positional: true,
|
|
5
|
+
nodeImportArgs: true,
|
|
6
|
+
boolean: ['transpileOnly', 'compilerHost', 'ignoreDiagnostics', 'swc', 'preferTsExts'],
|
|
7
|
+
alias: { transpileOnly: ['T'], compilerHost: ['H'], ignoreDiagnostics: ['D'] },
|
|
8
|
+
};
|
|
9
|
+
export default {
|
|
10
|
+
title,
|
|
11
|
+
args,
|
|
12
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { TsupConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -6,5 +6,8 @@ declare const _default: {
|
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<TsupConfig>;
|
|
9
|
+
args: {
|
|
10
|
+
config: boolean;
|
|
11
|
+
};
|
|
9
12
|
};
|
|
10
13
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'tsup';
|
|
4
4
|
const enablers = ['tsup'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -16,13 +16,17 @@ const resolveConfig = async (config) => {
|
|
|
16
16
|
return config.entry;
|
|
17
17
|
return Object.values(config.entry);
|
|
18
18
|
})
|
|
19
|
-
.map(
|
|
19
|
+
.map(id => toProductionEntry(id));
|
|
20
20
|
return entryPatterns;
|
|
21
21
|
};
|
|
22
|
+
const args = {
|
|
23
|
+
config: true,
|
|
24
|
+
};
|
|
22
25
|
export default {
|
|
23
26
|
title,
|
|
24
27
|
enablers,
|
|
25
28
|
isEnabled,
|
|
26
29
|
config,
|
|
27
30
|
resolveConfig,
|
|
31
|
+
args,
|
|
28
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { TypeDocConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -9,5 +9,8 @@ declare const _default: {
|
|
|
9
9
|
resolveConfig: ResolveConfig<TypeDocConfig | {
|
|
10
10
|
typedocOptions: TypeDocConfig;
|
|
11
11
|
}>;
|
|
12
|
+
args: {
|
|
13
|
+
resolve: string[];
|
|
14
|
+
};
|
|
12
15
|
};
|
|
13
16
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'TypeDoc';
|
|
3
4
|
const enablers = ['typedoc'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -12,8 +13,13 @@ const config = [
|
|
|
12
13
|
'tsconfig.json',
|
|
13
14
|
];
|
|
14
15
|
const resolveConfig = config => {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const cfg = 'typedocOptions' in config ? config.typedocOptions : config;
|
|
17
|
+
const plugins = cfg?.plugin ?? [];
|
|
18
|
+
const themes = cfg?.theme ?? [];
|
|
19
|
+
return [...plugins, ...themes].map(toDeferResolve);
|
|
20
|
+
};
|
|
21
|
+
const args = {
|
|
22
|
+
resolve: ['plugin', 'theme'],
|
|
17
23
|
};
|
|
18
24
|
export default {
|
|
19
25
|
title,
|
|
@@ -22,4 +28,5 @@ export default {
|
|
|
22
28
|
packageJsonPath,
|
|
23
29
|
config,
|
|
24
30
|
resolveConfig,
|
|
31
|
+
args,
|
|
25
32
|
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TsConfigJson } from 'type-fest';
|
|
2
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
enablers: string[];
|
|
5
6
|
isEnabled: IsPluginEnabled;
|
|
6
7
|
config: string[];
|
|
7
8
|
production: string[];
|
|
8
|
-
resolveConfig: ResolveConfig
|
|
9
|
+
resolveConfig: ResolveConfig<TsConfigJson>;
|
|
10
|
+
args: {
|
|
11
|
+
binaries: string[];
|
|
12
|
+
string: string[];
|
|
13
|
+
alias: {
|
|
14
|
+
project: string[];
|
|
15
|
+
};
|
|
16
|
+
config: [string, (p: string) => string][];
|
|
17
|
+
};
|
|
9
18
|
};
|
|
10
19
|
export default _default;
|
|
@@ -1,48 +1,32 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { compact } from '../../util/array.js';
|
|
2
|
+
import { toConfig, toDeferResolve, toProductionDependency } from '../../util/input.js';
|
|
3
|
+
import { join } from '../../util/path.js';
|
|
4
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
const title = 'TypeScript';
|
|
6
6
|
const enablers = ['typescript'];
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
|
-
const config = ['tsconfig.json'
|
|
8
|
+
const config = ['tsconfig.json'];
|
|
9
9
|
const production = [];
|
|
10
|
-
const getExtends = async (configFilePath, internalExtends = new Set()) => {
|
|
11
|
-
const filePath = configFilePath.replace(/(\.json)?$/, '.json');
|
|
12
|
-
const localConfig = await loadJSON(filePath);
|
|
13
|
-
if (!localConfig)
|
|
14
|
-
return internalExtends;
|
|
15
|
-
const extends_ = localConfig.extends ? [localConfig.extends].flat() : [];
|
|
16
|
-
for (const extend of extends_) {
|
|
17
|
-
if (isInternal(extend)) {
|
|
18
|
-
const presetConfigPath = toAbsolute(extend, dirname(configFilePath));
|
|
19
|
-
await getExtends(presetConfigPath, internalExtends);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
for (const extend of extends_) {
|
|
23
|
-
if (isInternal(extend))
|
|
24
|
-
internalExtends.add(toAbsolute(extend, dirname(configFilePath)));
|
|
25
|
-
else
|
|
26
|
-
internalExtends.add(extend);
|
|
27
|
-
}
|
|
28
|
-
return internalExtends;
|
|
29
|
-
};
|
|
30
10
|
const resolveConfig = async (localConfig, options) => {
|
|
31
|
-
const {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
const { compilerOptions } = localConfig;
|
|
12
|
+
const extend = localConfig.extends
|
|
13
|
+
? [localConfig.extends].flat().map(specifier => toConfig('typescript', specifier, options.configFilePath))
|
|
14
|
+
: [];
|
|
35
15
|
if (!(compilerOptions && localConfig))
|
|
36
|
-
return
|
|
37
|
-
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
38
|
-
if (isProduction)
|
|
39
|
-
return [...jsx];
|
|
16
|
+
return extend;
|
|
17
|
+
const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(toProductionDependency);
|
|
40
18
|
const types = compilerOptions.types ?? [];
|
|
41
19
|
const plugins = Array.isArray(compilerOptions?.plugins)
|
|
42
20
|
? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
|
|
43
21
|
: [];
|
|
44
22
|
const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
|
|
45
|
-
return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
|
|
23
|
+
return compact([...extend, ...[...types, ...plugins, ...importHelpers].map(toDeferResolve), ...jsx]);
|
|
24
|
+
};
|
|
25
|
+
const args = {
|
|
26
|
+
binaries: ['tsc'],
|
|
27
|
+
string: ['project'],
|
|
28
|
+
alias: { project: ['p'] },
|
|
29
|
+
config: [['project', (p) => (p.endsWith('.json') ? p : join(p, 'tsconfig.json'))]],
|
|
46
30
|
};
|
|
47
31
|
export default {
|
|
48
32
|
title,
|
|
@@ -51,4 +35,5 @@ export default {
|
|
|
51
35
|
config,
|
|
52
36
|
production,
|
|
53
37
|
resolveConfig,
|
|
38
|
+
args,
|
|
54
39
|
};
|