diff --git a/.changeset/5867-plaintext-fenced-ts-batch4.md b/.changeset/5867-plaintext-fenced-ts-batch4.md new file mode 100644 index 0000000000..88d2a22e54 --- /dev/null +++ b/.changeset/5867-plaintext-fenced-ts-batch4.md @@ -0,0 +1,22 @@ +--- +--- + +Docs only, publishes nothing: nineteen TypeScript snippets across +`content/docs/blocks/block-schema.mdx` and six `content/docs/plugins/*.mdx` +reference pages were fenced ```plaintext, so `check-doc-snippet-types` — which +reads only `ts` / `tsx` fences — never saw them (objectui#5867, batch 4 of N). +Triage's classifier is the one applied: a plaintext block whose first line +starts with `import` / `export` / `interface` / `type X =` / `const x: T` is +code, and those fences are now `ts`; genuinely prose blocks on the same pages +are left alone. Compiling them found real documentation defects on +`block-schema`, now fixed: the *Complete Example*, *Block Slots* and +*Marketplace Example* blocks annotated `BlockSchema` / `SchemaNode` / +`BlockLibrarySchema` without importing them, and three blocks referenced values +defined in other blocks on the page. Resolving `BlockLibrarySchema` then +un-masked a defect the unresolved name had been suppressing: both marketplace +listings carried `schema: { /* block schema */ }`, an empty object that +`BlockLibraryItem.schema` rejects because `BlockSchema` requires `type`. The +gate's blocks-to-compile count rises from 206 to 225 — exactly the batch — with +diagnostics at 0, no new `FRAGMENT_MARKER` declarations, and the +covered/ungated sets unmoved. The blocks also stop rendering as unstyled +plaintext and pick up TypeScript highlighting, which is the reader-visible half. diff --git a/content/docs/blocks/block-schema.mdx b/content/docs/blocks/block-schema.mdx index f8fbbef323..d0baf1fb95 100644 --- a/content/docs/blocks/block-schema.mdx +++ b/content/docs/blocks/block-schema.mdx @@ -62,7 +62,7 @@ expanded. None of them goes through `BlockSchema`: there is nothing that expands ## Basic Usage -```plaintext +```ts import type { BlockSchema } from '@object-ui/types'; const heroBlock: BlockSchema = { @@ -108,7 +108,7 @@ const heroBlock: BlockSchema = { ### Block Metadata -```plaintext +```ts interface BlockMetadata { name: string; // Block identifier label?: string; // Display name @@ -129,7 +129,7 @@ interface BlockMetadata { Variables define configurable properties: -```plaintext +```ts interface BlockVariable { name: string; // Variable name label?: string; // Display label @@ -146,7 +146,9 @@ interface BlockVariable { Slots define content injection points: -```plaintext +```ts +import type { SchemaNode } from '@object-ui/types'; + interface BlockSlot { name: string; // Slot name label?: string; // Display label @@ -186,7 +188,9 @@ this family it is **declared but not yet consumed** - no renderer reads it today ## Complete Example -```plaintext +```ts +import type { BlockSchema } from '@object-ui/types'; + const cardBlock: BlockSchema = { type: 'block', @@ -325,7 +329,7 @@ const cardBlock: BlockSchema = { variable values, what slot content. It is a definition, not a component - nothing resolves `blockId` or expands the block it names. -```plaintext +```ts import type { BlockInstanceSchema } from '@object-ui/types'; const instance: BlockInstanceSchema = { @@ -365,8 +369,11 @@ selected it and the listings it returned. It is a data shape, not a browser comp nothing renders a library, and `onInstall` / `onPreview` name handlers that no dispatcher looks up. -```plaintext -import type { BlockLibrarySchema } from '@object-ui/types'; +```ts +import type { BlockLibrarySchema, BlockSchema } from '@object-ui/types'; + +// The block defined under "Basic Usage" above. +declare const heroBlock: BlockSchema; const library: BlockLibrarySchema = { type: 'block-library', @@ -403,8 +410,11 @@ const library: BlockLibrarySchema = { open and which panels a host would show. It is a configuration shape, not an editor component - no block editor exists to consume it. -```plaintext -import type { BlockEditorSchema } from '@object-ui/types'; +```ts +import type { BlockEditorSchema, BlockSchema } from '@object-ui/types'; + +// The block defined under "Complete Example" above. +declare const cardBlock: BlockSchema; const editor: BlockEditorSchema = { type: 'block-editor', @@ -423,7 +433,9 @@ const editor: BlockEditorSchema = { ## Marketplace Example -```plaintext +```ts +import type { BlockLibrarySchema } from '@object-ui/types'; + const marketplace: BlockLibrarySchema = { type: 'block-library', apiEndpoint: 'https://blocks.objectui.com/api', @@ -444,7 +456,7 @@ const marketplace: BlockLibrarySchema = { premium: false, preview: 'https://blocks.objectui.com/previews/pricing-table.png' }, - schema: { /* block schema */ }, + schema: { type: 'block', meta: { name: 'pricing-table-pro' } }, installs: 5420, rating: 4.9, ratingCount: 234, @@ -463,7 +475,7 @@ const marketplace: BlockLibrarySchema = { version: '1.3.0', premium: true }, - schema: { /* block schema */ }, + schema: { type: 'block', meta: { name: 'testimonial-slider' } }, installs: 2150, rating: 4.7, ratingCount: 89 @@ -474,9 +486,12 @@ const marketplace: BlockLibrarySchema = { ## Runtime Validation -```plaintext +```ts import { BlockSchema } from '@object-ui/types/zod'; +// The block configuration to validate. +declare const myBlock: unknown; + const result = BlockSchema.safeParse(myBlock); if (result.success) { diff --git a/content/docs/plugins/plugin-charts.mdx b/content/docs/plugins/plugin-charts.mdx index 1dc7481758..a7520403c9 100644 --- a/content/docs/plugins/plugin-charts.mdx +++ b/content/docs/plugins/plugin-charts.mdx @@ -262,7 +262,7 @@ const schema = { ## TypeScript Support -```plaintext +```ts import type { BarChartSchema } from '@object-ui/plugin-charts' const chartSchema: BarChartSchema = { diff --git a/content/docs/plugins/plugin-editor.mdx b/content/docs/plugins/plugin-editor.mdx index 93da2db490..e80bb05eea 100644 --- a/content/docs/plugins/plugin-editor.mdx +++ b/content/docs/plugins/plugin-editor.mdx @@ -137,7 +137,7 @@ This keeps your main application bundle small while providing full IDE-like edit ## TypeScript Support -```plaintext +```ts import type { CodeEditorSchema } from '@object-ui/plugin-editor' const editorSchema: CodeEditorSchema = { diff --git a/content/docs/plugins/plugin-form.mdx b/content/docs/plugins/plugin-form.mdx index 1307bb99c0..aeaad38e29 100644 --- a/content/docs/plugins/plugin-form.mdx +++ b/content/docs/plugins/plugin-form.mdx @@ -212,7 +212,7 @@ spec rejects `pane` on non-split form types at parse.) ### Registration is a side effect of the import -```plaintext +```ts import '@object-ui/plugin-form'; ``` @@ -242,7 +242,7 @@ claims it. To serve one of this package's components under a key of your own, register the exported component — that is what a manual registration is here: -```plaintext +```ts import { ComponentRegistry } from '@object-ui/core'; import { ObjectForm } from '@object-ui/plugin-form'; diff --git a/content/docs/plugins/plugin-grid.mdx b/content/docs/plugins/plugin-grid.mdx index 72fa9d6402..96a0ed8fd4 100644 --- a/content/docs/plugins/plugin-grid.mdx +++ b/content/docs/plugins/plugin-grid.mdx @@ -170,7 +170,7 @@ view whose columns are all `none` (or carry no `summary`) has no footer. ### Registration is a side effect of the import -```plaintext +```ts import '@object-ui/plugin-grid'; ``` @@ -200,7 +200,7 @@ the CSS Grid *layout* container in `@object-ui/components` To serve the data grid under a key of your own, register the exported renderer — that is what a manual registration is here: -```plaintext +```ts import { ComponentRegistry } from '@object-ui/core'; import { ObjectGridRenderer } from '@object-ui/plugin-grid'; diff --git a/content/docs/plugins/plugin-markdown.mdx b/content/docs/plugins/plugin-markdown.mdx index d6a0456e4b..d81a723636 100644 --- a/content/docs/plugins/plugin-markdown.mdx +++ b/content/docs/plugins/plugin-markdown.mdx @@ -347,7 +347,7 @@ The plugin uses lazy loading to optimize bundle size: ## TypeScript Support -```plaintext +```ts import type { MarkdownSchema } from '@object-ui/plugin-markdown' const markdownSchema: MarkdownSchema = { diff --git a/content/docs/plugins/plugin-view.mdx b/content/docs/plugins/plugin-view.mdx index a21996a93c..a0562fea6d 100644 --- a/content/docs/plugins/plugin-view.mdx +++ b/content/docs/plugins/plugin-view.mdx @@ -202,7 +202,7 @@ path only (the row above, and the section below), so on a non-grid ### Registration is a side effect of the import -```plaintext +```ts import '@object-ui/plugin-view'; ``` @@ -238,7 +238,7 @@ than as a schema key. To serve one of this package's components under a key of your own, register the exported component — that is what a manual registration is here: -```plaintext +```ts import { ComponentRegistry } from '@object-ui/core'; import { ViewSwitcher } from '@object-ui/plugin-view';