knip 5.46.4 → 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.
Files changed (36) hide show
  1. package/dist/ConfigurationChief.d.ts +2 -1
  2. package/dist/ConfigurationChief.js +14 -6
  3. package/dist/PrincipalFactory.js +3 -5
  4. package/dist/WorkspaceWorker.d.ts +1 -1
  5. package/dist/WorkspaceWorker.js +3 -3
  6. package/dist/binaries/package-manager/pnpm.js +1 -0
  7. package/dist/compilers/index.d.ts +10 -0
  8. package/dist/graph/build.js +6 -2
  9. package/dist/plugins/github-action/index.d.ts +9 -0
  10. package/dist/plugins/github-action/index.js +28 -0
  11. package/dist/plugins/github-actions/index.d.ts +2 -1
  12. package/dist/plugins/github-actions/index.js +1 -1
  13. package/dist/plugins/husky/index.js +1 -1
  14. package/dist/plugins/index.d.ts +7 -0
  15. package/dist/plugins/index.js +2 -0
  16. package/dist/plugins/karma/helpers.js +4 -4
  17. package/dist/plugins/lint-staged/index.js +2 -0
  18. package/dist/plugins/vitest/index.js +12 -1
  19. package/dist/plugins/vitest/types.d.ts +5 -0
  20. package/dist/plugins/vue/index.js +2 -2
  21. package/dist/plugins/webpack/index.js +2 -2
  22. package/dist/schema/configuration.d.ts +56 -0
  23. package/dist/schema/plugins.d.ts +23 -0
  24. package/dist/schema/plugins.js +1 -0
  25. package/dist/types/PluginNames.d.ts +2 -2
  26. package/dist/types/PluginNames.js +1 -0
  27. package/dist/util/create-workspace-graph.d.ts +1 -1
  28. package/dist/util/create-workspace-graph.js +2 -2
  29. package/dist/util/graph-sequencer.d.ts +9 -0
  30. package/dist/util/graph-sequencer.js +94 -0
  31. package/dist/util/input.d.ts +3 -2
  32. package/dist/util/input.js +2 -1
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +2 -2
  36. package/schema.json +4 -0
@@ -38,7 +38,7 @@ export declare class ConfigurationChief {
38
38
  availableWorkspaceNames: string[];
39
39
  availableWorkspacePkgNames: Set<string>;
40
40
  availableWorkspaceDirs: string[];
41
- workspaceGraph: WorkspaceGraph | undefined;
41
+ workspaceGraph: WorkspaceGraph;
42
42
  includedWorkspaces: Workspace[];
43
43
  resolvedConfigFilePath?: string;
44
44
  rawConfig?: any;
@@ -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;
@@ -4,13 +4,14 @@ import { partitionCompilers } from './compilers/index.js';
4
4
  import { DEFAULT_EXTENSIONS, KNIP_CONFIG_LOCATIONS, ROOT_WORKSPACE_NAME } from './constants.js';
5
5
  import { knipConfigurationSchema } from './schema/configuration.js';
6
6
  import { pluginNames } from './types/PluginNames.js';
7
- import { arrayify, compact } from './util/array.js';
7
+ import { arrayify, compact, partition } from './util/array.js';
8
8
  import parsedArgValues from './util/cli-arguments.js';
9
9
  import { createWorkspaceGraph } from './util/create-workspace-graph.js';
10
10
  import { ConfigurationError } from './util/errors.js';
11
11
  import { findFile, isDirectory, isFile, loadJSON } from './util/fs.js';
12
12
  import { getIncludedIssueTypes } from './util/get-included-issue-types.js';
13
13
  import { _dirGlob } from './util/glob.js';
14
+ import { graphSequencer } from './util/graph-sequencer.js';
14
15
  import { defaultRules } from './util/issue-initializers.js';
15
16
  import { _load } from './util/loader.js';
16
17
  import mapWorkspaces from './util/map-workspaces.js';
@@ -63,7 +64,7 @@ export class ConfigurationChief {
63
64
  availableWorkspaceNames = [];
64
65
  availableWorkspacePkgNames = new Set();
65
66
  availableWorkspaceDirs = [];
66
- workspaceGraph;
67
+ workspaceGraph = new Map();
67
68
  includedWorkspaces = [];
68
69
  resolvedConfigFilePath;
69
70
  rawConfig;
@@ -205,7 +206,12 @@ export class ConfigurationChief {
205
206
  !picomatch.isMatch(name, this.ignoredWorkspacePatterns)));
206
207
  }
207
208
  getAvailableWorkspaceNames(names) {
208
- return [...names, ...this.additionalWorkspaceNames].filter(name => !picomatch.isMatch(name, this.ignoredWorkspacePatterns));
209
+ const availableWorkspaceNames = [];
210
+ for (const name of names) {
211
+ if (!picomatch.isMatch(name, this.ignoredWorkspacePatterns))
212
+ availableWorkspaceNames.push(name);
213
+ }
214
+ return availableWorkspaceNames;
209
215
  }
210
216
  getIncludedWorkspaces() {
211
217
  if (this.workspace) {
@@ -237,9 +243,9 @@ export class ConfigurationChief {
237
243
  const workspaceDirsWithDependents = new Set(initialWorkspaces);
238
244
  const addDependents = (dir) => {
239
245
  seen.add(dir);
240
- if (!graph[dir] || graph[dir].size === 0)
246
+ const dirs = graph.get(dir);
247
+ if (!dirs || dirs.size === 0)
241
248
  return;
242
- const dirs = graph[dir];
243
249
  if (initialWorkspaces.some(dir => dirs.has(dir)))
244
250
  workspaceDirsWithDependents.add(dir);
245
251
  for (const dir of dirs)
@@ -281,7 +287,9 @@ export class ConfigurationChief {
281
287
  return this.workspacePackages.get(name)?.manifest;
282
288
  }
283
289
  getWorkspaces() {
284
- return this.includedWorkspaces;
290
+ const sorted = graphSequencer(this.workspaceGraph, this.includedWorkspaces.map(workspace => workspace.dir));
291
+ const [root, rest] = partition(sorted.chunks.flat(), dir => dir === this.cwd);
292
+ return [...root, ...rest.reverse()].map(dir => this.includedWorkspaces.find(w => w.dir === dir));
285
293
  }
286
294
  getDescendentWorkspaces(name) {
287
295
  return this.availableWorkspaceNames
@@ -22,16 +22,14 @@ export class PrincipalFactory {
22
22
  options.compilerOptions = mergePaths(cwd, compilerOptions, paths);
23
23
  if (isFile && compilerOptions.module !== ts.ModuleKind.CommonJS)
24
24
  compilerOptions.moduleResolution ??= ts.ModuleResolutionKind.Bundler;
25
- const principal = this.findReusablePrincipal(cwd, compilerOptions);
25
+ const principal = this.findReusablePrincipal(compilerOptions);
26
26
  if (!isIsolateWorkspaces && principal) {
27
27
  this.linkPrincipal(principal, cwd, compilerOptions, pkgName, compilers);
28
28
  return principal.principal;
29
29
  }
30
30
  return this.addNewPrincipal(options);
31
31
  }
32
- findReusablePrincipal(cwd, compilerOptions) {
33
- if (compilerOptions.rootDir && cwd !== compilerOptions.rootDir)
34
- return;
32
+ findReusablePrincipal(compilerOptions) {
35
33
  const workspacePaths = compilerOptions?.paths ? Object.keys(compilerOptions.paths) : [];
36
34
  const principal = Array.from(this.principals).find(principal => {
37
35
  if (compilerOptions.pathsBasePath && principal.principal.compilerOptions.pathsBasePath)
@@ -63,7 +61,7 @@ export class PrincipalFactory {
63
61
  return principal;
64
62
  }
65
63
  getPrincipals() {
66
- return Array.from(this.principals, p => p.principal).reverse();
64
+ return Array.from(this.principals, p => p.principal);
67
65
  }
68
66
  getPrincipalByPackageName(packageName) {
69
67
  return Array.from(this.principals).find(principal => principal.pkgNames.has(packageName))?.principal;
@@ -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]) {
@@ -123,7 +122,8 @@ export class WorkspaceWorker {
123
122
  return patterns;
124
123
  }
125
124
  getPluginEntryFilePatterns(patterns) {
126
- return [patterns, this.ignoredWorkspacePatterns.map(negate)].flat();
125
+ const negateWorkspaces = patterns.some(pattern => pattern.startsWith('**/')) ? this.negatedWorkspacePatterns : [];
126
+ return [patterns, negateWorkspaces, this.ignoredWorkspacePatterns.map(negate)].flat();
127
127
  }
128
128
  getProductionEntryFilePatterns(negatedTestFilePatterns) {
129
129
  const entry = this.config.entry.filter(hasProductionSuffix);
@@ -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,3 +1,3 @@
1
1
  import type { WorkspacePackage } from '../types/package-json.js';
2
- export type WorkspaceGraph = Record<string, Set<string>>;
2
+ export type WorkspaceGraph = Map<string, Set<string>>;
3
3
  export declare function createWorkspaceGraph(cwd: string, wsNames: string[], wsPkgNames: Set<string>, wsPackages: Map<string, WorkspacePackage>): WorkspaceGraph;
@@ -1,7 +1,7 @@
1
1
  import { join } from './path.js';
2
2
  const types = ['peerDependencies', 'devDependencies', 'optionalDependencies', 'dependencies'];
3
3
  export function createWorkspaceGraph(cwd, wsNames, wsPkgNames, wsPackages) {
4
- const graph = {};
4
+ const graph = new Map();
5
5
  const packages = Array.from(wsPackages.values());
6
6
  const getWorkspaceDirs = (pkg) => {
7
7
  const dirs = new Set();
@@ -21,7 +21,7 @@ export function createWorkspaceGraph(cwd, wsNames, wsPkgNames, wsPackages) {
21
21
  for (const name of wsNames) {
22
22
  const pkg = wsPackages.get(name);
23
23
  if (pkg)
24
- graph[join(cwd, name)] = getWorkspaceDirs(pkg);
24
+ graph.set(join(cwd, name), getWorkspaceDirs(pkg));
25
25
  }
26
26
  return graph;
27
27
  }
@@ -0,0 +1,9 @@
1
+ type Graph<T> = Map<T, Set<T>>;
2
+ type Groups<T> = T[][];
3
+ interface Result<T> {
4
+ safe: boolean;
5
+ chunks: Groups<T>;
6
+ cycles: Groups<T>;
7
+ }
8
+ export declare function graphSequencer<T>(graph: Graph<T>, includedNodes?: T[]): Result<T>;
9
+ export {};
@@ -0,0 +1,94 @@
1
+ export function graphSequencer(graph, includedNodes = [...graph.keys()]) {
2
+ const reverseGraph = new Map();
3
+ for (const key of graph.keys()) {
4
+ reverseGraph.set(key, []);
5
+ }
6
+ const nodes = new Set(includedNodes);
7
+ const visited = new Set();
8
+ const outDegree = new Map();
9
+ for (const [from, edges] of graph.entries()) {
10
+ outDegree.set(from, 0);
11
+ for (const to of edges) {
12
+ if (nodes.has(from) && nodes.has(to)) {
13
+ changeOutDegree(from, 1);
14
+ reverseGraph.get(to).push(from);
15
+ }
16
+ }
17
+ if (!nodes.has(from)) {
18
+ visited.add(from);
19
+ }
20
+ }
21
+ const chunks = [];
22
+ const cycles = [];
23
+ let safe = true;
24
+ while (nodes.size) {
25
+ const chunk = [];
26
+ let minDegree = Number.MAX_SAFE_INTEGER;
27
+ for (const node of nodes) {
28
+ const degree = outDegree.get(node);
29
+ if (degree === 0) {
30
+ chunk.push(node);
31
+ }
32
+ minDegree = Math.min(minDegree, degree);
33
+ }
34
+ if (minDegree === 0) {
35
+ chunk.forEach(removeNode);
36
+ chunks.push(chunk);
37
+ }
38
+ else {
39
+ const cycleNodes = [];
40
+ for (const node of nodes) {
41
+ const cycle = findCycle(node);
42
+ if (cycle.length) {
43
+ cycles.push(cycle);
44
+ cycle.forEach(removeNode);
45
+ cycleNodes.push(...cycle);
46
+ if (cycle.length > 1) {
47
+ safe = false;
48
+ }
49
+ }
50
+ }
51
+ chunks.push(cycleNodes);
52
+ }
53
+ }
54
+ return { safe, chunks, cycles };
55
+ function changeOutDegree(node, value) {
56
+ const degree = outDegree.get(node) ?? 0;
57
+ outDegree.set(node, degree + value);
58
+ }
59
+ function removeNode(node) {
60
+ for (const from of reverseGraph.get(node)) {
61
+ changeOutDegree(from, -1);
62
+ }
63
+ visited.add(node);
64
+ nodes.delete(node);
65
+ }
66
+ function findCycle(startNode) {
67
+ const queue = [[startNode, [startNode]]];
68
+ const cycleVisited = new Set();
69
+ const cycles = [];
70
+ while (queue.length) {
71
+ const [id, cycle] = queue.shift();
72
+ const nodes = graph.get(id);
73
+ if (!nodes)
74
+ continue;
75
+ for (const to of nodes) {
76
+ if (to === startNode) {
77
+ cycleVisited.add(to);
78
+ cycles.push([...cycle]);
79
+ continue;
80
+ }
81
+ if (visited.has(to) || cycleVisited.has(to)) {
82
+ continue;
83
+ }
84
+ cycleVisited.add(to);
85
+ queue.push([to, [...cycle, to]]);
86
+ }
87
+ }
88
+ if (!cycles.length) {
89
+ return [];
90
+ }
91
+ cycles.sort((a, b) => b.length - a.length);
92
+ return cycles[0];
93
+ }
94
+ }
@@ -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.4";
1
+ export declare const version = "5.47.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.46.4';
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.4",
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"