Exploration: `@nuxt/content` v4 owns nuxt.com's own content (`site`),
defined in `server/content.ts` with `createNuxtContent()`. It serves it
under `/__nuxt_content`, snapshots it at build and generates its types;
the app reads it through the native `content` client and renders
documents with `<ContentRenderer>`. No v3 compatibility layer.
The docs, cli, examples and module docs instances stay on comark-content:
the module serves one surface under a fixed base path, so it can't hold an
instance per commit (`withRef`) nor several instances sharing a name.
- Bump comark-content to 0.5.1 (the module's), moving from the removed
`github` source to `forge` + `forges/github`
- `site` leaves the push webhook and `modules/snapshot`: it ships with
the deployment its push triggers
- Patch nuxt-agent-discovery to accept `@nuxt/content` v4
Amp-Thread-ID: https://ampcode.com/threads/T-01a1b537-979e-7255-b1d1-f4d6b0f37278
Co-authored-by: Amp <amp@ampcode.com>
Upgrades
comark-contentfrom 0.4.3 to 0.5.1, the version the upcoming Nuxt Content v4 module depends on. 0.5 removed thecomark-content/sources/githubsource, so nuxt.com's GitHub-backed content instances (site, docs, cli, examples, module docs) now read GitHub through the genericforgesource.This branch started as an exploration of moving nuxt.com onto the Nuxt Content v4 module (nuxt/content-v4-temp#37). The module can't serve nuxt.com yet: every instance reads a repository at the commit its branch points to, and
vercel.jsonskips deploys for content-only pushes, so evensitecan't ship with the build. That attempt is reverted in this branch, and its findings (six gaps in the module) are on nuxt/content-v4-temp#37. What's left here is only the dependency upgrade.What changed
package.json:comark-content^0.4.3 → ^0.5.1, andforges^0.3.2 as a new direct dependency.utils/factory.ts:github({ repo, branch, path, token, ttl })becomesforge({ provider: github({ auth }), repo, ref, path }), withgithubfromforges/github. The token is passed as forge auth when one is configured.server/utils/content/instances.ts: the source option type comes fromcomark-content/sources/forgeinstead ofsources/github.pnpm-workspace.yaml: thecomarkoverride comment no longer names comark-content, which accepts comark 0.9 since 0.5.No app, page, webhook, snapshot, search or l10n code changes.
Evidence
pnpm install --frozen-lockfilepnpm why comark→ 1 version (0.9.0);pnpm why comark-content→ 1 version (0.5.1)pnpm lint,pnpm test:typespnpm vitest run --project unit/--project nuxtpnpm buildforge:site snapshot 350a1a4: 1823 kB, plus examples, docs:4.x, cli:4.x and 6 module docsThe built server (
node .output/server/index.mjs, with a GitHub token) returned 200 for/docs/4.x/getting-started/introduction,/blog/v4,/raw/blog/v4.md,/deploy/vercel,/docs/4.x/api/commands/dev,/llms.txt,/api/navigation/4.xand/fr/docs/4.x/getting-started/introduction, and the blog post renders normally.Worth checking before merging
githubsource cached each read for 24 hours (ttl);forgehas no equivalent option. Reads go throughwithRef(sha), so they're for immutable commits, and parsed results still go through each instance's cache driver, but GitHub API usage under production traffic hasn't been watched on Vercel. Worth a look at the Vercel preview's logs, or after deploying.main's history to this one change.ELI5
nuxt.com reads its docs and blog from GitHub through a library called comark-content. This updates that library to its newest version, which reads GitHub in a slightly different way. The site works the same.