@eui/tools 5.0.0-rc.8 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +846 -19
  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 +14 -13
  8. package/sandbox.js +229 -6
  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 -28
  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 +724 -83
  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 +108 -0
  148. package/scripts/csdr/init/init.js +11 -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/init/resources/nodejs-10.x/resolutions.json +8 -0
  156. package/scripts/csdr/install/build-app.js +6 -38
  157. package/scripts/csdr/install/build-package.js +16 -157
  158. package/scripts/csdr/install/common.js +21 -9
  159. package/scripts/csdr/install/composite-core.js +256 -0
  160. package/scripts/csdr/install/install-utils.js +8 -4
  161. package/scripts/csdr/install/local-dev.js +6 -4
  162. package/scripts/csdr/install/packages.js +90 -0
  163. package/scripts/csdr/install/projects.js +76 -0
  164. package/scripts/csdr/install/{remote.js → remotes.js} +46 -51
  165. package/scripts/csdr/metadata/app-envs.js +0 -39
  166. package/scripts/csdr/metadata/app-history.js +0 -66
  167. package/scripts/csdr/metadata/app-versions.js +2 -12
  168. package/scripts/csdr/metadata/app.js +49 -9
  169. package/scripts/csdr/metadata/common.js +23 -47
  170. package/scripts/csdr/metadata/metadata-utils.js +2 -0
  171. package/scripts/csdr/metadata/package-envs.js +71 -0
  172. package/scripts/csdr/metadata/package-history.js +5 -0
  173. package/scripts/csdr/metadata/package-versions.js +79 -0
  174. package/scripts/csdr/metadata/package.js +95 -105
  175. package/scripts/csdr/metadata/stats.js +9 -5
  176. package/scripts/csdr/metadata/v2/app/_app.js +21 -0
  177. package/scripts/csdr/metadata/v2/app/app.js +25 -0
  178. package/scripts/csdr/metadata/v2/app/index.js +3 -0
  179. package/scripts/csdr/metadata/v2/global/_global.js +21 -0
  180. package/scripts/csdr/metadata/v2/global/global.js +25 -0
  181. package/scripts/csdr/metadata/v2/global/index.js +3 -0
  182. package/scripts/csdr/metadata/v2/index.js +5 -0
  183. package/scripts/csdr/metadata/v2/migrate-devops-metadata.js +207 -0
  184. package/scripts/csdr/metadata/v2/package/_package.js +21 -0
  185. package/scripts/csdr/metadata/v2/package/index.js +3 -0
  186. package/scripts/csdr/metadata/v2/package/package.js +25 -0
  187. package/scripts/csdr/release/app/release-app.js +16 -21
  188. package/scripts/csdr/release/package/backend.js +26 -0
  189. package/scripts/csdr/release/package/common.js +220 -18
  190. package/scripts/csdr/release/package/release-package.js +28 -10
  191. package/scripts/csdr/release/package/remote.js +2 -17
  192. package/scripts/csdr/release/package/ui.js +86 -3
  193. package/scripts/csdr/sync/sync-utils.js +6 -0
  194. package/scripts/csdr/templates/maven-settings.template +13 -0
  195. package/scripts/csdr/version/app-common.js +32 -0
  196. package/scripts/csdr/version/app-env-target.js +5 -295
  197. package/scripts/csdr/version/app.js +5 -3
  198. package/scripts/csdr/version/common.js +282 -0
  199. package/scripts/csdr/version/{app-env-target.test.js → common.test.js} +48 -36
  200. package/scripts/csdr/version/package-common.js +158 -0
  201. package/scripts/csdr/version/package-default.js +144 -0
  202. package/scripts/csdr/version/package-remote.js +51 -0
  203. package/scripts/csdr/version/package.js +16 -270
  204. package/scripts/csdr/version/version-utils.js +12 -7
  205. package/scripts/utils/api-utils.js +126 -0
  206. package/scripts/utils/build/app/build-app-utils.js +11 -9
  207. package/scripts/utils/build/package/angular.js +4 -30
  208. package/scripts/utils/build/package/build-package-utils.js +50 -1
  209. package/scripts/utils/build/package/element.js +17 -18
  210. package/scripts/utils/build/package/nodeJs.js +2 -1
  211. package/scripts/utils/build/package/skeletons/elements/index.html +9 -0
  212. package/scripts/utils/build/package/styles.js +92 -92
  213. package/scripts/utils/git-utils.js +76 -6
  214. package/scripts/utils/index.js +3 -4
  215. package/scripts/utils/notification/common.js +5 -0
  216. package/scripts/utils/notification/mail-utils.js +3 -0
  217. package/scripts/utils/notification/mailstack.js +3 -5
  218. package/scripts/utils/notification/package.js +0 -2
  219. package/scripts/utils/notification/slack-utils.js +6 -7
  220. package/scripts/utils/pre-build/elements.js +8 -4
  221. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/app/app.module.ts +1 -1
  222. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/tsconfig.app.json +1 -2
  223. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
  224. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
  225. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
  226. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
  227. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
  228. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
  229. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
  230. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
  231. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
  232. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
  233. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
  234. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
  235. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
  236. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
  237. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
  238. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
  239. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/app.module.ts +52 -0
  240. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/core/reducers/index.ts +40 -0
  241. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/global.ts +4 -0
  242. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/index.ts +8 -0
  243. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/modules.ts +4 -0
  244. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.dev.ts +9 -0
  245. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.prod.ts +9 -0
  246. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.ts +21 -0
  247. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/favicon.ico +0 -0
  248. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/karma.conf.js +7 -0
  249. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/main.ts +21 -0
  250. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/polyfills.ts +86 -0
  251. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/tst.ts +33 -0
  252. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.app.json +19 -0
  253. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.spec.json +9 -0
  254. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tslint.json +17 -0
  255. package/scripts/utils/pre-build/injection/config.js +30 -31
  256. package/scripts/utils/pre-build/injection/externals.js +70 -72
  257. package/scripts/utils/pre-build/injection/injection-utils.js +2 -0
  258. package/scripts/utils/pre-build/injection/routes-replacement.js +322 -0
  259. package/scripts/utils/pre-build/injection/skeletons.js +9 -3
  260. package/scripts/utils/pre-build/projects.js +20 -15
  261. package/scripts/utils/pre-build/translations/elements.js +21 -11
  262. package/scripts/utils/serve/app.js +7 -4
  263. package/scripts/utils/test/test-utils.js +39 -1
  264. package/scripts/utils/tools.js +402 -290
  265. package/bin/scripts/csdr-jira-update.js +0 -12
  266. package/bin/scripts/csdr-migrate-package.js +0 -17
  267. package/bin/scripts/e2e-app.js +0 -62
  268. package/scripts/csdr/install/composite-utils.js +0 -292
  269. package/scripts/csdr/jira/jira-utils.js +0 -169
  270. package/scripts/csdr/jira/update.js +0 -153
  271. package/scripts/migration/eui8-migration.js +0 -94
  272. package/scripts/migration/migrate-utils.js +0 -191
  273. package/scripts/utils/confluence-utils.js +0 -126
@@ -1,283 +1,29 @@
1
1
  'use strict';
2
2
 
3
- // externals
4
- const semver = require('semver');
5
- const path = require('path');
6
- const execa = require('execa');
7
- const fs = require('fs');
8
-
9
- // local
10
- const tools = require('../../utils/tools');
11
- const templateUtils = require('../templates/template-utils');
12
- const configUtils = require('../config/config-utils');
13
-
14
-
15
- // constants
16
- const RELEASE_TYPES = ['major', 'minor', 'patch'];
17
-
18
- const { dryRun, nexusUser, nexusPassword } = tools.getArgs();
19
-
20
-
21
- const getCurrentVersion = (pkg) => {
3
+ // inner modules
4
+ const packageDefault = require('./package-default');
5
+ const packageRemote = require('./package-remote');
6
+ const packageCommon = require('./package-common');
7
+
8
+ // public methods
9
+ module.exports.getNewVersion = (
10
+ pkg,
11
+ commits,
12
+ isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch,
13
+ envTarget
14
+ ) => {
22
15
  return Promise.resolve()
23
16
  .then(() => {
24
- let currentVersion;
25
-
26
- tools.logTitle('Extracting current version');
27
-
28
- if (pkg.backend) {
29
- // if nodejs backend, explicitely declared
30
- if (pkg.build && pkg.build.nodejs) {
31
- tools.logInfo('UI package => extracting from package.json');
32
-
33
- const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
34
- const pkgJson = require(pathPkgJson);
35
- currentVersion = pkgJson.version;
36
-
37
- // by default maven java backend is taken into account
38
- } else {
39
- tools.logInfo('Backend => extracting pom.xml');
40
-
41
- const xmlContent = tools.getXMLJsContent(path.join(pkg.paths.pkgDirectory, 'pom.xml'));
42
- console.log(xmlContent);
43
-
44
- currentVersion = xmlContent.project.version.toString();
45
- }
46
-
17
+ if (pkg.remote && pkg.build && pkg.build.envTargetActive) {
18
+ return packageRemote.getNewVersion(pkg, envTarget);
47
19
  } else {
48
- tools.logInfo('UI package => extracting from package.json');
49
-
50
- const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
51
- const pkgJson = require(pathPkgJson);
52
- currentVersion = pkgJson.version;
53
- }
54
-
55
- tools.logSuccess('Current version found : ' + currentVersion);
56
- return currentVersion;
57
- })
58
- .catch((e) => {
59
- throw e;
60
- })
61
- }
62
-
63
-
64
- const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSupportBranch) => {
65
- return Promise.resolve()
66
- .then(() => {
67
- const pkgJsonFile = path.resolve(folder, 'package.json');
68
- const pkgJson = require(pkgJsonFile);
69
-
70
- let tag = 'latest';
71
-
72
- if (isSnapshot) {
73
- tag = 'snapshot';
74
- }
75
- if (isNextBranch) {
76
- tag = 'next';
77
- }
78
- if (isSupportBranch) {
79
- tag = 'prev';
80
- }
81
-
82
- pkgJson.version = newVersion;
83
- pkgJson.tag = tag;
84
-
85
- tools.logInfo(`Updating package version : ${newVersion} / tag: ${tag} for ${pkgJsonFile}`);
86
- tools.writeJsonFileSync(pkgJsonFile, pkgJson);
87
- })
88
- .catch((e) => {
89
- throw e;
90
- })
91
- }
92
-
93
- const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch) => {
94
- return Promise.resolve()
95
- .then(() => {
96
- tools.logTitle('updating package version');
97
-
98
- if (!pkg.parent) {
99
- return Promise.resolve()
100
- .then(() => {
101
- return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch);
102
- })
103
- .then(() => {
104
- if (!pkg.element && !pkg.config) {
105
- return writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch);
106
- }
107
- })
108
- .catch((e) => {
109
- throw e;
110
- })
111
-
112
- } else {
113
- return Promise.resolve()
114
- .then(() => {
115
- return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch);
116
- })
117
- .then(() => {
118
- let linkedPackages = Object.keys(pkg.packages)
119
- .map(p => {
120
- const pkg = configUtils.packages.getPackage(p);
121
- return pkg;
122
- })
123
-
124
- return tools.removeArrayDuplicates(linkedPackages, 'name');
125
- })
126
-
127
- .then((linkedPackages) => Promise.resolve().then(() => {
128
- return linkedPackages.reduce((promise, pkg) => {
129
- return promise.then(() => (
130
- writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch)
131
- ));
132
- }, Promise.resolve());
133
- }))
134
-
135
- .catch((e) => {
136
- throw e;
137
- })
138
- }
139
- })
140
- .then(() => {
141
- tools.logSuccess();
142
- })
143
- .catch((e) => {
144
- throw e;
145
- })
146
- }
147
-
148
-
149
-
150
- const writePomXml = (pkg, newVersion, isSnapshot, isForceTimestamp = true) => {
151
-
152
- tools.logTitle(`updating project pom.xml version: ${newVersion}`);
153
-
154
- return Promise.resolve()
155
- .then(() => {
156
- return templateUtils.generateMavenSettings(nexusUser, nexusPassword);
157
- })
158
-
159
- .then((mavenSettingsFile) => {
160
-
161
- tools.logInfo(`Executing mvn versions on : ${pkg.paths.pkgDirectory}`);
162
-
163
- execa.shellSync('mvn versions:set -T1 -DnewVersion=' + newVersion + ' -s ' + mavenSettingsFile, { cwd: pkg.paths.pkgDirectory });
164
- execa.shellSync('mvn versions:commit -T1' + ' -s ' + mavenSettingsFile, { cwd: pkg.paths.pkgDirectory });
165
-
166
- if (isForceTimestamp) {
167
- // timestamp file is forced to have at least one file to commit, as snapshot release
168
- // for backend can keep the same version until its latest
169
- const tsversionFile = path.resolve(pkg.paths.pkgDirectory, '.tsversion');
170
- fs.writeFileSync(tsversionFile, Date.now());
171
-
172
- const versionFile = path.resolve(pkg.paths.pkgDirectory, '.version.properties');
173
- fs.writeFileSync(versionFile, newVersion);
20
+ return packageDefault.getNewVersion(pkg, commits, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
174
21
  }
175
22
  })
176
- .then(() => {
177
- tools.logSuccess();
178
- })
179
- .catch((e) => {
180
- throw e;
181
- })
182
- }
183
-
184
23
 
185
-
186
-
187
-
188
- // PUBLIC METHODS
189
-
190
- module.exports.getNewVersion = (pkg, commits, isSnapshot, isNextBranch, isSupportBranch) => {
191
- return Promise.resolve()
192
- .then(() => {
193
- return getCurrentVersion(pkg);
194
- })
195
-
196
- .then((currentVersion) => {
197
- tools.logTitle('Extracting recommended version');
198
-
199
- tools.logInfo(`Current version found : ${currentVersion}`);
200
-
201
- let newVersion = '1.0.0';
202
-
203
- if (commits) {
204
-
205
- tools.logInfo('Commits found for processing version, extracting...');
206
-
207
- let level = 2;
208
- let breakings = 0;
209
- let features = 0;
210
-
211
- commits.forEach((commit) => {
212
- if (commit.breakingChange) {
213
- breakings += commit.body;
214
- level = 0;
215
- } else if (commit.type === 'feat') {
216
- features += 1;
217
- if (level === 2) {
218
- level = 1;
219
- }
220
- }
221
- });
222
-
223
- const release = {
224
- level: level,
225
- reason: 'There are ' + breakings + ' BREAKING CHANGES and ' + features + ' features',
226
- releaseType: RELEASE_TYPES[level]
227
- };
228
-
229
- tools.logInfo('release info found : ' + JSON.stringify(release));
230
-
231
- if (isNextBranch) {
232
- newVersion = semver.inc(currentVersion, 'prerelease');
233
- } else {
234
- newVersion = semver.valid(release.releaseType) || semver.inc(currentVersion, release.releaseType)
235
- }
236
-
237
-
238
- } else {
239
- tools.logInfo('No commits found for version processing...applying minor version upgrade');
240
-
241
- if (isNextBranch) {
242
- newVersion = semver.inc(currentVersion, 'prerelease');
243
- } else {
244
- newVersion = semver.inc(currentVersion, 'minor');
245
- }
246
- }
247
-
248
- tools.logInfo('probable new version : ' + newVersion);
249
-
250
- if (isSnapshot) {
251
- if (pkg.backend) {
252
- if (pkg.build && pkg.build.nodejs) {
253
- newVersion += '-snapshot-' + Date.now();
254
- } else {
255
- newVersion += '-SNAPSHOT';
256
- }
257
- } else {
258
- newVersion += '-snapshot-' + Date.now();
259
- }
260
- }
261
-
262
- if (isSupportBranch && pkg.backend) {
263
- newVersion = semver.inc(currentVersion, 'prerelease');
264
- }
265
-
266
- tools.logSuccess('new version generated : ' + newVersion);
267
-
268
- return newVersion;
269
- })
270
24
  .catch((e) => {
271
25
  throw e;
272
26
  })
273
27
  }
274
28
 
275
-
276
- module.exports.updateVersion = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch) => {
277
- if (pkg.backend) {
278
- return writePomXml(pkg, newVersion, isSnapshot);
279
- }
280
- else {
281
- return writePackageJson(pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch);
282
- }
283
- }
29
+ module.exports.updateVersion = packageCommon.updateVersion;
@@ -1,16 +1,21 @@
1
1
  'use strict';
2
2
 
3
- // externals
4
- const moment = require('moment');
5
-
6
- // local
7
- const tools = require('../../utils/tools');
8
-
9
3
  // inner modules
10
4
  const innerApp = require('./app');
5
+ const innerAppCommon = require('./app-common');
6
+ const innerAppDefault = require('./app-default');
7
+ const innerAppEnvTarget = require('./app-env-target');
11
8
  const innerPackage = require('./package');
9
+ const innerPackageCommon = require('./package-common');
10
+ const innerPackageRemote = require('./package-remote');
11
+ const innerPackageDefault = require('./package-default');
12
12
 
13
13
  // re-exports inner modules
14
14
  module.exports.app = innerApp;
15
+ module.exports.appCommon = innerAppCommon;
16
+ module.exports.appDefault = innerAppDefault;
17
+ module.exports.appEnvTarget = innerAppEnvTarget;
15
18
  module.exports.package = innerPackage;
16
-
19
+ module.exports.packageCommon = innerPackageCommon;
20
+ module.exports.packageRemote = innerPackageRemote;
21
+ module.exports.packageDefault = innerPackageDefault;
@@ -0,0 +1,126 @@
1
+ 'use strict';
2
+
3
+ // LOCALS
4
+ const tools = require('./tools');
5
+ const configUtils = require('../csdr/config/config-utils');
6
+
7
+ // FETCH OPTIONS
8
+ const { API_HOST } = configUtils.global.getConfigOptions();
9
+
10
+ // FETCH ARGS
11
+ const { apiUserId, apiPassword } = tools.getArgs();
12
+
13
+ // PRIVATES
14
+ let authToken;
15
+
16
+
17
+ const handleResponse = (response) => {
18
+ tools.logDebug(JSON.stringify(response));
19
+
20
+ if (response.ok) {
21
+ return response.data;
22
+ } else {
23
+ throw new Error(response.message);
24
+ }
25
+ }
26
+
27
+ module.exports.login = () => {
28
+ const fetch = require('node-fetch');
29
+
30
+ tools.logInfo(`API Login - userId:${apiUserId}`);
31
+
32
+ return Promise.resolve()
33
+ .then(() => {
34
+ return fetch(`${API_HOST}/auth`, {
35
+ method: 'post',
36
+ headers: { 'content-type': 'application/json' },
37
+ body: JSON.stringify({
38
+ "userid": apiUserId,
39
+ "password": apiPassword
40
+ })
41
+ })
42
+ })
43
+ .then((res) => {
44
+ tools.logDebugResponse(res);
45
+ return res.json();
46
+ })
47
+ .then((response) => {
48
+ authToken = response.token;
49
+ return handleResponse(response);
50
+ })
51
+ .catch(e => {
52
+ tools.logDebugTrace(__filename, 'login', e);
53
+ throw e;
54
+ });
55
+ }
56
+
57
+
58
+ module.exports.get = (pathName) => {
59
+ const fetch = require('node-fetch');
60
+
61
+ tools.logInfo(`API get - pathName: ${pathName}`);
62
+
63
+ return Promise.resolve()
64
+ .then(() => {
65
+ if (!authToken) {
66
+ return this.login();
67
+ }
68
+ })
69
+ .then(() => {
70
+ return fetch(`${API_HOST}${pathName}`, {
71
+ method: 'get',
72
+ headers: {
73
+ 'content-type': 'application/json',
74
+ 'x-auth-token': authToken
75
+ },
76
+ })
77
+ })
78
+ .then((res) => {
79
+ tools.logDebugResponse(res);
80
+ return res.json();
81
+ })
82
+ .then((response) => {
83
+ return handleResponse(response);
84
+ })
85
+ .catch(e => {
86
+ tools.logDebugTrace(__filename, 'get', e);
87
+ throw e;
88
+ });
89
+ }
90
+
91
+
92
+ module.exports.post = (pathName, body) => {
93
+ const fetch = require('node-fetch');
94
+
95
+ tools.logInfo(`API post - pathName: ${pathName} - body: ${JSON.stringify(body)}`);
96
+
97
+ return Promise.resolve()
98
+ .then(() => {
99
+ if (!authToken) {
100
+ return this.login();
101
+ }
102
+ })
103
+ .then(() => {
104
+ return fetch(`${API_HOST}${pathName}`, {
105
+ method: 'post',
106
+ headers: {
107
+ 'content-type': 'application/json',
108
+ 'x-auth-token': authToken
109
+ },
110
+ body: JSON.stringify(body)
111
+ })
112
+ })
113
+ .then((res) => {
114
+ tools.logDebugResponse(res);
115
+ return res.json();
116
+ })
117
+ .then((response) => {
118
+ return handleResponse(response);
119
+ })
120
+ .catch(e => {
121
+ tools.logDebugTrace(__filename, 'post', e);
122
+ throw e;
123
+ });
124
+ }
125
+
126
+
@@ -13,7 +13,7 @@ const preBuildUtils = require('../../pre-build/pre-build-utils');
13
13
  let {
14
14
  skipLint, skipTest, skipCompile, configuration, baseHref,
15
15
  watch, dryRun, maxSpaceSize, statsJson, extraWebpackConfig, ci,
16
- deployUrl, sourceMap
16
+ deployUrl, sourceMap, configEnvTarget
17
17
  } = tools.getArgs();
18
18
 
19
19
 
@@ -33,12 +33,18 @@ const getProjectInfos = () => {
33
33
 
34
34
 
35
35
 
36
- module.exports.angular = (envTarget, isSnapshot, version) => {
36
+ module.exports.angular = (envTarget, isSnapshot, version, configEnvTargetIn) => {
37
37
 
38
38
  const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
39
39
 
40
40
  const currentProject = getProjectInfos();
41
41
 
42
+ // checking if configEnvTarget is passed as param, if not take the global script param
43
+ // as this angular build method can be called in stand-alone (outside of CSDR pipeline flow)
44
+ if (configEnvTargetIn) {
45
+ configEnvTarget = configEnvTargetIn;
46
+ }
47
+
42
48
  // getting param from project config
43
49
  if (currentProject.build) {
44
50
  if (currentProject.build.skipLint) {
@@ -66,7 +72,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
66
72
  })
67
73
 
68
74
  .then(() => {
69
- return preBuildUtils.projects.preBuild(currentProject, envTarget, true);
75
+ return preBuildUtils.projects.preBuild(currentProject, envTarget, true, configEnvTarget);
70
76
  })
71
77
 
72
78
  .then(() => {
@@ -88,10 +94,6 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
88
94
  if (!skipLint) {
89
95
  tools.logSuccess();
90
96
  }
91
- if (!skipLint) {
92
- tools.logInfo(`Styles Linting application...`);
93
- return tools.runScript(`stylelint **/*.scss`, currentProject.paths.angularPath);
94
- }
95
97
  })
96
98
 
97
99
 
@@ -120,7 +122,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
120
122
 
121
123
  tools.logInfo(`ng test : watching = ${watch || false}`);
122
124
 
123
- console.log(`running Angular TEST with args: ${args} on`);
125
+ tools.logInfo(`running Angular TEST with args: ${args} on :`);
124
126
  console.log(currentProject.paths.angularPath);
125
127
 
126
128
  if (!dryRun) {
@@ -204,7 +206,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
204
206
 
205
207
  tools.logInfo(`ng build for configuration : ${configuration || 'production'}`);
206
208
 
207
- console.log(`running Angular BUILD with args: ${args} on`);
209
+ tools.logInfo(`running Angular BUILD with args: ${args} on :`);
208
210
  console.log(currentProject.paths.angularPath);
209
211
 
210
212
  if (!dryRun && !skipCompile) {
@@ -14,19 +14,6 @@ const configUtils = require('../../../csdr/config/config-utils');
14
14
  let { deps, skipClean, skipLint, skipTest, skipCompile, skipDoc } = tools.getArgs();
15
15
 
16
16
 
17
-
18
- const preChecks = (pkg) => {
19
- return Promise.resolve()
20
- .then(() => {
21
- return configUtils.angular.generateTsConfigLibProd(pkg);
22
- })
23
-
24
- .catch((e) => {
25
- throw e;
26
- })
27
- }
28
-
29
-
30
17
  module.exports.build = (pkg, isMaster) => {
31
18
 
32
19
  tools.logInfo('Building UI Angular package...');
@@ -43,11 +30,6 @@ module.exports.build = (pkg, isMaster) => {
43
30
  }
44
31
 
45
32
  return Promise.resolve()
46
- // disabled only used for injecting tsconfig.lib.prod for disable ivy using '--prod' flag if necessary in later version of angular / node
47
- // .then(() => {
48
- // tools.logInfo('Executing pre-checks');
49
- // return preChecks(pkg);
50
- // })
51
33
  .then(() => {
52
34
  if (deps === true) {
53
35
  tools.logInfo('Building dependencies...');
@@ -63,13 +45,7 @@ module.exports.build = (pkg, isMaster) => {
63
45
  .then(() => {
64
46
  if (!skipLint) {
65
47
  tools.logInfo('Linting...');
66
-
67
- let tsLintPath;
68
- if (pkg.build && pkg.build.euiVersion && pkg.build.euiVersion === '9.x') {
69
- tsLintPath = path.join(pkg.paths.pkgRootDirectory, 'tslint-eui9.json');
70
- } else {
71
- tsLintPath = path.join(pkg.paths.pkgRootDirectory, 'tslint.json');
72
- }
48
+ const tsLintPath = path.join(pkg.paths.pkgRootDirectory, 'tslint.json');
73
49
  const tsConfigPath = path.join(pkg.paths.pkgRootDirectory, 'tsconfig.lib.json');
74
50
  tools.logInfo(`running tslint -c ${tsLintPath} -p ${tsConfigPath}`);
75
51
  return tools.runScript(`tslint -c ${tsLintPath} -p ${tsConfigPath} -t verbose`);
@@ -82,11 +58,8 @@ module.exports.build = (pkg, isMaster) => {
82
58
  if (!skipTest) {
83
59
  tools.logInfo('Testing...');
84
60
  let args = ['--max_old_space_size=8096', ng, 'test', pkg.name];
85
-
86
61
  args.push('--code-coverage');
87
-
88
62
  tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
89
-
90
63
  return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
91
64
  }
92
65
  })
@@ -96,11 +69,9 @@ module.exports.build = (pkg, isMaster) => {
96
69
  }
97
70
  if (!skipCompile) {
98
71
  tools.logInfo('Bundling package...');
99
-
100
72
  let args = ['--max_old_space_size=8096', ng, 'build', pkg.name];
101
73
 
102
74
  tools.logInfo(`running ng build : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
103
-
104
75
  return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
105
76
  }
106
77
  })
@@ -132,14 +103,17 @@ module.exports.build = (pkg, isMaster) => {
132
103
  if (!skipCompile) {
133
104
  tools.logInfo('Copying assets...');
134
105
  tools.copydir(path.join(pkg.paths.pkgRootDirectory, 'assets'), path.join(pkg.paths.pkgRootDirectory, 'dist', 'assets'));
106
+
135
107
  tools.logInfo('Copying config...');
136
108
  tools.copydir(path.join(pkg.paths.pkgRootDirectory, 'config'), path.join(pkg.paths.pkgRootDirectory, 'dist', 'config'));
109
+
137
110
  tools.logInfo('Copying license...');
138
111
  if (pkg.child) {
139
112
  tools.copy(path.join(pkg.paths.pkgRootDirectory, '..', '..', 'LICENSE'), path.join(pkg.paths.pkgRootDirectory, 'dist', 'LICENSE'));
140
113
  } else {
141
114
  tools.copy(path.join(pkg.paths.pkgRootDirectory, 'LICENSE'), path.join(pkg.paths.pkgRootDirectory, 'dist', 'LICENSE'));
142
115
  }
116
+
143
117
  tools.logInfo('Copying readme.md...');
144
118
  if (pkg.child) {
145
119
  tools.copy(path.join(pkg.paths.pkgRootDirectory, '..', '..', 'README.md'), path.join(pkg.paths.pkgRootDirectory, 'dist', 'README.md'));
@@ -3,11 +3,11 @@
3
3
  // GLOBAL
4
4
  const path = require('path');
5
5
  const glob = require('glob');
6
+ const execa = require('execa');
6
7
 
7
8
  // LOCAL
8
9
  const tools = require('../../tools');
9
10
  const configUtils = require('../../../csdr/config/config-utils');
10
- const notificationUtils = require('../../notification/notification-utils');
11
11
 
12
12
  // INNER MODULES
13
13
  const innerNodeJs = require('./nodeJs');
@@ -188,3 +188,52 @@ module.exports.postBuild = (pkg) => {
188
188
  })
189
189
  }
190
190
 
191
+
192
+ module.exports.buildSubEntry = (pkg, subEntry) => {
193
+ return Promise.resolve()
194
+ .then(() => {
195
+ tools.logInfo(`Building sub-entry : ${subEntry} of package : ${pkg.name}`);
196
+ // console.log(pkg);
197
+ return tools.getFilesGlob(pkg.paths.pkgRootDirectory, `**/package.json`);
198
+ })
199
+
200
+ .then((files) => {
201
+ // console.log(files);
202
+
203
+ if (files.length === 0) {
204
+ tools.logWarning(`no sub-entries found within package ${pkg.name}`);
205
+ return;
206
+
207
+ } else {
208
+ let subEntryPath = files.filter((f) => {
209
+ return f.indexOf(subEntry) > -1;
210
+ })[0];
211
+
212
+ if (!subEntryPath) {
213
+ tools.logWarning(`${subEntry} can't be found in sub-folders of package (must contains package.json file for sub-entry definition)`);
214
+ return;
215
+
216
+ } else {
217
+ subEntryPath = subEntryPath.replace('/ng-package.json', '');
218
+ tools.logInfo(`${subEntryPath} found... injecting angular.json for sub entry`);
219
+
220
+ return configUtils.angular.registerAngularPackageSubEntry(subEntry, subEntryPath);
221
+ };
222
+ }
223
+ })
224
+
225
+ .then(() => {
226
+ const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
227
+
228
+ let args = ['--max_old_space_size=8096', ng, 'build', subEntry];
229
+
230
+ return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
231
+ })
232
+
233
+ .then(() => {
234
+ tools.logSuccess();
235
+ })
236
+ .catch((e) => {
237
+ throw e;
238
+ })
239
+ }