From 32a25222abf9d6c4bac853de458b1f69c9dbd456 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Aug 2026 01:38:39 +0000 Subject: [PATCH] =?UTF-8?q?fix(site):=20SchemaNode=20crosses=20to=20Schema?= =?UTF-8?q?Renderer=20through=20the=20bridge=20=E2=80=94=20the=20docs=20si?= =?UTF-8?q?te=20builds=20again=20(#4617)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Build Docs` (`next build`, which type-checks apps/site) has failed on every push to `main` since PR #4608 landed, with 5x TS2322 at the five call sites that hand a `SchemaNode` to `SchemaRenderer`'s `schema` prop. Route all five through `toRenderableSchema`, the adapter #4548-Q2 kept for exactly this crossing: `SchemaNode` deliberately includes `number`/`boolean`, SchemaRenderer's component union deliberately excludes them. Not a prop widening, not a cast. Also close the gate gap that let this reach `main` green: apps/site's type-check script was named `types:check`, so `turbo run type-check` listed it as `` and never ran it. Renamed to `type-check`; its CHECKED_BY_OWN_BUILD exemption retires with the rename, as that gate's own ratchet requires. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 --- apps/site/app/components/InteractiveDemo.tsx | 6 ++-- apps/site/app/components/LiveSplitDemo.tsx | 4 +-- apps/site/app/components/SchemaThumbnail.tsx | 4 +-- apps/site/app/playground/page.tsx | 4 +-- apps/site/package.json | 2 +- scripts/check-type-check-coverage.mjs | 30 +++++++++++++------- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/apps/site/app/components/InteractiveDemo.tsx b/apps/site/app/components/InteractiveDemo.tsx index e59adf9b5c..62a48be5d9 100644 --- a/apps/site/app/components/InteractiveDemo.tsx +++ b/apps/site/app/components/InteractiveDemo.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useMemo } from 'react'; -import { SchemaRenderer, SchemaRendererContext } from '@object-ui/react'; +import { SchemaRenderer, SchemaRendererContext, toRenderableSchema } from '@object-ui/react'; import { SidebarProvider } from '@object-ui/components'; // Registers `page-header` & friends — see the module header (objectui#3787). import './registerLayoutBlocks'; @@ -71,7 +71,7 @@ export function InteractiveDemo({
- +
@@ -116,7 +116,7 @@ export function InteractiveDemo({
- +
diff --git a/apps/site/app/components/LiveSplitDemo.tsx b/apps/site/app/components/LiveSplitDemo.tsx index f14ae5e90c..ac73a33d12 100644 --- a/apps/site/app/components/LiveSplitDemo.tsx +++ b/apps/site/app/components/LiveSplitDemo.tsx @@ -17,7 +17,7 @@ import React, { useRef, useState, } from 'react'; -import { SchemaRenderer, SchemaRendererContext } from '@object-ui/react'; +import { SchemaRenderer, SchemaRendererContext, toRenderableSchema } from '@object-ui/react'; import { SidebarProvider } from '@object-ui/components'; import type { SchemaNode } from '@object-ui/core'; import { @@ -283,7 +283,7 @@ export function LiveSplitDemo({ defaultOpen={false} >
- +
diff --git a/apps/site/app/components/SchemaThumbnail.tsx b/apps/site/app/components/SchemaThumbnail.tsx index af8279b189..27483bb42b 100644 --- a/apps/site/app/components/SchemaThumbnail.tsx +++ b/apps/site/app/components/SchemaThumbnail.tsx @@ -16,7 +16,7 @@ import React, { useRef, useState, } from 'react'; -import { SchemaRenderer, SchemaRendererContext } from '@object-ui/react'; +import { SchemaRenderer, SchemaRendererContext, toRenderableSchema } from '@object-ui/react'; import { SidebarProvider } from '@object-ui/components'; import type { SchemaNode } from '@object-ui/core'; // Registers `page-header` & friends — see the module header (objectui#3787). @@ -135,7 +135,7 @@ export function SchemaThumbnail({
- +
diff --git a/apps/site/app/playground/page.tsx b/apps/site/app/playground/page.tsx index 28a605f110..901991d863 100644 --- a/apps/site/app/playground/page.tsx +++ b/apps/site/app/playground/page.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useState, useEffect } from 'react'; -import { SchemaRenderer } from '@object-ui/react'; +import { SchemaRenderer, toRenderableSchema } from '@object-ui/react'; import type { SchemaNode } from '@object-ui/core'; import dynamic from 'next/dynamic'; import { ObjectUIProvider } from '@/app/components/ObjectUIProvider'; @@ -1410,7 +1410,7 @@ export default function PlaygroundPage() { viewMode === 'mobile' ? 'min-h-[667px]' : viewMode === 'tablet' ? 'min-h-[600px]' : '' }`}>
- +
diff --git a/apps/site/package.json b/apps/site/package.json index 9dbb3fdcd6..eb541f8b22 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -8,7 +8,7 @@ "lint": "eslint .", "dev": "next dev", "start": "next start", - "types:check": "fumadocs-mdx && next typegen && tsc --noEmit", + "type-check": "fumadocs-mdx && next typegen && tsc --noEmit", "postinstall": "fumadocs-mdx" }, "dependencies": { diff --git a/scripts/check-type-check-coverage.mjs b/scripts/check-type-check-coverage.mjs index ec29a4e000..9a87ff6d40 100644 --- a/scripts/check-type-check-coverage.mjs +++ b/scripts/check-type-check-coverage.mjs @@ -90,17 +90,25 @@ export const NOT_COMPILED = ["@object-ui/example-hello-world"]; // // That escape hatch is exactly how this exemption could rot, so it is verified // on every run rather than trusted: setting `ignoreBuildErrors` fails the guard. -export const CHECKED_BY_OWN_BUILD = { - "@object-ui/site": { - build: "next build", - // Caveat worth knowing: the `docs` CI job runs this build only when - // `apps/site/` or `content/` changed (plus every push to main). A PR that - // only touches a workspace package in `transpilePackages` therefore does - // not re-check the site until it lands. Closing that would mean paying a - // Next build on many more PRs — a cost/coverage call, not a silent gap. - verifyNoIgnoreBuildErrors: "apps/site/next.config.mjs", - }, -}; +// +// Empty since objectui#4617, and worth keeping that way. Its sole entry was +// `@object-ui/site`, and the caveat that entry carried — "the `docs` CI job runs +// this build only when `apps/site/` or `content/` changed", so a PR touching only +// a `transpilePackages` workspace package "does not re-check the site until it +// lands" — turned out to describe a live main-red, not a tolerable cost/coverage +// call. PR #4608 widened `SchemaNode` to a union, touched no file under +// `apps/site/`, and merged green; the site's five `SchemaRenderer` call sites +// stopped compiling the moment it landed and `Build Docs` was red on every push +// to `main` for the next ~5 hours. The exemption was honest about WHAT checked +// the package and silent about WHEN, and "when" was the half that mattered. +// +// The site now carries a real `type-check` script, so it is audited by the same +// ratchet as every other package and the `Type Check` job reaches it on every PR. +// `verifyNoIgnoreBuildErrors` retires with the entry rather than being orphaned: +// its whole job was protecting a coverage claim that rested on `next build`, and +// coverage no longer rests there — `tsc --noEmit` runs directly, so setting +// `ignoreBuildErrors` can no longer hide a type error from CI. +export const CHECKED_BY_OWN_BUILD = {}; // ── Known gaps: tests that nothing type-checks ─────────────────────────────── // Packages whose tests do not compile yet, so they cannot chain a