Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ const mySchema: PageNodeSchema = {

```typescript
import { ComponentRegistry } from '@object-ui/core'
import type { ComponentRenderer } from '@object-ui/core'

ComponentRegistry.register('button', buttonMetadata)
const metadata = ComponentRegistry.get('button')
// Your component, in whatever renderer shape the host framework uses.
declare const buttonRenderer: ComponentRenderer

ComponentRegistry.register('button', buttonRenderer)
const renderer = ComponentRegistry.get('button')
```

`ComponentRegistry` is a process-level singleton exported by `@object-ui/core`;
`SchemaRenderer` resolves every `type` against it, so a component registered
here is renderable from schema anywhere in the app.
here is renderable from schema anywhere in the app. `register()`'s second
argument is the component itself; registration metadata is its optional third
argument, and `getMeta()` — not `get()` — reads that metadata back.

### Data Scope

Expand Down Expand Up @@ -82,6 +88,14 @@ object scope, which are injected:

```typescript
import { createServerActionHandler } from '@object-ui/core'
import type { ActionRunner, ServerActionFetch } from '@object-ui/core'

// Injected by the host. Each stand-in is typed from the shipped surface, so
// this example is checked against the factory's own config rather than a copy.
declare const myAuthenticatedFetch: ServerActionFetch
declare const currentObject: string | undefined
declare const refetchData: () => void
declare const runner: ActionRunner

const script = createServerActionHandler({
fetch: myAuthenticatedFetch, // your auth wrapper (Bearer/cookies/...)
Expand Down Expand Up @@ -116,6 +130,7 @@ export const userListView = defineSystemView({
columns: [{ name: 'email' }],
})

// @ts-expect-error readonly by defineSystemView — refused at compile time, not just at run time
userListView.columns.push({ name: 'name' }) // ❌ TypeError (strict mode)
isSystemView(userListView) // ✅ true

Expand Down
10 changes: 0 additions & 10 deletions scripts/check-doc-snippet-types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -705,16 +705,6 @@ const UNGATED_DOCS = {
'what is left is fragment shape, and no gate reads this page\'s import names.',
'packages/auth/README.md':
'1 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies; 15 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; plus TS2741x1 — candidate real defects, un-triaged',
'packages/core/README.md':
'5 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the ' +
'page never defines; plus TS2339x1 — TRIAGED, and NOT a defect: the remaining one is ' +
'`userListView.columns.push(...) // ❌ TypeError (strict mode)`, the System-View immutability ' +
'demonstration, so a readonly rejection there is the documentation working as written. ' +
'This entry read TS2339x2 until objectui#5257: the second one, on the `cloneAsOverride` draft ' +
'one block below, was a real signature defect — `cloneAsOverride` returned its input type, so ' +
'the documented override flow did not compile. It now returns `DeepMutable<T>` and that ' +
'diagnostic is gone. Covering this page still needs the 5 undefined-name blocks made ' +
'self-contained or declared, plus a way to declare a block whose rejection IS the point.',
'packages/fields/README.md':
'2 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; 1 unresolved-module diagnostic(s)',
'packages/plugin-ai/README.md':
Expand Down
Loading