Skip to content

test(exports): assert every exports subpath resolves to a source file that exists - #446

Open
YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:fix/exports-wildcard-source-targets
Open

YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:fix/exports-wildcard-source-targets

Conversation

@YevheniiKotyrlo

@YevheniiKotyrlo YevheniiKotyrlo commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

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 guard main does not have: src/__tests__/package/exports-source-targets.test.ts walks the exports map the way node does (an exact key first, then the pattern whose literal prefix before * is longest) and asserts every source and react-native target names a file on disk. Export conditions match on key presence rather than target existence, so a wrong target is a hard MODULE_NOT_FOUND with no fallthrough to import or require.

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. On f70c402, before #451, it fails exactly ./components/copyComponentProperties and ./components/index and passes the other 33.

Verification

On Windows with Node 26:

  • yarn lint clean
  • yarn typecheck clean
  • yarn build clean
  • yarn test --maxWorkers=2 --coverage: every failure also fails on main on this machine (the four babel cases)
  • node --test node/__tests__/*.mjs: the same 11 assertions fail on main on this machine

Base

Re-written on main (a5002c5) as the test alone.

@YevheniiKotyrlo

YevheniiKotyrlo commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

No device frame

This PR adds a test only, and what it checks is module resolution, which happens before anything renders.

@YevheniiKotyrlo
YevheniiKotyrlo force-pushed the fix/exports-wildcard-source-targets branch from 79eb466 to 6fc4ee3 Compare October 11, 2026 12:35
@YevheniiKotyrlo YevheniiKotyrlo changed the title fix(exports): correct ./components/* source targets for two non-tsx modules test(exports): assert every exports subpath resolves to a source file that exists Oct 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant