fix(core): improve nodenext type declarations#1559
Merged
Timeless0911 merged 3 commits intomainfrom Apr 8, 2026
Merged
Conversation
23d5ef2 to
8e7fbb2
Compare
8e7fbb2 to
36a6d1d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates @rslib/core’s type declaration output to rely on extension-based DTS redirects (instead of generating an extra dist-types/package.json), and adds module-resolution-specific type-test fixtures to validate public type behavior under Bundler and NodeNext resolution modes.
Changes:
- Add dedicated
tests/type-tests/resolution-bundlerandtests/type-tests/resolution-nodenexttype-check fixtures withskipLibCheck: false. - Extend the
@rslib/teststype-checkscript to also run the new type-test packages. - Update
packages/corebuild config to enableredirect.dts.extension: trueand remove the post-builddist-types/package.jsonwriter plugin.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/type-tests/resolution-nodenext/tsconfig.json | Adds NodeNext module/moduleResolution fixture config with full lib checking. |
| tests/type-tests/resolution-nodenext/package.json | Defines a private workspace package for NodeNext type-checking. |
| tests/type-tests/resolution-nodenext/index.ts | Exercises @rslib/core public imports under NodeNext resolution. |
| tests/type-tests/resolution-bundler/tsconfig.json | Adds Bundler moduleResolution fixture config with full lib checking. |
| tests/type-tests/resolution-bundler/package.json | Defines a private workspace package for Bundler type-checking. |
| tests/type-tests/resolution-bundler/index.ts | Exercises @rslib/core public imports under Bundler resolution. |
| tests/package.json | Runs the new @type-tests/* checks as part of @rslib/tests type-check. |
| packages/core/rslib.config.ts | Switches core DTS output to extension-based redirects and removes the custom dist-types package.json writer. |
Deploying rslib with
|
| Latest commit: |
c35f696
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e0585366.rslib.pages.dev |
| Branch Preview URL: | https://david-fix-core-nodenext-type.rslib.pages.dev |
fi3ework
approved these changes
Apr 8, 2026
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.
Summary
Switch the core declaration output to use extension-based dts redirects instead of writing an extra
dist-types/package.json, and add dedicated bundler / NodeNext type-test fixtures undertests/type-tests.Wire those fixtures into the
@rslib/teststype-check flow so we can validate module-resolution-specific public type behavior in one place.Related Links
Checklist