Skip to content

fix: keep .js/.json precedence over .node and verify prebuild Info.plist - #467

Open
kraenhansen wants to merge 2 commits into
mainfrom
claude/sleepy-babbage-cv5w7g
Open

kraenhansen wants to merge 2 commits into
mainfrom
claude/sleepy-babbage-cv5w7g

Conversation

@kraenhansen

Copy link
Copy Markdown
Collaborator

Closes #424. Supersedes #426, which conflicts with next and carries unrelated commits; this is a clean take on the same two gaps. @kraenhansen for review.

Changes

  • isNodeApiModule now returns false for an extensionless path when <path>.js or <path>.json exists, matching Node's resolution order. Previously require('./my-addon') was rewritten to requireNodeAddon(...) whenever a sibling my-addon.node existed.
  • The Babel plugin test "does not touch required JS files" now includes a my-addon.node next to my-addon.js. It fails without the fix above.
  • verify-prebuilds.mts parses each framework's Info.plist and asserts that CFBundleExecutable and CFBundleName match the framework name, that CFBundleIdentifier only contains valid characters, and that the executable exists. It adds @expo/plist (same version as packages/host) as a devDependency of node-addon-examples.

The script doesn't know the identifier that was requested at build time, so it checks that the identifier is valid rather than equal to an expected value.

Test plan

  • pnpm run build, eslint, prettier:check pass.
  • pnpm --filter react-native-node-api test: all pass except 4 permission tests that fail the same way on next here because the sandbox runs as root.
  • The verify-prebuilds change is not run here (needs Apple toolchain output); it type-checks and lints.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RFTxhqB2yuMZU7AvpM5nvx


Generated by Claude Code

@kraenhansen kraenhansen added Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) labels Oct 11, 2026
@kraenhansen
kraenhansen changed the base branch from next to main October 11, 2026 20:37
@kraenhansen
kraenhansen force-pushed the claude/sleepy-babbage-cv5w7g branch from 0a66da1 to fd9cfb9 Compare October 11, 2026 20:37

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

Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two test gaps: unverified prebuild Info.plist and a missing .node fixture in the Babel plugin tests

2 participants