diff --git a/apps/web-console-next/README.md b/apps/web-console-next/README.md index 12d6212..1f1bcd8 100644 --- a/apps/web-console-next/README.md +++ b/apps/web-console-next/README.md @@ -31,6 +31,23 @@ incremental cache / tag cache / queue — this app has no R2/KV/D1 bindings and runs fully session-authenticated, so no persistent caching layer is needed. +## Live preview + +`orun preview` runs the console the way a coding session on orun.work does, +for its **Preview** tab (`spec.preview` in `component.yaml`, named by +`preview:` in `intent.yaml`). It is the console alone: `next dev` on +127.0.0.1:3001, talking to the product's deployed **stage** API, with only +its own packages installed and a 1 GiB heap, so it fits beside the agent in +the session's box. No Worker runs locally. Token-free pages (`/`, `/login`, +`/demo`) render in full; pages behind sign-in show the sign-in prompt. + +```sh +orun preview start # waits for :3001 +orun preview status +orun preview logs web-console-next +orun preview stop +``` + ## Parity vs. apps/web-console | Surface | web-console (Vite) | web-console-next (Next 15) | diff --git a/apps/web-console-next/component.yaml b/apps/web-console-next/component.yaml index b4e69f5..f8f9b40 100644 --- a/apps/web-console-next/component.yaml +++ b/apps/web-console-next/component.yaml @@ -56,6 +56,33 @@ spec: - profile: deploy when: triggerRef: github-push-main + # The live preview for orun.work's Preview tab (saas-parallel-baselining + # PB4): `orun preview` runs this, and a coding session keeps it running + # while it works, so the person watches the console change as it is built. + # + # KEPT SMALL ON PURPOSE. It is for looking at the UI, inside the coding + # session's own box (1 vCPU, 3 GiB, shared with the agent): + # - the console alone, `next dev` on the box's loopback. No Worker runs: + # no `needs`, so none of the thirteen workers, Postgres or wrangler start; + # - its API is the product's deployed STAGE (CONSOLE_DEPLOY_ENV=stage); + # - only the console's own packages are installed (`--filter ...`); + # - `next` itself, not `pnpm exec next` (two idle pnpm processes, ~200 MB); + # - its heap is capped at 1 GiB, so it can never starve the agent. + # Measured: up in ~17 s, ~830 MB with three pages compiled. + # The token-free pages (the landing page, /login, /demo's mock gallery) + # show in full. Pages behind sign-in show the sign-in prompt: stage's + # sign-in does not return to a preview host. + preview: + run: + - sh + - -c + - pnpm install --frozen-lockfile --prefer-offline --filter "@saas/web-console-next..." && exec node_modules/.bin/next dev -H 127.0.0.1 -p 3001 + port: 3001 + path: / + env: + CONSOLE_DEPLOY_ENV: stage + NODE_OPTIONS: --max-old-space-size=1024 + NEXT_TELEMETRY_DISABLED: "1" parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/intent.yaml b/intent.yaml index 846064f..d9a85cd 100644 --- a/intent.yaml +++ b/intent.yaml @@ -64,6 +64,13 @@ compositions: cloudflare-domain: stack-tectonic db-migrate: stack-tectonic +# The live preview (saas-parallel-baselining PB4): the one component orun.work's +# Preview tab shows while a coding session works on the product. The console +# alone, against the deployed stage API; its `spec.preview` says how it runs +# (apps/web-console-next/component.yaml), and `orun preview` runs it. +preview: + component: web-console-next + discovery: roots: - apps/