knip 6.45.1 → 6.46.1
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/README.md +42 -18
- package/dist/ConfigurationChief.d.ts +6 -0
- package/dist/ConfigurationChief.js +2 -2
- package/dist/DependencyDeputy.d.ts +12 -14
- package/dist/DependencyDeputy.js +33 -21
- package/dist/IssueCollector.d.ts +1 -0
- package/dist/IssueCollector.js +4 -1
- package/dist/PackagePeeker.d.ts +0 -9
- package/dist/PackagePeeker.js +0 -38
- package/dist/ProjectPrincipal.d.ts +1 -1
- package/dist/ProjectPrincipal.js +3 -1
- package/dist/WorkspaceWorker.js +7 -7
- package/dist/binaries/bash-parser.js +5 -8
- package/dist/binaries/command.js +2 -2
- package/dist/binaries/fallback.d.ts +5 -1
- package/dist/binaries/fallback.js +41 -10
- package/dist/binaries/plugins.d.ts +1 -0
- package/dist/binaries/plugins.js +75 -39
- package/dist/binaries/resolvers/bun.js +2 -2
- package/dist/binaries/resolvers/npm.js +2 -2
- package/dist/binaries/resolvers/npx.js +2 -2
- package/dist/binaries/resolvers/nub.js +2 -2
- package/dist/binaries/resolvers/pnpm.js +29 -21
- package/dist/binaries/resolvers/pnpx.js +20 -8
- package/dist/binaries/resolvers/vp.js +1 -1
- package/dist/binaries/resolvers/yarn.js +1 -1
- package/dist/binaries/util.d.ts +4 -1
- package/dist/binaries/util.js +10 -13
- package/dist/constants.js +18 -0
- package/dist/graph/SubpathReferences.d.ts +1 -1
- package/dist/graph/SubpathReferences.js +4 -3
- package/dist/graph/build.js +11 -12
- package/dist/plugins/_template/index.js +2 -2
- package/dist/plugins/angular/index.js +3 -8
- package/dist/plugins/astro/resolveFromAST.js +2 -2
- package/dist/plugins/astro-markdoc/index.js +2 -2
- package/dist/plugins/astro-og-canvas/index.js +1 -1
- package/dist/plugins/aws-cdk/index.js +3 -3
- package/dist/plugins/babel/index.js +5 -3
- package/dist/plugins/borp/index.js +2 -2
- package/dist/plugins/bun/index.js +3 -3
- package/dist/plugins/capacitor/index.js +33 -6
- package/dist/plugins/capacitor/types.d.ts +10 -0
- package/dist/plugins/changesets/index.js +2 -2
- package/dist/plugins/commitizen/index.js +2 -2
- package/dist/plugins/commitlint/index.js +2 -2
- package/dist/plugins/convex/index.js +2 -2
- package/dist/plugins/cspell/index.js +2 -2
- package/dist/plugins/cucumber/index.js +2 -2
- package/dist/plugins/cypress/index.js +3 -3
- package/dist/plugins/docusaurus/helpers.js +6 -6
- package/dist/plugins/docusaurus/index.js +3 -3
- package/dist/plugins/dotenv/index.js +6 -2
- package/dist/plugins/drizzle/index.js +2 -2
- package/dist/plugins/electron-builder/index.d.ts +3 -0
- package/dist/plugins/electron-builder/index.js +61 -0
- package/dist/plugins/electron-forge/index.js +2 -2
- package/dist/plugins/electron-vite/index.js +4 -3
- package/dist/plugins/electron-vite/types.d.ts +3 -0
- package/dist/plugins/eleventy/index.js +2 -2
- package/dist/plugins/ember/compiler.d.ts +2 -0
- package/dist/plugins/ember/compiler.js +14 -0
- package/dist/plugins/ember/index.d.ts +6 -0
- package/dist/plugins/ember/index.js +160 -0
- package/dist/plugins/ember/types.d.ts +13 -0
- package/dist/plugins/ember/types.js +1 -0
- package/dist/plugins/ember/visitors/importSync.d.ts +2 -0
- package/dist/plugins/ember/visitors/importSync.js +32 -0
- package/dist/plugins/ember-template-lint/index.d.ts +3 -0
- package/dist/plugins/ember-template-lint/index.js +20 -0
- package/dist/plugins/env-cmd/index.d.ts +3 -0
- package/dist/plugins/env-cmd/index.js +16 -0
- package/dist/plugins/esbuild/index.js +2 -2
- package/dist/plugins/eslint/helpers.js +6 -6
- package/dist/plugins/eslint/index.js +0 -1
- package/dist/plugins/eslint/resolveFromAST.js +11 -3
- package/dist/plugins/evalite/index.js +2 -2
- package/dist/plugins/expo/helpers.js +10 -10
- package/dist/plugins/expo-router/index.js +3 -3
- package/dist/plugins/filesystem-routing/index.js +4 -4
- package/dist/plugins/flue/index.js +4 -4
- package/dist/plugins/gatsby/index.js +3 -3
- package/dist/plugins/github-action/index.js +2 -2
- package/dist/plugins/github-actions/index.js +2 -2
- package/dist/plugins/graphql-codegen/index.js +8 -6
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.js +12 -0
- package/dist/plugins/jasmine/index.js +3 -4
- package/dist/plugins/jest/index.js +3 -3
- package/dist/plugins/karma/helpers.js +2 -2
- package/dist/plugins/karma/index.js +5 -1
- package/dist/plugins/knex/index.js +13 -7
- package/dist/plugins/laravel-vite-plugin/resolveFromAST.js +2 -2
- package/dist/plugins/linthtml/index.js +2 -2
- package/dist/plugins/lunaria/index.js +3 -3
- package/dist/plugins/maestro/index.d.ts +3 -0
- package/dist/plugins/maestro/index.js +54 -0
- package/dist/plugins/maestro/types.d.ts +21 -0
- package/dist/plugins/maestro/types.js +1 -0
- package/dist/plugins/markdownlint/index.js +3 -3
- package/dist/plugins/marko/index.js +4 -4
- package/dist/plugins/mastra/index.js +3 -3
- package/dist/plugins/mdx/index.js +3 -3
- package/dist/plugins/mdxlint/index.js +2 -2
- package/dist/plugins/metro/index.js +5 -5
- package/dist/plugins/mikro-orm/index.js +3 -4
- package/dist/plugins/mise/scripts.js +2 -3
- package/dist/plugins/mocha/index.js +8 -7
- package/dist/plugins/netlify/index.js +4 -4
- package/dist/plugins/next/index.js +5 -5
- package/dist/plugins/next-mdx/resolveFromAST.js +2 -2
- package/dist/plugins/nitro/index.js +4 -4
- package/dist/plugins/node/index.d.ts +16 -0
- package/dist/plugins/node/index.js +89 -23
- package/dist/plugins/nodemon/index.js +1 -1
- package/dist/plugins/npm-package-json-lint/index.js +2 -2
- package/dist/plugins/nuxt/index.js +16 -14
- package/dist/plugins/nx/index.js +3 -3
- package/dist/plugins/nyc/index.js +39 -2
- package/dist/plugins/oclif/index.js +5 -3
- package/dist/plugins/openclaw/index.js +5 -5
- package/dist/plugins/oxlint/index.js +2 -2
- package/dist/plugins/panda-css/index.js +2 -2
- package/dist/plugins/parcel/index.js +2 -2
- package/dist/plugins/payload/index.js +3 -3
- package/dist/plugins/playwright/index.js +4 -4
- package/dist/plugins/pm2/index.js +2 -2
- package/dist/plugins/pnpm/index.js +1 -1
- package/dist/plugins/postcss/index.js +2 -2
- package/dist/plugins/preconstruct/index.js +2 -2
- package/dist/plugins/prettier/index.js +4 -3
- package/dist/plugins/prisma/index.js +5 -5
- package/dist/plugins/quasar/resolveFromAST.js +8 -8
- package/dist/plugins/qwik/resolveFromAST.js +3 -3
- package/dist/plugins/raycast/index.js +2 -2
- package/dist/plugins/react-cosmos/index.js +2 -2
- package/dist/plugins/react-native/index.js +1 -1
- package/dist/plugins/react-router/index.js +6 -6
- package/dist/plugins/relay/index.js +3 -3
- package/dist/plugins/release-it/index.js +2 -5
- package/dist/plugins/remark/helpers.js +2 -2
- package/dist/plugins/retry-cli/index.js +0 -1
- package/dist/plugins/rolldown/index.js +2 -2
- package/dist/plugins/rollup/index.js +2 -2
- package/dist/plugins/rsbuild/index.js +3 -3
- package/dist/plugins/rslib/index.js +2 -2
- package/dist/plugins/rslint/index.d.ts +3 -0
- package/dist/plugins/rslint/index.js +16 -0
- package/dist/plugins/rspack/index.js +4 -0
- package/dist/plugins/rstest/index.js +4 -4
- package/dist/plugins/semantic-release/index.js +2 -2
- package/dist/plugins/serverless-framework/index.js +4 -4
- package/dist/plugins/solidjs-vite-plugin/resolveFromAST.js +3 -3
- package/dist/plugins/sst/resolveFromAST.js +2 -2
- package/dist/plugins/starlight/resolveFromAST.js +3 -3
- package/dist/plugins/stencil/resolveFromAST.js +5 -5
- package/dist/plugins/storybook/index.js +2 -2
- package/dist/plugins/stryker/index.js +2 -2
- package/dist/plugins/stylelint/index.js +4 -4
- package/dist/plugins/sveltekit/resolveFromAST.js +7 -5
- package/dist/plugins/swc/index.js +8 -5
- package/dist/plugins/tailwind/index.js +3 -2
- package/dist/plugins/tanstack-router/index.js +5 -2
- package/dist/plugins/textlint/helpers.js +2 -2
- package/dist/plugins/ts-node/index.js +23 -6
- package/dist/plugins/tsd/index.js +1 -1
- package/dist/plugins/tsdown/index.js +4 -4
- package/dist/plugins/tsup/index.js +3 -3
- package/dist/plugins/tsx/index.js +4 -3
- package/dist/plugins/turbo/index.js +2 -2
- package/dist/plugins/typedoc/index.js +4 -3
- package/dist/plugins/typescript/index.js +4 -4
- package/dist/plugins/varlock/scan.js +6 -3
- package/dist/plugins/vite/helpers.js +2 -2
- package/dist/plugins/vite-plugin-pages/index.js +2 -2
- package/dist/plugins/vite-plugin-pwa/resolveFromAST.js +2 -2
- package/dist/plugins/vite-plugin-vue-layouts-next/index.js +2 -2
- package/dist/plugins/vitest/index.js +14 -18
- package/dist/plugins/webdriver-io/index.js +13 -1
- package/dist/plugins/webpack/index.js +7 -12
- package/dist/plugins/wrangler/index.js +3 -3
- package/dist/plugins/wxt/index.js +2 -2
- package/dist/plugins/yarn/index.js +5 -5
- package/dist/session/incremental.d.ts +1 -1
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +6 -0
- package/dist/types/args.d.ts +4 -3
- package/dist/types/config.d.ts +2 -0
- package/dist/types/module-graph.d.ts +1 -1
- package/dist/types/package-json.d.ts +1 -0
- package/dist/types/workspace.d.ts +10 -8
- package/dist/typescript/ast-nodes.js +4 -5
- package/dist/typescript/get-imports-and-exports.js +5 -2
- package/dist/typescript/visitors/exports.js +6 -32
- package/dist/typescript/visitors/imports.d.ts +1 -1
- package/dist/typescript/visitors/imports.js +15 -24
- package/dist/typescript/visitors/walk.d.ts +5 -0
- package/dist/typescript/visitors/walk.js +75 -30
- package/dist/util/codeowners.js +4 -1
- package/dist/util/input.d.ts +3 -6
- package/dist/util/input.js +6 -20
- package/dist/util/parse-and-convert-gitignores.js +5 -4
- package/dist/util/parse-args.d.ts +2 -1
- package/dist/util/parse-args.js +13 -3
- package/dist/util/plugin.js +6 -4
- package/dist/util/watch.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +36 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'aws-cdk' | 'babel' | 'biome' | 'borp' | 'buf' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-forge' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'evalite' | 'eve' | 'execa' | 'expo' | 'expo-router' | 'expressive-code' | 'fast' | 'filesystem-routing' | 'flue' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jasmine' | 'jest' | 'karma' | 'knex' | 'kysely-codegen' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lingui' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mastra' | 'mcp' | 'mdx' | 'mdxlint' | 'metro' | 'mikro-orm' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'osls' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'purgecss' | 'quasar' | 'qwik' | 'railway' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'retry-cli' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'solidjs-vite-plugin' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsrs' | 'tsup' | 'tsx' | 'turbo' | 'typedoc' | 'typescript' | 'typescript-content-mapper' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'web-test-runner' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
|
|
2
|
-
export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'aws-cdk', 'babel', 'biome', 'borp', 'buf', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-forge', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'evalite', 'eve', 'execa', 'expo', 'expo-router', 'expressive-code', 'fast', 'filesystem-routing', 'flue', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jasmine', 'jest', 'karma', 'knex', 'kysely-codegen', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lingui', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mastra', 'mcp', 'mdx', 'mdxlint', 'metro', 'mikro-orm', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'osls', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'purgecss', 'quasar', 'qwik', 'railway', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'retry-cli', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'solidjs-vite-plugin', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsrs', 'tsup', 'tsx', 'turbo', 'typedoc', 'typescript', 'typescript-content-mapper', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'web-test-runner', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'aws-cdk' | 'babel' | 'biome' | 'borp' | 'buf' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-builder' | 'electron-forge' | 'electron-vite' | 'eleventy' | 'ember' | 'ember-template-lint' | 'env-cmd' | 'esbuild' | 'eslint' | 'evalite' | 'eve' | 'execa' | 'expo' | 'expo-router' | 'expressive-code' | 'fast' | 'filesystem-routing' | 'flue' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jasmine' | 'jest' | 'karma' | 'knex' | 'kysely-codegen' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lingui' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'maestro' | 'markdownlint' | 'marko' | 'mastra' | 'mcp' | 'mdx' | 'mdxlint' | 'metro' | 'mikro-orm' | 'mise' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'osls' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'purgecss' | 'quasar' | 'qwik' | 'railway' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'retry-cli' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rslint' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'solidjs-vite-plugin' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsrs' | 'tsup' | 'tsx' | 'turbo' | 'typedoc' | 'typescript' | 'typescript-content-mapper' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'web-test-runner' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
|
|
2
|
+
export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'aws-cdk', 'babel', 'biome', 'borp', 'buf', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-builder', 'electron-forge', 'electron-vite', 'eleventy', 'ember', 'ember-template-lint', 'env-cmd', 'esbuild', 'eslint', 'evalite', 'eve', 'execa', 'expo', 'expo-router', 'expressive-code', 'fast', 'filesystem-routing', 'flue', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jasmine', 'jest', 'karma', 'knex', 'kysely-codegen', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lingui', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'maestro', 'markdownlint', 'marko', 'mastra', 'mcp', 'mdx', 'mdxlint', 'metro', 'mikro-orm', 'mise', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'osls', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'purgecss', 'quasar', 'qwik', 'railway', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'retry-cli', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rslint', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'solidjs-vite-plugin', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsrs', 'tsup', 'tsx', 'turbo', 'typedoc', 'typescript', 'typescript-content-mapper', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'web-test-runner', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
@@ -30,9 +30,13 @@ export const pluginNames = [
|
|
|
30
30
|
'docusaurus',
|
|
31
31
|
'dotenv',
|
|
32
32
|
'drizzle',
|
|
33
|
+
'electron-builder',
|
|
33
34
|
'electron-forge',
|
|
34
35
|
'electron-vite',
|
|
35
36
|
'eleventy',
|
|
37
|
+
'ember',
|
|
38
|
+
'ember-template-lint',
|
|
39
|
+
'env-cmd',
|
|
36
40
|
'esbuild',
|
|
37
41
|
'eslint',
|
|
38
42
|
'evalite',
|
|
@@ -68,6 +72,7 @@ export const pluginNames = [
|
|
|
68
72
|
'lockfile-lint',
|
|
69
73
|
'lost-pixel',
|
|
70
74
|
'lunaria',
|
|
75
|
+
'maestro',
|
|
71
76
|
'markdownlint',
|
|
72
77
|
'marko',
|
|
73
78
|
'mastra',
|
|
@@ -136,6 +141,7 @@ export const pluginNames = [
|
|
|
136
141
|
'rollup',
|
|
137
142
|
'rsbuild',
|
|
138
143
|
'rslib',
|
|
144
|
+
'rslint',
|
|
139
145
|
'rspack',
|
|
140
146
|
'rstest',
|
|
141
147
|
'sanity',
|
package/dist/types/args.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import type { Manifest } from '../util/package-json.ts';
|
|
|
4
4
|
export type ConfigArg = boolean | (string | [string, (id: string) => string])[];
|
|
5
5
|
export type Args = {
|
|
6
6
|
binaries?: string[];
|
|
7
|
-
positional?: boolean;
|
|
7
|
+
positional?: boolean | ((parsed: ParsedArgs) => string[]);
|
|
8
8
|
string?: string[];
|
|
9
|
-
boolean?: string[];
|
|
9
|
+
boolean?: string[] | true;
|
|
10
|
+
stopEarly?: boolean;
|
|
10
11
|
alias?: Record<string, string[]>;
|
|
11
12
|
resolve?: string[];
|
|
12
13
|
nodeImportArgs?: boolean;
|
|
@@ -14,7 +15,7 @@ export type Args = {
|
|
|
14
15
|
args?: (args: string[]) => string[];
|
|
15
16
|
fromArgs?: string[] | ((parsed: ParsedArgs, args: string[], options: {
|
|
16
17
|
cwd: string;
|
|
17
|
-
}) => string[]);
|
|
18
|
+
}) => string[] | string);
|
|
18
19
|
resolveInputs?: (parsed: ParsedArgs, options: {
|
|
19
20
|
cwd: string;
|
|
20
21
|
args: string[];
|
package/dist/types/config.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export interface PluginOptions extends BaseOptions {
|
|
|
116
116
|
}
|
|
117
117
|
type PluginSetup = () => Promise<void> | void;
|
|
118
118
|
export type IsLoadConfig = (options: PluginOptions, dependencies: Set<string>) => boolean;
|
|
119
|
+
export type ParseConfig = (source: string) => unknown | Promise<unknown>;
|
|
119
120
|
export type ResolveConfig<T = any> = (config: T, options: PluginOptions) => Promise<Input[]> | Input[];
|
|
120
121
|
export type Resolve = (options: PluginOptions) => Promise<Input[]> | Input[];
|
|
121
122
|
export type SourceMap = {
|
|
@@ -183,6 +184,7 @@ export interface Plugin {
|
|
|
183
184
|
setup?: PluginSetup;
|
|
184
185
|
isLoadConfig?: IsLoadConfig;
|
|
185
186
|
isLoadConfigOptional?: boolean;
|
|
187
|
+
parseConfig?: ParseConfig;
|
|
186
188
|
resolveConfig?: ResolveConfig;
|
|
187
189
|
resolve?: Resolve;
|
|
188
190
|
resolveSourceMap?: ResolveSourceMap;
|
|
@@ -70,7 +70,7 @@ export type FileNode = {
|
|
|
70
70
|
readonly programFiles: Set<FilePath>;
|
|
71
71
|
readonly entryFiles: Set<FilePath>;
|
|
72
72
|
readonly imports: Imports;
|
|
73
|
-
readonly subpathImports:
|
|
73
|
+
readonly subpathImports: Map<string, string | undefined> | undefined;
|
|
74
74
|
};
|
|
75
75
|
exports: ExportMap;
|
|
76
76
|
duplicates: Iterable<Array<IssueSymbol>>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export type DependencySet = Set<string>;
|
|
2
2
|
export type DependencyArray = Array<string>;
|
|
3
|
-
type
|
|
3
|
+
export type WorkspaceIgnores = {
|
|
4
|
+
ignoreDependencies: (string | RegExp)[];
|
|
5
|
+
ignoreBinaries: (string | RegExp)[];
|
|
6
|
+
ignoreUnresolved: (string | RegExp)[];
|
|
7
|
+
unusedIgnoreDependencies: Set<string | RegExp>;
|
|
8
|
+
unusedIgnoreBinaries: Set<string | RegExp>;
|
|
9
|
+
unusedIgnoreUnresolved: Set<string | RegExp>;
|
|
10
|
+
ignoreConfigKeys: Record<'ignoreDependencies' | 'ignoreBinaries' | 'ignoreUnresolved', Map<string | RegExp, string | undefined>>;
|
|
11
|
+
};
|
|
12
|
+
type WorkspaceManifest = WorkspaceIgnores & {
|
|
4
13
|
workspaceDir: string;
|
|
5
14
|
manifestPath: string;
|
|
6
15
|
manifestStr: string;
|
|
@@ -13,13 +22,6 @@ type WorkspaceManifest = {
|
|
|
13
22
|
allDependencies: DependencySet;
|
|
14
23
|
engines: Record<string, string>;
|
|
15
24
|
isPrivate: boolean;
|
|
16
|
-
ignoreDependencies: (string | RegExp)[];
|
|
17
|
-
ignoreBinaries: (string | RegExp)[];
|
|
18
|
-
ignoreUnresolved: (string | RegExp)[];
|
|
19
|
-
unusedIgnoreDependencies: Set<string | RegExp>;
|
|
20
|
-
unusedIgnoreBinaries: Set<string | RegExp>;
|
|
21
|
-
unusedIgnoreUnresolved: Set<string | RegExp>;
|
|
22
|
-
ignoreConfigKeys: Record<'ignoreDependencies' | 'ignoreBinaries' | 'ignoreUnresolved', Map<string | RegExp, string | undefined>>;
|
|
23
25
|
};
|
|
24
26
|
export type WorkspaceManifests = Map<string, WorkspaceManifest>;
|
|
25
27
|
export type HostDependencies = Map<string, Array<{
|
|
@@ -79,11 +79,10 @@ export const getSafeScriptFromArgs = (executable, argsArray) => {
|
|
|
79
79
|
const parts = [value];
|
|
80
80
|
if (argsArray?.type === 'ArrayExpression') {
|
|
81
81
|
for (const element of argsArray.elements) {
|
|
82
|
-
if (element
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
82
|
+
if (element?.type === 'SpreadElement')
|
|
83
|
+
continue;
|
|
84
|
+
const arg = getStringValue(element);
|
|
85
|
+
parts.push(arg && SAFE_SCRIPT_ARG.test(arg) ? arg : SCRIPT_INTERPOLATION);
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
return parts.join(' ');
|
|
@@ -120,8 +120,11 @@ const getImportsAndExports = (filePath, sourceText, resolveModule, options, igno
|
|
|
120
120
|
}
|
|
121
121
|
const module = preResolvedModule ?? resolveModule(specifier, filePath);
|
|
122
122
|
const subpathImport = getSubpathImport(specifier);
|
|
123
|
-
if (subpathImport)
|
|
124
|
-
|
|
123
|
+
if (subpathImport) {
|
|
124
|
+
subpathImports ??= new Map();
|
|
125
|
+
if (!subpathImports.get(subpathImport))
|
|
126
|
+
subpathImports.set(subpathImport, module?.resolvedFileName);
|
|
127
|
+
}
|
|
125
128
|
if (modifiers & IMPORT_FLAGS.AUGMENT &&
|
|
126
129
|
(!module || module.isExternalLibraryImport || isInNodeModules(module.resolvedFileName))) {
|
|
127
130
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ALIAS_TAG, FIX_FLAGS, IMPORT_FLAGS, IMPORT_STAR, SYMBOL_TYPE } from '../../constants.js';
|
|
2
2
|
import { addNsValue, addValue } from '../../util/module-graph.js';
|
|
3
|
-
import { extractEnumMembers, extractNamespaceMembers,
|
|
3
|
+
import { extractEnumMembers, extractNamespaceMembers, getStringValue, isStringLiteral } from '../ast-nodes.js';
|
|
4
4
|
import { EMPTY_TAGS } from './jsdoc.js';
|
|
5
5
|
const getName = (n) => (n?.type === 'Identifier' ? n.name : undefined);
|
|
6
6
|
const addLocalToExport = (s, local, exported) => {
|
|
@@ -138,21 +138,8 @@ export function handleExportNamed(node, s) {
|
|
|
138
138
|
else if (declarator.init) {
|
|
139
139
|
s.collectRefsInType(declarator.init, name, hasExplicitFunctionReturnType(declarator.init));
|
|
140
140
|
}
|
|
141
|
-
if (!jsDocTags.has(ALIAS_TAG) && declarator.init?.type === 'Identifier') {
|
|
142
|
-
|
|
143
|
-
const existingExport = s.exports.get(initName);
|
|
144
|
-
if (existingExport && !existingExport.isReExport) {
|
|
145
|
-
if (!s.aliasedExports.has(initName)) {
|
|
146
|
-
s.aliasedExports.set(initName, [
|
|
147
|
-
{ symbol: initName, pos: existingExport.pos, line: existingExport.line, col: existingExport.col },
|
|
148
|
-
]);
|
|
149
|
-
}
|
|
150
|
-
const aliased = s.aliasedExports.get(initName);
|
|
151
|
-
if (aliased) {
|
|
152
|
-
const { line: l, col: c } = getLineAndCol(s.lineStarts, declarator.id.start);
|
|
153
|
-
aliased.push({ symbol: name, pos: declarator.id.start, line: l, col: c });
|
|
154
|
-
}
|
|
155
|
-
}
|
|
141
|
+
if (!jsDocTags.has(ALIAS_TAG) && !isReExport && declarator.init?.type === 'Identifier') {
|
|
142
|
+
s.exportAliases.push({ local: declarator.init.name, symbol: name, pos: declarator.id.start });
|
|
156
143
|
}
|
|
157
144
|
}
|
|
158
145
|
}
|
|
@@ -281,21 +268,8 @@ export function handleExportDefault(node, s) {
|
|
|
281
268
|
}
|
|
282
269
|
}
|
|
283
270
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const existingExport = s.exports.get(decl.name);
|
|
287
|
-
if (existingExport) {
|
|
288
|
-
if (!s.aliasedExports.has(decl.name)) {
|
|
289
|
-
s.aliasedExports.set(decl.name, [
|
|
290
|
-
{ symbol: decl.name, pos: existingExport.pos, line: existingExport.line, col: existingExport.col },
|
|
291
|
-
]);
|
|
292
|
-
}
|
|
293
|
-
const aliased = s.aliasedExports.get(decl.name);
|
|
294
|
-
if (aliased) {
|
|
295
|
-
const { line: defLine, col: defCol } = getLineAndCol(s.lineStarts, decl.start);
|
|
296
|
-
aliased.push({ symbol: 'default', pos: decl.start, line: defLine, col: defCol });
|
|
297
|
-
}
|
|
298
|
-
}
|
|
271
|
+
if (!_import && !s.getJSDocTags(node.start).has(ALIAS_TAG)) {
|
|
272
|
+
s.exportAliases.push({ local: decl.name, symbol: 'default', pos: decl.start });
|
|
299
273
|
}
|
|
300
274
|
}
|
|
301
275
|
s.addExport('default', type, pos, members, fix, false, s.getJSDocTags(node.start), binding);
|
|
@@ -390,7 +364,7 @@ export function handleExpressionStatement(node, s) {
|
|
|
390
364
|
if (allShorthand) {
|
|
391
365
|
for (const prop of props) {
|
|
392
366
|
if (prop.type === 'Property' && prop.key.type === 'Identifier') {
|
|
393
|
-
const fix = s.options.isFixExports ? [prop.start, prop.end, FIX_FLAGS.
|
|
367
|
+
const fix = s.options.isFixExports ? [prop.start, prop.end, FIX_FLAGS.OBJECT_BINDING] : undefined;
|
|
394
368
|
s.addExport(prop.key.name, SYMBOL_TYPE.UNKNOWN, prop.key.start, [], fix, false, EMPTY_TAGS);
|
|
395
369
|
}
|
|
396
370
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ArrayExpression, CallExpression, Expression, ImportExpression, VariableDeclarator } from 'oxc-parser';
|
|
2
2
|
import type { WalkState } from './walk.ts';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function markNamespaceRef(name: string, pos: number, s: WalkState, isStaticIncluded?: boolean): void;
|
|
4
4
|
export declare function getPromiseAllElements(expression: Expression): ArrayExpression['elements'] | undefined;
|
|
5
5
|
export declare function handleVariableDeclarator(node: VariableDeclarator, isVar: boolean, s: WalkState): void;
|
|
6
6
|
export declare function handleImportThen(node: CallExpression, s: WalkState): void;
|
|
@@ -3,15 +3,19 @@ import { addValue } from '../../util/module-graph.js';
|
|
|
3
3
|
import { isInNodeModules } from '../../util/path.js';
|
|
4
4
|
import { getStringValue, isStringLiteral } from '../ast-nodes.js';
|
|
5
5
|
import { isShadowedIn } from './shadow.js';
|
|
6
|
-
export function
|
|
6
|
+
export function markNamespaceRef(name, pos, s, isStaticIncluded = false) {
|
|
7
7
|
const _import = s.localImportMap.get(name);
|
|
8
|
-
if (!_import?.
|
|
8
|
+
if (!_import?.isNamespace || !(_import.isDynamicImport || isStaticIncluded))
|
|
9
9
|
return;
|
|
10
10
|
if (isShadowedIn(s, name, pos))
|
|
11
11
|
return;
|
|
12
12
|
const internalImport = s.internal.get(_import.filePath);
|
|
13
|
-
if (internalImport)
|
|
13
|
+
if (!internalImport)
|
|
14
|
+
return;
|
|
15
|
+
if (_import.isDynamicImport)
|
|
14
16
|
addValue(internalImport.import, OPAQUE, s.filePath);
|
|
17
|
+
else
|
|
18
|
+
internalImport.refs.add(name);
|
|
15
19
|
}
|
|
16
20
|
const getBlockScope = (s) => {
|
|
17
21
|
const i = s.scopeDepth - 1;
|
|
@@ -90,30 +94,13 @@ export function handleVariableDeclarator(node, isVar, s) {
|
|
|
90
94
|
break;
|
|
91
95
|
const binding = bindings[i];
|
|
92
96
|
if (imp?.type === 'ImportExpression' && isStringLiteral(imp.source)) {
|
|
93
|
-
s.handledImportExpressions.add(imp.start);
|
|
94
|
-
const specifier = getStringValue(imp.source);
|
|
95
97
|
const caughtFlag = s.caughtTryBlockEnds.length > 0 ? IMPORT_FLAGS.CAUGHT : IMPORT_FLAGS.NONE;
|
|
96
|
-
if (binding?.type === 'ObjectPattern') {
|
|
97
|
-
|
|
98
|
-
if (prop.type === 'Property') {
|
|
99
|
-
const importedName = prop.key?.type === 'Identifier'
|
|
100
|
-
? prop.key.name
|
|
101
|
-
: prop.key?.type === 'Literal' && typeof prop.key.value === 'string'
|
|
102
|
-
? prop.key.value
|
|
103
|
-
: undefined;
|
|
104
|
-
s.addImport(specifier, importedName, undefined, undefined, prop.key?.start ?? prop.start, caughtFlag);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else if (binding?.type === 'Identifier') {
|
|
109
|
-
s.addImport(specifier, 'default', binding.name, undefined, imp.source.start, IMPORT_FLAGS.DYNAMIC | caughtFlag);
|
|
110
|
-
const resolved = s.resolveModule(specifier, s.filePath);
|
|
111
|
-
if (resolved && !resolved.isExternalLibraryImport && !isInNodeModules(resolved.resolvedFileName)) {
|
|
112
|
-
setDynamicNamespace(binding.name, resolved.resolvedFileName, getBlockScope(s), isVar, s);
|
|
113
|
-
}
|
|
98
|
+
if (binding?.type === 'ObjectPattern' || binding?.type === 'Identifier') {
|
|
99
|
+
handleDynamicImportBinding(binding, imp, true, caughtFlag, getBlockScope(s), isVar, s);
|
|
114
100
|
}
|
|
115
101
|
else {
|
|
116
|
-
s.
|
|
102
|
+
s.handledImportExpressions.add(imp.start);
|
|
103
|
+
s.addImport(getStringValue(imp.source), undefined, undefined, undefined, imp.source.start, IMPORT_FLAGS.DYNAMIC | IMPORT_FLAGS.SIDE_EFFECTS | caughtFlag);
|
|
117
104
|
}
|
|
118
105
|
}
|
|
119
106
|
}
|
|
@@ -268,6 +255,10 @@ function handleDynamicImportBinding(id, importExpr, isAwaited, caughtFlag, scope
|
|
|
268
255
|
}
|
|
269
256
|
else if (prop.type === 'RestElement' && prop.argument?.type === 'Identifier') {
|
|
270
257
|
s.addImport(specifier, IMPORT_STAR, prop.argument.name, undefined, prop.start, IMPORT_FLAGS.DYNAMIC | caughtFlag);
|
|
258
|
+
const resolved = s.resolveModule(specifier, s.filePath);
|
|
259
|
+
if (resolved && !resolved.isExternalLibraryImport && !isInNodeModules(resolved.resolvedFileName)) {
|
|
260
|
+
setDynamicNamespace(prop.argument.name, resolved.resolvedFileName, scope, isVar, s);
|
|
261
|
+
}
|
|
271
262
|
}
|
|
272
263
|
}
|
|
273
264
|
}
|
|
@@ -78,6 +78,11 @@ export interface WalkState extends WalkContext {
|
|
|
78
78
|
prev: LocalImport | undefined;
|
|
79
79
|
}[];
|
|
80
80
|
localDeclarations: Map<string, FunctionNode | Class | VariableDeclarator>;
|
|
81
|
+
exportAliases: {
|
|
82
|
+
local: string;
|
|
83
|
+
symbol: string;
|
|
84
|
+
pos: number;
|
|
85
|
+
}[];
|
|
81
86
|
localInterfaces: Map<string, TSInterfaceDeclaration | null>;
|
|
82
87
|
pendingCallRefs: Array<{
|
|
83
88
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Visitor, visitorKeys, } from 'oxc-parser';
|
|
2
|
-
import { FIX_FLAGS, IMPORT_FLAGS, OPAQUE, SYMBOL_TYPE } from '../../constants.js';
|
|
2
|
+
import { ALIAS_TAG, FIX_FLAGS, IMPORT_FLAGS, OPAQUE, SYMBOL_TYPE } from '../../constants.js';
|
|
3
3
|
import { addValue } from '../../util/module-graph.js';
|
|
4
4
|
import { isInNodeModules } from '../../util/path.js';
|
|
5
5
|
import { timerify } from '../../util/Performance.js';
|
|
@@ -7,7 +7,7 @@ import { collectAugmentationRefs, getLineAndCol, getStringValue, isStringLiteral
|
|
|
7
7
|
import { EMPTY_TAGS } from './jsdoc.js';
|
|
8
8
|
import { handleCallExpression, handleNewExpression, trackCustomElementRegistry } from './calls.js';
|
|
9
9
|
import { handleExportAssignment, handleExportDefault, handleExportNamed, handleExpressionStatement, } from './exports.js';
|
|
10
|
-
import { getPromiseAllElements, handleImportExpression, handleImportThen, handleVariableDeclarator,
|
|
10
|
+
import { getPromiseAllElements, handleImportExpression, handleImportThen, handleVariableDeclarator, markNamespaceRef, } from './imports.js';
|
|
11
11
|
import { handleJSXMemberExpression, handleMemberExpression } from './members.js';
|
|
12
12
|
import { isShadowedIn } from './shadow.js';
|
|
13
13
|
let state;
|
|
@@ -207,6 +207,27 @@ const _addLocalRef = (name, pos) => {
|
|
|
207
207
|
else
|
|
208
208
|
state.localRefs.add(name);
|
|
209
209
|
};
|
|
210
|
+
const _splitQualifiedName = (node) => {
|
|
211
|
+
const members = [];
|
|
212
|
+
let root = node;
|
|
213
|
+
while (root.type === 'TSQualifiedName') {
|
|
214
|
+
if (root.right.type === 'Identifier')
|
|
215
|
+
members.unshift(root.right.name);
|
|
216
|
+
root = root.left;
|
|
217
|
+
}
|
|
218
|
+
return { root, members };
|
|
219
|
+
};
|
|
220
|
+
const _addQualifiedRefs = (internalImport, rootName, members) => {
|
|
221
|
+
if (members.length === 0) {
|
|
222
|
+
internalImport.refs.add(rootName);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
let path = '';
|
|
226
|
+
for (const member of members) {
|
|
227
|
+
path = path ? `${path}.${member}` : member;
|
|
228
|
+
state.addNsMemberRefs(internalImport, rootName, path);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
210
231
|
const _addShadowRange = (name, range) => {
|
|
211
232
|
const ranges = state.shadowScopes.get(name);
|
|
212
233
|
if (ranges)
|
|
@@ -407,6 +428,13 @@ const coreVisitorObject = {
|
|
|
407
428
|
},
|
|
408
429
|
ExportDefaultDeclaration(node) {
|
|
409
430
|
handleExportDefault(node, state);
|
|
431
|
+
if (node.declaration.type === 'ObjectExpression') {
|
|
432
|
+
for (const prop of node.declaration.properties) {
|
|
433
|
+
const value = prop.type === 'Property' ? prop.value : prop.argument;
|
|
434
|
+
if (value.type === 'Identifier')
|
|
435
|
+
markNamespaceRef(value.name, value.start, state, true);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
410
438
|
},
|
|
411
439
|
TSExportAssignment(node) {
|
|
412
440
|
handleExportAssignment(node, state);
|
|
@@ -496,46 +524,30 @@ const coreVisitorObject = {
|
|
|
496
524
|
},
|
|
497
525
|
ReturnStatement(node) {
|
|
498
526
|
if (node.argument?.type === 'Identifier')
|
|
499
|
-
|
|
527
|
+
markNamespaceRef(node.argument.name, node.argument.start, state, true);
|
|
500
528
|
},
|
|
501
529
|
AssignmentExpression(node) {
|
|
502
530
|
if (node.right?.type === 'Identifier')
|
|
503
|
-
|
|
531
|
+
markNamespaceRef(node.right.name, node.right.start, state);
|
|
504
532
|
},
|
|
505
533
|
SpreadElement(node) {
|
|
506
534
|
if (node.argument?.type === 'Identifier')
|
|
507
|
-
|
|
535
|
+
markNamespaceRef(node.argument.name, node.argument.start, state);
|
|
508
536
|
},
|
|
509
537
|
TSQualifiedName(node) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
if (left.right.type === 'Identifier')
|
|
514
|
-
parts.unshift(left.right.name);
|
|
515
|
-
left = left.left;
|
|
516
|
-
}
|
|
517
|
-
if (left.type === 'Identifier' && !isShadowed(left.name, left.start)) {
|
|
518
|
-
const rootName = left.name;
|
|
538
|
+
const { root, members } = _splitQualifiedName(node);
|
|
539
|
+
if (root.type === 'Identifier' && !isShadowed(root.name, root.start)) {
|
|
540
|
+
const rootName = root.name;
|
|
519
541
|
const _import = state.localImportMap.get(rootName);
|
|
520
542
|
if (_import) {
|
|
521
543
|
const internalImport = state.internal.get(_import.filePath);
|
|
522
|
-
if (internalImport)
|
|
523
|
-
|
|
524
|
-
let path = '';
|
|
525
|
-
for (const part of parts) {
|
|
526
|
-
path = path ? `${path}.${part}` : part;
|
|
527
|
-
state.addNsMemberRefs(internalImport, rootName, path);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
else {
|
|
531
|
-
internalImport.refs.add(rootName);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
544
|
+
if (internalImport)
|
|
545
|
+
_addQualifiedRefs(internalImport, rootName, members);
|
|
534
546
|
}
|
|
535
|
-
else if (
|
|
547
|
+
else if (members.length > 0) {
|
|
536
548
|
let path = '';
|
|
537
|
-
for (const
|
|
538
|
-
path = path ? `${path}.${
|
|
549
|
+
for (const member of members) {
|
|
550
|
+
path = path ? `${path}.${member}` : member;
|
|
539
551
|
state.memberRefsInFile.push(rootName, path);
|
|
540
552
|
}
|
|
541
553
|
}
|
|
@@ -571,7 +583,15 @@ const coreVisitorObject = {
|
|
|
571
583
|
const src = node.source;
|
|
572
584
|
if (isStringLiteral(src)) {
|
|
573
585
|
const specifier = getStringValue(src);
|
|
574
|
-
|
|
586
|
+
const qualifier = node.qualifier ? _splitQualifiedName(node.qualifier) : undefined;
|
|
587
|
+
const rootName = qualifier?.root.type === 'Identifier' ? qualifier.root.name : undefined;
|
|
588
|
+
state.addImport(specifier, rootName, undefined, undefined, src.start, IMPORT_FLAGS.TYPE_ONLY);
|
|
589
|
+
if (qualifier && rootName) {
|
|
590
|
+
const module = state.resolveModule(specifier, state.filePath);
|
|
591
|
+
const internalImport = module && state.internal.get(module.resolvedFileName);
|
|
592
|
+
if (internalImport)
|
|
593
|
+
_addQualifiedRefs(internalImport, rootName, qualifier.members);
|
|
594
|
+
}
|
|
575
595
|
}
|
|
576
596
|
},
|
|
577
597
|
TSImportEqualsDeclaration(node) {
|
|
@@ -902,6 +922,7 @@ function walkAST(program, sourceText, filePath, hasModuleSyntax, ctx) {
|
|
|
902
922
|
shadowScopes: new Map(),
|
|
903
923
|
scopedImports: [],
|
|
904
924
|
localDeclarations: new Map(),
|
|
925
|
+
exportAliases: [],
|
|
905
926
|
localInterfaces: new Map(),
|
|
906
927
|
pendingCallRefs: [],
|
|
907
928
|
pendingMemberCallRefs: [],
|
|
@@ -919,6 +940,30 @@ function walkAST(program, sourceText, filePath, hasModuleSyntax, ctx) {
|
|
|
919
940
|
isInNamespace: _isInNamespace,
|
|
920
941
|
};
|
|
921
942
|
ctx.visitor.visit(program);
|
|
943
|
+
for (const { local, symbol, pos } of state.exportAliases) {
|
|
944
|
+
let name = local;
|
|
945
|
+
let original = state.exports.get(local);
|
|
946
|
+
if (!original) {
|
|
947
|
+
const defaultExport = state.exports.get('default');
|
|
948
|
+
if (defaultExport && (defaultExport.binding === local || state.localToExports.get(local)?.has('default'))) {
|
|
949
|
+
name = 'default';
|
|
950
|
+
original = defaultExport;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (!original || original.isReExport || original.jsDocTags.has(ALIAS_TAG) || name === symbol)
|
|
954
|
+
continue;
|
|
955
|
+
if (symbol === 'default' && state.specifierExportNames.has(local))
|
|
956
|
+
continue;
|
|
957
|
+
let group = state.aliasedExports.get(name);
|
|
958
|
+
if (!group) {
|
|
959
|
+
group = [{ symbol: name, pos: original.pos, line: original.line, col: original.col }];
|
|
960
|
+
state.aliasedExports.set(name, group);
|
|
961
|
+
}
|
|
962
|
+
const { line, col } = getLineAndCol(state.lineStarts, pos);
|
|
963
|
+
group.push({ symbol, pos, line, col });
|
|
964
|
+
}
|
|
965
|
+
for (const group of state.aliasedExports.values())
|
|
966
|
+
group.sort((a, b) => (a.pos ?? 0) - (b.pos ?? 0));
|
|
922
967
|
while (state.pendingCallRefs.length > 0 || state.pendingMemberCallRefs.length > 0) {
|
|
923
968
|
while (state.pendingCallRefs.length > 0) {
|
|
924
969
|
const { name, exportName, seen, kind } = state.pendingCallRefs.pop();
|
package/dist/util/codeowners.js
CHANGED
|
@@ -5,9 +5,12 @@ import { convertGitignoreToPicomatchIgnorePatterns, expandIgnorePatterns } from
|
|
|
5
5
|
export function parseCodeowners(content) {
|
|
6
6
|
const matchers = content
|
|
7
7
|
.split(/\r?\n/)
|
|
8
|
+
.map(line => line.trim())
|
|
8
9
|
.filter(line => line && !line.startsWith('#'))
|
|
9
10
|
.map(rule => {
|
|
10
|
-
const [path, ...
|
|
11
|
+
const [path, ...tokens] = rule.split(/\s+/);
|
|
12
|
+
const comment = tokens.findIndex(token => token.startsWith('#'));
|
|
13
|
+
const owners = comment === -1 ? tokens : tokens.slice(0, comment);
|
|
11
14
|
const { pattern } = convertGitignoreToPicomatchIgnorePatterns(path);
|
|
12
15
|
return { owners, match: picomatch(expandIgnorePatterns([pattern], true)) };
|
|
13
16
|
});
|
package/dist/util/input.d.ts
CHANGED
|
@@ -45,21 +45,18 @@ export declare const toBinary: (specifier: string, options?: Options) => Input;
|
|
|
45
45
|
export declare const isBinary: (input: Input) => boolean;
|
|
46
46
|
export declare const toCatalog: (specifier: string, catalogName: string) => CatalogInput;
|
|
47
47
|
export declare const isCatalog: (input: Input) => input is CatalogInput;
|
|
48
|
-
export declare const toEntry: (specifier: string) => Input;
|
|
48
|
+
export declare const toEntry: (specifier: string, options?: Options) => Input;
|
|
49
49
|
export declare const isEntry: (input: Input) => boolean;
|
|
50
50
|
export declare const toProject: (specifier: string) => Input;
|
|
51
51
|
export declare const isProject: (input: Input) => boolean;
|
|
52
|
-
export declare const toProductionEntry: (specifier: string, options?: Options) => Input;
|
|
53
52
|
export declare const isProductionEntry: (input: Input) => boolean;
|
|
54
53
|
export declare const toConfig: (pluginName: PluginName, specifier: string, options?: Options) => ConfigInput;
|
|
55
54
|
export declare const isConfig: (input: Input) => input is ConfigInput;
|
|
56
55
|
export declare const toDependency: (specifier: string, options?: Options) => Input;
|
|
57
56
|
export declare const isDependency: (input: Input) => boolean;
|
|
58
|
-
export declare const
|
|
59
|
-
export declare const toDeferResolve: (specifier: string, options?: Options) => Input;
|
|
57
|
+
export declare const toModule: (specifier: string, options?: Options) => Input;
|
|
60
58
|
export declare const isDeferResolve: (input: Input) => boolean;
|
|
61
|
-
export declare const
|
|
62
|
-
export declare const toDeferResolveEntry: (specifier: string, options?: Options) => Input;
|
|
59
|
+
export declare const toEntryPath: (specifier: string, options?: Options) => Input;
|
|
63
60
|
export declare const isDeferResolveEntry: (input: Input) => boolean;
|
|
64
61
|
export declare const toAlias: (specifier: string, prefix: string | string[], options?: Options) => AliasInput;
|
|
65
62
|
export declare const isAlias: (input: Input) => input is AliasInput;
|
package/dist/util/input.js
CHANGED
|
@@ -12,16 +12,14 @@ export const toCatalog = (specifier, catalogName) => ({
|
|
|
12
12
|
catalogName,
|
|
13
13
|
});
|
|
14
14
|
export const isCatalog = (input) => input.type === 'catalog';
|
|
15
|
-
export const toEntry = (specifier) => ({
|
|
16
|
-
export const isEntry = (input) => input.type === 'entry' && !input.production;
|
|
17
|
-
export const toProject = (specifier) => ({ type: 'project', specifier });
|
|
18
|
-
export const isProject = (input) => input.type === 'project';
|
|
19
|
-
export const toProductionEntry = (specifier, options = {}) => ({
|
|
15
|
+
export const toEntry = (specifier, options = {}) => ({
|
|
20
16
|
type: 'entry',
|
|
21
17
|
specifier,
|
|
22
|
-
production: true,
|
|
23
18
|
...options,
|
|
24
19
|
});
|
|
20
|
+
export const isEntry = (input) => input.type === 'entry' && !input.production;
|
|
21
|
+
export const toProject = (specifier) => ({ type: 'project', specifier });
|
|
22
|
+
export const isProject = (input) => input.type === 'project';
|
|
25
23
|
export const isProductionEntry = (input) => input.type === 'entry' && input.production === true;
|
|
26
24
|
export const toConfig = (pluginName, specifier, options = {}) => ({
|
|
27
25
|
type: 'config',
|
|
@@ -36,25 +34,13 @@ export const toDependency = (specifier, options = {}) => ({
|
|
|
36
34
|
...options,
|
|
37
35
|
});
|
|
38
36
|
export const isDependency = (input) => input.type === 'dependency';
|
|
39
|
-
export const
|
|
40
|
-
type: 'dependency',
|
|
41
|
-
specifier,
|
|
42
|
-
production: true,
|
|
43
|
-
...options,
|
|
44
|
-
});
|
|
45
|
-
export const toDeferResolve = (specifier, options = {}) => ({
|
|
37
|
+
export const toModule = (specifier, options = {}) => ({
|
|
46
38
|
type: 'deferResolve',
|
|
47
39
|
specifier,
|
|
48
40
|
...options,
|
|
49
41
|
});
|
|
50
42
|
export const isDeferResolve = (input) => input.type === 'deferResolve';
|
|
51
|
-
export const
|
|
52
|
-
type: 'deferResolveEntry',
|
|
53
|
-
specifier,
|
|
54
|
-
production: true,
|
|
55
|
-
...options,
|
|
56
|
-
});
|
|
57
|
-
export const toDeferResolveEntry = (specifier, options = {}) => ({
|
|
43
|
+
export const toEntryPath = (specifier, options = {}) => ({
|
|
58
44
|
type: 'deferResolveEntry',
|
|
59
45
|
specifier,
|
|
60
46
|
...options,
|
|
@@ -32,15 +32,16 @@ export const convertGitignoreToPicomatchIgnorePatterns = (pattern, isAnchored =
|
|
|
32
32
|
return { negated, pattern };
|
|
33
33
|
};
|
|
34
34
|
export const parseAndConvertGitignorePatterns = (patterns, ancestor, isAnchored = !ancestor) => {
|
|
35
|
-
const matchFrom = ancestor ? new RegExp(`^(!?/?)(${ancestor})`) : undefined;
|
|
36
35
|
return patterns
|
|
37
36
|
.split(/\r?\n/)
|
|
38
37
|
.filter(line => line.trim() && !line.startsWith('#'))
|
|
39
38
|
.flatMap(line => {
|
|
40
39
|
const pattern = line.replace(/^\\(?=#)/, '').trim();
|
|
41
|
-
if (ancestor
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
if (ancestor) {
|
|
41
|
+
const negation = pattern.startsWith('!') ? 1 : 0;
|
|
42
|
+
const offset = pattern[negation] === '/' ? negation + 1 : negation;
|
|
43
|
+
if (pattern.startsWith(ancestor, offset))
|
|
44
|
+
return [pattern.slice(0, offset) + pattern.slice(offset + ancestor.length)];
|
|
44
45
|
if (pattern.startsWith('/**/'))
|
|
45
46
|
return [pattern.slice(1)];
|
|
46
47
|
if (pattern.startsWith('!/**/'))
|