sonor-setup Changelog
7.6.0
doctorandverifysay whether the site can show privacy choices (privacy.choices). The check warns whenprivacyChoices={false}leaves no consent manager to ask, when the site connects its own consent manager but leavesSiteKitLayout's built-in choices on beside it, when the installed site-kit is from beforeSiteKitLayoutshowed 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 --onlineandstatussay 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
setupstops 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.llmsDiscoveryandAiDiscoveryLinks, and recommend HTML discovery that preserves Next resource preload headers. Existing HTTP discovery wiring remains recognized.
7.5.0
- Add
publication --config publication.jsonto preview a validated launch definition.--writecreates 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-kitwith--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-articleskeeps 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.yamlline the codemod adds is valid YAML. When it lists@sonordev/commerce-kitunderminimumReleaseAgeExclude, 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--checkstill passed. If 7.3.0 already ran on your project, run the codemod again: it quotes a name it finds there unquoted, and--checkfails until it's quoted. - It goes by imports, not by text. The codemod decides a project uses
commerce from its module specifiers:
importandexport ... from, a dynamicimport()(insidenext/dynamictoo) andrequire(). 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-kitadded and site-kit raised to^8.0.0in a project that imports neither, and--checkfailed 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:--checkpasses without it.
7.3.0
- The codemod moves commerce to
@sonordev/commerce-kit. site-kit 8 takes commerce out of@sonordev/site-kitand into its own package, so the newsite-kit-8transform rewrites the imports for you.@sonordev/site-kit/commerceand/commerce/server(and/membershipsand/memberships/server, which only a pre-release build had) become the same subpaths of@sonordev/commerce-kit, in imports,export ... from, dynamicimport()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 aftersite-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-8runs 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-kitto dependencies unless dependencies or devDependencies already list it, and raises@sonordev/site-kitto^8.0.0when its range starts below 8. An exact pin stays exact (7.4.0becomes8.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. Aworkspace:,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 beforeverify, in the terminal and in--json. - It flags what it can't rewrite safely: a
require()of an old path (@sonordev/commerce-kitis ESM only), a namespace import of the site-kit root that uses one of the moved types, anexport *from the root, a re-export of a moved type, and asonorMcpServerwhoseofferingsoption has noread. - The codemod reads the whole project. It used to read
app/,src/,components/andlib/and a few root files, so a Pages Router site, or an import inhooks/,utils/,scripts/, a root config, an.mjs,.ctsor.mdxfile, got "No changes needed" and--checkexit 0 while the old imports were still there (andpackage.jsonuntouched). It reads source files anywhere now, minusnode_modules, build output andpublic/. --checkfails 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-8printedcodemod --writeas its next step, which runs every transform; the step repeats--only,--pathand--no-backupnow. An--onlyid it doesn't know stops the run (exit 2) and lists the valid ones; a typo used to run every transform.--dry-runwins over--write. - It stops where a run does harm: inside
@sonordev/site-kit,@sonordev/commerce-kit,@sonordev/contractsorsonor-setupitself (it would add a package as its own dependency), at a workspace root, and for a--pathoutside the project. - pnpm's release-age policy. When
pnpm-workspace.yamllists@sonordev/site-kitunderminimumReleaseAgeExclude, the codemod adds@sonordev/commerce-kitbeside 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.jsonwith 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, withpackage.jsonlast, 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.overridesorresolutionsentry that pins site-kit below 8. upgradestops at a major version.@latestis whatever is newest today, and a major can take things away (site-kit 8 moved commerce out).upgradesays so, installs nothing and points atcodemod --check, until you pass--major. A dry run previews it.mcp --offeringswrites the reader site-kit 8 needs.list_offeringsnow reads throughgetOfferingsResultfrom@sonordev/commerce-kit/commerce/server, so the server file imports it and setsofferings: { 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-kitisn't in package.json, the next steps say to install it.migrategives a layout's metadata call the layout scope. A layout's metadata is inherited by every page beneath it, so whenmigrateturns a layout's staticmetadata(the root layout's included) intogetManagedMetadata, it passesscope: '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 layoutmigratecreates to carry a client-component page's own metadata, keep the default scope.
7.2.0
mcpgenerates an experimental AI catalog at/.well-known/ai-catalog.jsonand 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_URLneeds to be set.
7.1.2
-
The codemod moves
@sonordev/site-kit/engageimports. 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/popupsunder their new names (EngageElementbecomesSitePopup, kept as the local name so nothing else in the file changes). It flagsEngageWidget, whichSiteKitLayoutalready mounts. -
Schema saves say what Sonor did.
setupandmigratesay 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. -
migratekeeps a page's schema until Sonor has it. It replaces a page's JSON-LD withManagedSchemaonly 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 --schemaslists, and stops failing. It lists where each page gets its schema and points hand-written JSON-LD atmigrate. 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.tsfrom the directory that holds the app: the project root, orsrc/when the app issrc/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. Thenext-16-proxytransform (andsonor-setup next16) used to renamemiddleware.tsin place, which leftproxy.tsat the root ofsrc/appsites. It now writessrc/proxy.tsthere and re-points the file's relative imports, and it moves a rootproxy.tsan earlier run left behind. When there's a proxy in both places, it changes neither and says which one Next runs. -
doctorchecks where the proxy is. It warns when a proxy or middleware file sits at the root of asrc/appsite (or insrc/when the app is at the root) and says where it goes, instead of calling the file present.geono longer credits the discovery header to a proxy Next never runs. A comment that mentionsruntimeno longer reads as setting one. -
Repeated reads collapse. Renaming an old fallback such as
process.env.SONOR_API_KEY || process.env.UPTRADE_API_KEYnow givesprocess.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 renamesUPTRADE_API_KEYonto aSONOR_API_KEYthat's already set (the later line would win); it flags the old line to delete. -
Nothing extra is left in the project. The codemod,
initandmigratekeep the originals of the files they overwrite in a folder under your OS temp directory, not as.bakor.backupfiles beside them, and the codemod prints where (--no-backupskips them). A.env.local.bakalso slipped past the.env*.localignore rule older Next.js templates use. The codemod never reads or edits.env.example(or.env.sample,.env.template):.env.localis the one env file. -
The live-updates route fits a site with articles.
scaffoldwritescreateRevalidateRoute({ 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.doctorasks 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. -
scaffoldwrites 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 manifestships site-kit 7.1.2's manifest.
7.1.0
doctorchecks 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.scaffoldwrites 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-setupneeds it as a dev dependency;sonor-setup codemod --writeadds it. --jsonenvelopes reportsiteKitVersion(the site's installed site-kit,nonewhen absent) and, new,setupVersion(this CLI).manifestreads 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 runsonor-setupgets 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 namedmiddlewareexport →proxy(or the default export when the file has its ownproxy), and site-kit's./middleware/createMiddleware→./proxy/createProxy. Deterministic and offline;next16uses it instead of shelling out to@next/codemod@canary. A file that setsruntimeis flagged, never moved, and nothing moves onto an existingproxy.ts. The engine can now rename files (renamedToin--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 generatedMCP_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;--forcereplaces it. An existing route's extension decides route.ts vs route.js. - One
.envloader with site-kit (Next.js precedence), on Node'sutil.parseEnv;dotenvis gone. Node 20.19+. - The codemod no longer scans
.claude/(agent session worktrees).