Repository navigation
test(exports): assert every exports subpath resolves to a source file that exists - #446
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
Contributor
Author
No device frameThis PR adds a test only, and what it checks is module resolution, which happens before anything renders. |
YevheniiKotyrlo
force-pushed
the
fix/exports-wildcard-source-targets
branch
from
October 11, 2026 12:35
79eb466 to
6fc4ee3
Compare
./components/* source targets for two non-tsx modulesThis branch has not been deployed
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
#451 corrected the two
./components/*source targets #445 reported, which is what this PR fixed when I opened it. The manifest change is gone. What stays is a guardmaindoes not have:src/__tests__/package/exports-source-targets.test.tswalks theexportsmap the way node does (an exact key first, then the pattern whose literal prefix before*is longest) and asserts everysourceandreact-nativetarget names a file on disk. Export conditions match on key presence rather than target existence, so a wrong target is a hardMODULE_NOT_FOUNDwith no fallthrough toimportorrequire.Two censuses drive it: every literal subpath, and every module in
src/components/reduced to the subpath a consumer would import. A case asserts both are non-empty, so a narrowed map cannot quietly produce zero cases.Tests
All 37 pass on
main. Onf70c402, before #451, it fails exactly./components/copyComponentPropertiesand./components/indexand passes the other 33.Verification
On Windows with Node 26:
yarn lintcleanyarn typecheckcleanyarn buildcleanyarn test --maxWorkers=2 --coverage: every failure also fails onmainon this machine (the four babel cases)node --test node/__tests__/*.mjs: the same 11 assertions fail onmainon this machineBase
Re-written on
main(a5002c5) as the test alone.