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
package/dist/bin.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.main = exports.parseArgs = void 0;
|
|
38
|
+
exports.main = exports.promptDestination = exports.getDestination = exports.parseArgs = void 0;
|
|
39
39
|
const fs_1 = __importDefault(require("fs"));
|
|
40
40
|
const path_1 = __importStar(require("path"));
|
|
41
41
|
const chalk_1 = __importDefault(require("chalk"));
|
|
@@ -49,7 +49,15 @@ const parseArgs = () => {
|
|
|
49
49
|
// useful for CI and testing purposes
|
|
50
50
|
const options = {
|
|
51
51
|
boolean: ['appPrefix', 'force', 'noInstall', 'yes', 'silent', 'prePushHook'],
|
|
52
|
-
string: [
|
|
52
|
+
string: [
|
|
53
|
+
'appName',
|
|
54
|
+
'destination',
|
|
55
|
+
'proxyAppDestination',
|
|
56
|
+
'templates',
|
|
57
|
+
'hostName',
|
|
58
|
+
'fetchWith',
|
|
59
|
+
'language',
|
|
60
|
+
],
|
|
53
61
|
default: { prePushHook: null },
|
|
54
62
|
};
|
|
55
63
|
const args = (0, minimist_1.default)(process.argv.slice(2), options);
|
|
@@ -62,6 +70,30 @@ const parseArgs = () => {
|
|
|
62
70
|
return args;
|
|
63
71
|
};
|
|
64
72
|
exports.parseArgs = parseArgs;
|
|
73
|
+
const getDestination = (args, templates) => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
if (templates.length === 0) {
|
|
75
|
+
throw new Error('Unable to get destinations, provided templates are empty');
|
|
76
|
+
}
|
|
77
|
+
// validate/gather destinations
|
|
78
|
+
const defaultBaseDestination = `${process.cwd()}${args.appName ? path_1.sep + args.appName : `${path_1.sep}${templates[0]}`}`;
|
|
79
|
+
let destination = args.destination;
|
|
80
|
+
if (!destination) {
|
|
81
|
+
destination = args.yes
|
|
82
|
+
? defaultBaseDestination
|
|
83
|
+
: yield (0, exports.promptDestination)('Where would you like your new app created?', defaultBaseDestination);
|
|
84
|
+
}
|
|
85
|
+
return destination;
|
|
86
|
+
});
|
|
87
|
+
exports.getDestination = getDestination;
|
|
88
|
+
const promptDestination = (prompt, defaultDestination) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
return (yield inquirer_1.default.prompt({
|
|
90
|
+
type: 'input',
|
|
91
|
+
name: 'destination',
|
|
92
|
+
message: prompt,
|
|
93
|
+
default: () => defaultDestination,
|
|
94
|
+
})).destination;
|
|
95
|
+
});
|
|
96
|
+
exports.promptDestination = promptDestination;
|
|
65
97
|
const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
98
|
let templates = [];
|
|
67
99
|
// check if templates were provided
|
|
@@ -99,23 +131,7 @@ const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
99
131
|
});
|
|
100
132
|
templates.push(answer.template);
|
|
101
133
|
}
|
|
102
|
-
|
|
103
|
-
const defaultDestination = `${process.cwd()}${args.appName ? path_1.sep + args.appName : `${path_1.sep}${templates[0]}`}`;
|
|
104
|
-
let destination = args.destination;
|
|
105
|
-
if (!destination) {
|
|
106
|
-
if (args.yes) {
|
|
107
|
-
destination = defaultDestination;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
const answer = yield inquirer_1.default.prompt({
|
|
111
|
-
type: 'input',
|
|
112
|
-
name: 'destination',
|
|
113
|
-
message: 'Where would you like your new app created?',
|
|
114
|
-
default: () => defaultDestination,
|
|
115
|
-
});
|
|
116
|
-
destination = answer.destination;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
134
|
+
const destination = yield (0, exports.getDestination)(args, templates);
|
|
119
135
|
if (!args.force && fs_1.default.existsSync(destination) && fs_1.default.readdirSync(destination).length > 0) {
|
|
120
136
|
const answer = yield inquirer_1.default.prompt({
|
|
121
137
|
type: 'confirm',
|
package/dist/common/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installPrePushHook = exports.lintFix = exports.installPackages = exports.nextSteps = exports.transform = exports.removeFile = exports.saveConfiguration = exports.getBaseTemplates = exports.getAllTemplates = exports.
|
|
3
|
+
exports.installPrePushHook = exports.lintFix = exports.installPackages = exports.nextSteps = exports.transform = exports.removeFile = exports.saveConfiguration = exports.getBaseTemplates = exports.getAllTemplates = exports.writeJsonFile = exports.openJsonFile = exports.isDevEnvironment = exports.sxpPrompts = exports.styleguidePrompts = exports.missingAddonMsg = exports.incompatibleAddonsMsg = exports.DEFAULT_APPNAME = exports.clientAppPrompts = void 0;
|
|
4
4
|
var base_1 = require("./prompts/base");
|
|
5
5
|
Object.defineProperty(exports, "clientAppPrompts", { enumerable: true, get: function () { return base_1.clientAppPrompts; } });
|
|
6
6
|
Object.defineProperty(exports, "DEFAULT_APPNAME", { enumerable: true, get: function () { return base_1.DEFAULT_APPNAME; } });
|
|
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "incompatibleAddonsMsg", { enumerable: true, get:
|
|
|
8
8
|
Object.defineProperty(exports, "missingAddonMsg", { enumerable: true, get: function () { return base_1.missingAddonMsg; } });
|
|
9
9
|
var styleguide_1 = require("./prompts/styleguide");
|
|
10
10
|
Object.defineProperty(exports, "styleguidePrompts", { enumerable: true, get: function () { return styleguide_1.styleguidePrompts; } });
|
|
11
|
+
var sxp_1 = require("./prompts/sxp");
|
|
12
|
+
Object.defineProperty(exports, "sxpPrompts", { enumerable: true, get: function () { return sxp_1.sxpPrompts; } });
|
|
11
13
|
var helpers_1 = require("./utils/helpers");
|
|
12
14
|
Object.defineProperty(exports, "isDevEnvironment", { enumerable: true, get: function () { return helpers_1.isDevEnvironment; } });
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
-
Object.defineProperty(exports, "
|
|
15
|
+
Object.defineProperty(exports, "openJsonFile", { enumerable: true, get: function () { return helpers_1.openJsonFile; } });
|
|
16
|
+
Object.defineProperty(exports, "writeJsonFile", { enumerable: true, get: function () { return helpers_1.writeJsonFile; } });
|
|
15
17
|
Object.defineProperty(exports, "getAllTemplates", { enumerable: true, get: function () { return helpers_1.getAllTemplates; } });
|
|
16
18
|
Object.defineProperty(exports, "getBaseTemplates", { enumerable: true, get: function () { return helpers_1.getBaseTemplates; } });
|
|
17
19
|
Object.defineProperty(exports, "saveConfiguration", { enumerable: true, get: function () { return helpers_1.saveConfiguration; } });
|
|
@@ -47,8 +47,7 @@ exports.installPackages = installPackages;
|
|
|
47
47
|
*/
|
|
48
48
|
const lintFix = (projectFolder, silent) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const
|
|
51
|
-
const pkg = (0, helpers_1.openPackageJson)(packagePath);
|
|
50
|
+
const pkg = getPackageJson(projectFolder);
|
|
52
51
|
if (!((_a = pkg === null || pkg === void 0 ? void 0 : pkg.scripts) === null || _a === void 0 ? void 0 : _a.lint)) {
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
@@ -65,6 +64,10 @@ exports.lintFix = lintFix;
|
|
|
65
64
|
* @param {boolean} [silent] suppress logs
|
|
66
65
|
*/
|
|
67
66
|
const installPrePushHook = (destination, silent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
const pkg = getPackageJson(destination);
|
|
68
|
+
if (!(pkg === null || pkg === void 0 ? void 0 : pkg.scripts) || !pkg.scripts['install-pre-push-hook']) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
68
71
|
silent || console.log(chalk_1.default.cyan('Installing pre-push hook...'));
|
|
69
72
|
yield new Promise((resolve, reject) => {
|
|
70
73
|
(0, child_process_1.exec)(`cd ${destination} && git init && npm run install-pre-push-hook`, (err) => {
|
|
@@ -80,3 +83,7 @@ const installPrePushHook = (destination, silent) => __awaiter(void 0, void 0, vo
|
|
|
80
83
|
});
|
|
81
84
|
});
|
|
82
85
|
exports.installPrePushHook = installPrePushHook;
|
|
86
|
+
const getPackageJson = (projectFolder) => {
|
|
87
|
+
const packagePath = path_1.default.join(projectFolder, 'package.json');
|
|
88
|
+
return (0, helpers_1.openJsonFile)(packagePath);
|
|
89
|
+
};
|
|
@@ -16,10 +16,13 @@ exports.nextSteps = void 0;
|
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
17
|
/**
|
|
18
18
|
* Logs app creation completion message and next steps
|
|
19
|
-
* @param {string}
|
|
19
|
+
* @param {string[]} appNames application name(s) for the new app
|
|
20
20
|
* @param {string[]} nextStepsArr next steps to be performed after app is created
|
|
21
21
|
*/
|
|
22
|
-
const nextSteps = (
|
|
22
|
+
const nextSteps = (appNames, nextStepsArr) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const successMessage = appNames.length > 1
|
|
24
|
+
? `JSS applications ${chalk_1.default.green(appNames.join(', '))} are ready!`
|
|
25
|
+
: `JSS application ${chalk_1.default.green(appNames[0])} is ready!`;
|
|
23
26
|
console.log(chalk_1.default.red(' -/oyhdmNNNNmdhyo/- '));
|
|
24
27
|
console.log(chalk_1.default.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
|
|
25
28
|
console.log(chalk_1.default.red(' :yNMMMMMMMMMMMMMMMMMMMMMMMMMMNy: '));
|
|
@@ -51,7 +54,7 @@ const nextSteps = (appName, nextStepsArr) => __awaiter(void 0, void 0, void 0, f
|
|
|
51
54
|
console.log(chalk_1.default.white(' / // /\\ \\_\\ \\ '));
|
|
52
55
|
console.log(chalk_1.default.white(' \\___/___/___/'));
|
|
53
56
|
console.log();
|
|
54
|
-
console.log(
|
|
57
|
+
console.log(successMessage);
|
|
55
58
|
console.log();
|
|
56
59
|
console.log(chalk_1.default.yellow('Next steps:'));
|
|
57
60
|
nextStepsArr.forEach((step) => {
|
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.transform = exports.diffAndWriteFiles = exports.diffFiles = exports.mergeEnv = exports.merge = exports.transformFilename = void 0;
|
|
38
|
+
exports.transform = exports.populateEjsData = exports.diffAndWriteFiles = exports.diffFiles = exports.mergeEnv = exports.merge = exports.transformFilename = void 0;
|
|
39
39
|
const chalk_1 = __importDefault(require("chalk"));
|
|
40
40
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
41
41
|
const glob_1 = __importDefault(require("glob"));
|
|
@@ -180,6 +180,16 @@ const diffAndWriteFiles = ({ rendered, pathToNewFile, answers, }) => __awaiter(v
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
exports.diffAndWriteFiles = diffAndWriteFiles;
|
|
183
|
+
const populateEjsData = (answers, destination) => {
|
|
184
|
+
// pass in helper to answers object
|
|
185
|
+
const ejsData = Object.assign(Object.assign({}, answers), { helper: {
|
|
186
|
+
isDev: (0, helpers_1.isDevEnvironment)(destination || answers.destination),
|
|
187
|
+
getPascalCaseName: helpers_1.getPascalCaseName,
|
|
188
|
+
getAppPrefix: helpers_1.getAppPrefix,
|
|
189
|
+
} });
|
|
190
|
+
return ejsData;
|
|
191
|
+
};
|
|
192
|
+
exports.populateEjsData = populateEjsData;
|
|
183
193
|
/**
|
|
184
194
|
* Handles each template file and applies ejs renderer, also:
|
|
185
195
|
* * determines files for copy
|
|
@@ -198,12 +208,7 @@ const transform = (templatePath, answers, options = {}) => __awaiter(void 0, voi
|
|
|
198
208
|
if (!answers.appPrefix) {
|
|
199
209
|
answers.appPrefix = false;
|
|
200
210
|
}
|
|
201
|
-
|
|
202
|
-
const ejsData = Object.assign(Object.assign({}, answers), { helper: {
|
|
203
|
-
isDev: (0, helpers_1.isDevEnvironment)(answers.destination),
|
|
204
|
-
getPascalCaseName: helpers_1.getPascalCaseName,
|
|
205
|
-
getAppPrefix: helpers_1.getAppPrefix,
|
|
206
|
-
} });
|
|
211
|
+
const ejsData = (0, exports.populateEjsData)(answers);
|
|
207
212
|
// the templates to be run through ejs render or copied directly
|
|
208
213
|
const files = glob_1.default.sync('**/*', { cwd: templatePath, dot: true, nodir: true });
|
|
209
214
|
for (const file of files) {
|
|
@@ -228,13 +233,13 @@ const transform = (templatePath, answers, options = {}) => __awaiter(void 0, voi
|
|
|
228
233
|
fs_extra_1.default.copySync(pathToTemplate, pathToNewFile);
|
|
229
234
|
continue;
|
|
230
235
|
}
|
|
231
|
-
if (file.endsWith('
|
|
232
|
-
// we treat
|
|
233
|
-
// read the current
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
+
if (file.endsWith('.json') && fs_extra_1.default.existsSync(pathToNewFile)) {
|
|
237
|
+
// we treat a .json a bit differently
|
|
238
|
+
// read the current .json and the template .json (rendered with ejs)
|
|
239
|
+
const currentJson = (0, helpers_1.openJsonFile)(pathToNewFile);
|
|
240
|
+
const templateJson = JSON.parse(yield (0, ejs_1.renderFile)(path_1.default.resolve(pathToTemplate), ejsData));
|
|
236
241
|
// merge them and set the result to str which will then go through diff
|
|
237
|
-
const merged = (0, exports.merge)(
|
|
242
|
+
const merged = (0, exports.merge)(currentJson, templateJson);
|
|
238
243
|
str = JSON.stringify(merged, null, 2);
|
|
239
244
|
}
|
|
240
245
|
if (file.endsWith('.env') && fs_extra_1.default.existsSync(pathToNewFile)) {
|
|
@@ -38,31 +38,6 @@ exports.clientAppPrompts = [
|
|
|
38
38
|
return !answers.appName;
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
|
-
{
|
|
42
|
-
type: 'input',
|
|
43
|
-
name: 'hostName',
|
|
44
|
-
message: 'What is your Sitecore hostname (used if deployed to Sitecore)?',
|
|
45
|
-
default: (answers) => `${answers.appName}.dev.local`,
|
|
46
|
-
when: (answers) => {
|
|
47
|
-
if (answers.yes && !answers.hostName) {
|
|
48
|
-
answers.hostName = `${answers.appName}.dev.local`;
|
|
49
|
-
}
|
|
50
|
-
return !answers.hostName;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
type: 'list',
|
|
55
|
-
name: 'fetchWith',
|
|
56
|
-
message: 'How would you like to fetch Layout and Dictionary data?',
|
|
57
|
-
choices: Object.values(FetchWith),
|
|
58
|
-
default: exports.DEFAULT_FETCHWITH,
|
|
59
|
-
when: (answers) => {
|
|
60
|
-
if (answers.yes && !answers.fetchWith) {
|
|
61
|
-
answers.fetchWith = exports.DEFAULT_FETCHWITH;
|
|
62
|
-
}
|
|
63
|
-
return !answers.fetchWith;
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
41
|
];
|
|
67
42
|
const missingAddonMsg = (source, missingAddon) => chalk_1.default.yellow(`Warning: ${source} add-on cannot be used without the ${missingAddon} add-on. This may cause unexpected results.`);
|
|
68
43
|
exports.missingAddonMsg = missingAddonMsg;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.proxyPrompts = exports.FALLBACK_PROXYNAME = void 0;
|
|
7
|
+
const helpers_1 = require("../utils/helpers");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
exports.FALLBACK_PROXYNAME = 'sitecore-jss-proxy-app';
|
|
10
|
+
/**
|
|
11
|
+
* Set of CLI prompts for an SXP app
|
|
12
|
+
*/
|
|
13
|
+
exports.proxyPrompts = [
|
|
14
|
+
{
|
|
15
|
+
type: 'input',
|
|
16
|
+
name: 'proxyAppDestination',
|
|
17
|
+
message: 'Where would you like your proxy app created?',
|
|
18
|
+
default: (answers) => {
|
|
19
|
+
// default proxy destination should be under same root as main app
|
|
20
|
+
return (0, helpers_1.getDefaultProxyDestination)(answers.destination, answers.proxyName || exports.FALLBACK_PROXYNAME);
|
|
21
|
+
},
|
|
22
|
+
when: (answers) => {
|
|
23
|
+
if (answers.yes && !answers.proxyAppDestination) {
|
|
24
|
+
answers.proxyAppDestination = (0, helpers_1.getDefaultProxyDestination)(answers.destination, answers.proxyName || exports.FALLBACK_PROXYNAME);
|
|
25
|
+
}
|
|
26
|
+
return !answers.proxyAppDestination;
|
|
27
|
+
},
|
|
28
|
+
validate: (input, answers) => {
|
|
29
|
+
if (path_1.default.resolve(input) === path_1.default.resolve(answers.destination)) {
|
|
30
|
+
return 'Paths for main app and proxy cannot match. Please choose another destination';
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sxpPrompts = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
/**
|
|
6
|
+
* Set of CLI prompts for an SXP app
|
|
7
|
+
*/
|
|
8
|
+
exports.sxpPrompts = [
|
|
9
|
+
{
|
|
10
|
+
type: 'input',
|
|
11
|
+
name: 'hostName',
|
|
12
|
+
message: 'What is your Sitecore hostname (used if deployed to Sitecore)?',
|
|
13
|
+
default: (answers) => `${answers.appName || base_1.DEFAULT_APPNAME}.dev.local`,
|
|
14
|
+
when: (answers) => {
|
|
15
|
+
if (answers.yes && !answers.hostName) {
|
|
16
|
+
answers.hostName = `${answers.appName || base_1.DEFAULT_APPNAME}.dev.local`;
|
|
17
|
+
}
|
|
18
|
+
return !answers.hostName;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'list',
|
|
23
|
+
name: 'fetchWith',
|
|
24
|
+
message: 'How would you like to fetch Layout and Dictionary data?',
|
|
25
|
+
choices: Object.values(base_1.FetchWith),
|
|
26
|
+
default: base_1.DEFAULT_FETCHWITH,
|
|
27
|
+
when: (answers) => {
|
|
28
|
+
if (answers.yes && !answers.fetchWith) {
|
|
29
|
+
answers.fetchWith = base_1.DEFAULT_FETCHWITH;
|
|
30
|
+
}
|
|
31
|
+
return !answers.fetchWith;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
@@ -35,11 +35,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.removeFile = exports.writeFileToPath = exports.getAppPrefix = exports.getBaseTemplates = exports.getAllTemplates = exports.sortKeys = exports.saveConfiguration = exports.
|
|
38
|
+
exports.removeFile = exports.writeFileToPath = exports.getAppPrefix = exports.getBaseTemplates = exports.getAllTemplates = exports.sortKeys = exports.saveConfiguration = exports.writeJsonFile = exports.openJsonFile = exports.getPascalCaseName = exports.isDevEnvironment = exports.getRelativeProxyDestination = exports.getDefaultProxyDestination = exports.proxyAppMatcher = void 0;
|
|
39
39
|
const chalk_1 = __importDefault(require("chalk"));
|
|
40
40
|
const fs_1 = __importDefault(require("fs"));
|
|
41
41
|
const path_1 = __importStar(require("path"));
|
|
42
42
|
const InitializerFactory_1 = require("../../InitializerFactory");
|
|
43
|
+
// matched for proxy templates
|
|
44
|
+
exports.proxyAppMatcher = /node-headless.+|node-xmcloud.+/g;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the default path for proxy app initialized alongside main JSS tempalates.
|
|
47
|
+
* @param {string} mainAppDestination target destination for main app
|
|
48
|
+
* @param {string} proxyName name of for the proxy app folder
|
|
49
|
+
* @returns {string} target path for proxy app
|
|
50
|
+
*/
|
|
51
|
+
const getDefaultProxyDestination = (mainAppDestination, proxyName) => path_1.default.join(mainAppDestination, '..', proxyName);
|
|
52
|
+
exports.getDefaultProxyDestination = getDefaultProxyDestination;
|
|
53
|
+
const getRelativeProxyDestination = (mainDestination, proxyDestination) => `${path_1.default.relative(path_1.default.resolve(mainDestination), path_1.default.resolve(proxyDestination))}${path_1.sep}`;
|
|
54
|
+
exports.getRelativeProxyDestination = getRelativeProxyDestination;
|
|
43
55
|
/**
|
|
44
56
|
* Determines whether you are in a dev environment.
|
|
45
57
|
* It's `true` if you are inside the monorepo
|
|
@@ -61,46 +73,44 @@ const getPascalCaseName = (name) => {
|
|
|
61
73
|
};
|
|
62
74
|
exports.getPascalCaseName = getPascalCaseName;
|
|
63
75
|
/**
|
|
64
|
-
* Provides
|
|
65
|
-
* @param {string}
|
|
66
|
-
* @returns
|
|
76
|
+
* Provides json data from a file
|
|
77
|
+
* @param {string} jsonFilePath path to the .json file.
|
|
78
|
+
* @returns json data
|
|
67
79
|
*/
|
|
68
|
-
const
|
|
69
|
-
const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
|
|
80
|
+
const openJsonFile = (jsonFilePath) => {
|
|
70
81
|
try {
|
|
71
|
-
const data = fs_1.default.readFileSync(
|
|
82
|
+
const data = fs_1.default.readFileSync(jsonFilePath, 'utf8');
|
|
72
83
|
return data ? JSON.parse(data) : undefined;
|
|
73
84
|
}
|
|
74
85
|
catch (error) {
|
|
75
|
-
console.log(chalk_1.default.red(`The following error occurred while trying to read ${
|
|
86
|
+
console.log(chalk_1.default.red(`The following error occurred while trying to read ${jsonFilePath}:`));
|
|
76
87
|
console.log(chalk_1.default.red(error));
|
|
77
88
|
}
|
|
78
89
|
};
|
|
79
|
-
exports.
|
|
90
|
+
exports.openJsonFile = openJsonFile;
|
|
80
91
|
/**
|
|
81
|
-
* Creates
|
|
82
|
-
* @param {Object} data data to be written into
|
|
83
|
-
* @param {string}
|
|
92
|
+
* Creates a .json file and inserts provided data
|
|
93
|
+
* @param {Object} data data to be written into the .json file
|
|
94
|
+
* @param {string} jsonFilePath a path to a file.
|
|
84
95
|
*/
|
|
85
|
-
const
|
|
86
|
-
const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
|
|
96
|
+
const writeJsonFile = (data, jsonFilePath) => {
|
|
87
97
|
try {
|
|
88
|
-
fs_1.default.writeFileSync(
|
|
98
|
+
fs_1.default.writeFileSync(jsonFilePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
|
|
89
99
|
}
|
|
90
100
|
catch (error) {
|
|
91
|
-
console.log(chalk_1.default.red(`The following error occurred while trying to write ${
|
|
101
|
+
console.log(chalk_1.default.red(`The following error occurred while trying to write ${jsonFilePath}:`));
|
|
92
102
|
console.log(chalk_1.default.red(error));
|
|
93
103
|
}
|
|
94
104
|
};
|
|
95
|
-
exports.
|
|
105
|
+
exports.writeJsonFile = writeJsonFile;
|
|
96
106
|
/**
|
|
97
107
|
* Save configuration params to the package.json
|
|
98
108
|
* @param {string[]} templates templates applied to the sample
|
|
99
109
|
* @param {string} [pkgPath] path to the package.json
|
|
100
110
|
*/
|
|
101
111
|
const saveConfiguration = (templates, pkgPath) => {
|
|
102
|
-
const pkg = (0, exports.
|
|
103
|
-
(0, exports.
|
|
112
|
+
const pkg = (0, exports.openJsonFile)(pkgPath);
|
|
113
|
+
(0, exports.writeJsonFile)(Object.assign(Object.assign({}, pkg), { config: Object.assign(Object.assign({}, pkg.config), { templates }) }), pkgPath);
|
|
104
114
|
};
|
|
105
115
|
exports.saveConfiguration = saveConfiguration;
|
|
106
116
|
const sortKeys = (obj) => {
|
package/dist/init-runner.js
CHANGED
|
@@ -42,7 +42,7 @@ const common_1 = require("./common");
|
|
|
42
42
|
const InitializerFactory_1 = require("./InitializerFactory");
|
|
43
43
|
const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
44
|
let nextStepsArr = [];
|
|
45
|
-
|
|
45
|
+
const appNames = new Set([]);
|
|
46
46
|
const initFactory = new InitializerFactory_1.InitializerFactory();
|
|
47
47
|
const runner = (inits) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
var _a;
|
|
@@ -53,7 +53,8 @@ const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, fun
|
|
|
53
53
|
}
|
|
54
54
|
args.silent || console.log(chalk_1.default.cyan(`Initializing '${init}'...`));
|
|
55
55
|
const response = yield initializer.init(args);
|
|
56
|
-
|
|
56
|
+
// We can have multiple appNames if base template requires to setup an additional standalone app (e.g. XM Cloud proxy)
|
|
57
|
+
appNames.add(response.appName);
|
|
57
58
|
nextStepsArr = [...nextStepsArr, ...((_a = response.nextSteps) !== null && _a !== void 0 ? _a : [])];
|
|
58
59
|
// process any returned initializers
|
|
59
60
|
if (response.initializers && response.initializers.length > 0) {
|
|
@@ -67,17 +68,21 @@ const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, fun
|
|
|
67
68
|
});
|
|
68
69
|
yield runner(initializers);
|
|
69
70
|
(0, common_1.saveConfiguration)(args.templates, path_1.default.resolve(`${args.destination}${path_1.sep}package.json`));
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
for (const destination of [args.destination, args.proxyAppDestination]) {
|
|
72
|
+
if (!destination)
|
|
73
|
+
continue;
|
|
74
|
+
// final steps (install, lint, etc)
|
|
75
|
+
if (!args.noInstall) {
|
|
76
|
+
(0, common_1.installPackages)(destination, args.silent);
|
|
77
|
+
(0, common_1.lintFix)(destination, args.silent);
|
|
78
|
+
}
|
|
79
|
+
// install pre-push hook if user opts-in
|
|
80
|
+
if (args.prePushHook) {
|
|
81
|
+
yield (0, common_1.installPrePushHook)(destination, args.silent);
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
84
|
if (!args.silent) {
|
|
80
|
-
(0, common_1.nextSteps)(
|
|
85
|
+
(0, common_1.nextSteps)([...appNames], nextStepsArr);
|
|
81
86
|
}
|
|
82
87
|
});
|
|
83
88
|
exports.initRunner = initRunner;
|
|
@@ -27,9 +27,22 @@ class AngularInitializer {
|
|
|
27
27
|
const mergedArgs = Object.assign(Object.assign({}, args), answers);
|
|
28
28
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/angular');
|
|
29
29
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
30
|
+
const addInitializers = [];
|
|
31
|
+
if (answers.xmcloud) {
|
|
32
|
+
if (!args.templates.includes('angular-xmcloud')) {
|
|
33
|
+
addInitializers.push('angular-xmcloud');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// invoke default non-XMC init
|
|
38
|
+
if (!args.templates.includes('angular-sxp') && !args.templates.includes('angular-xmcloud')) {
|
|
39
|
+
addInitializers.push('angular-sxp');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
30
42
|
const response = {
|
|
31
43
|
nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
|
|
32
44
|
appName: answers.appName,
|
|
45
|
+
initializers: addInitializers,
|
|
33
46
|
};
|
|
34
47
|
return response;
|
|
35
48
|
});
|
|
@@ -2,4 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prompts = void 0;
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
|
-
exports.prompts = [
|
|
5
|
+
exports.prompts = [
|
|
6
|
+
// XMCloud answer defines init behavior. Prompt must go first
|
|
7
|
+
{
|
|
8
|
+
type: 'confirm',
|
|
9
|
+
name: 'xmcloud',
|
|
10
|
+
message: 'Are you building for Sitecore XM Cloud?',
|
|
11
|
+
default: false,
|
|
12
|
+
when: (answers) => {
|
|
13
|
+
// don't prompt if --yes or angular-xmcloud template was specified
|
|
14
|
+
if (answers.templates.includes('angular-xmcloud') &&
|
|
15
|
+
!answers.templates.includes('angular-sxp')) {
|
|
16
|
+
answers.xmcloud = true;
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (answers.yes) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
...common_1.clientAppPrompts,
|
|
26
|
+
];
|
|
@@ -0,0 +1,62 @@
|
|
|
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 inquirer_1 = __importDefault(require("inquirer"));
|
|
41
|
+
class AngularSxpInitializer {
|
|
42
|
+
get isBase() {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
init(args) {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
49
|
+
const answers = yield inquirer_1.default.prompt(common_1.sxpPrompts, args);
|
|
50
|
+
const styleguideAnswers = yield inquirer_1.default.prompt(common_1.styleguidePrompts, args);
|
|
51
|
+
const mergedArgs = 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 }), answers), styleguideAnswers);
|
|
52
|
+
const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-sxp');
|
|
53
|
+
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
54
|
+
const response = {
|
|
55
|
+
nextSteps: [],
|
|
56
|
+
appName: mergedArgs.appName,
|
|
57
|
+
};
|
|
58
|
+
return response;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = AngularSxpInitializer;
|