Skip to content

Commit 176357e

Browse files
authored
Use bun rather than pnpm.
2 parents 51d3637 + ccd8311 commit 176357e

20 files changed

Lines changed: 2572 additions & 9251 deletions

‎.github/workflows/cd.yml‎

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ jobs:
6666
uses: actions/setup-node@v4
6767
with:
6868
node-version: 'lts/*'
69-
- name: Install pnpm
70-
run: npm install -g pnpm
69+
- name: Install bun
70+
if: ${{ matrix.name != 'Windows (ARM)' }}
71+
uses: oven-sh/setup-bun@v2
72+
- name: Install bun (Windows ARM only)
73+
if: ${{ matrix.name == 'Windows (ARM)' }}
74+
run: |
75+
curl -L https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip -o bun.zip
76+
unzip -j bun.zip -d $env:USERPROFILE\.bun
77+
del bun.zip
78+
echo "$env:USERPROFILE\.bun" >> $env:GITHUB_PATH
7179
- name: Make sure that we can sign OpenCOR (Windows ARM only)
7280
if: matrix.name == 'Windows (ARM)'
7381
run: |
@@ -81,13 +89,16 @@ jobs:
8189
sudo apt update
8290
sudo apt install libopenjp2-tools
8391
- name: OpenCOR dependencies
84-
run: pnpm install
92+
run: bun install
93+
- name: Install some native packages (Windows ARM only)
94+
if: ${{ matrix.name == 'Windows (ARM)' }}
95+
run: npm install @rollup/rollup-win32-arm64-msvc @tailwindcss/oxide-win32-arm64-msvc lightningcss-win32-arm64-msvc
8596
- name: Build libOpenCOR
86-
run: pnpm libopencor
97+
run: bun libopencor
8798
- name: Build OpenCOR
88-
run: pnpm build
99+
run: bun run build
89100
- name: Release OpenCOR
90-
run: pnpm release
101+
run: bun release
91102
web_app:
92103
if: ${{ github.repository == 'opencor/webapp' }}
93104
name: Web app
@@ -103,12 +114,12 @@ jobs:
103114
uses: actions/setup-node@v4
104115
with:
105116
node-version: 'lts/*'
106-
- name: Install pnpm
107-
run: npm install -g pnpm
117+
- name: Install bun
118+
run: npm install -g bun
108119
- name: OpenCOR dependencies
109-
run: pnpm install
120+
run: bun install
110121
- name: Build OpenCOR's Web app
111-
run: pnpm build:web
122+
run: bun build:web
112123
- name: Deploy to https://opencor.ws/app/
113124
uses: milanmk/actions-file-deployer@master
114125
with:
@@ -120,7 +131,7 @@ jobs:
120131
remote-path: /home/www/opencor.ws/app
121132
sync: full
122133
- name: Archive OpenCOR's Web app
123-
run: pnpm archive:web
134+
run: bun archive:web
124135
- name: Release OpenCOR's Web app
125136
uses: softprops/action-gh-release@v2
126137
with:
@@ -141,17 +152,17 @@ jobs:
141152
with:
142153
node-version: 'lts/*'
143154
registry-url: 'https://registry.npmjs.org'
144-
- name: Install pnpm
145-
run: npm install -g pnpm
155+
- name: Install bun
156+
run: npm install -g bun
146157
- name: OpenCOR dependencies
147158
run: |
148159
cd src/renderer
149-
pnpm install
160+
bun install
150161
- name: Build OpenCOR as a component
151162
run: |
152163
cd src/renderer
153-
pnpm build:lib
164+
bun build:lib
154165
- name: Publish OpenCOR
155166
run: |
156167
cd src/renderer
157-
pnpm publish --provenance --access public --no-git-checks
168+
bun publish --provenance --access public --no-git-checks

‎.github/workflows/cddev.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: 'lts/*'
23-
- name: Install pnpm
24-
run: npm install -g pnpm
23+
- name: Install bun
24+
run: npm install -g bun
2525
- name: OpenCOR dependencies
26-
run: pnpm install
26+
run: bun install
2727
- name: Build OpenCOR's Web app
28-
run: pnpm build:web
28+
run: bun build:web
2929
- name: Deploy to https://opencor.ws/appdev/
3030
uses: milanmk/actions-file-deployer@master
3131
with:

‎.github/workflows/ci.yml‎

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,41 @@ jobs:
4444
uses: actions/setup-node@v4
4545
with:
4646
node-version: 'lts/*'
47-
- name: Install pnpm
48-
run: npm install -g pnpm
47+
- name: Install bun
48+
if: ${{ matrix.name != 'Windows (ARM)' }}
49+
uses: oven-sh/setup-bun@v2
50+
- name: Install bun (Windows ARM only)
51+
if: ${{ matrix.name == 'Windows (ARM)' }}
52+
run: |
53+
curl -L https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip -o bun.zip
54+
unzip -j bun.zip -d $env:USERPROFILE\.bun
55+
del bun.zip
56+
echo "$env:USERPROFILE\.bun" >> $env:GITHUB_PATH
4957
- name: OpenCOR dependencies
50-
run: pnpm install
58+
run: bun install
59+
- name: Install some native packages (Windows ARM only)
60+
if: ${{ matrix.name == 'Windows (ARM)' }}
61+
run: npm install @rollup/rollup-win32-arm64-msvc @tailwindcss/oxide-win32-arm64-msvc lightningcss-win32-arm64-msvc
5162
- name: Build libOpenCOR
5263
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
53-
run: pnpm libopencor
64+
run: bun libopencor
5465
- name: Build OpenCOR
5566
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
56-
run: pnpm build
67+
run: bun run build
5768
- name: Build OpenCOR's Web app
5869
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
59-
run: pnpm build:web
70+
run: bun build:web
6071
- name: Build OpenCOR's npm library
6172
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
6273
run: |
6374
cd src/renderer
64-
pnpm install
65-
pnpm build:lib
75+
bun install
76+
bun build:lib
6677
- name: Code formatting
6778
if: matrix.name == 'Code formatting'
68-
run: pnpm format:check
79+
run: bun format:check
6980
- name: Linting
7081
if: matrix.name == 'Linting'
71-
run: pnpm lint
82+
run: bun lint
7283
- name: Clean OpenCOR
73-
run: pnpm clean
84+
run: bun clean

‎.prettierignore‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎BUILD.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
- [Node.js](https://nodejs.org/) (version 22+);
44
- [npm](https://npmjs.com/) (it comes with Node.js);
5-
- [pnpm](https://pnpm.io/) (for package management); and
5+
- [bun](https://bun.com/package-manager) (for package management); and
66
- [C](<https://en.wikipedia.org/wiki/C_(programming_language)>)/[C++](https://en.wikipedia.org/wiki/C%2B%2B) toolchain.
77

88
## Installation
99

1010
1. **Install Node.js and npm from [here](https://nodejs.org/en/download/package-manager);**
1111
**Note:** on [Windows](https://en.wikipedia.org/wiki/Microsoft_Windows) on [ARM](https://en.wikipedia.org/wiki/ARM_architecture_family), you can install [Node.js](https://nodejs.org/) using [fnm](https://github.com/Schniz/fnm). However, if you use `fnm install --lts`, it will install the [Intel](https://en.wikipedia.org/wiki/List_of_Intel_processors) version of [Node.js](https://nodejs.org/), which may or may not be what you want. If you want to install the [ARM](https://en.wikipedia.org/wiki/ARM_architecture_family) version of [Node.js](https://nodejs.org/), you should use `fnm install --lts --arch arm64`.
1212

13-
2. **Install pnpm globally:**
13+
2. **Install bun globally:**
1414

1515
```bash
16-
npm install -g pnpm
16+
npm install -g bun
1717
```
1818

1919
3. **Install a C/C++ toolchain:**
@@ -35,26 +35,26 @@ npm install -g pnpm
3535
1. **Install OpenCOR's dependencies:**
3636

3737
```bash
38-
pnpm install
38+
bun install
3939
```
4040

4141
2. **Build libOpenCOR's native Node.js module:**
4242

4343
```bash
44-
pnpm libopencor
44+
bun libopencor
4545
```
4646

4747
3. **Start the development version of OpenCOR:**
4848
- **Desktop version:**
4949

5050
```bash
51-
pnpm dev
51+
bun dev
5252
```
5353

5454
- **Web app version:**
5555

5656
```bash
57-
pnpm dev:web
57+
bun dev:web
5858
```
5959

6060
4. **Test OpenCOR:**

0 commit comments

Comments
 (0)