Skip to content

fix(core): improve nodenext type declarations#1559

Merged
Timeless0911 merged 3 commits intomainfrom
david/fix/core-nodenext-types
Apr 8, 2026
Merged

fix(core): improve nodenext type declarations#1559
Timeless0911 merged 3 commits intomainfrom
david/fix/core-nodenext-types

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

@Timeless0911 Timeless0911 commented Mar 25, 2026

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 under tests/type-tests.

Wire those fixtures into the @rslib/tests type-check flow so we can validate module-resolution-specific public type behavior in one place.

Related Links

Checklist

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

@Timeless0911 Timeless0911 force-pushed the david/fix/core-nodenext-types branch from 23d5ef2 to 8e7fbb2 Compare March 25, 2026 12:07
@Timeless0911 Timeless0911 force-pushed the david/fix/core-nodenext-types branch from 8e7fbb2 to 36a6d1d Compare April 7, 2026 09:59
@Timeless0911 Timeless0911 marked this pull request as ready for review April 7, 2026 10:37
Copilot AI review requested due to automatic review settings April 7, 2026 10:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-bundler and tests/type-tests/resolution-nodenext type-check fixtures with skipLibCheck: false.
  • Extend the @rslib/tests type-check script to also run the new type-test packages.
  • Update packages/core build config to enable redirect.dts.extension: true and remove the post-build dist-types/package.json writer 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.

Comment thread tests/package.json Outdated
Comment thread tests/package.json Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 8, 2026

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

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

View logs

@Timeless0911 Timeless0911 enabled auto-merge (squash) April 8, 2026 03:37
@Timeless0911 Timeless0911 merged commit b384707 into main Apr 8, 2026
10 checks passed
@Timeless0911 Timeless0911 deleted the david/fix/core-nodenext-types branch April 8, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants