# stage profile
This scaffold produces a platform-loaded Bun app whose UI is a **stage**: a
framework-free ES module that mounts directly into the client-node PWA
shell (not its own page), following the original-skin design system.
- `manifest.json` declares `ui.kind = "stage"` and ships `ui.integrity: {}`
as a placeholder — the empty map is deliberately invalid on its own
(`node-app validate` / the host's stage loader require a SHA-256 entry
for `ui.entry` and, if set, `ui.icon`). It gets filled in by the build
step below.
- `src/index.ts` is the Bun runtime entrypoint (`@econ-v1/app-sdk`'s
`NodeApp` / `runNodeApp`, same pattern as the `bun-fullstack` profile).
- `ui/src/main.ts` exports `mount(ctx)` / `unmount()` as the stage ES
module. It is a real, running teaching template — not a stub — that
renders one `.ui-card`/`.ui-eyebrow`/`.ui-title` card, calls
`core.metrics.latest` via `ctx.invokeCapability`, and includes one
commented `ctx.liveQuery` example.
- `ui/` builds with vanilla TypeScript + Vite only (no React/Vue).
- `ui/scripts/stamp-integrity.mjs` runs after `vite build` (wired into
`ui/package.json`'s `build` script) and writes the SHA-256 of every file
under `ui/dist/` into `manifest.json`'s `ui.integrity` map, keyed by
`ui_path`-relative path (e.g. `ui/dist/main.js`). This is what turns the
placeholder `ui.integrity: {}` into a manifest the host's stage load path
will accept straight out of `bun install && bun run build` — no need to
go through `node-app package` first (which regenerates the same map for
the staged copy anyway, via `write_staged_manifest` in
`system/node-app-build/src/commands/package.rs`).
Differs from the `bun-stage` profile: `bun-stage` intentionally leaves
`ui.integrity` out of the source manifest entirely ("packaging generates
integrity in the staged copy") and its `ui/src/main.ts` is a bare
`stage-shell`/`stage-card` scaffold with no working capability example.
`stage` is the fuller teaching template — self-stamping and pre-wired with
one real, one commented data-fetch pattern.