knip 5.62.0 → 5.63.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/README.md +22 -24
- package/dist/CacheConsultant.d.ts +3 -9
- package/dist/CacheConsultant.js +5 -5
- package/dist/ConfigurationChief.d.ts +588 -38
- package/dist/ConfigurationChief.js +43 -124
- package/dist/ConsoleStreamer.d.ts +2 -3
- package/dist/ConsoleStreamer.js +2 -2
- package/dist/DependencyDeputy.d.ts +2 -6
- package/dist/IssueCollector.d.ts +4 -12
- package/dist/IssueCollector.js +10 -10
- package/dist/IssueFixer.d.ts +3 -14
- package/dist/IssueFixer.js +11 -21
- package/dist/PrincipalFactory.d.ts +3 -2
- package/dist/PrincipalFactory.js +11 -11
- package/dist/ProjectPrincipal.d.ts +5 -3
- package/dist/ProjectPrincipal.js +17 -11
- package/dist/WorkspaceWorker.d.ts +4 -9
- package/dist/WorkspaceWorker.js +8 -12
- package/dist/binaries/bash-parser.js +1 -1
- package/dist/binaries/fallback.js +4 -2
- package/dist/binaries/package-manager/pnpm.js +6 -1
- package/dist/cli.js +43 -60
- package/dist/compilers/index.d.ts +34 -4
- package/dist/graph/analyze.d.ts +3 -8
- package/dist/graph/analyze.js +24 -27
- package/dist/graph/build.d.ts +3 -17
- package/dist/graph/build.js +60 -47
- package/dist/index.d.ts +3 -6
- package/dist/index.js +23 -62
- package/dist/plugins/astro/index.d.ts +1 -0
- package/dist/plugins/astro/index.js +4 -0
- package/dist/plugins/index.d.ts +24 -1
- package/dist/plugins/index.js +6 -0
- package/dist/plugins/lefthook/index.js +2 -0
- package/dist/plugins/node-modules-inspector/index.d.ts +12 -0
- package/dist/plugins/node-modules-inspector/index.js +17 -0
- package/dist/plugins/nuxt/index.js +4 -3
- package/dist/plugins/nuxt/types.d.ts +3 -2
- package/dist/plugins/playwright/index.js +8 -1
- package/dist/plugins/playwright/types.d.ts +20 -14
- package/dist/plugins/pnpm/index.d.ts +7 -0
- package/dist/plugins/pnpm/index.js +8 -0
- package/dist/plugins/preconstruct/index.js +2 -1
- package/dist/plugins/react-router/index.js +18 -8
- package/dist/plugins/rsbuild/index.js +28 -2
- package/dist/plugins/rsbuild/types.d.ts +11 -0
- package/dist/plugins/rslib/index.d.ts +10 -0
- package/dist/plugins/rslib/index.js +15 -0
- package/dist/plugins/rslib/types.d.ts +1 -0
- package/dist/plugins/rspack/index.js +1 -1
- package/dist/plugins/typescript/index.d.ts +1 -1
- package/dist/plugins.js +3 -2
- package/dist/reporters/codeclimate.d.ts +1 -1
- package/dist/reporters/codeclimate.js +10 -10
- package/dist/reporters/codeowners.d.ts +1 -1
- package/dist/reporters/codeowners.js +5 -5
- package/dist/reporters/compact.d.ts +1 -1
- package/dist/reporters/compact.js +7 -7
- package/dist/reporters/disclosure.d.ts +1 -1
- package/dist/reporters/disclosure.js +2 -2
- package/dist/reporters/index.d.ts +6 -6
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/json.js +3 -3
- package/dist/reporters/markdown.d.ts +1 -1
- package/dist/reporters/markdown.js +4 -4
- package/dist/reporters/symbols.js +4 -2
- package/dist/reporters/util/configuration-hints.d.ts +1 -1
- package/dist/reporters/util/configuration-hints.js +58 -23
- package/dist/reporters/util/util.d.ts +2 -4
- package/dist/reporters/util/util.js +6 -6
- package/dist/reporters/watch.d.ts +3 -4
- package/dist/reporters/watch.js +5 -5
- package/dist/schema/configuration.d.ts +176 -8
- package/dist/schema/plugins.d.ts +69 -0
- package/dist/schema/plugins.js +3 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +3 -0
- package/dist/types/config.d.ts +4 -10
- package/dist/types/entries.d.ts +3 -0
- package/dist/types/entries.js +1 -0
- package/dist/types/issues.d.ts +4 -3
- package/dist/types/{cli.d.ts → options.d.ts} +2 -2
- package/dist/types/options.js +1 -0
- package/dist/types/package-json.d.ts +5 -0
- package/dist/types/project.d.ts +1 -7
- package/dist/types/tsconfig-json.d.ts +14 -0
- package/dist/types/tsconfig-json.js +1 -0
- package/dist/typescript/ast-helpers.js +1 -1
- package/dist/typescript/get-imports-and-exports.d.ts +2 -2
- package/dist/typescript/get-imports-and-exports.js +9 -10
- package/dist/util/Performance.js +16 -6
- package/dist/util/cli-arguments.d.ts +1 -2
- package/dist/util/cli-arguments.js +3 -13
- package/dist/util/create-options.d.ts +1219 -0
- package/dist/util/create-options.js +112 -0
- package/dist/util/debug.js +3 -4
- package/dist/util/errors.d.ts +1 -1
- package/dist/util/file-entry-cache.js +3 -3
- package/dist/util/fs.d.ts +1 -1
- package/dist/util/get-included-issue-types.d.ts +9 -13
- package/dist/util/get-included-issue-types.js +10 -16
- package/dist/util/get-referenced-inputs.js +1 -1
- package/dist/util/glob-core.d.ts +1 -1
- package/dist/util/glob-core.js +8 -7
- package/dist/util/glob.d.ts +1 -0
- package/dist/util/glob.js +1 -1
- package/dist/util/input.d.ts +1 -1
- package/dist/util/input.js +1 -1
- package/dist/util/is-identifier-referenced.d.ts +1 -1
- package/dist/util/is-identifier-referenced.js +19 -19
- package/dist/util/load-config.d.ts +1 -0
- package/dist/util/load-config.js +24 -0
- package/dist/util/package-json.d.ts +2 -1
- package/dist/util/package-json.js +24 -12
- package/dist/util/parse-and-convert-gitignores.js +2 -0
- package/dist/util/path.d.ts +4 -4
- package/dist/util/path.js +5 -7
- package/dist/util/reporter.js +3 -3
- package/dist/util/require.js +1 -2
- package/dist/util/table.js +1 -3
- package/dist/util/tag.d.ts +1 -1
- package/dist/util/to-source-path.d.ts +1 -1
- package/dist/util/to-source-path.js +5 -5
- package/dist/util/trace.d.ts +6 -6
- package/dist/util/trace.js +18 -22
- package/dist/util/watch.d.ts +2 -5
- package/dist/util/watch.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -15
- package/schema.json +12 -0
- package/dist/util/unwrap-function.d.ts +0 -1
- package/dist/util/unwrap-function.js +0 -13
- /package/dist/{types/cli.js → plugins/rslib/types.js} +0 -0
package/README.md
CHANGED
|
@@ -20,29 +20,28 @@ performance, less maintenance and easier refactorings.
|
|
|
20
20
|
- Website: [knip.dev][6]
|
|
21
21
|
- GitHub repo: [webpro-nl/knip][4]
|
|
22
22
|
- npm package: [knip][1]
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [Sponsor Knip!][9]
|
|
23
|
+
- [Contributing Guide][7]
|
|
24
|
+
- [Sponsor Knip!][8]
|
|
26
25
|
|
|
27
26
|
## Contributors
|
|
28
27
|
|
|
29
|
-
Special thanks to [the wonderful people who have contributed to Knip][
|
|
28
|
+
Special thanks to [the wonderful people who have contributed to Knip][9]!
|
|
30
29
|
|
|
31
30
|
## Knip
|
|
32
31
|
|
|
33
|
-
/'knɪp/ means "(to) cut" and is [pronounced with a hard "K"][
|
|
32
|
+
/'knɪp/ means "(to) cut" and is [pronounced with a hard "K"][10] 🇳🇱
|
|
34
33
|
|
|
35
34
|
## License
|
|
36
35
|
|
|
37
|
-
Knip is free and open-source software licensed under the [ISC License][
|
|
36
|
+
Knip is free and open-source software licensed under the [ISC License][11].
|
|
38
37
|
|
|
39
38
|
Parts of Knip have been inspired by and/or partially copy code from the
|
|
40
39
|
following projects:
|
|
41
40
|
|
|
42
|
-
- [@npmcli/package-json][
|
|
43
|
-
- [@pnpm/deps.graph-sequencer][
|
|
44
|
-
- [file-entry-cache][
|
|
45
|
-
- [json-parse-even-better-errors][
|
|
41
|
+
- [@npmcli/package-json][12] ([ISC][13])
|
|
42
|
+
- [@pnpm/deps.graph-sequencer][14] ([MIT][15])
|
|
43
|
+
- [file-entry-cache][16] ([MIT][17])
|
|
44
|
+
- [json-parse-even-better-errors][18] ([MIT][19])
|
|
46
45
|
|
|
47
46
|
[1]: https://www.npmjs.com/package/knip
|
|
48
47
|
[2]: https://img.shields.io/npm/v/knip?color=f56e0f
|
|
@@ -51,18 +50,17 @@ following projects:
|
|
|
51
50
|
[5]:
|
|
52
51
|
https://img.shields.io/github/stars/webpro-nl/knip?style=flat-square&color=f56e0f
|
|
53
52
|
[6]: https://knip.dev
|
|
54
|
-
[7]: https://
|
|
55
|
-
[8]: https://
|
|
56
|
-
[9]: https://knip.dev
|
|
57
|
-
[10]: https://
|
|
58
|
-
[11]:
|
|
59
|
-
[12]:
|
|
60
|
-
[13]: https://github.com/
|
|
61
|
-
[14]:
|
|
53
|
+
[7]: https://github.com/webpro-nl/knip/blob/main/.github/CONTRIBUTING.md
|
|
54
|
+
[8]: https://knip.dev/sponsors
|
|
55
|
+
[9]: https://knip.dev/#created-by-awesome-contributors
|
|
56
|
+
[10]: https://www.youtube.com/watch?v=PE7h7KvQoUI&t=9s
|
|
57
|
+
[11]: ./license
|
|
58
|
+
[12]: https://github.com/npm/package-json
|
|
59
|
+
[13]: https://github.com/npm/package-json/blob/main/LICENSE
|
|
60
|
+
[14]: https://github.com/pnpm/pnpm/tree/main/deps/graph-sequencer
|
|
61
|
+
[15]: https://github.com/pnpm/pnpm/blob/main/LICENSE
|
|
62
|
+
[16]: https://github.com/jaredwray/cacheable/tree/main/packages/file-entry-cache
|
|
63
|
+
[17]:
|
|
62
64
|
https://github.com/jaredwray/cacheable/blob/main/packages/file-entry-cache/LICENSE
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[17]: https://github.com/npm/package-json
|
|
66
|
-
[18]: https://github.com/npm/package-json/blob/main/LICENSE
|
|
67
|
-
[19]: https://github.com/npm/json-parse-even-better-errors
|
|
68
|
-
[20]: https://github.com/npm/json-parse-even-better-errors/blob/main/LICENSE.md
|
|
65
|
+
[18]: https://github.com/npm/json-parse-even-better-errors
|
|
66
|
+
[19]: https://github.com/npm/json-parse-even-better-errors/blob/main/LICENSE.md
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
+
import type { MainOptions } from './util/create-options.js';
|
|
1
2
|
import { type FileDescriptor } from './util/file-entry-cache.js';
|
|
2
|
-
type CacheOptions = {
|
|
3
|
-
name: string;
|
|
4
|
-
isEnabled: boolean;
|
|
5
|
-
cacheLocation: string;
|
|
6
|
-
isProduction: boolean;
|
|
7
|
-
};
|
|
8
3
|
export declare class CacheConsultant<T> {
|
|
9
4
|
private isEnabled;
|
|
10
5
|
private cache;
|
|
11
|
-
constructor(options:
|
|
12
|
-
getFileDescriptor(
|
|
6
|
+
constructor(name: string, options: MainOptions);
|
|
7
|
+
getFileDescriptor(filePath: string): FileDescriptor<T>;
|
|
13
8
|
reconcile(): void;
|
|
14
9
|
}
|
|
15
|
-
export {};
|
package/dist/CacheConsultant.js
CHANGED
|
@@ -5,18 +5,18 @@ const dummyFileDescriptor = { key: '', changed: true, notFound: true };
|
|
|
5
5
|
export class CacheConsultant {
|
|
6
6
|
isEnabled;
|
|
7
7
|
cache;
|
|
8
|
-
constructor(options) {
|
|
9
|
-
this.isEnabled = options.
|
|
8
|
+
constructor(name, options) {
|
|
9
|
+
this.isEnabled = options.isCache;
|
|
10
10
|
if (this.isEnabled) {
|
|
11
|
-
const cacheName = `${
|
|
11
|
+
const cacheName = `${name.replace(/[^a-z0-9]/g, '-').replace(/-*$/, '')}-${options.isProduction ? '-prod' : ''}-${version}`;
|
|
12
12
|
this.cache = new FileEntryCache(cacheName, options.cacheLocation);
|
|
13
13
|
this.reconcile = timerify(this.cache.reconcile).bind(this.cache);
|
|
14
14
|
this.getFileDescriptor = timerify(this.cache.getFileDescriptor).bind(this.cache);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
getFileDescriptor(
|
|
17
|
+
getFileDescriptor(filePath) {
|
|
18
18
|
if (this.isEnabled && this.cache)
|
|
19
|
-
return this.cache.getFileDescriptor(
|
|
19
|
+
return this.cache.getFileDescriptor(filePath);
|
|
20
20
|
return dummyFileDescriptor;
|
|
21
21
|
}
|
|
22
22
|
reconcile() {
|