build: a clone compiles before the frontend is built

rust-embed refused to derive without `web/dist`, so on a fresh clone
`cargo check`, `cargo test` and rust-analyzer failed with a derive error that
did not say what was missing. With `allow_missing` the embed is empty until
the frontend is built, and the handler gives the answer it already had for
that case, "frontend not built". The release build is unchanged once
`web/dist` is there, which `make build`, the Dockerfile and CI all see to.
This commit is contained in:
nvrl committed 2026-10-21 12:35:59 +02:00
1 parent 0e0d21506e
commit a59ba4af1b
4 files changed
+14 -9

No files matched your search

+7 -5
View File
@@ -7,9 +7,11 @@ make dev-api # cargo run, serving the API on :4242
make dev-web # vite on :4243, proxying /api to :4242
```
Open <http://127.0.0.1:4243>. The Rust build embeds `web/dist`, so build the
frontend once (`cd web && bun install && bun run build`) before the first
`cargo build`; a debug build reads `web/dist` from disk after that.
Open <http://127.0.0.1:4243>. The release binary embeds `web/dist`, and a
debug build reads it from disk, so build the frontend once
(`cd web && bun install && bun run build`) for `cargo run` alone to serve the
app. Without it the Rust side still compiles and tests, and the pages answer
"frontend not built".
Point `WORKSPACE_DATA_DIR` at a throwaway directory while trying things, so the
real data stays out of it.
@@ -57,8 +59,8 @@ block at the bottom.
`.github/workflows/ci.yml` runs on every push and pull request:
- **rust**: builds the frontend (the binary embeds it), then format, clippy
and the tests;
- **rust**: builds the frontend, so the tests see the app the binary ships,
then format, clippy and the tests;
- **web**: svelte-check;
- **docs**: checks that the generated wiki pages are up to date and that every
link between the pages resolves.