From 2d9f3e15d428a52d68deb4f790425712d8aa1cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Thu, 22 Oct 2026 17:39:03 +0200 Subject: [PATCH] Docs in English (part 1), seeding guide, Coolify deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Translate to English every doc the code branches did not touch: AGENT.md, developer guide, vibe, CHANGELOG, docs index, module pages, all skills except ipal-seo-check (14 pages follow after the security/SEO merge). Placeholder marker is now [TO FILL: …]; skill resources renamed to section-code.md / nav-code.md. AGENT.md and the ipal-skills pointer block say the docs are in English. - docs/seeding.md: create-only, natural keys, never delete, no users or secrets, empty-field globals, fallbackLocale: false, dry run, backup and restore, production update guard, seeds vs migrations, Coolify Terminal. Seed templates gain --dry-run, the SEED_UPDATE production guard (IPAL_SEED_ALLOW_PROD_UPDATE), skip of edited records and a summary. "Seeding on production" rule block in AGENT.md. - Coolify is the single deployment path (deployment, env, developer guide, ipal-setup): build vs runtime env, migrations on container start (prodMigrations), health check and rolling updates, rollback, backups and restore, DNS/Let's Encrypt/CAA. R2: custom domain needs a Cloudflare zone; default is media served by the app (R2_PUBLIC_URL empty). - docsConsistency: no Polish prose outside code/quoted data (pending pages listed); IPAL_* names may also be read by shipped skill templates. Co-Authored-By: Claude Opus 5.5 --- README.md | 6 +- bin/ipal-skills.mjs | 17 +- docs/CHANGELOG.md | 966 +++++----- docs/README.md | 85 +- docs/accessibility.md | 164 +- docs/agent/AGENT.md | 1673 +++++++++-------- docs/agent/skills/ipal-audit/SKILL.md | 52 +- docs/agent/skills/ipal-audit/scripts/audit.sh | 2 +- docs/agent/skills/ipal-block/SKILL.md | 76 +- .../{kod-sekcji.md => section-code.md} | 138 +- docs/agent/skills/ipal-collection/SKILL.md | 66 +- docs/agent/skills/ipal-consent-check/SKILL.md | 86 +- docs/agent/skills/ipal-debug/SKILL.md | 152 +- docs/agent/skills/ipal-form/SKILL.md | 204 +- .../skills/ipal-form/resources/formClasses.ts | 2 +- .../ipal-form/resources/seed-form.template.ts | 221 ++- docs/agent/skills/ipal-locale-add/SKILL.md | 124 +- .../agent/skills/ipal-migrate-fields/SKILL.md | 156 +- docs/agent/skills/ipal-nav/SKILL.md | 56 +- .../{kod-nawigacji.md => nav-code.md} | 64 +- docs/agent/skills/ipal-plugin-gap/SKILL.md | 72 +- docs/agent/skills/ipal-reference/SKILL.md | 306 +-- .../skills/ipal-reference/resources/api.md | 810 ++++---- docs/agent/skills/ipal-setup/SKILL.md | 509 ++--- docs/agent/skills/ipal-site/SKILL.md | 209 +- .../resources/seed-content.template.ts | 260 ++- docs/agent/skills/ipal-upgrade/SKILL.md | 106 +- docs/blocks.md | 96 +- docs/deployment.md | 522 +++-- docs/dev/PROGRAMISTA.md | 878 ++++----- docs/dev/vibe.md | 488 ++--- docs/email.md | 272 +-- docs/env.md | 164 +- docs/frontend.md | 174 +- docs/gtm-meta-pixel.md | 258 +-- docs/i18n.md | 364 ++-- docs/integrations.md | 82 +- docs/links.md | 196 +- docs/media.md | 155 +- docs/pages.md | 272 +-- docs/payload-helpers.md | 82 +- docs/seeding.md | 173 ++ docs/slug.md | 80 +- docs/storage.md | 362 ++-- docs/theme.md | 90 +- docs/white-label.md | 134 +- test/docsConsistency.test.ts | 33 +- 47 files changed, 6102 insertions(+), 5355 deletions(-) rename docs/agent/skills/ipal-block/resources/{kod-sekcji.md => section-code.md} (63%) rename docs/agent/skills/ipal-nav/resources/{kod-nawigacji.md => nav-code.md} (61%) create mode 100644 docs/seeding.md diff --git a/README.md b/README.md index 4650c46..e3dc3dc 100644 --- a/README.md +++ b/README.md @@ -153,10 +153,10 @@ Full checklist and troubleshooting: **[docs/dev/PROGRAMISTA.md §8](./docs/dev/P Everything lives in the **[docs/](./docs)** directory. To get started: -- **[AGENT.md](./docs/agent/AGENT.md)** — rules for AI agents (Polish) -- **[PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** — setup, deployment, upgrades, releasing (Polish) +- **[AGENT.md](./docs/agent/AGENT.md)** — rules for AI agents +- **[PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** — setup, deployment, upgrades, releasing - **[README.md](./docs/README.md)** — index of the plugin's modules -- **[CHANGELOG.md](./docs/CHANGELOG.md)** — what changed per version and what projects must update (Polish) +- **[CHANGELOG.md](./docs/CHANGELOG.md)** — what changed per version and what projects must update --- diff --git a/bin/ipal-skills.mjs b/bin/ipal-skills.mjs index 9ad2a4d..4abe5b8 100755 --- a/bin/ipal-skills.mjs +++ b/bin/ipal-skills.mjs @@ -70,16 +70,17 @@ if (pointer) { const skillsDir = relative(process.cwd(), dest).split('\\').join('/') const block = [ START, - `## ipal-kit ${version} — przewodnik dla agenta`, + `## ipal-kit ${version} — agent guide`, '', - '', - 'Ten projekt stoi na `@intecion/ipal-kit` (plugin Payload CMS 3). Zanim napiszesz kod:', + '', + 'This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code:', '', - '1. Reguły: `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`.', - `2. Wszystko, co daje plugin (opcje, env, trasy, layout, hooki, kolekcje, globale, każdy eksport): skill \`ipal-reference\` — \`${skillsDir}/ipal-reference/SKILL.md\`.`, - `3. Nowy projekt albo brak fundamentu: skill \`ipal-setup\`; cała strona: \`ipal-site\`. Lista skilli: \`${skillsDir}/\`.`, - '4. Szczegóły modułu: `node_modules/@intecion/ipal-kit/docs/.md`.', - '5. Funkcja istnieje w pluginie → użyj jej. Brakuje opcji → skill `ipal-plugin-gap`, nigdy łatka w `node_modules`.', + '1. Rules: `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`.', + `2. Everything the plugin provides (options, env vars, routes, layout, hooks, collections, globals, every export): the \`ipal-reference\` skill — \`${skillsDir}/ipal-reference/SKILL.md\`.`, + `3. New project or missing foundation: the \`ipal-setup\` skill; a whole site: \`ipal-site\`. All skills: \`${skillsDir}/\`.`, + '4. Module details: `node_modules/@intecion/ipal-kit/docs/.md`.', + '5. If the plugin has it, use it. If an option is missing, use the `ipal-plugin-gap` skill — never patch `node_modules`.', + '6. ipal-kit docs, this guide and the skills are in English; write rules, AGENTS.md entries and gap reports in English.', END, ].join('\n') const upsert = (file, { create }) => { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 48ef6e6..6dd8a4c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,659 +1,661 @@ # Changelog -Zmiany ważne dla projektów na ipal-kit. Jak przejść na nową wersję: skill -**ipal-upgrade** i [PROGRAMISTA.md §6](./dev/PROGRAMISTA.md). +Changes that matter for projects built on ipal-kit. How to move to a new version: the +**ipal-upgrade** skill and [PROGRAMISTA.md §6](./dev/PROGRAMISTA.md). -Trzymamy tu co najmniej **20 ostatnich wersji** — przy aktualizacji projektu o kilka -wersji naraz przejdź po kolei wszystkie sekcje „Wymaga zmian w projekcie” od -wersji, którą masz. Nowe wydanie = nowa sekcja na górze; najstarsze usuwamy -dopiero powyżej 20. +We keep at least the **20 most recent versions** here. When you upgrade a project by several +versions at once, go through every "Requires project changes" section in order, starting from the +version you have. A new release = a new section at the top; we remove the oldest ones only +once there are more than 20. ## 1.12.3 -### Nowe -- **Duże okno ustawień cookies ze szczegółami** — ``. Każda kategoria to karta - z przełącznikiem (wł./wył.), opisem i rozwijaną listą ciasteczek, które obejmuje (nazwa, dostawca, cel, czas) — - z **Cookie Settings → Cookies**. Tryb wybiera programista: `'inline'` (domyślnie, bez zmian), `'modal'`, - `'detailed'`. Nowa grupa w globalu **Cookie Settings → Detail labels** (podpisy listy, per język; puste → - angielskie). `ConsentTexts` ma opcjonalne `cookies` i `details` (wypełnia je `getConsentTexts`). Nowe sloty - `classNames`: `categoryCard`, `cookies`, `cookiesToggle`, `cookieList`, `cookie`, `cookieName`, `cookieMeta`. - consent.md → „Duże okno ze szczegółami”. +### New +- **Large cookie settings window with details** — ``. Each category is a card + with a switch (on/off), a description and an expandable list of the cookies it covers (name, provider, purpose, + duration) — from **Cookie Settings → Cookies**. The developer picks the mode: `'inline'` (default, unchanged), + `'modal'`, `'detailed'`. New group in the **Cookie Settings → Detail labels** global (list labels, per language; + empty → English). `ConsentTexts` has optional `cookies` and `details` (filled by `getConsentTexts`). New + `classNames` slots: `categoryCard`, `cookies`, `cookiesToggle`, `cookieList`, `cookie`, `cookieName`, `cookieMeta`. + consent.md → "Large window with details". -### Dokumentacja -- consent.md: porównanie trzech trybów `settings`, który wybrać (brief milczy → `detailed` przy wypełnionej liście - Cookies), nowe pola w tabeli tekstów z panelu, sloty i uchwyty `data-ipal`. -- AGENT.md (§0b poz. 12, §7, compliance), PROGRAMISTA §2.8 / §2.11 / §6 poz. 46, skille `ipal-setup`, `ipal-site`, - `ipal-upgrade`, `ipal-locale-add` (Detail labels i Cookies w każdym języku), `ipal-consent-check` (import zasila - też okno `detailed` — sprawdź je po imporcie). +### Documentation +- consent.md: comparison of the three `settings` modes, which one to pick (brief says nothing → `detailed` when the + Cookies list is filled in), new fields in the table of panel texts, slots and `data-ipal` hooks. +- AGENT.md (§0b item 12, §7, compliance), PROGRAMISTA §2.8 / §2.11 / §6 item 46, skills `ipal-setup`, `ipal-site`, + `ipal-upgrade`, `ipal-locale-add` (Detail labels and Cookies in every language), `ipal-consent-check` (the import + also feeds the `detailed` window — check it after the import). -### Wymaga zmian w projekcie -1. Postgres/SQLite: nowe pola w globalu Cookie Settings → `payload migrate:create`. MongoDB bez zmian. -2. Opcjonalnie: ``, wypełnij Cookie Settings → Cookies (skan: - `ipal-consent-check` → cookie-scan) i Detail labels w każdym języku. +### Requires project changes +1. Postgres/SQLite: new fields in the Cookie Settings global → `payload migrate:create`. MongoDB: no changes. +2. Optional: ``, fill in Cookie Settings → Cookies (scan: + `ipal-consent-check` → cookie-scan) and Detail labels in every language. ## 1.12.2 -### Poprawki -- **Pusty panel admina na produkcji przez import mapę z deva.** `buildR2Storage` bez `R2_*` zwracał no-op, więc - `pnpm dev` / `generate:importmap` bez R2 zapisywał `importMap.js` bez `S3ClientUploadHandler`; projekt to - commitował, a produkcyjny panel (z R2) renderował pustą stronę bez błędu w konsoli. Teraz adapter jest - rejestrowany zawsze (bez R2 jako `enabled: false`, media dalej na dysku) — import mapa jest identyczna w każdym - środowisku. `ipal-audit`: ERROR „import map without the R2 upload handler”. -- **Cookie Settings — tekst „Zapisz” nie ginie po 1.11.1 (MongoDB).** Pierwszy zapis globala usuwał stare - `buttons.save` i przycisk wracał do „Save preferences” we wszystkich językach. Plugin przy starcie kopiuje - `buttons.save` → `buttons.savePreferences` (wszystkie języki), gdy nowego pola brak. `getConsentTexts` czytał stare - pole jako tekst, a Mongo zwraca je jako mapę `{ pl, en }` (pola nie ma w schemacie) — w banerze mogło wyjść - „[object Object]”. -- `ipal-audit`: `"exclude"` w kilku liniach tsconfig nie jest już zgłaszany; `a11y`, `i18n`, `l10n` to nie „numbered - fields”; łapie linki `` `${prefix}/${slug}` `` i ścieżki stron wpisane w kod (`` `${prefix}/kontakt` ``); komunikat - „panel text in Polish — admin labels/descriptions are English” (był mylący „panel is English”). +### Fixes +- **Empty admin panel in production because of the import map from dev.** `buildR2Storage` without `R2_*` returned + a no-op, so `pnpm dev` / `generate:importmap` without R2 wrote `importMap.js` without `S3ClientUploadHandler`; the + project committed it, and the production panel (with R2) rendered a blank page with no console error. Now the + adapter is always registered (without R2 as `enabled: false`, media still on disk) — the import map is identical in + every environment. `ipal-audit`: ERROR "import map without the R2 upload handler". +- **Cookie Settings — the "Zapisz" text is no longer lost after 1.11.1 (MongoDB).** The first save of the global + removed the old `buttons.save` and the button fell back to "Save preferences" in all languages. On startup the + plugin copies `buttons.save` → `buttons.savePreferences` (all languages) when the new field is missing. + `getConsentTexts` read the old field as text, but Mongo returns it as a `{ pl, en }` map (the field is not in the + schema) — the banner could show "[object Object]". +- `ipal-audit`: a multi-line `"exclude"` in tsconfig is no longer reported; `a11y`, `i18n`, `l10n` are not "numbered + fields"; it catches links `` `${prefix}/${slug}` `` and page paths hard-coded in code (`` `${prefix}/kontakt` ``); + message "panel text in Polish — admin labels/descriptions are English" (was the misleading "panel is English"). -### Nowe -- **Media tylko do odczytu:** samo `R2_PUBLIC_URL` (absolutne, poza produkcją) → adresy plików z domeny mediów, - upload i usuwanie zablokowane (403). Lokalny dev na bazie produkcyjnej bez kluczy do bucketa. `ipalEnvRules` w - devie nie wymaga wtedy reszty `R2_*`. storage.md → „Zachowanie”. -- **`context: { ipalSkipAutoFill: true }`** (`SKIP_AUTO_FILL`) — zapis bez auto-fill meta i `aiSummary`. Dla migracji - danych i skryptów, które mają zapisać tylko to, co ustawiają. seo.md. -- **`createPageRoute` przekierowuje stronę główną spod jej sluga** (`/pl/home` → 308 `/pl`). Wyłączenie: - `homeAlias: false`. Usuń własne przekierowanie z `page.tsx`. pages.md. +### New +- **Read-only media:** `R2_PUBLIC_URL` alone (absolute, outside production) → file URLs from the media domain, + upload and delete blocked (403). Local dev on the production database without bucket keys. `ipalEnvRules` in + dev then does not require the rest of `R2_*`. storage.md → "Behavior". +- **`context: { ipalSkipAutoFill: true }`** (`SKIP_AUTO_FILL`) — save without auto-filling meta and `aiSummary`. For + data migrations and scripts that must save only what they set. seo.md. +- **`createPageRoute` redirects the home page from its slug** (`/pl/home` → 308 `/pl`). Turn off: + `homeAlias: false`. Remove your own redirect from `page.tsx`. pages.md. -### Dokumentacja -- i18n.md: `fallback: true` utrwala tekst języka domyślnego w pustych polach innych języków przy zapisie — skutki i - jak pisać skrypty. -- PROGRAMISTA §1: `pnpm up --latest @intecion/ipal-kit` (samo `pnpm up` nie wyjdzie poza dokładną wersję); 401 przy - publicznym rejestrze = stary token w `~/.npmrc`. +### Documentation +- i18n.md: `fallback: true` persists default-language text into empty fields of other languages on save — the + consequences and how to write scripts. +- PROGRAMISTA §1: `pnpm up --latest @intecion/ipal-kit` (plain `pnpm up` will not go past the exact version); 401 on + the public registry = old token in `~/.npmrc`. -### Wymaga zmian w projekcie -1. `pnpm up --latest @intecion/ipal-kit`, potem `pnpm payload generate:importmap` i sprawdź, że `importMap.js` ma - `@payloadcms/storage-s3/client#S3ClientUploadHandler` (projekt z `buildR2Storage`). Commituj. -2. Własne przekierowanie strony głównej spod sluga (np. w `render` z `buildLocalizedPath`) — usuń, robi to - `createPageRoute`. -3. Opcjonalnie: lokalny dev na bazie produkcyjnej → w `.env` samo `R2_PUBLIC_URL` zamiast kluczy R2. +### Requires project changes +1. `pnpm up --latest @intecion/ipal-kit`, then `pnpm payload generate:importmap` and check that `importMap.js` has + `@payloadcms/storage-s3/client#S3ClientUploadHandler` (project with `buildR2Storage`). Commit it. +2. Your own redirect of the home page from its slug (e.g. in `render` with `buildLocalizedPath`) — remove it, + `createPageRoute` does this now. +3. Optional: local dev on the production database → only `R2_PUBLIC_URL` in `.env` instead of R2 keys. ## 1.12.1 -### Nowe -- **Opis każdej strony z jej treści** — auto-fill wypełnia puste `meta.description` z bloków strony (`layout` → - akapity bez nagłówków, całe zdania do ~155 znaków), gdy `autoFill.description` nic nie daje. Wcześniej strona bez - opisu dostawała `siteDescription` — ten sam na każdej stronie, więc Google go ignorował i cytował stopkę. - `autoFill: { content: 'blocks' | false, descriptionLength }`. Opis wpisany ręcznie nigdy nie jest nadpisywany. -- **``** (`/rsc`, `/client`) — `data-nosnippet` na `div`/`section`/`span`. Dla stopki, paska kontaktowego, - powtarzanego CTA: Google przestaje pokazywać adres i godziny ze stopki jako opis podstron. `CookieBanner` i - `LanguageSwitcher` mają `data-nosnippet` same. Opis: seo.md → „Opisy w Google”. -- **Podpowiedź pod opisem w tabie SEO** (`MetaDescriptionCheck`) — opis pusty, taki sam jak `siteDescription` albo jak - w innym dokumencie kolekcji. Nie blokuje zapisu. `seo.descriptionCheck: { settingsSlug, siteDescriptionField }` - albo `false`. -- **ipal-seo-check** — ostrzeżenia: zduplikowane meta description, stopka bez `data-nosnippet`. +### New +- **A description for every page from its content** — auto-fill fills an empty `meta.description` from the page's + blocks (`layout` → paragraphs without headings, whole sentences up to ~155 characters) when `autoFill.description` + yields nothing. Before, a page without a description got `siteDescription` — the same on every page, so Google + ignored it and quoted the footer. `autoFill: { content: 'blocks' | false, descriptionLength }`. A description + typed by hand is never overwritten. +- **``** (`/rsc`, `/client`) — `data-nosnippet` on `div`/`section`/`span`. For the footer, contact bar, + repeated CTA: Google stops showing the address and opening hours from the footer as the description of subpages. + `CookieBanner` and `LanguageSwitcher` have `data-nosnippet` themselves. Details: seo.md → "Descriptions in Google". +- **Hint under the description in the SEO tab** (`MetaDescriptionCheck`) — description empty, identical to + `siteDescription`, or identical to another document in the collection. Does not block saving. + `seo.descriptionCheck: { settingsSlug, siteDescriptionField }` or `false`. +- **ipal-seo-check** — warnings: duplicated meta description, footer without `data-nosnippet`. -- **Statystyki w panelu** — `ipalKit({ stats: true })` + `` (albo `` - z `/client`). Widok `/admin/stats`: wizyty dziennie z 30 dni, strony, wejścia, źródła, urządzenia; wykres na - dashboardzie. Bez cookies i bez zapisu IP — **nie wymaga zgody** (hash z solą wymienianą codziennie). Odwiedzający ze - zgodą *analytics* (ta sama co GA4) dostają cookie `ipal_vid` i historię przez wiele dni; serwer sam sprawdza cookie - zgody. Kolekcja `stats-visits`, retencja 90 dni. Opis + tekst do polityki prywatności: stats.md. -- `@payloadcms/next` w peerDependencies (widok `/admin/stats` używa jego `DefaultTemplate`; każdy projekt Payload+Next - już go ma). +- **Statistics in the panel** — `ipalKit({ stats: true })` + `` (or `` + from `/client`). The `/admin/stats` view: daily visits over 30 days, pages, entries, sources, devices; chart on + the dashboard. No cookies and no IP stored — **no consent required** (hash with a salt rotated daily). Visitors with + *analytics* consent (the same as GA4) get the `ipal_vid` cookie and a multi-day history; the server checks the + consent cookie itself. Collection `stats-visits`, 90-day retention. Details + privacy policy text: stats.md. +- `@payloadcms/next` in peerDependencies (the `/admin/stats` view uses its `DefaultTemplate`; every Payload+Next + project already has it). -### Poprawki -- **Auto-fill przy częściowym zapisie** — `payload.update` / REST PATCH bez grupy `meta` nie traktuje już zapisanego - tytułu jako pustego (czyta go z dokumentu). +### Fixes +- **Auto-fill on a partial save** — `payload.update` / REST PATCH without the `meta` group no longer treats the + saved title as empty (it reads it from the document). -### Wymaga zmian w projekcie -1. `pnpm payload generate:importmap` — nowy komponent panelu `@intecion/ipal-kit/admin#MetaDescriptionCheck`. -2. Stopka: treść w `` wewnątrz `