diff --git a/.baseline/product/README.md b/.baseline/product/README.md index 71548f5..d303be2 100644 --- a/.baseline/product/README.md +++ b/.baseline/product/README.md @@ -78,4 +78,7 @@ and attach it to the Worker (dashboard → Workers & Pages → `nextra-docs-web-prod` → Settings → Domains & Routes → Add → Custom domain). Do the same for stage with a subdomain if you want one. Nothing in the build depends on the origin — every link the site renders is relative — so there -is nothing to redeploy. +is nothing to redeploy. The repository names the domain in one place, +`BASE_DOMAIN` in `intent.yaml` (dev, stage and prod), which the site was born +with as the reserved placeholder `nextra-docs.example.com`. Replace it with +your domain in the same change that records it. diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index 88bb706..9a142c7 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -91,7 +91,6 @@ jobs: --out "$(mktemp -d)" \ --set reponame=acme-docs \ --set "productname=Acme Docs" \ - --set productdomain=acme.dev \ --set githuborg=acme-inc - name: the leak gate — what a site carries run: bash testing/leak.test.sh diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index ebe52ff..e5beaac 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -52,7 +52,7 @@ cd nextra-docs orun new --blueprint repo-blueprint.yaml \ --out ~/sites/acme-docs --run-hooks --resume \ --set reponame=acme-docs --set productname="Acme Docs" \ - --set productdomain=acme.dev --set githuborg=acme-inc \ + --set githuborg=acme-inc \ --set orunWorkspace=ws_XXXXXXXX \ --set subdomain= ``` @@ -89,9 +89,13 @@ orun new --blueprint repo-blueprint.yaml --out ~/sites/acme-docs --run-hooks \ Every later phase reads the identity back from `.rebrand/values.json` in the placed tree, but the blueprint's **required** inputs — `reponame`, -`productname`, `productdomain`, `githuborg` — are validated before anything -runs, so pass them every time (a `--values` file is easier). The full guide, -one page per phase: [docs/phases/README.md](docs/phases/README.md). +`productname`, `githuborg` — are validated before anything runs, so pass them +every time (a `--values` file is easier). The domain is not one of them: the +site goes live on workers.dev, and `productdomain` defaults to empty, which +brands the reserved placeholder `.example.com` into `BASE_DOMAIN` +for an owner to replace when they attach a domain (README, "Custom domain"). +Pass `--set productdomain=` only for a site that already has its domain. +The full guide, one page per phase: [docs/phases/README.md](docs/phases/README.md). | flag | what it does | |---|---| @@ -136,10 +140,12 @@ orun new --blueprint repo-blueprint.yaml \ titled by `apps/web/content/_meta.ts`; the name and the repository the GitHub and "Edit this page" links point at are `apps/web/app/site.ts`. Every merge to `main` rebuilds the search index and redeploys. -- **Custom domain**: attach it to the Worker in Cloudflare (the site's - README, "Custom domain"); every link the site renders is relative, so - nothing else changes. There is no domain phase: attaching a domain needs - zone permissions the brokered `workers-deploy` token does not carry. +- **Custom domain**: attach it to the Worker in Cloudflare, and replace the + placeholder `.example.com` in `intent.yaml`'s `BASE_DOMAIN` with + it (the site's README, "Custom domain"); every link the site renders is + relative, so nothing else changes. There is no domain phase: attaching a + domain needs zone permissions the brokered `workers-deploy` token does not + carry. - **Refresh the record**: re-run `--phase 03-docs`; it is idempotent. ## 4. Testing this baseline @@ -190,7 +196,7 @@ at the tag and refuses the whole catalogue if it 404s. | Convergence failed AFTER the PR merged; re-running lands nothing | expected on its own — the files are on main. Re-run the phase (`--phase 01-product`, `--redo 01-product`, or the console's Retry): its `retouch` hook gives the landing a diff and the site redeploys | | The site's `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace; set it and re-run `01-product` | | A bootstrap stopped before `03-docs`; prod no longer waits on stage | the gate is deferred, not dropped: run `03-docs`, or `node tooling/bootstrap/promotion.mjs --restore --file /intent.yaml` | -| `✕ input "productdomain" is required` | all four required inputs must be set on every invocation, single-phase ones included | +| `✕ input "productname" is required` | all three required inputs (`reponame`, `productname`, `githuborg`) must be set on every invocation, single-phase ones included | | `unknown flag: --phase` or a parse error in the blueprint | the CLI is below the v2.58.11 floor | | `01-product` lanes fail in `build-app`: `Symlink apps/web/node_modules/next is invalid, it points out of the filesystem root` | the site's intent pins stack-tectonic ≥ 0.20.0, whose lane-scoped install links each job's node_modules out of its tree, which Next 16's Turbopack refuses. Pin 0.19.0 (this baseline does; `intent.yaml` says why) | | `01-product`'s convergence reported green, then `verify` got 404 from both URLs | a second workflow ran on the push to main and the watch took its run (a `checks.yml` that also runs on push). This baseline runs `checks.yml` on pull requests only, and its coverage gate holds the rule; read the CI run on main for the real result | diff --git a/README.md b/README.md index fb55731..f4447a3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ as-built status. git clone --depth 1 --branch https://github.com/sourceplane/nextra-docs cd nextra-docs orun new --blueprint repo-blueprint.yaml --out ~/sites/acme-docs --run-hooks --resume \ - --set reponame=acme-docs --set productname="Acme Docs" --set productdomain=acme.dev \ + --set reponame=acme-docs --set productname="Acme Docs" \ --set githuborg=acme-inc --set subdomain= ``` diff --git a/ai/context/current.md b/ai/context/current.md index 6a69cd9..118b43e 100644 --- a/ai/context/current.md +++ b/ai/context/current.md @@ -18,9 +18,10 @@ what went live (`03-docs`). | | | |---|---| -| Latest tag | `baseline-v2` — ND4, one landing ([#5](https://github.com/sourceplane/nextra-docs/pull/5), ND-5; the first tag of that shape), and ND5, the cirrus standard (no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) | -| Before it | `baseline-v1` (ND3: three phases, `01-scaffold`, `02-site`, `03-docs`) | -| Proven live | `baseline-v1`: yes — a console bootstrap went live on stage and prod on 2026-10-15 (`nextra-live`, `bst_PW76WBTK`, 8m15s). `baseline-v2`'s one-landing shape: no — proven offline in Baseline CI only (risk ND-I) | +| Latest tag | `baseline-v3` — ND6, the domain is set later ([#8](https://github.com/sourceplane/nextra-docs/pull/8), ND-8: the console asks for no domain, and a site is born with the placeholder `.example.com` for an owner to replace) | +| Before it | `baseline-v2` — ND4, one landing ([#5](https://github.com/sourceplane/nextra-docs/pull/5), ND-5; the first tag of that shape), and ND5, the cirrus standard (no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) | +| Before them | `baseline-v1` (ND3: three phases, `01-scaffold`, `02-site`, `03-docs`) | +| Proven live | `baseline-v1`: yes — a console bootstrap went live on stage and prod on 2026-10-15 (`nextra-live`, `bst_PW76WBTK`, 8m15s). The one-landing shape (`baseline-v2`, `baseline-v3`): no — proven offline in Baseline CI only (risk ND-I) | ## Where to read @@ -34,6 +35,6 @@ what went live (`03-docs`). ## Next -1. Bootstrap one site from `baseline-v2` from the console, and record its +1. Bootstrap one site from `baseline-v3` from the console, and record its timings against the 6-minute estimate and baseline-v1's 8m15s (closes ND-I and ND4's last exit criterion). diff --git a/ai/context/decisions.md b/ai/context/decisions.md index cd400d2..9c2d64d 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -19,3 +19,4 @@ reads in order. | 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version (v2.15.0) nothing ran | IMPLEMENTATION-STATUS (ND5) | | 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the component's facts drifts silently | `tooling/catalog/gen-component-docs.py` | | 13 | The workers.dev subdomain is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), not asked; only a hand-run build passes `--set subdomain` | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and wrong showed up after deploy in the build origin and the probes (cirrus-baseline since baseline-v23) | IMPLEMENTATION-STATUS (ND-7) | +| 14 | The console asks for no domain; an empty `productdomain` brands the placeholder `.example.com` | The site goes live on workers.dev and nothing in the build needs a domain; attaching one is an owner's step, and the placeholder keeps every place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (ND-8) | diff --git a/ai/context/operations.md b/ai/context/operations.md index 6760b50..41c3434 100644 --- a/ai/context/operations.md +++ b/ai/context/operations.md @@ -95,7 +95,7 @@ orun integrations list --org --json && orun cloud check --org | rename the site, or move its repository | edit `apps/web/app/site.ts` (`SITE_NAME`, `SOURCE_URL`), merge | | deploy a change | merge to `main`; watch the run; failed lanes → `gh run rerun --failed` | | redeploy without a change | edit the last line of `apps/web/component.yaml` (`# orun: redeploy `) and merge — it is a deploy trigger, nothing reads it | -| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"); nothing in the build depends on the origin | +| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"), then replace the placeholder `nextra-docs.example.com` in `intent.yaml`'s `BASE_DOMAIN` (dev, stage and prod) with it; nothing in the build depends on the origin | | add a runtime secret | `orun secrets set --org --env ` | | headless credentials | `ORUN_TOKEN` (workspace-scoped) + `GITHUB_TOKEN` | diff --git a/blueprint.yaml b/blueprint.yaml index 2ff4cee..09031cf 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -60,6 +60,12 @@ spec: # already holds says so with `from`. repo-blueprint.yaml declares the same # names; `repoPrivate`, `orunWorkspace` and `epicSlug` are build inputs with # defaults (or filled from the build's workspace) and are not asked. + # + # NOR IS THE DOMAIN. The site goes live on workers.dev, and a domain is an + # owner's step after the bootstrap: `productdomain` defaults to empty, the + # rebrand writes the reserved placeholder `.example.com` where + # the domain goes, and the site's README ("Custom domain") says how to set + # it. Nothing that needs a domain is removed — it waits for one. inputs: - key: reponame label: Repo name @@ -71,11 +77,6 @@ spec: pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$" help: The name visitors see — the navbar logo, the page titles and the footer. example: Acme Docs - - key: productdomain - label: Site domain - pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$" - help: The domain the site will answer on. It does not need to exist — the site goes live on workers.dev first. - example: acme.dev - key: githuborg label: GitHub organisation pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$" diff --git a/docs/phases/README.md b/docs/phases/README.md index cf09b1d..9e0ac30 100644 --- a/docs/phases/README.md +++ b/docs/phases/README.md @@ -50,9 +50,15 @@ the site renders is relative. `01-product` takes the site's identity once and writes it into the repo (`.rebrand/values.json`); every later phase reads it back from the placed tree. But the blueprint's **required** inputs — `reponame`, `productname`, -`productdomain`, `githuborg` — are validated before any phase runs, so they -must be supplied on every invocation, single-phase ones included. A -`--values` file is easier than repeating `--set`. +`githuborg` — are validated before any phase runs, so they must be supplied +on every invocation, single-phase ones included. A `--values` file is easier +than repeating `--set`. + +- `productdomain` — NOT ASKED, default empty. The site goes live on + workers.dev; empty brands the reserved placeholder `.example.com` + into `BASE_DOMAIN`, for an owner to replace when they attach a domain (the + site's README, "Custom domain"). Pass it only for a site that already has + its domain. - `subdomain` — the workers.dev subdomain of the Cloudflare account you deploy into. It is in every URL the phases probe and in the site's diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index 0c45ab0..f210897 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -33,11 +33,16 @@ inputs: description: The site's display name (e.g. "Acme Docs") — the navbar logo, the page titles, the footer. productdomain: type: string - required: true + default: "" description: >- - The domain the site will answer on (e.g. acme.dev) — BASE_DOMAIN and the - custom-domain guidance. It does not need to exist: the site answers on - workers.dev from its first deploy. + The site's own domain, once it has one (e.g. acme.dev). NOT ASKED: the + site answers on workers.dev from its first deploy, and a domain is an + owner's step after it. Empty, the rebrand writes the reserved + placeholder `.example.com` where the domain goes (BASE_DOMAIN + in intent.yaml, for dev, stage and prod), so setting it later is + replacing that one string — the site's README, "Custom domain", says + how. Pass it with --set only to brand a hand-run build with a domain it + already has. githuborg: type: string pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$" diff --git a/specs/epics/README.md b/specs/epics/README.md index 495c6c3..09272ca 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| -| [`nextra-docs/`](./nextra-docs/) | **ND** | ✅ Shipped (`baseline-v1`, live 2026-10-15); ND4–ND5 tagged `baseline-v2`, the one-landing shape, not yet proven live | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext — and an Orun baseline that instantiates it (ND3) | +| [`nextra-docs/`](./nextra-docs/) | **ND** | ✅ Shipped (`baseline-v1`, live 2026-10-15); ND4–ND5 tagged `baseline-v2`, ND6 (no domain asked) `baseline-v3`; the one-landing shape not yet proven live | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext — and an Orun baseline that instantiates it (ND3) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md b/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md index 66bdcb8..f32a1c4 100644 --- a/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md +++ b/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md @@ -11,6 +11,7 @@ the code departed from `design.md` or from the upstream template. | ND3 — a baseline | ✅ Shipped | [#4](https://github.com/sourceplane/nextra-docs/pull/4) (ND-4), tagged `baseline-v1`; a console bootstrap of it went live on 2026-10-15 (below) | | ND4 — one landing | ✅ Shipped | [#5](https://github.com/sourceplane/nextra-docs/pull/5) (ND-5), tagged `baseline-v2` — the first tag of the one-landing shape; not yet proven live (risk ND-I) | | ND5 — the cirrus standard | ✅ Shipped | [#6](https://github.com/sourceplane/nextra-docs/pull/6) (ND-6), [#7](https://github.com/sourceplane/nextra-docs/pull/7) (ND-7), tagged `baseline-v2` | +| ND6 — the domain is set later | ✅ Shipped | [#8](https://github.com/sourceplane/nextra-docs/pull/8) (ND-8), tagged `baseline-v3` | ## Departures from the upstream template @@ -181,6 +182,53 @@ Verified: placed, both landings, `--resume` changes nothing. - `orun task check ND-7` complete. +## The domain is set later (ND6, ND-8) + +The console asked for the site's domain, with help text that said it did not +need to exist — and nothing in the build needed one: the site answers on +workers.dev from its first deploy, every link it renders is relative (no +canonical URL, sitemap or Open Graph base is built from a domain), and the +one place the repository names the domain is `BASE_DOMAIN` in `intent.yaml`, +for dev, stage and prod. A domain is an owner's step after the bootstrap +(README, "Custom domain"), so the form no longer asks for it. + +- `blueprint.yaml` declares no `productdomain` input; the console's Product + step asks for the site's name alone. +- `repo-blueprint.yaml`'s `productdomain` is optional, default empty. A + hand-run build may still pass `--set productdomain=` for a site that + already has its domain. Nothing else in the build reads it: no hook, probe + or `when:` names it, only the `.rebrand/values.json` template, which + writes `""`. +- `rebrand.mjs` no longer requires it. Empty, it brands the reserved + placeholder `.example.com` (RFC 2606 — never someone else's + domain) where the domain goes, so setting it later is replacing one + string; the product README and `ai/context/operations.md` say so. +- `testing/fixtures/acme.json` carries no domain, so the leak gate and the + offline bootstrap exercise exactly what a console build supplies; + `testing/rebrand.test.sh` pins the placeholder for an absent and an empty + domain; `baseline.yml`'s blueprint read sets no domain. + +Nothing that needs a domain was removed — it waits for one. + +Verified: + +- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh` + green (`rebrand.test.sh`: 29 checks, two of them new — and those two fail + against the old `rebrand.mjs`); `gen-component-docs.py --check` green (2 + components). +- `orun new --status` (v2.58.11) with no `productdomain`: `01-product` + pending (61 files). `testing/leak.test.sh` (v2.58.11): 61 files derived; + ai/context still exactly the two declared pages. +- `testing/placement.test.sh` (v2.58.11, as Baseline CI runs it): 61 files + placed, both landings, branded, the site's own `orun plan` green, + `--resume` changes nothing. +- The offline bootstrap's site, kept and read: `.rebrand/values.json` has + `"productdomain": ""`; `intent.yaml`'s `BASE_DOMAIN` is + `acme-docs.example.com` in all three environments, and the README and + `ai/context/operations.md` name that same string (5 lines, 3 files); + `rebrand --verify` finds no leftover. +- `orun task check ND-8` complete. + ## Verified (ND5) - `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh` diff --git a/specs/epics/nextra-docs/README.md b/specs/epics/nextra-docs/README.md index aebcc3e..ba5e90e 100644 --- a/specs/epics/nextra-docs/README.md +++ b/specs/epics/nextra-docs/README.md @@ -8,15 +8,15 @@ The upstream content stays the content. What changes is the framework underneath | Field | Value | |-------|-------| -| Status | ✅ ND0–ND3 shipped (#1–#4), tagged `baseline-v1`, which went live from the console on 2026-10-15 (8m15s); ND4 — one landing (#5, ND-5) — and ND5 — the cirrus standard (#6, ND-6; the subdomain read from the Cloudflare connection, #7, ND-7) — tagged `baseline-v2`, the first tag of the one-landing shape, not yet proven live (risk ND-I) | -| Cluster | **ND** (ND0–ND5) | +| Status | ✅ ND0–ND3 shipped (#1–#4), tagged `baseline-v1`, which went live from the console on 2026-10-15 (8m15s); ND4 — one landing (#5, ND-5) — and ND5 — the cirrus standard (#6, ND-6; the subdomain read from the Cloudflare connection, #7, ND-7) — tagged `baseline-v2`, the first tag of the one-landing shape, not yet proven live (risk ND-I); ND6 — the domain is set later (#8, ND-8) — tagged `baseline-v3` | +| Cluster | **ND** (ND0–ND6) | | Owner(s) | `apps/web` (the site) · `tests/web` (the content-layout and site-identity tests) | | Builds on | `cirrus-baseline` conventions (intent, components, `checks.yml` gate, gated `ci.yml`) — no bounded context of the fleet is needed | | Upstream | [shuding/nextra-docs-template](https://github.com/shuding/nextra-docs-template) (Vercel's "Nextra Docs Starter Kit") | | Changes | Nextra 2 → Nextra 4 (file by file in `design.md`), plus the Workers build, the monorepo wrapper, tests and the deploy contract; the page text, the sidebar order, the theme settings and the counter component are preserved | | Decisions locked | (1) OpenNext on Workers + Static Assets, not Pages. (2) Nextra 4 on Next 16.3.8, not Nextra 2 on an old Next without OpenNext. (3) Every page is pre-rendered; `dynamicParams = false`. (4) Search is Pagefind, indexed between `next build` and the OpenNext bundle so it ships as static assets. (5) No infra root: the site binds nothing. | | Gate | ND1 is the first user-visible rung (the site serves from a Worker). | -| Shipped as | `baseline-v1` ([#4](https://github.com/sourceplane/nextra-docs/pull/4), three phases; live 2026-10-15), then `baseline-v2` (ND4: [#5](https://github.com/sourceplane/nextra-docs/pull/5); ND5: [#6](https://github.com/sourceplane/nextra-docs/pull/6), [#7](https://github.com/sourceplane/nextra-docs/pull/7)); the one-landing shape proven offline (Baseline CI), not yet live | +| Shipped as | `baseline-v1` ([#4](https://github.com/sourceplane/nextra-docs/pull/4), three phases; live 2026-10-15), then `baseline-v2` (ND4: [#5](https://github.com/sourceplane/nextra-docs/pull/5); ND5: [#6](https://github.com/sourceplane/nextra-docs/pull/6), [#7](https://github.com/sourceplane/nextra-docs/pull/7)), then `baseline-v3` (ND6: [#8](https://github.com/sourceplane/nextra-docs/pull/8), no domain asked); the one-landing shape proven offline (Baseline CI), not yet live | ## Read order @@ -35,3 +35,4 @@ The upstream content stays the content. What changes is the framework underneath | ND3 — a baseline | card, build document, rename, bootstrap tooling, tests | a new docs site goes from nothing to live in three phases; Baseline CI green | | ND4 — one landing | the site in one landing, each bootstrap landing checked by `plan` alone (cirrus-baseline baseline-v22's shape) | a site bootstrapped from the next tag is live faster than baseline-v1's 8m15s | | ND5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags and the live record; the subdomain read from the Cloudflare connection | Baseline CI green with the docs check; the card asks for no subdomain | +| ND6 — the domain is set later | the console asks for no domain; an empty `productdomain` brands the placeholder `.example.com` for an owner to replace | Baseline CI green on a fixture with no domain | diff --git a/specs/epics/nextra-docs/epic.yaml b/specs/epics/nextra-docs/epic.yaml index 11219b3..a1e33f2 100644 --- a/specs/epics/nextra-docs/epic.yaml +++ b/specs/epics/nextra-docs/epic.yaml @@ -46,3 +46,9 @@ spec: - "every milestone's status row agrees with the tags" - "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23" tasks: [ND-6, ND-7] + - name: "ND6 — the domain is set later" + exitCriteria: + - "the console card asks for no domain: a site goes live on workers.dev, and productdomain is an optional build input that defaults to empty" + - "a site built without a domain is branded with the reserved placeholder .example.com wherever the domain goes (BASE_DOMAIN in intent.yaml), and its README says how an owner sets the real one" + - "Baseline CI places, leak-checks and plans a site built with no domain" + tasks: [ND-8] diff --git a/specs/epics/nextra-docs/implementation-plan.md b/specs/epics/nextra-docs/implementation-plan.md index 0cf5494..1c35e6f 100644 --- a/specs/epics/nextra-docs/implementation-plan.md +++ b/specs/epics/nextra-docs/implementation-plan.md @@ -103,6 +103,15 @@ site itself changing. - the docs check is green in Baseline CI - this file, the status file and `epic.yaml` agree +## ND6 — the domain is set later (ND-8) ✅ + +**Done when** the console card asks for no domain; `productdomain` is an +optional build input, empty by default; a site built without one is branded +with the reserved placeholder `.example.com` where the domain goes +(`BASE_DOMAIN` in `intent.yaml`) and its README says how an owner sets the +real one; Baseline CI places, leak-checks and plans a site built with no +domain. Shipped in `baseline-v3`. + ## After ND3 (outside this repository) 1. Cut `baseline-v1` with `tag.yml` from the merged `main` — done. diff --git a/tasks/ND-8.TaskContract.yaml b/tasks/ND-8.TaskContract.yaml new file mode 100644 index 0000000..3a109ec --- /dev/null +++ b/tasks/ND-8.TaskContract.yaml @@ -0,0 +1,30 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: ND-8 + title: "The domain is set later" +spec: + goal: "The console no longer asks for the site's domain. A site goes live on workers.dev; productdomain is an optional build input (default empty), the rebrand writes the reserved placeholder .example.com where the domain goes (BASE_DOMAIN in intent.yaml), and the site's README says how an owner replaces it once a domain is attached" + affects: + - blueprint.yaml + - repo-blueprint.yaml + - tooling/rebrand/rebrand.mjs + - testing/rebrand.test.sh + - testing/fixtures/acme.json + - .github/workflows/baseline.yml + - .baseline/product/README.md + - BOOTSTRAP.md + - README.md + - docs/phases/README.md + - ai/context/operations.md + - ai/context/current.md + - ai/context/decisions.md + - specs/** + - tasks/** + doneWhen: + - blueprint.yaml declares no productdomain input, and repo-blueprint.yaml's productdomain is optional with an empty default + - "rebrand.mjs no longer requires productdomain and brands .example.com when it is empty (testing/rebrand.test.sh)" + - testing/fixtures/acme.json carries no domain, so the leak gate and the offline bootstrap exercise what a console build supplies + - the contract tests, the docs check, the leak gate and the offline bootstrap are green + gates: + - checks diff --git a/testing/fixtures/acme.json b/testing/fixtures/acme.json index 79b78c1..3da1d6e 100644 --- a/testing/fixtures/acme.json +++ b/testing/fixtures/acme.json @@ -6,15 +6,15 @@ "than tidy — a site name with an apostrophe and an ampersand (both legal in", "the card's pattern, both special in TypeScript strings and in HTML), a", "hyphenated repo slug that CONTAINS the word `docs`, an owner other", - "than the baseline's, and a multi-label domain — because a fixture that only", - "uses values the templates were written against proves the templates work", - "on the values they were written against.", + "than the baseline's, and NO domain — a console build asks for none, so the", + "placeholder .example.com is what a site is born with — because a", + "fixture that only uses values the templates were written against proves", + "the templates work on the values they were written against.", "Every key here is an input repo-blueprint.yaml declares. A key it does not", "declare is a fixture that has drifted, and orun refuses it." ], "reponame": "acme-docs", "productname": "Sam's Docs & Guides", - "productdomain": "docs.acme.dev", "githuborg": "acme-inc", "subdomain": "acme", "orunWorkspace": "ws_0000000000000000000000000000000f", diff --git a/testing/rebrand.test.sh b/testing/rebrand.test.sh index 3258748..c301018 100644 --- a/testing/rebrand.test.sh +++ b/testing/rebrand.test.sh @@ -83,6 +83,14 @@ check "an environment URL: worker name and subdomain" \ check "the placeholder domain is the product's domain, not a renamed slug" \ "$acme" intent.yaml ' BASE_DOMAIN: nextra-docs.example.com' \ ' BASE_DOMAIN: acme.dev' +check "no domain given: the reserved placeholder, for an owner to replace later" \ + '{"reponame":"acme-notes","productname":"Acme Notes","githuborg":"acme-inc","subdomain":"acme"}' \ + intent.yaml ' BASE_DOMAIN: nextra-docs.example.com' \ + ' BASE_DOMAIN: acme-notes.example.com' +check "an empty domain is no domain" \ + '{"reponame":"acme-notes","productname":"Acme Notes","productdomain":""}' \ + intent.yaml ' BASE_DOMAIN: nextra-docs.example.com' \ + ' BASE_DOMAIN: acme-notes.example.com' check "the repo slug" \ "$acme" package.json ' "name": "nextra-docs",' \ ' "name": "acme-notes",' diff --git a/tooling/rebrand/rebrand.mjs b/tooling/rebrand/rebrand.mjs index d6fbf2d..3c41029 100644 --- a/tooling/rebrand/rebrand.mjs +++ b/tooling/rebrand/rebrand.mjs @@ -25,7 +25,7 @@ // { // "reponame": "acme-docs", // required — repo slug // "productname": "Acme Docs", // required — the site's display name -// "productdomain": "acme.dev", // required — the product domain +// "productdomain": "acme.dev", // optional — default .example.com (set later) // "githuborg": "acme-inc", // owner of the product repo (source link) // "brandSlug": "acme", // default: reponame — worker name prefix // "subdomain": "acme", // default: your-workers-subdomain @@ -66,7 +66,7 @@ if (!verifyOnly && !valuesPath) { } if (valuesPath) { values = JSON.parse(fs.readFileSync(valuesPath, "utf8")); - for (const required of ["reponame", "productname", "productdomain"]) { + for (const required of ["reponame", "productname"]) { if (typeof values[required] !== "string" || values[required].length === 0) { console.error(`rebrand: values file is missing required field "${required}"`); process.exit(2); @@ -129,7 +129,11 @@ const rx = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // All fields are unused under --verify; the fallbacks keep derivation total. const reponame = values.reponame ?? ""; const productname = values.productname ?? ""; -const productdomain = values.productdomain ?? ""; +// The domain is NOT ASKED at bootstrap: a site goes live on workers.dev and an +// owner sets a domain later. Until then the reserved placeholder +// `.example.com` (RFC 2606 — it can never be someone else's) stands +// wherever the domain goes, so setting it is replacing one string. +const productdomain = (values.productdomain ?? "").trim() || (reponame ? `${reponame}.example.com` : ""); const githuborg = (values.githuborg ?? "").trim() || baseline.githubOwner; const brandSlug = (values.brandSlug ?? "").trim() || reponame; const subdomain = (values.subdomain ?? "").trim() || "your-workers-subdomain";