Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions apps/web/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 7 additions & 0 deletions intent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
Loading