knip 5.42.0 → 5.42.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/ConfigurationChief.d.ts +1 -0
- package/dist/ConfigurationValidator.d.ts +56 -0
- package/dist/IssueCollector.js +6 -4
- package/dist/WorkspaceWorker.js +2 -1
- package/dist/binaries/package-manager/bun.js +8 -2
- package/dist/binaries/package-manager/bunx.d.ts +3 -0
- package/dist/binaries/package-manager/bunx.js +18 -0
- package/dist/binaries/package-manager/index.d.ts +2 -0
- package/dist/binaries/package-manager/index.js +4 -0
- package/dist/binaries/package-manager/npm.js +1 -2
- package/dist/binaries/package-manager/npx.js +7 -2
- package/dist/binaries/package-manager/pnpm.js +7 -1
- package/dist/binaries/package-manager/pnpx.d.ts +3 -0
- package/dist/binaries/package-manager/pnpx.js +18 -0
- package/dist/binaries/package-manager/yarn.js +34 -10
- package/dist/binaries/plugins.js +7 -2
- package/dist/compilers/index.d.ts +10 -0
- package/dist/index.js +6 -6
- package/dist/plugins/angular/index.js +26 -10
- package/dist/plugins/capacitor/index.js +1 -1
- package/dist/plugins/changesets/index.js +1 -1
- package/dist/plugins/commitlint/index.js +1 -1
- package/dist/plugins/dependency-cruiser/index.d.ts +12 -0
- package/dist/plugins/dependency-cruiser/index.js +16 -0
- package/dist/plugins/expo/helpers.d.ts +1 -1
- package/dist/plugins/expo/helpers.js +3 -2
- package/dist/plugins/expo/index.js +2 -1
- package/dist/plugins/expo/types.d.ts +2 -1
- package/dist/plugins/gatsby/index.js +1 -1
- package/dist/plugins/github-actions/index.js +15 -10
- package/dist/plugins/github-actions/types.d.ts +20 -0
- package/dist/plugins/github-actions/types.js +1 -0
- package/dist/plugins/graphql-codegen/index.js +1 -1
- package/dist/plugins/index.d.ts +10 -2
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/lefthook/index.js +2 -2
- package/dist/plugins/markdownlint/index.js +1 -1
- package/dist/plugins/metro/index.d.ts +1 -1
- package/dist/plugins/metro/index.js +3 -4
- package/dist/plugins/nest/index.js +1 -1
- package/dist/plugins/netlify/index.js +2 -2
- package/dist/plugins/npm-package-json-lint/index.js +1 -1
- package/dist/plugins/nuxt/index.d.ts +3 -1
- package/dist/plugins/nuxt/index.js +3 -3
- package/dist/plugins/nx/index.js +1 -1
- package/dist/plugins/oclif/index.js +1 -1
- package/dist/plugins/prettier/index.js +1 -1
- package/dist/plugins/release-it/index.js +1 -1
- package/dist/plugins/semantic-release/index.js +7 -1
- package/dist/plugins/storybook/index.js +5 -1
- package/dist/plugins/typescript/index.d.ts +3 -0
- package/dist/plugins/typescript/index.js +2 -0
- package/dist/plugins/vitest/index.js +1 -1
- package/dist/plugins/webdriver-io/index.js +1 -1
- package/dist/reporters/symbols.js +6 -1
- package/dist/schema/plugins.d.ts +23 -0
- package/dist/schema/plugins.js +1 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +1 -0
- package/dist/types/config.d.ts +1 -2
- package/dist/typescript/visitors/helpers.d.ts +1 -1
- package/dist/typescript/visitors/helpers.js +2 -2
- package/dist/typescript/visitors/scripts/bun.js +1 -1
- package/dist/typescript/visitors/scripts/execa.js +24 -1
- package/dist/util/get-referenced-inputs.js +5 -3
- package/dist/util/input.d.ts +3 -1
- package/dist/util/input.js +5 -1
- package/dist/util/modules.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/schema.json +4 -0
package/dist/util/input.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface Input {
|
|
|
4
4
|
type: InputType;
|
|
5
5
|
specifier: string;
|
|
6
6
|
production?: boolean;
|
|
7
|
+
optional?: boolean;
|
|
7
8
|
dir?: string;
|
|
8
9
|
containingFilePath?: string;
|
|
9
10
|
}
|
|
@@ -14,6 +15,7 @@ export interface ConfigInput extends Input {
|
|
|
14
15
|
}
|
|
15
16
|
type Options = {
|
|
16
17
|
production?: boolean;
|
|
18
|
+
optional?: boolean;
|
|
17
19
|
dir?: string;
|
|
18
20
|
containingFilePath?: string;
|
|
19
21
|
};
|
|
@@ -26,7 +28,7 @@ export declare const toProductionEntry: (specifier: string, options?: Options) =
|
|
|
26
28
|
export declare const isProductionEntry: (input: Input) => boolean;
|
|
27
29
|
export declare const toConfig: (pluginName: PluginName, specifier: string, containingFilePath: string) => ConfigInput;
|
|
28
30
|
export declare const isConfigPattern: (input: Input) => input is ConfigInput;
|
|
29
|
-
export declare const toDependency: (specifier: string) => Input;
|
|
31
|
+
export declare const toDependency: (specifier: string, options?: Options) => Input;
|
|
30
32
|
export declare const isDependency: (input: Input) => boolean;
|
|
31
33
|
export declare const toProductionDependency: (specifier: string) => Input;
|
|
32
34
|
export declare const toDevDependency: (specifier: string) => Input;
|
package/dist/util/input.js
CHANGED
|
@@ -22,7 +22,11 @@ export const toConfig = (pluginName, specifier, containingFilePath) => ({
|
|
|
22
22
|
containingFilePath,
|
|
23
23
|
});
|
|
24
24
|
export const isConfigPattern = (input) => input.type === 'config';
|
|
25
|
-
export const toDependency = (specifier) => ({
|
|
25
|
+
export const toDependency = (specifier, options = {}) => ({
|
|
26
|
+
type: 'dependency',
|
|
27
|
+
specifier,
|
|
28
|
+
...options,
|
|
29
|
+
});
|
|
26
30
|
export const isDependency = (input) => input.type === 'dependency';
|
|
27
31
|
export const toProductionDependency = (specifier) => ({
|
|
28
32
|
type: 'dependency',
|
package/dist/util/modules.js
CHANGED
|
@@ -19,7 +19,7 @@ export const getPackageNameFromFilePath = (value) => {
|
|
|
19
19
|
export const getPackageNameFromSpecifier = (specifier) => isInNodeModules(specifier) ? getPackageNameFromFilePath(specifier) : getPackageNameFromModuleSpecifier(specifier);
|
|
20
20
|
export const isStartsLikePackageName = (specifier) => /^(@[a-z0-9._]|[a-z0-9])/i.test(specifier);
|
|
21
21
|
export const stripVersionFromSpecifier = (specifier) => specifier.replace(/(\S+)@.*/, '$1');
|
|
22
|
-
const stripNodeModulesFromPath = (command) => command.replace(
|
|
22
|
+
const stripNodeModulesFromPath = (command) => command.replace(/(?:\.{0,2}\/)*node_modules\//, '');
|
|
23
23
|
export const extractBinary = (command) => stripVersionFromSpecifier(stripNodeModulesFromPath(command)
|
|
24
24
|
.replace(/^(\.bin\/)/, '')
|
|
25
25
|
.replace(/\$\(npm bin\)\/(\w+)/, '$1'));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.42.
|
|
1
|
+
export declare const version = "5.42.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.42.
|
|
1
|
+
export const version = '5.42.2';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.42.
|
|
3
|
+
"version": "5.42.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": {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"lint": "biome lint ../..",
|
|
42
42
|
"format": "biome format --write .",
|
|
43
43
|
"test": "bun test test/*.test.ts test/**/*.test.ts",
|
|
44
|
+
"test:watch": "bun test test/*.test.ts test/**/*.test.ts --reporter=junit --reporter-outfile=junit.xml || bun test --watch $(grep -o 'name=\"[^\"]*\".*failures=\"[^0]' junit.xml | grep -v 'name=\"bun test\"' | grep -o 'name=\"[^\"]*\"' | cut -d'\"' -f2)",
|
|
44
45
|
"test:node": "glob -c \"npx -y tsx --test --import ./transform-test.js\" \"test/**/*.test.ts\"",
|
|
45
46
|
"watch": "npm link && tsc --watch",
|
|
46
47
|
"prebuild": "npm run generate-plugin-defs && node rmdir.js dist",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"devDependencies": {
|
|
83
84
|
"@jest/types": "^29.6.3",
|
|
84
85
|
"@release-it/bumper": "^7.0.0",
|
|
85
|
-
"@types/bun": "^1.1.
|
|
86
|
+
"@types/bun": "^1.1.16",
|
|
86
87
|
"@types/js-yaml": "^4.0.9",
|
|
87
88
|
"@types/minimist": "^1.2.5",
|
|
88
89
|
"@types/picomatch": "3.0.1",
|
package/schema.json
CHANGED
|
@@ -328,6 +328,10 @@
|
|
|
328
328
|
"title": "Cypress plugin configuration (https://knip.dev/reference/plugins/cypress)",
|
|
329
329
|
"$ref": "#/definitions/plugin"
|
|
330
330
|
},
|
|
331
|
+
"dependency-cruiser": {
|
|
332
|
+
"title": "dependency-cruiser plugin configuration (https://knip.dev/reference/plugins/dependency-cruiser)",
|
|
333
|
+
"$ref": "#/definitions/plugin"
|
|
334
|
+
},
|
|
331
335
|
"dotenv": {
|
|
332
336
|
"title": "dotenv plugin configuration (https://knip.dev/reference/plugins/dotenv)",
|
|
333
337
|
"$ref": "#/definitions/plugin"
|