knip 6.42.1 → 6.44.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 (187) hide show
  1. package/dist/CacheConsultant.d.ts +1 -0
  2. package/dist/CacheConsultant.js +2 -0
  3. package/dist/CatalogCounselor.d.ts +1 -3
  4. package/dist/CatalogCounselor.js +18 -15
  5. package/dist/ConfigurationChief.d.ts +42 -0
  6. package/dist/DependencyDeputy.d.ts +2 -1
  7. package/dist/DependencyDeputy.js +9 -4
  8. package/dist/IssueCollector.js +1 -0
  9. package/dist/IssueFixer.js +10 -5
  10. package/dist/ProjectPrincipal.d.ts +3 -2
  11. package/dist/ProjectPrincipal.js +32 -10
  12. package/dist/WorkspaceWorker.d.ts +5 -2
  13. package/dist/WorkspaceWorker.js +35 -17
  14. package/dist/binaries/resolvers/bun.js +1 -0
  15. package/dist/binaries/resolvers/npm.js +12 -2
  16. package/dist/binaries/resolvers/pnpm.js +5 -3
  17. package/dist/binaries/util.js +2 -1
  18. package/dist/cli.js +6 -1
  19. package/dist/compilers/compilers.js +2 -2
  20. package/dist/compilers/index.d.ts +5 -0
  21. package/dist/compilers/index.js +1 -1
  22. package/dist/constants.d.ts +1 -0
  23. package/dist/constants.js +2 -0
  24. package/dist/graph/analyze.js +3 -2
  25. package/dist/graph/build.d.ts +2 -0
  26. package/dist/graph/build.js +37 -22
  27. package/dist/graph-explorer/cache.d.ts +2 -1
  28. package/dist/graph-explorer/cache.js +5 -1
  29. package/dist/graph-explorer/explorer.d.ts +3 -5
  30. package/dist/graph-explorer/explorer.js +24 -3
  31. package/dist/plugins/_vue/auto-import.js +31 -1
  32. package/dist/plugins/biome/index.js +1 -1
  33. package/dist/plugins/buf/index.d.ts +3 -0
  34. package/dist/plugins/buf/index.js +33 -0
  35. package/dist/plugins/buf/types.d.ts +8 -0
  36. package/dist/plugins/buf/types.js +1 -0
  37. package/dist/plugins/cspell/index.js +1 -0
  38. package/dist/plugins/dependency-cruiser/index.js +2 -2
  39. package/dist/plugins/docusaurus/helpers.js +4 -4
  40. package/dist/plugins/electron-forge/index.d.ts +3 -0
  41. package/dist/plugins/electron-forge/index.js +94 -0
  42. package/dist/plugins/electron-vite/index.js +2 -2
  43. package/dist/plugins/eslint/helpers.d.ts +1 -0
  44. package/dist/plugins/eslint/helpers.js +1 -1
  45. package/dist/plugins/eslint/resolveFromAST.js +35 -10
  46. package/dist/plugins/expo/helpers.d.ts +1 -1
  47. package/dist/plugins/expo/helpers.js +15 -8
  48. package/dist/plugins/expo/types.d.ts +2 -1
  49. package/dist/plugins/expressive-code/index.d.ts +1 -1
  50. package/dist/plugins/expressive-code/index.js +2 -2
  51. package/dist/plugins/gatsby/index.js +6 -6
  52. package/dist/plugins/gatsby/types.d.ts +1 -1
  53. package/dist/plugins/github-actions/index.js +1 -1
  54. package/dist/plugins/i18next-parser/index.js +2 -2
  55. package/dist/plugins/index.d.ts +8 -1
  56. package/dist/plugins/index.js +14 -0
  57. package/dist/plugins/jasmine/index.js +2 -2
  58. package/dist/plugins/karma/index.js +4 -4
  59. package/dist/plugins/kysely-codegen/index.d.ts +3 -0
  60. package/dist/plugins/kysely-codegen/index.js +20 -0
  61. package/dist/plugins/lefthook/index.js +2 -2
  62. package/dist/plugins/lingui/index.d.ts +3 -0
  63. package/dist/plugins/lingui/index.js +16 -0
  64. package/dist/plugins/lockfile-lint/index.js +2 -2
  65. package/dist/plugins/lost-pixel/index.js +2 -2
  66. package/dist/plugins/lunaria/index.js +2 -2
  67. package/dist/plugins/marko/index.js +5 -6
  68. package/dist/plugins/mastra/index.d.ts +3 -0
  69. package/dist/plugins/mastra/index.js +57 -0
  70. package/dist/plugins/mcp/index.d.ts +3 -0
  71. package/dist/plugins/mcp/index.js +33 -0
  72. package/dist/plugins/mcp/types.d.ts +11 -0
  73. package/dist/plugins/mcp/types.js +1 -0
  74. package/dist/plugins/mise/index.js +0 -3
  75. package/dist/plugins/mocha/index.js +42 -3
  76. package/dist/plugins/mocha/types.d.ts +1 -0
  77. package/dist/plugins/next/index.d.ts +3 -0
  78. package/dist/plugins/next/index.js +57 -9
  79. package/dist/plugins/next/types.d.ts +11 -0
  80. package/dist/plugins/next/types.js +1 -0
  81. package/dist/plugins/nx/index.js +3 -8
  82. package/dist/plugins/nyc/index.js +1 -1
  83. package/dist/plugins/openapi-ts/index.js +2 -2
  84. package/dist/plugins/oxfmt/index.js +2 -2
  85. package/dist/plugins/playwright/index.js +6 -11
  86. package/dist/plugins/pnpm/index.js +2 -4
  87. package/dist/plugins/purgecss/index.d.ts +3 -0
  88. package/dist/plugins/purgecss/index.js +16 -0
  89. package/dist/plugins/railway/index.js +1 -4
  90. package/dist/plugins/remix/index.js +1 -1
  91. package/dist/plugins/rstest/index.js +2 -2
  92. package/dist/plugins/serverless-framework/index.js +1 -1
  93. package/dist/plugins/storybook/index.js +5 -5
  94. package/dist/plugins/sveltekit/resolveFromAST.js +1 -1
  95. package/dist/plugins/syncpack/index.js +2 -2
  96. package/dist/plugins/tailwind/compiler.js +6 -2
  97. package/dist/plugins/tanstack-router/index.js +3 -2
  98. package/dist/plugins/taskfile/index.js +4 -7
  99. package/dist/plugins/textlint/helpers.js +2 -2
  100. package/dist/plugins/travis/index.js +2 -2
  101. package/dist/plugins/typescript/index.js +9 -7
  102. package/dist/plugins/unocss/index.js +2 -2
  103. package/dist/plugins/vite-plugin-pwa/index.js +1 -4
  104. package/dist/plugins/vite-plugin-pwa/resolveFromAST.d.ts +0 -2
  105. package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
  106. package/dist/plugins/vite-pwa-assets-generator/index.js +2 -2
  107. package/dist/plugins/vitest/helpers.d.ts +1 -1
  108. package/dist/plugins/vitest/helpers.js +17 -10
  109. package/dist/plugins/vitest/index.js +53 -45
  110. package/dist/plugins/vitest/types.d.ts +11 -7
  111. package/dist/plugins/webpack/index.js +4 -2
  112. package/dist/plugins/yarn/index.js +2 -4
  113. package/dist/reporters/codeclimate.d.ts +2 -2
  114. package/dist/reporters/codeclimate.js +2 -4
  115. package/dist/reporters/codeowners.d.ts +2 -2
  116. package/dist/reporters/codeowners.js +9 -9
  117. package/dist/reporters/compact.d.ts +2 -2
  118. package/dist/reporters/compact.js +8 -7
  119. package/dist/reporters/cycles.d.ts +2 -2
  120. package/dist/reporters/cycles.js +7 -6
  121. package/dist/reporters/disclosure.d.ts +2 -2
  122. package/dist/reporters/disclosure.js +6 -4
  123. package/dist/reporters/github-actions.d.ts +2 -2
  124. package/dist/reporters/github-actions.js +7 -5
  125. package/dist/reporters/index.d.ts +10 -10
  126. package/dist/reporters/json.d.ts +2 -2
  127. package/dist/reporters/json.js +2 -4
  128. package/dist/reporters/markdown.d.ts +2 -2
  129. package/dist/reporters/markdown.js +11 -9
  130. package/dist/reporters/sarif.d.ts +2 -2
  131. package/dist/reporters/sarif.js +2 -3
  132. package/dist/reporters/symbols.d.ts +2 -2
  133. package/dist/reporters/symbols.js +6 -4
  134. package/dist/run.d.ts +1 -1
  135. package/dist/run.js +3 -10
  136. package/dist/schema/configuration.d.ts +105 -0
  137. package/dist/schema/plugins.d.ts +35 -0
  138. package/dist/schema/plugins.js +7 -0
  139. package/dist/session/configuration.d.ts +12 -0
  140. package/dist/session/configuration.js +43 -0
  141. package/dist/session/incremental.d.ts +54 -0
  142. package/dist/session/incremental.js +49 -0
  143. package/dist/session/session.d.ts +1 -1
  144. package/dist/session/session.js +62 -27
  145. package/dist/session/watch.d.ts +2 -0
  146. package/dist/session/watch.js +41 -0
  147. package/dist/types/PluginNames.d.ts +2 -2
  148. package/dist/types/PluginNames.js +7 -0
  149. package/dist/types/config.d.ts +2 -0
  150. package/dist/types/issues.d.ts +4 -0
  151. package/dist/types/package-json.d.ts +0 -3
  152. package/dist/typescript/ast-nodes.js +3 -3
  153. package/dist/typescript/get-imports-and-exports.js +2 -0
  154. package/dist/typescript/visitors/calls.js +15 -11
  155. package/dist/typescript/visitors/exports.js +5 -4
  156. package/dist/typescript/visitors/imports.d.ts +2 -1
  157. package/dist/typescript/visitors/imports.js +25 -19
  158. package/dist/typescript/visitors/members.js +23 -26
  159. package/dist/typescript/visitors/walk.d.ts +3 -0
  160. package/dist/typescript/visitors/walk.js +55 -3
  161. package/dist/util/cli-arguments.d.ts +2 -1
  162. package/dist/util/cli-arguments.js +3 -0
  163. package/dist/util/create-input-handler.js +1 -1
  164. package/dist/util/create-options.d.ts +72 -1
  165. package/dist/util/create-options.js +13 -2
  166. package/dist/util/file-entry-cache.d.ts +2 -0
  167. package/dist/util/file-entry-cache.js +19 -1
  168. package/dist/util/gitignore-cache.d.ts +1 -0
  169. package/dist/util/gitignore-cache.js +1 -0
  170. package/dist/util/glob-core.js +4 -2
  171. package/dist/util/glob.d.ts +1 -0
  172. package/dist/util/glob.js +6 -0
  173. package/dist/util/input.d.ts +2 -0
  174. package/dist/util/loader.d.ts +1 -0
  175. package/dist/util/loader.js +38 -2
  176. package/dist/util/modules.js +5 -2
  177. package/dist/util/path.d.ts +1 -0
  178. package/dist/util/path.js +1 -0
  179. package/dist/util/remove-export.js +3 -1
  180. package/dist/util/reporter.d.ts +1 -1
  181. package/dist/util/reporter.js +53 -9
  182. package/dist/util/watch.d.ts +5 -11
  183. package/dist/util/watch.js +84 -68
  184. package/dist/version.d.ts +1 -1
  185. package/dist/version.js +1 -1
  186. package/package.json +4 -4
  187. package/schema.json +28 -0
@@ -0,0 +1,94 @@
1
+ import { toConfig, toDependency, toProductionEntry } from '../../util/input.js';
2
+ import { toAbsolute } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ import { findWebpackDependenciesFromConfig } from '../webpack/index.js';
5
+ const title = 'Electron Forge';
6
+ const enablers = ['@electron-forge/cli'];
7
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
+ const packageJsonPath = 'config.forge';
9
+ const config = ['package.json', 'forge.config.{js,mjs,cjs,ts,mts,cts}'];
10
+ const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
11
+ const isPlainObject = (value) => isObject(value) && Object.getPrototypeOf(value) === Object.prototype;
12
+ const toArray = (value) => (Array.isArray(value) ? value : value === undefined ? [] : [value]);
13
+ const toStrings = (value) => {
14
+ const values = [];
15
+ for (const item of isObject(value) ? Object.values(value) : toArray(value)) {
16
+ if (typeof item === 'string')
17
+ values.push(item);
18
+ }
19
+ return values;
20
+ };
21
+ const getPluginInputs = async (name, opts, options) => {
22
+ if (!isObject(opts))
23
+ return [];
24
+ const { cwd, configFilePath } = options;
25
+ const inputs = [];
26
+ const addEntry = (value) => {
27
+ for (const id of toStrings(value))
28
+ inputs.push(toProductionEntry(toAbsolute(id, cwd)));
29
+ };
30
+ const addConfig = async (pluginName, value) => {
31
+ if (typeof value === 'string') {
32
+ inputs.push(toConfig(pluginName, value, { dir: cwd, containingFilePath: configFilePath }));
33
+ }
34
+ else if (pluginName === 'webpack' && isObject(value)) {
35
+ for (const input of await findWebpackDependenciesFromConfig(value, options))
36
+ inputs.push(input);
37
+ }
38
+ };
39
+ if (name === 'vite' || name === '@electron-forge/plugin-vite') {
40
+ for (const build of toArray(opts.build)) {
41
+ if (!isObject(build))
42
+ continue;
43
+ addEntry(build.entry);
44
+ await addConfig('vite', build.config);
45
+ }
46
+ for (const renderer of toArray(opts.renderer))
47
+ if (isObject(renderer))
48
+ await addConfig('vite', renderer.config);
49
+ }
50
+ else if (name === 'webpack' || name === '@electron-forge/plugin-webpack') {
51
+ await addConfig('webpack', opts.mainConfig);
52
+ for (const renderer of toArray(opts.renderer)) {
53
+ if (!isObject(renderer))
54
+ continue;
55
+ await addConfig('webpack', renderer.config);
56
+ for (const entryPoint of toArray(renderer.entryPoints)) {
57
+ if (!isObject(entryPoint))
58
+ continue;
59
+ addEntry(entryPoint.js);
60
+ if (!isObject(entryPoint.preload))
61
+ continue;
62
+ addEntry(entryPoint.preload.js);
63
+ await addConfig('webpack', entryPoint.preload.config);
64
+ }
65
+ }
66
+ }
67
+ return inputs;
68
+ };
69
+ const resolveConfig = async (localConfig, options) => {
70
+ if (typeof localConfig === 'string') {
71
+ return [toConfig('electron-forge', localConfig, { containingFilePath: options.configFilePath })];
72
+ }
73
+ if (!isObject(localConfig))
74
+ return [];
75
+ const inputs = [];
76
+ for (const item of [localConfig.makers, localConfig.publishers, localConfig.plugins].flatMap(toArray)) {
77
+ if (!isObject(item))
78
+ continue;
79
+ if (isPlainObject(item) && typeof item.name === 'string')
80
+ inputs.push(toDependency(item.name));
81
+ for (const input of await getPluginInputs(item.name, item.config, options))
82
+ inputs.push(input);
83
+ }
84
+ return inputs;
85
+ };
86
+ const plugin = {
87
+ title,
88
+ enablers,
89
+ isEnabled,
90
+ packageJsonPath,
91
+ config,
92
+ resolveConfig,
93
+ };
94
+ export default plugin;
@@ -1,5 +1,5 @@
1
1
  import { toProductionEntry } from '../../util/input.js';
2
- import { isAbsolute, join } from '../../util/path.js';
2
+ import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { getHtmlScriptEntries } from '../vite/helpers.js';
5
5
  const title = 'electron-vite';
@@ -30,7 +30,7 @@ const resolveConfig = async (localConfig, options) => {
30
30
  }
31
31
  const patterns = ids.length > 0 ? ids : [defaultEntry[name]];
32
32
  for (const id of patterns) {
33
- const resolved = isAbsolute(id) ? id : join(configFileDir, id);
33
+ const resolved = toAbsolute(id, configFileDir);
34
34
  inputs.push(toProductionEntry(resolved));
35
35
  if (name === 'renderer' && resolved.endsWith('.html')) {
36
36
  for (const input of await getHtmlScriptEntries(resolved))
@@ -4,6 +4,7 @@ import { type ConfigInput, type Input } from '../../util/input.ts';
4
4
  import type { ESLintConfig, ESLintConfigDeprecated, OverrideConfigDeprecated, Settings } from './types.ts';
5
5
  export declare const isFlatConfig: (fileName: string) => boolean;
6
6
  export declare const getInputs: (config: ESLintConfigDeprecated | OverrideConfigDeprecated | ESLintConfig, options: PluginOptions) => (Input | ConfigInput)[];
7
+ export declare const toParser: (name: string) => Input;
7
8
  export type ImportSettingKind = 'resolver' | 'parsers';
8
9
  export declare const importSettingKinds: Map<string, ImportSettingKind>;
9
10
  export declare const getInputsFromSettings: (settings?: Settings) => Input[];
@@ -33,7 +33,7 @@ const getInputsDeprecated = (config, options) => {
33
33
  return [...extendConfigs, ...deferred, ...parsers, ...babelDependencies, ...overrides];
34
34
  };
35
35
  const isParserObject = (value) => typeof value.parseForESLint === 'function' || typeof value.parse === 'function';
36
- const toParser = (name) => toDeferResolve(name, name === 'espree' ? { optional: true } : {});
36
+ export const toParser = (name) => toDeferResolve(name, name === 'espree' ? { optional: true } : {});
37
37
  const getParsers = ({ parser, parserOptions }) => {
38
38
  const inputs = [];
39
39
  for (const value of [parser, parserOptions?.parser]) {
@@ -3,7 +3,17 @@ import { toDeferResolve } from '../../util/input.js';
3
3
  import { findProperty, getPropertyKey } from '../../typescript/ast-helpers.js';
4
4
  import { getStringValue } from '../../typescript/ast-nodes.js';
5
5
  import { isInternal } from '../../util/path.js';
6
- import { importSettingKinds } from './helpers.js';
6
+ import { importSettingKinds, toParser } from './helpers.js';
7
+ const isParserObjectExpression = (node) => {
8
+ for (const prop of node.properties) {
9
+ if (prop.type === 'SpreadElement')
10
+ return true;
11
+ const key = getPropertyKey(prop);
12
+ if (key === 'parse' || key === 'parseForESLint')
13
+ return true;
14
+ }
15
+ return false;
16
+ };
7
17
  const getInputsFromSettingsAST = (program) => {
8
18
  const inputs = [];
9
19
  const addResolver = (kind, resolver) => {
@@ -12,6 +22,10 @@ const getInputsFromSettingsAST = (program) => {
12
22
  const dep = kind === 'resolver' ? `eslint-import-resolver-${resolver}` : resolver;
13
23
  inputs.push(toDeferResolve(dep, { optional: true }));
14
24
  };
25
+ const addParser = (name) => {
26
+ if (name)
27
+ inputs.push(toParser(name));
28
+ };
15
29
  const addResolvers = (kind, node) => {
16
30
  if (node?.type === 'ArrayExpression') {
17
31
  for (const element of node.elements)
@@ -32,15 +46,26 @@ const getInputsFromSettingsAST = (program) => {
32
46
  const visitor = new Visitor({
33
47
  ObjectExpression(node) {
34
48
  const settingsNode = findProperty(node, 'settings');
35
- if (!settingsNode || settingsNode.type !== 'ObjectExpression')
36
- return;
37
- for (const prop of settingsNode.properties ?? []) {
38
- if (prop.type !== 'Property')
39
- continue;
40
- const key = getPropertyKey(prop);
41
- const kind = key && importSettingKinds.get(key);
42
- if (kind)
43
- addResolvers(kind, prop.value);
49
+ if (settingsNode?.type === 'ObjectExpression') {
50
+ for (const prop of settingsNode.properties ?? []) {
51
+ if (prop.type !== 'Property')
52
+ continue;
53
+ const key = getPropertyKey(prop);
54
+ const kind = key && importSettingKinds.get(key);
55
+ if (kind)
56
+ addResolvers(kind, prop.value);
57
+ }
58
+ }
59
+ const parser = findProperty(findProperty(node, 'parserOptions'), 'parser');
60
+ if (parser?.type === 'ObjectExpression') {
61
+ if (isParserObjectExpression(parser))
62
+ return;
63
+ for (const prop of parser.properties)
64
+ if (prop.type === 'Property')
65
+ addParser(getStringValue(prop.value));
66
+ }
67
+ else {
68
+ addParser(getStringValue(parser));
44
69
  }
45
70
  },
46
71
  });
@@ -15,6 +15,6 @@ export declare const getConfig: (localConfig: ExpoConfig, options: PluginOptions
15
15
  userInterfaceStyle?: 'automatic' | 'light' | 'dark';
16
16
  };
17
17
  androidNavigationBar?: Record<string, unknown>;
18
- plugins?: (string | [string, Record<string, unknown>])[];
18
+ plugins?: (string | ((config: unknown) => unknown) | [string | ((config: unknown) => unknown), Record<string, unknown>])[];
19
19
  };
20
20
  export declare const getDependencies: ResolveConfig<ExpoConfig>;
@@ -1,6 +1,6 @@
1
- import { toDependency, toProductionDependency } from '../../util/input.js';
1
+ import { toDeferResolveEntry, toDependency, toProductionDependency } from '../../util/input.js';
2
2
  import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
3
- import { join } from '../../util/path.js';
3
+ import { isInternal, join } from '../../util/path.js';
4
4
  const getDummyConfigContext = (options) => ({
5
5
  projectRoot: options.cwd,
6
6
  staticConfigPath: null,
@@ -17,13 +17,20 @@ export const getDependencies = async (localConfig, options) => {
17
17
  const { manifest } = options;
18
18
  const config = getConfig(localConfig, options);
19
19
  const platforms = config.platforms ?? ['ios', 'android'];
20
- const pluginPackages = config.plugins
21
- ?.map(plugin => {
20
+ const inputs = new Set();
21
+ for (const plugin of config.plugins ?? []) {
22
22
  const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
23
- return getPackageNameFromModuleSpecifier(pluginName);
24
- })
25
- .filter(Boolean) ?? [];
26
- const inputs = new Set(pluginPackages.map(id => toDependency(id)));
23
+ if (typeof pluginName !== 'string')
24
+ continue;
25
+ if (isInternal(pluginName)) {
26
+ inputs.add(toDeferResolveEntry(pluginName));
27
+ }
28
+ else {
29
+ const packageName = getPackageNameFromModuleSpecifier(pluginName);
30
+ if (packageName)
31
+ inputs.add(toDependency(packageName));
32
+ }
33
+ }
27
34
  const allowedPackages = ['expo-atlas', 'expo-dev-client'];
28
35
  const allowedProductionPackages = ['expo-insights'];
29
36
  const manifestDependencies = Object.keys(manifest.dependencies ?? {});
@@ -1,3 +1,4 @@
1
+ type ConfigPlugin = (config: unknown) => unknown;
1
2
  type BaseConfig = {
2
3
  platforms?: ('ios' | 'android' | 'web')[];
3
4
  notification?: Record<string, unknown>;
@@ -13,7 +14,7 @@ type BaseConfig = {
13
14
  userInterfaceStyle?: 'automatic' | 'light' | 'dark';
14
15
  };
15
16
  androidNavigationBar?: Record<string, unknown>;
16
- plugins?: (string | [string, Record<string, unknown>])[];
17
+ plugins?: (string | ConfigPlugin | [string | ConfigPlugin, Record<string, unknown>])[];
17
18
  };
18
19
  type ConfigContext = {
19
20
  projectRoot: string;
@@ -3,6 +3,6 @@ declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
- config: string[];
6
+ entry: string[];
7
7
  };
8
8
  export default _default;
@@ -6,10 +6,10 @@ const enablers = [
6
6
  '@astrojs/starlight',
7
7
  ];
8
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
- const config = ['ec.config.{js,mjs,cjs,ts}'];
9
+ const entry = ['ec.config.{js,mjs,cjs,ts}'];
10
10
  export default {
11
11
  title,
12
12
  enablers,
13
13
  isEnabled,
14
- config,
14
+ entry,
15
15
  };
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toDependency } from '../../util/input.js';
1
+ import { toDeferResolve, toDependency, toProductionEntry } from '../../util/input.js';
2
2
  import { hasDependency } from '../../util/plugin.js';
3
3
  const title = 'Gatsby';
4
4
  const enablers = ['gatsby', 'gatsby-cli'];
@@ -14,10 +14,10 @@ const production = [
14
14
  ];
15
15
  const resolveConfig = async (localConfig, options) => {
16
16
  const { configFileName } = options;
17
+ const entries = production.map(id => toProductionEntry(id));
17
18
  if (configFileName.includes('gatsby-config')) {
18
- return localConfig.plugins
19
- .map(plugin => (typeof plugin === 'string' ? plugin : plugin.resolve))
20
- .map(id => toDeferResolve(id));
19
+ const plugins = localConfig.plugins ?? [];
20
+ return [...entries, ...plugins.map(plugin => toDeferResolve(typeof plugin === 'string' ? plugin : plugin.resolve))];
21
21
  }
22
22
  if (configFileName.includes('gatsby-node')) {
23
23
  const plugins = new Set();
@@ -26,9 +26,9 @@ const resolveConfig = async (localConfig, options) => {
26
26
  if (typeof _config.onCreateBabelConfig === 'function') {
27
27
  _config.onCreateBabelConfig({ actions });
28
28
  }
29
- return Array.from(plugins).map(id => toDependency(id));
29
+ return [...entries, ...Array.from(plugins, id => toDependency(id))];
30
30
  }
31
- return [];
31
+ return entries;
32
32
  };
33
33
  const plugin = {
34
34
  title,
@@ -1,5 +1,5 @@
1
1
  export type GatsbyConfig = {
2
- plugins: (string | {
2
+ plugins?: (string | {
3
3
  resolve: string;
4
4
  })[];
5
5
  };
@@ -34,7 +34,7 @@ const resolveConfig = async (config, options) => {
34
34
  const manifest = getManifest(dir) ?? options.manifest;
35
35
  const actionPath = relative(dir, configFileDir);
36
36
  const run = step.run.replace(ACTION_PATH_VAR, actionPath ? `./${actionPath}` : '.');
37
- for (const input of getInputsFromScripts([run], { optionalBinaries: true, manifest })) {
37
+ for (const input of getInputsFromScripts([run], { optionalBinaries: true, manifest, cwd: dir })) {
38
38
  if (isDeferResolveEntry(input) && path && !workingDir) {
39
39
  input.specifier = relative(join(dir, path), join(rootCwd, input.specifier));
40
40
  }
@@ -2,7 +2,7 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'i18next Parser';
3
3
  const enablers = ['i18next-parser'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['i18next-parser.config.{js,mjs,json,ts,yaml,yml}'];
5
+ const entry = ['i18next-parser.config.{js,mjs,json,ts,yaml,yml}'];
6
6
  const args = {
7
7
  binaries: ['i18next'],
8
8
  config: true,
@@ -11,7 +11,7 @@ const plugin = {
11
11
  title,
12
12
  enablers,
13
13
  isEnabled,
14
- config,
14
+ entry,
15
15
  args,
16
16
  };
17
17
  export default plugin;
@@ -8,6 +8,7 @@ export declare const Plugins: {
8
8
  babel: import("../types/config.ts").Plugin;
9
9
  biome: import("../types/config.ts").Plugin;
10
10
  borp: import("../types/config.ts").Plugin;
11
+ buf: import("../types/config.ts").Plugin;
11
12
  bumpp: import("../types/config.ts").Plugin;
12
13
  bun: import("../types/config.ts").Plugin;
13
14
  c8: import("../types/config.ts").Plugin;
@@ -28,6 +29,7 @@ export declare const Plugins: {
28
29
  docusaurus: import("../types/config.ts").Plugin;
29
30
  dotenv: import("../types/config.ts").Plugin;
30
31
  drizzle: import("../types/config.ts").Plugin;
32
+ 'electron-forge': import("../types/config.ts").Plugin;
31
33
  'electron-vite': import("../types/config.ts").Plugin;
32
34
  eleventy: import("../types/config.ts").Plugin;
33
35
  esbuild: import("../types/config.ts").Plugin;
@@ -40,7 +42,7 @@ export declare const Plugins: {
40
42
  title: string;
41
43
  enablers: string[];
42
44
  isEnabled: import("../types/config.ts").IsPluginEnabled;
43
- config: string[];
45
+ entry: string[];
44
46
  };
45
47
  fast: import("../types/config.ts").Plugin;
46
48
  'filesystem-routing': import("../types/config.ts").Plugin;
@@ -58,9 +60,11 @@ export declare const Plugins: {
58
60
  jest: import("../types/config.ts").Plugin;
59
61
  karma: import("../types/config.ts").Plugin;
60
62
  knex: import("../types/config.ts").Plugin;
63
+ 'kysely-codegen': import("../types/config.ts").Plugin;
61
64
  ladle: import("../types/config.ts").Plugin;
62
65
  'laravel-vite-plugin': import("../types/config.ts").Plugin;
63
66
  lefthook: import("../types/config.ts").Plugin;
67
+ lingui: import("../types/config.ts").Plugin;
64
68
  'lint-staged': import("../types/config.ts").Plugin;
65
69
  linthtml: import("../types/config.ts").Plugin;
66
70
  lit: import("../types/config.ts").Plugin;
@@ -69,6 +73,8 @@ export declare const Plugins: {
69
73
  lunaria: import("../types/config.ts").Plugin;
70
74
  markdownlint: import("../types/config.ts").Plugin;
71
75
  marko: import("../types/config.ts").Plugin;
76
+ mastra: import("../types/config.ts").Plugin;
77
+ mcp: import("../types/config.ts").Plugin;
72
78
  mdx: import("../types/config.ts").Plugin;
73
79
  mdxlint: import("../types/config.ts").Plugin;
74
80
  metro: import("../types/config.ts").Plugin;
@@ -114,6 +120,7 @@ export declare const Plugins: {
114
120
  preconstruct: import("../types/config.ts").Plugin;
115
121
  prettier: import("../types/config.ts").Plugin;
116
122
  prisma: import("../types/config.ts").Plugin;
123
+ purgecss: import("../types/config.ts").Plugin;
117
124
  quasar: import("../types/config.ts").Plugin;
118
125
  qwik: import("../types/config.ts").Plugin;
119
126
  railway: import("../types/config.ts").Plugin;
@@ -7,6 +7,7 @@ import { default as ava } from './ava/index.js';
7
7
  import { default as babel } from './babel/index.js';
8
8
  import { default as biome } from './biome/index.js';
9
9
  import { default as borp } from './borp/index.js';
10
+ import { default as buf } from './buf/index.js';
10
11
  import { default as bumpp } from './bumpp/index.js';
11
12
  import { default as bun } from './bun/index.js';
12
13
  import { default as c8 } from './c8/index.js';
@@ -27,6 +28,7 @@ import { default as dependencyCruiser } from './dependency-cruiser/index.js';
27
28
  import { default as docusaurus } from './docusaurus/index.js';
28
29
  import { default as dotenv } from './dotenv/index.js';
29
30
  import { default as drizzle } from './drizzle/index.js';
31
+ import { default as electronForge } from './electron-forge/index.js';
30
32
  import { default as electronVite } from './electron-vite/index.js';
31
33
  import { default as eleventy } from './eleventy/index.js';
32
34
  import { default as esbuild } from './esbuild/index.js';
@@ -52,9 +54,11 @@ import { default as jasmine } from './jasmine/index.js';
52
54
  import { default as jest } from './jest/index.js';
53
55
  import { default as karma } from './karma/index.js';
54
56
  import { default as knex } from './knex/index.js';
57
+ import { default as kyselyCodegen } from './kysely-codegen/index.js';
55
58
  import { default as ladle } from './ladle/index.js';
56
59
  import { default as laravelVitePlugin } from './laravel-vite-plugin/index.js';
57
60
  import { default as lefthook } from './lefthook/index.js';
61
+ import { default as lingui } from './lingui/index.js';
58
62
  import { default as lintStaged } from './lint-staged/index.js';
59
63
  import { default as linthtml } from './linthtml/index.js';
60
64
  import { default as lit } from './lit/index.js';
@@ -63,6 +67,8 @@ import { default as lostPixel } from './lost-pixel/index.js';
63
67
  import { default as lunaria } from './lunaria/index.js';
64
68
  import { default as markdownlint } from './markdownlint/index.js';
65
69
  import { default as marko } from './marko/index.js';
70
+ import { default as mastra } from './mastra/index.js';
71
+ import { default as mcp } from './mcp/index.js';
66
72
  import { default as mdx } from './mdx/index.js';
67
73
  import { default as mdxlint } from './mdxlint/index.js';
68
74
  import { default as metro } from './metro/index.js';
@@ -108,6 +114,7 @@ import { default as preCommit } from './pre-commit/index.js';
108
114
  import { default as preconstruct } from './preconstruct/index.js';
109
115
  import { default as prettier } from './prettier/index.js';
110
116
  import { default as prisma } from './prisma/index.js';
117
+ import { default as purgecss } from './purgecss/index.js';
111
118
  import { default as quasar } from './quasar/index.js';
112
119
  import { default as qwik } from './qwik/index.js';
113
120
  import { default as railway } from './railway/index.js';
@@ -203,6 +210,7 @@ export const Plugins = {
203
210
  babel,
204
211
  biome,
205
212
  borp,
213
+ buf,
206
214
  bumpp,
207
215
  bun,
208
216
  c8,
@@ -223,6 +231,7 @@ export const Plugins = {
223
231
  docusaurus,
224
232
  dotenv,
225
233
  drizzle,
234
+ 'electron-forge': electronForge,
226
235
  'electron-vite': electronVite,
227
236
  eleventy,
228
237
  esbuild,
@@ -248,9 +257,11 @@ export const Plugins = {
248
257
  jest,
249
258
  karma,
250
259
  knex,
260
+ 'kysely-codegen': kyselyCodegen,
251
261
  ladle,
252
262
  'laravel-vite-plugin': laravelVitePlugin,
253
263
  lefthook,
264
+ lingui,
254
265
  'lint-staged': lintStaged,
255
266
  linthtml,
256
267
  lit,
@@ -259,6 +270,8 @@ export const Plugins = {
259
270
  lunaria,
260
271
  markdownlint,
261
272
  marko,
273
+ mastra,
274
+ mcp,
262
275
  mdx,
263
276
  mdxlint,
264
277
  metro,
@@ -304,6 +317,7 @@ export const Plugins = {
304
317
  preconstruct,
305
318
  prettier,
306
319
  prisma,
320
+ purgecss,
307
321
  quasar,
308
322
  qwik,
309
323
  railway,
@@ -1,5 +1,5 @@
1
1
  import { toDeferResolve, toEntry } from '../../util/input.js';
2
- import { isAbsolute, join } from '../../util/path.js';
2
+ import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Jasmine';
5
5
  const enablers = ['jasmine'];
@@ -10,7 +10,7 @@ const entry = [defaultSpecFiles, 'spec/helpers/**/*.{js,mjs}'];
10
10
  const toSpecDirPattern = (specDir, pattern) => {
11
11
  const isNegated = pattern.startsWith('!');
12
12
  const id = isNegated ? pattern.slice(1) : pattern;
13
- const resolved = isAbsolute(id) ? id : join(specDir, id);
13
+ const resolved = toAbsolute(id, specDir);
14
14
  return isNegated ? `!${resolved}` : resolved;
15
15
  };
16
16
  const resolveConfig = (localConfig, options) => {
@@ -1,5 +1,5 @@
1
1
  import { toEntry } from '../../util/input.js';
2
- import { isAbsolute, join } from '../../util/path.js';
2
+ import { toAbsolute } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { configFiles, inputsFromFrameworks, inputsFromPlugins, loadConfig } from './helpers.js';
5
5
  const title = 'Karma';
@@ -15,17 +15,17 @@ const resolveConfig = async (localConfig, options) => {
15
15
  inputsFromFrameworks(config.frameworks).forEach(inputs.add, inputs);
16
16
  }
17
17
  inputsFromPlugins(config.plugins, options.manifest.devDependencies).forEach(inputs.add, inputs);
18
- const basePath = config.basePath ?? '';
18
+ const basePath = toAbsolute(config.basePath ?? '', options.configFileDir);
19
19
  if (config.files) {
20
20
  for (const fileOrPatternObj of config.files) {
21
21
  const fileOrPattern = typeof fileOrPatternObj === 'string' ? fileOrPatternObj : fileOrPatternObj.pattern;
22
- const absPath = isAbsolute(fileOrPattern) ? fileOrPattern : join(options.configFileDir, basePath, fileOrPattern);
22
+ const absPath = toAbsolute(fileOrPattern, basePath);
23
23
  inputs.add(toEntry(absPath));
24
24
  }
25
25
  }
26
26
  if (config.exclude) {
27
27
  for (const fileOrPattern of config.exclude) {
28
- const absPath = isAbsolute(fileOrPattern) ? fileOrPattern : join(options.configFileDir, basePath, fileOrPattern);
28
+ const absPath = toAbsolute(fileOrPattern, basePath);
29
29
  inputs.add(toEntry(`!${absPath}`));
30
30
  }
31
31
  }
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,20 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ const title = 'kysely-codegen';
3
+ const enablers = ['kysely-codegen'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const entry = [
6
+ '.kysely-codegenrc.{js,ts,cjs}',
7
+ '.config/kysely-codegenrc.{js,ts,cjs}',
8
+ 'kysely-codegen.config.{js,ts,cjs}',
9
+ ];
10
+ const args = {
11
+ config: ['config-file'],
12
+ };
13
+ const plugin = {
14
+ title,
15
+ enablers,
16
+ isEnabled,
17
+ entry,
18
+ args,
19
+ };
20
+ export default plugin;
@@ -1,7 +1,7 @@
1
1
  import { getGitHookPaths } from '../../util/git.js';
2
2
  import { fromBinary, toDependency } from '../../util/input.js';
3
3
  import { findByKeyDeep } from '../../util/object.js';
4
- import { extname } from '../../util/path.js';
4
+ import { extname, toAbsolute } from '../../util/path.js';
5
5
  import { hasDependency } from '../../util/plugin.js';
6
6
  const title = 'Lefthook';
7
7
  const enablers = ['lefthook', '@arkweid/lefthook', '@evilmartians/lefthook'];
@@ -22,7 +22,7 @@ const resolveConfig = async (localConfig, options) => {
22
22
  if (extname(configFileName) !== '') {
23
23
  const scripts = findByKeyDeep(localConfig, 'run').flatMap(command => {
24
24
  const deps = getInputsFromScripts([command.run], { ...options, optionalBinaries: true });
25
- const dir = command.root ?? cwd;
25
+ const dir = command.root ? toAbsolute(command.root, options.rootCwd) : cwd;
26
26
  return deps.flatMap(dependency => ({ ...dependency, dir }));
27
27
  });
28
28
  const lefthook = process.env.CI
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,16 @@
1
+ import { hasDependency } from '../../util/plugin.js';
2
+ const title = 'Lingui';
3
+ const enablers = ['@lingui/cli'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const entry = ['lingui.config.{js,cjs,ts,mjs}', '.linguirc.{js,ts}'];
6
+ const args = {
7
+ config: ['config'],
8
+ };
9
+ const plugin = {
10
+ title,
11
+ enablers,
12
+ isEnabled,
13
+ entry,
14
+ args,
15
+ };
16
+ export default plugin;
@@ -3,11 +3,11 @@ import { toCosmiconfig } from '../../util/plugin-config.js';
3
3
  const title = 'lockfile-lint';
4
4
  const enablers = ['lockfile-lint'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['package.json', ...toCosmiconfig('lockfile-lint', { additionalExtensions: ['toml'] })];
6
+ const entry = ['package.json', ...toCosmiconfig('lockfile-lint', { additionalExtensions: ['toml'] })];
7
7
  const plugin = {
8
8
  title,
9
9
  enablers,
10
10
  isEnabled,
11
- config,
11
+ entry,
12
12
  };
13
13
  export default plugin;
@@ -2,11 +2,11 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Lost Pixel';
3
3
  const enablers = ['lost-pixel'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['lostpixel.config.{js,ts}'];
5
+ const entry = ['lostpixel.config.{js,ts}'];
6
6
  const plugin = {
7
7
  title,
8
8
  enablers,
9
9
  isEnabled,
10
- config,
10
+ entry,
11
11
  };
12
12
  export default plugin;
@@ -1,4 +1,4 @@
1
- import { isAbsolute, join } from '../../util/path.js';
1
+ import { toAbsolute } from '../../util/path.js';
2
2
  import { toProductionEntry } from '../../util/input.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Lunaria';
@@ -13,7 +13,7 @@ const resolveConfig = async (localConfig, options) => {
13
13
  const customCss = localConfig.dashboard?.customCss ?? [];
14
14
  const favicon = localConfig.dashboard?.favicon?.inline ? [localConfig.dashboard.favicon.inline] : [];
15
15
  const baseDir = options.configFileDir;
16
- return [...files, ...renderer, ...customCss, ...favicon].map(id => toProductionEntry(isAbsolute(id) ? id : join(baseDir, id)));
16
+ return [...files, ...renderer, ...customCss, ...favicon].map(id => toProductionEntry(toAbsolute(id, baseDir)));
17
17
  };
18
18
  const args = {
19
19
  binaries: ['lunaria'],