chore: audit Markdown components#742
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d93ee6288b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ]) | ||
|
|
||
| const command = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm' | ||
| const audit = spawnSync(command, ['exec', 'vocs', 'markdown-audit', '--json'], { |
There was a problem hiding this comment.
Audit generated OpenAPI Markdown too
This check invokes the preview vocs markdown-audit command, but that command only audits filesystem pages and does not add generated OpenAPI pages; this repo generates API Markdown from the OpenAPI config in vocs.config.ts (/docs/api, https://api.tempo.xyz/openapi.json). When the hosted OpenAPI descriptions include a PascalCase MDX tag, CI still passes here while the later build publishes that unresolved tag in the AI-facing Markdown, so the audit needs to include generated OpenAPI pages or add a separate check for them.
Useful? React with 👍 / 👎.
| process.exit(audit.status ?? 1) | ||
| } | ||
|
|
||
| const unexpected = report.components.filter(({ name }) => !allowedComponents.has(name)) |
There was a problem hiding this comment.
Enforce the allowlisted component counts
Because the audit allowlist is checked only by component name, any new unresolved use of an already-allowlisted component still passes CI; for example, adding another <Tabs> or guide-step component to a new MDX page increases the surviving AI-facing tags reported by vocs markdown-audit, but unexpected remains empty. To actually prevent new unresolved Markdown components while grandfathering existing debt, record the expected pages/counts instead of allowing every future occurrence of the same names.
Useful? React with 👍 / 👎.
| "unplugin-icons": "^23.0.1", | ||
| "viem": "^2.54.6", | ||
| "vocs": "^2.6.0", | ||
| "vocs": "https://pkg.pr.new/wevm/vocs/vocs@595", |
There was a problem hiding this comment.
Pin Vocs to a released package
This makes every clean install pull the production docs framework from the PR-preview registry for Vocs PR #595 instead of a released npm version. In CI and Vercel deploys, pnpm install --frozen-lockfile now depends on that preview artifact continuing to exist and remain byte-for-byte identical; if the preview is pruned or republished, installs fail or the lockfile integrity no longer matches. Once the audit command is available upstream, switch this back to a normal released vocs version before merging to main.
Useful? React with 👍 / 👎.
Motivation
Vocs PR #595 adds a Markdown component audit. Keep AI-facing Markdown from gaining new unresolved components.
Summary
Key design considerations