fix: first time build fails#39
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughA single npm script entry, ChangesBuild Script Update
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 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 |
|
@adamivancza I think the lifecycle hook should live in Suggested change: move the new |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 9: The `prebuild` script is in the wrong place: it currently lives in the
root package and won’t run for filtered, direct, or release builds. Remove
`prebuild` from the root package configuration and add it to
`package/package.json` alongside the package’s `build` script so `bun run
build`, `bun run --filter react-native-better-maps build`, and `cd package &&
bun run build` all trigger `bun run nitrogen` correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "example" | ||
| ], | ||
| "scripts": { | ||
| "prebuild": "bun run nitrogen", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Move prebuild to package/package.json — root-level placement misses filtered and direct package builds.
You ignored the reviewer's explicit feedback. A root prebuild only fires on bun run build at workspace root. It does not run for bun run --filter react-native-better-maps build, cd package && bun run build, or release/prepack flows. The fix belongs in package/package.json alongside the build script so it actually executes wherever the package builds.
Per the PR objectives, the reviewer already told you this. You put it in the wrong file anyway.
🔧 Fix
Remove from package.json (root):
- "prebuild": "bun run nitrogen",Add to package/package.json in scripts:
+ "prebuild": "bun run nitrogen",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 9, The `prebuild` script is in the wrong place: it
currently lives in the root package and won’t run for filtered, direct, or
release builds. Remove `prebuild` from the root package configuration and add it
to `package/package.json` alongside the package’s `build` script so `bun run
build`, `bun run --filter react-native-better-maps build`, and `cd package &&
bun run build` all trigger `bun run nitrogen` correctly.
|
@piotr-graczyk-dev makes sense - done! |
Summary
Adds a pre-build step to generate Nitrogen output before the package build runs.
Why
bun run build can fail on a clean checkout because Bob’s TypeScript declaration build imports generated Nitrogen output from:
../../nitrogen/generated/shared/json/MapViewConfig.jsonIf bun run nitrogen has not been run first, that file is missing and the build fails with a TS error.
This change makes the documented build command work reliably for clean environments.
Testing