knip 5.33.3 → 5.34.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 +27 -27
- package/dist/ConfigurationChief.js +20 -36
- package/dist/ConfigurationValidator.d.ts +392 -0
- package/dist/ConfigurationValidator.js +7 -0
- package/dist/DependencyDeputy.js +5 -2
- package/dist/PrincipalFactory.d.ts +3 -20
- package/dist/PrincipalFactory.js +4 -4
- package/dist/ProjectPrincipal.d.ts +2 -5
- package/dist/ProjectPrincipal.js +0 -5
- package/dist/WorkspaceWorker.d.ts +15 -13
- package/dist/WorkspaceWorker.js +144 -105
- package/dist/binaries/bash-parser.d.ts +3 -2
- package/dist/binaries/bash-parser.js +33 -22
- package/dist/binaries/fallback.d.ts +2 -0
- package/dist/binaries/fallback.js +12 -0
- package/dist/binaries/index.d.ts +2 -2
- package/dist/binaries/index.js +15 -26
- package/dist/binaries/package-manager/bun.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/bun.js +6 -4
- package/dist/binaries/package-manager/index.d.ts +8 -0
- package/dist/binaries/package-manager/index.js +12 -0
- package/dist/binaries/{resolvers → package-manager}/node.d.ts +0 -2
- package/dist/binaries/package-manager/node.js +5 -0
- package/dist/binaries/package-manager/npm.d.ts +2 -0
- package/dist/binaries/package-manager/npm.js +8 -0
- package/dist/binaries/package-manager/npx.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/npx.js +6 -6
- package/dist/binaries/package-manager/pnpm.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/pnpm.js +6 -3
- package/dist/binaries/package-manager/yarn.d.ts +2 -0
- package/dist/binaries/{resolvers → package-manager}/yarn.js +9 -7
- package/dist/binaries/plugins.d.ts +2 -0
- package/dist/binaries/plugins.js +61 -0
- package/dist/binaries/util.d.ts +0 -2
- package/dist/binaries/util.js +0 -25
- package/dist/compilers/index.d.ts +70 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/index.js +74 -46
- package/dist/manifest/helpers.d.ts +1 -5
- package/dist/manifest/helpers.js +8 -7
- package/dist/plugins/_template/index.d.ts +2 -2
- package/dist/plugins/_template/index.js +4 -3
- package/dist/plugins/angular/index.d.ts +1 -1
- package/dist/plugins/angular/index.js +13 -10
- package/dist/plugins/astro/index.d.ts +1 -1
- package/dist/plugins/astro/index.js +6 -5
- package/dist/plugins/ava/index.d.ts +1 -1
- package/dist/plugins/ava/index.js +4 -5
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.d.ts +3 -2
- package/dist/plugins/babel/index.js +4 -3
- package/dist/plugins/c8/index.d.ts +10 -0
- package/dist/plugins/c8/index.js +11 -0
- package/dist/plugins/capacitor/index.d.ts +1 -1
- package/dist/plugins/capacitor/index.js +5 -4
- package/dist/plugins/changesets/index.d.ts +1 -1
- package/dist/plugins/changesets/index.js +4 -3
- package/dist/plugins/commitizen/index.d.ts +1 -1
- package/dist/plugins/commitizen/index.js +3 -2
- package/dist/plugins/commitlint/index.d.ts +1 -1
- package/dist/plugins/commitlint/index.js +4 -2
- package/dist/plugins/cspell/index.d.ts +1 -1
- package/dist/plugins/cspell/index.js +3 -2
- package/dist/plugins/cucumber/index.d.ts +2 -2
- package/dist/plugins/cucumber/index.js +4 -4
- package/dist/plugins/cypress/helpers.d.ts +1 -1
- package/dist/plugins/cypress/helpers.js +3 -4
- package/dist/plugins/cypress/index.d.ts +1 -1
- package/dist/plugins/cypress/index.js +6 -5
- package/dist/plugins/dotenv/index.d.ts +8 -0
- package/dist/plugins/dotenv/index.js +9 -0
- package/dist/plugins/drizzle/index.d.ts +1 -1
- package/dist/plugins/drizzle/index.js +3 -3
- package/dist/plugins/eleventy/index.d.ts +1 -1
- package/dist/plugins/eleventy/index.js +6 -6
- package/dist/plugins/eslint/helpers.d.ts +4 -5
- package/dist/plugins/eslint/helpers.js +10 -32
- package/dist/plugins/eslint/index.d.ts +1 -1
- package/dist/plugins/eslint/index.js +3 -6
- package/dist/plugins/gatsby/index.d.ts +1 -1
- package/dist/plugins/gatsby/index.js +6 -3
- package/dist/plugins/github-actions/index.d.ts +1 -1
- package/dist/plugins/github-actions/index.js +23 -7
- package/dist/plugins/graphql-codegen/index.d.ts +1 -1
- package/dist/plugins/graphql-codegen/index.js +7 -7
- package/dist/plugins/husky/index.d.ts +1 -1
- package/dist/plugins/husky/index.js +4 -3
- package/dist/plugins/index.d.ts +685 -77
- package/dist/plugins/index.js +170 -77
- package/dist/plugins/jest/index.d.ts +1 -1
- package/dist/plugins/jest/index.js +22 -24
- package/dist/plugins/ladle/index.d.ts +2 -2
- package/dist/plugins/ladle/index.js +4 -4
- package/dist/plugins/lefthook/index.d.ts +1 -1
- package/dist/plugins/lefthook/index.js +18 -14
- package/dist/plugins/lint-staged/index.d.ts +1 -1
- package/dist/plugins/lint-staged/index.js +6 -5
- package/dist/plugins/linthtml/index.d.ts +1 -1
- package/dist/plugins/linthtml/index.js +6 -8
- package/dist/plugins/lockfile-lint/index.d.ts +2 -2
- package/dist/plugins/lockfile-lint/index.js +2 -1
- package/dist/plugins/lost-pixel/index.d.ts +2 -2
- package/dist/plugins/lost-pixel/index.js +1 -1
- package/dist/plugins/markdownlint/index.d.ts +1 -1
- package/dist/plugins/markdownlint/index.js +3 -2
- package/dist/plugins/mocha/index.d.ts +4 -1
- package/dist/plugins/mocha/index.js +8 -4
- package/dist/plugins/moonrepo/index.d.ts +2 -2
- package/dist/plugins/moonrepo/index.js +4 -4
- package/dist/plugins/msw/index.d.ts +1 -1
- package/dist/plugins/msw/index.js +4 -4
- package/dist/plugins/nest/index.d.ts +2 -2
- package/dist/plugins/nest/index.js +4 -3
- package/dist/plugins/netlify/index.d.ts +1 -1
- package/dist/plugins/netlify/index.js +6 -6
- package/dist/plugins/next/index.d.ts +1 -1
- package/dist/plugins/next/index.js +1 -1
- package/dist/plugins/node/index.d.ts +8 -0
- package/dist/plugins/node/index.js +9 -0
- package/dist/plugins/node-test-runner/index.d.ts +1 -1
- package/dist/plugins/nodemon/index.d.ts +10 -0
- package/dist/plugins/nodemon/index.js +11 -0
- package/dist/plugins/npm-package-json-lint/index.d.ts +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +4 -2
- package/dist/plugins/nuxt/index.d.ts +1 -1
- package/dist/plugins/nuxt/index.js +4 -4
- package/dist/plugins/nx/index.d.ts +5 -1
- package/dist/plugins/nx/index.js +10 -8
- package/dist/plugins/nyc/index.d.ts +1 -1
- package/dist/plugins/nyc/index.js +3 -2
- package/dist/plugins/oclif/index.d.ts +2 -2
- package/dist/plugins/oclif/index.js +3 -2
- package/dist/plugins/playwright/index.d.ts +13 -1
- package/dist/plugins/playwright/index.js +13 -6
- package/dist/plugins/playwright-ct/index.d.ts +9 -3
- package/dist/plugins/playwright-ct/index.js +3 -2
- package/dist/plugins/playwright-test/index.d.ts +13 -0
- package/dist/plugins/playwright-test/index.js +16 -0
- package/dist/plugins/postcss/index.d.ts +1 -1
- package/dist/plugins/postcss/index.js +5 -2
- package/dist/plugins/preconstruct/index.d.ts +1 -1
- package/dist/plugins/preconstruct/index.js +3 -3
- package/dist/plugins/prettier/index.d.ts +1 -1
- package/dist/plugins/prettier/index.js +5 -5
- package/dist/plugins/react-cosmos/index.d.ts +2 -2
- package/dist/plugins/react-cosmos/index.js +5 -6
- package/dist/plugins/release-it/index.d.ts +1 -1
- package/dist/plugins/release-it/index.js +4 -3
- package/dist/plugins/remark/index.d.ts +1 -1
- package/dist/plugins/remark/index.js +3 -2
- package/dist/plugins/remix/index.d.ts +1 -1
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rollup/index.d.ts +3 -1
- package/dist/plugins/rollup/index.js +8 -1
- package/dist/plugins/rsbuild/index.d.ts +2 -2
- package/dist/plugins/rsbuild/index.js +1 -1
- package/dist/plugins/rspack/index.d.ts +2 -2
- package/dist/plugins/rspack/index.js +4 -8
- package/dist/plugins/semantic-release/index.d.ts +1 -1
- package/dist/plugins/semantic-release/index.js +4 -2
- package/dist/plugins/sentry/index.d.ts +1 -1
- package/dist/plugins/sentry/index.js +1 -1
- package/dist/plugins/simple-git-hooks/index.d.ts +2 -2
- package/dist/plugins/simple-git-hooks/index.js +5 -5
- package/dist/plugins/size-limit/index.d.ts +2 -2
- package/dist/plugins/size-limit/index.js +2 -1
- package/dist/plugins/storybook/index.d.ts +1 -1
- package/dist/plugins/storybook/index.js +5 -5
- package/dist/plugins/stryker/index.d.ts +1 -1
- package/dist/plugins/stryker/index.js +3 -2
- package/dist/plugins/stylelint/index.d.ts +1 -1
- package/dist/plugins/stylelint/index.js +4 -3
- package/dist/plugins/svelte/index.d.ts +1 -1
- package/dist/plugins/svelte/index.js +1 -1
- package/dist/plugins/syncpack/index.d.ts +2 -3
- package/dist/plugins/syncpack/index.js +2 -4
- package/dist/plugins/tailwind/index.d.ts +1 -1
- package/dist/plugins/tailwind/index.js +1 -1
- package/dist/plugins/travis/index.d.ts +1 -1
- package/dist/plugins/travis/index.js +2 -3
- package/dist/plugins/ts-node/index.d.ts +15 -0
- package/dist/plugins/ts-node/index.js +12 -0
- package/dist/plugins/tsup/index.d.ts +4 -1
- package/dist/plugins/tsup/index.js +7 -3
- package/dist/plugins/tsx/index.d.ts +9 -0
- package/dist/plugins/tsx/index.js +10 -0
- package/dist/plugins/typedoc/index.d.ts +4 -1
- package/dist/plugins/typedoc/index.js +10 -3
- package/dist/plugins/typedoc/types.d.ts +1 -0
- package/dist/plugins/typescript/index.d.ts +11 -2
- package/dist/plugins/typescript/index.js +19 -34
- package/dist/plugins/unbuild/index.d.ts +1 -1
- package/dist/plugins/unbuild/index.js +3 -3
- package/dist/plugins/unocss/index.d.ts +2 -2
- package/dist/plugins/unocss/index.js +2 -1
- package/dist/plugins/vercel-og/index.d.ts +1 -1
- package/dist/plugins/vercel-og/index.js +1 -1
- package/dist/plugins/vike/index.d.ts +2 -2
- package/dist/plugins/vike/index.js +1 -1
- package/dist/plugins/vite/index.d.ts +3 -3
- package/dist/plugins/vite/index.js +2 -2
- package/dist/plugins/vitest/index.d.ts +4 -1
- package/dist/plugins/vitest/index.js +31 -20
- package/dist/plugins/vue/index.d.ts +1 -1
- package/dist/plugins/vue/index.js +10 -10
- package/dist/plugins/webdriver-io/index.d.ts +1 -1
- package/dist/plugins/webdriver-io/index.js +3 -2
- package/dist/plugins/webpack/index.d.ts +3 -5
- package/dist/plugins/webpack/index.js +18 -19
- package/dist/plugins/wireit/index.d.ts +1 -1
- package/dist/plugins/wireit/index.js +2 -2
- package/dist/plugins/wrangler/index.d.ts +1 -1
- package/dist/plugins/wrangler/index.js +3 -2
- package/dist/plugins/xo/index.d.ts +2 -2
- package/dist/plugins/xo/index.js +4 -4
- package/dist/plugins/yorkie/index.d.ts +1 -1
- package/dist/plugins/yorkie/index.js +6 -5
- package/dist/plugins.d.ts +7 -4
- package/dist/plugins.js +17 -10
- package/dist/reporters/symbols.js +1 -1
- package/dist/types/PluginNames.d.ts +2 -0
- package/dist/types/PluginNames.js +86 -0
- package/dist/types/args.d.ts +14 -0
- package/dist/types/config.d.ts +84 -21
- package/dist/types/package-json.d.ts +10 -0
- package/dist/types/project.d.ts +18 -0
- package/dist/typescript/get-imports-and-exports.d.ts +1 -11
- package/dist/typescript/get-imports-and-exports.js +3 -1
- package/dist/typescript/visitors/dynamic-imports/importCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/importType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/jsDocType.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/requireCall.d.ts +1 -1
- package/dist/typescript/visitors/dynamic-imports/resolveCall.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportAssignment.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportKeyword.d.ts +1 -1
- package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/exports/index.d.ts +1 -1
- package/dist/typescript/visitors/exports/moduleExportsAccessExpression.d.ts +1 -1
- package/dist/typescript/visitors/imports/importDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/importEqualsDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/imports/index.d.ts +1 -1
- package/dist/typescript/visitors/imports/reExportDeclaration.d.ts +1 -1
- package/dist/typescript/visitors/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/bun.d.ts +1 -1
- package/dist/typescript/visitors/scripts/execa.d.ts +1 -1
- package/dist/typescript/visitors/scripts/index.d.ts +1 -1
- package/dist/typescript/visitors/scripts/zx.d.ts +1 -1
- package/dist/util/create-workspace-graph.d.ts +1 -1
- package/dist/util/create-workspace-graph.js +7 -7
- package/dist/util/debug.d.ts +2 -2
- package/dist/util/debug.js +1 -1
- package/dist/util/glob.js +2 -2
- package/dist/util/{handle-dependency.d.ts → handle-referenced-dependency.d.ts} +2 -1
- package/dist/util/handle-referenced-dependency.js +82 -0
- package/dist/util/input.d.ts +37 -0
- package/dist/util/input.js +36 -0
- package/dist/util/map-workspaces.d.ts +5 -2
- package/dist/util/map-workspaces.js +6 -6
- package/dist/util/modules.d.ts +1 -0
- package/dist/util/modules.js +4 -3
- package/dist/util/object.d.ts +1 -0
- package/dist/util/object.js +19 -0
- package/dist/util/plugin-config.d.ts +24 -0
- package/dist/util/plugin-config.js +32 -0
- package/dist/util/plugin.d.ts +3 -31
- package/dist/util/plugin.js +9 -54
- package/dist/util/regex.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -10
- package/schema.json +28 -0
- package/dist/binaries/resolvers/bun.d.ts +0 -2
- package/dist/binaries/resolvers/c8.d.ts +0 -2
- package/dist/binaries/resolvers/c8.js +0 -11
- package/dist/binaries/resolvers/dotenv.d.ts +0 -2
- package/dist/binaries/resolvers/dotenv.js +0 -7
- package/dist/binaries/resolvers/fallback.d.ts +0 -2
- package/dist/binaries/resolvers/fallback.js +0 -26
- package/dist/binaries/resolvers/index.d.ts +0 -15
- package/dist/binaries/resolvers/index.js +0 -26
- package/dist/binaries/resolvers/node.js +0 -11
- package/dist/binaries/resolvers/nodemon.d.ts +0 -2
- package/dist/binaries/resolvers/nodemon.js +0 -16
- package/dist/binaries/resolvers/npx.d.ts +0 -2
- package/dist/binaries/resolvers/nx.d.ts +0 -2
- package/dist/binaries/resolvers/nx.js +0 -9
- package/dist/binaries/resolvers/pnpm.d.ts +0 -2
- package/dist/binaries/resolvers/rollup.d.ts +0 -2
- package/dist/binaries/resolvers/rollup.js +0 -12
- package/dist/binaries/resolvers/ts-node.d.ts +0 -2
- package/dist/binaries/resolvers/ts-node.js +0 -16
- package/dist/binaries/resolvers/tsx.d.ts +0 -2
- package/dist/binaries/resolvers/tsx.js +0 -6
- package/dist/binaries/resolvers/yarn.d.ts +0 -2
- package/dist/binaries/types.d.ts +0 -11
- package/dist/types/plugins.d.ts +0 -42
- package/dist/util/handle-dependency.js +0 -63
- package/dist/util/protocols.d.ts +0 -9
- package/dist/util/protocols.js +0 -9
- /package/dist/{binaries/types.js → types/args.js} +0 -0
- /package/dist/types/{plugins.js → project.js} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { isInternal, toAbsolute } from '
|
|
2
|
-
import { load
|
|
1
|
+
import { isInternal, toAbsolute } from '../../util/path.js';
|
|
2
|
+
import { load } from '../../util/plugin.js';
|
|
3
3
|
export const resolveDependencies = async (config, options) => {
|
|
4
4
|
const { reporter } = config;
|
|
5
5
|
const { configFileDir } = options;
|
|
6
|
-
const resolve = (specifier) => resolveEntry(options, specifier);
|
|
7
6
|
const reporters = reporter ? new Set([reporter]) : new Set();
|
|
8
7
|
if (reporter === 'cypress-multi-reporters' && config.reporterOptions?.configFile) {
|
|
9
8
|
const { configFile } = config.reporterOptions;
|
|
@@ -14,7 +13,7 @@ export const resolveDependencies = async (config, options) => {
|
|
|
14
13
|
const { reporterEnabled: reporterConcatenatedNames } = reporterConfig;
|
|
15
14
|
const reporterNames = reporterConcatenatedNames.split(',');
|
|
16
15
|
for (const reporterName of reporterNames) {
|
|
17
|
-
reporters.add(
|
|
16
|
+
reporters.add(reporterName.trim());
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import type { CypressConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
import { resolveDependencies } from './helpers.js';
|
|
4
4
|
const title = 'Cypress';
|
|
5
5
|
const enablers = ['cypress'];
|
|
@@ -18,10 +18,11 @@ const resolveEntryPaths = async (localConfig) => {
|
|
|
18
18
|
return [
|
|
19
19
|
...(specPatterns.length > 0 ? specPatterns : TEST_FILE_PATTERNS),
|
|
20
20
|
...(supportFiles.length > 0 ? supportFiles : SUPPORT_FILE_PATTERNS),
|
|
21
|
-
].map(
|
|
21
|
+
].map(toEntry);
|
|
22
22
|
};
|
|
23
|
-
const resolveConfig = (config, options) => {
|
|
24
|
-
|
|
23
|
+
const resolveConfig = async (config, options) => {
|
|
24
|
+
const inputs = await resolveDependencies(config, options);
|
|
25
|
+
return inputs.map(toDeferResolve);
|
|
25
26
|
};
|
|
26
27
|
export default {
|
|
27
28
|
title,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Drizzle';
|
|
4
4
|
const enablers = ['drizzle-kit'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -7,7 +7,7 @@ const config = ['drizzle.config.{ts,js,json}'];
|
|
|
7
7
|
const resolveConfig = config => {
|
|
8
8
|
if (!config.schema)
|
|
9
9
|
return [];
|
|
10
|
-
return [config.schema].flat().map(
|
|
10
|
+
return [config.schema].flat().map(id => toProductionEntry(id));
|
|
11
11
|
};
|
|
12
12
|
export default {
|
|
13
13
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import { DummyEleventyConfig } from './helpers.js';
|
|
3
3
|
import type { EleventyConfig } from './types.js';
|
|
4
4
|
type T = Partial<EleventyConfig> | ((arg: DummyEleventyConfig) => Promise<Partial<EleventyConfig>>);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isDirectory } from '#p/util/fs.js';
|
|
2
|
-
import { isInNodeModules, join } from '#p/util/path.js';
|
|
3
|
-
import { hasDependency } from '#p/util/plugin.js';
|
|
4
|
-
import { toProductionEntryPattern } from '#p/util/protocols.js';
|
|
5
1
|
import { DEFAULT_EXTENSIONS } from '../../constants.js';
|
|
2
|
+
import { isDirectory } from '../../util/fs.js';
|
|
3
|
+
import { toDeferResolve, toProductionEntry } from '../../util/input.js';
|
|
4
|
+
import { isInNodeModules, join } from '../../util/path.js';
|
|
5
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
6
6
|
import { DummyEleventyConfig, defaultEleventyConfig } from './helpers.js';
|
|
7
7
|
const title = 'Eleventy';
|
|
8
8
|
const enablers = ['@11ty/eleventy'];
|
|
@@ -33,7 +33,7 @@ const resolveEntryPaths = async (localConfig, options) => {
|
|
|
33
33
|
join(inputDir, `**/*.{${typeof templateFormats === 'string' ? templateFormats : templateFormats.join(',')}}`),
|
|
34
34
|
join(inputDir, '**/*.11tydata.js'),
|
|
35
35
|
...copiedEntries,
|
|
36
|
-
].map(
|
|
36
|
+
].map(id => toProductionEntry(id));
|
|
37
37
|
};
|
|
38
38
|
const resolveConfig = async (localConfig) => {
|
|
39
39
|
const dummyUserConfig = new DummyEleventyConfig();
|
|
@@ -44,7 +44,7 @@ const resolveConfig = async (localConfig) => {
|
|
|
44
44
|
if (isInNodeModules(path))
|
|
45
45
|
copiedPackages.add(path);
|
|
46
46
|
}
|
|
47
|
-
return [...copiedPackages];
|
|
47
|
+
return [...copiedPackages].map(id => toDeferResolve(id));
|
|
48
48
|
};
|
|
49
49
|
export default {
|
|
50
50
|
title,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { PluginOptions } from '../../types/
|
|
2
|
-
import type
|
|
3
|
-
type
|
|
4
|
-
export declare const
|
|
5
|
-
export {};
|
|
1
|
+
import type { PluginOptions } from '../../types/config.js';
|
|
2
|
+
import { type ConfigInput, type Input } from '../../util/input.js';
|
|
3
|
+
import type { ESLintConfig, OverrideConfig } from './types.js';
|
|
4
|
+
export declare const getDependencies: (config: ESLintConfig | OverrideConfig, options: PluginOptions) => (Input | ConfigInput)[];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { compact } from '../../util/array.js';
|
|
2
|
+
import { toConfig, toDeferResolve } from '../../util/input.js';
|
|
3
|
+
import { getPackageNameFromFilePath, getPackageNameFromModuleSpecifier } from '../../util/modules.js';
|
|
4
|
+
import { isAbsolute, isInternal } from '../../util/path.js';
|
|
5
5
|
import { getDependenciesFromConfig } from '../babel/index.js';
|
|
6
|
-
const getDependencies = (config) => {
|
|
7
|
-
const extendsSpecifiers = config.extends ? [config.extends].flat().map(resolveExtendSpecifier) : [];
|
|
6
|
+
export const getDependencies = (config, options) => {
|
|
7
|
+
const extendsSpecifiers = config.extends ? compact([config.extends].flat().map(resolveExtendSpecifier)) : [];
|
|
8
8
|
if (extendsSpecifiers.some(specifier => specifier?.startsWith('eslint-plugin-prettier')))
|
|
9
9
|
extendsSpecifiers.push('eslint-config-prettier');
|
|
10
|
+
const extendConfigs = extendsSpecifiers.map(specifier => toConfig('eslint', specifier, options.configFilePath));
|
|
10
11
|
const plugins = config.plugins ? config.plugins.map(resolvePluginSpecifier) : [];
|
|
11
12
|
const parser = config.parser ?? config.parserOptions?.parser;
|
|
12
13
|
const babelDependencies = config.parserOptions?.babelOptions
|
|
@@ -14,32 +15,9 @@ const getDependencies = (config) => {
|
|
|
14
15
|
: [];
|
|
15
16
|
const settings = config.settings ? getDependenciesFromSettings(config.settings) : [];
|
|
16
17
|
const rules = getDependenciesFromRules({});
|
|
17
|
-
const overrides = config.overrides ? [config.overrides].flat().flatMap(getDependencies) : [];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const getDependenciesDeep = async (localConfig, options, dependencies = new Set()) => {
|
|
21
|
-
const { configFileDir } = options;
|
|
22
|
-
const addAll = (deps) => {
|
|
23
|
-
for (const dependency of deps)
|
|
24
|
-
dependencies.add(dependency);
|
|
25
|
-
};
|
|
26
|
-
if (localConfig) {
|
|
27
|
-
if (localConfig.extends) {
|
|
28
|
-
for (const extend of [localConfig.extends].flat()) {
|
|
29
|
-
if (isInternal(extend)) {
|
|
30
|
-
const filePath = resolve(toAbsolute(extend, configFileDir), configFileDir);
|
|
31
|
-
if (filePath) {
|
|
32
|
-
dependencies.add(filePath);
|
|
33
|
-
const localConfig = await load(filePath);
|
|
34
|
-
const opts = { ...options, configFileDir: dirname(filePath), configFileName: basename(filePath) };
|
|
35
|
-
addAll(await getDependenciesDeep(localConfig, opts, dependencies));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
addAll(getDependencies(localConfig));
|
|
41
|
-
}
|
|
42
|
-
return dependencies;
|
|
18
|
+
const overrides = config.overrides ? [config.overrides].flat().flatMap(d => getDependencies(d, options)) : [];
|
|
19
|
+
const x = compact([...extendsSpecifiers, ...plugins, parser, ...settings, ...rules]).map(toDeferResolve);
|
|
20
|
+
return [...extendConfigs, ...x, ...babelDependencies, ...overrides];
|
|
43
21
|
};
|
|
44
22
|
const isQualifiedSpecifier = (specifier) => specifier === 'eslint' ||
|
|
45
23
|
/\/eslint-(config|plugin)$/.test(specifier) ||
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hasDependency } from '
|
|
2
|
-
import {
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { getDependencies } from './helpers.js';
|
|
3
3
|
const title = 'ESLint';
|
|
4
4
|
const enablers = ['eslint', '@eslint/js'];
|
|
5
5
|
const isEnabled = ({ dependencies, manifest, config }) => hasDependency(dependencies, enablers) ||
|
|
@@ -8,10 +8,7 @@ const isEnabled = ({ dependencies, manifest, config }) => hasDependency(dependen
|
|
|
8
8
|
const packageJsonPath = 'eslintConfig';
|
|
9
9
|
const entry = ['eslint.config.{js,cjs,mjs}'];
|
|
10
10
|
const config = ['.eslintrc', '.eslintrc.{js,json,cjs}', '.eslintrc.{yml,yaml}', 'package.json'];
|
|
11
|
-
const resolveConfig =
|
|
12
|
-
const dependencies = await getDependenciesDeep(localConfig, options);
|
|
13
|
-
return Array.from(dependencies);
|
|
14
|
-
};
|
|
11
|
+
const resolveConfig = (localConfig, options) => getDependencies(localConfig, options);
|
|
15
12
|
export default {
|
|
16
13
|
title,
|
|
17
14
|
enablers,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve, toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Gatsby';
|
|
3
4
|
const enablers = ['gatsby', 'gatsby-cli'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -14,7 +15,9 @@ const production = [
|
|
|
14
15
|
const resolveConfig = async (localConfig, options) => {
|
|
15
16
|
const { configFileName } = options;
|
|
16
17
|
if (/gatsby-config/.test(configFileName)) {
|
|
17
|
-
return localConfig.plugins
|
|
18
|
+
return localConfig.plugins
|
|
19
|
+
.map(plugin => (typeof plugin === 'string' ? plugin : plugin.resolve))
|
|
20
|
+
.map(toDeferResolve);
|
|
18
21
|
}
|
|
19
22
|
if (/gatsby-node/.test(configFileName)) {
|
|
20
23
|
const plugins = new Set();
|
|
@@ -23,7 +26,7 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
23
26
|
if (typeof _config.onCreateBabelConfig === 'function') {
|
|
24
27
|
_config.onCreateBabelConfig({ actions });
|
|
25
28
|
}
|
|
26
|
-
return Array.from(plugins);
|
|
29
|
+
return Array.from(plugins).map(toDependency);
|
|
27
30
|
}
|
|
28
31
|
return [];
|
|
29
32
|
};
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { _firstGlob } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { _firstGlob } from '../../util/glob.js';
|
|
2
|
+
import { isDeferResolveEntry, toEntry } from '../../util/input.js';
|
|
3
|
+
import { findByKeyDeep } from '../../util/object.js';
|
|
4
|
+
import { join, relative } from '../../util/path.js';
|
|
5
5
|
const title = 'GitHub Actions';
|
|
6
6
|
const enablers = 'This plugin is enabled when a `.yml` or `.yaml` file is found in the `.github/workflows` folder.';
|
|
7
7
|
const isEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: ['.github/workflows/*.{yml,yaml}'] }));
|
|
8
8
|
const config = ['.github/workflows/*.{yml,yaml}', '.github/**/action.{yml,yaml}'];
|
|
9
9
|
const isString = (value) => typeof value === 'string';
|
|
10
10
|
const resolveConfig = async (config, options) => {
|
|
11
|
-
const { configFileDir, configFileName } = options;
|
|
12
|
-
const
|
|
11
|
+
const { configFileDir, configFileName, rootCwd, getInputsFromScripts } = options;
|
|
12
|
+
const inputs = new Set();
|
|
13
|
+
const jobs = findByKeyDeep(config, 'steps');
|
|
14
|
+
for (const steps of jobs) {
|
|
15
|
+
const action = steps.steps.find(step => step.uses?.startsWith('actions/checkout@') && typeof step.with?.path === 'string' && !step.with.repository);
|
|
16
|
+
const path = action?.with?.path;
|
|
17
|
+
for (const step of steps.steps) {
|
|
18
|
+
const workingDir = step['working-directory'];
|
|
19
|
+
const dir = join(rootCwd, path && workingDir ? relative(workingDir, path) : workingDir ? workingDir : '.');
|
|
20
|
+
if (step.run) {
|
|
21
|
+
for (const input of getInputsFromScripts([step.run], { knownBinsOnly: true })) {
|
|
22
|
+
if (isDeferResolveEntry(input) && path && !workingDir)
|
|
23
|
+
input.specifier = relative(join(dir, path), join(rootCwd, input.specifier));
|
|
24
|
+
inputs.add({ ...input, dir });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
13
29
|
const getActionDependencies = () => {
|
|
14
30
|
const isActionManifest = configFileName === 'action.yml' || configFileName === 'action.yaml';
|
|
15
31
|
if (!(isActionManifest && config?.runs?.using?.startsWith('node')))
|
|
@@ -17,7 +33,7 @@ const resolveConfig = async (config, options) => {
|
|
|
17
33
|
const scripts = [config.runs.pre, config.runs.main, config.runs.post].filter(isString);
|
|
18
34
|
return scripts.map(script => join(configFileDir, script));
|
|
19
35
|
};
|
|
20
|
-
return [...getActionDependencies()
|
|
36
|
+
return [...getActionDependencies().map(toEntry), ...inputs];
|
|
21
37
|
};
|
|
22
38
|
export default {
|
|
23
39
|
title,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { GraphqlCodegenTypes, GraphqlConfigTypes, GraphqlProjectsConfigTypes } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { toDependency, toEntry } from '../../util/input.js';
|
|
2
|
+
import { get } from '../../util/object.js';
|
|
3
|
+
import { isInternal } from '../../util/path.js';
|
|
4
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
5
5
|
import { isConfigurationOutput, isGraphqlConfigTypes, isGraphqlProjectsConfigTypes } from './types.js';
|
|
6
6
|
const title = 'GraphQL Codegen';
|
|
7
7
|
const enablers = [/^@graphql-codegen\//, 'graphql-config'];
|
|
@@ -47,10 +47,10 @@ const resolveConfig = config => {
|
|
|
47
47
|
if (typeof plugin !== 'string')
|
|
48
48
|
return [];
|
|
49
49
|
if (isInternal(plugin))
|
|
50
|
-
return [
|
|
51
|
-
return [plugin.includes('codegen-') ? plugin : `@graphql-codegen/${plugin}`];
|
|
50
|
+
return [toEntry(plugin)];
|
|
51
|
+
return [plugin.includes('codegen-') ? plugin : `@graphql-codegen/${plugin}`].map(toDependency);
|
|
52
52
|
});
|
|
53
|
-
return [...presets, ...flatPlugins, ...nestedPlugins];
|
|
53
|
+
return [...presets, ...flatPlugins, ...nestedPlugins].map(id => (typeof id === 'string' ? toDependency(id) : id));
|
|
54
54
|
};
|
|
55
55
|
export default {
|
|
56
56
|
title,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getGitHookPaths } from '../../util/git.js';
|
|
2
|
-
import {
|
|
2
|
+
import { toDependency } from '../../util/input.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
4
|
const title = 'husky';
|
|
4
5
|
const enablers = ['husky'];
|
|
5
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -12,10 +13,10 @@ const resolveConfig = (script, options) => {
|
|
|
12
13
|
const hooks = script.hooks;
|
|
13
14
|
if (hooks) {
|
|
14
15
|
const scripts = Object.values(hooks);
|
|
15
|
-
return ['husky', ...
|
|
16
|
+
return [toDependency('husky'), ...options.getInputsFromScripts(scripts, { ...options })];
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return options.getInputsFromScripts(String(script), { knownBinsOnly: true });
|
|
19
20
|
};
|
|
20
21
|
export default {
|
|
21
22
|
title,
|