feat: add example Rock app#338
Conversation
85a2e8f to
3295c91
Compare
3295c91 to
8fc61fb
Compare
|
Removed |
There was a problem hiding this comment.
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-sharedand updatesapps/RNAppto 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-columnScrollViewcontent container (it only affects multi-line flex-wrap layouts). Since the previousViewcontainer usedalignItems: '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 unlessprepareXCFrameworks.jshas 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.
| - `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`) |
There was a problem hiding this comment.
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 ?
| 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 = ( |
| 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 = ( |
| - name: Run RNApp -> AppleApp road test (Rock) | ||
| uses: ./.github/actions/appleapp-road-test | ||
| with: | ||
| variant: rock | ||
| rn-project-path: apps/RockApp |
There was a problem hiding this comment.
@Juozas-Petkelis shouldn't we use the Rock CLI for packaging it + installing Pods?
| 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"; |
| 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; | ||
| }; |
| targets = ( | ||
| 793C76A62EEBF938008A2A34 /* Brownfield Apple App (RNApp) */, | ||
| 79B8BE682FB7270E00B94C6F /* Brownfield Apple App (ExpoApp54) */, | ||
| 79B8BE832FB7273600B94C6F /* Brownfield Apple App (ExpoApp55) */, | ||
| 793C76A62EEBF938008A2A34 /* Brownfield Apple App */, | ||
| ); | ||
| }; |
artus9033
left a comment
There was a problem hiding this comment.
Great job! Left a few comments, also resolved false positives from copilot.
| - name: Run RNApp -> AppleApp road test (Rock) | ||
| uses: ./.github/actions/appleapp-road-test | ||
| with: | ||
| variant: rock | ||
| rn-project-path: apps/RockApp |
There was a problem hiding this comment.
@Juozas-Petkelis shouldn't we use the Rock CLI for packaging it + installing Pods?
| - `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`) |
There was a problem hiding this comment.
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 ?
Summary
Add a demo app & CLI support for Rock
This PR:
Creates new example app for Rock
yarn create rockin package RockAppBrownfield Apple App Rockfor iOS consumer appbrownfield-example-sharedpackage for RNApp and RockApp example appsWrapped container in a
ScrollViewto fix the native message list being cut offRefactored "Send message to Native" button to the
<Button />component to look and behave the same as other buttonsHome screen before and after
Adjust actions and CI to support Rock
Test plan
iOS
yarnin the root of the repository to install all dependenciesapps/RockApp/iosrunpod installapps/RockApprunyarn brownfield:package:iosapps/AppleApprunyarn build:example:ios-consumer:rockBrownfield Apple App RockschemaAndroid
yarnin the root of the repository to install all dependenciesapps/RockApprunyarn brownfield:package:androidandyarn brownfield:publish:androidRock example App