fix: preserve jsparser CommonJS package boundary#1984
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe jsparser distribution now includes its package manifest, declares CommonJS semantics, and validates the packaged manifest before completing project template copying. ChangesJS parser package validation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The Android runtime package copies
js_parser.jsinto an app's generated platform directory without its package boundary. When the app (or an ancestor workspace) declares"type": "module", Node treats that bundled CommonJS parser as ESM and the static binding generator fails withReferenceError: require is not defined in ES module scope.Fix
package.jsonalongsidejs_parser.jsin the runtime package.Verification
./gradlew help --no-daemon --console=plaintype: modulepackage boundary. The static binding generator completed and the native app launched successfully.Summary by CodeRabbit