Skip to content

Commit 90cca72

Browse files
committed
docs(cli): document the objectui check expression refusal, with its changeset (objectui#4795)
The `objectui check` page said only unreadable JSON fails the run; a refused `${…}` on a text key its node never evaluates now does too. The page names the rule, the two sub-rules and the real output, and the changeset declares the new refusal as a minor for `@object-ui/cli`. Claude-Session: https://claude.ai/code/session_012UwY3ahMixEFkfTUxMVkYm Co-authored-by: Claude <noreply@anthropic.com>
1 parent e2f8e48 commit 90cca72

2 files changed

Lines changed: 62 additions & 6 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@object-ui/cli': minor
3+
---
4+
5+
feat(cli): `objectui check` refuses a `${…}` on a text key its node never evaluates
6+
7+
`SchemaRenderer` evaluates an expression on the closed text keys `title`,
8+
`label`, `value` and `description` only where `@objectstack/spec`'s
9+
`expressionBindableTextKeysFor(type)` lists that key for the node's type.
10+
Anywhere else the expression is never resolved, so the user sees
11+
`${data.total}` as literal text, or nothing at all — and no step before the
12+
browser said so.
13+
14+
`objectui check` now refuses such an expression in every file it recognises as
15+
an ObjectUI schema, and the run exits non-zero. The refusal names the key, the
16+
path to it (spelled as `objectui validate` spells paths), the keys that type
17+
does evaluate, and the channels `SchemaRenderer` evaluates. Types with no row in
18+
the carriage map are refused too: `text.value` and `action:button.label` are
19+
never evaluated.
20+
21+
- **Component nodes only**: the file's root node and every node its `children`
22+
hold. Objects under other keys, such as a form's `fields` entries, are
23+
definitions rather than nodes and are not judged. A root of type `page` keeps
24+
its own `title`, which is a page key; its `children` are still judged.
25+
- **The type is matched as written**, as the runtime matches it: `ui:card` has
26+
no row, and is not read as `card`.
27+
- **A type no registered component answers to** gets a warning instead of a
28+
refusal, because a custom renderer may evaluate its own keys.
29+
30+
The key vocabulary and the per-type carriage map are read from
31+
`@objectstack/spec`, now a declared dependency of `@object-ui/cli`, so a row
32+
added upstream moves this check and the runtime together.

‎content/docs/utilities/cli.mdx‎

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,37 @@ distinction matters:
224224
Issue at map: Unrecognized key: "latitudeFieId"
225225
```
226226

227-
A run with no parse errors ends on a tally rather than a pass: how many
228-
recognised files validated, how many were recognised by a structural key and not
229-
validated, and how many did not validate, followed by a pointer to
230-
`objectui validate` for the verdict.
227+
#### Expressions on text keys that are never evaluated
228+
229+
`SchemaRenderer` evaluates a `${…}` expression on the closed text keys `title`,
230+
`label`, `value` and `description` only where `@objectstack/spec`'s
231+
`expressionBindableTextKeysFor(type)` lists that key for the node's type. On any
232+
other type, the expression is never resolved: the user sees its literal text, or
233+
nothing. `objectui check` refuses it in every recognised file:
234+
235+
- **Component nodes only.** The file's root node and every node its `children`
236+
hold, at any depth. Objects under other keys (a form's `fields`, a grid's
237+
`columns`) are definitions, not nodes, and are not judged. A root whose `type`
238+
is `page` keeps its own `title`: that is a page key, while its `children` are
239+
still judged.
240+
- **The type is matched as written.** `ui:card` is not `card`, exactly as at
241+
render time.
242+
- **A type no registered component answers to** is warned about, not refused: a
243+
custom renderer may evaluate its own keys.
231244

232-
Only unreadable JSON makes `objectui check` exit non-zero; everything above is a
233-
report. Use `objectui validate` when you want a failing exit code.
245+
```text
246+
x Unevaluated expression in dashboard.json at children → 0 → title: "statistic" never evaluates `title` (it evaluates only `label`, `value`, `description`), so the expression is never resolved: the user sees its literal text, or nothing.
247+
Channels SchemaRenderer evaluates: `label`, `value`, `description`, `content`, `properties.title` (evaluated, then hoisted onto the node); or resolve the value in the host before the schema reaches SchemaRenderer.
248+
```
249+
250+
A run with no parse errors and no refused expression ends on a tally rather than
251+
a pass: how many recognised files validated, how many were recognised by a
252+
structural key and not validated, and how many did not validate, followed by a
253+
pointer to `objectui validate` for the verdict.
254+
255+
Unreadable JSON and a refused expression make `objectui check` exit non-zero;
256+
everything else above is a report. Use `objectui validate` when you want a
257+
failing exit code on a document that does not validate.
234258

235259
### `objectui doctor`
236260

0 commit comments

Comments
 (0)