create-sitecore-jss 22.2.0-canary.9 → 22.2.1-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 +28 -70
- package/dist/common/index.js +3 -5
- package/dist/common/processes/install.js +2 -9
- package/dist/common/processes/next.js +3 -3
- package/dist/common/processes/transform.js +14 -29
- package/dist/common/prompts/base.js +12 -0
- package/dist/common/utils/helpers.js +43 -28
- package/dist/init-runner.js +11 -16
- package/dist/initializers/angular/index.js +0 -13
- package/dist/initializers/angular/prompts.js +1 -22
- package/dist/initializers/nextjs/index.js +2 -2
- package/dist/initializers/nextjs/prompts.js +0 -2
- 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/react/index.js +3 -3
- package/dist/initializers/react/prompts.js +1 -1
- package/dist/initializers/react-native/prompts.js +0 -1
- package/dist/initializers/vue/prompts.js +1 -1
- package/dist/templates/angular/.env +3 -5
- package/dist/templates/angular/README.md +45 -5
- package/dist/templates/angular/angular.json +6 -1
- package/dist/templates/angular/package.json +20 -10
- package/dist/templates/angular/proxy.conf.js +23 -5
- package/dist/templates/angular/scripts/bootstrap.ts +24 -5
- package/dist/templates/angular/scripts/generate-config.ts +73 -53
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +2 -4
- package/dist/templates/angular/server.bundle.ts +1 -19
- package/dist/templates/angular/src/app/app.module.ts +2 -0
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +19 -4
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +2 -0
- package/dist/templates/{angular-sxp → angular}/src/app/jss-data-fetcher.service.ts +1 -3
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +13 -21
- package/dist/templates/angular/src/app/lib/layout-service-factory.ts +12 -20
- package/dist/templates/angular/src/app/routing/layout/layout.component.html +1 -1
- package/dist/templates/angular/src/app/routing/layout/layout.component.ts +2 -1
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +6 -5
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +2 -1
- package/dist/templates/angular/src/app/routing/routing.module.ts +21 -14
- package/dist/templates/{angular-sxp/src/app/routing/scripts → angular/src/app/routing}/visitor-identification/visitor-identification.component.ts +3 -9
- package/dist/templates/angular/src/graphql-fragment-types.ts +95 -0
- package/dist/templates/angular/tsconfig.json +2 -7
- package/dist/templates/nextjs/package.json +5 -5
- package/dist/templates/nextjs/src/lib/page-props-factory/plugins/component-props.ts +2 -1
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-sxa/src/components/Container.tsx +6 -14
- package/dist/templates/nextjs-xmcloud/package.json +3 -2
- package/dist/templates/nextjs-xmcloud/src/Bootstrap.tsx +25 -10
- package/dist/templates/nextjs-xmcloud/src/byoc/{index.ts → index.tsx} +25 -8
- package/dist/templates/nextjs-xmcloud/src/components/CdpPageView.tsx +9 -14
- package/dist/templates/nextjs-xmcloud/src/lib/middleware/plugins/personalize.ts +0 -1
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/component-themes.ts +2 -1
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/preview-mode.ts +2 -1
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
- 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 +2 -2
- package/dist/common/prompts/sxp.js +0 -20
- package/dist/initializers/angular-sxp/index.js +0 -62
- package/dist/initializers/angular-xmcloud/index.js +0 -66
- package/dist/initializers/node-xmcloud-proxy/index.js +0 -32
- package/dist/templates/angular/scripts/config/index.ts +0 -28
- package/dist/templates/angular/scripts/config/plugins/computed.ts +0 -21
- package/dist/templates/angular/scripts/config/plugins/fallback.ts +0 -23
- package/dist/templates/angular/scripts/config/plugins/package-json.ts +0 -22
- package/dist/templates/angular/scripts/config/plugins/scjssconfig.ts +0 -29
- package/dist/templates/angular/scripts/generate-plugins.ts +0 -28
- package/dist/templates/angular/scripts/temp/gitignore +0 -2
- package/dist/templates/angular/src/app/lib/config.ts +0 -16
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +0 -1
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.ts +0 -7
- package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +0 -8
- package/dist/templates/angular-sxp/package.json +0 -12
- package/dist/templates/angular-sxp/proxy.conf.js +0 -43
- package/dist/templates/angular-sxp/scripts/config/plugins/disconnected.ts +0 -27
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +0 -35
- package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +0 -23
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +0 -3
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +0 -9
- package/dist/templates/angular-sxp/src/graphql-fragment-types.ts +0 -219
- package/dist/templates/angular-xmcloud/.env +0 -8
- package/dist/templates/angular-xmcloud/angular.json +0 -34
- package/dist/templates/angular-xmcloud/package.json +0 -15
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +0 -23
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +0 -15
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +0 -15
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +0 -30
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +0 -13
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +0 -16
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +0 -15
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +0 -15
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory.ts +0 -44
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +0 -48
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +0 -64
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +0 -31
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +0 -49
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +0 -150
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +0 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +0 -11
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +0 -10
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +0 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +0 -4
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +0 -103
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +0 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +0 -121
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +0 -283
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +0 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +0 -11
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +0 -26
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +0 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +0 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +0 -7
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +0 -86
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +0 -101
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +0 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +0 -95
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +0 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +0 -27
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +0 -18
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +0 -51
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +0 -42
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +0 -19
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +0 -26
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +0 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +0 -11
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +0 -63
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +0 -16
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +0 -6
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +0 -24
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +0 -66
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +0 -6
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +0 -17
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +0 -5
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +0 -27
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +0 -45
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +0 -20
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +0 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +0 -58
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +0 -176
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +0 -85
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +0 -29
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +0 -20
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +0 -5
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +0 -8
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +0 -40
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +0 -42
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +0 -3
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +0 -63
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +0 -14
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +0 -13
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +0 -2
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +0 -30
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +0 -1
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +0 -4
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +0 -6
- 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-xmcloud/src/lib/context/index.ts +0 -22
- package/dist/templates/nextjs-xmcloud/src/lib/context/sdk/events.ts +0 -26
- package/dist/templates/node-xmcloud-proxy/.env +0 -8
- package/dist/templates/node-xmcloud-proxy/README.md +0 -36
- package/dist/templates/node-xmcloud-proxy/package.json +0 -25
- package/dist/templates/node-xmcloud-proxy/src/config.ts +0 -19
- package/dist/templates/node-xmcloud-proxy/src/index.ts +0 -161
- package/dist/templates/node-xmcloud-proxy/src/types.ts +0 -59
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +0 -22
- /package/dist/templates/{angular-sxp → angular}/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/component-content/gitignore +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ContentListField/Item1/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ContentListField/Item2/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/EditFrameDemo/Item1/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/EditFrameDemo/Item2/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ItemLinkField/Item1/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ItemLinkField/Item2/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/content/gitignore +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/dictionary/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/dictionary/{{language}}.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/media/files/jss.pdf +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/media/img/jss_logo.png +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/media/img/sc_logo.png +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/sample-1/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/sample-2/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/custom-route-type/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/en.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/{{language}}.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/data/routes/{{language}}.yml +0 -0
- /package/dist/templates/{angular-sxp → angular}/scripts/disconnected-mode-proxy.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/scripts/lint-yml.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/config/{{appName}}.config +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/component-content.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Reuse.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Tabs-Tab.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Tabs.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Multilingual.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Section.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/content-block.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-connected-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-layout.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-angular-lazy-loading.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-component-params.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-custom-route-type.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-edit-frame.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-checkbox.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-content-list.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-custom.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-date.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-file.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-image.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-item-link.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-link.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-number.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-rich-text.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-text.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-route-fields.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-sitecore-context.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-tracking.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/config.js +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/content.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/dictionary.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/placeholders.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/routes.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/Styleguide-Explanatory-Component.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-content-list-template.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-edit-frame-list-item-template.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-item-link-template.sitecore.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/gitignore +0 -0
- /package/dist/templates/{angular-sxp → angular}/sitecore/pipelines/example.patch.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-layout/graph-ql-layout.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-component-params/styleguide-component-params.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout/styleguide-layout.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout/styleguide-layout.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-section/styleguide-section.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-section/styleguide-section.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-tracking/styleguide-tracking.component.html +0 -0
- /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +0 -0
- /package/dist/templates/angular/src/app/lib/{graphql-client-factory.ts → client-factory.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.
|
|
38
|
+
exports.main = 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"));
|
|
@@ -43,22 +43,13 @@ const inquirer_1 = __importDefault(require("inquirer"));
|
|
|
43
43
|
const init_runner_1 = require("./init-runner");
|
|
44
44
|
const minimist_1 = __importDefault(require("minimist"));
|
|
45
45
|
const common_1 = require("./common");
|
|
46
|
-
const helpers_1 = require("./common/utils/helpers");
|
|
47
46
|
const parseArgs = () => {
|
|
48
47
|
// parse any command line arguments passed into `init sitecore-jss`
|
|
49
48
|
// to pass to the generator prompts and skip them.
|
|
50
49
|
// useful for CI and testing purposes
|
|
51
50
|
const options = {
|
|
52
51
|
boolean: ['appPrefix', 'force', 'noInstall', 'yes', 'silent', 'prePushHook'],
|
|
53
|
-
string: [
|
|
54
|
-
'appName',
|
|
55
|
-
'destination',
|
|
56
|
-
'proxyAppDestination',
|
|
57
|
-
'templates',
|
|
58
|
-
'hostName',
|
|
59
|
-
'fetchWith',
|
|
60
|
-
'language',
|
|
61
|
-
],
|
|
52
|
+
string: ['appName', 'destination', 'templates', 'hostName', 'fetchWith', 'language'],
|
|
62
53
|
default: { prePushHook: null },
|
|
63
54
|
};
|
|
64
55
|
const args = (0, minimist_1.default)(process.argv.slice(2), options);
|
|
@@ -71,51 +62,6 @@ const parseArgs = () => {
|
|
|
71
62
|
return args;
|
|
72
63
|
};
|
|
73
64
|
exports.parseArgs = parseArgs;
|
|
74
|
-
const getDestinations = (args, templates) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
if (templates.length === 0) {
|
|
76
|
-
throw new Error('Unable to get destinations, provided templates are empty');
|
|
77
|
-
}
|
|
78
|
-
// validate/gather destinations
|
|
79
|
-
const defaultBaseDestination = `${process.cwd()}${args.appName ? path_1.sep + args.appName : `${path_1.sep}${templates[0]}`}`;
|
|
80
|
-
let destination = args.destination;
|
|
81
|
-
if (!destination) {
|
|
82
|
-
destination = args.yes
|
|
83
|
-
? defaultBaseDestination
|
|
84
|
-
: yield (0, exports.promptDestination)('Where would you like your new app created?', defaultBaseDestination);
|
|
85
|
-
}
|
|
86
|
-
// work with node-proxy destination if needed
|
|
87
|
-
const proxyApp = templates.find((template) => template.match(helpers_1.proxyAppMatcher));
|
|
88
|
-
if (proxyApp) {
|
|
89
|
-
// put the proxy alongside main app by default
|
|
90
|
-
const defaultProxyDestination = (0, helpers_1.getDefaultProxyDestination)(destination, proxyApp);
|
|
91
|
-
let proxyAppDestination = args.proxyAppDestination;
|
|
92
|
-
if (!proxyAppDestination) {
|
|
93
|
-
proxyAppDestination = args.yes
|
|
94
|
-
? defaultProxyDestination
|
|
95
|
-
: yield (0, exports.promptDestination)('Where would you like your proxy app created?', defaultProxyDestination);
|
|
96
|
-
}
|
|
97
|
-
while (path_1.default.resolve(proxyAppDestination) === path_1.default.resolve(destination)) {
|
|
98
|
-
proxyAppDestination = yield (0, exports.promptDestination)('Proxy app and base app cannot be located in the same folder. Please input another path for proxy', defaultProxyDestination);
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
destination,
|
|
102
|
-
proxyAppDestination,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
destination,
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
exports.getDestinations = getDestinations;
|
|
110
|
-
const promptDestination = (prompt, defaultDestination) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
-
return (yield inquirer_1.default.prompt({
|
|
112
|
-
type: 'input',
|
|
113
|
-
name: 'destination',
|
|
114
|
-
message: prompt,
|
|
115
|
-
default: () => defaultDestination,
|
|
116
|
-
})).destination;
|
|
117
|
-
});
|
|
118
|
-
exports.promptDestination = promptDestination;
|
|
119
65
|
const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
66
|
let templates = [];
|
|
121
67
|
// check if templates were provided
|
|
@@ -153,24 +99,36 @@ const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
153
99
|
});
|
|
154
100
|
templates.push(answer.template);
|
|
155
101
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
102
|
+
// validate/gather destination
|
|
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 {
|
|
161
110
|
const answer = yield inquirer_1.default.prompt({
|
|
162
|
-
type: '
|
|
163
|
-
name: '
|
|
164
|
-
message:
|
|
111
|
+
type: 'input',
|
|
112
|
+
name: 'destination',
|
|
113
|
+
message: 'Where would you like your new app created?',
|
|
114
|
+
default: () => defaultDestination,
|
|
165
115
|
});
|
|
166
|
-
|
|
167
|
-
process.exit();
|
|
168
|
-
}
|
|
116
|
+
destination = answer.destination;
|
|
169
117
|
}
|
|
170
|
-
|
|
171
|
-
|
|
118
|
+
}
|
|
119
|
+
if (!args.force && fs_1.default.existsSync(destination) && fs_1.default.readdirSync(destination).length > 0) {
|
|
120
|
+
const answer = yield inquirer_1.default.prompt({
|
|
121
|
+
type: 'confirm',
|
|
122
|
+
name: 'continue',
|
|
123
|
+
message: `Directory '${destination}' not empty. Are you sure you want to continue?`,
|
|
124
|
+
});
|
|
125
|
+
if (!answer.continue) {
|
|
126
|
+
process.exit();
|
|
172
127
|
}
|
|
173
128
|
}
|
|
129
|
+
else {
|
|
130
|
+
args.force = true;
|
|
131
|
+
}
|
|
174
132
|
if (!args.yes) {
|
|
175
133
|
if (args.prePushHook === null) {
|
|
176
134
|
const answer = yield inquirer_1.default.prompt({
|
|
@@ -188,7 +146,7 @@ const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
188
146
|
}
|
|
189
147
|
}
|
|
190
148
|
try {
|
|
191
|
-
yield (0, init_runner_1.initRunner)(templates.slice(), Object.assign(Object.assign(
|
|
149
|
+
yield (0, init_runner_1.initRunner)(templates.slice(), Object.assign(Object.assign({}, args), { destination, templates }));
|
|
192
150
|
}
|
|
193
151
|
catch (error) {
|
|
194
152
|
console.log(chalk_1.default.red('An error occurred: ', error));
|
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.writePackageJson = exports.openPackageJson = exports.isDevEnvironment = 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,12 +8,10 @@ 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; } });
|
|
13
11
|
var helpers_1 = require("./utils/helpers");
|
|
14
12
|
Object.defineProperty(exports, "isDevEnvironment", { enumerable: true, get: function () { return helpers_1.isDevEnvironment; } });
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "openPackageJson", { enumerable: true, get: function () { return helpers_1.openPackageJson; } });
|
|
14
|
+
Object.defineProperty(exports, "writePackageJson", { enumerable: true, get: function () { return helpers_1.writePackageJson; } });
|
|
17
15
|
Object.defineProperty(exports, "getAllTemplates", { enumerable: true, get: function () { return helpers_1.getAllTemplates; } });
|
|
18
16
|
Object.defineProperty(exports, "getBaseTemplates", { enumerable: true, get: function () { return helpers_1.getBaseTemplates; } });
|
|
19
17
|
Object.defineProperty(exports, "saveConfiguration", { enumerable: true, get: function () { return helpers_1.saveConfiguration; } });
|
|
@@ -47,7 +47,8 @@ exports.installPackages = installPackages;
|
|
|
47
47
|
*/
|
|
48
48
|
const lintFix = (projectFolder, silent) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const
|
|
50
|
+
const packagePath = path_1.default.join(projectFolder, 'package.json');
|
|
51
|
+
const pkg = (0, helpers_1.openPackageJson)(packagePath);
|
|
51
52
|
if (!((_a = pkg === null || pkg === void 0 ? void 0 : pkg.scripts) === null || _a === void 0 ? void 0 : _a.lint)) {
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
@@ -64,10 +65,6 @@ exports.lintFix = lintFix;
|
|
|
64
65
|
* @param {boolean} [silent] suppress logs
|
|
65
66
|
*/
|
|
66
67
|
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
|
-
}
|
|
71
68
|
silent || console.log(chalk_1.default.cyan('Installing pre-push hook...'));
|
|
72
69
|
yield new Promise((resolve, reject) => {
|
|
73
70
|
(0, child_process_1.exec)(`cd ${destination} && git init && npm run install-pre-push-hook`, (err) => {
|
|
@@ -83,7 +80,3 @@ const installPrePushHook = (destination, silent) => __awaiter(void 0, void 0, vo
|
|
|
83
80
|
});
|
|
84
81
|
});
|
|
85
82
|
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,10 @@ 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} appName application name 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 = (appName, nextStepsArr) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
console.log(chalk_1.default.red(' -/oyhdmNNNNmdhyo/- '));
|
|
24
24
|
console.log(chalk_1.default.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
|
|
25
25
|
console.log(chalk_1.default.red(' :yNMMMMMMMMMMMMMMMMMMMMMMMMMMNy: '));
|
|
@@ -51,7 +51,7 @@ const nextSteps = (appNames, nextStepsArr) => __awaiter(void 0, void 0, void 0,
|
|
|
51
51
|
console.log(chalk_1.default.white(' / // /\\ \\_\\ \\ '));
|
|
52
52
|
console.log(chalk_1.default.white(' \\___/___/___/'));
|
|
53
53
|
console.log();
|
|
54
|
-
console.log(`JSS application
|
|
54
|
+
console.log(`JSS application ${chalk_1.default.green(appName)} is ready!`);
|
|
55
55
|
console.log();
|
|
56
56
|
console.log(chalk_1.default.yellow('Next steps:'));
|
|
57
57
|
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.
|
|
38
|
+
exports.transform = 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,21 +180,6 @@ 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
|
-
// When SPA application and XM Cloud proxy is used we need to calculate relative path between SPA app and proxy to apply that in EJS template
|
|
191
|
-
// Absolute path can't be used across all the machines
|
|
192
|
-
if (answers.proxyAppDestination) {
|
|
193
|
-
ejsData.helper.relativeProxyAppDestination = `${path_1.default.relative(path_1.default.resolve(answers.destination), path_1.default.resolve(answers.proxyAppDestination))}${path_1.sep}`;
|
|
194
|
-
}
|
|
195
|
-
return ejsData;
|
|
196
|
-
};
|
|
197
|
-
exports.populateEjsData = populateEjsData;
|
|
198
183
|
/**
|
|
199
184
|
* Handles each template file and applies ejs renderer, also:
|
|
200
185
|
* * determines files for copy
|
|
@@ -209,16 +194,16 @@ exports.populateEjsData = populateEjsData;
|
|
|
209
194
|
*/
|
|
210
195
|
const transform = (templatePath, answers, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
211
196
|
const { isFileForCopy, isFileForSkip, fileForCopyRegExp = FILE_FOR_COPY_REGEXP } = options;
|
|
212
|
-
|
|
213
|
-
// allow proxy app to be installed separately alongside base app
|
|
214
|
-
if (templatePath.match(/.*node-.+-proxy$/g) && answers.proxyAppDestination) {
|
|
215
|
-
destination = answers.proxyAppDestination;
|
|
216
|
-
}
|
|
217
|
-
const destinationPath = path_1.default.resolve(destination || answers.destination);
|
|
197
|
+
const destinationPath = path_1.default.resolve(answers.destination);
|
|
218
198
|
if (!answers.appPrefix) {
|
|
219
199
|
answers.appPrefix = false;
|
|
220
200
|
}
|
|
221
|
-
|
|
201
|
+
// pass in helper to answers object
|
|
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
|
+
} });
|
|
222
207
|
// the templates to be run through ejs render or copied directly
|
|
223
208
|
const files = glob_1.default.sync('**/*', { cwd: templatePath, dot: true, nodir: true });
|
|
224
209
|
for (const file of files) {
|
|
@@ -243,13 +228,13 @@ const transform = (templatePath, answers, options = {}) => __awaiter(void 0, voi
|
|
|
243
228
|
fs_extra_1.default.copySync(pathToTemplate, pathToNewFile);
|
|
244
229
|
continue;
|
|
245
230
|
}
|
|
246
|
-
if (file.endsWith('.json') && fs_extra_1.default.existsSync(pathToNewFile)) {
|
|
247
|
-
// we treat
|
|
248
|
-
// read the current .json and the template .json (rendered with ejs)
|
|
249
|
-
const
|
|
250
|
-
const
|
|
231
|
+
if (file.endsWith('package.json') && fs_extra_1.default.existsSync(pathToNewFile)) {
|
|
232
|
+
// we treat package.json a bit differently
|
|
233
|
+
// read the current package.json and the template package.json (rendered with ejs)
|
|
234
|
+
const currentPkg = (0, helpers_1.openPackageJson)(pathToNewFile);
|
|
235
|
+
const templatePkg = JSON.parse(yield (0, ejs_1.renderFile)(path_1.default.resolve(pathToTemplate), ejsData));
|
|
251
236
|
// merge them and set the result to str which will then go through diff
|
|
252
|
-
const merged = (0, exports.merge)(
|
|
237
|
+
const merged = (0, exports.merge)(currentPkg, templatePkg);
|
|
253
238
|
str = JSON.stringify(merged, null, 2);
|
|
254
239
|
}
|
|
255
240
|
if (file.endsWith('.env') && fs_extra_1.default.existsSync(pathToNewFile)) {
|
|
@@ -38,6 +38,18 @@ 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
|
+
},
|
|
41
53
|
{
|
|
42
54
|
type: 'list',
|
|
43
55
|
name: 'fetchWith',
|
|
@@ -1,4 +1,27 @@
|
|
|
1
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -12,21 +35,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
36
|
};
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
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.writePackageJson = exports.openPackageJson = exports.getPascalCaseName = exports.isDevEnvironment = void 0;
|
|
16
39
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
40
|
const fs_1 = __importDefault(require("fs"));
|
|
18
|
-
const path_1 =
|
|
41
|
+
const path_1 = __importStar(require("path"));
|
|
19
42
|
const InitializerFactory_1 = require("../../InitializerFactory");
|
|
20
|
-
// matched for proxy templates
|
|
21
|
-
exports.proxyAppMatcher = /node-headless.+|node-xmcloud.+/g;
|
|
22
|
-
/**
|
|
23
|
-
* Returns the default path for proxy app initialized alongside main JSS tempalates.
|
|
24
|
-
* @param {string} mainAppDestination target destination for main app
|
|
25
|
-
* @param {string} proxyName name of for the proxy app folder
|
|
26
|
-
* @returns {string} target path for proxy app
|
|
27
|
-
*/
|
|
28
|
-
const getDefaultProxyDestination = (mainAppDestination, proxyName) => path_1.default.join(mainAppDestination, '..', proxyName);
|
|
29
|
-
exports.getDefaultProxyDestination = getDefaultProxyDestination;
|
|
30
43
|
/**
|
|
31
44
|
* Determines whether you are in a dev environment.
|
|
32
45
|
* It's `true` if you are inside the monorepo
|
|
@@ -48,44 +61,46 @@ const getPascalCaseName = (name) => {
|
|
|
48
61
|
};
|
|
49
62
|
exports.getPascalCaseName = getPascalCaseName;
|
|
50
63
|
/**
|
|
51
|
-
* Provides json data
|
|
52
|
-
* @param {string}
|
|
53
|
-
* @returns json data
|
|
64
|
+
* Provides `package.json` data
|
|
65
|
+
* @param {string} [pkgPath] path to `package.json`. Default is './package.json'.
|
|
66
|
+
* @returns `package.json` data
|
|
54
67
|
*/
|
|
55
|
-
const
|
|
68
|
+
const openPackageJson = (pkgPath) => {
|
|
69
|
+
const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
|
|
56
70
|
try {
|
|
57
|
-
const data = fs_1.default.readFileSync(
|
|
71
|
+
const data = fs_1.default.readFileSync(filePath, 'utf8');
|
|
58
72
|
return data ? JSON.parse(data) : undefined;
|
|
59
73
|
}
|
|
60
74
|
catch (error) {
|
|
61
|
-
console.log(chalk_1.default.red(`The following error occurred while trying to read ${
|
|
75
|
+
console.log(chalk_1.default.red(`The following error occurred while trying to read ${filePath}:`));
|
|
62
76
|
console.log(chalk_1.default.red(error));
|
|
63
77
|
}
|
|
64
78
|
};
|
|
65
|
-
exports.
|
|
79
|
+
exports.openPackageJson = openPackageJson;
|
|
66
80
|
/**
|
|
67
|
-
* Creates
|
|
68
|
-
* @param {Object} data data to be written into
|
|
69
|
-
* @param {string}
|
|
81
|
+
* Creates `package.json` file and inserts provided data
|
|
82
|
+
* @param {Object} data data to be written into package.json
|
|
83
|
+
* @param {string} [pkgPath] a path to a file. Default is './package.json'.
|
|
70
84
|
*/
|
|
71
|
-
const
|
|
85
|
+
const writePackageJson = (data, pkgPath) => {
|
|
86
|
+
const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
|
|
72
87
|
try {
|
|
73
|
-
fs_1.default.writeFileSync(
|
|
88
|
+
fs_1.default.writeFileSync(filePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
|
|
74
89
|
}
|
|
75
90
|
catch (error) {
|
|
76
|
-
console.log(chalk_1.default.red(`The following error occurred while trying to write ${
|
|
91
|
+
console.log(chalk_1.default.red(`The following error occurred while trying to write ${filePath}:`));
|
|
77
92
|
console.log(chalk_1.default.red(error));
|
|
78
93
|
}
|
|
79
94
|
};
|
|
80
|
-
exports.
|
|
95
|
+
exports.writePackageJson = writePackageJson;
|
|
81
96
|
/**
|
|
82
97
|
* Save configuration params to the package.json
|
|
83
98
|
* @param {string[]} templates templates applied to the sample
|
|
84
99
|
* @param {string} [pkgPath] path to the package.json
|
|
85
100
|
*/
|
|
86
101
|
const saveConfiguration = (templates, pkgPath) => {
|
|
87
|
-
const pkg = (0, exports.
|
|
88
|
-
(0, exports.
|
|
102
|
+
const pkg = (0, exports.openPackageJson)(pkgPath);
|
|
103
|
+
(0, exports.writePackageJson)(Object.assign(Object.assign({}, pkg), { config: Object.assign(Object.assign({}, pkg.config), { templates }) }), pkgPath);
|
|
89
104
|
};
|
|
90
105
|
exports.saveConfiguration = saveConfiguration;
|
|
91
106
|
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
|
+
let appName;
|
|
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,8 +53,7 @@ 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
|
-
|
|
57
|
-
appNames.add(response.appName);
|
|
56
|
+
appName = response.appName;
|
|
58
57
|
nextStepsArr = [...nextStepsArr, ...((_a = response.nextSteps) !== null && _a !== void 0 ? _a : [])];
|
|
59
58
|
// process any returned initializers
|
|
60
59
|
if (response.initializers && response.initializers.length > 0) {
|
|
@@ -68,21 +67,17 @@ const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, fun
|
|
|
68
67
|
});
|
|
69
68
|
yield runner(initializers);
|
|
70
69
|
(0, common_1.saveConfiguration)(args.templates, path_1.default.resolve(`${args.destination}${path_1.sep}package.json`));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// install pre-push hook if user opts-in
|
|
80
|
-
if (args.prePushHook) {
|
|
81
|
-
yield (0, common_1.installPrePushHook)(destination, args.silent);
|
|
82
|
-
}
|
|
70
|
+
// final steps (install, lint, etc)
|
|
71
|
+
if (!args.noInstall) {
|
|
72
|
+
(0, common_1.installPackages)(args.destination, args.silent);
|
|
73
|
+
(0, common_1.lintFix)(args.destination, args.silent);
|
|
74
|
+
}
|
|
75
|
+
// install pre-push hook if user opts-in
|
|
76
|
+
if (args.prePushHook) {
|
|
77
|
+
yield (0, common_1.installPrePushHook)(args.destination, args.silent);
|
|
83
78
|
}
|
|
84
79
|
if (!args.silent) {
|
|
85
|
-
(0, common_1.nextSteps)(
|
|
80
|
+
(0, common_1.nextSteps)(appName || '', nextStepsArr);
|
|
86
81
|
}
|
|
87
82
|
});
|
|
88
83
|
exports.initRunner = initRunner;
|
|
@@ -27,22 +27,9 @@ 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
|
-
}
|
|
42
30
|
const response = {
|
|
43
31
|
nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
|
|
44
32
|
appName: answers.appName,
|
|
45
|
-
initializers: addInitializers,
|
|
46
33
|
};
|
|
47
34
|
return response;
|
|
48
35
|
});
|
|
@@ -2,25 +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 = [
|
|
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.yes) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
else if (answers.templates.includes('angular-xmcloud') &&
|
|
18
|
-
!answers.templates.includes('angular-sxp')) {
|
|
19
|
-
answers.xmcloud = true;
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
...common_1.clientAppPrompts,
|
|
26
|
-
];
|
|
5
|
+
exports.prompts = [...common_1.clientAppPrompts, ...common_1.styleguidePrompts];
|
|
@@ -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.openPackageJson)(pkgPath);
|
|
109
109
|
pkg.scripts.bootstrap = pkg.scripts.bootstrap.replace(' && graphql-let', '');
|
|
110
|
-
(0, common_1.
|
|
110
|
+
(0, common_1.writePackageJson)(pkg, pkgPath);
|
|
111
111
|
}
|
|
112
112
|
const response = {
|
|
113
113
|
nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
|
|
@@ -12,10 +12,8 @@ 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
|
|
16
15
|
exports.prompts = [
|
|
17
16
|
...common_1.clientAppPrompts,
|
|
18
|
-
...common_1.sxpPrompts,
|
|
19
17
|
{
|
|
20
18
|
type: 'list',
|
|
21
19
|
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.openPackageJson)(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.writePackageJson)(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.openPackageJson)(`${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.openPackageJson)(`${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.openPackageJson)(`${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.openPackageJson)(`${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.openPackageJson)(`${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);
|