ipal-doctor proposal: blockLibraryManifest, slug-based duplicate match
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8cd9830a22
commit
9e583a92c9
@@ -102,12 +102,14 @@ Source tags: **S** = static (files only, no network, no database), **R** = regis
|
||||
| `blocks-registry` | error | S | `blocks/registry.ts` builds the registry with `createBlockRegistry(content, { ui, components, classNames, extra })` or renders through `RenderBlocks`; no hand-written `switch (blockType)` | blocks.md → Block library |
|
||||
| `blocks-ui-required` | error | S | without `createBlockRegistry`, `components/ui/` holds the five primitives (Section, SectionHeader, Media, CMSLink, Button); with it, `ui/` is optional | the `ipal-block` skill |
|
||||
| `blocks-ui-override` | warning | S | every file in `components/ui/` named like a library primitive (Section, SectionHeader, Media, CMSLink, Button, Container, Card) is passed through the registry's `ui` option. Otherwise the library blocks keep the plugin's version and the two looks drift apart | `createBlockRegistry(content, { ui: { Button } })` |
|
||||
| `blocks-duplicate` | warning | S | a project block whose folder or slug matches a library block (or a variant of one) and is not a declared override or eject | use the library block + variant, or record the eject in "Project decisions" |
|
||||
| `blocks-duplicate` | warning | S | a project block whose `slug` (read from its `config.ts`, not the folder name) or `interfaceName` matches a library block or a variant of one, and is not a declared override or eject. A library block renamed through its `slug` option (`testimonials` → `reviews`) counts as the library block, so a project block with the old or the new slug is a duplicate | use the library block + variant, or record the eject in "Project decisions" |
|
||||
| `blocks-helper-copy` | warning | S | no local copies of plugin helpers (`buildItemsField`, `buildActionButtonsField`, `ctaHref`, and the other exported field builders) | import from the plugin |
|
||||
| `blocks-tokens` | error | S | classes use design tokens only (no hex, no arbitrary colours) — the `ipal-audit` hex rule, extended by the design-token track's names | DESIGN.md / tokens |
|
||||
|
||||
The list of library blocks and primitives is read from the installed plugin (an exported manifest), not
|
||||
hard-coded in the doctor, so a new library block needs no doctor change.
|
||||
The doctor reads `blockLibraryManifest` from `@intecion/ipal-kit/blocks` (plain data: `blocks[{ slug, interfaceName,
|
||||
variants, fields, phase }]`, `primitives`, `fieldBuilders`, `templates`), so a new library block, primitive or
|
||||
field builder needs no doctor change. `blocks-helper-copy` checks the `fieldBuilders` names; `blocks-ui-override`
|
||||
the `primitives`.
|
||||
|
||||
### 2.6 Live checks (`--url`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user