@sonordev/site-kit 7.3.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +40 -12
- package/CHANGELOG.md +73 -0
- package/README.md +44 -18
- package/agent-manifest.json +111 -56
- package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
- package/dist/{ArticleViewTracker-GFOAXFV7.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
- package/dist/{BlocksPopup-AHDU34TL.js → BlocksPopup-GFX3GZIK.js} +6 -5
- package/dist/{ChatWidget-FHBAHFZX.js → ChatWidget-DVS7MLBN.js} +8 -5
- package/dist/{FileField-J5W5MIAZ.js → FileField-DVN7NUBI.js} +5 -5
- package/dist/{FormSpotlight-PE5YZBFZ.js → FormSpotlight-W4SXKKO6.js} +3 -3
- package/dist/{FormStage-OOPQC27J.js → FormStage-JTEE5MZD.js} +3 -3
- package/dist/ManagedForm-ZAUHIHGP.js +19 -0
- package/dist/{ManagedNewsletterForm-TC5542ZG.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
- package/dist/{SignalCore-2YP5FCAS.js → SignalCore-W5PYYMGX.js} +7 -7
- package/dist/SiteChat-MY2GATWC.js +6 -0
- package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
- package/dist/SitePopups-TGULLAER.js +13 -0
- package/dist/SitemapSync-AN2OBJE6.js +9 -0
- package/dist/_client/booking-widget.js +6 -5
- package/dist/_client/testimonial-section.d.ts +1 -1
- package/dist/_client/testimonial-section.js +4 -2
- package/dist/affiliates/index.js +6 -6
- package/dist/analytics/index.js +73 -7
- package/dist/articles/index.js +2 -2
- package/dist/articles/server-ui.js +3 -3
- package/dist/articles/server.js +2 -2
- package/dist/brand.css +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +39 -8
- package/dist/chunk-3G7YABRA.js +25 -0
- package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
- package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
- package/dist/{chunk-BEBR4OJD.js → chunk-56VDS2RP.js} +2 -2
- package/dist/chunk-5ROTTMBL.js +19 -0
- package/dist/{chunk-56KNHB4U.js → chunk-5S2XDG5O.js} +1 -1
- package/dist/chunk-5TM3WPCI.js +7 -0
- package/dist/{chunk-BR4ZKUHH.js → chunk-6CJGZFOU.js} +18 -2
- package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
- package/dist/{chunk-XLSQTTUE.js → chunk-6QFINXLH.js} +3 -3
- package/dist/{chunk-CYUFBKJQ.js → chunk-6ZXJ3SXR.js} +1 -1
- package/dist/{chunk-NI2XNEMR.js → chunk-7YEEOIWI.js} +1 -1
- package/dist/{chunk-DNPNYWVL.js → chunk-BQ2CXKTQ.js} +5 -20
- package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
- package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
- package/dist/chunk-CAT235HY.js +13 -0
- package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
- package/dist/{chunk-O5RGXTWU.js → chunk-GNSXOTIK.js} +6 -4
- package/dist/{chunk-UPRSH6Q4.js → chunk-ICAVVF6D.js} +3 -3
- package/dist/{chunk-2ECWEUHP.js → chunk-IJQ767JS.js} +3 -5
- package/dist/{chunk-MKMD2HJW.js → chunk-J65N34YM.js} +3 -3
- package/dist/{chunk-6U3VLV2C.js → chunk-JIH32RH2.js} +4 -4
- package/dist/{chunk-T4DLETKR.js → chunk-K22OLAPC.js} +2 -2
- package/dist/{chunk-I2YX3HVD.js → chunk-KRBBH64S.js} +3 -3
- package/dist/{chunk-VF4F5WXZ.js → chunk-LBIQ5LTC.js} +1 -1
- package/dist/{chunk-WGIDC6QP.js → chunk-LKH44GI3.js} +5 -5
- package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
- package/dist/{chunk-WDQB4OXY.js → chunk-M62U7TJF.js} +1 -1
- package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
- package/dist/chunk-OD2ULW5Z.js +57 -0
- package/dist/{chunk-Y6LP36UW.js → chunk-OE3NXEOF.js} +2 -2
- package/dist/{chunk-L7U23XI2.js → chunk-OGK7OL3T.js} +5 -4
- package/dist/{chunk-RDPW4D33.js → chunk-PD7K54EQ.js} +2 -2
- package/dist/{chunk-MVR4FY5R.js → chunk-PIX7FAMX.js} +2 -2
- package/dist/{chunk-2AD3CDRR.js → chunk-ROAOI6GG.js} +10 -10
- package/dist/{chunk-YJLS6JBI.js → chunk-S7SSYGUJ.js} +6 -5
- package/dist/{chunk-ZKHI4E2B.js → chunk-SBPAXWLF.js} +1 -1
- package/dist/{chunk-ZHS2XFLV.js → chunk-TOSZGJEQ.js} +1 -1
- package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
- package/dist/{chunk-Z65DHMTW.js → chunk-TZ5RTANX.js} +3 -3
- package/dist/{chunk-VX5CMNMM.js → chunk-UAYAJPEP.js} +7 -1
- package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
- package/dist/{chunk-EPT6FJUY.js → chunk-UUWUAMUC.js} +13 -16
- package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
- package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
- package/dist/{chunk-MRQ2U4LZ.js → chunk-ZHNQFNO3.js} +2 -2
- package/dist/chunk-ZKADJNR2.js +52 -0
- package/dist/{chunk-WGG6GTKW.js → chunk-ZLFGXKLG.js} +1 -1
- package/dist/client/index.js +6 -5
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/sentences.d.ts +46 -0
- package/dist/contracts/site-cache.d.ts +2 -0
- package/dist/cta-bar/index.js +1 -1
- package/dist/fleet/index.js +6 -5
- package/dist/forms/field-autocomplete.d.ts +16 -8
- package/dist/forms/index.d.ts +5 -0
- package/dist/forms/index.js +17 -17
- package/dist/forms/server.js +7 -7
- package/dist/forms/static.js +2 -2
- package/dist/forms/submitForm.d.ts +5 -0
- package/dist/images/index.js +4 -4
- package/dist/index.d.ts +3 -7
- package/dist/index.js +1 -1
- package/dist/layout/SiteKitLayout.d.ts +2 -1
- package/dist/layout/client.js +11 -9
- package/dist/layout/index.js +14 -12
- package/dist/llms/index.js +8 -7
- package/dist/maps/index.js +6 -6
- package/dist/mcp/sonor.d.ts +47 -3
- package/dist/mcp/sonor.js +31 -21
- package/dist/proxy/index.d.ts +3 -3
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/TestimonialSection.d.ts +1 -1
- package/dist/reputation/VisualReviewCard.d.ts +6 -0
- package/dist/reputation/index.d.ts +2 -1
- package/dist/reputation/index.js +5 -2
- package/dist/reputation/review-photo.d.ts +2 -0
- package/dist/reputation/server.d.ts +3 -2
- package/dist/reputation/server.js +4 -1
- package/dist/reputation/types.d.ts +22 -0
- package/dist/revalidate/index.js +3 -3
- package/dist/robots/indexnow.js +2 -2
- package/dist/runtime/index.d.ts +32 -0
- package/dist/runtime/index.js +7 -0
- package/dist/seo/api.d.ts +0 -4
- package/dist/seo/client.js +6 -5
- package/dist/seo/getManagedMetadata.d.ts +24 -0
- package/dist/seo/index.d.ts +2 -3
- package/dist/seo/index.js +14 -132
- package/dist/seo/indexnow.js +2 -2
- package/dist/seo/llms.js +8 -7
- package/dist/seo/register-sitemap-cli.js +2 -2
- package/dist/seo/server-api.d.ts +0 -6
- package/dist/seo/server.d.ts +1 -1
- package/dist/seo/server.js +4 -4
- package/dist/seo/sitemap.js +5 -4
- package/dist/seo/types.d.ts +9 -30
- package/dist/server/index.d.ts +8 -1
- package/dist/server/index.js +5 -4
- package/dist/server/mint-site-token.d.ts +1 -13
- package/dist/server/server-fetch.d.ts +19 -0
- package/dist/server-api-EGOKC7Q3.js +9 -0
- package/dist/shared/build-entries.d.ts +21 -9
- package/dist/shared/clientApiConfig.d.ts +56 -0
- package/dist/shared/fresh-fetch.d.ts +9 -3
- package/dist/shared/identity-reader.d.ts +26 -0
- package/dist/shared/identity-storage.d.ts +30 -0
- package/dist/shared/identity.d.ts +13 -13
- package/dist/shared/import-specifiers.d.ts +26 -0
- package/dist/shared/sonorFetch.d.ts +4 -3
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +5 -4
- package/dist/slots/index.js +3 -3
- package/dist/sync/index.js +6 -5
- package/dist/types.d.ts +0 -1
- package/dist/website/cta-bar.js +1 -1
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +7 -6
- package/dist/website/popups.js +10 -7
- package/dist/website/slots.js +3 -3
- package/dist/{writeLLMsTxt-2NQVDGYI.js → writeLLMsTxt-UZGN6IBU.js} +4 -3
- package/docs/MIGRATING-TO-7.md +5 -2
- package/docs/MIGRATING-TO-8.md +183 -0
- package/docs.json +4 -8
- package/package.json +15 -44
- package/skills/site-kit/SKILL.md +41 -11
- package/src/analytics/README.md +14 -14
- package/src/chat/README.md +7 -7
- package/src/forms/README.md +61 -6
- package/src/mcp/README.md +61 -20
- package/src/proxy/README.md +5 -4
- package/src/reputation/README.md +25 -0
- package/src/revalidate/README.md +2 -2
- package/src/runtime/README.md +51 -0
- package/src/seo/README.md +24 -8
- package/src/sync/README.md +2 -2
- package/src/website/README.md +3 -2
- package/dist/AnalyticsProvider-DJQA66AG.js +0 -11
- package/dist/ManagedForm-JRZAJ7SZ.js +0 -16
- package/dist/SiteChat-EGEZJJVV.js +0 -5
- package/dist/SiteDesignReporter-YEEWJKWN.js +0 -11
- package/dist/SitePopups-LQBIXIFV.js +0 -10
- package/dist/SitemapSync-LSZ2EYOF.js +0 -8
- package/dist/chunk-24QZEO3Q.js +0 -41
- package/dist/chunk-BU66S5B7.js +0 -1
- package/dist/chunk-G3NHWMP5.js +0 -233
- package/dist/chunk-HODO5BX5.js +0 -28
- package/dist/chunk-L3AQCDCY.js +0 -386
- package/dist/chunk-P5GB6NEO.js +0 -66
- package/dist/chunk-SWKE6FWH.js +0 -47
- package/dist/cms/CmsPage.d.ts +0 -17
- package/dist/cms/CmsPreview.d.ts +0 -37
- package/dist/cms/CmsSection.d.ts +0 -8
- package/dist/cms/PortableTextRenderer.d.ts +0 -7
- package/dist/cms/index.d.ts +0 -37
- package/dist/cms/index.js +0 -5
- package/dist/cms/sanity-image.d.ts +0 -47
- package/dist/cms/sections/CtaSection.d.ts +0 -3
- package/dist/cms/sections/CustomSection.d.ts +0 -7
- package/dist/cms/sections/FaqSection.d.ts +0 -3
- package/dist/cms/sections/FormSection.d.ts +0 -8
- package/dist/cms/sections/GallerySection.d.ts +0 -3
- package/dist/cms/sections/HeroSection.d.ts +0 -3
- package/dist/cms/sections/RichTextSection.d.ts +0 -3
- package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
- package/dist/cms/sections/index.d.ts +0 -8
- package/dist/cms/server-api.d.ts +0 -49
- package/dist/cms/server.d.ts +0 -1
- package/dist/cms/server.js +0 -5
- package/dist/cms/types.d.ts +0 -104
- package/dist/commerce/CalendarView.d.ts +0 -43
- package/dist/commerce/CheckoutForm.d.ts +0 -11
- package/dist/commerce/EventCalendar.d.ts +0 -26
- package/dist/commerce/EventCheckout.d.ts +0 -42
- package/dist/commerce/EventEmbed.d.ts +0 -11
- package/dist/commerce/EventModal.d.ts +0 -43
- package/dist/commerce/EventTile.d.ts +0 -10
- package/dist/commerce/EventsAgenda.d.ts +0 -38
- package/dist/commerce/EventsWidget.d.ts +0 -84
- package/dist/commerce/OfferingCard.d.ts +0 -9
- package/dist/commerce/OfferingList.d.ts +0 -9
- package/dist/commerce/ProductDetail.d.ts +0 -38
- package/dist/commerce/ProductEmbed.d.ts +0 -11
- package/dist/commerce/ProductGrid.d.ts +0 -41
- package/dist/commerce/ProductPage.d.ts +0 -39
- package/dist/commerce/RegistrationForm.d.ts +0 -9
- package/dist/commerce/SizeChart.d.ts +0 -8
- package/dist/commerce/UpcomingEvents.d.ts +0 -9
- package/dist/commerce/api.d.ts +0 -179
- package/dist/commerce/events-extras.d.ts +0 -60
- package/dist/commerce/index.d.ts +0 -33
- package/dist/commerce/index.js +0 -8022
- package/dist/commerce/server.d.ts +0 -161
- package/dist/commerce/server.js +0 -2
- package/dist/commerce/types.d.ts +0 -340
- package/dist/commerce/useEventModal.d.ts +0 -20
- package/dist/commerce/utils.d.ts +0 -17
- package/dist/engage/EngageWidget.d.ts +0 -21
- package/dist/engage/index.d.ts +0 -14
- package/dist/engage/index.js +0 -45
- package/dist/engage/types.d.ts +0 -33
- package/dist/seo/ManagedContent.d.ts +0 -14
- package/dist/server-api-BVCBLJKL.js +0 -9
- package/dist/website/cms/server.d.ts +0 -2
- package/dist/website/cms/server.js +0 -5
- package/dist/website/cms-server.d.ts +0 -2
- package/dist/website/cms.d.ts +0 -2
- package/dist/website/cms.js +0 -5
- package/src/commerce/README.md +0 -109
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Moving a site to site-kit 8
|
|
2
|
+
|
|
3
|
+
site-kit 8 moves commerce into its own package, [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which also carries the new memberships module, and removes the entries for two modules Sonor retired, Engage and the Sanity CMS. Most sites need no changes at all: if yours uses none of these, update site-kit and rebuild. A site's `^7` range never picks up 8, so nothing forces the move before you next touch the site.
|
|
4
|
+
|
|
5
|
+
## Who's affected
|
|
6
|
+
|
|
7
|
+
Only sites that do one of these:
|
|
8
|
+
|
|
9
|
+
- Import from `@sonordev/site-kit/commerce` or `@sonordev/site-kit/commerce/server` (products, services, events, checkout, calendars).
|
|
10
|
+
- Import a commerce type from the root, such as `import type { CommerceOffering } from '@sonordev/site-kit'`.
|
|
11
|
+
- Turn on the opt-in `list_offerings` agent tool by passing `offerings` to `sonorMcpServer`. See [The MCP change](#the-mcp-change).
|
|
12
|
+
- Import one of the entries that were [removed](#what-was-removed): `@sonordev/site-kit/engage`, `/cms`, `/website/cms` (or their `/server` entries), or `ManagedContent`, `getManagedContentData` or `getContentBlock` from `/seo`.
|
|
13
|
+
|
|
14
|
+
Not sure which you are? Search the site for the old paths, then for root imports:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
grep -rnE "@sonordev/site-kit/(commerce|memberships|engage|cms|website/cms)" . \
|
|
18
|
+
--include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' \
|
|
19
|
+
--include='*.mjs' --include='*.cjs' --include='*.mts' --include='*.cts' --include='*.mdx' \
|
|
20
|
+
--exclude-dir=node_modules --exclude-dir=.next
|
|
21
|
+
|
|
22
|
+
grep -rnE "ManagedContent|getManagedContentData|getContentBlock" . \
|
|
23
|
+
--include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' --exclude-dir=node_modules --exclude-dir=.next
|
|
24
|
+
|
|
25
|
+
grep -rnE "from ['\"]@sonordev/site-kit['\"]" . \
|
|
26
|
+
--include='*.ts' --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The root entry is types-only (plus `SITE_KIT_VERSION`), so the last search turns up type imports. Look for the commerce types listed under [What moved](#what-moved) and the Engage type names under [What was removed](#what-was-removed). If the first two searches find nothing, none of the root imports are those types, and you don't pass `offerings` to `sonorMcpServer`, you're done: raise site-kit to `^8` whenever you like.
|
|
30
|
+
|
|
31
|
+
## Steps
|
|
32
|
+
|
|
33
|
+
### 1. Install both packages
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pnpm add @sonordev/site-kit@^8 @sonordev/commerce-kit
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`npm install @sonordev/site-kit@^8 @sonordev/commerce-kit` does the same. commerce-kit lists site-kit 8 or newer as a peer dependency, so it uses your site's one copy of site-kit. If your package manager reports that commerce-kit needs `@sonordev/site-kit >=8.0.0` (npm stops with an `ERESOLVE` error, pnpm and Yarn warn), site-kit is still on 7. Like site-kit, commerce-kit needs React 19. Next 16 is an optional peer: only the memberships server helpers use it.
|
|
40
|
+
|
|
41
|
+
### 2. Run the codemod
|
|
42
|
+
|
|
43
|
+
Dry run first:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx sonor-setup codemod --only site-kit-8
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
It prints what it would change and writes nothing. When the diff looks right, apply it:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx sonor-setup codemod --only site-kit-8 --write
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The codemod needs sonor-setup 7.3.0 or later, and `npx` fetches the latest. It reads source files anywhere in the project (`pages/`, `hooks/` and `scripts/` count, not just `app/` and `src/`), but not `node_modules`, build output or `public/`. It rewrites your imports (the table below). When your code imports commerce, it also adds `@sonordev/commerce-kit` to package.json and raises site-kit's range to `^8.0.0`, and if `pnpm-workspace.yaml` lists site-kit under `minimumReleaseAgeExclude` it adds commerce-kit there too. Anything it can't rewrite safely it flags, with the fix, so you can finish those by hand: a `require()` of an old path (commerce-kit is ESM only, so that call needs an `import`), an import of a [removed](#what-was-removed) entry, or a `sonorMcpServer` whose `offerings` has no reader (see [The MCP change](#the-mcp-change)). Run it in the app's folder: in a monorepo, once per app that imports commerce, because it stops at a workspace root.
|
|
56
|
+
|
|
57
|
+
`--check` is the gate: it exits 1 while a file needs rewriting and while a manual follow-up remains, so exit 0 means there's nothing left for you to do.
|
|
58
|
+
|
|
59
|
+
If it changed package.json, install before you build:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
No codemod handy? The swap is mechanical: replace the package name in each import and add commerce-kit to package.json. The subpath stays the same.
|
|
66
|
+
|
|
67
|
+
### 3. Build
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A build is the real test. Nothing is left behind at the old paths, so an import you missed fails with "Module not found" instead of quietly running something stale. A bump you didn't build is a guess.
|
|
74
|
+
|
|
75
|
+
## What moved
|
|
76
|
+
|
|
77
|
+
The subpath stays the same; only the package name changes.
|
|
78
|
+
|
|
79
|
+
| Was | Now |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `@sonordev/site-kit/commerce` | `@sonordev/commerce-kit/commerce` |
|
|
82
|
+
| `@sonordev/site-kit/commerce/server` | `@sonordev/commerce-kit/commerce/server` |
|
|
83
|
+
| `@sonordev/site-kit/memberships` | `@sonordev/commerce-kit/memberships` |
|
|
84
|
+
| `@sonordev/site-kit/memberships/server` | `@sonordev/commerce-kit/memberships/server` |
|
|
85
|
+
| Commerce types from the root, `@sonordev/site-kit` | `@sonordev/commerce-kit` |
|
|
86
|
+
|
|
87
|
+
Memberships never shipped in a site-kit release, so those two rows only matter if you tried an unreleased build. The root types are `CommerceOffering`, `CommerceCategory`, `CommerceVariant`, `CommerceSchedule`, `OfferingType`, `Cart`, `CartItem`, `EventCheckoutProps` and `CheckoutLineItem`.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
// before
|
|
91
|
+
import { OfferingCard, ProductPage } from '@sonordev/site-kit/commerce'
|
|
92
|
+
import { getOfferingBySlug } from '@sonordev/site-kit/commerce/server'
|
|
93
|
+
import type { CommerceOffering } from '@sonordev/site-kit'
|
|
94
|
+
|
|
95
|
+
// after
|
|
96
|
+
import { OfferingCard, ProductPage } from '@sonordev/commerce-kit/commerce'
|
|
97
|
+
import { getOfferingBySlug } from '@sonordev/commerce-kit/commerce/server'
|
|
98
|
+
import type { CommerceOffering } from '@sonordev/commerce-kit'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The new entries export what the old ones did, under the same names. `/commerce` is a client entry and `/commerce/server` is server code, the same split as before. commerce-kit's root is types-only, so import anything that runs from one of its module entries.
|
|
102
|
+
|
|
103
|
+
What stays where it was:
|
|
104
|
+
|
|
105
|
+
- **Your CSS.** The components keep their `site-kit-` class names (`site-kit-product-grid`, `site-kit-calendar-event` and the rest), so your styles still apply. Brand tokens still come from site-kit's `brand.css`, which your site imports as before.
|
|
106
|
+
- **Your credential.** commerce-kit uses the credential `SiteKitLayout` already publishes, so there's no new environment variable.
|
|
107
|
+
|
|
108
|
+
What's different besides the import path, all in [commerce-kit's changelog](https://sonor.dev/commerce-kit/changelog):
|
|
109
|
+
|
|
110
|
+
- The shopping events (`product_view`, `add_to_cart`, `begin_checkout`, `checkout_start` and `purchase`) reach Sonor. site-kit 7 reported them through a hook that returns nothing under `SiteKitLayout`, so they were never sent.
|
|
111
|
+
- The server helpers return whole offerings (gallery, size chart and options included), and they're server-only now. Each response is cached for 60 seconds under the `commerce` tag, which Sonor expires when you edit an offering, and a request gives up after 30 seconds. Pass `{ revalidate: 0 }` in the config if a page needs every request fresh.
|
|
112
|
+
- A product marked sold out in Sonor keeps its page, shown as unavailable, instead of answering "no such product".
|
|
113
|
+
- Checkout works in a browser set to block site data.
|
|
114
|
+
- When a server fetch fails, the log line starts with `[commerce-kit]` instead of `[site-kit/commerce]`. If you filter or alert on that prefix, update it.
|
|
115
|
+
|
|
116
|
+
## What was removed
|
|
117
|
+
|
|
118
|
+
These modules were retired in Sonor, and their entries were kept through 7.x so old imports kept building. They're gone in 8, and nothing replaces them:
|
|
119
|
+
|
|
120
|
+
| Removed | Use instead |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `@sonordev/site-kit/engage` | `@sonordev/site-kit/chat` and `@sonordev/site-kit/website/popups`. The 7 codemod (`npx sonor-setup codemod --write`) moves the names that have a home there and flags `EngageWidget`, which `SiteKitLayout` already mounts |
|
|
123
|
+
| `@sonordev/site-kit/cms`, `/cms/server`, `/website/cms`, `/website/cms/server` | Managed copy: `ManagedSlot`, `ManagedRichText`, `ManagedLink` and `ManagedList` from `@sonordev/site-kit/website/slots`. You can uninstall `@portabletext/react` and `@sanity/image-url` |
|
|
124
|
+
| `ManagedContent`, `getManagedContentData`, `getContentBlock` and their types, from `@sonordev/site-kit/seo` | `ManagedRichText` from `@sonordev/site-kit/website/slots` |
|
|
125
|
+
| `EngageElement`, `WidgetConfig`, `EngageConfig` and the other Engage type names, from the root | `SitePopup`, `SitePopupConfig` and the rest of `@sonordev/site-kit/website/popups`. (The `engage` prop on `SiteKitLayout` and its own `EngageConfig` type stay.) |
|
|
126
|
+
|
|
127
|
+
They rendered nothing in 7.x, so most sites never imported them and have nothing to do. `npx sonor-setup manifest --json` lists them under `removed`.
|
|
128
|
+
|
|
129
|
+
## The MCP change
|
|
130
|
+
|
|
131
|
+
`list_offerings` is the opt-in agent tool that lists priced products, services and events. It used to read the commerce fetchers directly. It takes its reader as an option now, so site-kit doesn't depend on commerce-kit:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
// before (site-kit 7)
|
|
135
|
+
sonorMcpServer({ businessName: 'Example Studio', offerings: { path: '/shop' } })
|
|
136
|
+
|
|
137
|
+
// after (site-kit 8)
|
|
138
|
+
import { getOfferingsResult } from '@sonordev/commerce-kit/commerce/server'
|
|
139
|
+
|
|
140
|
+
sonorMcpServer({ businessName: 'Example Studio', offerings: { path: '/shop', read: getOfferingsResult } })
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`read` is `getOfferingsResult` from `@sonordev/commerce-kit/commerce/server`. It reports a failed request as "the catalog is unavailable" instead of an empty catalog; the plain `getOfferings` from the same entry also works, but it reads an outage as empty. `path` is still optional and still defaults to `/shop`. The tool, how it ranks a query, and its rule that a price the business keeps private is never shown all stay in site-kit.
|
|
144
|
+
|
|
145
|
+
If `read` is missing, `sonorMcpServer` throws when the server is built, with a message that says what to pass. A TypeScript site sees the same reminder as a type error. A site that doesn't pass `offerings` changes nothing, and neither does `list_services`: it reads the site's core data, not commerce. See [MCP and agent tools](../src/mcp/README.md).
|
|
146
|
+
|
|
147
|
+
## Check your work
|
|
148
|
+
|
|
149
|
+
1. The first two searches from [Who's affected](#whos-affected) come back empty, and none of the root imports the last one finds are commerce or Engage types.
|
|
150
|
+
2. `pnpm build` passes.
|
|
151
|
+
3. `pnpm ls @sonordev/site-kit @sonordev/commerce-kit` (or `npm ls`) shows site-kit 8.x and commerce-kit 1.x.
|
|
152
|
+
4. On a preview deploy or in dev, load a product or events page and start a checkout.
|
|
153
|
+
5. `npx sonor-setup verify` still exits 0.
|
|
154
|
+
|
|
155
|
+
## Staying on 7.x
|
|
156
|
+
|
|
157
|
+
Staying on 7 is fine while you plan the move. A `^7` range never picks up 8, and everything in 7.4 keeps working, commerce included. Two things to know: commerce-kit needs site-kit 8, so a site on 7 can't install it, and the memberships module ships only in commerce-kit. If a dependency update raised your range to 8 before you were ready, pin it back with `pnpm add @sonordev/site-kit@^7.4.0`.
|
|
158
|
+
|
|
159
|
+
## Questions
|
|
160
|
+
|
|
161
|
+
### Why is commerce a separate package?
|
|
162
|
+
|
|
163
|
+
It versions and releases on its own. Checkout is the busiest money path on a site, and most sites don't sell anything, so a fix there shouldn't wait for a site-kit release (or the other way round). commerce-kit builds on site-kit and takes its transport, credential, analytics and server data from it instead of carrying copies. The one entry site-kit added for it, [`@sonordev/site-kit/runtime`](../src/runtime/README.md), is public API, and a site doesn't need to import it.
|
|
164
|
+
|
|
165
|
+
### Does this make my site's JavaScript smaller?
|
|
166
|
+
|
|
167
|
+
No, and it was never meant to. site-kit's root entry was already types-only and no core entry referenced commerce, so visitors to a site without commerce never downloaded any of it. For a site that does sell, the components are the same code, now built and shipped from commerce-kit. What shrinks is site-kit's package: about 8% fewer bytes to download and about 13% fewer on disk than 7.4.0, which is install size, not page weight.
|
|
168
|
+
|
|
169
|
+
### Why 8.0, and not a 7.x release with the old paths still working?
|
|
170
|
+
|
|
171
|
+
Removing a published entry is a breaking change, and a `^7` range would have picked it up on the next install. Keeping the old paths alive would have meant a second copy of the code, or site-kit depending on a package that depends back on it. It wouldn't have saved an edit either, since commerce-kit has to be added to package.json whichever way. (The retired Engage and CMS entries were promised for 8.0 in the 7.0, 7.1 and 7.2 notes, so they go with it.)
|
|
172
|
+
|
|
173
|
+
### Do my styles, environment variables or API key change?
|
|
174
|
+
|
|
175
|
+
No. The class names, the brand tokens and the credential are all as they were. See [What moved](#what-moved).
|
|
176
|
+
|
|
177
|
+
### Did anything else leave site-kit in 8.0?
|
|
178
|
+
|
|
179
|
+
Only [what was removed](#what-was-removed). Every other entry works as it did in 7.4, including the deprecated aliases for renamed modules (`./middleware`, `./sitemap`, `./robots`, `./redirects`, `./og`, `./llms`, `./images`, `./slots`, `./landing` and `./cta-bar`), because sites still import them. Earlier notes said those would go in 8.0; they stay, and will go in a later major once sites have moved off them. [Migrating to 7](MIGRATING-TO-7.md) lists them, and the codemod (`npx sonor-setup codemod --write`) that moves a site onto their new homes.
|
|
180
|
+
|
|
181
|
+
### Where are the commerce docs now?
|
|
182
|
+
|
|
183
|
+
At [sonor.dev/commerce-kit](https://sonor.dev/commerce-kit): [Commerce](https://sonor.dev/commerce-kit/commerce), [Memberships](https://sonor.dev/commerce-kit/memberships) and the [changelog](https://sonor.dev/commerce-kit/changelog).
|
package/docs.json
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
"$comment": "What sonor.dev renders for this package, in nav order. sonor.dev reads this file from the published tarball (latest on npm), so a release IS the docs deploy: add a page here and ship it in package.json `files`. scripts/verify-docs.cjs fails the publish if a listed file is missing from the pack.",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
4
|
"title": "site-kit",
|
|
5
|
-
"summary": "One package, one env var,
|
|
5
|
+
"summary": "One package, one env var, the Sonor modules a Next.js site needs: SEO, analytics, forms, articles, booking, chat, AI visibility, agent tools and motion. Commerce and memberships live in commerce-kit.",
|
|
6
6
|
"groups": [
|
|
7
7
|
{
|
|
8
8
|
"title": "Start here",
|
|
9
9
|
"pages": [
|
|
10
10
|
{ "slug": "", "title": "Overview", "file": "README.md" },
|
|
11
11
|
{ "slug": "migrating-to-7", "title": "Migrating to 7", "file": "docs/MIGRATING-TO-7.md" },
|
|
12
|
+
{ "slug": "migrating-to-8", "title": "Migrating to 8", "file": "docs/MIGRATING-TO-8.md" },
|
|
12
13
|
{ "slug": "agents", "title": "For coding agents", "file": "AGENTS.md" }
|
|
13
14
|
]
|
|
14
15
|
},
|
|
@@ -41,16 +42,10 @@
|
|
|
41
42
|
{ "slug": "chat", "title": "Website chat", "file": "src/chat/README.md" },
|
|
42
43
|
{ "slug": "popups", "title": "Popups and banners", "file": "src/website/README.md" },
|
|
43
44
|
{ "slug": "cta-bar", "title": "CTA bar", "file": "src/cta-bar/README.md" },
|
|
45
|
+
{ "slug": "booking", "title": "Booking", "file": "src/sync/README.md" },
|
|
44
46
|
{ "slug": "signal", "title": "Signal (A/B)", "file": "src/signal/README.md" }
|
|
45
47
|
]
|
|
46
48
|
},
|
|
47
|
-
{
|
|
48
|
-
"title": "Commerce",
|
|
49
|
-
"pages": [
|
|
50
|
-
{ "slug": "commerce", "title": "Commerce", "file": "src/commerce/README.md" },
|
|
51
|
-
{ "slug": "booking", "title": "Booking", "file": "src/sync/README.md" }
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
49
|
{
|
|
55
50
|
"title": "AI visibility",
|
|
56
51
|
"pages": [
|
|
@@ -62,6 +57,7 @@
|
|
|
62
57
|
"title": "More",
|
|
63
58
|
"pages": [
|
|
64
59
|
{ "slug": "motion", "title": "Motion", "file": "src/motion/README.md" },
|
|
60
|
+
{ "slug": "runtime", "title": "Building a kit", "file": "src/runtime/README.md" },
|
|
65
61
|
{ "slug": "admin-auth", "title": "Sign in with Sonor", "file": "src/admin-auth/README.md" }
|
|
66
62
|
]
|
|
67
63
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonordev/site-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "pnpm@11.5.3",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "The Sonor modules a Next.js site needs, from one package and one API key: SEO, analytics, forms, articles, chat, booking, AI visibility and agent tools. Selling online? Add @sonordev/commerce-kit.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"**/*.css"
|
|
14
14
|
],
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
|
-
"module": "./dist/index.
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"bin": {
|
|
19
19
|
"sonor-register-sitemap": "dist/seo/register-sitemap-cli.js"
|
|
@@ -43,10 +43,6 @@
|
|
|
43
43
|
"types": "./dist/analytics/index.d.ts",
|
|
44
44
|
"default": "./dist/analytics/index.js"
|
|
45
45
|
},
|
|
46
|
-
"./engage": {
|
|
47
|
-
"types": "./dist/engage/index.d.ts",
|
|
48
|
-
"default": "./dist/engage/index.js"
|
|
49
|
-
},
|
|
50
46
|
"./signal": {
|
|
51
47
|
"types": "./dist/signal/index.d.ts",
|
|
52
48
|
"default": "./dist/signal/index.js"
|
|
@@ -75,14 +71,6 @@
|
|
|
75
71
|
"types": "./dist/articles/server-ui.d.ts",
|
|
76
72
|
"default": "./dist/articles/server-ui.js"
|
|
77
73
|
},
|
|
78
|
-
"./commerce": {
|
|
79
|
-
"types": "./dist/commerce/index.d.ts",
|
|
80
|
-
"default": "./dist/commerce/index.js"
|
|
81
|
-
},
|
|
82
|
-
"./commerce/server": {
|
|
83
|
-
"types": "./dist/commerce/server.d.ts",
|
|
84
|
-
"default": "./dist/commerce/server.js"
|
|
85
|
-
},
|
|
86
74
|
"./sync": {
|
|
87
75
|
"types": "./dist/sync/index.d.ts",
|
|
88
76
|
"default": "./dist/sync/index.js"
|
|
@@ -207,14 +195,6 @@
|
|
|
207
195
|
"types": "./dist/website/slots/contract.d.ts",
|
|
208
196
|
"default": "./dist/website/slots/contract.js"
|
|
209
197
|
},
|
|
210
|
-
"./website/cms": {
|
|
211
|
-
"types": "./dist/website/cms.d.ts",
|
|
212
|
-
"default": "./dist/website/cms.js"
|
|
213
|
-
},
|
|
214
|
-
"./website/cms/server": {
|
|
215
|
-
"types": "./dist/website/cms/server.d.ts",
|
|
216
|
-
"default": "./dist/website/cms/server.js"
|
|
217
|
-
},
|
|
218
198
|
"./website/landing": {
|
|
219
199
|
"types": "./dist/website/landing.d.ts",
|
|
220
200
|
"default": "./dist/website/landing.js"
|
|
@@ -323,14 +303,6 @@
|
|
|
323
303
|
"types": "./dist/config/index.d.ts",
|
|
324
304
|
"default": "./dist/config/index.js"
|
|
325
305
|
},
|
|
326
|
-
"./cms": {
|
|
327
|
-
"types": "./dist/cms/index.d.ts",
|
|
328
|
-
"default": "./dist/cms/index.js"
|
|
329
|
-
},
|
|
330
|
-
"./cms/server": {
|
|
331
|
-
"types": "./dist/cms/server.d.ts",
|
|
332
|
-
"default": "./dist/cms/server.js"
|
|
333
|
-
},
|
|
334
306
|
"./maps": {
|
|
335
307
|
"types": "./dist/maps/index.d.ts",
|
|
336
308
|
"default": "./dist/maps/index.js"
|
|
@@ -355,6 +327,10 @@
|
|
|
355
327
|
"types": "./dist/client/index.d.ts",
|
|
356
328
|
"default": "./dist/client/index.js"
|
|
357
329
|
},
|
|
330
|
+
"./runtime": {
|
|
331
|
+
"types": "./dist/runtime/index.d.ts",
|
|
332
|
+
"default": "./dist/runtime/index.js"
|
|
333
|
+
},
|
|
358
334
|
"./brand.css": "./dist/brand.css",
|
|
359
335
|
"./forms/styles.css": "./dist/forms/styles.css",
|
|
360
336
|
"./forms/static": {
|
|
@@ -375,6 +351,7 @@
|
|
|
375
351
|
"docs.json",
|
|
376
352
|
"CHANGELOG.md",
|
|
377
353
|
"docs/MIGRATING-TO-7.md",
|
|
354
|
+
"docs/MIGRATING-TO-8.md",
|
|
378
355
|
"src/*/README.md"
|
|
379
356
|
],
|
|
380
357
|
"scripts": {
|
|
@@ -395,13 +372,15 @@
|
|
|
395
372
|
"typecheck": "tsc --noEmit",
|
|
396
373
|
"typecheck:setup": "tsc --noEmit -p packages/sonor-setup/tsconfig.json",
|
|
397
374
|
"version": "node scripts/sync-version.cjs && node scripts/gen-agent-manifest.cjs && git add src/shared/version.ts agent-manifest.json",
|
|
398
|
-
"prepublishOnly": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsup && pnpm build:types && node scripts/gen-agent-manifest.cjs && node scripts/verify-dts.cjs && node scripts/prepublish-integration.cjs && node scripts/audit-as-consumer.cjs && node scripts/verify-docs.cjs",
|
|
375
|
+
"prepublishOnly": "vitest run && tsc --noEmit -p packages/commerce-kit/tsconfig.json && rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsup && pnpm build:types && node scripts/gen-agent-manifest.cjs && node scripts/verify-dts.cjs && node scripts/verify-no-local-paths.cjs dist agent-manifest.json && node scripts/prepublish-integration.cjs && node scripts/audit-as-consumer.cjs && node scripts/verify-docs.cjs",
|
|
399
376
|
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly --noEmit false && node scripts/alias-dts.cjs",
|
|
400
|
-
"verify:docs": "node scripts/verify-docs.cjs"
|
|
377
|
+
"verify:docs": "node scripts/verify-docs.cjs",
|
|
378
|
+
"build:commerce": "node scripts/check-kit-build-order.cjs && NODE_OPTIONS=--max-old-space-size=8192 tsup --config packages/commerce-kit/tsup.config.ts && tsc -p packages/commerce-kit/tsconfig.build.json && node packages/commerce-kit/scripts/verify-dist.cjs && node packages/commerce-kit/scripts/verify-against-site-kit.cjs",
|
|
379
|
+
"test:commerce": "vitest run packages/commerce-kit && tsc --noEmit -p packages/commerce-kit/tsconfig.json",
|
|
380
|
+
"typecheck:commerce": "tsc --noEmit -p packages/commerce-kit/tsconfig.json",
|
|
381
|
+
"verify:docs:commerce": "node scripts/verify-docs.cjs packages/commerce-kit"
|
|
401
382
|
},
|
|
402
383
|
"peerDependencies": {
|
|
403
|
-
"@portabletext/react": "^8.0.0",
|
|
404
|
-
"@sanity/image-url": "^2.1.1",
|
|
405
384
|
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
406
385
|
"gsap": "^3.13.0",
|
|
407
386
|
"next": "^16.0.0",
|
|
@@ -422,12 +401,6 @@
|
|
|
422
401
|
"@vis.gl/react-google-maps": {
|
|
423
402
|
"optional": true
|
|
424
403
|
},
|
|
425
|
-
"@portabletext/react": {
|
|
426
|
-
"optional": true
|
|
427
|
-
},
|
|
428
|
-
"@sanity/image-url": {
|
|
429
|
-
"optional": true
|
|
430
|
-
},
|
|
431
404
|
"gsap": {
|
|
432
405
|
"optional": true
|
|
433
406
|
},
|
|
@@ -446,8 +419,6 @@
|
|
|
446
419
|
"@babel/parser": "^8.0.4",
|
|
447
420
|
"@babel/traverse": "^8.0.4",
|
|
448
421
|
"@babel/types": "^8.0.4",
|
|
449
|
-
"@portabletext/react": "^8.0.0",
|
|
450
|
-
"@sanity/image-url": "^2.1.1",
|
|
451
422
|
"@types/babel__generator": "^7.27.0",
|
|
452
423
|
"@types/babel__traverse": "^7.28.0",
|
|
453
424
|
"@types/inquirer": "^9.0.10",
|
|
@@ -480,7 +451,7 @@
|
|
|
480
451
|
"seo",
|
|
481
452
|
"analytics",
|
|
482
453
|
"forms",
|
|
483
|
-
"
|
|
454
|
+
"chat",
|
|
484
455
|
"articles",
|
|
485
456
|
"publishing",
|
|
486
457
|
"nextjs",
|
package/skills/site-kit/SKILL.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: site-kit
|
|
3
|
-
description: Integrate, upgrade, or debug a Next.js site's Sonor integration via @sonordev/site-kit. Use when wiring a site to Sonor, migrating a 2.x integration to 3.x, or diagnosing SSR/analytics/key issues on a site that installs @sonordev/site-kit. Trigger on "wire up Sonor", "connect this site to Sonor", "site-kit", "sonor-setup", "SiteKitLayout", "analytics bailout / CSR", or a failing `sonor-setup verify`.
|
|
3
|
+
description: Integrate, upgrade, or debug a Next.js site's Sonor integration via @sonordev/site-kit. Use when wiring a site to Sonor, migrating a 2.x integration to 3.x, or diagnosing SSR/analytics/key issues on a site that installs @sonordev/site-kit. Also use when moving a site to site-kit 8, or when adding commerce, events or memberships through @sonordev/commerce-kit. Trigger on "wire up Sonor", "connect this site to Sonor", "site-kit", "sonor-setup", "SiteKitLayout", "commerce-kit", "analytics bailout / CSR", or a failing `sonor-setup verify`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# @sonordev/site-kit
|
|
6
|
+
# @sonordev/site-kit: integration skill
|
|
7
7
|
|
|
8
8
|
You are integrating a Next.js site with Sonor using `@sonordev/site-kit`. The
|
|
9
9
|
package ships its own machine-readable contract; use it instead of guessing.
|
|
@@ -16,7 +16,7 @@ package ships its own machine-readable contract; use it instead of guessing.
|
|
|
16
16
|
(`verify`, `doctor`, `codemod`, `manifest`, `init`, `install`, `upgrade`)
|
|
17
17
|
prints ONE JSON envelope to stdout. Parse it; branch on `exitCode`/`checks`.
|
|
18
18
|
3. **Never let a command prompt.** Pass `--yes` (and `--api-key` to `init`) so it
|
|
19
|
-
runs non-interactively. Exit `3` means you're missing a flag
|
|
19
|
+
runs non-interactively. Exit `3` means you're missing a flag; the error's
|
|
20
20
|
`fix` names it.
|
|
21
21
|
4. **One env var: `SONOR_API_KEY`** (server-side, no `NEXT_PUBLIC_` prefix). Never
|
|
22
22
|
add `UPTRADE_*`, `NEXT_PUBLIC_SONOR_API_KEY`, or `SONOR_PROJECT_ID`.
|
|
@@ -25,7 +25,7 @@ package ships its own machine-readable contract; use it instead of guessing.
|
|
|
25
25
|
anywhere below the fold; `./motion/gsap` and `./motion/three` need their
|
|
26
26
|
peer installed first (`npm i gsap` / `npm i three`). Never wrap page
|
|
27
27
|
content in a `dynamic(ssr:false)` component and never animate the hero
|
|
28
|
-
in
|
|
28
|
+
in; the server HTML must stay fully visible. See `src/motion/README.md`.
|
|
29
29
|
6. **The sticky mobile CTA bar comes from `@sonordev/site-kit/cta-bar`, never a
|
|
30
30
|
per-site `MobileCTABar`.** Render `<CtaBar>` once per page (the layout root
|
|
31
31
|
for a site-wide bar, inside the page for a page-specific one), with
|
|
@@ -33,8 +33,17 @@ package ships its own machine-readable contract; use it instead of guessing.
|
|
|
33
33
|
own bar, its body `padding-bottom`, and any `--sk-echo-offset-bottom` rule
|
|
34
34
|
written for it: the kit reserves the space and lifts the Echo launcher.
|
|
35
35
|
See `src/cta-bar/README.md`.
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
7. **Commerce, events and memberships come from `@sonordev/commerce-kit`, not
|
|
37
|
+
site-kit (since site-kit 8).** Install it beside site-kit with
|
|
38
|
+
`npm i @sonordev/commerce-kit` and import from
|
|
39
|
+
`@sonordev/commerce-kit/commerce`, `/commerce/server`, `/memberships` or
|
|
40
|
+
`/memberships/server`. The old site-kit commerce entries are gone, and
|
|
41
|
+
`npx sonor-setup manifest --json` lists every moved subpath under
|
|
42
|
+
`relocated`, the root types that moved under `relocatedTypes`, and what was
|
|
43
|
+
retired for good (Engage, the CMS, content blocks) under `removed`.
|
|
44
|
+
Docs: https://sonor.dev/commerce-kit.
|
|
45
|
+
|
|
46
|
+
## First step: discover, don't assume
|
|
38
47
|
|
|
39
48
|
```bash
|
|
40
49
|
cat node_modules/@sonordev/site-kit/AGENTS.md # human-skimmable guide
|
|
@@ -55,7 +64,7 @@ npx sonor-setup verify --json
|
|
|
55
64
|
|
|
56
65
|
```bash
|
|
57
66
|
npx sonor-setup codemod --check --json # exit 1 ⇒ work pending
|
|
58
|
-
npx sonor-setup codemod --write --json # apply (idempotent;
|
|
67
|
+
npx sonor-setup codemod --write --json # apply (idempotent; originals go to a temp folder). Review the diff.
|
|
59
68
|
next build # a bump you didn't build is a guess
|
|
60
69
|
npx sonor-setup verify --json
|
|
61
70
|
```
|
|
@@ -69,22 +78,43 @@ Codemod transforms: `provider-to-layout` (SiteKitProvider→SiteKitLayout),
|
|
|
69
78
|
(flags an `<AnalyticsProvider>` wrapped around `{children}`; remove it by hand.
|
|
70
79
|
A plain `<SiteKitLayout>{children}</SiteKitLayout>` is correct and isn't flagged).
|
|
71
80
|
|
|
81
|
+
## Move a 7.x site that sells to site-kit 8
|
|
82
|
+
|
|
83
|
+
Commerce left site-kit in 8.0 (memberships is new, and ships only in
|
|
84
|
+
commerce-kit). A site that doesn't use commerce needs nothing but the version bump.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm i @sonordev/site-kit@^8 @sonordev/commerce-kit
|
|
88
|
+
npx sonor-setup codemod --only site-kit-8 --check --json # exit 1 ⇒ imports still to move
|
|
89
|
+
npx sonor-setup codemod --only site-kit-8 --write --json # swaps the package name in each import
|
|
90
|
+
next build
|
|
91
|
+
npx sonor-setup verify --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
It rewrites the imports, adds `@sonordev/commerce-kit` to package.json, raises
|
|
95
|
+
site-kit's range to `^8.0.0` and flags what it can't rewrite. A site that passes
|
|
96
|
+
`offerings` to `sonorMcpServer` also needs `read: getOfferingsResult`, imported from
|
|
97
|
+
`@sonordev/commerce-kit/commerce/server`. See `docs/MIGRATING-TO-8.md`.
|
|
98
|
+
|
|
72
99
|
## Debug a red integration
|
|
73
100
|
|
|
74
101
|
Run `npx sonor-setup doctor --online --json` (or `verify`). Each `checks[]`
|
|
75
102
|
finding has a stable `id`, a `fix`, and often a `fixCommand`. Highest-signal ids:
|
|
76
103
|
|
|
77
|
-
- `ssr.render
|
|
104
|
+
- `ssr.render`: page bailed to client rendering. On site-kit ≥3.0.2 a plain
|
|
78
105
|
`SiteKitLayout` is never the cause: it already mounts analytics as a
|
|
79
106
|
deferred, childless sibling, so don't reach for `analytics={false}`. Find
|
|
80
107
|
what else wraps `{children}` (usually a `next/dynamic({ ssr: false })`
|
|
81
108
|
component, often the site's own Providers) and import it statically or mount
|
|
82
109
|
it as a childless sibling. On <3.0.2, upgrade. Confirm with
|
|
83
110
|
`verify --url <url>`.
|
|
84
|
-
- `key.valid
|
|
111
|
+
- `key.valid`: key rejected/stale. Put the current `sonor_` key in `.env.local`
|
|
85
112
|
and redeploy (hosts don't pick up env changes without a redeploy).
|
|
86
|
-
- `middleware.netlify
|
|
113
|
+
- `middleware.netlify`: `middleware.ts` sets `runtime: 'nodejs'`, which
|
|
87
114
|
`proxy.ts` rejects. Remove the export, then run the codemod to move it.
|
|
88
|
-
- `layout.sitekit
|
|
115
|
+
- `layout.sitekit`: deprecated `SiteKitProvider`; run the codemod.
|
|
116
|
+
- A build that can't resolve a site-kit commerce path: the site is on site-kit 8,
|
|
117
|
+
where commerce moved to `@sonordev/commerce-kit`. Run the site-kit 8 steps
|
|
118
|
+
above.
|
|
89
119
|
|
|
90
120
|
Apply fixes, then re-run `verify --json`. Done when it exits 0.
|
package/src/analytics/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Analytics
|
|
1
|
+
# Analytics: `@sonordev/site-kit/analytics`
|
|
2
2
|
|
|
3
3
|
Automatic page view tracking, custom events, conversions, scroll depth, heatmap clicks, and Core Web Vitals. All data flows through the Sonor API.
|
|
4
4
|
|
|
@@ -157,22 +157,22 @@ interface AnalyticsConfig {
|
|
|
157
157
|
trackScrollDepth?: boolean // Default: true
|
|
158
158
|
sessionTimeout?: number // Minutes (default: 30)
|
|
159
159
|
excludePaths?: string[] // Don't track these paths
|
|
160
|
-
allowInFrame?: boolean // Default: false
|
|
161
|
-
allowLocalhost?: boolean // Default: false
|
|
160
|
+
allowInFrame?: boolean // Default: false (see below)
|
|
161
|
+
allowLocalhost?: boolean // Default: false (local builds report nothing)
|
|
162
162
|
debug?: boolean // Log events to console
|
|
163
163
|
}
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
## What Gets Tracked Automatically
|
|
167
167
|
|
|
168
|
-
- **Page views
|
|
169
|
-
- **Web Vitals
|
|
170
|
-
- **Contact clicks
|
|
171
|
-
- **DOM metadata
|
|
168
|
+
- **Page views**: on every route change (path, URL, title, referrer, UTM params, device/browser/OS)
|
|
169
|
+
- **Web Vitals**: LCP, CLS, TTFB, INP, FCP with good/needs-improvement/poor ratings
|
|
170
|
+
- **Contact clicks**: `tel:` and `mailto:` links tracked as conversions, once `<ContactTracking />` is mounted (it isn't by default)
|
|
171
|
+
- **DOM metadata**: full snapshot per page view (meta tags, H1, word count, links, content, FAQs)
|
|
172
172
|
|
|
173
173
|
## Embedded pages report nothing (`analytics.allowInFrame`)
|
|
174
174
|
|
|
175
|
-
When this site is loaded inside a **cross-origin iframe**, nothing is sent
|
|
175
|
+
When this site is loaded inside a **cross-origin iframe**, nothing is sent:
|
|
176
176
|
no page views, journey/session rows, scroll depth, heatmap clicks, web vitals,
|
|
177
177
|
events or conversions. The visitor is on whoever framed the page, not on this
|
|
178
178
|
site, so every metric the frame produces is phantom traffic in the analytics
|
|
@@ -189,8 +189,8 @@ the pixels, not the JavaScript.
|
|
|
189
189
|
a print view, an on-domain booking frame) has a real visitor really on that
|
|
190
190
|
site and no other tenant to pollute.
|
|
191
191
|
|
|
192
|
-
Opt back in only when the frame IS the product
|
|
193
|
-
page deliberately distributed as an embed:
|
|
192
|
+
Opt back in only when the frame IS the product (a widget or partner-hosted
|
|
193
|
+
page deliberately distributed as an embed):
|
|
194
194
|
|
|
195
195
|
```tsx
|
|
196
196
|
<SiteKitLayout analytics={{ allowInFrame: true }}>…</SiteKitLayout>
|
|
@@ -199,7 +199,7 @@ page deliberately distributed as an embed:
|
|
|
199
199
|
There is deliberately no env var or window global for this. A silent switch
|
|
200
200
|
that turns cross-tenant tracking back on is the failure mode, not the feature.
|
|
201
201
|
|
|
202
|
-
The decision lives in one place
|
|
202
|
+
The decision lives in one place, `shared/reporting-gate.ts`, over the frame
|
|
203
203
|
primitive in `shared/frame.ts`. Every send in the module routes through it, and
|
|
204
204
|
`send-gate.test.ts` fails the build if a new one does not. `isCrossOriginFrame()`
|
|
205
205
|
is exported from `@sonordev/site-kit/analytics` if a site needs the same answer
|
|
@@ -229,8 +229,8 @@ Neither option bypasses authentication. No environment variable or global
|
|
|
229
229
|
silently enables local reporting.
|
|
230
230
|
|
|
231
231
|
This is a browser gate: build-time `createSitemap` and Node fleet reporting
|
|
232
|
-
still run. It doesn't disable forms,
|
|
233
|
-
modules locally, point them at a test API as well.
|
|
232
|
+
still run. It doesn't disable forms, Signal, or [commerce-kit](https://sonor.dev/commerce-kit).
|
|
233
|
+
When verifying those modules locally, point them at a test API as well.
|
|
234
234
|
|
|
235
235
|
## Environment
|
|
236
236
|
|
|
@@ -257,6 +257,6 @@ site without forcing each microsite into its own Sonor project.
|
|
|
257
257
|
</SiteKitLayout>
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
Most projects leave it implicit
|
|
260
|
+
Most projects leave it implicit: `NEXT_PUBLIC_SITE_URL` is already set per
|
|
261
261
|
microsite, so the dimension fills in automatically. The dashboard shows a
|
|
262
262
|
"Site" picker + a "Sites" tab as soon as ≥2 distinct hosts are detected.
|
package/src/chat/README.md
CHANGED
|
@@ -46,7 +46,7 @@ interface SiteChatProps {
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Through `SiteKitLayout`, the placement options go in `chat={{ ... }}`. The
|
|
49
|
-
deprecated `engage={{ ... }}` still works
|
|
49
|
+
deprecated `engage={{ ... }}` still works; it goes in a later major.
|
|
50
50
|
|
|
51
51
|
## The chat switch
|
|
52
52
|
|
|
@@ -233,10 +233,10 @@ interface ChatConfig {
|
|
|
233
233
|
Popups, banners and toasts are their own module now:
|
|
234
234
|
[Popups and banners](../website/README.md) (`@sonordev/site-kit/website/popups`).
|
|
235
235
|
|
|
236
|
-
##
|
|
236
|
+
## Engage (retired)
|
|
237
237
|
|
|
238
|
-
Engage was retired in Sonor
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(`DesignRenderer`) is gone; popups render from blocks.
|
|
242
|
-
|
|
238
|
+
Engage was retired in Sonor, and `@sonordev/site-kit/engage` was removed in
|
|
239
|
+
site-kit 8. `ChatWidget` and the chat types are here, popups are in
|
|
240
|
+
`@sonordev/site-kit/website/popups`, and `SiteKitLayout` mounts both for you.
|
|
241
|
+
Engage Studio's renderer (`DesignRenderer`) is gone; popups render from blocks.
|
|
242
|
+
`npx sonor-setup codemod --write` moves the names that have a home.
|