create-sitecore-jss 22.6.0-canary.4 → 22.6.0-canary.41
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 -4
- package/dist/initializers/nextjs/index.js +2 -0
- package/dist/initializers/nextjs/prompts.js +11 -1
- package/dist/initializers/nextjs-xmcloud/index.js +2 -1
- package/dist/templates/angular/.eslintignore +3 -3
- package/dist/templates/angular/.eslintrc +66 -66
- package/dist/templates/angular/LICENSE.txt +202 -202
- package/dist/templates/angular/README.md +13 -13
- package/dist/templates/angular/angular.json +171 -171
- package/dist/templates/angular/e2e/tsconfig.e2e.json +15 -15
- package/dist/templates/angular/gitignore +52 -52
- package/dist/templates/angular/package.json +116 -116
- package/dist/templates/angular/scripts/temp/gitignore +2 -2
- package/dist/templates/angular/src/app/app.component.html +1 -1
- package/dist/templates/angular/src/app/components/content-block/content-block.component.html +4 -4
- package/dist/templates/angular/src/app/components/gitignore +7 -7
- package/dist/templates/angular/src/app/routing/layout/layout.component.html +17 -17
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +20 -20
- package/dist/templates/angular/src/app/routing/not-found/not-found.component.html +7 -7
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +1 -1
- package/dist/templates/angular/src/app/routing/server-error/server-error.component.html +3 -3
- package/dist/templates/angular/src/environments/gitignore +1 -1
- package/dist/templates/angular/src/index.html +12 -12
- package/dist/templates/angular/src/styles.css +34 -34
- package/dist/templates/angular/src/tsconfig.app.json +21 -21
- package/dist/templates/angular/src/tsconfig.server.json +20 -20
- package/dist/templates/angular/src/tsconfig.spec.json +24 -24
- package/dist/templates/angular/src/tsconfig.webpack-server.json +6 -6
- package/dist/templates/angular/tsconfig.json +38 -38
- package/dist/templates/angular-sxp/.env +2 -2
- package/dist/templates/angular-sxp/angular.json +13 -13
- package/dist/templates/angular-sxp/package.json +12 -12
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +69 -69
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +55 -55
- package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +47 -47
- package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.html +22 -22
- package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +5 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.html +19 -19
- package/dist/templates/angular-sxp/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +14 -14
- package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +19 -19
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +11 -11
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +26 -26
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +4 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +27 -27
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +10 -10
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +30 -30
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +17 -17
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +44 -44
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +11 -11
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +11 -11
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +13 -13
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.html +20 -20
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +52 -52
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +37 -37
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +12 -12
- package/dist/templates/angular-sxp/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +15 -15
- package/dist/templates/angular-sxp/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +8 -8
- package/dist/templates/angular-sxp/src/app/components/styleguide-section/styleguide-section.component.html +7 -7
- package/dist/templates/angular-sxp/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +3 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.html +175 -175
- package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +23 -23
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +3 -3
- package/dist/templates/angular-xmcloud/README.md +87 -87
- package/dist/templates/angular-xmcloud/angular.json +33 -33
- package/dist/templates/angular-xmcloud/package.json +17 -17
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +5 -5
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -14
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +36 -36
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +15 -15
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +23 -23
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +21 -21
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.html +5 -5
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.html +1 -1
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +21 -21
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +8 -8
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +11 -11
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +10 -10
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -38
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +48 -48
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +64 -64
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +31 -31
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +51 -51
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +150 -150
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +58 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +11 -11
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +9 -9
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +8 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +14 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +103 -103
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +8 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +121 -121
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +283 -283
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +16 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +10 -10
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +26 -26
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +58 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +14 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +7 -7
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +86 -86
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +101 -101
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +2 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +95 -95
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +14 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +27 -27
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +18 -18
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +51 -51
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +42 -42
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +19 -19
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +25 -25
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +16 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +11 -11
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +62 -62
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +16 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +5 -5
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +23 -23
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +66 -66
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +6 -6
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +17 -17
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +5 -5
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +27 -27
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +45 -45
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +20 -20
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +2 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +58 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +176 -176
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +85 -85
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +29 -29
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +20 -20
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +5 -5
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +8 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +40 -40
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +42 -42
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +3 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +63 -63
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +14 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +13 -13
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +2 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +30 -30
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +1 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +4 -4
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +5 -5
- package/dist/templates/nextjs/.eslintrc +31 -31
- package/dist/templates/nextjs/.gitattributes +11 -11
- package/dist/templates/nextjs/.graphql-let.yml +8 -8
- package/dist/templates/nextjs/.prettierrc +8 -8
- package/dist/templates/nextjs/.vscode/launch.json +15 -15
- package/dist/templates/nextjs/LICENSE.txt +202 -202
- package/dist/templates/nextjs/README.md +8 -8
- package/dist/templates/nextjs/gitignore +32 -32
- package/dist/templates/nextjs/package.json +87 -87
- package/dist/templates/nextjs/scripts/temp/gitignore +2 -2
- package/dist/templates/nextjs/sitecore/config/{{appName}}.config +165 -165
- package/dist/templates/nextjs/src/assets/app.css +36 -36
- package/dist/templates/nextjs/src/temp/GraphQLIntrospectionResult.json +22215 -22215
- package/dist/templates/nextjs/src/temp/gitignore +3 -3
- package/dist/templates/nextjs/tsconfig.json +38 -38
- package/dist/templates/nextjs/tsconfig.scripts.json +11 -11
- package/dist/templates/nextjs-styleguide/package.json +14 -14
- package/dist/templates/nextjs-styleguide/sitecore/definitions/components/graphql/GraphQL-IntegratedDemo.sitecore.graphql +71 -71
- package/dist/templates/nextjs-styleguide/sitecore/gitignore +3 -3
- package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.graphql +69 -69
- package/dist/templates/nextjs-sxa/package.json +11 -11
- package/dist/templates/nextjs-sxa/src/assets/basic/_component.scss +48 -48
- package/dist/templates/nextjs-sxa/src/assets/basic/_container.scss +64 -64
- package/dist/templates/nextjs-sxa/src/assets/basic/_fonts.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/basic/_footer.scss +31 -31
- package/dist/templates/nextjs-sxa/src/assets/basic/_header.scss +49 -49
- package/dist/templates/nextjs-sxa/src/assets/basic/_navigation.scss +150 -150
- package/dist/templates/nextjs-sxa/src/assets/basic/_promo.scss +58 -58
- package/dist/templates/nextjs-sxa/src/assets/basic/_rich-text.scss +11 -11
- package/dist/templates/nextjs-sxa/src/assets/basic/_variables.scss +9 -9
- package/dist/templates/nextjs-sxa/src/assets/basic/main.scss +8 -8
- package/dist/templates/nextjs-sxa/src/assets/main.scss +4 -4
- package/dist/templates/nextjs-sxa/src/assets/sass/_app.scss +103 -103
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/_functions.scss +8 -8
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/_mixins.scss +121 -121
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/_vars.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/vars/_colors.scss +283 -283
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/vars/_fontSizes.scss +16 -16
- package/dist/templates/nextjs-sxa/src/assets/sass/abstracts/vars/_margins.scss +10 -10
- package/dist/templates/nextjs-sxa/src/assets/sass/base/fonts/_fonts.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/base/fonts/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/base/index.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/base/links/_link-button.scss +26 -26
- package/dist/templates/nextjs-sxa/src/assets/sass/base/links/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/base/reset/_inputs.scss +58 -58
- package/dist/templates/nextjs-sxa/src/assets/sass/base/reset/_links.scss +14 -14
- package/dist/templates/nextjs-sxa/src/assets/sass/base/reset/_ui-datepicker.scss +7 -7
- package/dist/templates/nextjs-sxa/src/assets/sass/base/richtext/_richtext-files-icons.scss +86 -86
- package/dist/templates/nextjs-sxa/src/assets/sass/base/richtext/_richtext.scss +101 -101
- package/dist/templates/nextjs-sxa/src/assets/sass/base/richtext/index.scss +2 -2
- package/dist/templates/nextjs-sxa/src/assets/sass/base/typehead/_typehead.scss +95 -95
- package/dist/templates/nextjs-sxa/src/assets/sass/base/typehead/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-column-splitter.scss +14 -14
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss +27 -27
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-image.scss +18 -18
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-navigation.scss +51 -51
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-promo.scss +42 -42
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-richtext-content.scss +19 -19
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_alignment.scss +53 -53
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_boxed.scss +16 -16
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_clearfix.scss +11 -11
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_highlighted.scss +62 -62
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_link-button.scss +16 -16
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_promoted-box.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/index.scss +5 -5
- package/dist/templates/nextjs-sxa/src/assets/sass/components/container/_bordered.scss +23 -23
- package/dist/templates/nextjs-sxa/src/assets/sass/components/container/_title-row-box.scss +66 -66
- package/dist/templates/nextjs-sxa/src/assets/sass/components/container/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/image/_image-default-size.scss +6 -6
- package/dist/templates/nextjs-sxa/src/assets/sass/components/image/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/image-alignment/_image-left.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/components/image-alignment/_image-right.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/components/index.scss +17 -17
- package/dist/templates/nextjs-sxa/src/assets/sass/components/layout/_acaindent.scss +5 -5
- package/dist/templates/nextjs-sxa/src/assets/sass/components/layout/_background.scss +27 -27
- package/dist/templates/nextjs-sxa/src/assets/sass/components/layout/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/link-list/_component-link-list.scss +45 -45
- package/dist/templates/nextjs-sxa/src/assets/sass/components/link-list/_list-vertical.scss +20 -20
- package/dist/templates/nextjs-sxa/src/assets/sass/components/link-list/index.scss +2 -2
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/_navigation-fat.scss +58 -58
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/_navigation-main-horizontal-vertical.scss +176 -176
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/_navigation-mobile.scss +85 -85
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/_navigation-sidebar.scss +29 -29
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/_sitemap-navigation.scss +20 -20
- package/dist/templates/nextjs-sxa/src/assets/sass/components/navigation/index.scss +5 -5
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_absolute-bottom-link.scss +8 -8
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_promo-hero.scss +40 -40
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_promo-shadow.scss +42 -42
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/index.scss +3 -3
- package/dist/templates/nextjs-sxa/src/assets/sass/components/rich-text/_rich-text-lists.scss +63 -63
- package/dist/templates/nextjs-sxa/src/assets/sass/components/rich-text/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/spacing/_background-colors.scss +14 -14
- package/dist/templates/nextjs-sxa/src/assets/sass/components/spacing/_indent.scss +13 -13
- package/dist/templates/nextjs-sxa/src/assets/sass/components/spacing/index.scss +2 -2
- package/dist/templates/nextjs-sxa/src/assets/sass/components/title/_component-title.scss +30 -30
- package/dist/templates/nextjs-sxa/src/assets/sass/components/title/index.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/main.scss +4 -4
- package/dist/templates/nextjs-sxa/src/assets/sass/variants/index.scss +5 -5
- package/dist/templates/nextjs-sxa/src/components/ColumnSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Container.tsx +5 -5
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +9 -9
- package/dist/templates/nextjs-sxa/src/components/LinkList.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Navigation.tsx +2 -2
- package/dist/templates/nextjs-sxa/src/components/PageContent.tsx +3 -3
- package/dist/templates/nextjs-sxa/src/components/Promo.tsx +3 -3
- package/dist/templates/nextjs-sxa/src/components/RichText.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/RowSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +2 -2
- package/dist/templates/nextjs-sxa/src/pages/api/sitemap.ts +12 -12
- package/dist/templates/nextjs-xmcloud/.env +19 -19
- package/dist/templates/nextjs-xmcloud/package.json +8 -8
- package/dist/templates/nextjs-xmcloud/scripts/generate-component-builder/plugins/form.ts +24 -0
- package/dist/templates/nextjs-xmcloud/src/lib/next-config/plugins/monorepo-xmcloud.js +4 -0
- package/dist/templates/nextjs-xmcloud/src/pages/[[...path]].tsx +112 -0
- package/dist/templates/node-headless-ssr-experience-edge/README.md +56 -56
- package/dist/templates/node-headless-ssr-experience-edge/gitignore +19 -19
- package/dist/templates/node-headless-ssr-experience-edge/package.json +34 -34
- package/dist/templates/node-headless-ssr-experience-edge/tsconfig.json +22 -22
- package/dist/templates/node-headless-ssr-proxy/.vscode/launch.json +47 -47
- package/dist/templates/node-headless-ssr-proxy/LICENSE.txt +202 -202
- package/dist/templates/node-headless-ssr-proxy/README.md +65 -65
- package/dist/templates/node-headless-ssr-proxy/gitignore +19 -19
- package/dist/templates/node-headless-ssr-proxy/package.json +39 -39
- package/dist/templates/node-headless-ssr-proxy/src/error.html +200 -200
- package/dist/templates/node-headless-ssr-proxy/tsconfig.json +22 -22
- package/dist/templates/node-xmcloud-proxy/README.md +165 -165
- package/dist/templates/node-xmcloud-proxy/gitignore +33 -33
- package/dist/templates/node-xmcloud-proxy/package.json +26 -26
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -22
- package/dist/templates/react/.prettierrc +9 -9
- package/dist/templates/react/LICENSE.txt +202 -202
- package/dist/templates/react/README.md +2402 -2402
- package/dist/templates/react/gitignore +25 -25
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react/public/index.html +35 -35
- package/dist/templates/react/sitecore/config/{{appName}}.config +90 -90
- package/dist/templates/react/sitecore/definitions/components/graphql/GraphQL-IntegratedDemo.sitecore.graphql +71 -71
- package/dist/templates/react/sitecore/gitignore +2 -2
- package/dist/templates/react/src/assets/sc_logo.svg +52 -52
- package/dist/templates/react/src/components/graphql/query.graphql +69 -69
- package/dist/templates/react/src/temp/GraphQLFragmentTypes.json +207 -207
- package/dist/templates/react/src/temp/gitignore +3 -3
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/.browserslistrc +2 -2
- package/dist/templates/vue/.prettierrc +9 -9
- package/dist/templates/vue/LICENSE.txt +202 -202
- package/dist/templates/vue/README.md +36 -36
- package/dist/templates/vue/gitignore +25 -25
- package/dist/templates/vue/package.json +87 -87
- package/dist/templates/vue/public/index.html +27 -27
- package/dist/templates/vue/public/manifest.json +14 -14
- package/dist/templates/vue/public/robots.txt +2 -2
- package/dist/templates/vue/sitecore/config/{{appName}}.config +89 -89
- package/dist/templates/vue/sitecore/definitions/components/GraphQL-IntegratedDemo.sitecore.graphql +71 -71
- package/dist/templates/vue/sitecore/gitignore +4 -4
- package/dist/templates/vue/src/assets/app.css +30 -30
- package/dist/templates/vue/src/components/GraphQL/GraphQL-ConnectedDemo.query.graphql +69 -69
- package/dist/templates/vue/src/temp/GraphQLFragmentTypes.json +273 -273
- package/dist/templates/vue/src/temp/gitignore +3 -3
- package/package.json +2 -2
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
# Node XM Cloud Proxy
|
|
2
|
-
|
|
3
|
-
> Sitecore XM Cloud Proxy is in public beta.
|
|
4
|
-
> If you encounter any issues or bugs, please submit a new issue in the [JSS GitHub Repo](https://github.com/Sitecore/jss)
|
|
5
|
-
|
|
6
|
-
[Documentation](https://doc.sitecore.com/xmc/en/developers/jss/latest/jss-xmc/introducing-sitecore-javascript-rendering-sdk.html)
|
|
7
|
-
|
|
8
|
-
This Node.js-based proxy app is the backbone for enabling seamless integration between XM Cloud and various SPA frameworks like React, Angular, or Vue laying the groundwork for future JSS starter kits built for other front-end JavaScript frameworks. It acts as a middleware layer to handle critical functionalities such as server-side rendering (SSR), enabling editing and personalization, A/B/n component testing, and integrating Sitecore Forms. By serving as the rendering host, it ensures a smooth connection between Sitecore XM Cloud services and your front-end applications, making it easier to build dynamic, personalized, and localized experiences for users.
|
|
9
|
-
|
|
10
|
-
This is a sample setup showing how you can configure XM Cloud rendering server on top of Node.js and Express.js
|
|
11
|
-
|
|
12
|
-
## Features Supported
|
|
13
|
-
|
|
14
|
-
- `Context ID`: the Context ID environment variable simplifies setting up and configuring XM Cloud solutions. It's a unified identifier that maps to all your configured resources, such as content, sites, files, forms, and integration settings.
|
|
15
|
-
|
|
16
|
-
- `XM Cloud Pages editing integration`: full integration with Pages - the dynamic visual page editor of XM Cloud.
|
|
17
|
-
|
|
18
|
-
- `XM Cloud proxy personalization` with embedded personalization and Component A/B/n Testing support.
|
|
19
|
-
|
|
20
|
-
- `Forms support`: provides the capability to consume and post Sitecore Forms from JSS apps. Sitecore Forms enables marketers to author their own forms, collect data, and analyze form performance.
|
|
21
|
-
|
|
22
|
-
- `Internationalization` support.
|
|
23
|
-
|
|
24
|
-
> The following features and integrations are not supported by Node XM Cloud Proxy:
|
|
25
|
-
> - Multisite
|
|
26
|
-
> - The XM Cloud Components application
|
|
27
|
-
> - BYOC components
|
|
28
|
-
> - SXA sitemap, redirects, error pages
|
|
29
|
-
> - Sitecore Experience Editor
|
|
30
|
-
|
|
31
|
-
## Getting Started
|
|
32
|
-
|
|
33
|
-
Here are the main configurations defined in the `config.ts` file in the node XM Cloud proxy app:
|
|
34
|
-
|
|
35
|
-
- Server Bundle Configuration:
|
|
36
|
-
|
|
37
|
-
- The app loads a `server.bundle.js` file, pre-built from your SPA app.
|
|
38
|
-
- This file contains the required configuration options.
|
|
39
|
-
- GraphQL Endpoint Setup:
|
|
40
|
-
|
|
41
|
-
- Defines a graphQLEndpoint for handling Sitecore GraphQL requests. It differentiates between production (Sitecore Edge) and development (Sitecore CM) endpoints.
|
|
42
|
-
- Constructs the target URL and path for proxy requests, ensuring compliance with http-proxy-middleware requirements.
|
|
43
|
-
|
|
44
|
-
- Port Configuration:
|
|
45
|
-
|
|
46
|
-
- Configures the port for running the proxy, with a default of 3000 or an environment-specified port.
|
|
47
|
-
|
|
48
|
-
- Personalization Configuration (personalizeConfig):
|
|
49
|
-
|
|
50
|
-
- Sets up Sitecore personalization through PersonalizeConfig, defining settings for both Sitecore Experience Edge and CDP endpoints.
|
|
51
|
-
- Contains options to control personalization features, including:
|
|
52
|
-
- Timeouts for Edge and CDP endpoints (default 400ms, configurable via environment variables).
|
|
53
|
-
- Scope and site name used for Sitecore Personalize.
|
|
54
|
-
- Enable/Disable Switch: Functions that allow you to conditionally disable personalization based on the environment (such as disabling it in development mode) and and cookie consent policy.
|
|
55
|
-
- Language Configuration: defaultLanguage serves as a fallback if language data is unavailable in layout data.
|
|
56
|
-
|
|
57
|
-
This configuration is designed to be flexible and secure, with dynamic settings managed via environment variables where appropriate.
|
|
58
|
-
|
|
59
|
-
### Environment Variables
|
|
60
|
-
|
|
61
|
-
The following environment variables can be used to configure the Node XM Cloud Proxy app instead of modifying config.js. You can use the .env file located in the root of the app or set these directly in the environment (for example, in containers).
|
|
62
|
-
|
|
63
|
-
| Parameter | Description |
|
|
64
|
-
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
-
| `PROXY_BUNDLE_PATH` | Path to the JSS SPA app's `server.bundle.js`. Default can be seen in [config.ts](./src/config.ts). |
|
|
66
|
-
| `PROXY_PORT` | Optional. Port which will be used when start sample. Default can be seen in [config.ts](./src/config.ts). |
|
|
67
|
-
| `DEBUG` | Optional. Debug level for the proxy. Set the DEBUG environment variable to 'sitecore-jss:_,proxy_,http-proxy-middleware\*, 'sitecore-jss:layout','sitecore-jss:personalize' to see all logs. |
|
|
68
|
-
| `JSS_EDITING_SECRET` | Required when working with the Sitecore Editor to secure the `/api/editing/render` endpoint exposed by your proxy app. An alphanumeric value of at least 16 characters is recommended. |
|
|
69
|
-
| `PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT=` | Optional. Timeout (ms) for Sitecore CDP requests to respond within. Default is 400. |
|
|
70
|
-
| `PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT` | Optional. Timeout (ms) for Sitecore Experience Edge requests to respond within. Default is 400. |
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## Pre-requisites
|
|
74
|
-
|
|
75
|
-
1. SPA application supports XM Cloud out of the box.
|
|
76
|
-
|
|
77
|
-
2. Build your SPA application bundle with `jss build` or `npm run build`. The build output should be placed in the `dist` folder.
|
|
78
|
-
|
|
79
|
-
## Run
|
|
80
|
-
|
|
81
|
-
1. Run `npm install`
|
|
82
|
-
|
|
83
|
-
2. Run `npm run start`
|
|
84
|
-
|
|
85
|
-
If the operation is successful, you’ll see the following message:
|
|
86
|
-
`server listening on port 3000!`.
|
|
87
|
-
|
|
88
|
-
## Deployment options
|
|
89
|
-
|
|
90
|
-
### Deploy to Netlify
|
|
91
|
-
|
|
92
|
-
Follow these steps to deploy your application to Netlify. The deployed site can be used as an editing host in XM Cloud.
|
|
93
|
-
|
|
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
|
-
3. Configure `serverless-http`:
|
|
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:
|
|
115
|
-
```
|
|
116
|
-
import serverless from 'serverless-http';
|
|
117
|
-
...
|
|
118
|
-
export const handler = serverless(server);
|
|
119
|
-
```
|
|
120
|
-
4. Create a `netlify.toml` file and ensure that the following Netlify configuration is added there:
|
|
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
|
-
|
|
143
|
-
5. Create your [Netlify deployment](https://www.netlify.com/blog/2016/09/29/a-step-by-step-guide-deploying-on-netlify/):
|
|
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.
|
|
146
|
-
- Configure your build settings in the Build and Deploy tab under Site configuration.
|
|
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
|
-
```
|
|
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`
|
|
162
|
-
|
|
163
|
-
### Deploy to Vercel
|
|
164
|
-
|
|
165
|
-
> Deployment to Vercel is not yet supported.
|
|
1
|
+
# Node XM Cloud Proxy
|
|
2
|
+
|
|
3
|
+
> Sitecore XM Cloud Proxy is in public beta.
|
|
4
|
+
> If you encounter any issues or bugs, please submit a new issue in the [JSS GitHub Repo](https://github.com/Sitecore/jss)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://doc.sitecore.com/xmc/en/developers/jss/latest/jss-xmc/introducing-sitecore-javascript-rendering-sdk.html)
|
|
7
|
+
|
|
8
|
+
This Node.js-based proxy app is the backbone for enabling seamless integration between XM Cloud and various SPA frameworks like React, Angular, or Vue laying the groundwork for future JSS starter kits built for other front-end JavaScript frameworks. It acts as a middleware layer to handle critical functionalities such as server-side rendering (SSR), enabling editing and personalization, A/B/n component testing, and integrating Sitecore Forms. By serving as the rendering host, it ensures a smooth connection between Sitecore XM Cloud services and your front-end applications, making it easier to build dynamic, personalized, and localized experiences for users.
|
|
9
|
+
|
|
10
|
+
This is a sample setup showing how you can configure XM Cloud rendering server on top of Node.js and Express.js
|
|
11
|
+
|
|
12
|
+
## Features Supported
|
|
13
|
+
|
|
14
|
+
- `Context ID`: the Context ID environment variable simplifies setting up and configuring XM Cloud solutions. It's a unified identifier that maps to all your configured resources, such as content, sites, files, forms, and integration settings.
|
|
15
|
+
|
|
16
|
+
- `XM Cloud Pages editing integration`: full integration with Pages - the dynamic visual page editor of XM Cloud.
|
|
17
|
+
|
|
18
|
+
- `XM Cloud proxy personalization` with embedded personalization and Component A/B/n Testing support.
|
|
19
|
+
|
|
20
|
+
- `Forms support`: provides the capability to consume and post Sitecore Forms from JSS apps. Sitecore Forms enables marketers to author their own forms, collect data, and analyze form performance.
|
|
21
|
+
|
|
22
|
+
- `Internationalization` support.
|
|
23
|
+
|
|
24
|
+
> The following features and integrations are not supported by Node XM Cloud Proxy:
|
|
25
|
+
> - Multisite
|
|
26
|
+
> - The XM Cloud Components application
|
|
27
|
+
> - BYOC components
|
|
28
|
+
> - SXA sitemap, redirects, error pages
|
|
29
|
+
> - Sitecore Experience Editor
|
|
30
|
+
|
|
31
|
+
## Getting Started
|
|
32
|
+
|
|
33
|
+
Here are the main configurations defined in the `config.ts` file in the node XM Cloud proxy app:
|
|
34
|
+
|
|
35
|
+
- Server Bundle Configuration:
|
|
36
|
+
|
|
37
|
+
- The app loads a `server.bundle.js` file, pre-built from your SPA app.
|
|
38
|
+
- This file contains the required configuration options.
|
|
39
|
+
- GraphQL Endpoint Setup:
|
|
40
|
+
|
|
41
|
+
- Defines a graphQLEndpoint for handling Sitecore GraphQL requests. It differentiates between production (Sitecore Edge) and development (Sitecore CM) endpoints.
|
|
42
|
+
- Constructs the target URL and path for proxy requests, ensuring compliance with http-proxy-middleware requirements.
|
|
43
|
+
|
|
44
|
+
- Port Configuration:
|
|
45
|
+
|
|
46
|
+
- Configures the port for running the proxy, with a default of 3000 or an environment-specified port.
|
|
47
|
+
|
|
48
|
+
- Personalization Configuration (personalizeConfig):
|
|
49
|
+
|
|
50
|
+
- Sets up Sitecore personalization through PersonalizeConfig, defining settings for both Sitecore Experience Edge and CDP endpoints.
|
|
51
|
+
- Contains options to control personalization features, including:
|
|
52
|
+
- Timeouts for Edge and CDP endpoints (default 400ms, configurable via environment variables).
|
|
53
|
+
- Scope and site name used for Sitecore Personalize.
|
|
54
|
+
- Enable/Disable Switch: Functions that allow you to conditionally disable personalization based on the environment (such as disabling it in development mode) and and cookie consent policy.
|
|
55
|
+
- Language Configuration: defaultLanguage serves as a fallback if language data is unavailable in layout data.
|
|
56
|
+
|
|
57
|
+
This configuration is designed to be flexible and secure, with dynamic settings managed via environment variables where appropriate.
|
|
58
|
+
|
|
59
|
+
### Environment Variables
|
|
60
|
+
|
|
61
|
+
The following environment variables can be used to configure the Node XM Cloud Proxy app instead of modifying config.js. You can use the .env file located in the root of the app or set these directly in the environment (for example, in containers).
|
|
62
|
+
|
|
63
|
+
| Parameter | Description |
|
|
64
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| `PROXY_BUNDLE_PATH` | Path to the JSS SPA app's `server.bundle.js`. Default can be seen in [config.ts](./src/config.ts). |
|
|
66
|
+
| `PROXY_PORT` | Optional. Port which will be used when start sample. Default can be seen in [config.ts](./src/config.ts). |
|
|
67
|
+
| `DEBUG` | Optional. Debug level for the proxy. Set the DEBUG environment variable to 'sitecore-jss:_,proxy_,http-proxy-middleware\*, 'sitecore-jss:layout','sitecore-jss:personalize' to see all logs. |
|
|
68
|
+
| `JSS_EDITING_SECRET` | Required when working with the Sitecore Editor to secure the `/api/editing/render` endpoint exposed by your proxy app. An alphanumeric value of at least 16 characters is recommended. |
|
|
69
|
+
| `PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT=` | Optional. Timeout (ms) for Sitecore CDP requests to respond within. Default is 400. |
|
|
70
|
+
| `PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT` | Optional. Timeout (ms) for Sitecore Experience Edge requests to respond within. Default is 400. |
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Pre-requisites
|
|
74
|
+
|
|
75
|
+
1. SPA application supports XM Cloud out of the box.
|
|
76
|
+
|
|
77
|
+
2. Build your SPA application bundle with `jss build` or `npm run build`. The build output should be placed in the `dist` folder.
|
|
78
|
+
|
|
79
|
+
## Run
|
|
80
|
+
|
|
81
|
+
1. Run `npm install`
|
|
82
|
+
|
|
83
|
+
2. Run `npm run start`
|
|
84
|
+
|
|
85
|
+
If the operation is successful, you’ll see the following message:
|
|
86
|
+
`server listening on port 3000!`.
|
|
87
|
+
|
|
88
|
+
## Deployment options
|
|
89
|
+
|
|
90
|
+
### Deploy to Netlify
|
|
91
|
+
|
|
92
|
+
Follow these steps to deploy your application to Netlify. The deployed site can be used as an editing host in XM Cloud.
|
|
93
|
+
|
|
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
|
+
3. Configure `serverless-http`:
|
|
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:
|
|
115
|
+
```
|
|
116
|
+
import serverless from 'serverless-http';
|
|
117
|
+
...
|
|
118
|
+
export const handler = serverless(server);
|
|
119
|
+
```
|
|
120
|
+
4. Create a `netlify.toml` file and ensure that the following Netlify configuration is added there:
|
|
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
|
+
|
|
143
|
+
5. Create your [Netlify deployment](https://www.netlify.com/blog/2016/09/29/a-step-by-step-guide-deploying-on-netlify/):
|
|
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.
|
|
146
|
+
- Configure your build settings in the Build and Deploy tab under Site configuration.
|
|
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
|
+
```
|
|
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`
|
|
162
|
+
|
|
163
|
+
### Deploy to Vercel
|
|
164
|
+
|
|
165
|
+
> Deployment to Vercel is not yet supported.
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# compiled output
|
|
4
|
-
/dist
|
|
5
|
-
|
|
6
|
-
# dependencies
|
|
7
|
-
/node_modules
|
|
8
|
-
|
|
9
|
-
# local env files
|
|
10
|
-
.env.local
|
|
11
|
-
.env.*.local
|
|
12
|
-
|
|
13
|
-
# IDE - VSCode
|
|
14
|
-
.vscode/*
|
|
15
|
-
!.vscode/settings.json
|
|
16
|
-
!.vscode/tasks.json
|
|
17
|
-
!.vscode/launch.json
|
|
18
|
-
!.vscode/extensions.json
|
|
19
|
-
|
|
20
|
-
# misc
|
|
21
|
-
/connect.lock
|
|
22
|
-
/libpeerconnection.log
|
|
23
|
-
npm-debug.log
|
|
24
|
-
testem.log
|
|
25
|
-
/typings
|
|
26
|
-
|
|
27
|
-
# System Files
|
|
28
|
-
.DS_Store
|
|
29
|
-
Thumbs.db
|
|
30
|
-
|
|
31
|
-
# deploy platforms
|
|
32
|
-
.vercel
|
|
33
|
-
.netlify
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# compiled output
|
|
4
|
+
/dist
|
|
5
|
+
|
|
6
|
+
# dependencies
|
|
7
|
+
/node_modules
|
|
8
|
+
|
|
9
|
+
# local env files
|
|
10
|
+
.env.local
|
|
11
|
+
.env.*.local
|
|
12
|
+
|
|
13
|
+
# IDE - VSCode
|
|
14
|
+
.vscode/*
|
|
15
|
+
!.vscode/settings.json
|
|
16
|
+
!.vscode/tasks.json
|
|
17
|
+
!.vscode/launch.json
|
|
18
|
+
!.vscode/extensions.json
|
|
19
|
+
|
|
20
|
+
# misc
|
|
21
|
+
/connect.lock
|
|
22
|
+
/libpeerconnection.log
|
|
23
|
+
npm-debug.log
|
|
24
|
+
testem.log
|
|
25
|
+
/typings
|
|
26
|
+
|
|
27
|
+
# System Files
|
|
28
|
+
.DS_Store
|
|
29
|
+
Thumbs.db
|
|
30
|
+
|
|
31
|
+
# deploy platforms
|
|
32
|
+
.vercel
|
|
33
|
+
.netlify
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "node-xmcloud-sample",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Node XM Cloud Proxy sample for running XM Cloud JSS SPA apps",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Sitecore Corporation",
|
|
7
|
-
"url": "https://jss.sitecore.com"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "ts-node ./src/index.ts"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@sitecore-jss/sitecore-jss-proxy": "
|
|
14
|
-
"compression": "^1.7.4",
|
|
15
|
-
"express": "^4.18.2",
|
|
16
|
-
"dotenv": "^16.0.3",
|
|
17
|
-
"http-proxy-middleware": "^3.0.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@sitecore-jss/sitecore-jss": "
|
|
21
|
-
"@types/compression": "^1.7.2",
|
|
22
|
-
"@types/express": "^4.17.17",
|
|
23
|
-
"ts-node": "^10.9.1",
|
|
24
|
-
"typescript": "~5.6.3"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "node-xmcloud-sample",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Node XM Cloud Proxy sample for running XM Cloud JSS SPA apps",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Sitecore Corporation",
|
|
7
|
+
"url": "https://jss.sitecore.com"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "ts-node ./src/index.ts"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@sitecore-jss/sitecore-jss-proxy": "<%- version %>",
|
|
14
|
+
"compression": "^1.7.4",
|
|
15
|
+
"express": "^4.18.2",
|
|
16
|
+
"dotenv": "^16.0.3",
|
|
17
|
+
"http-proxy-middleware": "^3.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@sitecore-jss/sitecore-jss": "<%- version %>",
|
|
21
|
+
"@types/compression": "^1.7.2",
|
|
22
|
+
"@types/express": "^4.17.17",
|
|
23
|
+
"ts-node": "^10.9.1",
|
|
24
|
+
"typescript": "~5.6.3"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"newLine": "LF",
|
|
4
|
-
"emitDecoratorMetadata": true,
|
|
5
|
-
"experimentalDecorators": true,
|
|
6
|
-
"noFallthroughCasesInSwitch": true,
|
|
7
|
-
"rootDir": ".",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"noImplicitAny": true,
|
|
12
|
-
"noUnusedLocals": true,
|
|
13
|
-
"noUnusedParameters": true,
|
|
14
|
-
"noImplicitReturns": true,
|
|
15
|
-
"strictFunctionTypes": false,
|
|
16
|
-
"downlevelIteration": true,
|
|
17
|
-
"moduleResolution": "node",
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"allowSyntheticDefaultImports": true
|
|
20
|
-
},
|
|
21
|
-
"exclude": ["node_modules", "dist"]
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"newLine": "LF",
|
|
4
|
+
"emitDecoratorMetadata": true,
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"noFallthroughCasesInSwitch": true,
|
|
7
|
+
"rootDir": ".",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"noImplicitAny": true,
|
|
12
|
+
"noUnusedLocals": true,
|
|
13
|
+
"noUnusedParameters": true,
|
|
14
|
+
"noImplicitReturns": true,
|
|
15
|
+
"strictFunctionTypes": false,
|
|
16
|
+
"downlevelIteration": true,
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"allowSyntheticDefaultImports": true
|
|
20
|
+
},
|
|
21
|
+
"exclude": ["node_modules", "dist"]
|
|
22
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"endOfLine": "crlf",
|
|
3
|
-
"semi": true,
|
|
4
|
-
"singleQuote": true,
|
|
5
|
-
"tabWidth": 2,
|
|
6
|
-
"useTabs": false,
|
|
7
|
-
"trailingComma": "es5",
|
|
8
|
-
"printWidth": 100
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"endOfLine": "crlf",
|
|
3
|
+
"semi": true,
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"tabWidth": 2,
|
|
6
|
+
"useTabs": false,
|
|
7
|
+
"trailingComma": "es5",
|
|
8
|
+
"printWidth": 100
|
|
9
|
+
}
|