knip 5.33.3 → 5.34.1
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 -23
- 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 +17 -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/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 +2 -2
- package/dist/binaries/util.js +5 -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-referenced-inputs.d.ts +5 -0
- package/dist/util/handle-referenced-inputs.js +86 -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.d.ts +0 -4
- 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.d.ts +0 -4
- 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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PluginName } from '../types/PluginNames.js';
|
|
2
|
+
type InputType = 'binary' | 'entry' | 'config' | 'dependency' | 'deferResolve' | 'deferResolveEntry';
|
|
3
|
+
export interface Input {
|
|
4
|
+
type: InputType;
|
|
5
|
+
specifier: string;
|
|
6
|
+
production?: boolean;
|
|
7
|
+
dir?: string;
|
|
8
|
+
containingFilePath?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ConfigInput extends Input {
|
|
11
|
+
type: 'config';
|
|
12
|
+
containingFilePath: string;
|
|
13
|
+
pluginName: PluginName;
|
|
14
|
+
}
|
|
15
|
+
type Options = {
|
|
16
|
+
production?: boolean;
|
|
17
|
+
dir?: string;
|
|
18
|
+
containingFilePath?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const fromBinary: (input: Input) => string;
|
|
21
|
+
export declare const toBinary: (specifier: string, options?: Options) => Input;
|
|
22
|
+
export declare const isBinary: (input: Input) => boolean;
|
|
23
|
+
export declare const toEntry: (specifier: string) => Input;
|
|
24
|
+
export declare const isEntry: (input: Input) => boolean;
|
|
25
|
+
export declare const toProductionEntry: (specifier: string, options?: Options) => Input;
|
|
26
|
+
export declare const isProductionEntry: (input: Input) => boolean;
|
|
27
|
+
export declare const toConfig: (pluginName: PluginName, specifier: string, containingFilePath: string) => ConfigInput;
|
|
28
|
+
export declare const isConfigPattern: (input: Input) => input is ConfigInput;
|
|
29
|
+
export declare const toDependency: (specifier: string) => Input;
|
|
30
|
+
export declare const isDependency: (input: Input) => boolean;
|
|
31
|
+
export declare const toProductionDependency: (specifier: string) => Input;
|
|
32
|
+
export declare const toDevDependency: (specifier: string) => Input;
|
|
33
|
+
export declare const toDeferResolve: (specifier: string) => Input;
|
|
34
|
+
export declare const toDeferResolveEntry: (specifier: string) => Input;
|
|
35
|
+
export declare const isDeferResolveEntry: (input: Input) => boolean;
|
|
36
|
+
export declare const toDebugString: (input: Input) => string;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { toRelative } from './path.js';
|
|
2
|
+
export const fromBinary = (input) => input.specifier;
|
|
3
|
+
export const toBinary = (specifier, options = {}) => ({
|
|
4
|
+
type: 'binary',
|
|
5
|
+
specifier,
|
|
6
|
+
...options,
|
|
7
|
+
});
|
|
8
|
+
export const isBinary = (input) => input.type === 'binary';
|
|
9
|
+
export const toEntry = (specifier) => ({ type: 'entry', specifier });
|
|
10
|
+
export const isEntry = (input) => input.type === 'entry' && !input.production;
|
|
11
|
+
export const toProductionEntry = (specifier, options = {}) => ({
|
|
12
|
+
type: 'entry',
|
|
13
|
+
specifier,
|
|
14
|
+
production: true,
|
|
15
|
+
...options,
|
|
16
|
+
});
|
|
17
|
+
export const isProductionEntry = (input) => input.type === 'entry' && input.production === true;
|
|
18
|
+
export const toConfig = (pluginName, specifier, containingFilePath) => ({
|
|
19
|
+
type: 'config',
|
|
20
|
+
specifier,
|
|
21
|
+
pluginName,
|
|
22
|
+
containingFilePath,
|
|
23
|
+
});
|
|
24
|
+
export const isConfigPattern = (input) => input.type === 'config';
|
|
25
|
+
export const toDependency = (specifier) => ({ type: 'dependency', specifier });
|
|
26
|
+
export const isDependency = (input) => input.type === 'dependency';
|
|
27
|
+
export const toProductionDependency = (specifier) => ({
|
|
28
|
+
type: 'dependency',
|
|
29
|
+
specifier,
|
|
30
|
+
production: true,
|
|
31
|
+
});
|
|
32
|
+
export const toDevDependency = (specifier) => ({ type: 'dependency', specifier });
|
|
33
|
+
export const toDeferResolve = (specifier) => ({ type: 'deferResolve', specifier });
|
|
34
|
+
export const toDeferResolveEntry = (specifier) => ({ type: 'deferResolveEntry', specifier });
|
|
35
|
+
export const isDeferResolveEntry = (input) => input.type === 'deferResolveEntry';
|
|
36
|
+
export const toDebugString = (input) => `${input.type}:${input.specifier} ${input.containingFilePath ? `(${toRelative(input.containingFilePath)})` : ''}`;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import type { Package } from '../
|
|
2
|
-
|
|
1
|
+
import type { Package } from '../types/package-json.js';
|
|
2
|
+
type Packages = Map<string, Package>;
|
|
3
|
+
type WorkspacePkgNames = Set<string>;
|
|
4
|
+
export default function mapWorkspaces(cwd: string, workspaces: string[]): Promise<[Packages, WorkspacePkgNames]>;
|
|
5
|
+
export {};
|
|
@@ -7,10 +7,10 @@ import { join } from './path.js';
|
|
|
7
7
|
import { _require } from './require.js';
|
|
8
8
|
export default async function mapWorkspaces(cwd, workspaces) {
|
|
9
9
|
const [negatedPatterns, patterns] = partition(workspaces, p => p.match(/^!/));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const packages = new Map();
|
|
11
|
+
const wsPkgNames = new Set();
|
|
12
12
|
if (patterns.length === 0 && negatedPatterns.length === 0)
|
|
13
|
-
return [
|
|
13
|
+
return [packages, wsPkgNames];
|
|
14
14
|
const matches = await fg.glob(patterns, {
|
|
15
15
|
cwd,
|
|
16
16
|
onlyDirectories: true,
|
|
@@ -23,9 +23,9 @@ export default async function mapWorkspaces(cwd, workspaces) {
|
|
|
23
23
|
const manifest = _require(filePath);
|
|
24
24
|
const pkgName = getPackageName(manifest, dir);
|
|
25
25
|
const pkg = { dir, name, pkgName, manifest };
|
|
26
|
-
|
|
26
|
+
packages.set(name, pkg);
|
|
27
27
|
if (pkgName)
|
|
28
|
-
|
|
28
|
+
wsPkgNames.add(pkgName);
|
|
29
29
|
else
|
|
30
30
|
throw new ConfigurationError(`Missing package name in ${filePath}`);
|
|
31
31
|
}
|
|
@@ -36,5 +36,5 @@ export default async function mapWorkspaces(cwd, workspaces) {
|
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
return [
|
|
39
|
+
return [packages, wsPkgNames];
|
|
40
40
|
}
|
package/dist/util/modules.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const getPackageNameFromModuleSpecifier: (moduleSpecifier: string) => string | undefined;
|
|
2
2
|
export declare const getPackageNameFromFilePath: (value: string) => string;
|
|
3
|
+
export declare const getPackageNameFromSpecifier: (specifier: string) => string | undefined;
|
|
3
4
|
export declare const isStartsLikePackageName: (specifier: string) => boolean;
|
|
4
5
|
export declare const isDefinitelyTyped: (packageName: string) => boolean;
|
|
5
6
|
export declare const getDefinitelyTypedFor: (packageName: string) => string;
|
package/dist/util/modules.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isBuiltin } from 'node:module';
|
|
2
|
-
import { DT_SCOPE } from '../constants.js';
|
|
3
|
-
import { isAbsolute, toPosix } from './path.js';
|
|
2
|
+
import { DT_SCOPE, PROTOCOL_VIRTUAL } from '../constants.js';
|
|
3
|
+
import { isAbsolute, isInNodeModules, toPosix } from './path.js';
|
|
4
4
|
export const getPackageNameFromModuleSpecifier = (moduleSpecifier) => {
|
|
5
5
|
if (!isStartsLikePackageName(moduleSpecifier))
|
|
6
6
|
return;
|
|
@@ -14,6 +14,7 @@ export const getPackageNameFromFilePath = (value) => {
|
|
|
14
14
|
return match[match.length - 1];
|
|
15
15
|
return value;
|
|
16
16
|
};
|
|
17
|
+
export const getPackageNameFromSpecifier = (specifier) => isInNodeModules(specifier) ? getPackageNameFromFilePath(specifier) : getPackageNameFromModuleSpecifier(specifier);
|
|
17
18
|
export const isStartsLikePackageName = (specifier) => /^(@[a-z0-9._]|[a-z0-9])/.test(specifier);
|
|
18
19
|
export const isDefinitelyTyped = (packageName) => packageName.startsWith(`${DT_SCOPE}/`);
|
|
19
20
|
export const getDefinitelyTypedFor = (packageName) => {
|
|
@@ -36,7 +37,7 @@ export const sanitizeSpecifier = (specifier) => {
|
|
|
36
37
|
return specifier;
|
|
37
38
|
if (isAbsolute(specifier))
|
|
38
39
|
return specifier;
|
|
39
|
-
if (specifier.startsWith(
|
|
40
|
+
if (specifier.startsWith(PROTOCOL_VIRTUAL))
|
|
40
41
|
return specifier;
|
|
41
42
|
return specifier.replace(matchDirectives, '$2');
|
|
42
43
|
};
|
package/dist/util/object.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const getValuesByKeyDeep: (obj: any, key: string) => unknown[];
|
|
2
|
+
export declare const findByKeyDeep: <T>(obj: any, key: string) => T[];
|
|
2
3
|
export declare const getStringValues: (obj: any) => string[];
|
|
3
4
|
export declare const getKeysByValue: <T>(obj: T, value: unknown) => (keyof T)[];
|
|
4
5
|
export declare const get: <T>(obj: T, path: string) => any;
|
package/dist/util/object.js
CHANGED
|
@@ -13,6 +13,25 @@ export const getValuesByKeyDeep = (obj, key) => {
|
|
|
13
13
|
}
|
|
14
14
|
return objects;
|
|
15
15
|
};
|
|
16
|
+
export const findByKeyDeep = (obj, key) => {
|
|
17
|
+
const objects = [];
|
|
18
|
+
if (obj && typeof obj === 'object') {
|
|
19
|
+
if (key in obj) {
|
|
20
|
+
objects.push(obj);
|
|
21
|
+
}
|
|
22
|
+
for (const value of Object.values(obj)) {
|
|
23
|
+
if (Array.isArray(value)) {
|
|
24
|
+
for (const item of value) {
|
|
25
|
+
objects.push(...findByKeyDeep(item, key));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (typeof value === 'object') {
|
|
29
|
+
objects.push(...findByKeyDeep(value, key));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return objects;
|
|
34
|
+
};
|
|
16
35
|
export const getStringValues = (obj) => {
|
|
17
36
|
if (typeof obj === 'string')
|
|
18
37
|
return [obj];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const toCosmiconfig: (moduleName: string, options?: {
|
|
2
|
+
rcPrefix?: string;
|
|
3
|
+
rcSuffix?: string;
|
|
4
|
+
configDir?: boolean;
|
|
5
|
+
configFiles?: boolean;
|
|
6
|
+
configFilesAllExtensions?: boolean;
|
|
7
|
+
additionalExtensions?: string[];
|
|
8
|
+
}) => string[];
|
|
9
|
+
export declare const toLilconfig: (moduleName: string, options?: {
|
|
10
|
+
rcPrefix?: string;
|
|
11
|
+
rcSuffix?: string;
|
|
12
|
+
configDir?: boolean;
|
|
13
|
+
configFiles?: boolean;
|
|
14
|
+
configFilesAllExtensions?: boolean;
|
|
15
|
+
additionalExtensions?: string[];
|
|
16
|
+
}) => string[];
|
|
17
|
+
export declare const toUnconfig: (moduleName: string, options?: {
|
|
18
|
+
rcPrefix?: string;
|
|
19
|
+
rcSuffix?: string;
|
|
20
|
+
configDir?: boolean;
|
|
21
|
+
configFiles?: boolean;
|
|
22
|
+
configFilesAllExtensions?: boolean;
|
|
23
|
+
additionalExtensions?: string[];
|
|
24
|
+
}) => string[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const toConfigMap = (defaultExtensions, builderConfig) => (moduleName, options) => {
|
|
2
|
+
const config = {
|
|
3
|
+
rcPrefix: '.',
|
|
4
|
+
rcSuffix: 'rc',
|
|
5
|
+
configDir: true,
|
|
6
|
+
configFiles: true,
|
|
7
|
+
configFilesAllExtensions: false,
|
|
8
|
+
additionalExtensions: [],
|
|
9
|
+
...builderConfig,
|
|
10
|
+
...options,
|
|
11
|
+
};
|
|
12
|
+
const { rcPrefix, rcSuffix } = config;
|
|
13
|
+
const jsTypeExtensions = ['js', 'ts', 'cjs', 'mjs', 'cts', 'mts'];
|
|
14
|
+
const extensions = [...defaultExtensions, ...config.additionalExtensions];
|
|
15
|
+
const baseFiles = [
|
|
16
|
+
`${rcPrefix}${moduleName}${rcSuffix}`,
|
|
17
|
+
...(config.configDir ? [`.config/${moduleName}${rcSuffix}`] : []),
|
|
18
|
+
];
|
|
19
|
+
const rcFiles = `${rcPrefix}${moduleName}${rcSuffix}.{${extensions.join(',')}}`;
|
|
20
|
+
const configExtensions = extensions.filter(ext => config.configFilesAllExtensions || jsTypeExtensions.includes(ext));
|
|
21
|
+
const configFiles = config.configFiles ? [`${moduleName}.config.{${configExtensions.join(',')}}`] : [];
|
|
22
|
+
const configDirFiles = config.configDir ? [`.config/${moduleName}${rcSuffix}.{${extensions.join(',')}}`] : [];
|
|
23
|
+
return [...baseFiles, rcFiles, ...configFiles, ...configDirFiles];
|
|
24
|
+
};
|
|
25
|
+
export const toCosmiconfig = toConfigMap(['json', 'yaml', 'yml', 'js', 'ts', 'cjs', 'mjs'], { configDir: true });
|
|
26
|
+
export const toLilconfig = toConfigMap(['json', 'js', 'cjs', 'mjs'], { configDir: true });
|
|
27
|
+
export const toUnconfig = toConfigMap(['json', 'ts', 'mts', 'cts', 'js', 'mjs', 'cjs'], {
|
|
28
|
+
configDir: false,
|
|
29
|
+
rcPrefix: '',
|
|
30
|
+
rcSuffix: '',
|
|
31
|
+
configFiles: false,
|
|
32
|
+
});
|
package/dist/util/plugin.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export { _getDependenciesFromScripts as getDependenciesFromScripts } from '../binaries/index.js';
|
|
2
1
|
export { _loadJSON as loadJSON } from './fs.js';
|
|
3
2
|
export { _load as load } from './loader.js';
|
|
4
|
-
|
|
5
|
-
import type
|
|
6
|
-
import type { Plugin, PluginOptions } from '../types/plugins.js';
|
|
7
|
-
export declare const toCamelCase: (name: string) => string;
|
|
3
|
+
import type { Plugin, PluginOptions, RawPluginConfiguration } from '../types/config.js';
|
|
4
|
+
import { type Input } from './input.js';
|
|
8
5
|
export declare const hasDependency: (dependencies: Set<string>, values: (string | RegExp)[]) => boolean;
|
|
9
6
|
export declare const normalizePluginConfig: (pluginConfig: RawPluginConfiguration) => boolean | {
|
|
10
7
|
config: string[] | null;
|
|
@@ -12,29 +9,4 @@ export declare const normalizePluginConfig: (pluginConfig: RawPluginConfiguratio
|
|
|
12
9
|
project: string[] | null;
|
|
13
10
|
};
|
|
14
11
|
export declare const loadConfigForPlugin: (configFilePath: string, plugin: Plugin, options: PluginOptions, pluginName: string) => Promise<any>;
|
|
15
|
-
export declare const getFinalEntryPaths: (plugin: Plugin, options: PluginOptions, configEntryPaths:
|
|
16
|
-
export declare const toCosmiconfig: (moduleName: string, options?: {
|
|
17
|
-
rcPrefix?: string;
|
|
18
|
-
rcSuffix?: string;
|
|
19
|
-
configDir?: boolean;
|
|
20
|
-
configFiles?: boolean;
|
|
21
|
-
configFilesAllExtensions?: boolean;
|
|
22
|
-
additionalExtensions?: string[];
|
|
23
|
-
}) => string[];
|
|
24
|
-
export declare const toLilconfig: (moduleName: string, options?: {
|
|
25
|
-
rcPrefix?: string;
|
|
26
|
-
rcSuffix?: string;
|
|
27
|
-
configDir?: boolean;
|
|
28
|
-
configFiles?: boolean;
|
|
29
|
-
configFilesAllExtensions?: boolean;
|
|
30
|
-
additionalExtensions?: string[];
|
|
31
|
-
}) => string[];
|
|
32
|
-
export declare const toUnconfig: (moduleName: string, options?: {
|
|
33
|
-
rcPrefix?: string;
|
|
34
|
-
rcSuffix?: string;
|
|
35
|
-
configDir?: boolean;
|
|
36
|
-
configFiles?: boolean;
|
|
37
|
-
configFilesAllExtensions?: boolean;
|
|
38
|
-
additionalExtensions?: string[];
|
|
39
|
-
}) => string[];
|
|
40
|
-
export declare const resolveEntry: (options: PluginOptions, specifier: string, rootDir?: string) => string;
|
|
12
|
+
export declare const getFinalEntryPaths: (plugin: Plugin, options: PluginOptions, configEntryPaths: Input[]) => Input[];
|
package/dist/util/plugin.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
export { _getDependenciesFromScripts as getDependenciesFromScripts } from '../binaries/index.js';
|
|
2
1
|
export { _loadJSON as loadJSON } from './fs.js';
|
|
3
2
|
export { _load as load } from './loader.js';
|
|
4
|
-
export { _resolveSync as resolve } from './resolve.js';
|
|
5
3
|
import { arrayify } from './array.js';
|
|
4
|
+
import { toEntry, toProductionEntry } from './input.js';
|
|
6
5
|
import { _load as load } from './loader.js';
|
|
7
6
|
import { get } from './object.js';
|
|
8
|
-
import { basename
|
|
9
|
-
import { toEntryPattern, toProductionEntryPattern } from './protocols.js';
|
|
10
|
-
import { _resolveSync } from './resolve.js';
|
|
11
|
-
export const toCamelCase = (name) => name.toLowerCase().replace(/(-[a-z])/g, group => group.toUpperCase().replace('-', ''));
|
|
7
|
+
import { basename } from './path.js';
|
|
12
8
|
export const hasDependency = (dependencies, values) => values.some(value => {
|
|
13
9
|
if (typeof value === 'string') {
|
|
14
10
|
return dependencies.has(value);
|
|
@@ -50,52 +46,11 @@ export const loadConfigForPlugin = async (configFilePath, plugin, options, plugi
|
|
|
50
46
|
export const getFinalEntryPaths = (plugin, options, configEntryPaths) => {
|
|
51
47
|
const { config, isProduction } = options;
|
|
52
48
|
if (plugin.title === 'Storybook')
|
|
53
|
-
return [...(config.entry ?? []).map(
|
|
54
|
-
const toEntryPathProtocol = isProduction && plugin.production && plugin.production.length > 0 ?
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
const toConfigMap = (defaultExtensions, builderConfig) => (moduleName, options) => {
|
|
62
|
-
const config = {
|
|
63
|
-
rcPrefix: '.',
|
|
64
|
-
rcSuffix: 'rc',
|
|
65
|
-
configDir: true,
|
|
66
|
-
configFiles: true,
|
|
67
|
-
configFilesAllExtensions: false,
|
|
68
|
-
additionalExtensions: [],
|
|
69
|
-
...builderConfig,
|
|
70
|
-
...options,
|
|
71
|
-
};
|
|
72
|
-
const { rcPrefix, rcSuffix } = config;
|
|
73
|
-
const jsTypeExtensions = ['js', 'ts', 'cjs', 'mjs', 'cts', 'mts'];
|
|
74
|
-
const extensions = [...defaultExtensions, ...config.additionalExtensions];
|
|
75
|
-
const baseFiles = [
|
|
76
|
-
`${rcPrefix}${moduleName}${rcSuffix}`,
|
|
77
|
-
...(config.configDir ? [`.config/${moduleName}${rcSuffix}`] : []),
|
|
78
|
-
];
|
|
79
|
-
const rcFiles = `${rcPrefix}${moduleName}${rcSuffix}.{${extensions.join(',')}}`;
|
|
80
|
-
const configExtensions = extensions.filter(ext => config.configFilesAllExtensions || jsTypeExtensions.includes(ext));
|
|
81
|
-
const configFiles = config.configFiles ? [`${moduleName}.config.{${configExtensions.join(',')}}`] : [];
|
|
82
|
-
const configDirFiles = config.configDir ? [`.config/${moduleName}${rcSuffix}.{${extensions.join(',')}}`] : [];
|
|
83
|
-
return [...baseFiles, rcFiles, ...configFiles, ...configDirFiles];
|
|
84
|
-
};
|
|
85
|
-
export const toCosmiconfig = toConfigMap(['json', 'yaml', 'yml', 'js', 'ts', 'cjs', 'mjs'], { configDir: true });
|
|
86
|
-
export const toLilconfig = toConfigMap(['json', 'js', 'cjs', 'mjs'], { configDir: true });
|
|
87
|
-
export const toUnconfig = toConfigMap(['json', 'ts', 'mts', 'cts', 'js', 'mjs', 'cjs'], {
|
|
88
|
-
configDir: false,
|
|
89
|
-
rcPrefix: '',
|
|
90
|
-
rcSuffix: '',
|
|
91
|
-
configFiles: false,
|
|
92
|
-
});
|
|
93
|
-
export const resolveEntry = (options, specifier, rootDir = '.') => {
|
|
94
|
-
const { configFileDir } = options;
|
|
95
|
-
const resolvedPath = isAbsolute(specifier)
|
|
96
|
-
? specifier
|
|
97
|
-
: _resolveSync(join(configFileDir, rootDir, specifier), join(configFileDir, rootDir));
|
|
98
|
-
if (resolvedPath)
|
|
99
|
-
return toEntryPattern(relative(configFileDir, resolvedPath));
|
|
100
|
-
return specifier;
|
|
49
|
+
return [...(config.entry ?? []).map(toEntry), ...configEntryPaths];
|
|
50
|
+
const toEntryPathProtocol = isProduction && plugin.production && plugin.production.length > 0 ? toProductionEntry : toEntry;
|
|
51
|
+
if (config.entry)
|
|
52
|
+
return config.entry.map(id => toEntryPathProtocol(id));
|
|
53
|
+
if (configEntryPaths.length > 0)
|
|
54
|
+
return configEntryPaths;
|
|
55
|
+
return [...(plugin.entry ?? []).map(toEntry), ...(plugin.production ?? []).map(id => toProductionEntry(id))];
|
|
101
56
|
};
|
package/dist/util/regex.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const isRegexLikeMatch = /[*+\\(|{^$]/;
|
|
2
|
+
const isRegexLike = (value) => isRegexLikeMatch.test(value);
|
|
3
|
+
export const toRegexOrString = (value) => typeof value === 'string' && isRegexLike(value) ? new RegExp(value) : value;
|
|
3
4
|
export const findMatch = (haystack, needle) => haystack?.find(n => (typeof n === 'string' ? n === needle : n.test(needle)));
|
|
4
5
|
const idCharMatch = /[a-zA-Z0-9$_]/;
|
|
5
6
|
export const isIdChar = (text) => idCharMatch.test(text);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.34.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.34.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.1",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"type": "module",
|
|
37
37
|
"types": "./dist/index.d.ts",
|
|
38
|
-
"imports": {
|
|
39
|
-
"#p/*.ts": "./src/*.ts",
|
|
40
|
-
"#p/*.js": "./dist/*.js"
|
|
41
|
-
},
|
|
42
38
|
"scripts": {
|
|
43
39
|
"knip": "node ./dist/cli.js --directory ../..",
|
|
44
40
|
"knip:production": "node ./dist/cli.js --directory ../.. --production --strict",
|
|
@@ -52,7 +48,8 @@
|
|
|
52
48
|
"qa": "bun lint && bun run build && bun knip && bun knip:production && bun run test",
|
|
53
49
|
"release": "release-it",
|
|
54
50
|
"create-plugin": "bun ./scripts/create-new-plugin.ts",
|
|
55
|
-
"postcreate-plugin": "biome format --write schema.json schema-jsonc.json src/ConfigurationValidator.ts"
|
|
51
|
+
"postcreate-plugin": "biome format --write schema.json schema-jsonc.json src/ConfigurationValidator.ts",
|
|
52
|
+
"generate-plugin-types": "bun ./scripts/generate-plugin-types.ts"
|
|
56
53
|
},
|
|
57
54
|
"files": [
|
|
58
55
|
"dist",
|
|
@@ -85,15 +82,15 @@
|
|
|
85
82
|
"devDependencies": {
|
|
86
83
|
"@jest/types": "^29.6.3",
|
|
87
84
|
"@release-it/bumper": "^6.0.1",
|
|
88
|
-
"@types/bun": "^1.1.
|
|
85
|
+
"@types/bun": "^1.1.11",
|
|
89
86
|
"@types/js-yaml": "^4.0.9",
|
|
90
87
|
"@types/minimist": "^1.2.5",
|
|
91
88
|
"@types/picomatch": "3.0.1",
|
|
92
89
|
"@types/webpack": "^5.28.5",
|
|
93
|
-
"@wdio/types": "^9.1.
|
|
90
|
+
"@wdio/types": "^9.1.3",
|
|
94
91
|
"glob": "^10.4.2",
|
|
95
|
-
"release-it": "^17.
|
|
96
|
-
"type-fest": "^4.
|
|
92
|
+
"release-it": "^17.10.0",
|
|
93
|
+
"type-fest": "^4.26.1",
|
|
97
94
|
"typescript": "^5.5.2"
|
|
98
95
|
},
|
|
99
96
|
"engines": {
|
package/schema.json
CHANGED
|
@@ -296,6 +296,10 @@
|
|
|
296
296
|
"title": "Babel plugin configuration (https://knip.dev/reference/plugins/babel)",
|
|
297
297
|
"$ref": "#/definitions/plugin"
|
|
298
298
|
},
|
|
299
|
+
"c8": {
|
|
300
|
+
"title": "c8 plugin configuration (https://knip.dev/reference/plugins/c8)",
|
|
301
|
+
"$ref": "#/definitions/plugin"
|
|
302
|
+
},
|
|
299
303
|
"capacitor": {
|
|
300
304
|
"title": "Capacitor plugin configuration (https://knip.dev/reference/plugins/capacitor)",
|
|
301
305
|
"$ref": "#/definitions/plugin"
|
|
@@ -324,6 +328,10 @@
|
|
|
324
328
|
"title": "Cypress plugin configuration (https://knip.dev/reference/plugins/cypress)",
|
|
325
329
|
"$ref": "#/definitions/plugin"
|
|
326
330
|
},
|
|
331
|
+
"dotenv": {
|
|
332
|
+
"title": "dotenv plugin configuration (https://knip.dev/reference/plugins/dotenv)",
|
|
333
|
+
"$ref": "#/definitions/plugin"
|
|
334
|
+
},
|
|
327
335
|
"drizzle": {
|
|
328
336
|
"title": "Drizzle plugin configuration (https://knip.dev/reference/plugins/drizzle)",
|
|
329
337
|
"$ref": "#/definitions/plugin"
|
|
@@ -408,10 +416,18 @@
|
|
|
408
416
|
"title": "Next.js plugin configuration (https://knip.dev/reference/plugins/main)",
|
|
409
417
|
"$ref": "#/definitions/plugin"
|
|
410
418
|
},
|
|
419
|
+
"node": {
|
|
420
|
+
"title": "node plugin configuration (https://knip.dev/reference/plugins/node)",
|
|
421
|
+
"$ref": "#/definitions/plugin"
|
|
422
|
+
},
|
|
411
423
|
"node-test-runner": {
|
|
412
424
|
"title": "node-test-runner plugin configuration (https://knip.dev/reference/plugins/node-test-runner)",
|
|
413
425
|
"$ref": "#/definitions/plugin"
|
|
414
426
|
},
|
|
427
|
+
"nodemon": {
|
|
428
|
+
"title": "nodemon plugin configuration (https://knip.dev/reference/plugins/nodemon)",
|
|
429
|
+
"$ref": "#/definitions/plugin"
|
|
430
|
+
},
|
|
415
431
|
"npm-package-json-lint": {
|
|
416
432
|
"title": "npm-package-json-lint plugin configuration (https://knip.dev/reference/plugins/npm-package-json-lint)",
|
|
417
433
|
"$ref": "#/definitions/plugin"
|
|
@@ -440,6 +456,10 @@
|
|
|
440
456
|
"title": "Playwright for components plugin configuration (https://knip.dev/reference/plugins/playwright-ct)",
|
|
441
457
|
"$ref": "#/definitions/plugin"
|
|
442
458
|
},
|
|
459
|
+
"playwright-test": {
|
|
460
|
+
"title": "playwright-test plugin configuration (https://knip.dev/reference/plugins/playwright-test)",
|
|
461
|
+
"$ref": "#/definitions/plugin"
|
|
462
|
+
},
|
|
443
463
|
"postcss": {
|
|
444
464
|
"title": "PostCSS plugin configuration (https://knip.dev/reference/plugins/postcss)",
|
|
445
465
|
"$ref": "#/definitions/plugin"
|
|
@@ -524,10 +544,18 @@
|
|
|
524
544
|
"title": "travis plugin configuration (https://knip.dev/reference/plugins/travis)",
|
|
525
545
|
"$ref": "#/definitions/plugin"
|
|
526
546
|
},
|
|
547
|
+
"ts-node": {
|
|
548
|
+
"title": "ts-node plugin configuration (https://knip.dev/reference/plugins/ts-node)",
|
|
549
|
+
"$ref": "#/definitions/plugin"
|
|
550
|
+
},
|
|
527
551
|
"tsup": {
|
|
528
552
|
"title": "tsup plugin configuration (https://knip.dev/reference/plugins/tsup)",
|
|
529
553
|
"$ref": "#/definitions/plugin"
|
|
530
554
|
},
|
|
555
|
+
"tsx": {
|
|
556
|
+
"title": "tsx plugin configuration (https://knip.dev/reference/plugins/tsx)",
|
|
557
|
+
"$ref": "#/definitions/plugin"
|
|
558
|
+
},
|
|
531
559
|
"typedoc": {
|
|
532
560
|
"title": "typedoc plugin configuration (https://knip.dev/reference/plugins/typedoc)",
|
|
533
561
|
"$ref": "#/definitions/plugin"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { toBinary } from '../../util/protocols.js';
|
|
3
|
-
import { argsFrom } from '../util.js';
|
|
4
|
-
export const resolve = (binary, args, { fromArgs }) => {
|
|
5
|
-
const parsed = parseArgs(args, {
|
|
6
|
-
boolean: ['all', 'check-coverage', 'clean', 'exclude-after-remap', 'per-file', 'skip-full'],
|
|
7
|
-
});
|
|
8
|
-
parsed._ = parsed._.filter(a => a !== 'check-coverage');
|
|
9
|
-
const rest = argsFrom(args, parsed._[0]);
|
|
10
|
-
return [toBinary(binary), ...fromArgs(rest)];
|
|
11
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { toBinary } from '../../util/protocols.js';
|
|
3
|
-
import { argsFrom } from '../util.js';
|
|
4
|
-
export const resolve = (binary, args, { fromArgs }) => {
|
|
5
|
-
const parsed = parseArgs(args);
|
|
6
|
-
return [toBinary(binary), ...fromArgs(argsFrom(args, parsed._[0]))];
|
|
7
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
3
|
-
import { toBinary } from '../../util/protocols.js';
|
|
4
|
-
import { tryResolveFilePath, tryResolveSpecifiers } from '../util.js';
|
|
5
|
-
const withPositional = parsed => [parsed._[0], parsed.require].flat();
|
|
6
|
-
const withoutPositional = parsed => [parsed.require].flat();
|
|
7
|
-
const withoutRequire = () => [];
|
|
8
|
-
const argFilters = {
|
|
9
|
-
adb: withoutRequire,
|
|
10
|
-
deploy: withoutRequire,
|
|
11
|
-
'babel-node': withPositional,
|
|
12
|
-
esbuild: withPositional,
|
|
13
|
-
execa: withPositional,
|
|
14
|
-
vitest: withoutRequire,
|
|
15
|
-
'vite-node': withPositional,
|
|
16
|
-
zx: withPositional,
|
|
17
|
-
default: withoutPositional,
|
|
18
|
-
};
|
|
19
|
-
const spawningBinaries = ['cross-env', 'retry-cli'];
|
|
20
|
-
export const resolve = (binary, args, { cwd, fromArgs }) => {
|
|
21
|
-
const parsed = parseArgs(args, { string: ['r'], alias: { require: ['r', 'loader'] }, boolean: ['quiet', 'verbose'] });
|
|
22
|
-
const bin = binary.startsWith('.') ? tryResolveFilePath(cwd, binary) : toBinary(binary);
|
|
23
|
-
const filteredArgs = binary in argFilters ? argFilters[binary](parsed) : argFilters.default(parsed);
|
|
24
|
-
const shiftedArgs = spawningBinaries.includes(binary) ? fromArgs(args) : [];
|
|
25
|
-
return compact([bin, ...tryResolveSpecifiers(cwd, filteredArgs), ...shiftedArgs]);
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
bun: import("../types.js").Resolver;
|
|
3
|
-
c8: import("../types.js").Resolver;
|
|
4
|
-
dotenv: import("../types.js").Resolver;
|
|
5
|
-
node: import("../types.js").Resolver;
|
|
6
|
-
nodemon: import("../types.js").Resolver;
|
|
7
|
-
npx: import("../types.js").Resolver;
|
|
8
|
-
nx: import("../types.js").Resolver;
|
|
9
|
-
pnpm: import("../types.js").Resolver;
|
|
10
|
-
rollup: import("../types.js").Resolver;
|
|
11
|
-
'ts-node': import("../types.js").Resolver;
|
|
12
|
-
tsx: import("../types.js").Resolver;
|
|
13
|
-
yarn: import("../types.js").Resolver;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as bun from './bun.js';
|
|
2
|
-
import * as c8 from './c8.js';
|
|
3
|
-
import * as dotenv from './dotenv.js';
|
|
4
|
-
import * as node from './node.js';
|
|
5
|
-
import * as nodemon from './nodemon.js';
|
|
6
|
-
import * as npx from './npx.js';
|
|
7
|
-
import * as nx from './nx.js';
|
|
8
|
-
import * as pnpm from './pnpm.js';
|
|
9
|
-
import * as rollup from './rollup.js';
|
|
10
|
-
import * as tsNode from './ts-node.js';
|
|
11
|
-
import * as tsx from './tsx.js';
|
|
12
|
-
import * as yarn from './yarn.js';
|
|
13
|
-
export default {
|
|
14
|
-
bun: bun.resolve,
|
|
15
|
-
c8: c8.resolve,
|
|
16
|
-
dotenv: dotenv.resolve,
|
|
17
|
-
node: node.resolve,
|
|
18
|
-
nodemon: nodemon.resolve,
|
|
19
|
-
npx: npx.resolve,
|
|
20
|
-
nx: nx.resolve,
|
|
21
|
-
pnpm: pnpm.resolve,
|
|
22
|
-
rollup: rollup.resolve,
|
|
23
|
-
'ts-node': tsNode.resolve,
|
|
24
|
-
tsx: tsx.resolve,
|
|
25
|
-
yarn: yarn.resolve,
|
|
26
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
3
|
-
import { tryResolveFilePath, tryResolveSpecifiers } from '../util.js';
|
|
4
|
-
export const parseNodeArgs = (args) => parseArgs(args, {
|
|
5
|
-
string: ['r'],
|
|
6
|
-
alias: { require: ['r', 'loader', 'experimental-loader', 'test-reporter', 'watch', 'import'] },
|
|
7
|
-
});
|
|
8
|
-
export const resolve = (_binary, args, { cwd }) => {
|
|
9
|
-
const parsed = parseNodeArgs(args);
|
|
10
|
-
return compact([tryResolveFilePath(cwd, parsed._[0]), ...tryResolveSpecifiers(cwd, [parsed.require].flat())]);
|
|
11
|
-
};
|