docs
    sonor-setup CLI: Changelog
    v7.6.0.md

    sonor-setup Changelog

    7.6.0

    • doctor and verify say whether the site can show privacy choices (privacy.choices). The check warns when privacyChoices={false} leaves no consent manager to ask, when the site connects its own consent manager but leaves SiteKitLayout's built-in choices on beside it, when the installed site-kit is from before SiteKitLayout showed them, when the site loads a Google tag or tag manager by hand or sends a Google Ads conversion itself, and when the notice links to a page the site doesn't have.
    • doctor --online and status say whether Sonor's measurement configuration answers for the host the site calls itself (measurement.site). They warn when Sonor refuses that host (a different spelling of the project's address, or one the project doesn't list), when the configuration is turned off and when it needs saving again. A refused host records no analytics. For a configuration that's turned off or needs saving again, what they say about analytics follows the saved policy: where it asks visitors to agree to analytics, the site records none, and where it asks only for advertising purposes, analytics keep recording and the built-in privacy choices let a visitor turn visit measurement off. An enabled configuration is described the same way, and a check that can't read the policy says so instead of guessing. The privacy-choices check's note on a site with nobody to ask follows the policy too.

    7.5.2

    • setup stops at the first batch Sonor refuses for a reason every batch would share (an API key it doesn't accept, or a project whose plan doesn't include AI site setup) and prints Sonor's reason once, instead of failing every batch in turn. Any other failure still moves on to the next batch.

    7.5.1

    • GEO checks recognize rendered SiteKitLayout.llmsDiscovery and AiDiscoveryLinks, and recommend HTML discovery that preserves Next resource preload headers. Existing HTTP discovery wiring remains recognized.

    7.5.0

    • Add publication --config publication.json to preview a validated launch definition. --write creates publication, article, category, author, newsletter, feed and sitemap routes with three distinct starter compositions. Existing files are preserved; credentials and customer data never belong in the definition.
    • New Press Kit migrations install Press Kit 1.1 with Site Kit 8.4 for confirmed newsletter receipts and publication operations helpers.

    7.4.0

    • Move article imports to @sonordev/press-kit with --only press-kit, sharing the existing migration engine while preserving commerce imports and dependencies, add its dependency, and honor the Site Kit 8.3 minor floor.
    • Scaffold MCP article tools with injected Press Kit readers. --no-articles keeps sites without publications independent of Press Kit.
    • Detect Press Kit publications for revalidation scaffolding and checks, including local reader barrels. Existing Site Kit article imports remain compatible.

    7.3.1

    • The pnpm-workspace.yaml line the codemod adds is valid YAML. When it lists @sonordev/commerce-kit under minimumReleaseAgeExclude, the name is always quoted, in the quotes the list uses for @sonordev/site-kit (single quotes when there's nothing to follow). 7.3.0 copied the last line of the list, and when that line was unquoted (- next) it wrote - @sonordev/commerce-kit. A plain YAML value can't start with @, so pnpm couldn't read the file and every install failed, while --check still passed. If 7.3.0 already ran on your project, run the codemod again: it quotes a name it finds there unquoted, and --check fails until it's quoted.
    • It goes by imports, not by text. The codemod decides a project uses commerce from its module specifiers: import and export ... from, a dynamic import() (inside next/dynamic too) and require(). 7.3.0 also counted any quoted string that named an old path or the package, so a code sample on a docs page, a redirect table or a list of packages got @sonordev/commerce-kit added and site-kit raised to ^8.0.0 in a project that imports neither, and --check failed until someone made that change. It now also leaves a comment, a path written out inside a longer string or template (a code sample), the text of a JSX element (a <code> block, or a sentence that names a path) and an MDX page's prose and code fences as they are: in an MDX page, only the import and export blocks are code. If 7.3.0 added the package to a project that doesn't import commerce, you can take it out again: --check passes without it.

    7.3.0

    • The codemod moves commerce to @sonordev/commerce-kit. site-kit 8 takes commerce out of @sonordev/site-kit and into its own package, so the new site-kit-8 transform rewrites the imports for you. @sonordev/site-kit/commerce and /commerce/server (and /memberships and /memberships/server, which only a pre-release build had) become the same subpaths of @sonordev/commerce-kit, in imports, export ... from, dynamic import() and import types. The types the site-kit root used to re-export (CommerceOffering, CommerceCategory, CommerceVariant, CommerceSchedule, OfferingType, Cart, CartItem, EventCheckoutProps, CheckoutLineItem) move to the package's root, and a mixed import is split so the rest stays on site-kit. It runs right after site-kit-7, so a 6.x site that imports commerce components from the root reaches the package in one run, and running it again changes nothing. --only site-kit-8 runs it alone. The whole move is in Moving a site to site-kit 8.
    • It updates package.json when a site uses commerce. It adds @sonordev/commerce-kit to dependencies unless dependencies or devDependencies already list it, and raises @sonordev/site-kit to ^8.0.0 when its range starts below 8. An exact pin stays exact (7.4.0 becomes 8.0.0) and a tilde stays a tilde. The edit changes those lines in place and leaves the rest of the file as it was. A workspace:, link:, file: or git spec isn't rewritten; the codemod flags it. A site that doesn't use commerce keeps the site-kit it has. After a write, the next steps name the install for your package manager before verify, in the terminal and in --json.
    • It flags what it can't rewrite safely: a require() of an old path (@sonordev/commerce-kit is ESM only), a namespace import of the site-kit root that uses one of the moved types, an export * from the root, a re-export of a moved type, and a sonorMcpServer whose offerings option has no read.
    • The codemod reads the whole project. It used to read app/, src/, components/ and lib/ and a few root files, so a Pages Router site, or an import in hooks/, utils/, scripts/, a root config, an .mjs, .cts or .mdx file, got "No changes needed" and --check exit 0 while the old imports were still there (and package.json untouched). It reads source files anywhere now, minus node_modules, build output and public/.
    • --check fails while a manual follow-up remains, not only while a file can be rewritten: an import it can't fix is as broken as one it can.
    • A scoped preview offers a scoped next step. codemod --only site-kit-8 printed codemod --write as its next step, which runs every transform; the step repeats --only, --path and --no-backup now. An --only id it doesn't know stops the run (exit 2) and lists the valid ones; a typo used to run every transform. --dry-run wins over --write.
    • It stops where a run does harm: inside @sonordev/site-kit, @sonordev/commerce-kit, @sonordev/contracts or sonor-setup itself (it would add a package as its own dependency), at a workspace root, and for a --path outside the project.
    • pnpm's release-age policy. When pnpm-workspace.yaml lists @sonordev/site-kit under minimumReleaseAgeExclude, the codemod adds @sonordev/commerce-kit beside it. Without it, the first install in the day after a release is refused (or rewrites the file on its own).
    • Safer with the files it can't handle. A package.json with a byte order mark is edited (and keeps the mark); one it can't read is flagged instead of left out of step with the rewritten code. A file that isn't UTF-8 is reported, not damaged. A write that fails is reported and the rest are written, with package.json last, so a run that stops partway leaves the dependencies as they were; the exit code is 1 and a re-run finishes the job.
    • New flags: a template-literal specifier of an old path, and an overrides, pnpm.overrides or resolutions entry that pins site-kit below 8.
    • upgrade stops at a major version. @latest is whatever is newest today, and a major can take things away (site-kit 8 moved commerce out). upgrade says so, installs nothing and points at codemod --check, until you pass --major. A dry run previews it.
    • mcp --offerings writes the reader site-kit 8 needs. list_offerings now reads through getOfferingsResult from @sonordev/commerce-kit/commerce/server, so the server file imports it and sets offerings: { path: '/shop', read: getOfferingsResult }. The commented hint in the file shows the same shape. The option needs site-kit 8.0.0 or newer installed: an older one gets upgrade guidance and nothing is written. When @sonordev/commerce-kit isn't in package.json, the next steps say to install it.
    • migrate gives a layout's metadata call the layout scope. A layout's metadata is inherited by every page beneath it, so when migrate turns a layout's static metadata (the root layout's included) into getManagedMetadata, it passes scope: 'layout'. Without it, a canonical Sonor holds for the homepage is stamped on every page that has none of its own. The option is site-kit 8 API, so it's written only when the installed site-kit is 8.0.0 or newer. Pages, and the layout migrate creates to carry a client-component page's own metadata, keep the default scope.

    7.2.0

    • mcp generates an experimental AI catalog at /.well-known/ai-catalog.json and a canonical card at /api/mcp/server-card, alongside both existing compatibility paths. All surfaces use the same server definition.
    • New discovery scaffolding requires site-kit 7.3.0 or newer. Older installed versions receive upgrade guidance before any files change; custom servers remain untouched.
    • An unconfigured catalog returns 503 with no caching instead of failing the site's build. The command explains when NEXT_PUBLIC_SITE_URL needs to be set.

    7.1.2

    • The codemod moves @sonordev/site-kit/engage imports. Engage was retired in Sonor and split in site-kit: chat imports (ChatWidget, ChatConfig, ...) move to @sonordev/site-kit/chat, popup types to @sonordev/site-kit/website/popups under their new names (EngageElement becomes SitePopup, kept as the local name so nothing else in the file changes). It flags EngageWidget, which SiteKitLayout already mounts.

    • Schema saves say what Sonor did. setup and migrate say when Sonor saved a schema as a draft because it has template placeholders (with what to fill in), or kept the copy it already had, and report a failed save as failed, including an answer that says it didn't save. They used to print a check mark either way.

    • migrate keeps a page's schema until Sonor has it. It replaces a page's JSON-LD with ManagedSchema only once Sonor has saved a copy; a refused key or a server error used to leave the page with no schema at all. JSON-LD built at render time stays as it is, and JSON-LD in a template literal that ends in a string value is read now (it never was).

    • sync --schemas lists, and stops failing. It lists where each page gets its schema and points hand-written JSON-LD at migrate. It used to send that list to an endpoint that takes one schema at a time, so the step always failed.

    • The codemod puts the proxy where Next reads it. Next only runs proxy.ts from the directory that holds the app: the project root, or src/ when the app is src/app. A proxy anywhere else is ignored without a warning and the build still passes, so the site quietly sends no security headers and runs no managed redirects. The next-16-proxy transform (and sonor-setup next16) used to rename middleware.ts in place, which left proxy.ts at the root of src/app sites. It now writes src/proxy.ts there and re-points the file's relative imports, and it moves a root proxy.ts an earlier run left behind. When there's a proxy in both places, it changes neither and says which one Next runs.

    • doctor checks where the proxy is. It warns when a proxy or middleware file sits at the root of a src/app site (or in src/ when the app is at the root) and says where it goes, instead of calling the file present. geo no longer credits the discovery header to a proxy Next never runs. A comment that mentions runtime no longer reads as setting one.

    • Repeated reads collapse. Renaming an old fallback such as process.env.SONOR_API_KEY || process.env.UPTRADE_API_KEY now gives process.env.SONOR_API_KEY, not the same read twice, and rerunning the codemod cleans up files an earlier version left that way. In an env file it no longer renames UPTRADE_API_KEY onto a SONOR_API_KEY that's already set (the later line would win); it flags the old line to delete.

    • Nothing extra is left in the project. The codemod, init and migrate keep the originals of the files they overwrite in a folder under your OS temp directory, not as .bak or .backup files beside them, and the codemod prints where (--no-backup skips them). A .env.local.bak also slipped past the .env*.local ignore rule older Next.js templates use. The codemod never reads or edits .env.example (or .env.sample, .env.template): .env.local is the one env file.

    • The live-updates route fits a site with articles. scaffold writes createRevalidateRoute({ publicationBasePath: '/insights' }) with the site's own path, read from the app directory: a dynamic page that renders site-kit articles, or a [slug] route under a folder named blog, insights, news, resources or articles. When more than one folder looks like the publication, it writes the one-line route and lists them. doctor asks for the same form, warns when a site with articles uses the one-line route, and counts a route built on agency-site-kit's handler as kit-built rather than hand-rolled.

    • scaffold writes the proxy beside the app directory too, and won't write one next to a middleware file or a proxy Next ignores.

    7.1.1

    • Messages say "Sonor" where they said "Portal", the product's old name: "Uploading FAQs to Sonor", "Get your API key from Sonor → Project Settings → API Keys", and the rest. No behavior changes.
    • sonor-setup manifest ships site-kit 7.1.2's manifest.

    7.1.0

    • doctor checks for the live-updates route (app/api/seo-revalidate). Without it, content edits in Sonor wait for the site's cache to expire instead of going live in seconds.
    • scaffold writes that route (one line, export { POST } from '@sonordev/site-kit/revalidate') unless the site already has one.

    7.0.0

    First release as its own package. Until now the CLI shipped inside @sonordev/site-kit (as its sonor-setup bin), where it was 3 MB of every site's install and needed a site-kit release for every setup-only fix.

    • npx sonor-setup … works as before; npx fetches this package.
    • A site whose package.json scripts run sonor-setup needs it as a dev dependency; sonor-setup codemod --write adds it.
    • --json envelopes report siteKitVersion (the site's installed site-kit, none when absent) and, new, setupVersion (this CLI).
    • manifest reads the site's installed site-kit manifest, falling back to the copy shipped here.
    • New codemod transform site-kit-7: runtime imports from the site-kit root (types-only since 7.0) move to their module's entry, deprecated paths move to their 7.x homes, and a site whose scripts run sonor-setup gets it as a dev dependency. See site-kit's docs/MIGRATING-TO-7.md.
    • New codemod transform next-16-proxy: middleware.ts → proxy.ts, a named middleware export → proxy (or the default export when the file has its own proxy), and site-kit's ./middleware/createMiddleware → ./proxy/createProxy. Deterministic and offline; next16 uses it instead of shelling out to @next/codemod@canary. A file that sets runtime is flagged, never moved, and nothing moves onto an existing proxy.ts. The engine can now rename files (renamedTo in --json).
    • New command mcp: writes a site's MCP wiring with site-kit's built-in tools (the server file, the endpoint with tool-call reporting, the server card at both well-known paths, and on Netlify the rate-limited relay plus a generated MCP_TRANSPORT_SECRET). Never overwrites a file without --force; --inquiry-form, --booking, --offerings, --articles, --netlify/--no-netlify, --dry-run. On a site that runs its own MCP server it writes nothing and lists what's opt-in; --force replaces it. An existing route's extension decides route.ts vs route.js.
    • One .env loader with site-kit (Next.js precedence), on Node's util.parseEnv; dotenv is gone. Node 20.19+.
    • The codemod no longer scans .claude/ (agent session worktrees).