knip 5.46.5 → 5.47.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.
@@ -92,6 +92,7 @@ export declare class ConfigurationChief {
92
92
  eslint?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
93
93
  expo?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
94
94
  gatsby?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
95
+ "github-action"?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
95
96
  "github-actions"?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
96
97
  glob?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
97
98
  "graphql-codegen"?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -55,7 +55,7 @@ export declare class WorkspaceWorker {
55
55
  private getConfigForPlugin;
56
56
  getEntryFilePatterns(): string[];
57
57
  getProjectFilePatterns(projectFilePatterns: string[]): string[];
58
- getPluginProjectFilePatterns(): string[];
58
+ getPluginProjectFilePatterns(patterns?: string[]): string[];
59
59
  getPluginConfigPatterns(): string[];
60
60
  getPluginEntryFilePatterns(patterns: string[]): string[];
61
61
  getProductionEntryFilePatterns(negatedTestFilePatterns: string[]): string[];
@@ -100,8 +100,7 @@ export class WorkspaceWorker {
100
100
  this.negatedWorkspacePatterns,
101
101
  ].flat();
102
102
  }
103
- getPluginProjectFilePatterns() {
104
- const patterns = [];
103
+ getPluginProjectFilePatterns(patterns = []) {
105
104
  for (const [pluginName, plugin] of PluginEntries) {
106
105
  const pluginConfig = this.getConfigForPlugin(pluginName);
107
106
  if (this.enabledPluginsMap[pluginName]) {
@@ -51,6 +51,7 @@ const commands = [
51
51
  'up',
52
52
  'update',
53
53
  'upgrade',
54
+ 'version',
54
55
  'why',
55
56
  ];
56
57
  export const resolve = (_binary, args, options) => {
@@ -109,6 +109,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
109
109
  entry?: string | string[] | undefined;
110
110
  project?: string | string[] | undefined;
111
111
  } | undefined;
112
+ 'github-action'?: string | boolean | string[] | {
113
+ config?: string | string[] | undefined;
114
+ entry?: string | string[] | undefined;
115
+ project?: string | string[] | undefined;
116
+ } | undefined;
112
117
  'github-actions'?: string | boolean | string[] | {
113
118
  config?: string | string[] | undefined;
114
119
  entry?: string | string[] | undefined;
@@ -578,6 +583,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
578
583
  entry?: string | string[] | undefined;
579
584
  project?: string | string[] | undefined;
580
585
  } | undefined;
586
+ 'github-action'?: string | boolean | string[] | {
587
+ config?: string | string[] | undefined;
588
+ entry?: string | string[] | undefined;
589
+ project?: string | string[] | undefined;
590
+ } | undefined;
581
591
  'github-actions'?: string | boolean | string[] | {
582
592
  config?: string | string[] | undefined;
583
593
  entry?: string | string[] | undefined;
@@ -4,7 +4,7 @@ import { getCompilerExtensions, getIncludedCompilers } from '../compilers/index.
4
4
  import { debugLog, debugLogArray } from '../util/debug.js';
5
5
  import { getReferencedInputsHandler } from '../util/get-referenced-inputs.js';
6
6
  import { _glob, negate } from '../util/glob.js';
7
- import { isConfig, isDeferResolveEntry, isDeferResolveProductionEntry, isEntry, isProductionEntry, toProductionEntry, } from '../util/input.js';
7
+ import { isConfig, isDeferResolveEntry, isDeferResolveProductionEntry, isEntry, isProductionEntry, isProject, toProductionEntry, } from '../util/input.js';
8
8
  import { getOrCreateFileNode, updateImportMap } from '../util/module-graph.js';
9
9
  import { getEntryPathsFromManifest } from '../util/package-json.js';
10
10
  import { dirname, isAbsolute, join, relative } from '../util/path.js';
@@ -93,6 +93,7 @@ export async function build({ cacheLocation, chief, collector, cwd, deputy, fact
93
93
  });
94
94
  const entryFilePatterns = new Set();
95
95
  const productionEntryFilePatterns = new Set();
96
+ const projectFilePatterns = new Set();
96
97
  for (const input of inputs) {
97
98
  const specifier = input.specifier;
98
99
  if (isEntry(input)) {
@@ -101,6 +102,9 @@ export async function build({ cacheLocation, chief, collector, cwd, deputy, fact
101
102
  else if (isProductionEntry(input)) {
102
103
  productionEntryFilePatterns.add(isAbsolute(specifier) ? relative(dir, specifier) : specifier);
103
104
  }
105
+ else if (isProject(input)) {
106
+ projectFilePatterns.add(isAbsolute(specifier) ? relative(dir, specifier) : specifier);
107
+ }
104
108
  else if (!isConfig(input)) {
105
109
  const ws = (input.containingFilePath && chief.findWorkspaceByFilePath(input.containingFilePath)) || workspace;
106
110
  const resolvedFilePath = getReferencedInternalFilePath(input, ws);
@@ -149,7 +153,7 @@ export async function build({ cacheLocation, chief, collector, cwd, deputy, fact
149
153
  }
150
154
  {
151
155
  const label = 'project';
152
- const patterns = worker.getProjectFilePatterns([...productionEntryFilePatterns]);
156
+ const patterns = worker.getProjectFilePatterns([...productionEntryFilePatterns, ...projectFilePatterns]);
153
157
  const workspaceProjectPaths = await _glob({ ...sharedGlobOptions, patterns, label });
154
158
  for (const projectPath of workspaceProjectPaths)
155
159
  principal.addProjectPath(projectPath);
@@ -0,0 +1,9 @@
1
+ import type { IsPluginEnabled, ResolveEntryPaths } from '../../types/config.js';
2
+ declare const _default: {
3
+ title: string;
4
+ enablers: string[];
5
+ isEnabled: IsPluginEnabled;
6
+ config: string[];
7
+ resolveEntryPaths: ResolveEntryPaths;
8
+ };
9
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { toEntry, toProject } from '../../util/input.js';
2
+ import { relative } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ import { getActionDependencies } from '../github-actions/index.js';
5
+ const title = 'GitHub Action';
6
+ const enablers = ['@actions/core'];
7
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
+ const config = ['action.{yml,yaml}'];
9
+ const isAssumeArtifact = (specifier) => /^(dist|build)\//.test(specifier);
10
+ const resolveEntryPaths = async (config, options) => {
11
+ const inputs = [];
12
+ const filePaths = getActionDependencies(config, options);
13
+ for (const filePath of new Set(filePaths)) {
14
+ const relativePath = relative(options.cwd, filePath);
15
+ if (isAssumeArtifact(relativePath))
16
+ inputs.push(toProject(`!${relativePath}`));
17
+ else
18
+ inputs.push(toEntry(relativePath));
19
+ }
20
+ return inputs;
21
+ };
22
+ export default {
23
+ title,
24
+ enablers,
25
+ isEnabled,
26
+ config,
27
+ resolveEntryPaths,
28
+ };
@@ -1,4 +1,5 @@
1
- import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
1
+ import type { IsPluginEnabled, PluginOptions, ResolveConfig } from '../../types/config.js';
2
+ export declare const getActionDependencies: (config: any, options: PluginOptions) => string[];
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string;
@@ -8,7 +8,7 @@ const isEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: [
8
8
  const isRootOnly = true;
9
9
  const config = ['.github/workflows/*.{yml,yaml}', '.github/**/action.{yml,yaml}'];
10
10
  const isString = (value) => typeof value === 'string';
11
- const getActionDependencies = (config, options) => {
11
+ export const getActionDependencies = (config, options) => {
12
12
  const { configFileDir, configFileName } = options;
13
13
  const isActionManifest = configFileName === 'action.yml' || configFileName === 'action.yaml';
14
14
  if (!(isActionManifest && config?.runs?.using?.startsWith('node')))
@@ -8,7 +8,7 @@ const isRootOnly = true;
8
8
  const gitHookPaths = getGitHookPaths('.husky', false);
9
9
  const config = [...gitHookPaths, 'package.json'];
10
10
  const resolveConfig = (script, options) => {
11
- if (!script)
11
+ if (!script || options.isProduction)
12
12
  return [];
13
13
  if (options.configFileName === 'package.json') {
14
14
  const hooks = script.hooks;
@@ -151,6 +151,13 @@ export declare const Plugins: {
151
151
  production: string[];
152
152
  resolveConfig: import("../types/config.js").ResolveConfig<import("./gatsby/types.js").GatsbyConfig | import("./gatsby/types.js").GatsbyNode>;
153
153
  };
154
+ 'github-action': {
155
+ title: string;
156
+ enablers: string[];
157
+ isEnabled: import("../types/config.js").IsPluginEnabled;
158
+ config: string[];
159
+ resolveEntryPaths: import("../types/config.js").ResolveEntryPaths;
160
+ };
154
161
  'github-actions': {
155
162
  title: string;
156
163
  enablers: string;
@@ -17,6 +17,7 @@ import { default as eleventy } from './eleventy/index.js';
17
17
  import { default as eslint } from './eslint/index.js';
18
18
  import { default as expo } from './expo/index.js';
19
19
  import { default as gatsby } from './gatsby/index.js';
20
+ import { default as githubAction } from './github-action/index.js';
20
21
  import { default as githubActions } from './github-actions/index.js';
21
22
  import { default as glob } from './glob/index.js';
22
23
  import { default as graphqlCodegen } from './graphql-codegen/index.js';
@@ -109,6 +110,7 @@ export const Plugins = {
109
110
  eslint,
110
111
  expo,
111
112
  gatsby,
113
+ 'github-action': githubAction,
112
114
  'github-actions': githubActions,
113
115
  glob,
114
116
  'graphql-codegen': graphqlCodegen,
@@ -1,19 +1,19 @@
1
- import { toDeferResolveEntry, toDevDependency } from '../../util/input.js';
1
+ import { toDeferResolveEntry, toDependency } from '../../util/input.js';
2
2
  import { isInternal } from '../../util/path.js';
3
3
  export const configFiles = ['karma.conf.js', 'karma.conf.ts', '.config/karma.conf.js', '.config/karma.conf.ts'];
4
4
  export const inputsFromFrameworks = (frameworks) => frameworks.map(framework => {
5
- return toDevDependency(framework === 'jasmine' ? 'jasmine-core' : framework);
5
+ return toDependency(framework === 'jasmine' ? 'jasmine-core' : framework);
6
6
  });
7
7
  export const inputsFromPlugins = (plugins, devDependencies) => {
8
8
  if (!plugins) {
9
9
  const karmaPluginDevDeps = Object.keys(devDependencies ?? {}).filter(name => name.startsWith('karma-'));
10
- return karmaPluginDevDeps.map(karmaPluginDevDep => toDevDependency(karmaPluginDevDep));
10
+ return karmaPluginDevDeps.map(karmaPluginDevDep => toDependency(karmaPluginDevDep));
11
11
  }
12
12
  return plugins
13
13
  .map(plugin => {
14
14
  if (typeof plugin !== 'string')
15
15
  return;
16
- return isInternal(plugin) ? toDeferResolveEntry(plugin) : toDevDependency(plugin);
16
+ return isInternal(plugin) ? toDeferResolveEntry(plugin) : toDependency(plugin);
17
17
  })
18
18
  .filter(input => !!input);
19
19
  };
@@ -12,6 +12,8 @@ const config = [
12
12
  ...toLilconfig('lintstaged'),
13
13
  ];
14
14
  const resolveConfig = async (config, options) => {
15
+ if (options.isProduction)
16
+ return [];
15
17
  if (typeof config === 'function')
16
18
  config = config();
17
19
  if (!config)
@@ -25,7 +25,18 @@ const findConfigDependencies = (localConfig, options) => {
25
25
  const dir = join(configFileDir, testConfig.root ?? '.');
26
26
  const setupFiles = [testConfig.setupFiles ?? []].flat().map(specifier => ({ ...toDeferResolve(specifier), dir }));
27
27
  const globalSetup = [testConfig.globalSetup ?? []].flat().map(specifier => ({ ...toDeferResolve(specifier), dir }));
28
- return [...[...environments, ...reporters, ...coverage].map(id => toDependency(id)), ...setupFiles, ...globalSetup];
28
+ const workspaceDependencies = [];
29
+ if (testConfig.workspace !== undefined) {
30
+ for (const workspaceConfig of testConfig.workspace) {
31
+ workspaceDependencies.push(...findConfigDependencies(workspaceConfig, options));
32
+ }
33
+ }
34
+ return [
35
+ ...[...environments, ...reporters, ...coverage].map(id => toDependency(id)),
36
+ ...setupFiles,
37
+ ...globalSetup,
38
+ ...workspaceDependencies,
39
+ ];
29
40
  };
30
41
  const getConfigs = async (localConfig) => {
31
42
  const configs = [];
@@ -10,6 +10,11 @@ interface VitestConfig {
10
10
  globalSetup?: string | string[];
11
11
  reporters?: (string | [string, unknown] | unknown)[];
12
12
  setupFiles?: string | string[];
13
+ workspace?: (ViteConfig & {
14
+ test: VitestConfig['test'] & {
15
+ workspace: never;
16
+ };
17
+ })[];
13
18
  };
14
19
  }
15
20
  export interface ViteConfig extends VitestConfig {
@@ -1,4 +1,4 @@
1
- import { toDevDependency } from '../../util/input.js';
1
+ import { toDependency } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  import { findWebpackDependenciesFromConfig } from '../webpack/index.js';
4
4
  const title = 'Vue';
@@ -26,7 +26,7 @@ const resolveConfig = async (config, options) => {
26
26
  }
27
27
  if (manifest.scripts &&
28
28
  Object.values(manifest.scripts).some(script => /(?<=^|\s)vue-cli-service(\s|\s.+\s)lint(?=\s|$)/.test(script))) {
29
- inputs.push(toDevDependency('@vue/cli-plugin-eslint'));
29
+ inputs.push(toDependency('@vue/cli-plugin-eslint'));
30
30
  }
31
31
  return inputs;
32
32
  };
@@ -1,5 +1,5 @@
1
1
  import { compact } from '../../util/array.js';
2
- import { toDeferResolve, toDeferResolveEntry, toDeferResolveProductionEntry, toDependency, toDevDependency, } from '../../util/input.js';
2
+ import { toDeferResolve, toDeferResolveEntry, toDeferResolveProductionEntry, toDependency, } from '../../util/input.js';
3
3
  import { isInternal } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
5
  import { getDependenciesFromConfig } from '../babel/index.js';
@@ -109,7 +109,7 @@ const resolveConfig = async (localConfig, options) => {
109
109
  const scripts = Object.values(manifest.scripts ?? {});
110
110
  const webpackCLI = scripts.some(script => script && /(?<=^|\s)webpack(?=\s|$)/.test(script)) ? ['webpack-cli'] : [];
111
111
  const webpackDevServer = scripts.some(script => script?.includes('webpack serve')) ? ['webpack-dev-server'] : [];
112
- return compact([...inputs, [...webpackCLI, ...webpackDevServer].map(toDevDependency)].flat());
112
+ return compact([...inputs, ...[...webpackCLI, ...webpackDevServer].map(id => toDependency(id))]);
113
113
  };
114
114
  const args = {
115
115
  binaries: ['webpack', 'webpack-dev-server'],
@@ -278,6 +278,19 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
278
278
  entry?: string | string[] | undefined;
279
279
  project?: string | string[] | undefined;
280
280
  }>]>>;
281
+ 'github-action': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
282
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
283
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
284
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ config?: string | string[] | undefined;
287
+ entry?: string | string[] | undefined;
288
+ project?: string | string[] | undefined;
289
+ }, {
290
+ config?: string | string[] | undefined;
291
+ entry?: string | string[] | undefined;
292
+ project?: string | string[] | undefined;
293
+ }>]>>;
281
294
  'github-actions': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
282
295
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
283
296
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1317,6 +1330,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
1317
1330
  entry?: string | string[] | undefined;
1318
1331
  project?: string | string[] | undefined;
1319
1332
  } | undefined;
1333
+ 'github-action'?: string | boolean | string[] | {
1334
+ config?: string | string[] | undefined;
1335
+ entry?: string | string[] | undefined;
1336
+ project?: string | string[] | undefined;
1337
+ } | undefined;
1320
1338
  'github-actions'?: string | boolean | string[] | {
1321
1339
  config?: string | string[] | undefined;
1322
1340
  entry?: string | string[] | undefined;
@@ -1782,6 +1800,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
1782
1800
  entry?: string | string[] | undefined;
1783
1801
  project?: string | string[] | undefined;
1784
1802
  } | undefined;
1803
+ 'github-action'?: string | boolean | string[] | {
1804
+ config?: string | string[] | undefined;
1805
+ entry?: string | string[] | undefined;
1806
+ project?: string | string[] | undefined;
1807
+ } | undefined;
1785
1808
  'github-actions'?: string | boolean | string[] | {
1786
1809
  config?: string | string[] | undefined;
1787
1810
  entry?: string | string[] | undefined;
@@ -2393,6 +2416,19 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
2393
2416
  entry?: string | string[] | undefined;
2394
2417
  project?: string | string[] | undefined;
2395
2418
  }>]>>;
2419
+ 'github-action': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
2420
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2421
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2422
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2423
+ }, "strip", z.ZodTypeAny, {
2424
+ config?: string | string[] | undefined;
2425
+ entry?: string | string[] | undefined;
2426
+ project?: string | string[] | undefined;
2427
+ }, {
2428
+ config?: string | string[] | undefined;
2429
+ entry?: string | string[] | undefined;
2430
+ project?: string | string[] | undefined;
2431
+ }>]>>;
2396
2432
  'github-actions': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
2397
2433
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
2398
2434
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3435,6 +3471,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3435
3471
  entry?: string | string[] | undefined;
3436
3472
  project?: string | string[] | undefined;
3437
3473
  } | undefined;
3474
+ 'github-action'?: string | boolean | string[] | {
3475
+ config?: string | string[] | undefined;
3476
+ entry?: string | string[] | undefined;
3477
+ project?: string | string[] | undefined;
3478
+ } | undefined;
3438
3479
  'github-actions'?: string | boolean | string[] | {
3439
3480
  config?: string | string[] | undefined;
3440
3481
  entry?: string | string[] | undefined;
@@ -3906,6 +3947,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3906
3947
  entry?: string | string[] | undefined;
3907
3948
  project?: string | string[] | undefined;
3908
3949
  } | undefined;
3950
+ 'github-action'?: string | boolean | string[] | {
3951
+ config?: string | string[] | undefined;
3952
+ entry?: string | string[] | undefined;
3953
+ project?: string | string[] | undefined;
3954
+ } | undefined;
3909
3955
  'github-actions'?: string | boolean | string[] | {
3910
3956
  config?: string | string[] | undefined;
3911
3957
  entry?: string | string[] | undefined;
@@ -4375,6 +4421,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4375
4421
  entry?: string | string[] | undefined;
4376
4422
  project?: string | string[] | undefined;
4377
4423
  } | undefined;
4424
+ 'github-action'?: string | boolean | string[] | {
4425
+ config?: string | string[] | undefined;
4426
+ entry?: string | string[] | undefined;
4427
+ project?: string | string[] | undefined;
4428
+ } | undefined;
4378
4429
  'github-actions'?: string | boolean | string[] | {
4379
4430
  config?: string | string[] | undefined;
4380
4431
  entry?: string | string[] | undefined;
@@ -4846,6 +4897,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4846
4897
  entry?: string | string[] | undefined;
4847
4898
  project?: string | string[] | undefined;
4848
4899
  } | undefined;
4900
+ 'github-action'?: string | boolean | string[] | {
4901
+ config?: string | string[] | undefined;
4902
+ entry?: string | string[] | undefined;
4903
+ project?: string | string[] | undefined;
4904
+ } | undefined;
4849
4905
  'github-actions'?: string | boolean | string[] | {
4850
4906
  config?: string | string[] | undefined;
4851
4907
  entry?: string | string[] | undefined;
@@ -261,6 +261,19 @@ export declare const pluginsSchema: z.ZodObject<{
261
261
  entry?: string | string[] | undefined;
262
262
  project?: string | string[] | undefined;
263
263
  }>]>;
264
+ 'github-action': z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
265
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
266
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
267
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
268
+ }, "strip", z.ZodTypeAny, {
269
+ config?: string | string[] | undefined;
270
+ entry?: string | string[] | undefined;
271
+ project?: string | string[] | undefined;
272
+ }, {
273
+ config?: string | string[] | undefined;
274
+ entry?: string | string[] | undefined;
275
+ project?: string | string[] | undefined;
276
+ }>]>;
264
277
  'github-actions': z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
265
278
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
266
279
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1298,6 +1311,11 @@ export declare const pluginsSchema: z.ZodObject<{
1298
1311
  entry?: string | string[] | undefined;
1299
1312
  project?: string | string[] | undefined;
1300
1313
  };
1314
+ 'github-action': string | boolean | string[] | {
1315
+ config?: string | string[] | undefined;
1316
+ entry?: string | string[] | undefined;
1317
+ project?: string | string[] | undefined;
1318
+ };
1301
1319
  'github-actions': string | boolean | string[] | {
1302
1320
  config?: string | string[] | undefined;
1303
1321
  entry?: string | string[] | undefined;
@@ -1754,6 +1772,11 @@ export declare const pluginsSchema: z.ZodObject<{
1754
1772
  entry?: string | string[] | undefined;
1755
1773
  project?: string | string[] | undefined;
1756
1774
  };
1775
+ 'github-action': string | boolean | string[] | {
1776
+ config?: string | string[] | undefined;
1777
+ entry?: string | string[] | undefined;
1778
+ project?: string | string[] | undefined;
1779
+ };
1757
1780
  'github-actions': string | boolean | string[] | {
1758
1781
  config?: string | string[] | undefined;
1759
1782
  entry?: string | string[] | undefined;
@@ -29,6 +29,7 @@ export const pluginsSchema = z.object({
29
29
  eslint: pluginSchema,
30
30
  expo: pluginSchema,
31
31
  gatsby: pluginSchema,
32
+ 'github-action': pluginSchema,
32
33
  'github-actions': pluginSchema,
33
34
  glob: pluginSchema,
34
35
  'graphql-codegen': pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'react-router' | '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", "dependency-cruiser", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-actions", "glob", "graphql-codegen", "husky", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "react-router", "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"];
1
+ export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dependency-cruiser' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'husky' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'react-router' | '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", "dependency-cruiser", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "husky", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "metro", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "plop", "postcss", "preconstruct", "prettier", "react-cosmos", "react-router", "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"];
@@ -18,6 +18,7 @@ export const pluginNames = [
18
18
  'eslint',
19
19
  'expo',
20
20
  'gatsby',
21
+ 'github-action',
21
22
  'github-actions',
22
23
  'glob',
23
24
  'graphql-codegen',
@@ -1,5 +1,5 @@
1
1
  import type { PluginName } from '../types/PluginNames.js';
2
- type InputType = 'binary' | 'entry' | 'config' | 'dependency' | 'deferResolve' | 'deferResolveEntry';
2
+ type InputType = 'binary' | 'entry' | 'project' | 'config' | 'dependency' | 'deferResolve' | 'deferResolveEntry';
3
3
  export interface Input {
4
4
  type: InputType;
5
5
  specifier: string;
@@ -23,6 +23,8 @@ export declare const toBinary: (specifier: string, options?: Options) => Input;
23
23
  export declare const isBinary: (input: Input) => boolean;
24
24
  export declare const toEntry: (specifier: string) => Input;
25
25
  export declare const isEntry: (input: Input) => boolean;
26
+ export declare const toProject: (specifier: string) => Input;
27
+ export declare const isProject: (input: Input) => boolean;
26
28
  export declare const toProductionEntry: (specifier: string, options?: Options) => Input;
27
29
  export declare const isProductionEntry: (input: Input) => boolean;
28
30
  export declare const toConfig: (pluginName: PluginName, specifier: string, options?: Options) => ConfigInput;
@@ -30,7 +32,6 @@ export declare const isConfig: (input: Input) => input is ConfigInput;
30
32
  export declare const toDependency: (specifier: string, options?: Options) => Input;
31
33
  export declare const isDependency: (input: Input) => boolean;
32
34
  export declare const toProductionDependency: (specifier: string) => Input;
33
- export declare const toDevDependency: (specifier: string) => Input;
34
35
  export declare const toDeferResolve: (specifier: string) => Input;
35
36
  export declare const isDeferResolve: (input: Input) => boolean;
36
37
  export declare const toDeferResolveProductionEntry: (specifier: string, options?: Options) => Input;
@@ -8,6 +8,8 @@ export const toBinary = (specifier, options = {}) => ({
8
8
  export const isBinary = (input) => input.type === 'binary';
9
9
  export const toEntry = (specifier) => ({ type: 'entry', specifier });
10
10
  export const isEntry = (input) => input.type === 'entry' && !input.production;
11
+ export const toProject = (specifier) => ({ type: 'project', specifier });
12
+ export const isProject = (input) => input.type === 'project';
11
13
  export const toProductionEntry = (specifier, options = {}) => ({
12
14
  type: 'entry',
13
15
  specifier,
@@ -33,7 +35,6 @@ export const toProductionDependency = (specifier) => ({
33
35
  specifier,
34
36
  production: true,
35
37
  });
36
- export const toDevDependency = (specifier) => ({ type: 'dependency', specifier });
37
38
  export const toDeferResolve = (specifier) => ({ type: 'deferResolve', specifier });
38
39
  export const isDeferResolve = (input) => input.type === 'deferResolve';
39
40
  export const toDeferResolveProductionEntry = (specifier, options = {}) => ({
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.46.5";
1
+ export declare const version = "5.47.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.46.5';
1
+ export const version = '5.47.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.46.5",
3
+ "version": "5.47.0",
4
4
  "description": "Find and fix unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {
@@ -83,7 +83,7 @@
83
83
  "devDependencies": {
84
84
  "@jest/types": "^29.6.3",
85
85
  "@release-it/bumper": "^7.0.2",
86
- "@types/bun": "1.2.8",
86
+ "@types/bun": "1.2.4",
87
87
  "@types/js-yaml": "^4.0.9",
88
88
  "@types/minimist": "^1.2.5",
89
89
  "@types/picomatch": "3.0.1",
package/schema.json CHANGED
@@ -371,6 +371,10 @@
371
371
  "title": "Gatsby plugin configuration (https://knip.dev/reference/plugins/gatsby)",
372
372
  "$ref": "#/definitions/plugin"
373
373
  },
374
+ "github-action": {
375
+ "title": "github-action plugin configuration (https://knip.dev/reference/plugins/github-action)",
376
+ "$ref": "#/definitions/plugin"
377
+ },
374
378
  "github-actions": {
375
379
  "title": "github-actions plugin configuration (https://knip.dev/reference/plugins/github-actions)",
376
380
  "$ref": "#/definitions/plugin"