Docs: reconcile agent, developer and module docs with the code

- AGENT.md, skills, PROGRAMISTA, vibe, README and module pages checked
  against src/ and package.json; every mismatch fixed (consent/analytics
  loading, revalidation scope, generateStaticParams, construction gating,
  Turnstile fail modes, email/Graph, MCP, i18n, links, slug, hooks, ...)
- New pages: frontend.md, media.md, integrations.md; docs/README.md now
  indexes every page
- Main rule (plugin helps, never limits) at the top of AGENT.md,
  PROGRAMISTA.md, docs/README.md, README and the setup/plugin-gap skills;
  module pages gain a "Wyłączenie, nadpisanie, rozszerzenie" section
- README/PROGRAMISTA: stop telling projects to install packages ipal-kit
  already depends on; peer table; publish flow matches prepublishOnly
- ipal-skills: refuse --dest without a value or pointing at the project
  root (previously could delete ipal-* folders in cwd)
- docsConsistency: option keys, IPAL_* env names, relative links, README
  index, AGENT.md section refs, skill frontmatter, frontend.md helper keys,
  no `pnpm add` of own dependencies

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:06:52 +02:00
co-authored by Claude Opus 5.5
parent 12fbd424a5
commit 6e0f59c62b
49 changed files with 1736 additions and 605 deletions
+31 -1
View File
@@ -6,7 +6,26 @@ plugin nigdy nie woła `getPayload` sam.
## Config
Brak — te globale są zawsze budowane przez plugin. Nie ma osobnej opcji.
Globale `site-settings` (`SITE_SETTINGS_SLUG`), `site-integrations` (`SITE_INTEGRATIONS_SLUG`),
`cookie-settings` i `notifications` są **obecnie zawsze dodawane** przez plugin (gdy
`enabled !== false`) — nie ma opcji, żeby je pominąć albo zmienić im slug.
| Opcja `ipalKit()` | Co robi |
|---|---|
| `siteSettingsFields?: Field[]` | dodatkowe pola SiteSettings w osobnym tabie **„Custom”** (dane płasko: `settings.mojePole`) |
| `integrationsFields?: Field[]` | dodatkowe pola SiteIntegrations w tabie „Custom” |
Taby SiteSettings (nienazwane — dane płaskie): **General** (`siteName`, `siteDescription`,
`titleOrder`, `titleSeparator`, `logo`, `defaultShareImage`, `sameAs`, `favicon`, …),
**Theme** (`defaultTheme`, `allowThemeToggle`, `themeToggleLabel`), **System Pages**
(z `pages` / `content`), **Emails** (z `forms.emailLayout`), **Under construction**
(z `pages`), **Custom** (z `siteSettingsFields`).
**Dostęp:** SiteSettings ma `read: () => true` — **cały global, także pola z
`siteSettingsFields`, jest publiczny** przez REST/GraphQL (`/api/globals/site-settings`).
Nie trzymaj tam niczego poufnego (do tego SiteIntegrations, `read`/`update` tylko admin).
SiteSettings nie ustawia `update` — obowiązuje domyślne Payloada (każdy zalogowany
użytkownik kolekcji auth).
## Front — odczyt globali
@@ -26,6 +45,10 @@ const integrations = await getSiteIntegrations<SiteIntegration>(payload)
Generyk `<T>` pozwala wstrzyknąć wygenerowany typ klienta. Bez niego zwraca
`Record<string, unknown>`.
Opcje (`GlobalQueryOptions`): `locale` (kod albo `'all'`; brak → domyślny Payloada),
`depth` (brak → domyślny Payloada). Helpery nie łapią błędów i nie cache'ują — w
Next używaj `getSettings(locale)` z `@/lib/content` (React `cache()`, `depth: 2`).
## ⚠️ SiteIntegrations zawiera sekrety
Local API domyślnie omija access control (`overrideAccess: true`), więc
@@ -52,3 +75,10 @@ return <Form siteKey={turnstileSiteKey} />
import { getGlobal } from '@intecion/ipal-kit'
const data = await getGlobal<MyType>(payload, 'moj-global', { locale: 'pl', depth: 1 })
```
## Wyłączenie, nadpisanie, rozszerzenie
- Globale pluginu są obecnie zawsze dodawane (brak opcji wyłączenia / zmiany slugów); `enabled: false` usuwa cały plugin, razem z nimi.
- Rozszerzenie: `siteSettingsFields` / `integrationsFields` (tab „Custom”); kształt istniejących tabów jest stały.
- Dostęp, hooki i pola globalu zmienisz tylko nadpisując go w configu po `ipalKit` (własny plugin mapujący `config.globals`, przykład w hooks.md).
- `getGlobal(payload, slug, { locale, depth })` działa z dowolnym globalem projektu.