knip 6.4.1 → 6.6.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/CacheConsultant.js +3 -3
- package/dist/CatalogCounselor.js +5 -5
- package/dist/ConfigurationChief.d.ts +39 -16
- package/dist/ConfigurationChief.js +15 -15
- package/dist/DependencyDeputy.d.ts +1 -1
- package/dist/DependencyDeputy.js +5 -5
- package/dist/IssueCollector.js +3 -3
- package/dist/IssueFixer.js +5 -5
- package/dist/JsonCatalogPeeker.js +1 -1
- package/dist/ProjectPrincipal.js +13 -13
- package/dist/WorkspaceWorker.d.ts +3 -2
- package/dist/WorkspaceWorker.js +39 -26
- package/dist/YamlCatalogPeeker.js +1 -1
- package/dist/binaries/bash-parser.js +10 -10
- package/dist/binaries/fallback.js +3 -3
- package/dist/binaries/index.js +3 -3
- package/dist/binaries/plugins.js +6 -6
- package/dist/binaries/resolvers/bun.js +4 -4
- package/dist/binaries/resolvers/bunx.js +4 -4
- package/dist/binaries/resolvers/find.js +1 -1
- package/dist/binaries/resolvers/index.js +8 -8
- package/dist/binaries/resolvers/npx.js +4 -4
- package/dist/binaries/resolvers/pnpm.js +3 -3
- package/dist/binaries/resolvers/pnpx.js +2 -2
- package/dist/binaries/resolvers/yarn.js +4 -4
- package/dist/cli.js +10 -10
- package/dist/compilers/index.d.ts +62 -22
- package/dist/compilers/index.js +2 -2
- package/dist/compilers/mdx.js +1 -1
- package/dist/compilers/scss.js +1 -1
- package/dist/constants.d.ts +25 -25
- package/dist/constants.js +1 -1
- package/dist/graph/analyze.js +7 -7
- package/dist/graph/build.d.ts +2 -2
- package/dist/graph/build.js +34 -26
- package/dist/graph-explorer/constants.d.ts +5 -5
- package/dist/graph-explorer/explorer.js +9 -9
- package/dist/graph-explorer/operations/build-exports-tree.js +2 -2
- package/dist/graph-explorer/operations/get-contention.js +3 -3
- package/dist/graph-explorer/operations/get-dependency-usage.js +1 -1
- package/dist/graph-explorer/operations/get-usage.js +5 -5
- package/dist/graph-explorer/operations/has-strictly-ns-references.js +1 -1
- package/dist/graph-explorer/operations/is-referenced.js +2 -2
- package/dist/graph-explorer/operations/resolve-definition.js +3 -3
- package/dist/graph-explorer/utils.d.ts +1 -1
- package/dist/graph-explorer/utils.js +2 -2
- package/dist/graph-explorer/visitors.js +1 -1
- package/dist/graph-explorer/walk-down.js +2 -2
- package/dist/graph-explorer/walk-up.js +2 -2
- package/dist/index.js +2 -2
- package/dist/manifest/helpers.js +2 -2
- package/dist/manifest/index.js +3 -3
- package/dist/plugins/_template/index.js +2 -2
- package/dist/plugins/angular/index.js +4 -4
- package/dist/plugins/astro/compiler-mdx.js +1 -1
- package/dist/plugins/astro/compiler.js +1 -1
- package/dist/plugins/astro/index.js +8 -6
- package/dist/plugins/astro/resolveFromAST.d.ts +1 -0
- package/dist/plugins/astro/resolveFromAST.js +40 -1
- package/dist/plugins/astro-db/index.js +1 -1
- package/dist/plugins/astro-og-canvas/index.js +2 -2
- package/dist/plugins/ava/index.js +2 -2
- package/dist/plugins/babel/helpers.d.ts +44 -6
- package/dist/plugins/babel/helpers.js +1 -1
- package/dist/plugins/babel/index.js +4 -4
- package/dist/plugins/biome/index.js +4 -4
- package/dist/plugins/bumpp/index.js +2 -2
- package/dist/plugins/bun/index.js +1 -1
- package/dist/plugins/c8/index.js +1 -1
- package/dist/plugins/capacitor/index.js +3 -3
- package/dist/plugins/changelogen/index.js +2 -2
- package/dist/plugins/changelogithub/index.js +2 -2
- package/dist/plugins/changesets/index.js +3 -3
- package/dist/plugins/commitizen/index.js +2 -2
- package/dist/plugins/commitlint/index.js +3 -3
- package/dist/plugins/convex/index.js +1 -1
- package/dist/plugins/create-typescript-app/index.js +1 -1
- package/dist/plugins/cspell/index.js +2 -2
- package/dist/plugins/cucumber/index.js +2 -2
- package/dist/plugins/cypress/helpers.js +2 -2
- package/dist/plugins/cypress/index.js +3 -3
- package/dist/plugins/danger/index.js +1 -1
- package/dist/plugins/dependency-cruiser/index.js +1 -1
- package/dist/plugins/docusaurus/helpers.js +2 -2
- package/dist/plugins/docusaurus/index.js +4 -4
- package/dist/plugins/dotenv/index.js +1 -1
- package/dist/plugins/drizzle/index.js +2 -2
- package/dist/plugins/eleventy/index.js +6 -6
- package/dist/plugins/eslint/helpers.js +5 -5
- package/dist/plugins/eslint/index.js +4 -4
- package/dist/plugins/eslint/resolveFromAST.js +3 -3
- package/dist/plugins/execa/index.js +2 -2
- package/dist/plugins/execa/visitors/execa.js +1 -1
- package/dist/plugins/expo/helpers.d.ts +3 -3
- package/dist/plugins/expo/helpers.js +3 -3
- package/dist/plugins/expo/index.js +4 -4
- package/dist/plugins/expressive-code/index.js +1 -1
- package/dist/plugins/gatsby/index.js +2 -2
- package/dist/plugins/github-action/index.js +4 -4
- package/dist/plugins/github-actions/index.js +4 -4
- package/dist/plugins/graphql-codegen/index.js +5 -5
- package/dist/plugins/hardhat/index.js +2 -2
- package/dist/plugins/husky/index.js +3 -3
- package/dist/plugins/i18next-parser/index.js +1 -1
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.js +152 -144
- package/dist/plugins/jest/helpers.js +2 -2
- package/dist/plugins/jest/index.js +4 -4
- package/dist/plugins/karma/helpers.d.ts +1 -1
- package/dist/plugins/karma/helpers.js +2 -2
- package/dist/plugins/karma/index.js +4 -4
- package/dist/plugins/knex/index.js +3 -3
- package/dist/plugins/ladle/index.js +4 -4
- package/dist/plugins/lefthook/index.js +5 -5
- package/dist/plugins/lint-staged/index.js +2 -2
- package/dist/plugins/linthtml/index.js +3 -3
- package/dist/plugins/lockfile-lint/index.js +2 -2
- package/dist/plugins/lost-pixel/index.js +1 -1
- package/dist/plugins/markdownlint/index.js +3 -3
- package/dist/plugins/mdx/index.js +2 -2
- package/dist/plugins/mdxlint/index.js +3 -3
- package/dist/plugins/metro/index.js +4 -4
- package/dist/plugins/mocha/index.js +2 -2
- package/dist/plugins/moonrepo/index.js +1 -1
- package/dist/plugins/msw/index.js +3 -3
- package/dist/plugins/nano-staged/index.js +1 -1
- package/dist/plugins/nest/index.js +2 -2
- package/dist/plugins/netlify/index.js +4 -4
- package/dist/plugins/next/index.js +3 -3
- package/dist/plugins/next/resolveFromAST.js +1 -1
- package/dist/plugins/next-intl/index.js +1 -1
- package/dist/plugins/next-mdx/index.js +3 -3
- package/dist/plugins/next-mdx/resolveFromAST.js +1 -1
- package/dist/plugins/nitro/index.js +3 -3
- package/dist/plugins/node/index.js +1 -1
- package/dist/plugins/node-modules-inspector/index.js +2 -2
- package/dist/plugins/npm-package-json-lint/index.js +3 -3
- package/dist/plugins/nuxt/helpers.js +3 -3
- package/dist/plugins/nuxt/index.js +10 -11
- package/dist/plugins/nx/index.js +4 -4
- package/dist/plugins/nyc/index.js +2 -2
- package/dist/plugins/oclif/index.js +2 -2
- package/dist/plugins/openapi-ts/index.js +2 -2
- package/dist/plugins/oxfmt/index.js +1 -1
- package/dist/plugins/oxlint/index.js +3 -3
- package/dist/plugins/panda-css/index.js +2 -2
- package/dist/plugins/parcel/index.js +2 -2
- package/dist/plugins/payload/index.js +2 -2
- package/dist/plugins/pino/index.d.ts +3 -0
- package/dist/plugins/pino/index.js +15 -0
- package/dist/plugins/pino/visitors/transportCall.d.ts +2 -0
- package/dist/plugins/pino/visitors/transportCall.js +87 -0
- package/dist/plugins/playwright/index.js +4 -4
- package/dist/plugins/playwright-ct/index.js +3 -3
- package/dist/plugins/playwright-test/index.js +1 -1
- package/dist/plugins/plop/index.js +1 -1
- package/dist/plugins/pm2/index.js +3 -3
- package/dist/plugins/pnpm/index.js +1 -1
- package/dist/plugins/postcss/index.js +3 -3
- package/dist/plugins/preconstruct/index.js +3 -3
- package/dist/plugins/prettier/index.js +6 -2
- package/dist/plugins/prisma/index.js +5 -5
- package/dist/plugins/qwik/index.js +5 -5
- package/dist/plugins/qwik/resolveFromAST.js +1 -1
- package/dist/plugins/raycast/index.js +3 -3
- package/dist/plugins/react-cosmos/index.js +3 -3
- package/dist/plugins/react-email/index.d.ts +3 -0
- package/dist/plugins/react-email/index.js +26 -0
- package/dist/plugins/react-native/index.js +2 -2
- package/dist/plugins/react-router/index.js +6 -10
- package/dist/plugins/relay/index.js +3 -3
- package/dist/plugins/release-it/index.js +2 -2
- package/dist/plugins/remark/index.js +3 -3
- package/dist/plugins/remix/index.js +1 -1
- package/dist/plugins/rolldown/index.js +3 -3
- package/dist/plugins/rolldown/resolveFromAST.js +1 -1
- package/dist/plugins/rollup/index.js +3 -3
- package/dist/plugins/rollup/resolveFromAST.js +1 -1
- package/dist/plugins/rsbuild/index.js +2 -2
- package/dist/plugins/rslib/index.js +1 -1
- package/dist/plugins/rspack/index.js +2 -2
- package/dist/plugins/rstest/index.js +2 -2
- package/dist/plugins/sanity/index.js +1 -1
- package/dist/plugins/semantic-release/index.js +3 -3
- package/dist/plugins/sentry/index.js +1 -1
- package/dist/plugins/serverless-framework/index.d.ts +3 -0
- package/dist/plugins/serverless-framework/index.js +23 -0
- package/dist/plugins/serverless-framework/types.d.ts +7 -0
- package/dist/plugins/serverless-framework/types.js +1 -0
- package/dist/plugins/simple-git-hooks/index.js +2 -2
- package/dist/plugins/size-limit/index.js +3 -3
- package/dist/plugins/sst/index.js +2 -2
- package/dist/plugins/sst/resolveFromAST.js +5 -5
- package/dist/plugins/starlight/index.js +4 -4
- package/dist/plugins/starlight/resolveFromAST.js +1 -1
- package/dist/plugins/stencil/index.js +3 -3
- package/dist/plugins/storybook/index.js +3 -3
- package/dist/plugins/stryker/index.js +2 -2
- package/dist/plugins/stylelint/index.js +3 -3
- package/dist/plugins/svelte/compiler.js +1 -1
- package/dist/plugins/svelte/index.js +3 -3
- package/dist/plugins/sveltejs-package/helpers.d.ts +8 -0
- package/dist/plugins/sveltejs-package/helpers.js +65 -0
- package/dist/plugins/sveltejs-package/index.d.ts +3 -0
- package/dist/plugins/sveltejs-package/index.js +27 -0
- package/dist/plugins/sveltekit/index.js +3 -3
- package/dist/plugins/svgo/index.js +1 -1
- package/dist/plugins/svgr/index.js +2 -2
- package/dist/plugins/swc/index.js +3 -3
- package/dist/plugins/syncpack/index.js +2 -2
- package/dist/plugins/tailwind/index.js +2 -2
- package/dist/plugins/tanstack-router/index.js +3 -3
- package/dist/plugins/taskfile/index.js +3 -3
- package/dist/plugins/travis/index.js +1 -1
- package/dist/plugins/tsdown/index.js +3 -3
- package/dist/plugins/tsdown/resolveFromAST.js +1 -1
- package/dist/plugins/tsup/index.js +3 -3
- package/dist/plugins/tsup/resolveFromAST.js +1 -1
- package/dist/plugins/tsx/index.js +2 -2
- package/dist/plugins/typedoc/index.js +2 -2
- package/dist/plugins/typescript/index.js +4 -4
- package/dist/plugins/unbuild/index.js +2 -2
- package/dist/plugins/unocss/index.js +2 -2
- package/dist/plugins/vercel-og/index.js +1 -1
- package/dist/plugins/vike/index.js +1 -1
- package/dist/plugins/vite/helpers.js +4 -4
- package/dist/plugins/vite/index.js +5 -5
- package/dist/plugins/vite/visitors/importMetaGlob.js +4 -4
- package/dist/plugins/vitepress/index.js +1 -1
- package/dist/plugins/vitest/helpers.d.ts +4 -2
- package/dist/plugins/vitest/helpers.js +18 -0
- package/dist/plugins/vitest/index.js +9 -23
- package/dist/plugins/vue/compiler.js +1 -1
- package/dist/plugins/vue/index.js +4 -4
- package/dist/plugins/webdriver-io/index.js +2 -2
- package/dist/plugins/webpack/index.js +5 -5
- package/dist/plugins/webpack/visitors/requireContext.js +6 -7
- package/dist/plugins/wireit/index.js +1 -1
- package/dist/plugins/wrangler/index.js +2 -2
- package/dist/plugins/xo/index.js +2 -2
- package/dist/plugins/yarn/index.js +2 -2
- package/dist/plugins/yorkie/index.js +2 -2
- package/dist/plugins/zx/index.js +2 -2
- package/dist/plugins.js +2 -2
- package/dist/reporters/codeclimate.js +2 -2
- package/dist/reporters/codeowners.js +3 -3
- package/dist/reporters/compact.js +1 -1
- package/dist/reporters/disclosure.js +1 -1
- package/dist/reporters/github-actions.js +4 -4
- package/dist/reporters/index.js +8 -8
- package/dist/reporters/json.js +4 -4
- package/dist/reporters/markdown.js +2 -2
- package/dist/reporters/symbols.js +2 -2
- package/dist/reporters/trace.js +7 -7
- package/dist/reporters/util/configuration-hints.d.ts +2 -2
- package/dist/reporters/util/configuration-hints.js +7 -10
- package/dist/reporters/util/util.d.ts +3 -3
- package/dist/reporters/util/util.js +16 -15
- package/dist/reporters/watch.js +7 -7
- package/dist/run.js +14 -14
- package/dist/schema/configuration.d.ts +89 -31
- package/dist/schema/configuration.js +2 -2
- package/dist/schema/plugins.d.ts +20 -0
- package/dist/schema/plugins.js +4 -0
- package/dist/session/build-maps.js +3 -3
- package/dist/session/file-descriptor.js +3 -3
- package/dist/session/index.js +7 -7
- package/dist/session/package-json-descriptor.js +1 -1
- package/dist/session/session.js +3 -3
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +4 -0
- package/dist/types/config.d.ts +13 -0
- package/dist/types/issues.d.ts +1 -1
- package/dist/typescript/SourceFileManager.js +3 -3
- package/dist/typescript/ast-helpers.d.ts +2 -0
- package/dist/typescript/ast-helpers.js +5 -5
- package/dist/typescript/comments.js +1 -1
- package/dist/typescript/follow-imports.js +2 -2
- package/dist/typescript/get-imports-and-exports.js +10 -10
- package/dist/typescript/resolve-module-names.js +5 -5
- package/dist/typescript/visitors/calls.js +3 -3
- package/dist/typescript/visitors/exports.js +4 -4
- package/dist/typescript/visitors/helpers.js +3 -3
- package/dist/typescript/visitors/imports.js +4 -4
- package/dist/typescript/visitors/members.js +4 -4
- package/dist/typescript/visitors/walk.js +9 -9
- package/dist/util/Performance.d.ts +1 -1
- package/dist/util/Performance.js +2 -2
- package/dist/util/catalog.js +3 -3
- package/dist/util/codeowners.js +4 -4
- package/dist/util/colors.d.ts +18 -0
- package/dist/util/colors.js +24 -0
- package/dist/util/create-input-handler.js +6 -6
- package/dist/util/create-options.d.ts +72 -33
- package/dist/util/create-options.js +14 -15
- package/dist/util/create-workspace-graph.js +1 -1
- package/dist/util/debug.js +2 -4
- package/dist/util/file-entry-cache.js +4 -4
- package/dist/util/fs.js +2 -2
- package/dist/util/get-included-issue-types.js +2 -2
- package/dist/util/git.js +1 -1
- package/dist/util/glob-cache.js +4 -4
- package/dist/util/glob-core.d.ts +3 -3
- package/dist/util/glob-core.js +80 -64
- package/dist/util/glob.d.ts +1 -1
- package/dist/util/glob.js +14 -7
- package/dist/util/input.js +1 -1
- package/dist/util/issue-initializers.js +1 -1
- package/dist/util/jiti.js +1 -1
- package/dist/util/load-config.js +3 -3
- package/dist/util/load-tsconfig.js +62 -50
- package/dist/util/loader.js +5 -5
- package/dist/util/log.js +3 -3
- package/dist/util/map-workspaces.js +6 -6
- package/dist/util/modules.js +2 -2
- package/dist/util/package-name.js +1 -1
- package/dist/util/parse-and-convert-gitignores.d.ts +4 -2
- package/dist/util/parse-and-convert-gitignores.js +19 -7
- package/dist/util/plugin.js +5 -5
- package/dist/util/remove-export.js +1 -1
- package/dist/util/reporter.js +3 -3
- package/dist/util/require.js +1 -1
- package/dist/util/resolve.js +3 -3
- package/dist/util/string.d.ts +1 -1
- package/dist/util/table.js +1 -1
- package/dist/util/tag.js +1 -1
- package/dist/util/to-source-path.d.ts +4 -2
- package/dist/util/to-source-path.js +46 -22
- package/dist/util/trace.js +8 -8
- package/dist/util/watch.js +8 -8
- package/dist/util/workspace-file-filter.js +2 -2
- package/dist/util/workspace-selectors.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -19
- package/schema.json +13 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import parseArgs from 'minimist';
|
|
2
|
-
import { toDependency } from
|
|
3
|
-
import { stripVersionFromSpecifier } from
|
|
2
|
+
import { toDependency } from '../../util/input.js';
|
|
3
|
+
import { stripVersionFromSpecifier } from '../../util/modules.js';
|
|
4
4
|
export const resolveDlx = (args, options) => {
|
|
5
5
|
const parsed = parseArgs(args, {
|
|
6
6
|
boolean: ['silent'],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import parseArgs from 'minimist';
|
|
2
|
-
import { isBinary, isDependency, toBinary, toDependency } from
|
|
3
|
-
import { stripVersionFromSpecifier } from
|
|
4
|
-
import { join } from
|
|
5
|
-
import { argsFrom } from
|
|
2
|
+
import { isBinary, isDependency, toBinary, toDependency } from '../../util/input.js';
|
|
3
|
+
import { stripVersionFromSpecifier } from '../../util/modules.js';
|
|
4
|
+
import { join } from '../../util/path.js';
|
|
5
|
+
import { argsFrom } from '../util.js';
|
|
6
6
|
const commands = [
|
|
7
7
|
'add',
|
|
8
8
|
'bin',
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { fix } from
|
|
2
|
-
import { run } from
|
|
3
|
-
import parseArgs, { helpText } from
|
|
4
|
-
import { createOptions } from
|
|
5
|
-
import { getKnownErrors, hasErrorCause, isConfigurationError, isKnownError, isLoaderError, isModuleNotFoundError, } from
|
|
6
|
-
import { logError } from
|
|
7
|
-
import { perfObserver } from
|
|
8
|
-
import { runPreprocessors, runReporters } from
|
|
9
|
-
import { prettyMilliseconds } from
|
|
10
|
-
import { version } from
|
|
1
|
+
import { fix } from './IssueFixer.js';
|
|
2
|
+
import { run } from './run.js';
|
|
3
|
+
import parseArgs, { helpText } from './util/cli-arguments.js';
|
|
4
|
+
import { createOptions } from './util/create-options.js';
|
|
5
|
+
import { getKnownErrors, hasErrorCause, isConfigurationError, isKnownError, isLoaderError, isModuleNotFoundError, } from './util/errors.js';
|
|
6
|
+
import { logError } from './util/log.js';
|
|
7
|
+
import { perfObserver } from './util/Performance.js';
|
|
8
|
+
import { runPreprocessors, runReporters } from './util/reporter.js';
|
|
9
|
+
import { prettyMilliseconds } from './util/string.js';
|
|
10
|
+
import { version } from './version.js';
|
|
11
11
|
let args = {};
|
|
12
12
|
try {
|
|
13
13
|
args = parseArgs();
|
|
@@ -3,8 +3,6 @@ import type { DependencySet } from '../types/workspace.ts';
|
|
|
3
3
|
import type { AsyncCompilers, CompilerAsync, CompilerSync, Compilers, RawSyncCompilers, SyncCompilers } from './types.ts';
|
|
4
4
|
export declare const normalizeCompilerExtension: (ext: string) => string;
|
|
5
5
|
export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
6
|
-
syncCompilers: Record<string, true | CompilerSync>;
|
|
7
|
-
asyncCompilers: Record<string, CompilerAsync>;
|
|
8
6
|
angular?: string | boolean | string[] | {
|
|
9
7
|
config?: string | string[] | undefined;
|
|
10
8
|
entry?: string | string[] | undefined;
|
|
@@ -385,6 +383,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
385
383
|
entry?: string | string[] | undefined;
|
|
386
384
|
project?: string | string[] | undefined;
|
|
387
385
|
} | undefined;
|
|
386
|
+
pino?: string | boolean | string[] | {
|
|
387
|
+
config?: string | string[] | undefined;
|
|
388
|
+
entry?: string | string[] | undefined;
|
|
389
|
+
project?: string | string[] | undefined;
|
|
390
|
+
} | undefined;
|
|
388
391
|
playwright?: string | boolean | string[] | {
|
|
389
392
|
config?: string | string[] | undefined;
|
|
390
393
|
entry?: string | string[] | undefined;
|
|
@@ -450,6 +453,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
450
453
|
entry?: string | string[] | undefined;
|
|
451
454
|
project?: string | string[] | undefined;
|
|
452
455
|
} | undefined;
|
|
456
|
+
'react-email'?: string | boolean | string[] | {
|
|
457
|
+
config?: string | string[] | undefined;
|
|
458
|
+
entry?: string | string[] | undefined;
|
|
459
|
+
project?: string | string[] | undefined;
|
|
460
|
+
} | undefined;
|
|
453
461
|
'react-native'?: string | boolean | string[] | {
|
|
454
462
|
config?: string | string[] | undefined;
|
|
455
463
|
entry?: string | string[] | undefined;
|
|
@@ -525,6 +533,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
525
533
|
entry?: string | string[] | undefined;
|
|
526
534
|
project?: string | string[] | undefined;
|
|
527
535
|
} | undefined;
|
|
536
|
+
'serverless-framework'?: string | boolean | string[] | {
|
|
537
|
+
config?: string | string[] | undefined;
|
|
538
|
+
entry?: string | string[] | undefined;
|
|
539
|
+
project?: string | string[] | undefined;
|
|
540
|
+
} | undefined;
|
|
528
541
|
'simple-git-hooks'?: string | boolean | string[] | {
|
|
529
542
|
config?: string | string[] | undefined;
|
|
530
543
|
entry?: string | string[] | undefined;
|
|
@@ -570,6 +583,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
570
583
|
entry?: string | string[] | undefined;
|
|
571
584
|
project?: string | string[] | undefined;
|
|
572
585
|
} | undefined;
|
|
586
|
+
'sveltejs-package'?: string | boolean | string[] | {
|
|
587
|
+
config?: string | string[] | undefined;
|
|
588
|
+
entry?: string | string[] | undefined;
|
|
589
|
+
project?: string | string[] | undefined;
|
|
590
|
+
} | undefined;
|
|
573
591
|
sveltekit?: string | boolean | string[] | {
|
|
574
592
|
config?: string | string[] | undefined;
|
|
575
593
|
entry?: string | string[] | undefined;
|
|
@@ -725,6 +743,26 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
725
743
|
entry?: string | string[] | undefined;
|
|
726
744
|
project?: string | string[] | undefined;
|
|
727
745
|
} | undefined;
|
|
746
|
+
$schema?: string | undefined;
|
|
747
|
+
rules?: Partial<Record<"binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved", "error" | "off" | "warn">> | undefined;
|
|
748
|
+
entry?: string | string[] | undefined;
|
|
749
|
+
project?: string | string[] | undefined;
|
|
750
|
+
paths?: Record<string, string[]> | undefined;
|
|
751
|
+
ignore?: string | string[] | undefined;
|
|
752
|
+
ignoreFiles?: string | string[] | undefined;
|
|
753
|
+
ignoreBinaries?: (string | RegExp)[] | undefined;
|
|
754
|
+
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
755
|
+
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
756
|
+
ignoreUnresolved?: (string | RegExp)[] | undefined;
|
|
757
|
+
ignoreExportsUsedInFile?: boolean | Record<string, boolean | undefined> | undefined;
|
|
758
|
+
ignoreIssues?: Record<string, ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[]> | undefined;
|
|
759
|
+
ignoreWorkspaces?: string[] | undefined;
|
|
760
|
+
includeEntryExports?: boolean | undefined;
|
|
761
|
+
compilers?: Record<string, true | CompilerAsync | CompilerSync> | undefined;
|
|
762
|
+
tags?: string[] | undefined;
|
|
763
|
+
treatConfigHintsAsErrors?: boolean | undefined;
|
|
764
|
+
include?: ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[] | undefined;
|
|
765
|
+
exclude?: ("binaries" | "catalog" | "dependencies" | "devDependencies" | "duplicates" | "enumMembers" | "exports" | "files" | "namespaceMembers" | "nsExports" | "nsTypes" | "optionalPeerDependencies" | "types" | "unlisted" | "unresolved")[] | undefined;
|
|
728
766
|
workspaces?: Record<string, {
|
|
729
767
|
angular?: string | boolean | string[] | {
|
|
730
768
|
config?: string | string[] | undefined;
|
|
@@ -1106,6 +1144,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1106
1144
|
entry?: string | string[] | undefined;
|
|
1107
1145
|
project?: string | string[] | undefined;
|
|
1108
1146
|
} | undefined;
|
|
1147
|
+
pino?: string | boolean | string[] | {
|
|
1148
|
+
config?: string | string[] | undefined;
|
|
1149
|
+
entry?: string | string[] | undefined;
|
|
1150
|
+
project?: string | string[] | undefined;
|
|
1151
|
+
} | undefined;
|
|
1109
1152
|
playwright?: string | boolean | string[] | {
|
|
1110
1153
|
config?: string | string[] | undefined;
|
|
1111
1154
|
entry?: string | string[] | undefined;
|
|
@@ -1171,6 +1214,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1171
1214
|
entry?: string | string[] | undefined;
|
|
1172
1215
|
project?: string | string[] | undefined;
|
|
1173
1216
|
} | undefined;
|
|
1217
|
+
'react-email'?: string | boolean | string[] | {
|
|
1218
|
+
config?: string | string[] | undefined;
|
|
1219
|
+
entry?: string | string[] | undefined;
|
|
1220
|
+
project?: string | string[] | undefined;
|
|
1221
|
+
} | undefined;
|
|
1174
1222
|
'react-native'?: string | boolean | string[] | {
|
|
1175
1223
|
config?: string | string[] | undefined;
|
|
1176
1224
|
entry?: string | string[] | undefined;
|
|
@@ -1246,6 +1294,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1246
1294
|
entry?: string | string[] | undefined;
|
|
1247
1295
|
project?: string | string[] | undefined;
|
|
1248
1296
|
} | undefined;
|
|
1297
|
+
'serverless-framework'?: string | boolean | string[] | {
|
|
1298
|
+
config?: string | string[] | undefined;
|
|
1299
|
+
entry?: string | string[] | undefined;
|
|
1300
|
+
project?: string | string[] | undefined;
|
|
1301
|
+
} | undefined;
|
|
1249
1302
|
'simple-git-hooks'?: string | boolean | string[] | {
|
|
1250
1303
|
config?: string | string[] | undefined;
|
|
1251
1304
|
entry?: string | string[] | undefined;
|
|
@@ -1291,6 +1344,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1291
1344
|
entry?: string | string[] | undefined;
|
|
1292
1345
|
project?: string | string[] | undefined;
|
|
1293
1346
|
} | undefined;
|
|
1347
|
+
'sveltejs-package'?: string | boolean | string[] | {
|
|
1348
|
+
config?: string | string[] | undefined;
|
|
1349
|
+
entry?: string | string[] | undefined;
|
|
1350
|
+
project?: string | string[] | undefined;
|
|
1351
|
+
} | undefined;
|
|
1294
1352
|
sveltekit?: string | boolean | string[] | {
|
|
1295
1353
|
config?: string | string[] | undefined;
|
|
1296
1354
|
entry?: string | string[] | undefined;
|
|
@@ -1457,26 +1515,8 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
1457
1515
|
ignoreUnresolved?: (string | RegExp)[] | undefined;
|
|
1458
1516
|
includeEntryExports?: boolean | undefined;
|
|
1459
1517
|
}> | undefined;
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
$schema?: string | undefined;
|
|
1463
|
-
rules?: Partial<Record<"files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog", "error" | "warn" | "off">> | undefined;
|
|
1464
|
-
entry?: string | string[] | undefined;
|
|
1465
|
-
project?: string | string[] | undefined;
|
|
1466
|
-
paths?: Record<string, string[]> | undefined;
|
|
1467
|
-
ignore?: string | string[] | undefined;
|
|
1468
|
-
ignoreFiles?: string | string[] | undefined;
|
|
1469
|
-
ignoreBinaries?: (string | RegExp)[] | undefined;
|
|
1470
|
-
ignoreDependencies?: (string | RegExp)[] | undefined;
|
|
1471
|
-
ignoreMembers?: (string | RegExp)[] | undefined;
|
|
1472
|
-
ignoreUnresolved?: (string | RegExp)[] | undefined;
|
|
1473
|
-
ignoreExportsUsedInFile?: boolean | Record<string, boolean | undefined> | undefined;
|
|
1474
|
-
ignoreIssues?: Record<string, ("files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "exports" | "nsExports" | "types" | "nsTypes" | "enumMembers" | "namespaceMembers" | "duplicates" | "catalog")[]> | undefined;
|
|
1475
|
-
ignoreWorkspaces?: string[] | undefined;
|
|
1476
|
-
includeEntryExports?: boolean | undefined;
|
|
1477
|
-
compilers?: Record<string, true | ((filename: string, contents: string) => string) | ((filename: string, contents: string) => Promise<string>)> | undefined;
|
|
1478
|
-
tags?: string[] | undefined;
|
|
1479
|
-
treatConfigHintsAsErrors?: boolean | undefined;
|
|
1518
|
+
syncCompilers: Record<string, true | CompilerSync>;
|
|
1519
|
+
asyncCompilers: Record<string, CompilerAsync>;
|
|
1480
1520
|
};
|
|
1481
1521
|
export declare const getIncludedCompilers: (syncCompilers: RawSyncCompilers, asyncCompilers: AsyncCompilers, dependencies: DependencySet) => Compilers;
|
|
1482
1522
|
export declare const getCompilerExtensions: (compilers: [SyncCompilers, AsyncCompilers]) => string[];
|
package/dist/compilers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import MDX from
|
|
2
|
-
import SCSS from
|
|
1
|
+
import MDX from './mdx.js';
|
|
2
|
+
import SCSS from './scss.js';
|
|
3
3
|
const isAsyncCompiler = (fn) => (fn ? fn.constructor.name === 'AsyncFunction' : false);
|
|
4
4
|
export const normalizeCompilerExtension = (ext) => ext.replace(/^\.*/, '.');
|
|
5
5
|
export const partitionCompilers = (rawLocalConfig) => {
|
package/dist/compilers/mdx.js
CHANGED
package/dist/compilers/scss.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { basename, dirname } from
|
|
1
|
+
import { basename, dirname } from '../util/path.js';
|
|
2
2
|
const condition = (hasDependency) => hasDependency('sass') || hasDependency('sass-embedded') || hasDependency('node-sass');
|
|
3
3
|
const importMatcher = /@(?:use|import|forward)\s+['"](pkg:)?([^'"]+)['"]/g;
|
|
4
4
|
const isAlias = (s) => (s.charCodeAt(0) === 64 && s.charCodeAt(1) === 47) || s.charCodeAt(0) === 126 || s.charCodeAt(0) === 35;
|
package/dist/constants.d.ts
CHANGED
|
@@ -16,34 +16,34 @@ export declare const IGNORED_DEPENDENCIES: Set<string>;
|
|
|
16
16
|
export declare const IGNORED_RUNTIME_DEPENDENCIES: Set<string>;
|
|
17
17
|
export declare const FOREIGN_FILE_EXTENSIONS: Set<string>;
|
|
18
18
|
export declare const IGNORE_DEFINITELY_TYPED: Set<string>;
|
|
19
|
-
export declare const ISSUE_TYPES: readonly [
|
|
19
|
+
export declare const ISSUE_TYPES: readonly ['files', 'dependencies', 'devDependencies', 'optionalPeerDependencies', 'unlisted', 'binaries', 'unresolved', 'exports', 'nsExports', 'types', 'nsTypes', 'enumMembers', 'namespaceMembers', 'duplicates', 'catalog'];
|
|
20
20
|
export declare const ISSUE_TYPE_TITLE: {
|
|
21
|
-
readonly files:
|
|
22
|
-
readonly dependencies:
|
|
23
|
-
readonly devDependencies:
|
|
24
|
-
readonly optionalPeerDependencies:
|
|
25
|
-
readonly unlisted:
|
|
26
|
-
readonly binaries:
|
|
27
|
-
readonly unresolved:
|
|
28
|
-
readonly exports:
|
|
29
|
-
readonly nsExports:
|
|
30
|
-
readonly types:
|
|
31
|
-
readonly nsTypes:
|
|
32
|
-
readonly enumMembers:
|
|
33
|
-
readonly namespaceMembers:
|
|
34
|
-
readonly duplicates:
|
|
35
|
-
readonly catalog:
|
|
21
|
+
readonly files: 'Unused files';
|
|
22
|
+
readonly dependencies: 'Unused dependencies';
|
|
23
|
+
readonly devDependencies: 'Unused devDependencies';
|
|
24
|
+
readonly optionalPeerDependencies: 'Referenced optional peerDependencies';
|
|
25
|
+
readonly unlisted: 'Unlisted dependencies';
|
|
26
|
+
readonly binaries: 'Unlisted binaries';
|
|
27
|
+
readonly unresolved: 'Unresolved imports';
|
|
28
|
+
readonly exports: 'Unused exports';
|
|
29
|
+
readonly nsExports: 'Exports in used namespace';
|
|
30
|
+
readonly types: 'Unused exported types';
|
|
31
|
+
readonly nsTypes: 'Exported types in used namespace';
|
|
32
|
+
readonly enumMembers: 'Unused exported enum members';
|
|
33
|
+
readonly namespaceMembers: 'Unused exported namespace members';
|
|
34
|
+
readonly duplicates: 'Duplicate exports';
|
|
35
|
+
readonly catalog: 'Unused catalog entries';
|
|
36
36
|
};
|
|
37
37
|
export declare const SYMBOL_TYPE: {
|
|
38
|
-
readonly CLASS:
|
|
39
|
-
readonly ENUM:
|
|
40
|
-
readonly FUNCTION:
|
|
41
|
-
readonly INTERFACE:
|
|
42
|
-
readonly MEMBER:
|
|
43
|
-
readonly NAMESPACE:
|
|
44
|
-
readonly TYPE:
|
|
45
|
-
readonly UNKNOWN:
|
|
46
|
-
readonly VARIABLE:
|
|
38
|
+
readonly CLASS: 'class';
|
|
39
|
+
readonly ENUM: 'enum';
|
|
40
|
+
readonly FUNCTION: 'function';
|
|
41
|
+
readonly INTERFACE: 'interface';
|
|
42
|
+
readonly MEMBER: 'member';
|
|
43
|
+
readonly NAMESPACE: 'namespace';
|
|
44
|
+
readonly TYPE: 'type';
|
|
45
|
+
readonly UNKNOWN: 'unknown';
|
|
46
|
+
readonly VARIABLE: 'variable';
|
|
47
47
|
};
|
|
48
48
|
export declare const FIX_FLAGS: {
|
|
49
49
|
readonly NONE: 0;
|
package/dist/constants.js
CHANGED
|
@@ -13,7 +13,7 @@ export const KNIP_CONFIG_LOCATIONS = [
|
|
|
13
13
|
export const DEFAULT_EXTENSIONS = new Set(['.js', '.mjs', '.cjs', '.jsx', '.ts', '.tsx', '.mts', '.cts']);
|
|
14
14
|
export const DTS_EXTENSIONS = ['.d.ts', '.d.mts', '.d.cts'];
|
|
15
15
|
export const IS_DTS = /\.d\.(c|m)?ts$/;
|
|
16
|
-
export const GLOBAL_IGNORE_PATTERNS = ['**/node_modules
|
|
16
|
+
export const GLOBAL_IGNORE_PATTERNS = ['**/node_modules', '.git/!(hooks)'];
|
|
17
17
|
export const PUBLIC_TAG = '@public';
|
|
18
18
|
export const INTERNAL_TAG = '@internal';
|
|
19
19
|
export const BETA_TAG = '@beta';
|
package/dist/graph/analyze.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createGraphExplorer } from
|
|
2
|
-
import { getIssueType, hasStrictlyEnumReferences } from
|
|
3
|
-
import traceReporter from
|
|
4
|
-
import { getPackageNameFromModuleSpecifier } from
|
|
5
|
-
import { perfObserver } from
|
|
6
|
-
import { findMatch } from
|
|
7
|
-
import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from
|
|
1
|
+
import { createGraphExplorer } from '../graph-explorer/explorer.js';
|
|
2
|
+
import { getIssueType, hasStrictlyEnumReferences } from '../graph-explorer/utils.js';
|
|
3
|
+
import traceReporter from '../reporters/trace.js';
|
|
4
|
+
import { getPackageNameFromModuleSpecifier } from '../util/modules.js';
|
|
5
|
+
import { perfObserver } from '../util/Performance.js';
|
|
6
|
+
import { findMatch } from '../util/regex.js';
|
|
7
|
+
import { getShouldIgnoreHandler, getShouldIgnoreTagHandler } from '../util/tag.js';
|
|
8
8
|
export const analyze = async ({ analyzedFiles, counselor, chief, collector, deputy, entryPaths, graph, streamer, unreferencedFiles, options, }) => {
|
|
9
9
|
const shouldIgnore = getShouldIgnoreHandler(options.isProduction);
|
|
10
10
|
const shouldIgnoreTags = getShouldIgnoreTagHandler(options.tags);
|
package/dist/graph/build.d.ts
CHANGED
|
@@ -17,12 +17,12 @@ interface BuildOptions {
|
|
|
17
17
|
workspaces: Workspace[];
|
|
18
18
|
options: MainOptions;
|
|
19
19
|
}
|
|
20
|
-
export declare function build({ chief, collector, counselor, deputy, principal, isGitIgnored, streamer, workspaces, options
|
|
20
|
+
export declare function build({ chief, collector, counselor, deputy, principal, isGitIgnored, streamer, workspaces, options }: BuildOptions): Promise<{
|
|
21
21
|
graph: ModuleGraph;
|
|
22
22
|
entryPaths: Set<string>;
|
|
23
23
|
analyzedFiles: Set<string>;
|
|
24
24
|
unreferencedFiles: Set<string>;
|
|
25
|
-
analyzeSourceFile: (filePath: string, pp: ProjectPrincipal, parseResult?: import(
|
|
25
|
+
analyzeSourceFile: (filePath: string, pp: ProjectPrincipal, parseResult?: import('oxc-parser').ParseResult, sourceText?: string, cachedFile?: FileNode) => void;
|
|
26
26
|
enabledPluginsStore: Map<string, string[]>;
|
|
27
27
|
}>;
|
|
28
28
|
export {};
|
package/dist/graph/build.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { _getInputsFromScripts } from
|
|
2
|
-
import { getCompilerExtensions, getIncludedCompilers, normalizeCompilerExtension } from
|
|
3
|
-
import { DEFAULT_EXTENSIONS, FOREIGN_FILE_EXTENSIONS, IS_DTS } from
|
|
4
|
-
import { partition } from
|
|
5
|
-
import { createInputHandler } from
|
|
6
|
-
import { debugLog, debugLogArray } from
|
|
1
|
+
import { _getInputsFromScripts } from '../binaries/index.js';
|
|
2
|
+
import { getCompilerExtensions, getIncludedCompilers, normalizeCompilerExtension } from '../compilers/index.js';
|
|
3
|
+
import { DEFAULT_EXTENSIONS, FOREIGN_FILE_EXTENSIONS, IS_DTS } from '../constants.js';
|
|
4
|
+
import { partition } from '../util/array.js';
|
|
5
|
+
import { createInputHandler } from '../util/create-input-handler.js';
|
|
6
|
+
import { debugLog, debugLogArray } from '../util/debug.js';
|
|
7
7
|
import { existsSync } from 'node:fs';
|
|
8
|
-
import { tryRealpath } from
|
|
9
|
-
import { _glob, _syncGlob, negate, prependDirToPattern as prependDir } from
|
|
10
|
-
import { isAlias, isConfig, isDeferResolveEntry, isDeferResolveProductionEntry, isEntry, isIgnore, isProductionEntry, isProject, toProductionEntry, } from
|
|
11
|
-
import { loadTSConfig } from
|
|
12
|
-
import { createFileNode, updateImportMap } from
|
|
13
|
-
import { getPackageNameFromModuleSpecifier, isStartsLikePackageName, sanitizeSpecifier } from
|
|
14
|
-
import { perfObserver } from
|
|
15
|
-
import { getEntrySpecifiersFromManifest, getManifestImportDependencies } from
|
|
16
|
-
import { dirname, extname, isAbsolute, isInNodeModules, join, relative } from
|
|
17
|
-
import { augmentWorkspace, getToSourcePathsHandler } from
|
|
18
|
-
import { WorkspaceWorker } from
|
|
8
|
+
import { tryRealpath } from '../util/fs.js';
|
|
9
|
+
import { _glob, _syncGlob, negate, prependDirToPattern as prependDir } from '../util/glob.js';
|
|
10
|
+
import { isAlias, isConfig, isDeferResolveEntry, isDeferResolveProductionEntry, isEntry, isIgnore, isProductionEntry, isProject, toProductionEntry, } from '../util/input.js';
|
|
11
|
+
import { loadTSConfig } from '../util/load-tsconfig.js';
|
|
12
|
+
import { createFileNode, updateImportMap } from '../util/module-graph.js';
|
|
13
|
+
import { getPackageNameFromModuleSpecifier, isStartsLikePackageName, sanitizeSpecifier } from '../util/modules.js';
|
|
14
|
+
import { perfObserver } from '../util/Performance.js';
|
|
15
|
+
import { getEntrySpecifiersFromManifest, getManifestImportDependencies } from '../util/package-json.js';
|
|
16
|
+
import { dirname, extname, isAbsolute, isInNodeModules, join, relative } from '../util/path.js';
|
|
17
|
+
import { augmentWorkspace, getToSourcePathsHandler, toSourceMappedSpecifiers } from '../util/to-source-path.js';
|
|
18
|
+
import { WorkspaceWorker } from '../WorkspaceWorker.js';
|
|
19
19
|
export async function build({ chief, collector, counselor, deputy, principal, isGitIgnored, streamer, workspaces, options, }) {
|
|
20
20
|
const configFilesMap = new Map();
|
|
21
21
|
const enabledPluginsStore = new Map();
|
|
@@ -57,8 +57,6 @@ export async function build({ chief, collector, counselor, deputy, principal, is
|
|
|
57
57
|
const tsConfigFilePath = join(dir, options.tsConfigFile ?? 'tsconfig.json');
|
|
58
58
|
const { isFile, compilerOptions, fileNames } = await loadTSConfig(tsConfigFilePath);
|
|
59
59
|
const [definitionPaths, tscSourcePaths] = partition(fileNames, filePath => IS_DTS.test(filePath));
|
|
60
|
-
if (isFile)
|
|
61
|
-
augmentWorkspace(workspace, dir, compilerOptions);
|
|
62
60
|
const worker = new WorkspaceWorker({
|
|
63
61
|
name,
|
|
64
62
|
dir,
|
|
@@ -89,6 +87,8 @@ export async function build({ chief, collector, counselor, deputy, principal, is
|
|
|
89
87
|
const extensionGlobStr = `.{${[...DEFAULT_EXTENSIONS, ...extensions].map(ext => ext.slice(1)).join(',')}}`;
|
|
90
88
|
const config = chief.getConfigForWorkspace(name, extensions);
|
|
91
89
|
worker.config = config;
|
|
90
|
+
const pluginSourceMaps = await worker.resolveSourceMaps();
|
|
91
|
+
augmentWorkspace(workspace, dir, isFile ? compilerOptions : undefined, pluginSourceMaps);
|
|
92
92
|
const inputs = new Set();
|
|
93
93
|
if (definitionPaths.length > 0) {
|
|
94
94
|
debugLogArray(name, 'Definition paths', definitionPaths);
|
|
@@ -105,13 +105,21 @@ export async function build({ chief, collector, counselor, deputy, principal, is
|
|
|
105
105
|
inputs.add(toProductionEntry(filePath));
|
|
106
106
|
}
|
|
107
107
|
for (const identifier of entrySpecifiersFromManifest) {
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
if (identifier.startsWith('!') || isGitIgnored(join(dir, identifier)))
|
|
109
|
+
continue;
|
|
110
|
+
if (!identifier.startsWith('.') && !identifier.startsWith('/')) {
|
|
111
|
+
const packageName = getPackageNameFromModuleSpecifier(identifier);
|
|
112
|
+
if (packageName && dependencies.has(packageName))
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const abs = prependDir(dir, identifier);
|
|
116
|
+
const mapped = toSourceMappedSpecifiers(workspace, abs, extensionGlobStr);
|
|
117
|
+
const hasWildcard = identifier.includes('*');
|
|
118
|
+
const exists = hasWildcard
|
|
119
|
+
? _syncGlob({ patterns: [identifier, ...mapped], cwd: dir }).length > 0
|
|
120
|
+
: existsSync(abs) || mapped.some(pattern => _syncGlob({ patterns: [pattern], cwd: dir }).length > 0);
|
|
121
|
+
if (!exists) {
|
|
122
|
+
collector.addConfigurationHint({ type: 'package-entry', filePath, identifier, workspaceName: name });
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
for (const dep of getManifestImportDependencies(manifest))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const CONTINUE = "continue";
|
|
2
2
|
export declare const STOP = "stop";
|
|
3
3
|
export declare const RE_EXPORT_KIND: {
|
|
4
|
-
readonly ALIAS:
|
|
5
|
-
readonly NAMESPACE:
|
|
6
|
-
readonly PASSTHROUGH:
|
|
7
|
-
readonly SELF:
|
|
8
|
-
readonly STAR:
|
|
4
|
+
readonly ALIAS: 'alias';
|
|
5
|
+
readonly NAMESPACE: 'namespace';
|
|
6
|
+
readonly PASSTHROUGH: 'passthrough';
|
|
7
|
+
readonly SELF: 'self';
|
|
8
|
+
readonly STAR: 'star';
|
|
9
9
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { invalidateCache as invalidateCacheInternal } from
|
|
2
|
-
import { buildExportsTree } from
|
|
3
|
-
import { findCycles } from
|
|
4
|
-
import { getContention } from
|
|
5
|
-
import { getDependencyUsage } from
|
|
6
|
-
import { getUsage } from
|
|
7
|
-
import { hasStrictlyNsReferences } from
|
|
8
|
-
import { isReferenced } from
|
|
9
|
-
import { resolveDefinition } from
|
|
1
|
+
import { invalidateCache as invalidateCacheInternal } from './cache.js';
|
|
2
|
+
import { buildExportsTree } from './operations/build-exports-tree.js';
|
|
3
|
+
import { findCycles } from './operations/find-cycles.js';
|
|
4
|
+
import { getContention } from './operations/get-contention.js';
|
|
5
|
+
import { getDependencyUsage } from './operations/get-dependency-usage.js';
|
|
6
|
+
import { getUsage } from './operations/get-usage.js';
|
|
7
|
+
import { hasStrictlyNsReferences } from './operations/has-strictly-ns-references.js';
|
|
8
|
+
import { isReferenced } from './operations/is-referenced.js';
|
|
9
|
+
import { resolveDefinition } from './operations/resolve-definition.js';
|
|
10
10
|
export const createGraphExplorer = (graph, entryPaths) => {
|
|
11
11
|
return {
|
|
12
12
|
isReferenced: (filePath, identifier, options) => isReferenced(graph, entryPaths, filePath, identifier, options),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CONTINUE } from
|
|
2
|
-
import { walkDown } from
|
|
1
|
+
import { CONTINUE } from '../constants.js';
|
|
2
|
+
import { walkDown } from '../walk-down.js';
|
|
3
3
|
export const buildExportsTree = (graph, entryPaths, options) => {
|
|
4
4
|
const traces = [];
|
|
5
5
|
const processFile = (filePath, file) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IMPORT_STAR } from
|
|
2
|
-
import { getExportedIdentifiers } from
|
|
3
|
-
import { forEachAliasReExport, forEachPassThroughReExport, getStarReExportSources } from
|
|
1
|
+
import { IMPORT_STAR } from '../../constants.js';
|
|
2
|
+
import { getExportedIdentifiers } from '../utils.js';
|
|
3
|
+
import { forEachAliasReExport, forEachPassThroughReExport, getStarReExportSources } from '../visitors.js';
|
|
4
4
|
export const getContention = (graph, filePath) => {
|
|
5
5
|
const node = graph.get(filePath);
|
|
6
6
|
if (!node)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPackageNameFromModuleSpecifier } from
|
|
1
|
+
import { getPackageNameFromModuleSpecifier } from '../../util/modules.js';
|
|
2
2
|
export const getDependencyUsage = (graph, pattern) => {
|
|
3
3
|
const result = new Map();
|
|
4
4
|
const isMatch = (packageName, binaryName) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IMPORT_STAR } from
|
|
2
|
-
import { getCachedUsage, setCachedUsage } from
|
|
3
|
-
import { CONTINUE } from
|
|
4
|
-
import { findImportRef } from
|
|
5
|
-
import { walkDown } from
|
|
1
|
+
import { IMPORT_STAR } from '../../constants.js';
|
|
2
|
+
import { getCachedUsage, setCachedUsage } from '../cache.js';
|
|
3
|
+
import { CONTINUE } from '../constants.js';
|
|
4
|
+
import { findImportRef } from '../utils.js';
|
|
5
|
+
import { walkDown } from '../walk-down.js';
|
|
6
6
|
export const getUsage = (graph, entryPaths, filePath, identifier) => {
|
|
7
7
|
const cached = getCachedUsage(graph, filePath, identifier);
|
|
8
8
|
if (cached)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAliasReExportMap, getPassThroughReExportSources, getStarReExportSources } from
|
|
1
|
+
import { getAliasReExportMap, getPassThroughReExportSources, getStarReExportSources } from '../visitors.js';
|
|
2
2
|
export const hasStrictlyNsReferences = (graph, filePath, importsForExport, identifier) => {
|
|
3
3
|
const seen = new Set();
|
|
4
4
|
const walkDown = (path, importMaps, id) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OPAQUE } from
|
|
2
|
-
import { getAliasReExportMap, getNamespaceReExportSources, getPassThroughReExportSources, getStarReExportSources, } from
|
|
1
|
+
import { OPAQUE } from '../../constants.js';
|
|
2
|
+
import { getAliasReExportMap, getNamespaceReExportSources, getPassThroughReExportSources, getStarReExportSources, } from '../visitors.js';
|
|
3
3
|
const hasOnlyNsRefs = (file) => {
|
|
4
4
|
if (file.importNs.size === 0)
|
|
5
5
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getCachedDefinition, setCachedDefinition } from
|
|
2
|
-
import { CONTINUE, STOP } from
|
|
3
|
-
import { walkUp } from
|
|
1
|
+
import { getCachedDefinition, setCachedDefinition } from '../cache.js';
|
|
2
|
+
import { CONTINUE, STOP } from '../constants.js';
|
|
3
|
+
import { walkUp } from '../walk-up.js';
|
|
4
4
|
export const resolveDefinition = (graph, filePath, identifier) => {
|
|
5
5
|
const cached = getCachedDefinition(graph, filePath, identifier);
|
|
6
6
|
if (cached !== undefined)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Import, ImportMaps, ModuleGraph } from '../types/module-graph.ts';
|
|
2
2
|
export declare const getExportedIdentifiers: (graph: ModuleGraph, filePath: string, visited?: Set<string>) => Map<string, boolean>;
|
|
3
3
|
export declare const hasStrictlyEnumReferences: (importsForExport: ImportMaps | undefined, identifier: string) => boolean;
|
|
4
|
-
export declare const getIssueType: (hasOnlyNsReference: boolean, isType: boolean) => "exports" | "nsExports" | "
|
|
4
|
+
export declare const getIssueType: (hasOnlyNsReference: boolean, isType: boolean) => "exports" | "nsExports" | "nsTypes" | "types";
|
|
5
5
|
export declare const findImportRef: (graph: ModuleGraph, importingFile: string, importedFile: string, identifier: string) => Import | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getCachedExportedIdentifiers, setCachedExportedIdentifiers } from
|
|
2
|
-
import { forEachAliasReExport, forEachNamespaceReExport, forEachPassThroughReExport, getStarReExportSources, } from
|
|
1
|
+
import { getCachedExportedIdentifiers, setCachedExportedIdentifiers } from './cache.js';
|
|
2
|
+
import { forEachAliasReExport, forEachNamespaceReExport, forEachPassThroughReExport, getStarReExportSources, } from './visitors.js';
|
|
3
3
|
export const getExportedIdentifiers = (graph, filePath, visited = new Set()) => {
|
|
4
4
|
if (visited.has(filePath))
|
|
5
5
|
return new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { STOP } from
|
|
2
|
-
import { getAliasReExportMap, getPassThroughReExportSources, getStarReExportSources } from
|
|
1
|
+
import { STOP } from './constants.js';
|
|
2
|
+
import { getAliasReExportMap, getPassThroughReExportSources, getStarReExportSources } from './visitors.js';
|
|
3
3
|
export const walkDown = (graph, filePath, identifier, visitor, entryPaths, visited = new Set()) => {
|
|
4
4
|
const key = `${filePath}:${identifier}`;
|
|
5
5
|
if (visited.has(key))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RE_EXPORT_KIND, STOP } from
|
|
2
|
-
import { forEachAliasReExport, getNamespaceReExportSources, getPassThroughReExportSources, getStarReExportSources, } from
|
|
1
|
+
import { RE_EXPORT_KIND, STOP } from './constants.js';
|
|
2
|
+
import { forEachAliasReExport, getNamespaceReExportSources, getPassThroughReExportSources, getStarReExportSources, } from './visitors.js';
|
|
3
3
|
export const walkUp = (graph, filePath, identifier, visitor, visited = new Set()) => {
|
|
4
4
|
const key = `${filePath}:${identifier}`;
|
|
5
5
|
if (visited.has(key))
|
package/dist/index.js
CHANGED
package/dist/manifest/helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { join } from
|
|
2
|
-
import { _require } from
|
|
1
|
+
import { join } from '../util/path.js';
|
|
2
|
+
import { _require } from '../util/require.js';
|
|
3
3
|
export const loadPackageManifest = ({ dir, packageName, cwd }) => {
|
|
4
4
|
try {
|
|
5
5
|
return _require(join(dir, 'node_modules', packageName, 'package.json'));
|