knip 5.38.4 → 5.39.0

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.
@@ -155,6 +155,7 @@ export declare class ConfigurationChief {
155
155
  wireit?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
156
156
  wrangler?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
157
157
  xo?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
158
+ yarn?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
158
159
  yorkie?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
159
160
  entry: string[];
160
161
  project: string[];
@@ -1133,6 +1133,19 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
1133
1133
  entry?: string | string[] | undefined;
1134
1134
  project?: string | string[] | undefined;
1135
1135
  }>]>>;
1136
+ yarn: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1137
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1138
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1139
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1140
+ }, "strip", z.ZodTypeAny, {
1141
+ config?: string | string[] | undefined;
1142
+ entry?: string | string[] | undefined;
1143
+ project?: string | string[] | undefined;
1144
+ }, {
1145
+ config?: string | string[] | undefined;
1146
+ entry?: string | string[] | undefined;
1147
+ project?: string | string[] | undefined;
1148
+ }>]>>;
1136
1149
  yorkie: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1137
1150
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1138
1151
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1574,6 +1587,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
1574
1587
  entry?: string | string[] | undefined;
1575
1588
  project?: string | string[] | undefined;
1576
1589
  } | undefined;
1590
+ yarn?: string | boolean | string[] | {
1591
+ config?: string | string[] | undefined;
1592
+ entry?: string | string[] | undefined;
1593
+ project?: string | string[] | undefined;
1594
+ } | undefined;
1577
1595
  yorkie?: string | boolean | string[] | {
1578
1596
  config?: string | string[] | undefined;
1579
1597
  entry?: string | string[] | undefined;
@@ -2013,6 +2031,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
2013
2031
  entry?: string | string[] | undefined;
2014
2032
  project?: string | string[] | undefined;
2015
2033
  } | undefined;
2034
+ yarn?: string | boolean | string[] | {
2035
+ config?: string | string[] | undefined;
2036
+ entry?: string | string[] | undefined;
2037
+ project?: string | string[] | undefined;
2038
+ } | undefined;
2016
2039
  yorkie?: string | boolean | string[] | {
2017
2040
  config?: string | string[] | undefined;
2018
2041
  entry?: string | string[] | undefined;
@@ -3131,6 +3154,19 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
3131
3154
  entry?: string | string[] | undefined;
3132
3155
  project?: string | string[] | undefined;
3133
3156
  }>]>>;
3157
+ yarn: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3158
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3159
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3160
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3161
+ }, "strip", z.ZodTypeAny, {
3162
+ config?: string | string[] | undefined;
3163
+ entry?: string | string[] | undefined;
3164
+ project?: string | string[] | undefined;
3165
+ }, {
3166
+ config?: string | string[] | undefined;
3167
+ entry?: string | string[] | undefined;
3168
+ project?: string | string[] | undefined;
3169
+ }>]>>;
3134
3170
  yorkie: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3135
3171
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3136
3172
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3574,6 +3610,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
3574
3610
  entry?: string | string[] | undefined;
3575
3611
  project?: string | string[] | undefined;
3576
3612
  } | undefined;
3613
+ yarn?: string | boolean | string[] | {
3614
+ config?: string | string[] | undefined;
3615
+ entry?: string | string[] | undefined;
3616
+ project?: string | string[] | undefined;
3617
+ } | undefined;
3577
3618
  yorkie?: string | boolean | string[] | {
3578
3619
  config?: string | string[] | undefined;
3579
3620
  entry?: string | string[] | undefined;
@@ -4019,6 +4060,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
4019
4060
  entry?: string | string[] | undefined;
4020
4061
  project?: string | string[] | undefined;
4021
4062
  } | undefined;
4063
+ yarn?: string | boolean | string[] | {
4064
+ config?: string | string[] | undefined;
4065
+ entry?: string | string[] | undefined;
4066
+ project?: string | string[] | undefined;
4067
+ } | undefined;
4022
4068
  yorkie?: string | boolean | string[] | {
4023
4069
  config?: string | string[] | undefined;
4024
4070
  entry?: string | string[] | undefined;
@@ -4461,6 +4507,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
4461
4507
  entry?: string | string[] | undefined;
4462
4508
  project?: string | string[] | undefined;
4463
4509
  } | undefined;
4510
+ yarn?: string | boolean | string[] | {
4511
+ config?: string | string[] | undefined;
4512
+ entry?: string | string[] | undefined;
4513
+ project?: string | string[] | undefined;
4514
+ } | undefined;
4464
4515
  yorkie?: string | boolean | string[] | {
4465
4516
  config?: string | string[] | undefined;
4466
4517
  entry?: string | string[] | undefined;
@@ -4906,6 +4957,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
4906
4957
  entry?: string | string[] | undefined;
4907
4958
  project?: string | string[] | undefined;
4908
4959
  } | undefined;
4960
+ yarn?: string | boolean | string[] | {
4961
+ config?: string | string[] | undefined;
4962
+ entry?: string | string[] | undefined;
4963
+ project?: string | string[] | undefined;
4964
+ } | undefined;
4909
4965
  yorkie?: string | boolean | string[] | {
4910
4966
  config?: string | string[] | undefined;
4911
4967
  entry?: string | string[] | undefined;
@@ -433,6 +433,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
433
433
  entry?: string | string[] | undefined;
434
434
  project?: string | string[] | undefined;
435
435
  } | undefined;
436
+ yarn?: string | boolean | string[] | {
437
+ config?: string | string[] | undefined;
438
+ entry?: string | string[] | undefined;
439
+ project?: string | string[] | undefined;
440
+ } | undefined;
436
441
  yorkie?: string | boolean | string[] | {
437
442
  config?: string | string[] | undefined;
438
443
  entry?: string | string[] | undefined;
@@ -876,6 +881,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
876
881
  entry?: string | string[] | undefined;
877
882
  project?: string | string[] | undefined;
878
883
  } | undefined;
884
+ yarn?: string | boolean | string[] | {
885
+ config?: string | string[] | undefined;
886
+ entry?: string | string[] | undefined;
887
+ project?: string | string[] | undefined;
888
+ } | undefined;
879
889
  yorkie?: string | boolean | string[] | {
880
890
  config?: string | string[] | undefined;
881
891
  entry?: string | string[] | undefined;
@@ -1,4 +1,4 @@
1
- import { toConfig, toDependency, toProductionEntry } from '../../util/input.js';
1
+ import { toConfig, toDependency, toEntry, toProductionEntry } from '../../util/input.js';
2
2
  import { join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Angular';
@@ -15,7 +15,7 @@ const resolveConfig = async (config, options) => {
15
15
  if (!project.architect)
16
16
  return [];
17
17
  for (const target of Object.values(project.architect)) {
18
- const { options: opts } = target;
18
+ const { options: opts, configurations: configs } = target;
19
19
  const [packageName] = typeof target.builder === 'string' ? target.builder.split(':') : [];
20
20
  if (typeof packageName === 'string')
21
21
  inputs.add(toDependency(packageName));
@@ -37,11 +37,27 @@ const resolveConfig = async (config, options) => {
37
37
  if ('server' in opts && opts.server && typeof opts.server === 'string') {
38
38
  inputs.add(toProductionEntry(join(cwd, opts.server)));
39
39
  }
40
+ if ('fileReplacements' in opts && opts.fileReplacements && Array.isArray(opts.fileReplacements)) {
41
+ for (const fileReplacedBy of filesReplacedBy(opts.fileReplacements)) {
42
+ inputs.add(toEntry(fileReplacedBy));
43
+ }
44
+ }
45
+ }
46
+ if (configs) {
47
+ for (const [configName, config] of Object.entries(configs)) {
48
+ const isProductionConfig = configName === 'production';
49
+ if ('fileReplacements' in config && config.fileReplacements && Array.isArray(config.fileReplacements)) {
50
+ for (const fileReplacedBy of filesReplacedBy(config.fileReplacements)) {
51
+ inputs.add(isProductionConfig ? toProductionEntry(fileReplacedBy) : toEntry(fileReplacedBy));
52
+ }
53
+ }
54
+ }
40
55
  }
41
56
  }
42
57
  }
43
58
  return Array.from(inputs);
44
59
  };
60
+ const filesReplacedBy = (fileReplacements) => fileReplacements.map(fileReplacement => 'with' in fileReplacement ? fileReplacement.with : fileReplacement.replaceWith);
45
61
  export default {
46
62
  title,
47
63
  enablers,
@@ -620,7 +620,7 @@ interface AppShellTarget {
620
620
  inputIndexPath?: string;
621
621
  outputIndexPath?: string;
622
622
  }
623
- interface WebpackBrowserSchemaForBuildFacade {
623
+ export interface WebpackBrowserSchemaForBuildFacade {
624
624
  assets?: ({
625
625
  followSymlinks?: boolean;
626
626
  glob: string;
@@ -697,6 +697,12 @@ export declare const Plugins: {
697
697
  config: string[];
698
698
  resolveConfig: import("../types/config.js").ResolveConfig<import("./xo/types.js").XOConfig>;
699
699
  };
700
+ yarn: {
701
+ title: string;
702
+ enablers: string;
703
+ isEnabled: import("../types/config.js").IsPluginEnabled;
704
+ entry: string[];
705
+ };
700
706
  yorkie: {
701
707
  title: string;
702
708
  enablers: string[];
@@ -83,6 +83,7 @@ import { default as webpack } from './webpack/index.js';
83
83
  import { default as wireit } from './wireit/index.js';
84
84
  import { default as wrangler } from './wrangler/index.js';
85
85
  import { default as xo } from './xo/index.js';
86
+ import { default as yarn } from './yarn/index.js';
86
87
  import { default as yorkie } from './yorkie/index.js';
87
88
  export const Plugins = {
88
89
  angular,
@@ -170,5 +171,6 @@ export const Plugins = {
170
171
  wireit,
171
172
  wrangler,
172
173
  xo,
174
+ yarn,
173
175
  yorkie,
174
176
  };
@@ -0,0 +1,8 @@
1
+ import type { IsPluginEnabled } from '../../types/config.js';
2
+ declare const _default: {
3
+ title: string;
4
+ enablers: string;
5
+ isEnabled: IsPluginEnabled;
6
+ entry: string[];
7
+ };
8
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { _firstGlob } from '../../util/glob.js';
2
+ const title = 'Yarn';
3
+ const enablers = 'This plugin is enabled when a `yarn.lock` file is found in the root folder.';
4
+ const isEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: ['yarn.lock'] }));
5
+ const entry = ['yarn.config.cjs'];
6
+ export default {
7
+ title,
8
+ enablers,
9
+ isEnabled,
10
+ entry,
11
+ };
@@ -1119,6 +1119,19 @@ export declare const pluginsSchema: z.ZodObject<{
1119
1119
  entry?: string | string[] | undefined;
1120
1120
  project?: string | string[] | undefined;
1121
1121
  }>]>;
1122
+ yarn: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1123
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1124
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1125
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1126
+ }, "strip", z.ZodTypeAny, {
1127
+ config?: string | string[] | undefined;
1128
+ entry?: string | string[] | undefined;
1129
+ project?: string | string[] | undefined;
1130
+ }, {
1131
+ config?: string | string[] | undefined;
1132
+ entry?: string | string[] | undefined;
1133
+ project?: string | string[] | undefined;
1134
+ }>]>;
1122
1135
  yorkie: z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1123
1136
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1124
1137
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1558,6 +1571,11 @@ export declare const pluginsSchema: z.ZodObject<{
1558
1571
  entry?: string | string[] | undefined;
1559
1572
  project?: string | string[] | undefined;
1560
1573
  };
1574
+ yarn: string | boolean | string[] | {
1575
+ config?: string | string[] | undefined;
1576
+ entry?: string | string[] | undefined;
1577
+ project?: string | string[] | undefined;
1578
+ };
1561
1579
  yorkie: string | boolean | string[] | {
1562
1580
  config?: string | string[] | undefined;
1563
1581
  entry?: string | string[] | undefined;
@@ -1989,6 +2007,11 @@ export declare const pluginsSchema: z.ZodObject<{
1989
2007
  entry?: string | string[] | undefined;
1990
2008
  project?: string | string[] | undefined;
1991
2009
  };
2010
+ yarn: string | boolean | string[] | {
2011
+ config?: string | string[] | undefined;
2012
+ entry?: string | string[] | undefined;
2013
+ project?: string | string[] | undefined;
2014
+ };
1992
2015
  yorkie: string | boolean | string[] | {
1993
2016
  config?: string | string[] | undefined;
1994
2017
  entry?: string | string[] | undefined;
@@ -95,5 +95,6 @@ export const pluginsSchema = z.object({
95
95
  wireit: pluginSchema,
96
96
  wrangler: pluginSchema,
97
97
  xo: pluginSchema,
98
+ yarn: pluginSchema,
98
99
  yorkie: pluginSchema,
99
100
  });
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'gatsby' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'node-test-runner' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yorkie';
2
- export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "c8", "capacitor", "changesets", "commitizen", "commitlint", "cspell", "cucumber", "cypress", "dotenv", "drizzle", "eleventy", "eslint", "gatsby", "github-actions", "glob", "graphql-codegen", "husky", "jest", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "node-test-runner", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "storybook", "stryker", "stylelint", "svelte", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yorkie"];
1
+ export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'gatsby' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'node-test-runner' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
+ export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "c8", "capacitor", "changesets", "commitizen", "commitlint", "cspell", "cucumber", "cypress", "dotenv", "drizzle", "eleventy", "eslint", "gatsby", "github-actions", "glob", "graphql-codegen", "husky", "jest", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "node-test-runner", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "storybook", "stryker", "stylelint", "svelte", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
@@ -84,5 +84,6 @@ export const pluginNames = [
84
84
  'wireit',
85
85
  'wrangler',
86
86
  'xo',
87
+ 'yarn',
87
88
  'yorkie',
88
89
  ];
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.38.4";
1
+ export declare const version = "5.39.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.38.4';
1
+ export const version = '5.39.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.38.4",
3
+ "version": "5.39.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {
package/schema.json CHANGED
@@ -612,6 +612,10 @@
612
612
  "title": "xo plugin configuration (https://knip.dev/reference/plugins/xo)",
613
613
  "$ref": "#/definitions/plugin"
614
614
  },
615
+ "yarn": {
616
+ "title": "yarn plugin configuration (https://knip.dev/reference/plugins/yarn)",
617
+ "$ref": "#/definitions/plugin"
618
+ },
615
619
  "yorkie": {
616
620
  "title": "yorkie plugin configuration (https://knip.dev/reference/plugins/yorkie)",
617
621
  "$ref": "#/definitions/plugin"