# @banes-lab/web ## Purpose A document site. Every page is a light record under `presentation/records/` whose `registerPage` call names the page and loads its view from `presentation/views/` on demand, so the bundle carries one chunk per page; the route coordinator listens for `route.requested` events, renders the page into the main region, and emits `route.changed` so the panel and the mobile menu mark the active page. Copy lives in `configuration/strings/` as typed `Section` data (`types/document.types.ts`) whose blocks (`types/block.types.ts`, `types/grammar.types.ts`) are rendered by `presentation/renderers/block.renderer.ts`; the legal pages and the FAQ go through `document.renderer.ts`, the PAG, methodology, architecture, ontology and anatomy pages through `tab.widget.ts`, and the methodology and architecture chapters through `chapter.renderer.ts`, prose beside cited panels (`panel.renderer.ts`, pan and zoom viewports from `panel.component.ts`, diagrams fetched by digest in `diagram.renderer.ts`). The ontology page renders the build-time snapshot in `core/assets/ontology.generated.ts` through the converters in `domain/converters/`; the anatomy page renders `core/assets/anatomy.generated.ts`, the member's own tree with per-file walks, definitions, docs coverage and the source (`anatomy.renderer.ts`, `folder.renderer.ts`, `walk.renderer.ts`, `source.renderer.ts`). `site.strings.ts` passes every content module through `linkTabs` in `domain/converters/link.converter.ts`, so the first mention of an ontology term or another page's chapter in each section becomes a link, and `reference.widget.ts` reveals the record or chapter behind any such link on hover, focus or tap, grounded in the anatomy's constructs through `evidence.loader.ts`. Icons live in `configuration/icons/`, section ids in `core/ids/`, resource locations in `core/assets/`. Element construction goes through `core/factories/element.factory.ts`; inline markup in copy is converted to runs by `core/converters/markup.converter.ts` and rendered by `presentation/renderers/text.renderer.ts`, so no parsed HTML ever reaches a live node. `page.renderer.ts` derives each route's head — title, description, canonical, open-graph type and the JSON-LD graph from `schema.renderer.ts` — and `text.converter.ts` turns a rendered page into the Markdown twin the copy button and the prerender share. ## When to use - Adding a page — add a `.record.ts` under `presentation/records/` whose `registerPage` call names the page and loads its `.view.ts` from `presentation/views/` on demand; the glob barrel discovers the record, the prerender writes its route, payload and twin, and the view's chunk is fetched only when the page is opened. - Changing copy — edit the `.strings.ts` module that owns it; no view carries a literal. A section that outgrows the file cap continues in `.fragment.strings.ts`, and a chapter section cites each of its panels by tag from the prose. - Citing the ontology or another page — write the record's exact name or the chapter's exact title; the vocabulary linker resolves it, and an anchor the vocabulary does not carry goes through `stageLink`, `layerLink` or `nodeLink` from `link.converter.ts`. - Adding a block kind — extend `types/block.types.ts` (or `grammar.types.ts`), render it in `block.renderer.ts`, style it in `presentation/styles/`, and declare it in the panel kinds if a chapter may cite it. - Changing the shell — the panel widget, the menu widget and their styles under `presentation/`. ## When NOT to use - Deploying. The deploy member owns the droplet, nginx and the upload; this member only builds. - Deriving the snapshots. The ontology, anatomy and diagram assets are written by the build plugins under the workspace scripts member, never by hand. - Governance code. Rules and validators belong to `.govlab/` and the `govlab.*` members. - Tests. Every suite lives under `codebase.testing/test.web/`. ## Architecture charts Auto-generated structure, logical-flow, and dependency diagrams derived from the source AST live in [_generated.module-info/mermaid-charts.generated.md](./_generated.module-info/mermaid-charts.generated.md). ## Install Resolved through the root `package.json` `workspaces` glob; every third-party dependency is hoisted from the root. `npm run dev` from the root serves it over HTTPS on a generated self-signed certificate; `npm run build -w @banes-lab/web` runs the build plugins in `vite.config.ts` and emits the static site into the builds output declared as `builds.web` in `project.paths/paths.yaml`, then renders the methodology checkouts. ## Quick start ```ts EXAMPLE: Register a page import { registerPage } from "#domain/registries/page.registry"; registerPage({ description: HOME_DESCRIPTION, icon: HOME_ICON, id: HOME_PAGE, listed: true, load: async () => (await import("#presentation/views/home.view")).PAGE, order: 10, title: HOME_TITLE, }); ``` ```ts EXAMPLE: Request a route from anywhere import { emitEvent } from "#core/buses/base.bus"; import { ROUTE_REQUESTED } from "#core/ids/route.ids"; emitEvent({ name: ROUTE_REQUESTED, page: HOME_PAGE }); ``` ```ts EXAMPLE: Link a content module against the ontology and the chapter vocabulary import { METHODOLOGY_CONTENT } from "#configuration/strings/methodology.strings"; import { METHODOLOGY_PAGE } from "#core/ids/page.ids"; import { SITE_VOCABULARY } from "#configuration/strings/site.strings"; import { linkTabs } from "#domain/converters/link.converter"; export const METHODOLOGY_TABS = linkTabs(METHODOLOGY_CONTENT, SITE_VOCABULARY, METHODOLOGY_PAGE); ``` ## API No public API surface. ## Configuration - `vite.config.ts` — the application build and its plugin order — ontology, anatomy, diagrams, prerender, prune, chapters — with roots, output and the dev certificate resolving through `@ssot/paths`. - `.govlab/taxonomy.config.ts `containers`` — declares this member as a governed root with `configuration`, `core`, `domain`, `presentation`, `runtime` and the flat `types` bucket. - `configuration/constants/vocabulary.constants.ts` — the ambiguous phrases the vocabulary linker never links from prose. - `configuration/constants/evidence.source.constants.ts` — the classified registry that grounds ontology records and chapters in this member's own constructs, read by the reference widget both ways. ## Dependencies - `@govlab/constants` ## AI context - No view writes copy inline. A new string is a const in the owning `.strings.ts`. - Interactive controls (buttons, inputs) are constructed only inside `presentation/components/*.component.ts`. - Children emit events; parents subscribe. A widget never receives a callback to call back up. - A `*.generated.ts` asset is written by a build plugin and never edited; a missing or stale one means the build has not run. - Tests for this member live at `codebase.testing/test.web//tests/` and import it by package specifier. ## Domains The software domains this package serves — declared in `_manifest.json` `domains`, from the controlled two-tier `@govlab/docs` software-domain vocabulary (`meta → sub`): - **content** — copywriting-strings - **frontend-ui** — dom-construction, navigation ## Quality governance The quality concepts governing this package — declared in `_manifest.json` `governedBy`, or, for a lint package, derived from the canonical concepts its own rules enforce — resolved from the `@govlab/quality-relations` canonical catalog. Each maps to the custom lint rules that enforce it: - **separation-of-concerns** — _complexity_ - **type-safety** — _correctness_ ## Disposal - Remove the member's workspace entry from the root `package.json` and the `#host/*` imports key. - Remove its governed-root entry from `containers` and `specialContainers` in `.govlab/taxonomy.config.ts`. - Remove the `app` branch from `project.paths/paths.yaml`. - Delete the directory, reinstall, run the gate. --- experimental · 0 exports · 1 deps · 0 principles · 2 concepts _Last generated: September, 22 2026 - 10:36 | Last changed: September, 22 2026 - 00:02_