@eui/tools 5.0.0-rc.2 → 5.0.0-rc.22

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 (270) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +764 -5
  3. package/bin/eui-scripts.js +6 -6
  4. package/bin/scripts/build-package-sub.js +20 -0
  5. package/bin/scripts/version.js +12 -0
  6. package/global.test.js +61 -45
  7. package/package.json +18 -21
  8. package/sandbox.js +333 -5
  9. package/scripts/csdr/audit/audit-utils.js +2 -2
  10. package/scripts/csdr/cli/app.js +43 -5
  11. package/scripts/csdr/cli/package.js +93 -9
  12. package/scripts/csdr/cli/skeletons/app-eui10/angular-config.json +20 -0
  13. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-base.json +2 -0
  14. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-composite.json +5 -0
  15. package/scripts/csdr/cli/skeletons/app-eui10/gitignore_TO_REPLACE +63 -0
  16. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/models/user.js +8 -0
  17. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/index.js +5 -0
  18. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/user_routes.js +24 -0
  19. package/scripts/csdr/cli/skeletons/app-eui10/mock/db/db.json +12 -0
  20. package/scripts/csdr/cli/skeletons/app-eui10/mock/server.js +16 -0
  21. package/scripts/csdr/cli/skeletons/app-eui10/package.json +6 -0
  22. package/scripts/csdr/cli/skeletons/app-eui10/scripts.json +5 -0
  23. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-routing.module.ts +18 -0
  24. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-starter.service.ts +68 -0
  25. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.html +29 -0
  26. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.ts +55 -0
  27. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.module.ts +27 -0
  28. package/scripts/{utils/pre-build/translations/common.js → csdr/cli/skeletons/app-eui10/src/app/core/components/.gitkeep} +0 -0
  29. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/core.module.ts +84 -0
  30. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/reducers/index.ts +33 -0
  31. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home-routing.module.ts +15 -0
  32. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.html +7 -0
  33. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.ts +19 -0
  34. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.module.ts +18 -0
  35. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.html +7 -0
  36. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.ts +7 -0
  37. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.html +7 -0
  38. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.ts +7 -0
  39. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1-routing.module.ts +18 -0
  40. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.html +7 -0
  41. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.ts +8 -0
  42. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.module.ts +21 -0
  43. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2-routing.module.ts +16 -0
  44. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.html +8 -0
  45. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.ts +7 -0
  46. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.module.ts +17 -0
  47. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/shared.module.ts +21 -0
  48. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/testing/router.mock.ts +18 -0
  49. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/config/env-json-config.json +8 -0
  50. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/en.json +7 -0
  51. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/fr.json +7 -0
  52. package/scripts/csdr/cli/skeletons/app-eui10/src/config/global.ts +20 -0
  53. package/scripts/csdr/cli/skeletons/app-eui10/src/config/index.ts +8 -0
  54. package/scripts/csdr/cli/skeletons/app-eui10/src/config/modules.ts +4 -0
  55. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.prod.ts +9 -0
  56. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.ts +9 -0
  57. package/scripts/csdr/cli/skeletons/app-eui10/src/index.html +21 -0
  58. package/scripts/csdr/cli/skeletons/app-eui10/src/styles.scss +1 -0
  59. package/scripts/csdr/cli/skeletons/app-eui10/tslint.json +17 -0
  60. package/scripts/csdr/cli/skeletons/app-showcase/angular-config.json +98 -33
  61. package/scripts/csdr/cli/skeletons/app-showcase/dependencies-composite.json +1 -1
  62. package/scripts/csdr/cli/skeletons/app-showcase/src/app/app.component.html +16 -18
  63. package/scripts/csdr/cli/skeletons/app-showcase/src/app/app.routes.ts +1 -1
  64. package/scripts/csdr/cli/skeletons/app-showcase/src/app/features/_home/home.module.ts +2 -2
  65. package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
  66. package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
  67. package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
  68. package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
  69. package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
  70. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
  71. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
  72. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
  73. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
  74. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
  75. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
  76. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
  77. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
  78. package/scripts/csdr/cli/skeletons/{app-showcase → app-showcase-eui13}/src/app/features/shared/shared.module.ts +0 -0
  79. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
  80. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
  81. package/scripts/csdr/cli/skeletons/{app-showcase → app-showcase-eui13}/src/index.html +0 -0
  82. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/en.json +3 -0
  83. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/fr.json +3 -0
  84. package/scripts/csdr/cli/skeletons/package/frontend-eui10/gitignore_TO_REPLACE +46 -0
  85. package/scripts/csdr/cli/skeletons/package/frontend-eui10/karma.conf.js +7 -0
  86. package/scripts/csdr/cli/skeletons/package/frontend-eui10/ng-package.json +7 -0
  87. package/scripts/csdr/cli/skeletons/package/frontend-eui10/package.json +4 -0
  88. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/dummy.spec.ts.TO_REPLACE +5 -0
  89. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/index.ts +1 -0
  90. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/lib/module.ts +11 -0
  91. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/test.ts.TO_REPLACE +21 -0
  92. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.lib.json +32 -0
  93. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.spec.json +17 -0
  94. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tslint.json +17 -0
  95. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.html +1 -0
  96. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.spec.ts.TO_REPLACE +25 -0
  97. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.ts +14 -0
  98. package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +3 -3
  99. package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +1 -0
  100. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +3 -0
  101. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +6 -0
  102. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +62 -28
  103. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +44 -39
  104. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +23 -9
  105. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +1 -0
  106. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +1 -0
  107. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +6 -5
  108. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +1 -1
  109. package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +3 -1
  110. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/angular.json +90 -0
  111. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +10 -0
  112. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-base.json +2 -0
  113. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite.json +6 -0
  114. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +64 -0
  115. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/karma.conf.js +7 -0
  116. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +8 -0
  117. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/dummy.scss +3 -0
  118. package/scripts/csdr/cli/skeletons/package/{frontend-remote/src/app/dummy.spec.ts.TO_REPLACE → frontend-remote-eui10/src/app/dummy.spec.ts} +0 -0
  119. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/fallback.component.ts +11 -0
  120. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +90 -0
  121. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +219 -0
  122. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/custom-route-serializer.ts +28 -0
  123. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/index.ts +42 -0
  124. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +55 -0
  125. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/assets/.gitkeep +0 -0
  126. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +31 -0
  127. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/index.ts +20 -0
  128. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/modules.ts +3 -0
  129. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.prod.ts +3 -0
  130. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.ts +15 -0
  131. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/favicon.ico +0 -0
  132. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/index.html +10 -0
  133. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/main.ts +12 -0
  134. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/polyfills.ts +86 -0
  135. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/test.ts.TO_REPLACE +20 -0
  136. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.app.json +20 -0
  137. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.spec.json +18 -0
  138. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint-remote.json +7 -0
  139. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint.json +17 -0
  140. package/scripts/csdr/cli/skeletons/package/{frontend-remote → frontend-remote-eui10}/webpack.extra.js +0 -0
  141. package/scripts/csdr/config/angular.js +734 -47
  142. package/scripts/csdr/config/global.js +43 -6
  143. package/scripts/csdr/config/packages.js +64 -1
  144. package/scripts/csdr/config/projects.js +24 -6
  145. package/scripts/csdr/config/projects.test.js +11 -9
  146. package/scripts/csdr/config/sync.js +6 -3
  147. package/scripts/csdr/init/init-utils.js +72 -0
  148. package/scripts/csdr/init/init.js +6 -0
  149. package/scripts/csdr/init/prompt.js +3 -1
  150. package/scripts/csdr/init/resources/10.x/yarn.lock +16428 -0
  151. package/scripts/csdr/init/resources/13.x/browserslistrc +6 -0
  152. package/scripts/csdr/init/resources/13.x/resolutions.json +6 -0
  153. package/scripts/csdr/init/resources/14.x/browserslistrc +6 -0
  154. package/scripts/csdr/init/resources/14.x/resolutions.json +5 -0
  155. package/scripts/csdr/install/build-app.js +6 -38
  156. package/scripts/csdr/install/build-package.js +16 -157
  157. package/scripts/csdr/install/common.js +27 -15
  158. package/scripts/csdr/install/composite-core.js +256 -0
  159. package/scripts/csdr/install/install-utils.js +8 -4
  160. package/scripts/csdr/install/local-dev.js +5 -3
  161. package/scripts/csdr/install/packages.js +90 -0
  162. package/scripts/csdr/install/projects.js +76 -0
  163. package/scripts/csdr/install/{remote.js → remotes.js} +46 -51
  164. package/scripts/csdr/metadata/app-envs.js +1 -39
  165. package/scripts/csdr/metadata/app-history.js +1 -66
  166. package/scripts/csdr/metadata/app-versions.js +2 -12
  167. package/scripts/csdr/metadata/app.js +49 -9
  168. package/scripts/csdr/metadata/common.js +21 -45
  169. package/scripts/csdr/metadata/metadata-utils.js +2 -0
  170. package/scripts/csdr/metadata/package-envs.js +71 -0
  171. package/scripts/csdr/metadata/package-history.js +5 -1
  172. package/scripts/csdr/metadata/package-versions.js +79 -0
  173. package/scripts/csdr/metadata/package.js +182 -104
  174. package/scripts/csdr/metadata/stats.js +9 -5
  175. package/scripts/csdr/metadata/v2/app/_app.js +21 -0
  176. package/scripts/csdr/metadata/v2/app/app.js +25 -0
  177. package/scripts/csdr/metadata/v2/app/index.js +3 -0
  178. package/scripts/csdr/metadata/v2/global/_global.js +21 -0
  179. package/scripts/csdr/metadata/v2/global/global.js +25 -0
  180. package/scripts/csdr/metadata/v2/global/index.js +3 -0
  181. package/scripts/csdr/metadata/v2/index.js +5 -0
  182. package/scripts/csdr/metadata/v2/package/_package.js +21 -0
  183. package/scripts/csdr/metadata/v2/package/index.js +3 -0
  184. package/scripts/csdr/metadata/v2/package/package.js +25 -0
  185. package/scripts/csdr/release/app/release-app.js +16 -21
  186. package/scripts/csdr/release/package/backend.js +26 -0
  187. package/scripts/csdr/release/package/common.js +220 -18
  188. package/scripts/csdr/release/package/release-package.js +41 -7
  189. package/scripts/csdr/release/package/remote.js +2 -17
  190. package/scripts/csdr/release/package/ui.js +86 -3
  191. package/scripts/csdr/sync/sync-utils.js +9 -2
  192. package/scripts/csdr/version/app-common.js +32 -0
  193. package/scripts/csdr/version/app-env-target.js +5 -295
  194. package/scripts/csdr/version/app.js +5 -3
  195. package/scripts/csdr/version/common.js +282 -0
  196. package/scripts/csdr/version/{app-env-target.test.js → common.test.js} +48 -36
  197. package/scripts/csdr/version/package-common.js +158 -0
  198. package/scripts/csdr/version/package-default.js +144 -0
  199. package/scripts/csdr/version/package-remote.js +51 -0
  200. package/scripts/csdr/version/package.js +16 -270
  201. package/scripts/csdr/version/version-utils.js +12 -7
  202. package/scripts/utils/api-utils.js +126 -0
  203. package/scripts/utils/build/app/build-app-utils.js +11 -9
  204. package/scripts/utils/build/package/angular.js +4 -30
  205. package/scripts/utils/build/package/build-package-utils.js +50 -1
  206. package/scripts/utils/build/package/element.js +17 -18
  207. package/scripts/utils/build/package/nodeJs.js +2 -1
  208. package/scripts/utils/build/package/skeletons/elements/index.html +9 -0
  209. package/scripts/utils/build/package/styles.js +83 -86
  210. package/scripts/utils/git-utils.js +69 -6
  211. package/scripts/utils/index.js +3 -4
  212. package/scripts/utils/notification/common.js +5 -0
  213. package/scripts/utils/notification/mail-utils.js +3 -0
  214. package/scripts/utils/notification/mailstack.js +3 -5
  215. package/scripts/utils/notification/package.js +0 -2
  216. package/scripts/utils/notification/slack-utils.js +6 -7
  217. package/scripts/utils/pre-build/elements.js +8 -4
  218. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/app/app.module.ts +1 -1
  219. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/tsconfig.app.json +1 -2
  220. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
  221. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
  222. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
  223. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
  224. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
  225. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
  226. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
  227. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
  228. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
  229. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
  230. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
  231. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
  232. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
  233. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
  234. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
  235. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
  236. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/app.module.ts +52 -0
  237. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/core/reducers/index.ts +40 -0
  238. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/global.ts +4 -0
  239. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/index.ts +8 -0
  240. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/modules.ts +4 -0
  241. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.dev.ts +9 -0
  242. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.prod.ts +9 -0
  243. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.ts +21 -0
  244. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/favicon.ico +0 -0
  245. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/karma.conf.js +7 -0
  246. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/main.ts +21 -0
  247. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/polyfills.ts +86 -0
  248. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/tst.ts +33 -0
  249. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.app.json +19 -0
  250. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.spec.json +9 -0
  251. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tslint.json +17 -0
  252. package/scripts/utils/pre-build/injection/config.js +30 -31
  253. package/scripts/utils/pre-build/injection/externals.js +70 -72
  254. package/scripts/utils/pre-build/injection/injection-utils.js +2 -0
  255. package/scripts/utils/pre-build/injection/routes-replacement.js +318 -0
  256. package/scripts/utils/pre-build/injection/skeletons.js +9 -3
  257. package/scripts/utils/pre-build/projects.js +28 -15
  258. package/scripts/utils/pre-build/translations/elements.js +21 -11
  259. package/scripts/utils/serve/app.js +7 -4
  260. package/scripts/utils/test/test-utils.js +39 -1
  261. package/scripts/utils/tools.js +402 -290
  262. package/bin/scripts/csdr-jira-update.js +0 -12
  263. package/bin/scripts/csdr-migrate-package.js +0 -17
  264. package/bin/scripts/e2e-app.js +0 -62
  265. package/scripts/csdr/install/composite-utils.js +0 -292
  266. package/scripts/csdr/jira/jira-utils.js +0 -169
  267. package/scripts/csdr/jira/update.js +0 -153
  268. package/scripts/migration/eui8-migration.js +0 -94
  269. package/scripts/migration/migrate-utils.js +0 -191
  270. package/scripts/utils/confluence-utils.js +0 -126
@@ -0,0 +1,41 @@
1
+ {
2
+ "global": {
3
+ "appTitle": "CSDR-app",
4
+ "i18n": {
5
+ "i18nService": {
6
+ "defaultLanguage": "en",
7
+ "languages": [
8
+ "en",
9
+ "fr",
10
+ "es"
11
+ ]
12
+ },
13
+ "i18nLoader": {
14
+ "i18nFolders": [
15
+ "i18n-eui",
16
+ "i18n-ecl",
17
+ "i18n"
18
+ ]
19
+ }
20
+ }
21
+ },
22
+ "versions": {},
23
+ "modules": {
24
+ "core": {
25
+ "api": {
26
+ "base": "assets/",
27
+ "user": {
28
+ "base": "config/",
29
+ "details": "user-details.json",
30
+ "preferences": "user-preferences.json",
31
+ "rights": "user-rights.json"
32
+ }
33
+ }
34
+ },
35
+ "users": {
36
+ "api": {
37
+ "base": "https://jsonplaceholder.typicode.com/users"
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "@module.name@.KEY": "english text"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "@module.name@.KEY": "texte en français"
3
+ }
@@ -0,0 +1,46 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+ # compiled output
4
+ **/node_modules
5
+ **/target
6
+ **/build
7
+ **/dist
8
+ **/out-tsc
9
+ **/tmp
10
+ **/test/reports
11
+
12
+ # IDEs and editors
13
+ /.idea
14
+ .project
15
+ .classpath
16
+ .c9/
17
+ *.launch
18
+ .settings/
19
+ *.sublime-workspace
20
+
21
+ # IDE - VSCode
22
+ .vscode/*
23
+ !.vscode/settings.json
24
+ !.vscode/tasks.json
25
+ !.vscode/launch.json
26
+ !.vscode/extensions.json
27
+
28
+ # misc
29
+ /.sass-cache
30
+ /connect.lock
31
+ /coverage
32
+ /libpeerconnection.log
33
+ npm-debug.log
34
+ testem.log
35
+ /typings
36
+ yarn-error.log
37
+
38
+ # e2e
39
+ /e2e/*.js
40
+ /e2e/*.map
41
+ **/src/**/*.js
42
+ **/src/**/*.map
43
+
44
+ # System Files
45
+ .DS_Store
46
+ Thumbs.db
@@ -0,0 +1,7 @@
1
+ const karmaConfig = require('@eui/tools/karma/karma.conf.pkg');
2
+
3
+ module.exports = function (config) {
4
+ config.set(
5
+ karmaConfig.get(config, '@module.full.name@', {})
6
+ );
7
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "./dist",
4
+ "lib": {
5
+ "entryFile": "src/index.ts"
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "@module.scope@/@module.name@",
3
+ "version": "1.0.0"
4
+ }
@@ -0,0 +1,5 @@
1
+ describe('First test', () => {
2
+ it('should work', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
@@ -0,0 +1 @@
1
+ export * from './lib/module';
@@ -0,0 +1,11 @@
1
+ import { NgModule } from '@angular/core';
2
+
3
+ @NgModule({
4
+ declarations: [
5
+ ],
6
+ imports: [
7
+ ],
8
+ exports: [
9
+ ],
10
+ })
11
+ export class Module { }
@@ -0,0 +1,21 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/dist/zone';
4
+ import 'zone.js/dist/zone-testing';
5
+ import { getTestBed } from '@angular/core/testing';
6
+ import {
7
+ BrowserDynamicTestingModule,
8
+ platformBrowserDynamicTesting
9
+ } from '@angular/platform-browser-dynamic/testing';
10
+
11
+ declare const require: any;
12
+
13
+ // First, initialize the Angular testing environment.
14
+ getTestBed().initTestEnvironment(
15
+ BrowserDynamicTestingModule,
16
+ platformBrowserDynamicTesting()
17
+ );
18
+ // Then we find all the tests.
19
+ const context = require.context('./', true, /\.spec\.ts$/);
20
+ // And load the modules.
21
+ context.keys().map(context);
@@ -0,0 +1,32 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/lib",
5
+ "target": "es2015",
6
+ "module": "es2015",
7
+ "moduleResolution": "node",
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "inlineSources": true,
11
+ "emitDecoratorMetadata": true,
12
+ "experimentalDecorators": true,
13
+ "importHelpers": true,
14
+ "types": [],
15
+ "lib": [
16
+ "dom",
17
+ "es2018"
18
+ ]
19
+ },
20
+ "angularCompilerOptions": {
21
+ "annotateForClosureCompiler": true,
22
+ "skipTemplateCodegen": true,
23
+ "strictMetadataEmit": true,
24
+ "fullTemplateTypeCheck": true,
25
+ "strictInjectionParameters": true,
26
+ "enableResourceInlining": true
27
+ },
28
+ "exclude": [
29
+ "src/test.ts",
30
+ "**/*.spec.ts"
31
+ ]
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/spec",
5
+ "types": [
6
+ "jasmine",
7
+ "node"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tslint.json",
3
+ "rules": {
4
+ "directive-selector": [
5
+ true,
6
+ "attribute",
7
+ "@module.scope.string@",
8
+ "camelCase"
9
+ ],
10
+ "component-selector": [
11
+ true,
12
+ "element",
13
+ "@module.scope.string@",
14
+ "kebab-case"
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ Hello from <strong>@module.name@-cmp1</strong>
@@ -0,0 +1,25 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Cmp1Component } from './cmp1.component';
4
+
5
+ describe('ModuleComponent', () => {
6
+ let component: Cmp1Component;
7
+ let fixture: ComponentFixture<Cmp1Component>;
8
+
9
+ beforeEach(async(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [Cmp1Component],
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(Cmp1Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,14 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: '@module.scope.string@-cmp1-component',
5
+ templateUrl: './cmp1.component.html',
6
+ })
7
+ export class Cmp1Component implements OnInit {
8
+
9
+ constructor() { }
10
+
11
+ ngOnInit() {
12
+ }
13
+
14
+ }
@@ -3,7 +3,7 @@
3
3
  "version": 1,
4
4
  "newProjectRoot": "apps",
5
5
  "projects": {
6
- "remote-element": {
6
+ "@module.full.name@": {
7
7
  "root": ".",
8
8
  "sourceRoot": "src",
9
9
  "projectType": "application",
@@ -52,11 +52,11 @@
52
52
  "serve": {
53
53
  "builder": "./node_modules/@angular-devkit/build-angular:dev-server",
54
54
  "options": {
55
- "browserTarget": "remote-element:build:serve-dist"
55
+ "browserTarget": "@module.full.name@:build:serve-dist"
56
56
  },
57
57
  "configurations": {
58
58
  "production": {
59
- "browserTarget": "remote-element:build:production"
59
+ "browserTarget": "@module.full.name@:build:production"
60
60
  }
61
61
  }
62
62
  },
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "@eui/deps-base": "^7.0.0",
3
+
3
4
  "@csdr/core": "^1.0.0",
4
5
  "@csdr/integration": "^1.0.0",
5
6
  "@csdr/zipkin-tracing": "^3.0.0"
@@ -0,0 +1,3 @@
1
+ .example {
2
+ padding: 10px;
3
+ }
@@ -0,0 +1,6 @@
1
+ // Dummy test
2
+ describe('Test', () => {
3
+ it('should work', () => {
4
+ expect(true).toBe(true);
5
+ });
6
+ });
@@ -1,50 +1,84 @@
1
- import { Component, OnInit, Inject, ViewChild } from '@angular/core';
1
+ import { Component, OnInit, Inject } from '@angular/core';
2
2
  import { Location } from '@angular/common';
3
- import { Router, RouterOutlet } from '@angular/router';
3
+ import { Router } from '@angular/router';
4
4
 
5
- import { CONFIG_TOKEN, I18nService } from '@eui/core';
5
+ import { take, retry } from 'rxjs/operators';
6
+
7
+ import { CONFIG_TOKEN, I18nService, I18nLoadStatus } from '@eui/core';
8
+ import { appConfig } from '../config/index';
9
+
10
+ enum ElementStatus {
11
+ Loading = 'loading',
12
+ Loaded = 'loaded',
13
+ Error = 'error',
14
+ }
6
15
 
7
16
  @Component({
8
17
  template: `
9
- <ng-container *ngIf="render">
18
+ <ux-block-content *ngIf="moduleStatus === ElementStatus.Loading" [isBlocked]="true">
19
+ <div style="height: 100%"></div>
20
+ </ux-block-content>
21
+ <ng-container *ngIf="moduleStatus === ElementStatus.Loaded">
10
22
  <router-outlet></router-outlet>
11
23
  </ng-container>
24
+ <ng-container *ngIf="moduleStatus === ElementStatus.Error">
25
+ <div class="error-container">
26
+ <div>
27
+ <h1>Translations for this module failed to load.</h1>
28
+ <p>Do you want to try again?</p>
29
+ <ux-button (click)="loadTranslations()">{{ 'global.RELOAD' | translate }}</ux-button>
30
+ </div>
31
+ </div>
32
+ </ng-container>
12
33
  `,
34
+ styles: [`
35
+ .error-container {
36
+ width: 50vw;
37
+ height: 50vh;
38
+ position: absolute;
39
+ top: 50%;
40
+ left: 50%;
41
+ transform: translate(-50%, -50%);
42
+ }
43
+
44
+ .error-container div {
45
+ text-align: center
46
+ }
47
+ `],
13
48
  })
14
49
  export class ModuleComponent implements OnInit {
15
-
16
- @ViewChild(RouterOutlet) outlet: RouterOutlet;
17
- render: boolean;
50
+ ElementStatus = ElementStatus;
51
+ moduleStatus: ElementStatus;
18
52
 
19
53
  constructor(private router: Router,
20
54
  private location: Location,
21
55
  @Inject(CONFIG_TOKEN) public config: any,
22
56
  private i18nService: I18nService) {
23
- const i18nFolders = ['elements/@module.full.name@/bundles/assets/i18n-compiled'];
24
- this.i18nService.addResources({ i18nFolders }, '@module.full.name@');
25
-
26
- this.i18nService.onReady('@module.full.name@')
27
- .subscribe(() => {
28
- this.render = true;
29
- });
30
57
  }
31
58
 
32
59
  public ngOnInit() {
33
60
  this.router.navigateByUrl(this.location.path(true));
61
+ this.loadTranslations();
62
+ }
63
+
64
+ private loadTranslations() {
65
+ this.setStatus(ElementStatus.Loading);
66
+ this.i18nService.lazyLoad({ i18nFolders: appConfig.global.i18nResources })
67
+ .pipe(take(1), retry(1))
68
+ .subscribe((loadStatus: I18nLoadStatus) => {
69
+ if (!loadStatus.success) {
70
+ this.setStatus(ElementStatus.Error);
71
+ console.error(`[ELEMENT: ${appConfig.global.elementName}] `, loadStatus.error);
72
+ } else {
73
+ this.setStatus(ElementStatus.Loaded);
74
+ }
75
+ }, (error) => {
76
+ this.setStatus(ElementStatus.Error);
77
+ console.error(`[ELEMENT: ${appConfig.global.elementName}] `, error);
78
+ });
79
+ }
34
80
 
35
- // This avoids this error https://github.com/angular/angular/issues/29303
36
- // when following this steps:
37
- // - Go to http://localhost:4200/mywp-remote-sample-v7/
38
- // - Click on 'Go to mywp-remote-sample-v7b root'
39
- // - Go back twice through the browser to http://localhost:4200/mywp-remote-sample-v7/main
40
- // - Click on 'Go to child'
41
- // Solution from here:
42
- // - https://stackoverflow.com/questions/55617772/angular-7-multiple-outlets-error-cannot-activate-an-already-activated-outle
43
- // HANDLE WITH CARE, IT MIGHT HAVE UNKNOWN SIDE EFFECTS!
44
- /*this.router.events.subscribe(e => {
45
- if (e instanceof ActivationStart) {
46
- this.outlet.deactivate();
47
- }
48
- });*/
81
+ private setStatus(status: ElementStatus) {
82
+ this.moduleStatus = status;
49
83
  }
50
84
  }
@@ -14,41 +14,42 @@ import { TranslateModule, TranslateService, TranslateStore } from '@ngx-translat
14
14
  // CSDR CORE - Babel defs & core reducers
15
15
  import {
16
16
  CachePreventionInterceptor,
17
+ CONFIG_TOKEN,
17
18
  CorsSecurityInterceptor,
18
19
  CsrfPreventionInterceptor,
19
20
  EuLoginSessionTimeoutHandlingInterceptor,
20
- OpenidConnectInterceptor,
21
- UxService,
22
- CONFIG_TOKEN,
23
- UxDomService,
24
- UserService,
21
+ HttpService,
25
22
  I18nService,
26
- StoreService,
23
+ LocalStorageService,
27
24
  LogService,
28
- UxBreadcrumbsService,
25
+ OpenidConnectInterceptor,
29
26
  OpenIdConnectService,
30
- UxDynamicMessageBoxService,
31
- UxDynamicComponentService,
32
- UxAppShellService,
33
- HttpService,
34
- UxDynamicModalService,
35
- LocalStorageService,
36
27
  StorageService,
28
+ StoreService,
29
+ UserService,
30
+ UxAllModule,
31
+ UxAppShellService,
32
+ UxBreadcrumbsService,
33
+ UxDomService,
34
+ UxErrorFeedbackService,
35
+ UxService,
37
36
  } from '@eui/core';
38
- import { PushNotificationsService } from '@csdr/core';
39
- import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
37
+ import { LanguageInterceptor, PushNotificationsService, BreadcrumbsService } from '@csdr/core';
38
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
39
+ // import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
40
40
 
41
41
  import { TOKEN, reducerProvider, metaReducers } from './reducers/index';
42
42
  import { CustomSerializer } from './reducers/custom-route-serializer';
43
43
 
44
44
  import { environment } from '../environments/environment';
45
45
 
46
- // TODO - implies creation of sub-angular library root package - see task-manager for details
46
+ // TODO[REMOTE-SETUP] - import from wrapped package
47
47
  // import { TaskMgrCommonModule } from '@cc/task-manager';
48
- import { ELEMENT_ROUTER_TOKEN, PushNotificationMapping } from '@csdr/integration/elements';
48
+ import { ELEMENT_ROUTER_TOKEN, PushNotificationMapping, UxServiceMapping } from '@csdr/integration';
49
49
  import { RoutingModule } from './routing.module';
50
50
 
51
51
  import { ModuleComponent } from './module.component';
52
+ import { appConfig } from '../config';
52
53
 
53
54
  export function openidConnectInterceptorFactory(config) {
54
55
  return new OpenidConnectInterceptor();
@@ -62,10 +63,11 @@ export function openidConnectInterceptorFactory(config) {
62
63
  StoreRouterConnectingModule.forRoot({ stateKey: 'router', serializer: CustomSerializer }),
63
64
  StoreModule.forRoot(TOKEN, { metaReducers }),
64
65
  EffectsModule.forRoot([]),
65
- StoreDevtoolsModule.instrument({ name: 'TC remote el', maxAge: 150, logOnly: environment.production }),
66
+ StoreDevtoolsModule.instrument({ name: appConfig.global.storeName, maxAge: 150, logOnly: environment.production }),
66
67
  TranslateModule,
67
68
 
68
- // TODO - implies creation of sub-angular library root package - see task-manager for details
69
+ UxAllModule,
70
+ // TODO import from package
69
71
  // TaskMgrCommonModule,
70
72
  RoutingModule,
71
73
  ],
@@ -77,6 +79,12 @@ export function openidConnectInterceptorFactory(config) {
77
79
  ],
78
80
  providers: [
79
81
  reducerProvider,
82
+ {
83
+ provide: HTTP_INTERCEPTORS,
84
+ useClass: LanguageInterceptor,
85
+ deps: [CONFIG_TOKEN, StorageService],
86
+ multi: true,
87
+ },
80
88
  {
81
89
  provide: HTTP_INTERCEPTORS,
82
90
  useClass: CorsSecurityInterceptor,
@@ -103,15 +111,21 @@ export function openidConnectInterceptorFactory(config) {
103
111
  deps: [CONFIG_TOKEN],
104
112
  multi: true,
105
113
  },
114
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
115
+ // {
116
+ // provide: HTTP_INTERCEPTORS,
117
+ // useClass: ZipkinHttpInterceptor,
118
+ // deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
119
+ // multi: true,
120
+ // },
121
+ { provide: CONFIG_TOKEN, useFactory: () => window['PROVIDERS']['CONFIG_TOKEN'], deps: [] },
106
122
  {
107
- provide: HTTP_INTERCEPTORS,
108
- useClass: ZipkinHttpInterceptor,
109
- deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
110
- multi: true,
123
+ provide: UxService,
124
+ useFactory: () => new UxServiceMapping(window['PROVIDERS']['ngZone'], window['PROVIDERS']['UxService']),
125
+ deps: [],
111
126
  },
112
- { provide: CONFIG_TOKEN, useFactory: () => window['PROVIDERS']['CONFIG_TOKEN'], deps: [] },
113
- { provide: UxService, useFactory: () => window['PROVIDERS']['UxService'], deps: [] },
114
127
  { provide: UxDomService, useFactory: () => window['PROVIDERS']['UxDomService'], deps: [] },
128
+ { provide: UxErrorFeedbackService, useFactory: () => window['PROVIDERS']['UxErrorFeedbackService'], deps: [] },
115
129
  { provide: LocalStorageService, useFactory: () => window['PROVIDERS']['LocalStorageService'], deps: [] },
116
130
  { provide: StorageService, useFactory: () => window['PROVIDERS']['StorageService'], deps: [] },
117
131
  { provide: LogService, useFactory: () => window['PROVIDERS']['LogService'], deps: [] },
@@ -125,25 +139,16 @@ export function openidConnectInterceptorFactory(config) {
125
139
  { provide: OpenIdConnectService, useFactory: () => window['PROVIDERS']['OpenIdConnectService'], deps: [] },
126
140
  { provide: HttpService, useFactory: () => window['PROVIDERS']['HttpService'], deps: [] },
127
141
  { provide: UxAppShellService, useFactory: () => window['PROVIDERS']['UxAppShellService'], deps: [] },
128
- {
129
- provide: UxDynamicMessageBoxService,
130
- useFactory: () => window['PROVIDERS']['UxDynamicMessageBoxService'],
131
- deps: [],
132
- },
133
- { provide: UxDynamicModalService, useFactory: () => window['PROVIDERS']['UxDynamicModalService'], deps: [] },
134
- {
135
- provide: UxDynamicComponentService,
136
- useFactory: () => window['PROVIDERS']['UxDynamicComponentService'],
137
- deps: [],
138
- },
139
142
  {
140
143
  provide: PushNotificationsService,
141
144
  useFactory: (zone: NgZone) => new PushNotificationMapping(zone, window['PROVIDERS']['PushNotificationsService']),
142
145
  deps: [NgZone],
143
146
  },
147
+ { provide: BreadcrumbsService, useFactory: () => window['PROVIDERS']['BreadcrumbsService'], deps: [] },
144
148
  { provide: ELEMENT_ROUTER_TOKEN, useFactory: () => window['PROVIDERS']['ELEMENT_ROUTER_TOKEN'], deps: [] },
145
- { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
146
- { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
149
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
150
+ // { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
151
+ // { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
147
152
  ],
148
153
  })
149
154
  export class AppModule {
@@ -154,7 +159,7 @@ export class AppModule {
154
159
  ngDoBootstrap() {
155
160
  const elementSampleEui = createCustomElement(ModuleComponent, { injector: this.injector });
156
161
  try {
157
- customElements.define('@module.full.name@', elementSampleEui);
162
+ customElements.define(appConfig.global.elementName, elementSampleEui);
158
163
  } catch (e) {
159
164
  console.log(e);
160
165
  }
@@ -1,17 +1,20 @@
1
1
  import { NgModule, NgZone, Inject } from '@angular/core';
2
- import { RouterModule, Routes, Router } from '@angular/router';
2
+ import { RouterModule, Routes, Router, NavigationStart } from '@angular/router';
3
+ import { Subscription } from 'rxjs';
4
+ import { filter, distinctUntilChanged } from 'rxjs/operators';
3
5
 
4
- import { ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration/elements';
6
+ import { CCRoute, ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
5
7
 
6
- // TODO - get routes from linked root package lib
8
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
7
9
  // import { routes } from '@cc/task-manager';
8
- import { GLOBAL } from '../config/global';
10
+ import { appConfig } from '../config/index';
9
11
  import { ModuleComponent } from './module.component';
10
12
 
11
13
  const prefixedRoutes: Routes = [
12
14
  {
13
- path: GLOBAL.baseUrl,
14
- children: routes, // TODO
15
+ path: appConfig.global.baseUrl,
16
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
17
+ // children: routes,
15
18
  },
16
19
  { path: '**', component: ModuleComponent },
17
20
  ];
@@ -26,15 +29,26 @@ const prefixedRoutes: Routes = [
26
29
  ],
27
30
  })
28
31
  export class RoutingModule {
32
+ private routes: CCRoute[] = prefixedRoutes.map(route => route as CCRoute);
33
+
34
+ private navigationStartSubscription: Subscription;
29
35
 
30
36
  constructor(private router: Router,
31
37
  private ngZone: NgZone,
32
38
  @Inject(ELEMENT_ROUTER_TOKEN) private routerService: IRouterService) {
33
39
 
34
- this.routerService.registerSubRouter(GLOBAL.baseUrl, (url: string) => {
40
+ this.routerService.registerSubRouter(appConfig.global.baseUrl, (url: string) => {
35
41
  this.ngZone.run(() => router.navigateByUrl(url));
36
- });
42
+ }, this.routes);
37
43
 
38
- this.router.events.pipe().subscribe(data => this.routerService.subrouterEvent(GLOBAL.baseUrl, data));
44
+ this.navigationStartSubscription = this.router
45
+ .events
46
+ .pipe(
47
+ filter(event => event instanceof NavigationStart),
48
+ distinctUntilChanged((prev, curr) => prev['url'] === curr['url']),
49
+ )
50
+ .subscribe(data => {
51
+ this.routerService.subrouterEvent(appConfig.global.baseUrl, data);
52
+ });
39
53
  }
40
54
  }