web2

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 1 Imported by: 0

README

evva swarm — web SPA (FE v2)

Vue 3 + TypeScript + Pinia + vue-router SPA for the evva service swarm workstation (Veronica). This is the FE v2 app (PRDs: docs/veronica/refine-plan/fe-v2/). The built output (dist/) is embedded into the evva binary via embed.go (package web2) and served by internal/swarm/service (service.go embeds web2.Dist).

v1 lives in ../web and is no longer embedded. It is kept for reference until explicitly retired.

Build / dev / test

npm ci
npm run build      # vue-tsc --noEmit + vite build → web2/dist (embedded by the Go build)
npm run dev        # vite dev server
npm test           # node --test (pure lib) + vitest run (stores)

Notes

  • dist/ is vendored (committed). go build / go install run no node step, so the built SPA must live in the repo. After any frontend change, run npm run build and commit dist/. CI (the web job) rebuilds + runs tests + guards against a stale dist/.
  • Asset names are stable / un-hashed (assets/index.js, assets/index.css, see vite.config.ts); base: './' keeps URLs relative for the embedded FS.
  • Theming: three-layer CSS tokens (src/styles/) — primitive (per-theme raw palette: neon-tokyo, midnight) → semantic (the only layer components read) → component. A new theme = one tokens.primitive.<name>.css + a name in THEMES (src/stores/ui.ts). NEON TOKYO is ported 1:1 from the TUI (pkg/ui/bubbletea/theme/palette.go).
  • Tests: pure, framework-free logic (src/lib/*.test.ts) runs under node --test; Pinia store glue (src/**/*.spec.ts) runs under Vitest.

Layout

src/
  lib/        pure logic (events, colors, api, ws, cron, timeline, segments, tools) + tests
  types/      wire/event contracts mirroring the Go backend
  stores/     Pinia (connection, stream, space, ledger, mail, gate, spaces, session, ui)
  composables/ useSwarm (active-space IO lifecycle)
  router/     vue-router (hash history; URL = state)
  shell/      TopBar, AppLayout, Inspector, SpaceMenu, SpaceSwitcher, ThemeToggle
  views/      Landing, Workspace, Board, Timeline, Stream, Completed, ThemeProbe (/probe)
  components/ base/ (atoms) · stream/ · board/ · attention/ · gates/ · roster/ · compose/ · inspector/ · safety/
  styles/     token system + base scale

Documentation

Overview

Package web2 embeds the built FE v2 SPA (web2/dist) so `evva service` can serve the swarm workstation UI from a single binary.

Like web/embed.go, the embed lives at this module subdir root because go:embed paths cannot climb out of the Go file's directory (no ".."). The service switches its import from web to web2 at the FE-8 cutover; until then this package builds and embeds dist/ but is not yet wired into the service.

dist/ is vendored (committed) with stable, un-hashed asset names so `go build` / `go install` embed a working UI without a node build step. After any frontend change, run `npm run build` in web2/ and commit dist/.

Index

Constants

This section is empty.

Variables

View Source
var Dist embed.FS

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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