Skip to content

refactor(dts): simplify bundled package resolution - #1978

Merged
Timeless0911 merged 1 commit into
mainfrom
david/refactor-dts-bundled-packages
Oct 29, 2026
Merged

Timeless0911 merged 1 commit into
mainfrom
david/refactor-dts-bundled-packages

Conversation

@Timeless0911

Copy link
Copy Markdown
Contributor

Motivation

Follow up to #1977. Bundled packages are resolved in the main process, but the result is stored in API Extractor options and the declaration worker still calls the resolver.

Changes

Extract the resolver into a dedicated module and pass its result through an internal bundledPackages field. Remove the redundant worker-side call and unused configuration fields while preserving explicit user overrides and the custom bundling tsconfig.

Add a separate lib configuration to verify that explicit bundledPackages takes precedence over RegExp externals, keeping the existing test configurations intact.

Validation

  • DTS plugin build and Publint passed.
  • pnpm lint passed, including type checking.
  • 31 DTS unit tests and 39 integration tests passed, covering declaration bundling and isolated declarations.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 11:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T11:20:42.983869Z b129a98 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

🟢 Approval recommended

There are no active review issues requiring changes to the bundled-package resolution refactor.

No open issues 🎉

What changed in this PR

This refactor follows up on #1977 by resolving bundled declaration packages once in the main process and passing the result directly to declaration generation.

Changes:

  • Extract package resolution into a dedicated module and remove the redundant worker-side call.
  • Replace unused internal options with bundledPackages, preserving explicit overrides and the custom bundling tsconfig.
  • Extend integration coverage for RegExp externals and explicit override precedence.
File Description
tests/​integration/​dts/​bundle/​index.test.ts Assert external declarations and explicit override precedence.
tests/​integration/​dts/​bundle/​bundled-packages/​rslib.config.ts Add a separate configuration testing override precedence.
packages/​plugin-dts/​tests/​external.test.ts Import resolver tests from the extracted module.
packages/​plugin-dts/​src/​types/​internal.ts Replace unused worker options with the resolved package list.
packages/​plugin-dts/​src/​index.ts Resolve bundled packages in the main process.
packages/​plugin-dts/​src/​dts.ts Consume the resolved list without recalculating it.
packages/​plugin-dts/​src/​bundledPackages.ts Hold the extracted package-resolution logic.

Review effort: Balanced

@Timeless0911
Timeless0911 merged commit 0301ac4 into main Oct 29, 2026
13 checks passed
@Timeless0911
Timeless0911 deleted the david/refactor-dts-bundled-packages branch October 29, 2026 03:41
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.

2 participants