From 8387a4208f3520b2ece1bd3269281b129087b0eb Mon Sep 17 00:00:00 2001 From: Joshua King Date: Fri, 5 Jun 2026 08:12:36 -0400 Subject: [PATCH] fix: build frontend into the go:embed path so the hub binary compiles cmd/server/main.go has //go:embed all:src/dist (relative to cmd/server/), but Vite built to repo-root dist/, so cmd/server/src/dist never existed and every `go build` failed with "pattern all:src/dist: no matching files found". The hub binary has never built in CI as a result. - vite.config.ts: outDir -> cmd/server/src/dist (emptyOutDir) - commit cmd/server/src/dist/index.html placeholder so the embed always has a file (real build overwrites it) - .gitignore: scope dist ignore to /dist; ignore cmd/server/src/dist/* but keep the index.html placeholder (the prior !src/dist/index.html rule pointed at the wrong path) - ci.yaml: upload artifact from the new output path Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/ci.yaml | 2 +- .gitignore | 10 ++++++---- cmd/server/src/dist/index.html | 12 ++++++++++++ vite.config.ts | 6 ++++++ 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 cmd/server/src/dist/index.html diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index f6fc484..94768e1 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -46,7 +46,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: dist - path: dist/ + path: cmd/server/src/dist/ deploy: needs: build diff --git a/.gitignore b/.gitignore index 070756b..156113b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,15 @@ lerna-debug.log* # Dependencies node_modules -dist +/dist dist-ssr *.local -# Frontend build output (embedded at Go build time) -# Allow the fallback placeholder so embed always has at least index.html -!src/dist/index.html +# Frontend build output — embedded into the Go binary at build time. +# Vite writes here (cmd/server/src/dist); ignore the built output but keep +# the committed index.html placeholder so //go:embed always has a file. +cmd/server/src/dist/* +!cmd/server/src/dist/index.html # Environment files .env diff --git a/cmd/server/src/dist/index.html b/cmd/server/src/dist/index.html new file mode 100644 index 0000000..55dca8f --- /dev/null +++ b/cmd/server/src/dist/index.html @@ -0,0 +1,12 @@ + + + + + + RemoteRig Hub + + +

RemoteRig hub is running. Frontend not built into this binary.

+ + diff --git a/vite.config.ts b/vite.config.ts index d94d4cd..654e542 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,12 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], + // Build straight into the Go embed location: cmd/server/main.go has + // //go:embed all:src/dist relative to its package dir (cmd/server/). + build: { + outDir: 'cmd/server/src/dist', + emptyOutDir: true, + }, server: { port: 3000, proxy: {