Docs
Next

systhema codemod

Run one codemod.

On this page

Run a single code codemod on the current project. Mostly useful for debugging or for re-running an individual codemod after manual edits.

systhema codemod --list                          # list available codemods
systhema codemod rename-systhema-bin             # run by id
systhema codemod rename-systhema-bin --dry-run   # plan only

systhema upgrade runs every applicable codemod for you; see Upgrading.

OptionsLink to this section

FlagDescriptionDefault
--dry-runPlan only, no changesfalse
--listList available codemodsfalse

Available codemodsLink to this section

IDReleaseWhat it changesApplies when
add-browserslist-to-package-json1.6.0Adds a browserslist field to the project root package.json with Systhema's modern baseline (describeModernBaseline()). Without this Next.js falls back to its default targets (Chrome 64+, etc.) and ships ~14 KB of polyfills for Array.prototype.at/.flat/.flatMap to every public page. Idempotent — does nothing if browserslist is already defined (whether the consumer set their own list or accepts the recommended one).Idempotent — does nothing if browserslist is already defined (whether the consumer set their own list or accepts the recommended one).
add-cookie-consent-to-next-layout1.6.0Adds the cookieConsent={getSysthemaCookieConsentConfig()} prop to in the project's app/layout.tsx (or src/app/layout.tsx) so the cookie consent banner renders. Idempotent — does nothing if the prop is already present or if no SysthemaProvider is found (custom layout).Idempotent — does nothing if the prop is already present or if no SysthemaProvider is found (custom layout).
add-payload-instance-to-root-layout1.6.0Adds the payloadInstance prop to in the consumer's app/(site)/template.tsx, enabling the cookie consent banner to resolve its config from the GeneralSettings global. Reuses an already-resolved payload instance if the layout has one (e.g. a custom const payload = await getPayloadAuth(...)), otherwise falls back to getPayload({ config: configPromise }) and injects the getPayload / configPromise imports if missing. Idempotent — does nothing if the prop is already present, no template.tsx is found, or the project is not a Payload project.Idempotent — does nothing if the prop is already present, no template.tsx is found, or the project is not a Payload project.
adopt-icon-picker1.6.0Preserves faIconPickerField compatibility calls and wraps custom Lexical converters that inject data.icon/iconBefore/iconAfter straight into dangerouslySetInnerHTML with resolveIconForRender(…).svg so Material Symbols identifier-only picks render. Ambiguous icon usages are reported, not rewritten. Idempotent.
optin-cookie-consent-tab1.6.0Preserve the cookie consent admin tab for a configured banner, without replacing existing General Settings choices. SQL databases need the tab's columns, localized fields and child tables. Run nav renames before schema additions, then copy settings. For push-mode PostgreSQL, review systhema migrate --schema --dry-run, then apply systhema migrate --schema; do not run payload migrate with a dev-push marker or generate a full-schema migration without a baseline. For a migration-based project with an existing snapshot baseline and no dev marker, use pnpm payload migrate:create, review the DDL, then pnpm payload migrate. systhema migrate --schema needs @systhemaui/cli and @systhemaui/payload at 1.7.0-canary.16 or later; an older Payload package does not register the command.
remove-importmap-from-systhema-page1.6.0Drops the importMap import and the importMap={importMap} prop pass on in the consumer's (site)/(systhema)/[[...segments]]/page.tsx. The prop was never read inside @systhemaui/payload, but importing the admin importMap from a public route was dragging the entire admin component graph into the public bundle. Idempotent — does nothing if neither the import nor the prop are present, or no matching page.tsx is found.Idempotent — does nothing if neither the import nor the prop are present, or no matching page.tsx is found.
rename-emails-capability-strings1.6.0Rewrites occurrences of 'global.emails.read' and 'global.emails.update' in the project's TypeScript source to the new capability strings under 'global.general-settings.*'. Idempotent.
rename-figure-w-full1.6.0Rewrites occurrences of the legacy figure-w-full CSS class to the new figure-w-screen name across project source files (.ts/.tsx/.js/.jsx/.css/.scss/.mdx/.md/.html/.svelte/.vue). Whole-token match only; build artifacts and node_modules are skipped. Idempotent.
rename-systhema-bin1.6.0The project-local systhema bin was renamed to systhema-core in the next release so the systhema name belongs to the global Systhema CLI. This codemod updates npm scripts so they keep working.
add-searchparams-to-systhema-page1.7.0Adds the searchParams prop (param destructure + type) and forwards it to in the consumer catch-all route so wildcard redirects can preserve the incoming query string. Idempotent — no-op when searchParams is already present or no matching page.tsx is found.Idempotent — no-op when searchParams is already present or no matching page.tsx is found.
allow-pinch-zoom-in-root-layout1.7.0Deletes maximumScale and userScalable from the root layout's viewport export. Systhema used to scaffold both, which blocks pinch-zoom and fails WCAG 1.4.4 (Resize Text) plus Lighthouse's [user-scalable="no"] audit. The layout is a scaffold-mode file, so an upgrade can't rewrite it wholesale — this codemod edits the two properties in place and leaves everything else, including viewportFit: 'cover', untouched. Idempotent.
extract-forms-redirects-modules1.7.0Moves payload.config.ts's inline forms: {…} object and redirect: <bool> flag into src/payload/forms.ts and src/payload/redirects.ts, wired back by shorthand, so systhema setup forms|redirects can toggle them. A customised forms object and an already-extracted module are left alone. Idempotent.
host-aware-robots1.7.0Replaces the static app/robots.ts with app/robots.txt/route.ts. The static metadata file has no request context, so on a site serving one domain per locale every domain advertised the primary domain’s sitemap.
raise-browserslist-to-modern-baseline1.7.0Systhema's browser baseline is describeModernBaseline() — the union of Tailwind v4's own floor, Next 16's "baseline widely available" target and Swiper 14's. Tailwind is a hard requirement, so a Systhema site does not render below that line whatever the JavaScript is compiled for. This raises any >= floor in the root package.json browserslist that sits below it, so the build stops down-compiling and shipping legacy JavaScript for browsers the CSS never supported. A floor already at or above the baseline is left alone, a browser absent from the list is not added, and every other query shape (last 2 versions, defaults, > 0.5%) is untouched. Projects that keep their targets in a .browserslistrc need to raise them by hand. Idempotent.
rename-seo-capability-strings1.7.0Rewrites occurrences of 'global.seo.read', 'global.seo.update', and the 'global.seo.' wildcard in the project's TypeScript source to their 'global.general-settings.seo.' equivalents. Idempotent.
repair-fa-icon-picker-import1.7.0Restores faIconPickerField imports from the FontAwesome subpath after the old adopt-icon-picker rename. Reports ambiguous generic picker calls from the fields barrel without modifying them. Preserves aliases and shadowing bindings. Idempotent.
replace-admin-favicon1.7.0Rewrites the admin favicon to the Systhema mark and renames it to match the new admin.meta.icons default. The artwork is only overwritten when the file is still Systhema's shipped placeholder — a customised icon is renamed with its artwork untouched. Also rewrites hardcoded '/gg-icon.svg' references in the project's source. Idempotent.
add-postinstall-cache-refresh1.7.1Adds a postinstall script that refreshes the package token cache from existing generated artifacts.
declare-email-schema1.7.1Rewrites the generated Resend module and emails option so schema registration is source-controlled. Skips customized files.
rewrite-icon-tag-variants1.7.1Rewrites removed Icon.<tag> JSX variants imported from @systhemaui/react or @systhemaui/next to Icon as="tag". Preserves Icon.a, reports ambiguous members and spread attributes for review, and leaves other icon components unchanged.
commit-managed-files-ledger1.7.3A project whose .gitignore excludes all of .systhema/ never commits the managed-files ledger, so every fresh checkout loses the record of which managed files you edited and the next create-app-files run takes the one-time backup path again. Narrows the rule to .systhema/* and re-includes the ledger.
rename-deduplicated-translation-keys1.7.4Rewrites the 130 removed Systhema Admin translation keys (for example 'common:background_variant') to the surviving key with the same text in every language (for example 'common:backgroundVariant') across the project's TypeScript source. Idempotent.
robots-host-allowlist1.7.5Rewrites the scaffolded app/robots.txt/route.ts to resolve its origin with resolveSysthemaPublicOrigin, so a forged Host or X-Forwarded-Host header can no longer poison the CDN-cached robots.txt.