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.
- package/dist/CacheConsultant.d.ts +1 -0
- package/dist/CacheConsultant.js +2 -0
- package/dist/CatalogCounselor.d.ts +1 -3
- package/dist/CatalogCounselor.js +18 -15
- package/dist/ConfigurationChief.d.ts +42 -0
- package/dist/DependencyDeputy.d.ts +2 -1
- package/dist/DependencyDeputy.js +9 -4
- package/dist/IssueCollector.js +1 -0
- package/dist/IssueFixer.js +10 -5
- package/dist/ProjectPrincipal.d.ts +3 -2
- package/dist/ProjectPrincipal.js +32 -10
- package/dist/WorkspaceWorker.d.ts +5 -2
- package/dist/WorkspaceWorker.js +35 -17
- package/dist/binaries/resolvers/bun.js +1 -0
- package/dist/binaries/resolvers/npm.js +12 -2
- package/dist/binaries/resolvers/pnpm.js +5 -3
- package/dist/binaries/util.js +2 -1
- package/dist/cli.js +6 -1
- package/dist/compilers/compilers.js +2 -2
- package/dist/compilers/index.d.ts +5 -0
- package/dist/compilers/index.js +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/graph/analyze.js +3 -2
- package/dist/graph/build.d.ts +2 -0
- package/dist/graph/build.js +37 -22
- package/dist/graph-explorer/cache.d.ts +2 -1
- package/dist/graph-explorer/cache.js +5 -1
- package/dist/graph-explorer/explorer.d.ts +3 -5
- package/dist/graph-explorer/explorer.js +24 -3
- package/dist/plugins/_vue/auto-import.js +31 -1
- package/dist/plugins/biome/index.js +1 -1
- package/dist/plugins/buf/index.d.ts +3 -0
- package/dist/plugins/buf/index.js +33 -0
- package/dist/plugins/buf/types.d.ts +8 -0
- package/dist/plugins/buf/types.js +1 -0
- package/dist/plugins/cspell/index.js +1 -0
- package/dist/plugins/dependency-cruiser/index.js +2 -2
- package/dist/plugins/docusaurus/helpers.js +4 -4
- package/dist/plugins/electron-forge/index.d.ts +3 -0
- package/dist/plugins/electron-forge/index.js +94 -0
- package/dist/plugins/electron-vite/index.js +2 -2
- package/dist/plugins/eslint/helpers.d.ts +1 -0
- package/dist/plugins/eslint/helpers.js +1 -1
- package/dist/plugins/eslint/resolveFromAST.js +35 -10
- package/dist/plugins/expo/helpers.d.ts +1 -1
- package/dist/plugins/expo/helpers.js +15 -8
- package/dist/plugins/expo/types.d.ts +2 -1
- package/dist/plugins/expressive-code/index.d.ts +1 -1
- package/dist/plugins/expressive-code/index.js +2 -2
- package/dist/plugins/gatsby/index.js +6 -6
- package/dist/plugins/gatsby/types.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +1 -1
- package/dist/plugins/i18next-parser/index.js +2 -2
- package/dist/plugins/index.d.ts +8 -1
- package/dist/plugins/index.js +14 -0
- package/dist/plugins/jasmine/index.js +2 -2
- package/dist/plugins/karma/index.js +4 -4
- package/dist/plugins/kysely-codegen/index.d.ts +3 -0
- package/dist/plugins/kysely-codegen/index.js +20 -0
- package/dist/plugins/lefthook/index.js +2 -2
- package/dist/plugins/lingui/index.d.ts +3 -0
- package/dist/plugins/lingui/index.js +16 -0
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/lost-pixel/index.js +2 -2
- package/dist/plugins/lunaria/index.js +2 -2
- package/dist/plugins/marko/index.js +5 -6
- package/dist/plugins/mastra/index.d.ts +3 -0
- package/dist/plugins/mastra/index.js +57 -0
- package/dist/plugins/mcp/index.d.ts +3 -0
- package/dist/plugins/mcp/index.js +33 -0
- package/dist/plugins/mcp/types.d.ts +11 -0
- package/dist/plugins/mcp/types.js +1 -0
- package/dist/plugins/mise/index.js +0 -3
- package/dist/plugins/mocha/index.js +42 -3
- package/dist/plugins/mocha/types.d.ts +1 -0
- package/dist/plugins/next/index.d.ts +3 -0
- package/dist/plugins/next/index.js +57 -9
- package/dist/plugins/next/types.d.ts +11 -0
- package/dist/plugins/next/types.js +1 -0
- package/dist/plugins/nx/index.js +3 -8
- package/dist/plugins/nyc/index.js +1 -1
- package/dist/plugins/openapi-ts/index.js +2 -2
- package/dist/plugins/oxfmt/index.js +2 -2
- package/dist/plugins/playwright/index.js +6 -11
- package/dist/plugins/pnpm/index.js +2 -4
- package/dist/plugins/purgecss/index.d.ts +3 -0
- package/dist/plugins/purgecss/index.js +16 -0
- package/dist/plugins/railway/index.js +1 -4
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rstest/index.js +2 -2
- package/dist/plugins/serverless-framework/index.js +1 -1
- package/dist/plugins/storybook/index.js +5 -5
- package/dist/plugins/sveltekit/resolveFromAST.js +1 -1
- package/dist/plugins/syncpack/index.js +2 -2
- package/dist/plugins/tailwind/compiler.js +6 -2
- package/dist/plugins/tanstack-router/index.js +3 -2
- package/dist/plugins/taskfile/index.js +4 -7
- package/dist/plugins/textlint/helpers.js +2 -2
- package/dist/plugins/travis/index.js +2 -2
- package/dist/plugins/typescript/index.js +9 -7
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vite-plugin-pwa/index.js +1 -4
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.d.ts +0 -2
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
- package/dist/plugins/vite-pwa-assets-generator/index.js +2 -2
- package/dist/plugins/vitest/helpers.d.ts +1 -1
- package/dist/plugins/vitest/helpers.js +17 -10
- package/dist/plugins/vitest/index.js +53 -45
- package/dist/plugins/vitest/types.d.ts +11 -7
- package/dist/plugins/webpack/index.js +4 -2
- package/dist/plugins/yarn/index.js +2 -4
- package/dist/reporters/codeclimate.d.ts +2 -2
- package/dist/reporters/codeclimate.js +2 -4
- package/dist/reporters/codeowners.d.ts +2 -2
- package/dist/reporters/codeowners.js +9 -9
- package/dist/reporters/compact.d.ts +2 -2
- package/dist/reporters/compact.js +8 -7
- package/dist/reporters/cycles.d.ts +2 -2
- package/dist/reporters/cycles.js +7 -6
- package/dist/reporters/disclosure.d.ts +2 -2
- package/dist/reporters/disclosure.js +6 -4
- package/dist/reporters/github-actions.d.ts +2 -2
- package/dist/reporters/github-actions.js +7 -5
- package/dist/reporters/index.d.ts +10 -10
- package/dist/reporters/json.d.ts +2 -2
- package/dist/reporters/json.js +2 -4
- package/dist/reporters/markdown.d.ts +2 -2
- package/dist/reporters/markdown.js +11 -9
- package/dist/reporters/sarif.d.ts +2 -2
- package/dist/reporters/sarif.js +2 -3
- package/dist/reporters/symbols.d.ts +2 -2
- package/dist/reporters/symbols.js +6 -4
- package/dist/run.d.ts +1 -1
- package/dist/run.js +3 -10
- package/dist/schema/configuration.d.ts +105 -0
- package/dist/schema/plugins.d.ts +35 -0
- package/dist/schema/plugins.js +7 -0
- package/dist/session/configuration.d.ts +12 -0
- package/dist/session/configuration.js +43 -0
- package/dist/session/incremental.d.ts +54 -0
- package/dist/session/incremental.js +49 -0
- package/dist/session/session.d.ts +1 -1
- package/dist/session/session.js +62 -27
- package/dist/session/watch.d.ts +2 -0
- package/dist/session/watch.js +41 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +7 -0
- package/dist/types/config.d.ts +2 -0
- package/dist/types/issues.d.ts +4 -0
- package/dist/types/package-json.d.ts +0 -3
- package/dist/typescript/ast-nodes.js +3 -3
- package/dist/typescript/get-imports-and-exports.js +2 -0
- package/dist/typescript/visitors/calls.js +15 -11
- package/dist/typescript/visitors/exports.js +5 -4
- package/dist/typescript/visitors/imports.d.ts +2 -1
- package/dist/typescript/visitors/imports.js +25 -19
- package/dist/typescript/visitors/members.js +23 -26
- package/dist/typescript/visitors/walk.d.ts +3 -0
- package/dist/typescript/visitors/walk.js +55 -3
- package/dist/util/cli-arguments.d.ts +2 -1
- package/dist/util/cli-arguments.js +3 -0
- package/dist/util/create-input-handler.js +1 -1
- package/dist/util/create-options.d.ts +72 -1
- package/dist/util/create-options.js +13 -2
- package/dist/util/file-entry-cache.d.ts +2 -0
- package/dist/util/file-entry-cache.js +19 -1
- package/dist/util/gitignore-cache.d.ts +1 -0
- package/dist/util/gitignore-cache.js +1 -0
- package/dist/util/glob-core.js +4 -2
- package/dist/util/glob.d.ts +1 -0
- package/dist/util/glob.js +6 -0
- package/dist/util/input.d.ts +2 -0
- package/dist/util/loader.d.ts +1 -0
- package/dist/util/loader.js +38 -2
- package/dist/util/modules.js +5 -2
- package/dist/util/path.d.ts +1 -0
- package/dist/util/path.js +1 -0
- package/dist/util/remove-export.js +3 -1
- package/dist/util/reporter.d.ts +1 -1
- package/dist/util/reporter.js +53 -9
- package/dist/util/watch.d.ts +5 -11
- package/dist/util/watch.js +84 -68
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- 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 {
|
|
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 =
|
|
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 (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
21
|
-
|
|
20
|
+
const inputs = new Set();
|
|
21
|
+
for (const plugin of config.plugins ?? []) {
|
|
22
22
|
const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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;
|
|
@@ -6,10 +6,10 @@ const enablers = [
|
|
|
6
6
|
'@astrojs/starlight',
|
|
7
7
|
];
|
|
8
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
9
|
-
const
|
|
9
|
+
const entry = ['ec.config.{js,mjs,cjs,ts}'];
|
|
10
10
|
export default {
|
|
11
11
|
title,
|
|
12
12
|
enablers,
|
|
13
13
|
isEnabled,
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
|
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,
|
|
@@ -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
|
|
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
|
-
|
|
14
|
+
entry,
|
|
15
15
|
args,
|
|
16
16
|
};
|
|
17
17
|
export default plugin;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/plugins/index.js
CHANGED
|
@@ -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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
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 =
|
|
28
|
+
const absPath = toAbsolute(fileOrPattern, basePath);
|
|
29
29
|
inputs.add(toEntry(`!${absPath}`));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -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
|
|
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,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
|
|
6
|
+
const entry = ['package.json', ...toCosmiconfig('lockfile-lint', { additionalExtensions: ['toml'] })];
|
|
7
7
|
const plugin = {
|
|
8
8
|
title,
|
|
9
9
|
enablers,
|
|
10
10
|
isEnabled,
|
|
11
|
-
|
|
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
|
|
5
|
+
const entry = ['lostpixel.config.{js,ts}'];
|
|
6
6
|
const plugin = {
|
|
7
7
|
title,
|
|
8
8
|
enablers,
|
|
9
9
|
isEnabled,
|
|
10
|
-
|
|
10
|
+
entry,
|
|
11
11
|
};
|
|
12
12
|
export default plugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
16
|
+
return [...files, ...renderer, ...customCss, ...favicon].map(id => toProductionEntry(toAbsolute(id, baseDir)));
|
|
17
17
|
};
|
|
18
18
|
const args = {
|
|
19
19
|
binaries: ['lunaria'],
|