ShtukbaseStandard
SBR-R03/norms/rules/shtukbase-ui-react/SBR-R03.md

Этот текст ещё не переведён. Ниже английский оригинал.

The same components as the HTML library

MUSTне пускаетпроверкадействует
Every React component has a valid header whose id is its file name and whose level is its folder; when the project has shtukbase-ui-html, both libraries have the same ids and the same level, controls, states, statuses, uses and parts.
Зачем: The design promises that the two libraries are interchangeable: the same names, the same controls, one CSS. A component that exists in one library only, or has other controls, breaks the promise silently; the lenses and the catalog read the headers and would show the two differently.
Enforcer: checks/same.ts
Поля страницы (15)
ruleIdSBR-R03
requirementEvery React component has a valid header whose id is its file name and whose level is its folder; when the project has shtukbase-ui-html, both libraries have the same ids and the same level, controls, states, statuses, uses and parts.
levelMUST
floorfalse
statusactive
spheredesign
appliesTo/design
enforcers.shtukbase/packages/shtukbase-ui-react/checks/same.ts
enforcerKindgate
modeenforce
becauseThe design promises that the two libraries are interchangeable: the same names, the same controls, one CSS. A component that exists in one library only, or has other controls, breaks the promise silently; the lenses and the catalog read the headers and would show the two differently.
baseline0
reviewBy2027-05-29
packshtukbase-ui-react
railA new or changed component starts in the header of the HTML library; the React header is the same text, in a /*--- … ---*/ comment.

The header is the contract of section 4 of the build contract of the wave DSN: id, title, level, description, uses, parts, states, status, controls, cssProperties. It is parsed with the one parser of design-components (lib/header.ts).

What counts as a violation.

  • A component file has no header, or the header has problems (not YAML, an unknown level, a malformed control).
  • The header id is not the file name, or the level does not match the folder (primitive in primitives/, composite in composites/, block in blocks/).
  • The project has /design/shtukbase-ui-html/components/ and a component is in one library only, or the fields level, controls, states, status, uses, parts of the two headers differ.

The markup itself (tags, text, attributes, classes) is compared by the render test of the package, against the HTML templates, when the library changes; the check compares headers, which a project can edit.

Run. bun .shtukbase/packages/shtukbase-ui-react/checks/same.ts from the project root. A violation is a line per problem and exit code 1.

How to fix. Make the React header equal to the HTML header (copy the YAML), or place the missing component.

Пакет The Shtukbase React component library кладёт эту страницу в /norms/rules/shtukbase-ui-react/SBR-R03.md.Исходный текст