Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/spotty-pumas-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@callstack/brownfield-cli': minor
'@callstack/react-native-brownfield': minor
---

add expo sdk 58
4 changes: 2 additions & 2 deletions .github/actions/prepare-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ inputs:
default: 'false'

gradle-workflow-job-context:
description: 'Segment Gradle cache per app/project (e.g. vanilla, expo56). Falls back to github.job when empty.'
description: 'Segment Gradle cache per app/project (e.g. vanilla, expo58). Falls back to github.job when empty.'
required: false
default: ''

rn-project-path:
description: 'Optional RN app path for native ccache key segmentation (e.g. apps/ExpoApp56)'
description: 'Optional RN app path for native ccache key segmentation (e.g. apps/ExpoApp58)'
required: false
default: ''

Expand Down
55 changes: 30 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
outputs:
packages: ${{ steps.filter.outputs.packages }}
rnapp: ${{ steps.filter.outputs.rnapp }}
expo56: ${{ steps.filter.outputs.expo56 }}
expo58: ${{ steps.filter.outputs.expo58 }}
expo57: ${{ steps.filter.outputs.expo57 }}
androidapp: ${{ steps.filter.outputs.androidapp }}
appleapp: ${{ steps.filter.outputs.appleapp }}
Expand All @@ -43,8 +43,8 @@ jobs:
rnapp:
- 'apps/RNApp/**'
- 'apps/brownfield-example-shared-tests/**'
expo56:
- 'apps/ExpoApp56/**'
expo58:
- 'apps/ExpoApp58/**'
- 'apps/brownfield-example-shared-tests/**'
expo57:
- 'apps/ExpoApp57/**'
Expand Down Expand Up @@ -141,15 +141,15 @@ jobs:
cd packages/react-native-brownfield
yarn test

android-androidapp-expo56-build:
name: Build AndroidApp & Detox APKs (Expo 56)
android-androidapp-expo58-build:
name: Build AndroidApp & Detox APKs (Expo 58)
runs-on: ubuntu-latest
timeout-minutes: 120
needs: [filter, build-lint]
if: |
always() &&
(
needs.filter.outputs.expo56 == 'true' ||
needs.filter.outputs.expo58 == 'true' ||
needs.filter.outputs.androidapp == 'true' ||
needs.filter.outputs.packages == 'true' ||
needs.filter.outputs.gradle-plugins == 'true' ||
Expand All @@ -161,46 +161,46 @@ jobs:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Build Expo 56 AndroidApp Detox APKs
- name: Build Expo 58 AndroidApp Detox APKs
uses: ./.github/actions/androidapp-road-test
with:
flavor: expo56
rn-project-path: apps/ExpoApp56
rn-project-maven-path: com/callstack/rnbrownfield/demo/expoapp56/brownfieldlib
flavor: expo58
rn-project-path: apps/ExpoApp58
rn-project-maven-path: com/callstack/rnbrownfield/demo/expoapp58/brownfieldlib
e2e-phase: build
e2e-apk-artifact-name: androidapp-expo56-e2e-apks
e2e-artifact-name: detox-androidapp-expo56
e2e-apk-artifact-name: androidapp-expo58-e2e-apks
e2e-artifact-name: detox-androidapp-expo58

android-androidapp-expo56-e2e:
name: Detox E2E (AndroidApp - Expo 56)
android-androidapp-expo58-e2e:
name: Detox E2E (AndroidApp - Expo 58)
runs-on: ubuntu-latest
timeout-minutes: 90
needs: [filter, build-lint, android-androidapp-expo56-build]
needs: [filter, build-lint, android-androidapp-expo58-build]
if: |
always() &&
(
needs.filter.outputs.expo56 == 'true' ||
needs.filter.outputs.expo58 == 'true' ||
needs.filter.outputs.androidapp == 'true' ||
needs.filter.outputs.packages == 'true' ||
needs.filter.outputs.gradle-plugins == 'true' ||
needs.filter.outputs.ci == 'true'
) &&
(needs.build-lint.result == 'success' || needs.build-lint.result == 'skipped') &&
needs.android-androidapp-expo56-build.result == 'success'
needs.android-androidapp-expo58-build.result == 'success'

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Run Expo 56 Detox E2E (prebuilt APKs)
- name: Run Expo 58 Detox E2E (prebuilt APKs)
uses: ./.github/actions/androidapp-road-test
with:
flavor: expo56
rn-project-path: apps/ExpoApp56
rn-project-maven-path: com/callstack/rnbrownfield/demo/expoapp56/brownfieldlib
flavor: expo58
rn-project-path: apps/ExpoApp58
rn-project-maven-path: com/callstack/rnbrownfield/demo/expoapp58/brownfieldlib
e2e-phase: test
e2e-apk-artifact-name: androidapp-expo56-e2e-apks
e2e-artifact-name: detox-androidapp-expo56
e2e-apk-artifact-name: androidapp-expo58-e2e-apks
e2e-artifact-name: detox-androidapp-expo58

android-androidapp-expo57-build:
name: Build AndroidApp & Detox APKs (Expo 57)
Expand All @@ -217,6 +217,11 @@ jobs:
needs.filter.outputs.ci == 'true'
) &&
(needs.build-lint.result == 'success' || needs.build-lint.result == 'skipped')
strategy:
matrix:
include:
- version: '58'
- version: '57'

steps:
- name: Checkout
Expand Down Expand Up @@ -327,7 +332,7 @@ jobs:
if: |
always() &&
(
needs.filter.outputs.expo56 == 'true' ||
needs.filter.outputs.expo58 == 'true' ||
needs.filter.outputs.expo57 == 'true' ||
needs.filter.outputs.appleapp == 'true' ||
needs.filter.outputs.packages == 'true' ||
Expand All @@ -337,7 +342,7 @@ jobs:
strategy:
matrix:
include:
- version: '56'
- version: '58'
run-e2e: 'true'
- version: '57'
run-e2e: 'true'
Expand Down
42 changes: 21 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ We use [changesets](https://github.com/changesets/changesets) to make it easier
- `lint` - runs linting on all JS/TS source files in the monorepo _[Turbo]_
- `gradle-plugin:lint` - runs linting on the Brownfield Gradle plugin source code
- `typecheck` - runs TypeScript type checking on all TS source files in the monorepo _[Turbo]_
- `test:apps` - runs Jest for the React Native example apps under `apps/` (Expo 56, plain RN) _[Turbo]_
- `test:apps` - runs Jest for the React Native example apps under `apps/` (Expo 58, plain RN) _[Turbo]_
- `build` - runs all `build*` tasks in the Turbo repo - see below for more details _[Turbo]_
- `dev` - runs all `dev` tasks in all workspaces
- `brownfield:plugin:publish:local` - publishes the Brownfield Gradle plugin to your local Maven repository for testing purposes
- `build:brownfield` - builds the React Native Brownfield package (`packages/react-native-brownfield`) _[Turbo]_
- `build:docs` - builds the documentation site (`docs/`) _[Turbo]_
- `build:example:android-rn` - builds the example React Native app for Android (`apps/RNApp/android`)
- `build:example:ios-rn` - builds the example React Native app for iOS (`apps/RNApp/ios`)
- `build:example:android-consumer:expo56` - builds the example native Android consumer (`apps/AndroidApp`) app's flavor consuming the Expo 56 RN app (`apps/ExpoApp56`) artifact
- `build:example:android-consumer:expo58` - builds the example native Android consumer (`apps/AndroidApp`) app's flavor consuming the Expo 58 RN app (`apps/ExpoApp58`) artifact
- `build:example:android-consumer:expo57` - builds the example native Android consumer (`apps/AndroidApp`) app's flavor consuming the Expo 57 RN app (`apps/ExpoApp57`) artifact
- `build:example:android-consumer:expo` - alias for `build:example:android-consumer:expo57`
- `build:example:android-consumer:vanilla` - builds the example native Android consumer (`apps/AndroidApp`) app's flavor consuming the vanilla RN app (`apps/RNApp`) artifact
- `build:example:ios-consumer:expo` - alias for `build:example:ios-consumer:expo57`
- `build:example:ios-consumer:expo56` - builds the `Brownfield Apple App (ExpoApp56)` target via scheme **Brownfield Apple App Expo 56** (`Release`)
- `build:example:ios-consumer:expo58` - builds the `Brownfield Apple App (ExpoApp58)` target via scheme **Brownfield Apple App Expo 58** (`Release`)
- `build:example:ios-consumer:expo57` - builds the `Brownfield Apple App (ExpoApp57)` target via scheme **Brownfield Apple App Expo 57** (`Release`)
- `build:example:ios-consumer:vanilla` - builds the `Brownfield Apple App (RNApp)` target via scheme **Brownfield Apple App Vanilla** (`Release Vanilla`)

Expand All @@ -63,23 +63,23 @@ To package an application for brownfield, you can run `yarn brownfield:package:i
There are 2 brownfield host apps.

> [!IMPORTANT]
> Each of the scripts below requires you to **first** package the consumed RN application with `yarn brownfield:package:ios`, e.g. `cd apps/ExpoApp56 && yarn brownfield:package:ios`.
> Each of the scripts below requires you to **first** package the consumed RN application with `yarn brownfield:package:ios`, e.g. `cd apps/ExpoApp58 && yarn brownfield:package:ios`.

- `apps/AndroidApp` - for Android
- `build:example:android-consumer:expo56` - consumes Expo 56
- `build:example:android-consumer:expo58` - consumes Expo 58
- `build:example:android-consumer:expo57` (or `expo`) - consumes Expo 57
- `build:example:android-consumer:vanilla` - consumes the vanilla `RNApp`
- `apps/AppleApp` - for Apple (one Xcode target per consumed RN app, each with its own shared scheme)
- `build:example:ios-consumer:expo56` — target `Brownfield Apple App (ExpoApp56)`, scheme **Brownfield Apple App Expo 56**
- `build:example:ios-consumer:expo58` — target `Brownfield Apple App (ExpoApp58)`, scheme **Brownfield Apple App Expo 58**
- `build:example:ios-consumer:expo57` (or `expo`) — target `Brownfield Apple App (ExpoApp57)`, scheme **Brownfield Apple App Expo 57**
- `build:example:ios-consumer:vanilla` — target `Brownfield Apple App (RNApp)`, scheme **Brownfield Apple App Vanilla**

For iOS, these scripts validate the legacy direct-XCFramework integration path. Each script uses the previously packaged artifacts from the respective directory (`apps/RNApp`, `apps/ExpoApp56`, or `apps/ExpoApp57`), invokes `prepareXCFrameworks.js` to copy XCFrameworks into `apps/AppleApp/package`, then runs `xcodebuild` against the matching scheme. The Xcode project reads fixed paths under `package/` (for example `package/BrownfieldLib.xcframework`).
For iOS, these scripts validate the legacy direct-XCFramework integration path. Each script uses the previously packaged artifacts from the respective directory (`apps/RNApp`, `apps/ExpoApp58`, or `apps/ExpoApp57`), invokes `prepareXCFrameworks.js` to copy XCFrameworks into `apps/AppleApp/package`, then runs `xcodebuild` against the matching scheme. The Xcode project reads fixed paths under `package/` (for example `package/BrownfieldLib.xcframework`).

| Yarn script | RN app | Xcode target | Scheme | Configuration |
| ------------------------------------ | ----------- | ---------------------------------- | ---------------------------- | ----------------- |
| `build:example:ios-consumer:vanilla` | `RNApp` | `Brownfield Apple App (RNApp)` | Brownfield Apple App Vanilla | `Release Vanilla` |
| `build:example:ios-consumer:expo56` | `ExpoApp56` | `Brownfield Apple App (ExpoApp56)` | Brownfield Apple App Expo 56 | `Release` |
| `build:example:ios-consumer:expo58` | `ExpoApp58` | `Brownfield Apple App (ExpoApp58)` | Brownfield Apple App Expo 58 | `Release` |
| `build:example:ios-consumer:expo57` | `ExpoApp57` | `Brownfield Apple App (ExpoApp57)` | Brownfield Apple App Expo 57 | `Release` |

> [!IMPORTANT]
Expand All @@ -91,16 +91,16 @@ The local Swift Package Manager flow is separate from `prepareXCFrameworks.js`.

1. Package the producer app with `--add-spm-package`, for example:
- `cd apps/RNApp && yarn exec brownfield package:ios --scheme BrownfieldLib --configuration Release --add-spm-package`
- `cd apps/ExpoApp56 && yarn exec brownfield package:ios --scheme BrownfieldLib --configuration Release --add-spm-package`
- `cd apps/ExpoApp58 && yarn exec brownfield package:ios --scheme BrownfieldLib --configuration Release --add-spm-package`
- `cd apps/ExpoApp57 && yarn exec brownfield package:ios --scheme BrownfieldLib --configuration Release --add-spm-package`
2. Open `apps/AppleApp/Brownfield Apple App.xcodeproj`.
3. Select the host scheme you want to validate:
- `Brownfield Apple App Vanilla`
- `Brownfield Apple App Expo 56`
- `Brownfield Apple App Expo 58`
- `Brownfield Apple App Expo 57`
4. In Xcode, go to `Package Dependencies`, click `+`, choose `Add Local...`, and select the generated package folder:
- `apps/RNApp/ios/.brownfield/package/build`
- `apps/ExpoApp56/ios/.brownfield/package/build`
- `apps/ExpoApp58/ios/.brownfield/package/build`
- `apps/ExpoApp57/ios/.brownfield/package/build`
5. Add the `BrownfieldLib` product to the matching AppleApp target.
6. Remove old direct `package/*.xcframework` references from that target if you are switching from the legacy direct-XCFramework path.
Expand All @@ -122,9 +122,9 @@ Per example app (run from the repo root):
| Command | App |
| --------------------------------------------------------------- | --------------------------------- |
| `yarn workspace @callstack/brownfield-example-rn-app test` | Plain React Native (`apps/RNApp`) |
| `yarn workspace @callstack/brownfield-example-expo-app-56 test` | Expo SDK 56 (`apps/ExpoApp56`) |
| `yarn workspace @callstack/brownfield-example-expo-app-58 test` | Expo SDK 58 (`apps/ExpoApp58`) |

Package-level scripts (`yarn test` inside `apps/RNApp` or `apps/ExpoApp56`) invoke Jest with each app’s `jest.config.js`.
Package-level scripts (`yarn test` inside `apps/RNApp` or `apps/ExpoApp58`) invoke Jest with each app’s `jest.config.js`.

The native-only sample apps (`apps/AppleApp`, `apps/AndroidApp`) use their platform test runners (Xcode / Gradle), not Jest.

Expand All @@ -147,10 +147,10 @@ Per-app Detox scripts (run from the app directory):
| ------------------------- | --------------------------- | -------------------------- | ---------------------------------- |
| `RNApp` | `yarn e2e:build:ios` | `yarn e2e:test:ios` | `rnAppBrownfield.e2e.js` |
| `AppleApp` (vanilla) | `yarn e2e:build:ios` | `yarn e2e:test:ios` | `appleAppBrownfield.e2e.js` |
| `AppleApp` (Expo 56) | `yarn e2e:build:ios:expo56` | `yarn e2e:test:ios:expo56` | `appleAppExpoBrownfield.e2e.js` |
| `AppleApp` (Expo 58) | `yarn e2e:build:ios:expo58` | `yarn e2e:test:ios:expo58` | `appleAppExpoBrownfield.e2e.js` |
| `AppleApp` (Expo 57) | `yarn e2e:build:ios:expo57` | `yarn e2e:test:ios:expo57` | `appleAppExpoBrownfield.e2e.js` |
| `AndroidApp` (vanilla) | `yarn e2e:build:android` | `yarn e2e:test:android` | `androidAppBrownfield.e2e.js` |
| `AndroidApp` (Expo 56) | `yarn e2e:build:android:expo56` | `yarn e2e:test:android:expo56` | `androidAppExpoBrownfield.e2e.js` |
| `AndroidApp` (Expo 58) | `yarn e2e:build:android:expo58` | `yarn e2e:test:android:expo58` | `androidAppExpoBrownfield.e2e.js` |
| `AndroidApp` (Expo 57) | `yarn e2e:build:android:expo57` | `yarn e2e:test:android:expo57` | `androidAppExpoBrownfield.e2e.js` |

### CI
Expand All @@ -160,15 +160,15 @@ iOS Detox E2E runs in [`.github/workflows/ci.yml`](.github/workflows/ci.yml) via
| Job | E2E | Notes |
| ----------------------------- | --- | ---------------------------------------- |
| `ios-appleapp-vanilla` | Yes | `RNApp` → package → `AppleApp` Detox |
| `ios-appleapp-expo` (Expo 56) | Yes | `ExpoApp56` → package → `AppleApp` Detox |
| `ios-appleapp-expo` (Expo 58) | Yes | `ExpoApp58` → package → `AppleApp` Detox |
| `ios-appleapp-expo` (Expo 57) | Yes | `ExpoApp57` → package → `AppleApp` Detox |

Android Detox E2E uses [`.github/actions/androidapp-road-test`](.github/actions/androidapp-road-test/action.yml):

| Job | E2E | Notes |
| ---------------------------------------- | --- | --------------------------------------------- |
| `android-androidapp-vanilla` | Yes | `RNApp` → AAR → `AndroidApp` Detox |
| `android-androidapp-expo56-build` / `-e2e` | Yes | `ExpoApp56` → AAR → Detox APKs → emulator |
| `android-androidapp-expo58-build` / `-e2e` | Yes | `ExpoApp58` → AAR → Detox APKs → emulator |
| `android-androidapp-expo57-build` / `-e2e` | Yes | `ExpoApp57` → AAR → Detox APKs → emulator |

On failure, CI uploads Detox artifacts (`detox-*-ios-recordings` / `detox-androidapp-*-android`).
Expand All @@ -183,20 +183,20 @@ From the repo root (macOS + Xcode + Simulator required for iOS). All wrap `scrip
| ---------------------------------------------------- | -------------------------------- |
| `yarn ci:local:rnapp:e2e:ios` | RN host app E2E (`apps/RNApp`) |
| `yarn ci:local:appleapp:e2e:ios` | CI `ios-appleapp-vanilla` |
| `yarn ci:local:appleapp:e2e:ios --variant expo56` | CI `ios-appleapp-expo` (Expo 56) |
| `yarn ci:local:appleapp:e2e:ios --variant expo58` | CI `ios-appleapp-expo` (Expo 58) |
| `yarn ci:local:appleapp:e2e:ios --variant expo57` | CI `ios-appleapp-expo` (Expo 57) |

From `apps/AppleApp`, you can also use `yarn ci:local:e2e:ios:expo56` / `yarn ci:local:e2e:ios:expo57`.
From `apps/AppleApp`, you can also use `yarn ci:local:e2e:ios:expo58` / `yarn ci:local:e2e:ios:expo57`.

Android (Android SDK + emulator; defaults to `Pixel_4_API_34`):

| Command | Mirrors |
| ------------------------------------------------------- | -------------------------------------------- |
| `yarn ci:local:androidapp:e2e:android` | CI `android-androidapp-vanilla` |
| `yarn ci:local:androidapp:e2e:android:expo56` | CI Expo 56 AndroidApp Detox |
| `yarn ci:local:androidapp:e2e:android:expo58` | CI Expo 58 AndroidApp Detox |
| `yarn ci:local:androidapp:e2e:android:expo57` | CI Expo 57 AndroidApp Detox |

From `apps/AndroidApp`, you can also use `yarn ci:local:e2e:android:expo56` / `yarn ci:local:e2e:android:expo57`.
From `apps/AndroidApp`, you can also use `yarn ci:local:e2e:android:expo58` / `yarn ci:local:e2e:android:expo57`.

Common flags (append to any command above):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {

/** @type {import('detox').DetoxConfig} */
module.exports = createAndroidAppEmulatorReleaseDetoxConfig({
gradleFlavor: 'expo56',
detoxConfiguration: 'android.emu.release.expo56',
jestConfigPath: 'e2e/jest.config.expo56.cjs',
gradleFlavor: 'expo58',
detoxConfiguration: 'android.emu.release.expo58',
jestConfigPath: 'e2e/jest.config.expo58.cjs',
});
4 changes: 2 additions & 2 deletions apps/AndroidApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
create("expo57") {
dimension = "app"
}
create("expo56") {
create("expo58") {
dimension = "app"
}
create("expopreview") {
Expand Down Expand Up @@ -78,7 +78,7 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.appcompat)
add("expo57Implementation", libs.brownfieldlib.expo57)
add("expo56Implementation", libs.brownfieldlib.expo56)
add("expo58Implementation", libs.brownfieldlib.expo58)
add("expopreviewImplementation", libs.brownfieldlib.expopreview)
add("vanillaImplementation", libs.brownfieldlib.vanilla)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.callstack.brownfield.android.example

typealias BrownfieldStore = com.callstack.rnbrownfield.demo.expoapp56.BrownfieldStore
typealias User = com.callstack.rnbrownfield.demo.expoapp56.User
typealias BrownfieldStore = com.callstack.rnbrownfield.demo.expoapp58.BrownfieldStore
typealias User = com.callstack.rnbrownfield.demo.expoapp58.User
Loading
Loading