diff --git a/README.md b/README.md index e36a6ad..906d846 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,13 @@ pnpm --filter @app/web dev # http://localhost:3000, the server in workerd pnpm --filter @app/web preview # wrangler dev over the built Worker ``` +`orun preview` runs the same dev server the way a coding session on orun.work +does, for its live **Preview** tab: `apps/web/component.yaml` declares it +(`spec.preview`: install, then `vite dev` on 127.0.0.1:3000) and `intent.yaml` +names it (`preview: {component: web}`). `orun preview status`, `logs web` and +`stop` follow it; its state and log live in `.orun/preview/`, which git +ignores. + The todo list keeps each visitor's list in their own browser: one httpOnly cookie holding the list as JSON (base64url-encoded), capped at 50 todos of up to 100 characters and refused past ~3.8 KB so it stays under a browser's diff --git a/apps/web/component.yaml b/apps/web/component.yaml index 5623e03..409de3e 100644 --- a/apps/web/component.yaml +++ b/apps/web/component.yaml @@ -38,6 +38,19 @@ spec: - profile: deploy when: triggerRef: github-push-main + # How the site runs itself for orun.work's live Preview tab + # (saas-parallel-baselining PB4): `orun preview` starts this, and a coding + # session keeps it running while it works, so the person watches the site + # change as it is built. The dev server binds the box's loopback only; the + # platform forwards the preview's own host to this one port. It installs + # first, so a checkout the session has not installed yet still comes up. + preview: + run: + - sh + - -c + - pnpm install --frozen-lockfile --prefer-offline && exec pnpm exec vite dev --host 127.0.0.1 --port 3000 --strictPort + port: 3000 + path: / parameters: nodeVersion: '22' pnpmVersion: '10.12.1' diff --git a/intent.yaml b/intent.yaml index baed9be..cc826f4 100644 --- a/intent.yaml +++ b/intent.yaml @@ -59,6 +59,13 @@ compositions: cloudflare-domain: stack-tectonic db-migrate: stack-tectonic +# The live preview (saas-parallel-baselining PB4): the component orun.work's +# Preview tab shows while a coding session works on the site. Its own +# `spec.preview` (apps/web/component.yaml) says how it runs; `orun preview` +# runs it. +preview: + component: web + discovery: roots: - apps/