fix(spec): escape unmatched </{ in generated MDX docs (unblock apps/docs build)#1493
Merged
Conversation
…ps/docs build)
`build-docs.ts`'s `escapeMdxDescription` only backtick-wrapped *matched*
`<…>` / `{…}` pairs. A lone `<` with no closing partner — e.g. a SemVer
range in a `.describe()` like `">=4.0 <5"` — leaked into the generated MDX,
where Turbopack/fumadocs read the `<` as the start of a JSX tag and failed
the docs build:
./content/docs/references/kernel/manifest.mdx
82:97: Unexpected character `5` (U+0035) before name
Now an unmatched `<` / `{` is replaced with its HTML entity (`<` / `{`)
so it renders literally and never opens a JSX/expression node. Also routes
union-variant descriptions through the same escaper (previously emitted raw).
Verified: `pnpm --filter @objectstack/docs build` (gen:schema + gen:docs +
next build) now completes; no remaining unmatched `<` outside code spans
across the generated references.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Unblocks
main— theapps/docsNext.js (Turbopack + fumadocs-mdx) production build currently fails:(This is a docs-build regression unrelated to the validation-rules work; it surfaced once the #1485 → #1490 platform-objects regression was cleared and the pipeline reached the docs build.)
Root cause
packages/spec/scripts/build-docs.tsgenerates the reference MDX from the Zod schemas. ItsescapeMdxDescriptiononly backtick-wrapped matched<…>/{…}pairs. A lone<with no closing partner — e.g. the SemVer range inmanifest'splatformfield,.describe('... ">=4.0 <5"')— was emitted raw, and MDX read the<5as the start of a JSX tag.Fix
</{is now emitted as its HTML entity (</{) so it renders literally and never opens a JSX/expression node. Matched pairs keep their existing backtick-wrapping; fragments already inside inline-code spans are still left untouched.Only the generator changes — the committed generated
.mdxis regenerated by the build (gen:schema && gen:docs && next build), so no generated content is included here.Verification
pnpm --filter @objectstack/docs build(full gen +next build) completes successfully. A sweep of all generatedcontent/docs/references/**confirms no remaining unmatched<outside code spans (>=2.0.0 <3.0.0style ranges are inside backticks and unaffected).🤖 Generated with Claude Code