knip 6.45.1 → 6.46.1
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/astro-og-canvas/index.js +1 -1
- 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 +6 -6
- 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 +4 -4
- 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 +5 -3
- 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 +8 -8
- 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-native/index.js +1 -1
- 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 +8 -5
- 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 +7 -12
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compact } from '../../util/array.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toModule, toDependency } from '../../util/input.js';
|
|
3
3
|
import { isInternal } from '../../util/path.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
const title = 'SWC';
|
|
@@ -7,14 +7,17 @@ const enablers = ['@swc/core'];
|
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['.swcrc'];
|
|
9
9
|
const resolveConfig = async (config, options) => {
|
|
10
|
-
const
|
|
10
|
+
const plugins = [];
|
|
11
|
+
const inputs = [];
|
|
11
12
|
for (const item of [config].flat()) {
|
|
12
13
|
for (const [id] of item?.jsc?.experimental?.plugins ?? [])
|
|
13
|
-
|
|
14
|
+
plugins.push(id);
|
|
14
15
|
if (item?.jsc?.externalHelpers)
|
|
15
|
-
|
|
16
|
+
inputs.push(toDependency('@swc/helpers', { production: true }));
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
for (const id of compact(plugins))
|
|
19
|
+
inputs.push(isInternal(id) ? toModule(id, { dir: options.cwd }) : toDependency(id));
|
|
20
|
+
return inputs;
|
|
18
21
|
};
|
|
19
22
|
const plugin = {
|
|
20
23
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntryPath } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
import compiler from './compiler.js';
|
|
4
4
|
const title = 'Tailwind';
|
|
@@ -21,9 +21,10 @@ const registerCompilers = ({ registerCompiler, hasDependency }) => {
|
|
|
21
21
|
};
|
|
22
22
|
const args = {
|
|
23
23
|
binaries: ['tailwindcss'],
|
|
24
|
+
config: true,
|
|
24
25
|
string: ['input'],
|
|
25
26
|
alias: { input: ['i'] },
|
|
26
|
-
resolveInputs: (parsed, { cwd }) => (parsed.input ? [
|
|
27
|
+
resolveInputs: (parsed, { cwd }) => (parsed.input ? [toEntryPath(parsed.input, { production: true, dir: cwd })] : []),
|
|
27
28
|
};
|
|
28
29
|
const plugin = {
|
|
29
30
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntryPath, 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 = 'TanStack Router';
|
|
@@ -20,7 +20,10 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
20
20
|
const { configFileDir } = options;
|
|
21
21
|
const generatedRouteTree = localConfig.generatedRouteTree ?? './src/routeTree.gen.ts';
|
|
22
22
|
const routeTreePath = toAbsolute(generatedRouteTree, configFileDir);
|
|
23
|
-
return [
|
|
23
|
+
return [
|
|
24
|
+
toEntryPath(routeTreePath, { production: true }),
|
|
25
|
+
...routerEntries.map(id => toEntry(id, { production: true })),
|
|
26
|
+
];
|
|
24
27
|
};
|
|
25
28
|
const plugin = {
|
|
26
29
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDependency,
|
|
1
|
+
import { toDependency, toEntryPath } from '../../util/input.js';
|
|
2
2
|
import { isInternal } from '../../util/path.js';
|
|
3
3
|
const RULE_PREFIX = 'textlint-rule-';
|
|
4
4
|
const PRESET_PREFIX = 'textlint-rule-preset-';
|
|
@@ -29,7 +29,7 @@ const toPresetDependency = (key, manifest) => {
|
|
|
29
29
|
return toPackageDependency(PRESET_PREFIX, name, candidates, manifest);
|
|
30
30
|
};
|
|
31
31
|
const toModuleDependency = (prefix, key, manifest) => toPackageDependency(prefix, key, [createFullPackageName(prefix, key), key], manifest);
|
|
32
|
-
const toLocalEntry = (key, cwd) =>
|
|
32
|
+
const toLocalEntry = (key, cwd) => toEntryPath(key, { dir: cwd });
|
|
33
33
|
export const toRuleDependency = (key, manifest, cwd) => {
|
|
34
34
|
if (isInternal(key))
|
|
35
35
|
return toLocalEntry(key, cwd);
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
const title = 'ts-node';
|
|
2
2
|
const args = {
|
|
3
|
-
|
|
3
|
+
binaries: ['ts-node', 'ts-node-cwd', 'ts-node-esm', 'ts-node-script', 'ts-node-transpile-only'],
|
|
4
|
+
positional: (parsed) => (parsed.eval === undefined ? parsed._.slice(0, 1) : []),
|
|
4
5
|
nodeImportArgs: true,
|
|
5
|
-
|
|
6
|
+
string: [
|
|
7
|
+
'compiler',
|
|
8
|
+
'compilerOptions',
|
|
9
|
+
'cwd',
|
|
10
|
+
'dir',
|
|
11
|
+
'eval',
|
|
12
|
+
'experimentalSpecifierResolution',
|
|
13
|
+
'ignore',
|
|
14
|
+
'ignoreDiagnostics',
|
|
15
|
+
'project',
|
|
16
|
+
'scopeDir',
|
|
17
|
+
'transpiler',
|
|
18
|
+
],
|
|
6
19
|
alias: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
compiler: ['C'],
|
|
21
|
+
compilerOptions: ['O', 'compiler-options'],
|
|
22
|
+
eval: ['e'],
|
|
23
|
+
ignore: ['I'],
|
|
24
|
+
ignoreDiagnostics: ['D', 'ignore-diagnostics'],
|
|
25
|
+
project: ['P'],
|
|
11
26
|
},
|
|
27
|
+
boolean: true,
|
|
28
|
+
stopEarly: true,
|
|
12
29
|
};
|
|
13
30
|
const plugin = {
|
|
14
31
|
title,
|
|
@@ -21,7 +21,7 @@ const resolveConfig = async (localConfig) => {
|
|
|
21
21
|
};
|
|
22
22
|
const args = {
|
|
23
23
|
alias: { files: ['f'], typings: ['t'] },
|
|
24
|
-
string: ['files'
|
|
24
|
+
string: ['files'],
|
|
25
25
|
resolveInputs: (parsed) => {
|
|
26
26
|
const inputs = [];
|
|
27
27
|
for (const id of [parsed.files ?? []].flat())
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectPropertyValues } from '../../typescript/ast-helpers.js';
|
|
2
|
-
import { toDependency,
|
|
2
|
+
import { toDependency, toEntry } from '../../util/input.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'tsdown';
|
|
5
5
|
const enablers = ['tsdown'];
|
|
@@ -30,7 +30,7 @@ const resolveConfig = async (config) => {
|
|
|
30
30
|
const entryPatterns = [config]
|
|
31
31
|
.flat()
|
|
32
32
|
.flatMap(config => normalizeEntry(config.entry))
|
|
33
|
-
.map(id =>
|
|
33
|
+
.map(id => toEntry(id, { production: true, allowIncludeExports: true }));
|
|
34
34
|
const externalDependencies = [config]
|
|
35
35
|
.flat()
|
|
36
36
|
.flatMap(getExternalDependencies)
|
|
@@ -38,7 +38,7 @@ const resolveConfig = async (config) => {
|
|
|
38
38
|
return [...entryPatterns, ...externalDependencies];
|
|
39
39
|
};
|
|
40
40
|
const resolveFromAST = program => [
|
|
41
|
-
...Array.from(collectPropertyValues(program, 'entry'), id =>
|
|
41
|
+
...Array.from(collectPropertyValues(program, 'entry'), id => toEntry(id, { production: true, allowIncludeExports: true })),
|
|
42
42
|
...Array.from(collectPropertyValues(program, 'neverBundle'), id => toDependency(id, { optional: true })),
|
|
43
43
|
];
|
|
44
44
|
const args = {
|
|
@@ -76,7 +76,7 @@ const args = {
|
|
|
76
76
|
'write',
|
|
77
77
|
],
|
|
78
78
|
resolveInputs: parsed => [
|
|
79
|
-
...[...parsed._, ...normalizeEntry(parsed.entry)].map(id =>
|
|
79
|
+
...[...parsed._, ...normalizeEntry(parsed.entry)].map(id => toEntry(id, { production: true, allowIncludeExports: true })),
|
|
80
80
|
...[parsed.deps?.neverBundle, parsed.deps?.['never-bundle'], parsed.external]
|
|
81
81
|
.flat()
|
|
82
82
|
.filter(id => typeof id === 'string')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectPropertyValues } from '../../typescript/ast-helpers.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toEntry } from '../../util/input.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'tsup';
|
|
5
5
|
const enablers = ['tsup'];
|
|
@@ -18,10 +18,10 @@ const resolveConfig = async (config) => {
|
|
|
18
18
|
return config.entry;
|
|
19
19
|
return Object.values(config.entry);
|
|
20
20
|
})
|
|
21
|
-
.map(id =>
|
|
21
|
+
.map(id => toEntry(id, { production: true, allowIncludeExports: true }));
|
|
22
22
|
return entryPatterns;
|
|
23
23
|
};
|
|
24
|
-
const resolveFromAST = program => Array.from(collectPropertyValues(program, 'entry'), id =>
|
|
24
|
+
const resolveFromAST = program => Array.from(collectPropertyValues(program, 'entry'), id => toEntry(id, { production: true, allowIncludeExports: true }));
|
|
25
25
|
const args = {
|
|
26
26
|
config: true,
|
|
27
27
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { toEntry } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { args as nodeArgs } from '../node/index.js';
|
|
3
4
|
const title = 'tsx';
|
|
4
5
|
const enablers = ['tsx'];
|
|
5
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -20,9 +21,9 @@ const resolveConfig = localConfig => {
|
|
|
20
21
|
return entries;
|
|
21
22
|
};
|
|
22
23
|
const args = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
args: (args) => args
|
|
24
|
+
...nodeArgs,
|
|
25
|
+
string: [...nodeArgs.string, 'exclude', 'ignore', 'include', 'tsconfig'],
|
|
26
|
+
args: (args) => nodeArgs.args(args[0] === 'watch' ? args.slice(1) : args),
|
|
26
27
|
};
|
|
27
28
|
const plugin = {
|
|
28
29
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntryPath, toEntry } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Turborepo';
|
|
4
4
|
const enablers = ['turbo', '@turbo/gen'];
|
|
@@ -9,7 +9,7 @@ const resolve = ({ cwd, rootCwd }) => (cwd === rootCwd ? [toEntry(`plopfile.${ex
|
|
|
9
9
|
const args = {
|
|
10
10
|
string: ['config'],
|
|
11
11
|
resolveInputs: (parsed, { cwd }) => (parsed._[0] === 'gen' || parsed._[0] === 'generate') && typeof parsed.config === 'string'
|
|
12
|
-
? [
|
|
12
|
+
? [toEntryPath(parsed.config, { dir: cwd })]
|
|
13
13
|
: [],
|
|
14
14
|
};
|
|
15
15
|
const plugin = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arrayify } from '../../util/array.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toModule, toEntryPath } from '../../util/input.js';
|
|
3
3
|
import { join } from '../../util/path.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
const title = 'TypeDoc';
|
|
@@ -18,14 +18,15 @@ const resolveConfig = (config, options) => {
|
|
|
18
18
|
const cfg = 'typedocOptions' in config ? config.typedocOptions : config;
|
|
19
19
|
const plugins = arrayify(cfg?.plugin);
|
|
20
20
|
const themes = arrayify(cfg?.theme);
|
|
21
|
-
const inputs = [...plugins, ...themes].map(id =>
|
|
21
|
+
const inputs = [...plugins, ...themes].map(id => toModule(id));
|
|
22
22
|
for (const file of [cfg?.customCss, cfg?.customJs]) {
|
|
23
23
|
if (file)
|
|
24
|
-
inputs.push(
|
|
24
|
+
inputs.push(toEntryPath(join(options.configFileDir, file)));
|
|
25
25
|
}
|
|
26
26
|
return inputs;
|
|
27
27
|
};
|
|
28
28
|
const args = {
|
|
29
|
+
config: ['options'],
|
|
29
30
|
resolve: ['plugin', 'theme'],
|
|
30
31
|
};
|
|
31
32
|
const plugin = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compact } from '../../util/array.js';
|
|
2
|
-
import { toConfig,
|
|
2
|
+
import { toConfig, toModule, toDependency } from '../../util/input.js';
|
|
3
3
|
import { join, toAbsolute } from '../../util/path.js';
|
|
4
4
|
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
import { contentMapperResolvers } from './content-mappers.js';
|
|
@@ -26,7 +26,7 @@ export const resolveConfig = (localConfig, options) => {
|
|
|
26
26
|
const contentMappers = resolveContentMappers(localConfig, options.configFileDir);
|
|
27
27
|
if (!(compilerOptions && localConfig))
|
|
28
28
|
return compact([...contentMappers, ...extend, ...references]);
|
|
29
|
-
const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(id =>
|
|
29
|
+
const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(id => toDependency(id, { production: true, dir: options.cwd, alsoReferenceOwner: true }));
|
|
30
30
|
const types = compilerOptions.types ?? [];
|
|
31
31
|
const plugins = Array.isArray(compilerOptions?.plugins)
|
|
32
32
|
? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
|
|
@@ -36,9 +36,9 @@ export const resolveConfig = (localConfig, options) => {
|
|
|
36
36
|
...contentMappers,
|
|
37
37
|
...extend,
|
|
38
38
|
...references,
|
|
39
|
-
...types.map(id =>
|
|
39
|
+
...types.map(id => toModule(id, { isTypeOnly: true, dir: options.cwd, alsoReferenceOwner: true })),
|
|
40
40
|
...plugins.map(id => toDependency(id, { dir: options.cwd, alsoReferenceOwner: true })),
|
|
41
|
-
...importHelpers.map(id =>
|
|
41
|
+
...importHelpers.map(id => toDependency(id, { production: true, dir: options.cwd, alsoReferenceOwner: true })),
|
|
42
42
|
...jsx,
|
|
43
43
|
]);
|
|
44
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
|
-
import {
|
|
3
|
+
import { toModule, toEntryPath, toDependency } from '../../util/input.js';
|
|
4
4
|
import { isDirectory, isFile, tryRealpath } from '../../util/fs.js';
|
|
5
5
|
import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
|
|
6
6
|
import { dirname, isInternal, join, toAbsolute } from '../../util/path.js';
|
|
@@ -54,7 +54,10 @@ export const scanVarlockFiles = (paths, cwd) => {
|
|
|
54
54
|
continue;
|
|
55
55
|
if (name === 'plugin') {
|
|
56
56
|
if (isLocalPath(descriptor)) {
|
|
57
|
-
inputs.push(
|
|
57
|
+
inputs.push(toEntryPath(descriptor.startsWith('~/') ? resolvePath(descriptor, dirname(realPath)) : descriptor, {
|
|
58
|
+
production: true,
|
|
59
|
+
containingFilePath: realPath,
|
|
60
|
+
}));
|
|
58
61
|
}
|
|
59
62
|
else {
|
|
60
63
|
const packageName = getPackageNameFromModuleSpecifier(descriptor);
|
|
@@ -70,7 +73,7 @@ export const scanVarlockFiles = (paths, cwd) => {
|
|
|
70
73
|
if (isFile(importPath) || isDirectory(importPath))
|
|
71
74
|
queue.push(...expandLoadPath(importPath));
|
|
72
75
|
else if (allowMissing !== true && allowMissing !== null && enabled !== null) {
|
|
73
|
-
inputs.push(
|
|
76
|
+
inputs.push(toModule(descriptor, { containingFilePath: realPath }));
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
}
|
|
@@ -2,7 +2,7 @@ import { blockCommentMatcher, lineCommentMatcher, scriptExtractor } from '../../
|
|
|
2
2
|
import { findImportedCalls, findProperty, getStringValues, resolveObjectArg } from '../../typescript/ast-helpers.js';
|
|
3
3
|
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
4
4
|
import { isFile, loadFile } from '../../util/fs.js';
|
|
5
|
-
import {
|
|
5
|
+
import { toEntryPath } from '../../util/input.js';
|
|
6
6
|
import { dirname, isInternal, join, toAbsolute } from '../../util/path.js';
|
|
7
7
|
import { getDependenciesFromConfig } from '../babel/index.js';
|
|
8
8
|
import { toProviderInput } from '../mdx/index.js';
|
|
@@ -70,7 +70,7 @@ export const getHtmlScriptEntries = async (htmlPath, rootDir = dirname(htmlPath)
|
|
|
70
70
|
if (!isFile(htmlPath))
|
|
71
71
|
return [];
|
|
72
72
|
const html = await loadFile(htmlPath);
|
|
73
|
-
return getScriptSources(html, dirname(htmlPath), rootDir, publicDir).map(src =>
|
|
73
|
+
return getScriptSources(html, dirname(htmlPath), rootDir, publicDir).map(src => toEntryPath(src, { production: true }));
|
|
74
74
|
};
|
|
75
75
|
export const getIndexHtmlEntries = (rootDir, publicDir) => getHtmlScriptEntries(join(rootDir, 'index.html'), rootDir, publicDir);
|
|
76
76
|
export const getVitePluginDirs = (program, specifiers, key) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toIgnore,
|
|
1
|
+
import { toIgnore, toEntry } from '../../util/input.js';
|
|
2
2
|
import { join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { getVitePluginDirs } from '../vite/helpers.js';
|
|
@@ -11,7 +11,7 @@ const defaultDir = 'src/pages';
|
|
|
11
11
|
const production = [`${defaultDir}/**/*.{${extensions}}`];
|
|
12
12
|
const resolveFromAST = (program, options) => {
|
|
13
13
|
const dirs = getVitePluginDirs(program, enablers, 'dirs') ?? [defaultDir];
|
|
14
|
-
return dirs.map(dir =>
|
|
14
|
+
return dirs.map(dir => toEntry(join(options.configFileDir, `${dir}/**/*.{${extensions}}`), { production: true }));
|
|
15
15
|
};
|
|
16
16
|
const resolve = () => ['~pages', '~react-pages', '~solid-pages'].map(specifier => toIgnore(specifier, 'unresolved'));
|
|
17
17
|
const plugin = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Visitor } from 'oxc-parser';
|
|
2
2
|
import { findImportedCalls, findProperty, getFirstPropertyValue, getPropertyValues, } from '../../typescript/ast-helpers.js';
|
|
3
|
-
import {
|
|
3
|
+
import { toEntryPath } from '../../util/input.js';
|
|
4
4
|
import { join } from '../../util/path.js';
|
|
5
5
|
const defaultSrcDir = 'public';
|
|
6
6
|
const defaultFilename = 'sw.js';
|
|
@@ -10,7 +10,7 @@ const getInjectManifestEntry = (options, configFileDir) => {
|
|
|
10
10
|
return;
|
|
11
11
|
const srcDir = getFirstPropertyValue(options, 'srcDir') ?? defaultSrcDir;
|
|
12
12
|
const filename = getFirstPropertyValue(options, 'filename') ?? defaultFilename;
|
|
13
|
-
return
|
|
13
|
+
return toEntryPath(join(configFileDir, srcDir, filename), { production: true });
|
|
14
14
|
};
|
|
15
15
|
export const resolveFromAST = (program, options) => {
|
|
16
16
|
const inputs = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntry } from '../../util/input.js';
|
|
2
2
|
import { join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { getVitePluginDirs } from '../vite/helpers.js';
|
|
@@ -10,7 +10,7 @@ const defaultDir = 'src/layouts';
|
|
|
10
10
|
const production = [`${defaultDir}/**/*.vue`];
|
|
11
11
|
const resolveFromAST = (program, options) => {
|
|
12
12
|
const dirs = getVitePluginDirs(program, enablers, 'layoutsDirs') ?? [defaultDir];
|
|
13
|
-
return dirs.map(dir =>
|
|
13
|
+
return dirs.map(dir => toEntry(join(options.configFileDir, `${dir}/**/*.vue`), { production: true }));
|
|
14
14
|
};
|
|
15
15
|
const plugin = {
|
|
16
16
|
title,
|
|
@@ -2,7 +2,7 @@ import { DEFAULT_EXTENSIONS } from '../../constants.js';
|
|
|
2
2
|
import { filterTransitiveDependencies } from '../../util/filter-transitive-dependencies.js';
|
|
3
3
|
import { findFileWithExtensions } from '../../util/fs.js';
|
|
4
4
|
import { _dirGlob, _glob } from '../../util/glob.js';
|
|
5
|
-
import { toConfig,
|
|
5
|
+
import { toConfig, toModule, toEntryPath, toDependency, toEntry } from '../../util/input.js';
|
|
6
6
|
import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
|
|
7
7
|
import { basename, isAbsolute, isInternal, join, toAbsolute, toPosix } from '../../util/path.js';
|
|
8
8
|
import { hasDependency } from '../../util/plugin.js';
|
|
@@ -24,7 +24,7 @@ const builtInCoverageProviders = new Set(['v8', 'istanbul', 'c8']);
|
|
|
24
24
|
const getCoverageInputs = (provider, customProviderModule, dir) => builtInCoverageProviders.has(provider)
|
|
25
25
|
? [toDependency(`@vitest/coverage-${provider}`)]
|
|
26
26
|
: customProviderModule
|
|
27
|
-
? [
|
|
27
|
+
? [toModule(customProviderModule, { dir })]
|
|
28
28
|
: [];
|
|
29
29
|
const isProjectConfig = (project) => typeof project === 'object' && !(project instanceof Promise);
|
|
30
30
|
const findConfigDependencies = (localConfig, options, vitestRoot) => {
|
|
@@ -32,21 +32,15 @@ const findConfigDependencies = (localConfig, options, vitestRoot) => {
|
|
|
32
32
|
if (!testConfig)
|
|
33
33
|
return [];
|
|
34
34
|
const env = testConfig.environment;
|
|
35
|
-
const environments = env && env !== 'node' ? (isInternal(env) || isAbsolute(env) ? [
|
|
36
|
-
const reporters = getExternalReporters(testConfig.reporters).map(specifier => isInternal(specifier) || isAbsolute(specifier)
|
|
37
|
-
? toDeferResolve(specifier, { dir: vitestRoot })
|
|
38
|
-
: toDependency(specifier));
|
|
35
|
+
const environments = env && env !== 'node' ? (isInternal(env) || isAbsolute(env) ? [toModule(env)] : [toEnvDependency(env)]) : [];
|
|
36
|
+
const reporters = getExternalReporters(testConfig.reporters).map(specifier => isInternal(specifier) || isAbsolute(specifier) ? toModule(specifier, { dir: vitestRoot }) : toDependency(specifier));
|
|
39
37
|
const hasCoverage = testConfig.coverage && (testConfig.coverage.enabled !== false || testConfig.coverage.provider);
|
|
40
38
|
const coverage = hasCoverage
|
|
41
39
|
? getCoverageInputs(testConfig.coverage?.provider ?? 'v8', testConfig.coverage?.customProviderModule, vitestRoot)
|
|
42
40
|
: [];
|
|
43
|
-
const setupFiles = [testConfig.setupFiles ?? []]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const snapshotSerializers = (testConfig.snapshotSerializers ?? []).map(specifier => toDeferResolve(specifier, { dir: vitestRoot }));
|
|
47
|
-
const globalSetup = [testConfig.globalSetup ?? []]
|
|
48
|
-
.flat()
|
|
49
|
-
.map(specifier => toDeferResolve(specifier, { dir: vitestRoot }));
|
|
41
|
+
const setupFiles = [testConfig.setupFiles ?? []].flat().map(specifier => toModule(specifier, { dir: vitestRoot }));
|
|
42
|
+
const snapshotSerializers = (testConfig.snapshotSerializers ?? []).map(specifier => toModule(specifier, { dir: vitestRoot }));
|
|
43
|
+
const globalSetup = [testConfig.globalSetup ?? []].flat().map(specifier => toModule(specifier, { dir: vitestRoot }));
|
|
50
44
|
const workspaceDependencies = [];
|
|
51
45
|
if (testConfig.workspace !== undefined) {
|
|
52
46
|
for (const workspaceConfig of testConfig.workspace) {
|
|
@@ -214,8 +208,8 @@ export const resolveConfig = async (localConfig, options) => {
|
|
|
214
208
|
const _input = cfg.build?.rolldownOptions?.input ?? cfg.build?.rollupOptions?.input ?? [];
|
|
215
209
|
const inputSpecifiers = typeof _input === 'string' ? [_input] : Array.isArray(_input) ? _input : Object.values(_input).flat();
|
|
216
210
|
for (const specifier of inputSpecifiers) {
|
|
217
|
-
const resolved = toAbsolute(specifier, viteRoot);
|
|
218
|
-
inputs.add(
|
|
211
|
+
const resolved = toAbsolute(toPosix(specifier), viteRoot);
|
|
212
|
+
inputs.add(toEntryPath(resolved, { production: true }));
|
|
219
213
|
if (resolved.endsWith('.html')) {
|
|
220
214
|
for (const input of await getHtmlScriptEntries(resolved, viteRoot, publicDir))
|
|
221
215
|
inputs.add(input);
|
|
@@ -223,7 +217,9 @@ export const resolveConfig = async (localConfig, options) => {
|
|
|
223
217
|
}
|
|
224
218
|
const _entry = cfg.build?.lib?.entry ?? [];
|
|
225
219
|
const entries = typeof _entry === 'string' ? [_entry] : Array.isArray(_entry) ? _entry : Object.values(_entry).flat();
|
|
226
|
-
const deps = entries
|
|
220
|
+
const deps = entries
|
|
221
|
+
.map(specifier => toAbsolute(specifier, viteRoot))
|
|
222
|
+
.map(id => toEntryPath(id, { production: true }));
|
|
227
223
|
for (const dependency of deps)
|
|
228
224
|
inputs.add(dependency);
|
|
229
225
|
}
|
|
@@ -251,12 +247,12 @@ const args = {
|
|
|
251
247
|
}
|
|
252
248
|
if (parsed['reporter']) {
|
|
253
249
|
for (const reporter of getExternalReporters([parsed['reporter']].flat())) {
|
|
254
|
-
inputs.push(isInternal(reporter) ?
|
|
250
|
+
inputs.push(isInternal(reporter) ? toModule(reporter, { dir: root }) : toDependency(reporter));
|
|
255
251
|
}
|
|
256
252
|
}
|
|
257
253
|
const env = parsed['environment'];
|
|
258
254
|
if (env && env !== 'node')
|
|
259
|
-
inputs.push(isInternal(env) ?
|
|
255
|
+
inputs.push(isInternal(env) ? toModule(env, { dir: root }) : toEnvDependency(env));
|
|
260
256
|
if (typeof parsed['typecheck'] === 'object' && parsed['typecheck'].checker) {
|
|
261
257
|
inputs.push(toDependency(parsed['typecheck'].checker === 'tsc' ? 'typescript' : parsed['typecheck'].checker));
|
|
262
258
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDependency } from '../../util/input.js';
|
|
1
|
+
import { toConfig, toDependency } from '../../util/input.js';
|
|
2
2
|
import { isAbsolute } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { resolvePackageManifestPath } from '../../util/resolve.js';
|
|
@@ -30,11 +30,23 @@ const resolveConfig = async (config, options) => {
|
|
|
30
30
|
...toInputs(cfg.services, 'service'),
|
|
31
31
|
];
|
|
32
32
|
};
|
|
33
|
+
const commands = new Set(['config', 'install', 'repl', 'session']);
|
|
34
|
+
const args = {
|
|
35
|
+
binaries: ['wdio'],
|
|
36
|
+
boolean: ['cpuProf', 'headless', 'heapProf'],
|
|
37
|
+
alias: { cpuProf: ['cpu-prof'], heapProf: ['heap-prof'] },
|
|
38
|
+
resolveInputs: parsed => {
|
|
39
|
+
const [command, path] = parsed._;
|
|
40
|
+
const configPath = command === 'run' ? path : command;
|
|
41
|
+
return configPath && !commands.has(configPath) ? [toConfig('webdriver-io', configPath)] : [];
|
|
42
|
+
},
|
|
43
|
+
};
|
|
33
44
|
const plugin = {
|
|
34
45
|
title,
|
|
35
46
|
enablers,
|
|
36
47
|
isEnabled,
|
|
37
48
|
config,
|
|
38
49
|
resolveConfig,
|
|
50
|
+
args,
|
|
39
51
|
};
|
|
40
52
|
export default plugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toAlias,
|
|
1
|
+
import { toAlias, toModule, toEntryPath, toDependency } from '../../util/input.js';
|
|
2
2
|
import { extname, isInternal, join } from '../../util/path.js';
|
|
3
3
|
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
import { getDependenciesFromConfig } from '../babel/index.js';
|
|
@@ -41,8 +41,7 @@ const resolveRuleSetDependencies = (rule) => {
|
|
|
41
41
|
if (typeof useItem === 'function')
|
|
42
42
|
useItem = useItem(info);
|
|
43
43
|
if (typeof useItem === 'string' && hasBabelOptions(rule)) {
|
|
44
|
-
|
|
45
|
-
return [useItem, ...d];
|
|
44
|
+
return [useItem, ...getDependenciesFromConfig(rule.options)];
|
|
46
45
|
}
|
|
47
46
|
if (typeof useItem === 'string' && useItem && rule.options && rule.use == null)
|
|
48
47
|
useItem = { loader: useItem, options: rule.options };
|
|
@@ -50,8 +49,7 @@ const resolveRuleSetDependencies = (rule) => {
|
|
|
50
49
|
if (!item)
|
|
51
50
|
return [];
|
|
52
51
|
if (hasBabelOptions(item)) {
|
|
53
|
-
|
|
54
|
-
return [...resolveUseItem(item), ...d];
|
|
52
|
+
return [...resolveUseItem(item), ...getDependenciesFromConfig(item.options)];
|
|
55
53
|
}
|
|
56
54
|
if (typeof item !== 'string' && 'oneOf' in item)
|
|
57
55
|
return item.oneOf?.flatMap(resolveRuleSetDependencies) ?? [];
|
|
@@ -97,7 +95,7 @@ export const findWebpackDependenciesFromConfig = async (config, options) => {
|
|
|
97
95
|
for (const opts of [resolvedConfig].flat()) {
|
|
98
96
|
const entries = [];
|
|
99
97
|
for (const loader of opts.module?.rules?.flatMap(resolveRuleSetDependencies) ?? []) {
|
|
100
|
-
inputs.add(
|
|
98
|
+
inputs.add(typeof loader === 'string' ? toModule(loader.replace(/\?.*/, '')) : loader);
|
|
101
99
|
}
|
|
102
100
|
for (const plugin of opts?.plugins ?? []) {
|
|
103
101
|
if (plugin && plugin.constructor.name === 'ProvidePlugin') {
|
|
@@ -105,7 +103,7 @@ export const findWebpackDependenciesFromConfig = async (config, options) => {
|
|
|
105
103
|
if (providePluginInstance.definitions) {
|
|
106
104
|
for (const values of Object.values(providePluginInstance.definitions)) {
|
|
107
105
|
const specifier = typeof values === 'string' ? values : values[0];
|
|
108
|
-
inputs.add(
|
|
106
|
+
inputs.add(toModule(specifier, { production: isProduction }));
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
}
|
|
@@ -132,13 +130,10 @@ export const findWebpackDependenciesFromConfig = async (config, options) => {
|
|
|
132
130
|
for (const entry of entries) {
|
|
133
131
|
if (isInternal(entry) || entry.startsWith('#')) {
|
|
134
132
|
const dir = opts.context ? opts.context : cwd;
|
|
135
|
-
|
|
136
|
-
? toDeferResolveProductionEntry(entry, { dir })
|
|
137
|
-
: toDeferResolveEntry(entry, { dir });
|
|
138
|
-
inputs.add(input);
|
|
133
|
+
inputs.add(toEntryPath(entry, { production: isProduction, dir }));
|
|
139
134
|
}
|
|
140
135
|
else {
|
|
141
|
-
inputs.add(
|
|
136
|
+
inputs.add(toModule(entry, { production: isProduction }));
|
|
142
137
|
}
|
|
143
138
|
}
|
|
144
139
|
const processAlias = (aliases) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toEntryPath } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Wrangler';
|
|
4
4
|
const enablers = ['wrangler'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['wrangler.{json,jsonc,toml}'];
|
|
7
|
-
const resolveConfig = async (config
|
|
8
|
-
return (config.main ? [config.main] : []).map(id =>
|
|
7
|
+
const resolveConfig = async (config) => {
|
|
8
|
+
return (config.main ? [config.main] : []).map(id => toEntryPath(id, { production: true }));
|
|
9
9
|
};
|
|
10
10
|
const plugin = {
|
|
11
11
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toDependency,
|
|
1
|
+
import { toDependency, toEntry } from '../../util/input.js';
|
|
2
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'WXT';
|
|
4
4
|
const enablers = ['wxt'];
|
|
@@ -8,7 +8,7 @@ const production = ['entrypoints/**/*'];
|
|
|
8
8
|
const resolveConfig = async (localConfig) => {
|
|
9
9
|
const inputs = [];
|
|
10
10
|
for (const pattern of production) {
|
|
11
|
-
inputs.push(
|
|
11
|
+
inputs.push(toEntry(pattern, { production: true }));
|
|
12
12
|
}
|
|
13
13
|
for (const id of localConfig?.modules ?? []) {
|
|
14
14
|
if (typeof id === 'string')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isFile } from '../../util/fs.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toEntryPath, toDependency, toEntry } from '../../util/input.js';
|
|
3
3
|
const title = 'Yarn';
|
|
4
4
|
const enablers = 'This plugin is enabled when a `yarn.lock` file is found in the root directory, or when `yarn@` is specified in the `packageManager` field of `package.json`.';
|
|
5
5
|
const isEnabled = async ({ cwd, manifest }) => manifest.packageManager?.startsWith('yarn@') || isFile(cwd, 'yarn.lock');
|
|
@@ -7,17 +7,17 @@ const isRootOnly = true;
|
|
|
7
7
|
const config = ['.yarnrc.yml'];
|
|
8
8
|
const entry = ['yarn.config.cjs'];
|
|
9
9
|
const resolveConfig = (config, { cwd }) => {
|
|
10
|
-
const inputs = entry.map(toEntry);
|
|
10
|
+
const inputs = entry.map(id => toEntry(id));
|
|
11
11
|
if (Array.isArray(config.plugins)) {
|
|
12
12
|
for (const plugin of config.plugins) {
|
|
13
13
|
if (typeof plugin === 'string')
|
|
14
|
-
inputs.push(
|
|
14
|
+
inputs.push(toEntryPath(plugin, { dir: cwd }));
|
|
15
15
|
else if (typeof plugin.path === 'string')
|
|
16
|
-
inputs.push(
|
|
16
|
+
inputs.push(toEntryPath(plugin.path, { dir: cwd }));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
if (config.yarnPath) {
|
|
20
|
-
inputs.push(
|
|
20
|
+
inputs.push(toEntryPath(config.yarnPath, { dir: cwd }));
|
|
21
21
|
}
|
|
22
22
|
if (config.packageExtensions) {
|
|
23
23
|
for (const extension of Object.values(config.packageExtensions)) {
|
|
@@ -30,7 +30,7 @@ export declare const getFileTopology: (file: FileNode) => {
|
|
|
30
30
|
modifiers: number;
|
|
31
31
|
jsDocTags: Set<string> | undefined;
|
|
32
32
|
}[];
|
|
33
|
-
subpathImports:
|
|
33
|
+
subpathImports: Map<string, string | undefined> | undefined;
|
|
34
34
|
externalRefs: Set<import("../types/module-graph.ts").ExternalRef>;
|
|
35
35
|
exports: {
|
|
36
36
|
identifier: string;
|