Block library: docs, agent guide, skills; picker order as an explicit list

- docs/block-library.md: setup, every block (fields, variants, accessibility),
  options, registry, primitives, eject, page templates, seeding after launch,
  versioning, manifest, turn off / override / extend
- AGENT.md (compass, how to add, §6, §6.3, module map), ipal-block (library
  block first), ipal-site (phases 2, 4, 6, 8), ipal-reference (wiring rows,
  export index), seed-content template from pageTemplates, seeding.md ($form)
- CHANGELOG Unreleased; proposal marked built with an as-built section

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 14:12:50 +01:00
co-authored by Claude Opus 5.5
parent 2d1cc0e77d
commit 2a07fb8844
14 changed files with 470 additions and 39 deletions
+19 -1
View File
@@ -10,9 +10,21 @@ once there are more than 20.
## Unreleased
Database names follow one rule, and seeding a live site touches only the records you name.
Database names follow one rule, and seeding a live site touches only the records you name. The block library:
fifteen ready page sections and ten page templates.
### New
- **Block library** ([block-library.md](./block-library.md)): `hero`, `textMedia`, `featureGrid`, `cta`, `richText`, `faq`,
`contact`, `gallery`, `testimonials`, `stats`, `steps`, `logos`, `team`, `pricing`, `entryList` — Payload block +
server component each, `{ en, pl }` panel, accessibility built in, styled only with design-token utilities.
Opt in per block: `libraryBlocks({ hero: true, … })` (`@intecion/ipal-kit/blocks`); render with
`createBlockRegistry(content, { Image, Link, sendForm })` (`@intecion/ipal-kit/blocks/rsc`). Nothing is on by default.
Override fields, variants, slugs, labels, part classes, primitives or whole components; own blocks share the registry.
- **Page templates:** `pageTemplates` (`@intecion/ipal-kit/templates`) — home, about, services, service, contact, blog
index, post, legal pages, cookie policy, 404 — as `createSeeder` data in English and Polish; `systemPageRefs`.
- **`ipal-blocks eject <block>`** copies a library block into `src/blocks/` (same slug and data shape).
- **`blockLibraryManifest`** — the library's blocks, variants, fields and primitives as data, for checks.
- **Seeder:** `{ $form: 'Contact form' }` references (by title, `formsCollection`, default `forms`).
- **Database name rule:** `<domain without dots>_prod` / `_dev` (e.g. `acmepl_prod`), docs/deployment.md.
`ipalEnvRules({ databaseName: true })` (domain from `NEXT_PUBLIC_SERVER_URL`, skipped on localhost) or
`{ databaseName: { domain, warn } }` checks `DATABASE_URI` and **warns only** — never fails startup. Default off.
@@ -22,6 +34,8 @@ Database names follow one rule, and seeding a live site touches only the records
`skip (not listed)`. The seed templates (`ipal-site`, `ipal-form`) read it.
### Changed
- **Admin labels:** the link "Open in new tab" checkbox is now **New tab** (with a description) and the table-of-contents
switch **Show contents** — shorter labels per admin-ux; the stored fields are unchanged.
- **A full seed of a live database is refused:** a run without `only` / `SEED_ONLY` against `NODE_ENV=production` or
a non-local database now throws (with the steps to follow). Dry runs (`SEED_DRY_RUN=1`) are never refused. Allow it
only with the owner's explicit OK: `IPAL_SEED_ALLOW_FULL=1` or `guard: { allowFull: true }`; `guard: false` turns
@@ -34,6 +48,10 @@ Database names follow one rule, and seeding a live site touches only the records
2. Optional: name the databases `<domain without dots>_prod` / `_dev` and add `ipalEnvRules({ databaseName: true })`
to see a warning when `DATABASE_URI` points elsewhere. Existing databases need not be renamed.
3. Seed scripts copied from older templates: take the new `SEED_ONLY` handling from `ipal-site` / `ipal-form`.
4. Block library — optional, nothing changes until you turn blocks on. New sites: the starter turns on eight blocks.
Existing sites move block by block when they get work (an own block with the same slug and fields can be replaced by
the library block with `slug`, else a migration with **ipal-migrate-fields**). After turning blocks on:
`pnpm generate:types`, `pnpm payload generate:importmap`, Postgres/SQLite `pnpm payload migrate:create`.
## 1.14.6