feat: v1.7.0 — AI-readability suite, form engine & boilerplate helpers

AI / GEO:
- feat(content): lexicalToMarkdown, blocksToMarkdown, createMarkdownRenderer
  (+markdownResponse) — per-page Markdown for AI agents
- feat(content): markdown content negotiation + discovery (prefersMarkdown, markdownHref)
- feat(seo): buildRobots aiBots policy (allow/block-training/disallow)
- feat(seo): llms-full.txt mode in buildLlmsTxt/createLlmsTxtRoute
- feat(mcp): createMcpRoute — read-only MCP server (search_content, get_page)
- feat(content): searchContent + createSearchRoute — shared JSON search
- feat(seo): buildSpeakableJsonLd + buildSummaryField (aiSummary, auto-fill)

Forms:
- feat(forms): useForm/useContactForm + validators (logic-only, no markup)
- feat(forms): honeypot anti-spam (honeypotInputProps, isHoneypotTripped)

Helpers / hardening:
- feat(i18n): resolveLocalized — replaces ad-hoc getSafeString
- feat(hooks): buildCrossLocaleFieldSync — locales from config, no hardcoded list
- feat(seo): buildNoindexField — checkbox → meta.noindex, no
- feat(content): resolveRedirect — 301/308 from slugHistory
- feat(env): assertEnv + ipalEnvRules — fail-fast env validation
- feat(consent): ConsentScript — load third-party only after consent
- feat(health): createHealthRoute — Coolify/Docker DB liveness

Fixes:
- fix(seo): wrap getCachedPayload in try/catch in createManifestHandler
  (Docker/CI build no longer crashes when DB unreachable)

docs: migration.md (20 sections), new env.md/mcp.md, updated agents.md,
AGENTS-TEMPLATE.md, forms/hooks/content/seo/consent/deployment/richtext
This commit is contained in:
2026-10-10 16:52:16 +02:00
parent e6eada5d39
commit 09925e4cfd
75 changed files with 3067 additions and 45 deletions
+20
View File
@@ -53,6 +53,26 @@ const converters: JSXConvertersFunction = ({ defaultConverters }) => ({
Spread `defaultConverters` — nadpisujesz tylko te węzły, które chcesz. Reszta
(listy, tabele, obrazy, linki) działa z oficjalnej obsługi Payload.
## lexicalToMarkdown — richText → Markdown (dla AI)
Do czytelności dla agentów AI (Markdown per strona, llms-full) potrzebny jest
tekst, nie JSX. `lexicalToMarkdown` konwertuje pole richText na czysty Markdown:
```ts
import { lexicalToMarkdown } from '@intecion/ipal-kit'
const md = lexicalToMarkdown(page.content) // '## Nagłówek\n\nAkapit **bold**…'
```
Obsługuje nagłówki, akapity, bold/kursywa/kod/strikethrough, linki, listy
(zagnieżdżone), cytaty, `---`, obrazy (upload). To tekstowy brat `RenderRichText`
— ten sam wejściowy kształt, inne wyjście. **Samodzielny walker**, NIE zależy od
konkretnego eksportu MD z `@payloadcms/richtext-lexical` (te zmieniają się między
wersjami), więc bump Payloada go nie zepsuje. Nieznany węzeł degraduje się do
swojej treści, nie rzuca.
Dla całej strony (bloki, nie pojedyncze pole) użyj `blocksToMarkdown` /
`createMarkdownRenderer` — patrz [content.md](./content.md).
## Zależność
Oficjalny konwerter jest częścią `@payloadcms/richtext-lexical`, które projekt