@sitecore-content-sdk/nextjs 2.1.1 → 2.2.0-canary.20260527110239
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/dist/cjs/cache/sitecore-cache-tags.js +130 -0
- package/dist/cjs/cache/sitecore-edge-webhook-revalidation.js +67 -0
- package/dist/cjs/cache/sitecore-page-cache-tags.js +83 -0
- package/dist/cjs/debug.js +1 -1
- package/dist/cjs/editing/utils.js +6 -10
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/proxy/redirects-proxy.js +55 -23
- package/dist/cjs/route-handler/index.js +3 -1
- package/dist/cjs/route-handler/sitecore-revalidate-route-handler.js +124 -0
- package/dist/cjs/tools/generate-map.js +120 -115
- package/dist/cjs/tools/templating/utils.js +22 -10
- package/dist/esm/cache/sitecore-cache-tags.js +119 -0
- package/dist/esm/cache/sitecore-edge-webhook-revalidation.js +63 -0
- package/dist/esm/cache/sitecore-page-cache-tags.js +80 -0
- package/dist/esm/debug.js +2 -2
- package/dist/esm/editing/utils.js +6 -10
- package/dist/esm/index.js +6 -0
- package/dist/esm/proxy/redirects-proxy.js +55 -23
- package/dist/esm/route-handler/index.js +1 -0
- package/dist/esm/route-handler/sitecore-revalidate-route-handler.js +118 -0
- package/dist/esm/tools/generate-map.js +119 -115
- package/dist/esm/tools/templating/utils.js +21 -10
- package/package.json +10 -10
- package/types/cache/sitecore-cache-tags.d.ts +108 -0
- package/types/cache/sitecore-cache-tags.d.ts.map +1 -0
- package/types/cache/sitecore-edge-webhook-revalidation.d.ts +54 -0
- package/types/cache/sitecore-edge-webhook-revalidation.d.ts.map +1 -0
- package/types/cache/sitecore-page-cache-tags.d.ts +42 -0
- package/types/cache/sitecore-page-cache-tags.d.ts.map +1 -0
- package/types/debug.d.ts.map +1 -1
- package/types/editing/utils.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/proxy/redirects-proxy.d.ts +18 -0
- package/types/proxy/redirects-proxy.d.ts.map +1 -1
- package/types/route-handler/index.d.ts +1 -0
- package/types/route-handler/index.d.ts.map +1 -1
- package/types/route-handler/sitecore-revalidate-route-handler.d.ts +68 -0
- package/types/route-handler/sitecore-revalidate-route-handler.d.ts.map +1 -0
- package/types/tools/generate-map.d.ts +11 -6
- package/types/tools/generate-map.d.ts.map +1 -1
- package/types/tools/templating/utils.d.ts +11 -0
- package/types/tools/templating/utils.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/nextjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-canary.20260527110239",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@sitecore-content-sdk/analytics-core": "
|
|
36
|
-
"@sitecore-content-sdk/personalize": "
|
|
35
|
+
"@sitecore-content-sdk/analytics-core": "2.1.1-canary.20260527110239",
|
|
36
|
+
"@sitecore-content-sdk/personalize": "2.1.1-canary.20260527110239",
|
|
37
37
|
"@stylistic/eslint-plugin": "^5.2.2",
|
|
38
38
|
"@testing-library/dom": "^10.4.0",
|
|
39
39
|
"@testing-library/react": "^16.3.0",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"typescript": "~5.8.3"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@sitecore-content-sdk/analytics-core": "
|
|
80
|
-
"@sitecore-content-sdk/events": "
|
|
81
|
-
"@sitecore-content-sdk/personalize": "
|
|
79
|
+
"@sitecore-content-sdk/analytics-core": "2.1.1-canary.20260527110239",
|
|
80
|
+
"@sitecore-content-sdk/events": "2.1.1-canary.20260527110239",
|
|
81
|
+
"@sitecore-content-sdk/personalize": "2.1.1-canary.20260527110239",
|
|
82
82
|
"next": "^16.2.0",
|
|
83
83
|
"react": "^19.2.1",
|
|
84
84
|
"react-dom": "^19.2.1",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@babel/parser": "^7.27.2",
|
|
94
|
-
"@sitecore-content-sdk/content": "
|
|
95
|
-
"@sitecore-content-sdk/core": "
|
|
96
|
-
"@sitecore-content-sdk/events": "
|
|
97
|
-
"@sitecore-content-sdk/react": "
|
|
94
|
+
"@sitecore-content-sdk/content": "2.2.0-canary.20260527110239",
|
|
95
|
+
"@sitecore-content-sdk/core": "2.1.1-canary.20260527110239",
|
|
96
|
+
"@sitecore-content-sdk/events": "2.1.1-canary.20260527110239",
|
|
97
|
+
"@sitecore-content-sdk/react": "2.2.0-canary.20260527110239",
|
|
98
98
|
"recast": "^0.23.11",
|
|
99
99
|
"regex-parser": "^2.3.1",
|
|
100
100
|
"sync-disk-cache": "^2.1.0"
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { RouteData } from '@sitecore-content-sdk/content/layout';
|
|
2
|
+
/**
|
|
3
|
+
* Stable cache tag strings for Sitecore content (Next.js `cacheTag`, `unstable_cache` tags, `revalidateTag`).
|
|
4
|
+
* Tags are deterministic for the same logical inputs so app code and invalidation webhooks stay aligned.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const SITECORE_CONTENT_CACHE_TAG_PREFIX = "sc";
|
|
8
|
+
/**
|
|
9
|
+
* Sanitizes a single segment for use inside Sitecore cache tags.
|
|
10
|
+
* Colons are reserved as delimiters; slashes and whitespace are normalized for stable keys.
|
|
11
|
+
* @param {string} value - Raw segment (site name, locale, path segment, etc.).
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizeSitecoreCacheTagSegment(value: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes a Sitecore item GUID for use in cache tags (lowercase, no braces).
|
|
17
|
+
* @param {string} itemId - Sitecore item id or GUID string.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeSitecoreItemIdForCacheTag(itemId: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Parameters for {@link buildSitecoreRouteCacheTag}.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export type BuildSitecoreRouteCacheTagParams = {
|
|
26
|
+
site: string;
|
|
27
|
+
locale: string;
|
|
28
|
+
/**
|
|
29
|
+
* Path segments after site/locale (e.g. `['about']` or `['products', 'sku-1']`).
|
|
30
|
+
* Empty or omitted means the site home route for that locale.
|
|
31
|
+
*/
|
|
32
|
+
pathSegments?: string[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Tag for a resolved route (site + language + logical path). Use for URL-level invalidation.
|
|
36
|
+
* @param {BuildSitecoreRouteCacheTagParams} params - Site, locale, and optional path segments.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildSitecoreRouteCacheTag(params: BuildSitecoreRouteCacheTagParams): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parameters for {@link buildSitecoreItemCacheTag}.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export type BuildSitecoreItemCacheTagParams = {
|
|
45
|
+
itemId: string;
|
|
46
|
+
locale: string;
|
|
47
|
+
/**
|
|
48
|
+
* Published version number, or omit / `undefined` for "latest".
|
|
49
|
+
*/
|
|
50
|
+
version?: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Tag for a layout/route item (and anything else keyed the same way). Use for item-level invalidation.
|
|
54
|
+
* @param {BuildSitecoreItemCacheTagParams} params - Item id, locale, and optional published version.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildSitecoreItemCacheTag(params: BuildSitecoreItemCacheTagParams): string;
|
|
58
|
+
/**
|
|
59
|
+
* Parameters for {@link buildSitecoreDictionaryCacheTag}.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export type BuildSitecoreDictionaryCacheTagParams = {
|
|
63
|
+
site: string;
|
|
64
|
+
locale: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Tag for dictionary data scoped to site + locale.
|
|
68
|
+
* @param {BuildSitecoreDictionaryCacheTagParams} params - Site and locale for the dictionary fetch.
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildSitecoreDictionaryCacheTag(params: BuildSitecoreDictionaryCacheTagParams): string;
|
|
72
|
+
/**
|
|
73
|
+
* Parameters for buildSitecoreDictionaryCacheTagsFromSites.
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export type BuildSitecoreDictionaryCacheTagsFromSitesParams = {
|
|
77
|
+
/** Sites list (e.g. from generated multisite JSON). */
|
|
78
|
+
sites: readonly {
|
|
79
|
+
name: string;
|
|
80
|
+
language?: string;
|
|
81
|
+
}[];
|
|
82
|
+
/** Locale used when a site has no `language` value. */
|
|
83
|
+
baseLocale: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Builds deduplicated dictionary cache tags from a sites list.
|
|
87
|
+
* @param {BuildSitecoreDictionaryCacheTagsFromSitesParams} params - Sites list and fallback locale.
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildSitecoreDictionaryCacheTagsFromSites(params: BuildSitecoreDictionaryCacheTagsFromSitesParams): string[];
|
|
91
|
+
/**
|
|
92
|
+
* Builds an item cache tag from Sitecore layout route data when `itemId` is present.
|
|
93
|
+
* Prefers `itemLanguage` from Sitecore when set; otherwise uses `fallbackLocale`.
|
|
94
|
+
* Accepts the same `RouteData` shape returned by the layout service (e.g. `page.layout.sitecore.route`,
|
|
95
|
+
* which is `RouteData | null`) or `undefined` when the page did not resolve.
|
|
96
|
+
* @param {RouteData | null | undefined} route - Route node from layout (item id, language, version).
|
|
97
|
+
* @param {string} fallbackLocale - Locale used when `route.itemLanguage` is not set.
|
|
98
|
+
* @returns `null` when `route` is missing or `route.itemId` is not set.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare function buildSitecoreItemCacheTagFromRouteData(route: RouteData | null | undefined, fallbackLocale: string): string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Deduplicates tag strings while preserving first-seen order.
|
|
104
|
+
* @param {string[]} tags - Tag strings possibly containing duplicates.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare function dedupeSitecoreCacheTags(tags: string[]): string[];
|
|
108
|
+
//# sourceMappingURL=sitecore-cache-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitecore-cache-tags.d.ts","sourceRoot":"","sources":["../../src/cache/sitecore-cache-tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;GAGG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gCAAgC,GAAG,MAAM,CAM3F;AAED;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,MAAM,CAQzF;AAED;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qCAAqC,GAAG,MAAM,CAIrG;AAED;;;GAGG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,uDAAuD;IACvD,KAAK,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,+CAA+C,GACtD,MAAM,EAAE,CAcV;AAED;;;;;;;;;GASG;AACH,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,EACnC,cAAc,EAAE,MAAM,GACrB,MAAM,GAAG,IAAI,CAaf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAUhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One content change entry as commonly seen in Experience Edge / Content Operations style payloads.
|
|
3
|
+
* Field names follow community OSR examples; production payloads may include additional fields.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type SitecoreEdgeRevalidateUpdate = {
|
|
7
|
+
identifier?: string;
|
|
8
|
+
entity_definition?: string;
|
|
9
|
+
operation?: string;
|
|
10
|
+
entity_culture?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Request body shape for webhook-driven revalidation.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export type SitecoreEdgeRevalidateRequestBody = {
|
|
17
|
+
invocation_id?: string;
|
|
18
|
+
updates?: SitecoreEdgeRevalidateUpdate[];
|
|
19
|
+
continues?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Extra tag strings. Values starting with the Sitecore cache prefix (`sc:`) are used as-is.
|
|
22
|
+
* Bare values are treated as Sitecore item ids (with optional `-media` / `-layout` suffix stripped)
|
|
23
|
+
* and mapped to {@link buildSitecoreItemCacheTag} using the handler default locale when culture is missing.
|
|
24
|
+
*/
|
|
25
|
+
tags?: string[];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Strips Experience Edge style suffixes from an `identifier` so the value can be used as an item id in cache tags.
|
|
29
|
+
* Handles `{GUID}`, `{GUID}-media`, `{GUID}-layout` style strings.
|
|
30
|
+
* @param {string} identifier - Raw identifier from a webhook update row.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractSitecoreEdgeContentId(identifier: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Options for {@link collectSitecoreTagsFromEdgeRevalidateRequestBody}.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export type CollectSitecoreTagsFromEdgeBodyOptions = {
|
|
39
|
+
/**
|
|
40
|
+
* Used when an update omits `entity_culture`, and when mapping bare item ids in `tags`.
|
|
41
|
+
*/
|
|
42
|
+
defaultLocale: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Maps an Experience Edge webhook JSON body to Content SDK cache tag strings used by
|
|
46
|
+
* {@link collectSitecorePageCacheTags} / {@link buildSitecoreItemCacheTag} (`sc:item:...`), so
|
|
47
|
+
* `revalidateTag` matches tags registered during cached reads.
|
|
48
|
+
* **`updates`** rows resolve to **`sc:item:…`** (locale from `entity_culture` or `defaultLocale`). **`tags`**: full `sc:` strings pass through; bare ids become **`sc:item:…`** with `defaultLocale`. Route/variant tags are not inferred.
|
|
49
|
+
* @param {SitecoreEdgeRevalidateRequestBody | null | undefined} body - Webhook JSON body (tags and/or updates).
|
|
50
|
+
* @param {CollectSitecoreTagsFromEdgeBodyOptions} options - Default locale when culture is missing on an update or bare tag.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function collectSitecoreTagsFromEdgeRevalidateRequestBody(body: SitecoreEdgeRevalidateRequestBody | null | undefined, options: CollectSitecoreTagsFromEdgeBodyOptions): string[];
|
|
54
|
+
//# sourceMappingURL=sitecore-edge-webhook-revalidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitecore-edge-webhook-revalidation.d.ts","sourceRoot":"","sources":["../../src/cache/sitecore-edge-webhook-revalidation.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,4BAA4B,EAAE,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMvE;AAYD;;;GAGG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gDAAgD,CAC9D,IAAI,EAAE,iCAAiC,GAAG,IAAI,GAAG,SAAS,EAC1D,OAAO,EAAE,sCAAsC,GAC9C,MAAM,EAAE,CAgCV"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RouteData } from '@sitecore-content-sdk/content/layout';
|
|
2
|
+
/**
|
|
3
|
+
* Inputs for assembling cache tags for a typical Sitecore page render (`getPage`).
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type CollectSitecorePageCacheTagsParams = {
|
|
7
|
+
site: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
/**
|
|
10
|
+
* Path string used for deriving normalized route segments (personalization rewrite segments stripped)
|
|
11
|
+
* for the route tag. Provide this **or** `path`. When both are set, this value wins.
|
|
12
|
+
*/
|
|
13
|
+
personalizedPathname?: string;
|
|
14
|
+
/**
|
|
15
|
+
* App Router catch-all segments (e.g. from `[...path]`). Used when `personalizedPathname` is omitted;
|
|
16
|
+
* normalized the same way as `SitecoreClient.parsePath` for a string array argument.
|
|
17
|
+
*/
|
|
18
|
+
path?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Route node from a Sitecore layout response (e.g. `page.layout.sitecore.route`, which is
|
|
21
|
+
* `RouteData | null`). Optional because the page may not resolve; only `itemId`, `itemLanguage`,
|
|
22
|
+
* and `itemVersion` are read when present.
|
|
23
|
+
*/
|
|
24
|
+
route?: RouteData | null;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Builds cache tags for a Sitecore page read (`getPage`): the route tag and the route's item tag.
|
|
28
|
+
* Dictionary data is not part of `getPage`; tag dictionary fetches separately (for example with
|
|
29
|
+
* `buildSitecoreDictionaryCacheTag` on a dedicated `use cache` helper).
|
|
30
|
+
*
|
|
31
|
+
* Registers **`sc:route:…`** and **`sc:item:…`** (when layout has `itemId`). Edge-style webhooks emit
|
|
32
|
+
* item ids, which the Sitecore revalidate route handler maps to **`sc:item:…`**; route tags are only
|
|
33
|
+
* invalidated when callers send the full `sc:route:…` strings in the `tags[]` array of the same revalidate request.
|
|
34
|
+
*
|
|
35
|
+
* Personalization variants are isolated naturally by URL path (each variant rewrite yields a distinct
|
|
36
|
+
* Cache Components key) so no `sc:pvv:…` tag is added here. If a personalize-specific webhook is wired
|
|
37
|
+
* up later, build that tag in the dedicated helper and add it on top of these.
|
|
38
|
+
* @param {CollectSitecorePageCacheTagsParams} params - Site, locale, path or personalized pathname, and route metadata.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export declare function collectSitecorePageCacheTags(params: CollectSitecorePageCacheTagsParams): string[];
|
|
42
|
+
//# sourceMappingURL=sitecore-page-cache-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitecore-page-cache-tags.d.ts","sourceRoot":"","sources":["../../src/cache/sitecore-page-cache-tags.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AA0DtE;;;GAGG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,kCAAkC,GAAG,MAAM,EAAE,CAgBjG"}
|
package/types/debug.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAKzC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|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,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAC,KACnD;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAazB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,mBAAmB,GAAG,OAAO,KACrC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAazB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,GAAG,EACf,oBAAoB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EACzD,mBAAmB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAC5C,SAAS,MAAM,EAAE,EACjB,aAAa,iBAAiB,KAC7B,OAAO,CAAC,MAAM,CAsDhB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,OAAO,KACZ,IAAI,IAAI,8BAOV,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,cAAc,GAAG,WAAW,WAmBjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,cAIxB,CAAC"}
|
package/types/index.d.ts
CHANGED
|
@@ -32,4 +32,6 @@ export type { AnalyticsProxyAdapter } from './initialization/proxy/analytics-ada
|
|
|
32
32
|
export { analyticsProxyAdapter } from './initialization/proxy/analytics-adapter';
|
|
33
33
|
export { DesignLibraryApp } from './components/DesignLibrary/DesignLibraryApp';
|
|
34
34
|
export { type CachedPageParams, getCachedPageParams, setCachedPageParams, } from './cache/page-params';
|
|
35
|
+
export { buildSitecoreDictionaryCacheTag, type BuildSitecoreDictionaryCacheTagParams, } from './cache/sitecore-cache-tags';
|
|
36
|
+
export { collectSitecorePageCacheTags, type CollectSitecorePageCacheTagsParams, } from './cache/sitecore-page-cache-tags';
|
|
35
37
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EACL,SAAS,EAET,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,IAAI,EACJ,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,QAAQ,EACR,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,SAAS,EACT,kBAAkB,GACnB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,YAAY,GACb,MAAM,oCAAoC,CAAC;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EACnB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,YAAY,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,OAAO,EACL,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,+BAA+B,EAC/B,KAAK,qCAAqC,GAC3C,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,4BAA4B,EAC5B,KAAK,kCAAkC,GACxC,MAAM,kCAAkC,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { ProxyBase, ProxyBaseConfig } from './proxy';
|
|
|
5
5
|
import { SitecoreConfig } from '../config';
|
|
6
6
|
type RedirectResult = RedirectInfo & {
|
|
7
7
|
matchedQueryString?: string;
|
|
8
|
+
matchedPath?: string;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* The interface for the RedirectsProxy configuration.
|
|
@@ -32,6 +33,7 @@ export declare class RedirectsProxy extends ProxyBase {
|
|
|
32
33
|
* Method returns RedirectInfo when matches
|
|
33
34
|
* @param {NextRequest} req request
|
|
34
35
|
* @param {string} siteName site name
|
|
36
|
+
* @param {string} requestLocale locale used for locale redirect matching
|
|
35
37
|
* @returns Promise<RedirectInfo | undefined>
|
|
36
38
|
* @private
|
|
37
39
|
*/
|
|
@@ -83,6 +85,22 @@ export declare class RedirectsProxy extends ProxyBase {
|
|
|
83
85
|
* @returns {NextResponse<unknown>} The redirect response.
|
|
84
86
|
*/
|
|
85
87
|
protected createRedirectResponse(url: NextURL | string, res: Response | undefined, status: number, statusText: string): NextResponse;
|
|
88
|
+
/**
|
|
89
|
+
* Converts a redirect pattern string into a RegExp.
|
|
90
|
+
* Supports both JS literal form (`/pattern/i`) and plain regex source (`^/path$`).
|
|
91
|
+
* @param {string} pattern redirect pattern from redirect map
|
|
92
|
+
* @returns {RegExp} normalized regex instance
|
|
93
|
+
* @private
|
|
94
|
+
*/
|
|
95
|
+
private getRedirectPatternRegex;
|
|
96
|
+
/**
|
|
97
|
+
* Strips locale prefix from path when present.
|
|
98
|
+
* @param {string} path incoming request path
|
|
99
|
+
* @param {string} urlLocale locale from Next.js URL
|
|
100
|
+
* @returns {string} locale-stripped path
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private getLocaleStrippedPath;
|
|
86
104
|
}
|
|
87
105
|
export {};
|
|
88
106
|
//# sourceMappingURL=redirects-proxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirects-proxy.d.ts","sourceRoot":"","sources":["../../src/proxy/redirects-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EAItB,YAAY,EAEb,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"redirects-proxy.d.ts","sourceRoot":"","sources":["../../src/proxy/redirects-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EAItB,YAAY,EAEb,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAuB,MA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,cAAc,GAAG,SAAS;IAiE7B;;;;;;;OAOG;IACH,SAAS,CAAC,yBAAyB,CACjC,SAAS,EAAE,cAAc,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,cAAc,GAAG,SAAS;IAW7B;;;;;;OAMG;IACH,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IA6C7C;;;;;;;;;OASG;IACH,SAAS,CAAC,gBAAgB,CACxB,MAAM,EAAE,OAAO,GAAG,MAAM,EACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,YAAY,EACjB,UAAU,UAAQ,GACjB,YAAY;IAkDf;;;;;;;OAOG;IACH,SAAS,CAAC,sBAAsB,CAC9B,GAAG,EAAE,OAAO,GAAG,MAAM,EACrB,GAAG,EAAE,QAAQ,GAAG,SAAS,EACzB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,YAAY;IAgBf;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;CAQ9B"}
|
|
@@ -2,4 +2,5 @@ export { createSitemapRouteHandler } from './sitemap-route-handler';
|
|
|
2
2
|
export { createRobotsRouteHandler } from './robots-route-handler';
|
|
3
3
|
export { createEditingConfigRouteHandler } from './editing-config-route-handler';
|
|
4
4
|
export { createEditingRenderRouteHandlers } from './editing-render-route-handler';
|
|
5
|
+
export { createSitecoreRevalidateRouteHandler, type SitecoreRevalidateRouteHandlerOptions, type RevalidateTagCacheProfile, } from './sitecore-revalidate-route-handler';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route-handler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route-handler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,oCAAoC,EACpC,KAAK,qCAAqC,EAC1C,KAAK,yBAAyB,GAC/B,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { revalidateTag } from 'next/cache';
|
|
2
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
3
|
+
import type { SiteInfo } from '@sitecore-content-sdk/content/site';
|
|
4
|
+
/**
|
|
5
|
+
* Second argument to Next.js `revalidateTag` (cache profile: e.g. `"max"` or `{ expire }`).
|
|
6
|
+
* Aligns with the installed `next/cache` typings.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type RevalidateTagCacheProfile = Parameters<typeof revalidateTag>[1];
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@link createSitecoreRevalidateRouteHandler}.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export type SitecoreRevalidateRouteHandlerOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* Shared secret for `POST /api/revalidate`. If omitted, the handler reads `process.env.SITECORE_REVALIDATE_SECRET`.
|
|
17
|
+
* When a non-empty value is configured (here or via env), callers must send the same value in the
|
|
18
|
+
* **`x-revalidate-secret`** header. When empty/omitted, revalidation proceeds without that header.
|
|
19
|
+
*/
|
|
20
|
+
secret?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Next.js `revalidateTag` cache profile (second argument). Default is `"max"` (recommended).
|
|
23
|
+
* Other string values may match profiles from `cacheLife` in `next.config`; objects may use `{ expire }` per Next.js docs.
|
|
24
|
+
*/
|
|
25
|
+
cacheProfile?: RevalidateTagCacheProfile;
|
|
26
|
+
/**
|
|
27
|
+
* Locale for item tags when culture is missing, and for dictionary tags when a site has no language.
|
|
28
|
+
* Defaults to `'en'` when omitted.
|
|
29
|
+
*/
|
|
30
|
+
defaultLocale?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Sites list (e.g. from `.sitecore/sites.json`). Adds one `sc:dict:<site>:<locale>` tag per
|
|
33
|
+
* site on every revalidation call. `generateSites` always includes the configured default site.
|
|
34
|
+
*/
|
|
35
|
+
sites?: SiteInfo[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Creates a single `POST` handler for `/api/revalidate` that consumes Sitecore Experience Edge / Content
|
|
39
|
+
* Operations webhook bodies (and equivalent ad-hoc calls that reuse the same body shape).
|
|
40
|
+
*
|
|
41
|
+
* The body is expected to be a JSON object that resolves to at least one Sitecore cache tag:
|
|
42
|
+
*
|
|
43
|
+
* - **`updates[]`** — Sitecore publish-event rows. Each row's `identifier` (with `-media` / `-layout`
|
|
44
|
+
* suffix stripped) maps to an `sc:item:<id>:<locale>:latest` tag, using `entity_culture` for locale
|
|
45
|
+
* (falling back to the handler's `defaultLocale`).
|
|
46
|
+
* - **`tags[]`** — pass-through and convenience array:
|
|
47
|
+
* - Strings already starting with `sc:` are used verbatim (e.g. `sc:route:...`, `sc:item:...`, `sc:dict:...`).
|
|
48
|
+
* - Bare values are treated as Sitecore item ids and mapped to `sc:item:<id>:<defaultLocale>:latest`.
|
|
49
|
+
*
|
|
50
|
+
* When **`sites`** is configured, the handler also appends one `sc:dict:<site>:<locale>` tag per
|
|
51
|
+
* site so dictionary updates flow through the same call.
|
|
52
|
+
*
|
|
53
|
+
* Auth (optional): when `SITECORE_REVALIDATE_SECRET` (or the `secret` option) is non-empty, callers must
|
|
54
|
+
* send the same value in the **`x-revalidate-secret`** header. When unset or blank, no header is required.
|
|
55
|
+
* @param {SitecoreRevalidateRouteHandlerOptions} [options] - Optional inline `secret`, `cacheProfile`, locale, sites, and dictionary options.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare function createSitecoreRevalidateRouteHandler(options?: SitecoreRevalidateRouteHandlerOptions): {
|
|
59
|
+
POST: (req: NextRequest) => Promise<NextResponse<{
|
|
60
|
+
error: string;
|
|
61
|
+
}> | NextResponse<{
|
|
62
|
+
revalidated: boolean;
|
|
63
|
+
tagsCount: number;
|
|
64
|
+
invocation_id: string | null;
|
|
65
|
+
continues: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=sitecore-revalidate-route-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitecore-revalidate-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/sitecore-revalidate-route-handler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAmBnE;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,GAAE,qCAA0C;gBAY1B,WAAW;;;;;;;;EA0FrC"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { GenerateMapFunction, EnhancedComponentMapTemplate } from '@sitecore-content-sdk/content/tools';
|
|
2
|
+
export declare const defaultServerMapTemplate: EnhancedComponentMapTemplate;
|
|
2
3
|
export declare const defaultClientMapTemplate: EnhancedComponentMapTemplate;
|
|
3
4
|
export type CollectFilter = 'all' | 'client' | 'server' | 'universal';
|
|
4
5
|
/**
|
|
5
6
|
* Generate and write componentMap.ts files based on provided params.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
+
* Pages Router:
|
|
9
|
+
* - component-map.ts : Single component map with Pages Router wrappers
|
|
10
|
+
*
|
|
11
|
+
* App Router (clientComponentMap=true or undefined):
|
|
8
12
|
* - component-map.ts : Full component map with all components (server, client, universal)
|
|
9
|
-
* - component-map.client.ts : Client-safe map with
|
|
13
|
+
* - component-map.client.ts : Client-safe map with client + universal components
|
|
10
14
|
*
|
|
11
|
-
*
|
|
12
|
-
* - component-map.ts :
|
|
15
|
+
* App Router (clientComponentMap=false):
|
|
16
|
+
* - component-map.ts : Full component map with all components (server, client, universal)
|
|
17
|
+
* - component-map.client.ts : Client-safe map with built-in components only (no user components)
|
|
13
18
|
*
|
|
14
|
-
* When includeVariants is true
|
|
19
|
+
* When includeVariants is true:
|
|
15
20
|
* - Includes component **variants** in the generated map(s) alongside base components
|
|
16
21
|
* - Preserves the same client/server filtering rules (variants obey clientComponentMap filtering)
|
|
17
22
|
* - Variant entries are emitted using the same naming/keys convention as their base components
|
|
18
23
|
*
|
|
19
24
|
* Template Customization:
|
|
20
25
|
* - mapTemplate: Custom template for main component map (works for both single and dual map modes)
|
|
21
|
-
* - clientMapTemplate: Custom template for client component map (
|
|
26
|
+
* - clientMapTemplate: Custom template for client component map (App Router only)
|
|
22
27
|
* @param {GenerateMapArgs} params - The parameters for the generateMap function.
|
|
23
28
|
* @public
|
|
24
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../src/tools/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAInB,4BAA4B,EAG7B,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../src/tools/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAInB,4BAA4B,EAG7B,MAAM,qCAAqC,CAAC;AAyO7C,eAAO,MAAM,wBAAwB,EAAE,4BAiBtC,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,4BAiBtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AA6BtE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,EAAE,mBAiGzB,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { ComponentFileWithType, ComponentType, RouterType } from '@sitecore-content-sdk/content/tools';
|
|
2
2
|
import { ModuleExports } from '@sitecore-content-sdk/content/node-tools';
|
|
3
|
+
/**
|
|
4
|
+
* Constants for Next.js router types. Used for consistent detection and comparison throughout the codebase.
|
|
5
|
+
* Values are based on Next.js conventions:
|
|
6
|
+
* - 'app' for App Router (src/app or app directory)
|
|
7
|
+
* - 'pages' for Pages Router (src/pages or pages directory)
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const ROUTER_TYPE: {
|
|
11
|
+
readonly APP: "app";
|
|
12
|
+
readonly PAGES: "pages";
|
|
13
|
+
};
|
|
3
14
|
/**
|
|
4
15
|
* Detects the Next.js router type (App Router or Pages Router) based on directory structure.
|
|
5
16
|
* @param {string} projectRoot - The project root directory. Defaults to current working directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAGL,aAAa,EACd,MAAM,0CAA0C,CAAC;AAIlD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,GAAE,MAAsB,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAGL,aAAa,EACd,MAAM,0CAA0C,CAAC;AAIlD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,GAAE,MAAsB,GAAG,UAAU,CAahF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,aAAa,CA0J5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,eAAe,CAAC,EAAE,OAAO,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,qBAAqB,EAAE,CAQzB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAGnF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAEpF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAEpF"}
|