Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: monorepo setup with bun #3249

Merged
merged 26 commits into from
Oct 30, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ body:
attributes:
label: Can you reproduce this issue in the VisionCamera Example app?
description: >
Try to build the example app (`package/example/`) and see if the issue is reproduceable here.
Try to build the example app (`example/`) and see if the issue is reproduceable here.
**Note:** If you don't try this in the example app, I most likely won't help you with your issue.
options:
- I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUILD_ERROR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ body:
attributes:
label: Can you build the VisionCamera Example app?
description: >
Try to build the example app (`package/example/`) and see if the issue is reproduceable here.
Try to build the example app (`example/`) and see if the issue is reproduceable here.
**Note:** If you don't try to build the example app, I most likely won't help you with your issue.
options:
- I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ updates:
# - "🛠 dependencies"
# - "☕️ js"
# - package-ecosystem: "npm"
# directory: "/package/example/"
# directory: "/example/"
# schedule:
# interval: "monthly"
# labels:
Expand Down
78 changes: 26 additions & 52 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,37 @@ on:
branches:
- main
paths:
- '.github/workflows/build-android.yml'
- 'package/android/**'
- 'package/example/android/**'
- 'package/yarn.lock'
- 'package/example/yarn.lock'
- ".github/workflows/build-android.yml"
- "package/android/**"
- "example/android/**"
- "package/bun.lockb"
- "example/bun.lockb"
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'package/android/**'
- 'package/example/android/**'
- 'package/yarn.lock'
- 'package/example/yarn.lock'
- ".github/workflows/build-android.yml"
- "package/android/**"
- "example/android/**"
- "package/bun.lockb"
- "example/bun.lockb"

jobs:
build:
name: Build Android Example App
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./package
steps:
- uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: "zulu"
java-version: 17
java-package: jdk

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-with-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-with-fps-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install

- name: Restore Gradle cache
uses: actions/cache@v4
Expand All @@ -60,45 +46,33 @@ jobs:
restore-keys: |
${{ runner.os }}-with-fps-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug --no-daemon --build-cache && cd ../..
run: cd example/android && ./gradlew assembleDebug --no-daemon --build-cache

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
run: cd android && ./gradlew --stop
run: cd example/android && ./gradlew --stop

build-no-frame-processors:
name: Build Android Example App (without Frame Processors)
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./package
steps:
- uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: "zulu"
java-version: 17
java-package: jdk

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-without-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-without-fps-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install
- name: Remove worklets, skia and reanimated
run: yarn remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd example
run: |
bun remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd example
bun remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated

- name: Restore Gradle cache
uses: actions/cache@v4
Expand All @@ -113,4 +87,4 @@ jobs:

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
run: cd android && ./gradlew --stop
run: cd example/android && ./gradlew --stop
66 changes: 25 additions & 41 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,31 @@ on:
branches:
- main
paths:
- '.github/workflows/build-ios.yml'
- 'package/ios/**'
- 'package/*.podspec'
- 'package/example/ios/**'
- ".github/workflows/build-ios.yml"
- "package/ios/**"
- "package/*.podspec"
- "example/ios/**"
pull_request:
paths:
- '.github/workflows/build-ios.yml'
- 'package/ios/**'
- 'package/*.podspec'
- 'package/example/ios/**'
- ".github/workflows/build-ios.yml"
- "package/ios/**"
- "package/*.podspec"
- "example/ios/**"

jobs:
build:
name: Build iOS Example App
runs-on: macOS-latest
defaults:
run:
working-directory: package/example/ios
working-directory: example/ios
steps:
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-with-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-with-fps-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: cd ../../ && bun install

- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
Expand All @@ -49,12 +40,12 @@ jobs:
with:
ruby-version: 2.7.2
bundler-cache: true
working-directory: package/example/ios
working-directory: example/ios

- name: Restore Pods cache
uses: actions/cache@v4
with:
path: package/example/ios/Pods
path: example/ios/Pods
key: ${{ runner.os }}-with-fps-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-with-fps-pods-
Expand All @@ -79,25 +70,18 @@ jobs:
runs-on: macOS-latest
defaults:
run:
working-directory: package/example/ios
working-directory: example/ios
steps:
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-without-fps-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-without-fps-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: cd ../../ && bun install
- name: Remove worklets, skia and reanimated
run: yarn remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd ..
run: |
bun remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd ..
bun remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd ../../package

- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
Expand All @@ -108,12 +92,12 @@ jobs:
with:
ruby-version: 2.7.2
bundler-cache: true
working-directory: package/example/ios
working-directory: example/ios

- name: Restore Pods cache
uses: actions/cache@v4
with:
path: package/example/ios/Pods
path: example/ios/Pods
key: ${{ runner.os }}-without-fps-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-without-fps-pods-
Expand Down
Loading
Loading