knip 5.74.0 → 5.75.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.
Files changed (57) hide show
  1. package/README.md +1 -0
  2. package/dist/ConfigurationChief.d.ts +1 -0
  3. package/dist/ConfigurationChief.js +9 -0
  4. package/dist/IssueCollector.d.ts +1 -0
  5. package/dist/ProjectPrincipal.js +2 -3
  6. package/dist/constants.d.ts +1 -0
  7. package/dist/constants.js +1 -0
  8. package/dist/graph/build.js +18 -6
  9. package/dist/graph-explorer/cache.d.ts +10 -0
  10. package/dist/graph-explorer/cache.js +72 -0
  11. package/dist/graph-explorer/constants.d.ts +7 -0
  12. package/dist/graph-explorer/constants.js +7 -0
  13. package/dist/graph-explorer/explorer.d.ts +6 -0
  14. package/dist/graph-explorer/explorer.js +10 -0
  15. package/dist/graph-explorer/operations/find-cycles.d.ts +3 -0
  16. package/dist/graph-explorer/operations/find-cycles.js +38 -0
  17. package/dist/graph-explorer/operations/get-contention.d.ts +3 -0
  18. package/dist/graph-explorer/operations/get-contention.js +142 -0
  19. package/dist/graph-explorer/operations/get-usage.d.ts +13 -0
  20. package/dist/graph-explorer/operations/get-usage.js +34 -0
  21. package/dist/graph-explorer/operations/resolve-definition.d.ts +16 -0
  22. package/dist/graph-explorer/operations/resolve-definition.js +38 -0
  23. package/dist/graph-explorer/utils.d.ts +3 -1
  24. package/dist/graph-explorer/utils.js +62 -1
  25. package/dist/graph-explorer/walk-up.d.ts +6 -0
  26. package/dist/graph-explorer/walk-up.js +67 -0
  27. package/dist/reporters/util/configuration-hints.d.ts +9 -1
  28. package/dist/reporters/util/configuration-hints.js +31 -28
  29. package/dist/run.d.ts +9 -6
  30. package/dist/run.js +7 -7
  31. package/dist/session/build-maps.d.ts +6 -0
  32. package/dist/session/build-maps.js +150 -0
  33. package/dist/session/file-descriptor.d.ts +6 -0
  34. package/dist/session/file-descriptor.js +43 -0
  35. package/dist/session/index.d.ts +10 -0
  36. package/dist/session/index.js +6 -0
  37. package/dist/session/session.d.ts +20 -0
  38. package/dist/session/session.js +18 -0
  39. package/dist/session/types.d.ts +35 -0
  40. package/dist/session/types.js +1 -0
  41. package/dist/types/issues.d.ts +1 -1
  42. package/dist/types/module-graph.d.ts +3 -3
  43. package/dist/types/options.d.ts +2 -0
  44. package/dist/typescript/SourceFileManager.d.ts +3 -0
  45. package/dist/typescript/SourceFileManager.js +9 -0
  46. package/dist/typescript/create-hosts.js +1 -1
  47. package/dist/util/cli-arguments.d.ts +2 -1
  48. package/dist/util/cli-arguments.js +2 -0
  49. package/dist/util/create-options.d.ts +2 -0
  50. package/dist/util/create-options.js +2 -0
  51. package/dist/util/load-tsconfig.d.ts +1 -1
  52. package/dist/util/load-tsconfig.js +3 -4
  53. package/dist/util/watch.d.ts +10 -5
  54. package/dist/util/watch.js +7 -5
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +11 -2
@@ -7,7 +7,7 @@ type NamespaceOrAlias = string;
7
7
  type Reference = string;
8
8
  type References = Set<Reference>;
9
9
  type Tags = Set<string>;
10
- interface SourceLocation {
10
+ export interface Position {
11
11
  pos: number;
12
12
  line: number;
13
13
  col: number;
@@ -24,13 +24,13 @@ export type ImportMaps = {
24
24
  reExportedNs: IdToFileMap;
25
25
  };
26
26
  export type ImportMap = Map<FilePath, ImportMaps>;
27
- export interface Import extends SourceLocation {
27
+ export interface Import extends Position {
28
28
  readonly specifier: string;
29
29
  readonly filePath: string | undefined;
30
30
  readonly identifier: string | undefined;
31
31
  readonly isTypeOnly: boolean;
32
32
  }
33
- export interface Export extends SourceLocation {
33
+ export interface Export extends Position {
34
34
  readonly identifier: Identifier;
35
35
  readonly type: SymbolType;
36
36
  readonly members: ExportMember[];
@@ -17,8 +17,10 @@ export interface Options {
17
17
  isIsolateWorkspaces: boolean;
18
18
  isProduction: boolean;
19
19
  isRemoveFiles: boolean;
20
+ isSession: boolean;
20
21
  isShowProgress: boolean;
21
22
  isStrict: boolean;
23
+ isUseTscFiles: boolean;
22
24
  isWatch: boolean;
23
25
  tags: string[];
24
26
  tsConfigFile: string | undefined;
@@ -8,12 +8,15 @@ export declare class SourceFileManager {
8
8
  isSkipLibs: boolean;
9
9
  sourceFileCache: Map<string, ts.SourceFile | undefined>;
10
10
  snapshotCache: Map<string, ts.IScriptSnapshot | undefined>;
11
+ scriptVersions: Map<string, number>;
11
12
  syncCompilers: SyncCompilers;
12
13
  asyncCompilers: AsyncCompilers;
13
14
  constructor({ compilers, isSkipLibs }: SourceFileManagerOptions);
14
15
  createSourceFile(filePath: string, contents: string): ts.SourceFile;
15
16
  getSourceFile(filePath: string): ts.SourceFile | undefined;
16
17
  getSnapshot(filePath: string): ts.IScriptSnapshot | undefined;
18
+ getScriptVersion(filePath: string): number;
19
+ invalidate(filePath: string): void;
17
20
  compileAndAddSourceFile(filePath: string): Promise<void>;
18
21
  }
19
22
  export {};
@@ -7,6 +7,7 @@ export class SourceFileManager {
7
7
  isSkipLibs;
8
8
  sourceFileCache = new Map();
9
9
  snapshotCache = new Map();
10
+ scriptVersions = new Map();
10
11
  syncCompilers;
11
12
  asyncCompilers;
12
13
  constructor({ compilers, isSkipLibs }) {
@@ -53,6 +54,14 @@ export class SourceFileManager {
53
54
  this.snapshotCache.set(filePath, snapshot);
54
55
  return snapshot;
55
56
  }
57
+ getScriptVersion(filePath) {
58
+ return this.scriptVersions.get(filePath) ?? 0;
59
+ }
60
+ invalidate(filePath) {
61
+ this.sourceFileCache.delete(filePath);
62
+ this.snapshotCache.delete(filePath);
63
+ this.scriptVersions.set(filePath, (this.scriptVersions.get(filePath) ?? 0) + 1);
64
+ }
56
65
  async compileAndAddSourceFile(filePath) {
57
66
  const contents = ts.sys.readFile(filePath);
58
67
  if (typeof contents !== 'string')
@@ -10,7 +10,7 @@ export const createHosts = ({ cwd, compilerOptions, fileManager, entryPaths, com
10
10
  const languageServiceHost = {
11
11
  getCompilationSettings: () => compilerOptions,
12
12
  getScriptFileNames: () => Array.from(entryPaths),
13
- getScriptVersion: () => '0',
13
+ getScriptVersion: (fileName) => fileManager.getScriptVersion(fileName).toString(),
14
14
  getScriptSnapshot: (fileName) => fileManager.getSnapshot(fileName),
15
15
  getCurrentDirectory: () => cwd,
16
16
  getDefaultLibFileName: ts.getDefaultLibFilePath,
@@ -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 -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.(js|ts), knip.config.(js|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,catalog\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 --format Format modified files after --fix using the local formatter\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, codeclimate, markdown, disclosure, github-actions, 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 --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints\n --no-exit-code Always exit with code zero (0)\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 -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 key functions and display stats table\n --performance-fn [name] Measure only function [name]\n --memory Measure memory usage and display data table\n --memory-realtime Log memory usage in realtime\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, catalog\n(2) Fixable issue types: dependencies, exports, types, catalog\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";
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 -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.(js|ts), knip.config.(js|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,catalog\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 --format Format modified files after --fix using the local formatter\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 --use-tsconfig-files Use tsconfig.json to define project files (override `project` patterns)\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, codeclimate, markdown, disclosure, github-actions, 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 --treat-config-hints-as-errors Exit with non-zero code (1) if there are any configuration hints\n --no-exit-code Always exit with code zero (0)\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 -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 key functions and display stats table\n --performance-fn [name] Measure only function [name]\n --memory Measure memory usage and display data table\n --memory-realtime Log memory usage in realtime\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, catalog\n(2) Fixable issue types: dependencies, exports, types, catalog\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
  export type ParsedCLIArgs = ReturnType<typeof parseCLIArgs>;
3
3
  export default function parseCLIArgs(): {
4
4
  cache?: boolean | undefined;
@@ -43,6 +43,7 @@ export default function parseCLIArgs(): {
43
43
  'trace-file'?: string | undefined;
44
44
  'treat-config-hints-as-errors'?: boolean | undefined;
45
45
  tsConfig?: string | undefined;
46
+ 'use-tsconfig-files'?: boolean | undefined;
46
47
  version?: boolean | undefined;
47
48
  watch?: boolean | undefined;
48
49
  workspace?: string | undefined;
@@ -26,6 +26,7 @@ Options:
26
26
  --include-libs Include type definitions from external dependencies (default: false)
27
27
  --include-entry-exports Include entry files when reporting unused exports
28
28
  --isolate-workspaces Isolate workspaces into separate programs
29
+ --use-tsconfig-files Use tsconfig.json to define project files (override \`project\` patterns)
29
30
  -n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)
30
31
  --preprocessor Preprocess the results before providing it to the reporter(s), can be repeated
31
32
  --preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)
@@ -106,6 +107,7 @@ export default function parseCLIArgs() {
106
107
  'trace-file': { type: 'string' },
107
108
  'treat-config-hints-as-errors': { type: 'boolean' },
108
109
  tsConfig: { type: 'string', short: 't' },
110
+ 'use-tsconfig-files': { type: 'boolean' },
109
111
  version: { type: 'boolean', short: 'V' },
110
112
  watch: { type: 'boolean' },
111
113
  workspace: { type: 'string', short: 'W' },
@@ -33,11 +33,13 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
33
33
  isReportDependencies: boolean;
34
34
  isReportTypes: boolean;
35
35
  isReportValues: boolean;
36
+ isSession: boolean;
36
37
  isShowProgress: boolean;
37
38
  isSkipLibs: boolean;
38
39
  isStrict: boolean;
39
40
  isTrace: boolean;
40
41
  isTreatConfigHintsAsErrors: boolean;
42
+ isUseTscFiles: boolean | undefined;
41
43
  isWatch: boolean;
42
44
  maxShowIssues: number | undefined;
43
45
  parsedConfig: {
@@ -103,6 +103,7 @@ export const createOptions = async (options) => {
103
103
  includedIssueTypes.binaries,
104
104
  isReportTypes: includedIssueTypes.types || includedIssueTypes.nsTypes || includedIssueTypes.enumMembers,
105
105
  isReportValues: includedIssueTypes.exports || includedIssueTypes.nsExports || isReportClassMembers,
106
+ isSession: options.isSession ?? false,
106
107
  isShowProgress: !isDebug &&
107
108
  !isTrace &&
108
109
  parsedCLIArgs['no-progress'] !== true &&
@@ -113,6 +114,7 @@ export const createOptions = async (options) => {
113
114
  isStrict,
114
115
  isTrace,
115
116
  isTreatConfigHintsAsErrors: parsedCLIArgs['treat-config-hints-as-errors'] ?? parsedConfig.treatConfigHintsAsErrors ?? false,
117
+ isUseTscFiles: options.isUseTscFiles ?? parsedCLIArgs['use-tsconfig-files'] ?? (options.isSession && !configFilePath),
116
118
  isWatch: parsedCLIArgs.watch ?? options.isWatch ?? false,
117
119
  maxShowIssues: parsedCLIArgs['max-show-issues'] ? Number(parsedCLIArgs['max-show-issues']) : undefined,
118
120
  parsedConfig,
@@ -2,5 +2,5 @@ import ts from 'typescript';
2
2
  export declare const loadTSConfig: (tsConfigFilePath: string) => Promise<{
3
3
  isFile: boolean;
4
4
  compilerOptions: ts.CompilerOptions;
5
- definitionPaths: string[];
5
+ fileNames: string[];
6
6
  }>;
@@ -1,14 +1,13 @@
1
1
  import ts from 'typescript';
2
2
  import { isFile } from './fs.js';
3
3
  import { dirname } from './path.js';
4
- const dtsMatch = /\.d\.(c|m)?ts$/;
5
4
  export const loadTSConfig = async (tsConfigFilePath) => {
6
5
  if (isFile(tsConfigFilePath)) {
7
6
  const config = ts.readConfigFile(tsConfigFilePath, ts.sys.readFile);
8
7
  const parsedConfig = ts.parseJsonConfigFileContent(config.config, ts.sys, dirname(tsConfigFilePath));
9
8
  const compilerOptions = parsedConfig.options ?? {};
10
- const definitionPaths = parsedConfig.fileNames.filter(filePath => dtsMatch.test(filePath));
11
- return { isFile: true, compilerOptions, definitionPaths };
9
+ const fileNames = parsedConfig.fileNames;
10
+ return { isFile: true, compilerOptions, fileNames };
12
11
  }
13
- return { isFile: false, compilerOptions: {}, definitionPaths: [] };
12
+ return { isFile: false, compilerOptions: {}, fileNames: [] };
14
13
  };
@@ -11,12 +11,12 @@ export type OnFileChange = (options: {
11
11
  duration?: number;
12
12
  mem?: number;
13
13
  }) => void;
14
- type WatchChange = {
14
+ export type WatchChange = {
15
15
  type: 'added' | 'deleted' | 'modified';
16
16
  filePath: string;
17
17
  };
18
- export type WatchHandler = Awaited<ReturnType<typeof getWatchHandler>>;
19
- type Watch = {
18
+ export type SessionHandler = Awaited<ReturnType<typeof getSessionHandler>>;
19
+ type WatchOptions = {
20
20
  analyzedFiles: Set<string>;
21
21
  analyzeSourceFile: (filePath: string, principal: ProjectPrincipal) => void;
22
22
  chief: ConfigurationChief;
@@ -29,7 +29,7 @@ type Watch = {
29
29
  unreferencedFiles: Set<string>;
30
30
  entryPaths: Set<string>;
31
31
  };
32
- export declare const getWatchHandler: (options: MainOptions, { analyzedFiles, analyzeSourceFile, chief, collector, analyze, factory, graph, isIgnored, onFileChange, unreferencedFiles, entryPaths, }: Watch) => Promise<{
32
+ export declare const getSessionHandler: (options: MainOptions, { analyzedFiles, analyzeSourceFile, chief, collector, analyze, factory, graph, isIgnored, onFileChange, unreferencedFiles, entryPaths, }: WatchOptions) => Promise<{
33
33
  listener: WatchListener<string | Buffer<ArrayBufferLike>>;
34
34
  handleFileChanges: (changes: WatchChange[]) => Promise<{
35
35
  duration: number;
@@ -37,6 +37,11 @@ export declare const getWatchHandler: (options: MainOptions, { analyzedFiles, an
37
37
  }>;
38
38
  getEntryPaths: () => Set<string>;
39
39
  getGraph: () => ModuleGraph;
40
- getIssues: () => Issues;
40
+ getIssues: () => {
41
+ issues: Issues;
42
+ counters: import("../types/issues.js").Counters;
43
+ tagHints: Set<import("../types/issues.js").TagHint>;
44
+ configurationHints: Set<import("../types/issues.js").ConfigurationHint>;
45
+ };
41
46
  }>;
42
47
  export {};
@@ -1,3 +1,4 @@
1
+ import { invalidateCache } from '../graph-explorer/cache.js';
1
2
  import { debugLog } from './debug.js';
2
3
  import { isFile } from './fs.js';
3
4
  import { updateImportMap } from './module-graph.js';
@@ -7,8 +8,7 @@ const createUpdate = (options) => {
7
8
  const mem = process.memoryUsage().heapUsed;
8
9
  return { duration, mem };
9
10
  };
10
- export const getWatchHandler = async (options, { analyzedFiles, analyzeSourceFile, chief, collector, analyze, factory, graph, isIgnored, onFileChange, unreferencedFiles, entryPaths, }) => {
11
- const getIssues = () => collector.getIssues().issues;
11
+ export const getSessionHandler = async (options, { analyzedFiles, analyzeSourceFile, chief, collector, analyze, factory, graph, isIgnored, onFileChange, unreferencedFiles, entryPaths, }) => {
12
12
  const handleFileChanges = async (changes) => {
13
13
  const startTime = performance.now();
14
14
  const added = new Set();
@@ -49,6 +49,7 @@ export const getWatchHandler = async (options, { analyzedFiles, analyzeSourceFil
49
49
  }
50
50
  if (added.size === 0 && deleted.size === 0 && modified.size === 0)
51
51
  return createUpdate({ startTime });
52
+ invalidateCache(graph);
52
53
  unreferencedFiles.clear();
53
54
  const cachedUnusedFiles = collector.purge();
54
55
  for (const filePath of added)
@@ -117,7 +118,7 @@ export const getWatchHandler = async (options, { analyzedFiles, analyzeSourceFil
117
118
  collector.addIssue(issue);
118
119
  const update = createUpdate({ startTime });
119
120
  if (onFileChange)
120
- onFileChange(Object.assign({ issues: getIssues() }, update));
121
+ onFileChange(Object.assign({ issues: getIssues().issues }, update));
121
122
  return update;
122
123
  };
123
124
  const listener = (eventType, filePath) => {
@@ -127,9 +128,10 @@ export const getWatchHandler = async (options, { analyzedFiles, analyzeSourceFil
127
128
  handleFileChanges([{ type, filePath }]);
128
129
  }
129
130
  };
130
- if (onFileChange)
131
- onFileChange({ issues: getIssues() });
131
+ const getIssues = () => collector.getIssues();
132
132
  const getEntryPaths = () => entryPaths;
133
133
  const getGraph = () => graph;
134
+ if (onFileChange)
135
+ onFileChange({ issues: getIssues().issues });
134
136
  return { listener, handleFileChanges, getEntryPaths, getGraph, getIssues };
135
137
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.74.0";
1
+ export declare const version = "5.75.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.74.0';
1
+ export const version = '5.75.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.74.0",
3
+ "version": "5.75.1",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {
@@ -24,7 +24,16 @@
24
24
  "url": "https://opencollective.com/knip"
25
25
  }
26
26
  ],
27
- "main": "./dist/index.js",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/types.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./session": {
33
+ "types": "./dist/session/index.d.ts",
34
+ "default": "./dist/session/index.js"
35
+ }
36
+ },
28
37
  "bin": {
29
38
  "knip": "bin/knip.js",
30
39
  "knip-bun": "bin/knip-bun.js"