Skip to content

Commit d47173d

Browse files
feat: rework monorepo with Turborepo; update example apps and CI pipelines (#171)
* chore: move RN CLI example app to dedicated folder * feat: bootstrap CLI & add Android commands * docs: added CLI docs * fix: update path to root project in metro and react-native config files * chore: upgraded pods in example app * feat: ios support PoC using Rock utilities * chore: bootstrap new RN app with RN CLI * feat: integrate brownfield into demo Android RN app * chore: bootstrap demo android app * feat: integrate brownfield RN lib into demo native Android app * ci: added CI for new Android app * docs: updated links to apps in docs * chore: bootstrap demo iOS app * feat: added brownfield framework target to RN iOS app * ci: added pipeline for new iOS app * feat: better logging in verbose mode in the CLI * feat: cleanup cli flags for CLI * chore: re-add brownfield target to RN iOS project * chore: use static frameworks in RN iOS app * fix: cli for iOS * chore: deintegrate old, obsolete example app * docs: added README in example/ directory * chore: static frameworks in RNApp * feat: pod install in CLI * feat: simplify iOS CLI logic, add xcframework merging * feat: integrate brownfield with demo iOS app * feat: new, nicer UI in demo Android app * ci: build Release variants * chore: remove obsolete tag in AndroidManifest.xml * chore: move cli sources and configuration after merge * chore: proper turborepo configuration * chore: provide brownfield bin * fix(ci): fix ci * fix: paths in demo RNApp configuration * fix: respect --no-install-pods CLI option * ci: merge workflows * ci: build iOS Release configuration * chore: remove yarn.lock in RNApp * chore: rename CI workflow, add badge to README.md * chore: move tester app, reorganize CI workflow * fix(ci): fix CLI commands in CI * fix(ci): use first available iOS simulator * fix(ci): right path to the CLI * fix(ci): use any iOS target * fix(ci): proper native app build commands * chore: add android / ios scripts to run the RN app * chore: rework turbo repo config * chore: add CONTRIBUTING.md and describe demo apps in docs * ci: use Turbo tasks instead of manual commands * ci: cache Turbo caches on GH Actions * fix: move build:brownfield task to turbo repo root * fix: iOS app script name * ci: build framework only for iphoneos to speed up * ci: build iOS artifact for iphonesimulator to match consumer app destination * chore: add linting of gradle plugins to the lint job * fix: add eslint dev-dependency to react-native-brownfield * chore: deintegrate CLI from this PR * ci: cache tester app in CI * chore: remove cli bin entry from yarn.lock * chore: rename tester-integrated directory to TesterIntegrated * chore: embed frameworks in Apple example app * fix(ci): fix caching keys * ci: rename caching steps * ci: cache gradle files * chore: enable ccache in Podfiles * chore: separate script for linting gradle plugin sources * ci: deintegrate iOS build caching that does not bring boost * chore: deintegrate CLI docs * ci: set concurrency rule to stop outdated running tasks * fix: typo in apps/README.md Co-authored-by: Oskar Kwaśniewski <oskarkwasniewski@icloud.com> * chore: remove leftover CLI dependencies * ci: pin action commit checksums, validate gradle wrapper in android CI --------- Co-authored-by: Oskar Kwaśniewski <oskarkwasniewski@icloud.com>
1 parent a4da8e1 commit d47173d

File tree

198 files changed

+8947
-625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+8947
-625
lines changed

.github/actions/setup/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v4
8+
uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6
99
with:
1010
node-version: 'lts/*'
1111
cache: 'yarn'
1212

13+
- name: Restore turbo cache
14+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
15+
with:
16+
path: |
17+
.turbo
18+
apps/*/.turbo
19+
packages/*/.turbo
20+
key: ${{ runner.os }}-turbo-${{ hashFiles('.turbo', '**/.turbo') }}
21+
restore-keys: |
22+
${{ runner.os }}-turbo-
23+
1324
- name: Install dependencies
1425
run: yarn install
1526
shell: bash

.github/workflows/build.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,130 @@ on:
66
pull_request:
77
branches: [main]
88

9+
concurrency:
10+
group: pr-${{ github.event.pull_request.number }}
11+
cancel-in-progress: true
12+
913
jobs:
10-
lint:
14+
build-lint:
15+
name: Build & static code analysis
1116
runs-on: ubuntu-latest
1217
steps:
1318
- name: Checkout
14-
uses: actions/checkout@v4
19+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1520

1621
- name: Setup
1722
uses: ./.github/actions/setup
1823

19-
- name: Build package
24+
- name: Build packages
2025
run: yarn build
2126

2227
- name: Lint files
2328
run: yarn lint
2429

2530
- name: Typecheck files
2631
run: yarn typecheck
32+
33+
tester-android:
34+
name: Integrated tester Android App
35+
runs-on: ubuntu-latest
36+
needs: build-lint
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
41+
42+
- name: Validate Gradle Wrapper
43+
uses: gradle/actions/wrapper-validation@6f229686ee4375cc4a86b2514c89bac4930e82c4 # v5
44+
45+
- name: Setup Java
46+
uses: actions/setup-java@5d7b2146334bacf88728daaa70414a99f5164e0f # v5
47+
with:
48+
distribution: 'zulu'
49+
java-version: '17'
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6
53+
with:
54+
node-version: 'lts/*'
55+
cache: 'yarn'
56+
57+
- name: Install dependencies
58+
run: yarn install
59+
60+
- name: Build packages
61+
run: yarn build
62+
63+
- name: Restore android build cache
64+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
65+
with:
66+
path: |
67+
apps/TesterIntegrated/kotlin/build
68+
apps/TesterIntegrated/kotlin/app/.cxx
69+
apps/TesterIntegrated/kotlin/app/build
70+
key: ${{ runner.os }}-tester-android-build-${{ github.sha }}
71+
restore-keys: |
72+
${{ runner.os }}-tester-android-build-
73+
74+
- name: Resture Gradle cache
75+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
76+
with:
77+
path: |
78+
~/.gradle/caches
79+
~/.gradle/wrapper
80+
key: ${{ runner.os }}-tester-integrated-android-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
81+
restore-keys: |
82+
${{ runner.os }}-tester-integrated-android-gradle-
83+
84+
- name: Build integrated Android tester app
85+
run: yarn run build:tester-integrated:android
86+
87+
tester-ios:
88+
name: Integrated tester iOS App
89+
runs-on: macos-latest
90+
needs: build-lint
91+
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
95+
96+
- name: Use appropriate Xcode version
97+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
98+
with:
99+
xcode-version: '16'
100+
101+
- name: Setup Node.js
102+
uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6
103+
with:
104+
node-version: 'lts/*'
105+
cache: 'yarn'
106+
107+
- name: Setup Ruby
108+
uses: ruby/setup-ruby@5dd816ae0186f20dfa905997a64104db9a8221c7 # v1.280.0
109+
with:
110+
ruby-version: '3.2'
111+
bundler-cache: true
112+
113+
- name: Install dependencies
114+
run: yarn install
115+
116+
- name: Build packages
117+
run: yarn build
118+
119+
- name: Restore Pods cache
120+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
121+
with:
122+
path: |
123+
apps/TesterIntegrated/swift/Pods
124+
key: ${{ runner.os }}-tester-ios-pods-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock') }}
125+
restore-keys: |
126+
${{ runner.os }}-tester-ios-pods-
127+
128+
- name: Install pods
129+
run: |
130+
cd apps/TesterIntegrated/swift
131+
pod install
132+
133+
- name: Build integrated iOS tester app
134+
run: |
135+
yarn run build:tester-integrated:ios

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2525
with:
2626
fetch-depth: 0 # Not needed if lastUpdated is not enabled
2727
- name: Setup
2828
uses: ./.github/actions/setup
2929

3030
- name: Setup Pages
31-
uses: actions/configure-pages@v5
31+
uses: actions/configure-pages@d5606572c479bee637007364c6b4800ac4fc8573 # v5
3232

3333
- name: Install dependencies
3434
working-directory: docs
@@ -40,7 +40,7 @@ jobs:
4040
yarn run build
4141
4242
- name: Upload artifact
43-
uses: actions/upload-pages-artifact@v3
43+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
4444
with:
4545
path: docs/doc_build
4646

@@ -55,4 +55,4 @@ jobs:
5555
steps:
5656
- name: Deploy to GitHub Pages
5757
id: deployment
58-
uses: actions/deploy-pages@v4
58+
uses: actions/deploy-pages@854d7aa1b99e4509c4d1b53d69b7ba4eaf39215a # v4.0.5

.github/workflows/gradle-plugin-lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: ktlint and detekt
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ['main']
66
pull_request:
77
branches: [main]
88

@@ -13,19 +13,19 @@ jobs:
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1717

1818
- name: Validate Gradle Wrapper
19-
uses: gradle/wrapper-validation-action@v2
19+
uses: gradle/actions/wrapper-validation@6f229686ee4375cc4a86b2514c89bac4930e82c4 # v5
2020

2121
- name: Set up JDK
22-
uses: actions/setup-java@v4
22+
uses: actions/setup-java@5d7b2146334bacf88728daaa70414a99f5164e0f # v5
2323
with:
2424
distribution: temurin
2525
java-version: 17
2626

27-
- name: Cache Gradle
28-
uses: actions/cache@v4
27+
- name: Restore Gradle cache
28+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
2929
with:
3030
path: |
3131
~/.gradle/caches

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to React Native Brownfield
2+
3+
## Project setup
4+
5+
Run `yarn` in the root of the repository to install all dependencies.
6+
7+
Depending on your needs, you may need to install CocoaPods in a subset of the below directories:
8+
- example React Native iOS app: `cd apps/RNApp/ios && pod install`
9+
- integrated iOS tester app: `cd apps/TesterIntegrated/swift && pod install`
10+
11+
## Scripts
12+
13+
- `lint` - runs linting on all JS/TS source files in the monorepo *[Turbo]*
14+
- `gradle-plugin:lint` - runs linting on the Brownfield Gradle plugin source code
15+
- `typecheck` - runs TypeScript type checking on all TS source files in the monorepo *[Turbo]*
16+
- `build` - runs all `build*` tasks in the Turbo repo - see below for more details *[Turbo]*
17+
- `release` - releases a new version of React Native Brownfield package using `release-it`
18+
- `brownfield:plugin:publish:local` - publishes the Brownfield Gradle plugin to your local Maven repository for testing purposes
19+
- `build:brownfield` - builds the React Native Brownfield package (`packages/react-native-brownfield`) *[Turbo]*
20+
- `build:docs` - builds the documentation site (`docs/`) *[Turbo]*
21+
- `build:tester-integrated:android` - builds the Android integrated tester app (`apps/TesterIntegrated/android`) *[Turbo]*
22+
- `build:tester-integrated:ios` - builds the iOS integrated tester app (`apps/TesterIntegrated/swift`) *[Turbo]*
23+
- `build:example:android-rn` - builds the example React Native app for Android (`apps/RNApp/android`) *[Turbo]*
24+
- `build:example:ios-rn` - builds the example React Native app for iOS (`apps/RNApp/ios`) *[Turbo]*
25+
- `build:example:android-consumer` - builds the example native Android consumer app (`apps/AndroidApp`) *[Turbo]*
26+
- `build:example:ios-consumer` - builds the example native Apple consumer app (`apps/AppleApp`) *[Turbo]*

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ This project follows the [all-contributors](https://github.com/kentcdodds/all-co
6262

6363
[build-badge]: https://img.shields.io/circleci/build/github/callstack/react-native-brownfield/master.svg?style=flat-square
6464
[build]: https://circleci.com/gh/callstack/react-native-brownfield
65+
[ci]: https://github.com/callstack/react-native-brownfield/actions/workflows/ci.yml/badge.svg
6566
[version-badge]: https://img.shields.io/npm/v/@callstack/react-native-brownfield.svg?style=flat-square
6667
[package]: https://www.npmjs.com/package/@callstack/react-native-brownfield
6768
[license-badge]: https://img.shields.io/npm/l/@callstack/react-native-brownfield.svg?style=flat-square

apps/AndroidApp/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

apps/AndroidApp/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)