Skip to content

Commit

Permalink
move to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRefactor committed Nov 19, 2024
1 parent 4a331d6 commit 816d409
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9,618 deletions.
36 changes: 18 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,52 @@ We want this community to be friendly and respectful to each other. Please follo

## Development workflow

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

```sh
yarn
bun install
```

> 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.
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`bun`](https://bun.sh/), so you'll have an easier time if you use `bun` for development.
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.

To start the packager:

```sh
yarn example start
bun example start
```

To run the example app on Android:

```sh
yarn example android
bun example android
```

To run the example app on iOS:

```sh
yarn example ios
bun example ios
```


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

```sh
yarn typescript
yarn lint
bun typescript
bun lint
```

To fix formatting errors, run the following:

```sh
yarn lint --fix
bun lint --fix
```

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

```sh
yarn test
bun test
```
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`.

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

```sh
yarn release
bun release
```

### Scripts

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

- `yarn bootstrap`: setup project by installing all dependencies and pods.
- `yarn typescript`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `bun bootstrap`: setup project by installing all dependencies and pods.
- `bun typescript`: type-check files with TypeScript.
- `bun lint`: lint files with ESLint.
- `bun test`: run unit tests with Jest.
- `bun example start`: start the Metro server for the example app.
- `bun example android`: run the example app on Android.
- `bun example ios`: run the example app on iOS.

### Sending a pull request

Expand Down
Binary file added bun.lockb
Binary file not shown.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"prepare": "bob build",
"release": "release-it",
"releaseNext": "release-it --npm.tag=next --preRelease=rc",
"example": "yarn --cwd example",
"bootstrap": "yarn example && yarn && yarn example pods",
"bootstrap-no-pods": "yarn example && yarn",
"bootstrap": "cd example; bun install && bun run pods ",
"bootstrap-no-pods": "bun install --cwd example",
"test:e2e:android": "bash ./scripts/run-maestro-tests.sh android",
"test:e2e:ios": "bash ./scripts/run-maestro-tests.sh ios",
"run-example-android": "cd example;react-native run-android --mode \"Release\" --appId com.pagerviewexample",
"run-example-ios": "cd example;react-native run-ios --mode \"Release\" --simulator \"iPhone 13 (15.2)\"",
"test:e2e:ios": "bash ./scripts/run-maestro-tests.sh ios"
"run-example-ios": "cd example;react-native run-ios --mode \"Release\" --simulator \"iPhone 13 (15.2)\""
},
"keywords": [
"react-native",
Expand Down Expand Up @@ -62,6 +60,7 @@
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ft-flow": "^3.0.1",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.6.3",
"metro-react-native-babel-preset": "^0.77.0",
Expand Down
29 changes: 0 additions & 29 deletions scripts/bootstrap.js

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/run-maestro-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ esac

if [ "$PLATFORM" == "ios" ]; then
APPID="com.pagerviewexample"
allTestFiles=$(ls maestro-tests/*.yaml maestro-tests/basic_example/*.yaml)
allTestFiles=$(ls maestro-tests/basic_example/*.yaml)
else
APPID="com.pagerviewexample"
allTestFiles=$(ls maestro-tests/*.yaml maestro-tests/basic_example/*.yaml)
allTestFiles=$(ls maestro-tests/basic_example/*.yaml)
fi

failedTests=()
Expand Down
Loading

0 comments on commit 816d409

Please sign in to comment.