Skip to content

Declare the site's live preview (saas-parallel-baselining PB4) - #6

Merged
ruehowl merged 1 commit into
mainfrom
claude/declare-preview
Nov 4, 2026
Merged

ruehowl merged 1 commit into
mainfrom
claude/declare-preview

Conversation

@ruehowl

@ruehowl ruehowl commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

What

The baseline declares its live preview, so orun.work's Preview tab can show a coding session's dev server (saas-parallel-baselining PB4).

  • apps/web/component.yaml: spec.preview:
    preview:
      run:
      - sh
      - -c
      - pnpm install --frozen-lockfile --prefer-offline --filter "@app/web..." && exec node ../../tooling/wire/with-vars.mjs --config wrangler.jsonc -- node_modules/.bin/vite dev --host 127.0.0.1 --port 5173 --strictPort
      port: 5173
      path: /
      env:
        NODE_OPTIONS: --max-old-space-size=512
  • intent.yaml: preview: {component: web}.
  • .github/workflows/baseline.yml: orun v2.88.0 → v2.96.0, the first release that reads spec.preview, so the placement test's orun validate checks the declaration. ci.yml (the product's own lane pin) is unchanged.

Nothing about how the baseline builds or deploys changes.

Checked

From a clean clone, with orun v2.96.0, and through a local stand-in of the preview gateway (the dev server sees a local Host and the browser's own Origin; the page is framed from a foreign origin):

Check Result
orun validate passes
orun preview start --json ready in 21.7 s (warm pnpm store)
GET / 200, 234.9 KB, "SaaS Starter"
foreign Host + Origin straight to the dev server 403
through the gateway stand-in, framed frame 200, no failed assets, hot-reload socket connected
an edit reaches the frame hot update in 0.5s
memory dev server 750 MB at its peak (page compiled, after an edit); the install peaks at 1237 MB
orun preview stop stops it; port freed

Notes

  • vite dev runs directly (node_modules/.bin/vite), as the app's own dev script does, under tooling/wire/with-vars.mjs --config wrangler.jsonc, the wrapper the site's own build uses: $env/static/public (the Supabase URL and anon key) comes from the environment, and the committed wrangler.jsonc carries the public values. No value is added to env, and no secret is read: without .dev.vars the service-role client fails only where it is used, as the site already arranges for a local run.
  • What it cannot show: sign-in, the account pages, billing and email need the product's own Supabase project, its service-role key and the Stripe / Resend keys, none of which a preview gets. The marketing pages, blog, pricing and the sign-in page render.
  • --strictPort makes Vite fail rather than move when 5173 is taken. A foreign Host straight to the dev server gets 403 from Vite's allowedHosts; the gateway forwards with a local Host (127.0.0.1:5173), so no allowedHosts change is needed. SvelteKit skips its form-action origin check in dev, so form actions also work behind the gateway.
  • Memory: ~0.52 GB for Vite, ~0.17 GB for the workerd processes @sveltejs/adapter-cloudflare's platform proxy starts in dev, ~0.05 GB for the with-vars wrapper.

Generated by Claude Code

orun.work's Preview tab shows a coding session's dev server, live from its
box: `orun preview` (orun v2.96.0) runs what a repository declares, and the
session keeps it running while it works.

- apps/web/component.yaml: spec.preview. It installs this app's packages
  only (--filter "@app/web..."), then runs `vite dev` on 127.0.0.1:5173
  with --strictPort (fail, never move to another port) and a 512 MiB heap
  cap; the tab opens /. tooling/wire/with-vars.mjs hands it wrangler.jsonc's
  vars (the Supabase project's public URL and anon key), as the site's own
  build gets them: `$env/static/public` needs them to start.
- intent.yaml: preview: {component: web}.
- baseline.yml: orun v2.88.0 -> v2.96.0, the first release that reads
  spec.preview, so the placement's `orun validate` checks it. ci.yml (the
  product's own lane pin) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z
@ruehowl
ruehowl marked this pull request as ready for review November 4, 2026 20:39
@ruehowl
ruehowl merged commit 4cf48de into main Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants