!refactor: replace node with bun #3

Merged
t.behrendt merged 1 commits from refactor-replace-node-with-bun into main 2025-01-07 18:06:12 +01:00
8 changed files with 34 additions and 5915 deletions

1
.bun-version Normal file
View File

@@ -0,0 +1 @@
1.1.42

View File

@@ -16,19 +16,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: ${{ inputs.node-version }}
bun-version-file: ".bun-version"
- name: Install dependencies
run: npm install
run: bun install --frozen-lockfile
- name: Run lint
run: npm run check:code
run: bun run check:code
- name: Run spellcheck
run: npm run check:spell
run: bun run check:spell
build_and_push:
name: Build and push

View File

@@ -1,4 +1,5 @@
name: CI
on:
pull_request:
@@ -10,16 +11,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: ${{ inputs.node-version }}
bun-version-file: ".bun-version"
- name: Install dependencies
run: npm install
run: bun install --frozen-lockfile
- name: Run lint
run: npm run check:code
run: bun run check:code
- name: Run spellcheck
run: npm run check:spell
run: bun run check:spell

1
.nvmrc
View File

@@ -1 +0,0 @@
v18.12.1

View File

@@ -1,13 +1,23 @@
FROM node:18.12-slim
FROM oven/bun:1.1.42 AS base
WORKDIR /app
COPY ["package.json", "package-lock.json", "./"]
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
RUN npm install
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS build
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
RUN bun run build
RUN npm run build
FROM base as release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=build /app/dist .
CMD [ "node", "dist/app.js"]
CMD [ "node", "/app/app.js"]

BIN
bun.lockb Executable file

Binary file not shown.

5894
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"scripts": {
"build": "npx tsc",
"build": "bun build --minify --target bun --outdir dist --sourcemap src/app.ts",
"check:code": "eslint src/ --ext .ts",
"check:spell": "cspell --config cspell.code.json **/*.ts"
},
@@ -10,11 +10,15 @@
"@typescript-eslint/parser": "^5.46.0",
"cspell": "^6.17.0",
"eslint": "^8.29.0",
"typescript": "^4.9.3"
"typescript": "^4.9.3",
"@types/bun": "latest"
},
"dependencies": {
"gotify": "^1.1.0",
"ts3-nodejs-library": "^3.4.1",
"winston": "^3.8.2"
}
},
"name": "ts3gotify",
"module": "src/app.ts",
"type": "module"
}