Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from yarn to bun #14

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set up Node.js

- name: Set up Node.js 🍞
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Enable Corepack
run: corepack enable

- name: Set Yarn version to Berry
run: corepack prepare [email protected] --activate

- name: Install Bun (via Bun action) 🍞
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: yarn install
run: bun install

- name: Build auto-utils package 🔧
run: yarn workspace @autonomys/auto-utils build
run: bun run --filter '@autonomys/auto-utils' build

- name: Build all packages 🔧
run: yarn build
run: bun run build

- name: Run tests 🧪
run: yarn test
run: bun test
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The repository is organized as follows:
## Requirements

- Node.js
- Yarn 2 (Berry) or later
- [Bun 1.0.0 or higher](https://bun.sh/docs/installation#installing)

## Setup

Expand All @@ -25,27 +25,23 @@ The repository is organized as follows:

`cd auto-sdk`

3. **Set Yarn to use the Berry version:**
3. **Install dependencies:**

`yarn set version berry`

4. **Install dependencies:**

`yarn install`
`bun install`

## Scripts

### Build

To build all packages:

`yarn build`
`bun build`

### Test

To run tests for all packages:

`yarn test`
`bun test`

### Localhost testing

Expand Down Expand Up @@ -79,7 +75,7 @@ To test the packages against a local node, you can use the script at `scripts/lo

## Workspaces

This project uses Yarn workspaces. Packages are located in the `packages` directory. Each package can have its own dependencies and build scripts.
This project uses workspaces. Packages are located in the `packages` directory. Each package can have its own dependencies and build scripts.

## License

Expand Down
Binary file added bun.lockb
Binary file not shown.
24 changes: 19 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@
"packages/*"
],
"scripts": {
"build": "yarn workspaces foreach --all run build",
"test": "yarn workspaces foreach --all run test"
"build": "bun run --filter '*' build",
"test": "bun run --filter '*' test"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/subspace/auto-sdk"
},
"author": {
"name": "Autonomys",
"url": "https://www.autonomys.net"
},
"devDependencies": {
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
},
"packageManager": "[email protected]"
"typescript": "^5.4.5",
"ts-jest": "^29.1.4",
"@types/jest": "^29.5.12",
"jest": "^29.7.0"
}
}
18 changes: 10 additions & 8 deletions packages/auto-consensus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
"version": "0.1.0",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"test": "jest"
"build": "bun build ./src/index.ts --outdir ./dist",
"test": "bun test"
},
"files": [
"dist",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/subspace/auto-sdk"
},
"author": {
"name": "Autonomys",
"url": "https://www.autonomys.net"
},
"dependencies": {
"@autonomys/auto-utils": "workspace:*"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.1.4",
"typescript": "^5.4.5"
}
}
16 changes: 9 additions & 7 deletions packages/auto-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"test": "jest"
"build": "bun build ./src/index.ts --outdir ./dist",
"test": "bun test"
},
"files": [
"dist",
Expand All @@ -14,11 +14,13 @@
"@polkadot/api": "^11.2.1",
"fs": "^0.0.1-security"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.1.4",
"typescript": "^5.4.5"
"repository": {
"type": "git",
"url": "https://github.com/subspace/auto-sdk"
},
"author": {
"name": "Autonomys",
"url": "https://www.autonomys.net"
},
"browser": {
"fs": false
Expand Down
2 changes: 1 addition & 1 deletion scripts/localhost-run-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LOCALHOST="true"
export LOCALHOST

yarn test
bun test
Loading
Loading