Skip to content

Commit 30349bf

Browse files
authored
Migrate to Bun (#664)
1 parent 65083fc commit 30349bf

32 files changed

+681
-4429
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
3+
- package-ecosystem: "bun"
44
directory: "/react/"
55
schedule:
66
interval: "weekly"
77
commit-message:
8-
prefix: "[npm]"
8+
prefix: "[bun]"
99
include: "scope"
1010
target-branch: "react-rewrite"
1111
groups:

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24-
- name: Set up Node
25-
uses: actions/setup-node@v4
24+
- name: Set up Bun
25+
uses: oven-sh/setup-bun@v2
2626
with:
27-
node-version: lts/*
27+
bun-version: latest
2828

2929
- name: Install Dependencies
30-
run: npm ci
30+
run: |
31+
bun install --frozen-lockfile --ignore-scripts
3132
3233
- name: Build Website
33-
run: npm run build
34+
run: bun run build
3435

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
- name: Checkout Repository
2828
uses: actions/checkout@v4
2929

30-
- name: Set up Node
31-
uses: actions/setup-node@v4
30+
- name: Set up Bun
31+
uses: oven-sh/setup-bun@v2
3232
with:
33-
node-version: lts/*
33+
bun-version: latest
3434

3535
- name: Install Dependencies
3636
run: |
37-
npm ci
37+
bun install --frozen-lockfile --ignore-scripts
3838
3939
- name: Initialize CodeQL
4040
uses: github/codeql-action/init@v3

.github/workflows/lint.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
- name: Checkout Repository
2121
uses: actions/checkout@v4
2222

23-
- name: Set up Node
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: lts/*
27-
2823
- name: Setup Biome CLI
2924
uses: biomejs/setup-biome@v2
3025

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Created by Mary Delos Reyes [SIG Design Lead] - [mockup](https://www.figma.com/f
1010

1111
Make sure you have the following:
1212

13-
- [Node.js 22](https://nodejs.org/en/download/)
13+
- [Bun](<https://bun.sh/>)
1414

15-
Run `npm install`, then `npm run dev`.
15+
Run `bun install --save-dev`, then `bun run dev`.
1616

17-
A more in-depth introduction (recommended to read) can be found [here](https://docs.ucmacm.com)
17+
A more in-depth introduction (recommended to read) can be found in the [documentation](https://docs.ucmacm.dev).
1818

1919
## Contributing
2020

21-
For more information on how you can get started, please see the [onboarding guide](https://docs.ucmacm.com/website/contributing).
21+
For more information on how you can get started, please see the [onboarding guide](https://docs.ucmacm.dev/docs/projects/chapter-website/).

docker/Dockerfile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
FROM node:22-bookworm-slim
1+
FROM oven/bun:1-slim AS build
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

5-
RUN apt-get update \
6-
&& apt-get install -y --no-install-recommends \
7-
tini \
8-
&& apt-get clean
9-
105
WORKDIR /website
116
COPY /react /website
127

@@ -15,18 +10,18 @@ RUN adduser --disabled-password --gecos "" website \
1510

1611
USER website
1712

18-
RUN npm ci --ignore-scripts \
19-
&& npm run build
13+
RUN bun install --frozen-lockfile --ignore-scripts \
14+
&& bun run build
2015

21-
EXPOSE 3000
16+
FROM nginxinc/nginx-unprivileged:stable-alpine-perl
2217

23-
ENTRYPOINT ["/usr/bin/tini", "--"]
18+
COPY --from=build /website/dist /usr/share/nginx/html
2419

25-
CMD ["npx", "--yes", "serve", "/website/dist", "--no-clipboard"]
20+
EXPOSE 8080
2621

27-
STOPSIGNAL SIGTERM
22+
CMD ["nginx", "-g", "daemon off;"]
2823

29-
HEALTHCHECK --interval=5m --timeout=3s CMD ["curl", "-f" , "http://localhost:3000/", "||", "exit 1"]
24+
HEALTHCHECK --interval=5m --timeout=3s CMD ["curl", "-f" , "http://localhost:8080/", "||", "exit 1"]
3025

3126
LABEL org.opencontainers.image.title="Chapter-Website"
3227
LABEL org.opencontainers.image.description="ACM @ UC Merced's website"

docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ services:
55
container_name: chapter-website
66
image: ghcr.io/ucmercedacm/chapter-website:edge
77
ports:
8-
- 3000:3000
8+
- 3000:8080
99
healthcheck:
10-
test: curl -f http://localhost:3000/ || exit 1
10+
test: curl -f http://localhost:8080/ || exit 1
1111
interval: 5m
1212
start_interval: 30s
1313
start_period: 5m

lefthook.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ pre-commit:
22
commands:
33
check:
44
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
5-
run: npx --yes @biomejs/biome check --write --error-on-warnings --colors=off {staged_files}
5+
root: "react/"
6+
run: bunx --bun biome check --write --error-on-warnings --colors=off {staged_files}
67
stage_fixed: true
78
rustywind:
89
glob: "*.{js,ts,jsx,tsx}"
9-
run: npx --yes rustywind {staged_files} --write
10+
root: "react/"
11+
run: bunx --bun rustywind --write {staged_files}
1012
stage_fixed: true

react/biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
33
"files": {
44
"ignoreUnknown": true,
55
"includes": [
@@ -9,7 +9,7 @@
99
"!**/.idea",
1010
"!**/public/",
1111
"!**/dist",
12-
"!**/package-lock.json"
12+
"!**/bun.lock"
1313
]
1414
},
1515
"formatter": {

0 commit comments

Comments
 (0)