Skip to content

chore(docs): upgrade vocs to 2.x - #347

Merged
adrienlacombe merged 2 commits into
masterfrom
claude/docs-vocs-2
Oct 29, 2026
Merged

adrienlacombe merged 2 commits into
masterfrom
claude/docs-vocs-2

Conversation

@adrienlacombe

@adrienlacombe adrienlacombe commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Migrates the private docs site from vocs 1.4.1 to vocs 2.12.0, and fixes code scanning alert #1.

Builds on #346 (now merged), whose overrides this PR revisits.

vocs 2 is a rewrite on Waku (React Server Components) with Vite 8 and built-in Tailwind. The content and sidebar didn't need changes; the work was config, styling and deployment.

Changes in docs/

  • Dependencies: vocs ^2.12.0, with its waku 1.0.0-rc.4 / vite ^8.3.5 peers. React moves to ~19.3.1, which vocs 2 requires and which the workspace already resolved to. @tailwindcss/vite is removed because vocs 2 bundles Tailwind.
  • vocs.config.ts: imports from vocs/config. srcDir: "." keeps the pages in docs/pages (no file moves). renderStrategy: "full-static" builds a pure static site. The vite plugin option is gone.
  • Styles: styles.css moves to pages/_root.css, the file vocs 2 loads automatically.
  • Components: Callout is now imported from vocs and takes variant instead of type. The discovery demo gets "use client".
  • UI demo (wallet-modal-ui.tsx):
    • Without a fix, the WalletConnectModal lost its styling. React hoists the get-starknet-ui stylesheet above vocs's stylesheet, and because it declares the utilities layer first, vocs's reset layer (vocs_base) ends up after it and wins. components/layer-order.css declares the full layer order before both.
    • The UI's dark theme keys off <html class="dark">, which vocs 1 set and vocs 2 doesn't (it only sets color-scheme). A small hook mirrors the vocs theme onto the class while the demo is mounted.

Changes outside docs/

  • vercel.json:
    • Static output is now docs/dist/public, Waku's layout.
    • The new llms.txt links to per-page Markdown (/<page>.md). Those files are emitted at /assets/md/<page>.md, and vocs's Vercel adapter adds no route for them in full-static mode, so a rewrite maps one to the other.
  • .gitignore: adds .vercel. When VERCEL is set, vocs also writes docs/.vercel/output. Vercel ignores it because the project root is the repo root, so outputDirectory is what gets deployed.
  • pnpm-workspace.yaml overrides:
    • @hono/node-server: removed. vocs 2 asks for ^2.0.2 and resolves 2.1.5 in range.
    • katex: removed. mermaid is only an optional peer of vocs 2 and the docs don't use it, so mermaid and katex leave the tree. That drops 110 lockfile entries, including dompurify and marked.
    • toml: kept. vocs 2 still pulls it at ^3 through remark-mdx-frontmatter@^5.2.0.
  • .github/workflows/pr.yml: adds permissions: contents: read (code scanning alert choose a wallet/wallets discovery popup #1, actions/missing-workflow-permissions). The job only checks out, installs, builds and tests.
  • No changeset: the docs package is private. Published packages' resolved dependencies are unchanged in the lockfile; only vitest's dev-only peer suffixes moved.

Verification

  • pnpm install --frozen-lockfile, format:check, build, typecheck, lint:check and test (50 tests) all pass. tsc --noEmit on docs/ is clean.
  • pnpm audit reports 0 advisories across all 1,226 dependencies. As a sanity check, it does flag zod 4.4.3 and toml 3.0.0 in a scratch project.
  • Built pages: all 27 pages, llms.txt and llms-full.txt are present, plus new 404.html and Waku's internal _root.d/. A VERCEL=1 build still fills docs/dist/public.
  • Browser check against the vocs 1 build (vocs preview, 1366px wide):
    • Home, getting started, wallet standard and the integration guide render. Sidebar, top nav, code groups, callout and search all work.
    • UI demo modal: styled in both dark and light themes, matching vocs 1.
    • Headless-modal and discovery demos render. The headless modal now looks as designed; under vocs 1 its Tailwind classes weren't applied.
    • /getting-started.md returns text/markdown.

Not verified / behaviour changes

  • The Vercel deploy itself. PRs here get no Vercel preview, so outputDirectory and the .md rewrite are only checked locally (the rewrite pattern against path-to-regexp 6). Please check the first production deploy.
  • llms.txt format: now in sidebar order, linking to .md pages without descriptions (vocs 2's format).
  • UI demo layout: the button is now centered with padding, because the demo's own Tailwind classes now apply.
  • Hydration error: the discovery demo logs React error #418. It does the same on vocs 1, so this PR doesn't introduce it.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The Vocs/Waku migration changes Vercel’s output layout and Markdown routing, but no deployment has been validated, so deployed pages, navigation, assets, and .md URLs still need human verification.

No open issues 🎉

What changed in this PR

Migrates the private documentation site to Vocs 2, adapting configuration, demos, and deployment for its new static-build architecture without changing published package code.

Changes:

  • Updates Vocs dependencies, configuration, component APIs, and stylesheet loading.
  • Preserves wallet-demo styling and dark-mode behavior, and marks the discovery demo as a client component.
  • Updates Vercel output and Markdown routing, removes obsolete dependency overrides, and restricts CI token permissions.
File Description
vercel.json Deploys the new static output and rewrites Markdown URLs.
pnpm-workspace.yaml Removes obsolete security overrides while retaining the TOML override.
docs/​vocs.config.ts Adopts Vocs 2 configuration and full-static rendering.
docs/​sidebar.ts Updates the sidebar type to use the new configuration API.
docs/​pages/​wallet-standard.mdx Migrates the Callout import and variant prop.
docs/​pages/​_root.css Loads Tailwind through the automatic root stylesheet.
docs/​package.json Upgrades Vocs and supporting dependencies; updates the build command.
docs/​components/​wallet-modal-ui.tsx Adds stylesheet ordering and dark-theme synchronization.
docs/​components/​wallet-discovery.tsx Declares the discovery demo as a client component.
docs/​components/​layer-order.css Defines CSS layer precedence to preserve modal styling.
.gitignore Ignores generated Vercel artifacts.
.github/​workflows/​pr.yml Limits workflow token permissions to read-only repository contents.

Review effort: Balanced

adrienlacombe and others added 2 commits October 29, 2026 19:05
vocs 2 is a rewrite on Waku (React Server Components) with Vite 8 and
built-in Tailwind.

- vocs ^2.12.0 with its waku / vite peers; react ~19.3.1
- config: import from `vocs/config`, keep pages in `docs/pages`
  (`srcDir: "."`), `renderStrategy: "full-static"`; Tailwind plugin is
  built in, so `@tailwindcss/vite` and the `vite` option are gone
- `styles.css` -> `pages/_root.css`; `Callout` from `vocs` with `variant`
- `"use client"` on the discovery demo
- UI demo: declare the cascade layer order before the hoisted
  get-starknet-ui stylesheet, and mirror the vocs theme onto a `dark`
  class, so the modal keeps its styles and dark mode
- Vercel: static output is now `docs/dist/public`; rewrite `/<page>.md`
  to `/assets/md/<page>.md` for the llms.txt links
- drop the `@hono/node-server` and katex overrides (vocs 2 resolves a
  fixed `@hono/node-server` in range and no longer pulls mermaid); keep
  toml, still ^3 via remark-mdx-frontmatter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes code scanning alert actions/missing-workflow-permissions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adrienlacombe
adrienlacombe merged commit d8af416 into master Oct 29, 2026
4 checks passed
@adrienlacombe
adrienlacombe deleted the claude/docs-vocs-2 branch October 29, 2026 19:15
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.

2 participants