IAPL rename: docs, agent guide, skills, reference site and starter on the new names; changelog draft
- docs, AGENT.md, the 16 skills, PROGRAMISTA and README use the preferred names (scripted, same list of forms); past CHANGELOG entries and the proposals in docs/dev are not rewritten - AGENT.md: 'Names: IAPL and ipal-kit' — old name, new name, state in 1.x; what is not renamed; storageNames - iapl-upgrade '→ 1.17.0', PROGRAMISTA §6 item 72, CHANGELOG 1.17.0 (draft): nothing required - env.md, doctor.md (legacy-names, storage-names), stats.md, security.md, project-starter.md, iapl-reference, iapl-setup - skill scripts read ipal-audit-skip and IPAL_IP_HEADER too; audit rule ids stay what they were - reference site: iapl(), iapl-doctor.json, iapl-* skills, storageNames: 'iapl'; INDEX.md regenerated Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
425fac14fb
commit
b91984fbcd
+12
-12
@@ -4,16 +4,16 @@
|
||||
> edits on the live site must survive. Every later change targets **named records only** — specific pages,
|
||||
> globals, forms or fields — listed in the seed (`only: [...]` / `SEED_ONLY="pages:kontakt,global:header"`).
|
||||
> Never re-seed everything, not even in create-only mode, without the owner's explicit OK. `createSeeder`
|
||||
> refuses a run with no record list against a production or non-local database unless `IPAL_SEED_ALLOW_FULL=1`
|
||||
> refuses a run with no record list against a production or non-local database unless `IAPL_SEED_ALLOW_FULL=1`
|
||||
> (set it only after that OK).
|
||||
|
||||
A seed is a script that puts content into the database: pages, forms, globals. ipal-kit ships two
|
||||
A seed is a script that puts content into the database: pages, forms, globals. IAPL ships two
|
||||
templates. Copy them into the project and fill them from the brief:
|
||||
|
||||
| Template | Copy to | Seeds |
|
||||
|---|---|---|
|
||||
| `docs/agent/skills/ipal-site/resources/seed-content.template.ts` | `scripts/seed-content.ts` | pages (or another collection with a slug) and globals, every language |
|
||||
| `docs/agent/skills/ipal-form/resources/seed-form.template.ts` | `scripts/seed-form-<name>.ts` | one form: fields, confirmation, both e-mails, every language |
|
||||
| `docs/agent/skills/iapl-site/resources/seed-content.template.ts` | `scripts/seed-content.ts` | pages (or another collection with a slug) and globals, every language |
|
||||
| `docs/agent/skills/iapl-form/resources/seed-form.template.ts` | `scripts/seed-form-<name>.ts` | one form: fields, confirmation, both e-mails, every language |
|
||||
|
||||
Both are thin scripts over the seed helper `createSeeder` from `@intecion/ipal-kit/seed`
|
||||
([The seed helper](#the-seed-helper)), which implements every rule below. A seed you write yourself
|
||||
@@ -36,7 +36,7 @@ should use it too; if it does not, it must follow the rules by hand.
|
||||
4. **After launch, named records only.** Before launch the seed may build the whole site. After launch a seed
|
||||
lists exactly the records it may touch (`only`, `SEED_ONLY`) — everything else is reported as
|
||||
`skip (not listed)` and never read for writing. A full run against a live database needs the owner's explicit
|
||||
OK and `IPAL_SEED_ALLOW_FULL=1`. Record the launch date in `AGENTS.md` → "Project decisions".
|
||||
OK and `IAPL_SEED_ALLOW_FULL=1`. Record the launch date in `AGENTS.md` → "Project decisions".
|
||||
5. **Never seed users, passwords or secrets.** SMTP, Turnstile, API keys and tokens stay in the panel or in
|
||||
env vars. The first admin is created on the first-user screen.
|
||||
6. **Globals: fill only empty fields.** A field that already has content is kept.
|
||||
@@ -97,7 +97,7 @@ A seed may update a record on production only when **both** are true:
|
||||
Anything an editor changed is always skipped and reported as `skip (edited)`.
|
||||
|
||||
`SEED_UPDATE=1` is **refused** when `NODE_ENV=production` or when the database is not local. It runs only
|
||||
when `IPAL_SEED_ALLOW_PROD_UPDATE=1` is also set. The refusal message tells you to back up first.
|
||||
when `IAPL_SEED_ALLOW_PROD_UPDATE=1` is also set. The refusal message tells you to back up first.
|
||||
|
||||
A database counts as local when `DATABASE_URI` is a SQLite file (`file:…`), a Unix socket, or a URL whose
|
||||
host is `localhost`, `127.0.0.1` or `::1`. Everything else is not local, including Docker service names
|
||||
@@ -116,7 +116,7 @@ hash field. The seed helper uses it automatically when the collection or global
|
||||
that name; the stored hash then decides instead of the timestamps.
|
||||
|
||||
```ts
|
||||
// a collection (pages) or a global — for forms use ipalKit({ forms: { formOverrides: { fields } } })
|
||||
// a collection (pages) or a global — for forms use iapl({ forms: { formOverrides: { fields } } })
|
||||
{ name: 'seedHash', type: 'text', admin: { hidden: true } }
|
||||
```
|
||||
|
||||
@@ -157,8 +157,8 @@ Pass them in `context` on every `create`, `update` and `updateGlobal` (`createSe
|
||||
|
||||
The seed script and its dependencies must be in the image. Env vars (`DATABASE_URI`, `PAYLOAD_SECRET`, …)
|
||||
must be available at runtime, not only at build time. The container already has `NODE_ENV=production`, so
|
||||
`SEED_UPDATE=1` is refused there unless you add `IPAL_SEED_ALLOW_PROD_UPDATE=1`, and a run without `SEED_ONLY`
|
||||
is refused unless you add `IPAL_SEED_ALLOW_FULL=1` (only with the owner's explicit OK).
|
||||
`SEED_UPDATE=1` is refused there unless you add `IAPL_SEED_ALLOW_PROD_UPDATE=1`, and a run without `SEED_ONLY`
|
||||
is refused unless you add `IAPL_SEED_ALLOW_FULL=1` (only with the owner's explicit OK).
|
||||
|
||||
## Seeds or migrations?
|
||||
|
||||
@@ -166,7 +166,7 @@ is refused unless you add `IPAL_SEED_ALLOW_FULL=1` (only with the owner's explic
|
||||
|---|---|
|
||||
| Schema: new field, new collection, changed type | Payload migration: `pnpm payload migrate:create`, runs on deploy ([deployment.md §4.3](./deployment.md)) |
|
||||
| Data fix that must run exactly once on every database | Payload migration |
|
||||
| Field rename or move that must keep content | the **ipal-migrate-fields** skill |
|
||||
| Field rename or move that must keep content | the **iapl-migrate-fields** skill |
|
||||
| Content: pages, forms, globals from a brief | seed |
|
||||
|
||||
A seed never changes the schema. A migration never fills editorial content from a brief.
|
||||
@@ -277,8 +277,8 @@ the script:
|
||||
| `SEED_DRY_RUN=1` / `--dry-run` | `dryRun` | off | no writes, print the plan |
|
||||
| `SEED_UPDATE=1` | `update` | off | update records nobody edited since seeding |
|
||||
| `SEED_ONLY` | `only` | all records | the records the run may touch: `pages:kontakt`, `forms:Contact form`, `global:header`, `pages:*` (comma-separated in env) |
|
||||
| `IPAL_SEED_ALLOW_FULL=1` | `guard.allowFull` | off | allow a run without `only` on production or a non-local database (a full re-seed — owner's OK only) |
|
||||
| `IPAL_SEED_ALLOW_PROD_UPDATE=1` | `guard.allowProdUpdate` | off | allow `update` on production or a non-local database |
|
||||
| `IAPL_SEED_ALLOW_FULL=1` | `guard.allowFull` | off | allow a run without `only` on production or a non-local database (a full re-seed — owner's OK only) |
|
||||
| `IAPL_SEED_ALLOW_PROD_UPDATE=1` | `guard.allowProdUpdate` | off | allow `update` on production or a non-local database |
|
||||
| `SEED_FORCE=1` | `force` | off | with `update`: overwrite edited records too. Local database only (`guard.forceOnlyLocal: false` lifts that) |
|
||||
| `SEED_LOCAL_HOSTS` | `guard.localHosts` | — | extra hosts that count as local, comma-separated (e.g. a Docker Compose `db` service) |
|
||||
| `SEED_DB_URL_ENV` | `guard.databaseUrl` | `DATABASE_URI` | the env var that holds the database URL / the URL itself |
|
||||
|
||||
Reference in New Issue
Block a user