Conversation
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.
Rollup Plugin Name:
@rollup/plugin-virtualThis PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Fixes #2024
Description
With Node16 or NodeNext module resolution, an ESM consumer's documented default import is typed as a namespace and cannot be called:
Route the import condition to an ESM declaration that reuses the existing function type. Existing runtime entries, CJS declarations, top-level
types, and thedefaultfallback are preserved.The regression checks public package-name imports for ESM and CJS, plus a directory-entry fixture for legacy Node resolution. From
packages/virtual, runpnpm test:ts.Validation:
pnpm build,pnpm test(7 tests), andpnpm test:tspass.TypeScript 4.8.4 and 5.9.3 pass the Node16/NodeNext ESM and CJS checks and legacy resolution fixture.
Public package-name ESM and CJS runtime imports pass against the rebuilt package.
Root
pnpm lintpasses with 0 errors and 45 warnings in unchanged files in other packages; virtual has no warnings.Root
pnpm fix:jspasses with 0 errors and 39 warnings.Draft pending maintainer approval for GitHub Actions.