Skip to content

fix(bun): use npx for react-native-builder-bob in prepare script#47

Merged
mfazekas merged 2 commits into
mainfrom
fix/bun-prepare-script
Nov 28, 2025
Merged

fix(bun): use npx for react-native-builder-bob in prepare script#47
mfazekas merged 2 commits into
mainfrom
fix/bun-prepare-script

Conversation

@mfazekas
Copy link
Copy Markdown
Collaborator

@mfazekas mfazekas commented Nov 27, 2025

Bun blocks lifecycle scripts by default for security. When users add the package to trustedDependencies, the prepare script runs but bob is not available since it's a devDependency. Using npx downloads bob on-demand.

Fixes #38

 # 1. Create a fresh Expo app with bun
  cd /tmp
  bunx create-expo-app@latest rive-bun-test --template blank-typescript
  cd rive-bun-test

  # 2. Add trustedDependencies to package.json
  # Edit package.json to add:
  #   "trustedDependencies": [
  #     "@rive-app/react-native",
  #     "react-native-nitro-modules"
  #   ]

  # 3. Install nitro-modules first (peer dependency)
  bun add react-native-nitro-modules

  # 4. Install from GitHub branch
  bun add rive-app/rive-nitro-react-native#fix/bun-prepare-script

  # 5. Verify lib folder was created
  ls node_modules/@rive-app/react-native/lib/
  # Should show: module/ typescript/ nitrogen/

Bun blocks lifecycle scripts by default for security. When users add the package
to trustedDependencies, the prepare script runs but bob is not available since
it's a devDependency. Using npx downloads bob on-demand.

Fixes #38
- Use npx react-native-builder-bob in prepare script so it works
  when installed as a dependency (bob is a devDependency)
- Exclude __tests__ directories from tsconfig.build.json

Fixes #38
@mfazekas mfazekas requested a review from HayesGordon November 27, 2025 14:55
@mfazekas mfazekas merged commit 9431e59 into main Nov 28, 2025
5 checks passed
@HayesGordon HayesGordon deleted the fix/bun-prepare-script branch December 9, 2025 16:24
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.

bun + prepare: Cannot use library

2 participants