feat: support local BGP in Expo config plugin#402
Open
artus9033 wants to merge 17 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the @callstack/react-native-brownfield Expo config plugin to support loading the Brownfield Gradle plugin locally (via includeBuild) and introduces a unified configuration flow where the Expo plugin can resolve options from brownfield.config.* / package.json#brownfield as well as legacy app.json plugin props.
Changes:
- Add
useLocalGradlePluginoption and wire it through Expo Android prebuild Gradle modifications (settings.gradleincludeBuild + skipping Maven classpath injection). - Introduce a shared “Expo plugin config resolution” module in
@callstack/brownfield-cliand update the Expo plugin to consume it (plus overlap protection between file config and plugin props). - Update CLI config loading semantics (
loadBrownfieldConfigcan returnnull), schema/types/docs, and migrate an example app config tobrownfield.config.json.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-brownfield/src/expo-config-plugin/withBrownfield.ts | Switch Expo plugin config resolution to shared CLI resolver + overlap guard. |
| packages/react-native-brownfield/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts | Add useLocalGradlePlugin option to Android plugin config type. |
| packages/react-native-brownfield/src/expo-config-plugin/android/withBrownfieldAndroid.ts | Pass useLocalGradlePlugin into Gradle modification helpers. |
| packages/react-native-brownfield/src/expo-config-plugin/android/utils/gradleHelpers.ts | Implement includeBuild insertion + skip Maven classpath when local plugin enabled. |
| packages/react-native-brownfield/src/expo-config-plugin/android/utils/tests/gradleHelpers.test.ts | Add unit tests covering the new Gradle helper behavior. |
| packages/react-native-brownfield/src/expo-config-plugin/android/tests/withAndroidModuleFiles.test.ts | Extend fixture config with useLocalGradlePlugin. |
| packages/cli/src/types.ts | Add Expo-only nested config types (android.expo, ios.expo) incl. useLocalGradlePlugin. |
| packages/cli/src/expoPluginConfig.ts | New shared resolver/overlap-check module for Expo config plugin consumption. |
| packages/cli/src/config.ts | Make loadBrownfieldConfig return `BrownfieldConfig |
| packages/cli/src/brownie/config.ts | Handle loadBrownfieldConfig() possibly returning null. |
| packages/cli/src/brownie/tests/config.test.ts | Adjust tests for config loading behavior changes. |
| packages/cli/src/brownfield/utils/project.ts | Refine Expo project detection and error behavior when app config exists but Expo config parsing fails. |
| packages/cli/src/brownfield/commands/publishAndroid.ts | Run Expo prebuild earlier and adjust project root handling. |
| packages/cli/src/brownfield/commands/packageIos.ts | Run Expo prebuild earlier and adjust project root handling. |
| packages/cli/src/brownfield/commands/packageAndroid.ts | Run Expo prebuild earlier and adjust project root handling. |
| packages/cli/src/brownfield/commands/tests/packageIos.action.test.ts | Update mocks and assertions for adjusted package:ios command flow. |
| packages/cli/src/tests/expoPluginConfig.test.ts | Add tests for overlap detection + resolver mapping across config sources. |
| packages/cli/src/tests/config.test.ts | Update tests for loadBrownfieldConfig returning null when no source exists. |
| packages/cli/schema.json | Add android.expo / ios.expo schema definitions incl. useLocalGradlePlugin. |
| packages/cli/package.json | Export new ./expo-plugin-config entrypoint. |
| docs/docs/docs/getting-started/ios.mdx | Rename referenced config file to brownfield.config.json. |
| docs/docs/docs/getting-started/expo.mdx | Document preference for config file, overlap warning, and useLocalGradlePlugin. |
| docs/docs/docs/getting-started/android.mdx | Rename referenced config file to brownfield.config.json. |
| docs/docs/docs/api-reference/configuration.mdx | Document Expo project config sharing and android.expo.* / ios.expo.* layout. |
| apps/ExpoApp55/package.json | Remove inline brownfield config block from package.json. |
| apps/ExpoApp55/brownfield.config.json | Add dedicated Brownfield config file for the example Expo app. |
| apps/ExpoApp55/app.json | Register plugin without options (config comes from file). |
| apps/ExpoApp54/app.json | Register plugin without options. |
| .changeset/vast-waves-itch.md | Changeset for local BGP support in Expo plugin. |
| .changeset/nine-mice-fall.md | Changeset for unified config file support in Expo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Support local BGP in Expo config plugin with new option
useLocalGradlePlugin, available both in the config file & Expo config plugin options.Test plan
CI green.