knip 2.20.0 → 2.20.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.
@@ -1,5 +1,4 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { join } from '../../util/path.js';
3
2
  import { timerify } from '../../util/Performance.js';
4
3
  import { hasDependency, load } from '../../util/plugin.js';
5
4
  import { getEnvPackageName, getExternalReporters } from './helpers.js';
@@ -8,7 +7,7 @@ export const ENABLERS = ['vitest'];
8
7
  export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
9
8
  export const CONFIG_FILE_PATTERNS = ['vitest.config.ts'];
10
9
  export const ENTRY_FILE_PATTERNS = ['vite.config.ts'];
11
- const findVitestDependencies = async (configFilePath, { cwd }) => {
10
+ const findVitestDependencies = async (configFilePath) => {
12
11
  const config = await load(configFilePath);
13
12
  if (!config || !config.test)
14
13
  return [];
@@ -16,8 +15,8 @@ const findVitestDependencies = async (configFilePath, { cwd }) => {
16
15
  const environments = cfg.environment ? [getEnvPackageName(cfg.environment)] : [];
17
16
  const reporters = getExternalReporters(cfg.reporters);
18
17
  const coverage = cfg.coverage ? [`@vitest/coverage-${cfg.coverage.provider ?? 'v8'}`] : [];
19
- const setupFiles = cfg.setupFiles ? [cfg.setupFiles].flat().map(filePath => join(cwd, filePath)) : [];
20
- const globalSetup = cfg.globalSetup ? [cfg.globalSetup].flat().map(filePath => join(cwd, filePath)) : [];
18
+ const setupFiles = cfg.setupFiles ? [cfg.setupFiles].flat() : [];
19
+ const globalSetup = cfg.globalSetup ? [cfg.globalSetup].flat() : [];
21
20
  return compact([...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup]);
22
21
  };
23
22
  export const findDependencies = timerify(findVitestDependencies);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.20.0";
1
+ export declare const version = "2.20.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.20.0';
1
+ export const version = '2.20.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.20.0",
3
+ "version": "2.20.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",
@@ -70,13 +70,13 @@
70
70
  "@types/js-yaml": "4.0.5",
71
71
  "@types/micromatch": "4.0.2",
72
72
  "@types/minimist": "1.2.2",
73
- "@types/node": "20.5.1",
73
+ "@types/node": "20.5.6",
74
74
  "@types/npmcli__map-workspaces": "3.0.1",
75
- "@types/webpack": "5.28.1",
75
+ "@types/webpack": "5.28.2",
76
76
  "@typescript-eslint/eslint-plugin": "6.4.1",
77
77
  "@typescript-eslint/parser": "6.4.1",
78
78
  "c8": "8.0.1",
79
- "eslint": "8.47.0",
79
+ "eslint": "8.48.0",
80
80
  "eslint-import-resolver-typescript": "3.6.0",
81
81
  "eslint-plugin-import": "2.28.1",
82
82
  "eslint-plugin-n": "16.0.2",
@@ -85,7 +85,7 @@
85
85
  "remark-cli": "11.0.0",
86
86
  "remark-preset-webpro": "0.0.3",
87
87
  "tsx": "3.12.7",
88
- "type-fest": "4.2.0"
88
+ "type-fest": "4.3.0"
89
89
  },
90
90
  "engines": {
91
91
  "node": ">=16.17.0 <17 || >=18.6.0"