Skip to content

Commit 184fc43

Browse files
committed
migrated to pnpm
1 parent a7cc35a commit 184fc43

File tree

12 files changed

+9697
-14716
lines changed

12 files changed

+9697
-14716
lines changed

.github/workflows/check.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
24+
- uses: pnpm/action-setup@v4
25+
name: Install pnpm
26+
with:
27+
version: 'latest'
28+
run_install: false
2429
- uses: actions/setup-node@v4
2530
with:
2631
node-version: lts/jod
27-
- run: npm ci
28-
- run: npm run lint
32+
- run: pnpm install --frozen-lockfile
33+
- run: pnpm lint
2934
unit-tests:
3035
strategy:
3136
fail-fast: false
@@ -38,6 +43,11 @@ jobs:
3843
name: Unit tests (${{ matrix.runner }})
3944
steps:
4045
- uses: actions/checkout@v4
46+
- uses: pnpm/action-setup@v4
47+
name: Install pnpm
48+
with:
49+
version: 'latest'
50+
run_install: false
4151
- uses: actions/setup-node@v4
4252
with:
4353
node-version: lts/jod
@@ -51,15 +61,20 @@ jobs:
5161
with:
5262
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
5363
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
54-
- run: npm ci
55-
- run: npm run bootstrap
56-
- run: npm test
64+
- run: pnpm install --frozen-lockfile
65+
- run: pnpm bootstrap
66+
- run: pnpm test
5767
test-ios:
5868
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Apple 🍎')
5969
name: Test app (iOS)
6070
runs-on: macos-latest
6171
steps:
6272
- uses: actions/checkout@v4
73+
- uses: pnpm/action-setup@v4
74+
name: Install pnpm
75+
with:
76+
version: 'latest'
77+
run_install: false
6378
- uses: actions/setup-node@v4
6479
with:
6580
node-version: lts/jod
@@ -73,24 +88,29 @@ jobs:
7388
with:
7489
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
7590
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
76-
- run: npm ci
77-
- run: npm run bootstrap
91+
- run: pnpm install --frozen-lockfile
92+
- run: pnpm bootstrap
7893
env:
7994
CMAKE_RN_TARGETS: arm64-apple-ios-sim
8095
FERRIC_TARGETS: aarch64-apple-ios-sim
81-
- run: npm run pod-install
96+
- run: pnpm pod-install
8297
working-directory: apps/test-app
8398
- name: Run tests (iOS)
84-
run: npm run test:ios:allTests
99+
run: pnpm test:ios:allTests
85100
# TODO: Enable release mode when it works
86-
# run: npm run test:ios -- --mode Release
101+
# run: pnpm test:ios -- --mode Release
87102
working-directory: apps/test-app
88103
test-android:
89104
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Android 🤖')
90105
name: Test app (Android)
91106
runs-on: ubuntu-latest
92107
steps:
93108
- uses: actions/checkout@v4
109+
- uses: pnpm/action-setup@v4
110+
name: Install pnpm
111+
with:
112+
version: 'latest'
113+
run_install: false
94114
- uses: actions/setup-node@v4
95115
with:
96116
node-version: lts/jod
@@ -104,8 +124,8 @@ jobs:
104124
with:
105125
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
106126
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
107-
- run: npm ci
108-
- run: npm run bootstrap
127+
- run: pnpm install --frozen-lockfile
128+
- run: pnpm bootstrap
109129
env:
110130
CMAKE_RN_TARGETS: i686-linux-android
111131
FERRIC_TARGETS: i686-linux-android
@@ -130,10 +150,10 @@ jobs:
130150
sudo udevadm control --reload-rules
131151
sudo udevadm trigger --name-match=kvm
132152
- name: Build weak-node-api for all architectures
133-
run: npm run build-weak-node-api -- --android
153+
run: pnpm build-weak-node-api -- --android
134154
working-directory: packages/host
135155
- name: Build ferric-example for all architectures
136-
run: npm run build -- --android
156+
run: pnpm build -- --android
137157
working-directory: packages/ferric-example
138158
- name: Run tests (Android)
139159
timeout-minutes: 75
@@ -156,7 +176,7 @@ jobs:
156176
adb logcat > emulator-logcat.txt 2>&1 &
157177
LOGCAT_PID=$!
158178
# Build, install and run the app
159-
npm run test:android:allTests -- --mode Release
179+
pnpm test:android:allTests -- --mode Release
160180
# Wait a bit for the sub-process to terminate, before terminating the emulator
161181
sleep 5
162182
# Stop logcat

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ jobs:
1717
runs-on: macos-latest
1818
steps:
1919
- uses: actions/checkout@v4
20+
- uses: pnpm/action-setup@v4
21+
name: Install pnpm
22+
with:
23+
version: 'latest'
24+
run_install: false
2025
- uses: actions/setup-node@v4
2126
with:
2227
node-version: lts/jod
28+
cache: "pnpm"
2329
- name: Set up JDK 17
2430
uses: actions/setup-java@v3
2531
with:
@@ -30,13 +36,13 @@ jobs:
3036
with:
3137
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
3238
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
33-
- run: npm ci
39+
- run: pnpm install --frozen-lockfile
3440

3541
- name: Create Release Pull Request or Publish to npm
3642
id: changesets
3743
uses: changesets/action@v1
3844
with:
39-
publish: npm run release
45+
publish: pnpm release
4046
env:
4147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4248
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

apps/test-app/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"ios": "react-native run-ios --no-packager",
99
"pod-install": "cd ios && pod install",
1010
"test:android": "mocha-remote --exit-on-error -- concurrently --kill-others-on-fail --passthrough-arguments npm:metro 'npm:android -- {@}' --",
11-
"test:android:allTests": "MOCHA_REMOTE_CONTEXT=allTests npm run test:android -- ",
12-
"test:android:nodeAddonExamples": "MOCHA_REMOTE_CONTEXT=nodeAddonExamples npm run test:android -- ",
13-
"test:android:ferricExample": "MOCHA_REMOTE_CONTEXT=ferricExample npm run test:android -- ",
11+
"test:android:allTests": "MOCHA_REMOTE_CONTEXT=allTests pnpm test:android -- ",
12+
"test:android:nodeAddonExamples": "MOCHA_REMOTE_CONTEXT=nodeAddonExamples pnpm test:android -- ",
13+
"test:android:ferricExample": "MOCHA_REMOTE_CONTEXT=ferricExample pnpm test:android -- ",
1414
"test:ios": "mocha-remote --exit-on-error -- concurrently --passthrough-arguments --kill-others-on-fail npm:metro 'npm:ios -- {@}' --",
15-
"test:ios:allTests": "MOCHA_REMOTE_CONTEXT=allTests npm run test:ios -- ",
16-
"test:ios:nodeAddonExamples": "MOCHA_REMOTE_CONTEXT=nodeAddonExamples npm run test:ios -- ",
17-
"test:ios:ferricExample": "MOCHA_REMOTE_CONTEXT=ferricExample npm run test:ios -- "
15+
"test:ios:allTests": "MOCHA_REMOTE_CONTEXT=allTests pnpm test:ios -- ",
16+
"test:ios:nodeAddonExamples": "MOCHA_REMOTE_CONTEXT=nodeAddonExamples pnpm test:ios -- ",
17+
"test:ios:ferricExample": "MOCHA_REMOTE_CONTEXT=ferricExample pnpm test:ios -- "
1818
},
1919
"dependencies": {
2020
"@babel/core": "^7.26.10",
@@ -30,14 +30,14 @@
3030
"@types/mocha": "^10.0.10",
3131
"@types/react": "^19.0.0",
3232
"concurrently": "^9.1.2",
33-
"ferric-example": "^0.1.0",
33+
"@react-native-node-api/ferric-example": "workspace:*",
3434
"mocha": "^11.6.0",
3535
"mocha-remote-cli": "^1.13.2",
3636
"mocha-remote-react-native": "^1.13.2",
3737
"react": "19.0.0",
3838
"react-native": "0.79.5",
39-
"react-native-node-addon-examples": "*",
40-
"react-native-node-api": "*",
39+
"@react-native-node-api/node-addon-examples": "workspace:*",
40+
"react-native-node-api": "workspace:*",
4141
"react-native-test-app": "^4.3.3"
4242
}
4343
}

0 commit comments

Comments
 (0)