knip 5.43.1 → 5.43.2
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/plugins/expo/index.js +3 -3
- package/dist/typescript/get-imports-and-exports.js +10 -8
- package/dist/util/cli-arguments.d.ts +1 -1
- package/dist/util/cli-arguments.js +1 -1
- package/dist/util/file-entry-cache.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/util/serialize.d.ts +0 -2
- package/dist/util/serialize.js +0 -12
|
@@ -11,9 +11,8 @@ export const docs = { production };
|
|
|
11
11
|
const resolveEntryPaths = async (localConfig, { manifest }) => {
|
|
12
12
|
const expoConfig = typeof localConfig === 'function' ? localConfig() : localConfig;
|
|
13
13
|
const config = 'expo' in expoConfig ? expoConfig.expo : expoConfig;
|
|
14
|
-
let patterns = [];
|
|
15
14
|
if (manifest.main === 'expo-router/entry') {
|
|
16
|
-
patterns = [...production];
|
|
15
|
+
let patterns = [...production];
|
|
17
16
|
const normalizedPlugins = config.plugins?.map(plugin => (Array.isArray(plugin) ? plugin : [plugin])) ?? [];
|
|
18
17
|
const expoRouterPlugin = normalizedPlugins.find(([plugin]) => plugin === 'expo-router');
|
|
19
18
|
if (expoRouterPlugin) {
|
|
@@ -22,8 +21,9 @@ const resolveEntryPaths = async (localConfig, { manifest }) => {
|
|
|
22
21
|
patterns = [join(options.root, '**/*.{js,jsx,ts,tsx}')];
|
|
23
22
|
}
|
|
24
23
|
}
|
|
24
|
+
return patterns.map(entry => toProductionEntry(entry));
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return production.map(entry => toProductionEntry(entry));
|
|
27
27
|
};
|
|
28
28
|
const resolveConfig = async (expoConfig, options) => getDependencies(expoConfig, options);
|
|
29
29
|
export default {
|
|
@@ -271,14 +271,16 @@ const getImportsAndExports = (sourceFile, resolveModule, typeChecker, options) =
|
|
|
271
271
|
const members = right.map((_r, index) => right.slice(0, index + 1).join('.'));
|
|
272
272
|
addNsMemberRefs(imports, ns, members);
|
|
273
273
|
}
|
|
274
|
-
else if (imports.importedNs.has(id)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
else if (imports.importedNs.has(id)) {
|
|
275
|
+
if (isConsiderReferencedNS(node)) {
|
|
276
|
+
imports.refs.add(id);
|
|
277
|
+
}
|
|
278
|
+
else if (isObjectEnumerationCallExpressionArgument(node)) {
|
|
279
|
+
imports.refs.add(id);
|
|
280
|
+
}
|
|
281
|
+
else if (isInForIteration(node)) {
|
|
282
|
+
imports.refs.add(id);
|
|
283
|
+
}
|
|
282
284
|
}
|
|
283
285
|
}
|
|
284
286
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\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 -W, --workspace [dir] Analyze a single workspace (default: analyze all configured workspaces)\n --directory [dir] Run process from a different directory (default: cwd)\n --cache Enable caching\n --cache-location Change cache location (default: node_modules/.cache/knip)\n --watch Watch mode\n --no-gitignore Don't use .gitignore\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\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --files Shortcut for --include files\n --fix Fix issues\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 --include-libs Include type definitions from external dependencies (default: false)\n --include-entry-exports Include entry files when reporting unused exports\n --isolate-workspaces Isolate workspaces into separate programs\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\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: symbols, compact, codeowners, json, can be repeated (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --tags Include or exclude tagged exports\n --no-config-hints Suppress configuration hints\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n -d, --debug Show debug output\n --trace Show trace output\n --trace-export [name] Show trace output for named export(s)\n --trace-file [file] Show trace output for exports in file\n --performance Measure count and running time of expensive functions and display stats table\n -h, --help Print this help text\n -V, --version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n(2) Fixable issue types: dependencies, exports, types\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --tags=-
|
|
1
|
+
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\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 -W, --workspace [dir] Analyze a single workspace (default: analyze all configured workspaces)\n --directory [dir] Run process from a different directory (default: cwd)\n --cache Enable caching\n --cache-location Change cache location (default: node_modules/.cache/knip)\n --watch Watch mode\n --no-gitignore Don't use .gitignore\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\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --files Shortcut for --include files\n --fix Fix issues\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 --include-libs Include type definitions from external dependencies (default: false)\n --include-entry-exports Include entry files when reporting unused exports\n --isolate-workspaces Isolate workspaces into separate programs\n -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)\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: symbols, compact, codeowners, json, can be repeated (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --tags Include or exclude tagged exports\n --no-config-hints Suppress configuration hints\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n -d, --debug Show debug output\n --trace Show trace output\n --trace-export [name] Show trace output for named export(s)\n --trace-file [file] Show trace output for exports in file\n --performance Measure count and running time of expensive functions and display stats table\n -h, --help Print this help text\n -V, --version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n(2) Fixable issue types: dependencies, exports, types\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\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
|
declare const _default: {
|
|
3
3
|
cache?: boolean | undefined;
|
|
4
4
|
'cache-location'?: string | undefined;
|
|
@@ -52,7 +52,7 @@ $ knip --production
|
|
|
52
52
|
$ knip --workspace packages/client --include files,dependencies
|
|
53
53
|
$ knip -c ./config/knip.json --reporter compact
|
|
54
54
|
$ knip --reporter codeowners --reporter-options '{"path":".github/CODEOWNERS"}'
|
|
55
|
-
$ knip --tags=-
|
|
55
|
+
$ knip --tags=-lintignore
|
|
56
56
|
|
|
57
57
|
Website: https://knip.dev`;
|
|
58
58
|
let parsedArgs;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { deserialize, serialize } from 'node:v8';
|
|
3
4
|
import { timerify } from './Performance.js';
|
|
4
5
|
import { debugLog } from './debug.js';
|
|
5
6
|
import { isDirectory, isFile } from './fs.js';
|
|
6
7
|
import { cwd, dirname, isAbsolute, resolve } from './path.js';
|
|
7
|
-
import { deserialize, serialize } from './serialize.js';
|
|
8
8
|
const createCache = (filePath) => {
|
|
9
9
|
try {
|
|
10
10
|
return deserialize(fs.readFileSync(filePath));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.43.
|
|
1
|
+
export declare const version = "5.43.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.43.
|
|
1
|
+
export const version = '5.43.2';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.43.
|
|
3
|
+
"version": "5.43.2",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@jest/types": "^29.6.3",
|
|
85
85
|
"@release-it/bumper": "^7.0.0",
|
|
86
|
-
"@types/bun": "^1.
|
|
86
|
+
"@types/bun": "^1.2.0",
|
|
87
87
|
"@types/js-yaml": "^4.0.9",
|
|
88
88
|
"@types/minimist": "^1.2.5",
|
|
89
89
|
"@types/picomatch": "3.0.1",
|
|
90
90
|
"@types/webpack": "^5.28.5",
|
|
91
91
|
"@wdio/types": "^9.5.0",
|
|
92
92
|
"glob": "^10.4.2",
|
|
93
|
-
"release-it": "^18.1.
|
|
93
|
+
"release-it": "^18.1.2",
|
|
94
94
|
"type-fest": "^4.31.0",
|
|
95
95
|
"typescript": "^5.5.2"
|
|
96
96
|
},
|
package/dist/util/serialize.d.ts
DELETED
package/dist/util/serialize.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
let s, d;
|
|
2
|
-
if (typeof Bun !== 'undefined') {
|
|
3
|
-
const { serialize, deserialize } = await import('bun:jsc');
|
|
4
|
-
s = serialize;
|
|
5
|
-
d = deserialize;
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
const { serialize, deserialize } = await import('node:v8');
|
|
9
|
-
s = serialize;
|
|
10
|
-
d = deserialize;
|
|
11
|
-
}
|
|
12
|
-
export { s as serialize, d as deserialize };
|