From cf2a91b8b88362da9d244025e0921fd0ceb83de8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 20:50:35 +0000 Subject: [PATCH] docs: stop teaching imports five published pages do not export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four package READMEs (app-shell, components, core, react) and the ObjectOS integration guide imported 15 symbols their packages do not export. All four READMEs ship to npm inside their package's `files`, so a reader copying one of those imports got a compile error. Each name was decided against the package's BUILT `dist/index.d.ts` — the surface a consumer resolves — never a grep of `src/`: - renamed: defineView -> defineSystemView (core; renamed in objectstack#4115 because @objectstack/spec owns `defineView` for the view-DOCUMENT factory), PageSchema -> PageNodeSchema. - neighbour: DashboardRenderer is @object-ui/plugin-dashboard (app-shell's own DashboardView.tsx imports it from there); FormSchema/InputSchema/ BaseSchema/PageNodeSchema are @object-ui/types vocabulary that core only consumes. - removed: ObjectRenderer (removed as an unwired stub in 54e3dfbbf, which names SchemaRenderer as the real implementation); registerDefaultRenderers, registerRenderer, useRegistry, useObjectQuery, useObjectMutation never existed in any package's src/ at any point in history. Each example now teaches the real surface instead. The five UNGATED_DOCS reason strings are re-measured to the new diagnostic mix. No entry is added, widened or deleted, and the gate's build filter is unchanged. AppManifest (objectos-integration.mdx) is deliberately NOT changed — see the PR body. It exists at @objectstack/spec/system rather than the root, but the literal beneath it is not an AppManifest in any spelling, so a path-only fix would trade one type error for another. Part of #5160 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE --- content/docs/guide/objectos-integration.mdx | 28 ++++++---- packages/app-shell/README.md | 61 +++++++++++---------- packages/components/README.md | 22 +++++--- packages/core/README.md | 49 ++++++++++------- packages/react/README.md | 17 +++--- scripts/check-doc-snippet-types.mjs | 10 ++-- 6 files changed, 108 insertions(+), 79 deletions(-) diff --git a/content/docs/guide/objectos-integration.mdx b/content/docs/guide/objectos-integration.mdx index 0ef687d420..5e6d47f216 100644 --- a/content/docs/guide/objectos-integration.mdx +++ b/content/docs/guide/objectos-integration.mdx @@ -325,22 +325,26 @@ const schema = { ### Custom Data Hooks +`@object-ui/data-objectstack` ships the *adapter*, not hooks. Reads and writes +go through `useViewData` from `@object-ui/react`, which resolves the adapter +from context and hands back both the rows and the `DataSource` to write with. + ```typescript -// Implement custom hooks for data operations -import { useObjectQuery, useObjectMutation } from '@object-ui/data-objectstack'; +import { useViewData } from '@object-ui/react'; function ContactList() { - const { data, loading, error } = useObjectQuery('contact', { - filter: { field: 'status', operator: 'eq', value: 'active' }, - sort: [{ field: 'name', order: 'asc' }], - page: 1, - pageSize: 20 + const { data, loading, error, dataSource, refresh } = useViewData({ + resource: 'contact', + params: { + $filter: { status: 'active' }, + $orderby: [{ field: 'name', order: 'asc' }], + $top: 20, + }, }); - const { mutate: createContact } = useObjectMutation('contact', 'create'); - - const handleCreate = async (formData: any) => { - await createContact(formData); + const handleCreate = async (formData: Record) => { + await dataSource?.create('contact', formData); + await refresh(); }; if (loading) return
Loading...
; @@ -350,7 +354,7 @@ function ContactList() { diff --git a/packages/app-shell/README.md b/packages/app-shell/README.md index 37144b305c..21e7f5b14b 100644 --- a/packages/app-shell/README.md +++ b/packages/app-shell/README.md @@ -8,7 +8,8 @@ A lightweight, framework-agnostic rendering engine that enables third-party syst This package provides the essential building blocks for rendering ObjectUI schemas: - Basic layout components (AppShell, Sidebar, Main) -- Renderer components for objects, dashboards, pages, and forms +- Route-level views for objects, dashboards, pages and records + (`ObjectView`, `DashboardView`, `PageView`, `RecordDetailView`) - Zero console-specific dependencies - Bring-your-own-router design @@ -23,15 +24,18 @@ pnpm add @object-ui/app-shell ### Basic Setup ```tsx -import { AppShell, ObjectRenderer } from '@object-ui/app-shell'; +import { AppShell } from '@object-ui/app-shell'; +import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react'; +import type { ObjectViewSchema } from '@object-ui/types'; + +const contactView: ObjectViewSchema = { type: 'object-view', objectName: 'contact' }; function MyCustomConsole() { return ( }> - + + + ); } @@ -39,8 +43,11 @@ function MyCustomConsole() { ### With Dashboard +`DashboardRenderer` ships from `@object-ui/plugin-dashboard` — this package's +own `DashboardView` imports it from there. + ```tsx -import { DashboardRenderer } from '@object-ui/app-shell'; +import { DashboardRenderer } from '@object-ui/plugin-dashboard'; function MyDashboard() { return ( @@ -103,40 +110,38 @@ Basic layout container with sidebar support. ``` -### ObjectRenderer +### ObjectView -Renders object views (Grid, Kanban, List, etc.). +The route-level object surface (Grid, Kanban, List, etc.). It resolves the +object and view from the host's route, so it takes no `objectName` prop — +mount it on a route that supplies them, as the console does with +`/apps/:appName/:objectName` and `/apps/:appName/:objectName/view/:viewId`. ```tsx - navigate(`/detail/${record.id}`)} -/> + ``` -### DashboardRenderer +To render an object view from a schema instead of from a route, use +`SchemaRenderer` from `@object-ui/react` — see [Basic Setup](#basic-setup). + +### DashboardView / PageView -Renders dashboard layouts from schema. +`DashboardView` and `PageView` are the route-level equivalents for dashboards +and custom pages; like `ObjectView` they resolve their target from the route +(`dashboardName` / `pageName`) rather than from a `schema` prop. ```tsx - + ``` -### PageRenderer - -Renders custom page schemas. - ```tsx - + ``` +The schema-driven renderers live elsewhere: `DashboardRenderer` in +`@object-ui/plugin-dashboard`, and everything else through `SchemaRenderer` in +`@object-ui/react`, which resolves `type` against the component registry. + ### ActionParamDialog Collects user input for a declared action's `params` before execution. Every diff --git a/packages/components/README.md b/packages/components/README.md index 464d88f79b..cf691dc7c1 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -70,20 +70,24 @@ entry goes on generating the classes your own source uses, as it always did. ### 2. Register Components ```tsx -import { registerDefaultRenderers } from '@object-ui/components' +import { initializeComponents } from '@object-ui/components' -registerDefaultRenderers() +initializeComponents() ``` +Importing the package already registers its components as a side effect; +`initializeComponents()` is the explicit call for bundlers that would otherwise +tree-shake that import away. + ## Usage ### With SchemaRenderer ```tsx import { SchemaRenderer } from '@object-ui/react' -import { registerDefaultRenderers } from '@object-ui/components' +import { initializeComponents } from '@object-ui/components' -registerDefaultRenderers() +initializeComponents() const schema = { type: 'card', @@ -200,16 +204,20 @@ All components accept `className` for Tailwind classes: Register your own components: ```tsx -import { registerRenderer } from '@object-ui/react' +import { ComponentRegistry } from '@object-ui/core' import { Button } from '@object-ui/components' -function CustomButton(props) { +function CustomButton(props: Record) { return