knip 5.33.2 → 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 +3 -4
- 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/ast-helpers.d.ts +1 -1
- package/dist/typescript/ast-helpers.js +5 -1
- package/dist/typescript/find-internal-references.d.ts +1 -1
- package/dist/typescript/find-internal-references.js +12 -10
- package/dist/typescript/get-imports-and-exports.d.ts +1 -11
- package/dist/typescript/get-imports-and-exports.js +19 -14
- 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/exportKeyword.js +2 -0
- 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,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
2
|
const title = 'moonrepo';
|
|
3
3
|
const enablers = ['@moonrepo/cli'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const config = ['moon.yml', '.moon/tasks.yml', '.moon/tasks/*.yml'];
|
|
6
6
|
const resolveConfig = async (config, options) => {
|
|
7
7
|
const tasks = config.tasks ? Object.values(config.tasks) : [];
|
|
8
|
-
const
|
|
8
|
+
const inputs = tasks
|
|
9
9
|
.map(task => task.command)
|
|
10
10
|
.filter(command => command)
|
|
11
11
|
.map(command => command.replace('$workspaceRoot', options.rootCwd))
|
|
12
12
|
.map(command => command.replace('$projectRoot', options.cwd))
|
|
13
|
-
.flatMap(command =>
|
|
14
|
-
return [...
|
|
13
|
+
.flatMap(command => options.getInputsFromScripts(command));
|
|
14
|
+
return [...inputs];
|
|
15
15
|
};
|
|
16
16
|
export default {
|
|
17
17
|
title,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Mock Service Worker';
|
|
5
5
|
const enablers = ['msw'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -9,7 +9,7 @@ const entry = ['mockServiceWorker.js'];
|
|
|
9
9
|
const resolveEntryPaths = async (localConfig) => {
|
|
10
10
|
const workerDirectory = localConfig?.workerDirectory;
|
|
11
11
|
const dir = workerDirectory ? [workerDirectory].flat()[0] : '.';
|
|
12
|
-
return entry.map(pattern =>
|
|
12
|
+
return entry.map(pattern => toEntry(join(dir, pattern)));
|
|
13
13
|
};
|
|
14
14
|
export default {
|
|
15
15
|
title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { NestConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: RegExp[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
resolveConfig: ResolveConfig<NestConfig>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Nest';
|
|
3
4
|
const enablers = [/^@nestjs\/.*/];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
6
|
const config = ['nest-cli.json', '.nestcli.json', '.nest-cli.json', 'nest.json'];
|
|
6
7
|
const resolveConfig = async (config) => {
|
|
7
|
-
const
|
|
8
|
-
return [...
|
|
8
|
+
const inputs = config?.collection ? [config.collection] : [];
|
|
9
|
+
return [...inputs].map(toDependency);
|
|
9
10
|
};
|
|
10
11
|
export default {
|
|
11
12
|
title,
|
|
@@ -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 { NetlifyConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toDependency, toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { extractFunctionsConfigProperty } from './helpers.js';
|
|
5
5
|
const title = 'Netlify';
|
|
6
6
|
const enablers = [/^@netlify\/plugin-/, 'netlify-cli', '@netlify/functions'];
|
|
@@ -15,12 +15,12 @@ const resolveEntryPaths = localConfig => {
|
|
|
15
15
|
join(localConfig.functions?.directory ?? NETLIFY_FUNCTIONS_DIR, `**/*.{${NETLIFY_FUNCTIONS_EXTS}}`),
|
|
16
16
|
]
|
|
17
17
|
.filter(file => !file.startsWith('!'))
|
|
18
|
-
.map(
|
|
18
|
+
.map(id => toProductionEntry(id));
|
|
19
19
|
};
|
|
20
20
|
const resolveConfig = async (localConfig) => {
|
|
21
21
|
return [
|
|
22
|
-
...(localConfig?.plugins?.map(plugin => plugin.package) ?? []),
|
|
23
|
-
...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules'),
|
|
22
|
+
...(localConfig?.plugins?.map(plugin => plugin.package) ?? []).map(toDependency),
|
|
23
|
+
...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(toDependency),
|
|
24
24
|
];
|
|
25
25
|
};
|
|
26
26
|
export default {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
const title = 'npm-package-json-lint';
|
|
3
5
|
const enablers = ['npm-package-json-lint'];
|
|
4
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
7
|
const packageJsonPath = 'npmpackagejsonlint';
|
|
6
8
|
const config = ['package.json', ...toCosmiconfig('npmpackagejsonlint')];
|
|
7
9
|
const resolveConfig = localConfig => {
|
|
8
|
-
return localConfig?.extends ? [localConfig.extends] : [];
|
|
10
|
+
return localConfig?.extends ? [localConfig.extends].map(toDependency) : [];
|
|
9
11
|
};
|
|
10
12
|
export default {
|
|
11
13
|
title,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Nuxt';
|
|
5
5
|
const note = `Knip works best with [explicit imports](https://nuxt.com/docs/guide/concepts/auto-imports#explicit-imports).
|
|
6
6
|
Nuxt allows to [disable auto-imports](https://nuxt.com/docs/guide/concepts/auto-imports#disabling-auto-imports).`;
|
|
@@ -36,7 +36,7 @@ const resolveEntryPaths = async (localConfig) => {
|
|
|
36
36
|
'server/middleware/**/*.ts',
|
|
37
37
|
'server/plugins/**/*.ts',
|
|
38
38
|
];
|
|
39
|
-
return patterns.map(pattern =>
|
|
39
|
+
return patterns.map(pattern => toProductionEntry(join(srcDir, pattern)));
|
|
40
40
|
};
|
|
41
41
|
export default {
|
|
42
42
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ParsedArgs } from 'minimist';
|
|
2
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
3
|
import type { NxConfigRoot, NxProjectConfiguration } from './types.js';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
@@ -6,5 +7,8 @@ declare const _default: {
|
|
|
6
7
|
isEnabled: IsPluginEnabled;
|
|
7
8
|
config: string[];
|
|
8
9
|
resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot>;
|
|
10
|
+
args: {
|
|
11
|
+
fromArgs: (parsed: ParsedArgs) => string[];
|
|
12
|
+
};
|
|
9
13
|
};
|
|
10
14
|
export default _default;
|
package/dist/plugins/nx/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { compact } from '../../util/array.js';
|
|
2
|
+
import { toDependency } from '../../util/input.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Nx';
|
|
5
5
|
const enablers = ['nx', /^@nrwl\//, /^@nx\//];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -14,16 +14,14 @@ const findNxDependenciesInNxJson = async (localConfig) => {
|
|
|
14
14
|
const plugins = localConfig.plugins && Array.isArray(localConfig.plugins)
|
|
15
15
|
? localConfig.plugins
|
|
16
16
|
.map(value => (typeof value === 'string' ? value : value.plugin))
|
|
17
|
-
.map(value => getPackageNameFromModuleSpecifier(value))
|
|
18
17
|
.filter(value => value !== undefined)
|
|
19
18
|
: [];
|
|
20
19
|
const generators = localConfig.generators
|
|
21
20
|
? Object.keys(localConfig.generators)
|
|
22
|
-
.map(value => getPackageNameFromModuleSpecifier(value))
|
|
23
21
|
.filter(value => value !== undefined)
|
|
24
22
|
.map(value => value.split(':')[0])
|
|
25
23
|
: [];
|
|
26
|
-
return compact([...targetsDefault, ...plugins, ...generators]);
|
|
24
|
+
return compact([...targetsDefault, ...plugins, ...generators]).map(toDependency);
|
|
27
25
|
};
|
|
28
26
|
const resolveConfig = async (localConfig, options) => {
|
|
29
27
|
const { configFileName } = options;
|
|
@@ -39,8 +37,11 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
39
37
|
const scripts = targets
|
|
40
38
|
.filter(target => target.executor === 'nx:run-commands')
|
|
41
39
|
.flatMap(target => target.options?.commands ?? (target.options?.command ? [target.options.command] : []));
|
|
42
|
-
const
|
|
43
|
-
return compact([...executors, ...
|
|
40
|
+
const inputs = options.getInputsFromScripts(scripts);
|
|
41
|
+
return compact([...executors, ...inputs]).map(id => (typeof id === 'string' ? toDependency(id) : id));
|
|
42
|
+
};
|
|
43
|
+
const args = {
|
|
44
|
+
fromArgs: (parsed) => (parsed._[0] === 'exec' ? parsed._.slice(1) : []),
|
|
44
45
|
};
|
|
45
46
|
export default {
|
|
46
47
|
title,
|
|
@@ -48,4 +49,5 @@ export default {
|
|
|
48
49
|
isEnabled,
|
|
49
50
|
config,
|
|
50
51
|
resolveConfig,
|
|
52
|
+
args,
|
|
51
53
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'nyc';
|
|
3
4
|
const enablers = ['nyc'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -6,7 +7,7 @@ const config = ['.nycrc', '.nycrc.json', '.nycrc.{yml,yaml}', 'nyc.config.js', '
|
|
|
6
7
|
const resolveConfig = config => {
|
|
7
8
|
const extend = config?.extends ? [config?.extends].flat() : [];
|
|
8
9
|
const requires = config?.require ? [config?.require].flat() : [];
|
|
9
|
-
return [...extend, ...requires].flat();
|
|
10
|
+
return [...extend, ...requires].flat().map(toDeferResolve);
|
|
10
11
|
};
|
|
11
12
|
export default {
|
|
12
13
|
title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { OclifConfig } 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<OclifConfig>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'oclif';
|
|
3
4
|
const enablers = ['oclif'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -6,7 +7,7 @@ const config = ['package.json'];
|
|
|
6
7
|
const resolveConfig = async (config) => {
|
|
7
8
|
const plugins = config?.plugins ?? [];
|
|
8
9
|
const devPlugins = config?.devPlugins ?? [];
|
|
9
|
-
return [...plugins, ...devPlugins];
|
|
10
|
+
return [...plugins, ...devPlugins].map(toDependency);
|
|
10
11
|
};
|
|
11
12
|
export default {
|
|
12
13
|
title,
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import type { PlaywrightTestConfig } from './types.js';
|
|
3
3
|
export declare const entry: string[];
|
|
4
4
|
export declare const resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
5
5
|
export declare const resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
6
|
+
export declare const args: {
|
|
7
|
+
binaries: string[];
|
|
8
|
+
positional: boolean;
|
|
9
|
+
args: (args: string[]) => string[];
|
|
10
|
+
config: boolean;
|
|
11
|
+
};
|
|
6
12
|
declare const _default: {
|
|
7
13
|
title: string;
|
|
8
14
|
enablers: string[];
|
|
@@ -11,5 +17,11 @@ declare const _default: {
|
|
|
11
17
|
entry: string[];
|
|
12
18
|
resolveConfig: ResolveConfig<PlaywrightTestConfig>;
|
|
13
19
|
resolveEntryPaths: ResolveEntryPaths<PlaywrightTestConfig>;
|
|
20
|
+
args: {
|
|
21
|
+
binaries: string[];
|
|
22
|
+
positional: boolean;
|
|
23
|
+
args: (args: string[]) => string[];
|
|
24
|
+
config: boolean;
|
|
25
|
+
};
|
|
14
26
|
};
|
|
15
27
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
2
|
+
import { join, relative } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Playwright';
|
|
5
5
|
const enablers = ['@playwright/test'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
|
-
const config = ['playwright.config.{js,ts}'];
|
|
7
|
+
const config = ['playwright.config.{js,ts,mjs}'];
|
|
8
8
|
export const entry = ['**/*.@(spec|test).?(c|m)[jt]s?(x)'];
|
|
9
9
|
const toEntryPatterns = (testMatch, cwd, configDir, localConfig, rootConfig) => {
|
|
10
10
|
if (!testMatch)
|
|
@@ -12,7 +12,7 @@ const toEntryPatterns = (testMatch, cwd, configDir, localConfig, rootConfig) =>
|
|
|
12
12
|
const testDir = localConfig.testDir ?? rootConfig.testDir;
|
|
13
13
|
const dir = relative(cwd, testDir ? join(configDir, testDir) : configDir);
|
|
14
14
|
const patterns = [testMatch].flat().filter((p) => typeof p === 'string');
|
|
15
|
-
return patterns.map(pattern =>
|
|
15
|
+
return patterns.map(pattern => toEntry(join(dir, pattern)));
|
|
16
16
|
};
|
|
17
17
|
const builtinReporters = ['dot', 'line', 'list', 'junit', 'html', 'blob', 'json', 'github'];
|
|
18
18
|
export const resolveEntryPaths = async (localConfig, options) => {
|
|
@@ -27,7 +27,13 @@ export const resolveConfig = async (config) => {
|
|
|
27
27
|
return [];
|
|
28
28
|
return [name];
|
|
29
29
|
});
|
|
30
|
-
return [...reporters];
|
|
30
|
+
return [...reporters].map(toDeferResolve);
|
|
31
|
+
};
|
|
32
|
+
export const args = {
|
|
33
|
+
binaries: ['playwright'],
|
|
34
|
+
positional: true,
|
|
35
|
+
args: (args) => args.filter(arg => arg !== 'install' && arg !== 'test'),
|
|
36
|
+
config: true,
|
|
31
37
|
};
|
|
32
38
|
export default {
|
|
33
39
|
title,
|
|
@@ -37,4 +43,5 @@ export default {
|
|
|
37
43
|
entry,
|
|
38
44
|
resolveConfig,
|
|
39
45
|
resolveEntryPaths,
|
|
46
|
+
args,
|
|
40
47
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import type { IsPluginEnabled } from '
|
|
1
|
+
import type { IsPluginEnabled } from '../../types/config.js';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
enablers: RegExp[];
|
|
5
5
|
isEnabled: IsPluginEnabled;
|
|
6
6
|
config: string[];
|
|
7
7
|
entry: string[];
|
|
8
|
-
resolveEntryPaths: import("
|
|
9
|
-
resolveConfig: import("
|
|
8
|
+
resolveEntryPaths: import("../../types/config.js").ResolveEntryPaths<import("../playwright/types.js").PlaywrightTestConfig>;
|
|
9
|
+
resolveConfig: import("../../types/config.js").ResolveConfig<import("../playwright/types.js").PlaywrightTestConfig>;
|
|
10
|
+
args: {
|
|
11
|
+
binaries: string[];
|
|
12
|
+
positional: boolean;
|
|
13
|
+
args: (args: string[]) => string[];
|
|
14
|
+
config: boolean;
|
|
15
|
+
};
|
|
10
16
|
};
|
|
11
17
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
2
|
-
import { entry, resolveConfig, resolveEntryPaths } from '../playwright/index.js';
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { args, entry, resolveConfig, resolveEntryPaths } from '../playwright/index.js';
|
|
3
3
|
const title = 'Playwright for components';
|
|
4
4
|
const enablers = [/^@playwright\/experimental-ct-/];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -12,4 +12,5 @@ export default {
|
|
|
12
12
|
entry,
|
|
13
13
|
resolveEntryPaths,
|
|
14
14
|
resolveConfig,
|
|
15
|
+
args,
|
|
15
16
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IsPluginEnabled } from '../../types/config.js';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
enablers: string[];
|
|
5
|
+
isEnabled: IsPluginEnabled;
|
|
6
|
+
args: {
|
|
7
|
+
binaries: string[];
|
|
8
|
+
positional: boolean;
|
|
9
|
+
args: (args: string[]) => string[];
|
|
10
|
+
config: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
const title = 'playwright-test';
|
|
3
|
+
const enablers = ['playwright-test'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const args = {
|
|
6
|
+
binaries: ['playwright-test'],
|
|
7
|
+
positional: true,
|
|
8
|
+
args: (args) => args.filter(arg => arg !== 'install' && arg !== 'test'),
|
|
9
|
+
config: true,
|
|
10
|
+
};
|
|
11
|
+
export default {
|
|
12
|
+
title,
|
|
13
|
+
enablers,
|
|
14
|
+
isEnabled,
|
|
15
|
+
args,
|
|
16
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve, toDependency } from '../../util/input.js';
|
|
2
|
+
import { toLilconfig } from '../../util/plugin-config.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
const title = 'PostCSS';
|
|
3
5
|
const enablers = ['postcss', 'postcss-cli', 'next'];
|
|
4
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -17,7 +19,8 @@ const resolveConfig = config => {
|
|
|
17
19
|
return [];
|
|
18
20
|
})
|
|
19
21
|
: [];
|
|
20
|
-
|
|
22
|
+
const inputs = plugins.map(toDeferResolve);
|
|
23
|
+
return plugins.includes('tailwindcss') ? [...inputs, toDependency('postcss')] : inputs;
|
|
21
24
|
};
|
|
22
25
|
export default {
|
|
23
26
|
title,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Preconstruct';
|
|
4
4
|
const enablers = ['@preconstruct/cli'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['package.json'];
|
|
7
7
|
const resolveEntryPaths = async (config) => {
|
|
8
|
-
return (config.entrypoints ?? []).map(
|
|
8
|
+
return (config.entrypoints ?? []).map(toEntry);
|
|
9
9
|
};
|
|
10
10
|
export default {
|
|
11
11
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve, toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Prettier';
|
|
3
4
|
const enablers = ['prettier'];
|
|
4
5
|
const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'prettier' in config;
|
|
@@ -9,11 +10,10 @@ const config = [
|
|
|
9
10
|
'package.{json,yaml}',
|
|
10
11
|
];
|
|
11
12
|
const resolveConfig = config => {
|
|
12
|
-
if (typeof config === 'string')
|
|
13
|
-
return [config];
|
|
14
|
-
}
|
|
13
|
+
if (typeof config === 'string')
|
|
14
|
+
return [toDeferResolve(config)];
|
|
15
15
|
return Array.isArray(config.plugins)
|
|
16
|
-
? config.plugins.filter((plugin) => typeof plugin === 'string')
|
|
16
|
+
? config.plugins.filter((plugin) => typeof plugin === 'string').map(toDependency)
|
|
17
17
|
: [];
|
|
18
18
|
};
|
|
19
19
|
export default {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import type { ReactCosmosConfig } 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
|
entry: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
2
2
|
import { join } from '../../util/path.js';
|
|
3
|
-
import {
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'React Cosmos';
|
|
5
5
|
const enablers = ['react-cosmos'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -16,11 +16,10 @@ const resolveEntryPaths = async (localConfig) => {
|
|
|
16
16
|
join(fixturesDir ?? '', `**/*.${fixtureFileSuffix ?? 'fixture'}.${ext}`),
|
|
17
17
|
join(fixturesDir ?? '', `**/${fixtureFileSuffix ?? 'fixture'}.${ext}`),
|
|
18
18
|
];
|
|
19
|
-
return [...entries, ...decoratorEntry].map(
|
|
19
|
+
return [...entries, ...decoratorEntry].map(toEntry);
|
|
20
20
|
};
|
|
21
|
-
const resolveConfig = async (localConfig
|
|
22
|
-
|
|
23
|
-
return [...dependencies];
|
|
21
|
+
const resolveConfig = async (localConfig) => {
|
|
22
|
+
return (localConfig?.plugins ?? []).map(toDeferResolve);
|
|
24
23
|
};
|
|
25
24
|
export default {
|
|
26
25
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Release It!';
|
|
3
4
|
const enablers = ['release-it'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -13,8 +14,8 @@ const resolveConfig = (config, options) => {
|
|
|
13
14
|
if (typeof config.gitlab?.releaseNotes === 'string') {
|
|
14
15
|
scripts.push(config.gitlab.releaseNotes);
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
-
return [...plugins, ...
|
|
17
|
+
const inputs = options.getInputsFromScripts(scripts);
|
|
18
|
+
return [...plugins.map(toDependency), ...inputs];
|
|
18
19
|
};
|
|
19
20
|
export default {
|
|
20
21
|
title,
|