Skip to content

feat: unified config file support for Expo#398

Open
artus9033 wants to merge 15 commits into
mainfrom
feat/config-file-expo
Open

feat: unified config file support for Expo#398
artus9033 wants to merge 15 commits into
mainfrom
feat/config-file-expo

Conversation

@artus9033

@artus9033 artus9033 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR:

  • brings standalone config file support to Expo & migrates the demo app setups to use it,
  • modifies the signature of loadBrownfieldConfig to return null if it was not loaded

New config architecture:
image

Example behavior:

Scenario Behavior
No config file, plugin props in app.json Unchanged (current Expo workflow)
Config file only, plugins: ["@callstack/react-native-brownfield"] New unified workflow
Config file + non-empty plugin props with overlap Error, abort prebuild
Legacy frameworkName in app.json (no config file) Still accepted
ios.scheme in config file Drives both CLI package:ios and plugin frameworkName

Test plan

CI green - with migrated config in demo apps.

@artus9033 artus9033 requested review from hurali97 and krozniata June 24, 2026 15:56
@artus9033 artus9033 self-assigned this Jun 24, 2026
Copilot AI review requested due to automatic review settings June 24, 2026 15:56
@artus9033 artus9033 changed the title Feat/config file expo feat: unified config file support for Expo Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-config utilities for Expo prebuild (load config, detect overlap with app.json plugin props, resolve effective plugin config).
  • Updates config loading to return null when 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.json options 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 (see CONFIG_BASE_NAME = "brownfield"), but the docs here mention react-native-brownfield.config.js. This is inconsistent with the earlier “Expo projects” section and with the actual filenames supported by loadBrownfieldConfig.
## 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.

Comment thread packages/cli/src/config.ts
Comment thread packages/cli/src/config.ts
Comment thread docs/docs/docs/api-reference/configuration.mdx
Comment thread packages/cli/src/expoPluginConfig.ts
Comment thread packages/cli/src/__tests__/expoPluginConfig.test.ts
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.

2 participants