knip 6.24.0 → 6.26.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/ConfigurationChief.d.ts +115 -1
- package/dist/ConfigurationChief.js +3 -0
- package/dist/ProjectPrincipal.d.ts +2 -0
- package/dist/ProjectPrincipal.js +4 -1
- package/dist/binaries/bash-parser.js +55 -83
- package/dist/binaries/index.js +3 -0
- package/dist/compilers/index.d.ts +199 -5
- package/dist/constants.d.ts +5 -1
- package/dist/constants.js +18 -0
- package/dist/graph/analyze.js +37 -2
- package/dist/graph/build.js +17 -3
- package/dist/graph-explorer/explorer.d.ts +1 -0
- package/dist/graph-explorer/explorer.js +2 -0
- package/dist/graph-explorer/operations/find-all-cycles.d.ts +3 -0
- package/dist/graph-explorer/operations/find-all-cycles.js +43 -0
- package/dist/graph-explorer/operations/find-cycles.js +3 -9
- package/dist/graph-explorer/utils.d.ts +10 -1
- package/dist/graph-explorer/utils.js +53 -0
- package/dist/plugins/_vue/auto-import.d.ts +12 -0
- package/dist/plugins/_vue/auto-import.js +272 -0
- package/dist/plugins/_vue/types.d.ts +38 -0
- package/dist/plugins/_vue/types.js +1 -0
- package/dist/plugins/astro/index.js +2 -37
- package/dist/plugins/astro/resolveFromAST.d.ts +4 -4
- package/dist/plugins/astro/resolveFromAST.js +34 -7
- package/dist/plugins/bun/index.js +28 -14
- package/dist/plugins/electron-vite/index.d.ts +3 -0
- package/dist/plugins/electron-vite/index.js +51 -0
- package/dist/plugins/electron-vite/types.d.ts +23 -0
- package/dist/plugins/electron-vite/types.js +1 -0
- package/dist/plugins/esbuild/index.d.ts +3 -0
- package/dist/plugins/esbuild/index.js +17 -0
- package/dist/plugins/eslint/resolveFromAST.js +18 -21
- package/dist/plugins/eve/index.d.ts +3 -0
- package/dist/plugins/eve/index.js +22 -0
- package/dist/plugins/execa/visitors/execa.js +10 -18
- package/dist/plugins/fumadocs/index.d.ts +3 -0
- package/dist/plugins/fumadocs/index.js +18 -0
- package/dist/plugins/graphql-codegen/index.js +9 -7
- package/dist/plugins/index.d.ts +19 -0
- package/dist/plugins/index.js +38 -0
- package/dist/plugins/jest/index.js +13 -3
- package/dist/plugins/laravel-vite-plugin/index.d.ts +3 -0
- package/dist/plugins/laravel-vite-plugin/index.js +14 -0
- package/dist/plugins/laravel-vite-plugin/resolveFromAST.d.ts +2 -0
- package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +27 -0
- package/dist/plugins/next/index.js +25 -12
- package/dist/plugins/next-mdx/index.js +2 -8
- package/dist/plugins/next-mdx/resolveFromAST.d.ts +3 -2
- package/dist/plugins/next-mdx/resolveFromAST.js +17 -21
- package/dist/plugins/node/index.js +4 -1
- package/dist/plugins/nuxt/index.js +5 -68
- package/dist/plugins/nuxt/types.d.ts +0 -34
- package/dist/plugins/nuxtjs-i18n/index.d.ts +3 -0
- package/dist/plugins/nuxtjs-i18n/index.js +12 -0
- package/dist/plugins/oclif/index.js +10 -5
- package/dist/plugins/orval/index.js +1 -3
- package/dist/plugins/orval/resolveFromAST.d.ts +2 -2
- package/dist/plugins/orval/resolveFromAST.js +4 -7
- package/dist/plugins/oxlint/index.js +23 -2
- package/dist/plugins/pnpm/index.js +22 -1
- package/dist/plugins/pnpm/types.d.ts +4 -0
- package/dist/plugins/pnpm/types.js +1 -0
- package/dist/plugins/prettier/index.js +19 -3
- package/dist/plugins/prettier/types.d.ts +6 -1
- package/dist/plugins/quasar/index.d.ts +3 -0
- package/dist/plugins/quasar/index.js +15 -0
- package/dist/plugins/quasar/resolveFromAST.d.ts +3 -0
- package/dist/plugins/quasar/resolveFromAST.js +63 -0
- package/dist/plugins/qwik/index.js +1 -25
- package/dist/plugins/qwik/resolveFromAST.d.ts +5 -3
- package/dist/plugins/qwik/resolveFromAST.js +28 -9
- package/dist/plugins/rolldown/index.js +2 -5
- package/dist/plugins/rollup/index.js +2 -5
- package/dist/plugins/rslib/index.js +2 -5
- package/dist/plugins/rspack/index.js +5 -0
- package/dist/plugins/serverless-framework/index.js +12 -1
- package/dist/plugins/serverless-framework/types.d.ts +5 -2
- package/dist/plugins/sst/index.js +1 -5
- package/dist/plugins/sst/resolveFromAST.d.ts +1 -1
- package/dist/plugins/sst/resolveFromAST.js +1 -1
- package/dist/plugins/starlight/index.js +1 -19
- package/dist/plugins/starlight/resolveFromAST.d.ts +2 -2
- package/dist/plugins/starlight/resolveFromAST.js +12 -8
- package/dist/plugins/stencil/index.js +2 -37
- package/dist/plugins/stencil/resolveFromAST.d.ts +3 -0
- package/dist/plugins/stencil/resolveFromAST.js +36 -0
- package/dist/plugins/storybook/index.js +10 -0
- package/dist/plugins/sveltekit/index.js +1 -48
- package/dist/plugins/sveltekit/resolveFromAST.d.ts +2 -0
- package/dist/plugins/sveltekit/resolveFromAST.js +45 -0
- package/dist/plugins/tauri/index.d.ts +3 -0
- package/dist/plugins/tauri/index.js +42 -0
- package/dist/plugins/tauri/types.d.ts +16 -0
- package/dist/plugins/tauri/types.js +1 -0
- package/dist/plugins/tsdown/index.js +2 -5
- package/dist/plugins/tsup/index.js +2 -5
- package/dist/plugins/typedoc/index.js +9 -3
- package/dist/plugins/typedoc/types.d.ts +2 -0
- package/dist/plugins/unplugin-auto-import/index.d.ts +3 -0
- package/dist/plugins/unplugin-auto-import/index.js +18 -0
- package/dist/plugins/unplugin-icons/index.d.ts +3 -0
- package/dist/plugins/unplugin-icons/index.js +17 -0
- package/dist/plugins/unplugin-vue-components/index.d.ts +3 -0
- package/dist/plugins/unplugin-vue-components/index.js +16 -0
- package/dist/plugins/unplugin-vue-i18n/index.d.ts +3 -0
- package/dist/plugins/unplugin-vue-i18n/index.js +10 -0
- package/dist/plugins/unplugin-vue-markdown/index.d.ts +3 -0
- package/dist/plugins/unplugin-vue-markdown/index.js +16 -0
- package/dist/plugins/unplugin-vue-router/index.d.ts +3 -0
- package/dist/plugins/unplugin-vue-router/index.js +14 -0
- package/dist/plugins/vite/helpers.d.ts +2 -0
- package/dist/plugins/vite/helpers.js +46 -31
- package/dist/plugins/vite/index.js +1 -1
- package/dist/plugins/vite/visitors/importMetaGlob.js +1 -8
- package/dist/plugins/vite-plugin-pages/index.d.ts +3 -0
- package/dist/plugins/vite-plugin-pages/index.js +26 -0
- package/dist/plugins/vite-plugin-pwa/index.d.ts +3 -0
- package/dist/plugins/vite-plugin-pwa/index.js +17 -0
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.d.ts +4 -0
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +37 -0
- package/dist/plugins/vite-plugin-vue-layouts-next/index.d.ts +3 -0
- package/dist/plugins/vite-plugin-vue-layouts-next/index.js +23 -0
- package/dist/plugins/vite-plus/index.d.ts +3 -0
- package/dist/plugins/vite-plus/index.js +14 -0
- package/dist/plugins/vite-plus/resolveFromAST.d.ts +2 -0
- package/dist/plugins/vite-plus/resolveFromAST.js +37 -0
- package/dist/plugins/vite-pwa-assets-generator/index.d.ts +3 -0
- package/dist/plugins/vite-pwa-assets-generator/index.js +12 -0
- package/dist/plugins/vitepress/index.js +5 -1
- package/dist/plugins/vitest/index.js +4 -0
- package/dist/plugins/vitest/types.d.ts +3 -0
- package/dist/plugins/vue/index.js +5 -3
- package/dist/plugins/webpack/visitors/requireContext.js +2 -13
- package/dist/plugins/yarn/index.js +14 -4
- package/dist/plugins/yarn/types.d.ts +8 -0
- package/dist/plugins/yarn/types.js +1 -0
- package/dist/plugins/zx/visitors/zx.js +4 -4
- package/dist/reporters/cycles.d.ts +3 -0
- package/dist/reporters/cycles.js +79 -0
- package/dist/reporters/index.d.ts +1 -0
- package/dist/reporters/index.js +2 -0
- package/dist/reporters/json.d.ts +3 -0
- package/dist/reporters/json.js +2 -1
- package/dist/reporters/util/util.d.ts +3 -1
- package/dist/reporters/util/util.js +5 -1
- package/dist/schema/configuration.d.ts +295 -6
- package/dist/schema/configuration.js +6 -0
- package/dist/schema/plugins.d.ts +95 -0
- package/dist/schema/plugins.js +19 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +19 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/issues.d.ts +3 -0
- package/dist/types/module-graph.d.ts +7 -0
- package/dist/types/package-json.d.ts +8 -1
- package/dist/typescript/ast-helpers.d.ts +7 -2
- package/dist/typescript/ast-helpers.js +36 -8
- package/dist/typescript/ast-nodes.d.ts +4 -1
- package/dist/typescript/ast-nodes.js +17 -1
- package/dist/typescript/get-imports-and-exports.js +10 -0
- package/dist/typescript/glob-imports.d.ts +3 -0
- package/dist/typescript/glob-imports.js +49 -0
- package/dist/typescript/resolve-module-names.d.ts +2 -0
- package/dist/typescript/resolve-module-names.js +35 -1
- package/dist/typescript/visitors/calls.js +4 -6
- package/dist/typescript/visitors/imports.js +8 -8
- package/dist/typescript/visitors/script-visitors.js +4 -4
- package/dist/typescript/visitors/walk.js +2 -3
- package/dist/util/cli-arguments.d.ts +2 -1
- package/dist/util/cli-arguments.js +5 -3
- package/dist/util/create-options.d.ts +202 -5
- package/dist/util/create-options.js +4 -1
- package/dist/util/get-included-issue-types.d.ts +1 -0
- package/dist/util/get-included-issue-types.js +4 -2
- package/dist/util/issue-initializers.js +1 -1
- package/dist/util/load-tsconfig.js +17 -4
- package/dist/util/module-graph.js +1 -0
- package/dist/util/modules.js +25 -4
- package/dist/util/resolve.js +4 -1
- package/dist/util/scripts.d.ts +7 -0
- package/dist/util/scripts.js +75 -0
- package/dist/util/to-source-path.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +108 -1
- package/dist/plugins/next/resolveFromAST.d.ts +0 -2
- package/dist/plugins/next/resolveFromAST.js +0 -2
- package/dist/plugins/nuxt/helpers.d.ts +0 -15
- package/dist/plugins/nuxt/helpers.js +0 -133
- package/dist/plugins/rolldown/resolveFromAST.d.ts +0 -2
- package/dist/plugins/rolldown/resolveFromAST.js +0 -4
- package/dist/plugins/rollup/resolveFromAST.d.ts +0 -2
- package/dist/plugins/rollup/resolveFromAST.js +0 -4
- package/dist/plugins/rslib/resolveFromAST.d.ts +0 -2
- package/dist/plugins/rslib/resolveFromAST.js +0 -4
- package/dist/plugins/tsdown/resolveFromAST.d.ts +0 -2
- package/dist/plugins/tsdown/resolveFromAST.js +0 -4
- package/dist/plugins/tsup/resolveFromAST.d.ts +0 -2
- package/dist/plugins/tsup/resolveFromAST.js +0 -4
- package/dist/plugins/vue/compiler.d.ts +0 -3
- package/dist/plugins/vue/compiler.js +0 -10
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { isAbsolute, join } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
|
+
import { getHtmlScriptEntries } from '../vite/helpers.js';
|
|
5
|
+
const title = 'electron-vite';
|
|
6
|
+
const enablers = ['electron-vite'];
|
|
7
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
|
+
const config = ['electron.vite.config.{js,mjs,cjs,ts,mts,cts}'];
|
|
9
|
+
const defaultEntry = {
|
|
10
|
+
main: 'src/main/index.{js,mjs,cjs,ts,mts,cts}',
|
|
11
|
+
preload: 'src/preload/index.{js,mjs,cjs,ts,mts,cts}',
|
|
12
|
+
renderer: 'src/renderer/index.html',
|
|
13
|
+
};
|
|
14
|
+
const production = Object.values(defaultEntry);
|
|
15
|
+
const buildEnv = { command: 'build', mode: 'production' };
|
|
16
|
+
const resolveConfig = async (localConfig, options) => {
|
|
17
|
+
const { configFileDir } = options;
|
|
18
|
+
const config = typeof localConfig === 'function' ? await localConfig(buildEnv) : localConfig;
|
|
19
|
+
const inputs = [];
|
|
20
|
+
for (const name of ['main', 'preload', 'renderer']) {
|
|
21
|
+
let section = config?.[name];
|
|
22
|
+
if (typeof section === 'function')
|
|
23
|
+
section = await section(buildEnv);
|
|
24
|
+
const ids = [];
|
|
25
|
+
for (const input of [section?.build?.rollupOptions?.input, section?.build?.lib?.entry]) {
|
|
26
|
+
if (typeof input === 'string')
|
|
27
|
+
ids.push(input);
|
|
28
|
+
else if (input)
|
|
29
|
+
ids.push(...Object.values(input));
|
|
30
|
+
}
|
|
31
|
+
const patterns = ids.length > 0 ? ids : [defaultEntry[name]];
|
|
32
|
+
for (const id of patterns) {
|
|
33
|
+
const resolved = isAbsolute(id) ? id : join(configFileDir, id);
|
|
34
|
+
inputs.push(toProductionEntry(resolved));
|
|
35
|
+
if (name === 'renderer' && resolved.endsWith('.html')) {
|
|
36
|
+
for (const input of await getHtmlScriptEntries(resolved))
|
|
37
|
+
inputs.push(input);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return inputs;
|
|
42
|
+
};
|
|
43
|
+
const plugin = {
|
|
44
|
+
title,
|
|
45
|
+
enablers,
|
|
46
|
+
isEnabled,
|
|
47
|
+
config,
|
|
48
|
+
production,
|
|
49
|
+
resolveConfig,
|
|
50
|
+
};
|
|
51
|
+
export default plugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type EntryInput = string | string[] | Record<string, string>;
|
|
2
|
+
interface ViteBuildConfig {
|
|
3
|
+
build?: {
|
|
4
|
+
rollupOptions?: {
|
|
5
|
+
input?: EntryInput;
|
|
6
|
+
};
|
|
7
|
+
lib?: {
|
|
8
|
+
entry?: EntryInput;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
type ConfigEnv = {
|
|
13
|
+
command: string;
|
|
14
|
+
mode: string;
|
|
15
|
+
};
|
|
16
|
+
type Section = ViteBuildConfig | ((env: ConfigEnv) => ViteBuildConfig | Promise<ViteBuildConfig>);
|
|
17
|
+
type ElectronViteConfigObject = {
|
|
18
|
+
main?: Section;
|
|
19
|
+
preload?: Section;
|
|
20
|
+
renderer?: Section;
|
|
21
|
+
};
|
|
22
|
+
export type ElectronViteConfig = ElectronViteConfigObject | ((env: ConfigEnv) => ElectronViteConfigObject | Promise<ElectronViteConfigObject>);
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { collectPropertyValues } from '../../typescript/ast-helpers.js';
|
|
2
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
3
|
+
import { join } from '../../util/path.js';
|
|
4
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
5
|
+
const title = 'esbuild';
|
|
6
|
+
const enablers = ['esbuild'];
|
|
7
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
|
+
const config = ['esbuild.config.{js,mjs,cjs,ts,mts,cts}', 'esbuild.{js,mjs,cjs,ts,mts,cts}'];
|
|
9
|
+
const resolveFromAST = (program, { configFileDir }) => [...collectPropertyValues(program, 'entryPoints')].map(id => toProductionEntry(join(configFileDir, id)));
|
|
10
|
+
const plugin = {
|
|
11
|
+
title,
|
|
12
|
+
enablers,
|
|
13
|
+
isEnabled,
|
|
14
|
+
config,
|
|
15
|
+
resolveFromAST,
|
|
16
|
+
};
|
|
17
|
+
export default plugin;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Visitor } from 'oxc-parser';
|
|
2
2
|
import { toDeferResolve } from '../../util/input.js';
|
|
3
|
-
import { findProperty } from '../../typescript/ast-helpers.js';
|
|
3
|
+
import { findProperty, getPropertyKey } from '../../typescript/ast-helpers.js';
|
|
4
|
+
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
4
5
|
import { isInternal } from '../../util/path.js';
|
|
5
6
|
export const getInputsFromFlatConfigAST = (program) => {
|
|
6
7
|
const inputs = [];
|
|
8
|
+
const addResolver = (key, resolver) => {
|
|
9
|
+
if (!resolver || resolver === 'node' || isInternal(resolver))
|
|
10
|
+
return;
|
|
11
|
+
const dep = key === 'import/resolver' ? `eslint-import-resolver-${resolver}` : resolver;
|
|
12
|
+
inputs.push(toDeferResolve(dep, { optional: true }));
|
|
13
|
+
};
|
|
7
14
|
const visitor = new Visitor({
|
|
8
15
|
ObjectExpression(node) {
|
|
9
16
|
const settingsNode = findProperty(node, 'settings');
|
|
@@ -12,28 +19,18 @@ export const getInputsFromFlatConfigAST = (program) => {
|
|
|
12
19
|
for (const prop of settingsNode.properties ?? []) {
|
|
13
20
|
if (prop.type !== 'Property')
|
|
14
21
|
continue;
|
|
15
|
-
const key = prop
|
|
16
|
-
if (key
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (resolver && resolver !== 'node' && !isInternal(resolver)) {
|
|
23
|
-
const dep = key === 'import/resolver' ? `eslint-import-resolver-${resolver}` : resolver;
|
|
24
|
-
inputs.push(toDeferResolve(dep, { optional: true }));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else if (prop.value?.type === 'StringLiteral' ||
|
|
29
|
-
(prop.value?.type === 'Literal' && typeof prop.value.value === 'string')) {
|
|
30
|
-
const resolver = prop.value.value;
|
|
31
|
-
if (resolver && resolver !== 'node' && !isInternal(resolver)) {
|
|
32
|
-
const dep = key === 'import/resolver' ? `eslint-import-resolver-${resolver}` : resolver;
|
|
33
|
-
inputs.push(toDeferResolve(dep, { optional: true }));
|
|
34
|
-
}
|
|
22
|
+
const key = getPropertyKey(prop);
|
|
23
|
+
if (key !== 'import/resolver' && key !== 'import/parsers')
|
|
24
|
+
continue;
|
|
25
|
+
if (prop.value?.type === 'ObjectExpression') {
|
|
26
|
+
for (const p of prop.value.properties ?? []) {
|
|
27
|
+
if (p.type === 'Property')
|
|
28
|
+
addResolver(key, getPropertyKey(p));
|
|
35
29
|
}
|
|
36
30
|
}
|
|
31
|
+
else {
|
|
32
|
+
addResolver(key, getStringValue(prop.value));
|
|
33
|
+
}
|
|
37
34
|
}
|
|
38
35
|
},
|
|
39
36
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
const title = 'eve';
|
|
3
|
+
const enablers = ['eve'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const extensions = '{js,jsx,ts,tsx,mjs,cjs,mts,cts}';
|
|
6
|
+
const rootAgentFileNames = '{agent,instructions,instrumentation,sandbox}';
|
|
7
|
+
const subagentFileNames = '{agent,instructions,sandbox}';
|
|
8
|
+
const production = [
|
|
9
|
+
`{,agent/}${rootAgentFileNames}.${extensions}`,
|
|
10
|
+
`{,agent/}sandbox/sandbox.${extensions}`,
|
|
11
|
+
`{,agent/}{channels,connections,hooks,skills,tools,schedules}/**/*.${extensions}`,
|
|
12
|
+
`{,agent/}subagents/**/${subagentFileNames}.${extensions}`,
|
|
13
|
+
`{,agent/}subagents/**/sandbox/sandbox.${extensions}`,
|
|
14
|
+
`{,agent/}subagents/**/{connections,hooks,skills,tools}/**/*.${extensions}`,
|
|
15
|
+
];
|
|
16
|
+
const plugin = {
|
|
17
|
+
title,
|
|
18
|
+
enablers,
|
|
19
|
+
isEnabled,
|
|
20
|
+
production,
|
|
21
|
+
};
|
|
22
|
+
export default plugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSafeScriptFromArgs,
|
|
1
|
+
import { getSafeScriptFromArgs, getScriptFromArg, getScriptFromTemplate } from '../../../typescript/ast-nodes.js';
|
|
2
2
|
const tags = new Set(['$', '$sync']);
|
|
3
3
|
const methods = new Set(['execa', 'execaSync', 'execaCommand', 'execaCommandSync', 'execaNode', '$sync']);
|
|
4
4
|
export function createExecaVisitor(ctx) {
|
|
@@ -10,18 +10,12 @@ export function createExecaVisitor(ctx) {
|
|
|
10
10
|
: tag.type === 'CallExpression' && tag.callee.type === 'Identifier'
|
|
11
11
|
? tag.callee.name
|
|
12
12
|
: undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
else if (tagName && tags.has(tagName)) {
|
|
20
|
-
for (const q of node.quasi.quasis) {
|
|
21
|
-
if (q.value.raw)
|
|
22
|
-
ctx.addScript(q.value.raw);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
13
|
+
const isNode = tagName === 'execaNode';
|
|
14
|
+
if (!isNode && !(tagName && tags.has(tagName)))
|
|
15
|
+
return;
|
|
16
|
+
const script = getScriptFromTemplate(node.quasi);
|
|
17
|
+
if (script)
|
|
18
|
+
ctx.addScript(isNode ? `node ${script}` : script);
|
|
25
19
|
},
|
|
26
20
|
CallExpression(node) {
|
|
27
21
|
if (node.callee.type !== 'Identifier' || !methods.has(node.callee.name))
|
|
@@ -33,11 +27,9 @@ export function createExecaVisitor(ctx) {
|
|
|
33
27
|
ctx.addScript(`node ${script}`);
|
|
34
28
|
}
|
|
35
29
|
else if (fnName.startsWith('execaCommand')) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ctx.addScript(val);
|
|
40
|
-
}
|
|
30
|
+
const script = getScriptFromArg(node.arguments[0]);
|
|
31
|
+
if (script)
|
|
32
|
+
ctx.addScript(script);
|
|
41
33
|
}
|
|
42
34
|
else {
|
|
43
35
|
const script = getSafeScriptFromArgs(node.arguments[0], node.arguments[1]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import MDX from '../../compilers/mdx.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
const title = 'Fumadocs';
|
|
4
|
+
const enablers = ['fumadocs-core', 'fumadocs-mdx', 'fumadocs-ui'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const entry = ['source.config.{js,ts,mjs}', 'content/**/*.mdx'];
|
|
7
|
+
const registerCompilers = ({ registerCompiler, hasDependency }) => {
|
|
8
|
+
if (hasDependency('fumadocs-mdx'))
|
|
9
|
+
registerCompiler({ extension: '.mdx', compiler: MDX.compiler });
|
|
10
|
+
};
|
|
11
|
+
const plugin = {
|
|
12
|
+
title,
|
|
13
|
+
enablers,
|
|
14
|
+
isEnabled,
|
|
15
|
+
entry,
|
|
16
|
+
registerCompilers,
|
|
17
|
+
};
|
|
18
|
+
export default plugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toDependency, toEntry } from '../../util/input.js';
|
|
1
|
+
import { toDependency, toEntry, toProductionEntry } from '../../util/input.js';
|
|
2
2
|
import { get } from '../../util/object.js';
|
|
3
|
-
import { isInternal } from '../../util/path.js';
|
|
3
|
+
import { isInternal, join } from '../../util/path.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
import { isConfigurationOutput, isGraphqlConfigTypes, isGraphqlProjectsConfigTypes } from './types.js';
|
|
6
6
|
const title = 'GraphQL Codegen';
|
|
@@ -24,15 +24,17 @@ const getPluginPackageName = (name) => {
|
|
|
24
24
|
return name;
|
|
25
25
|
return `@graphql-codegen/${name}`;
|
|
26
26
|
};
|
|
27
|
-
const resolveConfig = config => {
|
|
27
|
+
const resolveConfig = (config, options) => {
|
|
28
28
|
const codegenConfigs = isGraphqlProjectsConfigTypes(config)
|
|
29
29
|
? Object.values(config.projects).flatMap(project => project.extensions?.codegen ?? [])
|
|
30
30
|
: isGraphqlConfigTypes(config)
|
|
31
31
|
? [config.extensions?.codegen]
|
|
32
32
|
: [config];
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const generateConfigs = codegenConfigs.filter((config) => Boolean(config?.generates));
|
|
34
|
+
const generateSet = generateConfigs.flatMap(config => Object.values(config.generates));
|
|
35
|
+
const outputs = generateConfigs
|
|
36
|
+
.flatMap(config => Object.keys(config.generates))
|
|
37
|
+
.map(output => toProductionEntry(join(options.configFileDir, output.endsWith('/') ? `${output}**` : output)));
|
|
36
38
|
const configurationOutput = generateSet.filter(isConfigurationOutput);
|
|
37
39
|
const presets = configurationOutput
|
|
38
40
|
.map(configOutput => (configOutput.preset ? configOutput.preset : undefined))
|
|
@@ -58,7 +60,7 @@ const resolveConfig = config => {
|
|
|
58
60
|
return [toEntry(plugin)];
|
|
59
61
|
return [toDependency(getPluginPackageName(plugin))];
|
|
60
62
|
});
|
|
61
|
-
return [...presets, ...flatPlugins, ...nestedPlugins].map(id =>
|
|
63
|
+
return [...presets, ...flatPlugins, ...nestedPlugins, ...outputs].map(id => typeof id === 'string' ? toDependency(id) : id);
|
|
62
64
|
};
|
|
63
65
|
const plugin = {
|
|
64
66
|
title,
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -27,8 +27,11 @@ export declare const Plugins: {
|
|
|
27
27
|
docusaurus: import("../types/config.ts").Plugin;
|
|
28
28
|
dotenv: import("../types/config.ts").Plugin;
|
|
29
29
|
drizzle: import("../types/config.ts").Plugin;
|
|
30
|
+
'electron-vite': import("../types/config.ts").Plugin;
|
|
30
31
|
eleventy: import("../types/config.ts").Plugin;
|
|
32
|
+
esbuild: import("../types/config.ts").Plugin;
|
|
31
33
|
eslint: import("../types/config.ts").Plugin;
|
|
34
|
+
eve: import("../types/config.ts").Plugin;
|
|
32
35
|
execa: import("../types/config.ts").Plugin;
|
|
33
36
|
expo: import("../types/config.ts").Plugin;
|
|
34
37
|
'expressive-code': {
|
|
@@ -38,6 +41,7 @@ export declare const Plugins: {
|
|
|
38
41
|
config: string[];
|
|
39
42
|
};
|
|
40
43
|
fast: import("../types/config.ts").Plugin;
|
|
44
|
+
fumadocs: import("../types/config.ts").Plugin;
|
|
41
45
|
gatsby: import("../types/config.ts").Plugin;
|
|
42
46
|
'github-action': import("../types/config.ts").Plugin;
|
|
43
47
|
'github-actions': import("../types/config.ts").Plugin;
|
|
@@ -50,6 +54,7 @@ export declare const Plugins: {
|
|
|
50
54
|
karma: import("../types/config.ts").Plugin;
|
|
51
55
|
knex: import("../types/config.ts").Plugin;
|
|
52
56
|
ladle: import("../types/config.ts").Plugin;
|
|
57
|
+
'laravel-vite-plugin': import("../types/config.ts").Plugin;
|
|
53
58
|
lefthook: import("../types/config.ts").Plugin;
|
|
54
59
|
'lint-staged': import("../types/config.ts").Plugin;
|
|
55
60
|
linthtml: import("../types/config.ts").Plugin;
|
|
@@ -77,6 +82,7 @@ export declare const Plugins: {
|
|
|
77
82
|
nodemon: import("../types/config.ts").Plugin;
|
|
78
83
|
'npm-package-json-lint': import("../types/config.ts").Plugin;
|
|
79
84
|
nuxt: import("../types/config.ts").Plugin;
|
|
85
|
+
'nuxtjs-i18n': import("../types/config.ts").Plugin;
|
|
80
86
|
nx: import("../types/config.ts").Plugin;
|
|
81
87
|
nyc: import("../types/config.ts").Plugin;
|
|
82
88
|
oclif: import("../types/config.ts").Plugin;
|
|
@@ -98,6 +104,7 @@ export declare const Plugins: {
|
|
|
98
104
|
preconstruct: import("../types/config.ts").Plugin;
|
|
99
105
|
prettier: import("../types/config.ts").Plugin;
|
|
100
106
|
prisma: import("../types/config.ts").Plugin;
|
|
107
|
+
quasar: import("../types/config.ts").Plugin;
|
|
101
108
|
qwik: import("../types/config.ts").Plugin;
|
|
102
109
|
raycast: import("../types/config.ts").Plugin;
|
|
103
110
|
'react-cosmos': import("../types/config.ts").Plugin;
|
|
@@ -136,6 +143,7 @@ export declare const Plugins: {
|
|
|
136
143
|
tailwind: import("../types/config.ts").Plugin;
|
|
137
144
|
'tanstack-router': import("../types/config.ts").Plugin;
|
|
138
145
|
taskfile: import("../types/config.ts").Plugin;
|
|
146
|
+
tauri: import("../types/config.ts").Plugin;
|
|
139
147
|
travis: import("../types/config.ts").Plugin;
|
|
140
148
|
'ts-node': import("../types/config.ts").Plugin;
|
|
141
149
|
tsdown: import("../types/config.ts").Plugin;
|
|
@@ -145,10 +153,21 @@ export declare const Plugins: {
|
|
|
145
153
|
typescript: import("../types/config.ts").Plugin;
|
|
146
154
|
unbuild: import("../types/config.ts").Plugin;
|
|
147
155
|
unocss: import("../types/config.ts").Plugin;
|
|
156
|
+
'unplugin-auto-import': import("../types/config.ts").Plugin;
|
|
157
|
+
'unplugin-icons': import("../types/config.ts").Plugin;
|
|
158
|
+
'unplugin-vue-components': import("../types/config.ts").Plugin;
|
|
159
|
+
'unplugin-vue-i18n': import("../types/config.ts").Plugin;
|
|
160
|
+
'unplugin-vue-markdown': import("../types/config.ts").Plugin;
|
|
161
|
+
'unplugin-vue-router': import("../types/config.ts").Plugin;
|
|
148
162
|
vercel: import("../types/config.ts").Plugin;
|
|
149
163
|
'vercel-og': import("../types/config.ts").Plugin;
|
|
150
164
|
vike: import("../types/config.ts").Plugin;
|
|
151
165
|
vite: import("../types/config.ts").Plugin;
|
|
166
|
+
'vite-plugin-pages': import("../types/config.ts").Plugin;
|
|
167
|
+
'vite-plugin-pwa': import("../types/config.ts").Plugin;
|
|
168
|
+
'vite-plugin-vue-layouts-next': import("../types/config.ts").Plugin;
|
|
169
|
+
'vite-plus': import("../types/config.ts").Plugin;
|
|
170
|
+
'vite-pwa-assets-generator': import("../types/config.ts").Plugin;
|
|
152
171
|
vitepress: import("../types/config.ts").Plugin;
|
|
153
172
|
vitest: import("../types/config.ts").Plugin;
|
|
154
173
|
vue: import("../types/config.ts").Plugin;
|
package/dist/plugins/index.js
CHANGED
|
@@ -26,12 +26,16 @@ import { default as dependencyCruiser } from './dependency-cruiser/index.js';
|
|
|
26
26
|
import { default as docusaurus } from './docusaurus/index.js';
|
|
27
27
|
import { default as dotenv } from './dotenv/index.js';
|
|
28
28
|
import { default as drizzle } from './drizzle/index.js';
|
|
29
|
+
import { default as electronVite } from './electron-vite/index.js';
|
|
29
30
|
import { default as eleventy } from './eleventy/index.js';
|
|
31
|
+
import { default as esbuild } from './esbuild/index.js';
|
|
30
32
|
import { default as eslint } from './eslint/index.js';
|
|
33
|
+
import { default as eve } from './eve/index.js';
|
|
31
34
|
import { default as execa } from './execa/index.js';
|
|
32
35
|
import { default as expo } from './expo/index.js';
|
|
33
36
|
import { default as expressiveCode } from './expressive-code/index.js';
|
|
34
37
|
import { default as fast } from './fast/index.js';
|
|
38
|
+
import { default as fumadocs } from './fumadocs/index.js';
|
|
35
39
|
import { default as gatsby } from './gatsby/index.js';
|
|
36
40
|
import { default as githubAction } from './github-action/index.js';
|
|
37
41
|
import { default as githubActions } from './github-actions/index.js';
|
|
@@ -44,6 +48,7 @@ import { default as jest } from './jest/index.js';
|
|
|
44
48
|
import { default as karma } from './karma/index.js';
|
|
45
49
|
import { default as knex } from './knex/index.js';
|
|
46
50
|
import { default as ladle } from './ladle/index.js';
|
|
51
|
+
import { default as laravelVitePlugin } from './laravel-vite-plugin/index.js';
|
|
47
52
|
import { default as lefthook } from './lefthook/index.js';
|
|
48
53
|
import { default as lintStaged } from './lint-staged/index.js';
|
|
49
54
|
import { default as linthtml } from './linthtml/index.js';
|
|
@@ -71,6 +76,7 @@ import { default as nodeModulesInspector } from './node-modules-inspector/index.
|
|
|
71
76
|
import { default as nodemon } from './nodemon/index.js';
|
|
72
77
|
import { default as npmPackageJsonLint } from './npm-package-json-lint/index.js';
|
|
73
78
|
import { default as nuxt } from './nuxt/index.js';
|
|
79
|
+
import { default as nuxtjsI18n } from './nuxtjs-i18n/index.js';
|
|
74
80
|
import { default as nx } from './nx/index.js';
|
|
75
81
|
import { default as nyc } from './nyc/index.js';
|
|
76
82
|
import { default as oclif } from './oclif/index.js';
|
|
@@ -92,6 +98,7 @@ import { default as postcss } from './postcss/index.js';
|
|
|
92
98
|
import { default as preconstruct } from './preconstruct/index.js';
|
|
93
99
|
import { default as prettier } from './prettier/index.js';
|
|
94
100
|
import { default as prisma } from './prisma/index.js';
|
|
101
|
+
import { default as quasar } from './quasar/index.js';
|
|
95
102
|
import { default as qwik } from './qwik/index.js';
|
|
96
103
|
import { default as raycast } from './raycast/index.js';
|
|
97
104
|
import { default as reactCosmos } from './react-cosmos/index.js';
|
|
@@ -130,6 +137,7 @@ import { default as syncpack } from './syncpack/index.js';
|
|
|
130
137
|
import { default as tailwind } from './tailwind/index.js';
|
|
131
138
|
import { default as tanstackRouter } from './tanstack-router/index.js';
|
|
132
139
|
import { default as taskfile } from './taskfile/index.js';
|
|
140
|
+
import { default as tauri } from './tauri/index.js';
|
|
133
141
|
import { default as travis } from './travis/index.js';
|
|
134
142
|
import { default as tsNode } from './ts-node/index.js';
|
|
135
143
|
import { default as tsdown } from './tsdown/index.js';
|
|
@@ -139,10 +147,21 @@ import { default as typedoc } from './typedoc/index.js';
|
|
|
139
147
|
import { default as typescript } from './typescript/index.js';
|
|
140
148
|
import { default as unbuild } from './unbuild/index.js';
|
|
141
149
|
import { default as unocss } from './unocss/index.js';
|
|
150
|
+
import { default as unpluginAutoImport } from './unplugin-auto-import/index.js';
|
|
151
|
+
import { default as unpluginIcons } from './unplugin-icons/index.js';
|
|
152
|
+
import { default as unpluginVueComponents } from './unplugin-vue-components/index.js';
|
|
153
|
+
import { default as unpluginVueI18n } from './unplugin-vue-i18n/index.js';
|
|
154
|
+
import { default as unpluginVueMarkdown } from './unplugin-vue-markdown/index.js';
|
|
155
|
+
import { default as unpluginVueRouter } from './unplugin-vue-router/index.js';
|
|
142
156
|
import { default as vercel } from './vercel/index.js';
|
|
143
157
|
import { default as vercelOg } from './vercel-og/index.js';
|
|
144
158
|
import { default as vike } from './vike/index.js';
|
|
145
159
|
import { default as vite } from './vite/index.js';
|
|
160
|
+
import { default as vitePluginPages } from './vite-plugin-pages/index.js';
|
|
161
|
+
import { default as vitePluginPwa } from './vite-plugin-pwa/index.js';
|
|
162
|
+
import { default as vitePluginVueLayoutsNext } from './vite-plugin-vue-layouts-next/index.js';
|
|
163
|
+
import { default as vitePlus } from './vite-plus/index.js';
|
|
164
|
+
import { default as vitePwaAssetsGenerator } from './vite-pwa-assets-generator/index.js';
|
|
146
165
|
import { default as vitepress } from './vitepress/index.js';
|
|
147
166
|
import { default as vitest } from './vitest/index.js';
|
|
148
167
|
import { default as vue } from './vue/index.js';
|
|
@@ -184,12 +203,16 @@ export const Plugins = {
|
|
|
184
203
|
docusaurus,
|
|
185
204
|
dotenv,
|
|
186
205
|
drizzle,
|
|
206
|
+
'electron-vite': electronVite,
|
|
187
207
|
eleventy,
|
|
208
|
+
esbuild,
|
|
188
209
|
eslint,
|
|
210
|
+
eve,
|
|
189
211
|
execa,
|
|
190
212
|
expo,
|
|
191
213
|
'expressive-code': expressiveCode,
|
|
192
214
|
fast,
|
|
215
|
+
fumadocs,
|
|
193
216
|
gatsby,
|
|
194
217
|
'github-action': githubAction,
|
|
195
218
|
'github-actions': githubActions,
|
|
@@ -202,6 +225,7 @@ export const Plugins = {
|
|
|
202
225
|
karma,
|
|
203
226
|
knex,
|
|
204
227
|
ladle,
|
|
228
|
+
'laravel-vite-plugin': laravelVitePlugin,
|
|
205
229
|
lefthook,
|
|
206
230
|
'lint-staged': lintStaged,
|
|
207
231
|
linthtml,
|
|
@@ -229,6 +253,7 @@ export const Plugins = {
|
|
|
229
253
|
nodemon,
|
|
230
254
|
'npm-package-json-lint': npmPackageJsonLint,
|
|
231
255
|
nuxt,
|
|
256
|
+
'nuxtjs-i18n': nuxtjsI18n,
|
|
232
257
|
nx,
|
|
233
258
|
nyc,
|
|
234
259
|
oclif,
|
|
@@ -250,6 +275,7 @@ export const Plugins = {
|
|
|
250
275
|
preconstruct,
|
|
251
276
|
prettier,
|
|
252
277
|
prisma,
|
|
278
|
+
quasar,
|
|
253
279
|
qwik,
|
|
254
280
|
raycast,
|
|
255
281
|
'react-cosmos': reactCosmos,
|
|
@@ -288,6 +314,7 @@ export const Plugins = {
|
|
|
288
314
|
tailwind,
|
|
289
315
|
'tanstack-router': tanstackRouter,
|
|
290
316
|
taskfile,
|
|
317
|
+
tauri,
|
|
291
318
|
travis,
|
|
292
319
|
'ts-node': tsNode,
|
|
293
320
|
tsdown,
|
|
@@ -297,10 +324,21 @@ export const Plugins = {
|
|
|
297
324
|
typescript,
|
|
298
325
|
unbuild,
|
|
299
326
|
unocss,
|
|
327
|
+
'unplugin-auto-import': unpluginAutoImport,
|
|
328
|
+
'unplugin-icons': unpluginIcons,
|
|
329
|
+
'unplugin-vue-components': unpluginVueComponents,
|
|
330
|
+
'unplugin-vue-i18n': unpluginVueI18n,
|
|
331
|
+
'unplugin-vue-markdown': unpluginVueMarkdown,
|
|
332
|
+
'unplugin-vue-router': unpluginVueRouter,
|
|
300
333
|
vercel,
|
|
301
334
|
'vercel-og': vercelOg,
|
|
302
335
|
vike,
|
|
303
336
|
vite,
|
|
337
|
+
'vite-plugin-pages': vitePluginPages,
|
|
338
|
+
'vite-plugin-pwa': vitePluginPwa,
|
|
339
|
+
'vite-plugin-vue-layouts-next': vitePluginVueLayoutsNext,
|
|
340
|
+
'vite-plus': vitePlus,
|
|
341
|
+
'vite-pwa-assets-generator': vitePwaAssetsGenerator,
|
|
304
342
|
vitepress,
|
|
305
343
|
vitest,
|
|
306
344
|
vue,
|
|
@@ -3,6 +3,7 @@ import { _glob, _dirGlob } from '../../util/glob.js';
|
|
|
3
3
|
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
4
4
|
import { isInternal, join, normalize, toAbsolute } from '../../util/path.js';
|
|
5
5
|
import { hasDependency } from '../../util/plugin.js';
|
|
6
|
+
import { getDependenciesFromConfig } from '../babel/index.js';
|
|
6
7
|
import { getReportersDependencies, resolveExtensibleConfig } from './helpers.js';
|
|
7
8
|
const title = 'Jest';
|
|
8
9
|
const enablers = ['jest'];
|
|
@@ -11,6 +12,7 @@ const config = ['jest.config.{js,ts,mjs,cjs,mts,cts,json}', 'package.json'];
|
|
|
11
12
|
const mocks = ['**/__mocks__/**/*.[jt]s?(x)'];
|
|
12
13
|
const entry = ['**/__tests__/**/*.?(c|m)[jt]s?(x)', '**/?(*.)+(spec|test).?(c|m)[jt]s?(x)', ...mocks];
|
|
13
14
|
const rootDirRe = /<rootDir>/;
|
|
15
|
+
const isBabelJest = (transformer) => transformer[0] === 'babel-jest';
|
|
14
16
|
const resolveDependencies = async (config, rootDir, options) => {
|
|
15
17
|
const { configFileDir } = options;
|
|
16
18
|
if (config?.preset) {
|
|
@@ -46,9 +48,17 @@ const resolveDependencies = async (config, rootDir, options) => {
|
|
|
46
48
|
const resolvers = config.resolver ? [config.resolver] : [];
|
|
47
49
|
const reporters = getReportersDependencies(config, options);
|
|
48
50
|
const watchPlugins = config.watchPlugins?.map(watchPlugin => (typeof watchPlugin === 'string' ? watchPlugin : watchPlugin[0])) ?? [];
|
|
49
|
-
const transform =
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
const transform = [];
|
|
52
|
+
for (const transformer of config.transform ? Object.values(config.transform) : []) {
|
|
53
|
+
if (typeof transformer === 'string') {
|
|
54
|
+
transform.push(transformer);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
transform.push(transformer[0]);
|
|
58
|
+
if (isBabelJest(transformer))
|
|
59
|
+
transform.push(...getDependenciesFromConfig(transformer[1]));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
52
62
|
const moduleNameMapper = (config.moduleNameMapper
|
|
53
63
|
? Object.values(config.moduleNameMapper).map(mapper => (typeof mapper === 'string' ? mapper : mapper[0]))
|
|
54
64
|
: []).filter(value => !/\$[0-9]/.test(value));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { resolveFromAST } from './resolveFromAST.js';
|
|
3
|
+
const title = 'laravel-vite-plugin';
|
|
4
|
+
const enablers = ['laravel-vite-plugin'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const config = ['vite.config.{js,mjs,ts,cjs,mts,cts}'];
|
|
7
|
+
const plugin = {
|
|
8
|
+
title,
|
|
9
|
+
enablers,
|
|
10
|
+
isEnabled,
|
|
11
|
+
config,
|
|
12
|
+
resolveFromAST,
|
|
13
|
+
};
|
|
14
|
+
export default plugin;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { findImportedCalls, findProperty, getStringValues } from '../../typescript/ast-helpers.js';
|
|
2
|
+
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
3
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
4
|
+
import { join } from '../../util/path.js';
|
|
5
|
+
const enablers = ['laravel-vite-plugin'];
|
|
6
|
+
const addStringOrArray = (values, node) => {
|
|
7
|
+
const single = getStringValue(node);
|
|
8
|
+
if (single !== undefined)
|
|
9
|
+
values.add(single);
|
|
10
|
+
for (const value of getStringValues(node))
|
|
11
|
+
values.add(value);
|
|
12
|
+
};
|
|
13
|
+
export const resolveFromAST = (program, options) => {
|
|
14
|
+
const inputs = [];
|
|
15
|
+
for (const call of findImportedCalls(program, enablers)) {
|
|
16
|
+
const arg = call.arguments?.[0];
|
|
17
|
+
if (!arg)
|
|
18
|
+
continue;
|
|
19
|
+
const specifiers = new Set();
|
|
20
|
+
addStringOrArray(specifiers, arg);
|
|
21
|
+
addStringOrArray(specifiers, findProperty(arg, 'input'));
|
|
22
|
+
addStringOrArray(specifiers, findProperty(arg, 'ssr'));
|
|
23
|
+
for (const id of specifiers)
|
|
24
|
+
inputs.push(toProductionEntry(join(options.configFileDir, id)));
|
|
25
|
+
}
|
|
26
|
+
return inputs;
|
|
27
|
+
};
|