Skip to content

Commit

Permalink
Merge pull request sitecorelabs#168 from sitecorelabs/jss/release-22.0.0
Browse files Browse the repository at this point in the history
[JSS] Updated sxastarter to v22.0.0
  • Loading branch information
addy-pathania authored Apr 29, 2024
2 parents cd51f56 + da95f24 commit 4acf1e7
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 290 deletions.
2 changes: 1 addition & 1 deletion src/sxastarter/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sitecore JSS Next.js Sample Application

[Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-next-js.html)
[Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-next-js.html)

[Documentation (XM Cloud)](https://doc.sitecore.com/xmc/en/developers/xm-cloud/sitecore-javascript-rendering-sdk--jss--for-next-js.html)
523 changes: 250 additions & 273 deletions src/sxastarter/package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/sxastarter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sxastarter",
"description": "Application utilizing Sitecore JavaScript Services and Next.js",
"version": "21.7.1",
"version": "22.0.0",
"private": true,
"config": {
"appName": "sxastarter",
Expand Down Expand Up @@ -31,9 +31,9 @@
},
"license": "Apache-2.0",
"dependencies": {
"@sitecore-cloudsdk/events": "^0.2.4",
"@sitecore-cloudsdk/events": "^0.3.0",
"@sitecore-feaas/clientside": "^0.5.17",
"@sitecore-jss/sitecore-jss-nextjs": "~21.7.1",
"@sitecore-jss/sitecore-jss-nextjs": "~22.0.0",
"@sitecore/components": "^1.1.10",
"bootstrap": "^5.1.3",
"font-awesome": "^4.7.0",
Expand All @@ -55,8 +55,8 @@
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-resolvers": "^4.0.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@sitecore-jss/sitecore-jss-cli": "~21.7.1",
"@sitecore-jss/sitecore-jss-dev-tools": "~21.7.1",
"@sitecore-jss/sitecore-jss-cli": "~22.0.0",
"@sitecore-jss/sitecore-jss-dev-tools": "~22.0.0",
"@types/node": "^18.11.18",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.0.5",
Expand Down
2 changes: 0 additions & 2 deletions src/sxastarter/scripts/config/plugins/multisite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class MultisitePlugin implements ConfigPlugin {
try {
const siteInfoService = new GraphQLSiteInfoService({
clientFactory: createGraphQLClientFactory(config),
// enable site query for the service. Only works on XMCloud currently
useSiteQuery: true,
});
sites = await siteInfoService.fetchSiteInfo();
} catch (error) {
Expand Down
5 changes: 1 addition & 4 deletions src/sxastarter/scripts/generate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ import { jssConfigFactory } from './config';
Generates the /src/temp/config.js file which contains runtime configuration
that the app can import and use.
*/
// JSS_APP_NAME env variable has been deprecated since v.21.6, SITECORE_SITE_NAME should be used instead
const defaultConfig: JssConfig = {
sitecoreApiKey: process.env[`${constantCase('sitecoreApiKey')}`],
sitecoreApiHost: process.env[`${constantCase('sitecoreApiHost')}`],
sitecoreSiteName:
process.env[`${constantCase('sitecoreSiteName')}`] ||
process.env[`${constantCase('jssAppName')}`],
sitecoreSiteName: process.env[`${constantCase('sitecoreSiteName')}`],
graphQLEndpointPath: process.env[`${constantCase('graphQLEndpointPath')}`],
defaultLanguage: process.env[`${constantCase('defaultLanguage')}`],
graphQLEndpoint: process.env[`${constantCase('graphQLEndpoint')}`],
Expand Down
5 changes: 2 additions & 3 deletions src/sxastarter/src/pages/api/robots.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { GraphQLRobotsService } from '@sitecore-jss/sitecore-jss-nextjs';
import { siteResolver } from 'lib/site-resolver';
import config from 'temp/config';
import clientFactory from 'lib/graphql-client-factory';

const robotsApi = async (req: NextApiRequest, res: NextApiResponse): Promise<void> => {
res.setHeader('Content-Type', 'text/plain');
Expand All @@ -12,8 +12,7 @@ const robotsApi = async (req: NextApiRequest, res: NextApiResponse): Promise<voi

// create robots graphql service
const robotsService = new GraphQLRobotsService({
endpoint: config.graphQLEndpoint,
apiKey: config.sitecoreApiKey,
clientFactory,
siteName: site.name,
});

Expand Down
4 changes: 2 additions & 2 deletions src/sxastarter/src/pages/api/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '@sitecore-jss/sitecore-jss-nextjs';
import { siteResolver } from 'lib/site-resolver';
import config from 'temp/config';
import clientFactory from 'lib/graphql-client-factory';

const ABSOLUTE_URL_REGEXP = '^(?:[a-z]+:)?//';

Expand All @@ -23,8 +24,7 @@ const sitemapApi = async (

// create sitemap graphql service
const sitemapXmlService = new GraphQLSitemapXmlService({
endpoint: config.graphQLEndpoint,
apiKey: config.sitecoreApiKey,
clientFactory,
siteName: site.name,
});

Expand Down

0 comments on commit 4acf1e7

Please sign in to comment.