fix: make EXUpdates as a dependency only when installed#361
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the ReactBrownfield.podspec so that Expo-host integration doesn’t unconditionally add the EXUpdates pod, avoiding build failures for Expo apps that don’t include expo-updates.
Changes:
- Add a small helper to detect whether
expo-updatesis installed. - Gate the
EXUpdatesCocoaPods dependency behind that detection whenREACT_NATIVE_BROWNFIELD_USE_EXPO_HOST=1.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| File.exist?( | ||
| File.join(install_root, 'node_modules', 'expo-updates', 'package.json') | ||
| ) |
There was a problem hiding this comment.
I'm wondering if we could dynamically establish the path to this with node require CLI call like in this case: https://github.com/expo/expo/blob/a260901d706ba7d5fa1ee0a9e999b6b6b255a858/apps/brownfield-tester/integrated/android/settings.gradle.kts#L5-L9 - this would be more error-prone. WDYT @hurali97?
There was a problem hiding this comment.
Yeah I agree, I have addressed it now.
Summary
This PR fixes the issue where
expo-updatesare added as dependency in Podspec ofreact-native-brownfieldif the project is Expo. However, even Expo projects may not useexpo-updates.Test plan
expo-updates