|
| 1 | +--- |
| 2 | +"@objectstack/spec": minor |
| 3 | +"@objectstack/lint": patch |
| 4 | +--- |
| 5 | + |
| 6 | +feat(spec,lint): the `ui` vocabularies admit what the renderers implement, and derive instead of restating (objectui#2945) |
| 7 | + |
| 8 | +Additions-only follow-up to the vocabulary audit |
| 9 | +(objectstack-ai/objectui#2901, #2945). Nothing here narrows a vocabulary, so no |
| 10 | +already-stored metadata changes meaning — three of the four `ui/` enums that had |
| 11 | +drifted from what is actually implemented, plus the fork that drift had made |
| 12 | +invisible. |
| 13 | + |
| 14 | +**`ChartTypeSchema` admits `combo`.** The taxonomy could not name the one chart |
| 15 | +family the rest of `chart.zod.ts` is written for: `ChartSeriesSchema.type` |
| 16 | +exists to override a series' type — its doc comment literally says *"combo |
| 17 | +charts"* — and `ChartSeriesSchema.yAxis` binds a series to the left or right |
| 18 | +axis, which is only meaningful for mixed marks. objectui's renderer draws it |
| 19 | +distinctly (mixed bar/line/area on dual axes, per-series type) and had to carry |
| 20 | +`combo` in a local fork of this list, whose own comment claimed to mirror it. |
| 21 | + |
| 22 | +**`WidgetActionTypeSchema` is `ActionType`.** The two disagreed by one member, |
| 23 | +`form`, and the disagreement was backwards: a dashboard header or widget action |
| 24 | +button dispatches through the same `ActionRunner` that implements `form` — |
| 25 | +objectui's `DashboardRenderer` deliberately routes everything except a raw `url` |
| 26 | +into it, so a `flow` header action works (#3528). The narrower enum therefore |
| 27 | +rejected at validation exactly what the shared dispatcher then executes. |
| 28 | +Derived, so the next type the runner implements needs one edit, not two. |
| 29 | + |
| 30 | +**`ListChartConfigSchema.chartType` is `ChartTypeSchema.extract([...])`.** Same |
| 31 | +five members as before — a de-duplication, not a widening. A member renamed in |
| 32 | +the taxonomy now fails at build time instead of leaving a second list quietly |
| 33 | +disagreeing. |
| 34 | + |
| 35 | +**`@objectstack/lint`'s chart-family set is derived from the taxonomy.** |
| 36 | +`validate-widget-bindings` decides which widgets need a `chartConfig` measure |
| 37 | +mapping from a hand-written list of families, and its omissions fail in the |
| 38 | +worst direction: an unlisted family reads as *"not a chart"*, so a widget |
| 39 | +missing its mapping **passes** validation. `combo` was exactly that case — |
| 40 | +verified by pinning the old list back, where a `combo` widget with no |
| 41 | +`chartConfig` produced zero findings. The set is now the taxonomy minus an |
| 42 | +explicit `MEASURE_EXEMPT_CHART_TYPES` (single-value and tabular families), so a |
| 43 | +family added to the spec is covered without editing the rule. |
| 44 | + |
| 45 | +Guards: `packages/spec/src/ui/vocabulary-derivation.test.ts` asserts both |
| 46 | +derivations still hold (a restated list fails silently — it keeps validating, |
| 47 | +just not what the other list says), and the lint suite now walks every |
| 48 | +multi-series family in the taxonomy rather than a list of its own. |
| 49 | + |
| 50 | +`ActionType` deliberately does **not** gain `navigation`, which the audit |
| 51 | +suggested. `ActionRunner.executeNavigation` is a strictly weaker |
| 52 | +`executeUrl` — no `${param.X}` interpolation, no `apiBase` promotion, no |
| 53 | +`openIn` — differing only by a `replace` option, and its one live producer is |
| 54 | +the SDUI `element:button` `action` prop, which `ElementButtonPropsSchema` does |
| 55 | +not model at all. Promoting the name would add a second spelling of *navigate* |
| 56 | +to a closed authorable vocabulary (members cannot be removed later) without |
| 57 | +closing the gap that actually exists. Tracked separately. |
| 58 | + |
| 59 | +Verified: `@objectstack/spec` **6944 tests / 267 files**, `@objectstack/lint` |
| 60 | +**544 tests / 37 files**, both green; `tsc --noEmit` clean on both. |
0 commit comments