web

package
v0.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package web embeds the Vue console and TODO app that `pnpm -C web build` produces, so a released ovdb binary serves them with no Node runtime and no separate asset directory to ship alongside it.

dist/ is git-ignored except for dist/.gitkeep, which exists only because the go:embed directive below refuses a directory that is not there, so it needs something to embed in a clean clone. dist/.gitkeep is not committed directly: it is copied there from the tracked public/.gitkeep by every `vite build`, because Vite empties dist/ before each build and would otherwise delete a placeholder committed straight into it — the same technique wb's Astro build uses for hub/web/dist/.gitkeep. Handler then serves the friendly not-built page instead of the console. This is S3 of spec/features/configuration-parity #REQ:increment-zero-spikes, implementing spec/features/local-server-and-web-console#REQ:embedded-assets. Modeled on sneat-dev/wb's hub/web/embed.go, the reference implementation this pattern was proven against.

internal/localserver mounts Handler for signed-in browsers; everyone else gets its landing page.

Index

Constants

This section is empty.

Variables

View Source
var Dist embed.FS

Dist holds every file the Vite build emitted, or only .gitkeep in a clone where `pnpm -C web build` has never run.

View Source
var TokensCSS []byte

TokensCSS is the design token stylesheet (colours for light and dark) the console is built from. The Go-rendered landing and sign-in pages serve it too, so both look like one product without a second copy of the tokens.

Functions

func Built

func Built() bool

Built reports whether a real console build is embedded.

func Handler

func Handler() http.Handler

Handler serves the embedded console at "/" and the embedded TODO app at "/apps/todo/", matching the Vite multi-page build's output layout and spec/features/local-server-and-web-console#REQ:route-layout.

Types

type Route added in v0.9.0

type Route struct {
	Path   string `json:"path"`
	Screen string `json:"screen"`
	// Prefix routes also match every path below Path (/browse/todo/lists).
	Prefix bool `json:"prefix,omitempty"`
}

Route is one console route.

func Routes added in v0.9.0

func Routes() []Route

Routes returns the console's client-side routes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL