@overkube/web
v0.1.6
Published
overkube's page: the registry of the dashboard's kinds, the addons run in it (their lifecycle), the cluster they are given, and the frame that draws what they define — for a host to boot into a page of its own
Readme
@overkube/web
overkube's page: what the browser runs. Started in order (src/boot.ts): signed in as its server says one signs in here (GET /auth; src/session.tsx: not signed in, the sign-in screen alone); the connector to the gateway at /kube (@overkube/connector) and the source answering queries over it (@overkube/source); overweave's registry of the dashboard's kinds (@overkube/sdk); the user's changes read back (@overkube/shell's UserService, in localStorage); the addons run in it (src/host: their lifecycle — requirements, retries, ?safe runs the core alone); the shell drawn into #app (?debug: the slots over it). The addons in its bundle: src/addons.ts — the core, metrics, cert-manager, trivy, helm, flux.
npm run dev -w @overkube/web # Vite, with /kube and /auth passed to OVERKUBE_SERVER (http://127.0.0.1:8080)
npm run build -w @overkube/web # dist/: what the server serves as OVERKUBE_UIThe dev stand (make dev) runs the first at http://localhost:5173; the image copies the second to /app/ui. vite.config.ts reads the workspace's packages and overweave from their sources (the overkube-source and overweave-source conditions), one Preact.
For a host that draws the page into a page of its own (a platform's plugin), it is published as a library, @overkube/web (src/index.ts): boot({ element, asked, gateway, headers, signIn: false, addons }) — its gateway where the host serves it, the host's headers on every request (a CSRF token), no /auth asked (the host has signed the user in), the host's own addons beside the page's; it answers the registry and close(). Its own packages (the addons, the shell, the runtime, the source, the connector) are bundled in; those a host's addons are written with — @overkube/sdk, @overkube/uikit, @overkube/kube-types, @overkube/query, @overkube/gateway, overweave, Preact — are dependencies, one of each in the host's bundle. @overkube/web/styles is the page around it (the fonts, src/page.css), for the host's bundler.
import { boot } from '@overkube/web';
import '@overkube/web/styles';
const page = await boot({ element, asked: new URLSearchParams(location.search), gateway: '/plugins/overkube/kube', signIn: false });npm run build:lib -w @overkube/web # lib/: the library (vite.lib.config.ts), its types