Skip to content

Migrate to Vocs v2#172

Open
technophile-04 wants to merge 5 commits into
mainfrom
feat/vocs-v2
Open

Migrate to Vocs v2#172
technophile-04 wants to merge 5 commits into
mainfrom
feat/vocs-v2

Conversation

@technophile-04

Copy link
Copy Markdown
Collaborator

Fixes #170.

Migrates the docs site from Vocs v1 to v2. v2 isn't a normal major bump — it's a rebuild on Waku (React Server Components) + Vite 8 + React 19, so the site now renders dynamically and deploys as serverless functions on Vercel instead of pure static. The payoff is the AI features from the issue: a native MCP server at /api/mcp, raw-markdown content negotiation for AI agents, and the Ask AI button, all built in now instead of hand-rolled.

Most of the diff is mechanical file moves (docs/pagessrc/pages, docs/publicpublic/) that GitHub collapses into renames. The changes actually worth reviewing are the config, scripts, and deps in the second commit.

Concretely

  • vocs ^1.2.12.1.6; config import moves vocsvocs/config; adds waku / vite 8 / react 19
  • Skill generation is decoupled from config — a prebuild generate step writes src/skills.generated.json that the config reads synchronously, instead of top-level await inside vocs.config.ts
  • gen-sitemap.ts deleted: v2 emits /sitemap.xml and /robots.txt natively. fetch-skills + gen-agent-skills-index kept (SE-2-specific)
  • Plausible moved from the removed head config option to src/pages/_layout.tsx (React 19 hoists the async script into <head>)
  • Native MCP server enabled; vercel.json redirects moved into the config's native redirects
  • codeHighlight aliases the env fence to bash with a plaintext fallback (v2's Shiki bundle hard-fails on unknown languages, v1 fell back silently)

How to test

```bash
pnpm install
pnpm build # green build
pnpm dev # http://localhost:5173
curl -s localhost:5173/sitemap.xml | head
curl -s -X POST localhost:5173/api/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"c","version":"1"}}}'
```

Deferred

  • Verify the Vercel preview deploy — the serverless adapter path can't be exercised locally
  • Optionally set GITHUB_TOKEN in Vercel env: fetch-skills and the MCP GitHub source both hit the GitHub API and benefit from a higher rate limit

Relocate docs/pages -> src/pages and docs/public -> public/ to match
v2's default src/ + root public/ convention, plus the shared Tabs
component and footer into src/. Page content is unchanged (renames).
Drops the custom robots.txt since v2 generates one natively.
Upgrade vocs ^1.2.1 -> 2.1.6, a Waku / Vite 8 / React 19 rebuild.

- config import vocs -> vocs/config; add waku, vite, react 19 deps
- decouple skill generation from config: a prebuild generate step writes
  src/skills.generated.json that the config reads synchronously, instead
  of top-level await in vocs.config.ts
- drop gen-sitemap.ts (v2 emits sitemap.xml / robots.txt natively); keep
  fetch-skills + gen-agent-skills-index
- inject Plausible via src/pages/_layout.tsx (React 19 head hoisting; the
  v1 head config option is removed)
- enable the native MCP server; move vercel.json redirects into config
- codeHighlight: alias env->bash with a plaintext fallback for v2's
  strict Shiki bundle
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scaffold-eth-2-docs Ready Ready Preview, Comment Jun 24, 2026 5:47am

Request Review

Vocs v2 ships a native Tab/Tabs component, so the custom Tabs (which had
lost its active-tab underline under v2 — it referenced v1 CSS variables
that no longer exist) is redundant. Convert the Hardhat/Foundry switchers
on the deploy + environment pages to <Tabs stateKey> / <Tab title> and
delete src/components/Tabs.tsx. stateKey preserves the cross-page sync the
old groupId gave us.
The github source pointed at the scaffold-eth-2 template repo, but anyone
using SE-2 already has their own (possibly Foundry / customized) project
locally — the agent should read that, not a diverging Hardhat template. The
docs tools (list/read/search pages) are the real value of MCP on a docs site,
so keep it enabled but drop the source. Also takes GITHUB_TOKEN off the
runtime path; only build-time fetch-skills uses it now.
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.

Migrate to Vocs v2

1 participant