From 7e4e94e84d598bb4fee0b6f5b3b2e57e2278a3db Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Mon, 23 Mar 2026 10:44:37 -0500 Subject: [PATCH 01/18] Upgrade to Content SDK 2.0 --- packages/data/package.json | 24 +- packages/data/src/base-item.ts | 2 +- packages/data/src/factories/data.ts | 2 +- packages/enhancers/package.json | 22 +- .../src/helpers/filter-placeholders.ts | 2 +- .../src/helpers/get-rendering-index.ts | 2 +- .../src/hooks/useModifyChildrenProps.tsx | 2 +- .../src/withAppDatasourceRendering.tsx | 2 +- .../enhancers/src/withDatasourceRendering.tsx | 2 +- packages/labels/package.json | 22 +- packages/labels/src/labels.ts | 2 +- packages/mapper/package.json | 22 +- packages/mapper/src/cast-item.ts | 2 +- packages/navigation/package.json | 22 +- .../navigation/src/models/navigation-link.ts | 2 +- packages/nextjs/package.json | 20 +- .../src/graphql-client-factory/create.ts | 6 +- packages/page-analytics-scripts/package.json | 24 +- .../src/services/app-analytics-service.ts | 2 +- packages/page-tagging/package.json | 24 +- .../src/services/canonical-url.ts | 2 +- packages/security/package.json | 10 +- .../security/src/middleware/cspMiddleware.ts | 8 +- packages/security/src/services/cspSettings.ts | 4 +- yarn.lock | 541 ++++++++++-------- 25 files changed, 406 insertions(+), 367 deletions(-) diff --git a/packages/data/package.json b/packages/data/package.json index ddb9df6..d48e4f3 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -19,26 +19,26 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "@types/node": "~22.9.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/core": "^2.0.0", + "@types/node": "^24.10.4", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/core": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/mapper": "^1.1.1", diff --git a/packages/data/src/base-item.ts b/packages/data/src/base-item.ts index d771e9d..9235108 100644 --- a/packages/data/src/base-item.ts +++ b/packages/data/src/base-item.ts @@ -1,4 +1,4 @@ -import { Item } from '@sitecore-content-sdk/core/layout'; +import { Item } from '@sitecore-content-sdk/content/layout'; /** * Represents a base item in Sitecore. diff --git a/packages/data/src/factories/data.ts b/packages/data/src/factories/data.ts index 28cdaa8..bb611e5 100644 --- a/packages/data/src/factories/data.ts +++ b/packages/data/src/factories/data.ts @@ -1,4 +1,4 @@ -import { LayoutServiceData } from '@sitecore-content-sdk/core/layout'; +import { LayoutServiceData } from '@sitecore-content-sdk/content/layout'; import { DataService } from '../services/data-service'; export const createDataService = (layoutData: LayoutServiceData): DataService => { diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index 7d4d6ff..eef27fb 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -19,25 +19,25 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/nextjs": "^2.0.0", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/src/helpers/filter-placeholders.ts b/packages/enhancers/src/helpers/filter-placeholders.ts index ffea53e..de3ac68 100644 --- a/packages/enhancers/src/helpers/filter-placeholders.ts +++ b/packages/enhancers/src/helpers/filter-placeholders.ts @@ -1,4 +1,4 @@ -import { ComponentRendering } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering } from '@sitecore-content-sdk/content/layout'; export function filterPlaceholders(placeholderList: ComponentRendering[]): ComponentRendering[] { let newList = []; diff --git a/packages/enhancers/src/helpers/get-rendering-index.ts b/packages/enhancers/src/helpers/get-rendering-index.ts index 3df7337..0186398 100644 --- a/packages/enhancers/src/helpers/get-rendering-index.ts +++ b/packages/enhancers/src/helpers/get-rendering-index.ts @@ -1,4 +1,4 @@ -import { ComponentRendering } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering } from '@sitecore-content-sdk/content/layout'; export type RenderingIndex = { rendering: ComponentRendering; diff --git a/packages/enhancers/src/hooks/useModifyChildrenProps.tsx b/packages/enhancers/src/hooks/useModifyChildrenProps.tsx index 8664b68..bfbd077 100644 --- a/packages/enhancers/src/hooks/useModifyChildrenProps.tsx +++ b/packages/enhancers/src/hooks/useModifyChildrenProps.tsx @@ -1,4 +1,4 @@ -import { ComponentRendering } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering } from '@sitecore-content-sdk/content/layout'; import { useContext } from 'react'; import { filterPlaceholders } from '../helpers'; import { ComponentPropsReactContext } from '@sitecore-content-sdk/nextjs'; diff --git a/packages/enhancers/src/withAppDatasourceRendering.tsx b/packages/enhancers/src/withAppDatasourceRendering.tsx index 3356197..7c2468e 100644 --- a/packages/enhancers/src/withAppDatasourceRendering.tsx +++ b/packages/enhancers/src/withAppDatasourceRendering.tsx @@ -1,4 +1,4 @@ -import { ComponentRendering } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering } from '@sitecore-content-sdk/content/layout'; import { Page } from '@sitecore-content-sdk/nextjs'; import React, { ComponentType, ReactElement } from 'react'; diff --git a/packages/enhancers/src/withDatasourceRendering.tsx b/packages/enhancers/src/withDatasourceRendering.tsx index 3824c2b..0a908c4 100644 --- a/packages/enhancers/src/withDatasourceRendering.tsx +++ b/packages/enhancers/src/withDatasourceRendering.tsx @@ -1,5 +1,5 @@ 'use client'; -import { ComponentRendering } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering } from '@sitecore-content-sdk/content/layout'; import { useSitecore } from '@sitecore-content-sdk/nextjs'; import React, { ComponentType, ReactElement } from 'react'; diff --git a/packages/labels/package.json b/packages/labels/package.json index 8681cea..505629c 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -18,25 +18,25 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/core": "^2.0.0", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/core": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/mapper": "^1.1.1", diff --git a/packages/labels/src/labels.ts b/packages/labels/src/labels.ts index 85ef665..ce0fa90 100644 --- a/packages/labels/src/labels.ts +++ b/packages/labels/src/labels.ts @@ -3,7 +3,7 @@ import { gql } from 'graphql-request'; import { debug as debuggers } from '@constellation4sitecore-content-sdk/nextjs/debugger'; import { GraphqlService } from '@constellation4sitecore-content-sdk/nextjs/graphql'; import { mapToNew } from '@constellation4sitecore-content-sdk/mapper'; -import { LayoutServiceData } from '@sitecore-content-sdk/core/layout'; +import { LayoutServiceData } from '@sitecore-content-sdk/content/layout'; // https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build // .d.ts workaraound diff --git a/packages/mapper/package.json b/packages/mapper/package.json index bc42e5f..124fb1c 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -18,24 +18,24 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/core": "^2.0.0", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/core": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/core": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/src/cast-item.ts b/packages/mapper/src/cast-item.ts index 797448c..278f4eb 100644 --- a/packages/mapper/src/cast-item.ts +++ b/packages/mapper/src/cast-item.ts @@ -1,4 +1,4 @@ -import { ComponentRendering, Item } from '@sitecore-content-sdk/core/layout'; +import { ComponentRendering, Item } from '@sitecore-content-sdk/content/layout'; export function castItem(item: Item | ComponentRendering): T | null { return item.fields as T; diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 1322d99..9c15fe1 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -18,24 +18,24 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/nextjs": "^2.0.0", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/data": "^1.1.1" diff --git a/packages/navigation/src/models/navigation-link.ts b/packages/navigation/src/models/navigation-link.ts index 756daec..2a2889b 100644 --- a/packages/navigation/src/models/navigation-link.ts +++ b/packages/navigation/src/models/navigation-link.ts @@ -1,4 +1,4 @@ -import { Field } from '@sitecore-content-sdk/core/layout'; +import { Field } from '@sitecore-content-sdk/content/layout'; import { LinkField } from '@sitecore-content-sdk/nextjs'; export interface NavigationLink { diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index c24b6a4..624a01a 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -25,14 +25,14 @@ "/*.d.ts" ], "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", + "@sitecore-content-sdk/nextjs": "^2.0.0", "@types/chai": "^5.2.2", "@types/chai-string": "^1.4.5", "@types/debug": "^4.1.5", "@types/mocha": "^10.0.10", - "@types/node": "~22.9.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@types/node": "^24.10.4", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "chai": "^4.4.1", "chai-string": "^1.6.0", "copyfiles": "^2.4.1", @@ -41,17 +41,17 @@ "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", "mocha": "^11.2.2", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", - "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", + "ts-node": "^10.9.2", + "typescript": "~5.8.3" }, "dependencies": { "debug": "^4.3.1" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0" }, "gitHead": "4724f2214e80450076a12e36844e89d6b81229c4" } diff --git a/packages/nextjs/src/graphql-client-factory/create.ts b/packages/nextjs/src/graphql-client-factory/create.ts index 23d8838..2b8bc54 100644 --- a/packages/nextjs/src/graphql-client-factory/create.ts +++ b/packages/nextjs/src/graphql-client-factory/create.ts @@ -16,10 +16,8 @@ export const createGraphQLClientFactory = () => { const projectConfig = defineConfig({}); if (projectConfig.api?.edge?.contextId) { clientConfig = { - endpoint: getEdgeProxyContentUrl( - projectConfig.api?.edge?.contextId, - projectConfig.api?.edge?.edgeUrl - ), + endpoint: getEdgeProxyContentUrl(projectConfig.api?.edge?.edgeUrl), + contextId: projectConfig.api?.edge?.contextId, }; } else if (projectConfig.api?.local?.apiHost && projectConfig.api?.local.apiKey) { clientConfig = { diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index 6636bb0..c88ff00 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -19,26 +19,26 @@ "url": "https://github.com/constellation4sitecore/xmcloud-constellation/issues" }, "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "@types/node": "~22.9.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/nextjs": "^2.0.0", + "@types/node": "^24.10.4", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/data": "^1.1.1", diff --git a/packages/page-analytics-scripts/src/services/app-analytics-service.ts b/packages/page-analytics-scripts/src/services/app-analytics-service.ts index b35dee5..9e68104 100644 --- a/packages/page-analytics-scripts/src/services/app-analytics-service.ts +++ b/packages/page-analytics-scripts/src/services/app-analytics-service.ts @@ -1,5 +1,5 @@ import { GraphqlService } from '@constellation4sitecore-content-sdk/nextjs/graphql'; -import { LayoutServiceData } from '@sitecore-content-sdk/core/layout'; +import { LayoutServiceData } from '@sitecore-content-sdk/content/layout'; import { gql } from 'graphql-request'; import { AnalyticScriptItem, AnalyticScripts } from '../models'; diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index e38e513..39d28b2 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -18,26 +18,26 @@ "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "@types/node": "~22.9.0", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", + "@sitecore-content-sdk/nextjs": "^2.0.0", + "@types/node": "^24.10.4", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1", "ts-node": "^10.9.1", - "typescript": "~5.4.0" + "typescript": "~5.8.3" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/enhancers": "^1.1.1", diff --git a/packages/page-tagging/src/services/canonical-url.ts b/packages/page-tagging/src/services/canonical-url.ts index bf610cb..0ef513b 100644 --- a/packages/page-tagging/src/services/canonical-url.ts +++ b/packages/page-tagging/src/services/canonical-url.ts @@ -1,6 +1,6 @@ import { GetStaticPropsContext } from 'next'; import { removeLanguageFromUrl, removeTrailingSlash } from '../helpers/url'; -import { resolveUrl } from '@sitecore-content-sdk/core/utils'; +import { resolveUrl } from '@sitecore-content-sdk/nextjs/utils'; export class CanonicalUrlService { context: GetStaticPropsContext; diff --git a/packages/security/package.json b/packages/security/package.json index ab16f96..9c7038a 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -18,10 +18,10 @@ "clean": "del-cli dist types" }, "peerDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", - "next": "^15.3.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "@sitecore-content-sdk/nextjs": "^2.0.0", + "next": "^16.1.1", + "react": "^19.2.1", + "react-dom": "^19.2.1" }, "dependencies": { "@constellation4sitecore-content-sdk/nextjs": "^1.1.1", @@ -29,7 +29,7 @@ "memory-cache": "^0.2.0" }, "devDependencies": { - "@sitecore-content-sdk/nextjs": "^1.1.0", + "@sitecore-content-sdk/nextjs": "^2.0.0", "@types/memory-cache": "^0.2.5" }, "types": "types/index.d.ts", diff --git a/packages/security/src/middleware/cspMiddleware.ts b/packages/security/src/middleware/cspMiddleware.ts index 5f1022e..91e21eb 100644 --- a/packages/security/src/middleware/cspMiddleware.ts +++ b/packages/security/src/middleware/cspMiddleware.ts @@ -1,8 +1,8 @@ import { NextRequest, NextResponse } from 'next/server'; import { CSPSettingService } from '../services/cspSettings'; import { CacheOptions } from '../services/cache-client'; -import { SiteResolver } from '@sitecore-content-sdk/core/site'; -import { MiddlewareBase, MiddlewareBaseConfig } from '@sitecore-content-sdk/nextjs/middleware'; +import { SiteResolver } from '@sitecore-content-sdk/content/site'; +import { ProxyBase, ProxyBaseConfig } from '@sitecore-content-sdk/nextjs/proxy'; import { createGraphQLClientFactory } from '@constellation4sitecore-content-sdk/nextjs/graphql'; export declare type GraphQLRedirectsServiceConfig = { @@ -13,10 +13,10 @@ export declare type GraphQLRedirectsServiceConfig = { }; export type CSPMiddlewareConfig = Omit & - MiddlewareBaseConfig & + ProxyBaseConfig & CacheOptions; -export class CSPMiddleware extends MiddlewareBase { +export class CSPMiddleware extends ProxyBase { private cspService: CSPSettingService; constructor(protected config: CSPMiddlewareConfig) { super(config); diff --git a/packages/security/src/services/cspSettings.ts b/packages/security/src/services/cspSettings.ts index 3b68082..9643b41 100644 --- a/packages/security/src/services/cspSettings.ts +++ b/packages/security/src/services/cspSettings.ts @@ -4,7 +4,7 @@ import { GraphQLRequestClientFactory, } from '@sitecore-content-sdk/core'; import { debug as debugers } from '@constellation4sitecore-content-sdk/nextjs/debugger'; -import { Field, Item } from '@sitecore-content-sdk/core/layout'; +import { Field, Item } from '@sitecore-content-sdk/content/layout'; import { mapToNew } from '@constellation4sitecore-content-sdk/mapper'; import { CacheClient, CacheOptions, MemoryCacheClient } from './cache-client'; import { unstable_cache as cache, revalidateTag } from 'next/cache'; @@ -134,7 +134,7 @@ export class CSPSettingService { ): Promise { const cacheKey = `csp-${siteName}`; if (process.env.CONSTELLATION_NEXT_CACHE_ENABLED === 'true') { - if (forceCacheClear) revalidateTag(cacheKey); + if (forceCacheClear) revalidateTag(cacheKey, 'max'); return await cache( async (language, siteName) => this.fetchSettings(language, siteName), [language, siteName], diff --git a/yarn.lock b/yarn.lock index 466cbac..467b483 100644 --- a/yarn.lock +++ b/yarn.lock @@ -51,13 +51,20 @@ "@emnapi/wasi-threads" "1.1.0" tslib "^2.4.0" -"@emnapi/runtime@^1.4.3", "@emnapi/runtime@^1.5.0": +"@emnapi/runtime@^1.4.3": version "1.5.0" resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.5.0.tgz#9aebfcb9b17195dce3ab53c86787a6b7d058db73" integrity sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ== dependencies: tslib "^2.4.0" +"@emnapi/runtime@^1.7.0": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.9.1.tgz#115ff2a0d589865be6bd8e9d701e499c473f2a8d" + integrity sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA== + dependencies: + tslib "^2.4.0" + "@emnapi/wasi-threads@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz#60b2102fddc9ccb78607e4a3cf8403ea69be41bf" @@ -230,135 +237,147 @@ resolved "https://registry.yarnpkg.com/@img/colour/-/colour-1.0.0.tgz#d2fabb223455a793bf3bf9c70de3d28526aa8311" integrity sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw== -"@img/sharp-darwin-arm64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz#8a0dcac9e621ff533fbf2e830f6a977b38d67a0c" - integrity sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA== +"@img/sharp-darwin-arm64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz#6e0732dcade126b6670af7aa17060b926835ea86" + integrity sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w== optionalDependencies: - "@img/sharp-libvips-darwin-arm64" "1.2.3" + "@img/sharp-libvips-darwin-arm64" "1.2.4" -"@img/sharp-darwin-x64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.4.tgz#0ba2bd9dbf07f7300fab73305b787e66156f7752" - integrity sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg== +"@img/sharp-darwin-x64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz#19bc1dd6eba6d5a96283498b9c9f401180ee9c7b" + integrity sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw== optionalDependencies: - "@img/sharp-libvips-darwin-x64" "1.2.3" + "@img/sharp-libvips-darwin-x64" "1.2.4" -"@img/sharp-libvips-darwin-arm64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.3.tgz#f43c9aa3b74fd307e4318da63ebbe0ed4c34e744" - integrity sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw== +"@img/sharp-libvips-darwin-arm64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz#2894c0cb87d42276c3889942e8e2db517a492c43" + integrity sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g== -"@img/sharp-libvips-darwin-x64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.3.tgz#c42ff786d4a1f42ef8929dba4a989dd5df6417f0" - integrity sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA== +"@img/sharp-libvips-darwin-x64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz#e63681f4539a94af9cd17246ed8881734386f8cc" + integrity sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg== -"@img/sharp-libvips-linux-arm64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.3.tgz#c9073e5c4b629ee417f777db21c552910d84ed77" - integrity sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ== +"@img/sharp-libvips-linux-arm64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz#b1b288b36864b3bce545ad91fa6dadcf1a4ad318" + integrity sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw== -"@img/sharp-libvips-linux-arm@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.3.tgz#3cbc333fd6b8f224a14d69b03a1dd11df897c799" - integrity sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA== +"@img/sharp-libvips-linux-arm@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz#b9260dd1ebe6f9e3bdbcbdcac9d2ac125f35852d" + integrity sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A== -"@img/sharp-libvips-linux-ppc64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.3.tgz#68e0e0076299f43d838468675674fabcc7161d16" - integrity sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg== +"@img/sharp-libvips-linux-ppc64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz#4b83ecf2a829057222b38848c7b022e7b4d07aa7" + integrity sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA== -"@img/sharp-libvips-linux-s390x@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.3.tgz#7da9ab11a50c0ca905979f0aae14a4ccffab27b2" - integrity sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w== +"@img/sharp-libvips-linux-riscv64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz#880b4678009e5a2080af192332b00b0aaf8a48de" + integrity sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA== -"@img/sharp-libvips-linux-x64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.3.tgz#3b162d6b190cf77926819040e09fb15eec42135e" - integrity sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg== +"@img/sharp-libvips-linux-s390x@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz#74f343c8e10fad821b38f75ced30488939dc59ec" + integrity sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ== -"@img/sharp-libvips-linuxmusl-arm64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.3.tgz#ac99576630dd8e33cb598d7c4586f6e0655912ea" - integrity sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw== +"@img/sharp-libvips-linux-x64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz#df4183e8bd8410f7d61b66859a35edeab0a531ce" + integrity sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw== -"@img/sharp-libvips-linuxmusl-x64@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.3.tgz#93e9495af7bf6c4e0d41dd71d0196c35c3753a1c" - integrity sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g== +"@img/sharp-libvips-linuxmusl-arm64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz#c8d6b48211df67137541007ee8d1b7b1f8ca8e06" + integrity sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw== + +"@img/sharp-libvips-linuxmusl-x64@1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz#be11c75bee5b080cbee31a153a8779448f919f75" + integrity sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg== + +"@img/sharp-linux-arm64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz#7aa7764ef9c001f15e610546d42fce56911790cc" + integrity sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg== + optionalDependencies: + "@img/sharp-libvips-linux-arm64" "1.2.4" -"@img/sharp-linux-arm64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.4.tgz#0570ff1a4fa6e1d6779456fca8b5e8c18a6a9cf2" - integrity sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ== +"@img/sharp-linux-arm@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz#5fb0c3695dd12522d39c3ff7a6bc816461780a0d" + integrity sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw== optionalDependencies: - "@img/sharp-libvips-linux-arm64" "1.2.3" + "@img/sharp-libvips-linux-arm" "1.2.4" -"@img/sharp-linux-arm@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.4.tgz#5f020d933f54f3fc49203d32c3b7dd0ec11ffcdb" - integrity sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA== +"@img/sharp-linux-ppc64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz#9c213a81520a20caf66978f3d4c07456ff2e0813" + integrity sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA== optionalDependencies: - "@img/sharp-libvips-linux-arm" "1.2.3" + "@img/sharp-libvips-linux-ppc64" "1.2.4" -"@img/sharp-linux-ppc64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.4.tgz#8d5775f6dc7e30ea3a1efa43798b7690bb5cb344" - integrity sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ== +"@img/sharp-linux-riscv64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz#cdd28182774eadbe04f62675a16aabbccb833f60" + integrity sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw== optionalDependencies: - "@img/sharp-libvips-linux-ppc64" "1.2.3" + "@img/sharp-libvips-linux-riscv64" "1.2.4" -"@img/sharp-linux-s390x@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.4.tgz#740aa5b369188ee2c1913b1015e7f830f4dfdb50" - integrity sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw== +"@img/sharp-linux-s390x@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz#93eac601b9f329bb27917e0e19098c722d630df7" + integrity sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg== optionalDependencies: - "@img/sharp-libvips-linux-s390x" "1.2.3" + "@img/sharp-libvips-linux-s390x" "1.2.4" -"@img/sharp-linux-x64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.4.tgz#573ce4196b2d0771bba32acc13a37b7adc9b6212" - integrity sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A== +"@img/sharp-linux-x64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz#55abc7cd754ffca5002b6c2b719abdfc846819a8" + integrity sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ== optionalDependencies: - "@img/sharp-libvips-linux-x64" "1.2.3" + "@img/sharp-libvips-linux-x64" "1.2.4" -"@img/sharp-linuxmusl-arm64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.4.tgz#3c91bc8348cc3b42b43c6fca14f9dbb5cb47bd0d" - integrity sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA== +"@img/sharp-linuxmusl-arm64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz#d6515ee971bb62f73001a4829b9d865a11b77086" + integrity sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg== optionalDependencies: - "@img/sharp-libvips-linuxmusl-arm64" "1.2.3" + "@img/sharp-libvips-linuxmusl-arm64" "1.2.4" -"@img/sharp-linuxmusl-x64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.4.tgz#33de7d476ac9e2db7ef654331b54cc679b806bda" - integrity sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg== +"@img/sharp-linuxmusl-x64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz#d97978aec7c5212f999714f2f5b736457e12ee9f" + integrity sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q== optionalDependencies: - "@img/sharp-libvips-linuxmusl-x64" "1.2.3" + "@img/sharp-libvips-linuxmusl-x64" "1.2.4" -"@img/sharp-wasm32@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-wasm32/-/sharp-wasm32-0.34.4.tgz#d617f7b3f851f899802298f360667c20605c0198" - integrity sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA== +"@img/sharp-wasm32@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz#2f15803aa626f8c59dd7c9d0bbc766f1ab52cfa0" + integrity sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw== dependencies: - "@emnapi/runtime" "^1.5.0" + "@emnapi/runtime" "^1.7.0" -"@img/sharp-win32-arm64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.4.tgz#38e2c8a88826eac647f7c3f99efefb39897a8f5c" - integrity sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA== +"@img/sharp-win32-arm64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz#3706e9e3ac35fddfc1c87f94e849f1b75307ce0a" + integrity sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g== -"@img/sharp-win32-ia32@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.4.tgz#003a7eb0fdaba600790c3007cfd756e41a9cf749" - integrity sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw== +"@img/sharp-win32-ia32@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz#0b71166599b049e032f085fb9263e02f4e4788de" + integrity sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg== -"@img/sharp-win32-x64@0.34.4": - version "0.34.4" - resolved "https://registry.yarnpkg.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.4.tgz#b19f1f88ace8bfc20784a0ad31767f3438e025d1" - integrity sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig== +"@img/sharp-win32-x64@0.34.5": + version "0.34.5" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz#a81ffb00e69267cd0a1d626eaedb8a8430b2b2f8" + integrity sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw== "@inquirer/external-editor@^1.0.0": version "1.0.2" @@ -527,10 +546,10 @@ "@emnapi/runtime" "^1.4.3" "@tybys/wasm-util" "^0.10.0" -"@next/env@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/env/-/env-15.5.4.tgz#1d4aa6b238662d9cd95aea356b149b6f73061f95" - integrity sha512-27SQhYp5QryzIT5uO8hq99C69eLQ7qkzkDPsk3N+GuS2XgOgoYEeOav7Pf8Tn4drECOVDsDg8oj+/DVy8qQL2A== +"@next/env@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/env/-/env-16.2.1.tgz#3896715e28c850355b7b1c9c687beb9d7e9cdc40" + integrity sha512-n8P/HCkIWW+gVal2Z8XqXJ6aB3J0tuM29OcHpCsobWlChH/SITBs1DFBk/HajgrwDkqqBXPbuUuzgDvUekREPg== "@next/eslint-plugin-next@15.4.6": version "15.4.6" @@ -539,45 +558,45 @@ dependencies: fast-glob "3.3.1" -"@next/swc-darwin-arm64@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.4.tgz#80cba1bec831d4b01fd03cbc48dfb7050775e5ee" - integrity sha512-nopqz+Ov6uvorej8ndRX6HlxCYWCO3AHLfKK2TYvxoSB2scETOcfm/HSS3piPqc3A+MUgyHoqE6je4wnkjfrOA== - -"@next/swc-darwin-x64@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.4.tgz#d5408b19298f40da2b3dc9c2f9d1063ad98bd626" - integrity sha512-QOTCFq8b09ghfjRJKfb68kU9k2K+2wsC4A67psOiMn849K9ZXgCSRQr0oVHfmKnoqCbEmQWG1f2h1T2vtJJ9mA== - -"@next/swc-linux-arm64-gnu@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.4.tgz#3b6b389bb4a1c9728a14afbbd59d2366ccd80b55" - integrity sha512-eRD5zkts6jS3VfE/J0Kt1VxdFqTnMc3QgO5lFE5GKN3KDI/uUpSyK3CjQHmfEkYR4wCOl0R0XrsjpxfWEA++XA== - -"@next/swc-linux-arm64-musl@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.4.tgz#956127ecdfd56cda535af4651eed72a3b7270971" - integrity sha512-TOK7iTxmXFc45UrtKqWdZ1shfxuL4tnVAOuuJK4S88rX3oyVV4ZkLjtMT85wQkfBrOOvU55aLty+MV8xmcJR8A== - -"@next/swc-linux-x64-gnu@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.4.tgz#9386de65e86c0b34ef19e14f0ffbd4328a08d5e6" - integrity sha512-7HKolaj+481FSW/5lL0BcTkA4Ueam9SPYWyN/ib/WGAFZf0DGAN8frNpNZYFHtM4ZstrHZS3LY3vrwlIQfsiMA== - -"@next/swc-linux-x64-musl@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.4.tgz#c9094e5479b58c89d35b465f165b69be68de5a75" - integrity sha512-nlQQ6nfgN0nCO/KuyEUwwOdwQIGjOs4WNMjEUtpIQJPR2NUfmGpW2wkJln1d4nJ7oUzd1g4GivH5GoEPBgfsdw== - -"@next/swc-win32-arm64-msvc@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.4.tgz#e83ca6b5ce9499bde5a4f3351cf74dc9e92cc83e" - integrity sha512-PcR2bN7FlM32XM6eumklmyWLLbu2vs+D7nJX8OAIoWy69Kef8mfiN4e8TUv2KohprwifdpFKPzIP1njuCjD0YA== - -"@next/swc-win32-x64-msvc@15.5.4": - version "15.5.4" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.4.tgz#5b5baf1bcb0ecba70d1768a0c8be59dfdcb2f111" - integrity sha512-1ur2tSHZj8Px/KMAthmuI9FMp/YFusMMGoRNJaRZMOlSkgvLjzosSdQI0cJAKogdHl3qXUQKL9MGaYvKwA7DXg== +"@next/swc-darwin-arm64@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.1.tgz#8bd5c16ee04eb5f07d4f3ca71a3d5270093a9de6" + integrity sha512-BwZ8w8YTaSEr2HIuXLMLxIdElNMPvY9fLqb20LX9A9OMGtJilhHLbCL3ggyd0TwjmMcTxi0XXt+ur1vWUoxj2Q== + +"@next/swc-darwin-x64@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.1.tgz#4c1a9134cd442e7fcd74bbe85ab283616ece06cb" + integrity sha512-/vrcE6iQSJq3uL3VGVHiXeaKbn8Es10DGTGRJnRZlkNQQk3kaNtAJg8Y6xuAlrx/6INKVjkfi5rY0iEXorZ6uA== + +"@next/swc-linux-arm64-gnu@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.1.tgz#ec08722d22551ea649872df907a8fee027ab1828" + integrity sha512-uLn+0BK+C31LTVbQ/QU+UaVrV0rRSJQ8RfniQAHPghDdgE+SlroYqcmFnO5iNjNfVWCyKZHYrs3Nl0mUzWxbBw== + +"@next/swc-linux-arm64-musl@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.1.tgz#4d6270f5be7905c1a3e4f1c4f9cf4b8c62331561" + integrity sha512-ssKq6iMRnHdnycGp9hCuGnXJZ0YPr4/wNwrfE5DbmvEcgl9+yv97/Kq3TPVDfYome1SW5geciLB9aiEqKXQjlQ== + +"@next/swc-linux-x64-gnu@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.1.tgz#2d55519ba822cd27d9d65ed45a0ace3562df1dcc" + integrity sha512-HQm7SrHRELJ30T1TSmT706IWovFFSRGxfgUkyWJZF/RKBMdbdRWJuFrcpDdE5vy9UXjFOx6L3mRdqH04Mmx0hg== + +"@next/swc-linux-x64-musl@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.1.tgz#607b03c3a5bade2368beb4f5b4cac9c243333638" + integrity sha512-aV2iUaC/5HGEpbBkE+4B8aHIudoOy5DYekAKOMSHoIYQ66y/wIVeaRx8MS2ZMdxe/HIXlMho4ubdZs/J8441Tg== + +"@next/swc-win32-arm64-msvc@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.1.tgz#a96e776f37287b39e309e0850a8d8e2c6c749070" + integrity sha512-IXdNgiDHaSk0ZUJ+xp0OQTdTgnpx1RCfRTalhn3cjOP+IddTMINwA7DXZrwTmGDO8SUr5q2hdP/du4DcrB1GxA== + +"@next/swc-win32-x64-msvc@16.2.1": + version "16.2.1" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.1.tgz#a299bf2b5688029429061d13492c57ccf947c9c5" + integrity sha512-qvU+3a39Hay+ieIztkGSbF7+mccbbg1Tk25hc4JDylf8IHjYmY/Zm64Qq1602yPyQqvie+vf5T/uPwNxDNIoeg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1069,40 +1088,59 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@sitecore-content-sdk/core@1.1.0", "@sitecore-content-sdk/core@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/core/-/core-1.1.0.tgz#0e17b1804992d709f1ad9381a48b82f60fb99f10" - integrity sha512-ERNA8Ei5hBuwzZ8PMYP3PrbSKl5EvUj7gS4GK/+yWU30hyXbo8wkyYMQWCaC3h0jlmyD0OPg9VjFqbPWQvQ0Hg== +"@sitecore-content-sdk/content@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/content/-/content-2.0.1.tgz#ff166f40c61e2a73087beef8568c6b90bc64a825" + integrity sha512-1m9UejE5oPMqVf0Ej7S5jpMouH4bejAWsa8YTEPEV6xQTEbLZ6yxz67GqGGIV+P2D6b/CiNinhLA6shhhzZvkg== dependencies: + "@sitecore-content-sdk/core" "^2.0.1" chalk "^4.1.2" debug "^4.4.0" glob "^11.0.2" graphql "^16.11.0" + url-parse "^1.5.10" + +"@sitecore-content-sdk/core@^2.0.0", "@sitecore-content-sdk/core@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/core/-/core-2.0.1.tgz#575a6308ba8844078398bc634e719b02988a6b00" + integrity sha512-YJbgssX7DtgzQ1H0C9yPzT98NYLeNTTD/9M+2Vau68P8RK+LHUl91edkPsSwvgMg2mpqnDPBvJKzveYpkOvZGQ== + dependencies: + debug "^4.4.0" + graphql "^16.11.0" graphql-request "^6.1.0" memory-cache "^0.2.0" - sinon-chai "^4.0.0" url-parse "^1.5.10" -"@sitecore-content-sdk/nextjs@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/nextjs/-/nextjs-1.1.0.tgz#b7b044fa5d9fd0932b848d5cacaf3b417575c327" - integrity sha512-TbVRKtz6/SUid96y0deWvpKlEH4wxCwYJeMcfjx7wt1K5TTPpdmcGvf0Ln1UeqknXzDGj22E1UP5CFkDwYF/Xg== +"@sitecore-content-sdk/nextjs@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/nextjs/-/nextjs-2.0.1.tgz#151ca4033aed671ea077f593f37075b76fa5e483" + integrity sha512-ZIs3Mffe7vDUCY1mpYSEbSq5Zt3A1QsjFw6+FRI5JYnHh1BeZdUO7EUpDYo6mA9YdzEaG/fUtLYQWbgcmhC6og== dependencies: "@babel/parser" "^7.27.2" - "@sitecore-content-sdk/core" "1.1.0" - "@sitecore-content-sdk/react" "1.1.0" + "@sitecore-content-sdk/content" "^2.0.1" + "@sitecore-content-sdk/core" "^2.0.1" + "@sitecore-content-sdk/react" "^2.0.1" recast "^0.23.11" regex-parser "^2.3.1" sync-disk-cache "^2.1.0" -"@sitecore-content-sdk/react@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/react/-/react-1.1.0.tgz#9c59d0c73824806721e5afa843e2c6bf469c2629" - integrity sha512-SA4gP1oF4pHxueaVEphlWsmrU4O7lHWylGbyjFSvLOVrgjECYNJ49hchuk8VcIU63nAx11r86BCnFrkmEqaJOA== +"@sitecore-content-sdk/react@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/react/-/react-2.0.1.tgz#6f4efc9f87e4795560307ad6b78d6354fde0153a" + integrity sha512-9a2+8K1T3g4FiRrBER7y7suWOU9YEhzT/QxuPKPP+YASGk0rhAHX0TivrHhUEvdCXVBxgMyOQvkVo1wIQrEvMQ== dependencies: - "@sitecore-content-sdk/core" "1.1.0" + "@sitecore-content-sdk/content" "^2.0.1" + "@sitecore-content-sdk/core" "^2.0.1" + "@sitecore-content-sdk/search" "^0.2.1" fast-deep-equal "^3.1.3" +"@sitecore-content-sdk/search@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/search/-/search-0.2.1.tgz#dda44cbb251e2eef1bb775d94e429ae43fd6b5c2" + integrity sha512-Njt3tkb0dhnefjzqOvGveBjlnW2Za7CgZQNkk28MLZfh5PC1C7gs0nf2KF7pMGhEPbyFhQsnhu6OcfygY05o/Q== + dependencies: + "@sitecore-content-sdk/core" "^2.0.1" + "@swc/helpers@0.5.15": version "0.5.15" resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" @@ -1228,12 +1266,12 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-2.1.0.tgz#052aa67a48eccc4309d7f0191b7e41434b90bb78" integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA== -"@types/node@~22.9.0": - version "22.9.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.9.4.tgz#31eefcdbe163a51f53cbfbb3e121b8ae9b16fdb2" - integrity sha512-d9RWfoR7JC/87vj7n+PVTzGg9hDyuFjir3RxUHbjFSKNd9mpxbxwMEyaCim/ddCmy4IuW7HjTzF3g9p3EtWEOg== +"@types/node@^24.10.4": + version "24.12.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.12.0.tgz#6222e028210e5322e4f4f6767f8d88e5ea3b33d2" + integrity sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ== dependencies: - undici-types "~6.19.8" + undici-types "~7.16.0" "@types/normalize-package-data@^2.4.0": version "2.4.4" @@ -1245,17 +1283,17 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== -"@types/react-dom@^19.1.3": - version "19.1.9" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.1.9.tgz#5ab695fce1e804184767932365ae6569c11b4b4b" - integrity sha512-qXRuZaOsAdXKFyOhRBg6Lqqc0yay13vN7KrIg4L7N4aaHN68ma9OK3NE1BoDFgFOTfM7zg+3/8+2n8rLUH3OKQ== +"@types/react-dom@^19.2.3": + version "19.2.3" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.3.tgz#c1e305d15a52a3e508d54dca770d202cb63abf2c" + integrity sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ== -"@types/react@^19.1.2": - version "19.1.16" - resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.16.tgz#6329b1c17a5de624439eae673f86a2c5569a42be" - integrity sha512-WBM/nDbEZmDUORKnh5i1bTnAz6vTohUf9b8esSMu+b24+srbaxa04UbJgWx78CVfNXA20sNu0odEIluZDFdCog== +"@types/react@^19.2.7": + version "19.2.14" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.14.tgz#39604929b5e3957e3a6fa0001dafb17c7af70bad" + integrity sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w== dependencies: - csstype "^3.0.2" + csstype "^3.2.2" "@types/unist@*": version "3.0.3" @@ -1848,6 +1886,11 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +baseline-browser-mapping@^2.9.19: + version "2.10.10" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz#e74bd066724c1d8d7d8ea75fc3be25389a7a5c56" + integrity sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ== + before-after-hook@^2.2.0: version "2.2.3" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" @@ -2419,10 +2462,10 @@ cssstyle@^3.0.0: dependencies: rrweb-cssom "^0.6.0" -csstype@^3.0.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" - integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== +csstype@^3.2.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a" + integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ== damerau-levenshtein@^1.0.8: version "1.0.8" @@ -2620,10 +2663,10 @@ detect-indent@^5.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== -detect-libc@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.1.tgz#9f1e511ace6bb525efea4651345beac424dac7b9" - integrity sha512-ecqj/sy1jcK1uWrwpR67UhYrIFQ+5WlGxth34WquCbamhFA6hkkwiu37o6J5xCHdo1oixJRfVRw+ywV+Hq/0Aw== +detect-libc@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.2.tgz#689c5dcdc1900ef5583a4cb9f6d7b473742074ad" + integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ== diff@^4.0.1: version "4.0.2" @@ -5386,26 +5429,27 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -next@^15.3.1: - version "15.5.4" - resolved "https://registry.yarnpkg.com/next/-/next-15.5.4.tgz#e7412c805c0b686ceaf294de703b7c9be59a4081" - integrity sha512-xH4Yjhb82sFYQfY3vbkJfgSDgXvBB6a8xPs9i35k6oZJRoQRihZH+4s9Yo2qsWpzBmZ3lPXaJ2KPXLfkvW4LnA== +next@^16.1.1: + version "16.2.1" + resolved "https://registry.yarnpkg.com/next/-/next-16.2.1.tgz#8e3ee1051f900e2a52e5978fc1cc3bbd7fe76cad" + integrity sha512-VaChzNL7o9rbfdt60HUj8tev4m6d7iC1igAy157526+cJlXOQu5LzsBXNT+xaJnTP/k+utSX5vMv7m0G+zKH+Q== dependencies: - "@next/env" "15.5.4" + "@next/env" "16.2.1" "@swc/helpers" "0.5.15" + baseline-browser-mapping "^2.9.19" caniuse-lite "^1.0.30001579" postcss "8.4.31" styled-jsx "5.1.6" optionalDependencies: - "@next/swc-darwin-arm64" "15.5.4" - "@next/swc-darwin-x64" "15.5.4" - "@next/swc-linux-arm64-gnu" "15.5.4" - "@next/swc-linux-arm64-musl" "15.5.4" - "@next/swc-linux-x64-gnu" "15.5.4" - "@next/swc-linux-x64-musl" "15.5.4" - "@next/swc-win32-arm64-msvc" "15.5.4" - "@next/swc-win32-x64-msvc" "15.5.4" - sharp "^0.34.3" + "@next/swc-darwin-arm64" "16.2.1" + "@next/swc-darwin-x64" "16.2.1" + "@next/swc-linux-arm64-gnu" "16.2.1" + "@next/swc-linux-arm64-musl" "16.2.1" + "@next/swc-linux-x64-gnu" "16.2.1" + "@next/swc-linux-x64-musl" "16.2.1" + "@next/swc-win32-arm64-msvc" "16.2.1" + "@next/swc-win32-x64-msvc" "16.2.1" + sharp "^0.34.5" node-addon-api@^3.2.1: version "3.2.1" @@ -6348,12 +6392,12 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -react-dom@^19.1.0: - version "19.1.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.1.tgz#2daa9ff7f3ae384aeb30e76d5ee38c046dc89893" - integrity sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw== +react-dom@^19.2.1: + version "19.2.4" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.4.tgz#6fac6bd96f7db477d966c7ec17c1a2b1ad8e6591" + integrity sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ== dependencies: - scheduler "^0.26.0" + scheduler "^0.27.0" react-is@^16.13.1: version "16.13.1" @@ -6365,10 +6409,10 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -react@^19.1.0: - version "19.1.1" - resolved "https://registry.yarnpkg.com/react/-/react-19.1.1.tgz#06d9149ec5e083a67f9a1e39ce97b06a03b644af" - integrity sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ== +react@^19.2.1: + version "19.2.4" + resolved "https://registry.yarnpkg.com/react/-/react-19.2.4.tgz#438e57baa19b77cb23aab516cf635cd0579ee09a" + integrity sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ== read-cmd-shim@3.0.0: version "3.0.0" @@ -6744,10 +6788,10 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.26.0.tgz#4ce8a8c2a2095f13ea11bf9a445be50c555d6337" - integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== +scheduler@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.27.0.tgz#0c4ef82d67d1e5c1e359e8fc76d3a87f045fe5bd" + integrity sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q== "semver@2 || 3 || 4 || 5", semver@^5.6.0: version "5.7.2" @@ -6778,6 +6822,11 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semve resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== +semver@^7.7.3: + version "7.7.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" + integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== + serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" @@ -6828,37 +6877,39 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -sharp@^0.34.3: - version "0.34.4" - resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.34.4.tgz#73c2c5a425e98250b8b927e5537f711da8966e38" - integrity sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA== +sharp@^0.34.5: + version "0.34.5" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.34.5.tgz#b6f148e4b8c61f1797bde11a9d1cfebbae2c57b0" + integrity sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg== dependencies: "@img/colour" "^1.0.0" - detect-libc "^2.1.0" - semver "^7.7.2" + detect-libc "^2.1.2" + semver "^7.7.3" optionalDependencies: - "@img/sharp-darwin-arm64" "0.34.4" - "@img/sharp-darwin-x64" "0.34.4" - "@img/sharp-libvips-darwin-arm64" "1.2.3" - "@img/sharp-libvips-darwin-x64" "1.2.3" - "@img/sharp-libvips-linux-arm" "1.2.3" - "@img/sharp-libvips-linux-arm64" "1.2.3" - "@img/sharp-libvips-linux-ppc64" "1.2.3" - "@img/sharp-libvips-linux-s390x" "1.2.3" - "@img/sharp-libvips-linux-x64" "1.2.3" - "@img/sharp-libvips-linuxmusl-arm64" "1.2.3" - "@img/sharp-libvips-linuxmusl-x64" "1.2.3" - "@img/sharp-linux-arm" "0.34.4" - "@img/sharp-linux-arm64" "0.34.4" - "@img/sharp-linux-ppc64" "0.34.4" - "@img/sharp-linux-s390x" "0.34.4" - "@img/sharp-linux-x64" "0.34.4" - "@img/sharp-linuxmusl-arm64" "0.34.4" - "@img/sharp-linuxmusl-x64" "0.34.4" - "@img/sharp-wasm32" "0.34.4" - "@img/sharp-win32-arm64" "0.34.4" - "@img/sharp-win32-ia32" "0.34.4" - "@img/sharp-win32-x64" "0.34.4" + "@img/sharp-darwin-arm64" "0.34.5" + "@img/sharp-darwin-x64" "0.34.5" + "@img/sharp-libvips-darwin-arm64" "1.2.4" + "@img/sharp-libvips-darwin-x64" "1.2.4" + "@img/sharp-libvips-linux-arm" "1.2.4" + "@img/sharp-libvips-linux-arm64" "1.2.4" + "@img/sharp-libvips-linux-ppc64" "1.2.4" + "@img/sharp-libvips-linux-riscv64" "1.2.4" + "@img/sharp-libvips-linux-s390x" "1.2.4" + "@img/sharp-libvips-linux-x64" "1.2.4" + "@img/sharp-libvips-linuxmusl-arm64" "1.2.4" + "@img/sharp-libvips-linuxmusl-x64" "1.2.4" + "@img/sharp-linux-arm" "0.34.5" + "@img/sharp-linux-arm64" "0.34.5" + "@img/sharp-linux-ppc64" "0.34.5" + "@img/sharp-linux-riscv64" "0.34.5" + "@img/sharp-linux-s390x" "0.34.5" + "@img/sharp-linux-x64" "0.34.5" + "@img/sharp-linuxmusl-arm64" "0.34.5" + "@img/sharp-linuxmusl-x64" "0.34.5" + "@img/sharp-wasm32" "0.34.5" + "@img/sharp-win32-arm64" "0.34.5" + "@img/sharp-win32-ia32" "0.34.5" + "@img/sharp-win32-x64" "0.34.5" shebang-command@^2.0.0: version "2.0.0" @@ -6933,11 +6984,6 @@ sigstore@^1.0.0, sigstore@^1.3.0, sigstore@^1.4.0: "@sigstore/tuf" "^1.0.3" make-fetch-happen "^11.0.1" -sinon-chai@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-4.0.1.tgz#f70000fe0e4f4ab7ceeb3703d3053f8886e0386b" - integrity sha512-xMKEEV3cYHC1G+boyr7QEqi80gHznYsxVdC9CdjP5JnCWz/jPGuXQzJz3PtBcb0CcHAxar15Y5sjLBoAs6a0yA== - slash@3.0.0, slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -7445,7 +7491,7 @@ ts-api-utils@^2.1.0: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91" integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ== -ts-node@^10.9.1: +ts-node@^10.9.1, ts-node@^10.9.2: version "10.9.2" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== @@ -7620,11 +7666,6 @@ typedoc@^0.28.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@~5.4.0: - version "5.4.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" - integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== - typescript@~5.8.3: version "5.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" @@ -7650,10 +7691,10 @@ unbox-primitive@^1.1.0: has-symbols "^1.1.0" which-boxed-primitive "^1.1.1" -undici-types@~6.19.8: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~7.16.0: + version "7.16.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" + integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== unique-filename@^2.0.0: version "2.0.1" From 343296e5c383bc7d016d8e91c59342e1d18e8e5e Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Mon, 23 Mar 2026 10:53:49 -0500 Subject: [PATCH 02/18] version v2.0.0-beta.0 [skip ci] --- lerna.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 2 +- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index c063b71..4a5fde3 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "1.1.1", + "version": "2.0.0-beta.0", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/data/package.json b/packages/data/package.json index d48e4f3..cec2e07 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "^1.1.1", - "@constellation4sitecore-content-sdk/nextjs": "^1.1.1" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index eef27fb..eadca52 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index 505629c..e8b393b 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "^1.1.1", - "@constellation4sitecore-content-sdk/nextjs": "^1.1.1" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index 124fb1c..51b398b 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 9c15fe1..24b9fba 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "^1.1.1" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.0" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 624a01a..5cdcf5c 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index c88ff00..64e9779 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "^1.1.1", - "@constellation4sitecore-content-sdk/mapper": "^1.1.1", - "@constellation4sitecore-content-sdk/nextjs": "^1.1.1" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index 39d28b2..d8a61da 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "^1.1.1", - "@constellation4sitecore-content-sdk/mapper": "^1.1.1", - "@constellation4sitecore-content-sdk/nextjs": "^1.1.1" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index 9c7038a..e951a95 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "^1.1.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index 285d361..f3ba009 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "1.1.1", + "version": "2.0.0-beta.0", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From ac315378677a449b5cc71b9c98002cfbea88db29 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Wed, 8 Apr 2026 15:33:54 -0500 Subject: [PATCH 03/18] Rename To Proxy --- packages/security/src/middleware/index.ts | 1 - .../{middleware/cspMiddleware.ts => proxy/cspProxy.ts} | 10 +++++----- packages/security/src/proxy/index.ts | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 packages/security/src/middleware/index.ts rename packages/security/src/{middleware/cspMiddleware.ts => proxy/cspProxy.ts} (91%) create mode 100644 packages/security/src/proxy/index.ts diff --git a/packages/security/src/middleware/index.ts b/packages/security/src/middleware/index.ts deleted file mode 100644 index 265cce8..0000000 --- a/packages/security/src/middleware/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './cspMiddleware'; diff --git a/packages/security/src/middleware/cspMiddleware.ts b/packages/security/src/proxy/cspProxy.ts similarity index 91% rename from packages/security/src/middleware/cspMiddleware.ts rename to packages/security/src/proxy/cspProxy.ts index 91e21eb..8f09c97 100644 --- a/packages/security/src/middleware/cspMiddleware.ts +++ b/packages/security/src/proxy/cspProxy.ts @@ -12,13 +12,13 @@ export declare type GraphQLRedirectsServiceConfig = { fetch?: typeof fetch; }; -export type CSPMiddlewareConfig = Omit & +export type CSPProxyConfig = Omit & ProxyBaseConfig & CacheOptions; -export class CSPMiddleware extends ProxyBase { +export class CSPProxy extends ProxyBase { private cspService: CSPSettingService; - constructor(protected config: CSPMiddlewareConfig) { + constructor(protected config: CSPProxyConfig) { super(config); this.siteResolver = new SiteResolver(config.sites); this.cspService = new CSPSettingService({ @@ -33,7 +33,7 @@ export class CSPMiddleware extends ProxyBase { try { return await this.handler(req, res); } catch (error) { - console.log('Redirect middleware failed:'); + console.log('CSP proxy failed:'); console.log(error); return res || NextResponse.next(); } @@ -77,7 +77,7 @@ export class CSPMiddleware extends ProxyBase { const contentSecurityPolicyHeaderValue = cspHeader.replace(/\s{2,}/g, ' ').trim(); const requestHeaders = new Headers(req.headers); - // Response will be provided if other middleware is run before us (e.g. redirects) + // Response will be provided if other proxy is run before us (e.g. redirects) requestHeaders.set('x-nonce', nonce); requestHeaders.set('Content-Security-Policy', contentSecurityPolicyHeaderValue); diff --git a/packages/security/src/proxy/index.ts b/packages/security/src/proxy/index.ts new file mode 100644 index 0000000..d26d618 --- /dev/null +++ b/packages/security/src/proxy/index.ts @@ -0,0 +1 @@ +export * from './cspProxy'; From d0336ec159da01e9c232bc5686f7d63ff677b01c Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Wed, 8 Apr 2026 15:35:39 -0500 Subject: [PATCH 04/18] version v2.0.0-beta.1 [skip ci] --- lerna.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 2 +- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 4a5fde3..fc6ca9d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/data/package.json b/packages/data/package.json index cec2e07..bfea94e 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index eadca52..dbe4ce7 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index e8b393b..afe340e 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index 51b398b..862fb22 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 24b9fba..fc9dd79 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.0" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 5cdcf5c..a6c09f3 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index 64e9779..7db4c85 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index d8a61da..8c564ce 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.0", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index e951a95..a88919c 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.0", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index f3ba009..69980d0 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From ae5fa4be1cb35474600042f295fe66dc2a66a2dc Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Wed, 8 Apr 2026 15:39:18 -0500 Subject: [PATCH 05/18] version v2.0.0-beta.2 [skip ci] --- lerna.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 2 +- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index fc6ca9d..770fc94 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/data/package.json b/packages/data/package.json index bfea94e..593f73a 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index dbe4ce7..04e208d 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index afe340e..1e93e64 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index 862fb22..2db87d7 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index fc9dd79..6837aba 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.1" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.2" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index a6c09f3..5e4ae1f 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index 7db4c85..88ffefd 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index 8c564ce..46acd5b 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.1", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index a88919c..c81f6e6 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.1", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index 69980d0..d024f31 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From e7a24a236e89a53e47fb1a13e2cdf6ade384585f Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Wed, 8 Apr 2026 15:45:09 -0500 Subject: [PATCH 06/18] Rename to Proxy --- packages/security/middleware.d.ts | 1 - packages/security/middleware.js | 1 - packages/security/proxy.d.ts | 1 + packages/security/proxy.js | 1 + packages/security/tsconfig.json | 50 +++++++++++++++---------------- 5 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 packages/security/middleware.d.ts delete mode 100644 packages/security/middleware.js create mode 100644 packages/security/proxy.d.ts create mode 100644 packages/security/proxy.js diff --git a/packages/security/middleware.d.ts b/packages/security/middleware.d.ts deleted file mode 100644 index 3db6afb..0000000 --- a/packages/security/middleware.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types/middleware/index'; diff --git a/packages/security/middleware.js b/packages/security/middleware.js deleted file mode 100644 index 0ade5e0..0000000 --- a/packages/security/middleware.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/cjs/middleware/index'); diff --git a/packages/security/proxy.d.ts b/packages/security/proxy.d.ts new file mode 100644 index 0000000..80e69df --- /dev/null +++ b/packages/security/proxy.d.ts @@ -0,0 +1 @@ +export * from './types/proxy/index'; diff --git a/packages/security/proxy.js b/packages/security/proxy.js new file mode 100644 index 0000000..f0ba28e --- /dev/null +++ b/packages/security/proxy.js @@ -0,0 +1 @@ +module.exports = require('./dist/cjs/proxy/index'); diff --git a/packages/security/tsconfig.json b/packages/security/tsconfig.json index 9df2395..172e335 100644 --- a/packages/security/tsconfig.json +++ b/packages/security/tsconfig.json @@ -1,27 +1,27 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "jsx": "react", - "skipLibCheck": true, - "outDir": "dist/cjs", - "typeRoots": ["node_modules/@types"], - "declarationDir": "./types" - }, - "exclude": [ - "node_modules", - "types", - "typings", - "dist", - "middleware.d.ts", - "editing.d.ts", - "monitoring.d.ts", - "site.d.ts", - "utils.d.ts", - "src/tests/*", - "src/test-data/*", - "**/*.test.ts", - "**/*.test.tsx" - ] -} \ No newline at end of file + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "jsx": "react", + "skipLibCheck": true, + "outDir": "dist/cjs", + "typeRoots": ["node_modules/@types"], + "declarationDir": "./types" + }, + "exclude": [ + "node_modules", + "types", + "typings", + "dist", + "proxy.d.ts", + "editing.d.ts", + "monitoring.d.ts", + "site.d.ts", + "utils.d.ts", + "src/tests/*", + "src/test-data/*", + "**/*.test.ts", + "**/*.test.tsx" + ] +} From 59f0cae38624ae4a8702547b0cc7acee9f0be86d Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Wed, 8 Apr 2026 15:45:29 -0500 Subject: [PATCH 07/18] version v2.0.0-beta.3 [skip ci] --- lerna.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 2 +- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 770fc94..7c378ed 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/data/package.json b/packages/data/package.json index 593f73a..a51a5db 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index 04e208d..527e421 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index 1e93e64..42b9024 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index 2db87d7..93542ee 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 6837aba..0e690bf 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.2" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.3" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 5e4ae1f..ff579f3 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index 88ffefd..847ac35 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index 46acd5b..f1d0fd2 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.2", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index c81f6e6..4daf09e 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.2", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index d024f31..9a5169f 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From a08aef89e9e1f892ef3896a2e25fe73153742e27 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 14:38:50 -0500 Subject: [PATCH 08/18] Add Skills --- .agents/skills/README.md | 8 ++ .../skills/nextjs-app-router/skills/Skills.md | 79 ++++++++++++++++ .../SKILL.md | 37 ++++++++ .../SKILL.md | 38 ++++++++ .../content-sdk-component-scaffold/SKILL.md | 38 ++++++++ .../content-sdk-component-variants/SKILL.md | 36 ++++++++ .../content-sdk-dictionary-and-i18n/SKILL.md | 37 ++++++++ .../SKILL.md | 37 ++++++++ .../SKILL.md | 36 ++++++++ .../SKILL.md | 37 ++++++++ .../content-sdk-multisite-management/SKILL.md | 37 ++++++++ .../content-sdk-route-configuration/SKILL.md | 38 ++++++++ .../content-sdk-site-setup-and-env/SKILL.md | 36 ++++++++ .../content-sdk-sitemap-robots/SKILL.md | 37 ++++++++ .../content-sdk-troubleshoot-editing/SKILL.md | 39 ++++++++ .../content-sdk-upgrade-assistant/SKILL.md | 36 ++++++++ .agents/skills/nextjs-pages-router/Skills.md | 79 ++++++++++++++++ .../SKILL.md | 37 ++++++++ .../SKILL.md | 36 ++++++++ .../content-sdk-component-scaffold/SKILL.md | 34 +++++++ .../content-sdk-component-variants/SKILL.md | 36 ++++++++ .../content-sdk-dictionary-and-i18n/SKILL.md | 35 +++++++ .../SKILL.md | 37 ++++++++ .../SKILL.md | 36 ++++++++ .../SKILL.md | 38 ++++++++ .../content-sdk-multisite-management/SKILL.md | 37 ++++++++ .../content-sdk-route-configuration/SKILL.md | 38 ++++++++ .../content-sdk-site-setup-and-env/SKILL.md | 36 ++++++++ .../content-sdk-sitemap-robots/SKILL.md | 37 ++++++++ .../content-sdk-troubleshoot-editing/SKILL.md | 39 ++++++++ .../content-sdk-upgrade-assistant/SKILL.md | 36 ++++++++ .claude/settings.local.json | 7 ++ CLAUDE.md | 91 +++++++++++++++++++ Skills.md | 14 +++ 34 files changed, 1309 insertions(+) create mode 100644 .agents/skills/README.md create mode 100644 .agents/skills/nextjs-app-router/skills/Skills.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-component-data-strategy/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-component-registration/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-component-scaffold/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-component-variants/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-dictionary-and-i18n/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-editing-safe-rendering/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-field-usage-image-link-text/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-graphql-data-fetching/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-multisite-management/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-route-configuration/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-site-setup-and-env/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-sitemap-robots/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-troubleshoot-editing/SKILL.md create mode 100644 .agents/skills/nextjs-app-router/skills/content-sdk-upgrade-assistant/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/Skills.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-component-data-strategy/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-component-registration/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-component-scaffold/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-component-variants/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-dictionary-and-i18n/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-editing-safe-rendering/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-field-usage-image-link-text/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-graphql-data-fetching/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-multisite-management/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-route-configuration/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-site-setup-and-env/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-sitemap-robots/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-troubleshoot-editing/SKILL.md create mode 100644 .agents/skills/nextjs-pages-router/skills/content-sdk-upgrade-assistant/SKILL.md create mode 100644 .claude/settings.local.json create mode 100644 CLAUDE.md create mode 100644 Skills.md diff --git a/.agents/skills/README.md b/.agents/skills/README.md new file mode 100644 index 0000000..30f6d8f --- /dev/null +++ b/.agents/skills/README.md @@ -0,0 +1,8 @@ +# Agent Skills — where they live + +Skills are **not** duplicated at the monorepo root. They are maintained in the scaffolding templates so there is a single source of truth. + +- **App Router template:** [nextjs-app-router/.agents/skills/](./nextjs-app-router/skills/) +- **Pages Router template:** [nextjs/.agents/skills/](./nextjs-pages-router/skills/) + +See the root [Skills.md](../../Skills.md) for links to each template’s capability map and skills. diff --git a/.agents/skills/nextjs-app-router/skills/Skills.md b/.agents/skills/nextjs-app-router/skills/Skills.md new file mode 100644 index 0000000..45cc115 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/Skills.md @@ -0,0 +1,79 @@ +# Skills.md — Capability groupings for this app (Next.js App Router) + +This file describes **this application** in terms of **capability-style groupings**: high-level areas that help AI tools and developers map tasks to the right part of the app. This is an App Router app with `[site]`/`[locale]` segments, next-intl, and separate server/client component maps. For concrete steps and patterns, see [AGENTS.md](AGENTS.md) and the [official Content SDK documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). + +**Agent Skills:** Each grouping is also available as a skill in [.agents/skills/](.agents/skills/) in the standard [Agent Skills](https://agentskills.io) format (`SKILL.md` per capability). Tools that support this standard load skills from `.agents/skills/`; Cursor's built-in skills use `.cursor/skills/` unless it also supports the Agent Skills standard. The skills here are tailored for **App Router** (e.g. setRequestLocale, draftMode(), component-map.ts + component-map.client.ts). + +--- + +## Why capability grouping + +Grouping related capabilities makes it easier to know which area of the app applies to a given task and to point to the right docs and patterns. Map the task to one or more of the groupings below; use AGENTS.md and the official docs for concrete steps. + +--- + +## Capability groupings + +### content-sdk-component-scaffold + +Creating new Sitecore components: file structure, props interface, and placement under `src/components/`. Use when adding a new component from scratch. In App Router, decide Server vs Client and register in the appropriate map. + +### content-sdk-component-registration + +Registering components in `.sitecore/component-map.ts` (Server) and `.sitecore/component-map.client.ts` (Client). Required so layout and editing can resolve and render components. App Router has separate server and client maps. + +### content-sdk-editing-safe-rendering + +Safe rendering in XM Cloud editing and preview: `draftMode()`, editing chromes, and design library. Use when ensuring components work in the Sitecore editor and preview. Use `client.getPreview(searchParams)` or `client.getDesignLibraryData(searchParams)` when draft mode is enabled. + +### content-sdk-field-usage-image-link-text + +Using SDK field components: ``, ``, ``, ``, with proper validation and fallbacks. Use when rendering Sitecore fields. + +### content-sdk-graphql-data-fetching + +Page and dictionary fetching via the single Sitecore client in `src/lib/sitecore-client.ts`. Use `getPage(path ?? [], { site, locale })`, `getDictionary`, `getAppRouterStaticParams` for SSG. For preview use `draftMode()` and `getPreview`/`getDesignLibraryData` from searchParams. + +### content-sdk-route-configuration + +Routing: single catch-all at `src/app/[site]/[locale]/[[...path]]/page.tsx`. Layout: app/layout.tsx → app/[site]/layout.tsx → page. Call `setRequestLocale(\`${site}_${locale}\`)` at top of page. Use placeholders and Layout.tsx as in AGENTS.md. + +### content-sdk-site-setup-and-env + +Site and environment: `sitecore.config.ts`, environment variables, default site and language. Document vars in `.env.example` only; never commit `.env` or `.env.local`. + +### content-sdk-multisite-management + +Multisite: `.sitecore/sites.json`, proxy in `src/proxy.ts`. Chain order is **fixed:** LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Do not change proxy order. + +### content-sdk-dictionary-and-i18n + +Dictionary and i18n: next-intl with `src/i18n/routing.ts` and `src/i18n/request.ts`. Request locale is `${site}_${locale}`; call `setRequestLocale(\`${site}_${locale}\`)`in the page; in request.ts parse and load dictionary with`client.getDictionary({ locale, site })`. + +### content-sdk-sitemap-robots + +Sitemap and robots: `src/app/api/sitemap/route.ts` and `src/app/api/robots/route.ts` with `createSitemapRouteHandler` and `createRobotsRouteHandler`. Rewrites in next.config.ts for /sitemap\*.xml and /robots.txt. + +### content-sdk-component-variants + +Component variants: different renderings or data-driven variants of the same component type. Use when one component has multiple presentations. Register in the appropriate component map (server or client). + +### content-sdk-troubleshoot-editing + +Troubleshooting XM Cloud editing, preview, and design library. Use when editing or preview does not behave as expected. Check draftMode(), getPreview/getDesignLibraryData from searchParams, and component maps. + +### content-sdk-upgrade-assistant + +Upgrading @sitecore-content-sdk/\* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK version. Check the Content SDK repo CHANGELOG and upgrade guides. + +### content-sdk-component-data-strategy + +Component data: layout data from getPage (or getPreview/getDesignLibraryData in editing). Pass site and locale from route params; Server Components use the client in server context; Client Components receive serializable props from parent. BYOC must be registered in the component map. + +--- + +## How to use this + +Map the task to one or more groupings above. Use [AGENTS.md](AGENTS.md) for app-level instructions and the [official documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html) for APIs. + +**If your tool supports Agent Skills:** Load skills from [.agents/skills/](.agents/skills/) (one folder per capability). They provide when-to-use, hard rules, and stop conditions tailored for this App Router app. diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-component-data-strategy/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-component-data-strategy/SKILL.md new file mode 100644 index 0000000..feab549 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-component-data-strategy/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-component-data-strategy +description: Component data for App Router: layout data from getPage (or getPreview/getDesignLibraryData in editing). No getComponentData; pass site and locale from route params. Server Components use the client in server context; Client Components receive serializable props. Use when wiring component data or BYOC. +--- + +# Content SDK Component Data Strategy (App Router) + +This app does **not** use getComponentData. Page and layout data come from **getPage** (or getPreview/getDesignLibraryData in editing). Component props are derived from the layout/placeholders; pass site and locale from route params. + +## When to Use + +- User asks how to pass data to components, wire component props, or integrate custom/BYOC components. +- Task involves component props, server vs client components, or BYOC. +- User mentions "component data," "props," "BYOC," "server component," or "client component." + +## How to perform + +- Fetch at page/layout with getPage (or getPreview/getDesignLibraryData in draft). Pass site and locale from route params. Server Components use the client in server context; Client Components receive serializable props only. Register BYOC in the correct component map and pass props from layout. + +## Hard Rules + +- **Data source:** Page and layout from `client.getPage(path ?? [], { site, locale })` in the catch-all page (or getPreview/getDesignLibraryData when draftMode() is enabled). All Sitecore-driven data flows from this single fetch at the route level. +- **Server Components:** Use the same SitecoreClient in server context (e.g. in the page or layout). Pass data as props to children. +- **Client Components:** Receive **serializable** props from parent (no functions or non-serializable values). Do not create a new client inside components. Pass data from page/layout level into components. +- **BYOC or custom components:** Must be registered in the appropriate component map (.sitecore/component-map.ts or component-map.client.ts) and receive props in the shape the layout expects (e.g. fields, params). +- Do not fetch layout or page data inside a child component (e.g. another getPage call); fetch at page/layout level and pass props. + +## Stop Conditions + +- Stop if the user wants to fetch page/layout data inside a child component; recommend fetching at page/layout level and passing props. +- Stop if server/client boundary is ambiguous and the change could cause "use client" or serialization issues; clarify and follow Next.js and app conventions. +- Do not introduce getComponentData or duplicate getPage logic; this app uses getPage-only data flow. + +## References + +- content-sdk-graphql-data-fetching and [AGENTS.md](../../../AGENTS.md) for getPage and data flow. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-component-registration/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-component-registration/SKILL.md new file mode 100644 index 0000000..ce37a94 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-component-registration/SKILL.md @@ -0,0 +1,38 @@ +--- +name: content-sdk-component-registration +description: Registers Sitecore components in the component map so layout and editing can resolve them. App Router uses .sitecore/component-map.ts (Server) and .sitecore/component-map.client.ts (Client). Use when registering a new component or when layout/editor cannot find a component. +--- + +# Content SDK Component Registration (App Router) + +Register components in the Sitecore component maps so the layout and editing pipeline can resolve and render them. This app has **two** maps: server and client. + +## When to Use + +- After scaffolding or adding a new Sitecore component (must be registered). +- User reports a component not rendering, "component not found," or layout/placeholder showing raw component name. +- Task involves `.sitecore/component-map.ts` or `.sitecore/component-map.client.ts`. +- User asks how to register a component or fix component resolution. + +## How to perform + +- Open `.sitecore/component-map.ts` (Server) or `.sitecore/component-map.client.ts` (Client). Add an entry mapping the layout component name to the React component import. Keep keys consistent with layout and existing map entries. + +## Hard Rules + +- Every component rendered from Sitecore layout must be registered. Keep the maps in sync with `src/components/`. +- **Server components** (no `'use client'`): Register in `.sitecore/component-map.ts` only. +- **Client components** (`'use client'`): Register in `.sitecore/component-map.client.ts` only. Editing API routes use both maps (e.g. `clientComponents` from the client map). +- Use consistent component names (same key in map as used in layout). Follow existing naming in the maps. +- Do not remove or rename registrations without updating all references (layout, editing routes). + +## Stop Conditions + +- Stop if it is unclear whether the new component is Server or Client; ask or follow app convention. +- Stop if modifying the maps would break existing layout or editing; suggest a safe change or ask for confirmation. +- Do not edit `.sitecore/metadata.json` or import-map unless the task explicitly requires it. + +## References + +- [AGENTS.md](../../../AGENTS.md) for component maps and editing routes. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-component-scaffold/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-component-scaffold/SKILL.md new file mode 100644 index 0000000..7fdde7c --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-component-scaffold/SKILL.md @@ -0,0 +1,38 @@ +--- +name: content-sdk-component-scaffold +description: Creates new Sitecore components with correct file structure, props interface, and placement under src/components/. Use when adding a new component from scratch or scaffolding a component. App Router: decide Server vs Client and register in the appropriate map. +--- + +# Content SDK Component Scaffold (App Router) + +Scaffold new Sitecore components so they integrate with the layout and editing pipeline. This app uses App Router with separate server and client component maps. + +## When to Use + +- User asks to add a new Sitecore component, create a component from scratch, or scaffold a component. +- Task involves creating a new React component that will be rendered from Sitecore layout/placeholders. +- User mentions "new component," "add component," or "component file structure." + +## How to perform + +- Create a new file under `src/components/` (or existing feature folder). Define props (fields, params), export a single default component. +- Decide Server vs Client: default Server; add `'use client'` only if the component needs hooks or event handlers. +- Register the component in the correct map (content-sdk-component-registration). Run `npm run build` to verify. + +## Hard Rules + +- Place components under `src/components/`. Use existing folder conventions. +- Define a props interface with the component's fields (e.g. `fields: { title: Field; ... }`) and any params. Use types from `@sitecore-content-sdk/react` or the app's types. +- Export a single default component; one component per file unless the app pattern differs. +- **Server vs Client:** Use Server Components by default. Add `'use client'` only for interactivity (hooks, event handlers). Register Server components in `.sitecore/component-map.ts`; Client components in `.sitecore/component-map.client.ts`. +- After creating the component file, register it in the correct component map (see content-sdk-component-registration). Do not leave the component unregistered. + +## Stop Conditions + +- Stop and ask if the component should be a Server or Client Component when the app does not have a clear convention. +- Do not create components in `.next/`, `node_modules/`, or build output. + +## References + +- [AGENTS.md](../../../AGENTS.md) for app structure and component maps. +- [Skills.md](../../../Skills.md) for capability map. [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-component-variants/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-component-variants/SKILL.md new file mode 100644 index 0000000..ce192b8 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-component-variants/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-component-variants +description: Implements component variants: different renderings or data-driven variants of the same component type. App Router: register in component-map.ts or component-map.client.ts as appropriate. Use when one component has multiple presentations. +--- + +# Content SDK Component Variants (App Router) + +One component definition can have multiple presentations or data-driven variants. Keep registration and layout aligned. This app does not use getComponentData; layout/placeholder data comes from getPage. + +## When to Use + +- User asks for different "variants," "versions," or "presentations" of a component. +- Task involves rendering the same component type with different layouts or props based on data (e.g. variant field or style). +- User mentions "component variants," "variations," or "multiple renderings." + +## How to perform + +- Prefer one component that accepts variant/style via props and branches internally; or multiple map entries if the app pattern uses one key per variant. Use layout/fields/params for variant; register in the correct component map (Server or Client). Align with existing app convention. + +## Hard Rules + +- Prefer a single component registration that accepts variant/style data (e.g. params or fields) and branches internally, over multiple map entries for the same logical component unless the app pattern uses separate registrations per variant. +- Use props (fields, params) from layout to decide variant; do not rely on global state or URL for variant selection when data comes from Sitecore. +- Register in `.sitecore/component-map.ts` (Server) or `.sitecore/component-map.client.ts` (Client) as appropriate. If the app uses one key per variant, register each; if one key with variant param, single registration. Follow existing app convention. +- Keep component maps in sync with src/components/. + +## Stop Conditions + +- Stop if the variant model (one registration vs many) is unclear; ask or follow the app's existing pattern. +- Do not add new component map entries without ensuring layout and editing can provide the corresponding data. +- Do not assume variant field names (e.g. "variant," "style") without checking the layout definition. + +## References + +- [AGENTS.md](../../../AGENTS.md) and content-sdk-component-registration for maps. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-dictionary-and-i18n/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-dictionary-and-i18n/SKILL.md new file mode 100644 index 0000000..ae110a6 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-dictionary-and-i18n/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-dictionary-and-i18n +description: Dictionary and i18n for App Router: next-intl with src/i18n/routing.ts and request.ts. Request locale is site_locale; call setRequestLocale in the page; in request.ts parse and load dictionary with client.getDictionary. Use when adding or changing translated content or locale behavior. +--- + +# Content SDK Dictionary and i18n (App Router) + +This app uses **next-intl**. Locale is in the URL as [locale]. Request locale is encoded as `${site}_${locale}` for next-intl. + +## When to Use + +- User asks to add or change translated content, locale, or dictionary. +- Task involves getDictionary, next-intl, or locale in URL/request. +- User mentions "dictionary," "i18n," "locale," "translation," or "next-intl." + +## How to perform + +- Locales and routing: `src/i18n/routing.ts`. Request config: `src/i18n/request.ts` — parse `requestLocale` (e.g. `${site}_${locale}`), call `client.getDictionary({ locale, site })`, return `{ locale, messages }`. In the page, call `setRequestLocale(\`${site}_${locale}\`)` at the top. Use a single getDictionary per request. + +## Hard Rules + +- **Config:** `src/i18n/routing.ts` — `defineRouting({ locales, defaultLocale, localePrefix })`. Align `locales` with Sitecore languages (e.g. from sitecore.config.ts defaultLanguage). +- **Request config:** `src/i18n/request.ts` — `getRequestConfig` receives `requestLocale`. This app uses `${site}_${locale}` (set by `setRequestLocale(\`${site}_${locale}\`)` in the page). Parse requestLocale (e.g. `split('_')`) to get site and locale; load dictionary with `client.getDictionary({ locale, site })` and return `{ locale, messages }`. +- **In the page:** Call `setRequestLocale(\`${site}_${locale}\`)` at the **top** of the page so next-intl and request config see the correct locale. Do not omit when adding new page branches. +- **Do not** change the `${site}_${locale}` convention without updating request.ts and all pages that call setRequestLocale. +- Use a single client.getDictionary per request for the active site/locale. Never assume locale from headers or global state; use route params (site, locale). + +## Stop Conditions + +- Stop if the user wants to change to a different encoding for requestLocale; this affects request.ts and all setRequestLocale call sites. +- Stop if adding a new locale without confirming it exists in Sitecore and in routing.ts. +- Do not duplicate dictionary fetching (e.g. in layout and page) without a clear need. + +## References + +- [AGENTS.md](../../../AGENTS.md) for next-intl, setRequestLocale, and getDictionary usage. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-editing-safe-rendering/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-editing-safe-rendering/SKILL.md new file mode 100644 index 0000000..3d4a9d4 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-editing-safe-rendering/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-editing-safe-rendering +description: Ensures components render safely in XM Cloud editing and preview. App Router uses draftMode() and getPreview/getDesignLibraryData from searchParams. Use when making components work in the Sitecore editor or fixing preview/editing behavior. +--- + +# Content SDK Editing-Safe Rendering (App Router) + +Ensure components behave correctly in XM Cloud editing, preview, and design library. This app uses **draftMode()** and **searchParams** for editing data. + +## When to Use + +- User asks about editing, preview, design library, or "component not working in editor." +- Task involves draft mode, editing chromes, or design library integration. +- Fixing issues where components render differently or break in editor vs published. +- User mentions getPreview, getDesignLibraryData, or editing API routes. + +## How to perform + +- In the page or layout: call `draftMode()`; when enabled, read editing params from searchParams, use `isDesignLibraryPreviewData(editingParams)` to choose getDesignLibraryData vs getPreview; otherwise use getPage. Editing routes: config route uses `createEditingConfigRouteHandler`, render route uses `createEditingRenderRouteHandlers`; set `dynamic = 'force-dynamic'` on both. + +## Hard Rules + +- Use `draftMode()` in Server Components (e.g. in the page or [site] layout). When `draft.isEnabled`, get editing params from **searchParams** and use `isDesignLibraryPreviewData(editingParams)` to distinguish: if true, use `client.getDesignLibraryData(editingParams)`; otherwise use `client.getPreview(editingParams)`. When not in draft mode, use `getPage(path ?? [], { site, locale })`. +- Do not assume editing/preview context in components that might run in static or non-editing contexts; guard on `draftMode()`. +- Editing API routes: `src/app/api/editing/config/route.ts` uses `createEditingConfigRouteHandler({ components, clientComponents, metadata })` (import from `.sitecore/component-map`, `.sitecore/component-map.client`, `.sitecore/metadata.json`). `src/app/api/editing/render/route.ts` uses `createEditingRenderRouteHandlers({})`. Set `export const dynamic = 'force-dynamic'` on both. Do not duplicate client creation; config and render routes use the same component maps as the app. +- Never commit editing secrets; use environment variables and document in .env.example only. + +## Stop Conditions + +- Stop and clarify if the issue is preview vs design library vs published; behavior differs. +- Do not change proxy or middleware order to "fix" editing; editing is driven by API routes and draft/preview data. +- Do not recommend disabling secret validation without explicit user request and warning. + +## References + +- [AGENTS.md](../../../AGENTS.md) for data fetching, preview flow, and editing routes. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-field-usage-image-link-text/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-field-usage-image-link-text/SKILL.md new file mode 100644 index 0000000..1b2031c --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-field-usage-image-link-text/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-field-usage-image-link-text +description: Renders Sitecore fields using SDK field components (Text, RichText, Image, Link) with proper validation and fallbacks. Use when rendering content fields or when the user mentions Text, RichText, Image, Link, or field components. +--- + +# Content SDK Field Usage (App Router) + +Use SDK field components to render Sitecore fields with proper validation and fallbacks. + +## When to Use + +- User asks how to render a title, body, image, or link from Sitecore. +- Task involves displaying content fields, fixing empty/broken images or links, or using RichText/Text/Image/Link components. +- User mentions "field," "Image," "Link," "Text," "RichText," or "field value." + +## How to perform + +- Use SDK field components: ``, ``, ``, ``. Guard with `fields?.` when optional; use tag prop on Text when needed. Do not hardcode media or link URLs from Sitecore. + +## Hard Rules + +- Prefer SDK field components over manual field value extraction: ``, ``, ``, ``. Use tag prop for Text when needed (e.g. tag="h1"). +- Validate or guard field existence before rendering when fields can be optional (e.g. `fields?.title`). Handle null/undefined and empty fields gracefully. +- Do not hardcode image or link URLs when the data comes from Sitecore; use the field components or helpers that resolve media/URLs. +- Follow the app's import pattern (e.g. from lib or components). + +## Stop Conditions + +- Stop if the field structure (name or type) is unknown; suggest checking the layout/data shape or asking the user. +- Do not assume field names (e.g. "title") without confirmation when the template might use different names. +- Do not commit or log raw field values that might contain PII or secrets. + +## References + +- [AGENTS.md](../../../AGENTS.md) for component and Sitecore patterns. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-graphql-data-fetching/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-graphql-data-fetching/SKILL.md new file mode 100644 index 0000000..5b0ee4a --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-graphql-data-fetching/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-graphql-data-fetching +description: Fetches page data and dictionary via the single Sitecore client. App Router: getPage(path ?? [], { site, locale }), getDictionary, getAppRouterStaticParams; for preview use draftMode() and getPreview/getDesignLibraryData from searchParams. Use when fetching page or dictionary content. +--- + +# Content SDK GraphQL Data Fetching (App Router) + +All Sitecore data fetching goes through the single client in `src/lib/sitecore-client.ts`. Use getPage, getDictionary, and related methods correctly. This app does **not** use getComponentData; layout data comes from getPage. + +## When to Use + +- User asks how to fetch page data, layout, or dictionary phrases. +- Task involves getPage, getDictionary, getErrorPage, getPreview, getDesignLibraryData, or getAppRouterStaticParams. +- User mentions "sitecore client," "Layout Service," "page data," or "dictionary." + +## How to perform + +- Use the client from `src/lib/sitecore-client.ts` only. In the catch-all page: `await params`, then `client.getPage(path ?? [], { site, locale })`. For SSG use `generateStaticParams` and `client.getAppRouterStaticParams(siteNames, locales)`. For preview use `draftMode()` and `getPreview`/`getDesignLibraryData` from searchParams. + +## Hard Rules + +- Use the single SitecoreClient instance in `src/lib/sitecore-client.ts`. Do not create a second client or instantiate SitecoreClient elsewhere. +- Pass **site** and **locale** from route params (e.g. `await params` in the page). Do not rely on global state for site/locale in server code. +- **Catch-all page:** `client.getPage(path ?? [], { site, locale })`. Params are a Promise (Next.js 15+); use `await params` to get `{ site, locale, path? }`. +- **Preview:** Use `draftMode()`; if `draft.isEnabled`, use `client.getPreview(editingParams)` or `client.getDesignLibraryData(editingParams)` from **searchParams**. Otherwise use getPage with site and locale. +- **SSG:** `generateStaticParams` — use `client.getAppRouterStaticParams(siteNames, locales)` where site names come from `.sitecore/sites.json` (e.g. `sites.map((s) => s.name)`), locales from `src/i18n/routing.ts` (e.g. `routing.locales.slice()`). Return at least one default param when not generating full paths (e.g. `{ site, locale, path: [] }`). +- Config for the client comes from `sitecore.config.ts`; use environment variables, never hardcode secrets. + +## Stop Conditions + +- Stop if the task requires moving the client to another folder without clear requirement; suggest keeping a single instance in lib. +- Do not add direct GraphQL or fetch to Layout Service bypassing the client unless the task explicitly requires it. + +## References + +- [AGENTS.md](../../../AGENTS.md) for SitecoreClient, getPage, getDictionary, and SSG. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-multisite-management/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-multisite-management/SKILL.md new file mode 100644 index 0000000..452b3a5 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-multisite-management/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-multisite-management +description: Handles multisite: site resolution, .sitecore/sites.json, and proxy in src/proxy.ts. App Router proxy order is fixed: LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Use when working with multiple sites or hostnames. +--- + +# Content SDK Multisite Management (App Router) + +Site resolution from request (e.g. hostname or cookie); proxy rewrites to /[site]/[locale]/...path. **Locale must run first** so next-intl and multisite see the correct locale. + +## When to Use + +- User asks about multiple sites, hostnames, or site resolution. +- Task involves .sitecore/sites.json, multisite config, or proxy/middleware for site. +- User mentions "multisite," "site resolution," "hostname," or "sites.json." + +## How to perform + +- Site list: `.sitecore/sites.json`. Proxy logic lives in `src/proxy.ts`; ensure `src/middleware.ts` re-exports it if present. Keep chain order: LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. Exclude API, _next, static assets in the matcher. + +## Hard Rules + +- Site list is in `.sitecore/sites.json` (typically generated by Sitecore CLI or deployment). Avoid hand-editing unless the format is known. +- **Proxy:** Implemented in `src/proxy.ts`. Next.js runs middleware from `middleware.ts` at root or in `src/` — if the app only has `proxy.ts`, add `src/middleware.ts` that re-exports it. +- **Chain order is fixed:** LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy. **Do not change this order.** LocaleProxy runs first so i18n and multisite see the correct locale. AppRouterMultisiteProxy rewrites to /[site]/[locale]/[...path]. +- **Matcher:** Exclude API routes, _next/, sitemap, robots, healthz, Sitecore paths, and static assets so the proxy stays lightweight. +- Config: sitecore.config.ts → multisite, redirects, personalize. Single SitecoreClient; pass resolved site and locale from route params into getPage, getDictionary, etc. + +## Stop Conditions + +- Stop if the user wants to reorder the proxy chain; explain that LocaleProxy must run first for App Router. +- Stop if sites.json format is unknown and the change could break resolution; suggest checking SDK docs or CLI output. +- Do not add a second site resolution mechanism; use the existing proxy and config. + +## References + +- [AGENTS.md](../../../AGENTS.md) for proxy chain, matcher, and multisite config. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-route-configuration/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-route-configuration/SKILL.md new file mode 100644 index 0000000..03b4216 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-route-configuration/SKILL.md @@ -0,0 +1,38 @@ +--- +name: content-sdk-route-configuration +description: Configures routing and layout for App Router. Single catch-all at src/app/[site]/[locale]/[[...path]]/page.tsx; call setRequestLocale at top of page. Use when changing routing, placeholders, or Layout. +--- + +# Content SDK Route Configuration (App Router) + +Single catch-all route and layout hierarchy. Site and locale are **in the path**; proxy rewrites incoming requests to /[site]/[locale]/...path. + +## When to Use + +- User asks to change routing, add a route, or fix 404/not-found behavior. +- Task involves catch-all route, placeholders, root layout, or Layout.tsx. +- User mentions "[site]," "[locale]," "[[...path]]," "placeholder," or "layout hierarchy." + +## How to perform + +- Single Sitecore page: `src/app/[site]/[locale]/[[...path]]/page.tsx`. Use `await params` for `{ site, locale, path? }`; pass to getPage and call `setRequestLocale(\`${site}_${locale}\`)` at the top. Layout: app/layout.tsx → app/[site]/layout.tsx (Bootstrap, draftMode) → page. Not-found: use getCachedPageParams and getErrorPage in the route's not-found.tsx. + +## Hard Rules + +- **Single Sitecore page:** `src/app/[site]/[locale]/[[...path]]/page.tsx`. This is the **only** page that renders Sitecore content. Do not add another page or catch-all for Sitecore content. +- **Params:** Next.js 15+ — `params` is a Promise. Use `await params` to get `{ site, locale, path? }`. Pass `site` and `locale` to `client.getPage(path ?? [], { site, locale })`. +- **Locale for next-intl:** Call `setRequestLocale(\`${site}_${locale}\`)` at the **top** of the page so next-intl and `src/i18n/request.ts` see the correct locale. Do not omit when adding new page branches. +- **Layout hierarchy:** `app/layout.tsx` → `app/[site]/layout.tsx` (Bootstrap with `siteName={site}` and `draftMode()`) → page. Do not put site/locale-specific data fetching in the root layout. +- Placeholders are rendered by the layout (e.g. Placeholder component); do not change placeholder names or structure without aligning with Sitecore layout definition. +- **Not-found:** `src/app/[site]/[locale]/[[...path]]/not-found.tsx`. For Sitecore-driven 404 use `getCachedPageParams()` from `@sitecore-content-sdk/nextjs` for site/locale, then `client.getErrorPage(ErrorPage.NotFound, { site, locale })`. + +## Stop Conditions + +- Stop if the user wants to add a second catch-all or a different URL shape for Sitecore pages; explain single-entry-point constraint. +- Stop if changing proxy/middleware order; order is fixed (LocaleProxy → AppRouterMultisiteProxy → RedirectsProxy → PersonalizeProxy). +- Do not move or rename the catch-all file without updating all references. + +## References + +- [AGENTS.md](../../../AGENTS.md) for exact paths, params, and layout hierarchy. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-site-setup-and-env/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-site-setup-and-env/SKILL.md new file mode 100644 index 0000000..3c7ea80 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-site-setup-and-env/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-site-setup-and-env +description: Configures site and environment: sitecore.config.ts, environment variables, default site and language. Use when configuring the app or adding env vars. Document in .env.example only; never commit .env or .env.local. +--- + +# Content SDK Site Setup and Environment (App Router) + +Central config in sitecore.config.ts; all secrets and environment-specific values via env vars. + +## When to Use + +- User asks to configure site, default language, API host, or environment. +- Task involves sitecore.config.ts, .env, or defaultSite/defaultLanguage. +- User mentions "config," "environment variables," "API key," or "default site." + +## How to perform + +- Edit `sitecore.config.ts` with `defineConfig`; read all secrets and env-specific values from `process.env.*`. Add or change vars in `.env.example` (or `.env.remote.example` / `.env.container.example`) with placeholders; never commit `.env` or `.env.local`. + +## Hard Rules + +- Use `sitecore.config.ts` with `defineConfig` from the SDK. Expose api (edge, local), defaultSite, defaultLanguage, editingSecret, multisite, redirects, personalize as needed. +- All sensitive or environment-specific values must come from environment variables (e.g. process.env.SITECORE_API_KEY). Never hardcode API keys, secrets, or production URLs in source. +- Document every new or changed env var in `.env.example` (or `.env.remote.example` / `.env.container.example`). Use placeholder or empty value and a short comment; never put real secrets in example files. +- Never commit `.env` or `.env.local`; they are gitignored. Example files are the source of truth for which vars exist. + +## Stop Conditions + +- Stop if the user wants to commit real secrets or production values; insist on env vars and .env.example only. +- Stop if adding a new env var would require CI or deployment changes without explicit instruction; document the var and note that deployment must set it. +- Do not edit .next/, node_modules/, or lockfiles unless the task explicitly requires it. + +## References + +- [AGENTS.md](../../../AGENTS.md) for boundaries and env rules. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-sitemap-robots/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-sitemap-robots/SKILL.md new file mode 100644 index 0000000..2e662e4 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-sitemap-robots/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-sitemap-robots +description: Sitemap and robots.txt for App Router: src/app/api/sitemap/route.ts and src/app/api/robots/route.ts with createSitemapRouteHandler and createRobotsRouteHandler. Rewrites in next.config.ts. Use when configuring sitemap, robots.txt, or SEO. +--- + +# Content SDK Sitemap and Robots (App Router) + +Sitemap and robots.txt are served via **route handlers** and rewrites. Use the SDK route handler helpers and sites from .sitecore/sites.json. + +## When to Use + +- User asks to add or change sitemap or robots.txt. +- Task involves SEO, sitemap.xml, or robots route. +- User mentions "sitemap," "robots," "SEO," or "rewrites." + +## How to perform + +- Sitemap: `src/app/api/sitemap/route.ts` with `createSitemapRouteHandler({ client, sites })`; robots: `src/app/api/robots/route.ts` with `createRobotsRouteHandler({ client, sites })`. Use sites from `.sitecore/sites.json`. Add rewrites in `next.config.ts` for `/sitemap*.xml` and `/robots.txt` with `locale: false`. Set `dynamic = 'force-dynamic'` if needed. + +## Hard Rules + +- **Sitemap:** `src/app/api/sitemap/route.ts` — use `createSitemapRouteHandler({ client, sites })`. Export `{ GET }`. Use `sites` from `.sitecore/sites.json`. Set `export const dynamic = 'force-dynamic'` if the handler relies on request. +- **Robots:** `src/app/api/robots/route.ts` — use `createRobotsRouteHandler({ client, sites })`. Same pattern. +- **Rewrites:** In `next.config.ts`, add rewrites for `/sitemap*.xml` and `/robots.txt` to these route handlers. Use `locale: false` so they are not localized. +- Use the same SitecoreClient instance as the rest of the app; do not create a dedicated client for sitemap/robots. +- Avoid hardcoding the site list; use .sitecore/sites.json. + +## Stop Conditions + +- Stop if the user wants to serve sitemap/robots from a different origin or with different auth; document and suggest proxy or edge config. +- Do not add new env vars for sitemap/robots without documenting them in .env.example. +- Do not change rewrite paths without updating docs and any references. + +## References + +- [AGENTS.md](../../../AGENTS.md) for API routes and rewrites. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-troubleshoot-editing/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-troubleshoot-editing/SKILL.md new file mode 100644 index 0000000..a07b7ed --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-troubleshoot-editing/SKILL.md @@ -0,0 +1,39 @@ +--- +name: content-sdk-troubleshoot-editing +description: Troubleshoots XM Cloud editing, preview, and design library for App Router. Check draftMode(), getPreview/getDesignLibraryData from searchParams, setRequestLocale, and component maps. Use when editing or preview does not behave as expected. +--- + +# Content SDK Troubleshoot Editing (App Router) + +This skill focuses on **diagnosing** editing, preview, and design library issues. For implementing editing-safe rendering (draftMode, getPreview/getDesignLibraryData, API routes), use the **content-sdk-editing-safe-rendering** skill; the two are complementary (implementation vs. troubleshooting). + +Diagnose and fix editing, preview, and design library issues without breaking the single client or proxy order. This app uses **draftMode()** and **searchParams** for preview data. + +## When to Use + +- User reports that editing, preview, or design library is broken or inconsistent. +- Task involves debugging "not working in editor," missing chromes, or wrong data in preview. +- User mentions "editing broken," "preview not working," "design library," or "editor issues." + +## How to perform + +- Confirm `draftMode()` and searchParams-based getPreview/getDesignLibraryData; ensure `setRequestLocale` is called at the top of the page. Verify editing API routes are not rewritten (check proxy matcher) and both component maps include the component. Check env (editingSecret, API config) and .env.example documentation. + +## Hard Rules + +- **Preview flow:** Use `draftMode()` in Server Components; when enabled, use `client.getPreview(editingParams)` or `client.getDesignLibraryData(editingParams)` from **searchParams**. Ensure site/locale are passed correctly (e.g. from route params or editingParams). +- **next-intl:** Ensure `setRequestLocale(\`${site}_${locale}\`)` is called at the top of the page; missing setRequestLocale can cause locale or dictionary issues in editor. +- Editing API routes (`src/app/api/editing/config/route.ts`, `editing/render/route.ts`) must be reachable and use the same component maps (component-map.ts and component-map.client.ts) and config as the app. Check matcher in proxy.ts so /api/editing is not rewritten or blocked. +- Check that both component maps include all components used in the layout; missing registration causes "component not found" in editor. +- Environment: editingSecret and API config must be set (in env); document in .env.example only. Do not log or commit secrets. + +## Stop Conditions + +- Stop if the fix would require changing CI, deployment, or XM Cloud project settings; suggest the user do that and document the required env or config. +- Stop if the issue might be in Sitecore (layout, template) rather than the app; suggest checking layout and content in XM Cloud. +- Do not recommend disabling security (e.g. skipping secret validation) without explicit user request and warning. + +## References + +- content-sdk-editing-safe-rendering skill and [AGENTS.md](../../../AGENTS.md) for preview and editing flow. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-app-router/skills/content-sdk-upgrade-assistant/SKILL.md b/.agents/skills/nextjs-app-router/skills/content-sdk-upgrade-assistant/SKILL.md new file mode 100644 index 0000000..25aa812 --- /dev/null +++ b/.agents/skills/nextjs-app-router/skills/content-sdk-upgrade-assistant/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-upgrade-assistant +description: Guides upgrading @sitecore-content-sdk/* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK or package version. Check Content SDK repo CHANGELOG and upgrade guides. +--- + +# Content SDK Upgrade Assistant (App Router) + +Upgrade @sitecore-content-sdk/* packages safely; follow the Content SDK repo changelog and migration guides. + +## When to Use + +- User asks to upgrade SDK packages, update to a new version, or apply a migration. +- Task involves version bumps, @sitecore-content-sdk/* dependencies, or breaking changes. +- User mentions "upgrade," "migration," "new version," or "breaking change." + +## How to perform + +- Bump all @sitecore-content-sdk/* to consistent versions; read the Content SDK repo CHANGELOG (and MIGRATION/upgrade docs) for breaking changes and migration steps. Update package.json, run `npm install` and `npm run build`; test editing and preview after upgrade. + +## Hard Rules + +- Prefer upgrading all @sitecore-content-sdk/* packages together to a consistent set of versions unless the user requests a partial upgrade. Check peer dependencies and compatibility. +- Update dependencies in package.json; run `npm install` and `npm run build`. Test editing and preview after upgrade. +- Read the **Content SDK repository** CHANGELOG (and any MIGRATION.md or upgrade guide) for breaking changes and required code/config updates. Apply migration steps before or with the version bump. +- Do not edit .next/, node_modules/, or lockfiles unless required for the upgrade. Do not change CI or root tooling unless the task explicitly includes it. + +## Stop Conditions + +- Stop if the target version is not specified or unclear; ask or suggest checking the Content SDK CHANGELOG and supported versions. +- Stop if a breaking change requires product or deployment decisions (e.g. new env vars, config schema); list required changes and ask the user to confirm. + +## References + +- Content SDK repo [CHANGELOG](https://github.com/Sitecore/content-sdk/blob/dev/CHANGELOG.md) and upgrade docs. +- [AGENTS.md](../../../AGENTS.md) for build commands. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/Skills.md b/.agents/skills/nextjs-pages-router/Skills.md new file mode 100644 index 0000000..314d84b --- /dev/null +++ b/.agents/skills/nextjs-pages-router/Skills.md @@ -0,0 +1,79 @@ +# Skills.md — Capability groupings for this app (Next.js Pages Router) + +This file describes **this application** in terms of **capability-style groupings**: high-level areas that help AI tools and developers map tasks to the right part of the app. This is a Pages Router app with `pages/[[...path]].tsx`, Next.js i18n, and a single component map. For concrete steps and patterns, see [AGENTS.md](AGENTS.md) and the [official Content SDK documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). + +**Agent Skills:** Each grouping is also available as a skill in [.agents/skills/](.agents/skills/) in the standard [Agent Skills](https://agentskills.io) format (`SKILL.md` per capability). Tools that support this standard load skills from `.agents/skills/`; Cursor's built-in skills use `.cursor/skills/` unless it also supports the Agent Skills standard. The skills here are tailored for **Pages Router** (e.g. extractPath, context.locale, getComponentData, single component-map.ts). + +--- + +## Why capability grouping + +Grouping related capabilities makes it easier to know which area of the app applies to a given task and to point to the right docs and patterns. Map the task to one or more of the groupings below; use AGENTS.md and the official docs for concrete steps. + +--- + +## Capability groupings + +### content-sdk-component-scaffold + +Creating new Sitecore components: file structure, props interface, and placement under `src/components/`. Use when adding a new component from scratch. Register in `.sitecore/component-map.ts`. + +### content-sdk-component-registration + +Registering components in `.sitecore/component-map.ts` only. Required so layout and editing can resolve and render components. Used by getComponentData and editing API routes. Pages Router has a single map. + +### content-sdk-editing-safe-rendering + +Safe rendering in XM Cloud editing and preview: `context.preview` and `context.previewData`, editing chromes, and design library. Use when ensuring components work in the Sitecore editor and preview. Use `client.getPreview(context.previewData)` or `client.getDesignLibraryData(context.previewData)` when in preview. + +### content-sdk-field-usage-image-link-text + +Using SDK field components: ``, ``, ``, ``, with proper validation and fallbacks. Use when rendering Sitecore fields. + +### content-sdk-graphql-data-fetching + +Page, dictionary, and component data via the single Sitecore client in `src/lib/sitecore-client.ts`. Use `getPage(path, { locale: context.locale })`, then `getDictionary({ site: page.siteName, locale: page.locale })` and `getComponentData(page.layout, context, components)`. For SSG use `getPagePaths(sites, context?.locales)`. + +### content-sdk-route-configuration + +Routing: single catch-all at `src/pages/[[...path]].tsx`. Path from `extractPath(context)`; locale from `context.locale`. Layout and page data flow via getStaticProps/getServerSideProps to \_app and Layout.tsx. No [site]/[locale] in path; site resolved by middleware. + +### content-sdk-site-setup-and-env + +Site and environment: `sitecore.config.ts`, environment variables, default site and language. Document vars in `.env.example` only; never commit `.env` or `.env.local`. + +### content-sdk-multisite-management + +Multisite: `.sitecore/sites.json`, proxy in `src/proxy.ts`. Chain order is **fixed:** MultisiteProxy → RedirectsProxy → PersonalizeProxy. Do not change proxy order. + +### content-sdk-dictionary-and-i18n + +Dictionary and i18n: Next.js i18n in `next.config.js` (i18n.locales, defaultLocale). Per-request locale is `context.locale` in getStaticProps/getServerSideProps. Fetch dictionary with `client.getDictionary({ site: page.siteName, locale: page.locale })` after getPage. + +### content-sdk-sitemap-robots + +Sitemap and robots: `src/pages/api/sitemap.ts` and `src/pages/api/robots.ts` with `SitemapMiddleware(scClient, sites).getHandler()` and `RobotsMiddleware(scClient, sites).getHandler()`. Rewrites in next.config.js for /sitemap\*.xml and /robots.txt. + +### content-sdk-component-variants + +Component variants: different renderings or data-driven variants of the same component type. Use when one component has multiple presentations. Register in `.sitecore/component-map.ts`; getComponentData resolves props. + +### content-sdk-troubleshoot-editing + +Troubleshooting XM Cloud editing, preview, and design library. Use when editing or preview does not behave as expected. Check context.preview, context.previewData, and editing API routes (config, render, feaas/render). + +### content-sdk-upgrade-assistant + +Upgrading @sitecore-content-sdk/\* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK version. Check the Content SDK repo CHANGELOG and upgrade guides. + +### content-sdk-component-data-strategy + +Component data: after getPage, use `client.getComponentData(page.layout, context, components)` to resolve component props; pass result to layout renderer. All Sitecore-driven component data goes through this flow. BYOC must be registered in `.sitecore/component-map.ts`. + +--- + +## How to use this + +Map the task to one or more groupings above. Use [AGENTS.md](AGENTS.md) for app-level instructions and the [official documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html) for APIs. + +**If your tool supports Agent Skills:** Load skills from [.agents/skills/](.agents/skills/) (one folder per capability). They provide when-to-use, hard rules, and stop conditions tailored for this Pages Router app. diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-component-data-strategy/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-data-strategy/SKILL.md new file mode 100644 index 0000000..05f9600 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-data-strategy/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-component-data-strategy +description: Component data for Pages Router: after getPage use client.getComponentData(page.layout, context, components) to resolve component props; pass result to layout renderer. All Sitecore-driven component data goes through this flow. Use when wiring component data or BYOC. +--- + +# Content SDK Component Data Strategy (Pages Router) + +This app **uses getComponentData**. After getPage, use **client.getComponentData(page.layout, context, components)** to resolve component props and pass the result to the layout renderer. All Sitecore-driven component data goes through this flow. + +## When to Use + +- User asks how to pass data to components, wire component props, or integrate custom/BYOC components. +- Task involves getComponentData, component props, or BYOC. +- User mentions "component data," "props," "BYOC," or "getComponentData." + +## How to perform + +- In [[...path]].tsx: getPage(path, { locale: context.locale }), then getDictionary, then getComponentData(page.layout, context, components). Return props to Layout; do not fetch in _app or in child components. Register BYOC in .sitecore/component-map.ts; getComponentData passes resolved props. + +## Hard Rules + +- **Flow in catch-all page:** In getStaticProps/getServerSideProps: (1) `client.getPage(path, { locale: context.locale })`, (2) `client.getDictionary({ site: page.siteName, locale: page.locale })`, (3) `client.getComponentData(page.layout, context, components)` to resolve component props. Return `{ props: { page, dictionary, componentProps }, notFound: !page }`. Pass these props to Providers and Layout; do not fetch Sitecore data in _app. +- Do not fetch per-component data in parallel outside this flow unless the app pattern explicitly does so. All Sitecore-driven component data goes through getComponentData. +- Single client instance; do not create a new client inside components. The client is used in getStaticProps/getServerSideProps and in API routes. +- **BYOC or custom components:** Must be registered in `.sitecore/component-map.ts` and receive props in the shape the layout expects (e.g. fields, params). getComponentData will pass the resolved props. +- Do not fetch layout or page data inside a child component (e.g. another getPage call); fetch at the catch-all page level and pass props via getComponentData and layout. + +## Stop Conditions + +- Stop if the user wants to fetch page/layout data inside a child component; recommend fetching in [[...path]].tsx and passing via getComponentData and layout. +- Do not duplicate getComponentData or getPage logic across components; keep data fetching in the catch-all page only. +- Do not fetch Sitecore data in _app; all data flows from [[...path]].tsx. + +## References + +- content-sdk-graphql-data-fetching and [AGENTS.md](../../../AGENTS.md) for getPage, getComponentData, and data flow. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-component-registration/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-registration/SKILL.md new file mode 100644 index 0000000..cc1b3d3 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-registration/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-component-registration +description: Registers Sitecore components in .sitecore/component-map.ts so layout and editing can resolve them. Pages Router uses a single map; used by getComponentData and editing API routes. Use when registering a new component or when layout/editor cannot find a component. +--- + +# Content SDK Component Registration (Pages Router) + +Register components in the Sitecore component map so the layout and editing pipeline can resolve and render them. This app has a **single** map: `.sitecore/component-map.ts`. + +## When to Use + +- After scaffolding or adding a new Sitecore component (must be registered). +- User reports a component not rendering, "component not found," or layout/placeholder showing raw component name. +- Task involves `.sitecore/component-map.ts`. +- User asks how to register a component or fix component resolution. + +## How to perform + +- Open `.sitecore/component-map.ts` and add an entry mapping the layout component name to the React component import. The map is used by getComponentData and editing API routes; keep keys consistent with layout and existing entries. + +## Hard Rules + +- Every component rendered from Sitecore layout must be registered in `.sitecore/component-map.ts`. Keep the map in sync with `src/components/`. +- The map is used by `getComponentData(page.layout, context, components)` in the catch-all page and by editing API routes (`src/pages/api/editing/config.ts`, `render.ts`, `feaas/render.ts`). +- Use consistent component names (same key in map as used in layout). Follow existing naming in the map. +- Do not remove or rename registrations without updating all references (layout, getComponentData, editing routes). + +## Stop Conditions + +- Stop if modifying the component map would break existing layout or editing; suggest a safe change or ask for confirmation. +- Do not edit `.sitecore/metadata.json` or import-map unless the task explicitly requires it. + +## References + +- [AGENTS.md](../../../AGENTS.md) for component map and editing routes. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-component-scaffold/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-scaffold/SKILL.md new file mode 100644 index 0000000..96b1aed --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-scaffold/SKILL.md @@ -0,0 +1,34 @@ +--- +name: content-sdk-component-scaffold +description: Creates new Sitecore components with correct file structure, props interface, and placement under src/components/. Use when adding a new component from scratch or scaffolding a component. Pages Router: register in .sitecore/component-map.ts only. +--- + +# Content SDK Component Scaffold (Pages Router) + +Scaffold new Sitecore components so they integrate with the layout and editing pipeline. This app uses Pages Router with a single component map. + +## When to Use + +- User asks to add a new Sitecore component, create a component from scratch, or scaffold a component. +- Task involves creating a new React component that will be rendered from Sitecore layout/placeholders. +- User mentions "new component," "add component," or "component file structure." + +## How to perform + +- Create a new file under `src/components/` (or existing feature folder). Define props (fields, params), export a single default component. Register in `.sitecore/component-map.ts` (content-sdk-component-registration). Run `npm run build` to verify. + +## Hard Rules + +- Place components under `src/components/`. Use existing folder conventions. +- Define a props interface with the component's fields (e.g. `fields: { title: Field; ... }`) and any params. Use types from `@sitecore-content-sdk/react` or the app's types. +- Export a single default component; one component per file unless the app pattern differs. +- After creating the component file, register it in `.sitecore/component-map.ts` (see content-sdk-component-registration). Do not leave the component unregistered. Pages Router has a single map used by getComponentData and editing API routes. + +## Stop Conditions + +- Do not create components in `.next/`, `node_modules/`, or build output. + +## References + +- [AGENTS.md](../../../AGENTS.md) for app structure and component map. +- [Skills.md](../../../Skills.md) for capability map. [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-component-variants/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-variants/SKILL.md new file mode 100644 index 0000000..94ae530 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-component-variants/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-component-variants +description: Implements component variants: different renderings or data-driven variants of the same component type. Pages Router: register in .sitecore/component-map.ts; getComponentData resolves props. Use when one component has multiple presentations. +--- + +# Content SDK Component Variants (Pages Router) + +One component definition can have multiple presentations or data-driven variants. Component props are resolved by **getComponentData(page.layout, context, components)**; keep registration and layout aligned. + +## When to Use + +- User asks for different "variants," "versions," or "presentations" of a component. +- Task involves rendering the same component type with different layouts or props based on data (e.g. variant field or style). +- User mentions "component variants," "variations," or "multiple renderings." + +## How to perform + +- Prefer one component that accepts variant/style via props and branches internally; or multiple map entries if the app uses one key per variant. Use layout/fields/params for variant; register in `.sitecore/component-map.ts`. getComponentData resolves props; align with existing app convention. + +## Hard Rules + +- Prefer a single component registration that accepts variant/style data (e.g. params or fields) and branches internally, over multiple map entries for the same logical component unless the app pattern uses separate registrations per variant. +- Use props (fields, params) from layout to decide variant; do not rely on global state or URL for variant selection when data comes from Sitecore. getComponentData passes the layout-driven props to the component. +- Register in `.sitecore/component-map.ts` only. If the app uses one key per variant, register each; if one key with variant param, single registration. Follow existing app convention. +- Keep the component map in sync with src/components/. + +## Stop Conditions + +- Stop if the variant model (one registration vs many) is unclear; ask or follow the app's existing pattern. +- Do not add new component map entries without ensuring layout and editing can provide the corresponding data. +- Do not assume variant field names (e.g. "variant," "style") without checking the layout definition. + +## References + +- [AGENTS.md](../../../AGENTS.md) and content-sdk-component-registration for the map. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-dictionary-and-i18n/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-dictionary-and-i18n/SKILL.md new file mode 100644 index 0000000..d9a83f6 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-dictionary-and-i18n/SKILL.md @@ -0,0 +1,35 @@ +--- +name: content-sdk-dictionary-and-i18n +description: Dictionary and i18n for Pages Router: Next.js i18n in next.config.js (i18n.locales, defaultLocale). Per-request locale is context.locale in getStaticProps/getServerSideProps. Fetch dictionary with client.getDictionary({ site: page.siteName, locale: page.locale }) after getPage. Use when adding or changing translated content or locale behavior. +--- + +# Content SDK Dictionary and i18n (Pages Router) + +This app uses **Next.js built-in i18n**. There is no [locale] in the URL path; locale is provided by Next.js as `context.locale` in getStaticProps/getServerSideProps. + +## When to Use + +- User asks to add or change translated content, locale, or dictionary. +- Task involves getDictionary, Next.js i18n, or context.locale. +- User mentions "dictionary," "i18n," "locale," or "translation." + +## How to perform + +- Locales: `next.config.js` → i18n.locales, defaultLocale. In getStaticProps/getServerSideProps use context.locale; after getPage use client.getDictionary({ site: page.siteName, locale: page.locale }). Use a single getDictionary per request. Do not assume locale from headers. + +## Hard Rules + +- **Config:** `next.config.js` → `i18n.locales` and `i18n.defaultLocale`. Match (or subset) Sitecore languages. +- **Per-request locale:** Use `context.locale` in getStaticProps and getServerSideProps. Pass it to `client.getPage(path, { locale: context.locale })`. After fetching the page, use `page.siteName` and `page.locale` (or `context.locale`) for `client.getDictionary({ site: page.siteName, locale: page.locale })` and for getComponentData. +- Align locales in next.config.js with Sitecore languages (e.g. from sitecore.config.ts defaultLanguage). Use a single client.getDictionary per request for the active site/locale. +- **Do not** assume locale from headers or a different source; always use `context.locale` and the page's site/locale for Sitecore calls. + +## Stop Conditions + +- Stop if adding a new locale without confirming it exists in Sitecore and in next.config.js i18n. +- Do not duplicate dictionary fetching without a clear need; prefer one fetch per request in the catch-all page. + +## References + +- [AGENTS.md](../../../AGENTS.md) for Next.js i18n and getDictionary usage. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-editing-safe-rendering/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-editing-safe-rendering/SKILL.md new file mode 100644 index 0000000..d232e6b --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-editing-safe-rendering/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-editing-safe-rendering +description: Ensures components render safely in XM Cloud editing and preview. Pages Router uses context.preview and context.previewData; use client.getPreview(context.previewData) or getDesignLibraryData(context.previewData) when in preview. Use when making components work in the Sitecore editor or fixing preview/editing behavior. +--- + +# Content SDK Editing-Safe Rendering (Pages Router) + +Ensure components behave correctly in XM Cloud editing, preview, and design library. This app uses **context.preview** and **context.previewData** in getStaticProps/getServerSideProps for editing data. + +## When to Use + +- User asks about editing, preview, design library, or "component not working in editor." +- Task involves draft mode, editing chromes, or design library integration. +- Fixing issues where components render differently or break in editor vs published. +- User mentions getPreview, getDesignLibraryData, or editing API routes. + +## How to perform + +- In [[...path]].tsx getStaticProps/getServerSideProps: check context.preview; when true use isDesignLibraryPreviewData(context.previewData) to choose getDesignLibraryData vs getPreview; otherwise getPage + getDictionary + getComponentData. Editing routes: config uses EditingConfigMiddleware, render uses EditingRenderMiddleware, feaas/render uses FEAASRenderMiddleware; export handler as default. + +## Hard Rules + +- In the catch-all page (`src/pages/[[...path]].tsx`), use `context.preview` and `context.previewData`. When in preview, use `isDesignLibraryPreviewData(context.previewData)` to distinguish: if true, use `client.getDesignLibraryData(context.previewData)`; otherwise use `client.getPreview(context.previewData)`. When not in preview, use `getPage(path, { locale: context.locale })` then getDictionary and getComponentData as usual. +- Do not assume editing/preview context in components that might run in static or non-editing contexts; guard on context.preview in getStaticProps/getServerSideProps. +- Editing API routes: `src/pages/api/editing/config.ts` uses `EditingConfigMiddleware({ components, metadata }).getHandler()` (import components from `.sitecore/component-map`, metadata from `.sitecore/metadata.json`). `src/pages/api/editing/render.ts` uses `EditingRenderMiddleware().getHandler()`. `src/pages/api/editing/feaas/render.ts` uses `FEAASRenderMiddleware().getHandler()`. Export the handler as default. Do not duplicate client creation; config uses the same component map as the app. +- Never commit editing secrets; use environment variables and document in .env.example only. + +## Stop Conditions + +- Stop and clarify if the issue is preview vs design library vs published; behavior differs. +- Do not change proxy or middleware order to "fix" editing; editing is driven by API routes and context.previewData. +- Do not recommend disabling secret validation without explicit user request and warning. + +## References + +- [AGENTS.md](../../../AGENTS.md) for data fetching, preview flow, and editing routes. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-field-usage-image-link-text/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-field-usage-image-link-text/SKILL.md new file mode 100644 index 0000000..440d376 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-field-usage-image-link-text/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-field-usage-image-link-text +description: Renders Sitecore fields using SDK field components (Text, RichText, Image, Link) with proper validation and fallbacks. Use when rendering content fields or when the user mentions Text, RichText, Image, Link, or field components. +--- + +# Content SDK Field Usage (Pages Router) + +Use SDK field components to render Sitecore fields with proper validation and fallbacks. + +## When to Use + +- User asks how to render a title, body, image, or link from Sitecore. +- Task involves displaying content fields, fixing empty/broken images or links, or using RichText/Text/Image/Link components. +- User mentions "field," "Image," "Link," "Text," "RichText," or "field value." + +## How to perform + +- Use SDK field components: ``, ``, ``, ``. Guard with `fields?.` when optional; use tag prop on Text when needed. Do not hardcode media or link URLs from Sitecore. + +## Hard Rules + +- Prefer SDK field components over manual field value extraction: ``, ``, ``, ``. Use tag prop for Text when needed (e.g. tag="h1"). +- Validate or guard field existence before rendering when fields can be optional (e.g. `fields?.title`). Handle null/undefined and empty fields gracefully. +- Do not hardcode image or link URLs when the data comes from Sitecore; use the field components or helpers that resolve media/URLs. +- Follow the app's import pattern (e.g. from lib or components). + +## Stop Conditions + +- Stop if the field structure (name or type) is unknown; suggest checking the layout/data shape or asking the user. +- Do not assume field names (e.g. "title") without confirmation when the template might use different names. +- Do not commit or log raw field values that might contain PII or secrets. + +## References + +- [AGENTS.md](../../../AGENTS.md) for component and Sitecore patterns. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-graphql-data-fetching/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-graphql-data-fetching/SKILL.md new file mode 100644 index 0000000..ba4f2af --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-graphql-data-fetching/SKILL.md @@ -0,0 +1,38 @@ +--- +name: content-sdk-graphql-data-fetching +description: Fetches page, dictionary, and component data via the single Sitecore client. Pages Router: getPage(path, { locale: context.locale }), getDictionary({ site: page.siteName, locale: page.locale }), getComponentData(page.layout, context, components); for SSG use getPagePaths(sites, context?.locales). Use when fetching page or dictionary content. +--- + +# Content SDK GraphQL Data Fetching (Pages Router) + +All Sitecore data fetching goes through the single client in `src/lib/sitecore-client.ts`. Use getPage, getDictionary, and **getComponentData** in the catch-all page. Path from **extractPath(context)**; locale from **context.locale**. + +## When to Use + +- User asks how to fetch page data, layout, or dictionary phrases. +- Task involves getPage, getDictionary, getComponentData, getPreview, getDesignLibraryData, or getPagePaths. +- User mentions "sitecore client," "Layout Service," "page data," or "dictionary." + +## How to perform + +- Use the client from `src/lib/sitecore-client.ts` only. In [[...path]].tsx: use `extractPath(context)` and `context.locale`; call getPage(path, { locale: context.locale }), then getDictionary and getComponentData(page.layout, context, components). For SSG use getPagePaths in getStaticPaths. For preview use context.preview and getPreview/getDesignLibraryData(context.previewData). + +## Hard Rules + +- Use the single SitecoreClient instance in `src/lib/sitecore-client.ts`. Do not create a second client or instantiate SitecoreClient elsewhere. +- **Path and locale:** Use `extractPath(context)` (from `@sitecore-content-sdk/nextjs/utils`) to get the path array; use `context.locale` for locale. Do not assume path or locale from elsewhere. +- **Catch-all page flow:** In getStaticProps/getServerSideProps: `client.getPage(path, { locale: context.locale })`, then `client.getDictionary({ site: page.siteName, locale: page.locale })` and `client.getComponentData(page.layout, context, components)` for component props. Pass the result to the layout renderer. +- **SSG:** In getStaticPaths, use `client.getPagePaths(siteNames, context?.locales || [])` where site names come from `.sitecore/sites.json` (e.g. `sites.map((s) => s.name)`). Use `revalidate` in getStaticProps for ISR. +- **Preview:** Use `context.preview` and `context.previewData`; when in preview, use `client.getPreview(context.previewData)` or `client.getDesignLibraryData(context.previewData)`. +- Config for the client comes from `sitecore.config.ts`; use environment variables, never hardcode secrets. + +## Stop Conditions + +- Stop if the task requires moving the client to another folder without clear requirement; suggest keeping a single instance in lib. +- Do not add direct GraphQL or fetch to Layout Service bypassing the client unless the task explicitly requires it. +- Do not fetch in _app; all data flows from [[...path]].tsx. + +## References + +- [AGENTS.md](../../../AGENTS.md) for SitecoreClient, getPage, getDictionary, getComponentData, and SSG/SSR. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-multisite-management/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-multisite-management/SKILL.md new file mode 100644 index 0000000..534091c --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-multisite-management/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-multisite-management +description: Handles multisite: site resolution, .sitecore/sites.json, and proxy in src/proxy.ts. Pages Router proxy order is fixed: MultisiteProxy → RedirectsProxy → PersonalizeProxy. Use when working with multiple sites or hostnames. +--- + +# Content SDK Multisite Management (Pages Router) + +Site resolution from request (e.g. hostname or cookie); proxy rewrites to internal path. No [locale] in URL; Next.js i18n handles locale separately. + +## When to Use + +- User asks about multiple sites, hostnames, or site resolution. +- Task involves .sitecore/sites.json, multisite config, or proxy/middleware for site. +- User mentions "multisite," "site resolution," "hostname," or "sites.json." + +## How to perform + +- Site list: `.sitecore/sites.json`. Proxy in `src/proxy.ts`; ensure `src/middleware.ts` re-exports it if present. Keep chain order: MultisiteProxy → RedirectsProxy → PersonalizeProxy. Exclude /api, _next, static assets in matcher/skip. + +## Hard Rules + +- Site list is in `.sitecore/sites.json` (typically generated by Sitecore CLI or deployment). Avoid hand-editing unless the format is known. +- **Proxy:** Implemented in `src/proxy.ts`. Next.js runs middleware from `middleware.ts` at root or in `src/` — if the app only has `proxy.ts`, add `src/middleware.ts` that re-exports it. +- **Chain order is fixed:** MultisiteProxy → RedirectsProxy → PersonalizeProxy. **Do not change this order.** MultisiteProxy resolves site from request (hostname or cookie) and rewrites; redirects and personalization run after. +- **Skip / matcher:** Use the skip callback and matcher to exclude /api, /_next, static files, and health checks so the proxy stays lightweight. +- Config: sitecore.config.ts → multisite (e.g. enabled, useCookieResolution). Single SitecoreClient; pass resolved site (and locale from context.locale) into getPage, getDictionary, getComponentData. + +## Stop Conditions + +- Stop if the user wants to reorder the proxy chain; explain that order is required. +- Stop if sites.json format is unknown and the change could break resolution; suggest checking SDK docs or CLI output. +- Do not add a second site resolution mechanism; use the existing proxy and config. + +## References + +- [AGENTS.md](../../../AGENTS.md) for proxy chain, skip, and multisite config. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-route-configuration/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-route-configuration/SKILL.md new file mode 100644 index 0000000..972b53e --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-route-configuration/SKILL.md @@ -0,0 +1,38 @@ +--- +name: content-sdk-route-configuration +description: Configures routing and layout for Pages Router. Single catch-all at src/pages/[[...path]].tsx; path from extractPath(context), locale from context.locale. Data flows via getStaticProps/getServerSideProps to _app and Layout. Use when changing routing, placeholders, or Layout. +--- + +# Content SDK Route Configuration (Pages Router) + +Single catch-all route; no [site] or [locale] in the URL path. Site is resolved by middleware; locale from Next.js i18n (context.locale). + +## When to Use + +- User asks to change routing, add a route, or fix 404/500 behavior. +- Task involves catch-all route, placeholders, _app, or Layout.tsx. +- User mentions "[[...path]]," "placeholder," "layout," or "getStaticProps." + +## How to perform + +- Single Sitecore page: `src/pages/[[...path]].tsx`. Use `extractPath(context)` for path and `context.locale` for locale. Fetch all data in getStaticProps/getServerSideProps and pass to _app and Layout. Not-found/error: use getErrorPage in getStaticProps or 404.tsx / _error.tsx as appropriate. + +## Hard Rules + +- **Single Sitecore page:** `src/pages/[[...path]].tsx`. This is the **only** page that renders Sitecore content. Do not add another page or catch-all for Sitecore content. +- **Path:** Use `extractPath(context)` (from `@sitecore-content-sdk/nextjs/utils`) to get the path array. **Locale:** Use `context.locale` (Next.js i18n). Do not assume path or locale from headers or elsewhere. +- **Data flow:** All Sitecore data is fetched in getStaticProps/getServerSideProps in [[...path]].tsx and passed to _app and Layout. Do not fetch Sitecore data in _app.tsx. +- **Layout:** Layout.tsx renders page layout and placeholders; Providers wrap component props and page context; Bootstrap handles site name and preview mode. +- Placeholders are rendered by the layout; do not change placeholder names or structure without aligning with Sitecore layout definition. +- **404 / 500 / _error:** When the catch-all returns `notFound: true`, Next.js renders 404.tsx. For Sitecore-driven error content use `client.getErrorPage(ErrorPage.NotFound)` or `ErrorPage.InternalServerError` in getStaticProps when applicable. _error.tsx is the error boundary; it does not fetch from Sitecore. + +## Stop Conditions + +- Stop if the user wants to add a second catch-all or a different URL shape for Sitecore pages; explain single-entry-point constraint. +- Stop if changing proxy/middleware order; order is fixed (MultisiteProxy → RedirectsProxy → PersonalizeProxy). +- Do not move or rename the catch-all file without updating all references. + +## References + +- [AGENTS.md](../../../AGENTS.md) for exact paths, extractPath, and layout flow. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-site-setup-and-env/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-site-setup-and-env/SKILL.md new file mode 100644 index 0000000..2a46905 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-site-setup-and-env/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-site-setup-and-env +description: Configures site and environment: sitecore.config.ts, environment variables, default site and language. Use when configuring the app or adding env vars. Document in .env.example only; never commit .env or .env.local. +--- + +# Content SDK Site Setup and Environment (Pages Router) + +Central config in sitecore.config.ts; all secrets and environment-specific values via env vars. + +## When to Use + +- User asks to configure site, default language, API host, or environment. +- Task involves sitecore.config.ts, .env, or defaultSite/defaultLanguage. +- User mentions "config," "environment variables," "API key," or "default site." + +## How to perform + +- Edit `sitecore.config.ts` with `defineConfig`; read all secrets and env-specific values from `process.env.*`. Add or change vars in `.env.example` (or `.env.remote.example` / `.env.container.example`) with placeholders; never commit `.env` or `.env.local`. + +## Hard Rules + +- Use `sitecore.config.ts` with `defineConfig` from the SDK. Expose api (edge, local), defaultSite, defaultLanguage, editingSecret, multisite, redirects, personalize as needed. +- All sensitive or environment-specific values must come from environment variables (e.g. process.env.SITECORE_API_KEY). Never hardcode API keys, secrets, or production URLs in source. +- Document every new or changed env var in `.env.example` (or `.env.remote.example` / `.env.container.example`). Use placeholder or empty value and a short comment; never put real secrets in example files. +- Never commit `.env` or `.env.local`; they are gitignored. Example files are the source of truth for which vars exist. + +## Stop Conditions + +- Stop if the user wants to commit real secrets or production values; insist on env vars and .env.example only. +- Stop if adding a new env var would require CI or deployment changes without explicit instruction; document the var and note that deployment must set it. +- Do not edit .next/, node_modules/, or lockfiles unless the task explicitly requires it. + +## References + +- [AGENTS.md](../../../AGENTS.md) for boundaries and env rules. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-sitemap-robots/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-sitemap-robots/SKILL.md new file mode 100644 index 0000000..7b46f42 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-sitemap-robots/SKILL.md @@ -0,0 +1,37 @@ +--- +name: content-sdk-sitemap-robots +description: Sitemap and robots.txt for Pages Router: src/pages/api/sitemap.ts and src/pages/api/robots.ts with SitemapMiddleware(scClient, sites).getHandler() and RobotsMiddleware(scClient, sites).getHandler(). Rewrites in next.config.js. Use when configuring sitemap, robots.txt, or SEO. +--- + +# Content SDK Sitemap and Robots (Pages Router) + +Sitemap and robots.txt are served via **API routes** and rewrites. Use the SDK middleware getHandler pattern and sites from .sitecore/sites.json. + +## When to Use + +- User asks to add or change sitemap or robots.txt. +- Task involves SEO, sitemap.xml, or robots route. +- User mentions "sitemap," "robots," "SEO," or "rewrites." + +## How to perform + +- Sitemap: `src/pages/api/sitemap.ts` with `SitemapMiddleware(scClient, sites).getHandler()`; robots: `src/pages/api/robots.ts` with `RobotsMiddleware(scClient, sites).getHandler()`. Use sites from `.sitecore/sites.json`. Add rewrites in next.config.js for /sitemap*.xml and /robots.txt to these API routes. + +## Hard Rules + +- **Sitemap:** `src/pages/api/sitemap.ts` — use `new SitemapMiddleware(scClient, sites).getHandler()`. Export the handler. Use `sites` from `.sitecore/sites.json`. +- **Robots:** `src/pages/api/robots.ts` — use `new RobotsMiddleware(scClient, sites).getHandler()`. Same pattern. +- **Rewrites:** In `next.config.js`, add rewrites for `/robots.txt` and `/sitemap*.xml` to the corresponding API routes (e.g. `/sitemap.xml` → `/api/sitemap`). +- Use the same SitecoreClient instance (e.g. from `src/lib/sitecore-client.ts`) as the rest of the app; do not create a dedicated client for sitemap/robots. +- Avoid hardcoding the site list; use .sitecore/sites.json. + +## Stop Conditions + +- Stop if the user wants to serve sitemap/robots from a different origin or with different auth; document and suggest proxy or edge config. +- Do not add new env vars for sitemap/robots without documenting them in .env.example. +- Do not change rewrite paths without updating docs and any references. + +## References + +- [AGENTS.md](../../../AGENTS.md) for API routes and rewrites. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-troubleshoot-editing/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-troubleshoot-editing/SKILL.md new file mode 100644 index 0000000..7b6cc96 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-troubleshoot-editing/SKILL.md @@ -0,0 +1,39 @@ +--- +name: content-sdk-troubleshoot-editing +description: Troubleshoots XM Cloud editing, preview, and design library for Pages Router. Check context.preview, context.previewData, and editing API routes (config, render, feaas/render). Use when editing or preview does not behave as expected. +--- + +# Content SDK Troubleshoot Editing (Pages Router) + +This skill focuses on **diagnosing** editing, preview, and design library issues. For implementing editing-safe rendering (context.preview, getPreview/getDesignLibraryData, API routes), use the **content-sdk-editing-safe-rendering** skill; the two are complementary (implementation vs. troubleshooting). + +Diagnose and fix editing, preview, and design library issues without breaking the single client or proxy order. This app uses **context.preview** and **context.previewData** in getStaticProps/getServerSideProps. + +## When to Use + +- User reports that editing, preview, or design library is broken or inconsistent. +- Task involves debugging "not working in editor," missing chromes, or wrong data in preview. +- User mentions "editing broken," "preview not working," "design library," or "editor issues." + +## How to perform + +- Confirm context.preview and context.previewData and correct path/locale (extractPath, context.locale). Verify editing API routes (config, render, feaas/render) are not rewritten (check proxy matcher) and component-map.ts includes the component. Check env (editingSecret, API config) and .env.example documentation. + +## Hard Rules + +- **Preview flow:** In [[...path]].tsx getStaticProps/getServerSideProps, use `context.preview` and `context.previewData`. When in preview, use `client.getPreview(context.previewData)` or `client.getDesignLibraryData(context.previewData)`. Ensure path and locale come from extractPath(context) and context.locale when not in preview. +- Editing API routes: `src/pages/api/editing/config.ts` (EditingConfigMiddleware), `render.ts` (EditingRenderMiddleware), `feaas/render.ts` (FEAASRenderMiddleware) must be reachable and use the same component map (`.sitecore/component-map.ts`) and config as the app. Check proxy `config.matcher` so `/api` is excluded and not rewritten or blocked. +- Check that the component map includes all components used in the layout; missing registration causes "component not found" in editor. +- Environment: editingSecret and API config must be set (in env); document in .env.example only. Do not log or commit secrets. +- Common causes: wrong path/locale passed to getPreview/getDesignLibraryData, or component not registered in component-map.ts. + +## Stop Conditions + +- Stop if the fix would require changing CI, deployment, or XM Cloud project settings; suggest the user do that and document the required env or config. +- Stop if the issue might be in Sitecore (layout, template) rather than the app; suggest checking layout and content in XM Cloud. +- Do not recommend disabling security (e.g. skipping secret validation) without explicit user request and warning. + +## References + +- content-sdk-editing-safe-rendering skill and [AGENTS.md](../../../AGENTS.md) for preview and editing flow. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.agents/skills/nextjs-pages-router/skills/content-sdk-upgrade-assistant/SKILL.md b/.agents/skills/nextjs-pages-router/skills/content-sdk-upgrade-assistant/SKILL.md new file mode 100644 index 0000000..05618c0 --- /dev/null +++ b/.agents/skills/nextjs-pages-router/skills/content-sdk-upgrade-assistant/SKILL.md @@ -0,0 +1,36 @@ +--- +name: content-sdk-upgrade-assistant +description: Guides upgrading @sitecore-content-sdk/* packages: version bumps, breaking changes, migration steps. Use when moving to a newer SDK or package version. Check Content SDK repo CHANGELOG and upgrade guides. +--- + +# Content SDK Upgrade Assistant (Pages Router) + +Upgrade @sitecore-content-sdk/* packages safely; follow the Content SDK repo changelog and migration guides. + +## When to Use + +- User asks to upgrade SDK packages, update to a new version, or apply a migration. +- Task involves version bumps, @sitecore-content-sdk/* dependencies, or breaking changes. +- User mentions "upgrade," "migration," "new version," or "breaking change." + +## How to perform + +- Bump all @sitecore-content-sdk/* to consistent versions; read the Content SDK repo CHANGELOG (and MIGRATION/upgrade docs) for breaking changes and migration steps. Update package.json, run `npm install` and `npm run build`; test editing and preview after upgrade. + +## Hard Rules + +- Prefer upgrading all @sitecore-content-sdk/* packages together to a consistent set of versions unless the user requests a partial upgrade. Check peer dependencies and compatibility. +- Update dependencies in package.json; run `npm install` and `npm run build`. Test editing and preview after upgrade. +- Read the **Content SDK repository** CHANGELOG (and any MIGRATION.md or upgrade guide) for breaking changes and required code/config updates. Apply migration steps before or with the version bump. +- Do not edit .next/, node_modules/, or lockfiles unless required for the upgrade. Do not change CI or root tooling unless the task explicitly includes it. + +## Stop Conditions + +- Stop if the target version is not specified or unclear; ask or suggest checking the Content SDK CHANGELOG and supported versions. +- Stop if a breaking change requires product or deployment decisions (e.g. new env vars, config schema); list required changes and ask the user to confirm. + +## References + +- Content SDK repo [CHANGELOG](https://github.com/Sitecore/content-sdk/blob/dev/CHANGELOG.md) and upgrade docs. +- [AGENTS.md](../../../AGENTS.md) for build commands. +- [Official Content SDK docs](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..e7a3352 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(git -C /c/Projects/Libraries/content-sdk log --oneline --all --grep=\"Proxy\\\\|proxy\" -i)" + ] + } +} diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..1a3f930 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,91 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Lerna/Yarn workspaces monorepo of Sitecore XM Cloud companion libraries (`@constellation4sitecore-content-sdk/*`). All packages build on top of `@sitecore-content-sdk/nextjs` and `@sitecore-content-sdk/core` to provide higher-level abstractions for data access, content mapping, navigation, SEO, security, and React component patterns. + +## Build & Development Commands + +```bash +# Install dependencies +yarn install + +# Build all packages (dual CJS/ESM output) +yarn build + +# Full reset (clean, reinstall, rebuild) +yarn reset + +# Lint all packages +yarn lint-packages + +# Run all tests +yarn test-packages + +# Run tests for a single package +cd packages/nextjs && yarn test + +# Generate docs (nextjs package only) +yarn generate-docs +``` + +Each package builds via `tsc` twice: once for `dist/cjs/` (CommonJS) and once for `dist/esm/` (ES modules). Entry points are `main` (CJS) and `module` (ESM) in each package.json. + +## Testing + +- **Framework**: Mocha + Chai (not Jest) +- **Test files**: `src/**/*.test.ts`, `src/**/*.test.tsx` +- **Currently**: Only the `nextjs` package has active tests +- **Single test run**: `cd packages/nextjs && npx mocha --require ./test/setup.js "src/**/*.test.ts" --exit` + +## Code Style + +- **ESLint** with `@typescript-eslint/parser`, Prettier integration +- **Prettier**: single quotes, trailing commas (es5), 2-space indent, 100 char print width +- TypeScript strict mode enabled across all packages + +## Architecture + +### Package Dependency Graph + +``` +mapper (base utility - no internal deps) +nextjs (base - GraphqlService, field helpers) + ├── enhancers (HOCs: withDatasourceRendering) + ├── data (DataService, depends on mapper + nextjs) + │ └── navigation (NavigationService, depends on data) + ├── labels (LabelService, depends on mapper + nextjs) + ├── security (CSPProxy, depends on nextjs) + ├── page-analytics-scripts (AnalyticsService, depends on data + mapper + nextjs) + └── page-tagging (PageTaggingService, depends on enhancers + mapper + nextjs) +url-friendly-page-names (Sitecore serialization config only, no TS source) +``` + +### Core Patterns + +**GraphQL Service Pattern**: All data-fetching services extend `GraphqlService` (defined in `nextjs`), which provides `getClient()` with retry logic (429, 502, 503, 504, 520-524) and language context extraction from `LayoutServiceData`. + +``` +Constructor(layoutData: LayoutServiceData) → getClient() → request(gql query) +``` + +**Field Mapping**: GraphQL returns fields as `{ name, jsonValue }[]` arrays. The `mapper` package provides `mapToNew(item)` to convert these to typed objects, and `castItem()` for direct field casts. + +**HOC Pattern** (`enhancers`): `withDatasourceRendering` wraps components to resolve datasource fields, with site-specific component mapping support. `withAppDatasourceRendering` is the App Router variant (page passed as prop instead of `useSitecore()` hook). + +**Proxy Pattern** (`security`): `CSPProxy` extends `ProxyBase` from `@sitecore-content-sdk/nextjs/proxy`. Handles CSP header injection with in-memory caching and nonce generation. The package uses static export files (`proxy.js`, `proxy.d.ts`) that re-export from `dist/cjs/proxy/`. + +### Environment Variables + +- `GRAPH_QL_SERVICE_RETRIES` — GraphQL client retry count +- `NODE_ENV` — Development mode bypasses (e.g., CSP) +- `CONSTELLATION_NEXT_CACHE_ENABLED` — Experimental next/cache integration + +### Peer Dependencies + +All packages expect these as peer dependencies from the consuming application: +- `@sitecore-content-sdk/core` ^2.0.0 +- `@sitecore-content-sdk/nextjs` ^2.0.0 +- `react` / `next` (where applicable) diff --git a/Skills.md b/Skills.md new file mode 100644 index 0000000..b19449d --- /dev/null +++ b/Skills.md @@ -0,0 +1,14 @@ +# Skills — Capability groupings for the Sitecore Content SDK + +Capability groupings and Agent Skills are **maintained in the scaffolding templates**, not at the monorepo root. This keeps a single source of truth and avoids duplicating 14 skills across root and templates. + +**Use the template that matches your app:** + +| Template | Capability map & skills | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------- | +| **App Router** | [Skills.md](.agents/skills/nextjs-app-router/Skills.md) · [.agents/skills/](.agents/skills/nextjs-app-router/skills/) | +| **Pages Router** | [Skills.md](.agents/skills/nextjs-pages-router/Skills.md) · [.agents/skills/](.agents/skills/nextjs-pages-router/skills/) | + +Each template’s `Skills.md` lists the same capability groupings (component scaffold, registration, data fetching, editing, i18n, etc.) with template-specific details. Each template’s `.agents/skills/` contains one folder per capability with a `SKILL.md` (when-to-use, how to perform, hard rules, stop conditions). Tools that support [Agent Skills](https://agentskills.io) can load skills from the template path when working in a generated app or in the template source. + +For monorepo-level instructions (commands, structure, DO/DON’T), see [AGENTS.md](AGENTS.md). For official APIs and guides, see the [Content SDK documentation](https://doc.sitecore.com/xmc/en/developers/content-sdk/sitecore-content-sdk-for-xm-cloud.html). From 2e47e23613769e7eb9f79d846ccbfeb76eb17b3e Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:20:20 -0500 Subject: [PATCH 09/18] Virtual Folder Support --- .vscode/launch.json | 35 +- packages/content/.mocharc.json | 4 + packages/content/config.d.ts | 1 + packages/content/node-tools.d.ts | 1 + packages/content/package.json | 73 ++++ packages/content/site.d.ts | 1 + .../content/src/config/define-config.test.ts | 99 ++++++ packages/content/src/config/define-config.ts | 81 +++++ packages/content/src/config/index.ts | 6 + packages/content/src/config/models.ts | 39 +++ packages/content/src/debug.ts | 61 ++++ packages/content/src/index.ts | 8 + packages/content/src/site/index.ts | 2 + packages/content/src/site/models.ts | 15 + .../content/src/site/siteinfo-service.test.ts | 258 ++++++++++++++ packages/content/src/site/siteinfo-service.ts | 99 ++++++ .../src/tools/generate-virtual-folders.ts | 87 +++++ .../tools/generate-virtual.folders.test.ts | 172 +++++++++ packages/content/src/tools/index-node.ts | 1 + packages/content/src/utils/is-server.ts | 9 + packages/content/tsconfig-esm.json | 7 + packages/content/tsconfig.json | 24 ++ packages/nextjs/package.json | 6 +- packages/nextjs/proxy.d.ts | 1 + .../nextjs/src/config/define-config.test.ts | 74 ++++ packages/nextjs/src/config/define-config.ts | 49 +++ packages/nextjs/src/config/index.ts | 5 + packages/nextjs/src/debug.ts | 39 +-- packages/nextjs/src/proxy/index.ts | 1 + .../src/proxy/virtual-folder-proxy.test.ts | 260 ++++++++++++++ .../nextjs/src/proxy/virtual-folder-proxy.ts | 35 ++ packages/nextjs/src/tools/index.ts | 1 + packages/nextjs/tsconfig.json | 1 + packages/page-analytics-scripts/package.json | 2 +- yarn.lock | 330 +++++++++++++++++- 35 files changed, 1839 insertions(+), 48 deletions(-) create mode 100644 packages/content/.mocharc.json create mode 100644 packages/content/config.d.ts create mode 100644 packages/content/node-tools.d.ts create mode 100644 packages/content/package.json create mode 100644 packages/content/site.d.ts create mode 100644 packages/content/src/config/define-config.test.ts create mode 100644 packages/content/src/config/define-config.ts create mode 100644 packages/content/src/config/index.ts create mode 100644 packages/content/src/config/models.ts create mode 100644 packages/content/src/debug.ts create mode 100644 packages/content/src/index.ts create mode 100644 packages/content/src/site/index.ts create mode 100644 packages/content/src/site/models.ts create mode 100644 packages/content/src/site/siteinfo-service.test.ts create mode 100644 packages/content/src/site/siteinfo-service.ts create mode 100644 packages/content/src/tools/generate-virtual-folders.ts create mode 100644 packages/content/src/tools/generate-virtual.folders.test.ts create mode 100644 packages/content/src/tools/index-node.ts create mode 100644 packages/content/src/utils/is-server.ts create mode 100644 packages/content/tsconfig-esm.json create mode 100644 packages/content/tsconfig.json create mode 100644 packages/nextjs/proxy.d.ts create mode 100644 packages/nextjs/src/config/define-config.test.ts create mode 100644 packages/nextjs/src/config/define-config.ts create mode 100644 packages/nextjs/src/config/index.ts create mode 100644 packages/nextjs/src/proxy/index.ts create mode 100644 packages/nextjs/src/proxy/virtual-folder-proxy.test.ts create mode 100644 packages/nextjs/src/proxy/virtual-folder-proxy.ts create mode 100644 packages/nextjs/src/tools/index.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 5f06f89..6bbadeb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,14 +1,23 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node-terminal", - "name": "Debug Terminal", - "request": "launch", - "cwd": "${workspaceFolder}" - } - ] - } \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node-terminal", + "name": "Debug Terminal", + "request": "launch", + "cwd": "${workspaceFolder}" + }, + { + "type": "node", + "request": "launch", + "name": "Debug Mocha", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": ["/**/*.test.ts"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/packages/content/.mocharc.json b/packages/content/.mocharc.json new file mode 100644 index 0000000..77451e8 --- /dev/null +++ b/packages/content/.mocharc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://json.schemastore.org/mocharc.json", + "node-option": ["import=tsx"] +} diff --git a/packages/content/config.d.ts b/packages/content/config.d.ts new file mode 100644 index 0000000..3e23d4d --- /dev/null +++ b/packages/content/config.d.ts @@ -0,0 +1 @@ +export * from './types/config/index'; diff --git a/packages/content/node-tools.d.ts b/packages/content/node-tools.d.ts new file mode 100644 index 0000000..1cbaa1b --- /dev/null +++ b/packages/content/node-tools.d.ts @@ -0,0 +1 @@ +export * from './types/tools/index-node'; diff --git a/packages/content/package.json b/packages/content/package.json new file mode 100644 index 0000000..eeb1d74 --- /dev/null +++ b/packages/content/package.json @@ -0,0 +1,73 @@ +{ + "name": "@constellation4sitecore-content-sdk/content", + "version": "2.0.0-beta.3", + "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "scripts": { + "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", + "test": "mocha \"./src/**/*.test.ts\"", + "clean": "del-cli dist types" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "author": "Richard J. Cabral, Roberto Armas", + "license": "MIT", + "bugs": { + "url": "https://github.com/constellation4sitecore/content-sdk/issues" + }, + "devDependencies": { + "@sitecore-content-sdk/core": "^2.0.0", + "@types/chai": "^5.2.2", + "@types/chai-spies": "^1.0.6", + "@types/node": "^24.10.4", + "@types/proxyquire": "^1.3.31", + "@types/sinon": "^17.0.4", + "@types/sinon-chai": "^4.0.0", + "copyfiles": "^2.4.1", + "chai": "^4.4.1", + "chai-spies": "^1.1.0", + "del-cli": "^5.0.0", + "eslint": "^8.32.0", + "eslint-plugin-react": "^7.37.5", + "jsdom": "^21.1.0", + "nock": "14.0.0-beta.7", + "proxyquire": "^2.1.3", + "sinon": "^20.0.0", + "sinon-chai": "^4.0.0", + "ts-node": "^10.9.1", + "tslib": "^2.8.1", + "tsx": "^4.19.4", + "typescript": "~5.8.3" + }, + "peerDependencies": { + "@sitecore-content-sdk/core": "^2.0.0" + }, + "types": "types/index.d.ts", + "files": [ + "dist", + "types", + "/*.js", + "/*.d.ts" + ], + "exports": { + "./config": { + "import": "./dist/esm/config/index.js", + "require": "./dist/cjs/config/index.js", + "types": "./types/config/index.d.ts" + }, + "./node-tools": { + "import": "./dist/esm/tools/index-node.js", + "require": "./dist/cjs/tools/index-node.js", + "types": "./types/tools/index-node.d.ts" + }, + "./site": { + "import": "./dist/esm/site/index.js", + "require": "./dist/cjs/site/index.js", + "types": "./types/site/index.d.ts" + } + }, + "gitHead": "4724f2214e80450076a12e36844e89d6b81229c4" +} diff --git a/packages/content/site.d.ts b/packages/content/site.d.ts new file mode 100644 index 0000000..877b126 --- /dev/null +++ b/packages/content/site.d.ts @@ -0,0 +1 @@ +export * from './types/site/index'; diff --git a/packages/content/src/config/define-config.test.ts b/packages/content/src/config/define-config.test.ts new file mode 100644 index 0000000..364b0a8 --- /dev/null +++ b/packages/content/src/config/define-config.test.ts @@ -0,0 +1,99 @@ +/* eslint-disable no-unused-expressions, @typescript-eslint/no-unused-expressions */ +import { expect } from 'chai'; +import { deepMerge, defineConfig, getFallbackConfig } from './define-config'; +import { Constellation4SitecoreConfigInput } from './models'; + +describe('define-config', () => { + const mockConfig: Constellation4SitecoreConfigInput = { + virtualFolders: { enabled: true }, + }; + + it('merges config from sitecore.config with default values', () => { + const config = defineConfig(mockConfig); + // virtual folders + expect(config.virtualFolders.enabled).to.equal(mockConfig.virtualFolders?.enabled); + }); + + it('applies fallback virtual folders timeouts when values are falsy', () => { + const zeroTimeout = { ...mockConfig, virtualFolders: { enabled: false } }; + const fallback = getFallbackConfig(); + + let cfg = defineConfig(zeroTimeout); + expect(cfg.virtualFolders.enabled).to.equal(fallback.virtualFolders.enabled); + }); + + describe('getFallbackConfig', () => { + it('populates env variables in fallback config', () => { + process.env.VIRTUAL_FOLDERS_ENABLED = 'true'; + + const cfg = getFallbackConfig(); + expect(cfg.virtualFolders.enabled).to.equal(true); + }); + + it('falls back to defaults when env variables are absent', () => { + delete process.env.VIRTUAL_FOLDERS_ENABLED; + + const cfg = getFallbackConfig(); + expect(cfg.virtualFolders.enabled).to.equal(false); + }); + }); + + describe('deepMerge', () => { + it('keeps base value when override is empty or undefined', () => { + expect(deepMerge({ deep: { test: 'base' } }, { deep: { test: '' } })).to.deep.equal({ + deep: { test: 'base' }, + }); + + expect(deepMerge({ deep: { test: 'base' } }, { deep: { test: undefined } })).to.deep.equal({ + deep: { test: 'base' }, + }); + }); + + it('merges nested objects correctly', () => { + class Test { + a = true; + } + class BaseTest extends Test { + b = true; + } + + const base = { + deep: { + fn: () => false, + class: new BaseTest(), + array: [4, 5, 6], + number: 5, + string: '5', + }, + boolean: true, + }; + + const override = { + deep: { + fn: () => true, + class: new Test(), + nullValue: null, + array: [1, 2, 3], + number: 10, + string: '10', + }, + boolean: false, + }; + + expect(deepMerge(base, override)).to.deep.equal(override); + }); + }); + + describe('validateConfig server-side behaviour', () => { + let originalWindow: any; + + beforeEach(() => { + originalWindow = (global as any).window; + delete (global as any).window; // simulate server + }); + + afterEach(() => { + if (originalWindow !== undefined) (global as any).window = originalWindow; + }); + }); +}); diff --git a/packages/content/src/config/define-config.ts b/packages/content/src/config/define-config.ts new file mode 100644 index 0000000..753e45d --- /dev/null +++ b/packages/content/src/config/define-config.ts @@ -0,0 +1,81 @@ +import { + DeepPartial, + Constellation4SitecoreConfig, + Constellation4SitecoreConfigInput, +} from './models'; + +/** + * Provides default initial values for SitecoreConfig + * @returns default config + */ +export const getFallbackConfig = (): Constellation4SitecoreConfig => ({ + virtualFolders: { + enabled: process.env.VIRTUAL_FOLDERS_ENABLED?.toLowerCase() === 'true', + }, +}); + +/** + * Deep merge utility that skips undefined or empty string values in the override. + * @param {T} base base value + * @param {DeepPartial} [override] override value + */ +export function deepMerge(base: T, override?: DeepPartial): T { + if (!override) return base; + + const result: T = { ...base }; + + for (const key in override) { + if (!Object.prototype.hasOwnProperty.call(override, key)) continue; + + const typedKey = key as keyof T; + const baseValue = base[typedKey]; + const overrideValue = override[typedKey]; + + // Skip undefined and empty string overrides + if (overrideValue === undefined || overrideValue === '') { + continue; + } + + if ( + typeof overrideValue === 'object' && + overrideValue !== null && + !Array.isArray(overrideValue) && + Object.getPrototypeOf(overrideValue) === Object.prototype + ) { + result[typedKey] = deepMerge(baseValue, overrideValue); + } else { + result[typedKey] = overrideValue as T[typeof typedKey]; + } + } + + return result; +} + +/** + * Resolves constellation4sitecore config based on base config and overrides + * @param {Constellation4SitecoreConfig} base base constellation4sitecore config object + * @param {Constellation4SitecoreConfigInput} override override constellation4sitecore config object + * @returns resolved Constellation4SitecoreConfig object + */ +const resolveConfig = ( + base: Constellation4SitecoreConfig, + override: Constellation4SitecoreConfigInput +): Constellation4SitecoreConfig => { + const result: Constellation4SitecoreConfig = deepMerge(base, override); + + return result; +}; + +/** + * Accepts a Constellation4SitecoreConfigInput object and returns full constellation4sitecore configuration + * @param {Constellation4SitecoreConfigInput} config override values to be written over default config settings + * @returns {Constellation4SitecoreConfigInput} full constellation4sitecore configuration to use in application + * @public + */ +export const defineConfig = ( + config: Constellation4SitecoreConfigInput +): Constellation4SitecoreConfig => { + const resolvedConfig = resolveConfig(getFallbackConfig(), config); + + return resolvedConfig; +}; diff --git a/packages/content/src/config/index.ts b/packages/content/src/config/index.ts new file mode 100644 index 0000000..020b94c --- /dev/null +++ b/packages/content/src/config/index.ts @@ -0,0 +1,6 @@ +export { + Constellation4SitecoreConfig, + Constellation4SitecoreConfigInput, + DeepRequired, +} from './models'; +export { defineConfig } from './define-config'; diff --git a/packages/content/src/config/models.ts b/packages/content/src/config/models.ts new file mode 100644 index 0000000..4db8506 --- /dev/null +++ b/packages/content/src/config/models.ts @@ -0,0 +1,39 @@ +/** + * Utility type to make every property in a type required + * @public + */ +export type DeepRequired = Required<{ + [K in keyof T]: T[K] extends Required ? T[K] : DeepRequired; +}>; + +/** + * Utility type to make all properties in a type optional, recursively + * @internal + */ +export type DeepPartial = { + [K in keyof T]?: T[K] extends object ? DeepPartial : T[K]; +}; + +/** + * Type to be used as config input in sitecore.config + * @public + */ +export type Constellation4SitecoreConfigInput = { + /** + * Settings for virtual folders functionality + */ + virtualFolders?: { + /** + * Enable virtual folders + * @default true + */ + enabled?: boolean; + }; +}; + +/** + * Final Sitecore config type used at runtime. + * Every property is populated, either from sitecore.config or fallback values. + * @public + */ +export type Constellation4SitecoreConfig = DeepRequired; diff --git a/packages/content/src/debug.ts b/packages/content/src/debug.ts new file mode 100644 index 0000000..7056c2a --- /dev/null +++ b/packages/content/src/debug.ts @@ -0,0 +1,61 @@ +/* eslint-disable import/no-anonymous-default-export */ +import debug from 'debug'; +import isServer from './utils/is-server'; + +/** + * Debug module + * @public + */ +export const debugModule = debug; + +/** + * Debug namespace + * @public + */ +export const debugNamespace = 'constellation4sitecore-content-sdk'; + +/** + * Debugger type + * @public + */ +export type Debugger = debug.Debugger; + +// On server/node side, allow switching from the built-in +// `%o` (pretty-print single line) and `%O` (pretty-print multiple line) +// with a `DEBUG_MULTILINE` environment variable. +if ( + isServer() && + process?.env?.DEBUG_MULTILINE === 'true' && + debug.formatters.o && + debug.formatters.O +) { + debug.formatters.o = debug.formatters.O; +} + +/** + * Enable debug logging dynamically + * @param {string} namespaces space-separated list of namespaces to enable + * @public + */ +export const enableDebug = (namespaces: string) => debug.enable(namespaces); + +/** + * Check if a debug namespace is enabled + * @param {string} namespace the namespace to check + * @returns {boolean} whether the namespace is enabled + * @public + */ +export function isNamespaceEnabled(namespace: string): boolean { + return debug.enabled(namespace); +} + +/** + * Default Sitecore Content SDK 'debug' module debuggers. Uses namespace prefix 'content-sdk:'. + * See {@link https://www.npmjs.com/package/debug} for details. + */ +export default { + common: debug(`${debugNamespace}:common`), + http: debug(`${debugNamespace}:http`), + init: debug(`${debugNamespace}:init`), + virtualFolder: debug(`${debugNamespace}:virtualFolder`), +}; diff --git a/packages/content/src/index.ts b/packages/content/src/index.ts new file mode 100644 index 0000000..1a86d79 --- /dev/null +++ b/packages/content/src/index.ts @@ -0,0 +1,8 @@ +export { + default as debug, + Debugger, + enableDebug, + debugNamespace, + debugModule, + isNamespaceEnabled, +} from './debug'; diff --git a/packages/content/src/site/index.ts b/packages/content/src/site/index.ts new file mode 100644 index 0000000..7909594 --- /dev/null +++ b/packages/content/src/site/index.ts @@ -0,0 +1,2 @@ +export { SiteInfoWithVirtualFolder } from './models'; +export { SiteInfoService } from './siteinfo-service'; diff --git a/packages/content/src/site/models.ts b/packages/content/src/site/models.ts new file mode 100644 index 0000000..595191f --- /dev/null +++ b/packages/content/src/site/models.ts @@ -0,0 +1,15 @@ +import { SiteInfo } from '@sitecore-content-sdk/content/site'; + +export type SiteInfoWithAttributes = { + name: string; + hostName: string; + language: string; + attributes: { + key: string; + value: string; + }[]; +}; + +export type SiteInfoWithVirtualFolder = SiteInfo & { + virtualFolder: string; +}; diff --git a/packages/content/src/site/siteinfo-service.test.ts b/packages/content/src/site/siteinfo-service.test.ts new file mode 100644 index 0000000..cfd0811 --- /dev/null +++ b/packages/content/src/site/siteinfo-service.test.ts @@ -0,0 +1,258 @@ +import { expect } from 'chai'; +import { debugModule } from '@sitecore-content-sdk/core'; +import nock from 'nock'; +import { SiteInfoService } from './siteinfo-service'; +import { SiteInfoWithAttributes } from './models'; +import { GraphQLRequestClient } from '@sitecore-content-sdk/content/client'; +import debug from '../debug'; +describe('SiteInfoService', () => { + let debugNamespaces: string; + const endpoint = 'http://site'; + const apiKey = 'some-api-key'; + const clientFactory = GraphQLRequestClient.createClientFactory({ + endpoint, + apiKey, + }); + + const site = ({ + name, + hostName, + language, + attributes, + }: { + name: string; + hostName: string; + language: string; + attributes: { + key: string; + value: string; + }[]; + }): SiteInfoWithAttributes => ({ + name: name, + hostName: hostName, + language: language, + attributes: attributes, + }); + + const nonEmptyResponse = ({ + count = 1, + sites = [], + }: { + count?: number; + sites?: SiteInfoWithAttributes[]; + } = {}) => ({ + data: { + site: { + siteInfoCollection: [ + ...[...(Array(count).keys() as unknown as number[])].map((n: number) => + site({ + name: `site ${n}`, + hostName: 'restricted.gov', + language: 'en', + attributes: [ + { + key: 'virtualFolder', + value: '/', + }, + ], + }) + ), + ...sites, + ], + }, + }, + }); + + const emptyResponse = { + data: { + site: { + siteInfoCollection: [], + }, + }, + }; + + before(() => { + debugNamespaces = debugModule.disable(); + debugModule.enable(debug.virtualFolder.namespace); + }); + + afterEach(() => { + nock.cleanAll(); + delete process.env.SITECORE; + }); + + after(() => { + debugModule.enable(debugNamespaces); + }); + + const mockSiteInfoRequest = (response: { [key: string]: unknown }) => { + nock(endpoint).post('/').reply(200, response); + }; + + it('should return correct result', async () => { + mockSiteInfoRequest( + nonEmptyResponse({ + sites: [ + site({ + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + attributes: [ + { + key: 'virtualFolder', + value: '/', + }, + ], + }), + ], + }) + ); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + expect(result).to.be.deep.equal([ + { + name: 'site 0', + hostName: 'restricted.gov', + language: 'en', + }, + { + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + }, + ]); + }); + + it('should return correct result using clientFactory', async () => { + mockSiteInfoRequest( + nonEmptyResponse({ + sites: [ + site({ + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + attributes: [ + { + key: 'virtualFolder', + value: '/', + }, + ], + }), + ], + }) + ); + const clientFactory = GraphQLRequestClient.createClientFactory({ + endpoint, + apiKey, + }); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + expect(result).to.be.deep.equal([ + { + name: 'site 0', + hostName: 'restricted.gov', + language: 'en', + }, + { + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + }, + ]); + }); + it('should return empty array when empty result received', async () => { + nock(endpoint).post('/').reply(200, emptyResponse); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + expect(result).to.deep.equal([]); + }); + + it('should use caching by default', async () => { + mockSiteInfoRequest(nonEmptyResponse()); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + nock.cleanAll(); + nock(endpoint).post('/').reply(200, emptyResponse); + const resultCached = await service.fetchSiteInfo(); + expect(resultCached).to.deep.equal(result); + }); + + it('should be possible to disable cache', async () => { + mockSiteInfoRequest( + nonEmptyResponse({ + sites: [ + site({ + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + attributes: [ + { + key: 'virtualFolder', + value: '/', + }, + ], + }), + ], + }) + ); + const service = new SiteInfoService({ + clientFactory, + cacheEnabled: false, + }); + const result = await service.fetchSiteInfo(); + expect(result).to.be.deep.equal([ + { + name: 'site 0', + hostName: 'restricted.gov', + language: 'en', + }, + { + name: 'public 0', + hostName: 'pr.showercurtains.org', + language: '', + }, + ]); + nock.cleanAll(); + nock(endpoint).post('/').reply(200, emptyResponse); + const resultCached = await service.fetchSiteInfo(); + expect(resultCached).to.deep.equal([]); + }); + + it('should skip on XM Cloud', async () => { + process.env.SITECORE = 'true'; + nock(endpoint).post('/').reply(200, emptyResponse); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + expect(result).to.deep.equal([]); + expect(nock.isDone(), 'skip request').to.be.false; + }); + + it('should filter out default website', async () => { + mockSiteInfoRequest( + nonEmptyResponse({ + sites: [ + site({ + name: 'website', + hostName: 'notheadless.org', + language: '', + attributes: [ + { + key: 'virtualFolder', + value: '/', + }, + ], + }), + ], + }) + ); + const service = new SiteInfoService({ clientFactory }); + const result = await service.fetchSiteInfo(); + expect(result).to.be.deep.equal([ + { + name: 'site 0', + hostName: 'restricted.gov', + language: 'en', + }, + ]); + }); +}); diff --git a/packages/content/src/site/siteinfo-service.ts b/packages/content/src/site/siteinfo-service.ts new file mode 100644 index 0000000..e13089f --- /dev/null +++ b/packages/content/src/site/siteinfo-service.ts @@ -0,0 +1,99 @@ +import { + SiteInfoService as SiteInfoServiceBase, + SiteInfoServiceConfig, +} from '@sitecore-content-sdk/content/site'; +import { + CacheClient, + FetchOptions, + GraphQLClient, + MemoryCacheClient, +} from '@sitecore-content-sdk/core'; +import { gql } from 'graphql-request'; +import { SiteInfoWithAttributes, SiteInfoWithVirtualFolder } from './models'; +import debug from '../debug'; + +const siteQuery = gql` + query { + site { + siteInfoCollection { + name + hostName: hostname + language + attributes { + key + value + } + } + } + } +`; + +type GraphQLSiteInfoResponse = { + site: { + siteInfoCollection: SiteInfoWithAttributes[]; + }; +}; + +export class SiteInfoService extends SiteInfoServiceBase { + private siteGraphQLClient: GraphQLClient; + private siteCache: CacheClient; + constructor(private readonly siteConfig: SiteInfoServiceConfig) { + super(siteConfig); + this.siteCache = this.getSiteCacheClient(); + this.siteGraphQLClient = this.getGraphQLClient(); + } + + /** + * Gets cache client implementation + * Override this method if custom cache needs to be used + * @returns CacheClient instance + */ + protected getSiteCacheClient(): CacheClient { + return new MemoryCacheClient({ + cacheEnabled: this.siteConfig.cacheEnabled ?? true, + cacheTimeout: this.siteConfig.cacheTimeout ?? 10, + }); + } + + async fetchSiteInfoWithAttributes(fetchOptions?: FetchOptions) { + const cachedResult = this.siteCache.getCacheValue(this.getSiteCacheKey()); + if (cachedResult) { + return cachedResult; + } + if (process.env.SITECORE) { + debug.virtualFolder('Skipping site information fetch (building on XM Cloud)'); + return []; + } + const response = await this.siteGraphQLClient.request( + siteQuery, + {}, + fetchOptions + ); + const results = response?.site?.siteInfoCollection?.reduce( + (result, current) => { + result.push({ + name: current.name, + hostName: current.hostName, + language: current.language, + virtualFolder: this.removeTrailingSlash( + current.attributes.find( + (attribute: { key: string; value: string }) => attribute.key === 'virtualFolder' + )?.value ?? '' + ), + }); + return result; + }, + [] + ); + this.siteCache.setCacheValue(this.getSiteCacheKey(), results); + return results; + } + + private removeTrailingSlash(virtualFolder: string): string { + return virtualFolder.replace(/\/$/, ''); + } + + private getSiteCacheKey(): string { + return 'siteinfo-with-virtual-folder-service-cache'; + } +} diff --git a/packages/content/src/tools/generate-virtual-folders.ts b/packages/content/src/tools/generate-virtual-folders.ts new file mode 100644 index 0000000..66dcd43 --- /dev/null +++ b/packages/content/src/tools/generate-virtual-folders.ts @@ -0,0 +1,87 @@ +import path from 'path'; +import chalk from 'chalk'; +import fs from 'fs'; +import { ensurePathExists } from '@sitecore-content-sdk/core/node-tools'; +import { constants } from '@sitecore-content-sdk/core'; +import { SitecoreConfig } from '@sitecore-content-sdk/nextjs/config'; +import { createGraphQLClientFactory } from '@sitecore-content-sdk/nextjs/client'; +import debug from '../debug'; +import { SiteInfoWithVirtualFolder } from '../site'; +import { SiteInfoService } from '../site'; +import { Constellation4SitecoreConfig } from '../config'; + +const { ERROR_MESSAGES } = constants; +const DEFAULT_SITES_DIST_PATH = '.sitecore/virtual-folders.json'; + +/** + * Configuration object for generating sites. + * @public + */ +export type GenerateSitesConfig = { + c4sConfig: Constellation4SitecoreConfig; + /** + * Optional path where the generated sites will be saved. + * If not provided, the default '.sitecore/sites.json' will be used. + */ + destinationPath?: string; +}; + +/** + * Generates site information and writes it to a specified destination path. + * @param {GenerateSitesConfig} config - The configuration for generating site info. + * @returns {Promise} - A promise that resolves to an asynchronous function that fetches site information and writes it to a file. + * @public + */ +export const generateVirtualFolders = ({ + c4sConfig, + destinationPath, +}: GenerateSitesConfig): ((args: { scConfig: SitecoreConfig }) => Promise) => { + return async ({ scConfig }: { scConfig: SitecoreConfig }) => { + if (!scConfig) { + throw new Error(ERROR_MESSAGES.MV_008); + } + + let sites: SiteInfoWithVirtualFolder[] = []; + const sitesFilePath = path.resolve(destinationPath ?? DEFAULT_SITES_DIST_PATH); + + debug.virtualFolder( + c4sConfig.virtualFolders.enabled + ? 'Virtual Folders Enabled: Generating site information' + : 'Virtual Folders Disabled' + ); + + if (c4sConfig.virtualFolders.enabled) { + try { + const siteInfoService = new SiteInfoService({ + clientFactory: createGraphQLClientFactory({ + api: scConfig.api, + retries: scConfig.retries.count, + retryStrategy: scConfig.retries.retryStrategy, + }), + }); + + sites = await siteInfoService.fetchSiteInfoWithAttributes(); + } catch (error) { + console.error( + chalk.red(`Failed to fetch site information. ${ERROR_MESSAGES.CONTACT_SUPPORT}`) + ); + throw error; + } + } + + // Add default site to the list + const defaultSite: SiteInfoWithVirtualFolder = { + name: scConfig.defaultSite, + hostName: '*', + language: scConfig.defaultLanguage, + virtualFolder: '', + }; + sites.unshift(defaultSite); + + ensurePathExists(sitesFilePath); + + fs.writeFileSync(sitesFilePath, JSON.stringify(sites, null, 2), { + encoding: 'utf8', + }); + }; +}; diff --git a/packages/content/src/tools/generate-virtual.folders.test.ts b/packages/content/src/tools/generate-virtual.folders.test.ts new file mode 100644 index 0000000..b6fec04 --- /dev/null +++ b/packages/content/src/tools/generate-virtual.folders.test.ts @@ -0,0 +1,172 @@ +import { expect } from 'chai'; +import sinon from 'sinon'; +import path from 'path'; +import fs from 'fs'; +import chalk from 'chalk'; +import { constants } from '@sitecore-content-sdk/core'; +import { GenerateSitesConfig } from './generate-virtual-folders'; +import { SiteInfoWithVirtualFolder, SiteInfoService } from '../site'; +import { SitecoreConfigInput, defineConfig } from '@sitecore-content-sdk/content/config'; +import proxyquire from 'proxyquire'; +import nock from 'nock'; +import { Constellation4SitecoreConfig } from '../config'; + +const { ERROR_MESSAGES } = constants; + +const defaultSite: SiteInfoWithVirtualFolder = { + name: 'defaultSite', + hostName: '*', + language: 'en', + virtualFolder: '', +}; + +const mockConfig: SitecoreConfigInput = { + api: { + edge: { + contextId: 'context-id', + clientContextId: 'client-id', + }, + }, + defaultSite: defaultSite.name, + defaultLanguage: defaultSite.language, + multisite: { + enabled: true, + }, +}; + +describe('generateVirtualFolders', () => { + let ensurePathExistsStub: sinon.SinonStub; + let fsWriteFileSyncStub: sinon.SinonStub; + let consoleErrorStub: sinon.SinonStub; + let generateSites: any; + + beforeEach(() => { + ensurePathExistsStub = sinon.stub(); + fsWriteFileSyncStub = sinon.stub(fs, 'writeFileSync'); + sinon.stub(console, 'log'); + consoleErrorStub = sinon.stub(console, 'error'); + + const generateSitesModule = proxyquire('./generate-virtual-folders', { + '@sitecore-content-sdk/core/node-tools': { ensurePathExists: ensurePathExistsStub }, + }); + generateSites = generateSitesModule.generateVirtualFolders; + }); + + afterEach(() => { + sinon.restore(); + nock.cleanAll(); + }); + + const runCommand = (generateSitesConfig: GenerateSitesConfig) => { + const scConfig = defineConfig(mockConfig); + const generate = generateSites(generateSitesConfig); + return generate({ scConfig }); + }; + + it('should write site info to the default path when destinationPath is not provided', async () => { + const config: GenerateSitesConfig = { + c4sConfig: { + virtualFolders: { + enabled: true, + }, + }, + }; + sinon.stub(SiteInfoService.prototype, 'fetchSiteInfoWithAttributes').resolves([defaultSite]); + + await runCommand(config); + + const expectedPath = path.resolve('.sitecore/virtual-folders.json'); + expect(ensurePathExistsStub.calledWith(expectedPath)).to.be.true; + expect( + fsWriteFileSyncStub.calledWith( + expectedPath, + JSON.stringify([defaultSite, defaultSite], null, 2), + { + encoding: 'utf8', + } + ) + ).to.be.true; + }); + + it('should write site info to the provided destinationPath', async () => { + const destinationPath = 'custom/path/sites.json'; + const c4sConfig: Constellation4SitecoreConfig = { + virtualFolders: { + enabled: true, + }, + }; + const config: GenerateSitesConfig = { + destinationPath: destinationPath, + c4sConfig: c4sConfig, + }; + sinon.stub(SiteInfoService.prototype, 'fetchSiteInfoWithAttributes').resolves([defaultSite]); + + await runCommand(config); + + const expectedPath = path.resolve(destinationPath); + expect(ensurePathExistsStub.calledWith(expectedPath)).to.be.true; + expect( + fsWriteFileSyncStub.calledWith( + expectedPath, + JSON.stringify([defaultSite, defaultSite], null, 2), + { + encoding: 'utf8', + } + ) + ).to.be.true; + }); + + it('should fetch site information when virtual folders are enabled', async () => { + const fetchedSites: SiteInfoWithVirtualFolder[] = [ + { name: 'site1', hostName: 'site1.com', language: 'de/DE', virtualFolder: '' }, + { name: 'site2', hostName: 'site2.com', language: 'da/DK', virtualFolder: '/site2' }, + ]; + sinon.stub(SiteInfoService.prototype, 'fetchSiteInfoWithAttributes').resolves(fetchedSites); + + const config: GenerateSitesConfig = { + c4sConfig: { + virtualFolders: { + enabled: true, + }, + }, + }; + + await runCommand(config); + + const expectedPath = path.resolve('.sitecore/virtual-folders.json'); + expect(ensurePathExistsStub.calledWith(expectedPath)).to.be.true; + + expect( + fsWriteFileSyncStub.calledWith(expectedPath, JSON.stringify(fetchedSites, null, 2), { + encoding: 'utf8', + }) + ).to.be.true; + }); + + it('should log an error when fetching site information fails', async () => { + sinon + .stub(SiteInfoService.prototype, 'fetchSiteInfoWithAttributes') + .rejects(new Error('Fetch error')); + const config: GenerateSitesConfig = { + c4sConfig: { + virtualFolders: { + enabled: true, + }, + }, + }; + + try { + await runCommand(config); + expect.fail('Expected function to throw an error'); + } catch (error) { + expect(error).to.be.instanceOf(Error); + expect((error as Error).message).to.include('Fetch error'); + } + + expect( + consoleErrorStub.calledWith( + chalk.red(`Failed to fetch site information. ${ERROR_MESSAGES.CONTACT_SUPPORT}`) + ) + ).to.be.true; + }); +}); diff --git a/packages/content/src/tools/index-node.ts b/packages/content/src/tools/index-node.ts new file mode 100644 index 0000000..37a6cc0 --- /dev/null +++ b/packages/content/src/tools/index-node.ts @@ -0,0 +1 @@ +export { generateVirtualFolders } from './generate-virtual-folders'; diff --git a/packages/content/src/utils/is-server.ts b/packages/content/src/utils/is-server.ts new file mode 100644 index 0000000..d02e191 --- /dev/null +++ b/packages/content/src/utils/is-server.ts @@ -0,0 +1,9 @@ +/** + * Determines whether the current execution context is server-side + * @returns true if executing server-side + */ +function isServer(): boolean { + return !(typeof window !== 'undefined' && window.document); +} + +export default isServer; diff --git a/packages/content/tsconfig-esm.json b/packages/content/tsconfig-esm.json new file mode 100644 index 0000000..624ab17 --- /dev/null +++ b/packages/content/tsconfig-esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2022", + "outDir": "dist/esm" + } +} diff --git a/packages/content/tsconfig.json b/packages/content/tsconfig.json new file mode 100644 index 0000000..501ec0e --- /dev/null +++ b/packages/content/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "target": "es2017", + "skipLibCheck": true, + "useUnknownInCatchVariables": false, + "module": "commonjs", + "outDir": "dist/cjs", + "typeRoots": ["node_modules/@types"], + "declarationDir": "./types" + }, + "exclude": [ + "node_modules", + "types", + "dist", + "config.d.ts", + "node-tools.d.ts", + "site.d.ts", + "src/**/*.test.ts", + "src/test-data/**/*", + "src/tools/codegen/test-data/**/*", + "api" + ] +} diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index ff579f3..c293a2a 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -33,6 +33,8 @@ "@types/node": "^24.10.4", "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", + "@types/proxyquire": "^1.3.31", + "@types/sinon": "^17.0.4", "chai": "^4.4.1", "chai-string": "^1.6.0", "copyfiles": "^2.4.1", @@ -41,14 +43,16 @@ "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", "mocha": "^11.2.2", + "proxyquire": "^2.1.3", "next": "^16.1.1", "react": "^19.2.1", "react-dom": "^19.2.1", + "sinon": "^20.0.0", "ts-node": "^10.9.2", "typescript": "~5.8.3" }, "dependencies": { - "debug": "^4.3.1" + "@constellation4sitecore-content-sdk/content": "2.0.0-beta.3" }, "peerDependencies": { "@sitecore-content-sdk/nextjs": "^2.0.0" diff --git a/packages/nextjs/proxy.d.ts b/packages/nextjs/proxy.d.ts new file mode 100644 index 0000000..80e69df --- /dev/null +++ b/packages/nextjs/proxy.d.ts @@ -0,0 +1 @@ +export * from './types/proxy/index'; diff --git a/packages/nextjs/src/config/define-config.test.ts b/packages/nextjs/src/config/define-config.test.ts new file mode 100644 index 0000000..64e08a0 --- /dev/null +++ b/packages/nextjs/src/config/define-config.test.ts @@ -0,0 +1,74 @@ +/* eslint-disable no-unused-expressions, @typescript-eslint/no-unused-expressions */ +import { expect } from 'chai'; +import sinon from 'sinon'; +import proxyquire from 'proxyquire'; + +describe('defineConfig', () => { + let defineConfigCoreStub: sinon.SinonStub; + let defineConfigModule: any; + const sandbox = sinon.createSandbox(); + const defaultConfig = () => ({}); + + beforeEach(() => { + defineConfigCoreStub = sandbox.stub(); + defineConfigModule = proxyquire('./define-config', { + '@constellation4sitecore-content-sdk/content/config': { defineConfig: defineConfigCoreStub }, + }); + }); + + afterEach(() => { + sandbox.restore(); + }); + + describe('config.virtualFolders', () => { + describe('enabled', () => { + it('should default to false', () => { + defineConfigModule.defineConfig(defaultConfig()); + const resultConfig = defineConfigCoreStub.getCalls()[0].args[0]; + expect(resultConfig.virtualFolders.enabled).to.be.false; + }); + + it('should be able to override default value of enabled', () => { + defineConfigModule.defineConfig({ ...defaultConfig(), virtualFolders: { enabled: true } }); + const resultConfig = defineConfigCoreStub.getCalls()[0].args[0]; + expect(resultConfig.virtualFolders.enabled).to.be.true; + }); + }); + }); + + describe('environment variable is set', () => { + afterEach(() => { + delete process.env.VIRTUAL_FOLDERS_ENABLED; + }); + + it('should return false when VIRTUAL_FOLDERS_ENABLED is set to false', () => { + process.env.VIRTUAL_FOLDERS_ENABLED = 'false'; + + defineConfigModule.defineConfig({ + ...defaultConfig(), + }); + const resultConfig = defineConfigCoreStub.getCalls()[0].args[0]; + expect(resultConfig.virtualFolders.enabled).to.equal(false); + }); + + it('should return true when VIRTUAL_FOLDERS_ENABLED is set to true', () => { + process.env.VIRTUAL_FOLDERS_ENABLED = 'true'; + + defineConfigModule.defineConfig({ + ...defaultConfig(), + }); + const resultConfig = defineConfigCoreStub.getCalls()[0].args[0]; + expect(resultConfig.virtualFolders.enabled).to.equal(true); + }); + + it('should return false when VIRTUAL_FOLDERS_ENABLED is set to any other value', () => { + process.env.VIRTUAL_FOLDERS_ENABLED = 'some-other-value'; + + defineConfigModule.defineConfig({ + ...defaultConfig(), + }); + const resultConfig = defineConfigCoreStub.getCalls()[0].args[0]; + expect(resultConfig.virtualFolders.enabled).to.equal(false); + }); + }); +}); diff --git a/packages/nextjs/src/config/define-config.ts b/packages/nextjs/src/config/define-config.ts new file mode 100644 index 0000000..849dd1f --- /dev/null +++ b/packages/nextjs/src/config/define-config.ts @@ -0,0 +1,49 @@ +import { + DeepRequired, + defineConfig as defineConfigCore, + Constellation4SitecoreConfigInput as Constellation4SitecoreConfigInputCore, +} from '@constellation4sitecore-content-sdk/content/config'; + +/** + * Provides default NextJs initial values from env variables for SitecoreConfig + * @param {SitecoreConfigInput} config optional override values to be written over default config settings + * @returns default nextjs input config + */ +export const getNextFallbackConfig = ( + config?: Constellation4SitecoreConfigInput +): Constellation4SitecoreConfigInput => { + return { + ...config, + + virtualFolders: { + enabled: + process.env.VIRTUAL_FOLDERS_ENABLED != undefined + ? process.env.VIRTUAL_FOLDERS_ENABLED?.toLowerCase() === 'true' + : config?.virtualFolders?.enabled ?? false, + }, + }; +}; + +/** + * Type to be used as config input in constellation4sitecore.config + * @public + */ +export type Constellation4SitecoreConfigInput = Constellation4SitecoreConfigInputCore; + +/** + * Final constellation4sitecore config type used at runtime Every property should be populated, either from constellation4sitecore.config or built-in fallback values + * @public + */ +export type Constellation4SitecoreConfig = DeepRequired; + +/** + * Accepts a SitecoreConfigInput object and returns full sitecore configuration + * @param {SitecoreConfigInput} config override values to be written over default config settings + * @returns {SitecoreConfig} full sitecore configuration to use in application + * @public + */ +export const defineConfig = ( + config?: Constellation4SitecoreConfigInput +): Constellation4SitecoreConfig => { + return defineConfigCore(getNextFallbackConfig(config)) as Constellation4SitecoreConfig; +}; diff --git a/packages/nextjs/src/config/index.ts b/packages/nextjs/src/config/index.ts new file mode 100644 index 0000000..1c677c5 --- /dev/null +++ b/packages/nextjs/src/config/index.ts @@ -0,0 +1,5 @@ +export { + Constellation4SitecoreConfig, + Constellation4SitecoreConfigInput, + defineConfig, +} from './define-config'; diff --git a/packages/nextjs/src/debug.ts b/packages/nextjs/src/debug.ts index f047a15..3ece92b 100644 --- a/packages/nextjs/src/debug.ts +++ b/packages/nextjs/src/debug.ts @@ -1,38 +1,15 @@ -import debug from 'debug'; -import isServer from './utils/is-server'; - -const rootNamespace = 'constellation-sxa-nextjs'; - -export type Debugger = debug.Debugger; - -// On server/node side, allow switching from the built-in -// `%o` (pretty-print single line) and `%O` (pretty-print multiple line) -// with a `DEBUG_MULTILINE` environment variable. -if ( - isServer() && - process?.env?.DEBUG_MULTILINE === 'true' && - debug.formatters.o && - debug.formatters.O -) { - debug.formatters.o = debug.formatters.O; -} - -/** - * Enable debug logging dynamically - * @param {string} namespaces space-separated list of namespaces to enable - */ -export const enableDebug = (namespaces: string) => debug.enable(namespaces); +import { debugNamespace, debugModule } from '@constellation4sitecore-content-sdk/content'; /** * Default Sitecore JSS 'debug' module debuggers. Uses namespace prefix 'sitecore-jss:'. * See {@link https://www.npmjs.com/package/debug} for details. */ export default { - common: debug(`${rootNamespace}:common`), - labels: debug(`${rootNamespace}:labels`), - navigation: debug(`${rootNamespace}:navigation`), - data: debug(`${rootNamespace}:data`), - analytics: debug(`${rootNamespace}:analytics`), - security: debug(`${rootNamespace}:security`), - http: debug(`${rootNamespace}:http`), + common: debugModule(`${debugNamespace}:common`), + labels: debugModule(`${debugNamespace}:labels`), + navigation: debugModule(`${debugNamespace}:navigation`), + data: debugModule(`${debugNamespace}:data`), + analytics: debugModule(`${debugNamespace}:analytics`), + security: debugModule(`${debugNamespace}:security`), + http: debugModule(`${debugNamespace}:http`), }; diff --git a/packages/nextjs/src/proxy/index.ts b/packages/nextjs/src/proxy/index.ts new file mode 100644 index 0000000..1de4f58 --- /dev/null +++ b/packages/nextjs/src/proxy/index.ts @@ -0,0 +1 @@ +export { VirtualFolderProxy, VirtualFolderProxyConfig } from './virtual-folder-proxy'; diff --git a/packages/nextjs/src/proxy/virtual-folder-proxy.test.ts b/packages/nextjs/src/proxy/virtual-folder-proxy.test.ts new file mode 100644 index 0000000..56d09bd --- /dev/null +++ b/packages/nextjs/src/proxy/virtual-folder-proxy.test.ts @@ -0,0 +1,260 @@ +/* eslint-disable no-unused-expressions, @typescript-eslint/no-unused-expressions */ +import { expect } from 'chai'; +import sinon from 'sinon'; +import proxyquire from 'proxyquire'; +import nextjs, { NextRequest, NextResponse } from 'next/server'; +import type { VirtualFolderProxyConfig } from './virtual-folder-proxy'; +import type { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; + +class StubProxyBase { + constructor(_config: unknown) {} +} + +const { VirtualFolderProxy } = proxyquire.noCallThru()('./virtual-folder-proxy', { + '@sitecore-content-sdk/nextjs/proxy': { + ProxyBase: StubProxyBase, + }, +}); + +function createRequest(pathname: string, origin = 'http://localhost:3000'): NextRequest { + const fullUrl = `${origin}${pathname}`; + return { + url: fullUrl, + nextUrl: { + pathname, + origin, + search: '', + href: fullUrl, + }, + } as NextRequest; +} + +function minimalConfig( + partial: Partial & { + virtualFolders?: SiteInfoWithVirtualFolder[]; + c4sConfig?: VirtualFolderProxyConfig['c4sConfig']; + } +): VirtualFolderProxyConfig { + return { + sites: [], + enabled: true, + useCookieResolution: () => false, + defaultHostname: '', + virtualFolders: partial.virtualFolders ?? [], + c4sConfig: partial.c4sConfig ?? { virtualFolders: { enabled: true } }, + ...partial, + } as VirtualFolderProxyConfig; +} + +describe('VirtualFolderProxy', () => { + let rewriteStub: sinon.SinonStub; + + afterEach(() => { + rewriteStub?.restore(); + }); + + describe('when virtual folders are disabled in c4s config', () => { + it('returns the incoming response without calling rewrite', async () => { + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite'); + const proxy = new VirtualFolderProxy( + minimalConfig({ + c4sConfig: { virtualFolders: { enabled: false } }, + virtualFolders: [ + { + name: 'SiteA', + language: 'en', + hostName: 'a.test', + virtualFolder: '/vf', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/vf/page'); + const res = NextResponse.next(); + const out = await proxy.handle(req, res); + + expect(rewriteStub.called).to.be.false; + expect(out).to.equal(res); + }); + }); + + describe('when virtual folders are enabled', () => { + it('returns the incoming response when no site virtual folder matches the path', async () => { + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite'); + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'SiteA', + language: 'en', + hostName: 'a.test', + virtualFolder: '/blog', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/news/article'); + const res = NextResponse.next(); + const out = await proxy.handle(req, res); + + expect(rewriteStub.called).to.be.false; + expect(out).to.equal(res); + }); + + it('ignores sites whose virtual folder is root "/"', async () => { + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite'); + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'RootSite', + language: 'en', + hostName: 'root.test', + virtualFolder: '/', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/anything'); + const res = NextResponse.next(); + const out = await proxy.handle(req, res); + + expect(rewriteStub.called).to.be.false; + expect(out).to.equal(res); + }); + + it('ignores sites with a falsy virtual folder', async () => { + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite'); + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'NoVf', + language: 'en', + hostName: 'x.test', + virtualFolder: '', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/page'); + const res = NextResponse.next(); + const out = await proxy.handle(req, res); + + expect(rewriteStub.called).to.be.false; + expect(out).to.equal(res); + }); + + it('rewrites path to /{siteName}/{language}{remainder}', async () => { + const rewritten = NextResponse.next(); + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite').returns(rewritten); + + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'MySite', + language: 'da-DK', + hostName: 'mysite.test', + virtualFolder: '/dk', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/dk/products/widget'); + const res = NextResponse.next(); + const out = await proxy.handle(req, res); + + expect(rewriteStub.callCount).to.equal(1); + const rewriteArg = rewriteStub.firstCall.args[0] as URL; + expect(rewriteArg.pathname).to.equal('/MySite/da-DK/products/widget'); + + expect(out).to.equal(rewritten); + }); + + it('rewrites when the path equals the virtual folder (no trailing segment)', async () => { + const rewritten = NextResponse.next(); + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite').returns(rewritten); + + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'Shop', + language: 'en', + hostName: 'shop.test', + virtualFolder: '/shop', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/shop'); + const res = NextResponse.next(); + await proxy.handle(req, res); + + const rewriteArg = rewriteStub.firstCall.args[0] as URL; + expect(rewriteArg.pathname).to.equal('/Shop/en'); + }); + + it('uses the first matching site in config order', async () => { + const rewritten = NextResponse.next(); + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite').returns(rewritten); + + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'First', + language: 'en', + hostName: 'first.test', + virtualFolder: '/a', + } as SiteInfoWithVirtualFolder, + { + name: 'Second', + language: 'fr', + hostName: 'second.test', + virtualFolder: '/a/b', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/a/b/c'); + await proxy.handle(req, NextResponse.next()); + + const rewriteArg = rewriteStub.firstCall.args[0] as URL; + expect(rewriteArg.pathname).to.equal('/First/en/b/c'); + }); + + it('preserves request base URL for the rewritten URL', async () => { + const rewritten = NextResponse.next(); + rewriteStub = sinon.stub(nextjs.NextResponse, 'rewrite').returns(rewritten); + + const proxy = new VirtualFolderProxy( + minimalConfig({ + virtualFolders: [ + { + name: 'S', + language: 'en', + hostName: 's.test', + virtualFolder: '/vf', + } as SiteInfoWithVirtualFolder, + ], + }) + ); + + const req = createRequest('/vf/x', 'https://example.org:8080'); + await proxy.handle(req, NextResponse.next()); + + const rewriteArg = rewriteStub.firstCall.args[0] as URL; + expect(rewriteArg.origin).to.equal('https://example.org:8080'); + expect(rewriteArg.pathname).to.equal('/S/en/x'); + }); + }); +}); diff --git a/packages/nextjs/src/proxy/virtual-folder-proxy.ts b/packages/nextjs/src/proxy/virtual-folder-proxy.ts new file mode 100644 index 0000000..e64352a --- /dev/null +++ b/packages/nextjs/src/proxy/virtual-folder-proxy.ts @@ -0,0 +1,35 @@ +import { ProxyBase, ProxyBaseConfig } from '@sitecore-content-sdk/nextjs/proxy'; +import { NextResponse } from 'next/server'; +import { NextRequest } from 'next/server'; +import { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; +import { Constellation4SitecoreConfig } from '@constellation4sitecore-content-sdk/content/config'; + +export type VirtualFolderProxyConfig = ProxyBaseConfig & { + virtualFolders: SiteInfoWithVirtualFolder[]; + c4sConfig: Constellation4SitecoreConfig; +}; + +export class VirtualFolderProxy extends ProxyBase { + constructor(private readonly proxyConfig: VirtualFolderProxyConfig) { + super(proxyConfig); + } + + async handle(req: NextRequest, res: NextResponse): Promise> { + if (!this.proxyConfig.c4sConfig.virtualFolders.enabled) { + return res; + } + const virtualFolderSites = this.proxyConfig.virtualFolders.filter( + (virtualFolder) => virtualFolder.virtualFolder && virtualFolder.virtualFolder != '/' + ); + const virtualFolder = virtualFolderSites.find((virtualFolder) => + req.nextUrl.pathname.startsWith(virtualFolder.virtualFolder) + ); + if (virtualFolder) { + const pathname = req.nextUrl.pathname.replace(virtualFolder.virtualFolder, ''); + return NextResponse.rewrite( + new URL(`/${virtualFolder.name}/${virtualFolder.language}${pathname}`, req.url) + ); + } + return res; + } +} diff --git a/packages/nextjs/src/tools/index.ts b/packages/nextjs/src/tools/index.ts new file mode 100644 index 0000000..be1516e --- /dev/null +++ b/packages/nextjs/src/tools/index.ts @@ -0,0 +1 @@ +export { generateVirtualFolders } from '@constellation4sitecore-content-sdk/content/node-tools'; diff --git a/packages/nextjs/tsconfig.json b/packages/nextjs/tsconfig.json index 8177dd8..8d04aef 100644 --- a/packages/nextjs/tsconfig.json +++ b/packages/nextjs/tsconfig.json @@ -21,6 +21,7 @@ "graphql.js", "middleware.d.ts", "middleware.js", + "proxy.d.ts", "src/tests/*", "src/test-data/*", "**/*.test.ts", diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index 847ac35..f6c32ea 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", "clean": "del-cli dist types", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\"" }, "engines": { "node": ">=12", diff --git a/yarn.lock b/yarn.lock index 467b483..964e586 100644 --- a/yarn.lock +++ b/yarn.lock @@ -83,6 +83,136 @@ esquery "^1.6.0" jsdoc-type-pratt-parser "~4.1.0" +"@esbuild/aix-ppc64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz#82b74f92aa78d720b714162939fb248c90addf53" + integrity sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg== + +"@esbuild/android-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz#f78cb8a3121fc205a53285adb24972db385d185d" + integrity sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ== + +"@esbuild/android-arm@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.7.tgz#593e10a1450bbfcac6cb321f61f468453bac209d" + integrity sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ== + +"@esbuild/android-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.7.tgz#453143d073326033d2d22caf9e48de4bae274b07" + integrity sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg== + +"@esbuild/darwin-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz#6f23000fb9b40b7e04b7d0606c0693bd0632f322" + integrity sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw== + +"@esbuild/darwin-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz#27393dd18bb1263c663979c5f1576e00c2d024be" + integrity sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ== + +"@esbuild/freebsd-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz#22e4638fa502d1c0027077324c97640e3adf3a62" + integrity sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w== + +"@esbuild/freebsd-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz#9224b8e4fea924ce2194e3efc3e9aebf822192d6" + integrity sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ== + +"@esbuild/linux-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz#4f5d1c27527d817b35684ae21419e57c2bda0966" + integrity sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A== + +"@esbuild/linux-arm@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz#b9e9d070c8c1c0449cf12b20eac37d70a4595921" + integrity sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA== + +"@esbuild/linux-ia32@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz#3f80fb696aa96051a94047f35c85b08b21c36f9e" + integrity sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg== + +"@esbuild/linux-loong64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz#9be1f2c28210b13ebb4156221bba356fe1675205" + integrity sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q== + +"@esbuild/linux-mips64el@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz#4ab5ee67a3dfcbcb5e8fd7883dae6e735b1163b8" + integrity sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw== + +"@esbuild/linux-ppc64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz#dac78c689f6499459c4321e5c15032c12307e7ea" + integrity sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ== + +"@esbuild/linux-riscv64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz#050f7d3b355c3a98308e935bc4d6325da91b0027" + integrity sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ== + +"@esbuild/linux-s390x@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz#d61f715ce61d43fe5844ad0d8f463f88cbe4fef6" + integrity sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw== + +"@esbuild/linux-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz#ca8e1aa478fc8209257bf3ac8f79c4dc2982f32a" + integrity sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA== + +"@esbuild/netbsd-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz#1650f2c1b948deeb3ef948f2fc30614723c09690" + integrity sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w== + +"@esbuild/netbsd-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz#65772ab342c4b3319bf0705a211050aac1b6e320" + integrity sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw== + +"@esbuild/openbsd-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz#37ed7cfa66549d7955852fce37d0c3de4e715ea1" + integrity sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A== + +"@esbuild/openbsd-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz#01bf3d385855ef50cb33db7c4b52f957c34cd179" + integrity sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg== + +"@esbuild/openharmony-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz#6c1f94b34086599aabda4eac8f638294b9877410" + integrity sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw== + +"@esbuild/sunos-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz#4b0dd17ae0a6941d2d0fd35a906392517071a90d" + integrity sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA== + +"@esbuild/win32-arm64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz#34193ab5565d6ff68ca928ac04be75102ccb2e77" + integrity sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA== + +"@esbuild/win32-ia32@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz#eb67f0e4482515d8c1894ede631c327a4da9fc4d" + integrity sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw== + +"@esbuild/win32-x64@0.27.7": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz#8fe30b3088b89b4873c3a6cc87597ae3920c0a8b" + integrity sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0", "@eslint-community/eslint-utils@^4.8.0": version "4.9.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3" @@ -1088,6 +1218,28 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== +"@sinonjs/commons@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^13.0.5": + version "13.0.5" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz#36b9dbc21ad5546486ea9173d6bea063eb1717d5" + integrity sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw== + dependencies: + "@sinonjs/commons" "^3.0.1" + +"@sinonjs/samsam@^8.0.1": + version "8.0.3" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.3.tgz#eb6ffaef421e1e27783cc9b52567de20cb28072d" + integrity sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ== + dependencies: + "@sinonjs/commons" "^3.0.1" + type-detect "^4.1.0" + "@sitecore-content-sdk/content@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@sitecore-content-sdk/content/-/content-2.0.1.tgz#ff166f40c61e2a73087beef8568c6b90bc64a825" @@ -1193,6 +1345,13 @@ dependencies: tslib "^2.4.0" +"@types/chai-spies@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/chai-spies/-/chai-spies-1.0.6.tgz#20ad60f2bc484ced5cbd4a901f3bbfc1225e968e" + integrity sha512-xkk4HmhBB9OQeTAifa9MJ+6R5/Rq9+ungDe4JidZD+vqZVeiWZwc2i7/pd1ZKjyGlSBIQePoWdyUyFUGT0rv5w== + dependencies: + "@types/chai" "*" + "@types/chai-string@^1.4.5": version "1.4.5" resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.4.5.tgz#988ff37526386e9c354219b163d7ecf81bab8d2d" @@ -1283,6 +1442,11 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== +"@types/proxyquire@^1.3.31": + version "1.3.31" + resolved "https://registry.yarnpkg.com/@types/proxyquire/-/proxyquire-1.3.31.tgz#a008b78dad6061754e3adf2cb64b60303f68deaa" + integrity sha512-uALowNG2TSM1HNPMMOR0AJwv4aPYPhqB0xlEhkeRTMuto5hjoSPZkvgu1nbPUkz3gEPAHv4sy4DmKsurZiEfRQ== + "@types/react-dom@^19.2.3": version "19.2.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.3.tgz#c1e305d15a52a3e508d54dca770d202cb63abf2c" @@ -1295,6 +1459,33 @@ dependencies: csstype "^3.2.2" +"@types/sinon-chai@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-4.0.0.tgz#4d0e540a1498c0e85649088a0c7ed31d7627024f" + integrity sha512-Uar+qk3TmeFsUWCwtqRNqNUE7vf34+MCJiQJR5M2rd4nCbhtE8RgTiHwN/mVwbfCjhmO6DiOel/MgzHkRMJJFg== + dependencies: + "@types/chai" "*" + "@types/sinon" "*" + +"@types/sinon@*": + version "21.0.1" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-21.0.1.tgz#f995e2afdf15be832d5f1645803d82a8eb95a1bc" + integrity sha512-5yoJSqLbjH8T9V2bksgRayuhpZy+723/z6wBOR+Soe4ZlXC0eW8Na71TeaZPUWDQvM7LYKa9UGFc6LRqxiR5fQ== + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinon@^17.0.4": + version "17.0.4" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-17.0.4.tgz#fd9a3e8e07eea1a3f4a6f82a972c899e5778f369" + integrity sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew== + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinonjs__fake-timers@*": + version "15.0.1" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-15.0.1.tgz#49f731d9453f52d64dd79f5a5626c1cf1b81bea4" + integrity sha512-Ko2tjWJq8oozHzHV+reuvS5KYIRAokHnGbDwGh/J64LntgpbuylF74ipEL24HCyRjf9FOlBiBHWBR1RlVKsI1w== + "@types/unist@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" @@ -2079,6 +2270,11 @@ caniuse-lite@^1.0.30001579: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz#199d20f04f5369825e00ff7067d45d5dfa03aee7" integrity sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA== +chai-spies@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/chai-spies/-/chai-spies-1.1.0.tgz#a6c270bc708c70716fed667d771f910902a5fb31" + integrity sha512-ikaUhQvQWchRYj2K54itFp3nrcxaFRpSDQxDlRzSn9aWgu9Pi7lD8yFxTso4WnQ39+WZ69oB/qOvqp+isJIIWA== + chai-string@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.6.0.tgz#8365011c3b6d0543a73dd9e1aeecea82f44a79aa" @@ -2939,6 +3135,38 @@ es-to-primitive@^1.3.0: is-date-object "^1.0.5" is-symbol "^1.0.4" +esbuild@~0.27.0: + version "0.27.7" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.7.tgz#bcadce22b2f3fd76f257e3a64f83a64986fea11f" + integrity sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w== + optionalDependencies: + "@esbuild/aix-ppc64" "0.27.7" + "@esbuild/android-arm" "0.27.7" + "@esbuild/android-arm64" "0.27.7" + "@esbuild/android-x64" "0.27.7" + "@esbuild/darwin-arm64" "0.27.7" + "@esbuild/darwin-x64" "0.27.7" + "@esbuild/freebsd-arm64" "0.27.7" + "@esbuild/freebsd-x64" "0.27.7" + "@esbuild/linux-arm" "0.27.7" + "@esbuild/linux-arm64" "0.27.7" + "@esbuild/linux-ia32" "0.27.7" + "@esbuild/linux-loong64" "0.27.7" + "@esbuild/linux-mips64el" "0.27.7" + "@esbuild/linux-ppc64" "0.27.7" + "@esbuild/linux-riscv64" "0.27.7" + "@esbuild/linux-s390x" "0.27.7" + "@esbuild/linux-x64" "0.27.7" + "@esbuild/netbsd-arm64" "0.27.7" + "@esbuild/netbsd-x64" "0.27.7" + "@esbuild/openbsd-arm64" "0.27.7" + "@esbuild/openbsd-x64" "0.27.7" + "@esbuild/openharmony-arm64" "0.27.7" + "@esbuild/sunos-x64" "0.27.7" + "@esbuild/win32-arm64" "0.27.7" + "@esbuild/win32-ia32" "0.27.7" + "@esbuild/win32-x64" "0.27.7" + escalade@^3.1.1: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" @@ -3423,6 +3651,14 @@ filelist@^1.0.4: dependencies: minimatch "^5.0.1" +fill-keys@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fill-keys/-/fill-keys-1.0.2.tgz#9a8fa36f4e8ad634e3bf6b4f3c8882551452eb20" + integrity sha512-tcgI872xXjwFF4xgQmLxi76GnwJG3g/3isB1l4/G5Z4zrbddGpBjqZCO9oEAcB5wX0Hj/5iQB3toxfO7in1hHA== + dependencies: + is-object "~1.0.1" + merge-descriptors "~1.0.0" + fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -3554,6 +3790,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" @@ -3684,6 +3925,13 @@ get-tsconfig@^4.10.0: dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.7.5: + version "4.13.7" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.7.tgz#b9d8b199b06033ceeea1a93df7ea5765415089bc" + integrity sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q== + dependencies: + resolve-pkg-maps "^1.0.0" + git-raw-commits@^2.0.8: version "2.0.11" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" @@ -4384,6 +4632,11 @@ is-obj@^2.0.0: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== +is-object@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== + is-path-cwd@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" @@ -5139,6 +5392,11 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" +merge-descriptors@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -5383,6 +5641,11 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== +module-not-found-error@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0" + integrity sha512-pEk4ECWQXV6z2zjhRZUongnLJNUeGQJ3w6OQ5ctGwD+i5o93qjRQUk2Rt6VdNeu3sEP0AB4LcfvdebpxBRVr4g== + ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" @@ -5451,6 +5714,14 @@ next@^16.1.1: "@next/swc-win32-x64-msvc" "16.2.1" sharp "^0.34.5" +nock@14.0.0-beta.7: + version "14.0.0-beta.7" + resolved "https://registry.yarnpkg.com/nock/-/nock-14.0.0-beta.7.tgz#bdb3f3cfa2276659c87412f6dff2aea9ee69a7fc" + integrity sha512-+EQMm5W9K8YnBE2Ceg4hnJynaCZmvK8ZlFXQ2fxGwtkOkBUq8GpQLTks2m1jpvse9XDxMDDOHgOWpiznFuh0bA== + dependencies: + json-stringify-safe "^5.0.1" + propagate "^2.0.0" + node-addon-api@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" @@ -6328,6 +6599,11 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -6343,6 +6619,15 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +proxyquire@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-2.1.3.tgz#2049a7eefa10a9a953346a18e54aab2b4268df39" + integrity sha512-BQWfCqYM+QINd+yawJz23tbBM40VIGXOdDw3X344KcclI/gtBbdWF6SlQ4nK/bYhF9d27KYug9WzljHC6B9Ysg== + dependencies: + fill-keys "^1.0.2" + module-not-found-error "^1.0.1" + resolve "^1.11.1" + psl@^1.1.33: version "1.15.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.15.0.tgz#bdace31896f1d97cec6a79e8224898ce93d974c6" @@ -6668,6 +6953,16 @@ resolve@^1.10.0, resolve@^1.22.4: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.11.1: + version "1.22.12" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.12.tgz#f5b2a680897c69c238a13cd16b15671f8b73549f" + integrity sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA== + dependencies: + es-errors "^1.3.0" + is-core-module "^2.16.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.5: version "2.0.0-next.5" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" @@ -6984,6 +7279,22 @@ sigstore@^1.0.0, sigstore@^1.3.0, sigstore@^1.4.0: "@sigstore/tuf" "^1.0.3" make-fetch-happen "^11.0.1" +sinon-chai@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-4.0.1.tgz#f70000fe0e4f4ab7ceeb3703d3053f8886e0386b" + integrity sha512-xMKEEV3cYHC1G+boyr7QEqi80gHznYsxVdC9CdjP5JnCWz/jPGuXQzJz3PtBcb0CcHAxar15Y5sjLBoAs6a0yA== + +sinon@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-20.0.0.tgz#4b653468735f7152ba694d05498c2b5d024ab006" + integrity sha512-+FXOAbdnj94AQIxH0w1v8gzNxkawVvNqE3jUzRLptR71Oykeu2RrQXXl/VQjKay+Qnh73fDt/oDfMo6xMeDQbQ== + dependencies: + "@sinonjs/commons" "^3.0.1" + "@sinonjs/fake-timers" "^13.0.5" + "@sinonjs/samsam" "^8.0.1" + diff "^7.0.0" + supports-color "^7.2.0" + slash@3.0.0, slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -7296,7 +7607,7 @@ styled-jsx@5.1.6: dependencies: client-only "0.0.1" -supports-color@^7.1.0: +supports-color@^7.1.0, supports-color@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -7529,11 +7840,21 @@ tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.8.0: +tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.8.0, tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== +tsx@^4.19.4: + version "4.21.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.21.0.tgz#32aa6cf17481e336f756195e6fe04dae3e6308b1" + integrity sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw== + dependencies: + esbuild "~0.27.0" + get-tsconfig "^4.7.5" + optionalDependencies: + fsevents "~2.3.3" + tuf-js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.7.tgz#21b7ae92a9373015be77dfe0cb282a80ec3bbe43" @@ -7550,6 +7871,11 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + type-detect@^4.0.0, type-detect@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" From e9dce6d88d631f96f67135361a75e471e3e30622 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:27:16 -0500 Subject: [PATCH 10/18] Update Documentation --- packages/content/package.json | 1 + packages/nextjs/package.json | 2 +- ref-docs/content/README.md | 13 + ref-docs/content/config/README.md | 17 + .../content/config/functions/defineConfig.md | 25 ++ .../Constellation4SitecoreConfig.md | 14 + .../Constellation4SitecoreConfigInput.md | 35 ++ .../config/type-aliases/DeepRequired.md | 19 + ref-docs/content/index/README.md | 22 + .../content/index/functions/enableDebug.md | 23 ++ .../index/functions/isNamespaceEnabled.md | 25 ++ .../content/index/type-aliases/Debugger.md | 13 + ref-docs/content/index/variables/debug.md | 32 ++ .../content/index/variables/debugModule.md | 23 ++ .../content/index/variables/debugNamespace.md | 13 + ref-docs/content/site/README.md | 15 + .../content/site/classes/SiteInfoService.md | 155 +++++++ .../type-aliases/SiteInfoWithVirtualFolder.md | 17 + .../tools/generate-virtual-folders/README.md | 15 + .../functions/generateVirtualFolders.md | 36 ++ .../type-aliases/GenerateSitesConfig.md | 32 ++ ref-docs/content/tools/index-node/README.md | 13 + ref-docs/nextjs/README.md | 5 +- ref-docs/nextjs/config/README.md | 16 + .../nextjs/config/functions/defineConfig.md | 25 ++ .../Constellation4SitecoreConfig.md | 13 + .../Constellation4SitecoreConfigInput.md | 13 + .../classes/GraphqlService.md | 8 +- .../functions/createGraphQLClientFactory.md | 2 +- ref-docs/nextjs/helpers/README.md | 6 + ref-docs/nextjs/index/README.md | 10 +- ref-docs/nextjs/index/functions/Image.md | 2 +- .../nextjs/index/functions/enableDebug.md | 23 -- ref-docs/nextjs/index/functions/hasContent.md | 4 +- .../nextjs/index/functions/hasFieldContent.md | 26 ++ ref-docs/nextjs/index/functions/isServer.md | 2 +- .../nextjs/index/functions/useIsClient.md | 2 +- .../index/interfaces/ExtendedImageProps.md | 12 +- .../nextjs/index/type-aliases/Debugger.md | 11 - ref-docs/nextjs/index/variables/debug.md | 44 -- ref-docs/nextjs/middleware/README.md | 15 - .../middleware/classes/MiddlewareBase.md | 210 ---------- .../type-aliases/MiddlewareBaseConfig.md | 82 ---- ref-docs/nextjs/proxy/README.md | 15 + .../proxy/classes/VirtualFolderProxy.md | 380 ++++++++++++++++++ .../type-aliases/VirtualFolderProxyConfig.md | 21 + ref-docs/nextjs/tools/README.md | 11 + .../tools/variables/generateVirtualFolders.md | 36 ++ ref-docs/nextjs/utils/README-1.md | 19 - 49 files changed, 1141 insertions(+), 432 deletions(-) create mode 100644 ref-docs/content/README.md create mode 100644 ref-docs/content/config/README.md create mode 100644 ref-docs/content/config/functions/defineConfig.md create mode 100644 ref-docs/content/config/type-aliases/Constellation4SitecoreConfig.md create mode 100644 ref-docs/content/config/type-aliases/Constellation4SitecoreConfigInput.md create mode 100644 ref-docs/content/config/type-aliases/DeepRequired.md create mode 100644 ref-docs/content/index/README.md create mode 100644 ref-docs/content/index/functions/enableDebug.md create mode 100644 ref-docs/content/index/functions/isNamespaceEnabled.md create mode 100644 ref-docs/content/index/type-aliases/Debugger.md create mode 100644 ref-docs/content/index/variables/debug.md create mode 100644 ref-docs/content/index/variables/debugModule.md create mode 100644 ref-docs/content/index/variables/debugNamespace.md create mode 100644 ref-docs/content/site/README.md create mode 100644 ref-docs/content/site/classes/SiteInfoService.md create mode 100644 ref-docs/content/site/type-aliases/SiteInfoWithVirtualFolder.md create mode 100644 ref-docs/content/tools/generate-virtual-folders/README.md create mode 100644 ref-docs/content/tools/generate-virtual-folders/functions/generateVirtualFolders.md create mode 100644 ref-docs/content/tools/generate-virtual-folders/type-aliases/GenerateSitesConfig.md create mode 100644 ref-docs/content/tools/index-node/README.md create mode 100644 ref-docs/nextjs/config/README.md create mode 100644 ref-docs/nextjs/config/functions/defineConfig.md create mode 100644 ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfig.md create mode 100644 ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfigInput.md delete mode 100644 ref-docs/nextjs/index/functions/enableDebug.md create mode 100644 ref-docs/nextjs/index/functions/hasFieldContent.md delete mode 100644 ref-docs/nextjs/index/type-aliases/Debugger.md delete mode 100644 ref-docs/nextjs/index/variables/debug.md delete mode 100644 ref-docs/nextjs/middleware/README.md delete mode 100644 ref-docs/nextjs/middleware/classes/MiddlewareBase.md delete mode 100644 ref-docs/nextjs/middleware/type-aliases/MiddlewareBaseConfig.md create mode 100644 ref-docs/nextjs/proxy/README.md create mode 100644 ref-docs/nextjs/proxy/classes/VirtualFolderProxy.md create mode 100644 ref-docs/nextjs/proxy/type-aliases/VirtualFolderProxyConfig.md create mode 100644 ref-docs/nextjs/tools/README.md create mode 100644 ref-docs/nextjs/tools/variables/generateVirtualFolders.md delete mode 100644 ref-docs/nextjs/utils/README-1.md diff --git a/packages/content/package.json b/packages/content/package.json index eeb1d74..cbf0f9b 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -6,6 +6,7 @@ "module": "dist/esm/index.js", "scripts": { "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", + "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/content --entryPoints src/index.ts --entryPoints src/config/index.ts --entryPoints src/site/index.ts --entryPoints src/tools/index-node.ts --entryPoints src/tools/generate-virtual-folders.ts --githubPages false", "test": "mocha \"./src/**/*.test.ts\"", "clean": "del-cli dist types" }, diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index c293a2a..645f5f8 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -13,7 +13,7 @@ "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", "clean": "del-cli dist types", "test": "mocha --require ./test/setup.js \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit", - "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/nextjs --entryPoints src/index.ts --entryPoints src/middleware/index.ts --entryPoints src/utils/index.ts --entryPoints src/graphql-client-factory/index.ts --entryPoints src/fields-extensions/index.ts --entryPoints src/helpers/index.ts --entryPoints src/utils/index.ts --githubPages false" + "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/nextjs --entryPoints src/index.ts --entryPoints src/config/index.ts --entryPoints src/fields-extensions/index.ts --entryPoints src/graphql-client-factory/index.ts --entryPoints src/helpers/index.ts --entryPoints src/proxy/index.ts --entryPoints src/tools/index.ts --entryPoints src/utils/index.ts --githubPages false" }, "types": "types/index.d.ts", "files": [ diff --git a/ref-docs/content/README.md b/ref-docs/content/README.md new file mode 100644 index 0000000..3cc2e50 --- /dev/null +++ b/ref-docs/content/README.md @@ -0,0 +1,13 @@ +**@constellation4sitecore-content-sdk/content** + +*** + +# @constellation4sitecore-content-sdk/content + +## Modules + +- [config](config/README.md) +- [index](index/README.md) +- [site](site/README.md) +- [tools/generate-virtual-folders](tools/generate-virtual-folders/README.md) +- [tools/index-node](tools/index-node/README.md) diff --git a/ref-docs/content/config/README.md b/ref-docs/content/config/README.md new file mode 100644 index 0000000..f86314d --- /dev/null +++ b/ref-docs/content/config/README.md @@ -0,0 +1,17 @@ +[**@constellation4sitecore-content-sdk/content**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../README.md) / config + +# config + +## Type Aliases + +- [Constellation4SitecoreConfig](type-aliases/Constellation4SitecoreConfig.md) +- [Constellation4SitecoreConfigInput](type-aliases/Constellation4SitecoreConfigInput.md) +- [DeepRequired](type-aliases/DeepRequired.md) + +## Functions + +- [defineConfig](functions/defineConfig.md) diff --git a/ref-docs/content/config/functions/defineConfig.md b/ref-docs/content/config/functions/defineConfig.md new file mode 100644 index 0000000..b9ca413 --- /dev/null +++ b/ref-docs/content/config/functions/defineConfig.md @@ -0,0 +1,25 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [config](../README.md) / defineConfig + +# Function: defineConfig() + +> **defineConfig**(`config`): [`Constellation4SitecoreConfig`](../type-aliases/Constellation4SitecoreConfig.md) + +Defined in: [packages/content/src/config/define-config.ts:75](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/config/define-config.ts#L75) + +Accepts a Constellation4SitecoreConfigInput object and returns full constellation4sitecore configuration + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `config` | [`Constellation4SitecoreConfigInput`](../type-aliases/Constellation4SitecoreConfigInput.md) | override values to be written over default config settings | + +## Returns + +[`Constellation4SitecoreConfig`](../type-aliases/Constellation4SitecoreConfig.md) + +full constellation4sitecore configuration to use in application diff --git a/ref-docs/content/config/type-aliases/Constellation4SitecoreConfig.md b/ref-docs/content/config/type-aliases/Constellation4SitecoreConfig.md new file mode 100644 index 0000000..2d05b2a --- /dev/null +++ b/ref-docs/content/config/type-aliases/Constellation4SitecoreConfig.md @@ -0,0 +1,14 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [config](../README.md) / Constellation4SitecoreConfig + +# Type Alias: Constellation4SitecoreConfig + +> **Constellation4SitecoreConfig** = [`DeepRequired`](DeepRequired.md)\<[`Constellation4SitecoreConfigInput`](Constellation4SitecoreConfigInput.md)\> + +Defined in: [packages/content/src/config/models.ts:39](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/config/models.ts#L39) + +Final Sitecore config type used at runtime. +Every property is populated, either from sitecore.config or fallback values. diff --git a/ref-docs/content/config/type-aliases/Constellation4SitecoreConfigInput.md b/ref-docs/content/config/type-aliases/Constellation4SitecoreConfigInput.md new file mode 100644 index 0000000..39d9c83 --- /dev/null +++ b/ref-docs/content/config/type-aliases/Constellation4SitecoreConfigInput.md @@ -0,0 +1,35 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [config](../README.md) / Constellation4SitecoreConfigInput + +# Type Alias: Constellation4SitecoreConfigInput + +> **Constellation4SitecoreConfigInput** = `object` + +Defined in: [packages/content/src/config/models.ts:21](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/config/models.ts#L21) + +Type to be used as config input in sitecore.config + +## Properties + +### virtualFolders? + +> `optional` **virtualFolders**: `object` + +Defined in: [packages/content/src/config/models.ts:25](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/config/models.ts#L25) + +Settings for virtual folders functionality + +#### enabled? + +> `optional` **enabled**: `boolean` + +Enable virtual folders + +##### Default + +```ts +true +``` diff --git a/ref-docs/content/config/type-aliases/DeepRequired.md b/ref-docs/content/config/type-aliases/DeepRequired.md new file mode 100644 index 0000000..34f132d --- /dev/null +++ b/ref-docs/content/config/type-aliases/DeepRequired.md @@ -0,0 +1,19 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [config](../README.md) / DeepRequired + +# Type Alias: DeepRequired\ + +> **DeepRequired**\<`T`\> = `Required`\<`{ [K in keyof T]: T[K] extends Required ? T[K] : DeepRequired }`\> + +Defined in: [packages/content/src/config/models.ts:5](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/config/models.ts#L5) + +Utility type to make every property in a type required + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | diff --git a/ref-docs/content/index/README.md b/ref-docs/content/index/README.md new file mode 100644 index 0000000..5284d7f --- /dev/null +++ b/ref-docs/content/index/README.md @@ -0,0 +1,22 @@ +[**@constellation4sitecore-content-sdk/content**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../README.md) / index + +# index + +## Type Aliases + +- [Debugger](type-aliases/Debugger.md) + +## Variables + +- [debug](variables/debug.md) +- [debugModule](variables/debugModule.md) +- [debugNamespace](variables/debugNamespace.md) + +## Functions + +- [enableDebug](functions/enableDebug.md) +- [isNamespaceEnabled](functions/isNamespaceEnabled.md) diff --git a/ref-docs/content/index/functions/enableDebug.md b/ref-docs/content/index/functions/enableDebug.md new file mode 100644 index 0000000..28ad9b0 --- /dev/null +++ b/ref-docs/content/index/functions/enableDebug.md @@ -0,0 +1,23 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / enableDebug + +# Function: enableDebug() + +> **enableDebug**(`namespaces`): `void` + +Defined in: [packages/content/src/debug.ts:40](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L40) + +Enable debug logging dynamically + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `namespaces` | `string` | space-separated list of namespaces to enable | + +## Returns + +`void` diff --git a/ref-docs/content/index/functions/isNamespaceEnabled.md b/ref-docs/content/index/functions/isNamespaceEnabled.md new file mode 100644 index 0000000..242370a --- /dev/null +++ b/ref-docs/content/index/functions/isNamespaceEnabled.md @@ -0,0 +1,25 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / isNamespaceEnabled + +# Function: isNamespaceEnabled() + +> **isNamespaceEnabled**(`namespace`): `boolean` + +Defined in: [packages/content/src/debug.ts:48](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L48) + +Check if a debug namespace is enabled + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `namespace` | `string` | the namespace to check | + +## Returns + +`boolean` + +whether the namespace is enabled diff --git a/ref-docs/content/index/type-aliases/Debugger.md b/ref-docs/content/index/type-aliases/Debugger.md new file mode 100644 index 0000000..0a2e3be --- /dev/null +++ b/ref-docs/content/index/type-aliases/Debugger.md @@ -0,0 +1,13 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / Debugger + +# Type Alias: Debugger + +> **Debugger** = `debug.Debugger` + +Defined in: [packages/content/src/debug.ts:21](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L21) + +Debugger type diff --git a/ref-docs/content/index/variables/debug.md b/ref-docs/content/index/variables/debug.md new file mode 100644 index 0000000..1cc5eb8 --- /dev/null +++ b/ref-docs/content/index/variables/debug.md @@ -0,0 +1,32 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / debug + +# Variable: debug + +> **debug**: `object` + +Defined in: [packages/content/src/debug.ts:56](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L56) + +Default Sitecore Content SDK 'debug' module debuggers. Uses namespace prefix 'content-sdk:'. +See [https://www.npmjs.com/package/debug](https://www.npmjs.com/package/debug) for details. + +## Type Declaration + +### common + +> **common**: `Debugger` + +### http + +> **http**: `Debugger` + +### init + +> **init**: `Debugger` + +### virtualFolder + +> **virtualFolder**: `Debugger` diff --git a/ref-docs/content/index/variables/debugModule.md b/ref-docs/content/index/variables/debugModule.md new file mode 100644 index 0000000..6a8bfc8 --- /dev/null +++ b/ref-docs/content/index/variables/debugModule.md @@ -0,0 +1,23 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / debugModule + +# Variable: debugModule + +> `const` **debugModule**: `Debug` & `object` = `debug` + +Defined in: [packages/content/src/debug.ts:9](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L9) + +Debug module + +## Type Declaration + +### debug + +> **debug**: `Debug` + +### default + +> **default**: `Debug` diff --git a/ref-docs/content/index/variables/debugNamespace.md b/ref-docs/content/index/variables/debugNamespace.md new file mode 100644 index 0000000..0c7d956 --- /dev/null +++ b/ref-docs/content/index/variables/debugNamespace.md @@ -0,0 +1,13 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [index](../README.md) / debugNamespace + +# Variable: debugNamespace + +> `const` **debugNamespace**: `"constellation4sitecore-content-sdk"` = `'constellation4sitecore-content-sdk'` + +Defined in: [packages/content/src/debug.ts:15](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/debug.ts#L15) + +Debug namespace diff --git a/ref-docs/content/site/README.md b/ref-docs/content/site/README.md new file mode 100644 index 0000000..3056b3c --- /dev/null +++ b/ref-docs/content/site/README.md @@ -0,0 +1,15 @@ +[**@constellation4sitecore-content-sdk/content**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../README.md) / site + +# site + +## Classes + +- [SiteInfoService](classes/SiteInfoService.md) + +## Type Aliases + +- [SiteInfoWithVirtualFolder](type-aliases/SiteInfoWithVirtualFolder.md) diff --git a/ref-docs/content/site/classes/SiteInfoService.md b/ref-docs/content/site/classes/SiteInfoService.md new file mode 100644 index 0000000..d20652e --- /dev/null +++ b/ref-docs/content/site/classes/SiteInfoService.md @@ -0,0 +1,155 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [site](../README.md) / SiteInfoService + +# Class: SiteInfoService + +Defined in: [packages/content/src/site/siteinfo-service.ts:37](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/site/siteinfo-service.ts#L37) + +## Extends + +- `SiteInfoService` + +## Constructors + +### Constructor + +> **new SiteInfoService**(`siteConfig`): `SiteInfoService` + +Defined in: [packages/content/src/site/siteinfo-service.ts:40](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/site/siteinfo-service.ts#L40) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `siteConfig` | `SiteInfoServiceConfig` | + +#### Returns + +`SiteInfoService` + +#### Overrides + +`SiteInfoServiceBase.constructor` + +## Accessors + +### siteQuery + +#### Get Signature + +> **get** `protected` **siteQuery**(): `string` + +Defined in: node\_modules/@sitecore-content-sdk/content/types/site/siteinfo-service.d.ts:47 + +site query is available on XM Cloud and XP 10.4+ + +##### Returns + +`string` + +#### Inherited from + +`SiteInfoServiceBase.siteQuery` + +## Methods + +### fetchSiteInfo() + +> **fetchSiteInfo**(`fetchOptions?`): `Promise`\<`SiteInfo`[]\> + +Defined in: node\_modules/@sitecore-content-sdk/content/types/site/siteinfo-service.d.ts:48 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `fetchOptions?` | `FetchOptions` | + +#### Returns + +`Promise`\<`SiteInfo`[]\> + +#### Inherited from + +`SiteInfoServiceBase.fetchSiteInfo` + +*** + +### fetchSiteInfoWithAttributes() + +> **fetchSiteInfoWithAttributes**(`fetchOptions?`): `Promise`\<[`SiteInfoWithVirtualFolder`](../type-aliases/SiteInfoWithVirtualFolder.md)[]\> + +Defined in: [packages/content/src/site/siteinfo-service.ts:58](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/site/siteinfo-service.ts#L58) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `fetchOptions?` | `FetchOptions` | + +#### Returns + +`Promise`\<[`SiteInfoWithVirtualFolder`](../type-aliases/SiteInfoWithVirtualFolder.md)[]\> + +*** + +### getCacheClient() + +> `protected` **getCacheClient**(): `CacheClient`\<`SiteInfo`[]\> + +Defined in: node\_modules/@sitecore-content-sdk/content/types/site/siteinfo-service.d.ts:54 + +Gets cache client implementation +Override this method if custom cache needs to be used + +#### Returns + +`CacheClient`\<`SiteInfo`[]\> + +CacheClient instance + +#### Inherited from + +`SiteInfoServiceBase.getCacheClient` + +*** + +### getGraphQLClient() + +> `protected` **getGraphQLClient**(): `GraphQLClient` + +Defined in: node\_modules/@sitecore-content-sdk/content/types/site/siteinfo-service.d.ts:61 + +Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default +library for fetching graphql data (@see GraphQLRequestClient). Override this method if you +want to use something else. + +#### Returns + +`GraphQLClient` + +implementation + +#### Inherited from + +`SiteInfoServiceBase.getGraphQLClient` + +*** + +### getSiteCacheClient() + +> `protected` **getSiteCacheClient**(): `CacheClient`\<[`SiteInfoWithVirtualFolder`](../type-aliases/SiteInfoWithVirtualFolder.md)[]\> + +Defined in: [packages/content/src/site/siteinfo-service.ts:51](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/site/siteinfo-service.ts#L51) + +Gets cache client implementation +Override this method if custom cache needs to be used + +#### Returns + +`CacheClient`\<[`SiteInfoWithVirtualFolder`](../type-aliases/SiteInfoWithVirtualFolder.md)[]\> + +CacheClient instance diff --git a/ref-docs/content/site/type-aliases/SiteInfoWithVirtualFolder.md b/ref-docs/content/site/type-aliases/SiteInfoWithVirtualFolder.md new file mode 100644 index 0000000..2394203 --- /dev/null +++ b/ref-docs/content/site/type-aliases/SiteInfoWithVirtualFolder.md @@ -0,0 +1,17 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / [site](../README.md) / SiteInfoWithVirtualFolder + +# Type Alias: SiteInfoWithVirtualFolder + +> **SiteInfoWithVirtualFolder** = `SiteInfo` & `object` + +Defined in: [packages/content/src/site/models.ts:13](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/site/models.ts#L13) + +## Type Declaration + +### virtualFolder + +> **virtualFolder**: `string` diff --git a/ref-docs/content/tools/generate-virtual-folders/README.md b/ref-docs/content/tools/generate-virtual-folders/README.md new file mode 100644 index 0000000..a9c8d0d --- /dev/null +++ b/ref-docs/content/tools/generate-virtual-folders/README.md @@ -0,0 +1,15 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / tools/generate-virtual-folders + +# tools/generate-virtual-folders + +## Type Aliases + +- [GenerateSitesConfig](type-aliases/GenerateSitesConfig.md) + +## Functions + +- [generateVirtualFolders](functions/generateVirtualFolders.md) diff --git a/ref-docs/content/tools/generate-virtual-folders/functions/generateVirtualFolders.md b/ref-docs/content/tools/generate-virtual-folders/functions/generateVirtualFolders.md new file mode 100644 index 0000000..159fd82 --- /dev/null +++ b/ref-docs/content/tools/generate-virtual-folders/functions/generateVirtualFolders.md @@ -0,0 +1,36 @@ +[**@constellation4sitecore-content-sdk/content**](../../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../../README.md) / [tools/generate-virtual-folders](../README.md) / generateVirtualFolders + +# Function: generateVirtualFolders() + +> **generateVirtualFolders**(`config`): (`args`) => `Promise`\<`void`\> + +Defined in: [packages/content/src/tools/generate-virtual-folders.ts:35](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/tools/generate-virtual-folders.ts#L35) + +Generates site information and writes it to a specified destination path. + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `config` | [`GenerateSitesConfig`](../type-aliases/GenerateSitesConfig.md) | The configuration for generating site info. | + +## Returns + +- A promise that resolves to an asynchronous function that fetches site information and writes it to a file. + +> (`args`): `Promise`\<`void`\> + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `scConfig`: `SitecoreConfig`; \} | +| `args.scConfig` | `SitecoreConfig` | + +### Returns + +`Promise`\<`void`\> diff --git a/ref-docs/content/tools/generate-virtual-folders/type-aliases/GenerateSitesConfig.md b/ref-docs/content/tools/generate-virtual-folders/type-aliases/GenerateSitesConfig.md new file mode 100644 index 0000000..859fd42 --- /dev/null +++ b/ref-docs/content/tools/generate-virtual-folders/type-aliases/GenerateSitesConfig.md @@ -0,0 +1,32 @@ +[**@constellation4sitecore-content-sdk/content**](../../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../../README.md) / [tools/generate-virtual-folders](../README.md) / GenerateSitesConfig + +# Type Alias: GenerateSitesConfig + +> **GenerateSitesConfig** = `object` + +Defined in: [packages/content/src/tools/generate-virtual-folders.ts:20](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/tools/generate-virtual-folders.ts#L20) + +Configuration object for generating sites. + +## Properties + +### c4sConfig + +> **c4sConfig**: [`Constellation4SitecoreConfig`](../../../config/type-aliases/Constellation4SitecoreConfig.md) + +Defined in: [packages/content/src/tools/generate-virtual-folders.ts:21](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/tools/generate-virtual-folders.ts#L21) + +*** + +### destinationPath? + +> `optional` **destinationPath**: `string` + +Defined in: [packages/content/src/tools/generate-virtual-folders.ts:26](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/content/src/tools/generate-virtual-folders.ts#L26) + +Optional path where the generated sites will be saved. +If not provided, the default '.sitecore/sites.json' will be used. diff --git a/ref-docs/content/tools/index-node/README.md b/ref-docs/content/tools/index-node/README.md new file mode 100644 index 0000000..159b0e7 --- /dev/null +++ b/ref-docs/content/tools/index-node/README.md @@ -0,0 +1,13 @@ +[**@constellation4sitecore-content-sdk/content**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/content](../../README.md) / tools/index-node + +# tools/index-node + +## References + +### generateVirtualFolders + +Re-exports [generateVirtualFolders](../generate-virtual-folders/functions/generateVirtualFolders.md) diff --git a/ref-docs/nextjs/README.md b/ref-docs/nextjs/README.md index 1a12281..2cd1e78 100644 --- a/ref-docs/nextjs/README.md +++ b/ref-docs/nextjs/README.md @@ -6,10 +6,11 @@ ## Modules +- [config](config/README.md) - [fields-extensions](fields-extensions/README.md) - [graphql-client-factory](graphql-client-factory/README.md) - [helpers](helpers/README.md) - [index](index/README.md) -- [middleware](middleware/README.md) +- [proxy](proxy/README.md) +- [tools](tools/README.md) - [utils](utils/README.md) -- [utils](utils/README-1.md) diff --git a/ref-docs/nextjs/config/README.md b/ref-docs/nextjs/config/README.md new file mode 100644 index 0000000..a93d9d5 --- /dev/null +++ b/ref-docs/nextjs/config/README.md @@ -0,0 +1,16 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../README.md) / config + +# config + +## Type Aliases + +- [Constellation4SitecoreConfig](type-aliases/Constellation4SitecoreConfig.md) +- [Constellation4SitecoreConfigInput](type-aliases/Constellation4SitecoreConfigInput.md) + +## Functions + +- [defineConfig](functions/defineConfig.md) diff --git a/ref-docs/nextjs/config/functions/defineConfig.md b/ref-docs/nextjs/config/functions/defineConfig.md new file mode 100644 index 0000000..ebfc116 --- /dev/null +++ b/ref-docs/nextjs/config/functions/defineConfig.md @@ -0,0 +1,25 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [config](../README.md) / defineConfig + +# Function: defineConfig() + +> **defineConfig**(`config?`): [`Constellation4SitecoreConfig`](../type-aliases/Constellation4SitecoreConfig.md) + +Defined in: [packages/nextjs/src/config/define-config.ts:45](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/config/define-config.ts#L45) + +Accepts a SitecoreConfigInput object and returns full sitecore configuration + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `config?` | `Constellation4SitecoreConfigInput` | override values to be written over default config settings | + +## Returns + +[`Constellation4SitecoreConfig`](../type-aliases/Constellation4SitecoreConfig.md) + +full sitecore configuration to use in application diff --git a/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfig.md b/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfig.md new file mode 100644 index 0000000..11cf19a --- /dev/null +++ b/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfig.md @@ -0,0 +1,13 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [config](../README.md) / Constellation4SitecoreConfig + +# Type Alias: Constellation4SitecoreConfig + +> **Constellation4SitecoreConfig** = `DeepRequired`\<[`Constellation4SitecoreConfigInput`](Constellation4SitecoreConfigInput.md)\> + +Defined in: [packages/nextjs/src/config/define-config.ts:37](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/config/define-config.ts#L37) + +Final constellation4sitecore config type used at runtime Every property should be populated, either from constellation4sitecore.config or built-in fallback values diff --git a/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfigInput.md b/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfigInput.md new file mode 100644 index 0000000..da21951 --- /dev/null +++ b/ref-docs/nextjs/config/type-aliases/Constellation4SitecoreConfigInput.md @@ -0,0 +1,13 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [config](../README.md) / Constellation4SitecoreConfigInput + +# Type Alias: Constellation4SitecoreConfigInput + +> **Constellation4SitecoreConfigInput** = `Constellation4SitecoreConfigInputCore` + +Defined in: [packages/nextjs/src/config/define-config.ts:31](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/config/define-config.ts#L31) + +Type to be used as config input in constellation4sitecore.config diff --git a/ref-docs/nextjs/graphql-client-factory/classes/GraphqlService.md b/ref-docs/nextjs/graphql-client-factory/classes/GraphqlService.md index a0b8315..2daa1ae 100644 --- a/ref-docs/nextjs/graphql-client-factory/classes/GraphqlService.md +++ b/ref-docs/nextjs/graphql-client-factory/classes/GraphqlService.md @@ -6,7 +6,7 @@ # Class: GraphqlService -Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:6](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/graphql-client-factory/service.ts#L6) +Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:6](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/graphql-client-factory/service.ts#L6) ## Constructors @@ -14,7 +14,7 @@ Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:6](https://gi > **new GraphqlService**(`layoutData`): `GraphqlService` -Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:11](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/graphql-client-factory/service.ts#L11) +Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:11](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/graphql-client-factory/service.ts#L11) #### Parameters @@ -32,7 +32,7 @@ Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:11](https://g > `protected` **language**: `string` -Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:7](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/graphql-client-factory/service.ts#L7) +Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:7](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/graphql-client-factory/service.ts#L7) ## Methods @@ -40,7 +40,7 @@ Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:7](https://gi > `protected` **getClient**(): `GraphQLRequestClient` -Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:16](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/graphql-client-factory/service.ts#L16) +Defined in: [packages/nextjs/src/graphql-client-factory/service.ts:16](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/graphql-client-factory/service.ts#L16) #### Returns diff --git a/ref-docs/nextjs/graphql-client-factory/functions/createGraphQLClientFactory.md b/ref-docs/nextjs/graphql-client-factory/functions/createGraphQLClientFactory.md index fe086c2..bc5c297 100644 --- a/ref-docs/nextjs/graphql-client-factory/functions/createGraphQLClientFactory.md +++ b/ref-docs/nextjs/graphql-client-factory/functions/createGraphQLClientFactory.md @@ -8,7 +8,7 @@ > **createGraphQLClientFactory**(): `GraphQLRequestClientFactory` -Defined in: [packages/nextjs/src/graphql-client-factory/create.ts:14](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/graphql-client-factory/create.ts#L14) +Defined in: [packages/nextjs/src/graphql-client-factory/create.ts:14](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/graphql-client-factory/create.ts#L14) Creates a new GraphQLRequestClientFactory instance diff --git a/ref-docs/nextjs/helpers/README.md b/ref-docs/nextjs/helpers/README.md index ac7b070..3b7e976 100644 --- a/ref-docs/nextjs/helpers/README.md +++ b/ref-docs/nextjs/helpers/README.md @@ -11,3 +11,9 @@ ### hasContent Re-exports [hasContent](../index/functions/hasContent.md) + +*** + +### hasFieldContent + +Re-exports [hasFieldContent](../index/functions/hasFieldContent.md) diff --git a/ref-docs/nextjs/index/README.md b/ref-docs/nextjs/index/README.md index f755c7d..6b89265 100644 --- a/ref-docs/nextjs/index/README.md +++ b/ref-docs/nextjs/index/README.md @@ -10,18 +10,10 @@ - [ExtendedImageProps](interfaces/ExtendedImageProps.md) -## Type Aliases - -- [Debugger](type-aliases/Debugger.md) - -## Variables - -- [debug](variables/debug.md) - ## Functions -- [enableDebug](functions/enableDebug.md) - [hasContent](functions/hasContent.md) +- [hasFieldContent](functions/hasFieldContent.md) - [Image](functions/Image.md) - [isServer](functions/isServer.md) - [useIsClient](functions/useIsClient.md) diff --git a/ref-docs/nextjs/index/functions/Image.md b/ref-docs/nextjs/index/functions/Image.md index 5257c0f..e5cc508 100644 --- a/ref-docs/nextjs/index/functions/Image.md +++ b/ref-docs/nextjs/index/functions/Image.md @@ -8,7 +8,7 @@ > **Image**(`props`): `Element` -Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:8](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/fields-extensions/Image.tsx#L8) +Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:8](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/fields-extensions/Image.tsx#L8) ## Parameters diff --git a/ref-docs/nextjs/index/functions/enableDebug.md b/ref-docs/nextjs/index/functions/enableDebug.md deleted file mode 100644 index f736970..0000000 --- a/ref-docs/nextjs/index/functions/enableDebug.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [index](../README.md) / enableDebug - -# Function: enableDebug() - -> **enableDebug**(`namespaces`): `void` - -Defined in: [packages/nextjs/src/debug.ts:24](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/debug.ts#L24) - -Enable debug logging dynamically - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `namespaces` | `string` | space-separated list of namespaces to enable | - -## Returns - -`void` diff --git a/ref-docs/nextjs/index/functions/hasContent.md b/ref-docs/nextjs/index/functions/hasContent.md index f49b204..021d326 100644 --- a/ref-docs/nextjs/index/functions/hasContent.md +++ b/ref-docs/nextjs/index/functions/hasContent.md @@ -8,9 +8,9 @@ > **hasContent**(`ctx`, `field`): `boolean` -Defined in: [packages/nextjs/src/helpers/fields.ts:13](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/helpers/fields.ts#L13) +Defined in: [packages/nextjs/src/helpers/fields.ts:13](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/helpers/fields.ts#L13) -Checks if a field has content. +Checks if a field has content. For App Router use hasFieldContent instead. ## Parameters diff --git a/ref-docs/nextjs/index/functions/hasFieldContent.md b/ref-docs/nextjs/index/functions/hasFieldContent.md new file mode 100644 index 0000000..cf603d3 --- /dev/null +++ b/ref-docs/nextjs/index/functions/hasFieldContent.md @@ -0,0 +1,26 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [index](../README.md) / hasFieldContent + +# Function: hasFieldContent() + +> **hasFieldContent**(`page`, `field`): `boolean` + +Defined in: [packages/nextjs/src/helpers/fields.ts:37](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/helpers/fields.ts#L37) + +Checks if a field has content. + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `page` | `Page` | THis is supported for App Router. | +| `field` | `ImageField` \| `LinkField` \| `Field`\<`string`\> | The field to check. Example: LinkField, ImageField, Field | + +## Returns + +`boolean` + +True if the field has content, false otherwise. diff --git a/ref-docs/nextjs/index/functions/isServer.md b/ref-docs/nextjs/index/functions/isServer.md index a0659ca..ad07b46 100644 --- a/ref-docs/nextjs/index/functions/isServer.md +++ b/ref-docs/nextjs/index/functions/isServer.md @@ -8,7 +8,7 @@ > **isServer**(): `boolean` -Defined in: [packages/nextjs/src/utils/is-server.ts:5](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/utils/is-server.ts#L5) +Defined in: [packages/nextjs/src/utils/is-server.ts:5](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/utils/is-server.ts#L5) Determines whether the current execution context is server-side diff --git a/ref-docs/nextjs/index/functions/useIsClient.md b/ref-docs/nextjs/index/functions/useIsClient.md index dc90850..719944b 100644 --- a/ref-docs/nextjs/index/functions/useIsClient.md +++ b/ref-docs/nextjs/index/functions/useIsClient.md @@ -8,7 +8,7 @@ > **useIsClient**(): `boolean` -Defined in: [packages/nextjs/src/utils/is-client.ts:3](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/utils/is-client.ts#L3) +Defined in: [packages/nextjs/src/utils/is-client.ts:3](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/utils/is-client.ts#L3) ## Returns diff --git a/ref-docs/nextjs/index/interfaces/ExtendedImageProps.md b/ref-docs/nextjs/index/interfaces/ExtendedImageProps.md index 9216f4f..200be18 100644 --- a/ref-docs/nextjs/index/interfaces/ExtendedImageProps.md +++ b/ref-docs/nextjs/index/interfaces/ExtendedImageProps.md @@ -6,7 +6,7 @@ # Interface: ExtendedImageProps -Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:4](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/fields-extensions/Image.tsx#L4) +Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:4](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/fields-extensions/Image.tsx#L4) ## Extends @@ -56,7 +56,7 @@ Custom element to render in Pages in edit mode if field value is empty > `optional` **field**: (ImageField \| ImageFieldValue) & FieldMetadata -Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:31 +Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:47 Image field data (consistent with other field types) @@ -70,7 +70,7 @@ Image field data (consistent with other field types) > `optional` **imageParams**: `object` -Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:35 +Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:51 Parameters that will be attached to Sitecore media URLs @@ -88,7 +88,7 @@ Parameters that will be attached to Sitecore media URLs > `optional` **isSvg**: `boolean` -Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:5](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/fields-extensions/Image.tsx#L5) +Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:5](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/fields-extensions/Image.tsx#L5) *** @@ -96,7 +96,7 @@ Defined in: [packages/nextjs/src/fields-extensions/Image.tsx:5](https://github.c > `optional` **mediaUrlPrefix**: `RegExp` -Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:46 +Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:62 Custom regexp that finds media URL prefix that will be replaced by `/-/jssmedia` or `/~/jssmedia`. @@ -118,7 +118,7 @@ Custom regexp that finds media URL prefix that will be replaced by `/-/jssmedia` > `optional` **srcSet**: `ImageSizeParameters`[] -Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:38 +Defined in: node\_modules/@sitecore-content-sdk/react/types/components/Image.d.ts:54 #### Inherited from diff --git a/ref-docs/nextjs/index/type-aliases/Debugger.md b/ref-docs/nextjs/index/type-aliases/Debugger.md deleted file mode 100644 index 0144bd8..0000000 --- a/ref-docs/nextjs/index/type-aliases/Debugger.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [index](../README.md) / Debugger - -# Type Alias: Debugger - -> **Debugger** = `debug.Debugger` - -Defined in: [packages/nextjs/src/debug.ts:6](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/debug.ts#L6) diff --git a/ref-docs/nextjs/index/variables/debug.md b/ref-docs/nextjs/index/variables/debug.md deleted file mode 100644 index 0635720..0000000 --- a/ref-docs/nextjs/index/variables/debug.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [index](../README.md) / debug - -# Variable: debug - -> **debug**: `object` - -Defined in: [packages/nextjs/src/debug.ts:30](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/debug.ts#L30) - -Default Sitecore JSS 'debug' module debuggers. Uses namespace prefix 'sitecore-jss:'. -See [https://www.npmjs.com/package/debug](https://www.npmjs.com/package/debug) for details. - -## Type Declaration - -### analytics - -> **analytics**: `Debugger` - -### common - -> **common**: `Debugger` - -### data - -> **data**: `Debugger` - -### http - -> **http**: `Debugger` - -### labels - -> **labels**: `Debugger` - -### navigation - -> **navigation**: `Debugger` - -### security - -> **security**: `Debugger` diff --git a/ref-docs/nextjs/middleware/README.md b/ref-docs/nextjs/middleware/README.md deleted file mode 100644 index 5dc1f58..0000000 --- a/ref-docs/nextjs/middleware/README.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../README.md) / middleware - -# middleware - -## Classes - -- [MiddlewareBase](classes/MiddlewareBase.md) - -## Type Aliases - -- [MiddlewareBaseConfig](type-aliases/MiddlewareBaseConfig.md) diff --git a/ref-docs/nextjs/middleware/classes/MiddlewareBase.md b/ref-docs/nextjs/middleware/classes/MiddlewareBase.md deleted file mode 100644 index 0ab4859..0000000 --- a/ref-docs/nextjs/middleware/classes/MiddlewareBase.md +++ /dev/null @@ -1,210 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [middleware](../README.md) / MiddlewareBase - -# Abstract Class: MiddlewareBase - -Defined in: [packages/nextjs/src/middleware/index.ts:30](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L30) - -## Constructors - -### Constructor - -> **new MiddlewareBase**(`config`): `MiddlewareBase` - -Defined in: [packages/nextjs/src/middleware/index.ts:35](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L35) - -#### Parameters - -| Parameter | Type | -| ------ | ------ | -| `config` | [`MiddlewareBaseConfig`](../type-aliases/MiddlewareBaseConfig.md) | - -#### Returns - -`MiddlewareBase` - -## Properties - -### config - -> `protected` **config**: [`MiddlewareBaseConfig`](../type-aliases/MiddlewareBaseConfig.md) - -Defined in: [packages/nextjs/src/middleware/index.ts:35](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L35) - -*** - -### defaultHostname - -> `protected` **defaultHostname**: `string` - -Defined in: [packages/nextjs/src/middleware/index.ts:33](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L33) - -*** - -### REWRITE\_HEADER\_NAME - -> `protected` **REWRITE\_HEADER\_NAME**: `string` = `'x-sc-rewrite'` - -Defined in: [packages/nextjs/src/middleware/index.ts:32](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L32) - -*** - -### SITE\_SYMBOL - -> `protected` **SITE\_SYMBOL**: `string` = `'sc_site'` - -Defined in: [packages/nextjs/src/middleware/index.ts:31](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L31) - -## Methods - -### excludeRoute() - -> `protected` **excludeRoute**(`pathname`): `undefined` \| `boolean` - -Defined in: [packages/nextjs/src/middleware/index.ts:50](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L50) - -#### Parameters - -| Parameter | Type | -| ------ | ------ | -| `pathname` | `string` | - -#### Returns - -`undefined` \| `boolean` - -*** - -### extractDebugHeaders() - -> `protected` **extractDebugHeaders**(`incomingHeaders`): `object` - -Defined in: [packages/nextjs/src/middleware/index.ts:65](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L65) - -Safely extract all headers for debug logging -Necessary to avoid middleware issue https://github.com/vercel/next.js/issues/39765 - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `incomingHeaders` | `Headers` | Incoming headers | - -#### Returns - -`object` - -Object with headers as key/value pairs - -*** - -### getHostHeader() - -> `protected` **getHostHeader**(`req`): `undefined` \| `string` - -Defined in: [packages/nextjs/src/middleware/index.ts:84](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L84) - -Extract 'host' header - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `req` | `NextRequest` | request | - -#### Returns - -`undefined` \| `string` - -*** - -### getLanguage() - -> `protected` **getLanguage**(`req`): `string` - -Defined in: [packages/nextjs/src/middleware/index.ts:76](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L76) - -Provides used language - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `req` | `NextRequest` | request | - -#### Returns - -`string` - -language - -*** - -### getSite() - -> `protected` **getSite**(`req`, `res?`): `undefined` \| `SiteInfo` - -Defined in: [packages/nextjs/src/middleware/index.ts:95](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L95) - -Get site information. -Can not be used in **Preview** mode, since site will not be resolved - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `req` | `NextRequest` | request | -| `res?` | `NextResponse`\<`unknown`\> | response | - -#### Returns - -`undefined` \| `SiteInfo` - -site information - -*** - -### isPreview() - -> `protected` **isPreview**(`req`): `boolean` - -Defined in: [packages/nextjs/src/middleware/index.ts:44](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L44) - -Determines if mode is preview - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `req` | `NextRequest` | request | - -#### Returns - -`boolean` - -is preview - -*** - -### rewrite() - -> `protected` **rewrite**(`rewritePath`, `req`, `res`): `NextResponse` - -Defined in: [packages/nextjs/src/middleware/index.ts:111](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L111) - -Create a rewrite response - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `rewritePath` | `string` | the destionation path | -| `req` | `NextRequest` | the current request | -| `res` | `NextResponse` | the current response | - -#### Returns - -`NextResponse` diff --git a/ref-docs/nextjs/middleware/type-aliases/MiddlewareBaseConfig.md b/ref-docs/nextjs/middleware/type-aliases/MiddlewareBaseConfig.md deleted file mode 100644 index c3a0345..0000000 --- a/ref-docs/nextjs/middleware/type-aliases/MiddlewareBaseConfig.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [middleware](../README.md) / MiddlewareBaseConfig - -# Type Alias: MiddlewareBaseConfig - -> **MiddlewareBaseConfig** = `object` - -Defined in: [packages/nextjs/src/middleware/index.ts:4](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L4) - -## Properties - -### defaultHostname? - -> `optional` **defaultHostname**: `string` - -Defined in: [packages/nextjs/src/middleware/index.ts:23](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L23) - -Fallback hostname in case `host` header is not present - -#### Default - -```ts -localhost -``` - -*** - -### disabled()? - -> `optional` **disabled**: (`req?`, `res?`) => `boolean` - -Defined in: [packages/nextjs/src/middleware/index.ts:10](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L10) - -function, determines if middleware should be turned off, based on cookie, header, or other considerations - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `req?` | `NextRequest` | request object from middleware handler | -| `res?` | `NextResponse` | response object from middleware handler | - -#### Returns - -`boolean` - -*** - -### excludeRoute()? - -> `optional` **excludeRoute**: (`pathname`) => `boolean` - -Defined in: [packages/nextjs/src/middleware/index.ts:18](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L18) - -Function used to determine if route should be excluded. -By default, files (pathname.includes('.')), Next.js API routes (pathname.startsWith('/api/')), and Sitecore API routes (pathname.startsWith('/sitecore/')) are ignored. -This is an important performance consideration since Next.js Edge middleware runs on every request. - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `pathname` | `string` | The pathname | - -#### Returns - -`boolean` - -Whether to exclude the route - -*** - -### siteResolver - -> **siteResolver**: `SiteResolver` - -Defined in: [packages/nextjs/src/middleware/index.ts:27](https://github.com/constellation4sitecore/content-sdk/blob/68f5636dd87f6bb306e4c2c6ae8cb62f4f86e925/packages/nextjs/src/middleware/index.ts#L27) - -Site resolution implementation by name/hostname diff --git a/ref-docs/nextjs/proxy/README.md b/ref-docs/nextjs/proxy/README.md new file mode 100644 index 0000000..7b70943 --- /dev/null +++ b/ref-docs/nextjs/proxy/README.md @@ -0,0 +1,15 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../README.md) / proxy + +# proxy + +## Classes + +- [VirtualFolderProxy](classes/VirtualFolderProxy.md) + +## Type Aliases + +- [VirtualFolderProxyConfig](type-aliases/VirtualFolderProxyConfig.md) diff --git a/ref-docs/nextjs/proxy/classes/VirtualFolderProxy.md b/ref-docs/nextjs/proxy/classes/VirtualFolderProxy.md new file mode 100644 index 0000000..3fd2637 --- /dev/null +++ b/ref-docs/nextjs/proxy/classes/VirtualFolderProxy.md @@ -0,0 +1,380 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [proxy](../README.md) / VirtualFolderProxy + +# Class: VirtualFolderProxy + +Defined in: [packages/nextjs/src/proxy/virtual-folder-proxy.ts:12](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/proxy/virtual-folder-proxy.ts#L12) + +## Extends + +- `ProxyBase` + +## Constructors + +### Constructor + +> **new VirtualFolderProxy**(`proxyConfig`): `VirtualFolderProxy` + +Defined in: [packages/nextjs/src/proxy/virtual-folder-proxy.ts:13](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/proxy/virtual-folder-proxy.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `proxyConfig` | [`VirtualFolderProxyConfig`](../type-aliases/VirtualFolderProxyConfig.md) | + +#### Returns + +`VirtualFolderProxy` + +#### Overrides + +`ProxyBase.constructor` + +## Properties + +### config + +> `protected` **config**: `ProxyBaseConfig` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:50 + +#### Inherited from + +`ProxyBase.config` + +*** + +### defaultHostname + +> `protected` **defaultHostname**: `string` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:51 + +#### Inherited from + +`ProxyBase.defaultHostname` + +*** + +### siteResolver + +> `protected` **siteResolver**: `SiteResolver` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:52 + +#### Inherited from + +`ProxyBase.siteResolver` + +## Methods + +### disabled() + +> `protected` **disabled**(`req`, `res`): `undefined` \| `boolean` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:72 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `req` | `NextRequest` | +| `res` | `NextResponse` | + +#### Returns + +`undefined` \| `boolean` + +#### Inherited from + +`ProxyBase.disabled` + +*** + +### extractDebugHeaders() + +> `protected` **extractDebugHeaders**(`incomingHeaders`): `object` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:79 + +Safely extract all headers for debug logging +Necessary to avoid proxy issue https://github.com/vercel/next.js/issues/39765 + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `incomingHeaders` | `Headers` | Incoming headers | + +#### Returns + +`object` + +Object with headers as key/value pairs + +#### Inherited from + +`ProxyBase.extractDebugHeaders` + +*** + +### getClientFactory() + +> `protected` **getClientFactory**(`graphQLOptions`): `GraphQLRequestClientFactory` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:110 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `graphQLOptions` | `GraphQLClientOptions` | + +#### Returns + +`GraphQLRequestClientFactory` + +#### Inherited from + +`ProxyBase.getClientFactory` + +*** + +### getHostHeader() + +> `protected` **getHostHeader**(`req`): `undefined` \| `string` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:100 + +Extract 'host' header + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | + +#### Returns + +`undefined` \| `string` + +#### Inherited from + +`ProxyBase.getHostHeader` + +*** + +### getLanguage() + +> `protected` **getLanguage**(`req`, `res?`): `string` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:88 + +Provides used language + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | +| `res?` | `NextResponse`\<`unknown`\> | response | + +#### Returns + +`string` + +language + +#### Inherited from + +`ProxyBase.getLanguage` + +*** + +### getLanguageFromHeader() + +> `protected` **getLanguageFromHeader**(`res?`): `undefined` \| `string` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:95 + +Extract language from locale header of the response +set by LocaleProxy for app router application + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `res?` | `NextResponse`\<`unknown`\> | response | + +#### Returns + +`undefined` \| `string` + +language or undefined if not found + +#### Inherited from + +`ProxyBase.getLanguageFromHeader` + +*** + +### getSite() + +> `protected` **getSite**(`req`, `res?`): `SiteInfo` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:109 + +Get site information. If site name is stored in cookie, use it, otherwise resolve by hostname +- If site can't be resolved by site name cookie use default site info based on provided parameters +- If site can't be resolved by hostname throw an error + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | +| `res?` | `NextResponse`\<`unknown`\> | response | + +#### Returns + +`SiteInfo` + +site information + +#### Inherited from + +`ProxyBase.getSite` + +*** + +### handle() + +> **handle**(`req`, `res`): `Promise`\<`NextResponse`\<`unknown`\>\> + +Defined in: [packages/nextjs/src/proxy/virtual-folder-proxy.ts:17](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/proxy/virtual-folder-proxy.ts#L17) + +Handler method to execute proxy logic + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | +| `res` | `NextResponse`\<`unknown`\> | response | + +#### Returns + +`Promise`\<`NextResponse`\<`unknown`\>\> + +#### Overrides + +`ProxyBase.handle` + +*** + +### isAppRouter() + +> `protected` **isAppRouter**(`res`): `boolean` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:65 + +Determines if the application is using the app router based on the locale header + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `res` | `NextResponse` | response | + +#### Returns + +`boolean` + +true if app router is used + +#### Inherited from + +`ProxyBase.isAppRouter` + +*** + +### isPrefetch() + +> `protected` **isPrefetch**(`req`): `boolean` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:71 + +Determines if the request is a Next.js (next/link) prefetch request + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | + +#### Returns + +`boolean` + +is prefetch + +#### Inherited from + +`ProxyBase.isPrefetch` + +*** + +### isPreview() + +> `protected` **isPreview**(`req`): `boolean` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:59 + +Determines if mode is preview + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `req` | `NextRequest` | request | + +#### Returns + +`boolean` + +is preview + +#### Inherited from + +`ProxyBase.isPreview` + +*** + +### rewrite() + +> `protected` **rewrite**(`rewritePath`, `req`, `res`, `skipHeader?`): `NextResponse` + +Defined in: node\_modules/@sitecore-content-sdk/nextjs/types/proxy/proxy.d.ts:118 + +Create a rewrite response + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `rewritePath` | `string` | the destionation path | +| `req` | `NextRequest` | the current request | +| `res` | `NextResponse` | the current response | +| `skipHeader?` | `boolean` | don't write 'x-sc-rewrite' header | + +#### Returns + +`NextResponse` + +#### Inherited from + +`ProxyBase.rewrite` diff --git a/ref-docs/nextjs/proxy/type-aliases/VirtualFolderProxyConfig.md b/ref-docs/nextjs/proxy/type-aliases/VirtualFolderProxyConfig.md new file mode 100644 index 0000000..48356be --- /dev/null +++ b/ref-docs/nextjs/proxy/type-aliases/VirtualFolderProxyConfig.md @@ -0,0 +1,21 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [proxy](../README.md) / VirtualFolderProxyConfig + +# Type Alias: VirtualFolderProxyConfig + +> **VirtualFolderProxyConfig** = `ProxyBaseConfig` & `object` + +Defined in: [packages/nextjs/src/proxy/virtual-folder-proxy.ts:7](https://github.com/constellation4sitecore/content-sdk/blob/2e47e23613769e7eb9f79d846ccbfeb76eb17b3e/packages/nextjs/src/proxy/virtual-folder-proxy.ts#L7) + +## Type Declaration + +### c4sConfig + +> **c4sConfig**: `Constellation4SitecoreConfig` + +### virtualFolders + +> **virtualFolders**: `SiteInfoWithVirtualFolder`[] diff --git a/ref-docs/nextjs/tools/README.md b/ref-docs/nextjs/tools/README.md new file mode 100644 index 0000000..9cfcc85 --- /dev/null +++ b/ref-docs/nextjs/tools/README.md @@ -0,0 +1,11 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../README.md) / tools + +# tools + +## Variables + +- [generateVirtualFolders](variables/generateVirtualFolders.md) diff --git a/ref-docs/nextjs/tools/variables/generateVirtualFolders.md b/ref-docs/nextjs/tools/variables/generateVirtualFolders.md new file mode 100644 index 0000000..6c1ce7e --- /dev/null +++ b/ref-docs/nextjs/tools/variables/generateVirtualFolders.md @@ -0,0 +1,36 @@ +[**@constellation4sitecore-content-sdk/nextjs**](../../README.md) + +*** + +[@constellation4sitecore-content-sdk/nextjs](../../README.md) / [tools](../README.md) / generateVirtualFolders + +# Variable: generateVirtualFolders() + +> `const` **generateVirtualFolders**: (`{ c4sConfig, destinationPath, }`) => (`args`) => `Promise`\<`void`\> + +Defined in: packages/content/types/tools/generate-virtual-folders.d.ts:21 + +Generates site information and writes it to a specified destination path. + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `{ c4sConfig, destinationPath, }` | `GenerateSitesConfig` | + +## Returns + +- A promise that resolves to an asynchronous function that fetches site information and writes it to a file. + +> (`args`): `Promise`\<`void`\> + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `scConfig`: `SitecoreConfig`; \} | +| `args.scConfig` | `SitecoreConfig` | + +### Returns + +`Promise`\<`void`\> diff --git a/ref-docs/nextjs/utils/README-1.md b/ref-docs/nextjs/utils/README-1.md deleted file mode 100644 index e26138a..0000000 --- a/ref-docs/nextjs/utils/README-1.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@constellation4sitecore-content-sdk/nextjs**](../README.md) - -*** - -[@constellation4sitecore-content-sdk/nextjs](../README.md) / utils - -# utils - -## References - -### isServer - -Re-exports [isServer](../index/functions/isServer.md) - -*** - -### useIsClient - -Re-exports [useIsClient](../index/functions/useIsClient.md) From d66dc78de03e2c90bb7a5462f28c5d773f9da1e9 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:29:26 -0500 Subject: [PATCH 11/18] Update Read me --- packages/content/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/content/README.md diff --git a/packages/content/README.md b/packages/content/README.md new file mode 100644 index 0000000..a8308da --- /dev/null +++ b/packages/content/README.md @@ -0,0 +1,5 @@ +# Constellation SXA NextJS for Content SDK + +This module is provided as a part of Constellation 4 Sitecore Content SDK. It contains the Constellation 4 Sitecore Content SDK content APIs and utilities. + +[API reference documentation](/ref-docs/content/) From 081d94b49f31a26e21b9d106ea9e7f35efcff76d Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:41:51 -0500 Subject: [PATCH 12/18] Update Change Log --- CHANGELOG.md | 105 +++++++++++++++++++++++++++++++++++ packages/nextjs/package.json | 2 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..346d14c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,105 @@ +# Changelog + +All packages in this monorepo are versioned together. Changes listed here apply to the `@constellation4sitecore-content-sdk/*` scope. + +## [2.0.0] - 2026-04-11 + +### Breaking Changes + +#### Peer dependency upgrades + +All packages now require: + +| Dependency | v1.x | v2.x | +| ------------------------------ | --------- | --------- | +| `@sitecore-content-sdk/core` | `^1.1.0` | `^2.0.0` | +| `@sitecore-content-sdk/nextjs` | `^1.1.0` | `^2.0.0` | +| `next` | `^15.3.1` | `^16.1.1` | +| `react` / `react-dom` | `^19.1.0` | `^19.2.1` | + +#### Import path changes + +Layout and site types have moved from `@sitecore-content-sdk/core` to `@sitecore-content-sdk/content`: + +```diff +- import { Item, LayoutServiceData, ComponentRendering, Field } from '@sitecore-content-sdk/core/layout'; ++ import { Item, LayoutServiceData, ComponentRendering, Field } from '@sitecore-content-sdk/content/layout'; + +- import { SiteResolver } from '@sitecore-content-sdk/core/site'; ++ import { SiteResolver } from '@sitecore-content-sdk/content/site'; +``` + +This affects the following packages: `data`, `enhancers`, `labels`, `mapper`, `navigation`, `page-analytics-scripts`, `page-tagging`, `security`. + +#### `security`: Middleware renamed to Proxy + +The CSP middleware has been renamed and moved to align with the Content SDK 2.0 proxy pattern: + +```diff +- import { CSPMiddleware, CSPMiddlewareConfig } from '@constellation4sitecore-content-sdk/security/middleware'; ++ import { CSPProxy, CSPProxyConfig } from '@constellation4sitecore-content-sdk/security/proxy'; +``` + +- `CSPMiddleware` class → `CSPProxy` +- `CSPMiddlewareConfig` type → `CSPProxyConfig` +- Base class changed from `MiddlewareBase` to `ProxyBase` (from `@sitecore-content-sdk/nextjs/proxy`) + +#### `nextjs`: Debug module refactored + +The `debug` npm dependency has been removed. Debug utilities are now provided by the new `content` package. If you were importing `enableDebug` or `Debugger` from `@constellation4sitecore-content-sdk/nextjs`, import them from `@constellation4sitecore-content-sdk/content` instead. + +#### `nextjs`: GraphQL client factory + +`getEdgeProxyContentUrl` no longer accepts `contextId` as a first argument. The `contextId` is now passed as a separate field in the client config: + +```diff + clientConfig = { +- endpoint: getEdgeProxyContentUrl(contextId, edgeUrl), ++ endpoint: getEdgeProxyContentUrl(edgeUrl), ++ contextId: contextId, + }; +``` + +### New Features + +#### New package: `content` + +A new foundational package (`@constellation4sitecore-content-sdk/content`) with: + +- **`defineConfig`** (`content/config`) — Type-safe configuration builder with `Constellation4SitecoreConfig` types and deep-required resolution. +- **`SiteInfoService`** (`content/site`) — Service for resolving site information with virtual folder support (`SiteInfoWithVirtualFolder`). +- **`generateVirtualFolders`** (`content/node-tools`) — Build-time tool that generates virtual folder configuration from Sitecore site definitions. +- **Debug utilities** — Namespaced debug logging (`debugModule`, `debugNamespace`, `enableDebug`, `isNamespaceEnabled`). + +#### `nextjs`: Virtual Folder Proxy + +New `VirtualFolderProxy` class (`@constellation4sitecore-content-sdk/nextjs/proxy`) that rewrites incoming request paths based on virtual folder configuration. Enabled via `defineConfig({ virtualFolders: { enabled: true } })` or the `VIRTUAL_FOLDERS_ENABLED` environment variable. + +#### `nextjs`: Configuration module + +New `defineConfig` function (`@constellation4sitecore-content-sdk/nextjs/config`) that wraps the `content` package config with Next.js-specific defaults, including virtual folder settings from environment variables. + +#### `nextjs`: Tools re-export + +`generateVirtualFolders` is re-exported from `@constellation4sitecore-content-sdk/nextjs/tools` for convenience. + +## [1.1.1] - 2025 + +### Features + +- **App Router support** across `enhancers` and `page-analytics-scripts`. +- `withAppDatasourceRendering` HOC added to `enhancers` for App Router (page passed as prop instead of `useSitecore()` hook). +- `AppAnalyticsService` added to `page-analytics-scripts` with refactored script rendering for App Router compatibility. + +## [1.1.0] - 2025 + +### Features + +- Initial stable release with App Router groundwork. + +## [1.0.0] - 2025 + +### Features + +- First stable release of the monorepo. +- Packages: `data`, `enhancers`, `labels`, `mapper`, `navigation`, `nextjs`, `page-analytics-scripts`, `page-tagging`, `security`, `url-friendly-page-names`. diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 645f5f8..601c218 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -7,7 +7,7 @@ "author": "Richard J. Cabral, Roberto Armas", "license": "MIT", "bugs": { - "url": "https://github.com/Sitecore/content-sdk/issues" + "url": "https://github.com/constellation4sitecore/content-sdk/issues" }, "scripts": { "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", From 23d7302ee76346ed0e1040439b0ceb78edc487ee Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:44:30 -0500 Subject: [PATCH 13/18] version v2.0.0-beta.4 [skip ci] --- lerna.json | 2 +- packages/content/package.json | 4 ++-- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 8 ++++---- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 7c378ed..b54cf2d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/content/package.json b/packages/content/package.json index cbf0f9b..52f62bb 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/content", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -27,9 +27,9 @@ "@types/proxyquire": "^1.3.31", "@types/sinon": "^17.0.4", "@types/sinon-chai": "^4.0.0", - "copyfiles": "^2.4.1", "chai": "^4.4.1", "chai-spies": "^1.1.0", + "copyfiles": "^2.4.1", "del-cli": "^5.0.0", "eslint": "^8.32.0", "eslint-plugin-react": "^7.37.5", diff --git a/packages/data/package.json b/packages/data/package.json index a51a5db..6440349 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index 527e421..5400889 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index 42b9024..13a4b4f 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index 93542ee..edd80a4 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 0e690bf..d63220c 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.4" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 601c218..9e09071 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -31,9 +31,9 @@ "@types/debug": "^4.1.5", "@types/mocha": "^10.0.10", "@types/node": "^24.10.4", + "@types/proxyquire": "^1.3.31", "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", - "@types/proxyquire": "^1.3.31", "@types/sinon": "^17.0.4", "chai": "^4.4.1", "chai-string": "^1.6.0", @@ -43,8 +43,8 @@ "eslint-plugin-react": "^7.37.5", "jsdom": "^21.1.0", "mocha": "^11.2.2", - "proxyquire": "^2.1.3", "next": "^16.1.1", + "proxyquire": "^2.1.3", "react": "^19.2.1", "react-dom": "^19.2.1", "sinon": "^20.0.0", @@ -52,7 +52,7 @@ "typescript": "~5.8.3" }, "dependencies": { - "@constellation4sitecore-content-sdk/content": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/content": "2.0.0-beta.4" }, "peerDependencies": { "@sitecore-content-sdk/nextjs": "^2.0.0" diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index f6c32ea..a82ed4b 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index f1d0fd2..d54f24e 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.3", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index 4daf09e..78e1349 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.3", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index 9a5169f..ef2fff8 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From 9f9342c9050f1a849b91306c7238d14cf0e5a76b Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:51:37 -0500 Subject: [PATCH 14/18] Add missing file --- packages/nextjs/config.d.ts | 1 + packages/nextjs/tsconfig.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 packages/nextjs/config.d.ts diff --git a/packages/nextjs/config.d.ts b/packages/nextjs/config.d.ts new file mode 100644 index 0000000..3e23d4d --- /dev/null +++ b/packages/nextjs/config.d.ts @@ -0,0 +1 @@ +export * from './types/config/index'; diff --git a/packages/nextjs/tsconfig.json b/packages/nextjs/tsconfig.json index 8d04aef..559f143 100644 --- a/packages/nextjs/tsconfig.json +++ b/packages/nextjs/tsconfig.json @@ -15,6 +15,7 @@ "types", "typings", "dist", + "config.d.ts", "debugger.d.ts", "debugger.js", "graphql.d.ts", From 4020b791e0dde794ab10bc4a5b6ec3713e1d6a5a Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 18:53:32 -0500 Subject: [PATCH 15/18] version v2.0.0-beta.5 [skip ci] --- lerna.json | 2 +- packages/content/package.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 4 ++-- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lerna.json b/lerna.json index b54cf2d..2603f37 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/content/package.json b/packages/content/package.json index 52f62bb..72dcd09 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/content", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/data/package.json b/packages/data/package.json index 6440349..b10f331 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index 5400889..bdb6107 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index 13a4b4f..2e4df02 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index edd80a4..cd5b028 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index d63220c..8005a4a 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.5" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 9e09071..5cfc687 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -52,7 +52,7 @@ "typescript": "~5.8.3" }, "dependencies": { - "@constellation4sitecore-content-sdk/content": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/content": "2.0.0-beta.5" }, "peerDependencies": { "@sitecore-content-sdk/nextjs": "^2.0.0" diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index a82ed4b..d77f8c1 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index d54f24e..957e742 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.4", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index 78e1349..322a05f 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.4", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index ef2fff8..b407676 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT", From 5119cab82edcd352ab0bb7e1b4f5febcabb223e5 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 19:21:55 -0500 Subject: [PATCH 16/18] Add Route Handlers for Virtual Folder --- packages/content/package.json | 5 + packages/nextjs/package.json | 37 +++ packages/nextjs/route-handler.d.ts | 1 + packages/nextjs/src/debug.ts | 2 + packages/nextjs/src/debugger/index.ts | 1 + packages/nextjs/src/route-handler/index.ts | 2 + .../robots-route-handler.test.ts | 223 +++++++++++++ .../src/route-handler/robots-route-handler.ts | 107 +++++++ .../sitemap-route-handler.test.ts | 294 ++++++++++++++++++ .../route-handler/sitemap-route-handler.ts | 101 ++++++ packages/nextjs/tools.d.ts | 1 + packages/nextjs/tsconfig.json | 4 +- 12 files changed, 776 insertions(+), 2 deletions(-) create mode 100644 packages/nextjs/route-handler.d.ts create mode 100644 packages/nextjs/src/debugger/index.ts create mode 100644 packages/nextjs/src/route-handler/index.ts create mode 100644 packages/nextjs/src/route-handler/robots-route-handler.test.ts create mode 100644 packages/nextjs/src/route-handler/robots-route-handler.ts create mode 100644 packages/nextjs/src/route-handler/sitemap-route-handler.test.ts create mode 100644 packages/nextjs/src/route-handler/sitemap-route-handler.ts create mode 100644 packages/nextjs/tools.d.ts diff --git a/packages/content/package.json b/packages/content/package.json index 72dcd09..04c0453 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -54,6 +54,11 @@ "/*.d.ts" ], "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "types": "./types/index.d.ts" + }, "./config": { "import": "./dist/esm/config/index.js", "require": "./dist/cjs/config/index.js", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 5cfc687..279c94a 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -57,5 +57,42 @@ "peerDependencies": { "@sitecore-content-sdk/nextjs": "^2.0.0" }, + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "types": "./types/index.d.ts" + }, + "./config": { + "import": "./dist/esm/config/index.js", + "require": "./dist/cjs/config/index.js", + "types": "./types/config/index.d.ts" + }, + "./proxy": { + "import": "./dist/esm/proxy/index.js", + "require": "./dist/cjs/proxy/index.js", + "types": "./types/proxy/index.d.ts" + }, + "./tools": { + "import": "./dist/esm/tools/index.js", + "require": "./dist/cjs/tools/index.js", + "types": "./types/tools/index.d.ts" + }, + "./route-handler": { + "import": "./dist/esm/route-handler/index.js", + "require": "./dist/cjs/route-handler/index.js", + "types": "./types/route-handler/index.d.ts" + }, + "./debugger": { + "import": "./dist/esm/debugger/index.js", + "require": "./dist/cjs/debugger/index.js", + "types": "./types/debugger/index.d.ts" + }, + "./graphql": { + "import": "./dist/esm/graphql-client-factory/index.js", + "require": "./dist/cjs/graphql-client-factory/index.js", + "types": "./types/graphql-client-factory/index.d.ts" + } + }, "gitHead": "4724f2214e80450076a12e36844e89d6b81229c4" } diff --git a/packages/nextjs/route-handler.d.ts b/packages/nextjs/route-handler.d.ts new file mode 100644 index 0000000..9ba96b1 --- /dev/null +++ b/packages/nextjs/route-handler.d.ts @@ -0,0 +1 @@ +export * from './types/route-handler/index'; diff --git a/packages/nextjs/src/debug.ts b/packages/nextjs/src/debug.ts index 3ece92b..f708bc4 100644 --- a/packages/nextjs/src/debug.ts +++ b/packages/nextjs/src/debug.ts @@ -12,4 +12,6 @@ export default { analytics: debugModule(`${debugNamespace}:analytics`), security: debugModule(`${debugNamespace}:security`), http: debugModule(`${debugNamespace}:http`), + robots: debugModule(`${debugNamespace}:robots`), + sitemap: debugModule(`${debugNamespace}:sitemap`), }; diff --git a/packages/nextjs/src/debugger/index.ts b/packages/nextjs/src/debugger/index.ts new file mode 100644 index 0000000..bee71de --- /dev/null +++ b/packages/nextjs/src/debugger/index.ts @@ -0,0 +1 @@ +export { default as debug } from '../debug'; diff --git a/packages/nextjs/src/route-handler/index.ts b/packages/nextjs/src/route-handler/index.ts new file mode 100644 index 0000000..2129cb9 --- /dev/null +++ b/packages/nextjs/src/route-handler/index.ts @@ -0,0 +1,2 @@ +export { createRobotsRouteHandler } from './robots-route-handler'; +export { createSitemapRouteHandler } from './sitemap-route-handler'; diff --git a/packages/nextjs/src/route-handler/robots-route-handler.test.ts b/packages/nextjs/src/route-handler/robots-route-handler.test.ts new file mode 100644 index 0000000..5c2aa9c --- /dev/null +++ b/packages/nextjs/src/route-handler/robots-route-handler.test.ts @@ -0,0 +1,223 @@ +import chai, { expect } from 'chai'; +import sinon from 'sinon'; +import sinonChai from 'sinon-chai'; +import { NextRequest } from 'next/server'; +import proxyquire from 'proxyquire'; +import { SitecoreClient } from '@sitecore-content-sdk/content/client'; +import { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; + +chai.use(sinonChai); + +describe('createRobotsRouteHandler', () => { + const sandbox = sinon.createSandbox(); + let sitecoreClientStub: sinon.SinonStubbedInstance; + let robotsRouteHandlerModule: any; + let unstableCacheStub: sinon.SinonStub; + let handler: any; + let req: Partial; + const mockSiteInfo: SiteInfoWithVirtualFolder = { + name: 'test-site', + hostName: 'example.com', + language: 'en', + virtualFolder: '', + }; + + let OriginalResponse: typeof Response; + + const emptyVirtualFolderContext = { params: Promise.resolve({ virtualFolder: '' }) }; + + const sites: SiteInfoWithVirtualFolder[] = [ + mockSiteInfo, + { name: 'test-site-two', hostName: 'localhost', language: 'da', virtualFolder: '' }, + ]; + + beforeEach(() => { + sitecoreClientStub = sandbox.createStubInstance(SitecoreClient); + unstableCacheStub = sandbox.stub().callsFake((fn) => fn); + robotsRouteHandlerModule = proxyquire('./robots-route-handler', { + 'next/cache': { unstable_cache: unstableCacheStub }, + }); + + OriginalResponse = (globalThis as any).Response; + (globalThis as any).Response = sinon.stub().callsFake((body, options) => { + return { + headers: options?.headers, + status: options?.status, + body, + }; + }); + + handler = robotsRouteHandlerModule.createRobotsRouteHandler({ + client: sitecoreClientStub, + sites, + }); + + req = { + headers: new Headers({ + host: 'example.com', + }), + }; + }); + + afterEach(() => { + sandbox.restore(); + sinon.restore(); + (globalThis as any).Response = OriginalResponse; + }); + + it('should set the content type header to text/plain', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.headers['Content-Type']).to.equal('text/plain'); + }); + + it('should call getRobots with the correct siteName', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('test-site'); + }); + + it('should return 200 with robots content', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.status).to.equal(200); + expect(res.body).to.equal('User-agent: *\nDisallow: /'); + }); + + it('should return 404 if getRobots returns null', async () => { + sitecoreClientStub.getRobots.resolves(undefined); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.status).to.equal(404); + expect(res.body).to.equal('User-agent: *\nDisallow: /'); + }); + + it('should return 500 if getRobots throws an error', async () => { + sitecoreClientStub.getRobots.rejects(new Error('Unexpected failure')); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.status).to.equal(500); + expect(res.body).to.equal('Internal Server Error'); + }); + + it('should use "localhost" as fallback when host header is missing', async () => { + const req = { headers: new Headers() }; + + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('test-site-two'); + expect(res.status).to.equal(200); + expect(res.body).to.equal('User-agent: *\nDisallow: /'); + }); + + it('should use x-forwarded-host header when present', async () => { + const req = { + headers: new Headers({ + 'x-forwarded-host': 'example.com', + host: 'localhost:3000', + }), + }; + + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('test-site'); + }); + + it('should cache the response for default revalidate time', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(unstableCacheStub.callCount).to.equal(1); + expect(unstableCacheStub.args[0][2].revalidate).to.equal(60); + + expect(res.status).to.equal(200); + expect(res.body).to.equal('User-agent: *\nDisallow: /'); + }); + + it('should cache the response for custom revalidate time', async () => { + unstableCacheStub.resetHistory(); + + const handler = robotsRouteHandlerModule.createRobotsRouteHandler({ + client: sitecoreClientStub, + sites, + revalidate: 10, + }); + + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(unstableCacheStub.callCount).to.equal(1); + expect(unstableCacheStub.args[0][2].revalidate).to.equal(10); + + expect(res.status).to.equal(200); + expect(res.body).to.equal('User-agent: *\nDisallow: /'); + }); + + describe('virtualFolder route context', () => { + const multiFolderSites: SiteInfoWithVirtualFolder[] = [ + { name: 'blog-site', hostName: 'example.com', language: 'en', virtualFolder: '/blog' }, + { name: 'store-site', hostName: 'example.com', language: 'en', virtualFolder: '/store' }, + ]; + + let folderHandler: ReturnType; + + beforeEach(() => { + folderHandler = robotsRouteHandlerModule.createRobotsRouteHandler({ + client: sitecoreClientStub, + sites: multiFolderSites, + }); + }); + + it('calls getRobots for blog-site when virtualFolder param matches that path segment', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'blog' }), + }); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('blog-site'); + }); + + it('calls getRobots for store-site when virtualFolder param matches that path segment', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'store' }), + }); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('store-site'); + }); + + it('does not filter sites when virtualFolder param is empty; host resolution uses full list', async () => { + sitecoreClientStub.getRobots.resolves('User-agent: *\nDisallow: /'); + + await folderHandler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getRobots).to.have.been.calledWith('blog-site'); + }); + + it('returns 500 when virtualFolder param matches no site virtualFolder', async () => { + const res = await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'no-such-folder' }), + }); + + expect(sitecoreClientStub.getRobots.called).to.be.false; + expect(res.status).to.equal(500); + expect(res.body).to.equal('Internal Server Error'); + }); + }); +}); diff --git a/packages/nextjs/src/route-handler/robots-route-handler.ts b/packages/nextjs/src/route-handler/robots-route-handler.ts new file mode 100644 index 0000000..6b42985 --- /dev/null +++ b/packages/nextjs/src/route-handler/robots-route-handler.ts @@ -0,0 +1,107 @@ +import { SitecoreClient } from '@sitecore-content-sdk/content/client'; +import { SiteResolver } from '@sitecore-content-sdk/content/site'; +import { NextRequest } from 'next/server'; +import { unstable_cache } from 'next/cache'; +import debug from '../debug'; +import { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; + +type RouteHandlerOptions = { + /** + * Sitecore client instance. + */ + client: SitecoreClient; + /** + * Sites configuration for resolving the site by host. + */ + sites: SiteInfoWithVirtualFolder[]; + /** + * The number of seconds after which the cache should be revalidated. + * Pass false to cache indefinitely. + * Default is 60 seconds. + */ + revalidate?: number | false; +}; + +/** + * Creates a route handler to serve the robots.txt file. + * @param {RouteHandlerOptions} options - The options for the route handler. + * @returns The route handler object with GET method. + * @public + */ +export const createRobotsRouteHandler = (options: RouteHandlerOptions) => { + const { client, sites, revalidate = 60 } = options; + + const getRobots = unstable_cache( + async (site: string) => { + return client.getRobots(site); + }, + ['robots'], + { + revalidate, + tags: ['robots'], + } + ); + + const GET = async (req: NextRequest, params: { params: Promise<{ virtualFolder: string }> }) => { + try { + const { virtualFolder } = await params.params; + let filteredSites = sites; + if (virtualFolder) { + filteredSites = sites.filter((site) => site.virtualFolder.includes(virtualFolder)); + } + const siteResolver = new SiteResolver(filteredSites); + const hostName = + req.headers.get('x-forwarded-host') || + req.headers.get('host')?.split(':')[0] || + 'localhost'; + const site = siteResolver.getByHost(hostName); + + // Access request data first, then capture timestamp for Next.js 16 compatibility + const startTimestamp = Date.now(); + + debug.robots('robots route handler start: %o', { + hostName, + siteName: site.name, + }); + + const robotsContent = await getRobots(site.name); + + if (!robotsContent) { + debug.robots('robots route handler end in %dms', Date.now() - startTimestamp); + + return new Response('User-agent: *\nDisallow: /', { + status: 404, + headers: { + 'Content-Type': 'text/plain', + }, + }); + } + + debug.robots('robots route handler end in %dms', Date.now() - startTimestamp); + + return new Response(robotsContent, { + status: 200, + headers: { + 'Content-Type': 'text/plain', + }, + }); + } catch (error) { + // Re-throw prerender bail-out errors so Next.js can handle them properly + if ( + error instanceof Error && + (error as { digest?: string }).digest === 'NEXT_PRERENDER_INTERRUPTED' + ) { + throw error; + } + + console.log('Robots route handler failed:'); + console.log(error); + + return new Response('Internal Server Error', { + status: 500, + }); + } + }; + + return { GET }; +}; diff --git a/packages/nextjs/src/route-handler/sitemap-route-handler.test.ts b/packages/nextjs/src/route-handler/sitemap-route-handler.test.ts new file mode 100644 index 0000000..bd1efc9 --- /dev/null +++ b/packages/nextjs/src/route-handler/sitemap-route-handler.test.ts @@ -0,0 +1,294 @@ +/* eslint-disable no-unused-expressions, @typescript-eslint/no-unused-expressions */ +import chai, { expect } from 'chai'; +import sinon from 'sinon'; +import sinonChai from 'sinon-chai'; +import { NextRequest } from 'next/server'; +import proxyquire from 'proxyquire'; +import { SitecoreClient } from '@sitecore-content-sdk/content/client'; +import { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; + +chai.use(sinonChai); + +describe('createSitemapRouteHandler', () => { + const sandbox = sinon.createSandbox(); + let sitecoreClientStub: sinon.SinonStubbedInstance; + let sitemapRouteHandlerModule: any; + let unstableCacheStub: sinon.SinonStub; + let handler: any; + let req: Partial; + + let OriginalResponse: typeof Response; + + const emptyVirtualFolderContext = { params: Promise.resolve({ virtualFolder: '' }) }; + + const sites: SiteInfoWithVirtualFolder[] = [ + { name: 'test-site', hostName: 'example.com', language: 'en', virtualFolder: '' }, + { name: 'test-site-two', hostName: '*', language: 'da', virtualFolder: '' }, + ]; + + beforeEach(() => { + sitecoreClientStub = sandbox.createStubInstance(SitecoreClient); + unstableCacheStub = sandbox.stub().callsFake((fn) => fn); + + sitemapRouteHandlerModule = proxyquire('./sitemap-route-handler', { + 'next/cache': { unstable_cache: unstableCacheStub }, + }); + + OriginalResponse = (globalThis as any).Response; + + (globalThis as any).Response = sinon.stub().callsFake((body, options) => { + return { + headers: options?.headers, + status: options?.status, + body, + }; + }); + + req = { + headers: new Headers({ + host: 'example.com', + 'x-forwarded-proto': 'https', + }), + nextUrl: { + pathname: '/sitemap.xml', + } as any, + } as NextRequest; + + handler = sitemapRouteHandlerModule.createSitemapRouteHandler({ + client: sitecoreClientStub as unknown as SitecoreClient, + sites, + }); + }); + + afterEach(() => { + sandbox.restore(); + sinon.restore(); + (globalThis as any).Response = OriginalResponse; + }); + + describe('handler', () => { + it('should process sitemap request without id parameter', async () => { + const siteName = sites[0].name; + const xmlContent = '...'; + + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap.calledOnce).to.be.true; + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: 'example.com', + reqProtocol: 'https', + id: '', + siteName: siteName, + }); + + expect(res.headers).to.deep.equal({ + 'Content-Type': 'text/xml;charset=utf-8', + }); + expect(res.body).to.equal(xmlContent); + }); + + it('should handle sitemap request with specific id parameter', async () => { + const sitemapId = '1'; + req.nextUrl!.pathname = `/sitemap-${sitemapId}.xml`; + const siteName = sites[0].name; + const xmlContent = '...'; + + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: 'example.com', + reqProtocol: 'https', + id: sitemapId, + siteName: siteName, + }); + expect(res.body).to.equal(xmlContent); + }); + + it('should default to https protocol when x-forwarded-proto header is missing', async () => { + const reqWithoutProto = { + ...req, + headers: new Headers({ + host: 'example.com', + }), + }; + const siteName = sites[0].name; + const xmlContent = '...'; + + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + const res = await handler.GET(reqWithoutProto as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: 'example.com', + reqProtocol: 'https', + siteName: siteName, + }); + expect(res.body).to.equal(xmlContent); + }); + + it('should use x-forwarded-host header when present', async () => { + const reqWithForwardedHost = { + ...req, + headers: new Headers({ + 'x-forwarded-host': 'example.com', + host: 'localhost:3000', + }), + }; + const siteName = sites[0].name; + + await handler.GET(reqWithForwardedHost as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap).to.have.been.calledWithMatch({ + reqHost: 'example.com', + reqProtocol: 'https', + siteName: siteName, + }); + }); + + describe('virtualFolder route context', () => { + const multiFolderSites: SiteInfoWithVirtualFolder[] = [ + { name: 'blog-site', hostName: 'example.com', language: 'en', virtualFolder: '/blog' }, + { name: 'store-site', hostName: 'example.com', language: 'en', virtualFolder: '/store' }, + ]; + + let folderHandler: ReturnType< + typeof sitemapRouteHandlerModule.createSitemapRouteHandler + >; + + beforeEach(() => { + folderHandler = sitemapRouteHandlerModule.createSitemapRouteHandler({ + client: sitecoreClientStub as unknown as SitecoreClient, + sites: multiFolderSites, + }); + }); + + it('resolves blog-site when virtualFolder param matches that path segment', async () => { + const xmlContent = '...'; + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + const res = await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'blog' }), + }); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: 'example.com', + reqProtocol: 'https', + id: '', + siteName: 'blog-site', + }); + expect(res.body).to.equal(xmlContent); + }); + + it('resolves store-site when virtualFolder param matches that path segment', async () => { + const xmlContent = '...'; + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'store' }), + }); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: 'example.com', + reqProtocol: 'https', + siteName: 'store-site', + }); + }); + + it('does not filter sites when virtualFolder param is empty; host resolution uses full list', async () => { + const xmlContent = '...'; + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + await folderHandler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0].siteName).to.equal('blog-site'); + }); + + it('returns 500 when virtualFolder param matches no site virtualFolder', async () => { + sitecoreClientStub.getSiteMap.resolves(''); + + const res = await folderHandler.GET(req as NextRequest, { + params: Promise.resolve({ virtualFolder: 'no-such-folder' }), + }); + + expect(sitecoreClientStub.getSiteMap.called).to.be.false; + expect(res.status).to.equal(500); + expect(res.body).to.equal('Internal Server Error'); + }); + }); + + it('should use empty string when both x-forwarded-host and host headers are missing', async () => { + const reqWithoutHeaders = { + ...req, + headers: new Headers({ + 'x-forwarded-proto': 'https', + }), + nextUrl: { + pathname: '/sitemap.xml', + } as any, + }; + const xmlContent = '...'; + + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + const res = await handler.GET(reqWithoutHeaders as NextRequest, emptyVirtualFolderContext); + + expect(sitecoreClientStub.getSiteMap.firstCall.args[0]).to.deep.include({ + reqHost: '', + reqProtocol: 'https', + }); + expect(res.body).to.equal(xmlContent); + }); + + it('should cache the response for default revalidate time', async () => { + const xmlContent = '...'; + + sitecoreClientStub.getSiteMap.resolves(xmlContent); + + await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(unstableCacheStub.callCount).to.equal(1); + expect(unstableCacheStub.args[0][2].revalidate).to.equal(60); + }); + + it('should cache the response for custom revalidate time', async () => { + unstableCacheStub.resetHistory(); + + const handler = sitemapRouteHandlerModule.createSitemapRouteHandler({ + client: sitecoreClientStub, + sites, + revalidate: 10, + }); + + await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(unstableCacheStub.callCount).to.equal(1); + expect(unstableCacheStub.args[0][2].revalidate).to.equal(10); + }); + + it('should redirect to 404 when REDIRECT_404 error is thrown', async () => { + const error = new Error('REDIRECT_404'); + + sitecoreClientStub.getSiteMap.rejects(error); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.status).to.equal(404); + expect(res.body).to.equal('Not Found'); + }); + + it('should return 500 error when any other error occurs', async () => { + const error = new Error('Unexpected error'); + + sitecoreClientStub.getSiteMap.rejects(error); + + const res = await handler.GET(req as NextRequest, emptyVirtualFolderContext); + + expect(res.status).to.equal(500); + expect(res.body).to.equal('Internal Server Error'); + }); + }); +}); diff --git a/packages/nextjs/src/route-handler/sitemap-route-handler.ts b/packages/nextjs/src/route-handler/sitemap-route-handler.ts new file mode 100644 index 0000000..8a06fb0 --- /dev/null +++ b/packages/nextjs/src/route-handler/sitemap-route-handler.ts @@ -0,0 +1,101 @@ +import { SitecoreClient, SitemapXmlOptions } from '@sitecore-content-sdk/content/client'; +import { SiteResolver } from '@sitecore-content-sdk/content/site'; +import { NextRequest } from 'next/server'; +import { unstable_cache } from 'next/cache'; +import debug from '../debug'; +import { SiteInfoWithVirtualFolder } from '@constellation4sitecore-content-sdk/content/site'; + +type RouteHandlerOptions = { + /** + * Sitecore client instance. + */ + client: SitecoreClient; + /** + * Sites configuration for resolving the site by host. + */ + sites: SiteInfoWithVirtualFolder[]; + /** + * The number of seconds after which the cache should be revalidated. + * Pass false to cache indefinitely. + * Default is 60 seconds. + */ + revalidate?: number | false; +}; + +/** + * Creates a route handler to serve the sitemap.xml file. + * @param {RouteHandlerOptions} options - The options for the route handler. + * @returns The route handler. + * @public + */ +export function createSitemapRouteHandler(options: RouteHandlerOptions) { + const { client, sites, revalidate = 60 } = options; + + const getOptions = (req: NextRequest, virtualFolder: string): SitemapXmlOptions => { + let filteredSites = sites; + if (virtualFolder) { + filteredSites = sites.filter((site) => site.virtualFolder.includes(virtualFolder)); + } + const siteResolver = new SiteResolver(filteredSites); + const id = req.nextUrl.pathname.match(/^\/sitemap-(\d+)\.xml$/i)?.[1] || ''; + const reqHost = req.headers.get('x-forwarded-host') || req.headers.get('host') || ''; + const reqProtocol = req.headers.get('x-forwarded-proto') || 'https'; + const site = siteResolver.getByHost(reqHost); + + return { reqHost, reqProtocol, id, siteName: site.name }; + }; + + const getSitemap = unstable_cache( + async (options: SitemapXmlOptions) => { + return client.getSiteMap(options); + }, + ['sitemap'], + { + revalidate, + tags: ['sitemap'], + } + ); + + const GET = async (req: NextRequest, params: { params: Promise<{ virtualFolder: string }> }) => { + try { + const { virtualFolder } = await params.params; + const options = getOptions(req, virtualFolder); + + // Access request data first, then capture timestamp for Next.js 16 compatibility + const startTimestamp = Date.now(); + + debug.sitemap('sitemap route handler start: %o', { + options, + }); + + const xml = await getSitemap(options); + + debug.sitemap('sitemap route handler end in %dms', Date.now() - startTimestamp); + + return new Response(xml, { + headers: { + 'Content-Type': 'text/xml;charset=utf-8', + }, + }); + } catch (error) { + // Re-throw prerender bail-out errors so Next.js can handle them properly + if ( + error instanceof Error && + (error as { digest?: string }).digest === 'NEXT_PRERENDER_INTERRUPTED' + ) { + throw error; + } + + console.log('Sitemap route handler failed:'); + console.log(error); + + if (error instanceof Error && error.message === 'REDIRECT_404') { + return new Response('Not Found', { status: 404 }); + } else { + return new Response('Internal Server Error', { status: 500 }); + } + } + }; + + return { GET }; +} diff --git a/packages/nextjs/tools.d.ts b/packages/nextjs/tools.d.ts new file mode 100644 index 0000000..2f84154 --- /dev/null +++ b/packages/nextjs/tools.d.ts @@ -0,0 +1 @@ +export * from './types/tools/index'; diff --git a/packages/nextjs/tsconfig.json b/packages/nextjs/tsconfig.json index 559f143..3475d3d 100644 --- a/packages/nextjs/tsconfig.json +++ b/packages/nextjs/tsconfig.json @@ -20,9 +20,9 @@ "debugger.js", "graphql.d.ts", "graphql.js", - "middleware.d.ts", - "middleware.js", "proxy.d.ts", + "route-handler.d.ts", + "tools.d.ts", "src/tests/*", "src/test-data/*", "**/*.test.ts", From bbcfb3f9f43697674048b5d0edddd12b80497188 Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 19:24:15 -0500 Subject: [PATCH 17/18] Update changelogs --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 346d14c..9792f10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,28 @@ New `defineConfig` function (`@constellation4sitecore-content-sdk/nextjs/config` `generateVirtualFolders` is re-exported from `@constellation4sitecore-content-sdk/nextjs/tools` for convenience. +#### `nextjs`: Route handlers for robots.txt and sitemap.xml + +New `@constellation4sitecore-content-sdk/nextjs/route-handler` subpath with: + +- **`createRobotsRouteHandler`** — Factory that returns a Next.js App Router `GET` handler serving `robots.txt` per site, with `unstable_cache` revalidation (default 60s) and per-site resolution by host / virtual folder. +- **`createSitemapRouteHandler`** — Factory that returns a Next.js App Router `GET` handler serving `sitemap.xml` (and numbered sitemap segments like `/sitemap-1.xml`) per site, with the same caching and site-resolution behavior. + +Both handlers accept a `SitecoreClient`, a `sites` list (`SiteInfoWithVirtualFolder[]`), and an optional `revalidate` value (`number | false`, default `60`). + +#### Package `exports` fields + +The `nextjs` and `content` packages now declare `exports` fields in `package.json` covering every public subpath. This gives consumers strict, explicit module resolution and enables bundlers/TypeScript to discover types via a single source of truth. + +Declared subpaths: + +| Package | Subpaths | +|---|---| +| `@constellation4sitecore-content-sdk/nextjs` | `.`, `./config`, `./proxy`, `./tools`, `./route-handler`, `./debugger`, `./graphql` | +| `@constellation4sitecore-content-sdk/content` | `.`, `./config`, `./site`, `./node-tools` | + +> Note: because `exports` is exhaustive, any subpath not listed above is no longer importable. If you were relying on an undocumented internal path, switch to one of the declared entries. + ## [1.1.1] - 2025 ### Features From 28be65a2eb0964c449216217c77723b12631126a Mon Sep 17 00:00:00 2001 From: Roberto Armas Date: Sat, 11 Apr 2026 19:24:57 -0500 Subject: [PATCH 18/18] version v2.0.0-beta.6 [skip ci] --- lerna.json | 2 +- packages/content/package.json | 2 +- packages/data/package.json | 6 +++--- packages/enhancers/package.json | 2 +- packages/labels/package.json | 6 +++--- packages/mapper/package.json | 2 +- packages/navigation/package.json | 4 ++-- packages/nextjs/package.json | 4 ++-- packages/page-analytics-scripts/package.json | 8 ++++---- packages/page-tagging/package.json | 8 ++++---- packages/security/package.json | 4 ++-- packages/url-friendly-page-names/package.json | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lerna.json b/lerna.json index 2603f37..70a2d78 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "lerna": "3.22.1", "useWorkspaces": true, - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "npmClient": "yarn", "packages": ["packages/*"] } diff --git a/packages/content/package.json b/packages/content/package.json index 04c0453..1ae3d91 100644 --- a/packages/content/package.json +++ b/packages/content/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/content", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/data/package.json b/packages/data/package.json index b10f331..d5f1e65 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/data", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,8 +41,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.6" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/enhancers/package.json b/packages/enhancers/package.json index bdb6107..ad11c29 100644 --- a/packages/enhancers/package.json +++ b/packages/enhancers/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/enhancers", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/labels/package.json b/packages/labels/package.json index 2e4df02..86fd654 100644 --- a/packages/labels/package.json +++ b/packages/labels/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/labels", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -39,8 +39,8 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.6" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/mapper/package.json b/packages/mapper/package.json index cd5b028..23cb38d 100644 --- a/packages/mapper/package.json +++ b/packages/mapper/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/mapper", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/navigation/package.json b/packages/navigation/package.json index 8005a4a..dbb5da7 100644 --- a/packages/navigation/package.json +++ b/packages/navigation/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/navigation", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -38,7 +38,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.6" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 279c94a..40a51a8 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/nextjs", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -52,7 +52,7 @@ "typescript": "~5.8.3" }, "dependencies": { - "@constellation4sitecore-content-sdk/content": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/content": "2.0.0-beta.6" }, "peerDependencies": { "@sitecore-content-sdk/nextjs": "^2.0.0" diff --git a/packages/page-analytics-scripts/package.json b/packages/page-analytics-scripts/package.json index d77f8c1..7f753d0 100644 --- a/packages/page-analytics-scripts/package.json +++ b/packages/page-analytics-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-analytics-scripts", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/data": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/data": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.6" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/page-tagging/package.json b/packages/page-tagging/package.json index 957e742..8551dd8 100644 --- a/packages/page-tagging/package.json +++ b/packages/page-tagging/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/page-tagging", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -40,9 +40,9 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.5", - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5" + "@constellation4sitecore-content-sdk/enhancers": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/mapper": "2.0.0-beta.6", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.6" }, "types": "types/index.d.ts", "files": [ diff --git a/packages/security/package.json b/packages/security/package.json index 322a05f..b82609d 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/security", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -24,7 +24,7 @@ "react-dom": "^19.2.1" }, "dependencies": { - "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.5", + "@constellation4sitecore-content-sdk/nextjs": "2.0.0-beta.6", "graphql-tag": "^2.12.6", "memory-cache": "^0.2.0" }, diff --git a/packages/url-friendly-page-names/package.json b/packages/url-friendly-page-names/package.json index b407676..b56c9b4 100644 --- a/packages/url-friendly-page-names/package.json +++ b/packages/url-friendly-page-names/package.json @@ -1,6 +1,6 @@ { "name": "@constellation4sitecore-content-sdk/url-friendly-page-names", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.6", "description": "A collection of XM Cloud compatible libraries for SXA Sitecore Development.", "author": "Richard J. Cabral, Roberto Armas, Sebastian Aliaga", "license": "MIT",