Skip to content

build(ui): source-only main; build & embed UI at release time#99

Merged
aksOps merged 1 commit into
mainfrom
chore/source-only-dist
Jun 5, 2026
Merged

build(ui): source-only main; build & embed UI at release time#99
aksOps merged 1 commit into
mainfrom
chore/source-only-dist

Conversation

@aksOps

@aksOps aksOps commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Why

The built React UI was committed under internal/ui/dist. This switches to a
source-only main: the dist is generated at release time and embedded into
the tagged commit, not carried on the branch.

go install <module>@<tag> only compiles Go (never runs vite), so the tagged
commit must carry the built dist for the installed binary to be UI-complete.
That's now handled by scripts/release.sh — main stays artifact-free.

Changes

  • Untrack internal/ui/dist/**; track only a .gitkeep placeholder so
    //go:embed all:dist still compiles on a source-only checkout. .gitignore
    ignores everything in dist except .gitkeep.
  • internal/ui/ui.go: //go:embed static/* diststatic/* all:dist.
  • scripts/release.sh + make release VERSION=…: build the UI, create a
    detached release commit that includes dist, tag it, push only the tag.
    ui-build/release re-touch .gitkeep (vite emptyOutDir wipes it).
  • README: document the source-only build + release flow.

Validation

  • go build ./... compiles with only .gitkeep present (CI's go build path).
  • make build produces a UI-complete binary and leaves the tree clean (built
    assets correctly ignored — no accidental-commit footgun).
  • No Go test depends on real dist content.

A plain go build . now serves no SPA at / until the UI is built; use
make build or a release tag (which embeds the built UI).

🤖 Generated with Claude Code

The built React UI was committed under internal/ui/dist. Switch to a
source-only main: the dist is generated at release time and embedded into the
tagged commit, not carried on the branch.

- Untrack internal/ui/dist/** (built assets); track only a .gitkeep placeholder
  so `//go:embed all:dist` still compiles on a source-only checkout. .gitignore
  ignores everything in dist except .gitkeep.
- internal/ui/ui.go: `//go:embed static/* dist` -> `static/* all:dist` (embeds
  the dotfile placeholder; a plain `go build` serves no SPA until the UI is
  built — release tags carry the real dist so `go install ...@<tag>` is
  UI-complete).
- scripts/release.sh + `make release VERSION=...`: build the UI, create a
  detached release commit that includes dist, tag it, push only the tag. main
  stays artifact-free. ui-build/release re-touch .gitkeep (vite emptyOutDir
  wipes it).
- README: document the source-only build + release flow.

go build ./... compiles with only .gitkeep present; make build produces a
UI-complete binary and leaves the tree clean (built assets ignored).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@aksOps aksOps merged commit 8fcc76e into main Jun 5, 2026
17 checks passed
@aksOps aksOps deleted the chore/source-only-dist branch June 5, 2026 11:06
aksOps added a commit that referenced this pull request Jun 5, 2026
Move Unreleased into a dated [v0.2.0-beta.6] section; add #98/#99 work + go 1.25.11; refresh compare links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant