DSC-R01/norms/rules/design-components/DSC-R01.md
Este texto aún no está traducido. Debajo está el original en inglés.
Component pages and generated files are fresh
MUSTbloqueacomprobaciónactiva
The pages in /design/components, the data file, the manifest and the stories are what sync writes from the component headers now.
Por qué: The lenses, the manifest and the stories read the generated files, not the code. If a header changes and sync is not run, the catalog shows a component that no longer exists, and an edit made by hand in a generated file is lost at the next sync.
Campos de la página (15)
| ruleId | DSC-R01 |
| requirement | The pages in /design/components, the data file, the manifest and the stories are what sync writes from the component headers now. |
| level | MUST |
| floor | false |
| status | active |
| sphere | design |
| appliesTo | /design |
| enforcers | .shtukbase/packages/design-components/checks/fresh.ts |
| enforcerKind | gate |
| mode | enforce |
| because | The lenses, the manifest and the stories read the generated files, not the code. If a header changes and sync is not run, the catalog shows a component that no longer exists, and an edit made by hand in a generated file is lost at the next sync. |
| baseline | 0 |
| reviewBy | 2027-05-29 |
| pack | design-components |
| rail | Run: shtuk run design-components sync. Change the header in the code file, not the page header. |
The pages in /design/components, lib/design/components.data.js, /design/custom-elements.json and /design/stories/*.stories.js match what sync writes from the component headers now.
What counts as a violation. A page or generated file is missing or differs from what sync would write; a page the sync wrote has no component header any more; a header does not parse (then sync cannot run). The text under a page's header is the author's and is not compared.
Why. The lenses, the manifest and the stories read the generated files, not the code. If a header changes and sync is not run, the catalog shows a component that is gone, and an edit made by hand in a generated file is lost at the next sync.
Run. shtuk run design-components fresh. A violation is a line, exit code 1.
How to fix. shtuk run design-components sync. Change the header in the code file, not the header of the page.