ipal-upgrade: the 1.13.0 section walks through the 7 "What projects must update" items with checks. PROGRAMISTA §6: item 47 for 1.13.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8.0 KiB
name, description
| name | description |
|---|---|
| ipal-upgrade | Upgrades an existing project to the latest @intecion/ipal-kit and replaces hand-written code that the plugin now provides — proxy, route handlers, consent wrapper, language switcher, rich text parser, form logic, noindex, redirects, env validation, privacy link label, 404 page, CTA field zoo. Use when the user asks to update ipal-kit, migrate an older project, or clean up duplicated logic in a project. |
ipal-upgrade
What changed in the version: node_modules/@intecion/ipal-kit/docs/CHANGELOG.md (the
"Requires project changes" sections — do all of them). List of changes: …/docs/dev/PROGRAMISTA.md §6.
Rule: when the plugin provides something the project has written by hand — remove the local version.
1. Update the package
pnpm add @intecion/ipal-kit@latest
pnpm payload generate:importmap # new admin panel components from the plugin (e.g. RowLabel)
rm -rf .next
Copy the skills again (AGENT.md §14) — they may have changed.
Postgres with migrations: new plugin fields (e.g. privacyLinkLabel) →
pnpm payload migrate:create.
1a. AGENT.md §0b set
After the update, a full ipal-audit shows a "missing: …" section — the missing items of
the MANDATORY SET (GEO: llms-full, Markdown, MCP; R2; Turnstile through
getTurnstileConfig…). Wire each one according to PROGRAMISTA §2 — it is part of the update,
not an extra. Skip one only with a client decision in AGENTS.md (ipal-audit-skip:).
1.8.x → 1.9.0 (PROGRAMISTA §6, items 17–21): twoFactor.plugin required;
getTurnstileConfig instead of turnstileSiteKey (with both keys set the token is
required — check that every form has the widget); clientIp(await headers()) in
the form action + IPAL_IP_HEADER in the production env; buildR2Storage wired.
→ 1.9.2 (PROGRAMISTA §6, items 28–33) — import instead of code, start with item 28 (security):
a custom FormRenderer passed the Emails tab (company addresses) to the HTML → a block with <RenderForm> +
formClasses.ts, remove the renderer. Then: layout → SiteProviders, page and 404 → createPageRoute /
createNotFoundPage, GEO routes → re-exports from lib/content, src/fields/section*.ts and
lib/navigation.ts → buildSection*Field, resolveNav, resolveLink. Check every item in
the browser (form: submission + email; page: 200, 404, metadata). Postgres: migrate:create
(new form field types and texts in Notifications).
→ 1.11.0 (PROGRAMISTA §6, items 34–37): remove the workarounds — a copy of publicForm (→ RenderForm values /
prepareBuilderForm), manual remotePatterns/dangerouslyAllowLocalIP (→ buildImagesConfig()), conditional
storage in ipalEnvRules, a custom product JSON-LD graph (→ pageJsonLd.entries + buildProductJsonLd),
a custom RenderBlocks for h1 (→ isFirst). Links to posts: buildLinkField({ relationTo: [...] }) with a data migration.
→ 1.11.1 (PROGRAMISTA §6, items 38–45): remove the workarounds (WORKAROUND ipal-kit comments) — the
NEXT_RUNTIME condition around the revalidatePath injected into buildRevalidateHook (a global's own afterChange hook keeps it — ipal-nav), the form focus guard, a custom theme (→ ThemeScript/ThemeSwitcher),
a custom table of contents (→ extractHeadings + TableOfContents + headingIds), catching notFound for a redirect
(→ onMissing: 'redirectHome'), background colour only for JPEG in <Media>, a custom type instead of CmsLink['appearance']
(→ per-shape types from generate:types: CmsLink, CmsLinkPlain, CmsLinkNoLabel, CmsLinkPlainNoLabel; style: LinkAppearance). Cookie Settings: buttons.save →
buttons.savePreferences — in migrate:create choose rename for the column to keep the texts.
→ 1.12.3 (PROGRAMISTA §6, item 46): Postgres/SQLite: migrate:create (new Cookie Settings group →
detailLabels, only new columns — no rename). A custom cookie settings window or a cookie list added to
the banner → <CookieBanner settings="detailed"> and remove the copy. With detailed: Cookie Settings → Cookies filled in
(scan, ipal-consent-check) and Detail labels in every language.
→ 1.13.0 (PROGRAMISTA §6, item 47; CHANGELOG "What projects must update" — do all 7, in order):
- Project without
access(norolesfield): every logged-in account can now use the plugin's admin and editor features (Site Integrations, settings globals, test e-mail, stats, consent records, forms, form submissions); before, nobody could through the API. Check who can log in (grep -rn "auth:" src/collections, open sign-up, customer accounts). Untrusted accounts → addaccess(roles), or narrow withglobalOverrides,forms.formOverrides/forms.formSubmissionOverrides,consentLog.collectionOverrides,stats.collectionOverrides. Verify: log in as a non-staff account →GET /api/globals/site-integrationsis 403. - Project with
access: plainuseraccounts can no longer edit Site Settings, Cookie Settings, Notifications or forms, or create/delete users. List staff accounts in the panel (Users → Roles) and give themeditor/admin, or loosen withglobalOverrides,forms.formOverrides.access,access.authAccess. Verify: an editor saves Site Settings. - Postgres/SQLite:
pnpm payload migrate:create→migrate(Site Settings → Search & AI:search_verification_*,ai_crawlers_policy, theai_crawlers_rulestable, localizedllms_intro). Withenabled: falsethe migration now keeps (or restores) the plugin's tables — check it has no DROP TABLE. MongoDB: nothing. pnpm payload generate:importmap,pnpm ipal:skills,rm -rf .next.- Behaviour to check (grep the project, fix what applies):
getSettings/getSiteShellread atdepth: 1(code that reads a relation of a relation →createContentHelpers({ settingsDepth: 2 }));sitemap()throws at runtime instead of returning[](sitemapRouteanswers 503); atwoFactor.collectionSlugother thanadmin.userstops startup (allowCollectionMismatch: true); requests without a client IP share one limited bucket (proxy hides the IP →IPAL_IP_HEADER, orsetUnknownIpFactor);RenderRichTextturns unsafe link URLs into#(safeLinks). - Review the new options with the user (AGENT.md §7.1):
consentMode: 'basic',revalidatePath,turnstileHostnames, Site Settings → Search & AI (verification codes, or keep DNS verification),app/robots.ts→export { getRobots as default }+force-dynamic,createSearchRoute({ …, isPathVisible }),access.firstUserAdmin. - Remove the workarounds: a plugin after
ipalKitthat addsafterChangeor access to the plugin globals →ipalKit({ revalidatePath })/globalOverrides; a hand-written global revalidation hook →buildGlobalRevalidateHook({ revalidatePath });consentFieldNamepassed only because the option was ignored →forms.consentFieldNameworks now; your own seed guard / upsert code →@intecion/ipal-kit/seed(createSeeder).
2. Inventory (no code changes)
For every item in the PROGRAMISTA §6 table show evidence (grep / file) of whether
it applies to the project. Run the ipal-audit skill (--quick) and attach the result.
Result: a prioritised to-do list — carry it out right away. Stop
only before an irreversible change (data migration with content → ipal-migrate-fields,
changing published slugs).
3. Item by item
One item = one change = one commit:
- read the docs file it points to,
- replace the local code with the plugin function, remove the old code (do not keep both),
pnpm build— it passes before you take the next item.
Items that rename fields in the database (e.g. the ctaLabel → links refactor)
need a data migration before the old fields are removed — ask
the user whether the project already has content.
4. Finish
A full ipal-audit with no errors + a list of things to check in the admin panel.