knip 1.12.3 → 1.12.4

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,22 +1,19 @@
1
1
  import { z } from 'zod';
2
- export declare const ConfigurationValidator: z.ZodObject<z.extendShape<z.extendShape<z.extendShape<{
2
+ export declare const ConfigurationValidator: z.ZodObject<{
3
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4
+ ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
5
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3
6
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
4
7
  project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
5
8
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
6
- ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
7
9
  ignoreBinaries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
10
  ignoreDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
11
  ignoreWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
- }, {
11
- include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
- exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
- }>, {
14
- workspaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<z.extendShape<{
12
+ workspaces: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
13
+ ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
15
14
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
16
15
  project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
17
16
  paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
18
- ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
19
- }, {
20
17
  babel: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
21
18
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
22
19
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -407,7 +404,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.extendShape<z.extendS
407
404
  entry?: string | string[] | undefined;
408
405
  project?: string | string[] | undefined;
409
406
  }>]>>;
410
- }>, "strip", z.ZodTypeAny, {
407
+ }, "strip", z.ZodTypeAny, {
411
408
  ignore?: string | string[] | undefined;
412
409
  entry?: string | string[] | undefined;
413
410
  project?: string | string[] | undefined;
@@ -718,7 +715,6 @@ export declare const ConfigurationValidator: z.ZodObject<z.extendShape<z.extendS
718
715
  project?: string | string[] | undefined;
719
716
  } | undefined;
720
717
  }>>>;
721
- }>, {
722
718
  babel: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
723
719
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
724
720
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1109,7 +1105,7 @@ export declare const ConfigurationValidator: z.ZodObject<z.extendShape<z.extendS
1109
1105
  entry?: string | string[] | undefined;
1110
1106
  project?: string | string[] | undefined;
1111
1107
  }>]>>;
1112
- }>, "strip", z.ZodTypeAny, {
1108
+ }, "strip", z.ZodTypeAny, {
1113
1109
  exclude?: string[] | undefined;
1114
1110
  ignore?: string | string[] | undefined;
1115
1111
  include?: string[] | undefined;
@@ -4,7 +4,7 @@ import { hasDependency } from '../../util/plugin.js';
4
4
  export const NAME = 'Stryker';
5
5
  export const ENABLERS = ['@stryker-mutator/core'];
6
6
  export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
7
- export const CONFIG_FILE_PATTERNS = ['?(.)stryker.{conf,config}.{js,mjs,json}'];
7
+ export const CONFIG_FILE_PATTERNS = ['?(.)stryker.{conf,config}.{js,mjs,cjs,json}'];
8
8
  const findStrykerDependencies = async (configFilePath) => {
9
9
  const config = await _load(configFilePath);
10
10
  if (config) {
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
3
4
  import { load as esmLoad } from '@esbuild-kit/esm-loader';
4
5
  import yaml from 'js-yaml';
5
6
  import { require } from '../util/require.js';
@@ -8,12 +9,18 @@ import { loadJSON } from './fs.js';
8
9
  import { timerify } from './performance.js';
9
10
  const load = async (filePath) => {
10
11
  try {
11
- if (/\.jsonc?$/.test(filePath) || /rc$/.test(filePath)) {
12
+ const ext = path.extname(filePath);
13
+ if (ext === '.json' || ext === '.jsonc' || /rc$/.test(filePath)) {
12
14
  return loadJSON(filePath);
13
15
  }
14
- if (path.extname(filePath) === '.yaml' || path.extname(filePath) === '.yml') {
16
+ if (ext === '.yaml' || ext === '.yml') {
15
17
  return yaml.load((await fs.readFile(filePath)).toString());
16
18
  }
19
+ if (ext === '.mjs') {
20
+ const fileUrl = pathToFileURL(filePath);
21
+ const imported = await import(fileUrl.href);
22
+ return imported.default ?? imported;
23
+ }
17
24
  const imported = await esmLoad(filePath, {}, require);
18
25
  return imported.default ?? imported;
19
26
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.12.3";
1
+ export declare const version = "1.12.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.12.3';
1
+ export const version = '1.12.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
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",
@@ -39,21 +39,21 @@
39
39
  "schema.json"
40
40
  ],
41
41
  "dependencies": {
42
- "@esbuild-kit/esm-loader": "^2.5.4",
43
- "@npmcli/map-workspaces": "^3.0.1",
42
+ "@esbuild-kit/esm-loader": "^2.5.5",
43
+ "@npmcli/map-workspaces": "^3.0.2",
44
44
  "@snyk/github-codeowners": "^1.1.0",
45
45
  "bash-parser": "^0.5.0",
46
46
  "chalk": "^5.2.0",
47
47
  "easy-table": "^1.2.0",
48
- "esbuild": "^0.17.4",
48
+ "esbuild": "^0.17.10",
49
49
  "esbuild-register": "3.4.2",
50
- "eslint": "^8.32.0",
50
+ "eslint": "^8.34.0",
51
51
  "fast-glob": "^3.2.12",
52
- "get-tsconfig": "^4.3.0",
52
+ "get-tsconfig": "^4.4.0",
53
53
  "globby": "^13.1.3",
54
54
  "js-yaml": "^4.1.0",
55
55
  "micromatch": "^4.0.5",
56
- "minimist": "^1.2.7",
56
+ "minimist": "^1.2.8",
57
57
  "nano-memoize": "^2.0.0",
58
58
  "patch-package": "^6.5.1",
59
59
  "pretty-ms": "^8.0.0",
@@ -61,31 +61,31 @@
61
61
  "summary": "^2.1.0",
62
62
  "ts-morph": "^17.0.1",
63
63
  "ts-morph-helpers": "^0.6.3",
64
- "zod": "^3.20.2"
64
+ "zod": "^3.20.6"
65
65
  },
66
66
  "devDependencies": {
67
- "@jest/types": "^29.4.0",
67
+ "@jest/types": "29.4.3",
68
68
  "@npmcli/package-json": "3.0.0",
69
- "@release-it/bumper": "^4.0.2",
70
- "@types/eslint": "8.4.10",
69
+ "@release-it/bumper": "4.0.2",
70
+ "@types/eslint": "8.21.1",
71
71
  "@types/js-yaml": "4.0.5",
72
72
  "@types/micromatch": "4.0.2",
73
- "@types/minimist": "^1.2.2",
74
- "@types/node": "18.11.18",
73
+ "@types/minimist": "1.2.2",
74
+ "@types/node": "18.14.0",
75
75
  "@types/npmcli__map-workspaces": "3.0.0",
76
76
  "@types/webpack": "5.28.0",
77
- "@typescript-eslint/eslint-plugin": "^5.49.0",
78
- "@typescript-eslint/parser": "^5.49.0",
77
+ "@typescript-eslint/eslint-plugin": "5.53.0",
78
+ "@typescript-eslint/parser": "5.53.0",
79
79
  "eslint-import-resolver-typescript": "3.5.3",
80
80
  "eslint-plugin-import": "2.27.5",
81
81
  "globstar": "1.0.0",
82
- "prettier": "2.8.3",
82
+ "prettier": "2.8.4",
83
83
  "release-it": "15.6.0",
84
84
  "remark-cli": "11.0.0",
85
85
  "remark-preset-webpro": "0.0.1",
86
- "tsx": "3.12.2",
87
- "type-fest": "^3.5.3",
88
- "typescript": "4.9.4"
86
+ "tsx": "3.12.3",
87
+ "type-fest": "3.6.0",
88
+ "typescript": "4.9.5"
89
89
  },
90
90
  "engines": {
91
91
  "node": ">=16.17.0 <17 || >=18.6.0"