feat: unified config file support for Expo#398
Open
artus9033 wants to merge 15 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds unified Brownfield config-file support for Expo projects by centralizing config loading/merging in @callstack/brownfield-cli and updating the Expo config plugin + docs accordingly.
Changes:
- Introduces
@callstack/brownfield-cli/expo-plugin-configutilities for Expo prebuild (load config, detect overlap withapp.jsonplugin props, resolve effective plugin config). - Updates config loading to return
nullwhen no config source exists and expands CLI types/schema/docs with Expo-specific nested keys (android.expo.*,ios.expo.*) and richer descriptions. - Migrates the Expo demo app to register the plugin without
app.jsonoptions when using a config file.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updates Rock toolchain deps and adds Prettier lock entries. |
| packages/react-native-brownfield/src/expo-config-plugin/withBrownfield.ts | Switches Expo plugin config resolution to the new CLI-provided resolver + overlap guard. |
| packages/cli/src/types.ts | Adds Expo nested config types and tweaks iOS flag typing used for schema generation. |
| packages/cli/src/expoPluginConfig.ts | New shared Expo plugin config resolution utilities (overlap detection + resolution). |
| packages/cli/src/config.ts | Exposes config filenames/constants; loadBrownfieldConfig now returns null when no source exists. |
| packages/cli/src/brownie/config.ts | Adjusts Brownie config lookup for nullable loadBrownfieldConfig. |
| packages/cli/src/tests/expoPluginConfig.test.ts | Adds tests for Expo plugin config resolution utilities. |
| packages/cli/src/tests/config.test.ts | Updates tests for loadBrownfieldConfig nullable behavior. |
| packages/cli/schema.json | Extends schema with Expo nested keys and adds/updates descriptions. |
| packages/cli/package.json | Exposes new ./expo-plugin-config entrypoint; bumps Rock deps; adds Prettier for schema formatting. |
| docs/docs/docs/getting-started/expo.mdx | Recommends config-file-driven setup; clarifies plugin options usage rules. |
| docs/docs/docs/cli/brownfield.mdx | Updates CLI docs to match current iOS options. |
| docs/docs/docs/api-reference/configuration.mdx | Documents Expo projects config rules + Expo-only nested keys and example. |
| apps/ExpoApp54/app.json | Migrates plugin registration to string-only (no tuple options). |
| apps/AppleApp/package.json | Bumps @rock-js/tools version. |
| .changeset/young-snails-lose.md | Changeset for schema/description generation updates. |
| .changeset/nine-mice-fall.md | Changeset for unified Expo config support across packages. |
Comments suppressed due to low confidence (1)
docs/docs/docs/api-reference/configuration.mdx:85
- The config loader expects
brownfield.config.js(seeCONFIG_BASE_NAME = "brownfield"), but the docs here mentionreact-native-brownfield.config.js. This is inconsistent with the earlier “Expo projects” section and with the actual filenames supported byloadBrownfieldConfig.
## JavaScript config file
If you prefer a JavaScript file, create `react-native-brownfield.config.js` and export a plain object with `module.exports`:
💡 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
This PR:
loadBrownfieldConfigto returnnullif it was not loadedNew config architecture:

Example behavior:
Test plan
CI green - with migrated config in demo apps.