create-sitecore-jss 22.2.0-canary.83 → 22.3.0-canary.1
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/bin.js +35 -19
- package/dist/common/index.js +5 -3
- package/dist/common/processes/install.js +9 -2
- package/dist/common/processes/next.js +6 -3
- package/dist/common/processes/transform.js +18 -13
- package/dist/common/prompts/base.js +0 -25
- package/dist/common/prompts/proxy.js +35 -0
- package/dist/common/prompts/sxp.js +34 -0
- package/dist/common/utils/helpers.js +29 -19
- package/dist/init-runner.js +16 -11
- package/dist/initializers/angular/index.js +13 -0
- package/dist/initializers/angular/prompts.js +22 -1
- package/dist/initializers/angular-sxp/index.js +62 -0
- package/dist/initializers/angular-xmcloud/index.js +80 -0
- package/dist/initializers/nextjs/index.js +2 -2
- package/dist/initializers/nextjs/prompts.js +2 -0
- package/dist/initializers/nextjs/remove-dev-dependencies.js +2 -2
- package/dist/initializers/nextjs-multisite/index.js +1 -1
- package/dist/initializers/nextjs-styleguide/index.js +1 -1
- package/dist/initializers/nextjs-styleguide-tracking/index.js +1 -1
- package/dist/initializers/nextjs-sxa/index.js +1 -1
- package/dist/initializers/nextjs-xmcloud/index.js +1 -1
- package/dist/initializers/node-xmcloud-proxy/index.js +33 -0
- package/dist/initializers/react/index.js +3 -3
- package/dist/initializers/react/prompts.js +1 -1
- package/dist/initializers/react-native/prompts.js +1 -0
- package/dist/initializers/vue/prompts.js +1 -1
- package/dist/templates/angular/.env +4 -3
- package/dist/templates/angular/.eslintrc +1 -0
- package/dist/templates/angular/README.md +5 -45
- package/dist/templates/angular/angular.json +1 -6
- package/dist/templates/angular/gitignore +5 -0
- package/dist/templates/angular/package.json +11 -23
- package/dist/templates/angular/proxy.conf.js +5 -23
- package/dist/templates/angular/scripts/bootstrap.ts +5 -24
- package/dist/templates/angular/scripts/config/index.ts +28 -0
- package/dist/templates/angular/scripts/config/plugins/computed.ts +21 -0
- package/dist/templates/angular/scripts/config/plugins/fallback.ts +22 -0
- package/dist/templates/angular/scripts/config/plugins/package-json.ts +22 -0
- package/dist/templates/angular/scripts/config/plugins/scjssconfig.ts +29 -0
- package/dist/templates/angular/scripts/generate-component-factory/index.ts +45 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/component-factory.ts +147 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/components.ts +19 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/packages.ts +29 -0
- package/dist/templates/angular/scripts/generate-component-factory/template.ts +46 -0
- package/dist/templates/angular/scripts/generate-config.ts +71 -72
- package/dist/templates/angular/scripts/generate-plugins.ts +33 -0
- package/dist/templates/angular/scripts/temp/gitignore +2 -0
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +21 -28
- package/dist/templates/angular/server.bundle.ts +3 -5
- package/dist/templates/angular/server.exports.ts +13 -0
- package/dist/templates/angular/src/app/JssState.ts +2 -9
- package/dist/templates/angular/src/app/app.module.ts +5 -6
- package/dist/templates/angular/src/app/app.server.module.ts +9 -6
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +4 -19
- package/dist/templates/angular/src/app/components/gitignore +1 -1
- package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +15 -7
- package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +14 -2
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +4 -4
- package/dist/templates/angular/src/app/jss-context.service.ts +14 -11
- package/dist/templates/angular/src/app/jss-graphql.service.ts +7 -7
- package/dist/templates/angular/src/app/layout/jss-layout.service.ts +2 -2
- package/dist/templates/angular/src/app/lib/config.ts +16 -0
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +24 -13
- package/dist/templates/angular/src/app/lib/graphql-client-factory/config.ts +21 -0
- package/dist/templates/angular/src/app/lib/graphql-client-factory/index.ts +16 -0
- package/dist/templates/angular/src/app/lib/layout-service-factory.ts +20 -12
- package/dist/templates/angular/src/app/routing/layout/layout.component.html +1 -1
- package/dist/templates/angular/src/app/routing/layout/layout.component.ts +11 -11
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +5 -6
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +1 -2
- package/dist/templates/angular/src/app/routing/routing.module.ts +14 -21
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +1 -0
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.ts +7 -0
- package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +8 -0
- package/dist/templates/angular/src/environments/gitignore +2 -1
- package/dist/templates/angular/src/graphql-fragment-types.ts +0 -95
- package/dist/templates/angular/tsconfig.json +7 -2
- package/dist/templates/angular-sxp/.env +2 -0
- package/dist/templates/angular-sxp/package.json +12 -0
- package/dist/templates/angular-sxp/proxy.conf.js +43 -0
- package/dist/templates/angular-sxp/scripts/config/plugins/disconnected.ts +29 -0
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +35 -0
- package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +1 -1
- package/dist/templates/{angular → angular-sxp}/src/app/jss-data-fetcher.service.ts +3 -1
- package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +23 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +3 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +9 -0
- package/dist/templates/{angular/src/app/routing → angular-sxp/src/app/routing/scripts}/visitor-identification/visitor-identification.component.ts +9 -3
- package/dist/templates/angular-sxp/src/graphql-fragment-types.ts +219 -0
- package/dist/templates/angular-xmcloud/.env +21 -0
- package/dist/templates/angular-xmcloud/angular.json +33 -0
- package/dist/templates/angular-xmcloud/package.json +17 -0
- package/dist/templates/angular-xmcloud/scripts/bootstrap.ts +28 -0
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +39 -0
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/plugins/packages.ts +34 -0
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +57 -0
- package/dist/templates/angular-xmcloud/scripts/generate-metadata.ts +25 -0
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +15 -0
- package/dist/templates/angular-xmcloud/server.exports.ts +24 -0
- package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +40 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +30 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +36 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +67 -0
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +41 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +23 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +65 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +49 -0
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +39 -0
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.html +1 -0
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +13 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +8 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +11 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +35 -0
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +10 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +56 -0
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +55 -0
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +17 -0
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory/config.ts +58 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +104 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +77 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +48 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +12 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +48 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +64 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +31 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +51 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +150 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +10 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +103 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +121 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +283 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +26 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +7 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +86 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +101 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +95 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +27 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +18 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +51 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +42 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +19 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +26 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +63 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +24 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +66 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +17 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +5 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +27 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +45 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +20 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +176 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +85 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +29 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +20 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +5 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +40 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +42 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +63 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +13 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +30 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +4 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/link-list/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/navigation/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/page-content/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/promo/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/rich-text/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/title/index.scss +0 -0
- package/dist/templates/nextjs/package.json +4 -4
- package/dist/templates/nextjs/scripts/config/plugins/fallback.ts +0 -1
- package/dist/templates/nextjs/scripts/generate-config.ts +8 -1
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-styleguide/scripts/config/plugins/disconnected.ts +1 -0
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_alignment.scss +34 -7
- package/dist/templates/node-headless-ssr-experience-edge/gitignore +19 -0
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/gitignore +19 -0
- package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
- package/dist/templates/node-headless-ssr-proxy/src/config.ts +3 -3
- package/dist/templates/node-headless-ssr-proxy/src/httpAgents.ts +2 -2
- package/dist/templates/node-headless-ssr-proxy/src/index.ts +9 -2
- package/dist/templates/node-xmcloud-proxy/.env +14 -0
- package/dist/templates/node-xmcloud-proxy/README.md +36 -0
- package/dist/templates/node-xmcloud-proxy/gitignore +33 -0
- package/dist/templates/node-xmcloud-proxy/package.json +26 -0
- package/dist/templates/node-xmcloud-proxy/src/config.ts +25 -0
- package/dist/templates/node-xmcloud-proxy/src/index.ts +210 -0
- package/dist/templates/node-xmcloud-proxy/src/types.ts +27 -0
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -0
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react/scripts/generate-config.js +10 -3
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/package.json +4 -4
- package/dist/templates/vue/scripts/generate-config.js +5 -0
- package/package.json +2 -2
- package/dist/templates/angular/scripts/generate-component-factory.ts +0 -166
- package/dist/templates/angular/src/app/lib/client-factory.ts +0 -28
- /package/dist/templates/{angular → angular-sxp}/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/component-content/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/dictionary/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/dictionary/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/files/jss.pdf +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/img/jss_logo.png +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/img/sc_logo.png +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/custom-route-type/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/scripts/disconnected-mode-proxy.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/scripts/lint-yml.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/config/{{appName}}.config +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/component-content.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Reuse.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs-Tab.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Multilingual.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Section.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/content-block.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-connected-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-layout.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-angular-lazy-loading.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-component-params.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-custom-route-type.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-edit-frame.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-checkbox.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-content-list.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-custom.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-date.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-file.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-image.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-item-link.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-link.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-number.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-rich-text.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-text.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-route-fields.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-sitecore-context.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-tracking.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/config.js +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/content.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/dictionary.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/placeholders.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/routes.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/Styleguide-Explanatory-Component.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-content-list-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-edit-frame-list-item-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-item-link-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/pipelines/example.patch.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const path_1 = __importStar(require("path"));
|
|
39
|
+
const common_1 = require("../../common");
|
|
40
|
+
const proxy_1 = require("../../common/prompts/proxy");
|
|
41
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
42
|
+
const helpers_1 = require("../../common/utils/helpers");
|
|
43
|
+
class AngularXmCloudInitializer {
|
|
44
|
+
get isBase() {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
init(args) {
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
51
|
+
const addInitializers = [];
|
|
52
|
+
// angular-xmcloud requires node-xmcloud-proxy
|
|
53
|
+
if (!args.templates.includes('node-xmcloud-proxy')) {
|
|
54
|
+
addInitializers.push('node-xmcloud-proxy');
|
|
55
|
+
}
|
|
56
|
+
// ensure args.proxyAppDestination is populated
|
|
57
|
+
const promptArgs = {
|
|
58
|
+
yes: args.yes,
|
|
59
|
+
destination: args.destination,
|
|
60
|
+
proxyName: 'node-xmcloud-proxy',
|
|
61
|
+
proxyAppDestination: args.proxyAppDestination,
|
|
62
|
+
};
|
|
63
|
+
const proxyDetails = yield inquirer_1.default.prompt(proxy_1.proxyPrompts, promptArgs);
|
|
64
|
+
args.proxyAppDestination = proxyDetails.proxyAppDestination;
|
|
65
|
+
const finalArgs = Object.assign(Object.assign(Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false }), proxyDetails), { relativeProxyAppDestination: (0, helpers_1.getRelativeProxyDestination)(args.destination, args.proxyAppDestination) });
|
|
66
|
+
const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-xmcloud');
|
|
67
|
+
yield (0, common_1.transform)(templatePath, finalArgs);
|
|
68
|
+
if (args.templates.includes('angular-sxp') || ((_d = (_c = pkg.config) === null || _c === void 0 ? void 0 : _c.templates) === null || _d === void 0 ? void 0 : _d.includes('angular-sxp'))) {
|
|
69
|
+
console.log((0, common_1.incompatibleAddonsMsg)('angular-xmcloud', 'angular-sxp'));
|
|
70
|
+
}
|
|
71
|
+
const response = {
|
|
72
|
+
nextSteps: [],
|
|
73
|
+
appName: args.appName || common_1.DEFAULT_APPNAME,
|
|
74
|
+
initializers: addInitializers,
|
|
75
|
+
};
|
|
76
|
+
return response;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.default = AngularXmCloudInitializer;
|
|
@@ -105,9 +105,9 @@ class NextjsInitializer {
|
|
|
105
105
|
}
|
|
106
106
|
if (!addInitializers.includes('nextjs-styleguide') &&
|
|
107
107
|
!args.templates.includes('nextjs-styleguide')) {
|
|
108
|
-
const pkg = (0, common_1.
|
|
108
|
+
const pkg = (0, common_1.openJsonFile)(pkgPath);
|
|
109
109
|
pkg.scripts.bootstrap = pkg.scripts.bootstrap.replace(' && graphql-let', '');
|
|
110
|
-
(0, common_1.
|
|
110
|
+
(0, common_1.writeJsonFile)(pkg, pkgPath);
|
|
111
111
|
}
|
|
112
112
|
const response = {
|
|
113
113
|
nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
|
|
@@ -12,8 +12,10 @@ var Prerender;
|
|
|
12
12
|
Prerender["SSR"] = "SSR";
|
|
13
13
|
})(Prerender = exports.Prerender || (exports.Prerender = {}));
|
|
14
14
|
const DEFAULT_PRERENDER = Prerender.SSG;
|
|
15
|
+
// still need sxp prompts here until sitecore/config is no longer added to xmc app
|
|
15
16
|
exports.prompts = [
|
|
16
17
|
...common_1.clientAppPrompts,
|
|
18
|
+
...common_1.sxpPrompts,
|
|
17
19
|
{
|
|
18
20
|
type: 'list',
|
|
19
21
|
name: 'prerender',
|
|
@@ -10,10 +10,10 @@ const common_1 = require("../../common");
|
|
|
10
10
|
const removeDevDependencies = (projectPath) => {
|
|
11
11
|
// remove `next-transpile-modules` dependency
|
|
12
12
|
const packagePath = path_1.default.join(projectPath, 'package.json');
|
|
13
|
-
const pkg = (0, common_1.
|
|
13
|
+
const pkg = (0, common_1.openJsonFile)(packagePath);
|
|
14
14
|
if (pkg === null || pkg === void 0 ? void 0 : pkg.devDependencies['next-transpile-modules']) {
|
|
15
15
|
delete pkg.devDependencies['next-transpile-modules'];
|
|
16
|
-
(0, common_1.
|
|
16
|
+
(0, common_1.writeJsonFile)(pkg, packagePath);
|
|
17
17
|
}
|
|
18
18
|
// remove monorepo next.config.js plugin
|
|
19
19
|
const monorepoPlugin = path_1.default.join(projectPath, 'src/lib/next-config/plugins/monorepo.js');
|
|
@@ -41,7 +41,7 @@ class NextjsMultisiteInitializer {
|
|
|
41
41
|
init(args) {
|
|
42
42
|
var _a, _b;
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const pkg = (0, common_1.
|
|
44
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
45
45
|
const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
|
|
46
46
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-multisite');
|
|
47
47
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
@@ -46,7 +46,7 @@ class NextjsStyleguideInitializer {
|
|
|
46
46
|
init(args) {
|
|
47
47
|
var _a, _b;
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
const pkg = (0, common_1.
|
|
49
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
50
50
|
const answers = yield inquirer_1.default.prompt(common_1.styleguidePrompts, args);
|
|
51
51
|
const mergedArgs = Object.assign(Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false }), answers);
|
|
52
52
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-styleguide');
|
|
@@ -41,7 +41,7 @@ class NextjsStyleguideInitializer {
|
|
|
41
41
|
init(args) {
|
|
42
42
|
var _a, _b, _c, _d, _e, _f;
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const pkg = (0, common_1.
|
|
44
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
45
45
|
const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
|
|
46
46
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-styleguide-tracking');
|
|
47
47
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
@@ -41,7 +41,7 @@ class NextjsSxaInitializer {
|
|
|
41
41
|
init(args) {
|
|
42
42
|
var _a, _b, _c, _d;
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const pkg = (0, common_1.
|
|
44
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
45
45
|
// TODO: prompts for SXA
|
|
46
46
|
// const answers = await prompt<StyleguideAnswer>(styleguidePrompts, args);
|
|
47
47
|
const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
|
|
@@ -42,7 +42,7 @@ class NextjsXMCloudInitializer {
|
|
|
42
42
|
init(args) {
|
|
43
43
|
var _a, _b, _c, _d;
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const pkg = (0, common_1.
|
|
45
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
46
46
|
const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
|
|
47
47
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-xmcloud');
|
|
48
48
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const common_1 = require("../../common");
|
|
17
|
+
class AngularXmCloudInitializer {
|
|
18
|
+
get isBase() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
init(args) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const templatePath = path_1.default.resolve(__dirname, '../../templates/node-xmcloud-proxy');
|
|
24
|
+
const modifiedArgs = Object.assign(Object.assign({}, args), { destination: args.proxyAppDestination || args.destination });
|
|
25
|
+
yield (0, common_1.transform)(templatePath, modifiedArgs);
|
|
26
|
+
const response = {
|
|
27
|
+
appName: 'node-xmcloud-proxy',
|
|
28
|
+
};
|
|
29
|
+
return response;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = AngularXmCloudInitializer;
|
|
@@ -52,7 +52,7 @@ class ReactInitializer {
|
|
|
52
52
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
53
53
|
const isDev = (0, common_1.isDevEnvironment)(args.destination);
|
|
54
54
|
const pkgPath = path_1.default.resolve(`${args.destination}${path_1.sep}package.json`);
|
|
55
|
-
const pkg = (0, common_1.
|
|
55
|
+
const pkg = (0, common_1.openJsonFile)(pkgPath);
|
|
56
56
|
if (isDev) {
|
|
57
57
|
Object.entries(pkg.scripts).forEach(([key, value]) => {
|
|
58
58
|
// Can't rewire `eject` script
|
|
@@ -61,14 +61,14 @@ class ReactInitializer {
|
|
|
61
61
|
// It's required to start each command using `react-app-rewired`, to solve duplicate `react` issue
|
|
62
62
|
pkg.scripts[key] = value.replace('react-scripts', 'react-app-rewired');
|
|
63
63
|
});
|
|
64
|
-
(0, common_1.
|
|
64
|
+
(0, common_1.writeJsonFile)(pkg, pkgPath);
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
// Don't need to rewire anything if we are not in the dev env
|
|
68
68
|
delete pkg.devDependencies['react-app-rewired'];
|
|
69
69
|
// Remove webpack overrides
|
|
70
70
|
(0, common_1.removeFile)(path_1.default.resolve(`${args.destination}${path_1.sep}config-overrides.js`));
|
|
71
|
-
(0, common_1.
|
|
71
|
+
(0, common_1.writeJsonFile)(pkg, pkgPath);
|
|
72
72
|
}
|
|
73
73
|
const response = {
|
|
74
74
|
nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prompts = void 0;
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
|
-
exports.prompts = [...common_1.clientAppPrompts, ...common_1.styleguidePrompts];
|
|
5
|
+
exports.prompts = [...common_1.clientAppPrompts, ...common_1.sxpPrompts, ...common_1.styleguidePrompts];
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prompts = void 0;
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
|
-
exports.prompts = [...common_1.clientAppPrompts, ...common_1.styleguidePrompts];
|
|
5
|
+
exports.prompts = [...common_1.clientAppPrompts, ...common_1.sxpPrompts, ...common_1.styleguidePrompts];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# ====== Sitecore Preview / Delivery Edge ======
|
|
2
|
+
|
|
1
3
|
# Your Sitecore API key is needed to build the app. Typically, the API key is
|
|
2
4
|
# defined in `scjssconfig.json` (as `sitecore.apiKey`). This file may not exist
|
|
3
5
|
# when building locally (if you've never run `jss setup`), or when building in a
|
|
@@ -17,6 +19,8 @@ SITECORE_API_HOST=
|
|
|
17
19
|
# the resolved Sitecore API hostname + the `graphQLEndpointPath` defined in your `package.json`.
|
|
18
20
|
GRAPH_QL_ENDPOINT=
|
|
19
21
|
|
|
22
|
+
# ==============================================
|
|
23
|
+
|
|
20
24
|
# Your Sitecore site name.
|
|
21
25
|
# Uses your `package.json` config `appName` if empty.
|
|
22
26
|
SITECORE_SITE_NAME=
|
|
@@ -24,9 +28,6 @@ SITECORE_SITE_NAME=
|
|
|
24
28
|
# Your default app language.
|
|
25
29
|
DEFAULT_LANGUAGE=
|
|
26
30
|
|
|
27
|
-
# The way in which layout and dictionary data is fetched from Sitecore
|
|
28
|
-
FETCH_WITH=<%- fetchWith %>
|
|
29
|
-
|
|
30
31
|
# Sitecore JSS npm packages utilize the debug module for debug logging.
|
|
31
32
|
# https://www.npmjs.com/package/debug
|
|
32
33
|
# Set the DEBUG environment variable to 'sitecore-jss:*' to see all logs:
|
|
@@ -3,51 +3,11 @@
|
|
|
3
3
|
<!---
|
|
4
4
|
@TODO: Update to next version docs before release
|
|
5
5
|
-->
|
|
6
|
-
[Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-angular.html)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## App setup
|
|
10
|
-
|
|
11
|
-
1. `npm install`
|
|
12
|
-
1. `npm install -g @sitecore-jss/sitecore-jss-cli`
|
|
13
|
-
1. `jss setup`
|
|
14
|
-
|
|
15
|
-
> This setup is optional to get started with development, as it assumes you have Sitecore installed.
|
|
16
|
-
>
|
|
17
|
-
> If you answer "yes", you would need to provide the path to your Sitecore installation's "Website" folder.
|
|
18
|
-
|
|
19
|
-
## Development server
|
|
20
|
-
|
|
21
|
-
Run `jss start`.
|
|
22
|
-
|
|
23
|
-
The app will be built and webpack server will be started. So it's expected that the browser will open with `http://localhost:3000` and familiar default welcome content is rendered.
|
|
24
|
-
|
|
25
|
-
The app will automatically reload if you change any of the source files.
|
|
26
|
-
|
|
27
|
-
When running the development server, it automatically sets up a sitecore mock server configures a proxy that forwards all requests to `/sitecore` to that sitecore mock server. Check `proxy.conf.js` to see mock server and proxy implementation.
|
|
28
|
-
|
|
29
|
-
### Congratulations!
|
|
30
6
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## App deployment
|
|
34
|
-
|
|
35
|
-
### Pre-requisites
|
|
36
|
-
|
|
37
|
-
1. Sitecore instance has JSS packages installed.
|
|
38
|
-
1. Sitecore is configured for this JSS app.
|
|
39
|
-
|
|
40
|
-
### Steps
|
|
41
|
-
|
|
42
|
-
Run `jss deploy package`.
|
|
43
|
-
|
|
44
|
-
This step will:
|
|
45
|
-
|
|
46
|
-
* Run the production bundle of your app.
|
|
47
|
-
* Generate the app manifest.
|
|
48
|
-
* Generate a package with the manifest and production bundle.
|
|
49
|
-
* Install the package over HTTP on your Sitecore instance.
|
|
7
|
+
[Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-angular.html)
|
|
50
8
|
|
|
51
|
-
|
|
9
|
+
<!---
|
|
10
|
+
@TODO: Verify the link for angular xmcloud when documentation is ready
|
|
11
|
+
-->
|
|
52
12
|
|
|
53
|
-
|
|
13
|
+
[Documentation (XM Cloud)](https://doc.sitecore.com/xmc/en/developers/xm-cloud/sitecore-javascript-rendering-sdk--jss--for-angular.html)
|
|
@@ -49,12 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"baseHref": "/",
|
|
51
51
|
"aot": true,
|
|
52
|
-
"
|
|
53
|
-
"You might want to adjust the optimization entry to workaround a bug with bootstrap warnings caused by Angular",
|
|
54
|
-
"The warnings may occur during build and when running connected mode. Check below for possible fixes.",
|
|
55
|
-
"https://github.com/ng-bootstrap/ng-bootstrap/issues/4306"
|
|
56
|
-
],
|
|
57
|
-
"optimization": "true",
|
|
52
|
+
"optimization": true,
|
|
58
53
|
"outputHashing": "all",
|
|
59
54
|
"sourceMap": false,
|
|
60
55
|
"namedChunks": false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%- appName %>",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.3.0-canary",
|
|
4
4
|
"description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
|
|
5
5
|
"config": {
|
|
6
6
|
"appName": "<%- appName %>",
|
|
@@ -15,18 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"ng": "ng",
|
|
18
|
-
"lint
|
|
19
|
-
"lint": "ng lint <%- appName %> --fix && npm run lint:yml",
|
|
18
|
+
"lint": "ng lint <%- appName %> --fix",
|
|
20
19
|
"e2e": "ng e2e",
|
|
21
20
|
"jss": "jss",
|
|
22
|
-
"start": "cross-env-shell JSS_MODE=disconnected \"npm-run-all --serial bootstrap --parallel start:angular start:proxy start:watch-components\"",
|
|
23
21
|
"start:connected": "npm-run-all --serial bootstrap start:angular start:watch-components",
|
|
24
|
-
"build": "npm-run-all --serial bootstrap
|
|
25
|
-
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component",
|
|
22
|
+
"build": "npm-run-all --serial bootstrap build:client build:server",
|
|
23
|
+
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component --no-manifest",
|
|
26
24
|
"start:angular": "ng serve -o",
|
|
27
|
-
"start:
|
|
28
|
-
"
|
|
29
|
-
"build:client": "cross-env-shell ng build --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
25
|
+
"start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory/index.ts --watch",
|
|
26
|
+
"build:client": "cross-env-shell ng build --configuration=production --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
30
27
|
"build:server": "cross-env-shell ng run <%- appName %>:server:production --output-path=$npm_package_config_buildArtifactsPath",
|
|
31
28
|
"postbuild:server": "move-cli ./dist/main.js ./dist/server.bundle.js",
|
|
32
29
|
"bootstrap": "ts-node --project src/tsconfig.webpack-server.json scripts/bootstrap.ts",
|
|
@@ -60,13 +57,12 @@
|
|
|
60
57
|
"@apollo/client": "^3.3.12",
|
|
61
58
|
"@ngx-translate/core": "~15.0.0",
|
|
62
59
|
"@ngx-translate/http-loader": "~8.0.0",
|
|
63
|
-
"@sitecore-jss/sitecore-jss-angular": "~22.
|
|
60
|
+
"@sitecore-jss/sitecore-jss-angular": "~22.3.0-canary",
|
|
64
61
|
"apollo-angular": "~6.0.0",
|
|
65
62
|
"bootstrap": "^5.3.3",
|
|
66
63
|
"core-js": "~3.37.1",
|
|
67
64
|
"graphql": "15.5.0",
|
|
68
65
|
"graphql-tag": "~2.11.0",
|
|
69
|
-
"lodash": "^4.17.21",
|
|
70
66
|
"rxjs": "~7.8.1",
|
|
71
67
|
"tslib": "^2.6.3",
|
|
72
68
|
"zone.js": "~0.14.7"
|
|
@@ -82,33 +78,26 @@
|
|
|
82
78
|
"@angular/cli": "~17.3.8",
|
|
83
79
|
"@angular/compiler-cli": "~17.3.11",
|
|
84
80
|
"@angular/language-service": "~17.3.11",
|
|
85
|
-
"@sitecore-jss/sitecore-jss-angular-schematics": "~22.
|
|
86
|
-
"@sitecore-jss/sitecore-jss-cli": "~22.
|
|
87
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "~22.
|
|
88
|
-
"@types/isomorphic-fetch": "0.0.35",
|
|
81
|
+
"@sitecore-jss/sitecore-jss-angular-schematics": "~22.3.0-canary",
|
|
82
|
+
"@sitecore-jss/sitecore-jss-cli": "~22.3.0-canary",
|
|
83
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "~22.3.0-canary",
|
|
89
84
|
"@types/jasmine": "~3.6.7",
|
|
90
85
|
"@types/jasminewd2": "~2.0.8",
|
|
91
86
|
"@types/node": "~20.14.10",
|
|
92
87
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
93
88
|
"@typescript-eslint/parser": "^7.16.0",
|
|
94
|
-
"body-parser": "~1.20.2",
|
|
95
89
|
"chalk": "~4.1.0",
|
|
96
90
|
"chokidar": "^3.5.2",
|
|
97
91
|
"codelyzer": "~6.0.1",
|
|
98
92
|
"constant-case": "^3.0.4",
|
|
99
|
-
"cookie-parser": "~1.4.5",
|
|
100
93
|
"cross-env": "~7.0.3",
|
|
101
94
|
"del-cli": "^5.0.0",
|
|
102
95
|
"dotenv": "^16.0.0",
|
|
103
96
|
"dotenv-webpack": "^7.1.0",
|
|
104
|
-
"enhanced-resolve": "5.7.0",
|
|
105
97
|
"eslint": "^8.56.0",
|
|
106
98
|
"eslint-plugin-import": "2.29.1",
|
|
107
99
|
"eslint-plugin-jsdoc": "48.7.0",
|
|
108
100
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
109
|
-
"express": "~4.17.1",
|
|
110
|
-
"fs-extra": "~9.1.0",
|
|
111
|
-
"isomorphic-fetch": "^3.0.0",
|
|
112
101
|
"jasmine-core": "~3.7.1",
|
|
113
102
|
"jasmine-spec-reporter": "~6.0.0",
|
|
114
103
|
"karma": "^6.3.2",
|
|
@@ -121,7 +110,6 @@
|
|
|
121
110
|
"npm-run-all": "~4.1.5",
|
|
122
111
|
"protractor": "^7.0.0",
|
|
123
112
|
"ts-node": "~10.9.2",
|
|
124
|
-
"typescript": "~5.2.2"
|
|
125
|
-
"yaml-lint": "^1.2.4"
|
|
113
|
+
"typescript": "~5.2.2"
|
|
126
114
|
}
|
|
127
115
|
}
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
When the app runs in
|
|
3
|
-
the app copies of the Sitecore APIs it depends on (layout service, dictionary service, content service)
|
|
4
|
-
to talk to so that the app can run using the locally defined disconnected data.
|
|
5
|
-
|
|
6
|
-
When the app runs in connected mode, Sitecore is present and some of the requests should be
|
|
2
|
+
When the app runs in connected mode, some of the requests should be
|
|
7
3
|
proxied to the Sitecore API
|
|
8
|
-
|
|
9
|
-
This is accomplished by spinning up a small Express server that mocks the APIs, and then
|
|
10
|
-
telling angular-cli to proxy requests to the API paths to this express instance.
|
|
11
|
-
|
|
12
|
-
See /scripts/disconnected-mode-proxy.ts for the proxy API server configuration.
|
|
13
4
|
*/
|
|
14
|
-
const constants = require('@sitecore-jss/sitecore-jss-angular/cjs').constants;
|
|
15
5
|
const environment = require('./src/environments/environment.js').environment;
|
|
16
6
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const PROXY_CONFIG = process.env.JSS_MODE === constants.JSS_MODE.DISCONNECTED ? [
|
|
20
|
-
{
|
|
21
|
-
context: ['/data', '/sitecore'],
|
|
22
|
-
target: `http://localhost:${port}`,
|
|
23
|
-
secure: false,
|
|
24
|
-
},
|
|
25
|
-
] : [
|
|
7
|
+
const PROXY_CONFIG = [
|
|
26
8
|
{
|
|
27
9
|
context: [
|
|
28
10
|
// API endpoints
|
|
@@ -30,12 +12,12 @@ const PROXY_CONFIG = process.env.JSS_MODE === constants.JSS_MODE.DISCONNECTED ?
|
|
|
30
12
|
// media items
|
|
31
13
|
'/-',
|
|
32
14
|
// visitor identification
|
|
33
|
-
'/layouts'
|
|
15
|
+
'/layouts',
|
|
34
16
|
],
|
|
35
17
|
target: environment.sitecoreApiHost,
|
|
36
18
|
secure: false,
|
|
37
|
-
changeOrigin: true
|
|
38
|
-
}
|
|
19
|
+
changeOrigin: true,
|
|
20
|
+
},
|
|
39
21
|
];
|
|
40
22
|
|
|
41
23
|
module.exports = PROXY_CONFIG;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import 'dotenv/config';
|
|
2
|
-
import { constants } from '@sitecore-jss/sitecore-jss-angular/cjs';
|
|
3
|
-
import { generateConfig } from './generate-config';
|
|
4
|
-
const projects = require('../angular.json').projects;
|
|
5
|
-
const chalk = require('chalk');
|
|
6
2
|
|
|
7
3
|
/*
|
|
8
4
|
BOOTSTRAPPING
|
|
@@ -11,30 +7,15 @@ const chalk = require('chalk');
|
|
|
11
7
|
and the global config module.
|
|
12
8
|
*/
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
10
|
+
/*
|
|
11
|
+
PLUGINS GENERATION
|
|
12
|
+
*/
|
|
13
|
+
require('./generate-plugins');
|
|
19
14
|
|
|
20
15
|
/*
|
|
21
16
|
CONFIG GENERATION
|
|
22
|
-
Generates the /src/environments/environment.js file which contains runtime configuration
|
|
23
|
-
that the app can import and use.
|
|
24
|
-
|
|
25
|
-
This is generated rather than using Angular environments because of the need to set config params
|
|
26
|
-
based on build arguments, which env files don't directly allow.
|
|
27
17
|
*/
|
|
28
|
-
|
|
29
|
-
if (disconnected) {
|
|
30
|
-
configOverride.sitecoreApiHost = `http://localhost:${projects['<%- appName %>'].architect.serve.options.port}`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
generateConfig(configOverride, outputPath);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
writeConfig({ production: false });
|
|
37
|
-
writeConfig({ production: true }, 'src/environments/environment.prod.js');
|
|
18
|
+
require('./generate-config');
|
|
38
19
|
|
|
39
20
|
/*
|
|
40
21
|
COMPONENT FACTORY GENERATION
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
+
const plugins = require('scripts/temp/config-plugins');
|
|
3
|
+
import { JssConfig } from 'lib/config';
|
|
4
|
+
|
|
5
|
+
export interface ConfigPlugin {
|
|
6
|
+
/**
|
|
7
|
+
* Detect order when the plugin should be called, e.g. 0 - will be called first (can be a plugin which data is required for other plugins)
|
|
8
|
+
*/
|
|
9
|
+
order: number;
|
|
10
|
+
/**
|
|
11
|
+
* A function which will be called during config generation
|
|
12
|
+
* @param {JssConfig} config Current (accumulated) config
|
|
13
|
+
*/
|
|
14
|
+
exec(config: JssConfig): Promise<JssConfig>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class JssConfigFactory {
|
|
18
|
+
public async create(defaultConfig: JssConfig = {}): Promise<JssConfig> {
|
|
19
|
+
return (Object.values(plugins) as ConfigPlugin[])
|
|
20
|
+
.sort((p1, p2) => p1.order - p2.order)
|
|
21
|
+
.reduce(
|
|
22
|
+
(promise, plugin) => promise.then((config) => plugin.exec(config)),
|
|
23
|
+
Promise.resolve(defaultConfig)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const jssConfigFactory = new JssConfigFactory();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JssConfig } from 'lib/config';
|
|
2
|
+
import { ConfigPlugin } from '..';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This plugin will set computed config props.
|
|
6
|
+
* The "graphQLEndpoint" is an example of making a _computed_ config setting
|
|
7
|
+
* based on other config settings.
|
|
8
|
+
*/
|
|
9
|
+
class ComputedPlugin implements ConfigPlugin {
|
|
10
|
+
// should come after other plugins (but before fallback)
|
|
11
|
+
order = 10;
|
|
12
|
+
|
|
13
|
+
async exec(config: JssConfig) {
|
|
14
|
+
return Object.assign({}, config, {
|
|
15
|
+
graphQLEndpoint:
|
|
16
|
+
config.graphQLEndpoint || `${config.sitecoreApiHost}${config.graphQLEndpointPath}`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const computedPlugin = new ComputedPlugin();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JssConfig } from 'lib/config';
|
|
2
|
+
import { ConfigPlugin } from '..';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This config will set fallback values for properties that were left empty
|
|
6
|
+
* If neither env, nor other places had a proper value, this will ensure a fallback is set
|
|
7
|
+
*/
|
|
8
|
+
class FallbackPlugin implements ConfigPlugin {
|
|
9
|
+
// should always come last
|
|
10
|
+
order = 100;
|
|
11
|
+
|
|
12
|
+
async exec(config: JssConfig) {
|
|
13
|
+
return Object.assign({}, config, {
|
|
14
|
+
defaultLanguage: config.defaultLanguage || 'en',
|
|
15
|
+
<% if (!locals.xmcloud) { -%>
|
|
16
|
+
layoutServiceConfigurationName: config.layoutServiceConfigurationName || 'default',
|
|
17
|
+
<% } -%>
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const fallbackPlugin = new FallbackPlugin();
|