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
package/dist/index.js
CHANGED
|
@@ -6,19 +6,19 @@ import { IssueCollector } from './IssueCollector.js';
|
|
|
6
6
|
import { IssueFixer } from './IssueFixer.js';
|
|
7
7
|
import { PrincipalFactory } from './PrincipalFactory.js';
|
|
8
8
|
import { WorkspaceWorker } from './WorkspaceWorker.js';
|
|
9
|
-
import {
|
|
9
|
+
import { _getInputsFromScripts } from './binaries/index.js';
|
|
10
10
|
import { getCompilerExtensions, getIncludedCompilers } from './compilers/index.js';
|
|
11
|
-
import { getFilteredScripts } from './manifest/helpers.js';
|
|
12
11
|
import { debugLog, debugLogArray, debugLogObject } from './util/debug.js';
|
|
13
12
|
import { getOrCreateFileNode, updateImportMap } from './util/dependency-graph.js';
|
|
14
13
|
import { getGitIgnoredHandler } from './util/glob-core.js';
|
|
15
14
|
import { _glob, negate } from './util/glob.js';
|
|
16
|
-
import { getReferencedDependencyHandler } from './util/handle-dependency.js';
|
|
15
|
+
import { getReferencedDependencyHandler } from './util/handle-referenced-dependency.js';
|
|
17
16
|
import { getHasStrictlyNsReferences, getType } from './util/has-strictly-ns-references.js';
|
|
17
|
+
import { isConfigPattern, isEntry, isProductionEntry, toProductionEntry } from './util/input.js';
|
|
18
18
|
import { getIsIdentifierReferencedHandler } from './util/is-identifier-referenced.js';
|
|
19
19
|
import { getPackageNameFromModuleSpecifier } from './util/modules.js';
|
|
20
20
|
import { getEntryPathsFromManifest } from './util/package-json.js';
|
|
21
|
-
import { dirname, join } from './util/path.js';
|
|
21
|
+
import { dirname, isAbsolute, join, relative } from './util/path.js';
|
|
22
22
|
import { findMatch } from './util/regex.js';
|
|
23
23
|
import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from './util/tag.js';
|
|
24
24
|
import { augmentWorkspace, getToSourcePathHandler } from './util/to-source-path.js';
|
|
@@ -52,47 +52,39 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
52
52
|
const isReportClassMembers = report.classMembers;
|
|
53
53
|
const isSkipLibs = !(isIncludeLibs || isReportClassMembers);
|
|
54
54
|
const collector = new IssueCollector({ cwd, rules, filters });
|
|
55
|
+
const allConfigFilePaths = new Set();
|
|
55
56
|
const enabledPluginsStore = new Map();
|
|
56
57
|
const o = () => workspaces.map(w => ({ pkgName: w.pkgName, name: w.name, config: w.config, ancestors: w.ancestors }));
|
|
57
58
|
debugLogObject('*', 'Included workspaces', () => workspaces.map(w => w.pkgName));
|
|
58
59
|
debugLogObject('*', 'Included workspace configs', o);
|
|
59
60
|
const isGitIgnored = await getGitIgnoredHandler({ cwd, gitignore });
|
|
60
61
|
const toSourceFilePath = getToSourcePathHandler(chief);
|
|
61
|
-
const
|
|
62
|
+
const getReferencedInternalFilePath = getReferencedDependencyHandler(collector, deputy, chief, isGitIgnored);
|
|
62
63
|
const shouldIgnore = getShouldIgnoreHandler(isProduction);
|
|
63
64
|
const shouldIgnoreTags = getShouldIgnoreTagHandler(tags);
|
|
64
65
|
for (const workspace of workspaces) {
|
|
65
|
-
const { name, dir,
|
|
66
|
-
streamer.cast(`Analyzing workspace ${name}...`);
|
|
66
|
+
const { name, dir, manifestPath } = workspace;
|
|
67
67
|
const manifest = chief.getManifestForWorkspace(name);
|
|
68
|
-
const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);
|
|
69
68
|
if (!manifest)
|
|
70
69
|
continue;
|
|
70
|
+
const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);
|
|
71
71
|
deputy.addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreBinaries, ignoreDependencies });
|
|
72
|
+
}
|
|
73
|
+
for (const workspace of workspaces) {
|
|
74
|
+
const { name, dir, ancestors, pkgName } = workspace;
|
|
75
|
+
streamer.cast(`Analyzing workspace ${name}...`);
|
|
76
|
+
const manifest = chief.getManifestForWorkspace(name);
|
|
77
|
+
if (!manifest) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
72
80
|
const dependencies = deputy.getDependencies(name);
|
|
73
81
|
const compilers = getIncludedCompilers(chief.config.syncCompilers, chief.config.asyncCompilers, dependencies);
|
|
74
82
|
const extensions = getCompilerExtensions(compilers);
|
|
75
83
|
const config = chief.getConfigForWorkspace(name, extensions);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const manifestScriptNames = new Set(Object.keys(manifest.scripts ?? {}));
|
|
79
|
-
const { isFile, compilerOptions, definitionPaths } = await loadTSConfig(join(dir, tsConfigFile ?? 'tsconfig.json'));
|
|
84
|
+
const tsConfigFilePath = join(dir, tsConfigFile ?? 'tsconfig.json');
|
|
85
|
+
const { isFile, compilerOptions, definitionPaths } = await loadTSConfig(tsConfigFilePath);
|
|
80
86
|
if (isFile)
|
|
81
87
|
augmentWorkspace(workspace, dir, compilerOptions);
|
|
82
|
-
const principal = factory.getPrincipal({
|
|
83
|
-
cwd: dir,
|
|
84
|
-
paths: config.paths,
|
|
85
|
-
isFile,
|
|
86
|
-
compilerOptions,
|
|
87
|
-
compilers,
|
|
88
|
-
pkgName,
|
|
89
|
-
isIsolateWorkspaces,
|
|
90
|
-
isSkipLibs,
|
|
91
|
-
isWatch,
|
|
92
|
-
toSourceFilePath,
|
|
93
|
-
isCache,
|
|
94
|
-
cacheLocation,
|
|
95
|
-
});
|
|
96
88
|
const worker = new WorkspaceWorker({
|
|
97
89
|
name,
|
|
98
90
|
dir,
|
|
@@ -100,29 +92,64 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
100
92
|
config,
|
|
101
93
|
manifest,
|
|
102
94
|
dependencies,
|
|
95
|
+
getReferencedInternalFilePath: (input) => getReferencedInternalFilePath(input, workspace),
|
|
103
96
|
isProduction,
|
|
104
97
|
isStrict,
|
|
105
98
|
rootIgnore: chief.config.ignore,
|
|
106
99
|
negatedWorkspacePatterns: chief.getNegatedWorkspacePatterns(name),
|
|
100
|
+
ignoredWorkspacePatterns: chief.getIgnoredWorkspacesFor(name),
|
|
107
101
|
enabledPluginsInAncestors: ancestors.flatMap(ancestor => enabledPluginsStore.get(ancestor) ?? []),
|
|
108
102
|
isCache,
|
|
109
103
|
cacheLocation,
|
|
104
|
+
allConfigFilePaths,
|
|
110
105
|
});
|
|
111
106
|
await worker.init();
|
|
112
|
-
|
|
107
|
+
const deps = new Set();
|
|
113
108
|
debugLogArray(name, 'Definition paths', definitionPaths);
|
|
109
|
+
for (const id of definitionPaths)
|
|
110
|
+
deps.add(toProductionEntry(id, { containingFilePath: tsConfigFilePath }));
|
|
114
111
|
const ignore = worker.getIgnorePatterns();
|
|
115
112
|
const sharedGlobOptions = { cwd, dir, gitignore };
|
|
116
113
|
collector.addIgnorePatterns(ignore.map(pattern => join(cwd, pattern)));
|
|
117
|
-
const options = { manifestScriptNames, cwd: dir, dependencies };
|
|
118
|
-
const dependenciesFromManifest = _getDependenciesFromScripts(manifestScripts, options);
|
|
119
|
-
principal.addReferencedDependencies(name, new Set(dependenciesFromManifest.map(id => [manifestPath, id])));
|
|
120
114
|
const entryPathsFromManifest = await getEntryPathsFromManifest(manifest, { ...sharedGlobOptions, ignore });
|
|
121
115
|
debugLogArray(name, 'Entry paths in package.json', entryPathsFromManifest);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
for (const id of entryPathsFromManifest.map(id => toProductionEntry(id)))
|
|
117
|
+
deps.add(id);
|
|
118
|
+
const dependenciesFromPlugins = await worker.findDependenciesByPlugins();
|
|
119
|
+
for (const id of dependenciesFromPlugins)
|
|
120
|
+
deps.add(id);
|
|
121
|
+
enabledPluginsStore.set(name, worker.enabledPlugins);
|
|
122
|
+
const principal = factory.createPrincipal({
|
|
123
|
+
cwd: dir,
|
|
124
|
+
paths: config.paths,
|
|
125
|
+
isFile,
|
|
126
|
+
compilerOptions,
|
|
127
|
+
compilers,
|
|
128
|
+
pkgName,
|
|
129
|
+
isIsolateWorkspaces,
|
|
130
|
+
isSkipLibs,
|
|
131
|
+
isWatch,
|
|
132
|
+
toSourceFilePath,
|
|
133
|
+
isCache,
|
|
134
|
+
cacheLocation,
|
|
135
|
+
});
|
|
136
|
+
const entryFilePatterns = new Set();
|
|
137
|
+
const productionEntryFilePatterns = new Set();
|
|
138
|
+
for (const dependency of deps) {
|
|
139
|
+
const s = dependency.specifier;
|
|
140
|
+
if (isEntry(dependency)) {
|
|
141
|
+
entryFilePatterns.add(isAbsolute(s) ? relative(dir, s) : s);
|
|
142
|
+
}
|
|
143
|
+
else if (isProductionEntry(dependency)) {
|
|
144
|
+
productionEntryFilePatterns.add(isAbsolute(s) ? relative(dir, s) : s);
|
|
145
|
+
}
|
|
146
|
+
else if (!isConfigPattern(dependency)) {
|
|
147
|
+
const ws = (dependency.containingFilePath && chief.findWorkspaceByFilePath(dependency.containingFilePath)) || workspace;
|
|
148
|
+
const specifierFilePath = getReferencedInternalFilePath(dependency, ws);
|
|
149
|
+
if (specifierFilePath)
|
|
150
|
+
principal.addEntryPath(specifierFilePath);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
126
153
|
if (isProduction) {
|
|
127
154
|
const negatedEntryPatterns = Array.from(entryFilePatterns).map(negate);
|
|
128
155
|
{
|
|
@@ -160,7 +187,7 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
160
187
|
principal.addProjectPath(projectPath);
|
|
161
188
|
}
|
|
162
189
|
{
|
|
163
|
-
const patterns = [...entryFilePatterns, ...productionEntryFilePatterns];
|
|
190
|
+
const patterns = worker.getPluginEntryFilePatterns([...entryFilePatterns, ...productionEntryFilePatterns]);
|
|
164
191
|
const pluginWorkspaceEntryPaths = await _glob({ ...sharedGlobOptions, patterns });
|
|
165
192
|
debugLogArray(name, 'Plugin entry paths', pluginWorkspaceEntryPaths);
|
|
166
193
|
principal.addEntryPaths(pluginWorkspaceEntryPaths, { skipExportsAnalysis: true });
|
|
@@ -220,12 +247,21 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
220
247
|
file.internalImportCache = imports.internal;
|
|
221
248
|
graph.set(filePath, file);
|
|
222
249
|
if (scripts && scripts.size > 0) {
|
|
223
|
-
const cwd = dirname(filePath);
|
|
224
250
|
const dependencies = deputy.getDependencies(workspace.name);
|
|
225
251
|
const manifestScriptNames = new Set();
|
|
226
|
-
const
|
|
252
|
+
const rootCwd = cwd;
|
|
253
|
+
const options = {
|
|
254
|
+
cwd: dirname(filePath),
|
|
255
|
+
rootCwd,
|
|
256
|
+
containingFilePath: filePath,
|
|
257
|
+
dependencies,
|
|
258
|
+
manifestScriptNames,
|
|
259
|
+
};
|
|
260
|
+
const specifiers = _getInputsFromScripts(scripts, options);
|
|
227
261
|
for (const specifier of specifiers) {
|
|
228
|
-
|
|
262
|
+
specifier.containingFilePath = filePath;
|
|
263
|
+
specifier.dir = cwd;
|
|
264
|
+
const specifierFilePath = getReferencedInternalFilePath(specifier, workspace);
|
|
229
265
|
if (specifierFilePath)
|
|
230
266
|
analyzeSourceFile(specifierFilePath, principal);
|
|
231
267
|
}
|
|
@@ -234,14 +270,6 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
234
270
|
};
|
|
235
271
|
for (const principal of principals) {
|
|
236
272
|
principal.init();
|
|
237
|
-
for (const [containingFilePath, specifier, workspaceName] of principal.referencedDependencies) {
|
|
238
|
-
const workspace = chief.findWorkspaceByName(workspaceName);
|
|
239
|
-
if (workspace) {
|
|
240
|
-
const specifierFilePath = handleReferencedDependency(specifier, containingFilePath, workspace);
|
|
241
|
-
if (specifierFilePath && !isGitIgnored(specifierFilePath))
|
|
242
|
-
principal.addEntryPath(specifierFilePath);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
273
|
streamer.cast('Running async compilers...');
|
|
246
274
|
await principal.runAsyncCompilers();
|
|
247
275
|
streamer.cast('Analyzing source files...');
|
|
@@ -5,9 +5,5 @@ type LoadPackageManifestOptions = {
|
|
|
5
5
|
cwd: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const loadPackageManifest: ({ dir, packageName, cwd }: LoadPackageManifestOptions) => any;
|
|
8
|
-
|
|
9
|
-
isProduction: boolean;
|
|
10
|
-
scripts?: Scripts;
|
|
11
|
-
};
|
|
12
|
-
export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => Scripts;
|
|
8
|
+
export declare const getFilteredScripts: (scripts: Scripts) => Scripts[];
|
|
13
9
|
export {};
|
package/dist/manifest/helpers.js
CHANGED
|
@@ -14,16 +14,17 @@ export const loadPackageManifest = ({ dir, packageName, cwd }) => {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
export const getFilteredScripts = (
|
|
17
|
+
export const getFilteredScripts = (scripts) => {
|
|
18
18
|
if (!scripts)
|
|
19
|
-
return {};
|
|
20
|
-
if (!isProduction)
|
|
21
|
-
return scripts;
|
|
19
|
+
return [{}, {}];
|
|
22
20
|
const scriptFilter = new Set(['start', 'postinstall']);
|
|
23
|
-
const
|
|
21
|
+
const productionScripts = {};
|
|
22
|
+
const developmentScripts = {};
|
|
24
23
|
for (const scriptName in scripts) {
|
|
25
24
|
if (scriptFilter.has(scriptName))
|
|
26
|
-
|
|
25
|
+
productionScripts[scriptName] = scripts[scriptName];
|
|
26
|
+
else
|
|
27
|
+
developmentScripts[scriptName] = scripts[scriptName];
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return [productionScripts, developmentScripts];
|
|
29
30
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
2
|
import type { PluginConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = '_template';
|
|
3
4
|
const enablers = ['__PLUGIN_NAME__'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -6,8 +7,8 @@ const config = [];
|
|
|
6
7
|
const entry = [];
|
|
7
8
|
const production = [];
|
|
8
9
|
const resolveConfig = async (config) => {
|
|
9
|
-
const
|
|
10
|
-
return [...
|
|
10
|
+
const inputs = config?.plugins ?? [];
|
|
11
|
+
return [...inputs].map(toDeferResolve);
|
|
11
12
|
};
|
|
12
13
|
export default {
|
|
13
14
|
title,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toConfig, toDependency, toProductionEntry } from '../../util/input.js';
|
|
2
|
+
import { join } from '../../util/path.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
4
|
const title = 'Angular';
|
|
5
5
|
const enablers = ['@angular/cli'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
7
|
const config = ['angular.json'];
|
|
8
8
|
const production = [];
|
|
9
9
|
const resolveConfig = async (config, options) => {
|
|
10
|
-
const { cwd } = options;
|
|
10
|
+
const { cwd, configFilePath } = options;
|
|
11
11
|
if (!config?.projects)
|
|
12
12
|
return [];
|
|
13
|
-
const
|
|
13
|
+
const inputs = new Set();
|
|
14
14
|
for (const project of Object.values(config.projects)) {
|
|
15
15
|
if (!project.architect)
|
|
16
16
|
return [];
|
|
@@ -18,23 +18,26 @@ const resolveConfig = async (config, options) => {
|
|
|
18
18
|
const { options: opts } = target;
|
|
19
19
|
const [packageName] = typeof target.builder === 'string' ? target.builder.split(':') : [];
|
|
20
20
|
if (typeof packageName === 'string')
|
|
21
|
-
|
|
21
|
+
inputs.add(toDependency(packageName));
|
|
22
22
|
if (opts) {
|
|
23
23
|
if ('main' in opts && typeof opts.main === 'string') {
|
|
24
|
-
|
|
24
|
+
inputs.add(toProductionEntry(join(cwd, opts.main)));
|
|
25
25
|
}
|
|
26
26
|
if ('browser' in opts && typeof opts.browser === 'string') {
|
|
27
|
-
|
|
27
|
+
inputs.add(toProductionEntry(join(cwd, opts.browser)));
|
|
28
28
|
}
|
|
29
29
|
if ('ssr' in opts && opts.ssr && typeof opts.ssr === 'object') {
|
|
30
30
|
if ('entry' in opts.ssr && typeof opts.ssr.entry === 'string') {
|
|
31
|
-
|
|
31
|
+
inputs.add(toProductionEntry(join(cwd, opts.ssr.entry)));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
if ('tsConfig' in opts && typeof opts.tsConfig === 'string') {
|
|
35
|
+
inputs.add(toConfig('typescript', opts.tsConfig, configFilePath));
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
return Array.from(
|
|
40
|
+
return Array.from(inputs);
|
|
38
41
|
};
|
|
39
42
|
export default {
|
|
40
43
|
title,
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Astro';
|
|
3
4
|
const enablers = ['astro'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
6
|
const entry = ['astro.config.{js,cjs,mjs,ts}', 'src/content/config.ts'];
|
|
6
7
|
const production = ['src/pages/**/*.{astro,mdx,js,ts}', 'src/content/**/*.mdx'];
|
|
7
8
|
const resolve = options => {
|
|
8
|
-
const {
|
|
9
|
-
const
|
|
9
|
+
const { manifest, isProduction } = options;
|
|
10
|
+
const inputs = [];
|
|
10
11
|
if (!isProduction &&
|
|
11
12
|
manifest.scripts &&
|
|
12
13
|
Object.values(manifest.scripts).some(script => /(?<=^|\s)astro(\s|\s.+\s)check(?=\s|$)/.test(script))) {
|
|
13
|
-
|
|
14
|
+
inputs.push(toDependency('@astrojs/check'));
|
|
14
15
|
}
|
|
15
|
-
return
|
|
16
|
+
return inputs;
|
|
16
17
|
};
|
|
17
18
|
export default {
|
|
18
19
|
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 type { AvaConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Ava';
|
|
4
4
|
const enablers = ['ava'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -19,7 +19,7 @@ const entry = [
|
|
|
19
19
|
const resolveEntryPaths = localConfig => {
|
|
20
20
|
if (typeof localConfig === 'function')
|
|
21
21
|
localConfig = localConfig();
|
|
22
|
-
return (localConfig?.files ?? []).map(
|
|
22
|
+
return (localConfig?.files ?? []).map(toEntry);
|
|
23
23
|
};
|
|
24
24
|
const resolveConfig = async (localConfig, options) => {
|
|
25
25
|
if (typeof localConfig === 'function')
|
|
@@ -27,8 +27,7 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
27
27
|
const nodeArgs = localConfig.nodeArguments ?? [];
|
|
28
28
|
const requireArgs = (localConfig.require ?? []).map(require => `--require ${require}`);
|
|
29
29
|
const fakeCommand = `node ${nodeArgs.join(' ')} ${requireArgs.join(' ')}`;
|
|
30
|
-
|
|
31
|
-
return [...dependencies];
|
|
30
|
+
return options.getInputsFromScripts(fakeCommand, { knownBinsOnly: true });
|
|
32
31
|
};
|
|
33
32
|
export default {
|
|
34
33
|
title,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
|
+
import { type Input } from '../../util/input.js';
|
|
2
3
|
import type { BabelConfig, BabelConfigObj } from './types.js';
|
|
3
|
-
export declare const getDependenciesFromConfig: (config: BabelConfigObj) =>
|
|
4
|
+
export declare const getDependenciesFromConfig: (config: BabelConfigObj) => Input[];
|
|
4
5
|
declare const _default: {
|
|
5
6
|
title: string;
|
|
6
7
|
enablers: RegExp[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { compact } from '
|
|
2
|
-
import {
|
|
1
|
+
import { compact } from '../../util/array.js';
|
|
2
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
4
|
import { api, resolveName } from './helpers.js';
|
|
4
5
|
const title = 'Babel';
|
|
5
6
|
const enablers = [/^@babel\//];
|
|
@@ -11,7 +12,7 @@ export const getDependenciesFromConfig = (config) => {
|
|
|
11
12
|
const plugins = config.plugins?.flatMap(getName).map(name => resolveName(name, 'plugin')) ?? [];
|
|
12
13
|
const nested = config.env ? Object.values(config.env).flatMap(getDependenciesFromConfig) : [];
|
|
13
14
|
const overrides = config.overrides ? [config.overrides].flat().flatMap(getDependenciesFromConfig) : [];
|
|
14
|
-
return compact([...presets, ...plugins, ...nested, ...overrides]);
|
|
15
|
+
return compact([...presets.map(toDeferResolve), ...plugins.map(toDeferResolve), ...nested, ...overrides]);
|
|
15
16
|
};
|
|
16
17
|
const resolveConfig = async (config) => {
|
|
17
18
|
if (typeof config === 'function')
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { argsFrom } from '../../binaries/util.js';
|
|
2
|
+
const title = 'c8';
|
|
3
|
+
const args = {
|
|
4
|
+
args: (args) => args.filter(arg => arg !== 'check-coverage'),
|
|
5
|
+
boolean: ['all', 'check-coverage', 'clean', 'exclude-after-remap', 'per-file', 'skip-full'],
|
|
6
|
+
fromArgs: (parsed, args) => argsFrom(args, parsed._[0]),
|
|
7
|
+
};
|
|
8
|
+
export default {
|
|
9
|
+
title,
|
|
10
|
+
args,
|
|
11
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { isFile } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { isFile } from '../../util/fs.js';
|
|
2
|
+
import { toDependency } from '../../util/input.js';
|
|
3
|
+
import { join } from '../../util/path.js';
|
|
4
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
4
5
|
const title = 'Capacitor';
|
|
5
6
|
const enablers = [/^@capacitor\//];
|
|
6
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -10,7 +11,7 @@ const resolveConfig = async (config, { configFileDir }) => {
|
|
|
10
11
|
const plugins = config.includePlugins ?? [];
|
|
11
12
|
const android = (await exists('android/capacitor.settings.gradle')) ? ['@capacitor/android'] : [];
|
|
12
13
|
const ios = (await exists('ios/App/Podfile')) ? ['@capacitor/ios'] : [];
|
|
13
|
-
return [...plugins, ...android, ...ios];
|
|
14
|
+
return [...plugins, ...android, ...ios].map(toDependency);
|
|
14
15
|
};
|
|
15
16
|
export default {
|
|
16
17
|
title,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Changesets';
|
|
3
4
|
const enablers = ['@changesets/cli'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
6
|
const config = ['.changeset/config.json'];
|
|
6
7
|
const resolveConfig = config => {
|
|
7
|
-
return Array.isArray(config.changelog)
|
|
8
|
+
return (Array.isArray(config.changelog)
|
|
8
9
|
? [config.changelog[0]]
|
|
9
10
|
: typeof config.changelog === 'string'
|
|
10
11
|
? [config.changelog]
|
|
11
|
-
: [];
|
|
12
|
+
: []).map(toDependency);
|
|
12
13
|
};
|
|
13
14
|
export default {
|
|
14
15
|
title,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'Commitizen';
|
|
3
4
|
const enablers = ['commitizen'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
6
|
const packageJsonPath = 'config.commitizen';
|
|
6
7
|
const config = ['.czrc', '.cz.json', 'package.json'];
|
|
7
8
|
const resolveConfig = config => {
|
|
8
|
-
return config.path ? [config.path] : [];
|
|
9
|
+
return config.path ? [toDependency(config.path)] : [];
|
|
9
10
|
};
|
|
10
11
|
export default {
|
|
11
12
|
title,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
4
|
const title = 'commitlint';
|
|
3
5
|
const enablers = ['@commitlint/cli'];
|
|
4
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -19,7 +21,7 @@ const resolveConfig = async (config) => {
|
|
|
19
21
|
? [parserPreset.path ?? parserPreset]
|
|
20
22
|
: []
|
|
21
23
|
: [];
|
|
22
|
-
return [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths];
|
|
24
|
+
return [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths].map(toDependency);
|
|
23
25
|
};
|
|
24
26
|
export default {
|
|
25
27
|
title,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
const title = 'CSpell';
|
|
3
4
|
const enablers = ['cspell'];
|
|
4
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -9,7 +10,7 @@ const config = [
|
|
|
9
10
|
'c{s,S}pell.json',
|
|
10
11
|
];
|
|
11
12
|
const resolveConfig = config => {
|
|
12
|
-
return config.import ?? [];
|
|
13
|
+
return (config.import ?? []).map(toDeferResolve);
|
|
13
14
|
};
|
|
14
15
|
export default {
|
|
15
16
|
title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '../../types/config.js';
|
|
2
2
|
import type { CucumberConfig } from './types.js';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
enablers:
|
|
5
|
+
enablers: string[];
|
|
6
6
|
isEnabled: IsPluginEnabled;
|
|
7
7
|
config: string[];
|
|
8
8
|
entry: string[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
3
|
const title = 'Cucumber';
|
|
4
4
|
const enablers = ['@cucumber/cucumber'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['cucumber.{json,yaml,yml,js,cjs,mjs}'];
|
|
7
7
|
const entry = ['features/**/*.@(js|cjs|mjs)'];
|
|
8
8
|
const resolveEntryPaths = config => {
|
|
9
|
-
return (config?.import ? config.import : []).map(
|
|
9
|
+
return (config?.import ? config.import : []).map(toEntry);
|
|
10
10
|
};
|
|
11
11
|
const resolveConfig = config => {
|
|
12
12
|
const formatters = config?.format ? config.format : [];
|
|
13
13
|
const requires = config?.require ? config.require : [];
|
|
14
|
-
return [...formatters, ...requires];
|
|
14
|
+
return [...formatters, ...requires].map(toDeferResolve);
|
|
15
15
|
};
|
|
16
16
|
export default {
|
|
17
17
|
title,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { PluginOptions } from '
|
|
1
|
+
import type { PluginOptions } from '../../types/config.js';
|
|
2
2
|
import type { CypressConfig } from './types.js';
|
|
3
3
|
export declare const resolveDependencies: (config: CypressConfig, options: PluginOptions) => Promise<string[]>;
|