You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5bed1f6
Browse filesBrowse the repository at this point in the historyBrowse files
feat(sdui-parser): port objectui's one base-prop list into the save gate (#20799)
Fixes#20578
Clause-②: yes (widening)
## What
Ports objectui's one base-prop list into the save gate, at the console
pin `db11afd4967c` (objectui#11008 for `bind`/`hidden`, objectui#11044
for the single list). objectui anchors:
`packages/sdui-parser/src/validate.ts:137` (`SDUI_BASE_PROPS`, docblock
`:60-136`, skip `:213`) and `packages/sdui-parser/src/codegen.ts:13-32`,
`:95-110`.
- `validate.ts`: `BASE_PROPS` is now the `every-node` members of a
20-entry list: the 9 existing plus `bind`, `hidden`, `visibleWhen`,
`hiddenOn`, `testId`. Six `where-undeclared` members (`name`, `label`,
`description`, `placeholder`, `data`, `ariaLabel`) skip `unknown-prop`
only when the type declares no input of that name; a declared one keeps
its `type-mismatch` check.
- `codegen.ts`: `generateDts` emitted a hand-kept `export interface
SduiBaseProps` (public through `index.ts`). It is now emitted from the
same list, and a component that declares a base attribute `Omit`s it
from the base it extends. This is the second consumer of the list, so it
is exported from `validate.ts` for `codegen.ts` and is not re-exported
from `index.ts`.
- Correction: the first revision of this PR (and its report) claimed
`codegen.ts` emits no base-props interface. That was false; the second
commit fixes the code and the `validate.ts` LOCKSTEP paragraph.
- Existing test `html-tier-manifest.test.ts` now expects `AProps extends
Omit<SduiBaseProps, "className">`, the same string objectui pins in
`html-tier-manifest-10735.test.ts:114`.
## Clause-② measurement
Scanned every component's `inputs` in the tracked `sdui.manifest.json`
(107 components).
- Newly `every-node`: `bind`, `hidden`, `visibleWhen`, `hiddenOn`,
`testId` are declared by 0 components each, so no declared type check is
removed.
- `where-undeclared`: `name` 3, `label` 10, `description` 6, `data` 7,
`placeholder` 0, `ariaLabel` 0 declaring components. The skip is guarded
by `!byName.has(key)`, so a declared key takes the same path and
severity as before.
- Validator: for this manifest, undeclared uses lose a `unknown-prop`
warning; no error-severity `validateTree` diagnostic is removed.
- Generated types: `SduiBaseProps` goes from 8 members to 19, so a
`.tsx` page authoring `bind`, `hidden`, `visibleWhen`, `hiddenOn`,
`testId`, `name`, `label`, `description`, `placeholder`, `data` or
`ariaLabel` on a tag that does not declare it was a TypeScript error
against `generateDts` output before and compiles now. That widens the
accepted authoring surface and the published type output, hence `yes
(widening)` and a `minor` changeset.
## Tests
- New `base-props-one-list.test.ts`: each of the 13 attribute
`every-node` members draws no `unknown-prop`; the list is pinned entry
by entry (20 entries, `type` alone with no attribute type); each of the
6 `where-undeclared` keys draws nothing when undeclared; a declared
`label` given a number still draws `type-mismatch`; a non-base key is
still `unknown-prop`; the emitted `SduiBaseProps` equals the list's
attribute entries in order; a component with no declared base attribute
extends the whole base and one declaring `label` extends
`Omit<SduiBaseProps, "label">`. `type` is not tested through
`validateTree`: on a node it is the tag itself, so any such case passes
through `unknown-component`.
- `pnpm --filter @objectstack/sdui-parser exec vitest run`: 13 files,
224 tests passed; `typecheck` exit 0 (`os-verify-lock`, `VERDICT
command-exit 0`).
- No generated `.d.ts` or golden file for this output exists in the repo
outside `packages/sdui-parser/` (grep for `SduiBaseProps` and
`generateDts`).
## Gates (head `5cb34e77dc`)
`dispatch-gates --commands` derived 61 families; 56 ran and exited 0,
including `check:sdui-lockstep`, `check:published-files`,
`check:query-options-erasure`, `check:type-check-coverage`,
`check-changeset-no-major`, `check:doc-authoring`, `check:nul-bytes`.
NOT MEASURED, exit 3 PREREQUISITE NOT MET (need a built `dist/`, left to
CI): `check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:sourcemap-no-sources-content`,
`check:type-check-debt`. The earlier body's count of 52 was wrong.
## Acceptance notes
None outside the card.
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv
---------
Co-authored-by: Claude <noreply@anthropic.com>
`@objectstack/sdui-parser` now reads one base-prop list, ported from objectui's `SDUI_BASE_PROPS` at the console pin `db11afd4967c` (objectui#11008, #11044). Both `validateTree` and the generated JSX types (`generateDts`'s `SduiBaseProps`) are driven by it.
6
+
7
+
- On every node, whatever the component declares: `bind`, `hidden`, `visibleWhen`, `hiddenOn`, `testId` are newly accepted. They no longer draw `unknown-prop`, and the generated types accept them as attributes.
8
+
- Only on a type whose registration declares no input of that name: `name`, `label`, `description`, `placeholder`, `data`, `ariaLabel` are newly accepted. A type that declares one keeps its declared type check and its declared attribute type; its generated interface `Omit`s that key from `SduiBaseProps`.
9
+
10
+
Effect for consumers: `os validate` stops warning `unknown-prop` on those keys, and a `.tsx` page that authors them now type-checks against `generateDts` output where it was a TypeScript error before. Measured on the tracked `sdui.manifest.json` (107 components), no component declares any of the five every-node keys, and every declared where-undeclared key is checked as before, so no diagnostic of error severity is removed for that manifest. The wider type surface is why this is a minor, not a patch.
0 commit comments