Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 320c841

Browse files
claude[bot]claude
andauthored
docs(plugin-markdown): compile the README's snippets against the shipped surface (#8260)
Burns down `packages/plugin-markdown/README.md`'s `UNGATED_DOCS` entry (objectui#5174, batch 34): the page moves from the gate's ledgered tier into its compiled tier, so its snippets are judged on every commit instead of being recorded as debt. - The "Schema API" block was a TYPE shape written as an object literal — the page's only parse failure and both ledgered diagnostics. It becomes a Markdown members table, so the page points at `MarkdownSchema` instead of carrying a second private copy of it. - The Usage example's bare `const schema = { … }` is annotated `MarkdownSchema` with the type import; measured beforehand, the unannotated binding accepted a genuine type error with a byte-identical ledger row. - The manual-registration loop now passes the `{ namespace: 'plugin-markdown' }` third argument the plugin's own registration makes; the two-argument form still compiles but `ComponentRegistry.register` warns that it is deprecated. No `src/**` or type edit: `content`'s contract-versus-runtime reading (`schema.content || ''`) and the two ADR-0049 tombstones are stated, not changed. Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0fa7a9c commit 320c841

2 files changed

Lines changed: 26 additions & 11 deletions

File tree

‎packages/plugin-markdown/README.md‎

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ pnpm add @object-ui/plugin-markdown
2424
```typescript
2525
// In your app entry point (e.g., App.tsx or main.tsx)
2626
import '@object-ui/plugin-markdown';
27+
import type { MarkdownSchema } from '@object-ui/plugin-markdown';
2728

2829
// Now you can use markdown type in your schemas
29-
const schema = {
30+
const schema: MarkdownSchema = {
3031
type: 'markdown',
3132
content: '# Hello World\n\nThis is **markdown** text.'
3233
};
@@ -40,7 +41,7 @@ import { ComponentRegistry } from '@object-ui/core';
4041

4142
// Manually register if needed
4243
Object.entries(markdownComponents).forEach(([type, component]) => {
43-
ComponentRegistry.register(type, component);
44+
ComponentRegistry.register(type, component, { namespace: 'plugin-markdown' });
4445
});
4546
```
4647

@@ -59,13 +60,29 @@ const schema: MarkdownSchema = {
5960

6061
## Schema API
6162

62-
```typescript
63-
{
64-
type: 'markdown',
65-
content: string, // Markdown content (supports GitHub Flavored Markdown)
66-
className?: string // Tailwind classes
67-
}
68-
```
63+
`MarkdownSchema` has one authority — it is declared in `@object-ui/types` and
64+
re-exported by this package — so the members are listed here rather than
65+
re-declared as a second copy in a code block.
66+
67+
| Member | Type | Required | Default | Read by |
68+
| --- | --- | --- | --- | --- |
69+
| `type` | `'markdown'` | yes | none | the registry, to resolve this renderer (registered under the `plugin-markdown` namespace) |
70+
| `content` | `string` | yes | none — see the note below | `MarkdownRenderer`, which forwards it to the lazy implementation; supports GitHub Flavored Markdown |
71+
| `className` | `string` | no | none | `MarkdownRenderer`, which puts it on the markdown container as Tailwind classes |
72+
73+
Every other member is inherited from `BaseSchema`; this renderer reads none of
74+
them.
75+
76+
> ⚠️ **`content`: what the contract says and what the runtime does.** The type
77+
> declares `content` REQUIRED and the component's `inputs` manifest declares it
78+
> `required: true` — but the renderer reads `schema.content || ''`, so a node
79+
> that omits it renders empty instead of failing. Both statements are true, and
80+
> neither is widened or narrowed here.
81+
82+
`sanitize` and `components` appear on the interface only as ADR-0049 retirement
83+
tombstones (`?: never`, objectui#6972) — they are not authorable members and
84+
nothing reads them. Sanitization is unconditional: there is no authored spelling
85+
that turns it off.
6986

7087
## Supported Markdown Features
7188

‎scripts/check-doc-snippet-types.mjs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,6 @@ const UNGATED_DOCS = {
779779
'2 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; 1 unresolved-module diagnostic(s)',
780780
'packages/plugin-map/README.md':
781781
'1 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies; 1 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; plus TS2322x1 — candidate real defects, un-triaged',
782-
'packages/plugin-markdown/README.md':
783-
'2 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies',
784782
};
785783

786784
// ── Fence scanning ───────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)