create-sitecore-jss 22.1.0-canary.9 → 22.2.0-canary.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +70 -28
- package/dist/common/index.js +5 -3
- package/dist/common/processes/install.js +9 -2
- package/dist/common/processes/next.js +3 -3
- package/dist/common/processes/transform.js +29 -14
- package/dist/common/prompts/base.js +0 -12
- package/dist/common/prompts/sxp.js +20 -0
- package/dist/common/utils/helpers.js +28 -43
- 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 +66 -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 +32 -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 +5 -3
- package/dist/templates/angular/README.md +5 -45
- package/dist/templates/angular/angular.json +1 -6
- package/dist/templates/angular/package.json +43 -53
- 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 +23 -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-config.ts +53 -73
- package/dist/templates/angular/scripts/generate-plugins.ts +28 -0
- package/dist/templates/angular/scripts/temp/gitignore +2 -0
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +4 -2
- package/dist/templates/angular/server.bundle.ts +20 -2
- package/dist/templates/angular/src/app/JssState.ts +1 -4
- package/dist/templates/angular/src/app/app.module.ts +0 -2
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +4 -19
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +0 -2
- package/dist/templates/angular/src/app/lib/config.ts +16 -0
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +21 -13
- 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 +1 -2
- 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/graphql-fragment-types.ts +0 -95
- package/dist/templates/angular/src/polyfills.ts +2 -6
- package/dist/templates/angular/src/test.ts +1 -6
- package/dist/templates/angular/tsconfig.json +7 -2
- 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 +27 -0
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +35 -0
- 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 +8 -0
- package/dist/templates/angular-xmcloud/angular.json +34 -0
- package/dist/templates/angular-xmcloud/package.json +15 -0
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +23 -0
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +30 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +13 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +16 -0
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +51 -0
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory.ts +44 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +39 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +111 -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 +49 -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 +4 -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/next.config.js +5 -0
- package/dist/templates/nextjs/package.json +7 -6
- package/dist/templates/nextjs/src/lib/next-config/plugins/cors-header.js +0 -9
- package/dist/templates/nextjs/src/pages/[[...path]].tsx +1 -13
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-image.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/title/_component-title.scss +19 -13
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +22 -12
- package/dist/templates/nextjs-sxa/src/components/Promo.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +10 -13
- package/dist/templates/nextjs-xmcloud/package.json +1 -1
- package/dist/templates/nextjs-xmcloud/src/Scripts.tsx +2 -0
- package/dist/templates/nextjs-xmcloud/src/lib/dictionary-service-factory.ts +46 -0
- package/dist/templates/nextjs-xmcloud/src/lib/graphql-editing-service.ts +9 -0
- package/dist/templates/nextjs-xmcloud/src/lib/middleware/plugins/personalize.ts +6 -5
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/personalize.ts +7 -3
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/preview-mode.ts +72 -0
- package/dist/templates/nextjs-xmcloud/src/pages/api/editing/render.ts +46 -0
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/package.json +4 -4
- package/dist/templates/node-xmcloud-proxy/.env +8 -0
- package/dist/templates/node-xmcloud-proxy/README.md +36 -0
- package/dist/templates/node-xmcloud-proxy/package.json +25 -0
- package/dist/templates/node-xmcloud-proxy/src/config.ts +19 -0
- package/dist/templates/node-xmcloud-proxy/src/index.ts +161 -0
- package/dist/templates/node-xmcloud-proxy/src/types.ts +59 -0
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -0
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/package.json +4 -4
- package/package.json +4 -4
- /package/dist/templates/angular/src/app/lib/{client-factory.ts → graphql-client-factory.ts} +0 -0
- /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/graph-ql-layout/graph-ql-layout.component.ts +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,66 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const path_1 = __importStar(require("path"));
|
|
36
|
+
const common_1 = require("../../common");
|
|
37
|
+
const helpers_1 = require("../../common/utils/helpers");
|
|
38
|
+
class AngularXmCloudInitializer {
|
|
39
|
+
get isBase() {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
init(args) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
46
|
+
const addInitializers = [];
|
|
47
|
+
// when installing proxy alongside main app, have a separate path ready
|
|
48
|
+
if (!args.proxyAppDestination) {
|
|
49
|
+
args.proxyAppDestination = (0, helpers_1.getDefaultProxyDestination)(args.destination, 'node-xmcloud-proxy');
|
|
50
|
+
}
|
|
51
|
+
if (!args.templates.includes('node-xmcloud-proxy')) {
|
|
52
|
+
addInitializers.push('node-xmcloud-proxy');
|
|
53
|
+
}
|
|
54
|
+
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 });
|
|
55
|
+
const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-xmcloud');
|
|
56
|
+
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
57
|
+
const response = {
|
|
58
|
+
nextSteps: [],
|
|
59
|
+
appName: args.appName || common_1.DEFAULT_APPNAME,
|
|
60
|
+
initializers: addInitializers,
|
|
61
|
+
};
|
|
62
|
+
return response;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
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,32 @@
|
|
|
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
|
+
yield (0, common_1.transform)(templatePath, args);
|
|
25
|
+
const response = {
|
|
26
|
+
appName: 'node-xmcloud-proxy',
|
|
27
|
+
};
|
|
28
|
+
return response;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
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];
|
|
@@ -21,11 +21,13 @@ GRAPH_QL_ENDPOINT=
|
|
|
21
21
|
# Uses your `package.json` config `appName` if empty.
|
|
22
22
|
SITECORE_SITE_NAME=
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
DEFAULT_LANGUAGE=
|
|
26
|
-
|
|
24
|
+
<% if (!locals.xmcloud) { -%>
|
|
27
25
|
# The way in which layout and dictionary data is fetched from Sitecore
|
|
28
26
|
FETCH_WITH=<%- fetchWith %>
|
|
27
|
+
<% } -%>
|
|
28
|
+
|
|
29
|
+
# Your default app language.
|
|
30
|
+
DEFAULT_LANGUAGE=
|
|
29
31
|
|
|
30
32
|
# Sitecore JSS npm packages utilize the debug module for debug logging.
|
|
31
33
|
# https://www.npmjs.com/package/debug
|
|
@@ -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.2.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:proxy": "ts-node --project src/tsconfig.webpack-server.json scripts/disconnected-mode-proxy.ts",
|
|
28
25
|
"start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory.ts --watch",
|
|
29
|
-
"build:client": "cross-env-shell ng build --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
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",
|
|
@@ -48,66 +45,60 @@
|
|
|
48
45
|
"homepage": "https://jss.sitecore.com",
|
|
49
46
|
"license": "Apache-2.0",
|
|
50
47
|
"dependencies": {
|
|
51
|
-
"@angular/animations": "~
|
|
52
|
-
"@angular/common": "~
|
|
53
|
-
"@angular/compiler": "~
|
|
54
|
-
"@angular/core": "~
|
|
55
|
-
"@angular/forms": "~
|
|
56
|
-
"@angular/platform-browser": "~
|
|
57
|
-
"@angular/platform-browser-dynamic": "~
|
|
58
|
-
"@angular/platform-server": "~
|
|
59
|
-
"@angular/router": "~
|
|
48
|
+
"@angular/animations": "~17.3.11",
|
|
49
|
+
"@angular/common": "~17.3.11",
|
|
50
|
+
"@angular/compiler": "~17.3.11",
|
|
51
|
+
"@angular/core": "~17.3.11",
|
|
52
|
+
"@angular/forms": "~17.3.11",
|
|
53
|
+
"@angular/platform-browser": "~17.3.11",
|
|
54
|
+
"@angular/platform-browser-dynamic": "~17.3.11",
|
|
55
|
+
"@angular/platform-server": "~17.3.11",
|
|
56
|
+
"@angular/router": "~17.3.11",
|
|
60
57
|
"@apollo/client": "^3.3.12",
|
|
61
|
-
"@ngx-translate/core": "~
|
|
62
|
-
"@ngx-translate/http-loader": "~
|
|
63
|
-
"@sitecore-jss/sitecore-jss-angular": "~22.
|
|
64
|
-
"apollo-angular": "~
|
|
65
|
-
"bootstrap": "^5.3.
|
|
66
|
-
"core-js": "~3.
|
|
58
|
+
"@ngx-translate/core": "~15.0.0",
|
|
59
|
+
"@ngx-translate/http-loader": "~8.0.0",
|
|
60
|
+
"@sitecore-jss/sitecore-jss-angular": "~22.2.0-canary",
|
|
61
|
+
"apollo-angular": "~6.0.0",
|
|
62
|
+
"bootstrap": "^5.3.3",
|
|
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
|
-
"tslib": "^2.
|
|
72
|
-
"zone.js": "~0.
|
|
67
|
+
"tslib": "^2.6.3",
|
|
68
|
+
"zone.js": "~0.14.7"
|
|
73
69
|
},
|
|
74
70
|
"devDependencies": {
|
|
75
|
-
"@angular-builders/custom-webpack": "^
|
|
76
|
-
"@angular-devkit/build-angular": "^
|
|
77
|
-
"@angular-eslint/builder": "^
|
|
78
|
-
"@angular-eslint/eslint-plugin": "^
|
|
79
|
-
"@angular-eslint/eslint-plugin-template": "^
|
|
80
|
-
"@angular-eslint/schematics": "^
|
|
81
|
-
"@angular-eslint/template-parser": "^
|
|
82
|
-
"@angular/cli": "~
|
|
83
|
-
"@angular/compiler-cli": "~
|
|
84
|
-
"@angular/language-service": "~
|
|
85
|
-
"@sitecore-jss/sitecore-jss-angular-schematics": "~22.
|
|
86
|
-
"@sitecore-jss/sitecore-jss-cli": "~22.
|
|
87
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "~22.
|
|
71
|
+
"@angular-builders/custom-webpack": "^17.0.2",
|
|
72
|
+
"@angular-devkit/build-angular": "^17.3.8",
|
|
73
|
+
"@angular-eslint/builder": "^17.5.2",
|
|
74
|
+
"@angular-eslint/eslint-plugin": "^17.5.2",
|
|
75
|
+
"@angular-eslint/eslint-plugin-template": "^17.5.2",
|
|
76
|
+
"@angular-eslint/schematics": "^17.5.2",
|
|
77
|
+
"@angular-eslint/template-parser": "^17.5.2",
|
|
78
|
+
"@angular/cli": "~17.3.8",
|
|
79
|
+
"@angular/compiler-cli": "~17.3.11",
|
|
80
|
+
"@angular/language-service": "~17.3.11",
|
|
81
|
+
"@sitecore-jss/sitecore-jss-angular-schematics": "~22.2.0-canary",
|
|
82
|
+
"@sitecore-jss/sitecore-jss-cli": "~22.2.0-canary",
|
|
83
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "~22.2.0-canary",
|
|
88
84
|
"@types/isomorphic-fetch": "0.0.35",
|
|
89
85
|
"@types/jasmine": "~3.6.7",
|
|
90
86
|
"@types/jasminewd2": "~2.0.8",
|
|
91
|
-
"@types/node": "~
|
|
92
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
93
|
-
"@typescript-eslint/parser": "^
|
|
94
|
-
"body-parser": "~1.19.0",
|
|
87
|
+
"@types/node": "~20.14.10",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
89
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
95
90
|
"chalk": "~4.1.0",
|
|
96
91
|
"chokidar": "^3.5.2",
|
|
97
92
|
"codelyzer": "~6.0.1",
|
|
98
93
|
"constant-case": "^3.0.4",
|
|
99
|
-
"cookie-parser": "~1.4.5",
|
|
100
94
|
"cross-env": "~7.0.3",
|
|
101
95
|
"del-cli": "^5.0.0",
|
|
102
96
|
"dotenv": "^16.0.0",
|
|
103
97
|
"dotenv-webpack": "^7.1.0",
|
|
104
|
-
"
|
|
105
|
-
"eslint": "
|
|
106
|
-
"eslint-plugin-
|
|
107
|
-
"eslint-plugin-jsdoc": "32.3.0",
|
|
98
|
+
"eslint": "^8.56.0",
|
|
99
|
+
"eslint-plugin-import": "2.29.1",
|
|
100
|
+
"eslint-plugin-jsdoc": "48.7.0",
|
|
108
101
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
109
|
-
"express": "~4.17.1",
|
|
110
|
-
"fs-extra": "~9.1.0",
|
|
111
102
|
"isomorphic-fetch": "^3.0.0",
|
|
112
103
|
"jasmine-core": "~3.7.1",
|
|
113
104
|
"jasmine-spec-reporter": "~6.0.0",
|
|
@@ -120,8 +111,7 @@
|
|
|
120
111
|
"move-cli": "^2.0.0",
|
|
121
112
|
"npm-run-all": "~4.1.5",
|
|
122
113
|
"protractor": "^7.0.0",
|
|
123
|
-
"ts-node": "~10.9.
|
|
124
|
-
"typescript": "~
|
|
125
|
-
"yaml-lint": "^1.2.4"
|
|
114
|
+
"ts-node": "~10.9.2",
|
|
115
|
+
"typescript": "~5.2.2"
|
|
126
116
|
}
|
|
127
117
|
}
|
|
@@ -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();
|