Documentation
¶
Overview ¶
Package web carries the built review SPA.
A Go package inside the npm project rather than an embed from cmd/raglit, because //go:embed cannot reach outside the directory of the package that declares it — "../../web/dist" is not a legal embed pattern. Putting the embed here keeps the whole frontend, source and build output and all, in one directory that the Go build imports like any other package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotBuilt = errors.New("raglit: the review UI was not built into this binary (run `make web`)")
ErrNotBuilt reports a binary built without the UI.
Functions ¶
func Built ¶
func Built() bool
Built reports whether an index.html is embedded — the committed placeholder counts, which is deliberate: it is what keeps the SPA tests running on every clean checkout instead of skipping them.
func Dist ¶
Dist is the built bundle, rooted at the directory holding index.html.
With a clean checkout dist holds only the committed placeholder, which IS an index.html — so Built() is true and the tests run everywhere. This branch is for a tree where someone deleted dist/index.html: serve a page that SAYS the UI was not built rather than a blank one or a 404. The one thing a reader needs here is the build command.
Types ¶
This section is empty.