Skip to content

Commit f2a82b5

Browse files
authored
Updated SUGCON sites to Content-SDK v2 (#585)
* Updated SUGCON sites to Content-SDK v2 * Copilot PR Review changes * Fixed incorrect node version for GH Action * Fixed linting config errors after version upgrade
1 parent faa9137 commit f2a82b5

17 files changed

Lines changed: 921 additions & 850 deletions

File tree

.github/workflows/build_NextJs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v3
2626
- uses: actions/setup-node@v3
2727
with:
28-
node-version: 22.11.0
28+
node-version: 24
2929
- run: npm install
3030
- run: npm run build
3131
- run: npm run lint

headapps/Sugcon2024/.env.remote.example

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,22 @@ SITECORE_EDGE_CONTEXT_ID=
1919
# Will be used as a fallback if separate SITECORE_EDGE_CONTEXT_ID value is not provided
2020
NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID=
2121

22+
# Optional: custom Sitecore Edge Platform hostname (hostname or full URL).
23+
NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME=
24+
25+
# Optional: custom Experience Edge hostname for media URL rewriting (e.g. staging).
26+
SITECORE_EXPERIENCE_EDGE_HOSTNAME=
27+
2228
# An optional Sitecore Personalize scope identifier.
2329
# This can be used to isolate personalization data when multiple XM Cloud Environments share a Personalize tenant.
2430
# This should match the PAGES_PERSONALIZE_SCOPE environment variable for your connected XM Cloud Environment.
2531
NEXT_PUBLIC_PERSONALIZE_SCOPE=
2632

2733
# Timeout (ms) for Sitecore CDP requests to respond within. Default is 400.
28-
PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT=
34+
PERSONALIZE_PROXY_CDP_TIMEOUT=
2935

3036
# Timeout (ms) for Sitecore Experience Edge requests to respond within. Default is 400.
31-
PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT=
37+
PERSONALIZE_PROXY_EDGE_TIMEOUT=
3238

3339
# Sitecore Content SDK npm packages utilize the debug module for debug logging.
3440
# https://www.npmjs.com/package/debug
@@ -42,3 +48,4 @@ PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT=
4248
# Client ID and Secret used for Design Library functionality
4349
SITECORE_AUTH_CLIENT_ID=
4450
SITECORE_AUTH_CLIENT_SECRET=
51+
SITECORE_RENDERINGHOST_NAME=

headapps/Sugcon2024/.sitecore/component-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import * as ActionBanner from 'src/components/basic-components/action-banner/Act
4949
export const componentMap = new Map<string, NextjsContentSdkComponent>([
5050
['BYOCWrapper', BYOCServerWrapper],
5151
['FEaaSWrapper', FEaaSServerWrapper],
52-
['Form', Form],
52+
['Form', { ...Form, componentType: 'client' }],
5353
['LayoutConstants', { ...LayoutConstants }],
5454
['Navigation', { ...Navigation, componentType: 'client' }],
5555
['Header', { ...Header }],
Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
4-
5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
7-
8-
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
});
1+
import nextPlugin from "@next/eslint-plugin-next";
2+
import reactPlugin from "eslint-plugin-react";
3+
import hooksPlugin from "eslint-plugin-react-hooks";
4+
import importPlugin from "eslint-plugin-import";
5+
import tseslint from "typescript-eslint";
116

127
const eslintConfig = [
13-
...compat.extends("next/core-web-vitals", "next/typescript"),
14-
{
15-
rules: {
16-
// Don't force alt for <Image/> (sourced from Sitecore media)
17-
"jsx-a11y/alt-text": "off",
18-
},
8+
{
199
ignores: [
2010
"node_modules/**",
2111
".next/**",
@@ -24,6 +14,31 @@ const eslintConfig = [
2414
"next-env.d.ts",
2515
],
2616
},
17+
...tseslint.configs.recommended,
18+
{
19+
files: ["**/*.{ts,tsx,js,jsx}"],
20+
plugins: {
21+
"@next/next": nextPlugin,
22+
"react": reactPlugin,
23+
"react-hooks": hooksPlugin,
24+
"import": importPlugin,
25+
},
26+
rules: {
27+
...nextPlugin.configs.recommended.rules,
28+
...nextPlugin.configs["core-web-vitals"].rules,
29+
...reactPlugin.configs.recommended.rules,
30+
...hooksPlugin.configs.recommended.rules,
31+
// Don't force alt for <Image/> (sourced from Sitecore media)
32+
"jsx-a11y/alt-text": "off",
33+
// React 17+ doesn't require importing React
34+
"react/react-in-jsx-scope": "off",
35+
},
36+
settings: {
37+
react: {
38+
version: "detect",
39+
},
40+
},
41+
},
2742
];
2843

2944
export default eslintConfig;

headapps/Sugcon2024/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)