create-sitecore-jss 22.5.0-beta.1 → 22.5.0-beta.10
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.
- package/dist/common/processes/transform.js +2 -2
- package/dist/templates/angular/package.json +5 -5
- package/dist/templates/nextjs/package.json +4 -4
- package/dist/templates/nextjs/scripts/generate-component-builder/plugins/component-builder.ts +1 -1
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-sxa/src/Layout.tsx +31 -10
- package/dist/templates/nextjs-sxa/src/pages/404.tsx +8 -0
- package/dist/templates/nextjs-sxa/src/pages/500.tsx +8 -0
- package/dist/templates/nextjs-xmcloud/scripts/generate-component-builder/plugins/code-extraction.ts +16 -0
- package/dist/templates/nextjs-xmcloud/src/Bootstrap.tsx +5 -2
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/component-themes.ts +2 -2
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/preview-mode.ts +11 -4
- package/dist/templates/nextjs-xmcloud/src/pages/[[...path]].tsx +112 -0
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
- package/dist/templates/node-xmcloud-proxy/package.json +3 -3
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/package.json +4 -4
- package/package.json +2 -2
- package/dist/templates/nextjs-xmcloud/src/pages/component-library/render.tsx +0 -51
|
@@ -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
|
-
//
|
|
187
|
-
const jssVersion = version.
|
|
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": "
|
|
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": "
|
|
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": "
|
|
83
|
-
"@sitecore-jss/sitecore-jss-cli": "
|
|
84
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
47
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "
|
|
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",
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Head from 'next/head';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Placeholder,
|
|
8
|
+
LayoutServiceData,
|
|
9
|
+
Field,
|
|
10
|
+
DesignLibrary,
|
|
11
|
+
HTMLLink,
|
|
12
|
+
RenderingType
|
|
13
|
+
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
7
14
|
import config from 'temp/config';
|
|
8
15
|
import Scripts from 'src/Scripts';
|
|
9
16
|
|
|
@@ -40,15 +47,29 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
|
|
|
40
47
|
|
|
41
48
|
{/* root placeholder for the app, which we add components to using route data */}
|
|
42
49
|
<div className={mainClassPageEditing}>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
<% if (templates.includes('nextjs-xmcloud') || templates.includes('nextjs-sxa')) { %>
|
|
51
|
+
{layoutData.sitecore.context.renderingType === RenderingType.Component ? (
|
|
52
|
+
<DesignLibrary {...layoutData} />
|
|
53
|
+
) : (
|
|
54
|
+
<>
|
|
55
|
+
<header>
|
|
56
|
+
<div id="header">
|
|
57
|
+
{route && <Placeholder name="headless-header" rendering={route} />}
|
|
58
|
+
</div>
|
|
59
|
+
</header>
|
|
60
|
+
<main>
|
|
61
|
+
<div id="content">
|
|
62
|
+
{route && <Placeholder name="headless-main" rendering={route} />}
|
|
63
|
+
</div>
|
|
64
|
+
</main>
|
|
65
|
+
<footer>
|
|
66
|
+
<div id="footer">
|
|
67
|
+
{route && <Placeholder name="headless-footer" rendering={route} />}
|
|
68
|
+
</div>
|
|
69
|
+
</footer>
|
|
70
|
+
</>
|
|
71
|
+
)}
|
|
72
|
+
<% } %>
|
|
52
73
|
</div>
|
|
53
74
|
</>
|
|
54
75
|
);
|
|
@@ -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>
|
package/dist/templates/nextjs-xmcloud/scripts/generate-component-builder/plugins/code-extraction.ts
ADDED
|
@@ -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 (
|
|
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({
|
package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/component-themes.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SitecorePageProps } from 'lib/page-props';
|
|
2
|
-
import {
|
|
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
|
-
...
|
|
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
|
-
|
|
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 (
|
|
25
|
-
const {
|
|
26
|
-
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
23
|
-
"@sitecore-jss/sitecore-jss-proxy": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
56
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "
|
|
57
|
-
"@sitecore-jss/sitecore-jss-rendering-host": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
41
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
66
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "
|
|
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.
|
|
3
|
+
"version": "22.5.0-beta.10",
|
|
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": "
|
|
68
|
+
"gitHead": "5219803dfd700b1e2967c02e1b17db07f6f31b45"
|
|
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;
|