Skip to content

feat(plugin-dts): support custom tsconfig for DTS bundling - #1862

Merged
Timeless0911 merged 1 commit into
mainfrom
david/feat-dts-bundle-tsconfig
Aug 20, 2026
Merged

Timeless0911 merged 1 commit into
mainfrom
david/feat-dts-bundle-tsconfig

Conversation

@Timeless0911

Copy link
Copy Markdown
Contributor

Summary

  • Add dts.bundle.tsconfigPath so API Extractor can use a separate TypeScript config from declaration emit while defaulting to source.tsconfigPath.
  • Resolve custom paths from the project root and pass a normalized absolute path to declaration bundle invocations without affecting bundledPackages.
  • Add integration coverage and update the plugin, English, and Chinese documentation.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI lite review requested due to automatic review settings August 20, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for specifying a dedicated TypeScript config for the API Extractor bundling phase of DTS generation, while keeping the existing tsconfig for the declaration emit phase. This improves compatibility for projects that need different paths/module-resolution settings when analyzing the emitted .d.ts outputs.

Changes:

  • Introduces dts.bundle.tsconfigPath (and plugin counterpart bundle.tsconfigPath) and wires it through to API Extractor with project-root resolution and normalized absolute paths.
  • Refactors bundling flow to distinguish emit tsconfig vs bundle tsconfig, and improves the “missing declaration entry” error location (checked before invoking API Extractor).
  • Adds an integration fixture + assertions to validate separate tsconfig behavior, and updates English/Chinese docs.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/zh/config/lib/dts.mdx Documents dts.bundle.tsconfigPath and updates the dts.bundle type signature (ZH).
website/docs/en/config/lib/dts.mdx Documents dts.bundle.tsconfigPath and updates the dts.bundle type signature (EN).
packages/core/src/types/config.ts Adds typed config support + JSDoc for dts.bundle.tsconfigPath.
packages/plugin-dts/src/types/options.ts Extends bundle options type to include tsconfigPath.
packages/plugin-dts/src/types/internal.ts Adds bundleTsconfigPath to internal generation options.
packages/plugin-dts/src/index.ts Resolves bundle.tsconfigPath from project root and passes it through as bundleTsconfigPath.
packages/plugin-dts/src/dts.ts Uses separate emit/bundle tsconfig paths; moves missing-entry validation to pre-API-Extractor stage.
packages/plugin-dts/src/apiExtractor.ts Requires a tsconfig path and normalizes it before passing to API Extractor.
packages/plugin-dts/README.md Documents bundle.tsconfigPath and updates option type signature.
tests/integration/dts/bundle/index.test.ts Adds integration assertions for separate tsconfig usage during bundling.
tests/integration/dts/bundle/tsconfig-path/package.json Adds a new integration fixture package.
tests/integration/dts/bundle/tsconfig-path/rslib.config.ts Configures fixture to use dts.bundle.tsconfigPath for API Extractor.
tests/integration/dts/bundle/tsconfig-path/src/index.ts Fixture entry importing via a TS path alias.
tests/integration/dts/bundle/tsconfig-path/tsconfig.json Emit-phase tsconfig with paths pointing to source.
tests/integration/dts/bundle/tsconfig-path/tsconfig.bundle.json Bundle-phase tsconfig overriding paths to point to generated .d.ts.
tests/integration/dts/bundle/tsconfig-path/generated-dts/foo/index.d.ts Fixture “analysis-phase” declaration target used by API Extractor.
tests/integration/dts/bundle/tsconfig-path/workspace/foo/src/index.ts Fixture “emit-phase” source target for the alias.
pnpm-lock.yaml Registers the new integration fixture as a pnpm importer.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b0c97c
Status: ✅  Deploy successful!
Preview URL: https://ef10b19d.rslib.pages.dev
Branch Preview URL: https://david-feat-dts-bundle-tsconf.rslib.pages.dev

View logs

@Timeless0911
Timeless0911 merged commit 32baade into main Aug 20, 2026
13 checks passed
@Timeless0911
Timeless0911 deleted the david/feat-dts-bundle-tsconfig branch August 20, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Sponsor
SponsoredKunjungi sekarang
Promo