Block library proposal: blockLibraryManifest export for ipal-doctor

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 13:44:57 +01:00
co-authored by Claude Opus 5.5
parent 48c2a3a5a8
commit 7918eaf6d4
+7 -1
View File
@@ -121,6 +121,12 @@ New entries (names to confirm, decision D1):
| `@intecion/ipal-kit/blocks/client` | small client parts (accordion state, if any) | used internally; exported for custom components |
| `@intecion/ipal-kit/templates` | page template data for seeds | seed scripts only |
**Manifest.** `@intecion/ipal-kit/blocks` also exports `blockLibraryManifest`, plain data with no React:
`{ version, blocks: [{ slug, interfaceName, variants, fields: [paths], phase }], primitives: ['Section', 'SectionHeader',
'Media', 'CMSLink', 'Button', 'Container', 'Card'], fieldBuilders: ['buildItemsField', …], templates: ['home', …] }`.
ipal-doctor reads the block, variant and primitive names from it instead of keeping its own list. The schema snapshot
test (§8) and the docs tables are generated from the same data, so the manifest cannot drift from the code.
Configs and components are separate entries so `payload.config` never imports React
(AGENT.md §6.12). Source layout: `src/modules/block-library/<block>/{config.ts,Component.tsx,<Item>Card.tsx,texts.ts}`.
@@ -447,7 +453,7 @@ change in a new ipal-kit version never touches existing pages.
| **Design tokens** | the token contract in §6; the starter's `styles.css` defines them; blocks never introduce new names without that track |
| **Project starter** | turns on the phase 1 blocks, `createBlockRegistry`, the token CSS and a `seed-content.ts` built from templates |
| **Reference site** | uses every library block and variant on real pages; it is the visual test and the screenshot source for docs |
| **ipal-doctor** | checks: library blocks used where one fits (warns on project blocks that duplicate one), no local copies of `buildItemsField` etc., registry from `createBlockRegistry` or `RenderBlocks`, token-only classes |
| **ipal-doctor** | reads `blockLibraryManifest` (§4); rules agreed with that session (its proposal §2.5a): `blocks-ui-required`, `blocks-ui-override`, `blocks-duplicate`, `blocks-helper-copy`, `blocks-registry`, `blocks-tokens`. Checks: library blocks used where one fits (warns on project blocks that duplicate one), no local copies of `buildItemsField` etc., registry from `createBlockRegistry` or `RenderBlocks`, token-only classes |
| **ipal-block** skill | step 0: "is there a library block or a variant?"; then options (§7.1), component swap (§7.3), eject; own blocks as today |
| **ipal-site** skill | phase 2 maps each section of the site map to a library block + variant first; phase 6 builds `seed-content.ts` from templates |
| **seeding.md + ipal-site `seed-content.template.ts`** | templates, `$form`, named-records rule after launch |