Skip to content

Commit e629657

Browse files
authored
Migrate to bun (#414)
1 parent 377e381 commit e629657

File tree

12 files changed

+105
-4132
lines changed

12 files changed

+105
-4132
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ trim_trailing_whitespace = true
99
[*.{js,ts}]
1010
indent_style = space
1111
indent_size = 4
12+
13+
[package.json]
14+
indent_style = space
15+
indent_size = 2

.github/workflows/CI.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ jobs:
2424
show-progress: false
2525
fetch-depth: 0
2626

27-
- uses: actions/setup-node@v4
27+
- uses: oven-sh/setup-bun@v1
2828
with:
29-
node-version: '20'
30-
cache: npm
29+
bun-version: latest
3130

32-
- run: npm ci
31+
- run: bun install
3332
- run: npm run ci
3433

3534
build:

.nvmrc

-1
This file was deleted.

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"explorer.fileNesting.enabled": true,
33
"explorer.fileNesting.patterns": {
44
"tsconfig.json": "tsconfig.*.json",
5-
"package.json": "package-lock.json, .npmrc, yarn.lock, .yarnrc, .nvmrc",
5+
"package.json": "package-lock.json, .npmrc, yarn.lock, .yarnrc, .nvmrc, bun.lockb",
66
"flake.nix": "flake.lock",
77
"*.ts": "$(capture).test.ts"
88
},

Dockerfile

+7-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
FROM node:21-slim as dependency-base
1+
FROM oven/bun:latest as runtime-dependencies
22
WORKDIR /app
3-
RUN apt-get update -yqq \
4-
&& apt-get install -yqq \
5-
python3 build-essential pkg-config \
6-
&& apt-get clean -yqqq
7-
8-
FROM dependency-base as build
9-
# Install dependencies (with dev-deps)
10-
RUN --mount=type=bind,source=package.json,target=package.json \
11-
--mount=type=bind,source=package-lock.json,target=package-lock.json \
12-
--mount=type=cache,target=/root/.npm \
13-
npm ci
14-
15-
COPY . /app/
16-
RUN npm run compile
17-
18-
FROM dependency-base as runtime-dependencies
193
RUN --mount=type=bind,source=package.json,target=package.json \
20-
--mount=type=bind,source=package-lock.json,target=package-lock.json \
21-
--mount=type=cache,target=/root/.npm \
22-
NODE_ENV=production npm ci
4+
--mount=type=bind,source=bun.lockb,target=bun.lockb \
5+
--mount=type=cache,target=/root/.bun/install/cache \
6+
NODE_ENV=production bun install
237

24-
FROM node:21-slim
8+
FROM oven/bun:latest
259
WORKDIR /app
2610
RUN apt-get update -yqqq \
2711
&& apt-get install -yqqq \
@@ -39,8 +23,6 @@ FROM node:21-slim
3923
RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime
4024

4125
COPY --from=runtime-dependencies /app/node_modules /app/node_modules
42-
COPY --from=build /app/package.json /app/package.json
43-
COPY --from=build /app/assets /app/assets
44-
COPY --from=build /app/built /app/built
26+
COPY ./ /app/
4527

46-
ENTRYPOINT ["node", "--es-module-specifier-resolution=node", "built/app.js"]
28+
ENTRYPOINT ["bun", "src/app.ts"]

bun.lockb

124 KB
Binary file not shown.

0 commit comments

Comments
 (0)