knip 6.45.1 → 6.46.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/README.md +42 -18
- package/dist/ConfigurationChief.d.ts +6 -0
- package/dist/ConfigurationChief.js +2 -2
- package/dist/DependencyDeputy.d.ts +12 -14
- package/dist/DependencyDeputy.js +33 -21
- package/dist/IssueCollector.d.ts +1 -0
- package/dist/IssueCollector.js +4 -1
- package/dist/PackagePeeker.d.ts +0 -9
- package/dist/PackagePeeker.js +0 -38
- package/dist/ProjectPrincipal.d.ts +1 -1
- package/dist/ProjectPrincipal.js +3 -1
- package/dist/WorkspaceWorker.js +7 -7
- package/dist/binaries/bash-parser.js +5 -8
- package/dist/binaries/command.js +2 -2
- package/dist/binaries/fallback.d.ts +5 -1
- package/dist/binaries/fallback.js +41 -10
- package/dist/binaries/plugins.d.ts +1 -0
- package/dist/binaries/plugins.js +75 -39
- package/dist/binaries/resolvers/bun.js +2 -2
- package/dist/binaries/resolvers/npm.js +2 -2
- package/dist/binaries/resolvers/npx.js +2 -2
- package/dist/binaries/resolvers/nub.js +2 -2
- package/dist/binaries/resolvers/pnpm.js +29 -21
- package/dist/binaries/resolvers/pnpx.js +20 -8
- package/dist/binaries/resolvers/vp.js +1 -1
- package/dist/binaries/resolvers/yarn.js +1 -1
- package/dist/binaries/util.d.ts +4 -1
- package/dist/binaries/util.js +10 -13
- package/dist/constants.js +18 -0
- package/dist/graph/SubpathReferences.d.ts +1 -1
- package/dist/graph/SubpathReferences.js +4 -3
- package/dist/graph/build.js +11 -12
- package/dist/plugins/_template/index.js +2 -2
- package/dist/plugins/angular/index.js +3 -8
- package/dist/plugins/astro/resolveFromAST.js +2 -2
- package/dist/plugins/astro-markdoc/index.js +2 -2
- package/dist/plugins/aws-cdk/index.js +3 -3
- package/dist/plugins/babel/index.js +5 -3
- package/dist/plugins/borp/index.js +2 -2
- package/dist/plugins/bun/index.js +3 -3
- package/dist/plugins/capacitor/index.js +33 -6
- package/dist/plugins/capacitor/types.d.ts +10 -0
- package/dist/plugins/changesets/index.js +2 -2
- package/dist/plugins/commitizen/index.js +2 -2
- package/dist/plugins/commitlint/index.js +2 -2
- package/dist/plugins/convex/index.js +2 -2
- package/dist/plugins/cspell/index.js +2 -2
- package/dist/plugins/cucumber/index.js +2 -2
- package/dist/plugins/cypress/index.js +3 -3
- package/dist/plugins/docusaurus/helpers.js +4 -4
- package/dist/plugins/docusaurus/index.js +3 -3
- package/dist/plugins/dotenv/index.js +6 -2
- package/dist/plugins/drizzle/index.js +2 -2
- package/dist/plugins/electron-builder/index.d.ts +3 -0
- package/dist/plugins/electron-builder/index.js +61 -0
- package/dist/plugins/electron-forge/index.js +2 -2
- package/dist/plugins/electron-vite/index.js +4 -3
- package/dist/plugins/electron-vite/types.d.ts +3 -0
- package/dist/plugins/eleventy/index.js +2 -2
- package/dist/plugins/ember/compiler.d.ts +2 -0
- package/dist/plugins/ember/compiler.js +14 -0
- package/dist/plugins/ember/index.d.ts +6 -0
- package/dist/plugins/ember/index.js +160 -0
- package/dist/plugins/ember/types.d.ts +13 -0
- package/dist/plugins/ember/types.js +1 -0
- package/dist/plugins/ember/visitors/importSync.d.ts +2 -0
- package/dist/plugins/ember/visitors/importSync.js +32 -0
- package/dist/plugins/ember-template-lint/index.d.ts +3 -0
- package/dist/plugins/ember-template-lint/index.js +20 -0
- package/dist/plugins/env-cmd/index.d.ts +3 -0
- package/dist/plugins/env-cmd/index.js +16 -0
- package/dist/plugins/esbuild/index.js +2 -2
- package/dist/plugins/eslint/helpers.js +6 -6
- package/dist/plugins/eslint/index.js +0 -1
- package/dist/plugins/eslint/resolveFromAST.js +11 -3
- package/dist/plugins/evalite/index.js +2 -2
- package/dist/plugins/expo/helpers.js +10 -10
- package/dist/plugins/expo-router/index.js +3 -3
- package/dist/plugins/filesystem-routing/index.js +4 -4
- package/dist/plugins/flue/index.js +4 -4
- package/dist/plugins/gatsby/index.js +3 -3
- package/dist/plugins/github-action/index.js +2 -2
- package/dist/plugins/github-actions/index.js +2 -2
- package/dist/plugins/graphql-codegen/index.js +8 -6
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.js +12 -0
- package/dist/plugins/jasmine/index.js +3 -4
- package/dist/plugins/jest/index.js +3 -3
- package/dist/plugins/karma/helpers.js +2 -2
- package/dist/plugins/karma/index.js +5 -1
- package/dist/plugins/knex/index.js +13 -7
- package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
- package/dist/plugins/linthtml/index.js +2 -2
- package/dist/plugins/lunaria/index.js +3 -3
- package/dist/plugins/maestro/index.d.ts +3 -0
- package/dist/plugins/maestro/index.js +54 -0
- package/dist/plugins/maestro/types.d.ts +21 -0
- package/dist/plugins/maestro/types.js +1 -0
- package/dist/plugins/markdownlint/index.js +3 -3
- package/dist/plugins/marko/index.js +4 -4
- package/dist/plugins/mastra/index.js +3 -3
- package/dist/plugins/mdx/index.js +3 -3
- package/dist/plugins/mdxlint/index.js +2 -2
- package/dist/plugins/metro/index.js +5 -5
- package/dist/plugins/mikro-orm/index.js +3 -4
- package/dist/plugins/mise/scripts.js +2 -3
- package/dist/plugins/mocha/index.js +8 -7
- package/dist/plugins/netlify/index.js +3 -3
- package/dist/plugins/next/index.js +5 -5
- package/dist/plugins/next-mdx/resolveFromAST.js +2 -2
- package/dist/plugins/nitro/index.js +4 -4
- package/dist/plugins/node/index.d.ts +16 -0
- package/dist/plugins/node/index.js +89 -23
- package/dist/plugins/nodemon/index.js +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +2 -2
- package/dist/plugins/nuxt/index.js +16 -14
- package/dist/plugins/nx/index.js +3 -3
- package/dist/plugins/nyc/index.js +39 -2
- package/dist/plugins/oclif/index.js +2 -2
- package/dist/plugins/openclaw/index.js +5 -5
- package/dist/plugins/oxlint/index.js +2 -2
- package/dist/plugins/panda-css/index.js +2 -2
- package/dist/plugins/parcel/index.js +2 -2
- package/dist/plugins/payload/index.js +3 -3
- package/dist/plugins/playwright/index.js +4 -4
- package/dist/plugins/pm2/index.js +2 -2
- package/dist/plugins/pnpm/index.js +1 -1
- package/dist/plugins/postcss/index.js +2 -2
- package/dist/plugins/preconstruct/index.js +2 -2
- package/dist/plugins/prettier/index.js +4 -3
- package/dist/plugins/prisma/index.js +5 -5
- package/dist/plugins/quasar/resolveFromAST.js +6 -6
- package/dist/plugins/qwik/resolveFromAST.js +3 -3
- package/dist/plugins/raycast/index.js +2 -2
- package/dist/plugins/react-cosmos/index.js +2 -2
- package/dist/plugins/react-router/index.js +6 -6
- package/dist/plugins/relay/index.js +3 -3
- package/dist/plugins/release-it/index.js +2 -5
- package/dist/plugins/remark/helpers.js +2 -2
- package/dist/plugins/retry-cli/index.js +0 -1
- package/dist/plugins/rolldown/index.js +2 -2
- package/dist/plugins/rollup/index.js +2 -2
- package/dist/plugins/rsbuild/index.js +3 -3
- package/dist/plugins/rslib/index.js +2 -2
- package/dist/plugins/rslint/index.d.ts +3 -0
- package/dist/plugins/rslint/index.js +16 -0
- package/dist/plugins/rspack/index.js +4 -0
- package/dist/plugins/rstest/index.js +4 -4
- package/dist/plugins/semantic-release/index.js +2 -2
- package/dist/plugins/serverless-framework/index.js +4 -4
- package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +3 -3
- package/dist/plugins/sst/resolveFromAST.js +2 -2
- package/dist/plugins/starlight/resolveFromAST.js +3 -3
- package/dist/plugins/stencil/resolveFromAST.js +5 -5
- package/dist/plugins/storybook/index.js +2 -2
- package/dist/plugins/stryker/index.js +2 -2
- package/dist/plugins/stylelint/index.js +4 -4
- package/dist/plugins/sveltekit/resolveFromAST.js +7 -5
- package/dist/plugins/swc/index.js +2 -2
- package/dist/plugins/tailwind/index.js +3 -2
- package/dist/plugins/tanstack-router/index.js +5 -2
- package/dist/plugins/textlint/helpers.js +2 -2
- package/dist/plugins/ts-node/index.js +23 -6
- package/dist/plugins/tsd/index.js +1 -1
- package/dist/plugins/tsdown/index.js +4 -4
- package/dist/plugins/tsup/index.js +3 -3
- package/dist/plugins/tsx/index.js +4 -3
- package/dist/plugins/turbo/index.js +2 -2
- package/dist/plugins/typedoc/index.js +4 -3
- package/dist/plugins/typescript/index.js +4 -4
- package/dist/plugins/varlock/scan.js +6 -3
- package/dist/plugins/vite/helpers.js +2 -2
- package/dist/plugins/vite-plugin-pages/index.js +2 -2
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
- package/dist/plugins/vite-plugin-vue-layouts-next/index.js +2 -2
- package/dist/plugins/vitest/index.js +14 -18
- package/dist/plugins/webdriver-io/index.js +13 -1
- package/dist/plugins/webpack/index.js +5 -8
- package/dist/plugins/wrangler/index.js +3 -3
- package/dist/plugins/wxt/index.js +2 -2
- package/dist/plugins/yarn/index.js +5 -5
- package/dist/session/incremental.d.ts +1 -1
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +6 -0
- package/dist/types/args.d.ts +4 -3
- package/dist/types/config.d.ts +2 -0
- package/dist/types/module-graph.d.ts +1 -1
- package/dist/types/package-json.d.ts +1 -0
- package/dist/types/workspace.d.ts +10 -8
- package/dist/typescript/ast-nodes.js +4 -5
- package/dist/typescript/get-imports-and-exports.js +5 -2
- package/dist/typescript/visitors/exports.js +6 -32
- package/dist/typescript/visitors/imports.d.ts +1 -1
- package/dist/typescript/visitors/imports.js +15 -24
- package/dist/typescript/visitors/walk.d.ts +5 -0
- package/dist/typescript/visitors/walk.js +75 -30
- package/dist/util/codeowners.js +4 -1
- package/dist/util/input.d.ts +3 -6
- package/dist/util/input.js +6 -20
- package/dist/util/parse-and-convert-gitignores.js +5 -4
- package/dist/util/parse-args.d.ts +2 -1
- package/dist/util/parse-args.js +13 -3
- package/dist/util/plugin.js +6 -4
- package/dist/util/watch.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +36 -5
package/dist/plugins/index.js
CHANGED
|
@@ -29,9 +29,13 @@ import { default as dependencyCruiser } from './dependency-cruiser/index.js';
|
|
|
29
29
|
import { default as docusaurus } from './docusaurus/index.js';
|
|
30
30
|
import { default as dotenv } from './dotenv/index.js';
|
|
31
31
|
import { default as drizzle } from './drizzle/index.js';
|
|
32
|
+
import { default as electronBuilder } from './electron-builder/index.js';
|
|
32
33
|
import { default as electronForge } from './electron-forge/index.js';
|
|
33
34
|
import { default as electronVite } from './electron-vite/index.js';
|
|
34
35
|
import { default as eleventy } from './eleventy/index.js';
|
|
36
|
+
import { default as ember } from './ember/index.js';
|
|
37
|
+
import { default as emberTemplateLint } from './ember-template-lint/index.js';
|
|
38
|
+
import { default as envCmd } from './env-cmd/index.js';
|
|
35
39
|
import { default as esbuild } from './esbuild/index.js';
|
|
36
40
|
import { default as eslint } from './eslint/index.js';
|
|
37
41
|
import { default as evalite } from './evalite/index.js';
|
|
@@ -67,6 +71,7 @@ import { default as lit } from './lit/index.js';
|
|
|
67
71
|
import { default as lockfileLint } from './lockfile-lint/index.js';
|
|
68
72
|
import { default as lostPixel } from './lost-pixel/index.js';
|
|
69
73
|
import { default as lunaria } from './lunaria/index.js';
|
|
74
|
+
import { default as maestro } from './maestro/index.js';
|
|
70
75
|
import { default as markdownlint } from './markdownlint/index.js';
|
|
71
76
|
import { default as marko } from './marko/index.js';
|
|
72
77
|
import { default as mastra } from './mastra/index.js';
|
|
@@ -135,6 +140,7 @@ import { default as rolldown } from './rolldown/index.js';
|
|
|
135
140
|
import { default as rollup } from './rollup/index.js';
|
|
136
141
|
import { default as rsbuild } from './rsbuild/index.js';
|
|
137
142
|
import { default as rslib } from './rslib/index.js';
|
|
143
|
+
import { default as rslint } from './rslint/index.js';
|
|
138
144
|
import { default as rspack } from './rspack/index.js';
|
|
139
145
|
import { default as rstest } from './rstest/index.js';
|
|
140
146
|
import { default as sanity } from './sanity/index.js';
|
|
@@ -237,9 +243,13 @@ export const Plugins = {
|
|
|
237
243
|
docusaurus,
|
|
238
244
|
dotenv,
|
|
239
245
|
drizzle,
|
|
246
|
+
'electron-builder': electronBuilder,
|
|
240
247
|
'electron-forge': electronForge,
|
|
241
248
|
'electron-vite': electronVite,
|
|
242
249
|
eleventy,
|
|
250
|
+
ember,
|
|
251
|
+
'ember-template-lint': emberTemplateLint,
|
|
252
|
+
'env-cmd': envCmd,
|
|
243
253
|
esbuild,
|
|
244
254
|
eslint,
|
|
245
255
|
evalite,
|
|
@@ -275,6 +285,7 @@ export const Plugins = {
|
|
|
275
285
|
'lockfile-lint': lockfileLint,
|
|
276
286
|
'lost-pixel': lostPixel,
|
|
277
287
|
lunaria,
|
|
288
|
+
maestro,
|
|
278
289
|
markdownlint,
|
|
279
290
|
marko,
|
|
280
291
|
mastra,
|
|
@@ -343,6 +354,7 @@ export const Plugins = {
|
|
|
343
354
|
rollup,
|
|
344
355
|
rsbuild,
|
|
345
356
|
rslib,
|
|
357
|
+
rslint,
|
|
346
358
|
rspack,
|
|
347
359
|
rstest,
|
|
348
360
|
sanity,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toEntry } from '../../util/input.js';
|
|
2
2
|
import { toAbsolute } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Jasmine';
|
|
@@ -22,15 +22,14 @@ const resolveConfig = (localConfig, options) => {
|
|
|
22
22
|
for (const id of [...specFiles, ...helpers])
|
|
23
23
|
inputs.push(toEntry(id));
|
|
24
24
|
for (const id of requires)
|
|
25
|
-
inputs.push(
|
|
25
|
+
inputs.push(toModule(id, { dir: options.cwd }));
|
|
26
26
|
if (localConfig.loader)
|
|
27
|
-
inputs.push(
|
|
27
|
+
inputs.push(toModule(localConfig.loader, { dir: options.cwd }));
|
|
28
28
|
return inputs;
|
|
29
29
|
};
|
|
30
30
|
const commands = new Set(['init', 'examples', 'help', 'version']);
|
|
31
31
|
const args = {
|
|
32
32
|
boolean: ['color', 'fail-fast', 'list-not-applicable', 'no-color'],
|
|
33
|
-
string: ['config', 'reporter', 'require'],
|
|
34
33
|
config: ['config'],
|
|
35
34
|
resolve: ['require', 'reporter'],
|
|
36
35
|
resolveInputs: (parsed) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { arrayify } from '../../util/array.js';
|
|
2
2
|
import { _glob } from '../../util/glob.js';
|
|
3
|
-
import { toConfig,
|
|
3
|
+
import { toConfig, toModule, toDependency, toEntry } from '../../util/input.js';
|
|
4
4
|
import { extname, isInternal, join, normalize, toAbsolute } from '../../util/path.js';
|
|
5
5
|
import { hasDependency } from '../../util/plugin.js';
|
|
6
6
|
import { getDependenciesFromConfig } from '../babel/index.js';
|
|
@@ -55,7 +55,7 @@ const resolveDependencies = async (config, rootDir, options) => {
|
|
|
55
55
|
environments.push(toDependency('jest-environment-jsdom'));
|
|
56
56
|
}
|
|
57
57
|
else if (config.testEnvironment) {
|
|
58
|
-
environments.push(
|
|
58
|
+
environments.push(toModule(resolveWithPrefix('jest-environment-', config.testEnvironment, rootDir)));
|
|
59
59
|
}
|
|
60
60
|
const resolvers = config.resolver ? [config.resolver] : [];
|
|
61
61
|
const reporters = getReportersDependencies(config, options);
|
|
@@ -107,7 +107,7 @@ const resolveDependencies = async (config, rootDir, options) => {
|
|
|
107
107
|
...testSequencer,
|
|
108
108
|
...globalSetup,
|
|
109
109
|
...globalTeardown,
|
|
110
|
-
].map(id => (typeof id === 'string' ?
|
|
110
|
+
].map(id => (typeof id === 'string' ? toModule(id) : id));
|
|
111
111
|
};
|
|
112
112
|
const resolveConfig = async (localConfig, options) => {
|
|
113
113
|
const { configFileDir } = options;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntryPath, toDependency } from '../../util/input.js';
|
|
2
2
|
import { isInternal } from '../../util/path.js';
|
|
3
3
|
export const configFiles = ['karma.conf.js', 'karma.conf.ts', '.config/karma.conf.js', '.config/karma.conf.ts'];
|
|
4
4
|
export const inputsFromFrameworks = (frameworks) => frameworks.map(framework => {
|
|
@@ -13,7 +13,7 @@ export const inputsFromPlugins = (plugins, devDependencies) => {
|
|
|
13
13
|
.map(plugin => {
|
|
14
14
|
if (typeof plugin !== 'string')
|
|
15
15
|
return;
|
|
16
|
-
return isInternal(plugin) ?
|
|
16
|
+
return isInternal(plugin) ? toEntryPath(plugin) : toDependency(plugin);
|
|
17
17
|
})
|
|
18
18
|
.filter((input) => !!input);
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toEntry } from '../../util/input.js';
|
|
1
|
+
import { toConfig, toEntry } from '../../util/input.js';
|
|
2
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';
|
|
@@ -31,11 +31,15 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
31
31
|
}
|
|
32
32
|
return Array.from(inputs);
|
|
33
33
|
};
|
|
34
|
+
const args = {
|
|
35
|
+
resolveInputs: parsed => (parsed._[0] === 'start' && parsed._[1] ? [toConfig('karma', parsed._[1])] : []),
|
|
36
|
+
};
|
|
34
37
|
const plugin = {
|
|
35
38
|
title,
|
|
36
39
|
enablers,
|
|
37
40
|
isEnabled,
|
|
38
41
|
config,
|
|
39
42
|
resolveConfig,
|
|
43
|
+
args,
|
|
40
44
|
};
|
|
41
45
|
export default plugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { toEntry,
|
|
1
|
+
import { toConfig, toEntry, toDependency } from '../../util/input.js';
|
|
2
|
+
import { toAbsolute } from '../../util/path.js';
|
|
2
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
4
|
import { clientToPackages } from './helpers.js';
|
|
4
5
|
import { createKnexClientVisitor } from './visitors/clientCall.js';
|
|
@@ -6,31 +7,35 @@ const title = 'Knex';
|
|
|
6
7
|
const enablers = ['knex'];
|
|
7
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
9
|
const config = ['knexfile.{js,cjs,mjs,ts,cts,mts}'];
|
|
9
|
-
const processKnexConfig = (config) => {
|
|
10
|
+
const processKnexConfig = (config, dir) => {
|
|
10
11
|
const inputs = [];
|
|
11
12
|
if (config.client) {
|
|
12
13
|
const packages = clientToPackages(config.client);
|
|
13
|
-
inputs.push(...packages.map(pkg =>
|
|
14
|
+
inputs.push(...packages.map(pkg => toDependency(pkg, { production: true, optional: true })));
|
|
14
15
|
}
|
|
15
16
|
if (config.migrations?.directory) {
|
|
16
17
|
const dirs = Array.isArray(config.migrations.directory)
|
|
17
18
|
? config.migrations.directory
|
|
18
19
|
: [config.migrations.directory];
|
|
19
|
-
inputs.push(...dirs.map(
|
|
20
|
+
inputs.push(...dirs.map(directory => toEntry(`${directory}/*.{js,ts}`, { dir })));
|
|
20
21
|
}
|
|
21
22
|
if (config.seeds?.directory) {
|
|
22
23
|
const dirs = Array.isArray(config.seeds.directory) ? config.seeds.directory : [config.seeds.directory];
|
|
23
|
-
inputs.push(...dirs.map(
|
|
24
|
+
inputs.push(...dirs.map(directory => toEntry(`${directory}/*.{js,ts}`, { dir })));
|
|
24
25
|
}
|
|
25
26
|
return inputs;
|
|
26
27
|
};
|
|
27
|
-
const resolveConfig = config => {
|
|
28
|
+
const resolveConfig = (config, { configFileDir }) => {
|
|
28
29
|
const configs = 'client' in config && config.client ? [config] : Object.values(config);
|
|
29
|
-
return configs.flatMap(cfg => (typeof cfg === 'object' && cfg !== null ? processKnexConfig(cfg) : []));
|
|
30
|
+
return configs.flatMap(cfg => (typeof cfg === 'object' && cfg !== null ? processKnexConfig(cfg, configFileDir) : []));
|
|
30
31
|
};
|
|
31
32
|
const registerVisitors = ({ ctx, registerVisitor }) => {
|
|
32
33
|
registerVisitor(createKnexClientVisitor(ctx));
|
|
33
34
|
};
|
|
35
|
+
const args = {
|
|
36
|
+
string: ['cwd', 'knexfile'],
|
|
37
|
+
resolveInputs: (parsed, { cwd }) => parsed.knexfile ? [toConfig('knex', parsed.knexfile, { dir: parsed.cwd ? toAbsolute(parsed.cwd, cwd) : cwd })] : [],
|
|
38
|
+
};
|
|
34
39
|
const plugin = {
|
|
35
40
|
title,
|
|
36
41
|
enablers,
|
|
@@ -38,5 +43,6 @@ const plugin = {
|
|
|
38
43
|
config,
|
|
39
44
|
resolveConfig,
|
|
40
45
|
registerVisitors,
|
|
46
|
+
args,
|
|
41
47
|
};
|
|
42
48
|
export default plugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findImportedCalls, findProperty, getStringValues } from '../../typescript/ast-helpers.js';
|
|
2
2
|
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
3
|
-
import {
|
|
3
|
+
import { toEntryPath } from '../../util/input.js';
|
|
4
4
|
import { join } from '../../util/path.js';
|
|
5
5
|
const enablers = ['laravel-vite-plugin'];
|
|
6
6
|
const addStringOrArray = (values, node) => {
|
|
@@ -21,7 +21,7 @@ export const resolveFromAST = (program, options) => {
|
|
|
21
21
|
addStringOrArray(specifiers, findProperty(arg, 'input'));
|
|
22
22
|
addStringOrArray(specifiers, findProperty(arg, 'ssr'));
|
|
23
23
|
for (const id of specifiers)
|
|
24
|
-
inputs.push(
|
|
24
|
+
inputs.push(toEntryPath(join(options.configFileDir, id), { production: true }));
|
|
25
25
|
}
|
|
26
26
|
return inputs;
|
|
27
27
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'LintHTML';
|
|
@@ -9,7 +9,7 @@ const config = ['package.json', ...toCosmiconfig('linthtml')];
|
|
|
9
9
|
const resolveConfig = config => {
|
|
10
10
|
const extensions = config.extends ?? [];
|
|
11
11
|
const plugins = config.plugins ?? [];
|
|
12
|
-
return [extensions, plugins].flat().map(id =>
|
|
12
|
+
return [extensions, plugins].flat().map(id => toModule(id));
|
|
13
13
|
};
|
|
14
14
|
const plugin = {
|
|
15
15
|
title,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toAbsolute } from '../../util/path.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toEntryPath, toEntry } from '../../util/input.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Lunaria';
|
|
5
5
|
const enablers = ['@lunariajs/core', '@lunariajs/starlight'];
|
|
@@ -14,8 +14,8 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
14
14
|
const favicon = localConfig.dashboard?.favicon?.inline ? [localConfig.dashboard.favicon.inline] : [];
|
|
15
15
|
const baseDir = options.configFileDir;
|
|
16
16
|
return [
|
|
17
|
-
...files.map(id =>
|
|
18
|
-
...[...renderer, ...customCss, ...favicon].map(id =>
|
|
17
|
+
...files.map(id => toEntry(toAbsolute(id, baseDir), { production: true })),
|
|
18
|
+
...[...renderer, ...customCss, ...favicon].map(id => toEntryPath(toAbsolute(id, baseDir), { production: true })),
|
|
19
19
|
];
|
|
20
20
|
};
|
|
21
21
|
const args = {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isDirectory } from '../../util/fs.js';
|
|
2
|
+
import { toConfig, toEntryPath } from '../../util/input.js';
|
|
3
|
+
const title = 'Maestro';
|
|
4
|
+
const enablers = 'This plugin is enabled when a `.maestro` folder is found.';
|
|
5
|
+
const isEnabled = ({ cwd }) => isDirectory(cwd, '.maestro');
|
|
6
|
+
const config = ['.maestro/**/*.{yaml,yml}'];
|
|
7
|
+
const parseConfig = async (source) => {
|
|
8
|
+
const { parseAllDocuments } = await import('yaml');
|
|
9
|
+
return parseAllDocuments(source, { logLevel: 'error' }).map(document => {
|
|
10
|
+
if (document.errors.length > 0)
|
|
11
|
+
throw document.errors[0];
|
|
12
|
+
return document.toJS();
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const getFile = (value) => (typeof value === 'string' ? value : value?.file);
|
|
16
|
+
const addInputs = (commands, inputs) => {
|
|
17
|
+
if (!Array.isArray(commands))
|
|
18
|
+
return;
|
|
19
|
+
for (const command of commands) {
|
|
20
|
+
if (!command || typeof command !== 'object')
|
|
21
|
+
continue;
|
|
22
|
+
const script = getFile(command.runScript);
|
|
23
|
+
if (typeof script === 'string')
|
|
24
|
+
inputs.push(toEntryPath(script));
|
|
25
|
+
for (const nested of [command.runFlow, command.retry]) {
|
|
26
|
+
const flow = getFile(nested);
|
|
27
|
+
if (typeof flow === 'string')
|
|
28
|
+
inputs.push(toConfig('maestro', flow));
|
|
29
|
+
}
|
|
30
|
+
for (const nested of [command.runFlow, command.repeat, command.retry]) {
|
|
31
|
+
if (nested && typeof nested === 'object')
|
|
32
|
+
addInputs(nested.commands, inputs);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const resolveConfig = config => {
|
|
37
|
+
const inputs = [];
|
|
38
|
+
if (config.length === 2) {
|
|
39
|
+
const [header, commands] = config;
|
|
40
|
+
addInputs(header?.onFlowStart, inputs);
|
|
41
|
+
addInputs(header?.onFlowComplete, inputs);
|
|
42
|
+
addInputs(commands, inputs);
|
|
43
|
+
}
|
|
44
|
+
return inputs;
|
|
45
|
+
};
|
|
46
|
+
const plugin = {
|
|
47
|
+
title,
|
|
48
|
+
enablers,
|
|
49
|
+
isEnabled,
|
|
50
|
+
config,
|
|
51
|
+
parseConfig,
|
|
52
|
+
resolveConfig,
|
|
53
|
+
};
|
|
54
|
+
export default plugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type File = string | {
|
|
2
|
+
file?: string;
|
|
3
|
+
};
|
|
4
|
+
type Commands = {
|
|
5
|
+
file?: string;
|
|
6
|
+
commands?: Command[];
|
|
7
|
+
};
|
|
8
|
+
export type Command = string | {
|
|
9
|
+
runScript?: File;
|
|
10
|
+
runFlow?: string | Commands;
|
|
11
|
+
repeat?: {
|
|
12
|
+
commands?: Command[];
|
|
13
|
+
};
|
|
14
|
+
retry?: Commands;
|
|
15
|
+
};
|
|
16
|
+
type Header = {
|
|
17
|
+
onFlowStart?: Command[];
|
|
18
|
+
onFlowComplete?: Command[];
|
|
19
|
+
};
|
|
20
|
+
export type MaestroConfig = [Header?, Command[]?];
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toDependency } from '../../util/input.js';
|
|
2
2
|
import { isInternal } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { getArgumentValues } from './helpers.js';
|
|
@@ -37,10 +37,10 @@ const resolveConfig = (config, options) => {
|
|
|
37
37
|
.filter(script => script.includes('markdownlint ') || script.includes('markdownlint-cli2 '))
|
|
38
38
|
.flatMap(script => getArgumentValues(script, / (--rules|-r)[ =]([^ ]+)/g));
|
|
39
39
|
return [
|
|
40
|
-
...dependencies.filter(id => !isBundled(id)).map(id => (isInternal(id) ?
|
|
40
|
+
...dependencies.filter(id => !isBundled(id)).map(id => (isInternal(id) ? toModule(id) : toDependency(id))),
|
|
41
41
|
...uses
|
|
42
42
|
.filter(id => !isBundled(id))
|
|
43
|
-
.map(id => (isInternal(id) ?
|
|
43
|
+
.map(id => (isInternal(id) ? toModule(id, { dir: options.cwd }) : toDependency(id))),
|
|
44
44
|
];
|
|
45
45
|
};
|
|
46
46
|
const plugin = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toEntry } from '../../util/input.js';
|
|
2
2
|
import { join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { createCompiler } from './compiler.js';
|
|
@@ -30,16 +30,16 @@ const tagDefFields = [
|
|
|
30
30
|
];
|
|
31
31
|
const resolveConfig = (localConfig, options) => {
|
|
32
32
|
const { configFileName, configFileDir } = options;
|
|
33
|
-
const inputs = production.map(pattern =>
|
|
33
|
+
const inputs = production.map(pattern => toEntry(pattern, { production: true }));
|
|
34
34
|
if (!localConfig)
|
|
35
35
|
return inputs;
|
|
36
36
|
if (configFileName === 'marko.json') {
|
|
37
|
-
return tagProduction.map(pattern =>
|
|
37
|
+
return tagProduction.map(pattern => toEntry(join(configFileDir, pattern), { production: true }));
|
|
38
38
|
}
|
|
39
39
|
for (const field of tagDefFields) {
|
|
40
40
|
for (const id of [localConfig[field]].flat()) {
|
|
41
41
|
if (typeof id === 'string')
|
|
42
|
-
inputs.push(
|
|
42
|
+
inputs.push(toModule(id));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return inputs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from '../../util/path.js';
|
|
2
2
|
import { isDirectory } from '../../util/fs.js';
|
|
3
|
-
import {
|
|
3
|
+
import { toEntry } from '../../util/input.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
const title = 'Mastra';
|
|
6
6
|
const enablers = ['mastra'];
|
|
@@ -33,7 +33,7 @@ const args = {
|
|
|
33
33
|
const inputs = [];
|
|
34
34
|
if (parsed.dir) {
|
|
35
35
|
for (const pattern of getProductionPatterns(parsed.dir))
|
|
36
|
-
inputs.push(
|
|
36
|
+
inputs.push(toEntry(pattern, { production: true }));
|
|
37
37
|
}
|
|
38
38
|
if (parsed.tools) {
|
|
39
39
|
for (const tool of String(parsed.tools).split(',')) {
|
|
@@ -41,7 +41,7 @@ const args = {
|
|
|
41
41
|
if (!specifier)
|
|
42
42
|
continue;
|
|
43
43
|
const pattern = isDirectory(join(cwd, specifier)) ? `${specifier}/index.${extensions}` : specifier;
|
|
44
|
-
inputs.push(
|
|
44
|
+
inputs.push(toEntry(pattern, { production: true }));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
return inputs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toEntryPath, toDependency } from '../../util/input.js';
|
|
2
2
|
import { isInternal } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'MDX';
|
|
@@ -20,8 +20,8 @@ const takeDependencies = (plugins) => {
|
|
|
20
20
|
export const contentMappers = ['mdx-content-mapper', '@mdx-js/content-mapper'];
|
|
21
21
|
const bundledPlugins = ['remark-mdx-frontmatter'];
|
|
22
22
|
export const toProviderInput = (provider, dir) => isInternal(provider) || provider.startsWith('#')
|
|
23
|
-
?
|
|
24
|
-
:
|
|
23
|
+
? toEntryPath(provider, { production: true })
|
|
24
|
+
: toModule(provider, { dir, production: true });
|
|
25
25
|
export const resolveContentMapperOptions = (options, dir) => {
|
|
26
26
|
const inputs = takeDependencies(options.remarkPlugins).filter(input => !bundledPlugins.includes(input.specifier));
|
|
27
27
|
const provider = options.providerImportSource;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toDependency } from '../../util/input.js';
|
|
2
2
|
import { isInternal } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'mdxlint';
|
|
@@ -18,7 +18,7 @@ const resolveConfig = config => {
|
|
|
18
18
|
if (typeof id !== 'string')
|
|
19
19
|
continue;
|
|
20
20
|
if (isInternal(id))
|
|
21
|
-
inputs.push(
|
|
21
|
+
inputs.push(toModule(id));
|
|
22
22
|
else
|
|
23
23
|
inputs.push(toDependency(toPluginName(id)));
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compact } from '../../util/array.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toModule, toEntry } from '../../util/input.js';
|
|
3
3
|
import { join } from '../../util/path.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
const title = 'Metro';
|
|
@@ -24,14 +24,14 @@ const resolveConfig = async (config) => {
|
|
|
24
24
|
const sourceExts = config.resolver?.sourceExts ?? DEFAULT_EXTENSIONS;
|
|
25
25
|
const pattern = `src/**/*.{${platformEntryPatterns.join(',')}}.{${sourceExts.join(',')}}`;
|
|
26
26
|
if (!config.projectRoot) {
|
|
27
|
-
i.add(
|
|
27
|
+
i.add(toEntry(pattern, { production: true }));
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
const entryFilePattern = 'index.{js,jsx,ts,tsx}';
|
|
31
31
|
const entryFilePath = join(config.projectRoot, entryFilePattern);
|
|
32
32
|
const entryFilePaths = join(config.projectRoot, pattern);
|
|
33
|
-
i.add(
|
|
34
|
-
i.add(
|
|
33
|
+
i.add(toEntry(entryFilePath, { production: true }));
|
|
34
|
+
i.add(toEntry(entryFilePaths, { production: true }));
|
|
35
35
|
}
|
|
36
36
|
if (transformerPath)
|
|
37
37
|
inputs.push(transformerPath);
|
|
@@ -41,7 +41,7 @@ const resolveConfig = async (config) => {
|
|
|
41
41
|
inputs.push(transformer.minifierPath);
|
|
42
42
|
if (transformer?.babelTransformerPath)
|
|
43
43
|
inputs.push(transformer.babelTransformerPath);
|
|
44
|
-
return Array.from(i).concat(Array.from(inputs, id =>
|
|
44
|
+
return Array.from(i).concat(Array.from(inputs, id => toModule(id, {
|
|
45
45
|
optional: id === DEFAULT_TRANSFORMER_PACKAGE || id === DEFAULT_MINIFIER_PACKAGE,
|
|
46
46
|
})));
|
|
47
47
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toConfig,
|
|
1
|
+
import { toConfig, toEntry } from '../../util/input.js';
|
|
2
2
|
import { join, toAbsolute } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'MikroORM';
|
|
@@ -28,9 +28,9 @@ const toEntityEntry = (specifier, extensions, baseDir) => {
|
|
|
28
28
|
const hasPattern = entitySpecialRegex.test(specifier);
|
|
29
29
|
const hasExtension = entityFileExtensionRegex.test(specifier);
|
|
30
30
|
const pattern = hasPattern || hasExtension ? specifier : join(specifier, `**/*.{${extensions}}`);
|
|
31
|
-
return
|
|
31
|
+
return toEntry(toAbsolute(pattern, baseDir), { production: true });
|
|
32
32
|
};
|
|
33
|
-
const toFolderEntries = (paths, glob, baseDir) => paths.map(path =>
|
|
33
|
+
const toFolderEntries = (paths, glob, baseDir) => paths.map(path => toEntry(toAbsolute(join(path, glob), baseDir), { production: true }));
|
|
34
34
|
const resolveConfig = async (config, options) => {
|
|
35
35
|
if (options.configFileName === 'package.json') {
|
|
36
36
|
if (!isMikroOrmPackageJson(config))
|
|
@@ -64,7 +64,6 @@ const resolveConfig = async (config, options) => {
|
|
|
64
64
|
const args = {
|
|
65
65
|
binaries: ['mikro-orm'],
|
|
66
66
|
config: true,
|
|
67
|
-
string: ['contextName'],
|
|
68
67
|
};
|
|
69
68
|
const plugin = {
|
|
70
69
|
title,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { forEachChild, parse } from 'unbash';
|
|
2
2
|
import { getDependenciesFromCommand, getInputsFromNodeOptions } from '../../binaries/command.js';
|
|
3
3
|
import { spawningBinaries } from '../../binaries/fallback.js';
|
|
4
|
-
import { isWrapper } from '../../binaries/plugins.js';
|
|
4
|
+
import { isWrapper, toForwardedScript } from '../../binaries/plugins.js';
|
|
5
5
|
import { isPackageManager } from '../../binaries/resolvers/index.js';
|
|
6
|
-
import { toScript } from '../../binaries/util.js';
|
|
7
6
|
import { SCRIPT_INTERPOLATION } from '../../constants.js';
|
|
8
7
|
import { isBinary } from '../../util/input.js';
|
|
9
8
|
import { extractBinary, isRelativeNodeModulesBin } from '../../util/modules.js';
|
|
@@ -56,7 +55,7 @@ export const getInputsFromMiseScript = (script, options, hasLocalBinPath) => {
|
|
|
56
55
|
inputs.push(...getInputsFromMiseScript(script, options, isLocal));
|
|
57
56
|
return [];
|
|
58
57
|
};
|
|
59
|
-
const fromArgs = args => fromScript(
|
|
58
|
+
const fromArgs = args => fromScript(toForwardedScript(args));
|
|
60
59
|
commandInputs = getDependenciesFromCommand(marked, { ...options, fromArgs });
|
|
61
60
|
if (spawningBinaries.includes(binary))
|
|
62
61
|
commandInputs.push(...getInputsFromNodeOptions(marked.prefix));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toEntryPath, toEntry } from '../../util/input.js';
|
|
2
2
|
import { isDirectory } from '../../util/fs.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Mocha';
|
|
@@ -48,10 +48,10 @@ const resolveConfig = (localConfig, options) => {
|
|
|
48
48
|
const require = localConfig.require ? [localConfig.require].flat() : [];
|
|
49
49
|
const inputs = [];
|
|
50
50
|
inputs.push(...entryPatterns.map(id => toEntry(id)));
|
|
51
|
-
inputs.push(...files.map(id =>
|
|
52
|
-
inputs.push(...require.map(id =>
|
|
51
|
+
inputs.push(...files.map(id => toEntryPath(id, { dir: options.cwd })));
|
|
52
|
+
inputs.push(...require.map(id => toModule(id, { dir: options.cwd })));
|
|
53
53
|
if (isExternalReporter(localConfig.reporter))
|
|
54
|
-
inputs.push(
|
|
54
|
+
inputs.push(toModule(localConfig.reporter, { dir: options.cwd }));
|
|
55
55
|
return inputs;
|
|
56
56
|
};
|
|
57
57
|
const args = {
|
|
@@ -93,7 +93,7 @@ const args = {
|
|
|
93
93
|
ui: ['u'],
|
|
94
94
|
watch: ['w'],
|
|
95
95
|
},
|
|
96
|
-
string: ['
|
|
96
|
+
string: ['extension', 'file', 'ignore', 'reporter', 'spec'],
|
|
97
97
|
config: ['config'],
|
|
98
98
|
resolveInputs: (parsed, { cwd }) => {
|
|
99
99
|
const extensions = [parsed.extension ?? []]
|
|
@@ -103,7 +103,8 @@ const args = {
|
|
|
103
103
|
const list = extensions.length > 0 ? extensions : defaultExtensions;
|
|
104
104
|
const suffix = list.length === 1 ? `*.${list[0]}` : `*.{${list.join(',')}}`;
|
|
105
105
|
const inputs = [];
|
|
106
|
-
|
|
106
|
+
const operands = [...parsed._, ...(parsed['--'] ?? []).filter(value => !value.startsWith('-'))];
|
|
107
|
+
for (const value of [...operands, ...[parsed.spec ?? []].flat(), ...[parsed.file ?? []].flat()].map(String)) {
|
|
107
108
|
if (isDirectory(cwd, value))
|
|
108
109
|
inputs.push(toEntry(`${value.replace(/\/$/, '')}/${parsed.recursive ? '**/' : ''}${suffix}`));
|
|
109
110
|
else
|
|
@@ -112,7 +113,7 @@ const args = {
|
|
|
112
113
|
for (const value of [parsed.ignore ?? []].flat())
|
|
113
114
|
inputs.push(toEntry(`!${String(value)}`));
|
|
114
115
|
if (isExternalReporter(parsed.reporter))
|
|
115
|
-
inputs.push(
|
|
116
|
+
inputs.push(toModule(parsed.reporter));
|
|
116
117
|
return inputs;
|
|
117
118
|
},
|
|
118
119
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toModule, toDependency, toEntry } from '../../util/input.js';
|
|
2
2
|
import { isInternal, join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { extractFunctionsConfigProperty } from './helpers.js';
|
|
@@ -11,7 +11,7 @@ const NETLIFY_FUNCTIONS_EXTS = 'js,mjs,cjs,ts,mts,cts';
|
|
|
11
11
|
const production = [`${NETLIFY_FUNCTIONS_DIR}/**/*.{${NETLIFY_FUNCTIONS_EXTS}}`];
|
|
12
12
|
const toPluginInput = (id) => {
|
|
13
13
|
const specifier = id.startsWith('/') ? `.${id}` : id;
|
|
14
|
-
return isInternal(specifier) ?
|
|
14
|
+
return isInternal(specifier) ? toModule(specifier) : toDependency(id);
|
|
15
15
|
};
|
|
16
16
|
const resolveConfig = async (localConfig) => {
|
|
17
17
|
return [
|
|
@@ -19,7 +19,7 @@ const resolveConfig = async (localConfig) => {
|
|
|
19
19
|
join(localConfig.functions?.directory ?? NETLIFY_FUNCTIONS_DIR, `**/*.{${NETLIFY_FUNCTIONS_EXTS}}`),
|
|
20
20
|
]
|
|
21
21
|
.filter(file => !file.startsWith('!'))
|
|
22
|
-
.map(id =>
|
|
22
|
+
.map(id => toEntry(id, { production: true }))
|
|
23
23
|
.concat([
|
|
24
24
|
...(localConfig?.plugins?.map(plugin => plugin.package) ?? []).map(toPluginInput),
|
|
25
25
|
...extractFunctionsConfigProperty(localConfig.functions || {}, 'external_node_modules').map(id => toDependency(id)),
|
|
@@ -2,7 +2,7 @@ import { Visitor, } from 'oxc-parser';
|
|
|
2
2
|
import { findProperty, getPropertyValues, resolveObjectArg } from '../../typescript/ast-helpers.js';
|
|
3
3
|
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
4
4
|
import { isDirectory } from '../../util/fs.js';
|
|
5
|
-
import { toConfig,
|
|
5
|
+
import { toConfig, toModule, toEntryPath, toEntry } from '../../util/input.js';
|
|
6
6
|
import { isInNodeModules, join, toAbsolute } from '../../util/path.js';
|
|
7
7
|
import { hasDependency } from '../../util/plugin.js';
|
|
8
8
|
const title = 'Next.js';
|
|
@@ -42,13 +42,13 @@ const production = getEntryFilePatterns();
|
|
|
42
42
|
const getInputs = (pageExtensions, loaders, aliasTargets, files, configFileDir) => {
|
|
43
43
|
const extensions = pageExtensions.length > 0 ? pageExtensions : defaultPageExtensions;
|
|
44
44
|
const patterns = [...getEntryFilePatterns(extensions, configFileDir), 'next-env.d.ts'];
|
|
45
|
-
const inputs = patterns.map(id =>
|
|
45
|
+
const inputs = patterns.map(id => toEntry(join(configFileDir, id), { production: true }));
|
|
46
46
|
for (const loader of loaders)
|
|
47
|
-
inputs.push(
|
|
47
|
+
inputs.push(toModule(loader));
|
|
48
48
|
for (const target of aliasTargets)
|
|
49
|
-
inputs.push(
|
|
49
|
+
inputs.push(toModule(target, { dir: configFileDir, production: true }));
|
|
50
50
|
for (const file of files)
|
|
51
|
-
inputs.push(
|
|
51
|
+
inputs.push(toEntryPath(toAbsolute(file, configFileDir), { production: true }));
|
|
52
52
|
return inputs;
|
|
53
53
|
};
|
|
54
54
|
const isObject = (value) => typeof value === 'object' && value !== null;
|