Skip to content

Commit b8baeb8

Browse files
committed
chore: migrate to bun
1 parent d8f269f commit b8baeb8

File tree

17 files changed

+134
-10169
lines changed

17 files changed

+134
-10169
lines changed

.devcontainer/postCreateCommand.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
# Uninstall globally installed PNPM (required version will be reinstalled through corepack)
4-
echo "❌ Uninstalling globally installed PNPM..."
5-
npm uninstall -g pnpm
3+
# Installing Bun
4+
echo "⚙️ Installing bun..."
5+
curl -fsSL https://bun.sh/install | bash
66

7-
# Prevent corepack from prompting user before downloading PNPM
8-
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
97

10-
# Enable corepack
11-
corepack enable
12-
13-
# Install the PNPM version defined in the root package.json
14-
echo "⚙️ Installing required PNPM version..."
15-
corepack prepare --activate
8+
# Adding Bun to path
9+
echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.bashrc
10+
source ~/.bashrc
1611

1712
# Install NPM dependencies
1813
echo "⚙️ Installing NPM dependencies..."
19-
pnpm install --frozen-lockfile
14+
bun install --frozen-lockfile

.env

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Install dependencies'
2-
description: Install node and pnpm, then run pnpm install
2+
description: Install node and bun, then run bun install
33

44
inputs:
55
node-version: # id of input
@@ -10,15 +10,14 @@ inputs:
1010
runs:
1111
using: 'composite'
1212
steps:
13-
- name: Setup PNPM
14-
run: corepack enable pnpm
15-
shell: bash
13+
- name: Setup Bun
14+
uses: oven-sh/setup-bun@v2
1615

1716
- name: Use Node.js ${{ inputs.node-version }}
1817
uses: actions/setup-node@v4
1918
with:
2019
node-version: ${{ inputs.node-version }}
21-
cache: 'pnpm'
20+
#cache: 'bun'
2221
registry-url: 'https://registry.npmjs.org'
2322

2423
- name: Cache node_modules
@@ -27,8 +26,8 @@ runs:
2726
with:
2827
lookup-only: true
2928
path: '**/node_modules'
30-
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
29+
key: bun-${{ hashFiles('bun.lockb') }}
3130

3231
- name: Install packages
33-
run: pnpm install --frozen-lockfile
32+
run: bun install --frozen-lockfile
3433
shell: bash

.github/actions/setup/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Setup Build Tools and Dependencies'
2-
description: Setup node, pnpm, java, flutter, cache, and install dependencies
2+
description: Setup node, bun, java, flutter, cache, and install dependencies
33

44
inputs:
55
node-version: # id of input
@@ -10,15 +10,15 @@ inputs:
1010
runs:
1111
using: 'composite'
1212
steps:
13-
- name: Setup PNPM
14-
run: corepack enable pnpm
15-
shell: bash
13+
- name: Setup Bun
14+
uses: oven-sh/setup-bun@v2
1615

1716
- name: Setup Node.js ${{ inputs.node-version }}
1817
uses: actions/setup-node@v4
1918
with:
2019
node-version: ${{ inputs.node-version }}
21-
cache: 'pnpm'
20+
#cache: 'bun'
21+
registry-url: 'https://registry.npmjs.org'
2222

2323
- name: Setup Java
2424
uses: actions/setup-java@v4
@@ -45,10 +45,10 @@ runs:
4545
with:
4646
lookup-only: true
4747
path: '**/node_modules'
48-
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
48+
key: bun-${{ hashFiles('bun.lockb') }}
4949

5050
- name: Install packages
51-
run: pnpm install --frozen-lockfile
51+
run: bun install --frozen-lockfile
5252
shell: bash
5353

5454
- name: Derive appropriate SHAs for base and head for `nx affected` commands

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
2929
fetch-depth: 0
3030

31-
- name: Install node, pnpm, and dependencies
31+
- name: Install node, bun, and dependencies
3232
uses: ./.github/actions/install-dependencies
3333

3434
# Validating Launch Templates
35-
- run: pnpm exec nx-cloud validate --workflow-file="./.nx/workflows/agents.yaml"
35+
- run: bunx nx-cloud validate --workflow-file="./.nx/workflows/agents.yaml"
3636

3737
# Connect your workspace on nx.app and uncomment this to enable task distribution.
3838
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e" targets have been requested
39-
- run: pnpm exec nx-cloud start-ci-run --distribute-on=".nx/workflows/distribution-config.yaml" --stop-agents-after="e2e-ci" --with-env-vars="ANDROID_SDK_VERSION,FLUTTER_VERSION,JDK_VERSION"
39+
- run: bunx nx-cloud start-ci-run --distribute-on=".nx/workflows/distribution-config.yaml" --stop-agents-after="e2e-ci" --with-env-vars="ANDROID_SDK_VERSION,FLUTTER_VERSION,JDK_VERSION"
4040

4141
# This line is needed for nx affected to work when CI is running on a PR
4242
- run: git branch --track develop origin/develop || exit 0
@@ -46,5 +46,5 @@ jobs:
4646
with:
4747
main-branch-name: 'develop'
4848

49-
- run: pnpm exec nx-cloud record -- nx format:check
50-
- run: pnpm exec nx affected -t lint test-ci build e2e-ci --parallel=5 --exclude=smoke
49+
- run: bunx nx-cloud record -- nx format:check
50+
- run: bunx nx affected -t lint test-ci build e2e-ci --parallel=5 --exclude=smoke

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
git config --global user.email semantic-release@github.com
3131
git config --global user.name "Semantic Release CI"
3232
33-
- name: Install node, pnpm, and dependencies
33+
- name: Install node, bun, and dependencies
3434
uses: ./.github/actions/install-dependencies
3535

3636
- name: Build, Release on GitHub & Publish to NPM
@@ -40,4 +40,4 @@ jobs:
4040
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4141
NPM_CONFIG_PROVENANCE: true
4242
run: |
43-
pnpm nx release --yes -- --skip-nx-cache
43+
bunx nx release --yes -- --skip-nx-cache

.github/workflows/smoke-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
fetch-depth: 0
2727

28-
- name: Setup node, pnpm, java, flutter, and dependencies
28+
- name: Setup node, bun, java, flutter, and dependencies
2929
uses: ./.github/actions/setup
3030
with:
3131
node-version: ${{ matrix.node-version }}
@@ -34,4 +34,4 @@ jobs:
3434
env:
3535
NX_E2E_CI_CACHE_KEY: smoke-gha-${{ matrix.os }}-${{ matrix.node-version }}
3636
NX_RUN_GROUP: ${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}
37-
run: pnpm nx e2e-ci smoke
37+
run: bunx nx e2e smoke

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm commitlint --edit $1
1+
bunx commitlint --edit $1

.husky/pre-commit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pnpm sync-preset-schemas
2-
pnpm exec lint-staged --concurrent false --relative
3-
pnpm affected:test
1+
bun sync-preset-schemas
2+
bunx lint-staged --concurrent false --relative
3+
bun affected:test

.lintstagedrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"*.ts": [
3-
"pnpm nx affected:lint --fix --files"
3+
"bunx nx affected:lint --fix --files"
44
],
55
"*": [
6-
"pnpm nx format:write --files"
6+
"bunx nx format:write --files"
77
]
88
}

0 commit comments

Comments
 (0)