Repository navigation
docs(core): compile twenty-one plaintext-fenced TypeScript snippets (#5867 batch 2) - #6123
Conversation
…5867 batch 2) Re-fence 21 blocks across content/docs/core/{app-schema,enhanced-actions,schema-renderer}.mdx from plaintext to ts/tsx so check-doc-snippet-types compiles them, and fix what compiling them reddened. Part of #5867 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
PM: ACCEPT — batch 2, and this is the card earning its keep
18 blocks reddened, and every one was fixed rather than markedThis is what the card predicted and what makes it worth doing. Two are real defects that were invisible because nothing compiled these blocks:
The rest were ambient-name leaks, now self-contained with the import a reader actually needs. That last point matters: a snippet that compiles only because the checker has ambient names in scope is still broken for the person copying it. Two probes, and the second one is a gift to batch 3Probe 1 scoped this batch by measurement — re-fenced the whole core+layout remainder (44 blocks), rebuilt with the regenerated filter, ran the gate ( Probe 2 was not asked for: you re-fenced all 94 remaining components + plugins + blocks blocks across 80 files ( Render check held to batch 1's bar: 5 + 11 + 5 = 21 blocks newly carrying shiki keyword spans, matching the batch exactly, with Population corrected again (172/106 — one block more than batch 1 handed back, a new components page having landed), which is the right instinct: re-measure, don't inherit. The three blockers are correctly filed, and I am ruling on two nowYou excluded two files by measurement rather than by eye and filed the reasons. All three are genuine rulings, not implementation questions:
Also worth having: the two one-file defects probe 2 surfaced — Landing⏳ CI converging on Generated by Claude Code |
Part of #5867 — batch 2 of N. Batches remain, so this does not close the card.
Twenty-one TypeScript snippets across three
content/docs/core/*.mdxpages were fenced asplaintext, whichcheck-doc-snippet-typesdoes not read (TS_FENCE_LANGUAGESists/tsx/typescript). They are nowts/tsx, so the gate compiles them — and compiling them found three real documentation defects, fixed here.The classifier is triage's, applied unchanged
Nothing was widened. Prose blocks on the same pages are untouched —
schema-renderer.mdxkeeps three (a bare object-shape excerpt and two deliberately-invalidSchemaRendererusages), and they still render unstyled, which is the control for the render check below.Files, and why these
content/docs/core/app-schema.mdxcontent/docs/core/enhanced-actions.mdxcontent/docs/core/schema-renderer.mdxWhole files only. Scope was chosen by measurement, not by eye: all 44 blocks of the
core+layoutremainder were re-fenced in a throwaway probe, the gate was run, and the tree restored under atrap … EXIT INT TERM. The probe reddened 31 blocks; those readings are what the exclusions below stand on, rather than a reading of the pages.What compiling them reddened, and the fix for each
app-schema.mdxdocumented a type that has never existed. Every block annotatedAppSchemafrom@object-ui/types; the gate answeredTS2724: has no exported member named 'AppSchema'. The shipped name isAppComponentSchema— pinned by three independent pieces of evidence inside the package:app.d.ts:283declares it,wizardDraftToAppSchema(draft): AppComponentSchemanames the mapping, and the Zod twin exports the same spelling (zod/index.zod.d.ts:35). Renamed on the page (title, prose and code, 9 occurrences). The literal was then checked against the real type and passes unchanged, which is the evidence thatAppComponentSchemais the type the page always meant.enhanced-actions.mdxcallbacks authored anActionCallback.dialogwith notypekey.ActionCallback.dialogisSchemaNode(crud.d.ts:51), andSchemaNodeextendsBaseSchema, which requirestype— so the documenteddialog: { title, content }cannot exist.type: 'dialog'added to both;dialogis a registered component (packages/components/src/renderers/overlay/dialog.tsx:22), andActionRunner's own test pins the same shape.ActionSchemaand never imported it;interface AppActionreferencedMenuItem; two validation examples calledsafeParseon undeclared values; the registry example calledComponentRegistry.register('my-widget', MyWidgetComponent)with no such component and rendered aSchemaRendererelement without importing it. Each got the import — or, for the twosafeParseblocks, the small literal — that a reader copying the block needs anyway. ⛔ NoFRAGMENT_MARKERwas declared; the ledger andUNGATED_DOCSare untouched.Excluded, each with a filed blocker rather than a marker
content/docs/core/report-schema.mdx(11 blocks) → finding(docs/types): everycontent/docs/core/report-schemaauthoring example contradicts the types it annotates —dataSourceis typed as the runtimeDataSourceadapter, andexportsdemands all five formats #6121. After the ambient-name imports it still reds on four separate contract mismatches —dataSourceis annotated withDataSource, the runtime adapter interface, while every example authors a{ provider, read }config;exportsis a totalRecordover all five formats;ChartDataSerieshas notype. Which side is wrong is a ruling, not a docs edit.content/docs/layout/**(12 blocks, 3 files) → finding(docs): snippets that import a package's own third-party dependency (lucide-react) cannot resolve it — the wholecontent/docs/layoutgroup is blocked from #5867 #6120. Five blocks red only onTS2307: Cannot find module 'lucide-react'— a declared dependency of@object-ui/layoutthat is not resolvable from the repository root, where the snippet program compiles. The snippets are correct; the resolution environment is the gap.content/docs/core/app-schema.mdxwas not excluded for the same class of reason, because its rename is pinned by the package's own exports, while finding(docs/types): everycontent/docs/core/report-schemaauthoring example contradicts the types it annotates —dataSourceis typed as the runtimeDataSourceadapter, andexportsdemands all five formats #6121 and finding(docs): snippets that import a package's own third-party dependency (lucide-react) cannot resolve it — the wholecontent/docs/layoutgroup is blocked from #5867 #6120 are not.Verification
All at branch head
0ee4e87dd, tree clean, heavy runs through the container's shared verify lock.Gate, before → after (
node scripts/check-doc-snippet-types.mjs, quoting its own lines):Blocks-to-compile +21 = exactly the batch; diagnostics 0; declared fragments 111, unmoved; covered 178, unchanged (the set did not shrink); ungated 44, unchanged (no document newly ungated). Gate strictness unmoved —
scripts/is not in this diff.Other gates at the same head, exit codes captured before any pipe, each quoted by its own verdict line:
check:doc-snippetsexit=0 ·check:doc-typesexit=0 "Every documented component type is registered." (890typeliterals, up from 887 — the three this diff adds are all registered) ·docs:check-linksexit=0 "Links are valid across 15 scan roots." ·check:control-bytesexit=0 "OK (scanned 5063 tracked text file(s); skipped 85 binary)".Vitest, from the repository root:
check-doc-snippet-types·check-doc-component-types·check-doc-links·check-changeset-presence— "Test Files 4 passed (4), Tests 185 passed (185)".Render:
pnpm site:buildgreen (after building@object-ui/plugin-ganttand@object-ui/plugin-map, which sit outside the gate's--build-filterclosure — the same unrelated build note batch 1 recorded). Reading the prerendered HTML back, all 21 converted blocks now carry shiki keyword spans onimport/const/interfacewhere they were previously unstyled — 5 + 11 + 5, the batch exactly — andschema-renderer.mdx's three untouched plaintext blocks still render with zero shiki spans.Remainder
151 blocks in 103 files, handed back on #5867 for batch 3 with a measured breakdown of which files compile untouched.
⛔ Draft on purpose: not marked ready, no auto-merge.
Generated by Claude Code
Generated by Claude Code