Skip to content

feat: add example Rock app#338

Open
Juozas-Petkelis wants to merge 12 commits into
callstack:mainfrom
Juozas-Petkelis:feat/rock-example
Open

feat: add example Rock app#338
Juozas-Petkelis wants to merge 12 commits into
callstack:mainfrom
Juozas-Petkelis:feat/rock-example

Conversation

@Juozas-Petkelis
Copy link
Copy Markdown

@Juozas-Petkelis Juozas-Petkelis commented May 19, 2026

Summary

Add a demo app & CLI support for Rock
This PR:

  • Creates new example app for Rock

    • created app from Rock cli yarn create rock in package RockApp
    • Added new flavor for Android consumer app
          create("rock") {
              dimension = "app"
          }
    • Created new schema Brownfield Apple App Rock for iOS consumer app
    • Extracted example app UI to brownfield-example-shared package for RNApp and RockApp example apps
    • Minor adjustments to Home screen
      • Wrapped container in a ScrollView to fix the native message list being cut off

      • Refactored "Send message to Native" button to the <Button /> component to look and behave the same as other buttons

      • Home screen before and after
        Before After
  • Adjust actions and CI to support Rock

    • Add rock to GH action
    • Add scripts to build Rock from CI

Test plan

  • iOS

    • Run yarn in the root of the repository to install all dependencies
    • in apps/RockApp/ios run pod install
    • in apps/RockApp run yarn brownfield:package:ios
    • in apps/AppleApp run yarn build:example:ios-consumer:rock
    • run ios consumer app with Brownfield Apple App Rock schema
  • Android

    • Run yarn in the root of the repository to install all dependencies
    • in apps/RockApp run yarn brownfield:package:android and yarn brownfield:publish:android
    • run android consumer app with RockDebug or RockRelease build variant
Rock example App
iOS Android

Comment thread apps/AppleApp/embed-rock-runtime-frameworks.sh Outdated
@artus9033 artus9033 requested a review from hurali97 May 19, 2026 10:55
Comment thread packages/brownfield-navigation/src/NativeBrownfieldNavigation.ts Outdated
Comment thread packages/brownfield-navigation/src/index.ts Outdated
Comment thread packages/brownfield-navigation/ios/NativeBrownfieldNavigation.mm Outdated
Comment thread packages/brownfield-navigation/ios/BrownfieldNavigationModels.swift Outdated
Comment thread packages/brownfield-navigation/ios/BrownfieldNavigationDelegate.swift Outdated
@Juozas-Petkelis
Copy link
Copy Markdown
Author

Removed embed-rock-runtime-frameworks.sh as it is no longer necessary and reverted code generation for brownfield navigation

@Juozas-Petkelis Juozas-Petkelis requested a review from hurali97 June 5, 2026 07:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Rock-powered demo app to the apps/ workspace and wires it into the existing brownfield “road test” flow, while also extracting the shared React Native UI into a reusable workspace package used by both the vanilla RN app and the new Rock app.

Changes:

  • Introduces apps/RockApp (Rock CLI-based RN app) with iOS/Android native projects, packaging scripts, and Jest setup.
  • Extracts the example UI into apps/brownfield-example-shared and updates apps/RNApp to consume it.
  • Extends Apple/Android consumer apps and GitHub Actions CI to include a Rock variant.

Reviewed changes

Copilot reviewed 80 out of 103 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
CONTRIBUTING.md Documents Rock build/test scripts (needs scheme/config fix).
apps/RockApp/tsconfig.json TS config for Rock app.
apps/RockApp/rock.config.mjs Rock platform/bundler plugin config.
apps/RockApp/README.md Rock app readme placeholder.
apps/RockApp/package.json Rock app scripts and dependencies.
apps/RockApp/metro.config.js Metro config for monorepo layout.
apps/RockApp/jest.setup.js Shared Jest setup import.
apps/RockApp/jest.config.js Jest config/mappers for monorepo packages.
apps/RockApp/ios/RockApp/PrivacyInfo.xcprivacy iOS privacy manifest for Rock app.
apps/RockApp/ios/RockApp/LaunchScreen.storyboard iOS launch screen.
apps/RockApp/ios/RockApp/Info.plist iOS app Info.plist.
apps/RockApp/ios/RockApp/Images.xcassets/Contents.json iOS asset catalog metadata.
apps/RockApp/ios/RockApp/Images.xcassets/AppIcon.appiconset/Contents.json iOS app icon set metadata.
apps/RockApp/ios/RockApp/AppDelegate.swift iOS app delegate / RN factory setup.
apps/RockApp/ios/RockApp.xcworkspace/contents.xcworkspacedata Xcode workspace definition.
apps/RockApp/ios/RockApp.xcodeproj/xcshareddata/xcschemes/RockApp.xcscheme Shared scheme for Rock app target.
apps/RockApp/ios/RockApp.xcodeproj/xcshareddata/xcschemes/BrownfieldLib.xcscheme Shared scheme for BrownfieldLib framework target.
apps/RockApp/ios/RockApp.xcodeproj/project.pbxproj Rock iOS project config (deployment target needs alignment).
apps/RockApp/ios/Podfile.properties.json iOS Podfile properties.
apps/RockApp/ios/Podfile CocoaPods config using rock config.
apps/RockApp/ios/BrownfieldLib/BrownfieldLib.swift Swift export shim for ReactBrownfield bundle.
apps/RockApp/ios/BrownfieldLib/BrownfieldLib.h Framework umbrella header.
apps/RockApp/ios/.xcode.env Node path setup for Xcode scripts.
apps/RockApp/index.js JS entry registering RockApp component.
apps/RockApp/Gemfile.lock Bundler lockfile for CocoaPods tooling.
apps/RockApp/Gemfile Ruby/CocoaPods gem constraints.
apps/RockApp/eslint.config.mjs ESLint config wiring for Rock app.
apps/RockApp/BrownfieldStore.brownie.ts Brownie store typings augmentation for Rock app.
apps/RockApp/brownfield.navigation.ts Navigation spec for native interop.
apps/RockApp/babel.config.js Babel preset config.
apps/RockApp/App.tsx Rock app entry re-exporting shared UI App.
apps/RockApp/android/settings.gradle Android settings using rock config autolinking.
apps/RockApp/android/gradlew.bat Gradle wrapper (Windows).
apps/RockApp/android/gradlew Gradle wrapper (POSIX).
apps/RockApp/android/gradle/wrapper/gradle-wrapper.properties Gradle distribution config.
apps/RockApp/android/gradle.properties Android gradle properties (signing props need removal).
apps/RockApp/android/build.gradle Android root buildscript wiring (matches other apps).
apps/RockApp/android/brownfieldlib/src/main/java/com/callstack/rnbrownfield/demo/rockapp/ReactNativeHostManager.kt Host init helper for Brownfield integration.
apps/RockApp/android/brownfieldlib/src/main/java/com/callstack/rnbrownfield/demo/rockapp/Generated/SettingsStore.kt Generated SettingsStore model.
apps/RockApp/android/brownfieldlib/src/main/java/com/callstack/rnbrownfield/demo/rockapp/Generated/BrownfieldStore.kt Generated BrownfieldStore model.
apps/RockApp/android/brownfieldlib/build.gradle.kts Android library module for AAR publishing.
apps/RockApp/android/app/src/main/res/values/styles.xml Android app theme resources.
apps/RockApp/android/app/src/main/res/values/strings.xml Android app string resources.
apps/RockApp/android/app/src/main/res/drawable/rn_edit_text_material.xml Android drawable workaround for RN edit text.
apps/RockApp/android/app/src/main/java/com/callstack/rnbrownfield/demo/rockapp/MainApplication.kt Android app Application for RN host.
apps/RockApp/android/app/src/main/java/com/callstack/rnbrownfield/demo/rockapp/MainActivity.kt Android main activity for RN.
apps/RockApp/android/app/src/main/AndroidManifest.xml Android app manifest.
apps/RockApp/android/app/src/debug/AndroidManifest.xml Debug-only manifest overrides.
apps/RockApp/android/app/proguard-rules.pro Proguard rules placeholder.
apps/RockApp/android/app/build.gradle Android app build config (Rock CLI path, flavors/buildTypes).
apps/RockApp/.prettierrc.js Prettier config for Rock app.
apps/RockApp/.gitignore Gitignore tailored for Rock app.
apps/RockApp/.bundle/config Bundler config for local Ruby gems.
apps/RockApp/tests/brownfield.example.test.tsx Shared test-suite runner for Rock app UI.
apps/RockApp/tests/App.test.tsx Snapshot-style render test for Rock app.
apps/RNApp/package.json Adds dependency on shared UI package.
apps/RNApp/jest.config.js Allows transforming shared UI package in Jest.
apps/RNApp/index.js Switches entry to shared UI App + store augmentation.
apps/RNApp/tests/brownfield.example.test.tsx Updates tests to import shared UI components.
apps/RNApp/tests/App.test.tsx Updates App import to shared UI.
apps/README.md Documents RockApp and shared packages.
apps/brownfield-example-shared/tsconfig.json TS config for shared UI package.
apps/brownfield-example-shared/src/utils.ts Adds Theme type + typing for getRandomTheme.
apps/brownfield-example-shared/src/navigation/RootStack.ts Uses Theme type in route params.
apps/brownfield-example-shared/src/nativeHostContext.tsx Adds native OS version context + hook.
apps/brownfield-example-shared/src/index.ts Barrel exports for shared UI/public surface.
apps/brownfield-example-shared/src/HomeScreen.tsx UI tweaks (ScrollView, Button refactor) (needs centering fix).
apps/brownfield-example-shared/src/global.d.ts Shared Brownie store typing augmentation.
apps/brownfield-example-shared/src/components/Counter.tsx Shared Counter component.
apps/brownfield-example-shared/src/App.tsx Shared App component; exports AppProps.
apps/brownfield-example-shared/README.md Shared package readme.
apps/brownfield-example-shared/package.json Shared package metadata/exports/peer deps.
apps/brownfield-example-shared/eslint.config.mjs ESLint config for shared package.
apps/AppleApp/prepareXCFrameworks.js Adds Rock mapping for moduleName/greeting patching.
apps/AppleApp/package.json Adds Rock iOS consumer build script.
apps/AppleApp/Brownfield Apple App/components/ContentView.swift Hardcodes Rock moduleName/greeting + adds stop button (should keep neutral defaults).
apps/AppleApp/Brownfield Apple App.xcodeproj/xcshareddata/xcschemes/Brownfield Apple App Rock.xcscheme Adds Rock shared scheme.
apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj Restructures Xcode project (currently drops framework linking/embedding and breaks existing schemes).
apps/AndroidApp/package.json Adds Rock Android consumer build script.
apps/AndroidApp/gradle/libs.versions.toml Adds Rock AAR coordinate alias.
apps/AndroidApp/app/src/rock/java/com/callstack/brownfield/android/example/ReactNativeHostManager.kt Rock flavor host wiring via typealias.
apps/AndroidApp/app/src/rock/java/com/callstack/brownfield/android/example/ReactNativeConstants.kt Rock flavor constants (module name/app name).
apps/AndroidApp/app/src/rock/java/com/callstack/brownfield/android/example/BrownfieldStore.kt Rock flavor store typealiases.
apps/AndroidApp/app/build.gradle.kts Adds rock flavor and dependency wiring.
.github/workflows/ci.yml Adds Rock road test jobs (iOS job likely needs pod install support).
.github/actions/appleapp-road-test/action.yml Updates input description to include rock.
.github/actions/androidapp-road-test/action.yml Updates input description to include rock.
.changeset/config.json Adds Rock app to changeset ignore list.
Files not reviewed (1)
  • apps/RockApp/ios/RockApp.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (2)

apps/brownfield-example-shared/src/HomeScreen.tsx:223

  • alignContent: 'center' does not horizontally center children in a single-column ScrollView content container (it only affects multi-line flex-wrap layouts). Since the previous View container used alignItems: 'center', this change will likely regress layout/centering for the Home screen.
    apps/AppleApp/Brownfield Apple App/components/ContentView.swift:31
  • Similarly, hardcoding moduleName: "RockApp" breaks running AppleApp directly unless prepareXCFrameworks.js has been run. Keeping a stable default (e.g. RNApp) avoids confusing local runs and still gets overridden by the prepare script in CI.
                ReactNativeView(
                    moduleName: "RockApp",
                    initialProperties: [
                        "nativeOsVersionLabel":
                            "\(UIDevice.current.systemName) \(UIDevice.current.systemVersion)"
                    ]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CONTRIBUTING.md
- `build:example:ios-consumer:expo55` - builds the `Brownfield Apple App (ExpoApp55)` target via scheme **Brownfield Apple App Expo 55** (`Release`)
- `build:example:ios-consumer:expo54` - builds the `Brownfield Apple App (ExpoApp54)` target via scheme **Brownfield Apple App Expo 54** (`Release`)
- `build:example:ios-consumer:vanilla` - builds the `Brownfield Apple App (RNApp)` target via scheme **Brownfield Apple App Vanilla** (`Release Vanilla`)
- `build:example:ios-consumer:rock` - builds the `Brownfield Apple App (Rock)` target via scheme **Brownfield Apple App Vanilla** (`Release Rock`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This needs adjustment. I'm also wondering if just for clarity we should not just duplicate the Release Vanilla to Release Rock + update for coherence. WDYT @hurali97 ?

Comment on lines +472 to +479
ENABLE_MODULE_VERIFIER = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
LD_RUNPATH_SEARCH_PATHS = (
Comment on lines +525 to +532
ENABLE_MODULE_VERIFIER = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
LD_RUNPATH_SEARCH_PATHS = (
Comment thread apps/RockApp/android/gradle.properties
Comment thread apps/AppleApp/Brownfield Apple App/components/ContentView.swift
Comment thread .github/workflows/ci.yml
Comment on lines +249 to +253
- name: Run RNApp -> AppleApp road test (Rock)
uses: ./.github/actions/appleapp-road-test
with:
variant: rock
rn-project-path: apps/RockApp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Juozas-Petkelis shouldn't we use the Rock CLI for packaging it + installing Pods?

Comment on lines 15 to 17
files = (
79B8BE8F2FB7273600B94C6F /* Brownie.xcframework in Embed Frameworks */,
79B8BE902FB7273600B94C6F /* ReactBrownfield.xcframework in Embed Frameworks */,
79B8BE912FB7273600B94C6F /* ReactNativeDependencies.xcframework in Embed Frameworks */,
79B8BE922FB7273600B94C6F /* BrownfieldNavigation.xcframework in Embed Frameworks */,
79B8BE932FB7273600B94C6F /* hermesvm.xcframework in Embed Frameworks */,
79B8BE942FB7273600B94C6F /* BrownfieldLib.xcframework in Embed Frameworks */,
79B8BE952FB7273600B94C6F /* React.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
Comment on lines 36 to 41
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
795327752FB4A905008398F3 /* Brownie.xcframework in Frameworks */,
795327732FB4A904008398F3 /* BrownfieldNavigation.xcframework in Frameworks */,
7953277D2FB4A90A008398F3 /* ReactNativeDependencies.xcframework in Frameworks */,
795327772FB4A906008398F3 /* hermesvm.xcframework in Frameworks */,
7953277B2FB4A909008398F3 /* ReactBrownfield.xcframework in Frameworks */,
795327712FB4A902008398F3 /* BrownfieldLib.xcframework in Frameworks */,
795327792FB4A908008398F3 /* React.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
79B8BE6A2FB7270E00B94C6F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
79B8BE6B2FB7270E00B94C6F /* Brownie.xcframework in Frameworks */,
79B8BE6C2FB7270E00B94C6F /* BrownfieldNavigation.xcframework in Frameworks */,
79B8BE6E2FB7270E00B94C6F /* hermesvm.xcframework in Frameworks */,
79B8BE6F2FB7270E00B94C6F /* ReactBrownfield.xcframework in Frameworks */,
79B8BE702FB7270E00B94C6F /* BrownfieldLib.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
79B8BE852FB7273600B94C6F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
79B8BE862FB7273600B94C6F /* Brownie.xcframework in Frameworks */,
79B8BE872FB7273600B94C6F /* BrownfieldNavigation.xcframework in Frameworks */,
79B8BE882FB7273600B94C6F /* ReactNativeDependencies.xcframework in Frameworks */,
79B8BE892FB7273600B94C6F /* hermesvm.xcframework in Frameworks */,
79B8BE8A2FB7273600B94C6F /* ReactBrownfield.xcframework in Frameworks */,
79B8BE8B2FB7273600B94C6F /* BrownfieldLib.xcframework in Frameworks */,
79B8BE8C2FB7273600B94C6F /* React.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Comment on lines 123 to 126
targets = (
793C76A62EEBF938008A2A34 /* Brownfield Apple App (RNApp) */,
79B8BE682FB7270E00B94C6F /* Brownfield Apple App (ExpoApp54) */,
79B8BE832FB7273600B94C6F /* Brownfield Apple App (ExpoApp55) */,
793C76A62EEBF938008A2A34 /* Brownfield Apple App */,
);
};
Copy link
Copy Markdown
Collaborator

@artus9033 artus9033 left a comment

Choose a reason for hiding this comment

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

Great job! Left a few comments, also resolved false positives from copilot.

Comment thread .github/workflows/ci.yml
Comment on lines +249 to +253
- name: Run RNApp -> AppleApp road test (Rock)
uses: ./.github/actions/appleapp-road-test
with:
variant: rock
rn-project-path: apps/RockApp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Juozas-Petkelis shouldn't we use the Rock CLI for packaging it + installing Pods?

Comment thread CONTRIBUTING.md
- `build:example:ios-consumer:expo55` - builds the `Brownfield Apple App (ExpoApp55)` target via scheme **Brownfield Apple App Expo 55** (`Release`)
- `build:example:ios-consumer:expo54` - builds the `Brownfield Apple App (ExpoApp54)` target via scheme **Brownfield Apple App Expo 54** (`Release`)
- `build:example:ios-consumer:vanilla` - builds the `Brownfield Apple App (RNApp)` target via scheme **Brownfield Apple App Vanilla** (`Release Vanilla`)
- `build:example:ios-consumer:rock` - builds the `Brownfield Apple App (Rock)` target via scheme **Brownfield Apple App Vanilla** (`Release Rock`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This needs adjustment. I'm also wondering if just for clarity we should not just duplicate the Release Vanilla to Release Rock + update for coherence. WDYT @hurali97 ?

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.

4 participants