create-sitecore-jss 22.6.0-canary.1 → 22.6.0-canary.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.
Files changed (27) hide show
  1. package/dist/common/processes/transform.js +2 -4
  2. package/dist/templates/angular/package.json +26 -26
  3. package/dist/templates/angular-xmcloud/.env +0 -3
  4. package/dist/templates/angular-xmcloud/README.md +0 -1
  5. package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +0 -2
  6. package/dist/templates/angular-xmcloud/src/app/lib/config.ts +0 -1
  7. package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory/config.ts +1 -5
  8. package/dist/templates/nextjs/package.json +4 -4
  9. package/dist/templates/nextjs-styleguide/package.json +1 -1
  10. package/dist/templates/nextjs-sxa/src/components/ColumnSplitter.tsx +1 -1
  11. package/dist/templates/nextjs-sxa/src/components/Container.tsx +5 -5
  12. package/dist/templates/nextjs-sxa/src/components/Image.tsx +9 -9
  13. package/dist/templates/nextjs-sxa/src/components/LinkList.tsx +1 -1
  14. package/dist/templates/nextjs-sxa/src/components/Navigation.tsx +2 -2
  15. package/dist/templates/nextjs-sxa/src/components/PageContent.tsx +3 -3
  16. package/dist/templates/nextjs-sxa/src/components/Promo.tsx +3 -3
  17. package/dist/templates/nextjs-sxa/src/components/RichText.tsx +1 -1
  18. package/dist/templates/nextjs-sxa/src/components/RowSplitter.tsx +1 -1
  19. package/dist/templates/nextjs-sxa/src/components/Title.tsx +2 -2
  20. package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
  21. package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
  22. package/dist/templates/node-xmcloud-proxy/README.md +60 -51
  23. package/dist/templates/node-xmcloud-proxy/package.json +3 -3
  24. package/dist/templates/react/package.json +5 -5
  25. package/dist/templates/react-native/package.json +4 -4
  26. package/dist/templates/vue/package.json +4 -4
  27. package/package.json +2 -2
@@ -183,10 +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 canary build number in the generated app
187
- const jssVersion = version.includes('canary')
188
- ? version.replace(/(-canary\.\d+)$/, '-canary')
189
- : version;
186
+ // Use exact version for jss dependencies in beta and canary versions
187
+ const jssVersion = version.match(/(\-[a-zA-Z]+\.\d+)$/) ? version : `~${version}`;
190
188
  const ejsData = Object.assign(Object.assign({}, answers), { version: jssVersion, helper: {
191
189
  isDev: (0, helpers_1.isDevEnvironment)(destination || answers.destination),
192
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 %>",
@@ -45,20 +45,20 @@
45
45
  "homepage": "https://jss.sitecore.com",
46
46
  "license": "Apache-2.0",
47
47
  "dependencies": {
48
- "@angular/animations": "~17.3.11",
49
- "@angular/common": "~17.3.11",
50
- "@angular/compiler": "~17.3.11",
51
- "@angular/core": "~17.3.11",
52
- "@angular/forms": "~17.3.11",
53
- "@angular/platform-browser": "~17.3.11",
54
- "@angular/platform-browser-dynamic": "~17.3.11",
55
- "@angular/platform-server": "~17.3.11",
56
- "@angular/router": "~17.3.11",
57
- "@apollo/client": "^3.3.12",
48
+ "@angular/animations": "~18.2.13",
49
+ "@angular/common": "~18.2.13",
50
+ "@angular/compiler": "~18.2.13",
51
+ "@angular/core": "~18.2.13",
52
+ "@angular/forms": "~18.2.13",
53
+ "@angular/platform-browser": "~18.2.13",
54
+ "@angular/platform-browser-dynamic": "~18.2.13",
55
+ "@angular/platform-server": "~18.2.13",
56
+ "@angular/router": "~18.2.13",
57
+ "@apollo/client": "^3.12.9",
58
58
  "@ngx-translate/core": "~15.0.0",
59
59
  "@ngx-translate/http-loader": "~8.0.0",
60
- "@sitecore-jss/sitecore-jss-angular": "~<%- version %>",
61
- "apollo-angular": "~6.0.0",
60
+ "@sitecore-jss/sitecore-jss-angular": "<%- version %>",
61
+ "apollo-angular": "~8.0.2",
62
62
  "bootstrap": "^5.3.3",
63
63
  "core-js": "~3.37.1",
64
64
  "graphql": "15.5.0",
@@ -69,19 +69,19 @@
69
69
  "reflect-metadata": "^0.2.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@angular-builders/custom-webpack": "^17.0.2",
73
- "@angular-devkit/build-angular": "^17.3.8",
74
- "@angular-eslint/builder": "^17.5.2",
75
- "@angular-eslint/eslint-plugin": "^17.5.2",
76
- "@angular-eslint/eslint-plugin-template": "^17.5.2",
77
- "@angular-eslint/schematics": "^17.5.2",
78
- "@angular-eslint/template-parser": "^17.5.2",
79
- "@angular/cli": "~17.3.8",
80
- "@angular/compiler-cli": "~17.3.11",
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 %>",
72
+ "@angular-builders/custom-webpack": "^18.0.0",
73
+ "@angular-devkit/build-angular": "^18.2.14",
74
+ "@angular-eslint/builder": "^18.4.3",
75
+ "@angular-eslint/eslint-plugin": "^18.4.3",
76
+ "@angular-eslint/eslint-plugin-template": "^18.4.3",
77
+ "@angular-eslint/schematics": "^18.4.3",
78
+ "@angular-eslint/template-parser": "^18.4.3",
79
+ "@angular/cli": "~18.2.13",
80
+ "@angular/compiler-cli": "~18.2.13",
81
+ "@angular/language-service": "~18.2.13",
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",
@@ -7,9 +7,6 @@ SITECORE_EDGE_CONTEXT_ID=
7
7
 
8
8
  # ========== XM Cloud Proxy ===========
9
9
 
10
- # Your XM Cloud Proxy hostname is needed to build the app and execute the client-side requests against the proxy server.
11
- PROXY_HOST=http://localhost:3000
12
-
13
10
  # Your XM Cloud Proxy server path is needed to build the app. The build output will be copied to the proxy server path.
14
11
  # Use a relative unix style path to ensure compatibility when deployment runs on Windows or Unix based systems.
15
12
  PROXY_BUILD_PATH=<%- locals.relativeProxyAppDestination.replace(/\\/g, '\/') %>dist
@@ -77,7 +77,6 @@ The following environment variables can be used to configure the angular app. Yo
77
77
 
78
78
  | Parameter | Description |
79
79
  | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
80
- | `PROXY_HOST` | Your XM Cloud Proxy hostname is needed to build the app and execute the client-side requests against the proxy server. Default value `http://localhost:3000` |
81
80
  | `PROXY_BUILD_PATH` | Your XM Cloud Proxy server path is needed to build the app. The build output will be copied to the XM Cloud Proxy application path. Default value `<xmcloud_proxy_path>\dist`.
82
81
  | `SITECORE_EDGE_CONTEXT_ID` | The Context ID, which covers many system configurations, is required for connecting to the XM Cloud back end. This is an XM Cloud system environment variable. When the application runs on the XM Cloud editing host, this value is always set to the preview Context ID. |
83
82
  | `SITECORE_API_KEY` | The API key for GRAPH_QL_ENDPOINT authentication. It should be used in combination with SITECORE_API_HOST for local development when connecting to a local XM Cloud instance
@@ -12,7 +12,6 @@ class XMCloudPlugin implements ConfigPlugin {
12
12
 
13
13
  async exec(config: JssConfig) {
14
14
  const proxyBuildPath = process.env[`${constantCase('proxyBuildPath')}`]?.replace(/\/$/, '');
15
- const proxyHost = process.env[`${constantCase('proxyHost')}`];
16
15
 
17
16
  const sitecoreEdgeUrl =
18
17
  process.env[`${constantCase('sitecoreEdgeUrl')}`]?.replace(/\/$/, '') ||
@@ -30,7 +29,6 @@ class XMCloudPlugin implements ConfigPlugin {
30
29
 
31
30
  return Object.assign({}, config, {
32
31
  proxyBuildPath,
33
- proxyHost,
34
32
  sitecoreEdgeUrl,
35
33
  sitecoreEdgeContextId,
36
34
  personalizeScope,
@@ -11,7 +11,6 @@ export interface JssConfig extends Record<string, string | boolean | undefined>
11
11
  graphQLEndpointPath?: string;
12
12
  defaultServerRoute?: string;
13
13
  proxyBuildPath?: string;
14
- proxyHost?: string;
15
14
  sitecoreEdgeUrl?: string;
16
15
  sitecoreEdgeContextId?: string;
17
16
  }
@@ -17,15 +17,11 @@ export const getGraphQLClientFactoryConfig = () => {
17
17
  const isProduction = env.production === 'true';
18
18
 
19
19
  if (isProduction) {
20
- if (!env.proxyHost) {
21
- throw new Error('Please configure your proxyHost.');
22
- }
23
-
24
20
  if (env.sitecoreEdgeContextId) {
25
21
  clientConfig = {
26
22
  endpoint: isServer
27
23
  ? getEdgeProxyContentUrl(env.sitecoreEdgeContextId, env.sitecoreEdgeUrl)
28
- : getEdgeProxyContentUrl(env.sitecoreEdgeContextId, env.proxyHost),
24
+ : getEdgeProxyContentUrl(env.sitecoreEdgeContextId, ''),
29
25
  };
30
26
  } else if (env.graphQLEndpoint && env.sitecoreApiKey) {
31
27
  // we ignore ssr-proxy and query CM directly in case apiKey is used (i.e. in dev docker deployments)
@@ -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",
@@ -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": {
@@ -11,7 +11,7 @@ interface ComponentProps {
11
11
  }
12
12
 
13
13
  export const Default = (props: ComponentProps): JSX.Element => {
14
- const styles = `${props.params.GridParameters ?? ''} ${props.params.Styles ?? ''}`.trimEnd();
14
+ const styles = `${props?.params?.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd();
15
15
  const columnWidths = [
16
16
  props.params.ColumnWidth1,
17
17
  props.params.ColumnWidth2,
@@ -11,12 +11,12 @@ interface ComponentProps {
11
11
  }
12
12
 
13
13
  const DefaultContainer = (props: ComponentProps): JSX.Element => {
14
- const containerStyles = props.params && props.params.Styles ? props.params.Styles : '';
15
- const styles = `${props.params.GridParameters} ${containerStyles}`.trimEnd();
16
- const phKey = `container-${props.params.DynamicPlaceholderId}`;
17
- const id = props.params.RenderingIdentifier;
14
+ const containerStyles = props?.params?.Styles ?? '';
15
+ const styles = `${props?.params?.GridParameters} ${containerStyles}`.trimEnd();
16
+ const phKey = `container-${props?.params?.DynamicPlaceholderId}`;
17
+ const id = props?.params?.RenderingIdentifier;
18
18
  const mediaUrlPattern = new RegExp(/mediaurl=\"([^"]*)\"/, 'i');
19
- let backgroundImage = props.params.BackgroundImage as string;
19
+ let backgroundImage = props?.params?.BackgroundImage as string;
20
20
  let backgroundStyle: { [key: string]: string } = {};
21
21
 
22
22
  if (backgroundImage && backgroundImage.match(mediaUrlPattern)) {
@@ -22,7 +22,7 @@ type ImageProps = {
22
22
  };
23
23
 
24
24
  const ImageDefault = (props: ImageProps): JSX.Element => (
25
- <div className={`component image ${props.params.styles}`.trimEnd()}>
25
+ <div className={`component image ${props?.params?.styles}`.trimEnd()}>
26
26
  <div className="component-content">
27
27
  <span className="is-empty-hint">Image</span>
28
28
  </div>
@@ -49,16 +49,16 @@ export const Banner = (props: ImageProps): JSX.Element => {
49
49
  .replace(`height="${props?.fields?.Image?.value?.height}"`, 'height="100%"'),
50
50
  }
51
51
  : {
52
- ...props.fields.Image,
53
- value: {
54
- ...props.fields.Image.value,
55
- style: { width: '100%', height: '100%' },
56
- },
57
- };
52
+ ...props.fields.Image,
53
+ value: {
54
+ ...props.fields.Image.value,
55
+ style: { width: '100%', height: '100%' },
56
+ },
57
+ };
58
58
 
59
59
  return (
60
60
  <div
61
- className={`component hero-banner ${props.params.styles} ${classHeroBannerEmpty}`}
61
+ className={`component hero-banner ${props?.params?.styles} ${classHeroBannerEmpty}`}
62
62
  id={id ? id : undefined}
63
63
  >
64
64
  <div className="component-content sc-sxa-image-hero-banner" style={backgroundStyle}>
@@ -76,7 +76,7 @@ export const Default = (props: ImageProps): JSX.Element => {
76
76
  const id = props.params.RenderingIdentifier;
77
77
 
78
78
  return (
79
- <div className={`component image ${props.params.styles}`} id={id ? id : undefined}>
79
+ <div className={`component image ${props?.params?.styles}`} id={id ? id : undefined}>
80
80
  <div className="component-content">
81
81
  {sitecoreContext.pageState === 'edit' || !props.fields.TargetUrl?.value?.href ? (
82
82
  <Image />
@@ -52,7 +52,7 @@ const LinkListItem = (props: LinkListItemProps) => {
52
52
 
53
53
  export const Default = (props: LinkListProps): JSX.Element => {
54
54
  const datasource = props.fields?.data?.datasource;
55
- const styles = `component link-list ${props.params.styles}`.trimEnd();
55
+ const styles = `component link-list ${props?.params?.styles}`.trimEnd();
56
56
  const id = props.params.RenderingIdentifier;
57
57
 
58
58
  if (datasource) {
@@ -52,7 +52,7 @@ export const Default = (props: NavigationProps): JSX.Element => {
52
52
  const { sitecoreContext } = useSitecoreContext();
53
53
  const styles =
54
54
  props.params != null
55
- ? `${props.params.GridParameters ?? ''} ${props.params.Styles ?? ''}`.trimEnd()
55
+ ? `${props.params.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd()
56
56
  : '';
57
57
  const id = props.params != null ? props.params.RenderingIdentifier : null;
58
58
 
@@ -110,7 +110,7 @@ export const Default = (props: NavigationProps): JSX.Element => {
110
110
  const NavigationList = (props: NavigationProps) => {
111
111
  const { sitecoreContext } = useSitecoreContext();
112
112
  const [active, setActive] = useState(false);
113
- const classNameList = `${props.fields.Styles.concat('rel-level' + props.relativeLevel).join(
113
+ const classNameList = `${props?.fields?.Styles.concat('rel-level' + props.relativeLevel).join(
114
114
  ' '
115
115
  )}`;
116
116
 
@@ -23,7 +23,7 @@ type ComponentContentProps = {
23
23
  const ComponentContent = (props: ComponentContentProps) => {
24
24
  const id = props.id;
25
25
  return (
26
- <div className={`component content ${props.styles}`} id={id ? id : undefined}>
26
+ <div className={`component content ${props?.styles}`} id={id ? id : undefined}>
27
27
  <div className="component-content">
28
28
  <div className="field-content">{props.children}</div>
29
29
  </div>
@@ -37,7 +37,7 @@ export const Default = (props: PageContentProps): JSX.Element => {
37
37
 
38
38
  if (!(props.fields && props.fields.Content) && !sitecoreContext?.route?.fields?.Content) {
39
39
  return (
40
- <div className={`component content ${props.params.styles}`} id={id ? id : undefined}>
40
+ <div className={`component content ${props?.params?.styles}`} id={id ? id : undefined}>
41
41
  <div className="component-content">
42
42
  <div className="field-content">[Content]</div>
43
43
  </div>
@@ -50,7 +50,7 @@ export const Default = (props: PageContentProps): JSX.Element => {
50
50
  : sitecoreContext?.route?.fields?.Content) as RichTextField;
51
51
 
52
52
  return (
53
- <ComponentContent styles={props.params.styles} id={id}>
53
+ <ComponentContent styles={props?.params?.styles} id={id}>
54
54
  <JssRichText field={field} />
55
55
  </ComponentContent>
56
56
  );
@@ -21,7 +21,7 @@ type PromoProps = {
21
21
  };
22
22
 
23
23
  const PromoDefaultComponent = (props: PromoProps): JSX.Element => (
24
- <div className={`component promo ${props.params.styles}`}>
24
+ <div className={`component promo ${props?.params?.styles}`}>
25
25
  <div className="component-content">
26
26
  <span className="is-empty-hint">Promo</span>
27
27
  </div>
@@ -32,7 +32,7 @@ export const Default = (props: PromoProps): JSX.Element => {
32
32
  const id = props.params.RenderingIdentifier;
33
33
  if (props.fields) {
34
34
  return (
35
- <div className={`component promo ${props.params.styles}`} id={id ? id : undefined}>
35
+ <div className={`component promo ${props?.params?.styles}`} id={id ? id : undefined}>
36
36
  <div className="component-content">
37
37
  <div className="field-promoicon">
38
38
  <JssImage field={props.fields.PromoIcon} />
@@ -59,7 +59,7 @@ export const WithText = (props: PromoProps): JSX.Element => {
59
59
  const id = props.params.RenderingIdentifier;
60
60
  if (props.fields) {
61
61
  return (
62
- <div className={`component promo ${props.params.styles}`} id={id ? id : undefined}>
62
+ <div className={`component promo ${props?.params?.styles}`} id={id ? id : undefined}>
63
63
  <div className="component-content">
64
64
  <div className="field-promoicon">
65
65
  <JssImage field={props.fields.PromoIcon} />
@@ -20,7 +20,7 @@ export const Default = (props: RichTextProps): JSX.Element => {
20
20
 
21
21
  return (
22
22
  <div
23
- className={`component rich-text ${props.params.styles.trimEnd()}`}
23
+ className={`component rich-text ${props?.params?.styles.trimEnd()}`}
24
24
  id={id ? id : undefined}
25
25
  >
26
26
  <div className="component-content">{text}</div>
@@ -11,7 +11,7 @@ interface ComponentProps {
11
11
  }
12
12
 
13
13
  export const Default = (props: ComponentProps): JSX.Element => {
14
- const styles = `${props.params.GridParameters ?? ''} ${props.params.Styles ?? ''}`.trimEnd();
14
+ const styles = `${props?.params?.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd();
15
15
  const rowStyles = [
16
16
  props.params.Styles1,
17
17
  props.params.Styles2,
@@ -52,7 +52,7 @@ type ComponentContentProps = {
52
52
  const ComponentContent = (props: ComponentContentProps) => {
53
53
  const id = props.id;
54
54
  return (
55
- <div className={`component title ${props.styles}`} id={id ? id : undefined}>
55
+ <div className={`component title ${props?.styles}`} id={id ? id : undefined}>
56
56
  <div className="component-content">
57
57
  <div className="field-title">{props.children}</div>
58
58
  </div>
@@ -79,7 +79,7 @@ export const Default = (props: TitleProps): JSX.Element => {
79
79
  }
80
80
 
81
81
  return (
82
- <ComponentContent styles={props.params.styles} id={props.params.RenderingIdentifier}>
82
+ <ComponentContent styles={props?.params?.styles} id={props?.params?.RenderingIdentifier}>
83
83
  <>
84
84
  {sitecoreContext.pageEditing ? (
85
85
  <Text field={text} />
@@ -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",
@@ -91,64 +91,73 @@ If the operation is successful, you’ll see the following message:
91
91
 
92
92
  Follow these steps to deploy your application to Netlify. The deployed site can be used as an editing host in XM Cloud.
93
93
 
94
- 1. Run `npm init` in the root directory (which contains SPA and Node XM Cloud Proxy app folder) and add the following scripts to package.json:
95
- ```
96
- "build": "cd ./<your-proxy-app-name> && npm run build-all && cd ..",
97
- "install": "cd ./<your-proxy-app-name> && npm install && npm run install-all && cd ..",
98
- ```
99
- 2. Ensure that `<your-proxy-app-name>/package.json` includes the following commands to handle the build and install steps properly:
100
- ```
101
- "build-all": "cd ../angular && npm run build && cd ../<your-proxy-app-name> && tsc",
102
- "install-all": "cd ../angular && npm i && cd ../<your-proxy-app-name>"
103
- ```
94
+ 1. Run `npm init` in the root directory (which contains SPA and Node XM Cloud Proxy app folders) and add the following scripts to package.json:
95
+ ```
96
+ "build": "cd ./<your-proxy-app-folder> && npm run build-all && cd ..",
97
+ "install": "cd ./<your-proxy-app-folder> && npm install && npm run install-all && cd .."
98
+ ```
99
+ 2. Ensure that `<your-proxy-app-folder>/package.json` includes the following commands to handle the build and install steps properly:
100
+ ```
101
+ "build-all": "cd ../angular && npm run build && cd ../<your-proxy-app-folder> && tsc",
102
+ "install-all": "cd ../angular && npm i && cd ../<your-proxy-app-folder> && npm i"
103
+ ```
104
104
  3. Configure `serverless-http`:
105
- - Install the npm package
106
- ```
107
- npm i serverless-http
108
- ```
109
- - Import serverless-http in `<your-proxy-app-name>/src/index.ts` file.
105
+ - Install the serverless-http package :
106
+ - If you're deploying a standalone Angular app with the Node proxy, run the following command inside your proxy app folder:
107
+ ```
108
+ npm i serverless-http
109
+ ```
110
+ - If you're working within the pnpm setup context of the [xmcloud-foundation-head](https://github.com/sitecorelabs/xmcloud-foundation-head), run the following command inside your proxy app folder:
111
+ ```
112
+ pnpm add serverless-http
113
+ ```
114
+ - Import serverless-http in `<your-proxy-app-folder>/src/index.ts` file and export the serverless handler:
110
115
  ```
111
- export const handler = serverless(server);
116
+ import serverless from 'serverless-http';
117
+ ...
118
+ export const handler = serverless(server);
112
119
  ```
113
120
  4. Create a `netlify.toml` file and ensure that the following Netlify configuration is added there:
114
- - The following allows the proxy app to be treated as Netlify functions. [Functions Overview](https://docs.netlify.com/functions/overview/)
115
- ```
116
- [functions]
117
- directory = "<your-proxy-app-name>/src"
118
- node_bundler = "esbuild"
119
- included_files = ["<your-proxy-app-name>/dist/**"]
120
- ```
121
- - To ensure that static assets are accessed properly, you might need to add the following redirects statement to the toml file:
122
- ```
123
- [[redirects]]
124
- from = "/dist/browser/*"
125
- status = 200
126
- to = "/browser/:splat"
127
- ```
128
- - By default, redirects won’t be applied if there’s a file with the same path as the one defined in the `from` property. Setting `force` to `true` will make the redirect rule take precedence over any existing files.
129
- ```
130
- [[redirects]]
131
- from = "/*"
132
- status = 200
133
- to = "/.netlify/functions/index/:splat"
134
- force = true
135
- ```
136
- - Add the following build command:
137
- ```
138
- [build]
139
- command = "npm run build"
140
- publish = "<your-proxy-app-name>/dist"
141
- ```
121
+ ```
122
+ [functions]
123
+ directory = "<your-proxy-app-folder>/src"
124
+ node_bundler = "esbuild"
125
+ included_files = ["<your-proxy-app-folder>/dist/**"]
126
+ [[redirects]]
127
+ from = "/dist/browser/*"
128
+ status = 200
129
+ to = "/browser/:splat"
130
+ [[redirects]]
131
+ from = "/*"
132
+ status = 200
133
+ to = "/.netlify/functions/index/:splat"
134
+ force = true
135
+ [build]
136
+ command = "npm run build"
137
+ publish = "<your-proxy-app-folder>/dist"
138
+ ```
139
+ - The `[functions]` section allows the proxy app to be treated as Netlify functions. [Functions Overview](https://docs.netlify.com/functions/overview/)
140
+ - The first `[[redirects]]` section ensures that static assets are accessed properly.
141
+ - The second `[[redirects]]` section means that, by default, redirects aren't applied if a file exists at the same path as the one defined in the `from` property. Setting `force` to `true` ensures the redirect rule takes precedence over existing files, preventing files in the deploy folder from being publicly accessible.
142
+
142
143
  5. Create your [Netlify deployment](https://www.netlify.com/blog/2016/09/29/a-step-by-step-guide-deploying-on-netlify/):
143
144
  - Set up all your necessary environment variables like `SITECORE_EDGE_CONTEXT_ID`, `SITECORE_SITE_NAME` etc.
145
+ - Configure Netlify to use the latest LTS version of Node.js.
144
146
  - Configure your build settings in the Build and Deploy tab under Site configuration.
145
- - sample configuration:
146
- ```
147
- Base Directory: /
148
- Build command: npm run build
149
- Publish directory: /proxy/dist
150
- Functions directory: /proxy/src
151
- ```
147
+ - sample configuration for standalone Angular + proxy deployment:
148
+ ```
149
+ Base directory: /
150
+ Build command: npm run build
151
+ Publish directory: /proxy/dist
152
+ Functions directory: /proxy/src
153
+ ```
154
+ - Sample configuration for use within the context of [xmcloud-foundation-head](https://github.com/sitecorelabs/xmcloud-foundation-head):
155
+ ```
156
+ Base directory: /headapps/spa-starters/
157
+ Build command: npm run build
158
+ Publish directory: /headapps/spa-starters/proxy/dist
159
+ Functions directory: /headapps/spa-starters/proxy/src
160
+ ```
152
161
  NOTE: If `proxy/dist` folder is not picked up properly by Netlify make sure that the `PROXY_BUILD_PATH` env variable is unix style path e.g. `../proxy/dist`
153
162
 
154
163
  ### Deploy to Vercel
@@ -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.6.0-canary.1",
3
+ "version": "22.6.0-canary.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": "582aae74ef08bf73f000eebcd25f87067893810a"
68
+ "gitHead": "05def8420598c33ce7232b7440b92a17ef4f6903"
69
69
  }