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,16 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
3
|
-
import { toBinary } from '../../util/protocols.js';
|
|
4
|
-
import { tryResolveFilePath, tryResolveSpecifiers } from '../util.js';
|
|
5
|
-
export const resolve = (binary, args, { cwd, fromArgs }) => {
|
|
6
|
-
const parsed = parseArgs(args, {
|
|
7
|
-
string: ['r', 'exec'],
|
|
8
|
-
alias: { require: ['r', 'loader', 'experimental-loader', 'test-reporter'] },
|
|
9
|
-
});
|
|
10
|
-
return compact([
|
|
11
|
-
toBinary(binary),
|
|
12
|
-
tryResolveFilePath(cwd, parsed._[0]),
|
|
13
|
-
...tryResolveSpecifiers(cwd, [parsed.require].flat()),
|
|
14
|
-
...fromArgs([parsed.exec]),
|
|
15
|
-
]);
|
|
16
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { toBinary } from '../../util/protocols.js';
|
|
3
|
-
export const resolve = (binary, args, { fromArgs }) => {
|
|
4
|
-
const parsed = parseArgs(args);
|
|
5
|
-
const [command] = parsed._;
|
|
6
|
-
if (command === 'exec')
|
|
7
|
-
return [toBinary(binary), ...fromArgs(parsed._.slice(1))];
|
|
8
|
-
return [toBinary(binary)];
|
|
9
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
3
|
-
import { toBinary } from '../../util/protocols.js';
|
|
4
|
-
import { tryResolveSpecifiers } from '../util.js';
|
|
5
|
-
export const resolve = (binary, args, { cwd, fromArgs }) => {
|
|
6
|
-
const safeArgs = args.filter(arg => arg !== '--watch');
|
|
7
|
-
const parsed = parseArgs(safeArgs, { alias: { plugin: 'p' } });
|
|
8
|
-
const watchers = parsed.watch ? fromArgs(Object.values(parsed.watch)) : [];
|
|
9
|
-
const plugins = parsed.plugin ? tryResolveSpecifiers(cwd, [parsed.plugin].flat()) : [];
|
|
10
|
-
const configPlugins = parsed.configPlugin ? tryResolveSpecifiers(cwd, [parsed.configPlugin].flat()) : [];
|
|
11
|
-
return compact([toBinary(binary), ...watchers, ...plugins, ...configPlugins]);
|
|
12
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import parseArgs from 'minimist';
|
|
2
|
-
import { compact } from '../../util/array.js';
|
|
3
|
-
import { toBinary } from '../../util/protocols.js';
|
|
4
|
-
import { tryResolveFilePath, tryResolveSpecifiers } from '../util.js';
|
|
5
|
-
export const resolve = (binary, args, { cwd }) => {
|
|
6
|
-
const parsed = parseArgs(args, {
|
|
7
|
-
string: ['r'],
|
|
8
|
-
boolean: ['transpileOnly', 'compilerHost', 'ignoreDiagnostics', 'swc', 'preferTsExts'],
|
|
9
|
-
alias: { require: ['r'], transpileOnly: ['T'], compilerHost: ['H'], ignoreDiagnostics: ['D'] },
|
|
10
|
-
});
|
|
11
|
-
return compact([
|
|
12
|
-
toBinary(binary),
|
|
13
|
-
tryResolveFilePath(cwd, parsed._[0]),
|
|
14
|
-
...tryResolveSpecifiers(cwd, [parsed.require].flat()),
|
|
15
|
-
]);
|
|
16
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { toBinary } from '../../util/protocols.js';
|
|
2
|
-
import { resolve as resolveNode } from './node.js';
|
|
3
|
-
export const resolve = (binary, args, options) => {
|
|
4
|
-
args = args.map(a => (a === 'watch' ? '--watch' : a));
|
|
5
|
-
return [toBinary(binary), ...resolveNode(binary, args, options)];
|
|
6
|
-
};
|
package/dist/binaries/types.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BaseOptions } from '../types/plugins.js';
|
|
2
|
-
export interface GetDependenciesFromScriptsOptions extends BaseOptions {
|
|
3
|
-
knownGlobalsOnly?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type GetDependenciesFromScripts = (npmScripts: string | string[] | Set<string>, options: GetDependenciesFromScriptsOptions) => string[];
|
|
6
|
-
type FromArgs = (args: string[]) => string[];
|
|
7
|
-
interface BinaryResolverOptions extends GetDependenciesFromScriptsOptions {
|
|
8
|
-
fromArgs: FromArgs;
|
|
9
|
-
}
|
|
10
|
-
export type Resolver = (binary: string, args: string[], options: BinaryResolverOptions) => string[];
|
|
11
|
-
export {};
|
package/dist/types/plugins.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { EnsuredPluginConfiguration, IgnorePatterns, WorkspaceConfiguration } from './config.js';
|
|
2
|
-
import type { PackageJson } from './package-json.js';
|
|
3
|
-
import type { DependencySet } from './workspace.js';
|
|
4
|
-
export interface BaseOptions {
|
|
5
|
-
rootCwd?: string;
|
|
6
|
-
cwd: string;
|
|
7
|
-
manifestScriptNames: Set<string>;
|
|
8
|
-
dependencies: DependencySet;
|
|
9
|
-
}
|
|
10
|
-
type IsPluginEnabledOptions = {
|
|
11
|
-
cwd: string;
|
|
12
|
-
manifest: PackageJson;
|
|
13
|
-
dependencies: Set<string>;
|
|
14
|
-
config: WorkspaceConfiguration;
|
|
15
|
-
};
|
|
16
|
-
export type IsPluginEnabled = (options: IsPluginEnabledOptions) => boolean | Promise<boolean>;
|
|
17
|
-
export interface PluginOptions extends BaseOptions {
|
|
18
|
-
manifest: PackageJson;
|
|
19
|
-
config: EnsuredPluginConfiguration;
|
|
20
|
-
configFileDir: string;
|
|
21
|
-
configFileName: string;
|
|
22
|
-
isProduction: boolean;
|
|
23
|
-
enabledPlugins: string[];
|
|
24
|
-
}
|
|
25
|
-
export type ResolveEntryPaths<T = any> = (config: T, options: PluginOptions) => Promise<string[]> | string[];
|
|
26
|
-
export type ResolveConfig<T = any> = (config: T, options: PluginOptions) => Promise<string[]> | string[];
|
|
27
|
-
export type Resolve = (options: PluginOptions) => Promise<string[]> | string[];
|
|
28
|
-
export interface Plugin {
|
|
29
|
-
title: string;
|
|
30
|
-
enablers: IgnorePatterns | string;
|
|
31
|
-
note?: string;
|
|
32
|
-
packageJsonPath?: string | ((manifest: PackageJson) => string);
|
|
33
|
-
isEnabled: IsPluginEnabled;
|
|
34
|
-
config?: string[];
|
|
35
|
-
entry?: string[];
|
|
36
|
-
production?: string[];
|
|
37
|
-
project?: string[];
|
|
38
|
-
resolveEntryPaths?: ResolveEntryPaths;
|
|
39
|
-
resolveConfig?: ResolveConfig;
|
|
40
|
-
resolve?: Resolve;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { getPackageNameFromFilePath, getPackageNameFromModuleSpecifier } from './modules.js';
|
|
2
|
-
import { dirname, isInNodeModules, isInternal } from './path.js';
|
|
3
|
-
import { fromBinary, isBinary } from './protocols.js';
|
|
4
|
-
import { _resolveSync } from './resolve.js';
|
|
5
|
-
export const getReferencedDependencyHandler = (collector, deputy, chief) => (specifier, containingFilePath, workspace) => {
|
|
6
|
-
if (isBinary(specifier)) {
|
|
7
|
-
const binaryName = fromBinary(specifier);
|
|
8
|
-
const isHandled = deputy.maybeAddReferencedBinary(workspace, binaryName);
|
|
9
|
-
if (!isHandled)
|
|
10
|
-
collector.addIssue({
|
|
11
|
-
type: 'binaries',
|
|
12
|
-
filePath: containingFilePath,
|
|
13
|
-
workspace: workspace.name,
|
|
14
|
-
symbol: binaryName,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
if (isInternal(specifier)) {
|
|
19
|
-
const resolvedFilePath = _resolveSync(specifier, dirname(containingFilePath));
|
|
20
|
-
if (resolvedFilePath)
|
|
21
|
-
return resolvedFilePath;
|
|
22
|
-
collector.addIssue({
|
|
23
|
-
type: 'unresolved',
|
|
24
|
-
filePath: containingFilePath,
|
|
25
|
-
workspace: workspace.name,
|
|
26
|
-
symbol: specifier,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const packageName = isInNodeModules(specifier)
|
|
31
|
-
? getPackageNameFromFilePath(specifier)
|
|
32
|
-
: getPackageNameFromModuleSpecifier(specifier);
|
|
33
|
-
const isHandled = packageName && deputy.maybeAddReferencedExternalDependency(workspace, packageName);
|
|
34
|
-
if (!isHandled)
|
|
35
|
-
collector.addIssue({
|
|
36
|
-
type: 'unlisted',
|
|
37
|
-
filePath: containingFilePath,
|
|
38
|
-
workspace: workspace.name,
|
|
39
|
-
symbol: specifier,
|
|
40
|
-
});
|
|
41
|
-
if (packageName && specifier !== packageName) {
|
|
42
|
-
const specifierWorkspace = chief.workspacePackagesByPkgName.get(packageName);
|
|
43
|
-
if (specifierWorkspace) {
|
|
44
|
-
if (specifier.startsWith(packageName)) {
|
|
45
|
-
const dir = specifier.replace(new RegExp(`^${packageName}`), `./${specifierWorkspace.name}`);
|
|
46
|
-
const resolvedFilePath = _resolveSync(dir, chief.cwd);
|
|
47
|
-
if (resolvedFilePath)
|
|
48
|
-
return resolvedFilePath;
|
|
49
|
-
}
|
|
50
|
-
const resolvedFilePath = _resolveSync(specifier, dirname(containingFilePath));
|
|
51
|
-
if (resolvedFilePath)
|
|
52
|
-
return resolvedFilePath;
|
|
53
|
-
collector.addIssue({
|
|
54
|
-
type: 'unresolved',
|
|
55
|
-
filePath: containingFilePath,
|
|
56
|
-
workspace: workspace.name,
|
|
57
|
-
symbol: specifier,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
package/dist/util/protocols.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const toBinary: (specifier: string) => string;
|
|
2
|
-
export declare const fromBinary: (specifier: string) => string;
|
|
3
|
-
export declare const isBinary: (specifier: string) => boolean;
|
|
4
|
-
export declare const toEntryPattern: (specifier: string) => string;
|
|
5
|
-
export declare const fromEntryPattern: (specifier: string) => string;
|
|
6
|
-
export declare const isEntryPattern: (specifier: string) => boolean;
|
|
7
|
-
export declare const toProductionEntryPattern: (specifier: string) => string;
|
|
8
|
-
export declare const fromProductionEntryPattern: (specifier: string) => string;
|
|
9
|
-
export declare const isProductionEntryPattern: (specifier: string) => boolean;
|
package/dist/util/protocols.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const toBinary = (specifier) => specifier.replace(/^(bin:)?/, 'bin:');
|
|
2
|
-
export const fromBinary = (specifier) => specifier.replace(/^(bin:)?/, '');
|
|
3
|
-
export const isBinary = (specifier) => specifier.startsWith('bin:');
|
|
4
|
-
export const toEntryPattern = (specifier) => specifier.replace(/^(entry:)?/, 'entry:');
|
|
5
|
-
export const fromEntryPattern = (specifier) => specifier.replace(/^(entry:)?/, '');
|
|
6
|
-
export const isEntryPattern = (specifier) => specifier.startsWith('entry:');
|
|
7
|
-
export const toProductionEntryPattern = (specifier) => specifier.replace(/^(production:)?/, 'production:');
|
|
8
|
-
export const fromProductionEntryPattern = (specifier) => specifier.replace(/^(production:)?/, '');
|
|
9
|
-
export const isProductionEntryPattern = (specifier) => specifier.startsWith('production:');
|
|
File without changes
|
|
File without changes
|