knip 2.40.2 → 2.41.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 (43) hide show
  1. package/README.md +2 -0
  2. package/dist/ConfigurationValidator.d.ts +56 -0
  3. package/dist/ConfigurationValidator.js +1 -0
  4. package/dist/PrincipalFactory.d.ts +4 -2
  5. package/dist/PrincipalFactory.js +9 -5
  6. package/dist/ProjectPrincipal.d.ts +4 -9
  7. package/dist/ProjectPrincipal.js +5 -4
  8. package/dist/WorkspaceWorker.d.ts +1 -1
  9. package/dist/binaries/resolvers/fallback.js +0 -1
  10. package/dist/binaries/resolvers/index.d.ts +1 -0
  11. package/dist/binaries/resolvers/index.js +1 -0
  12. package/dist/binaries/resolvers/node.js +1 -1
  13. package/dist/binaries/resolvers/tsx.d.ts +2 -0
  14. package/dist/binaries/resolvers/tsx.js +6 -0
  15. package/dist/index.js +5 -3
  16. package/dist/plugins/eslint/helpers.d.ts +0 -2
  17. package/dist/plugins/eslint/helpers.js +8 -5
  18. package/dist/plugins/index.d.ts +1 -0
  19. package/dist/plugins/index.js +1 -0
  20. package/dist/plugins/node-test-runner/index.js +4 -4
  21. package/dist/plugins/tsup/index.d.ts +6 -0
  22. package/dist/plugins/tsup/index.js +23 -0
  23. package/dist/plugins/tsup/types.d.ts +7 -0
  24. package/dist/plugins/tsup/types.js +1 -0
  25. package/dist/plugins/vite/index.js +1 -1
  26. package/dist/plugins/vitest/index.d.ts +1 -1
  27. package/dist/plugins/vitest/index.js +16 -8
  28. package/dist/typescript/ast-helpers.js +5 -2
  29. package/dist/typescript/visitors/exports/moduleExportsAccessExpression.js +20 -25
  30. package/dist/util/compilers.d.ts +10 -0
  31. package/dist/util/fs.d.ts +1 -0
  32. package/dist/util/fs.js +24 -2
  33. package/dist/util/glob.js +1 -1
  34. package/dist/util/loader.js +2 -1
  35. package/dist/util/modules.d.ts +6 -1
  36. package/dist/util/modules.js +2 -2
  37. package/dist/util/plugin.d.ts +1 -0
  38. package/dist/util/plugin.js +1 -0
  39. package/dist/util/require.js +6 -4
  40. package/dist/version.d.ts +1 -1
  41. package/dist/version.js +1 -1
  42. package/package.json +1 -1
  43. package/schema.json +4 -0
package/README.md CHANGED
@@ -304,6 +304,7 @@ Knip contains a growing list of plugins:
304
304
  - [Stylelint][plugin-stylelint]
305
305
  - [Svelte][plugin-svelte]
306
306
  - [Tailwind][plugin-tailwind]
307
+ - [tsup][plugin-tsup]
307
308
  - [TypeDoc][plugin-typedoc]
308
309
  - [TypeScript][plugin-typescript]
309
310
  - [Vite][plugin-vite]
@@ -956,6 +957,7 @@ Special thanks to the wonderful people who have contributed to this project:
956
957
  [plugin-stylelint]: ./src/plugins/stylelint
957
958
  [plugin-svelte]: ./src/plugins/svelte
958
959
  [plugin-tailwind]: ./src/plugins/tailwind
960
+ [plugin-tsup]: ./src/plugins/tsup
959
961
  [plugin-typedoc]: ./src/plugins/typedoc
960
962
  [plugin-typescript]: ./src/plugins/typescript
961
963
  [plugin-vite]: ./src/plugins/vite
@@ -528,6 +528,19 @@ export declare const ConfigurationValidator: z.ZodObject<{
528
528
  entry?: string | string[] | undefined;
529
529
  project?: string | string[] | undefined;
530
530
  }>]>>;
531
+ tsup: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
532
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
533
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
534
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
535
+ }, "strip", z.ZodTypeAny, {
536
+ config?: string | string[] | undefined;
537
+ entry?: string | string[] | undefined;
538
+ project?: string | string[] | undefined;
539
+ }, {
540
+ config?: string | string[] | undefined;
541
+ entry?: string | string[] | undefined;
542
+ project?: string | string[] | undefined;
543
+ }>]>>;
531
544
  typedoc: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
532
545
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
533
546
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -790,6 +803,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
790
803
  entry?: string | string[] | undefined;
791
804
  project?: string | string[] | undefined;
792
805
  } | undefined;
806
+ tsup?: string | boolean | string[] | {
807
+ config?: string | string[] | undefined;
808
+ entry?: string | string[] | undefined;
809
+ project?: string | string[] | undefined;
810
+ } | undefined;
793
811
  typedoc?: string | boolean | string[] | {
794
812
  config?: string | string[] | undefined;
795
813
  entry?: string | string[] | undefined;
@@ -1012,6 +1030,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
1012
1030
  entry?: string | string[] | undefined;
1013
1031
  project?: string | string[] | undefined;
1014
1032
  } | undefined;
1033
+ tsup?: string | boolean | string[] | {
1034
+ config?: string | string[] | undefined;
1035
+ entry?: string | string[] | undefined;
1036
+ project?: string | string[] | undefined;
1037
+ } | undefined;
1015
1038
  typedoc?: string | boolean | string[] | {
1016
1039
  config?: string | string[] | undefined;
1017
1040
  entry?: string | string[] | undefined;
@@ -1532,6 +1555,19 @@ export declare const ConfigurationValidator: z.ZodObject<{
1532
1555
  entry?: string | string[] | undefined;
1533
1556
  project?: string | string[] | undefined;
1534
1557
  }>]>>;
1558
+ tsup: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1559
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1560
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1561
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1562
+ }, "strip", z.ZodTypeAny, {
1563
+ config?: string | string[] | undefined;
1564
+ entry?: string | string[] | undefined;
1565
+ project?: string | string[] | undefined;
1566
+ }, {
1567
+ config?: string | string[] | undefined;
1568
+ entry?: string | string[] | undefined;
1569
+ project?: string | string[] | undefined;
1570
+ }>]>>;
1535
1571
  typedoc: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1536
1572
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1537
1573
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1809,6 +1845,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
1809
1845
  entry?: string | string[] | undefined;
1810
1846
  project?: string | string[] | undefined;
1811
1847
  } | undefined;
1848
+ tsup?: string | boolean | string[] | {
1849
+ config?: string | string[] | undefined;
1850
+ entry?: string | string[] | undefined;
1851
+ project?: string | string[] | undefined;
1852
+ } | undefined;
1812
1853
  typedoc?: string | boolean | string[] | {
1813
1854
  config?: string | string[] | undefined;
1814
1855
  entry?: string | string[] | undefined;
@@ -2025,6 +2066,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
2025
2066
  entry?: string | string[] | undefined;
2026
2067
  project?: string | string[] | undefined;
2027
2068
  } | undefined;
2069
+ tsup?: string | boolean | string[] | {
2070
+ config?: string | string[] | undefined;
2071
+ entry?: string | string[] | undefined;
2072
+ project?: string | string[] | undefined;
2073
+ } | undefined;
2028
2074
  typedoc?: string | boolean | string[] | {
2029
2075
  config?: string | string[] | undefined;
2030
2076
  entry?: string | string[] | undefined;
@@ -2262,6 +2308,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
2262
2308
  entry?: string | string[] | undefined;
2263
2309
  project?: string | string[] | undefined;
2264
2310
  } | undefined;
2311
+ tsup?: string | boolean | string[] | {
2312
+ config?: string | string[] | undefined;
2313
+ entry?: string | string[] | undefined;
2314
+ project?: string | string[] | undefined;
2315
+ } | undefined;
2265
2316
  typedoc?: string | boolean | string[] | {
2266
2317
  config?: string | string[] | undefined;
2267
2318
  entry?: string | string[] | undefined;
@@ -2478,6 +2529,11 @@ export declare const ConfigurationValidator: z.ZodObject<{
2478
2529
  entry?: string | string[] | undefined;
2479
2530
  project?: string | string[] | undefined;
2480
2531
  } | undefined;
2532
+ tsup?: string | boolean | string[] | {
2533
+ config?: string | string[] | undefined;
2534
+ entry?: string | string[] | undefined;
2535
+ project?: string | string[] | undefined;
2536
+ } | undefined;
2481
2537
  typedoc?: string | boolean | string[] | {
2482
2538
  config?: string | string[] | undefined;
2483
2539
  entry?: string | string[] | undefined;
@@ -98,6 +98,7 @@ const pluginsSchema = z.object({
98
98
  stryker: pluginSchema,
99
99
  stylelint: pluginSchema,
100
100
  tailwind: pluginSchema,
101
+ tsup: pluginSchema,
101
102
  typedoc: pluginSchema,
102
103
  typescript: pluginSchema,
103
104
  vite: pluginSchema,
@@ -1,6 +1,7 @@
1
1
  import ts from 'typescript';
2
2
  import { ProjectPrincipal } from './ProjectPrincipal.js';
3
3
  import type { SyncCompilers, AsyncCompilers } from './types/compilers.js';
4
+ import type { GlobbyFilterFunction } from 'globby';
4
5
  type Paths = ts.CompilerOptions['paths'];
5
6
  type Principal = {
6
7
  principal: ProjectPrincipal;
@@ -9,16 +10,17 @@ type Principal = {
9
10
  pkgNames: Set<string>;
10
11
  };
11
12
  type Principals = Set<Principal>;
12
- type Options = {
13
+ export type PrincipalOptions = {
13
14
  cwd: string;
14
15
  compilerOptions: ts.CompilerOptions;
15
16
  paths: Paths;
16
17
  compilers: [SyncCompilers, AsyncCompilers];
17
18
  pkgName: string;
19
+ isGitIgnored: GlobbyFilterFunction;
18
20
  };
19
21
  export declare class PrincipalFactory {
20
22
  principals: Principals;
21
- getPrincipal(options: Options): ProjectPrincipal;
23
+ getPrincipal(options: PrincipalOptions): ProjectPrincipal;
22
24
  private findReusablePrincipal;
23
25
  private linkPrincipal;
24
26
  private addNewPrincipal;
@@ -1,12 +1,16 @@
1
1
  import ts from 'typescript';
2
2
  import { ProjectPrincipal } from './ProjectPrincipal.js';
3
3
  import { toAbsolute } from './util/path.js';
4
+ const mapToAbsolutePaths = (paths, cwd) => Object.keys(paths).reduce((result, key) => {
5
+ result[key] = paths[key].map(entry => toAbsolute(entry, cwd));
6
+ return result;
7
+ }, {});
4
8
  const mergePaths = (cwd, compilerOptions, paths = {}) => {
5
- const overridePaths = Object.keys(paths).reduce((overridePaths, key) => {
6
- overridePaths[key] = paths[key].map(entry => toAbsolute(entry, cwd));
7
- return overridePaths;
8
- }, {});
9
- compilerOptions.paths = { ...compilerOptions.paths, ...overridePaths };
9
+ const compilerPaths = !compilerOptions.baseUrl && compilerOptions.paths
10
+ ? mapToAbsolutePaths(compilerOptions.paths, cwd)
11
+ : compilerOptions.paths;
12
+ const extraPaths = mapToAbsolutePaths(paths, cwd);
13
+ compilerOptions.paths = { ...compilerPaths, ...extraPaths };
10
14
  return compilerOptions;
11
15
  };
12
16
  export class PrincipalFactory {
@@ -1,19 +1,15 @@
1
- import { isGitIgnoredSync } from 'globby';
2
1
  import ts from 'typescript';
3
2
  import { createCustomModuleResolver } from './typescript/resolveModuleNames.js';
4
3
  import { SourceFileManager } from './typescript/SourceFileManager.js';
4
+ import type { PrincipalOptions } from './PrincipalFactory.js';
5
5
  import type { SyncCompilers, AsyncCompilers } from './types/compilers.js';
6
6
  import type { ExportItem, ExportItemMember } from './types/exports.js';
7
- type ProjectPrincipalOptions = {
8
- compilerOptions: ts.CompilerOptions;
9
- cwd: string;
10
- compilers: [SyncCompilers, AsyncCompilers];
11
- };
7
+ import type { GlobbyFilterFunction } from 'globby';
12
8
  export declare class ProjectPrincipal {
13
9
  entryPaths: Set<string>;
14
10
  projectPaths: Set<string>;
15
11
  skipExportsAnalysis: Set<string>;
16
- isGitIgnored: ReturnType<typeof isGitIgnoredSync>;
12
+ isGitIgnored: GlobbyFilterFunction;
17
13
  cwd: string;
18
14
  compilerOptions: ts.CompilerOptions;
19
15
  extensions: Set<string>;
@@ -26,7 +22,7 @@ export declare class ProjectPrincipal {
26
22
  lsFindReferences: ts.LanguageService['findReferences'];
27
23
  program?: ts.Program;
28
24
  };
29
- constructor({ compilerOptions, cwd, compilers }: ProjectPrincipalOptions);
25
+ constructor({ compilerOptions, cwd, compilers, isGitIgnored }: PrincipalOptions);
30
26
  private createProgram;
31
27
  private hasAcceptedExtension;
32
28
  addEntryPath(filePath: string, options?: {
@@ -67,4 +63,3 @@ export declare class ProjectPrincipal {
67
63
  col: number;
68
64
  };
69
65
  }
70
- export {};
@@ -1,4 +1,3 @@
1
- import { isGitIgnoredSync } from 'globby';
2
1
  import ts from 'typescript';
3
2
  import { DEFAULT_EXTENSIONS } from './constants.js';
4
3
  import { IGNORED_FILE_EXTENSIONS } from './constants.js';
@@ -35,9 +34,9 @@ export class ProjectPrincipal {
35
34
  syncCompilers;
36
35
  asyncCompilers;
37
36
  backend;
38
- constructor({ compilerOptions, cwd, compilers }) {
37
+ constructor({ compilerOptions, cwd, compilers, isGitIgnored }) {
39
38
  this.cwd = cwd;
40
- this.isGitIgnored = isGitIgnoredSync({ cwd });
39
+ this.isGitIgnored = isGitIgnored;
41
40
  this.compilerOptions = {
42
41
  ...compilerOptions,
43
42
  ...baseCompilerOptions,
@@ -126,7 +125,9 @@ export class ProjectPrincipal {
126
125
  external.add(sanitizedSpecifier);
127
126
  }
128
127
  else {
129
- this.addEntryPath(resolvedModule.resolvedFileName, { skipExportsAnalysis: true });
128
+ const isIgnored = this.isGitIgnored(resolvedModule.resolvedFileName);
129
+ if (!isIgnored)
130
+ this.addEntryPath(resolvedModule.resolvedFileName, { skipExportsAnalysis: true });
130
131
  }
131
132
  }
132
133
  else {
@@ -52,7 +52,7 @@ export declare class WorkspaceWorker {
52
52
  installedBinaries: InstalledBinaries;
53
53
  referencedDependencies: ReferencedDependencies;
54
54
  hasTypesIncluded: Set<string>;
55
- enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "markdownlint" | "mocha" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "typedoc" | "typescript" | "vite" | "vitest" | "webpack" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "svelte")[];
55
+ enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "markdownlint" | "mocha" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "tailwind" | "tsup" | "typedoc" | "typescript" | "vite" | "vitest" | "webpack" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "svelte")[];
56
56
  entryFilePatterns: string[];
57
57
  productionEntryFilePatterns: string[];
58
58
  }>;
@@ -12,7 +12,6 @@ const argFilters = {
12
12
  execa: withPositional,
13
13
  'ts-node': withPositional,
14
14
  zx: withPositional,
15
- tsx: parsed => parsed._.filter(p => p !== 'watch'),
16
15
  default: withoutPositional,
17
16
  };
18
17
  const spawningBinaries = ['cross-env', 'retry-cli'];
@@ -6,4 +6,5 @@ export * as npx from './npx.js';
6
6
  export * as nx from './nx.js';
7
7
  export * as pnpm from './pnpm.js';
8
8
  export * as rollup from './rollup.js';
9
+ export * as tsx from './tsx.js';
9
10
  export * as yarn from './yarn.js';
@@ -6,4 +6,5 @@ export * as npx from './npx.js';
6
6
  export * as nx from './nx.js';
7
7
  export * as pnpm from './pnpm.js';
8
8
  export * as rollup from './rollup.js';
9
+ export * as tsx from './tsx.js';
9
10
  export * as yarn from './yarn.js';
@@ -4,7 +4,7 @@ import { tryResolveFilePath, tryResolveSpecifiers } from '../util.js';
4
4
  export const resolve = (binary, args, { cwd }) => {
5
5
  const parsed = parseArgs(args, {
6
6
  string: ['r'],
7
- alias: { require: ['r', 'loader', 'experimental-loader', 'test-reporter'] },
7
+ alias: { require: ['r', 'loader', 'experimental-loader', 'test-reporter', 'watch'] },
8
8
  });
9
9
  return compact([tryResolveFilePath(cwd, parsed._[0]), ...tryResolveSpecifiers(cwd, [parsed.require].flat())]);
10
10
  };
@@ -0,0 +1,2 @@
1
+ import type { Resolver } from '../types.js';
2
+ export declare const resolve: Resolver;
@@ -0,0 +1,6 @@
1
+ import { toBinary } from '../../util/protocols.js';
2
+ import { resolve as resolveNode } from './node.js';
3
+ export const resolve = (binary, args, options) => {
4
+ args = args.map(a => (a === 'watch' ? '--watch' : a));
5
+ return [toBinary(binary), ...resolveNode(binary, args, options)];
6
+ };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isGitIgnoredSync } from 'globby';
1
2
  import micromatch from 'micromatch';
2
3
  import { _getDependenciesFromScripts } from './binaries/index.js';
3
4
  import { ConfigurationChief } from './ConfigurationChief.js';
@@ -21,6 +22,7 @@ export const main = async (unresolvedConfiguration) => {
21
22
  const deputy = new DependencyDeputy({ isStrict });
22
23
  const factory = new PrincipalFactory();
23
24
  const streamer = new ConsoleStreamer({ isEnabled: isShowProgress });
25
+ const isGitIgnored = gitignore ? isGitIgnoredSync({ cwd }) : () => false;
24
26
  streamer.cast('Reading workspace configuration(s)...');
25
27
  await chief.init();
26
28
  const compilers = chief.getCompilers();
@@ -41,7 +43,7 @@ export const main = async (unresolvedConfiguration) => {
41
43
  if (isInternal(specifier)) {
42
44
  const filePath = principal.resolveModule(specifier, containingFilePath)?.resolvedFileName;
43
45
  if (filePath) {
44
- const ignorePatterns = workspace.config.ignore.map(pattern => join(dirname(containingFilePath), pattern));
46
+ const ignorePatterns = workspace.config.ignore.map(pattern => join(workspace.dir, pattern));
45
47
  const isIgnored = micromatch.isMatch(filePath, ignorePatterns);
46
48
  if (!isIgnored)
47
49
  principal.addEntryPath(filePath);
@@ -85,7 +87,7 @@ export const main = async (unresolvedConfiguration) => {
85
87
  streamer.cast(`Analyzing workspace ${name}...`);
86
88
  deputy.addWorkspace({ name, dir, manifestPath, manifest, ignoreDependencies, ignoreBinaries });
87
89
  const { compilerOptions, definitionPaths } = await loadTSConfig(join(dir, tsConfigFile ?? 'tsconfig.json'));
88
- const principal = factory.getPrincipal({ cwd: dir, paths, compilerOptions, compilers, pkgName });
90
+ const principal = factory.getPrincipal({ cwd: dir, paths, compilerOptions, compilers, pkgName, isGitIgnored });
89
91
  const worker = new WorkspaceWorker({
90
92
  name,
91
93
  dir,
@@ -102,7 +104,7 @@ export const main = async (unresolvedConfiguration) => {
102
104
  principal.addEntryPaths(definitionPaths);
103
105
  debugLogArray(name, `Definition paths`, definitionPaths);
104
106
  const sharedGlobOptions = { cwd, workingDir: dir, gitignore, ignore: worker.getIgnorePatterns() };
105
- const entryPathsFromManifest = await getEntryPathFromManifest(cwd, dir, manifest);
107
+ const entryPathsFromManifest = await getEntryPathFromManifest(manifest, sharedGlobOptions);
106
108
  debugLogArray(name, 'Entry paths in package.json', entryPathsFromManifest);
107
109
  principal.addEntryPaths(entryPathsFromManifest);
108
110
  const dependencies = await worker.findAllDependencies();
@@ -4,6 +4,4 @@ type GetDependenciesDeep = (configFilePath: string, options: {
4
4
  manifest: PackageJsonWithPlugins;
5
5
  }, dependencies?: Set<string>) => Promise<Set<string>>;
6
6
  export declare const getDependenciesDeep: GetDependenciesDeep;
7
- export declare const resolvePluginSpecifier: (specifier: string) => string;
8
- export declare const resolveExtendSpecifier: (specifier: string) => string | undefined;
9
7
  export {};
@@ -1,4 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
+ import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
2
3
  import { isInternal, dirname, toAbsolute } from '../../util/path.js';
3
4
  import { load } from '../../util/plugin.js';
4
5
  import { _resolve } from '../../util/require.js';
@@ -54,15 +55,17 @@ const resolveSpecifier = (namespace, rawSpecifier) => {
54
55
  const specifier = rawSpecifier.replace(/(^plugin:|:.+$)/, '');
55
56
  if (isQualifiedSpecifier(specifier))
56
57
  return specifier;
57
- if (!specifier.startsWith('@'))
58
- return `${namespace}-${specifier}`;
58
+ if (!specifier.startsWith('@')) {
59
+ const id = rawSpecifier.startsWith('plugin:') ? getPackageNameFromModuleSpecifier(specifier) : specifier;
60
+ return `${namespace}-${id}`;
61
+ }
59
62
  const [scope, name, ...rest] = specifier.split('/');
60
63
  if (rawSpecifier.startsWith('plugin:') && rest.length === 0)
61
- return [scope, namespace, name].join('/');
64
+ return [scope, namespace].join('/');
62
65
  return [scope, name ? `${namespace}-${name}` : namespace, ...rest].join('/');
63
66
  };
64
- export const resolvePluginSpecifier = (specifier) => resolveSpecifier('eslint-plugin', specifier);
65
- export const resolveExtendSpecifier = (specifier) => {
67
+ const resolvePluginSpecifier = (specifier) => resolveSpecifier('eslint-plugin', specifier);
68
+ const resolveExtendSpecifier = (specifier) => {
66
69
  if (isInternal(specifier))
67
70
  return;
68
71
  if (/^next(\/.+)?$/.test(specifier))
@@ -39,6 +39,7 @@ export * as stryker from './stryker/index.js';
39
39
  export * as stylelint from './stylelint/index.js';
40
40
  export * as svelte from './svelte/index.js';
41
41
  export * as tailwind from './tailwind/index.js';
42
+ export * as tsup from './tsup/index.js';
42
43
  export * as typedoc from './typedoc/index.js';
43
44
  export * as typescript from './typescript/index.js';
44
45
  export * as vite from './vite/index.js';
@@ -39,6 +39,7 @@ export * as stryker from './stryker/index.js';
39
39
  export * as stylelint from './stylelint/index.js';
40
40
  export * as svelte from './svelte/index.js';
41
41
  export * as tailwind from './tailwind/index.js';
42
+ export * as tsup from './tsup/index.js';
42
43
  export * as typedoc from './typedoc/index.js';
43
44
  export * as typescript from './typescript/index.js';
44
45
  export * as vite from './vite/index.js';
@@ -8,10 +8,10 @@ export const isEnabled = ({ manifest }) => {
8
8
  .some(s => manifest.scripts && /node (.*)--test/.test(manifest.scripts[s]));
9
9
  };
10
10
  export const ENTRY_FILE_PATTERNS = [
11
- '**/test.{js,cjs,mjs}',
12
- '**/test-*.{js,cjs,mjs}',
13
- '**/*{.,-,_}test.{js,cjs,mjs}',
14
- '**/test/**/*.{js,cjs,mjs}',
11
+ '**/*{.,-,_}test.?(c|m)js',
12
+ '**/test-*.?(c|m)js',
13
+ '**/test.?(c|m)js',
14
+ '**/test/**/*.?(c|m)js',
15
15
  ];
16
16
  const findNodeTestRunnerDependencies = async (configFilePath, options) => {
17
17
  return (options.config?.entry ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
@@ -0,0 +1,6 @@
1
+ import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
2
+ export declare const NAME = "tsup";
3
+ export declare const ENABLERS: string[];
4
+ export declare const isEnabled: IsPluginEnabledCallback;
5
+ export declare const CONFIG_FILE_PATTERNS: string[];
6
+ export declare const findDependencies: GenericPluginCallback;
@@ -0,0 +1,23 @@
1
+ import { timerify } from '../../util/Performance.js';
2
+ import { hasDependency, load } from '../../util/plugin.js';
3
+ import { toEntryPattern } from '../../util/protocols.js';
4
+ export const NAME = 'tsup';
5
+ export const ENABLERS = ['tsup'];
6
+ export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
7
+ export const CONFIG_FILE_PATTERNS = ['tsup.config.js'];
8
+ const findTsupDependencies = async (configFilePath) => {
9
+ let localConfig = await load(configFilePath);
10
+ if (typeof localConfig === 'function')
11
+ localConfig = await localConfig({});
12
+ if (!localConfig)
13
+ return [];
14
+ const entryPatterns = [localConfig].flat().flatMap(config => {
15
+ if (!config.entry)
16
+ return [];
17
+ if (Array.isArray(config.entry))
18
+ return config.entry.map(toEntryPattern);
19
+ return Object.values(config.entry).map(toEntryPattern);
20
+ });
21
+ return entryPatterns;
22
+ };
23
+ export const findDependencies = timerify(findTsupDependencies);
@@ -0,0 +1,7 @@
1
+ type Entry = string[] | Record<string, string>;
2
+ type Options = {
3
+ entry?: Entry;
4
+ };
5
+ type MaybePromise<T> = T | Promise<T>;
6
+ export type TsupConfig = Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>);
7
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -9,6 +9,6 @@ const findViteDependencies = async (configFilePath, options) => {
9
9
  const localConfig = await load(configFilePath);
10
10
  if (!localConfig)
11
11
  return [];
12
- return findVitestDependencies(localConfig, options);
12
+ return findVitestDependencies(configFilePath, localConfig, options);
13
13
  };
14
14
  export const findDependencies = timerify(findViteDependencies);
@@ -5,5 +5,5 @@ export declare const ENABLERS: string[];
5
5
  export declare const isEnabled: IsPluginEnabledCallback;
6
6
  export declare const CONFIG_FILE_PATTERNS: string[];
7
7
  export declare const ENTRY_FILE_PATTERNS: string[];
8
- export declare const findVitestDependencies: (localConfig: ViteConfigOrFn, options: GenericPluginCallbackOptions) => Promise<any[]>;
8
+ export declare const findVitestDependencies: (configFilePath: string, localConfig: ViteConfigOrFn, options: GenericPluginCallbackOptions) => Promise<any[]>;
9
9
  export declare const findDependencies: GenericPluginCallback;
@@ -1,6 +1,7 @@
1
1
  import { compact } from '../../util/array.js';
2
+ import { dirname, join, relative } from '../../util/path.js';
2
3
  import { timerify } from '../../util/Performance.js';
3
- import { hasDependency, load } from '../../util/plugin.js';
4
+ import { hasDependency, load, tryResolve } from '../../util/plugin.js';
4
5
  import { toEntryPattern } from '../../util/protocols.js';
5
6
  import { getEnvPackageName, getExternalReporters } from './helpers.js';
6
7
  export const NAME = 'Vitest';
@@ -8,7 +9,14 @@ export const ENABLERS = ['vitest'];
8
9
  export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
9
10
  export const CONFIG_FILE_PATTERNS = ['vitest.config.ts', 'vitest.{workspace,projects}.{ts,js,json}'];
10
11
  export const ENTRY_FILE_PATTERNS = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
11
- const findConfigDependencies = (localConfig, options) => {
12
+ const resolveEntry = (containingFilePath, specifier) => {
13
+ const dir = dirname(containingFilePath);
14
+ const resolvedPath = tryResolve(join(dir, specifier), containingFilePath);
15
+ if (resolvedPath)
16
+ return toEntryPattern(relative(dir, resolvedPath));
17
+ return specifier;
18
+ };
19
+ const findConfigDependencies = (configFilePath, localConfig, options) => {
12
20
  const { isProduction, config } = options;
13
21
  const testConfig = localConfig.test;
14
22
  const entryPatterns = (config?.entry ?? testConfig?.include ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
@@ -17,11 +25,11 @@ const findConfigDependencies = (localConfig, options) => {
17
25
  const environments = testConfig.environment ? [getEnvPackageName(testConfig.environment)] : [];
18
26
  const reporters = getExternalReporters(testConfig.reporters);
19
27
  const coverage = testConfig.coverage ? [`@vitest/coverage-${testConfig.coverage.provider ?? 'v8'}`] : [];
20
- const setupFiles = testConfig.setupFiles ? [testConfig.setupFiles].flat() : [];
21
- const globalSetup = testConfig.globalSetup ? [testConfig.globalSetup].flat() : [];
28
+ const setupFiles = [testConfig.setupFiles ?? []].flat().map(v => resolveEntry(configFilePath, v));
29
+ const globalSetup = [testConfig.globalSetup ?? []].flat().map(v => resolveEntry(configFilePath, v));
22
30
  return [...entryPatterns, ...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup];
23
31
  };
24
- export const findVitestDependencies = async (localConfig, options) => {
32
+ export const findVitestDependencies = async (configFilePath, localConfig, options) => {
25
33
  if (!localConfig)
26
34
  return [];
27
35
  if (typeof localConfig === 'function') {
@@ -29,21 +37,21 @@ export const findVitestDependencies = async (localConfig, options) => {
29
37
  for (const command of ['dev', 'serve', 'build']) {
30
38
  for (const mode of ['development', 'production']) {
31
39
  const config = await localConfig({ command, mode, ssrBuild: undefined });
32
- findConfigDependencies(config, options).forEach(dependency => dependencies.add(dependency));
40
+ findConfigDependencies(configFilePath, config, options).forEach(dependency => dependencies.add(dependency));
33
41
  }
34
42
  }
35
43
  return Array.from(dependencies);
36
44
  }
37
45
  if (!localConfig.test)
38
46
  return [];
39
- return findConfigDependencies(localConfig, options);
47
+ return findConfigDependencies(configFilePath, localConfig, options);
40
48
  };
41
49
  const findVitestWorkspaceDependencies = async (configFilePath, options) => {
42
50
  const localConfig = await load(configFilePath);
43
51
  const dependencies = new Set();
44
52
  for (const config of [localConfig].flat()) {
45
53
  if (config && typeof config !== 'string') {
46
- (await findVitestDependencies(config, options)).forEach(dependency => dependencies.add(dependency));
54
+ (await findVitestDependencies(configFilePath, config, options)).forEach(dependency => dependencies.add(dependency));
47
55
  }
48
56
  }
49
57
  return compact(dependencies);
@@ -97,8 +97,11 @@ export const isInModuleBlock = (node) => {
97
97
  };
98
98
  export const getJSDocTags = (node) => {
99
99
  const tags = new Set();
100
- const declaration = ts.isExportSpecifier(node) || ts.isBindingElement(node) ? node.parent.parent : node;
101
- for (const tagNode of ts.getJSDocTags(declaration)) {
100
+ let tagNodes = ts.getJSDocTags(node);
101
+ if (ts.isExportSpecifier(node) || ts.isBindingElement(node)) {
102
+ tagNodes = [...tagNodes, ...ts.getJSDocTags(node.parent.parent)];
103
+ }
104
+ for (const tagNode of tagNodes) {
102
105
  const match = tagNode.getText()?.match(/@\S+/);
103
106
  if (match)
104
107
  tags.add(match[0]);
@@ -3,42 +3,37 @@ import { SymbolType } from '../../../types/issues.js';
3
3
  import { stripQuotes } from '../../ast-helpers.js';
4
4
  import { isJS } from '../helpers.js';
5
5
  import { exportVisitor as visit } from '../index.js';
6
+ const isModuleExportsAccess = (node) => ts.isIdentifier(node.expression) && node.expression.escapedText === 'module' && node.name.escapedText === 'exports';
6
7
  export default visit(isJS, node => {
7
8
  if (ts.isExpressionStatement(node)) {
8
9
  if (ts.isBinaryExpression(node.expression)) {
9
- if (ts.isPropertyAccessExpression(node.expression.left) &&
10
- ts.isPropertyAccessExpression(node.expression.left.expression) &&
11
- ts.isIdentifier(node.expression.left.expression.expression) &&
12
- node.expression.left.expression.expression.escapedText === 'module' &&
13
- node.expression.left.expression.name.escapedText === 'exports') {
14
- const identifier = node.expression.left.name.getText();
15
- const pos = node.expression.left.name.pos;
16
- return { node, identifier, type: SymbolType.UNKNOWN, pos };
10
+ if (ts.isPropertyAccessExpression(node.expression.left)) {
11
+ if (ts.isPropertyAccessExpression(node.expression.left.expression) &&
12
+ isModuleExportsAccess(node.expression.left.expression)) {
13
+ const identifier = node.expression.left.name.getText();
14
+ const pos = node.expression.left.name.pos;
15
+ return { node, identifier, type: SymbolType.UNKNOWN, pos };
16
+ }
17
+ else if (isModuleExportsAccess(node.expression.left)) {
18
+ const expr = node.expression.right;
19
+ if (ts.isObjectLiteralExpression(expr) && expr.properties.every(ts.isShorthandPropertyAssignment)) {
20
+ return expr.properties.map(node => {
21
+ return { node, identifier: node.getText(), type: SymbolType.UNKNOWN, pos: node.pos };
22
+ });
23
+ }
24
+ else {
25
+ return { node, identifier: 'default', type: SymbolType.UNKNOWN, pos: expr.pos };
26
+ }
27
+ }
17
28
  }
18
29
  else if (ts.isElementAccessExpression(node.expression.left) &&
19
30
  ts.isPropertyAccessExpression(node.expression.left.expression) &&
20
31
  ts.isIdentifier(node.expression.left.expression.name) &&
21
- ts.isIdentifier(node.expression.left.expression.expression) &&
22
- node.expression.left.expression.expression.escapedText === 'module' &&
23
- node.expression.left.expression.name.escapedText === 'exports') {
32
+ isModuleExportsAccess(node.expression.left.expression)) {
24
33
  const identifier = stripQuotes(node.expression.left.argumentExpression.getText());
25
34
  const pos = node.expression.left.argumentExpression.pos;
26
35
  return { node, identifier, type: SymbolType.UNKNOWN, pos };
27
36
  }
28
- else if (ts.isPropertyAccessExpression(node.expression.left) &&
29
- ts.isIdentifier(node.expression.left.expression) &&
30
- node.expression.left.expression.escapedText === 'module' &&
31
- node.expression.left.name.escapedText === 'exports') {
32
- const expr = node.expression.right;
33
- if (ts.isObjectLiteralExpression(expr) && expr.properties.every(ts.isShorthandPropertyAssignment)) {
34
- return expr.properties.map(node => {
35
- return { node, identifier: node.getText(), type: SymbolType.UNKNOWN, pos: node.pos };
36
- });
37
- }
38
- else {
39
- return { node, identifier: 'default', type: SymbolType.UNKNOWN, pos: expr.pos };
40
- }
41
- }
42
37
  }
43
38
  }
44
39
  });
@@ -212,6 +212,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
212
212
  entry?: string | string[] | undefined;
213
213
  project?: string | string[] | undefined;
214
214
  } | undefined;
215
+ tsup?: string | boolean | string[] | {
216
+ config?: string | string[] | undefined;
217
+ entry?: string | string[] | undefined;
218
+ project?: string | string[] | undefined;
219
+ } | undefined;
215
220
  typedoc?: string | boolean | string[] | {
216
221
  config?: string | string[] | undefined;
217
222
  entry?: string | string[] | undefined;
@@ -428,6 +433,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
428
433
  entry?: string | string[] | undefined;
429
434
  project?: string | string[] | undefined;
430
435
  } | undefined;
436
+ tsup?: string | boolean | string[] | {
437
+ config?: string | string[] | undefined;
438
+ entry?: string | string[] | undefined;
439
+ project?: string | string[] | undefined;
440
+ } | undefined;
431
441
  typedoc?: string | boolean | string[] | {
432
442
  config?: string | string[] | undefined;
433
443
  entry?: string | string[] | undefined;
package/dist/util/fs.d.ts CHANGED
@@ -5,3 +5,4 @@ export declare const loadJSON: (filePath: string) => Promise<any>;
5
5
  export declare const loadYAML: (filePath: string) => Promise<unknown>;
6
6
  export declare const parseJSON: (filePath: string, contents: string) => Promise<any>;
7
7
  export declare const parseYAML: (contents: string) => Promise<unknown>;
8
+ export declare function isTypeModule(filePath: string): boolean;
package/dist/util/fs.js CHANGED
@@ -1,9 +1,9 @@
1
- import { statSync } from 'node:fs';
1
+ import { readFileSync, statSync } from 'node:fs';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import yaml from 'js-yaml';
4
4
  import stripJsonComments from 'strip-json-comments';
5
5
  import { LoaderError } from './errors.js';
6
- import { join } from './path.js';
6
+ import { dirname, join } from './path.js';
7
7
  export const isFile = (filePath) => {
8
8
  const stat = statSync(filePath, { throwIfNoEntry: false });
9
9
  return stat !== undefined && stat.isFile();
@@ -40,3 +40,25 @@ export const parseJSON = async (filePath, contents) => {
40
40
  export const parseYAML = async (contents) => {
41
41
  return yaml.load(contents);
42
42
  };
43
+ export function isTypeModule(filePath) {
44
+ if (!filePath.endsWith('.js'))
45
+ return false;
46
+ try {
47
+ let currentDir = dirname(filePath);
48
+ while (true) {
49
+ const packagePath = join(currentDir, 'package.json');
50
+ try {
51
+ const data = JSON.parse(readFileSync(packagePath, 'utf-8'));
52
+ return data.type === 'module';
53
+ }
54
+ catch { }
55
+ const parentDir = dirname(currentDir);
56
+ if (parentDir === currentDir)
57
+ return false;
58
+ currentDir = parentDir;
59
+ }
60
+ }
61
+ catch (error) {
62
+ return false;
63
+ }
64
+ }
package/dist/util/glob.js CHANGED
@@ -24,7 +24,7 @@ const glob = async ({ cwd, workingDir = cwd, patterns, ignore = [], gitignore =
24
24
  if (globPatterns[0].startsWith('!'))
25
25
  return [];
26
26
  const ignorePatterns = compact([...ignore, ...GLOBAL_IGNORE_PATTERNS]);
27
- debugLogObject(relativePath || ROOT_WORKSPACE_NAME, `Glob options`, { cwd, globPatterns, ignorePatterns });
27
+ debugLogObject(relativePath || ROOT_WORKSPACE_NAME, `Glob options`, { cwd, globPatterns, ignorePatterns, gitignore });
28
28
  return globby(globPatterns, {
29
29
  cwd,
30
30
  ignore: ignorePatterns,
@@ -1,6 +1,7 @@
1
1
  import { pathToFileURL } from 'node:url';
2
2
  import { LoaderError } from './errors.js';
3
3
  import { loadJSON, loadYAML, loadFile, parseJSON, parseYAML } from './fs.js';
4
+ import { isTypeModule } from './fs.js';
4
5
  import { extname } from './path.js';
5
6
  import { timerify } from './Performance.js';
6
7
  import { jiti } from './register.js';
@@ -20,7 +21,7 @@ const load = async (filePath) => {
20
21
  if (ext === '.yaml' || ext === '.yml') {
21
22
  return loadYAML(filePath);
22
23
  }
23
- if (ext === '.mjs') {
24
+ if (ext === '.mjs' || (ext === '.js' && isTypeModule(filePath))) {
24
25
  const fileUrl = pathToFileURL(filePath);
25
26
  const imported = await import(fileUrl.href);
26
27
  return imported.default ?? imported;
@@ -6,5 +6,10 @@ export declare const isMaybePackageName: (specifier: string) => boolean;
6
6
  export declare const isDefinitelyTyped: (packageName: string) => boolean;
7
7
  export declare const getDefinitelyTypedFor: (packageName: string) => string;
8
8
  export declare const getPackageFromDefinitelyTyped: (typedDependency: string) => string;
9
- export declare const getEntryPathFromManifest: (cwd: string, dir: string, manifest: PackageJson) => Promise<string[]>;
9
+ export declare const getEntryPathFromManifest: (manifest: PackageJson, sharedGlobOptions: {
10
+ cwd: string;
11
+ workingDir: string;
12
+ gitignore: boolean;
13
+ ignore: string[];
14
+ }) => Promise<string[]>;
10
15
  export declare const sanitizeSpecifier: (specifier: string) => string;
@@ -35,7 +35,7 @@ export const getPackageFromDefinitelyTyped = (typedDependency) => {
35
35
  }
36
36
  return typedDependency;
37
37
  };
38
- export const getEntryPathFromManifest = (cwd, dir, manifest) => {
38
+ export const getEntryPathFromManifest = (manifest, sharedGlobOptions) => {
39
39
  const { main, bin, exports } = manifest;
40
40
  const entryPaths = new Set();
41
41
  if (typeof main === 'string')
@@ -49,7 +49,7 @@ export const getEntryPathFromManifest = (cwd, dir, manifest) => {
49
49
  if (exports) {
50
50
  getStringValues(exports).forEach(item => entryPaths.add(item));
51
51
  }
52
- return _glob({ cwd, workingDir: dir, patterns: Array.from(entryPaths) });
52
+ return _glob({ ...sharedGlobOptions, patterns: Array.from(entryPaths) });
53
53
  };
54
54
  export const sanitizeSpecifier = (specifier) => {
55
55
  if (specifier.startsWith('node:'))
@@ -1,4 +1,5 @@
1
1
  export { _load as load, _loadFile as loadFile } from './loader.js';
2
+ export { _tryResolve as tryResolve } from './require.js';
2
3
  import type { RawPluginConfiguration } from '../types/config.js';
3
4
  export declare const toCamelCase: (name: string) => string;
4
5
  export declare const hasDependency: (dependencies: Set<string>, values: (string | RegExp)[]) => boolean;
@@ -1,4 +1,5 @@
1
1
  export { _load as load, _loadFile as loadFile } from './loader.js';
2
+ export { _tryResolve as tryResolve } from './require.js';
2
3
  import { arrayify } from './array.js';
3
4
  export const toCamelCase = (name) => name.toLowerCase().replace(/(-[a-z])/g, group => group.toUpperCase().replace('-', ''));
4
5
  export const hasDependency = (dependencies, values) => values.some(value => {
@@ -1,12 +1,15 @@
1
1
  import { createRequire as nodeCreateRequire } from 'node:module';
2
2
  import { pathToFileURL } from 'node:url';
3
+ import createJITI from 'jiti';
3
4
  import { debugLog } from './debug.js';
4
5
  import { getPackageNameFromModuleSpecifier } from './modules.js';
5
6
  import { cwd, toPosix, join } from './path.js';
6
7
  import { timerify } from './Performance.js';
8
+ import { jiti } from './register.js';
7
9
  const createRequire = (path) => nodeCreateRequire(pathToFileURL(path ?? cwd));
8
10
  const require = createRequire();
9
- const resolve = (specifier) => toPosix(require.resolve(specifier));
11
+ export const _require = timerify(require);
12
+ const resolve = (specifier) => toPosix(jiti.resolve(specifier));
10
13
  const tryResolve = (specifier, from) => {
11
14
  try {
12
15
  return resolve(specifier);
@@ -17,8 +20,8 @@ const tryResolve = (specifier, from) => {
17
20
  };
18
21
  const resolveSpecifier = (dir, specifier) => {
19
22
  try {
20
- const require = createRequire(join(dir, 'package.json'));
21
- return toPosix(require.resolve(specifier));
23
+ const jiti = createJITI(dir);
24
+ return toPosix(jiti.resolve(specifier));
22
25
  }
23
26
  catch {
24
27
  const packageName = getPackageNameFromModuleSpecifier(specifier);
@@ -28,7 +31,6 @@ const resolveSpecifier = (dir, specifier) => {
28
31
  }
29
32
  }
30
33
  };
31
- export const _require = timerify(require);
32
34
  export const _resolve = timerify(resolve);
33
35
  export const _tryResolve = timerify(tryResolve);
34
36
  export const _resolveSpecifier = timerify(resolveSpecifier);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.40.2";
1
+ export declare const version = "2.41.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.40.2';
1
+ export const version = '2.41.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.40.2",
3
+ "version": "2.41.1",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://github.com/webpro/knip",
6
6
  "repository": "github:webpro/knip",
package/schema.json CHANGED
@@ -384,6 +384,10 @@
384
384
  "title": "tailwind plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/tailwind/README.md)",
385
385
  "$ref": "#/definitions/plugin"
386
386
  },
387
+ "tsup": {
388
+ "title": "tsup plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/tsup/README.md)",
389
+ "$ref": "#/definitions/plugin"
390
+ },
387
391
  "typedoc": {
388
392
  "title": "typedoc plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/typedoc/README.md)",
389
393
  "$ref": "#/definitions/plugin"