create-sitecore-jss 22.1.0-canary.9 → 22.2.0-canary.2

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.
Files changed (213) hide show
  1. package/dist/bin.js +69 -28
  2. package/dist/common/processes/install.js +9 -2
  3. package/dist/common/processes/transform.js +7 -2
  4. package/dist/init-runner.js +12 -8
  5. package/dist/initializers/angular/index.js +16 -0
  6. package/dist/initializers/angular/prompts.js +22 -1
  7. package/dist/initializers/angular-sxp/index.js +56 -0
  8. package/dist/initializers/angular-xmcloud/index.js +56 -0
  9. package/dist/initializers/node-xmcloud-proxy/index.js +32 -0
  10. package/dist/templates/angular/.env +5 -3
  11. package/dist/templates/angular/README.md +5 -45
  12. package/dist/templates/angular/angular.json +1 -6
  13. package/dist/templates/angular/package.json +43 -53
  14. package/dist/templates/angular/proxy.conf.js +5 -23
  15. package/dist/templates/angular/scripts/bootstrap.ts +5 -24
  16. package/dist/templates/angular/scripts/config/index.ts +28 -0
  17. package/dist/templates/angular/scripts/config/plugins/computed.ts +21 -0
  18. package/dist/templates/angular/scripts/config/plugins/fallback.ts +23 -0
  19. package/dist/templates/angular/scripts/config/plugins/package-json.ts +22 -0
  20. package/dist/templates/angular/scripts/config/plugins/scjssconfig.ts +29 -0
  21. package/dist/templates/angular/scripts/generate-config.ts +53 -73
  22. package/dist/templates/angular/scripts/generate-plugins.ts +28 -0
  23. package/dist/templates/angular/scripts/temp/gitignore +2 -0
  24. package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +4 -2
  25. package/dist/templates/angular/server.bundle.ts +20 -2
  26. package/dist/templates/angular/src/app/app.module.ts +0 -2
  27. package/dist/templates/angular/src/app/components/app-components.shared.module.ts +4 -19
  28. package/dist/templates/angular/src/app/jss-context.server-side.service.ts +0 -2
  29. package/dist/templates/angular/src/app/lib/config.ts +16 -0
  30. package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +21 -13
  31. package/dist/templates/angular/src/app/lib/layout-service-factory.ts +20 -12
  32. package/dist/templates/angular/src/app/routing/layout/layout.component.html +1 -1
  33. package/dist/templates/angular/src/app/routing/layout/layout.component.ts +1 -2
  34. package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +5 -6
  35. package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +1 -2
  36. package/dist/templates/angular/src/app/routing/routing.module.ts +14 -21
  37. package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +1 -0
  38. package/dist/templates/angular/src/app/routing/scripts/scripts.component.ts +7 -0
  39. package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +8 -0
  40. package/dist/templates/angular/src/graphql-fragment-types.ts +0 -95
  41. package/dist/templates/angular/src/polyfills.ts +2 -6
  42. package/dist/templates/angular/src/test.ts +1 -6
  43. package/dist/templates/angular/tsconfig.json +7 -2
  44. package/dist/templates/angular-sxp/package.json +12 -0
  45. package/dist/templates/angular-sxp/proxy.conf.js +43 -0
  46. package/dist/templates/angular-sxp/scripts/config/plugins/disconnected.ts +27 -0
  47. package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +35 -0
  48. package/dist/templates/{angular → angular-sxp}/src/app/jss-data-fetcher.service.ts +3 -1
  49. package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +23 -0
  50. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +3 -0
  51. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +9 -0
  52. package/dist/templates/{angular/src/app/routing → angular-sxp/src/app/routing/scripts}/visitor-identification/visitor-identification.component.ts +9 -3
  53. package/dist/templates/angular-sxp/src/graphql-fragment-types.ts +219 -0
  54. package/dist/templates/angular-xmcloud/.env +8 -0
  55. package/dist/templates/angular-xmcloud/package.json +10 -0
  56. package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +23 -0
  57. package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +15 -0
  58. package/dist/templates/angular-xmcloud/src/app/lib/config.ts +15 -0
  59. package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory.ts +44 -0
  60. package/dist/templates/nextjs/next.config.js +5 -0
  61. package/dist/templates/nextjs/package.json +7 -6
  62. package/dist/templates/nextjs/src/lib/next-config/plugins/cors-header.js +0 -9
  63. package/dist/templates/nextjs/src/pages/[[...path]].tsx +1 -13
  64. package/dist/templates/nextjs-styleguide/package.json +1 -1
  65. package/dist/templates/nextjs-sxa/src/assets/sass/components/title/_component-title.scss +19 -13
  66. package/dist/templates/nextjs-sxa/src/components/Image.tsx +22 -12
  67. package/dist/templates/nextjs-sxa/src/components/Promo.tsx +1 -1
  68. package/dist/templates/nextjs-sxa/src/components/Title.tsx +10 -13
  69. package/dist/templates/nextjs-xmcloud/package.json +1 -1
  70. package/dist/templates/nextjs-xmcloud/src/Scripts.tsx +2 -0
  71. package/dist/templates/nextjs-xmcloud/src/lib/dictionary-service-factory.ts +46 -0
  72. package/dist/templates/nextjs-xmcloud/src/lib/graphql-editing-service.ts +9 -0
  73. package/dist/templates/nextjs-xmcloud/src/lib/middleware/plugins/personalize.ts +6 -5
  74. package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/personalize.ts +7 -3
  75. package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/preview-mode.ts +72 -0
  76. package/dist/templates/nextjs-xmcloud/src/pages/api/editing/render.ts +46 -0
  77. package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
  78. package/dist/templates/node-headless-ssr-proxy/package.json +4 -4
  79. package/dist/templates/node-xmcloud-proxy/.env +8 -0
  80. package/dist/templates/node-xmcloud-proxy/README.md +36 -0
  81. package/dist/templates/node-xmcloud-proxy/package.json +25 -0
  82. package/dist/templates/node-xmcloud-proxy/src/config.ts +19 -0
  83. package/dist/templates/node-xmcloud-proxy/src/index.ts +161 -0
  84. package/dist/templates/node-xmcloud-proxy/src/types.ts +59 -0
  85. package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -0
  86. package/dist/templates/react/package.json +5 -5
  87. package/dist/templates/react-native/package.json +4 -4
  88. package/dist/templates/vue/package.json +4 -4
  89. package/package.json +4 -4
  90. /package/dist/templates/angular/src/app/lib/{client-factory.ts → graphql-client-factory.ts} +0 -0
  91. /package/dist/templates/{angular → angular-sxp}/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +0 -0
  92. /package/dist/templates/{angular → angular-sxp}/data/component-content/gitignore +0 -0
  93. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item1/en.yml +0 -0
  94. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item2/en.yml +0 -0
  95. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item1/en.yml +0 -0
  96. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item2/en.yml +0 -0
  97. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item1/en.yml +0 -0
  98. /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item2/en.yml +0 -0
  99. /package/dist/templates/{angular → angular-sxp}/data/content/gitignore +0 -0
  100. /package/dist/templates/{angular → angular-sxp}/data/dictionary/en.yml +0 -0
  101. /package/dist/templates/{angular → angular-sxp}/data/dictionary/{{language}}.yml +0 -0
  102. /package/dist/templates/{angular → angular-sxp}/data/media/files/jss.pdf +0 -0
  103. /package/dist/templates/{angular → angular-sxp}/data/media/img/jss_logo.png +0 -0
  104. /package/dist/templates/{angular → angular-sxp}/data/media/img/sc_logo.png +0 -0
  105. /package/dist/templates/{angular → angular-sxp}/data/routes/en.yml +0 -0
  106. /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/en.yml +0 -0
  107. /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-1/en.yml +0 -0
  108. /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-2/en.yml +0 -0
  109. /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/custom-route-type/en.yml +0 -0
  110. /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/en.yml +0 -0
  111. /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/{{language}}.yml +0 -0
  112. /package/dist/templates/{angular → angular-sxp}/data/routes/{{language}}.yml +0 -0
  113. /package/dist/templates/{angular → angular-sxp}/scripts/disconnected-mode-proxy.ts +0 -0
  114. /package/dist/templates/{angular → angular-sxp}/scripts/lint-yml.ts +0 -0
  115. /package/dist/templates/{angular → angular-sxp}/sitecore/config/{{appName}}.config +0 -0
  116. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/component-content.sitecore.ts +0 -0
  117. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Reuse.sitecore.ts +0 -0
  118. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs-Tab.sitecore.ts +0 -0
  119. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs.sitecore.ts +0 -0
  120. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout.sitecore.ts +0 -0
  121. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Multilingual.sitecore.ts +0 -0
  122. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Section.sitecore.ts +0 -0
  123. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/content-block.sitecore.ts +0 -0
  124. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-connected-demo.sitecore.ts +0 -0
  125. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +0 -0
  126. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.ts +0 -0
  127. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-layout.sitecore.ts +0 -0
  128. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-angular-lazy-loading.sitecore.ts +0 -0
  129. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-component-params.sitecore.ts +0 -0
  130. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-custom-route-type.sitecore.ts +0 -0
  131. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-edit-frame.sitecore.ts +0 -0
  132. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-checkbox.sitecore.ts +0 -0
  133. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-content-list.sitecore.ts +0 -0
  134. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-custom.sitecore.ts +0 -0
  135. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-date.sitecore.ts +0 -0
  136. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-file.sitecore.ts +0 -0
  137. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-image.sitecore.ts +0 -0
  138. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-item-link.sitecore.ts +0 -0
  139. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-link.sitecore.ts +0 -0
  140. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-number.sitecore.ts +0 -0
  141. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-rich-text.sitecore.ts +0 -0
  142. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-text.sitecore.ts +0 -0
  143. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-route-fields.sitecore.ts +0 -0
  144. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-sitecore-context.sitecore.ts +0 -0
  145. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-tracking.sitecore.ts +0 -0
  146. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/config.js +0 -0
  147. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/content.sitecore.ts +0 -0
  148. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/dictionary.sitecore.ts +0 -0
  149. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/placeholders.sitecore.ts +0 -0
  150. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/routes.sitecore.ts +0 -0
  151. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/Styleguide-Explanatory-Component.sitecore.ts +0 -0
  152. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-content-list-template.sitecore.ts +0 -0
  153. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-edit-frame-list-item-template.sitecore.ts +0 -0
  154. /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-item-link-template.sitecore.ts +0 -0
  155. /package/dist/templates/{angular → angular-sxp}/sitecore/gitignore +0 -0
  156. /package/dist/templates/{angular → angular-sxp}/sitecore/pipelines/example.patch.ts +0 -0
  157. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +0 -0
  158. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +0 -0
  159. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +0 -0
  160. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +0 -0
  161. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +0 -0
  162. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.html +0 -0
  163. /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +0 -0
  164. /package/dist/templates/{angular → angular-sxp}/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +0 -0
  165. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +0 -0
  166. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +0 -0
  167. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +0 -0
  168. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.html +0 -0
  169. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +0 -0
  170. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +0 -0
  171. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +0 -0
  172. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +0 -0
  173. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +0 -0
  174. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +0 -0
  175. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +0 -0
  176. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +0 -0
  177. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +0 -0
  178. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +0 -0
  179. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +0 -0
  180. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +0 -0
  181. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +0 -0
  182. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +0 -0
  183. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +0 -0
  184. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +0 -0
  185. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +0 -0
  186. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +0 -0
  187. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +0 -0
  188. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +0 -0
  189. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +0 -0
  190. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +0 -0
  191. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +0 -0
  192. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +0 -0
  193. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +0 -0
  194. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +0 -0
  195. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +0 -0
  196. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.html +0 -0
  197. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.ts +0 -0
  198. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +0 -0
  199. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +0 -0
  200. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +0 -0
  201. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +0 -0
  202. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +0 -0
  203. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +0 -0
  204. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +0 -0
  205. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +0 -0
  206. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +0 -0
  207. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +0 -0
  208. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.html +0 -0
  209. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.ts +0 -0
  210. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +0 -0
  211. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +0 -0
  212. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.html +0 -0
  213. /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "22.1.0-canary",
3
+ "version": "22.2.0-canary",
4
4
  "description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
5
5
  "config": {
6
6
  "appName": "<%- appName %>",
@@ -15,18 +15,15 @@
15
15
  },
16
16
  "scripts": {
17
17
  "ng": "ng",
18
- "lint:yml": "ts-node ./scripts/lint-yml.ts",
19
- "lint": "ng lint <%- appName %> --fix && npm run lint:yml",
18
+ "lint": "ng lint <%- appName %> --fix",
20
19
  "e2e": "ng e2e",
21
20
  "jss": "jss",
22
- "start": "cross-env-shell JSS_MODE=disconnected \"npm-run-all --serial bootstrap --parallel start:angular start:proxy start:watch-components\"",
23
21
  "start:connected": "npm-run-all --serial bootstrap start:angular start:watch-components",
24
- "build": "npm-run-all --serial bootstrap --serial build:client build:server",
25
- "scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component",
22
+ "build": "npm-run-all --serial bootstrap build:client build:server",
23
+ "scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component --no-manifest",
26
24
  "start:angular": "ng serve -o",
27
- "start:proxy": "ts-node --project src/tsconfig.webpack-server.json scripts/disconnected-mode-proxy.ts",
28
25
  "start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory.ts --watch",
29
- "build:client": "cross-env-shell ng build --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
26
+ "build:client": "cross-env-shell ng build --configuration=production --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
30
27
  "build:server": "cross-env-shell ng run <%- appName %>:server:production --output-path=$npm_package_config_buildArtifactsPath",
31
28
  "postbuild:server": "move-cli ./dist/main.js ./dist/server.bundle.js",
32
29
  "bootstrap": "ts-node --project src/tsconfig.webpack-server.json scripts/bootstrap.ts",
@@ -48,66 +45,60 @@
48
45
  "homepage": "https://jss.sitecore.com",
49
46
  "license": "Apache-2.0",
50
47
  "dependencies": {
51
- "@angular/animations": "~16.2.10",
52
- "@angular/common": "~16.2.10",
53
- "@angular/compiler": "~16.2.10",
54
- "@angular/core": "~16.2.10",
55
- "@angular/forms": "~16.2.10",
56
- "@angular/platform-browser": "~16.2.10",
57
- "@angular/platform-browser-dynamic": "~16.2.10",
58
- "@angular/platform-server": "~16.2.10",
59
- "@angular/router": "~16.2.10",
48
+ "@angular/animations": "~17.3.11",
49
+ "@angular/common": "~17.3.11",
50
+ "@angular/compiler": "~17.3.11",
51
+ "@angular/core": "~17.3.11",
52
+ "@angular/forms": "~17.3.11",
53
+ "@angular/platform-browser": "~17.3.11",
54
+ "@angular/platform-browser-dynamic": "~17.3.11",
55
+ "@angular/platform-server": "~17.3.11",
56
+ "@angular/router": "~17.3.11",
60
57
  "@apollo/client": "^3.3.12",
61
- "@ngx-translate/core": "~14.0.0",
62
- "@ngx-translate/http-loader": "~7.0.0",
63
- "@sitecore-jss/sitecore-jss-angular": "~22.1.0-canary",
64
- "apollo-angular": "~5.0.2",
65
- "bootstrap": "^5.3.1",
66
- "core-js": "~3.32.1",
58
+ "@ngx-translate/core": "~15.0.0",
59
+ "@ngx-translate/http-loader": "~8.0.0",
60
+ "@sitecore-jss/sitecore-jss-angular": "~22.2.0-canary",
61
+ "apollo-angular": "~6.0.0",
62
+ "bootstrap": "^5.3.3",
63
+ "core-js": "~3.37.1",
67
64
  "graphql": "15.5.0",
68
65
  "graphql-tag": "~2.11.0",
69
- "lodash": "^4.17.21",
70
66
  "rxjs": "~7.8.1",
71
- "tslib": "^2.1.0",
72
- "zone.js": "~0.13.1"
67
+ "tslib": "^2.6.3",
68
+ "zone.js": "~0.14.7"
73
69
  },
74
70
  "devDependencies": {
75
- "@angular-builders/custom-webpack": "^16.0.1",
76
- "@angular-devkit/build-angular": "^16.2.10",
77
- "@angular-eslint/builder": "^16.3.1",
78
- "@angular-eslint/eslint-plugin": "^16.3.1",
79
- "@angular-eslint/eslint-plugin-template": "^16.3.1",
80
- "@angular-eslint/schematics": "^16.3.1",
81
- "@angular-eslint/template-parser": "^16.3.1",
82
- "@angular/cli": "~16.2.10",
83
- "@angular/compiler-cli": "~16.2.10",
84
- "@angular/language-service": "~16.2.10",
85
- "@sitecore-jss/sitecore-jss-angular-schematics": "~22.1.0-canary",
86
- "@sitecore-jss/sitecore-jss-cli": "~22.1.0-canary",
87
- "@sitecore-jss/sitecore-jss-dev-tools": "~22.1.0-canary",
71
+ "@angular-builders/custom-webpack": "^17.0.2",
72
+ "@angular-devkit/build-angular": "^17.3.8",
73
+ "@angular-eslint/builder": "^17.5.2",
74
+ "@angular-eslint/eslint-plugin": "^17.5.2",
75
+ "@angular-eslint/eslint-plugin-template": "^17.5.2",
76
+ "@angular-eslint/schematics": "^17.5.2",
77
+ "@angular-eslint/template-parser": "^17.5.2",
78
+ "@angular/cli": "~17.3.8",
79
+ "@angular/compiler-cli": "~17.3.11",
80
+ "@angular/language-service": "~17.3.11",
81
+ "@sitecore-jss/sitecore-jss-angular-schematics": "~22.2.0-canary",
82
+ "@sitecore-jss/sitecore-jss-cli": "~22.2.0-canary",
83
+ "@sitecore-jss/sitecore-jss-dev-tools": "~22.2.0-canary",
88
84
  "@types/isomorphic-fetch": "0.0.35",
89
85
  "@types/jasmine": "~3.6.7",
90
86
  "@types/jasminewd2": "~2.0.8",
91
- "@types/node": "~12.7.9",
92
- "@typescript-eslint/eslint-plugin": "^6.14.0",
93
- "@typescript-eslint/parser": "^6.14.0",
94
- "body-parser": "~1.19.0",
87
+ "@types/node": "~20.14.10",
88
+ "@typescript-eslint/eslint-plugin": "^7.16.0",
89
+ "@typescript-eslint/parser": "^7.16.0",
95
90
  "chalk": "~4.1.0",
96
91
  "chokidar": "^3.5.2",
97
92
  "codelyzer": "~6.0.1",
98
93
  "constant-case": "^3.0.4",
99
- "cookie-parser": "~1.4.5",
100
94
  "cross-env": "~7.0.3",
101
95
  "del-cli": "^5.0.0",
102
96
  "dotenv": "^16.0.0",
103
97
  "dotenv-webpack": "^7.1.0",
104
- "enhanced-resolve": "5.7.0",
105
- "eslint": "^7.22.0",
106
- "eslint-plugin-import": "2.22.1",
107
- "eslint-plugin-jsdoc": "32.3.0",
98
+ "eslint": "^8.56.0",
99
+ "eslint-plugin-import": "2.29.1",
100
+ "eslint-plugin-jsdoc": "48.7.0",
108
101
  "eslint-plugin-prefer-arrow": "1.2.3",
109
- "express": "~4.17.1",
110
- "fs-extra": "~9.1.0",
111
102
  "isomorphic-fetch": "^3.0.0",
112
103
  "jasmine-core": "~3.7.1",
113
104
  "jasmine-spec-reporter": "~6.0.0",
@@ -120,8 +111,7 @@
120
111
  "move-cli": "^2.0.0",
121
112
  "npm-run-all": "~4.1.5",
122
113
  "protractor": "^7.0.0",
123
- "ts-node": "~10.9.0",
124
- "typescript": "~4.9.5",
125
- "yaml-lint": "^1.2.4"
114
+ "ts-node": "~10.9.2",
115
+ "typescript": "~5.2.2"
126
116
  }
127
117
  }
@@ -1,28 +1,10 @@
1
1
  /*
2
- When the app runs in 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
2
+ When the app runs in connected mode, some of the requests should be
7
3
  proxied to the Sitecore API
8
-
9
- This is accomplished by spinning up a small Express server that mocks the APIs, and then
10
- telling angular-cli to proxy requests to the API paths to this express instance.
11
-
12
- See /scripts/disconnected-mode-proxy.ts for the proxy API server configuration.
13
4
  */
14
- const constants = require('@sitecore-jss/sitecore-jss-angular/cjs').constants;
15
5
  const environment = require('./src/environments/environment.js').environment;
16
6
 
17
- const 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
- ] : [
7
+ const PROXY_CONFIG = [
26
8
  {
27
9
  context: [
28
10
  // API endpoints
@@ -30,12 +12,12 @@ const PROXY_CONFIG = process.env.JSS_MODE === constants.JSS_MODE.DISCONNECTED ?
30
12
  // media items
31
13
  '/-',
32
14
  // visitor identification
33
- '/layouts'
15
+ '/layouts',
34
16
  ],
35
17
  target: environment.sitecoreApiHost,
36
18
  secure: false,
37
- changeOrigin: true
38
- }
19
+ changeOrigin: true,
20
+ },
39
21
  ];
40
22
 
41
23
  module.exports = PROXY_CONFIG;
@@ -1,8 +1,4 @@
1
1
  import 'dotenv/config';
2
- import { constants } from '@sitecore-jss/sitecore-jss-angular/cjs';
3
- import { generateConfig } from './generate-config';
4
- const projects = require('../angular.json').projects;
5
- const chalk = require('chalk');
6
2
 
7
3
  /*
8
4
  BOOTSTRAPPING
@@ -11,30 +7,15 @@ const chalk = require('chalk');
11
7
  and the global config module.
12
8
  */
13
9
 
14
- 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
- }
10
+ /*
11
+ PLUGINS GENERATION
12
+ */
13
+ require('./generate-plugins');
19
14
 
20
15
  /*
21
16
  CONFIG GENERATION
22
- Generates the /src/environments/environment.js file which contains runtime configuration
23
- that the app can import and use.
24
-
25
- This is generated rather than using Angular environments because of the need to set config params
26
- based on build arguments, which env files don't directly allow.
27
17
  */
28
- 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');
18
+ require('./generate-config');
38
19
 
39
20
  /*
40
21
  COMPONENT FACTORY GENERATION
@@ -0,0 +1,28 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ const plugins = require('scripts/temp/config-plugins');
3
+ import { JssConfig } from 'lib/config';
4
+
5
+ export interface ConfigPlugin {
6
+ /**
7
+ * Detect order when the plugin should be called, e.g. 0 - will be called first (can be a plugin which data is required for other plugins)
8
+ */
9
+ order: number;
10
+ /**
11
+ * A function which will be called during config generation
12
+ * @param {JssConfig} config Current (accumulated) config
13
+ */
14
+ exec(config: JssConfig): Promise<JssConfig>;
15
+ }
16
+
17
+ export class JssConfigFactory {
18
+ public async create(defaultConfig: JssConfig = {}): Promise<JssConfig> {
19
+ return (Object.values(plugins) as ConfigPlugin[])
20
+ .sort((p1, p2) => p1.order - p2.order)
21
+ .reduce(
22
+ (promise, plugin) => promise.then((config) => plugin.exec(config)),
23
+ Promise.resolve(defaultConfig)
24
+ );
25
+ }
26
+ }
27
+
28
+ export const jssConfigFactory = new JssConfigFactory();
@@ -0,0 +1,21 @@
1
+ import { JssConfig } from 'lib/config';
2
+ import { ConfigPlugin } from '..';
3
+
4
+ /**
5
+ * This plugin will set computed config props.
6
+ * The "graphQLEndpoint" is an example of making a _computed_ config setting
7
+ * based on other config settings.
8
+ */
9
+ class ComputedPlugin implements ConfigPlugin {
10
+ // should come after other plugins (but before fallback)
11
+ order = 10;
12
+
13
+ async exec(config: JssConfig) {
14
+ return Object.assign({}, config, {
15
+ graphQLEndpoint:
16
+ config.graphQLEndpoint || `${config.sitecoreApiHost}${config.graphQLEndpointPath}`,
17
+ });
18
+ }
19
+ }
20
+
21
+ export const computedPlugin = new ComputedPlugin();
@@ -0,0 +1,23 @@
1
+ import { JssConfig } from 'lib/config';
2
+ import { ConfigPlugin } from '..';
3
+
4
+ /**
5
+ * This config will set fallback values for properties that were left empty
6
+ * If neither env, nor other places had a proper value, this will ensure a fallback is set
7
+ */
8
+ class FallbackPlugin implements ConfigPlugin {
9
+ // should always come last
10
+ order = 100;
11
+
12
+ async exec(config: JssConfig) {
13
+ return Object.assign({}, config, {
14
+ defaultLanguage: config.defaultLanguage || 'en',
15
+ sitecoreApiKey: config.sitecoreApiKey || 'no-api-key-set',
16
+ <% if (!locals.xmcloud) { -%>
17
+ layoutServiceConfigurationName: config.layoutServiceConfigurationName || 'default',
18
+ <% } -%>
19
+ });
20
+ }
21
+ }
22
+
23
+ export const fallbackPlugin = new FallbackPlugin();
@@ -0,0 +1,22 @@
1
+ import { JssConfig } from 'lib/config';
2
+ import { ConfigPlugin } from '..';
3
+ import packageConfig from 'package.json';
4
+
5
+ /**
6
+ * This plugin will set config props based on package.json.
7
+ */
8
+ class PackageJsonPlugin implements ConfigPlugin {
9
+ order = 1;
10
+
11
+ async exec(config: JssConfig) {
12
+ if (!packageConfig.config) return config;
13
+
14
+ return Object.assign({}, config, {
15
+ sitecoreSiteName: config.sitecoreSiteName || packageConfig.config.appName,
16
+ graphQLEndpointPath: config.graphQLEndpointPath || packageConfig.config.graphQLEndpointPath,
17
+ defaultLanguage: config.defaultLanguage || packageConfig.config.language,
18
+ });
19
+ }
20
+ }
21
+
22
+ export const packageJsonPlugin = new PackageJsonPlugin();
@@ -0,0 +1,29 @@
1
+ import { JssConfig } from 'lib/config';
2
+ import { ConfigPlugin } from '..';
3
+
4
+ /**
5
+ * This plugin will set config props based on scjssconfig.json.
6
+ * scjssconfig.json may not exist if you've never run `jss setup` (development)
7
+ * or are depending on environment variables instead (production).
8
+ */
9
+ class ScJssConfigPlugin implements ConfigPlugin {
10
+ order = 1;
11
+
12
+ async exec(config: JssConfig) {
13
+ let scJssConfig;
14
+ try {
15
+ scJssConfig = require('scjssconfig.json');
16
+ } catch (e) {
17
+ return config;
18
+ }
19
+
20
+ if (!scJssConfig) return config;
21
+
22
+ return Object.assign({}, config, {
23
+ sitecoreApiKey: config.sitecoreApiKey || scJssConfig.sitecore?.apiKey,
24
+ sitecoreApiHost: config.sitecoreApiHost || scJssConfig.sitecore?.layoutServiceHost,
25
+ });
26
+ }
27
+ }
28
+
29
+ export const scjssconfigPlugin = new ScJssConfigPlugin();
@@ -1,7 +1,8 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import { constantCase } from 'constant-case';
4
- const packageConfig = require('../package.json');
4
+ import { jssConfigFactory } from './config';
5
+ import { JssConfig } from 'lib/config';
5
6
 
6
7
  /**
7
8
  * Generate config
@@ -10,91 +11,70 @@ const packageConfig = require('../package.json');
10
11
  * settings as variables into the JSS app.
11
12
  * NOTE! Any configs returned here will be written into the client-side JS bundle. DO NOT PUT SECRETS HERE.
12
13
  */
13
- export function generateConfig(configOverrides?: { [key: string]: unknown }, outputPath?: string) {
14
- const defaultConfig = {
15
- production: false,
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
- };
24
14
 
25
- if (!outputPath) {
26
- outputPath = 'src/environments/environment.js';
27
- }
15
+ const defaultConfigValue: JssConfig = {
16
+ production: false,
17
+ sitecoreApiKey: process.env[`${constantCase('sitecoreApiKey')}`],
18
+ sitecoreApiHost: process.env[`${constantCase('sitecoreApiHost')}`],
19
+ sitecoreSiteName: process.env[`${constantCase('sitecoreSiteName')}`],
20
+ defaultLanguage: process.env[`${constantCase('defaultLanguage')}`],
21
+ graphQLEndpoint: process.env[`${constantCase('graphQLEndpoint')}`],
22
+ graphQLEndpointPath: process.env[`${constantCase('graphQLEndpointPath')}`],
23
+ defaultServerRoute: '/',
24
+ };
28
25
 
29
- // require + combine config sources
30
- const scjssConfig = transformScJssConfig();
31
- const packageJson = transformPackageConfig();
26
+ generateConfig('src/environments/environment.js', defaultConfigValue, { production: false });
27
+ generateConfig('src/environments/environment.prod.js', defaultConfigValue, { production: true });
32
28
 
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);
29
+ /**
30
+ * Generates the JSS config based on config plugins (under ./config/plugins)
31
+ * and then writes the config to disk.
32
+ * @param {string} outputPath the output path of the generated config.
33
+ * @param {JssConfig} [defaultConfig] Default configuration.
34
+ * @param {[key: string]:unknown} [configOverrides] configuration values that override the generated ones.
35
+ */
36
+ export function generateConfig(
37
+ outputPath: string,
38
+ defaultConfig: JssConfig = defaultConfigValue,
39
+ configOverrides?: { [key: string]: unknown }
40
+ ) {
41
+ jssConfigFactory
42
+ .create(defaultConfig)
43
+ .then((config) => {
44
+ writeConfig(Object.assign(config, configOverrides), outputPath);
45
+ })
46
+ .catch((e) => {
47
+ console.error('Error generating config');
48
+ console.error(e);
49
+ process.exit(1);
50
+ });
51
+ }
40
52
 
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}`';
53
+ /**
54
+ * Writes the config object to disk with support for environment variables.
55
+ * @param {JssConfig} config JSS configuration to write.
56
+ * @param {string} outputPath the outputh path of the generated config.
57
+ */
58
+ export function writeConfig(config: JssConfig, outputPath?: string) {
59
+ if (!outputPath) {
60
+ outputPath = 'src/environments/environment.js';
61
+ }
45
62
 
46
63
  let configText = `/* eslint-disable */
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`;
64
+ // Do not edit this file, it is auto-generated at build time!
65
+ // See scripts/bootstrap.ts to modify the generation of this file.
66
+ const config = {};\n`;
50
67
 
51
68
  // Set base configuration values, allowing override with environment variables
52
69
  Object.keys(config).forEach((prop) => {
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`;
70
+ configText += `config.${prop} = process.env.${constantCase(prop)} || "${config[prop]
71
+ ?.toString()
72
+ .trim()}";\n`;
60
73
  });
74
+
61
75
  configText += `module.exports.environment = config;`;
62
76
 
63
77
  const configPath = path.resolve(outputPath);
64
78
  console.log(`Writing runtime config to ${configPath}`);
65
79
  fs.writeFileSync(configPath, configText, { encoding: 'utf8' });
66
80
  }
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
- }
@@ -0,0 +1,28 @@
1
+ import {
2
+ generatePlugins,
3
+ ModuleType,
4
+ PluginDefinition,
5
+ } from '@sitecore-jss/sitecore-jss-dev-tools';
6
+
7
+ /*
8
+ PLUGINS GENERATION
9
+ NOTE: pluginName: the name of the plugin in the src/lib folder
10
+ Generates the `/src/temp/{pluginName}-plugins.ts` file, which exports list of plugins
11
+
12
+ Generating the plugins is optional, and it can be maintained manually if preferred.
13
+
14
+ The default convention uses the plugin's filename (without the extension) as the first part of the component
15
+ name. For example, the file `/lib/page-props-factory/plugins/exampleName.ts` would map to plugin `exampleNamePlugin`.
16
+ */
17
+
18
+ const pluginDefinitions: PluginDefinition[] = [
19
+ {
20
+ distPath: 'scripts/temp/config-plugins.ts',
21
+ rootPath: 'scripts/config/plugins',
22
+ moduleType: ModuleType.ESM,
23
+ },
24
+ ];
25
+
26
+ pluginDefinitions.forEach((definition) => {
27
+ generatePlugins(definition);
28
+ });
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -9,7 +9,7 @@ import { generateConfig } from './generate-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
- generateConfig();
12
+ generateConfig('src/environments/environment.js');
13
13
 
14
14
  let jssConfig;
15
15
 
@@ -47,7 +47,9 @@ fetch(jssConfig.graphQLEndpoint, {
47
47
  .then((result) => result.json())
48
48
  .then((result) => {
49
49
  // here we're filtering out any type information unrelated to unions or interfaces
50
- const filteredData = result.data.__schema.types.filter((type: { possibleTypes: Array<string>; }) => type.possibleTypes !== null);
50
+ const filteredData = result.data.__schema.types.filter(
51
+ (type: { possibleTypes: Array<string> }) => type.possibleTypes !== null
52
+ );
51
53
 
52
54
  const filteredResult = { ...result };
53
55
  filteredResult.data.__schema.types = filteredData;
@@ -2,10 +2,13 @@
2
2
  import { readFileSync } from 'fs';
3
3
  import { join } from 'path';
4
4
  import 'reflect-metadata';
5
- import 'zone.js/dist/zone-node';
5
+ import 'zone.js';
6
6
  import { JssRouteBuilderService } from './src/app/routing/jss-route-builder.service';
7
7
  import { environment } from './src/environments/environment';
8
8
  import { AppServerModule, renderModule } from './src/main.server';
9
+ import { clientFactory } from './src/app/lib/graphql-client-factory';
10
+ import { dictionaryServiceFactory } from './src/app/lib/dictionary-service-factory';
11
+ import { layoutServiceFactory } from './src/app/lib/layout-service-factory';
9
12
 
10
13
  export * from './src/main.server';
11
14
 
@@ -99,5 +102,20 @@ function parseRouteUrl(url: string) {
99
102
 
100
103
  const apiKey = environment.sitecoreApiKey;
101
104
  const siteName = environment.sitecoreSiteName;
105
+ const defaultLanguage = environment.defaultLanguage;
106
+ const graphQLEndpointPath = environment.graphQLEndpointPath;
107
+ const graphQLEndpoint = environment.graphQLEndpoint;
102
108
 
103
- export { renderView, parseRouteUrl, setUpDefaultAgents, apiKey, siteName };
109
+ export {
110
+ renderView,
111
+ parseRouteUrl,
112
+ setUpDefaultAgents,
113
+ apiKey,
114
+ siteName,
115
+ clientFactory,
116
+ dictionaryServiceFactory,
117
+ layoutServiceFactory,
118
+ defaultLanguage,
119
+ graphQLEndpointPath,
120
+ graphQLEndpoint,
121
+ };
@@ -10,7 +10,6 @@ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
10
10
  import { JssTranslationClientLoaderService } from './i18n/jss-translation-client-loader.service';
11
11
  import { JssTranslationLoaderService } from './i18n/jss-translation-loader.service';
12
12
  import { GraphQLModule } from './jss-graphql.module';
13
- import { JssDataFetcherService } from './jss-data-fetcher.service';
14
13
  import { JssMetaService } from './jss-meta.service';
15
14
 
16
15
  @NgModule({
@@ -31,7 +30,6 @@ import { JssMetaService } from './jss-meta.service';
31
30
  // The token is needed in cases when multiple applications are bootstrapped on a page
32
31
  { provide: APP_ID, useValue: 'my-app' },
33
32
  JssContextService,
34
- JssDataFetcherService,
35
33
  JssLayoutService,
36
34
  JssMetaService,
37
35
  // IMPORTANT: you must set the base href with this token, not a <base> tag in the HTML.