Skip to content

Commit 1c4e8d8

Browse files
authored
chore(lib): Migrate library to bun (#916)
1 parent 88f2361 commit 1c4e8d8

File tree

11 files changed

+48
-17246
lines changed

11 files changed

+48
-17246
lines changed

.github/workflows/android.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
avd-name: e2e_emulator
6363
arch: x86_64
6464
script: |
65-
bun run-example-android
65+
bun example:android:release
6666
bun test:e2e:android
6767
6868
- name: Upload report

.github/workflows/ios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Build iOS App
6262
run: |
63-
bun run-example-ios
63+
bun example:ios:release
6464
6565
- name: Run tests
6666
run: |

CONTRIBUTING.md

+26-18
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,58 @@ We want this community to be friendly and respectful to each other. Please follo
44

55
## Development workflow
66

7-
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
7+
To get started with the project, run `bun install` in the root directory to install the required dependencies for each package:
88

99
```sh
10-
yarn
10+
bun install
1111
```
1212

13-
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
13+
> While it's possible to use [`npm`](https://github.com/npm/cli) or [`yarn`](https://yarnpkg.com/cli), the tooling is built around [`bun`](https://bun.sh/), so you'll have an easier time if you use `bun` for development.
1414
1515
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
1616

17+
To install dependencies and pods in example directory:
18+
19+
```sh
20+
bun bootstrap
21+
```
22+
1723
To start the packager:
1824

1925
```sh
20-
yarn example start
26+
bun example:start
2127
```
2228

2329
To run the example app on Android:
2430

2531
```sh
26-
yarn example android
32+
bun example:android
2733
```
2834

2935
To run the example app on iOS:
3036

3137
```sh
32-
yarn example ios
38+
bun example:ios
3339
```
3440

3541

3642
Make sure your code passes TypeScript and ESLint. Run the following to verify:
3743

3844
```sh
39-
yarn typescript
40-
yarn lint
45+
bun typescript
46+
bun lint
4147
```
4248

4349
To fix formatting errors, run the following:
4450

4551
```sh
46-
yarn lint --fix
52+
bun lint --fix
4753
```
4854

4955
Remember to add tests for your change if possible. Run the unit tests by:
5056

5157
```sh
52-
yarn test
58+
bun test
5359
```
5460
To edit the Objective-C files, open `example/ios/PagerViewExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-pager-view`.
5561

@@ -82,20 +88,22 @@ We use [release-it](https://github.com/release-it/release-it) to make it easier
8288
To publish new versions, run the following:
8389

8490
```sh
85-
yarn release
91+
bun release
8692
```
8793

8894
### Scripts
8995

9096
The `package.json` file contains various scripts for common tasks:
9197

92-
- `yarn bootstrap`: setup project by installing all dependencies and pods.
93-
- `yarn typescript`: type-check files with TypeScript.
94-
- `yarn lint`: lint files with ESLint.
95-
- `yarn test`: run unit tests with Jest.
96-
- `yarn example start`: start the Metro server for the example app.
97-
- `yarn example android`: run the example app on Android.
98-
- `yarn example ios`: run the example app on iOS.
98+
- `bun bootstrap`: setup project by installing all dependencies and pods.
99+
- `bun typescript`: type-check files with TypeScript.
100+
- `bun lint`: lint files with ESLint.
101+
- `bun test`: run unit tests with Jest.
102+
- `bun example:start`: start the Metro server for the example app.
103+
- `bun example:android`: run the example app on Android.
104+
- `bun example:ios`: run the example app on iOS.
105+
- `bun example:android:release`: run the example app on Android in release mode.
106+
- `bun example:ios:release`: run the example app on iOS in release mode.
99107

100108
### Sending a pull request
101109

bun.lockb

469 KB
Binary file not shown.

example/bun.lockb

398 KB
Binary file not shown.

example/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6-
"android": "react-native run-android --appId com.pagerviewexample --list-devices",
7-
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
8-
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev false --bundle-output dist/main.ios.jsbundle --assets-dest dist",
9-
"build:visionos": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.visionos.jsbundle --assets-dest dist",
10-
"ios": "react-native run-ios --list-devices",
11-
"lint": "eslint .",
12-
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
136
"start": "react-native start",
7+
"pods": "pod-install --quiet",
148
"test": "jest",
9+
"lint": "eslint .",
10+
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
11+
"android": "react-native run-android --appId com.pagerviewexample --list-devices",
12+
"ios": "react-native run-ios --list-devices",
1513
"visionos": "react-native run-visionos",
16-
"pods": "pod-install --quiet"
14+
"build:android": "bun mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
15+
"build:ios": "bun mkdist && react-native bundle --entry-file index.js --platform ios --dev false --bundle-output dist/main.ios.jsbundle --assets-dest dist",
16+
"build:visionos": "bun mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.visionos.jsbundle --assets-dest dist"
1717
},
1818
"dependencies": {
1919
"@callstack/react-native-visionos": "^0.76.0",

0 commit comments

Comments
 (0)