Skip to content

Commit

Permalink
build: use bun instead of pnpm (#382)
Browse files Browse the repository at this point in the history
Bun is allegedly way faster than pnpm. So let's try it out.
  • Loading branch information
Balvajs authored Apr 9, 2024
1 parent 5e83c7e commit add8a01
Show file tree
Hide file tree
Showing 18 changed files with 21,219 additions and 28,108 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ jobs:
with:
node-version: 20.x

- uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1

- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: pnpm install
run: bun install --frozen-lockfile

- name: Rebuild the dist/ directory
run: pnpm package
run: bun package

- name: Compare the expected and actual dist/ directories
run: |
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ jobs:
with:
node-version: 20.x

- uses: pnpm/action-setup@v2
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install
run: bun install --frozen-lockfile

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm semantic-release
run: bun semantic-release
14 changes: 11 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ jobs:
with:
node-version: 20.x

- uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1

- run: pnpm install
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- run: bun install --frozen-lockfile

- run: pnpm all
- run: bun all

test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
bun lint-staged
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ dist/
lib/
node_modules/
.cache
pnpm-lock.yaml
bun.lockb
Binary file added bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[install]
exact = true
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config: CodegenConfig = {
add: {
content: `/* eslint-disable */
/**
* This file is generated, don’t edit it manually. Run \`pnpm generate\` to re-generate.
* This file is generated, don’t edit it manually. Run \`bun generate\` to re-generate.
*/
`,
},
Expand Down
Loading

0 comments on commit add8a01

Please sign in to comment.