Migrate to Vocs v2#172
Open
technophile-04 wants to merge 5 commits into
Open
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # vocs.config.ts
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/pages→src/pages,docs/public→public/) that GitHub collapses into renames. The changes actually worth reviewing are the config, scripts, and deps in the second commit.Concretely
vocs^1.2.1→2.1.6; config import movesvocs→vocs/config; adds waku / vite 8 / react 19generatestep writessrc/skills.generated.jsonthat the config reads synchronously, instead of top-levelawaitinsidevocs.config.tsgen-sitemap.tsdeleted: v2 emits/sitemap.xmland/robots.txtnatively.fetch-skills+gen-agent-skills-indexkept (SE-2-specific)headconfig option tosrc/pages/_layout.tsx(React 19 hoists the async script into<head>)vercel.jsonredirects moved into the config's nativeredirectscodeHighlightaliases theenvfence 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
GITHUB_TOKENin Vercel env:fetch-skillsand the MCP GitHub source both hit the GitHub API and benefit from a higher rate limit