Skip to content

Commit 6cb2e46

Browse files
committed
chore: try bun
1 parent c3816f3 commit 6cb2e46

File tree

13 files changed

+3723
-15233
lines changed

13 files changed

+3723
-15233
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,33 @@ assignees: ''
77
---
88

99
### Current behaviour
10+
1011
<!-- Describe your issue in detail -->
1112

1213
### Expected behaviour
14+
1315
<!-- A clear and concise description of what you expected to happen -->
1416

1517
### How to reproduce?
18+
1619
<!-- Help us to reproduce the issue and describe the steps -->
1720
<!-- Attach code example on snack.expo.dev or in a GitHub repo -->
1821

1922
### Preview
23+
2024
<!-- Include screenshots or video if applicable. -->
2125

2226
### What have you tried so far?
27+
2328
<!-- List down the steps you have tried to fix or identify the issue. -->
2429

2530
### Your Environment
2631

27-
| software | version
28-
| --------------------- | -------
29-
| ios | x
30-
| android | x
31-
| react-native | x.x.x
32-
| node | x.x.x
33-
| npm or yarn | x.x.x
34-
| expo sdk | x.x.x
32+
| software | version |
33+
| ------------ | ------- |
34+
| ios | x |
35+
| android | x |
36+
| react-native | x.x.x |
37+
| node | x.x.x |
38+
| npm or bun | x.x.x |
39+
| expo sdk | x.x.x |

.github/actions/setup/action.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Setup
2-
description: Setup Node.js and install dependencies
2+
description: Setup Node.js, Bun, and install dependencies
33

44
runs:
55
using: composite
@@ -9,28 +9,33 @@ runs:
99
with:
1010
node-version-file: .nvmrc
1111

12+
- name: Setup Bun
13+
uses: oven-sh/setup-bun@v1
14+
with:
15+
bun-version: latest # or specify a version, e.g., '1.1.0'
16+
1217
- name: Restore dependencies
13-
id: yarn-cache
18+
id: bun-cache
1419
uses: actions/cache/restore@v4
1520
with:
1621
path: |
1722
**/node_modules
18-
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
23+
.bun/install-state.gz
24+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2025
restore-keys: |
21-
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22-
${{ runner.os }}-yarn-
26+
${{ runner.os }}-bun-${{ hashFiles('bun.lockb') }}
27+
${{ runner.os }}-bun-
2328
2429
- name: Install dependencies
25-
if: steps.yarn-cache.outputs.cache-hit != 'true'
26-
run: yarn install --immutable
30+
if: steps.bun-cache.outputs.cache-hit != 'true'
31+
run: bun install --immutable
2732
shell: bash
2833

2934
- name: Cache dependencies
30-
if: steps.yarn-cache.outputs.cache-hit != 'true'
35+
if: steps.bun-cache.outputs.cache-hit != 'true'
3136
uses: actions/cache/save@v4
3237
with:
3338
path: |
3439
**/node_modules
35-
.yarn/install-state.gz
36-
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
40+
.bun/install-state.gz
41+
key: ${{ steps.bun-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ jobs:
1818
uses: ./.github/actions/setup
1919

2020
- name: Lint files
21-
run: yarn lint
21+
run: bun lint
2222

2323
- name: Typecheck files
24-
run: yarn typecheck
24+
run: bun typecheck
2525

26-
# test:
27-
# runs-on: ubuntu-latest
28-
# steps:
29-
# - name: Checkout
30-
# uses: actions/checkout@v3
31-
#
32-
# - name: Setup
33-
# uses: ./.github/actions/setup
34-
#
35-
# - name: Run unit tests
36-
# run: yarn test --maxWorkers=2 --coverage
26+
# test:
27+
# runs-on: ubuntu-latest
28+
# steps:
29+
# - name: Checkout
30+
# uses: actions/checkout@v3
31+
#
32+
# - name: Setup
33+
# uses: ./.github/actions/setup
34+
#
35+
# - name: Run unit tests
36+
# run: bun test --maxWorkers=2 --coverage
3737

3838
build:
3939
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
uses: ./.github/actions/setup
4646

4747
- name: Build package
48-
run: yarn prepare
48+
run: bun prepare
4949
release:
5050
runs-on: ubuntu-latest
5151
if: github.ref == 'refs/heads/main'
@@ -61,7 +61,7 @@ jobs:
6161
git config user.name "${GITHUB_ACTOR}"
6262
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
6363
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
64-
- run: yarn release
64+
- run: bun release
6565
env:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
deploy-example:
@@ -74,7 +74,7 @@ jobs:
7474
fetch-depth: 0
7575
- name: Setup
7676
uses: ./.github/actions/setup
77-
- run: yarn build-example
77+
- run: bun build-example
7878
- name: Deploy example
7979
uses: jakejarvis/s3-sync-action@master
8080
with:

.gitignore

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@ example/vendor/
5151
#
5252
node_modules/
5353
npm-debug.log
54-
yarn-debug.log
55-
yarn-error.log
54+
bun-debug.log
55+
bun-error.log
5656

5757
# BUCK
5858
buck-out/
5959
\.buckd/
6060
android/app/libs
6161
android/keystores/debug.keystore
6262

63-
# Yarn
64-
.yarn/plugins
65-
!.yarn/patches
66-
!.yarn/plugins
67-
!.yarn/releases
68-
!.yarn/sdks
69-
!.yarn/versions
63+
# Bun
64+
.bun/plugins
65+
!.bun/patches
66+
!.bun/plugins
67+
!.bun/releases
68+
!.bun/sdks
69+
!.bun/versions
7070

7171
# Expo
7272
.expo/
@@ -80,4 +80,3 @@ lib/
8080
# React Native Codegen
8181
ios/generated
8282
android/generated
83-
.yarn

.husky/commit-msg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ call_lefthook()
3636
elif bundle exec lefthook -h >/dev/null 2>&1
3737
then
3838
bundle exec lefthook "$@"
39-
elif yarn lefthook -h >/dev/null 2>&1
39+
elif bun lefthook -h >/dev/null 2>&1
4040
then
41-
yarn lefthook "$@"
41+
bun lefthook "$@"
4242
elif pnpm lefthook -h >/dev/null 2>&1
4343
then
4444
pnpm lefthook "$@"

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ call_lefthook()
3636
elif bundle exec lefthook -h >/dev/null 2>&1
3737
then
3838
bundle exec lefthook "$@"
39-
elif yarn lefthook -h >/dev/null 2>&1
39+
elif bun lefthook -h >/dev/null 2>&1
4040
then
41-
yarn lefthook "$@"
41+
bun lefthook "$@"
4242
elif pnpm lefthook -h >/dev/null 2>&1
4343
then
4444
pnpm lefthook "$@"

.husky/prepare-commit-msg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ call_lefthook()
3636
elif bundle exec lefthook -h >/dev/null 2>&1
3737
then
3838
bundle exec lefthook "$@"
39-
elif yarn lefthook -h >/dev/null 2>&1
39+
elif bun lefthook -h >/dev/null 2>&1
4040
then
41-
yarn lefthook "$@"
41+
bun lefthook "$@"
4242
elif pnpm lefthook -h >/dev/null 2>&1
4343
then
4444
pnpm lefthook "$@"

.yarnrc.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ We want this community to be friendly and respectful to each other. Please follo
66

77
## Development workflow
88

9-
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
9+
This project is a monorepo managed using [Bun workspaces](https://bunpkg.com/features/workspaces). It contains the following packages:
1010

1111
- The library package in the root directory.
1212
- An example app in the `example/` directory.
1313

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

1616
```sh
17-
yarn
17+
bun
1818
```
1919

20-
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
20+
> Since the project relies on Bun workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
2121
2222
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
2323

@@ -28,19 +28,19 @@ You can use various commands from the root directory to work with the project.
2828
To start the packager:
2929

3030
```sh
31-
yarn example start
31+
bun example start
3232
```
3333

3434
To run the example app on Android:
3535

3636
```sh
37-
yarn example android
37+
bun example android
3838
```
3939

4040
To run the example app on iOS:
4141

4242
```sh
43-
yarn example ios
43+
bun example ios
4444
```
4545

4646
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
@@ -54,26 +54,26 @@ Note the `"fabric":true` and `"concurrentRoot":true` properties.
5454
To run the example app on Web:
5555

5656
```sh
57-
yarn example web
57+
bun example web
5858
```
5959

6060
Make sure your code passes TypeScript and ESLint. Run the following to verify:
6161

6262
```sh
63-
yarn typecheck
64-
yarn lint
63+
bun typecheck
64+
bun lint
6565
```
6666

6767
To fix formatting errors, run the following:
6868

6969
```sh
70-
yarn lint --fix
70+
bun lint --fix
7171
```
7272

7373
Remember to add tests for your change if possible. Run the unit tests by:
7474

7575
```sh
76-
yarn test
76+
bun test
7777
```
7878

7979
### Commit message convention
@@ -104,20 +104,20 @@ We use [release-it](https://github.com/release-it/release-it) to make it easier
104104
To publish new versions, run the following:
105105

106106
```sh
107-
yarn release
107+
bun release
108108
```
109109

110110
### Scripts
111111

112112
The `package.json` file contains various scripts for common tasks:
113113

114-
- `yarn`: setup project by installing dependencies.
115-
- `yarn typecheck`: type-check files with TypeScript.
116-
- `yarn lint`: lint files with ESLint.
117-
- `yarn test`: run unit tests with Jest.
118-
- `yarn example start`: start the Metro server for the example app.
119-
- `yarn example android`: run the example app on Android.
120-
- `yarn example ios`: run the example app on iOS.
114+
- `bun`: setup project by installing dependencies.
115+
- `bun typecheck`: type-check files with TypeScript.
116+
- `bun lint`: lint files with ESLint.
117+
- `bun test`: run unit tests with Jest.
118+
- `bun example start`: start the Metro server for the example app.
119+
- `bun example android`: run the example app on Android.
120+
- `bun example ios`: run the example app on iOS.
121121

122122
### Sending a pull request
123123

0 commit comments

Comments
 (0)