Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nextjs] CloudSDK Integration #1652

Merged
merged 43 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
31adef9
Initial commit
illiakovalenko Nov 2, 2023
a4a9a56
Merge branch 'dev' of https://github.com/Sitecore/jss into feature/JS…
illiakovalenko Nov 2, 2023
6fe1dcf
Handle async Events init call
illiakovalenko Nov 2, 2023
8672755
Update
illiakovalenko Nov 3, 2023
890922a
Update
illiakovalenko Nov 3, 2023
f6bc981
Updated test
illiakovalenko Nov 3, 2023
0fe146c
rename nextjs-personalize -> nextjs-xmcloud. move feaas and BYOC here.
ambrauer Nov 3, 2023
a2dfa99
Move Sitecore Edge Platform / conext related items to nextjs-xmcloud
ambrauer Nov 3, 2023
4cbe740
Updated context initialization
illiakovalenko Nov 6, 2023
3d64d0a
Updated dependency
illiakovalenko Nov 6, 2023
657b08e
Updated Yarn.lock
illiakovalenko Nov 6, 2023
ee929de
Merge branch 'dev' of https://github.com/Sitecore/jss into feature/JS…
illiakovalenko Nov 6, 2023
244fa5b
Fix lint errors
illiakovalenko Nov 6, 2023
2c95fd0
Updated CHANGELOG
illiakovalenko Nov 6, 2023
2df0a00
Repurpose nextjs-personalize -> nextjs-xmcloud initializer "system" t…
ambrauer Nov 6, 2023
1e8f7b4
Moved skipping of site information fetch on XM Cloud to base package …
ambrauer Nov 6, 2023
bf35161
CHANGELOG update
ambrauer Nov 6, 2023
b79b198
Updated Context implementation, added unit tests
illiakovalenko Nov 7, 2023
22deb3e
Updated CHANGELOG
illiakovalenko Nov 7, 2023
6349af7
Updated comment
illiakovalenko Nov 7, 2023
49af700
Updated cloudsdk to use latest production version
illiakovalenko Nov 7, 2023
9e8d7f5
Updated yarn.lock
illiakovalenko Nov 7, 2023
358dd37
Merge branch 'feature/JSS-1117-nextjs-xmcloud-template' of https://gi…
illiakovalenko Nov 7, 2023
40933f0
Introduced Bootstrap and pulled nextjs-xmcloud
illiakovalenko Nov 7, 2023
a013dc1
Merge branch 'dev' of https://github.com/Sitecore/jss into feature/JS…
illiakovalenko Nov 7, 2023
0e8e5f1
Update .env
illiakovalenko Nov 7, 2023
47a5c7d
Updated jsdoc
illiakovalenko Nov 7, 2023
e7ec8f8
Avoid unused vars rule for Bootstrap
illiakovalenko Nov 7, 2023
7769bfb
Normalize sitecoreEdgeUrl
illiakovalenko Nov 7, 2023
311c820
Updated CHANGELOG
illiakovalenko Nov 7, 2023
dc70eb7
Updated BYOC initialization
illiakovalenko Nov 7, 2023
e1bb785
Updated Props doc
illiakovalenko Nov 7, 2023
2d8633b
Updates
illiakovalenko Nov 8, 2023
924cb40
Updated unit test
illiakovalenko Nov 8, 2023
2ee000b
Updated comment
illiakovalenko Nov 8, 2023
4315eab
Provided sitecoreEdgeUrl to the middleware
illiakovalenko Nov 8, 2023
8503b16
Merge branch 'dev' of https://github.com/Sitecore/jss into feature/JS…
illiakovalenko Nov 8, 2023
5e60944
Refactoring
illiakovalenko Nov 8, 2023
d08ba22
Passing props to SDK's
illiakovalenko Nov 8, 2023
3712ea5
Updated type
illiakovalenko Nov 8, 2023
b2ef26e
Merge branch 'dev' of https://github.com/Sitecore/jss into feature/JS…
illiakovalenko Nov 8, 2023
defd3f3
Renamed SDKs -> sdks
illiakovalenko Nov 8, 2023
72c3c23
Updated yarn.lock
illiakovalenko Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated unit test
illiakovalenko committed Nov 8, 2023

Verified

This commit was signed with the committer’s verified signature.
bukka Jakub Zelenka
commit 924cb4088850d7cfa940778633c7ef96f01bc5f6
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import sinon, { spy } from 'sinon';
import nextjs, { NextRequest, NextResponse } from 'next/server';
import { debug } from '@sitecore-jss/sitecore-jss';
import { SiteResolver } from '@sitecore-jss/sitecore-jss/site';
import { ExperienceParams } from '@sitecore-jss/sitecore-jss/personalize';
import { PersonalizeMiddleware } from './personalize-middleware';

use(sinonChai);
@@ -33,17 +32,7 @@ describe('PersonalizeMiddleware', () => {
const variantIds = ['variant-1', 'variant-2'];
const contentId = `${id}_en_${version}`.toLowerCase();
const defaultLang = 'en';
const pointOfSale = 'cdp-pos';
const referrer = 'http://localhost:3000';
const experienceParams: ExperienceParams = {
referrer,
utm: {
campaign: 'utm_campaign',
content: null,
medium: null,
source: null,
},
};
const createRequest = (props: any = {}) => {
const req = {
...props,
@@ -164,8 +153,8 @@ describe('PersonalizeMiddleware', () => {
} = {}
) => {
const cdpConfig = {
clientKey: 'cdp-client-key',
endpoint: 'http://cdp-endpoint',
sitecoreEdgeContextId: '0000-0000-0000',
sitecoreEdgeUrl: 'https://foo.bar',
...(props?.cdpConfig || {}),
};
const edgeConfig = {
@@ -179,18 +168,12 @@ describe('PersonalizeMiddleware', () => {
name: siteName,
language: props.language || '',
hostName: hostname,
pointOfSale: {
[props.language || defaultLang]: pointOfSale,
},
}));

getByHost = sinon.stub().callsFake((hostName: string) => ({
name: siteName,
language: props.language || '',
hostName,
pointOfSale: {
[props.language || defaultLang]: pointOfSale,
},
}));
}