create-sitecore-jss 22.5.0-beta.1 → 22.5.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -183,8 +183,8 @@ const diffAndWriteFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ r
183
183
  exports.diffAndWriteFiles = diffAndWriteFiles;
184
184
  const populateEjsData = (answers, destination) => {
185
185
  // pass in helper to answers object
186
- // Don't expose prerelease build number in the generated app
187
- const jssVersion = version.replace(/(\.\d+)$/, '');
186
+ // Use exact version for jss dependencies in beta and canary versions
187
+ const jssVersion = version.match(/(\-[a-zA-Z]+\.\d+)$/) ? version : `~${version}`;
188
188
  const ejsData = Object.assign(Object.assign({}, answers), { version: jssVersion, helper: {
189
189
  isDev: (0, helpers_1.isDevEnvironment)(destination || answers.destination),
190
190
  getPascalCaseName: helpers_1.getPascalCaseName,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
5
5
  "config": {
6
6
  "appName": "<%- appName %>",
@@ -57,7 +57,7 @@
57
57
  "@apollo/client": "^3.3.12",
58
58
  "@ngx-translate/core": "~15.0.0",
59
59
  "@ngx-translate/http-loader": "~8.0.0",
60
- "@sitecore-jss/sitecore-jss-angular": "~<%- version %>",
60
+ "@sitecore-jss/sitecore-jss-angular": "<%- version %>",
61
61
  "apollo-angular": "~6.0.0",
62
62
  "bootstrap": "^5.3.3",
63
63
  "core-js": "~3.37.1",
@@ -79,9 +79,9 @@
79
79
  "@angular/cli": "~17.3.8",
80
80
  "@angular/compiler-cli": "~17.3.11",
81
81
  "@angular/language-service": "~17.3.11",
82
- "@sitecore-jss/sitecore-jss-angular-schematics": "~<%- version %>",
83
- "@sitecore-jss/sitecore-jss-cli": "~<%- version %>",
84
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
82
+ "@sitecore-jss/sitecore-jss-angular-schematics": "<%- version %>",
83
+ "@sitecore-jss/sitecore-jss-cli": "<%- version %>",
84
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
85
85
  "@types/jasmine": "~3.6.7",
86
86
  "@types/jasminewd2": "~2.0.8",
87
87
  "@types/node": "~22.9.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
3
  "description": "Application utilizing Sitecore JavaScript Services and Next.js",
4
- "version": "<%- version %>",
4
+ "version": "0.1.0",
5
5
  "private": true,
6
6
  "config": {
7
7
  "appName": "<%- appName %>",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@sitecore-jss/sitecore-jss-nextjs": "~<%- version %>",
28
+ "@sitecore-jss/sitecore-jss-nextjs": "<%- version %>",
29
29
  "graphql": "~15.8.0",
30
30
  "graphql-tag": "^2.12.6",
31
31
  "next": "^14.2.18",
@@ -43,8 +43,8 @@
43
43
  "@graphql-codegen/typescript-operations": "^4.0.1",
44
44
  "@graphql-codegen/typescript-resolvers": "^4.0.1",
45
45
  "@graphql-typed-document-node/core": "^3.2.0",
46
- "@sitecore-jss/sitecore-jss-cli": "~<%- version %>",
47
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
46
+ "@sitecore-jss/sitecore-jss-cli": "<%- version %>",
47
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
48
48
  "@types/node": "^22.9.0",
49
49
  "@types/react": "^18.2.22",
50
50
  "@types/react-dom": "^18.0.5",
@@ -8,7 +8,7 @@ import {
8
8
  * Generates the component builder file.
9
9
  */
10
10
  class ComponentBuilderPlugin implements ComponentBuilderPluginType {
11
- order = 9999;
11
+ order = 99;
12
12
 
13
13
  exec(config: ComponentBuilderPluginConfig) {
14
14
  generateComponentBuilder(config);
@@ -4,7 +4,7 @@
4
4
  "nprogress": "~0.2.0"
5
5
  },
6
6
  "devDependencies": {
7
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
7
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
8
8
  "@types/nprogress": "^0.2.0"
9
9
  },
10
10
  "scripts": {
@@ -3,7 +3,16 @@
3
3
  */
4
4
  import React from 'react';
5
5
  import Head from 'next/head';
6
- import { Placeholder, LayoutServiceData, Field, HTMLLink } from '@sitecore-jss/sitecore-jss-nextjs';
6
+ import {
7
+ LayoutServiceData,
8
+ Field,
9
+ HTMLLink,
10
+ Placeholder,
11
+ <% if (templates.includes('nextjs-xmcloud')) { %>
12
+ DesignLibrary,
13
+ RenderingType,
14
+ <% } %>
15
+ } from '@sitecore-jss/sitecore-jss-nextjs';
7
16
  import config from 'temp/config';
8
17
  import Scripts from 'src/Scripts';
9
18
 
@@ -27,6 +36,26 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
27
36
  const isPageEditing = layoutData.sitecore.context.pageEditing;
28
37
  const mainClassPageEditing = isPageEditing ? 'editing-mode' : 'prod-mode';
29
38
 
39
+ const renderContent = () => (
40
+ <>
41
+ <header>
42
+ <div id="header">
43
+ {route && <Placeholder name="headless-header" rendering={route} />}
44
+ </div>
45
+ </header>
46
+ <main>
47
+ <div id="content">
48
+ {route && <Placeholder name="headless-main" rendering={route} />}
49
+ </div>
50
+ </main>
51
+ <footer>
52
+ <div id="footer">
53
+ {route && <Placeholder name="headless-footer" rendering={route} />}
54
+ </div>
55
+ </footer>
56
+ </>
57
+ );
58
+
30
59
  return (
31
60
  <>
32
61
  <Scripts />
@@ -40,18 +69,19 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
40
69
 
41
70
  {/* root placeholder for the app, which we add components to using route data */}
42
71
  <div className={mainClassPageEditing}>
43
- <header>
44
- <div id="header">{route && <Placeholder name="headless-header" rendering={route} />}</div>
45
- </header>
46
- <main>
47
- <div id="content">{route && <Placeholder name="headless-main" rendering={route} />}</div>
48
- </main>
49
- <footer>
50
- <div id="footer">{route && <Placeholder name="headless-footer" rendering={route} />}</div>
51
- </footer>
72
+ <% if (templates.includes('nextjs-xmcloud')) { %>
73
+ {layoutData.sitecore.context.renderingType === RenderingType.Component ? (
74
+ <DesignLibrary {...layoutData} />
75
+ ) : (
76
+ renderContent()
77
+ )}
78
+ <% } else { %>
79
+ {renderContent()}
80
+ <% } %>
52
81
  </div>
53
82
  </>
54
83
  );
55
84
  };
56
85
 
57
86
  export default Layout;
87
+
@@ -21,6 +21,14 @@ const Custom404 = (props: SitecorePageProps): JSX.Element => {
21
21
  <SitecoreContext
22
22
  componentFactory={componentBuilder.getComponentFactory()}
23
23
  layoutData={props.layoutData}
24
+ <% if (templates.includes('nextjs-xmcloud')) { %>
25
+ api={{
26
+ edge: {
27
+ contextId: config.sitecoreEdgeContextId,
28
+ edgeUrl: config.sitecoreEdgeUrl,
29
+ },
30
+ }}
31
+ <% } %>
24
32
  >
25
33
  <Layout layoutData={props.layoutData} headLinks={props.headLinks} />
26
34
  </SitecoreContext>
@@ -37,6 +37,14 @@ const Custom500 = (props: SitecorePageProps): JSX.Element => {
37
37
  <SitecoreContext
38
38
  componentFactory={componentBuilder.getComponentFactory()}
39
39
  layoutData={props.layoutData}
40
+ <% if (templates.includes('nextjs-xmcloud')) { %>
41
+ api={{
42
+ edge: {
43
+ contextId: config.sitecoreEdgeContextId,
44
+ edgeUrl: config.sitecoreEdgeUrl,
45
+ },
46
+ }}
47
+ <% } %>
40
48
  >
41
49
  <Layout layoutData={props.layoutData} headLinks={props.headLinks} />
42
50
  </SitecoreContext>
@@ -0,0 +1,16 @@
1
+ import { ComponentBuilderPlugin, ComponentBuilderPluginConfig } from '..';
2
+ import { extractComponents } from '@sitecore-jss/sitecore-jss-dev-tools';
3
+
4
+ /**
5
+ * If consented to, sends components code for code generation learning to XMC
6
+ */
7
+ class CodeExtractionPlugin implements ComponentBuilderPlugin {
8
+ order = 100;
9
+
10
+ exec(config: ComponentBuilderPluginConfig) {
11
+ extractComponents({});
12
+ return config;
13
+ }
14
+ }
15
+
16
+ export const codeExtractionPlugin = new CodeExtractionPlugin();
@@ -3,7 +3,7 @@ import { SitecorePageProps } from 'lib/page-props';
3
3
  import { CloudSDK } from '@sitecore-cloudsdk/core/browser';
4
4
  import '@sitecore-cloudsdk/events/browser';
5
5
  import config from 'temp/config';
6
- import { LayoutServicePageState } from '@sitecore-jss/sitecore-jss-nextjs';
6
+ import { LayoutServicePageState, RenderingType } from '@sitecore-jss/sitecore-jss-nextjs';
7
7
 
8
8
  /**
9
9
  * The Bootstrap component is the entry point for performing any initialization logic
@@ -16,7 +16,10 @@ const Bootstrap = (props: SitecorePageProps): JSX.Element | null => {
16
16
  const renderingType = props.layoutData?.sitecore?.context.renderingType;
17
17
  if (process.env.NODE_ENV === 'development')
18
18
  console.debug('Browser Events SDK is not initialized in development environment');
19
- else if (pageState !== LayoutServicePageState.Normal || renderingType === 'component')
19
+ else if (
20
+ pageState !== LayoutServicePageState.Normal ||
21
+ renderingType === RenderingType.Component
22
+ )
20
23
  console.debug('Browser Events SDK is not initialized in edit and preview modes');
21
24
  else {
22
25
  CloudSDK({
@@ -1,5 +1,5 @@
1
1
  import { SitecorePageProps } from 'lib/page-props';
2
- import { getComponentLibraryStylesheetLinks } from '@sitecore-jss/sitecore-jss-nextjs';
2
+ import { getDesignLibraryStylesheetLinks } from '@sitecore-jss/sitecore-jss-nextjs';
3
3
  import { Plugin } from '..';
4
4
  import config from 'temp/config';
5
5
 
@@ -10,7 +10,7 @@ class ComponentThemesPlugin implements Plugin {
10
10
  async exec(props: SitecorePageProps) {
11
11
  // Collect FEAAS, BYOC, SXA component themes
12
12
  props.headLinks.push(
13
- ...getComponentLibraryStylesheetLinks(
13
+ ...getDesignLibraryStylesheetLinks(
14
14
  props.layoutData,
15
15
  config.sitecoreEdgeContextId,
16
16
  config.sitecoreEdgeUrl
@@ -6,7 +6,7 @@ import {
6
6
  } from '@sitecore-jss/sitecore-jss-nextjs';
7
7
  import {
8
8
  editingDataService,
9
- isComponentLibraryPreviewData,
9
+ isDesignLibraryPreviewData,
10
10
  isEditingMetadataPreviewData,
11
11
  } from '@sitecore-jss/sitecore-jss-nextjs/editing';
12
12
  import { SitecorePageProps } from 'lib/page-props';
@@ -21,9 +21,16 @@ class PreviewModePlugin implements Plugin {
21
21
  async exec(props: SitecorePageProps, context: GetServerSidePropsContext | GetStaticPropsContext) {
22
22
  if (!context.preview) return props;
23
23
 
24
- if (isComponentLibraryPreviewData(context.previewData)) {
25
- const { itemId, componentUid, site, language, renderingId, dataSourceId, version } =
26
- context.previewData;
24
+ if (isDesignLibraryPreviewData(context.previewData)) {
25
+ const {
26
+ itemId,
27
+ componentUid,
28
+ site,
29
+ language,
30
+ renderingId,
31
+ dataSourceId,
32
+ version,
33
+ } = context.previewData;
27
34
 
28
35
  const componentService = new RestComponentLayoutService({
29
36
  apiHost: config.sitecoreApiHost,
@@ -0,0 +1,112 @@
1
+ import { useEffect } from 'react';
2
+ <% if (prerender === 'SSG') { -%>
3
+ import { GetStaticPaths, GetStaticProps } from 'next';
4
+ <% } else if (prerender === 'SSR') { -%>
5
+ import { GetServerSideProps } from 'next';
6
+ <% } -%>
7
+ import NotFound from 'src/NotFound';
8
+ import Layout from 'src/Layout';
9
+ import {
10
+ SitecoreContext,
11
+ ComponentPropsContext,
12
+ <% if (prerender === 'SSG') { -%>
13
+ StaticPath,
14
+ <% } -%>
15
+ } from '@sitecore-jss/sitecore-jss-nextjs';
16
+ import { handleEditorFastRefresh } from '@sitecore-jss/sitecore-jss-nextjs/utils';
17
+ import { SitecorePageProps } from 'lib/page-props';
18
+ import { sitecorePagePropsFactory } from 'lib/page-props-factory';
19
+ import { componentBuilder } from 'temp/componentBuilder';
20
+ import config from 'temp/config';
21
+ <% if (prerender === 'SSG') { -%>
22
+ import { sitemapFetcher } from 'lib/sitemap-fetcher';
23
+
24
+ <% } -%>
25
+
26
+ const SitecorePage = ({ notFound, componentProps, layoutData, headLinks }: SitecorePageProps): JSX.Element => {
27
+ useEffect(() => {
28
+ // Since Sitecore editors do not support Fast Refresh, need to refresh editor chromes after Fast Refresh finished
29
+ handleEditorFastRefresh();
30
+ }, []);
31
+
32
+ if (notFound || !layoutData.sitecore.route) {
33
+ // Shouldn't hit this (as long as 'notFound' is being returned below), but just to be safe
34
+ return <NotFound />;
35
+ }
36
+
37
+ const isEditing = layoutData.sitecore.context.pageEditing;
38
+
39
+ return (
40
+ <ComponentPropsContext value={componentProps}>
41
+ <SitecoreContext
42
+ componentFactory={componentBuilder.getComponentFactory({ isEditing })}
43
+ layoutData={layoutData}
44
+ api={{
45
+ edge: {
46
+ contextId: config.sitecoreEdgeContextId,
47
+ edgeUrl: config.sitecoreEdgeUrl,
48
+ },
49
+ }}
50
+ >
51
+ <Layout layoutData={layoutData} headLinks={headLinks} />
52
+ </SitecoreContext>
53
+ </ComponentPropsContext>
54
+ );
55
+ };
56
+
57
+ <% if (prerender === 'SSG') { -%>
58
+ // This function gets called at build and export time to determine
59
+ // pages for SSG ("paths", as tokenized array).
60
+ export const getStaticPaths: GetStaticPaths = async (context) => {
61
+ // Fallback, along with revalidate in getStaticProps (below),
62
+ // enables Incremental Static Regeneration. This allows us to
63
+ // leave certain (or all) paths empty if desired and static pages
64
+ // will be generated on request (development mode in this example).
65
+ // Alternatively, the entire sitemap could be pre-rendered
66
+ // ahead of time (non-development mode in this example).
67
+ // See https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration
68
+
69
+ let paths: StaticPath[] = [];
70
+ let fallback: boolean | 'blocking' = 'blocking';
71
+
72
+ if (process.env.NODE_ENV !== 'development' && process.env.DISABLE_SSG_FETCH?.toLowerCase() !== 'true') {
73
+ try {
74
+ // Note: Next.js runs export in production mode
75
+ paths = await sitemapFetcher.fetch(context);
76
+ } catch (error) {
77
+ console.log('Error occurred while fetching static paths');
78
+ console.log(error);
79
+ }
80
+
81
+ fallback = process.env.EXPORT_MODE ? false : fallback;
82
+ }
83
+
84
+ return {
85
+ paths,
86
+ fallback,
87
+ };
88
+ };
89
+
90
+ // This function gets called at build time on server-side.
91
+ // It may be called again, on a serverless function, if
92
+ // revalidation (or fallback) is enabled and a new request comes in.
93
+ export const getStaticProps: GetStaticProps = async (context) => {
94
+ <% } else if (prerender === 'SSR') { -%>
95
+ // This function gets called at request time on server-side.
96
+ export const getServerSideProps: GetServerSideProps = async (context) => {
97
+ <% } -%>
98
+ const props = await sitecorePagePropsFactory.create(context);
99
+
100
+ return {
101
+ props,
102
+ <% if (prerender === 'SSG') { -%>
103
+ // Next.js will attempt to re-generate the page:
104
+ // - When a request comes in
105
+ // - At most once every 5 seconds
106
+ revalidate: 5, // In seconds
107
+ <% } -%>
108
+ notFound: props.notFound, // Returns custom 404 page with a status code of 404 when true
109
+ };
110
+ };
111
+
112
+ export default SitecorePage;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-headless-ssr-experience-edge-sample",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "Node server-side-rendering sample for running JSS apps under Node hosting using Experience Edge",
5
5
  "scripts": {
6
6
  "start": "ts-node ./src/index.ts"
@@ -19,7 +19,7 @@
19
19
  "homepage": "https://jss.sitecore.com",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@sitecore-jss/sitecore-jss": "~<%- version %>",
22
+ "@sitecore-jss/sitecore-jss": "<%- version %>",
23
23
  "compression": "^1.7.4",
24
24
  "express": "^4.18.2",
25
25
  "dotenv": "^16.0.3"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-headless-ssr-proxy-sample",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "Node server-side-rendering proxy sample for running JSS apps under Node hosting",
5
5
  "scripts": {
6
6
  "start": "ts-node ./src/index.ts"
@@ -19,8 +19,8 @@
19
19
  "homepage": "https://jss.sitecore.com",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@sitecore-jss/sitecore-jss": "~<%- version %>",
23
- "@sitecore-jss/sitecore-jss-proxy": "~<%- version %>",
22
+ "@sitecore-jss/sitecore-jss": "<%- version %>",
23
+ "@sitecore-jss/sitecore-jss-proxy": "<%- version %>",
24
24
  "agentkeepalive": "^4.2.1",
25
25
  "compression": "~1.7.4",
26
26
  "express": "~4.19.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-xmcloud-sample",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "Node XM Cloud Proxy sample for running XM Cloud JSS SPA apps",
5
5
  "author": {
6
6
  "name": "Sitecore Corporation",
@@ -10,14 +10,14 @@
10
10
  "start": "ts-node ./src/index.ts"
11
11
  },
12
12
  "dependencies": {
13
- "@sitecore-jss/sitecore-jss-proxy": "~<%- version %>",
13
+ "@sitecore-jss/sitecore-jss-proxy": "<%- version %>",
14
14
  "compression": "^1.7.4",
15
15
  "express": "^4.18.2",
16
16
  "dotenv": "^16.0.3",
17
17
  "http-proxy-middleware": "^3.0.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@sitecore-jss/sitecore-jss": "~<%- version %>",
20
+ "@sitecore-jss/sitecore-jss": "<%- version %>",
21
21
  "@types/compression": "^1.7.2",
22
22
  "@types/express": "^4.17.17",
23
23
  "ts-node": "^10.9.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
3
  "description": "Application utilizing Sitecore JavaScript Services and React (create-react-app).",
4
- "version": "<%- version %>",
4
+ "version": "0.1.0",
5
5
  "private": true,
6
6
  "config": {
7
7
  "appName": "<%- appName %>",
@@ -28,7 +28,7 @@
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
30
  "@apollo/client": "^3.7.1",
31
- "@sitecore-jss/sitecore-jss-react": "~<%- version %>",
31
+ "@sitecore-jss/sitecore-jss-react": "<%- version %>",
32
32
  "bootstrap": "^5.2.3",
33
33
  "cross-fetch": "^3.1.5",
34
34
  "fast-deep-equal": "^3.1.3",
@@ -52,9 +52,9 @@
52
52
  "@babel/preset-env": "^7.20.2",
53
53
  "@babel/preset-react": "^7.18.6",
54
54
  "@babel/register": "~7.18.9",
55
- "@sitecore-jss/sitecore-jss-cli": "~<%- version %>",
56
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
57
- "@sitecore-jss/sitecore-jss-rendering-host": "~<%- version %>",
55
+ "@sitecore-jss/sitecore-jss-cli": "<%- version %>",
56
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
57
+ "@sitecore-jss/sitecore-jss-rendering-host": "<%- version %>",
58
58
  "babel-loader": "~9.1.0",
59
59
  "babel-preset-react-app": "~10.0.1",
60
60
  "chalk": "~4.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "A basic React Native app utilizing Sitecore JavaScript Services",
5
5
  "config": {
6
6
  "appName": "<%- appName %>",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@react-native-community/masked-view": "^0.1.10",
26
- "@sitecore-jss/sitecore-jss-react-native": "~<%- version %>",
26
+ "@sitecore-jss/sitecore-jss-react-native": "<%- version %>",
27
27
  "prop-types": "^15.6.0",
28
28
  "react": "16.13.1",
29
29
  "react-native": "^0.63.4",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "private": true,
39
39
  "devDependencies": {
40
- "@sitecore-jss/sitecore-jss-cli": "~<%- version %>",
41
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
40
+ "@sitecore-jss/sitecore-jss-cli": "<%- version %>",
41
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
42
42
  "babel-core": "^6.26.0",
43
43
  "babel-eslint": "^8.2.1",
44
44
  "babel-plugin-inline-replace-variables": "^1.3.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "<%- version %>",
3
+ "version": "0.1.0",
4
4
  "description": "Application utilizing Sitecore JavaScript Services and Vue (vue-cli).",
5
5
  "private": true,
6
6
  "config": {
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@apollo/client": "^3.7.4",
47
47
  "@panter/vue-i18next": "~0.15.2",
48
- "@sitecore-jss/sitecore-jss-vue": "~<%- version %>",
48
+ "@sitecore-jss/sitecore-jss-vue": "<%- version %>",
49
49
  "@vue/apollo-composable": "4.0.0-beta.2",
50
50
  "@vue/apollo-option": "^4.0.0",
51
51
  "@vue/apollo-ssr": "^4.0.0",
@@ -62,8 +62,8 @@
62
62
  "devDependencies": {
63
63
  "@babel/eslint-parser": "^7.19.1",
64
64
  "@babel/register": "7.18.9",
65
- "@sitecore-jss/sitecore-jss-cli": "~<%- version %>",
66
- "@sitecore-jss/sitecore-jss-dev-tools": "~<%- version %>",
65
+ "@sitecore-jss/sitecore-jss-cli": "<%- version %>",
66
+ "@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
67
67
  "@vue/cli-plugin-babel": "~5.0.8",
68
68
  "@vue/cli-plugin-eslint": "~5.0.8",
69
69
  "@vue/cli-service": "~5.0.8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.5.0-beta.1",
3
+ "version": "22.5.0-beta.11",
4
4
  "description": "Sitecore JSS initializer",
5
5
  "bin": "./dist/index.js",
6
6
  "scripts": {
@@ -65,5 +65,5 @@
65
65
  "ts-node": "^10.9.1",
66
66
  "typescript": "~5.6.3"
67
67
  },
68
- "gitHead": "e080916b354c36e63f29f01fbcb87688d7f2b4cd"
68
+ "gitHead": "60c1594cdbc7ff5c173965d4b95020778fae1d7f"
69
69
  }
@@ -1,51 +0,0 @@
1
- import { GetServerSideProps } from 'next';
2
- import Head from 'next/head';
3
- import {
4
- ComponentLibraryLayout,
5
- ComponentPropsContext,
6
- SitecoreContext,
7
- } from '@sitecore-jss/sitecore-jss-nextjs';
8
- import { SitecorePageProps } from 'lib/page-props';
9
- import { sitecorePagePropsFactory } from 'lib/page-props-factory';
10
- import NotFound from 'src/NotFound';
11
- import { componentBuilder } from 'temp/componentBuilder';
12
- import config from 'temp/config';
13
-
14
- const FEAASRender = ({
15
- notFound,
16
- componentProps,
17
- layoutData,
18
- headLinks,
19
- }: SitecorePageProps): JSX.Element => {
20
- if (notFound) {
21
- return <NotFound />;
22
- }
23
- return (
24
- <ComponentPropsContext value={componentProps}>
25
- <SitecoreContext
26
- componentFactory={componentBuilder.getComponentFactory()}
27
- layoutData={layoutData}
28
- >
29
- <Head>
30
- <title>Sitecore Component Library</title>
31
- <link rel="icon" href={`${config.publicUrl}/favicon.ico`} />
32
- {headLinks.map((headLink) => (
33
- <link rel={headLink.rel} key={headLink.href} href={headLink.href} />
34
- ))}
35
- </Head>
36
- <ComponentLibraryLayout {...layoutData} />
37
- </SitecoreContext>
38
- </ComponentPropsContext>
39
- );
40
- };
41
-
42
- export const getServerSideProps: GetServerSideProps = async (context) => {
43
- const props = await sitecorePagePropsFactory.create(context);
44
- return {
45
- props,
46
- // not found when page not requested through editing render api or notFound set in page-props
47
- notFound: props.notFound || !context.preview,
48
- };
49
- };
50
-
51
- export default FEAASRender;