create-sitecore-jss 22.2.0-canary.81 → 22.2.0-canary.83
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 +19 -35
- package/dist/common/index.js +3 -5
- package/dist/common/processes/install.js +2 -9
- package/dist/common/processes/next.js +3 -6
- package/dist/common/processes/transform.js +13 -18
- package/dist/common/prompts/base.js +25 -0
- package/dist/common/utils/helpers.js +19 -29
- 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 -4
- package/dist/templates/angular/.eslintrc +0 -1
- package/dist/templates/angular/README.md +45 -5
- package/dist/templates/angular/angular.json +6 -1
- package/dist/templates/angular/gitignore +0 -5
- package/dist/templates/angular/package.json +18 -6
- package/dist/templates/angular/proxy.conf.js +23 -5
- package/dist/templates/angular/scripts/bootstrap.ts +24 -5
- package/dist/templates/angular/scripts/generate-component-factory.ts +166 -0
- package/dist/templates/angular/scripts/generate-config.ts +72 -71
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +28 -21
- package/dist/templates/angular/server.bundle.ts +5 -3
- package/dist/templates/angular/src/app/JssState.ts +9 -2
- package/dist/templates/angular/src/app/app.module.ts +6 -5
- package/dist/templates/angular/src/app/app.server.module.ts +6 -9
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +19 -4
- package/dist/templates/angular/src/app/components/gitignore +1 -1
- package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +1 -1
- package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +7 -15
- package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +2 -14
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +4 -4
- package/dist/templates/angular/src/app/jss-context.service.ts +11 -14
- package/dist/templates/{angular-sxp → angular}/src/app/jss-data-fetcher.service.ts +1 -3
- 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/client-factory.ts +28 -0
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +13 -24
- 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 +11 -11
- 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/environments/gitignore +1 -2
- package/dist/templates/angular/src/graphql-fragment-types.ts +95 -0
- package/dist/templates/angular/tsconfig.json +2 -7
- package/dist/templates/nextjs/scripts/config/plugins/fallback.ts +1 -0
- package/dist/templates/nextjs/scripts/generate-config.ts +1 -8
- package/dist/templates/nextjs-styleguide/scripts/config/plugins/disconnected.ts +0 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_alignment.scss +7 -34
- 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 +2 -9
- package/dist/templates/react/scripts/generate-config.js +3 -10
- package/dist/templates/vue/scripts/generate-config.js +0 -5
- package/package.json +2 -2
- package/dist/common/prompts/proxy.js +0 -35
- package/dist/common/prompts/sxp.js +0 -34
- package/dist/initializers/angular-sxp/index.js +0 -62
- package/dist/initializers/angular-xmcloud/index.js +0 -80
- package/dist/initializers/node-xmcloud-proxy/index.js +0 -33
- 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 -22
- 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-component-factory/index.ts +0 -45
- package/dist/templates/angular/scripts/generate-component-factory/plugins/component-factory.ts +0 -147
- package/dist/templates/angular/scripts/generate-component-factory/plugins/components.ts +0 -19
- package/dist/templates/angular/scripts/generate-component-factory/plugins/packages.ts +0 -29
- package/dist/templates/angular/scripts/generate-component-factory/template.ts +0 -46
- package/dist/templates/angular/scripts/generate-plugins.ts +0 -33
- package/dist/templates/angular/scripts/temp/gitignore +0 -2
- package/dist/templates/angular/server.exports.ts +0 -13
- package/dist/templates/angular/src/app/lib/config.ts +0 -16
- package/dist/templates/angular/src/app/lib/graphql-client-factory/config.ts +0 -21
- package/dist/templates/angular/src/app/lib/graphql-client-factory/index.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/.env +0 -2
- 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 -29
- 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 -21
- package/dist/templates/angular-xmcloud/angular.json +0 -33
- package/dist/templates/angular-xmcloud/package.json +0 -17
- package/dist/templates/angular-xmcloud/scripts/bootstrap.ts +0 -28
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +0 -39
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/plugins/packages.ts +0 -34
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +0 -57
- package/dist/templates/angular-xmcloud/scripts/generate-metadata.ts +0 -25
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +0 -15
- package/dist/templates/angular-xmcloud/server.exports.ts +0 -24
- package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +0 -21
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +0 -5
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +0 -40
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +0 -14
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +0 -30
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +0 -36
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +0 -67
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +0 -15
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +0 -41
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +0 -23
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +0 -65
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +0 -21
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +0 -49
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.html +0 -5
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +0 -39
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.html +0 -1
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +0 -15
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +0 -21
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +0 -13
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +0 -8
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +0 -21
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +0 -11
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +0 -35
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +0 -15
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +0 -10
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +0 -56
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +0 -55
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +0 -17
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory/config.ts +0 -58
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +0 -38
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +0 -104
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +0 -77
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +0 -48
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.html +0 -5
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +0 -12
- 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 -51
- 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 -14
- 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/node-headless-ssr-experience-edge/gitignore +0 -19
- package/dist/templates/node-headless-ssr-proxy/gitignore +0 -19
- package/dist/templates/node-xmcloud-proxy/.env +0 -14
- package/dist/templates/node-xmcloud-proxy/README.md +0 -36
- package/dist/templates/node-xmcloud-proxy/gitignore +0 -33
- package/dist/templates/node-xmcloud-proxy/package.json +0 -26
- package/dist/templates/node-xmcloud-proxy/src/config.ts +0 -25
- package/dist/templates/node-xmcloud-proxy/src/index.ts +0 -210
- package/dist/templates/node-xmcloud-proxy/src/types.ts +0 -27
- 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/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
|
@@ -3,11 +3,51 @@
|
|
|
3
3
|
<!---
|
|
4
4
|
@TODO: Update to next version docs before release
|
|
5
5
|
-->
|
|
6
|
-
|
|
7
6
|
[Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-angular.html)
|
|
8
7
|
|
|
9
|
-
<!---
|
|
10
|
-
@TODO: Verify the link for angular xmcloud when documentation is ready
|
|
11
|
-
-->
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
## App setup
|
|
10
|
+
|
|
11
|
+
1. `npm install`
|
|
12
|
+
1. `npm install -g @sitecore-jss/sitecore-jss-cli`
|
|
13
|
+
1. `jss setup`
|
|
14
|
+
|
|
15
|
+
> This setup is optional to get started with development, as it assumes you have Sitecore installed.
|
|
16
|
+
>
|
|
17
|
+
> If you answer "yes", you would need to provide the path to your Sitecore installation's "Website" folder.
|
|
18
|
+
|
|
19
|
+
## Development server
|
|
20
|
+
|
|
21
|
+
Run `jss start`.
|
|
22
|
+
|
|
23
|
+
The app will be built and webpack server will be started. So it's expected that the browser will open with `http://localhost:3000` and familiar default welcome content is rendered.
|
|
24
|
+
|
|
25
|
+
The app will automatically reload if you change any of the source files.
|
|
26
|
+
|
|
27
|
+
When running the development server, it automatically sets up a sitecore mock server configures a proxy that forwards all requests to `/sitecore` to that sitecore mock server. Check `proxy.conf.js` to see mock server and proxy implementation.
|
|
28
|
+
|
|
29
|
+
### Congratulations!
|
|
30
|
+
|
|
31
|
+
The app is now running in dev mode sourcing data from local files and is not connected to Sitecore in any way.
|
|
32
|
+
|
|
33
|
+
## App deployment
|
|
34
|
+
|
|
35
|
+
### Pre-requisites
|
|
36
|
+
|
|
37
|
+
1. Sitecore instance has JSS packages installed.
|
|
38
|
+
1. Sitecore is configured for this JSS app.
|
|
39
|
+
|
|
40
|
+
### Steps
|
|
41
|
+
|
|
42
|
+
Run `jss deploy package`.
|
|
43
|
+
|
|
44
|
+
This step will:
|
|
45
|
+
|
|
46
|
+
* Run the production bundle of your app.
|
|
47
|
+
* Generate the app manifest.
|
|
48
|
+
* Generate a package with the manifest and production bundle.
|
|
49
|
+
* Install the package over HTTP on your Sitecore instance.
|
|
50
|
+
|
|
51
|
+
## Further help
|
|
52
|
+
|
|
53
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -49,7 +49,12 @@
|
|
|
49
49
|
],
|
|
50
50
|
"baseHref": "/",
|
|
51
51
|
"aot": true,
|
|
52
|
-
"
|
|
52
|
+
"//": [
|
|
53
|
+
"You might want to adjust the optimization entry to workaround a bug with bootstrap warnings caused by Angular",
|
|
54
|
+
"The warnings may occur during build and when running connected mode. Check below for possible fixes.",
|
|
55
|
+
"https://github.com/ng-bootstrap/ng-bootstrap/issues/4306"
|
|
56
|
+
],
|
|
57
|
+
"optimization": "true",
|
|
53
58
|
"outputHashing": "all",
|
|
54
59
|
"sourceMap": false,
|
|
55
60
|
"namedChunks": false,
|
|
@@ -15,15 +15,18 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"ng": "ng",
|
|
18
|
-
"lint": "
|
|
18
|
+
"lint:yml": "ts-node ./scripts/lint-yml.ts",
|
|
19
|
+
"lint": "ng lint <%- appName %> --fix && npm run lint:yml",
|
|
19
20
|
"e2e": "ng e2e",
|
|
20
21
|
"jss": "jss",
|
|
22
|
+
"start": "cross-env-shell JSS_MODE=disconnected \"npm-run-all --serial bootstrap --parallel start:angular start:proxy start:watch-components\"",
|
|
21
23
|
"start:connected": "npm-run-all --serial bootstrap start:angular start:watch-components",
|
|
22
|
-
"build": "npm-run-all --serial bootstrap build:client build:server",
|
|
23
|
-
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component
|
|
24
|
+
"build": "npm-run-all --serial bootstrap --serial build:client build:server",
|
|
25
|
+
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component",
|
|
24
26
|
"start:angular": "ng serve -o",
|
|
25
|
-
"start:
|
|
26
|
-
"
|
|
27
|
+
"start:proxy": "ts-node --project src/tsconfig.webpack-server.json scripts/disconnected-mode-proxy.ts",
|
|
28
|
+
"start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory.ts --watch",
|
|
29
|
+
"build:client": "cross-env-shell ng build --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
27
30
|
"build:server": "cross-env-shell ng run <%- appName %>:server:production --output-path=$npm_package_config_buildArtifactsPath",
|
|
28
31
|
"postbuild:server": "move-cli ./dist/main.js ./dist/server.bundle.js",
|
|
29
32
|
"bootstrap": "ts-node --project src/tsconfig.webpack-server.json scripts/bootstrap.ts",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"core-js": "~3.37.1",
|
|
64
67
|
"graphql": "15.5.0",
|
|
65
68
|
"graphql-tag": "~2.11.0",
|
|
69
|
+
"lodash": "^4.17.21",
|
|
66
70
|
"rxjs": "~7.8.1",
|
|
67
71
|
"tslib": "^2.6.3",
|
|
68
72
|
"zone.js": "~0.14.7"
|
|
@@ -81,23 +85,30 @@
|
|
|
81
85
|
"@sitecore-jss/sitecore-jss-angular-schematics": "~22.2.0-canary",
|
|
82
86
|
"@sitecore-jss/sitecore-jss-cli": "~22.2.0-canary",
|
|
83
87
|
"@sitecore-jss/sitecore-jss-dev-tools": "~22.2.0-canary",
|
|
88
|
+
"@types/isomorphic-fetch": "0.0.35",
|
|
84
89
|
"@types/jasmine": "~3.6.7",
|
|
85
90
|
"@types/jasminewd2": "~2.0.8",
|
|
86
91
|
"@types/node": "~20.14.10",
|
|
87
92
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
88
93
|
"@typescript-eslint/parser": "^7.16.0",
|
|
94
|
+
"body-parser": "~1.20.2",
|
|
89
95
|
"chalk": "~4.1.0",
|
|
90
96
|
"chokidar": "^3.5.2",
|
|
91
97
|
"codelyzer": "~6.0.1",
|
|
92
98
|
"constant-case": "^3.0.4",
|
|
99
|
+
"cookie-parser": "~1.4.5",
|
|
93
100
|
"cross-env": "~7.0.3",
|
|
94
101
|
"del-cli": "^5.0.0",
|
|
95
102
|
"dotenv": "^16.0.0",
|
|
96
103
|
"dotenv-webpack": "^7.1.0",
|
|
104
|
+
"enhanced-resolve": "5.7.0",
|
|
97
105
|
"eslint": "^8.56.0",
|
|
98
106
|
"eslint-plugin-import": "2.29.1",
|
|
99
107
|
"eslint-plugin-jsdoc": "48.7.0",
|
|
100
108
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
109
|
+
"express": "~4.17.1",
|
|
110
|
+
"fs-extra": "~9.1.0",
|
|
111
|
+
"isomorphic-fetch": "^3.0.0",
|
|
101
112
|
"jasmine-core": "~3.7.1",
|
|
102
113
|
"jasmine-spec-reporter": "~6.0.0",
|
|
103
114
|
"karma": "^6.3.2",
|
|
@@ -110,6 +121,7 @@
|
|
|
110
121
|
"npm-run-all": "~4.1.5",
|
|
111
122
|
"protractor": "^7.0.0",
|
|
112
123
|
"ts-node": "~10.9.2",
|
|
113
|
-
"typescript": "~5.2.2"
|
|
124
|
+
"typescript": "~5.2.2",
|
|
125
|
+
"yaml-lint": "^1.2.4"
|
|
114
126
|
}
|
|
115
127
|
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
/*
|
|
2
|
-
When the app runs in
|
|
2
|
+
When the app runs in disconnected mode, and Sitecore is not present, we need to give
|
|
3
|
+
the app copies of the Sitecore APIs it depends on (layout service, dictionary service, content service)
|
|
4
|
+
to talk to so that the app can run using the locally defined disconnected data.
|
|
5
|
+
|
|
6
|
+
When the app runs in connected mode, Sitecore is present and some of the requests should be
|
|
3
7
|
proxied to the Sitecore API
|
|
8
|
+
|
|
9
|
+
This is accomplished by spinning up a small Express server that mocks the APIs, and then
|
|
10
|
+
telling angular-cli to proxy requests to the API paths to this express instance.
|
|
11
|
+
|
|
12
|
+
See /scripts/disconnected-mode-proxy.ts for the proxy API server configuration.
|
|
4
13
|
*/
|
|
14
|
+
const constants = require('@sitecore-jss/sitecore-jss-angular/cjs').constants;
|
|
5
15
|
const environment = require('./src/environments/environment.js').environment;
|
|
6
16
|
|
|
7
|
-
const
|
|
17
|
+
const port = 3043;
|
|
18
|
+
|
|
19
|
+
const PROXY_CONFIG = process.env.JSS_MODE === constants.JSS_MODE.DISCONNECTED ? [
|
|
20
|
+
{
|
|
21
|
+
context: ['/data', '/sitecore'],
|
|
22
|
+
target: `http://localhost:${port}`,
|
|
23
|
+
secure: false,
|
|
24
|
+
},
|
|
25
|
+
] : [
|
|
8
26
|
{
|
|
9
27
|
context: [
|
|
10
28
|
// API endpoints
|
|
@@ -12,12 +30,12 @@ const PROXY_CONFIG = [
|
|
|
12
30
|
// media items
|
|
13
31
|
'/-',
|
|
14
32
|
// visitor identification
|
|
15
|
-
'/layouts'
|
|
33
|
+
'/layouts'
|
|
16
34
|
],
|
|
17
35
|
target: environment.sitecoreApiHost,
|
|
18
36
|
secure: false,
|
|
19
|
-
changeOrigin: true
|
|
20
|
-
}
|
|
37
|
+
changeOrigin: true
|
|
38
|
+
}
|
|
21
39
|
];
|
|
22
40
|
|
|
23
41
|
module.exports = PROXY_CONFIG;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import 'dotenv/config';
|
|
2
|
+
import { constants } from '@sitecore-jss/sitecore-jss-angular/cjs';
|
|
3
|
+
import { generateConfig } from './generate-config';
|
|
4
|
+
const projects = require('../angular.json').projects;
|
|
5
|
+
const chalk = require('chalk');
|
|
2
6
|
|
|
3
7
|
/*
|
|
4
8
|
BOOTSTRAPPING
|
|
@@ -7,15 +11,30 @@ import 'dotenv/config';
|
|
|
7
11
|
and the global config module.
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
const disconnected = process.env.JSS_MODE === constants.JSS_MODE.DISCONNECTED;
|
|
15
|
+
|
|
16
|
+
if (disconnected && process.env.FETCH_WITH === constants.FETCH_WITH.GRAPHQL) {
|
|
17
|
+
throw new Error(chalk.red("GraphQL requests to Dictionary and Layout services are not supported in disconnected mode."))
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
/*
|
|
16
21
|
CONFIG GENERATION
|
|
22
|
+
Generates the /src/environments/environment.js file which contains runtime configuration
|
|
23
|
+
that the app can import and use.
|
|
24
|
+
|
|
25
|
+
This is generated rather than using Angular environments because of the need to set config params
|
|
26
|
+
based on build arguments, which env files don't directly allow.
|
|
17
27
|
*/
|
|
18
|
-
|
|
28
|
+
function writeConfig(configOverride: { production: boolean, sitecoreApiHost?: string }, outputPath?: string) {
|
|
29
|
+
if (disconnected) {
|
|
30
|
+
configOverride.sitecoreApiHost = `http://localhost:${projects['<%- appName %>'].architect.serve.options.port}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
generateConfig(configOverride, outputPath);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
writeConfig({ production: false });
|
|
37
|
+
writeConfig({ production: true }, 'src/environments/environment.prod.js');
|
|
19
38
|
|
|
20
39
|
/*
|
|
21
40
|
COMPONENT FACTORY GENERATION
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chokidar = require('chokidar');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
COMPONENT FACTORY GENERATION
|
|
7
|
+
Generates the /src/app/components/app-components.module.ts file which maps Angular components
|
|
8
|
+
to JSS components.
|
|
9
|
+
|
|
10
|
+
The component factory module defines a mapping between a string component name and a Angular component instance.
|
|
11
|
+
When the Sitecore Layout service returns a layout definition, it returns named components.
|
|
12
|
+
This mapping is used to construct the component hierarchy for the layout.
|
|
13
|
+
|
|
14
|
+
NOTE: this script can run in two modes. The default mode, the component factory file is written once.
|
|
15
|
+
But if `--watch` is a process argument, the component factory source folder will be watched,
|
|
16
|
+
and the componentFactory.js rewritten on added or deleted files.
|
|
17
|
+
This is used during `jss start` to pick up new or removed components at runtime.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export interface PackageDefinition {
|
|
21
|
+
name: string;
|
|
22
|
+
components: {
|
|
23
|
+
moduleName: string;
|
|
24
|
+
componentName: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const componentFactoryPath = path.resolve('src/app/components/app-components.module.ts');
|
|
29
|
+
const componentRootPath = 'src/app/components';
|
|
30
|
+
|
|
31
|
+
const isWatch = process.argv.some((arg) => arg === '--watch');
|
|
32
|
+
|
|
33
|
+
if (isWatch) {
|
|
34
|
+
watchComponentFactory();
|
|
35
|
+
} else {
|
|
36
|
+
writeComponentFactory();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function watchComponentFactory() {
|
|
40
|
+
console.log(`Watching for changes to component factory sources in ${componentRootPath}...`);
|
|
41
|
+
|
|
42
|
+
chokidar
|
|
43
|
+
.watch(componentRootPath, { ignoreInitial: true, awaitWriteFinish: true })
|
|
44
|
+
.on('add', writeComponentFactory)
|
|
45
|
+
.on('unlink', writeComponentFactory);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function writeComponentFactory() {
|
|
49
|
+
const componentFactory = generateComponentFactory();
|
|
50
|
+
|
|
51
|
+
console.log(`Writing component factory to ${componentFactoryPath}`);
|
|
52
|
+
|
|
53
|
+
fs.writeFileSync(componentFactoryPath, componentFactory, { encoding: 'utf8' });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function generateComponentFactory() {
|
|
57
|
+
// By convention, we expect to find Angular components
|
|
58
|
+
// under /src/app/components/component-name/component-name.component.ts
|
|
59
|
+
// If a component-name.module.ts file exists, we will treat it as lazy loaded.
|
|
60
|
+
// If you'd like to use your own convention, encode it below.
|
|
61
|
+
// NOTE: generating the component factory module is also totally optional,
|
|
62
|
+
// and it can be maintained manually if preferred.
|
|
63
|
+
|
|
64
|
+
const imports: string[] = [];
|
|
65
|
+
/**
|
|
66
|
+
* You can specify components which you want to import from external/internal packages
|
|
67
|
+
* in format:
|
|
68
|
+
* {
|
|
69
|
+
* name: 'package name',
|
|
70
|
+
* components: [
|
|
71
|
+
* {
|
|
72
|
+
* componentName: 'component name', // component rendering name,
|
|
73
|
+
* moduleName: 'module name' // component name to import from the package
|
|
74
|
+
* }
|
|
75
|
+
* ]
|
|
76
|
+
* }
|
|
77
|
+
*/
|
|
78
|
+
const packages: PackageDefinition[] = [];
|
|
79
|
+
const registrations: string[] = [];
|
|
80
|
+
const lazyRegistrations: string[] = [];
|
|
81
|
+
const declarations: string[] = [];
|
|
82
|
+
|
|
83
|
+
packages.forEach((p) => {
|
|
84
|
+
const variables = p.components
|
|
85
|
+
.map((c) => {
|
|
86
|
+
registrations.push(`{ name: '${c.componentName}', type: ${c.moduleName} },`);
|
|
87
|
+
declarations.push(`${c.moduleName},`);
|
|
88
|
+
|
|
89
|
+
return c.moduleName;
|
|
90
|
+
})
|
|
91
|
+
.join(', ');
|
|
92
|
+
imports.push(`import { ${variables} } from '${p.name}'`);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
fs.readdirSync(componentRootPath).forEach((componentFolder) => {
|
|
96
|
+
// ignore ts files in component root folder
|
|
97
|
+
if (componentFolder.endsWith('.ts') || componentFolder === '.gitignore') {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const componentFilePath = path.join(componentRootPath, componentFolder, `${componentFolder}.component.ts`);
|
|
102
|
+
|
|
103
|
+
if (!fs.existsSync(componentFilePath)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const componentFileContents = fs.readFileSync(componentFilePath, 'utf8');
|
|
108
|
+
|
|
109
|
+
// ASSUMPTION: your component should export a class directly that follows Angular conventions,
|
|
110
|
+
// i.e. `export class FooComponent` - so we can detect the component's name for auto registration.
|
|
111
|
+
const componentClassMatch = /export class (.+?)Component\b/g.exec(componentFileContents);
|
|
112
|
+
|
|
113
|
+
if (componentClassMatch === null) {
|
|
114
|
+
console.debug(`Component ${componentFilePath} did not seem to export a component class. It will be skipped.`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const componentName = componentClassMatch[1];
|
|
119
|
+
const importVarName = `${componentName}Component`;
|
|
120
|
+
|
|
121
|
+
// check for lazy loading needs
|
|
122
|
+
const moduleFilePath = path.join(componentRootPath, componentFolder, `${componentFolder}.module.ts`);
|
|
123
|
+
const isLazyLoaded = fs.existsSync(moduleFilePath);
|
|
124
|
+
|
|
125
|
+
if (isLazyLoaded) {
|
|
126
|
+
console.debug(`Registering JSS component (lazy) ${componentName}`);
|
|
127
|
+
lazyRegistrations.push(`{ path: '${componentName}', loadChildren: () => import('./${componentFolder}/${componentFolder}.module').then(m => m.${componentName}Module) },`);
|
|
128
|
+
} else {
|
|
129
|
+
console.debug(`Registering JSS component ${componentName}`);
|
|
130
|
+
imports.push(`import { ${importVarName} } from './${componentFolder}/${componentFolder}.component';`);
|
|
131
|
+
registrations.push(`{ name: '${componentName}', type: ${importVarName} },`);
|
|
132
|
+
declarations.push(`${importVarName},`);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return `// Do not edit this file, it is auto-generated at build time!
|
|
137
|
+
// See scripts/generate-component-factory.js to modify the generation of this file.
|
|
138
|
+
// Use app-components.shared.module.ts to modify the imports, etc of this module.
|
|
139
|
+
// Note: code-generation is optional! See ./.gitignore for directions to remove it,
|
|
140
|
+
// if you do not want it.
|
|
141
|
+
|
|
142
|
+
import { NgModule } from '@angular/core';
|
|
143
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
144
|
+
import { AppComponentsSharedModule } from './app-components.shared.module';
|
|
145
|
+
${imports.join('\n')}
|
|
146
|
+
|
|
147
|
+
@NgModule({
|
|
148
|
+
imports: [
|
|
149
|
+
AppComponentsSharedModule,
|
|
150
|
+
JssModule.withComponents([
|
|
151
|
+
${registrations.join('\n ')}
|
|
152
|
+
], [
|
|
153
|
+
${lazyRegistrations.join('\n ')}
|
|
154
|
+
]),
|
|
155
|
+
],
|
|
156
|
+
exports: [
|
|
157
|
+
JssModule,
|
|
158
|
+
AppComponentsSharedModule,
|
|
159
|
+
],
|
|
160
|
+
declarations: [
|
|
161
|
+
${declarations.join('\n ')}
|
|
162
|
+
],
|
|
163
|
+
})
|
|
164
|
+
export class AppComponentsModule { }
|
|
165
|
+
`;
|
|
166
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
2
1
|
import * as fs from 'fs';
|
|
3
2
|
import * as path from 'path';
|
|
4
3
|
import { constantCase } from 'constant-case';
|
|
5
|
-
|
|
6
|
-
import { JssConfig } from 'lib/config';
|
|
4
|
+
const packageConfig = require('../package.json');
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Generate config
|
|
@@ -12,88 +10,91 @@ import { JssConfig } from 'lib/config';
|
|
|
12
10
|
* settings as variables into the JSS app.
|
|
13
11
|
* NOTE! Any configs returned here will be written into the client-side JS bundle. DO NOT PUT SECRETS HERE.
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
production: false,
|
|
18
|
-
sitecoreApiKey: process.env[`${constantCase('sitecoreApiKey')}`],
|
|
19
|
-
sitecoreApiHost: process.env[`${constantCase('sitecoreApiHost')}`],
|
|
20
|
-
sitecoreSiteName: process.env[`${constantCase('sitecoreSiteName')}`],
|
|
21
|
-
defaultLanguage: process.env[`${constantCase('defaultLanguage')}`],
|
|
22
|
-
graphQLEndpoint: process.env[`${constantCase('graphQLEndpoint')}`],
|
|
23
|
-
graphQLEndpointPath: process.env[`${constantCase('graphQLEndpointPath')}`],
|
|
24
|
-
defaultServerRoute: '/',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
async function main() {
|
|
28
|
-
await generateConfig('src/environments/environment.js', defaultConfigValue, {
|
|
13
|
+
export function generateConfig(configOverrides?: { [key: string]: unknown }, outputPath?: string) {
|
|
14
|
+
const defaultConfig = {
|
|
29
15
|
production: false,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
sitecoreApiHost: '',
|
|
17
|
+
sitecoreApiKey: 'no-api-key-set',
|
|
18
|
+
sitecoreSiteName: process.env.SITECORE_SITE_NAME,
|
|
19
|
+
sitecoreLayoutServiceConfig: 'jss',
|
|
20
|
+
defaultLanguage: 'en',
|
|
21
|
+
defaultServerRoute: '/',
|
|
22
|
+
layoutServiceConfigurationName: 'default',
|
|
23
|
+
};
|
|
37
24
|
|
|
38
|
-
/**
|
|
39
|
-
* Generates the JSS config based on config plugins (under ./config/plugins)
|
|
40
|
-
* and then writes the config to disk.
|
|
41
|
-
* @param {string} outputPath the output path of the generated config.
|
|
42
|
-
* @param {JssConfig} [defaultConfig] Default configuration.
|
|
43
|
-
* @param {[key: string]:unknown} [configOverrides] configuration values that override the generated ones.
|
|
44
|
-
*/
|
|
45
|
-
export function generateConfig(
|
|
46
|
-
outputPath: string,
|
|
47
|
-
defaultConfig: JssConfig = defaultConfigValue,
|
|
48
|
-
configOverrides?: { [key: string]: unknown }
|
|
49
|
-
) {
|
|
50
|
-
// Handle undefined values
|
|
51
|
-
defaultConfig = Object.keys(defaultConfig).reduce((acc, key) => {
|
|
52
|
-
return {
|
|
53
|
-
...acc,
|
|
54
|
-
[key]: defaultConfig[key] || '',
|
|
55
|
-
};
|
|
56
|
-
}, {});
|
|
57
|
-
|
|
58
|
-
return jssConfigFactory
|
|
59
|
-
.create(defaultConfig)
|
|
60
|
-
.then((config) => {
|
|
61
|
-
writeConfig(Object.assign(config, configOverrides), outputPath);
|
|
62
|
-
})
|
|
63
|
-
.catch((e) => {
|
|
64
|
-
console.error('Error generating config');
|
|
65
|
-
console.error(e);
|
|
66
|
-
process.exit(1);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Writes the config object to disk with support for environment variables.
|
|
72
|
-
* @param {JssConfig} config JSS configuration to write.
|
|
73
|
-
* @param {string} outputPath the outputh path of the generated config.
|
|
74
|
-
*/
|
|
75
|
-
export function writeConfig(config: JssConfig, outputPath?: string) {
|
|
76
25
|
if (!outputPath) {
|
|
77
26
|
outputPath = 'src/environments/environment.js';
|
|
78
27
|
}
|
|
79
28
|
|
|
29
|
+
// require + combine config sources
|
|
30
|
+
const scjssConfig = transformScJssConfig();
|
|
31
|
+
const packageJson = transformPackageConfig();
|
|
32
|
+
|
|
33
|
+
// optional:
|
|
34
|
+
// do any other dynamic config source (e.g. environment-specific config files)
|
|
35
|
+
// Object.assign merges the objects in order, so the
|
|
36
|
+
// package.json config can override the calculated config,
|
|
37
|
+
// scjssconfig.json overrides it,
|
|
38
|
+
// and finally config passed in the configOverrides param wins.
|
|
39
|
+
const config = Object.assign(defaultConfig, scjssConfig, packageJson, configOverrides);
|
|
40
|
+
|
|
41
|
+
// The GraphQL endpoint is an example of making a _computed_ config setting
|
|
42
|
+
// based on other config settings.
|
|
43
|
+
const computedConfig: { [key: string]: string } = {};
|
|
44
|
+
computedConfig.graphQLEndpoint = '`${config.sitecoreApiHost}${config.graphQLEndpointPath}`';
|
|
45
|
+
|
|
80
46
|
let configText = `/* eslint-disable */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
47
|
+
// Do not edit this file, it is auto-generated at build time!
|
|
48
|
+
// See scripts/bootstrap.ts to modify the generation of this file.
|
|
49
|
+
const config = {};\n`;
|
|
84
50
|
|
|
85
51
|
// Set base configuration values, allowing override with environment variables
|
|
86
52
|
Object.keys(config).forEach((prop) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)} ||
|
|
53
|
+
configText += `config.${prop} = process.env.${constantCase(prop)} || "${config[prop]?.toString().trim()}";\n`;
|
|
54
|
+
});
|
|
55
|
+
// Set computed values, allowing override with environment variables
|
|
56
|
+
Object.keys(computedConfig).forEach((prop) => {
|
|
57
|
+
configText += `config.${prop} = process.env.${constantCase(prop)} || ${
|
|
58
|
+
computedConfig[prop]?.toString().trim()
|
|
59
|
+
};\n`;
|
|
92
60
|
});
|
|
93
|
-
|
|
94
61
|
configText += `module.exports.environment = config;`;
|
|
95
62
|
|
|
96
63
|
const configPath = path.resolve(outputPath);
|
|
97
64
|
console.log(`Writing runtime config to ${configPath}`);
|
|
98
65
|
fs.writeFileSync(configPath, configText, { encoding: 'utf8' });
|
|
99
66
|
}
|
|
67
|
+
|
|
68
|
+
function transformScJssConfig() {
|
|
69
|
+
// scjssconfig.json may not exist if you've never run setup
|
|
70
|
+
// so if it doesn't we substitute a fake object
|
|
71
|
+
let config;
|
|
72
|
+
try {
|
|
73
|
+
config = require('../scjssconfig.json');
|
|
74
|
+
} catch (e) {
|
|
75
|
+
return {};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!config) {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
sitecoreApiKey: config.sitecore.apiKey,
|
|
84
|
+
sitecoreApiHost: config.sitecore.layoutServiceHost,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function transformPackageConfig() {
|
|
89
|
+
const packageAny = packageConfig;
|
|
90
|
+
|
|
91
|
+
if (!packageAny.config) {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
sitecoreSiteName: packageAny.config.appName,
|
|
97
|
+
defaultLanguage: packageAny.config.language || 'en',
|
|
98
|
+
graphQLEndpointPath: packageAny.config.graphQLEndpointPath || null,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as fetch from 'isomorphic-fetch';
|
|
1
2
|
import * as fs from 'fs';
|
|
2
|
-
import
|
|
3
|
-
import { getGraphQLClientFactoryConfig } from 'lib/graphql-client-factory/config';
|
|
3
|
+
import { generateConfig } from './generate-config';
|
|
4
4
|
|
|
5
5
|
// Apollo Client supports caching GraphQL responses, which can greatly reduce network traffic needs.
|
|
6
6
|
// In order to work correctly with interfaces in GraphQL, it needs to know some basic information about
|
|
@@ -9,23 +9,28 @@ import { getGraphQLClientFactoryConfig } from 'lib/graphql-client-factory/config
|
|
|
9
9
|
//
|
|
10
10
|
// The `jss graphql:update` command should be executed when Sitecore templates related to the site are altered.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
generateConfig();
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
let jssConfig;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
jssConfig = require('../src/environments/environment').environment;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.error(
|
|
20
|
+
'Unable to require JSS config. Ensure `jss setup` has been run, and the app has been started at least once after setup.'
|
|
21
|
+
);
|
|
22
|
+
console.error(e);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}>(
|
|
27
|
-
`
|
|
28
|
-
{
|
|
26
|
+
console.log(`Updating GraphQL fragment type data from ${jssConfig.graphQLEndpoint}...`);
|
|
27
|
+
|
|
28
|
+
fetch(jssConfig.graphQLEndpoint, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: { 'Content-Type': 'application/json', sc_apikey: jssConfig.sitecoreApiKey },
|
|
31
|
+
body: JSON.stringify({
|
|
32
|
+
query: `
|
|
33
|
+
{
|
|
29
34
|
__schema {
|
|
30
35
|
types {
|
|
31
36
|
kind
|
|
@@ -36,18 +41,20 @@ clientFactory()
|
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
|
-
|
|
40
|
-
)
|
|
44
|
+
`,
|
|
45
|
+
}),
|
|
46
|
+
})
|
|
47
|
+
.then((result) => result.json())
|
|
41
48
|
.then((result) => {
|
|
42
49
|
// here we're filtering out any type information unrelated to unions or interfaces
|
|
43
|
-
const filteredData = result.__schema.types.filter((type) => type.possibleTypes !== null);
|
|
50
|
+
const filteredData = result.data.__schema.types.filter((type: { possibleTypes: Array<string>; }) => type.possibleTypes !== null);
|
|
44
51
|
|
|
45
52
|
const filteredResult = { ...result };
|
|
46
|
-
filteredResult.__schema.types = filteredData;
|
|
53
|
+
filteredResult.data.__schema.types = filteredData;
|
|
47
54
|
|
|
48
55
|
fs.writeFile(
|
|
49
56
|
'./src/graphql-fragment-types.ts',
|
|
50
|
-
`export default ${JSON.stringify(filteredResult, null, 2)}`,
|
|
57
|
+
`export default ${JSON.stringify(filteredResult.data, null, 2)}`,
|
|
51
58
|
(err) => {
|
|
52
59
|
if (err) {
|
|
53
60
|
console.error('Error writing GraphQLFragmentTypes file', err);
|