feat: walking skeleton — Go harness, SolidJS shell, supervised hugo preview #18
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1
What this is
The end-to-end spine everything else plugs into: a single Go binary (
harness serve --site <dir>) that serves an embedded SolidJS admin shell and supervises ahugo server --buildDraftssubprocess, with the live site shown in the shell's preview iframe.How it works
internal/supervisorpicks a free loopback port once at startup (so the preview URL stays stable across restarts), spawnshugo server --buildDrafts --bind 127.0.0.1 --port N --baseURL http://127.0.0.1:N/, and restarts it on crash with exponential backoff (500ms → 5s, reset after a healthy run). Combined stdout/stderr goes into a 200-line ring buffer;ERRORlines setlastBuildError, a newChange detectedrebuild clears it. Graceful stop via SIGTERM with a 3s SIGKILL escalation — no orphan processes.internal/serverexposesGET /api/status(state / previewUrl / restarts / lastExit / lastBuildError / output) and serves the SPA fromgo:embedwith index.html fallback. The CLI refuses any non-loopback--addr(D19).web/is a SolidJS + Vite + TypeScript three-pane placeholder shell (page tree / form / preview, per D11). It polls/api/statusevery 1.5s using per-field signals, so the iframesrcis only ever assigned when the URL actually changes — Hugo LiveReload inside the iframe survives polling. Build errors show as a red banner over the live iframe; a crashed Hugo replaces the iframe with the captured output tail and a "restarting automatically" note.testdata/siteis a self-contained sample Hugo site (includes a draft post to prove--buildDrafts) used by the supervisor integration test..forgejo/workflows/ci.yml) builds/tests the frontend first (go:embed needsweb/dist), then runsgo vet,go test(with hugo 0.161.1 installed for the integration test), andgo build.Verification performed (all live, against the built binary)
go vet ./...clean;go test -race ./...green (incl. real-hugo integration test);npm run build+npm test(4/4) green;tsc --noEmitclean/from the embedded FS;/api/statusmatches the documented contractlastBuildErrorpopulated (state staysrunning); restoring → clearedlastExitinstead of a dead iframeSIGKILLof the hugo child → supervisor restarts it (restarts incremented, same preview URL)SIGTERMof the harness → clean shutdown, zero orphan processes--addr 0.0.0.0:9999refused (exit 2); missing/non-Hugo site dir rejected with friendly errorsNotes for the reviewer
ci.ymlusesruns-on: docker(forgejo-runner's default label) — adjust if this instance's runners use different labels.go buildrequiresweb/distto exist (frontend build first);makeencodes the ordering, README documents it.harness init(#17).🤖 Generated with Claude Code
https://claude.ai/code/session_01WFnCfoX1pGAGyWeaisv2Gr