knip 5.33.2 → 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 +3 -4
- 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/ast-helpers.d.ts +1 -1
- package/dist/typescript/ast-helpers.js +5 -1
- package/dist/typescript/find-internal-references.d.ts +1 -1
- package/dist/typescript/find-internal-references.js +12 -10
- package/dist/typescript/get-imports-and-exports.d.ts +1 -11
- package/dist/typescript/get-imports-and-exports.js +19 -14
- 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/exportKeyword.js +2 -0
- 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/plugins.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Plugins } from './plugins/index.js';
|
|
2
2
|
import { timerify } from './util/Performance.js';
|
|
3
3
|
import parsedArgValues from './util/cli-arguments.js';
|
|
4
|
+
const PMap = Plugins;
|
|
4
5
|
const { performance: isEnabled = false } = parsedArgValues;
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const timerifyMethods = ['resolve', 'resolveConfig', 'resolveEntryPaths'];
|
|
7
|
+
const PluginEntries = Object.entries(PMap);
|
|
7
8
|
if (isEnabled) {
|
|
8
|
-
for (const [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
plugins[name][method] = timerify(plugin[method], `${method} (${plugin.title})`);
|
|
13
|
-
}
|
|
9
|
+
for (const [, plugin] of PluginEntries) {
|
|
10
|
+
for (const method of timerifyMethods) {
|
|
11
|
+
if (method in plugin)
|
|
12
|
+
plugin[method] = timerify(plugin[method], `${method} (${plugin.title})`);
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
16
|
+
const pluginArgsMap = new Map(PluginEntries.flatMap(([pluginName, plugin]) => {
|
|
17
|
+
if (!plugin.args)
|
|
18
|
+
return [];
|
|
19
|
+
const item = [pluginName, plugin.args];
|
|
20
|
+
if (Array.isArray(plugin.args?.binaries))
|
|
21
|
+
return plugin.args.binaries.map(bin => [bin, item]);
|
|
22
|
+
return [[pluginName, item]];
|
|
23
|
+
}));
|
|
24
|
+
export { PMap as Plugins, PluginEntries, pluginArgsMap };
|
|
@@ -56,7 +56,7 @@ export default ({ report, issues, tagHints, configurationHints, noConfigHints, i
|
|
|
56
56
|
}
|
|
57
57
|
if (!noConfigHints) {
|
|
58
58
|
if (configurationHints.size > 0) {
|
|
59
|
-
logTitle('Configuration
|
|
59
|
+
logTitle('Configuration hints', configurationHints.size);
|
|
60
60
|
for (const hint of configurationHints) {
|
|
61
61
|
const { type, workspaceName, identifier } = hint;
|
|
62
62
|
const message = `Unused item in ${type}`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'ava' | 'babel' | 'c8' | 'capacitor' | 'changesets' | 'commitizen' | 'commitlint' | 'cspell' | 'cucumber' | 'cypress' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'gatsby' | 'github-actions' | 'graphql-codegen' | 'husky' | 'jest' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mocha' | 'moonrepo' | 'msw' | 'nest' | 'netlify' | 'next' | 'node' | 'node-test-runner' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'postcss' | 'preconstruct' | 'prettier' | 'react-cosmos' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rspack' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yorkie';
|
|
2
|
+
export declare const pluginNames: readonly ["angular", "astro", "ava", "babel", "c8", "capacitor", "changesets", "commitizen", "commitlint", "cspell", "cucumber", "cypress", "dotenv", "drizzle", "eleventy", "eslint", "gatsby", "github-actions", "graphql-codegen", "husky", "jest", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mocha", "moonrepo", "msw", "nest", "netlify", "next", "node", "node-test-runner", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "playwright", "playwright-ct", "playwright-test", "postcss", "preconstruct", "prettier", "react-cosmos", "release-it", "remark", "remix", "rollup", "rsbuild", "rspack", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "storybook", "stryker", "stylelint", "svelte", "syncpack", "tailwind", "travis", "ts-node", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yorkie"];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const pluginNames = [
|
|
2
|
+
'angular',
|
|
3
|
+
'astro',
|
|
4
|
+
'ava',
|
|
5
|
+
'babel',
|
|
6
|
+
'c8',
|
|
7
|
+
'capacitor',
|
|
8
|
+
'changesets',
|
|
9
|
+
'commitizen',
|
|
10
|
+
'commitlint',
|
|
11
|
+
'cspell',
|
|
12
|
+
'cucumber',
|
|
13
|
+
'cypress',
|
|
14
|
+
'dotenv',
|
|
15
|
+
'drizzle',
|
|
16
|
+
'eleventy',
|
|
17
|
+
'eslint',
|
|
18
|
+
'gatsby',
|
|
19
|
+
'github-actions',
|
|
20
|
+
'graphql-codegen',
|
|
21
|
+
'husky',
|
|
22
|
+
'jest',
|
|
23
|
+
'ladle',
|
|
24
|
+
'lefthook',
|
|
25
|
+
'lint-staged',
|
|
26
|
+
'linthtml',
|
|
27
|
+
'lockfile-lint',
|
|
28
|
+
'lost-pixel',
|
|
29
|
+
'markdownlint',
|
|
30
|
+
'mocha',
|
|
31
|
+
'moonrepo',
|
|
32
|
+
'msw',
|
|
33
|
+
'nest',
|
|
34
|
+
'netlify',
|
|
35
|
+
'next',
|
|
36
|
+
'node',
|
|
37
|
+
'node-test-runner',
|
|
38
|
+
'nodemon',
|
|
39
|
+
'npm-package-json-lint',
|
|
40
|
+
'nuxt',
|
|
41
|
+
'nx',
|
|
42
|
+
'nyc',
|
|
43
|
+
'oclif',
|
|
44
|
+
'playwright',
|
|
45
|
+
'playwright-ct',
|
|
46
|
+
'playwright-test',
|
|
47
|
+
'postcss',
|
|
48
|
+
'preconstruct',
|
|
49
|
+
'prettier',
|
|
50
|
+
'react-cosmos',
|
|
51
|
+
'release-it',
|
|
52
|
+
'remark',
|
|
53
|
+
'remix',
|
|
54
|
+
'rollup',
|
|
55
|
+
'rsbuild',
|
|
56
|
+
'rspack',
|
|
57
|
+
'semantic-release',
|
|
58
|
+
'sentry',
|
|
59
|
+
'simple-git-hooks',
|
|
60
|
+
'size-limit',
|
|
61
|
+
'storybook',
|
|
62
|
+
'stryker',
|
|
63
|
+
'stylelint',
|
|
64
|
+
'svelte',
|
|
65
|
+
'syncpack',
|
|
66
|
+
'tailwind',
|
|
67
|
+
'travis',
|
|
68
|
+
'ts-node',
|
|
69
|
+
'tsup',
|
|
70
|
+
'tsx',
|
|
71
|
+
'typedoc',
|
|
72
|
+
'typescript',
|
|
73
|
+
'unbuild',
|
|
74
|
+
'unocss',
|
|
75
|
+
'vercel-og',
|
|
76
|
+
'vike',
|
|
77
|
+
'vite',
|
|
78
|
+
'vitest',
|
|
79
|
+
'vue',
|
|
80
|
+
'webdriver-io',
|
|
81
|
+
'webpack',
|
|
82
|
+
'wireit',
|
|
83
|
+
'wrangler',
|
|
84
|
+
'xo',
|
|
85
|
+
'yorkie',
|
|
86
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ParsedArgs } from 'minimist';
|
|
2
|
+
export type ConfigArg = boolean | (string | [string, (id: string) => string])[];
|
|
3
|
+
export type Args = {
|
|
4
|
+
binaries?: string[];
|
|
5
|
+
positional?: boolean;
|
|
6
|
+
string?: string[];
|
|
7
|
+
boolean?: string[];
|
|
8
|
+
alias?: Record<string, string[]>;
|
|
9
|
+
resolve?: string[];
|
|
10
|
+
nodeImportArgs?: boolean;
|
|
11
|
+
config?: ConfigArg;
|
|
12
|
+
args?: (args: string[]) => string[];
|
|
13
|
+
fromArgs?: string[] | ((parsed: ParsedArgs, args: string[]) => string[]);
|
|
14
|
+
};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { ConfigurationValidator, pluginSchema } from '../ConfigurationValidator.js';
|
|
3
3
|
import type { AsyncCompilers, SyncCompilers } from '../compilers/types.js';
|
|
4
|
-
import type
|
|
4
|
+
import type { Input } from '../util/input.js';
|
|
5
|
+
import type { PluginName } from './PluginNames.js';
|
|
6
|
+
import type { Args } from './args.js';
|
|
7
|
+
import type { Tags } from './cli.js';
|
|
5
8
|
import type { IssueType, Rules } from './issues.js';
|
|
9
|
+
import type { PackageJson } from './package-json.js';
|
|
10
|
+
export interface GetInputsFromScriptsOptions extends BaseOptions {
|
|
11
|
+
knownBinsOnly?: boolean;
|
|
12
|
+
containingFilePath: string;
|
|
13
|
+
}
|
|
14
|
+
export type GetInputsFromScripts<T = GetInputsFromScriptsOptions> = (npmScripts: string | string[] | Set<string>, options: T) => Input[];
|
|
15
|
+
export type GetInputsFromScriptsPartial = (npmScripts: string | string[] | Set<string>, options?: Partial<GetInputsFromScriptsOptions>) => Input[];
|
|
16
|
+
type FromArgs = (args: string[]) => Input[];
|
|
17
|
+
interface BinaryResolverOptions extends GetInputsFromScriptsOptions {
|
|
18
|
+
fromArgs: FromArgs;
|
|
19
|
+
}
|
|
20
|
+
export type BinaryResolver = (binary: string, args: string[], options: BinaryResolverOptions) => Input[];
|
|
6
21
|
export type RawConfiguration = z.infer<typeof ConfigurationValidator>;
|
|
7
22
|
export type RawPluginConfiguration = z.infer<typeof pluginSchema>;
|
|
8
|
-
type NormalizedGlob = string[];
|
|
9
23
|
export type IgnorePatterns = (string | RegExp)[];
|
|
10
|
-
export type EnablerPatterns = IgnorePatterns;
|
|
11
|
-
export type PluginName = keyof typeof Plugins;
|
|
12
|
-
export type PluginMap = typeof Plugins;
|
|
13
|
-
export type EnsuredPluginConfiguration = {
|
|
14
|
-
config: NormalizedGlob | null;
|
|
15
|
-
entry: NormalizedGlob | null;
|
|
16
|
-
project: NormalizedGlob | null;
|
|
17
|
-
};
|
|
18
|
-
type PluginConfiguration = EnsuredPluginConfiguration | boolean;
|
|
19
|
-
export type PluginsConfiguration = Record<PluginName, PluginConfiguration>;
|
|
20
|
-
interface BaseWorkspaceConfiguration {
|
|
21
|
-
entry: NormalizedGlob;
|
|
22
|
-
project: NormalizedGlob;
|
|
23
|
-
paths: Record<string, string[]>;
|
|
24
|
-
ignore: NormalizedGlob;
|
|
25
|
-
isIncludeEntryExports: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface WorkspaceConfiguration extends BaseWorkspaceConfiguration, Partial<PluginsConfiguration> {
|
|
28
|
-
}
|
|
29
24
|
type IgnorableExport = 'class' | 'enum' | 'function' | 'interface' | 'member' | 'type';
|
|
30
25
|
export type IgnoreExportsUsedInFile = boolean | Partial<Record<IgnorableExport, boolean>>;
|
|
26
|
+
export type GetImportsAndExportsOptions = {
|
|
27
|
+
skipTypeOnly: boolean;
|
|
28
|
+
skipExports: boolean;
|
|
29
|
+
isFixExports: boolean;
|
|
30
|
+
isFixTypes: boolean;
|
|
31
|
+
isReportClassMembers: boolean;
|
|
32
|
+
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
33
|
+
tags: Tags;
|
|
34
|
+
};
|
|
31
35
|
export interface Configuration {
|
|
32
36
|
rules: Rules;
|
|
33
37
|
include: IssueType[];
|
|
@@ -43,4 +47,63 @@ export interface Configuration {
|
|
|
43
47
|
asyncCompilers: AsyncCompilers;
|
|
44
48
|
rootPluginConfigs: Partial<PluginsConfiguration>;
|
|
45
49
|
}
|
|
50
|
+
export type NormalizedGlob = string[];
|
|
51
|
+
export type EnsuredPluginConfiguration = {
|
|
52
|
+
config: NormalizedGlob | null;
|
|
53
|
+
entry: NormalizedGlob | null;
|
|
54
|
+
project: NormalizedGlob | null;
|
|
55
|
+
};
|
|
56
|
+
interface BaseWorkspaceConfiguration {
|
|
57
|
+
entry: NormalizedGlob;
|
|
58
|
+
project: NormalizedGlob;
|
|
59
|
+
paths: Record<string, string[]>;
|
|
60
|
+
ignore: NormalizedGlob;
|
|
61
|
+
isIncludeEntryExports: boolean;
|
|
62
|
+
}
|
|
63
|
+
type PluginConfiguration = EnsuredPluginConfiguration | boolean;
|
|
64
|
+
export type PluginsConfiguration = Record<PluginName, PluginConfiguration>;
|
|
65
|
+
export interface WorkspaceConfiguration extends BaseWorkspaceConfiguration, Partial<PluginsConfiguration> {
|
|
66
|
+
}
|
|
67
|
+
interface BaseOptions {
|
|
68
|
+
rootCwd: string;
|
|
69
|
+
cwd: string;
|
|
70
|
+
manifestScriptNames: Set<string>;
|
|
71
|
+
}
|
|
72
|
+
type IsPluginEnabledOptions = {
|
|
73
|
+
cwd: string;
|
|
74
|
+
manifest: PackageJson;
|
|
75
|
+
dependencies: Set<string>;
|
|
76
|
+
config: WorkspaceConfiguration;
|
|
77
|
+
};
|
|
78
|
+
export type IsPluginEnabled = (options: IsPluginEnabledOptions) => boolean | Promise<boolean>;
|
|
79
|
+
export interface PluginOptions extends BaseOptions {
|
|
80
|
+
manifest: PackageJson;
|
|
81
|
+
config: EnsuredPluginConfiguration;
|
|
82
|
+
configFileDir: string;
|
|
83
|
+
configFileName: string;
|
|
84
|
+
configFilePath: string;
|
|
85
|
+
isProduction: boolean;
|
|
86
|
+
enabledPlugins: string[];
|
|
87
|
+
getInputsFromScripts: GetInputsFromScriptsPartial;
|
|
88
|
+
}
|
|
89
|
+
export type ResolveEntryPaths<T = any> = (config: T, options: PluginOptions) => Promise<Input[]> | Input[];
|
|
90
|
+
export type ResolveConfig<T = any> = (config: T, options: PluginOptions) => Promise<Input[]> | Input[];
|
|
91
|
+
export type Resolve = (options: PluginOptions) => Promise<Input[]> | Input[];
|
|
92
|
+
export interface Plugin {
|
|
93
|
+
title: string;
|
|
94
|
+
note?: string;
|
|
95
|
+
args?: Args;
|
|
96
|
+
packageJsonPath?: string | ((manifest: PackageJson) => string);
|
|
97
|
+
enablers?: IgnorePatterns | string;
|
|
98
|
+
isEnabled?: IsPluginEnabled;
|
|
99
|
+
config?: string[];
|
|
100
|
+
entry?: string[];
|
|
101
|
+
production?: string[];
|
|
102
|
+
project?: string[];
|
|
103
|
+
resolveEntryPaths?: ResolveEntryPaths;
|
|
104
|
+
resolveConfig?: ResolveConfig;
|
|
105
|
+
resolve?: Resolve;
|
|
106
|
+
}
|
|
107
|
+
export type PluginMap = Record<PluginName, Plugin>;
|
|
108
|
+
export type Entries = [PluginName, Plugin][];
|
|
46
109
|
export {};
|
|
@@ -37,5 +37,15 @@ export type PackageJson = {
|
|
|
37
37
|
peerDependenciesMeta?: Record<string, {
|
|
38
38
|
optional: true;
|
|
39
39
|
}>;
|
|
40
|
+
module?: string;
|
|
41
|
+
browser?: string;
|
|
42
|
+
types?: string;
|
|
43
|
+
typings?: string;
|
|
40
44
|
} & Plugins;
|
|
45
|
+
export type Package = {
|
|
46
|
+
dir: string;
|
|
47
|
+
name: string;
|
|
48
|
+
pkgName: string | undefined;
|
|
49
|
+
manifest: PackageJson;
|
|
50
|
+
};
|
|
41
51
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type ts from 'typescript';
|
|
2
|
+
import type { AsyncCompilers, SyncCompilers } from '../compilers/types.js';
|
|
3
|
+
import type { ToSourceFilePath } from '../util/to-source-path.js';
|
|
4
|
+
export type Paths = ts.CompilerOptions['paths'];
|
|
5
|
+
export type PrincipalOptions = {
|
|
6
|
+
cwd: string;
|
|
7
|
+
isFile: boolean;
|
|
8
|
+
compilerOptions: ts.CompilerOptions;
|
|
9
|
+
paths: Paths;
|
|
10
|
+
compilers: [SyncCompilers, AsyncCompilers];
|
|
11
|
+
pkgName: string;
|
|
12
|
+
isIsolateWorkspaces: boolean;
|
|
13
|
+
isSkipLibs: boolean;
|
|
14
|
+
isWatch: boolean;
|
|
15
|
+
toSourceFilePath: ToSourceFilePath;
|
|
16
|
+
isCache: boolean;
|
|
17
|
+
cacheLocation: string;
|
|
18
|
+
};
|
|
@@ -24,7 +24,7 @@ export declare const isObjectEnumerationCallExpressionArgument: (node: ts.Identi
|
|
|
24
24
|
export declare const isTopLevel: (node: ts.Node) => boolean;
|
|
25
25
|
export declare const getTypeName: (node: ts.Identifier) => ts.QualifiedName | undefined;
|
|
26
26
|
export declare const isImportSpecifier: (node: ts.Node) => boolean;
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const isReferencedInExport: (node: ts.Node) => boolean;
|
|
28
28
|
export declare const getExportKeywordNode: (node: ts.Node) => ts.ExportKeyword | undefined;
|
|
29
29
|
export declare const getDefaultKeywordNode: (node: ts.Node) => ts.DefaultKeyword | undefined;
|
|
30
30
|
export declare const hasRequireCall: (node: ts.Node) => boolean;
|
|
@@ -172,7 +172,11 @@ const getAncestorTypeDeclaration = (node) => {
|
|
|
172
172
|
node = node.parent;
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
-
export const
|
|
175
|
+
export const isReferencedInExport = (node) => {
|
|
176
|
+
if (ts.isTypeQueryNode(node.parent) && isExported(node.parent.parent))
|
|
177
|
+
return true;
|
|
178
|
+
if (ts.isTypeReferenceNode(node.parent) && isExported(node.parent.parent))
|
|
179
|
+
return true;
|
|
176
180
|
const typeNode = getAncestorTypeDeclaration(node);
|
|
177
181
|
return Boolean(typeNode && isExported(typeNode));
|
|
178
182
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type { Export, ExportMember } from '../types/dependency-graph.js';
|
|
3
3
|
export declare const isType: (item: Export | ExportMember) => boolean;
|
|
4
|
-
export declare const findInternalReferences: (item: Export | ExportMember, sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker,
|
|
4
|
+
export declare const findInternalReferences: (item: Export | ExportMember, sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker, referencedSymbolsInExport: Set<ts.Symbol>, isBindingElement?: boolean) => [number, boolean];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { isIdChar } from '../util/regex.js';
|
|
3
3
|
export const isType = (item) => item.type === 'type' || item.type === 'interface' || item.type === 'enum';
|
|
4
|
-
export const findInternalReferences = (item, sourceFile, typeChecker,
|
|
4
|
+
export const findInternalReferences = (item, sourceFile, typeChecker, referencedSymbolsInExport, isBindingElement) => {
|
|
5
5
|
if (!item.symbol)
|
|
6
6
|
return [0, false];
|
|
7
7
|
if (item.identifier === '')
|
|
@@ -12,7 +12,7 @@ export const findInternalReferences = (item, sourceFile, typeChecker, referenced
|
|
|
12
12
|
const id = item.identifier;
|
|
13
13
|
const symbols = new Set();
|
|
14
14
|
let refCount = 0;
|
|
15
|
-
let
|
|
15
|
+
let isSymbolInExport = false;
|
|
16
16
|
let index = 0;
|
|
17
17
|
while (index < text.length && (index = text.indexOf(id, index)) !== -1) {
|
|
18
18
|
if (!isIdChar(text.charAt(index - 1)) && !isIdChar(text.charAt(index + id.length))) {
|
|
@@ -20,21 +20,23 @@ export const findInternalReferences = (item, sourceFile, typeChecker, referenced
|
|
|
20
20
|
if (!isExportDeclaration) {
|
|
21
21
|
const symbol = typeChecker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, index));
|
|
22
22
|
if (symbol) {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
23
|
+
const isInExport = referencedSymbolsInExport.has(symbol);
|
|
24
|
+
if (isInExport)
|
|
25
|
+
isSymbolInExport = true;
|
|
26
26
|
if (item.symbol === symbol) {
|
|
27
27
|
refCount++;
|
|
28
|
-
if (
|
|
29
|
-
return [refCount,
|
|
28
|
+
if (isInExport || isType(item))
|
|
29
|
+
return [refCount, isSymbolInExport];
|
|
30
|
+
if (isBindingElement)
|
|
31
|
+
return [refCount, true];
|
|
30
32
|
}
|
|
31
33
|
const declaration = symbol.declarations?.[0];
|
|
32
34
|
if (declaration) {
|
|
33
35
|
if (item.symbol === declaration.name?.flowNode?.node?.symbol) {
|
|
34
|
-
return [++refCount,
|
|
36
|
+
return [++refCount, isSymbolInExport];
|
|
35
37
|
}
|
|
36
38
|
if (ts.isImportSpecifier(declaration) && symbols.has(symbol)) {
|
|
37
|
-
return [++refCount,
|
|
39
|
+
return [++refCount, isSymbolInExport];
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
symbols.add(symbol);
|
|
@@ -43,5 +45,5 @@ export const findInternalReferences = (item, sourceFile, typeChecker, referenced
|
|
|
43
45
|
}
|
|
44
46
|
index += id.length;
|
|
45
47
|
}
|
|
46
|
-
return [refCount,
|
|
48
|
+
return [refCount, isSymbolInExport];
|
|
47
49
|
};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IgnoreExportsUsedInFile } from '../types/config.js';
|
|
2
|
+
import type { GetImportsAndExportsOptions } from '../types/config.js';
|
|
4
3
|
import type { ExportMap, ImportMap, UnresolvedImport } from '../types/dependency-graph.js';
|
|
5
4
|
import type { IssueSymbol } from '../types/issues.js';
|
|
6
5
|
import type { BoundSourceFile } from './SourceFile.js';
|
|
7
|
-
export type GetImportsAndExportsOptions = {
|
|
8
|
-
skipTypeOnly: boolean;
|
|
9
|
-
skipExports: boolean;
|
|
10
|
-
isFixExports: boolean;
|
|
11
|
-
isFixTypes: boolean;
|
|
12
|
-
isReportClassMembers: boolean;
|
|
13
|
-
ignoreExportsUsedInFile: IgnoreExportsUsedInFile;
|
|
14
|
-
tags: Tags;
|
|
15
|
-
};
|
|
16
6
|
export declare const _getImportsAndExports: (sourceFile: BoundSourceFile, resolveModule: (specifier: string) => ts.ResolvedModuleFull | undefined, typeChecker: ts.TypeChecker, options: GetImportsAndExportsOptions) => {
|
|
17
7
|
imports: {
|
|
18
8
|
internal: ImportMap;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isBuiltin } from 'node:module';
|
|
2
2
|
import ts from 'typescript';
|
|
3
|
-
import { ALIAS_TAG, ANONYMOUS, DEFAULT_EXTENSIONS, IMPORT_STAR } from '../constants.js';
|
|
3
|
+
import { ALIAS_TAG, ANONYMOUS, DEFAULT_EXTENSIONS, IMPORT_STAR, PROTOCOL_VIRTUAL } from '../constants.js';
|
|
4
4
|
import { timerify } from '../util/Performance.js';
|
|
5
5
|
import { addNsValue, addValue, createImports } from '../util/dependency-graph.js';
|
|
6
6
|
import { getPackageNameFromFilePath, isStartsLikePackageName, sanitizeSpecifier } from '../util/modules.js';
|
|
7
7
|
import { extname, isInNodeModules } from '../util/path.js';
|
|
8
8
|
import { shouldIgnore } from '../util/tag.js';
|
|
9
|
-
import { getAccessMembers, getDestructuredIds, getJSDocTags, getLineAndCharacterOfPosition, getTypeName, isAccessExpression, isConsiderReferencedNS, isDestructuring, isImportSpecifier, isObjectEnumerationCallExpressionArgument,
|
|
9
|
+
import { getAccessMembers, getDestructuredIds, getJSDocTags, getLineAndCharacterOfPosition, getTypeName, isAccessExpression, isConsiderReferencedNS, isDestructuring, isImportSpecifier, isObjectEnumerationCallExpressionArgument, isReferencedInExport, } from './ast-helpers.js';
|
|
10
10
|
import { findInternalReferences, isType } from './find-internal-references.js';
|
|
11
11
|
import getDynamicImportVisitors from './visitors/dynamic-imports/index.js';
|
|
12
12
|
import getExportVisitors from './visitors/exports/index.js';
|
|
@@ -45,7 +45,7 @@ const getImportsAndExports = (sourceFile, resolveModule, typeChecker, options) =
|
|
|
45
45
|
const scripts = new Set();
|
|
46
46
|
const traceRefs = new Set();
|
|
47
47
|
const importedInternalSymbols = new Map();
|
|
48
|
-
const
|
|
48
|
+
const referencedSymbolsInExport = new Set();
|
|
49
49
|
const visitors = getVisitors(sourceFile);
|
|
50
50
|
const addNsMemberRefs = (internalImport, namespace, member) => {
|
|
51
51
|
if (typeof member === 'string') {
|
|
@@ -144,6 +144,8 @@ const getImportsAndExports = (sourceFile, resolveModule, typeChecker, options) =
|
|
|
144
144
|
return;
|
|
145
145
|
if (shouldIgnore(getJSDocTags(node), tags))
|
|
146
146
|
return;
|
|
147
|
+
if (specifier.startsWith(PROTOCOL_VIRTUAL))
|
|
148
|
+
return;
|
|
147
149
|
if (typeof pos === 'number') {
|
|
148
150
|
const { line, character } = sourceFile.getLineAndCharacterOfPosition(pos);
|
|
149
151
|
unresolvedImports.add({ specifier, pos, line: line + 1, col: character + 1 });
|
|
@@ -280,10 +282,8 @@ const getImportsAndExports = (sourceFile, resolveModule, typeChecker, options) =
|
|
|
280
282
|
}
|
|
281
283
|
}
|
|
282
284
|
}
|
|
283
|
-
if (!isTopLevel && symbol.exportSymbol) {
|
|
284
|
-
|
|
285
|
-
referencedSymbolsInExportedTypes.add(symbol.exportSymbol);
|
|
286
|
-
}
|
|
285
|
+
if (!isTopLevel && symbol.exportSymbol && isReferencedInExport(node)) {
|
|
286
|
+
referencedSymbolsInExport.add(symbol.exportSymbol);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -308,17 +308,22 @@ const getImportsAndExports = (sourceFile, resolveModule, typeChecker, options) =
|
|
|
308
308
|
for (const node of pragmaImports)
|
|
309
309
|
addImport(node, sourceFile);
|
|
310
310
|
for (const item of exports.values()) {
|
|
311
|
-
|
|
312
|
-
if (item.symbol && referencedSymbolsInExportedTypes.has(item.symbol)) {
|
|
311
|
+
if (item.symbol && referencedSymbolsInExport.has(item.symbol)) {
|
|
313
312
|
item.refs = [1, true];
|
|
314
313
|
}
|
|
315
|
-
else
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
314
|
+
else {
|
|
315
|
+
const isBindingElement = item.symbol?.valueDeclaration && ts.isBindingElement(item.symbol.valueDeclaration);
|
|
316
|
+
if (ignoreExportsUsedInFile === true ||
|
|
317
|
+
(typeof ignoreExportsUsedInFile === 'object' &&
|
|
318
|
+
item.type !== 'unknown' &&
|
|
319
|
+
ignoreExportsUsedInFile[item.type]) ||
|
|
320
|
+
isType(item) ||
|
|
321
|
+
isBindingElement) {
|
|
322
|
+
item.refs = findInternalReferences(item, sourceFile, typeChecker, referencedSymbolsInExport, isBindingElement);
|
|
323
|
+
}
|
|
319
324
|
}
|
|
320
325
|
for (const member of item.members) {
|
|
321
|
-
member.refs = findInternalReferences(member, sourceFile, typeChecker,
|
|
326
|
+
member.refs = findInternalReferences(member, sourceFile, typeChecker, referencedSymbolsInExport);
|
|
322
327
|
member.symbol = undefined;
|
|
323
328
|
}
|
|
324
329
|
item.symbol = undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined)[];
|
|
3
3
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type { ImportNode } from '../../../types/imports.js';
|
|
3
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
3
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => ImportNode | ImportNode[] | undefined;
|
|
4
4
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -19,6 +19,7 @@ export default visit(() => true, (node, { isFixExports, isFixTypes, isReportClas
|
|
|
19
19
|
: undefined;
|
|
20
20
|
return {
|
|
21
21
|
node: element,
|
|
22
|
+
symbol: element.symbol,
|
|
22
23
|
identifier: element.name.escapedText.toString(),
|
|
23
24
|
type: SymbolType.UNKNOWN,
|
|
24
25
|
pos: element.name.getStart(),
|
|
@@ -33,6 +34,7 @@ export default visit(() => true, (node, { isFixExports, isFixTypes, isReportClas
|
|
|
33
34
|
const fix = isFixExports ? [element.getStart(), element.getEnd(), FIX_FLAGS.NONE] : undefined;
|
|
34
35
|
return {
|
|
35
36
|
node: element,
|
|
37
|
+
symbol: element.symbol,
|
|
36
38
|
identifier: element.getText(),
|
|
37
39
|
type: SymbolType.UNKNOWN,
|
|
38
40
|
pos: element.getStart(),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined)[];
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined)[];
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("../../../types/config.js").GetImportsAndExportsOptions) => import("../../../types/imports.js").ImportNode | import("../../../types/imports.js").ImportNode[] | undefined;
|
|
3
3
|
export default _default;
|