Skip to content

Commit

Permalink
Migrate to yarn workspace (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Aug 29, 2024
1 parent cdc7ccc commit 4b73727
Show file tree
Hide file tree
Showing 423 changed files with 2,470 additions and 1,541 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "react-native-wcandillon",
"ignorePatterns": ["**/*/components/meshes"],
"rules": {
"no-bitwise": "off",
"@typescript-eslint/no-require-imports": "off"
}
}
5 changes: 2 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: package/.nvmrc
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
Expand All @@ -29,7 +29,6 @@ runs:
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: package
shell: bash

- name: Download Dawn Binary Artifacts
Expand All @@ -43,6 +42,6 @@ runs:
name: dawn-libs

- name: Copy Artifacts to libs folder
working-directory: package
working-directory: packages/webgpu
shell: bash
run: yarn copy-artifacts
5 changes: 2 additions & 3 deletions .github/workflows/build-dawn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
runs-on: macos-latest
env:
WORKING_DIRECTORY: ./package
WORKING_DIRECTORY: ./packages/webgpu
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -23,11 +23,10 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: 'yarn'
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/yarn.lock
cache-dependency-path: yarn.lock

- name: Install Package
run: yarn install --frozen-lockfile
working-directory: ${{ env.WORKING_DIRECTORY }}

- name: Build Dawn
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ concurrency:
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: package
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -23,19 +20,21 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Clang Format
working-directory: packages/webgpu
run: yarn clang-format

- name: Lint files
run: yarn lint

- name: Typecheck files
working-directory: packages/webgpu
run: yarn tsc

test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: package
working-directory: packages/webgpu
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -52,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: package
working-directory: packages/webgpu
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -67,9 +66,6 @@ jobs:

build-android:
runs-on: macos-latest
defaults:
run:
working-directory: package
env:
TURBO_CACHE_DIR: .turbo/android
steps:
Expand Down Expand Up @@ -119,28 +115,28 @@ jobs:
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Install Android SDK
run: echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('./apps/paper/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
build-ios:
runs-on: macos-latest
defaults:
run:
working-directory: package
env:
TURBO_CACHE_DIR: .turbo/ios
steps:
Expand All @@ -163,7 +159,7 @@ jobs:
name: dawn-libs

- name: Copy Artifacts to libs folder
working-directory: package
working-directory: packages/webgpu
run: yarn copy-artifacts

- name: Cache turborepo for iOS
Expand All @@ -189,14 +185,14 @@ jobs:
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
key: ${{ runner.os }}-cocoapods-${{ hashFiles('./apps/paper/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-
- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
cd apps/paper/ios
pod install
env:
NO_FLIPPER: 1
Expand Down
34 changes: 28 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

#apps/*/ios
#apps/*/android

# OSX
#
.DS_Store
Expand Down Expand Up @@ -39,11 +50,6 @@ local.properties
# Legacy Eclipse Settings
.settings/

# Externals
libs
package/cpp/dawn/
package/cpp/webgpu/

# BUCK
buck-out/
\.buckd/
Expand All @@ -53,5 +59,21 @@ buck-out/
dist
package/lib
.vscode
!package/script/build
*.tgz


# Externals
packages/webgpu/libs
packages/webgpu/cpp/dawn/
packages/webgpu/cpp/webgpu/
packages/webgpu/lib
!packages/webgpu/scripts/build


# Cocoapods
#
apps/paper/ios/Pods
# Ruby
apps/vendor/

.turbo
File renamed without changes.
426 changes: 213 additions & 213 deletions package/.yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs
100755 → 100644

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Make sure you have all the tools required for building the Skia libraries (Andro

### Building

* `cd package && yarn`
* `cd packages/webgpu && yarn`
* `yarn build-dawn`

### Upgrading
Expand All @@ -223,7 +223,7 @@ Make sure you have all the tools required for building the Skia libraries (Andro

### Codegen

* `cd package && yarn codegen`
* `cd packages/webgpu && yarn codegen`

### Testing

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ react {
// The root of your project, i.e. where "package.json" lives. Default is '..'
root = file("../..")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
reactNativeDir = file("../../../node_modules/react-native")
reactNativeDir = file("../../../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
codegenDir = file("../../../node_modules/@react-native/codegen")
codegenDir = file("../../../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
cliFile = file("../../../node_modules/react-native/cli.js")
cliFile = file("../../../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -116,4 +116,4 @@ dependencies {
}
}

apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4b73727

Please sign in to comment.