From 471f3bae8d1d716bbe51933cb4cc2dcc0c8143f1 Mon Sep 17 00:00:00 2001 From: Moritz Utcke <62291876+Letsmoe@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:33:17 +0600 Subject: [PATCH] Umstellung von Node.js auf Bun V1.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bun v1.0.0 ist vor einigen Tagen rausgekommen und bietet weitreichende Verbesserungen in Punkto Entwickler-Freundlichkeit und Geschwindigkeit beim Ausführen von Skripten, daher stellen wir nun alle Projekte auf Bun um. --- .github/workflows/cd.yml | 3 ++- .gitignore | 1 + Dockerfile | 7 +++---- docker-compose.yml | 2 +- package.json | 10 +++++----- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3bf412b5..631fc2b8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,5 +22,6 @@ jobs: git clean -f -d git pull origin main git status - pnpm install + npm install -g bun + bun install bash build.sh diff --git a/.gitignore b/.gitignore index 46086a3a..0a8440b5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ pnpm-debug.log* # lockfile pnpm-lock.yaml +bun.lockb # environment variables .env diff --git a/Dockerfile b/Dockerfile index 8dc33f23..f9a71dc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -FROM node:19.8-alpine3.16 +FROM oven/bun EXPOSE 3000 -RUN npm i -g pnpm WORKDIR /online-energieausweis COPY ./package.json ./ COPY . . -RUN pnpm install --prod +RUN bun install --prod -CMD ["pnpm", "run", "build:production"] \ No newline at end of file +CMD ["bun", "run", "build:production"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 72de1dd7..92e3f836 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: online-energieausweis: build: ./ container_name: online-energieausweis - command: pnpm run dev --host + command: bun run dev --host links: - database environment: diff --git a/package.json b/package.json index 90065ea0..ed66e0cc 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "license": "GPL V3.0", "type": "module", "scripts": { - "dev": "astro dev", - "build": "astro build", - "preview": "astro preview", + "dev": "bun --bun astro dev", + "build": "bun --bun astro build", + "preview": "bun --bun astro preview", "astro": "astro", "test:e2e": "cypress run", "test:unit": "vitest", "format": "prettier --write .", - "build:production": "astro build && node server.js", - "i18n:generate": "npx astro-i18next generate" + "build:production": "astro build && bun --bun server.js", + "i18n:generate": "bunx astro-i18next generate" }, "private": true, "dependencies": {