knip 5.83.0 → 5.84.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 +24 -0
- package/dist/IssueCollector.d.ts +15 -2
- package/dist/IssueCollector.js +59 -9
- package/dist/ProjectPrincipal.d.ts +2 -1
- package/dist/ProjectPrincipal.js +2 -1
- package/dist/WorkspaceWorker.d.ts +4 -1
- package/dist/WorkspaceWorker.js +69 -13
- package/dist/binaries/bash-parser.d.ts +0 -1
- package/dist/binaries/bash-parser.js +2 -3
- package/dist/binaries/fallback.js +1 -1
- package/dist/binaries/package-manager/npm.js +1 -1
- package/dist/binaries/package-manager/pnpm.js +3 -2
- package/dist/binaries/package-manager/yarn.js +1 -1
- package/dist/binaries/plugins.js +1 -0
- package/dist/compilers/compilers.d.ts +3 -3
- package/dist/compilers/index.d.ts +45 -4
- package/dist/compilers/index.js +6 -20
- package/dist/compilers/scss.d.ts +2 -2
- package/dist/compilers/types.d.ts +6 -5
- package/dist/constants.js +1 -0
- package/dist/graph/analyze.js +11 -0
- package/dist/graph/build.js +29 -15
- package/dist/plugins/astro/compiler-mdx.d.ts +2 -0
- package/dist/{compilers/astro-mdx.js → plugins/astro/compiler-mdx.js} +2 -4
- package/dist/plugins/astro/compiler.d.ts +2 -0
- package/dist/{compilers/astro.js → plugins/astro/compiler.js} +2 -3
- package/dist/plugins/astro/index.js +10 -0
- package/dist/plugins/bun/index.js +14 -5
- package/dist/plugins/bun/types.d.ts +5 -0
- package/dist/plugins/bun/types.js +1 -0
- package/dist/plugins/c8/index.js +1 -1
- package/dist/plugins/convex/index.js +1 -1
- package/dist/plugins/dotenv/index.js +8 -1
- package/dist/plugins/execa/index.d.ts +3 -0
- package/dist/plugins/execa/index.js +15 -0
- package/dist/{typescript/visitors/scripts → plugins/execa/visitors}/execa.js +3 -3
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.js +8 -0
- package/dist/plugins/jest/index.js +2 -2
- package/dist/plugins/metro/index.js +8 -2
- package/dist/plugins/nx/index.js +1 -1
- package/dist/plugins/pm2/index.d.ts +3 -0
- package/dist/plugins/pm2/index.js +34 -0
- package/dist/plugins/pm2/types.d.ts +9 -0
- package/dist/plugins/pm2/types.js +1 -0
- package/dist/plugins/prettier/index.js +2 -0
- package/dist/plugins/prisma/compiler.d.ts +2 -0
- package/dist/{compilers/prisma.js → plugins/prisma/compiler.js} +1 -2
- package/dist/plugins/prisma/index.js +6 -0
- package/dist/plugins/react-native/index.d.ts +3 -0
- package/dist/plugins/react-native/index.js +38 -0
- package/dist/plugins/react-native/types.d.ts +7 -0
- package/dist/plugins/react-native/types.js +1 -0
- package/dist/plugins/svelte/compiler.d.ts +2 -0
- package/dist/plugins/svelte/compiler.js +3 -0
- package/dist/plugins/svelte/index.js +6 -0
- package/dist/plugins/tailwind/compiler.d.ts +2 -0
- package/dist/{compilers/tailwind.js → plugins/tailwind/compiler.js} +2 -3
- package/dist/plugins/tailwind/index.js +6 -0
- package/dist/plugins/typescript/index.js +2 -2
- package/dist/plugins/vite/helpers.d.ts +2 -0
- package/dist/plugins/vite/helpers.js +23 -0
- package/dist/plugins/vite/index.js +10 -1
- package/dist/plugins/vite/visitors/importMetaGlob.d.ts +2 -0
- package/dist/plugins/vite/visitors/importMetaGlob.js +32 -0
- package/dist/plugins/vitest/index.js +24 -9
- package/dist/plugins/vue/compiler.d.ts +2 -0
- package/dist/plugins/vue/compiler.js +3 -0
- package/dist/plugins/vue/index.js +6 -0
- package/dist/plugins/webpack/index.js +15 -6
- package/dist/plugins/webpack/visitors/requireContext.d.ts +2 -0
- package/dist/plugins/webpack/visitors/requireContext.js +29 -0
- package/dist/plugins/yarn/index.js +18 -0
- package/dist/plugins/zx/index.d.ts +3 -0
- package/dist/plugins/zx/index.js +15 -0
- package/dist/{typescript/visitors/scripts → plugins/zx/visitors}/zx.js +2 -2
- package/dist/reporters/util/configuration-hints.js +3 -0
- package/dist/reporters/util/util.js +2 -2
- package/dist/run.d.ts +1 -1
- package/dist/schema/configuration.d.ts +60 -0
- package/dist/schema/plugins.d.ts +20 -0
- package/dist/schema/plugins.js +4 -0
- package/dist/session/session.d.ts +1 -1
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +4 -0
- package/dist/types/config.d.ts +26 -4
- package/dist/types/issues.d.ts +1 -1
- package/dist/typescript/ast-helpers.d.ts +2 -0
- package/dist/typescript/ast-helpers.js +55 -6
- package/dist/typescript/get-imports-and-exports.d.ts +2 -2
- package/dist/typescript/get-imports-and-exports.js +5 -5
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +2 -1
- package/dist/typescript/visitors/dynamic-imports/index.js +3 -2
- package/dist/typescript/visitors/dynamic-imports/moduleRegister.d.ts +3 -0
- package/dist/typescript/visitors/dynamic-imports/moduleRegister.js +25 -0
- package/dist/typescript/visitors/index.d.ts +2 -0
- package/dist/typescript/visitors/scripts/index.d.ts +2 -1
- package/dist/typescript/visitors/scripts/index.js +2 -4
- package/dist/util/cli-arguments.d.ts +1 -1
- package/dist/util/cli-arguments.js +5 -3
- package/dist/util/create-input-handler.js +8 -4
- package/dist/util/create-options.d.ts +40 -0
- package/dist/util/jiti.d.ts +1 -5
- package/dist/util/jiti.js +2 -7
- package/dist/util/loader.js +1 -1
- package/dist/util/modules.d.ts +1 -0
- package/dist/util/modules.js +1 -0
- package/dist/util/watch.d.ts +1 -1
- package/dist/util/watch.js +9 -2
- package/dist/util/workspace-selectors.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +19 -0
- package/dist/compilers/astro-mdx.d.ts +0 -6
- package/dist/compilers/astro.d.ts +0 -6
- package/dist/compilers/prisma.d.ts +0 -6
- package/dist/compilers/svelte.d.ts +0 -6
- package/dist/compilers/svelte.js +0 -4
- package/dist/compilers/tailwind.d.ts +0 -6
- package/dist/compilers/vue.d.ts +0 -6
- package/dist/compilers/vue.js +0 -4
- /package/dist/{typescript/visitors/scripts → plugins/execa/visitors}/execa.d.ts +0 -0
- /package/dist/{typescript/visitors/scripts → plugins/zx/visitors}/zx.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const helpText = "\u2702\uFE0F Find unused dependencies, exports and files in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -h, --help Print this help text\n -V, --version Print version\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\n -c, --config [file] Configuration file path
|
|
1
|
+
export declare const helpText = "\u2702\uFE0F Find unused dependencies, exports and files in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -h, --help Print this help text\n -V, --version Print version\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\n -c, --config [file] Configuration file path\n (default: [.]knip.json[c], knip.(js|ts), knip.config.(js|ts) or package.json#knip)\n --use-tsconfig-files Use tsconfig.json to define project files (override `project` patterns)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n\nMode\n --cache Enable caching\n --cache-location Change cache location (default: node_modules/.cache/knip)\n --include-entry-exports Include entry files when reporting unused exports\n --include-libs Include type definitions from external dependencies (default: false)\n --isolate-workspaces Isolate workspaces into separate programs\n --no-gitignore Don't respect .gitignore\n --production Analyze only production source files (e.g. no test files, devDependencies)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --watch Watch mode\n\nScope\n -W, --workspace [filter] Filter workspaces by name, directory, or glob (can be repeated)\n --directory [dir] Run process from a different directory (default: cwd)\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,binaries,unresolved,catalog\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --files Shortcut for --include files\n --tags Include or exclude tagged exports\n\nFix\n --fix Fix issues (modifies files in your repo)\n --fix-type Fix only issues of type, can be comma-separated or repeated (2)\n --allow-remove-files Allow Knip to remove files (with --fix)\n --format Format modified files after --fix using the local formatter\n\nOutput\n --preprocessor Preprocess the results before providing it to the reporter(s), can be repeated\n --preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)\n --reporter Select reporter (default: symbols), can be repeated (3)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-config-hints Suppress configuration hints\n --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints\n --max-issues Maximum number of total issues before non-zero exit code (default: 0)\n --max-show-issues Maximum number of issues to display per type\n --no-exit-code Always exit with code zero (0)\n\nTroubleshooting\n -d, --debug Show debug output\n --memory Measure memory usage and display data table\n --memory-realtime Log memory usage in realtime\n --performance Measure count and running time of key functions and display stats table\n --performance-fn [name] Measure only function [name]\n --trace Show trace output\n --trace-dependency [name] Show files that import the named dependency\n --trace-export [name] Show trace output for named export(s)\n --trace-file [file] Show trace output for exports in file\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates, catalog\n(2) Fixable issue types: dependencies, exports, types, files, catalog\n(3) Built-in reporters: symbols (default), compact, codeowners, json, codeclimate, markdown, disclosure, github-actions\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip --workspace @myorg/* --workspace '!@myorg/legacy'\n$ knip --workspace './apps/*' --workspace '@shared/utils'\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --tags=-lintignore\n\nWebsite: https://knip.dev";
|
|
2
2
|
export type ParsedCLIArgs = ReturnType<typeof parseCLIArgs>;
|
|
3
3
|
export default function parseCLIArgs(): {
|
|
4
4
|
cache?: boolean | undefined;
|
|
@@ -7,7 +7,8 @@ Options:
|
|
|
7
7
|
-h, --help Print this help text
|
|
8
8
|
-V, --version Print version
|
|
9
9
|
-n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)
|
|
10
|
-
-c, --config [file] Configuration file path
|
|
10
|
+
-c, --config [file] Configuration file path
|
|
11
|
+
(default: [.]knip.json[c], knip.(js|ts), knip.config.(js|ts) or package.json#knip)
|
|
11
12
|
--use-tsconfig-files Use tsconfig.json to define project files (override \`project\` patterns)
|
|
12
13
|
-t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)
|
|
13
14
|
|
|
@@ -41,7 +42,7 @@ Fix
|
|
|
41
42
|
Output
|
|
42
43
|
--preprocessor Preprocess the results before providing it to the reporter(s), can be repeated
|
|
43
44
|
--preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)
|
|
44
|
-
--reporter Select reporter: symbols,
|
|
45
|
+
--reporter Select reporter (default: symbols), can be repeated (3)
|
|
45
46
|
--reporter-options Pass extra options to the reporter (as JSON string, see example)
|
|
46
47
|
--no-config-hints Suppress configuration hints
|
|
47
48
|
--treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints
|
|
@@ -61,7 +62,8 @@ Troubleshooting
|
|
|
61
62
|
--trace-file [file] Show trace output for exports in file
|
|
62
63
|
|
|
63
64
|
(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates, catalog
|
|
64
|
-
(2) Fixable issue types: dependencies, exports, types, catalog
|
|
65
|
+
(2) Fixable issue types: dependencies, exports, types, files, catalog
|
|
66
|
+
(3) Built-in reporters: symbols (default), compact, codeowners, json, codeclimate, markdown, disclosure, github-actions
|
|
65
67
|
|
|
66
68
|
Examples:
|
|
67
69
|
|
|
@@ -3,7 +3,11 @@ import { debugLog } from './debug.js';
|
|
|
3
3
|
import { fromBinary, isBinary, isConfig, isDeferResolve, isDeferResolveEntry, isDependency, toDebugString, } from './input.js';
|
|
4
4
|
import { getPackageNameFromSpecifier } from './modules.js';
|
|
5
5
|
import { dirname, isAbsolute, isInNodeModules, isInternal, join } from './path.js';
|
|
6
|
-
import { _resolveSync } from './resolve.js';
|
|
6
|
+
import { _resolveModuleSync, _resolveSync } from './resolve.js';
|
|
7
|
+
const isJoinable = (specifier) => {
|
|
8
|
+
const char = specifier.charCodeAt(0);
|
|
9
|
+
return char !== 35 && char !== 126 && char !== 64 && !isAbsolute(specifier);
|
|
10
|
+
};
|
|
7
11
|
const getWorkspaceFor = (input, chief, workspace) => (input.dir && chief.findWorkspaceByFilePath(`${input.dir}/`)) ||
|
|
8
12
|
(input.containingFilePath && chief.findWorkspaceByFilePath(input.containingFilePath)) ||
|
|
9
13
|
workspace;
|
|
@@ -78,9 +82,9 @@ export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, extern
|
|
|
78
82
|
if (isDeferResolve(input) && deputy.isProduction && !input.production) {
|
|
79
83
|
return;
|
|
80
84
|
}
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
const resolvedFilePath =
|
|
85
|
+
const filePath = isJoinable(specifier) ? join(input.dir ?? dirname(containingFilePath), specifier) : specifier;
|
|
86
|
+
const basePath = input.dir ? join(input.dir, 'file.ts') : containingFilePath;
|
|
87
|
+
const resolvedFilePath = _resolveModuleSync(filePath, basePath);
|
|
84
88
|
if (resolvedFilePath && isInternal(resolvedFilePath)) {
|
|
85
89
|
return isGitIgnored(resolvedFilePath) ? undefined : resolvedFilePath;
|
|
86
90
|
}
|
|
@@ -185,6 +185,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
185
185
|
entry?: string | string[] | undefined;
|
|
186
186
|
project?: string | string[] | undefined;
|
|
187
187
|
} | undefined;
|
|
188
|
+
execa?: string | boolean | string[] | {
|
|
189
|
+
config?: string | string[] | undefined;
|
|
190
|
+
entry?: string | string[] | undefined;
|
|
191
|
+
project?: string | string[] | undefined;
|
|
192
|
+
} | undefined;
|
|
188
193
|
expo?: string | boolean | string[] | {
|
|
189
194
|
config?: string | string[] | undefined;
|
|
190
195
|
entry?: string | string[] | undefined;
|
|
@@ -420,6 +425,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
420
425
|
entry?: string | string[] | undefined;
|
|
421
426
|
project?: string | string[] | undefined;
|
|
422
427
|
} | undefined;
|
|
428
|
+
pm2?: string | boolean | string[] | {
|
|
429
|
+
config?: string | string[] | undefined;
|
|
430
|
+
entry?: string | string[] | undefined;
|
|
431
|
+
project?: string | string[] | undefined;
|
|
432
|
+
} | undefined;
|
|
423
433
|
pnpm?: string | boolean | string[] | {
|
|
424
434
|
config?: string | string[] | undefined;
|
|
425
435
|
entry?: string | string[] | undefined;
|
|
@@ -450,6 +460,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
450
460
|
entry?: string | string[] | undefined;
|
|
451
461
|
project?: string | string[] | undefined;
|
|
452
462
|
} | undefined;
|
|
463
|
+
'react-native'?: string | boolean | string[] | {
|
|
464
|
+
config?: string | string[] | undefined;
|
|
465
|
+
entry?: string | string[] | undefined;
|
|
466
|
+
project?: string | string[] | undefined;
|
|
467
|
+
} | undefined;
|
|
453
468
|
'react-router'?: string | boolean | string[] | {
|
|
454
469
|
config?: string | string[] | undefined;
|
|
455
470
|
entry?: string | string[] | undefined;
|
|
@@ -700,6 +715,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
700
715
|
entry?: string | string[] | undefined;
|
|
701
716
|
project?: string | string[] | undefined;
|
|
702
717
|
} | undefined;
|
|
718
|
+
zx?: string | boolean | string[] | {
|
|
719
|
+
config?: string | string[] | undefined;
|
|
720
|
+
entry?: string | string[] | undefined;
|
|
721
|
+
project?: string | string[] | undefined;
|
|
722
|
+
} | undefined;
|
|
703
723
|
workspaces?: Record<string, {
|
|
704
724
|
angular?: string | boolean | string[] | {
|
|
705
725
|
config?: string | string[] | undefined;
|
|
@@ -841,6 +861,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
841
861
|
entry?: string | string[] | undefined;
|
|
842
862
|
project?: string | string[] | undefined;
|
|
843
863
|
} | undefined;
|
|
864
|
+
execa?: string | boolean | string[] | {
|
|
865
|
+
config?: string | string[] | undefined;
|
|
866
|
+
entry?: string | string[] | undefined;
|
|
867
|
+
project?: string | string[] | undefined;
|
|
868
|
+
} | undefined;
|
|
844
869
|
expo?: string | boolean | string[] | {
|
|
845
870
|
config?: string | string[] | undefined;
|
|
846
871
|
entry?: string | string[] | undefined;
|
|
@@ -1076,6 +1101,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1076
1101
|
entry?: string | string[] | undefined;
|
|
1077
1102
|
project?: string | string[] | undefined;
|
|
1078
1103
|
} | undefined;
|
|
1104
|
+
pm2?: string | boolean | string[] | {
|
|
1105
|
+
config?: string | string[] | undefined;
|
|
1106
|
+
entry?: string | string[] | undefined;
|
|
1107
|
+
project?: string | string[] | undefined;
|
|
1108
|
+
} | undefined;
|
|
1079
1109
|
pnpm?: string | boolean | string[] | {
|
|
1080
1110
|
config?: string | string[] | undefined;
|
|
1081
1111
|
entry?: string | string[] | undefined;
|
|
@@ -1106,6 +1136,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1106
1136
|
entry?: string | string[] | undefined;
|
|
1107
1137
|
project?: string | string[] | undefined;
|
|
1108
1138
|
} | undefined;
|
|
1139
|
+
'react-native'?: string | boolean | string[] | {
|
|
1140
|
+
config?: string | string[] | undefined;
|
|
1141
|
+
entry?: string | string[] | undefined;
|
|
1142
|
+
project?: string | string[] | undefined;
|
|
1143
|
+
} | undefined;
|
|
1109
1144
|
'react-router'?: string | boolean | string[] | {
|
|
1110
1145
|
config?: string | string[] | undefined;
|
|
1111
1146
|
entry?: string | string[] | undefined;
|
|
@@ -1356,6 +1391,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
|
|
|
1356
1391
|
entry?: string | string[] | undefined;
|
|
1357
1392
|
project?: string | string[] | undefined;
|
|
1358
1393
|
} | undefined;
|
|
1394
|
+
zx?: string | boolean | string[] | {
|
|
1395
|
+
config?: string | string[] | undefined;
|
|
1396
|
+
entry?: string | string[] | undefined;
|
|
1397
|
+
project?: string | string[] | undefined;
|
|
1398
|
+
} | undefined;
|
|
1359
1399
|
entry?: string | string[] | undefined;
|
|
1360
1400
|
project?: string | string[] | undefined;
|
|
1361
1401
|
paths?: Record<string, string[]> | undefined;
|
package/dist/util/jiti.d.ts
CHANGED
package/dist/util/jiti.js
CHANGED
|
@@ -8,10 +8,5 @@ const options = {
|
|
|
8
8
|
'@rushstack/eslint-patch/modern-module-resolution': empty,
|
|
9
9
|
},
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export const jiti =
|
|
13
|
-
import: (id, opts) => {
|
|
14
|
-
_jiti ??= createJiti(process.cwd(), options);
|
|
15
|
-
return _jiti.import(id, opts);
|
|
16
|
-
},
|
|
17
|
-
};
|
|
11
|
+
const createLoader = (options) => createJiti(process.cwd(), options);
|
|
12
|
+
export const jiti = createLoader(options);
|
package/dist/util/loader.js
CHANGED
|
@@ -27,7 +27,7 @@ const load = async (filePath) => {
|
|
|
27
27
|
if (ext === '.jsonc' || ext === '.json5') {
|
|
28
28
|
return await loadJSONC(filePath);
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
30
|
+
if ('Bun' in globalThis) {
|
|
31
31
|
const imported = await import(filePath);
|
|
32
32
|
return imported.default ?? imported;
|
|
33
33
|
}
|
package/dist/util/modules.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const getPackageNameFromSpecifier: (specifier: string) => string
|
|
|
4
4
|
export declare const isStartsLikePackageName: (specifier: string) => boolean;
|
|
5
5
|
export declare const stripVersionFromSpecifier: (specifier: string) => string;
|
|
6
6
|
export declare const extractBinary: (command: string) => string;
|
|
7
|
+
export declare const isValidBinary: (str: string) => boolean;
|
|
7
8
|
export declare const isDefinitelyTyped: (packageName: string) => boolean;
|
|
8
9
|
export declare const getDefinitelyTypedFor: (packageName: string) => string;
|
|
9
10
|
export declare const getPackageFromDefinitelyTyped: (typedDependency: string) => string;
|
package/dist/util/modules.js
CHANGED
|
@@ -30,6 +30,7 @@ const stripNodeModulesFromPath = (command) => command.replace(/(?:\.{0,2}\/)*nod
|
|
|
30
30
|
export const extractBinary = (command) => stripVersionFromSpecifier(stripNodeModulesFromPath(command)
|
|
31
31
|
.replace(/^(\.bin\/)/, '')
|
|
32
32
|
.replace(/\$\(npm bin\)\/(\w+)/, '$1'));
|
|
33
|
+
export const isValidBinary = (str) => !/[*:!()]/.test(str);
|
|
33
34
|
export const isDefinitelyTyped = (packageName) => packageName.startsWith(`${DT_SCOPE}/`);
|
|
34
35
|
export const getDefinitelyTypedFor = (packageName) => {
|
|
35
36
|
if (isDefinitelyTyped(packageName))
|
package/dist/util/watch.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const getSessionHandler: (options: MainOptions, { analyzedFiles,
|
|
|
34
34
|
handleFileChanges: (changes: WatchChange[]) => Promise<{
|
|
35
35
|
duration: number;
|
|
36
36
|
mem: number;
|
|
37
|
-
}>;
|
|
37
|
+
} | undefined>;
|
|
38
38
|
getEntryPaths: () => Set<string>;
|
|
39
39
|
getGraph: () => ModuleGraph;
|
|
40
40
|
getIssues: () => {
|
package/dist/util/watch.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
1
2
|
import { invalidateCache } from '../graph-explorer/cache.js';
|
|
2
3
|
import { debugLog } from './debug.js';
|
|
3
4
|
import { isFile } from './fs.js';
|
|
@@ -40,15 +41,21 @@ export const getSessionHandler = async (options, { analyzedFiles, analyzeSourceF
|
|
|
40
41
|
principal.removeProjectPath(filePath);
|
|
41
42
|
debugLog(workspace.name, `Watcher: - ${relativePath}`);
|
|
42
43
|
break;
|
|
43
|
-
default:
|
|
44
|
+
default: {
|
|
45
|
+
const cached = principal.backend.fileManager.sourceFileCache.get(filePath);
|
|
46
|
+
if (cached && cached.text === readFileSync(filePath, 'utf8')) {
|
|
47
|
+
debugLog(workspace.name, `Watcher: = ${relativePath}`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
44
50
|
modified.add(filePath);
|
|
45
51
|
debugLog(workspace.name, `Watcher: ± ${relativePath}`);
|
|
46
52
|
break;
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
principal.invalidateFile(filePath);
|
|
49
56
|
}
|
|
50
57
|
if (added.size === 0 && deleted.size === 0 && modified.size === 0)
|
|
51
|
-
return
|
|
58
|
+
return;
|
|
52
59
|
invalidateCache(graph);
|
|
53
60
|
unreferencedFiles.clear();
|
|
54
61
|
const cachedUnusedFiles = collector.purge();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkspacePackage } from '../types/package-json.js';
|
|
2
2
|
type WorkspaceSelectorType = 'pkg-name' | 'dir-path' | 'dir-glob';
|
|
3
|
-
|
|
3
|
+
interface ParsedSelector {
|
|
4
4
|
type: WorkspaceSelectorType;
|
|
5
5
|
pattern: string;
|
|
6
6
|
isNegated: boolean;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.84.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.84.0';
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -138,6 +138,9 @@
|
|
|
138
138
|
"binaries": {
|
|
139
139
|
"$ref": "#/definitions/ruleValue"
|
|
140
140
|
},
|
|
141
|
+
"catalog": {
|
|
142
|
+
"$ref": "#/definitions/ruleValue"
|
|
143
|
+
},
|
|
141
144
|
"classMembers": {
|
|
142
145
|
"$ref": "#/definitions/ruleValue"
|
|
143
146
|
},
|
|
@@ -449,6 +452,10 @@
|
|
|
449
452
|
"title": "ESLint plugin configuration (https://knip.dev/reference/plugins/eslint)",
|
|
450
453
|
"$ref": "#/definitions/plugin"
|
|
451
454
|
},
|
|
455
|
+
"execa": {
|
|
456
|
+
"title": "execa plugin configuration (https://knip.dev/reference/plugins/execa)",
|
|
457
|
+
"$ref": "#/definitions/plugin"
|
|
458
|
+
},
|
|
452
459
|
"expo": {
|
|
453
460
|
"title": "Expo plugin configuration (https://knip.dev/reference/plugins/expo)",
|
|
454
461
|
"$ref": "#/definitions/plugin"
|
|
@@ -629,6 +636,10 @@
|
|
|
629
636
|
"title": "playwright-test plugin configuration (https://knip.dev/reference/plugins/playwright-test)",
|
|
630
637
|
"$ref": "#/definitions/plugin"
|
|
631
638
|
},
|
|
639
|
+
"pm2": {
|
|
640
|
+
"title": "pm2 plugin configuration (https://knip.dev/reference/plugins/pm2)",
|
|
641
|
+
"$ref": "#/definitions/plugin"
|
|
642
|
+
},
|
|
632
643
|
"pnpm": {
|
|
633
644
|
"title": "pnpm plugin configuration (https://knip.dev/reference/plugins/pnpm)",
|
|
634
645
|
"$ref": "#/definitions/plugin"
|
|
@@ -653,6 +664,10 @@
|
|
|
653
664
|
"title": "react-cosmos plugin configuration (https://knip.dev/reference/plugins/react-cosmos)",
|
|
654
665
|
"$ref": "#/definitions/plugin"
|
|
655
666
|
},
|
|
667
|
+
"react-native": {
|
|
668
|
+
"title": "react-native plugin configuration (https://knip.dev/reference/plugins/react-native)",
|
|
669
|
+
"$ref": "#/definitions/plugin"
|
|
670
|
+
},
|
|
656
671
|
"react-router": {
|
|
657
672
|
"title": "react-router plugin configuration (https://knip.dev/reference/plugins/react-router)",
|
|
658
673
|
"$ref": "#/definitions/plugin"
|
|
@@ -856,6 +871,10 @@
|
|
|
856
871
|
"yorkie": {
|
|
857
872
|
"title": "yorkie plugin configuration (https://knip.dev/reference/plugins/yorkie)",
|
|
858
873
|
"$ref": "#/definitions/plugin"
|
|
874
|
+
},
|
|
875
|
+
"zx": {
|
|
876
|
+
"title": "zx plugin configuration (https://knip.dev/reference/plugins/zx)",
|
|
877
|
+
"$ref": "#/definitions/plugin"
|
|
859
878
|
}
|
|
860
879
|
}
|
|
861
880
|
},
|
package/dist/compilers/svelte.js
DELETED
package/dist/compilers/vue.d.ts
DELETED
package/dist/compilers/vue.js
DELETED
|
File without changes
|
|
File without changes
|