@sonordev/site-kit 7.4.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 +67 -0
- package/README.md +44 -18
- package/agent-manifest.json +111 -56
- package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
- package/dist/{ArticleViewTracker-3DH53RSB.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
- package/dist/{BlocksPopup-FGWYVHCH.js → BlocksPopup-GFX3GZIK.js} +6 -5
- package/dist/{ChatWidget-CDQZCLVH.js → ChatWidget-DVS7MLBN.js} +8 -5
- package/dist/{FileField-IPJ7L2W6.js → FileField-DVN7NUBI.js} +5 -5
- package/dist/{FormSpotlight-CQI2DBWI.js → FormSpotlight-W4SXKKO6.js} +3 -3
- package/dist/{FormStage-4WHD6ED4.js → FormStage-JTEE5MZD.js} +3 -3
- package/dist/ManagedForm-ZAUHIHGP.js +19 -0
- package/dist/{ManagedNewsletterForm-3D2BK3KQ.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
- package/dist/{SignalCore-HEQYITTM.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.js +3 -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-3E3PPSNR.js → chunk-56VDS2RP.js} +2 -2
- package/dist/chunk-5ROTTMBL.js +19 -0
- package/dist/{chunk-KHQ5GD6T.js → chunk-5S2XDG5O.js} +1 -1
- package/dist/chunk-5TM3WPCI.js +7 -0
- package/dist/{chunk-7HPZSWS4.js → chunk-6CJGZFOU.js} +1 -1
- package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
- package/dist/{chunk-FUQTV5O6.js → chunk-6QFINXLH.js} +3 -3
- package/dist/{chunk-AH4AXO4P.js → chunk-6ZXJ3SXR.js} +1 -1
- package/dist/{chunk-XA2BNW5M.js → chunk-7YEEOIWI.js} +1 -1
- package/dist/{chunk-IE5SSOCN.js → chunk-BQ2CXKTQ.js} +3 -11
- package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
- package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
- package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
- package/dist/{chunk-OOD6GMT4.js → chunk-GNSXOTIK.js} +6 -4
- package/dist/{chunk-EHR4NIMX.js → chunk-ICAVVF6D.js} +3 -3
- package/dist/{chunk-MHGAZ3LL.js → chunk-IJQ767JS.js} +3 -5
- package/dist/{chunk-CKW4HFJG.js → chunk-J65N34YM.js} +3 -3
- package/dist/{chunk-4BHRA7TI.js → chunk-JIH32RH2.js} +3 -3
- package/dist/{chunk-D2RGEWHS.js → chunk-K22OLAPC.js} +2 -2
- package/dist/{chunk-CG4ETW5Y.js → chunk-KRBBH64S.js} +3 -3
- package/dist/{chunk-JRCNUUNG.js → chunk-LBIQ5LTC.js} +1 -1
- package/dist/{chunk-MDP7EB4J.js → chunk-LKH44GI3.js} +5 -5
- package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
- package/dist/{chunk-5O62CER4.js → chunk-M62U7TJF.js} +1 -1
- package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
- package/dist/{chunk-4DJMJ4V5.js → chunk-OE3NXEOF.js} +1 -1
- package/dist/{chunk-AV4QAK5F.js → chunk-OGK7OL3T.js} +5 -4
- package/dist/{chunk-YCFW2OQO.js → chunk-PD7K54EQ.js} +2 -2
- package/dist/{chunk-PF64OEXC.js → chunk-PIX7FAMX.js} +2 -2
- package/dist/{chunk-XEMHGJEG.js → chunk-ROAOI6GG.js} +10 -10
- package/dist/{chunk-6LLTLLEJ.js → chunk-S7SSYGUJ.js} +6 -5
- package/dist/{chunk-ATE6IFVK.js → chunk-SBPAXWLF.js} +1 -1
- package/dist/{chunk-DA5XC7Y6.js → chunk-TOSZGJEQ.js} +1 -1
- package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
- package/dist/{chunk-ZTLU3BSW.js → chunk-TZ5RTANX.js} +2 -2
- package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
- package/dist/{chunk-CSN45MHO.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-PQDJNIHR.js → chunk-ZHNQFNO3.js} +2 -2
- package/dist/chunk-ZKADJNR2.js +52 -0
- package/dist/{chunk-GK7TV7EK.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 +13 -11
- package/dist/llms/index.js +7 -6
- package/dist/maps/index.js +6 -6
- package/dist/mcp/sonor.d.ts +47 -3
- package/dist/mcp/sonor.js +30 -20
- package/dist/proxy/index.d.ts +3 -3
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/index.js +3 -2
- package/dist/reputation/server.js +2 -1
- 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 +7 -6
- 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 +4 -3
- package/dist/seo/types.d.ts +9 -30
- package/dist/server/index.d.ts +8 -1
- package/dist/server/index.js +4 -3
- package/dist/server/mint-site-token.d.ts +0 -11
- 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/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 +4 -3
- 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-OL4KQERZ.js → writeLLMsTxt-UZGN6IBU.js} +3 -2
- 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/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-BQXV3ZF3.js +0 -11
- package/dist/ManagedForm-7FZNH4L2.js +0 -16
- package/dist/SiteChat-DMPDXY3W.js +0 -5
- package/dist/SiteDesignReporter-Y2IOJE52.js +0 -11
- package/dist/SitePopups-HD2LDKVU.js +0 -10
- package/dist/SitemapSync-OKPZHRX6.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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @sonordev/site-kit/shared — where the analytics identity is kept.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for the `_sk_*` storage keys and for the in-memory
|
|
5
|
+
* fallback the writer (identity.tsx) and the reader (identity-reader.ts)
|
|
6
|
+
* share:
|
|
7
|
+
*
|
|
8
|
+
* localStorage: _sk_vid (visitor ID, kept across visits)
|
|
9
|
+
* sessionStorage: _sk_sid (session ID, per tab)
|
|
10
|
+
* sessionStorage: _sk_stime (last activity, for the inactivity timeout)
|
|
11
|
+
*
|
|
12
|
+
* Kept this small on purpose: analytics loads on every page of every site,
|
|
13
|
+
* and it shares this module with the forms, popups and runtime bundles. What
|
|
14
|
+
* only they use, the reader, lives in its own module so analytics doesn't
|
|
15
|
+
* download it.
|
|
16
|
+
*/
|
|
17
|
+
/** localStorage: the visitor id, kept across visits. */
|
|
18
|
+
export declare const VISITOR_ID_KEY = "_sk_vid";
|
|
19
|
+
/** sessionStorage: the session id, per tab. */
|
|
20
|
+
export declare const SESSION_ID_KEY = "_sk_sid";
|
|
21
|
+
/** sessionStorage: last activity, for the session's inactivity timeout. */
|
|
22
|
+
export declare const SESSION_TIME_KEY = "_sk_stime";
|
|
23
|
+
/**
|
|
24
|
+
* The ids for this page load when storage can't hold them (privacy settings,
|
|
25
|
+
* a sandboxed frame). Written only by get-or-create in identity.tsx.
|
|
26
|
+
*/
|
|
27
|
+
export declare const memoryIdentity: {
|
|
28
|
+
visitorId: string;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @sonordev/site-kit/shared — Unified Identity Management
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Creates the visitor and session ids that Analytics, Signal, chat and popups
|
|
5
|
+
* share, and the hook that reads them. The storage keys and the in-memory
|
|
6
|
+
* fallback live in identity-storage.ts (the single source of truth for where
|
|
7
|
+
* the ids are kept); the read-only reader is identity-reader.ts.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Storage keys are prefixed with `_sk_*`.
|
|
9
|
+
* When the browser blocks storage (privacy settings, a sandboxed frame), the
|
|
10
|
+
* ids live in memory for this page load instead. That matters because these
|
|
11
|
+
* functions run DURING RENDER (SiteKitClientProviders), where a throw takes
|
|
12
|
+
* the whole page down; same reason shared/uuid.ts never throws.
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
* Get or create a persistent visitor ID
|
|
16
|
-
*
|
|
15
|
+
* Get or create a persistent visitor ID, stored in localStorage under
|
|
16
|
+
* `_sk_vid`. Never throws.
|
|
17
17
|
*/
|
|
18
18
|
export declare function getOrCreateVisitorId(): string;
|
|
19
19
|
/**
|
|
20
|
-
* Get or create a session ID
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* Get or create a session ID, stored in sessionStorage under `_sk_sid`. The
|
|
21
|
+
* session expires after `timeoutMinutes` of inactivity (default 30). Never
|
|
22
|
+
* throws.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getOrCreateSessionId(timeoutMinutes?: number): string;
|
|
25
25
|
export interface SiteKitIdentity {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The module specifiers a piece of code imports, and what an isomorphic entry
|
|
3
|
+
* may not import: the one definition behind both the source-level boundary
|
|
4
|
+
* checks (./boundary-graph.ts) and the built-chunk check
|
|
5
|
+
* (scripts/kit-post-build.ts), which had each grown their own copy.
|
|
6
|
+
*
|
|
7
|
+
* Test and build infrastructure: nothing ships from here (tsconfig.build.json
|
|
8
|
+
* leaves it out of the declarations, and no entry reaches it).
|
|
9
|
+
*
|
|
10
|
+
* Callers strip comments (and type-only imports, where erased imports don't
|
|
11
|
+
* count) first; a comment that names an import is not an import.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Every specifier `code` imports, in the order they appear, without a query or
|
|
15
|
+
* hash a bundler would strip (`./server?raw` is `./server`).
|
|
16
|
+
*/
|
|
17
|
+
export declare function importSpecifiers(code: string): string[];
|
|
18
|
+
/**
|
|
19
|
+
* A specifier an isomorphic entry's graph must not import: React, Next or
|
|
20
|
+
* `server-only` (hooks, a client reference, or a hard error on the other
|
|
21
|
+
* side), and any site-kit entry but `./runtime`, which is isomorphic by design
|
|
22
|
+
* (the others are `'use client'` or server-only: `./analytics`, `./server`...).
|
|
23
|
+
* Matches by package name, so a subpath (`react/jsx-runtime`, `next/headers`)
|
|
24
|
+
* counts.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isNotIsomorphicSpecifier(spec: string): boolean;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* @sonordev/site-kit shared - Canonical client transport
|
|
3
3
|
*
|
|
4
4
|
* Single source of truth for how site-kit talks to Sonor from the browser.
|
|
5
|
-
* Every client-side module (analytics, forms,
|
|
6
|
-
* SitemapSync) routes through here instead of bare fetch(),
|
|
7
|
-
*
|
|
5
|
+
* Every client-side module (analytics, forms, engage, maps, images,
|
|
6
|
+
* SitemapSync) routes through here instead of bare fetch(), and so do the kits
|
|
7
|
+
* that build on site-kit (commerce-kit), through `@sonordev/site-kit/runtime`.
|
|
8
|
+
* That gives the whole kit family, in one place:
|
|
8
9
|
*
|
|
9
10
|
* - per-attempt timeout + retry with backoff (via fetchWithRetry) — a hung
|
|
10
11
|
* request left to the browser's own network timeout logs a console error
|
package/dist/shared/version.d.ts
CHANGED
package/dist/signal/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useSignalExperiment, useSignalEvent } from '../chunk-
|
|
3
|
-
export { SignalBridge, useSignal, useSignalConfig, useSignalEvent, useSignalExperiment, useSignalOutcome } from '../chunk-
|
|
2
|
+
import { useSignalExperiment, useSignalEvent } from '../chunk-6ZXJ3SXR.js';
|
|
3
|
+
export { SignalBridge, useSignal, useSignalConfig, useSignalEvent, useSignalExperiment, useSignalOutcome } from '../chunk-6ZXJ3SXR.js';
|
|
4
4
|
import '../chunk-PKBMQBKP.js';
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
package/dist/sitemap/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-
|
|
1
|
+
export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-OE3NXEOF.js';
|
|
2
|
+
import '../chunk-TZ5RTANX.js';
|
|
3
|
+
import '../chunk-JIH32RH2.js';
|
|
2
4
|
import '../chunk-Z22QVHT4.js';
|
|
3
|
-
import '../chunk-ZTLU3BSW.js';
|
|
4
|
-
import '../chunk-4BHRA7TI.js';
|
|
5
5
|
import '../chunk-L5UOHS6E.js';
|
|
6
6
|
import '../chunk-WMVK77ND.js';
|
|
7
7
|
import '../chunk-UAYAJPEP.js';
|
|
@@ -12,4 +12,5 @@ import '../chunk-YVKRYQRG.js';
|
|
|
12
12
|
import '../chunk-DIKNRN34.js';
|
|
13
13
|
import '../chunk-FESKKJAS.js';
|
|
14
14
|
import '../chunk-A4CC4ZG3.js';
|
|
15
|
+
import '../chunk-3G7YABRA.js';
|
|
15
16
|
import '../chunk-PKBMQBKP.js';
|
package/dist/slots/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-
|
|
1
|
+
export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-3RDJKIYO.js';
|
|
2
2
|
export { SLOTS_CONTRACT_VERSION, signSlotContent, slotSigningPayload, verifySlotContent } from '../chunk-VCJYLYJV.js';
|
|
3
3
|
export { SLOT_CONTENT_MAX_LENGTH, SLOT_CONTENT_TYPES, SLOT_ID_PATTERN, SLOT_LIST_MAX_ITEMS, isSafeSlotHref, isValidSlotId, normalizeSlotValue, parseSlotRichText } from '../chunk-LPH5FANE.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-6KU7STM3.js';
|
|
5
|
+
import '../chunk-C7TLGL3R.js';
|
|
6
6
|
import '../chunk-MH2DSGC6.js';
|
|
7
7
|
import '../chunk-PKBMQBKP.js';
|
package/dist/sync/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { BookingWidget } from '../chunk-
|
|
2
|
-
export { createBooking, createSlotHold, detectTimezone, fetchAvailability, fetchAvailableDates, fetchBookingTypeDetails, fetchBookingTypes, formatDate, formatDuration, formatTime, prepareMeeting, releaseSlotHold } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
1
|
+
export { BookingWidget } from '../chunk-OGK7OL3T.js';
|
|
2
|
+
export { createBooking, createSlotHold, detectTimezone, fetchAvailability, fetchAvailableDates, fetchBookingTypeDetails, fetchBookingTypes, formatDate, formatDuration, formatTime, prepareMeeting, releaseSlotHold } from '../chunk-IJQ767JS.js';
|
|
3
|
+
import '../chunk-3G7YABRA.js';
|
|
4
|
+
import '../chunk-56VDS2RP.js';
|
|
5
|
+
import '../chunk-ZLFGXKLG.js';
|
|
6
|
+
import '../chunk-5S2XDG5O.js';
|
|
6
7
|
import '../chunk-PKBMQBKP.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -16,6 +16,5 @@ export * from './seo/types';
|
|
|
16
16
|
export * from './analytics/types';
|
|
17
17
|
export * from './chat/types';
|
|
18
18
|
export * from './website/popup-types';
|
|
19
|
-
export type { EngageAnalytics, EngageConfig, EngageElement, TargetingRules, TriggerConfig, WidgetConfig, WidgetType } from './engage/types';
|
|
20
19
|
export * from './forms/types';
|
|
21
20
|
export * from './articles/types';
|
package/dist/website/cta-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CTA_BAR_BREAKPOINTS, CTA_BAR_SPACE, CtaBar, CtaBarAction, ECHO_CLEARANCE } from '../chunk-LNSNA3W4.js';
|
|
2
2
|
import '../chunk-UPFU63L4.js';
|
|
3
|
-
import '../chunk-LCDVPAMR.js';
|
|
4
3
|
import '../chunk-JE4A5S4F.js';
|
|
4
|
+
import '../chunk-LCDVPAMR.js';
|
|
5
5
|
import '../chunk-PKBMQBKP.js';
|
package/dist/website/images.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-
|
|
1
|
+
export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-TOSZGJEQ.js';
|
|
2
2
|
export { ManagedFavicon, getManagedFaviconUrl } from '../chunk-GW7GSBO7.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-56VDS2RP.js';
|
|
4
|
+
import '../chunk-ZLFGXKLG.js';
|
|
5
|
+
import '../chunk-5S2XDG5O.js';
|
|
6
6
|
import '../chunk-PKBMQBKP.js';
|
package/dist/website/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { SiteDesignReporter } from '../chunk-
|
|
3
|
-
export { SITE_DESIGN_PATH, cleanFontStack, colorToHex, getSiteDesignTokens, measureSiteDesign, readDeclaredDesign, sendSiteDesign } from '../chunk-
|
|
2
|
+
export { SiteDesignReporter } from '../chunk-ZHNQFNO3.js';
|
|
3
|
+
export { SITE_DESIGN_PATH, cleanFontStack, colorToHex, getSiteDesignTokens, measureSiteDesign, readDeclaredDesign, sendSiteDesign } from '../chunk-KRBBH64S.js';
|
|
4
4
|
export { DEFAULT_POPUP_TOKENS, PopupBlocks } from '../chunk-BF7TZYC3.js';
|
|
5
5
|
import '../chunk-IHG36STL.js';
|
|
6
6
|
import '../chunk-YC7ELZS3.js';
|
|
7
7
|
import '../chunk-S22FSH7C.js';
|
|
8
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-CAH4Y4PY.js';
|
|
9
9
|
import '../chunk-EKBEOXTH.js';
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-3G7YABRA.js';
|
|
11
|
+
import '../chunk-56VDS2RP.js';
|
|
12
|
+
import '../chunk-ZLFGXKLG.js';
|
|
13
|
+
import '../chunk-5S2XDG5O.js';
|
|
13
14
|
import '../chunk-PKBMQBKP.js';
|
package/dist/website/popups.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
export { SitePopups } from '../chunk-S7SSYGUJ.js';
|
|
3
|
+
import '../chunk-27FISYK4.js';
|
|
2
4
|
export { DEFAULT_POPUP_TOKENS, PopupBlocks } from '../chunk-BF7TZYC3.js';
|
|
3
5
|
import '../chunk-IHG36STL.js';
|
|
4
|
-
|
|
5
|
-
import '../chunk-27FISYK4.js';
|
|
6
|
+
import '../chunk-5ROTTMBL.js';
|
|
6
7
|
import '../chunk-S22FSH7C.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-ZKADJNR2.js';
|
|
9
|
+
import '../chunk-5TM3WPCI.js';
|
|
8
10
|
import '../chunk-GJWI74ZZ.js';
|
|
9
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-CAH4Y4PY.js';
|
|
10
12
|
import '../chunk-EKBEOXTH.js';
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-3G7YABRA.js';
|
|
14
|
+
import '../chunk-56VDS2RP.js';
|
|
15
|
+
import '../chunk-ZLFGXKLG.js';
|
|
16
|
+
import '../chunk-5S2XDG5O.js';
|
|
14
17
|
import '../chunk-PKBMQBKP.js';
|
package/dist/website/slots.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-
|
|
1
|
+
export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-3RDJKIYO.js';
|
|
2
2
|
export { SLOTS_CONTRACT_VERSION, signSlotContent, slotSigningPayload, verifySlotContent } from '../chunk-VCJYLYJV.js';
|
|
3
3
|
export { SLOT_CONTENT_MAX_LENGTH, SLOT_CONTENT_TYPES, SLOT_ID_PATTERN, SLOT_LIST_MAX_ITEMS, isSafeSlotHref, isValidSlotId, normalizeSlotValue, parseSlotRichText } from '../chunk-LPH5FANE.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-6KU7STM3.js';
|
|
5
|
+
import '../chunk-C7TLGL3R.js';
|
|
6
6
|
import '../chunk-MH2DSGC6.js';
|
|
7
7
|
import '../chunk-PKBMQBKP.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { writeLLMsTxtToPublic } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { writeLLMsTxtToPublic } from './chunk-TZ5RTANX.js';
|
|
2
|
+
import './chunk-JIH32RH2.js';
|
|
3
3
|
import './chunk-L5UOHS6E.js';
|
|
4
4
|
import './chunk-WMVK77ND.js';
|
|
5
5
|
import './chunk-UAYAJPEP.js';
|
|
@@ -8,4 +8,5 @@ import './chunk-MJP63SSS.js';
|
|
|
8
8
|
import './chunk-YVKRYQRG.js';
|
|
9
9
|
import './chunk-FESKKJAS.js';
|
|
10
10
|
import './chunk-A4CC4ZG3.js';
|
|
11
|
+
import './chunk-3G7YABRA.js';
|
|
11
12
|
import './chunk-PKBMQBKP.js';
|
package/docs/MIGRATING-TO-7.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Moving a site to site-kit 7
|
|
2
2
|
|
|
3
|
+
> This guide covers the move from 6 to 7 and is kept as it was. Moving from 7 to 8 is a separate, shorter guide: [Migrating to 8](MIGRATING-TO-8.md). Two things have changed since this page was written. Commerce now lives in [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), so the commerce row below names a path that moved in 8.0. And where this page says old paths are removed in 8.0, the [8.0.0 changelog entry](../CHANGELOG.md) says what that release actually removed: the retired Engage and CMS entries, but not the aliases for renamed modules, which are still there.
|
|
4
|
+
|
|
3
5
|
site-kit 7 is organised the way Sonor's dashboard is: one entry per module.
|
|
4
6
|
Most sites need no changes at all. Move a site when you next touch it;
|
|
5
7
|
nothing forces it before then, because a
|
|
@@ -78,7 +80,8 @@ New homes, each the same module as before:
|
|
|
78
80
|
- Website chat: `./chat`, and popups: `./website/popups` (both out of
|
|
79
81
|
`./engage`, which Sonor retired with the Engage module)
|
|
80
82
|
|
|
81
|
-
**The old paths keep working through 7.x** and
|
|
83
|
+
**The old paths keep working through 7.x** (and in 8, except `./engage`, which was
|
|
84
|
+
removed with the retired Engage module). The
|
|
82
85
|
codemod moves them anyway, so a touched site is done in one pass: chat
|
|
83
86
|
imports go to `./chat`, popup types to `./website/popups` under their new
|
|
84
87
|
names (`EngageElement` is `SitePopup`). It flags `EngageWidget`, which draws
|
|
@@ -128,7 +131,7 @@ just this part.
|
|
|
128
131
|
type (not `withSiteKitConfig`, which stays).
|
|
129
132
|
- Source maps. The package no longer ships `.map` files (7.3 of 6.x's 11 MB).
|
|
130
133
|
|
|
131
|
-
Still accepted and ignored
|
|
134
|
+
Still accepted and ignored (in 8 too), because sites pass them:
|
|
132
135
|
`contentSignals` on `createRobotsTxtHandler`, `nativeReturnTo` on forms, and
|
|
133
136
|
`<ManagedScripts />`.
|
|
134
137
|
|
|
@@ -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
|
}
|