mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
bun + update
This commit is contained in:
1 parent
3757b784de
commit
d0a027a2a1
11 files changed
+1059
-6767
No files matched your search
+9
-11
@@ -14,35 +14,33 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Bun
|
||||||
uses: actions/setup-node@v4
|
uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
node-version: '25'
|
bun-version: '1.3'
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: frontend/package-lock.json
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: bun install --frozen-lockfile
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Typecheck
|
||||||
run: npm run typecheck
|
run: bun run typecheck
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: bun run lint
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Format Check
|
- name: Format Check
|
||||||
run: npm run format:check
|
run: bun run format:check
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm test -- --run
|
run: bun run test
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: bun run build
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
backend-check:
|
backend-check:
|
||||||
|
|||||||
@@ -12,35 +12,33 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Bun
|
||||||
uses: actions/setup-node@v4
|
uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
node-version: '25'
|
bun-version: '1.3'
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: frontend/package-lock.json
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: bun install --frozen-lockfile
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Typecheck
|
||||||
run: npm run typecheck
|
run: bun run typecheck
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: bun run lint
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Format Check
|
- name: Format Check
|
||||||
run: npm run format:check
|
run: bun run format:check
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm test -- --run
|
run: bun run test
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: bun run build
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
backend-check:
|
backend-check:
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ cargo run # listens on 0.0.0.0:8001
|
|||||||
#### Frontend
|
#### Frontend
|
||||||
```bash
|
```bash
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
bun install
|
||||||
npm run dev
|
bun run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
> The Rust backend uses the existing SQLite database under `data/db.sqlite3`. The `data/` directory is retained as the data store (db, `media/`, `banners/`, `backups/`).
|
> The Rust backend uses the existing SQLite database under `data/db.sqlite3`. The `data/` directory is retained as the data store (db, `media/`, `banners/`, `backups/`).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# --- Build stage ------------------------------------------------------------
|
# --- Build stage ------------------------------------------------------------
|
||||||
# Pin the toolchain image; the crate is edition 2021 with no nightly features.
|
# Pin the toolchain image; the crate is edition 2021 with no nightly features.
|
||||||
FROM rust:1-slim-bookworm AS build
|
FROM rust:1-slim-trixie AS build
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
@@ -36,7 +36,9 @@ RUN touch src/main.rs && cargo build --release \
|
|||||||
&& strip target/release/holy_backend_rs
|
&& strip target/release/holy_backend_rs
|
||||||
|
|
||||||
# --- Runtime stage ----------------------------------------------------------
|
# --- Runtime stage ----------------------------------------------------------
|
||||||
FROM debian:bookworm-slim
|
# Must stay on the same Debian release as the build stage — the binary links
|
||||||
|
# against that release's glibc.
|
||||||
|
FROM debian:trixie-slim
|
||||||
|
|
||||||
# curl for the container healthcheck; ca-certificates for outbound HTTPS
|
# curl for the container healthcheck; ca-certificates for outbound HTTPS
|
||||||
# (Shopify sync, SMTP over TLS).
|
# (Shopify sync, SMTP over TLS).
|
||||||
|
|||||||
@@ -4,3 +4,5 @@ dist/
|
|||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
bun-debug.log
|
||||||
|
package-lock.json
|
||||||
+10
-5
@@ -1,8 +1,11 @@
|
|||||||
# --- Build Stage ---
|
# --- Build Stage ---
|
||||||
FROM node:lts-alpine AS build-stage
|
# Bun replaces npm for install + scripts. bun.lock is the lockfile of record
|
||||||
|
# (package-lock.json is gone); --frozen-lockfile fails the build loudly if it
|
||||||
|
# has drifted from package.json instead of quietly resolving something else.
|
||||||
|
FROM oven/bun:1.3-alpine AS build-stage
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package.json bun.lock ./
|
||||||
RUN npm install
|
RUN bun install --frozen-lockfile
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Pass VITE environment variables during build
|
# Pass VITE environment variables during build
|
||||||
@@ -20,10 +23,12 @@ ENV VITE_IMPRESSUM_CITY=${VITE_IMPRESSUM_CITY}
|
|||||||
ENV VITE_IMPRESSUM_EMAIL=${VITE_IMPRESSUM_EMAIL}
|
ENV VITE_IMPRESSUM_EMAIL=${VITE_IMPRESSUM_EMAIL}
|
||||||
ENV VITE_IMPRESSUM_PHONE=${VITE_IMPRESSUM_PHONE}
|
ENV VITE_IMPRESSUM_PHONE=${VITE_IMPRESSUM_PHONE}
|
||||||
|
|
||||||
RUN npm run build
|
RUN bun run build
|
||||||
|
|
||||||
# --- Production Stage ---
|
# --- Production Stage ---
|
||||||
FROM nginx:stable-alpine
|
# nginx 1.30 is the current stable branch (identical to `stable-alpine` today),
|
||||||
|
# pinned so a rebuild can't silently roll onto the next branch.
|
||||||
|
FROM nginx:1.30-alpine
|
||||||
# Copy built files
|
# Copy built files
|
||||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
|||||||
+1020
File diff suppressed because it is too large.
Load diff
Generated
-6733
File diff suppressed because it is too large.
Load diff
@@ -15,7 +15,7 @@
|
|||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"schema:export": "curl -fsS http://localhost:8001/api/schema/ -o ../schema.yaml",
|
"schema:export": "curl -fsS http://localhost:8001/api/schema/ -o ../schema.yaml",
|
||||||
"openapi:gen": "openapi-typescript ../schema.yaml -o src/api/schema.d.ts",
|
"openapi:gen": "openapi-typescript ../schema.yaml -o src/api/schema.d.ts",
|
||||||
"openapi:sync": "npm run schema:export && npm run openapi:gen"
|
"openapi:sync": "bun run schema:export && bun run openapi:gen"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@catppuccin/palette": "^1.7.1",
|
"@catppuccin/palette": "^1.7.1",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { components } from './schema';
|
|||||||
export type Schemas = components['schemas'];
|
export type Schemas = components['schemas'];
|
||||||
|
|
||||||
// Re-exported from generated OpenAPI schema.
|
// Re-exported from generated OpenAPI schema.
|
||||||
// Regenerate with `npm run openapi:sync` after backend serializer changes.
|
// Regenerate with `bun run openapi:sync` after backend serializer changes.
|
||||||
export type Banner = Schemas['Banner'];
|
export type Banner = Schemas['Banner'];
|
||||||
export type Category = Schemas['Category'];
|
export type Category = Schemas['Category'];
|
||||||
export type Flavor = Schemas['Flavor'];
|
export type Flavor = Schemas['Flavor'];
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ echo "Step 1: Checking Frontend Formatting..."
|
|||||||
cd "$ROOT_DIR/frontend"
|
cd "$ROOT_DIR/frontend"
|
||||||
if ! bun run format:check; then
|
if ! bun run format:check; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "❌ ERROR: Frontend formatting issues found. Run 'npm run format' in frontend/."
|
echo "❌ ERROR: Frontend formatting issues found. Run 'bun run format' in frontend/."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user