diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index b654f51..6eb44ba 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -68,9 +68,11 @@ jobs: # ✕ action orun.pr/land@v1 has no parameter "repo" # ✕ input "domain" has unknown type "bool" # - # — with every gate green, because none of them asked orun. This job pins the - # bootstrap FLOOR (BOOTSTRAP.md: v2.60, where the run-level - # `hooks.preInstantiate` list arrives) and makes orun place the whole tree, + # — with every gate green, because none of them asked orun. This job pins + # v2.96.0: at or above the bootstrap FLOOR (BOOTSTRAP.md: v2.60, where the + # run-level `hooks.preInstantiate` list arrives), and the first orun that + # reads a component's `spec.preview`, so the placement's `orun validate` + # checks the site's live preview too. It makes orun place the whole tree, # hooks off: offline, no credential, about ten seconds. blueprint-runs: runs-on: ubuntu-latest @@ -78,7 +80,7 @@ jobs: - uses: actions/checkout@v6 - uses: sourceplane/orun-action@v1.2.0 with: - version: v2.76.0 + version: v2.96.0 - uses: actions/setup-node@v5 with: node-version: 22 diff --git a/apps/web-site/component.yaml b/apps/web-site/component.yaml index b002795..6bfd513 100644 --- a/apps/web-site/component.yaml +++ b/apps/web-site/component.yaml @@ -28,6 +28,27 @@ 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 it change + # as it is built. The dev server binds the box's loopback only, on a fixed + # port, and installs first, so a checkout the session has not installed yet + # still comes up. + # It installs only this app's packages and runs the site alone, with its + # heap capped: the box is shared with the agent. site-api and mail-worker do + # not run; the islands that call site-api from the browser (views, upvotes, + # the subscribe and contact forms) degrade to their static messages, as they + # do whenever it is unreachable. + preview: + run: + - sh + - -c + - pnpm install --frozen-lockfile --prefer-offline --filter "@site/web-site..." && exec node_modules/.bin/next dev -H 127.0.0.1 -p 3000 + port: 3000 + path: / + env: + NODE_OPTIONS: --max-old-space-size=1024 + NEXT_TELEMETRY_DISABLED: "1" parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/web-site/next.config.mjs b/apps/web-site/next.config.mjs index fd5c7ae..180ad72 100644 --- a/apps/web-site/next.config.mjs +++ b/apps/web-site/next.config.mjs @@ -22,6 +22,16 @@ const nextConfig = { outputFileTracingRoot: path.join(__dirname, "../.."), typescript: { ignoreBuildErrors: false }, eslint: { ignoreDuringBuilds: true }, + experimental: { + // Dev server only: behind orun.work's live Preview the browser's Origin + // is the preview's host while `next dev` sees a local Host, and Next.js + // refuses a Server Action from an origin it is not told about. `next + // build` runs with NODE_ENV=production, so production keeps its + // same-origin check. + ...(process.env.NODE_ENV === "development" + ? { serverActions: { allowedOrigins: ["*.orun-preview.app", "preview-gateway-stage.oruncloud.workers.dev"] } } + : {}), + }, env: { NEXT_PUBLIC_DEPLOY_ENV: process.env.NEXT_PUBLIC_DEPLOY_ENV ?? "", NEXT_PUBLIC_SITE_API_URL: process.env.NEXT_PUBLIC_SITE_API_URL ?? "", diff --git a/intent.yaml b/intent.yaml index 305db82..339fa96 100644 --- a/intent.yaml +++ b/intent.yaml @@ -55,6 +55,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-site/component.yaml) says how it runs; `orun preview` +# runs it. +preview: + component: web-site + discovery: roots: - apps/