Skip to content

Commit e691218

Browse files
chore: migrate to bun
1 parent 229c71b commit e691218

5 files changed

Lines changed: 33 additions & 46 deletions

File tree

.github/actions/setup/action.yml

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

44
runs:
55
using: composite
66
steps:
7-
- name: Setup Node.js
8-
uses: actions/setup-node@v3
7+
- name: Setup Bun
8+
uses: oven-sh/setup-bun@v2
99
with:
10-
node-version-file: .nvmrc
11-
12-
- name: Cache dependencies
13-
id: yarn-cache
14-
uses: actions/cache@v3
15-
with:
16-
path: |
17-
**/node_modules
18-
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
20-
restore-keys: |
21-
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22-
${{ runner.os }}-yarn-
10+
bun-version: latest
2311

2412
- name: Install dependencies
25-
if: steps.yarn-cache.outputs.cache-hit != 'true'
26-
run: yarn install --immutable
13+
run: bun install
2714
shell: bash

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
uses: ./.github/actions/setup
2222

2323
- name: Lint files
24-
run: yarn lint
24+
run: bun run lint
2525

2626
- name: Typecheck files
27-
run: yarn typecheck
27+
run: bun run typecheck
2828

2929
test:
3030
runs-on: ubuntu-latest
@@ -36,7 +36,7 @@ jobs:
3636
uses: ./.github/actions/setup
3737

3838
- name: Run unit tests
39-
run: yarn test --maxWorkers=2 --coverage
39+
run: bun run test --maxWorkers=2 --coverage
4040

4141
build-library:
4242
runs-on: ubuntu-latest
@@ -48,7 +48,7 @@ jobs:
4848
uses: ./.github/actions/setup
4949

5050
- name: Build package
51-
run: yarn prepare
51+
run: bun run prepare
5252

5353
build-web:
5454
runs-on: ubuntu-latest
@@ -61,4 +61,4 @@ jobs:
6161

6262
- name: Build example for Web
6363
run: |
64-
yarn example expo export --platform web
64+
bun run example expo export --platform web

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://bun.sh/docs/install/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 install` in the root directory to install the required dependencies for each package:
1515

1616
```sh
17-
yarn
17+
bun install
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 should use [`bun`](https://bun.sh) 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,44 +28,44 @@ 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 run the example app on Web:
4747

4848
```sh
49-
yarn example web
49+
bun example web
5050
```
5151

5252
Make sure your code passes TypeScript and ESLint. Run the following to verify:
5353

5454
```sh
55-
yarn typecheck
56-
yarn lint
55+
bun run typecheck
56+
bun run lint
5757
```
5858

5959
To fix formatting errors, run the following:
6060

6161
```sh
62-
yarn lint --fix
62+
bun run lint --fix
6363
```
6464

6565
Remember to add tests for your change if possible. Run the unit tests by:
6666

6767
```sh
68-
yarn test
68+
bun test
6969
```
7070

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

9898
```sh
99-
yarn release
99+
bun run release
100100
```
101101

102102
### Scripts
103103

104104
The `package.json` file contains various scripts for common tasks:
105105

106-
- `yarn`: setup project by installing dependencies.
107-
- `yarn typecheck`: type-check files with TypeScript.
108-
- `yarn lint`: lint files with ESLint.
109-
- `yarn test`: run unit tests with Jest.
110-
- `yarn example start`: start the Metro server for the example app.
111-
- `yarn example android`: run the example app on Android.
112-
- `yarn example ios`: run the example app on iOS.
106+
- `bun install`: setup project by installing dependencies.
107+
- `bun run typecheck`: type-check files with TypeScript.
108+
- `bun run lint`: lint files with ESLint.
109+
- `bun test`: run unit tests with Jest.
110+
- `bun example start`: start the Metro server for the example app.
111+
- `bun example android`: run the example app on Android.
112+
- `bun example ios`: run the example app on iOS.
113113

114114
### Sending a pull request
115115

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The package is built on top of the BaseButton from [react-native-gesture-handler
88
## Installation
99

1010
```sh
11-
yarn add pressto react-native-reanimated react-native-gesture-handler
11+
bun add pressto react-native-reanimated react-native-gesture-handler
1212
```
1313

1414
Or with Expo

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"!**/.*"
3838
],
3939
"scripts": {
40-
"example": "yarn workspace pressto-example",
40+
"example": "bun --filter pressto-example",
4141
"test": "jest",
4242
"typecheck": "tsc",
4343
"lint": "eslint \"**/*.{js,ts,tsx}\"",
@@ -97,7 +97,7 @@
9797
"workspaces": [
9898
"example"
9999
],
100-
"packageManager": "yarn@3.6.1",
100+
"packageManager": "bun@1.2.19",
101101
"jest": {
102102
"preset": "react-native",
103103
"modulePathIgnorePatterns": [

0 commit comments

Comments
 (0)