{message}
+{details}
+ {stack && ( +
+ {stack}
+
+ )}
+ From 27173c01da909c6ac39fb3ba89036ed84b00e0d5 Mon Sep 17 00:00:00 2001 From: GW_MC <72297530+GWMCwing@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:18:14 +0800 Subject: [PATCH 1/6] Added basic frontend setup --- apps/frontend/.dockerignore | 4 + apps/frontend/.gitignore | 7 + apps/frontend/app/app.css | 15 + apps/frontend/app/root.tsx | 59 + apps/frontend/app/routes.ts | 3 + apps/frontend/app/routes/home.tsx | 10 + apps/frontend/package.json | 33 + apps/frontend/pnpm-lock.yaml | 4748 ++++++++++++++++++++++++++ apps/frontend/public/favicon.ico | Bin 0 -> 15086 bytes apps/frontend/react-router.config.ts | 5 + apps/frontend/tsconfig.json | 22 + apps/frontend/vite.config.ts | 9 + justfile | 12 + 13 files changed, 4927 insertions(+) create mode 100644 apps/frontend/.dockerignore create mode 100644 apps/frontend/.gitignore create mode 100644 apps/frontend/app/app.css create mode 100644 apps/frontend/app/root.tsx create mode 100644 apps/frontend/app/routes.ts create mode 100644 apps/frontend/app/routes/home.tsx create mode 100644 apps/frontend/package.json create mode 100644 apps/frontend/pnpm-lock.yaml create mode 100644 apps/frontend/public/favicon.ico create mode 100644 apps/frontend/react-router.config.ts create mode 100644 apps/frontend/tsconfig.json create mode 100644 apps/frontend/vite.config.ts diff --git a/apps/frontend/.dockerignore b/apps/frontend/.dockerignore new file mode 100644 index 0000000..9b8d514 --- /dev/null +++ b/apps/frontend/.dockerignore @@ -0,0 +1,4 @@ +.react-router +build +node_modules +README.md \ No newline at end of file diff --git a/apps/frontend/.gitignore b/apps/frontend/.gitignore new file mode 100644 index 0000000..039ee62 --- /dev/null +++ b/apps/frontend/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +.env +/node_modules/ + +# React Router +/.react-router/ +/build/ diff --git a/apps/frontend/app/app.css b/apps/frontend/app/app.css new file mode 100644 index 0000000..99345d8 --- /dev/null +++ b/apps/frontend/app/app.css @@ -0,0 +1,15 @@ +@import "tailwindcss"; + +@theme { + --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +html, +body { + @apply bg-white dark:bg-gray-950; + + @media (prefers-color-scheme: dark) { + color-scheme: dark; + } +} diff --git a/apps/frontend/app/root.tsx b/apps/frontend/app/root.tsx new file mode 100644 index 0000000..b0e9a73 --- /dev/null +++ b/apps/frontend/app/root.tsx @@ -0,0 +1,59 @@ +import { isRouteErrorResponse, Links, Meta, Outlet, Scripts, ScrollRestoration } from 'react-router'; + +import type { Route } from './+types/root'; +import './app.css'; +import { Theme } from '@radix-ui/themes'; + +export const links: Route.LinksFunction = () => []; + +export function Layout({ children }: { children: React.ReactNode }) { + return ( + +
+ + + +{details}
+ {stack && ( +
+ {stack}
+
+ )}
+ BP_2ehBt1?`~ypvg_Ot4x1V+43P@Ve8>qd)9NX_jWdLo`Zfy
zoeam9)@Dpym{4m@+LNx K7osU{Xp5PG4-K+L2G=)c3f&}H&M3wo7TlO_UJjQ-Oq&_
zjAc9=nNIYz{c3zxOiS5UfcE1}8#iI4@uy;$Q7>}u`j+OU0N<*Ezx$k{x_27+{s2Eg
z`^=rhtIzCm!_UcJ? The requested resource was not found on this server. Possibly the frontend build is missing or corrupted.404 Not Found
+ 404 - Not Found
;
+}
From 0374d63efee3788d58bffb482b85eb414593a078 Mon Sep 17 00:00:00 2001
From: GW_MC <72297530+GWMCwing@users.noreply.github.com>
Date: Tue, 2 Dec 2025 20:18:48 +0800
Subject: [PATCH 5/6] Add frontend build artifact handling and linting steps to
CI workflow
---
.github/workflows/test.yml | 67 +++++++++++++++++++++++++++++++++-----
justfile | 8 +++++
2 files changed, 66 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 638bb91..0cbc987 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -44,6 +44,7 @@ jobs:
fi
test:
+ needs: frontend-build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -54,9 +55,42 @@ jobs:
- name: Setup Rust, checkout and restore caches
uses: ./.github/actions/setup-rust
+ - name: Download frontend build
+ uses: actions/download-artifact@v4
+ with:
+ name: frontend-build
+ path: apps/frontend/build
+
- name: Run tests
run: cargo test --all-features
+ lint:
+ needs: frontend-build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Setup Rust, checkout and restore caches
+ uses: ./.github/actions/setup-rust
+ with:
+ components: clippy, rustfmt
+
+ - name: Download frontend build
+ uses: actions/download-artifact@v4
+ with:
+ name: frontend-build
+ path: apps/frontend/build
+
+ - name: Run clippy
+ run: cargo clippy --all-features -- -D warnings
+
+ - name: Check code formatting
+ run: cargo fmt --all -- --check
+
+
test-frontend:
runs-on: ubuntu-latest
steps:
@@ -88,21 +122,36 @@ jobs:
cd apps/frontend
pnpm test
- lint:
+ frontend-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
+
+ - uses: pnpm/action-setup@v4
with:
- fetch-depth: 0
+ version: 10
+ run_install: false
- - name: Setup Rust, checkout and restore caches
- uses: ./.github/actions/setup-rust
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
with:
- components: clippy, rustfmt
+ node-version: 22
+ cache: 'pnpm'
+ cache-dependency-path: apps/frontend/pnpm-lock.yaml
- - name: Run clippy
- run: cargo clippy --all-features -- -D warnings
+ - name: Install frontend dependencies
+ run: |
+ cd apps/frontend
+ pnpm install
- - name: Check code formatting
- run: cargo fmt --all -- --check
\ No newline at end of file
+ - name: Build frontend
+ run: |
+ cd apps/frontend
+ pnpm build
+
+ - name: Upload frontend build artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: frontend-build
+ path: apps/frontend/build
\ No newline at end of file
diff --git a/justfile b/justfile
index 44963be..a048e1d 100644
--- a/justfile
+++ b/justfile
@@ -52,3 +52,11 @@ build-backend:
cargo build --release
build: build-frontend build-backend
+
+act *args:
+ if [ -n "{{args}}" ]; then \
+ act {{args}} --artifact-server-path /tmp/artifacts; \
+ else \
+ act; \
+ fi
+
From c79ef265dbdea9ff8cd88a680e3b577a62d1e1d6 Mon Sep 17 00:00:00 2001
From: GW_MC <72297530+GWMCwing@users.noreply.github.com>
Date: Tue, 2 Dec 2025 20:44:18 +0800
Subject: [PATCH 6/6] use workflow specific cache instead of artifact
---
.github/workflows/test.yml | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0cbc987..4956b9a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -55,11 +55,13 @@ jobs:
- name: Setup Rust, checkout and restore caches
uses: ./.github/actions/setup-rust
- - name: Download frontend build
- uses: actions/download-artifact@v4
+ - name: Restore frontend build cache
+ uses: actions/cache@v4
with:
- name: frontend-build
path: apps/frontend/build
+ key: frontend-build-${{ runner.os }}-run-${{ github.run_id }}
+ restore-keys: |
+ frontend-build-${{ runner.os }}-
- name: Run tests
run: cargo test --all-features
@@ -78,11 +80,13 @@ jobs:
with:
components: clippy, rustfmt
- - name: Download frontend build
- uses: actions/download-artifact@v4
+ - name: Restore frontend build cache
+ uses: actions/cache@v4
with:
- name: frontend-build
path: apps/frontend/build
+ key: frontend-build-${{ runner.os }}-run-${{ github.run_id }}
+ restore-keys: |
+ frontend-build-${{ runner.os }}-
- name: Run clippy
run: cargo clippy --all-features -- -D warnings
@@ -150,8 +154,10 @@ jobs:
cd apps/frontend
pnpm build
- - name: Upload frontend build artifact
- uses: actions/upload-artifact@v4
+ - name: Cache frontend build
+ uses: actions/cache@v4
with:
- name: frontend-build
- path: apps/frontend/build
\ No newline at end of file
+ path: apps/frontend/build
+ key: frontend-build-${{ runner.os }}-run-${{ github.run_id }}
+ restore-keys: |
+ frontend-build-${{ runner.os }}-