Repository navigation
refactor(dts): simplify bundled package resolution - #1978
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
bundledPackagesfield. 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
bundledPackagestakes precedence over RegExp externals, keeping the existing test configurations intact.Validation
pnpm lintpassed, including type checking.