Skip to content

Commit 4b73727

Browse files
authored
Migrate to yarn workspace (#91)
1 parent cdc7ccc commit 4b73727

File tree

423 files changed

+2470
-1541
lines changed

Some content is hidden

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

423 files changed

+2470
-1541
lines changed

.eslintrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "react-native-wcandillon",
3+
"ignorePatterns": ["**/*/components/meshes"],
4+
"rules": {
5+
"no-bitwise": "off",
6+
"@typescript-eslint/no-require-imports": "off"
7+
}
8+
}

.github/actions/setup/action.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Setup Node.js
1313
uses: actions/setup-node@v3
1414
with:
15-
node-version-file: package/.nvmrc
15+
node-version-file: .nvmrc
1616

1717
- name: Cache dependencies
1818
id: yarn-cache
@@ -29,7 +29,6 @@ runs:
2929
- name: Install dependencies
3030
if: steps.yarn-cache.outputs.cache-hit != 'true'
3131
run: yarn install --immutable
32-
working-directory: package
3332
shell: bash
3433

3534
- name: Download Dawn Binary Artifacts
@@ -43,6 +42,6 @@ runs:
4342
name: dawn-libs
4443

4544
- name: Copy Artifacts to libs folder
46-
working-directory: package
45+
working-directory: packages/webgpu
4746
shell: bash
4847
run: yarn copy-artifacts

.github/workflows/build-dawn.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
build:
55
runs-on: macos-latest
66
env:
7-
WORKING_DIRECTORY: ./package
7+
WORKING_DIRECTORY: ./packages/webgpu
88
steps:
99
- name: checkout
1010
uses: actions/checkout@v2
@@ -23,11 +23,10 @@ jobs:
2323
- uses: actions/setup-node@v3
2424
with:
2525
cache: 'yarn'
26-
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/yarn.lock
26+
cache-dependency-path: yarn.lock
2727

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

3231
- name: Build Dawn
3332
working-directory: ${{ env.WORKING_DIRECTORY }}

.github/workflows/ci.yml

+12-16
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ concurrency:
1010
jobs:
1111
lint:
1212
runs-on: ubuntu-latest
13-
defaults:
14-
run:
15-
working-directory: package
1613
steps:
1714
- name: Checkout
1815
uses: actions/checkout@v3
@@ -23,19 +20,21 @@ jobs:
2320
github_token: ${{ secrets.GITHUB_TOKEN }}
2421

2522
- name: Clang Format
23+
working-directory: packages/webgpu
2624
run: yarn clang-format
2725

2826
- name: Lint files
2927
run: yarn lint
3028

3129
- name: Typecheck files
30+
working-directory: packages/webgpu
3231
run: yarn tsc
3332

3433
test:
3534
runs-on: ubuntu-latest
3635
defaults:
3736
run:
38-
working-directory: package
37+
working-directory: packages/webgpu
3938
steps:
4039
- name: Checkout
4140
uses: actions/checkout@v3
@@ -52,7 +51,7 @@ jobs:
5251
runs-on: ubuntu-latest
5352
defaults:
5453
run:
55-
working-directory: package
54+
working-directory: packages/webgpu
5655
steps:
5756
- name: Checkout
5857
uses: actions/checkout@v3
@@ -67,9 +66,6 @@ jobs:
6766

6867
build-android:
6968
runs-on: macos-latest
70-
defaults:
71-
run:
72-
working-directory: package
7369
env:
7470
TURBO_CACHE_DIR: .turbo/android
7571
steps:
@@ -119,28 +115,28 @@ jobs:
119115
run: |
120116
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
121117
118+
- name: Install Android SDK
119+
run: echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
120+
122121
- name: Cache Gradle
123122
if: env.turbo_cache_hit != 1
124123
uses: actions/cache@v3
125124
with:
126125
path: |
127126
~/.gradle/wrapper
128127
~/.gradle/caches
129-
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
128+
key: ${{ runner.os }}-gradle-${{ hashFiles('./apps/paper/android/gradle/wrapper/gradle-wrapper.properties') }}
130129
restore-keys: |
131130
${{ runner.os }}-gradle-
132131
133132
- name: Build example for Android
134133
env:
135134
JAVA_OPTS: "-XX:MaxHeapSize=6g"
136135
run: |
137-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
136+
yarn build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
138137
139138
build-ios:
140139
runs-on: macos-latest
141-
defaults:
142-
run:
143-
working-directory: package
144140
env:
145141
TURBO_CACHE_DIR: .turbo/ios
146142
steps:
@@ -163,7 +159,7 @@ jobs:
163159
name: dawn-libs
164160

165161
- name: Copy Artifacts to libs folder
166-
working-directory: package
162+
working-directory: packages/webgpu
167163
run: yarn copy-artifacts
168164

169165
- name: Cache turborepo for iOS
@@ -189,14 +185,14 @@ jobs:
189185
with:
190186
path: |
191187
**/ios/Pods
192-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
188+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('./apps/paper/ios/Podfile.lock') }}
193189
restore-keys: |
194190
${{ runner.os }}-cocoapods-
195191
196192
- name: Install cocoapods
197193
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
198194
run: |
199-
cd example/ios
195+
cd apps/paper/ios
200196
pod install
201197
env:
202198
NO_FLIPPER: 1

.gitignore

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Yarn
2+
.yarn/*
3+
!.yarn/patches
4+
!.yarn/plugins
5+
!.yarn/releases
6+
!.yarn/sdks
7+
!.yarn/versions
8+
9+
#apps/*/ios
10+
#apps/*/android
11+
112
# OSX
213
#
314
.DS_Store
@@ -39,11 +50,6 @@ local.properties
3950
# Legacy Eclipse Settings
4051
.settings/
4152

42-
# Externals
43-
libs
44-
package/cpp/dawn/
45-
package/cpp/webgpu/
46-
4753
# BUCK
4854
buck-out/
4955
\.buckd/
@@ -53,5 +59,21 @@ buck-out/
5359
dist
5460
package/lib
5561
.vscode
56-
!package/script/build
5762
*.tgz
63+
64+
65+
# Externals
66+
packages/webgpu/libs
67+
packages/webgpu/cpp/dawn/
68+
packages/webgpu/cpp/webgpu/
69+
packages/webgpu/lib
70+
!packages/webgpu/scripts/build
71+
72+
73+
# Cocoapods
74+
#
75+
apps/paper/ios/Pods
76+
# Ruby
77+
apps/vendor/
78+
79+
.turbo

package/.nvmrc .nvmrc

File renamed without changes.

package/.yarn/releases/yarn-3.6.1.cjs .yarn/releases/yarn-3.6.4.cjs

+213-213
Large diffs are not rendered by default.

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.6.4.cjs

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Make sure you have all the tools required for building the Skia libraries (Andro
212212

213213
### Building
214214

215-
* `cd package && yarn`
215+
* `cd packages/webgpu && yarn`
216216
* `yarn build-dawn`
217217

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

224224
### Codegen
225225

226-
* `cd package && yarn codegen`
226+
* `cd packages/webgpu && yarn codegen`
227227

228228
### Testing
229229

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package/example/android/app/build.gradle apps/paper/android/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ react {
1111
// The root of your project, i.e. where "package.json" lives. Default is '..'
1212
root = file("../..")
1313
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
reactNativeDir = file("../../../node_modules/react-native")
14+
reactNativeDir = file("../../../../node_modules/react-native")
1515
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
codegenDir = file("../../../node_modules/@react-native/codegen")
16+
codegenDir = file("../../../../node_modules/@react-native/codegen")
1717
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
cliFile = file("../../../node_modules/react-native/cli.js")
18+
cliFile = file("../../../../node_modules/react-native/cli.js")
1919

2020
/* Variants */
2121
// The list of variants to that are debuggable. For those we're going to
@@ -116,4 +116,4 @@ dependencies {
116116
}
117117
}
118118

119-
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
119+
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.

0 commit comments

Comments
 (0)