@pega/dx-component-builder-sdk 0.1.47 → 0.1.49

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 (268) hide show
  1. package/package.json +3 -2
  2. package/src/auth.js +726 -508
  3. package/src/cli.js +1 -1
  4. package/src/constants.js +728 -2
  5. package/src/tasks/authenticate/index.js +12 -2
  6. package/src/tasks/build/helper.js +10 -6
  7. package/src/tasks/build/index.js +76 -22
  8. package/src/tasks/build-all/helper.js +16 -11
  9. package/src/tasks/build-all/index.js +106 -42
  10. package/src/tasks/bundle/{builder → builderAngular}/paths.js +3 -2
  11. package/src/tasks/bundle/builderAngular/webpack.config.js +342 -0
  12. package/src/tasks/bundle/builderAssociated/index.js +218 -0
  13. package/src/tasks/bundle/builderAssociated/modules.js +139 -0
  14. package/src/tasks/bundle/builderAssociated/paths.js +51 -0
  15. package/src/tasks/bundle/{builder → builderAssociated}/webpack.config.js +5 -4
  16. package/src/tasks/bundle/builderReact/index.js +218 -0
  17. package/src/tasks/bundle/builderReact/modules.js +139 -0
  18. package/src/tasks/bundle/builderReact/paths.js +51 -0
  19. package/src/tasks/bundle/builderReact/webpack.config.js +337 -0
  20. package/src/tasks/bundle/index.js +122 -5
  21. package/src/tasks/create/index.js +54 -12
  22. package/src/tasks/create/templates/Constellation/field/Boolean/styles.js.mustache +13 -6
  23. package/src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache +7 -7
  24. package/src/tasks/create/templates/Constellation/field/Date/date.js.mustache +8 -8
  25. package/src/tasks/create/templates/Constellation/field/Date/styles.js.mustache +13 -6
  26. package/src/tasks/create/templates/Constellation/field/DateTime/date-time.js.mustache +10 -10
  27. package/src/tasks/create/templates/Constellation/field/DateTime/date-utils.js.mustache +6 -5
  28. package/src/tasks/create/templates/Constellation/field/DateTime/date.js.mustache +6 -3
  29. package/src/tasks/create/templates/Constellation/field/DateTime/styles.js.mustache +13 -6
  30. package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +2 -2
  31. package/src/tasks/create/templates/Constellation/field/Decimal/styles.js.mustache +13 -6
  32. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +2 -2
  33. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.js.mustache +13 -6
  34. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +4 -4
  35. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.js.mustache +13 -6
  36. package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +2 -2
  37. package/src/tasks/create/templates/Constellation/field/Integer/styles.js.mustache +13 -6
  38. package/src/tasks/create/templates/Constellation/field/Picklist/styles.js.mustache +13 -6
  39. package/src/tasks/create/templates/Constellation/field/Text/styles.js.mustache +13 -6
  40. package/src/tasks/create/templates/Constellation/field/Text-Email/styles.js.mustache +13 -6
  41. package/src/tasks/create/templates/Constellation/field/Text-Input/styles.js.mustache +13 -6
  42. package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.js.mustache +13 -6
  43. package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +0 -1
  44. package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.js.mustache +13 -6
  45. package/src/tasks/create/templates/Constellation/field/Text-URL/styles.js.mustache +13 -6
  46. package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.js.mustache +14 -0
  47. package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/time-of-day.js.mustache +6 -5
  48. package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.jsx.mustache +20 -6
  49. package/src/tasks/create/templates/Constellation/template/DETAILS/index.jsx.mustache +2 -2
  50. package/src/tasks/create/templates/Constellation/template/DETAILS/mock.stories.js.mustache +20 -10
  51. package/src/tasks/create/templates/Constellation/template/DETAILS/styles.js.mustache +13 -6
  52. package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.jsx.mustache +20 -7
  53. package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.jsx.mustache +2 -2
  54. package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.stories.js.mustache +28 -13
  55. package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.js.mustache +13 -6
  56. package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.jsx.mustache +92 -16
  57. package/src/tasks/create/templates/Constellation/template/FORM/index.jsx.mustache +2 -2
  58. package/src/tasks/create/templates/Constellation/template/FORM/mock.stories.js.mustache +24 -12
  59. package/src/tasks/create/templates/Constellation/template/FORM/styles.js.mustache +13 -6
  60. package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.jsx.mustache +91 -13
  61. package/src/tasks/create/templates/Constellation/template/FORM-region/index.jsx.mustache +2 -2
  62. package/src/tasks/create/templates/Constellation/template/FORM-region/mock.stories.js.mustache +24 -12
  63. package/src/tasks/create/templates/Constellation/template/FORM-region/styles.js.mustache +13 -6
  64. package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.jsx.mustache +1 -0
  65. package/src/tasks/create/templates/Constellation/template/PAGE/styles.js.mustache +13 -6
  66. package/src/tasks/create/templates/Constellation/widget/CASE/index.jsx.mustache +2 -2
  67. package/src/tasks/create/templates/Constellation/widget/CASE/styles.js.mustache +13 -6
  68. package/src/tasks/create/templates/Constellation/widget/PAGE/styles.js.mustache +13 -6
  69. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.jsx.mustache +2 -2
  70. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.jsx.mustache +2 -2
  71. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.js.mustache +13 -6
  72. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +42 -0
  73. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.scss.mustache +24 -0
  74. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.spec.ts.mustache +25 -0
  75. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +165 -0
  76. package/src/tasks/create/templates/SDK-Angular/field/Boolean/config.json.mustache +87 -0
  77. package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.jsx.mustache +56 -0
  78. package/src/tasks/create/templates/SDK-Angular/field/Boolean/mock.stories.js.mustache +15 -0
  79. package/src/tasks/create/templates/SDK-Angular/field/Date/config.json.mustache +147 -0
  80. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +35 -0
  81. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.scss.mustache +20 -0
  82. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +25 -0
  83. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +209 -0
  84. package/src/tasks/create/templates/SDK-Angular/field/DateTime/config.json.mustache +204 -0
  85. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +31 -0
  86. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache +20 -0
  87. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache +25 -0
  88. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +177 -0
  89. package/src/tasks/create/templates/SDK-Angular/field/Decimal/config.json.mustache +94 -0
  90. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +32 -0
  91. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.scss.mustache +20 -0
  92. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +25 -0
  93. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +170 -0
  94. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/config.json.mustache +125 -0
  95. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +33 -0
  96. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.scss.mustache +20 -0
  97. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.spec.ts.mustache +25 -0
  98. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +175 -0
  99. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/config.json.mustache +94 -0
  100. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +33 -0
  101. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.scss.mustache +20 -0
  102. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +25 -0
  103. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +176 -0
  104. package/src/tasks/create/templates/SDK-Angular/field/Integer/config.json.mustache +88 -0
  105. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.html.mustache +33 -0
  106. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.scss.mustache +20 -0
  107. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.spec.ts.mustache +25 -0
  108. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +180 -0
  109. package/src/tasks/create/templates/SDK-Angular/field/Picklist/config.json.mustache +86 -0
  110. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.html.mustache +30 -0
  111. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.scss.mustache +25 -0
  112. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.spec.ts.mustache +25 -0
  113. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +195 -0
  114. package/src/tasks/create/templates/SDK-Angular/field/Text/config.json.mustache +83 -0
  115. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.html.mustache +17 -0
  116. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.scss.mustache +30 -0
  117. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.spec.ts.mustache +25 -0
  118. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +145 -0
  119. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/config.json.mustache +83 -0
  120. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.html.mustache +31 -0
  121. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.scss.mustache +20 -0
  122. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.spec.ts.mustache +25 -0
  123. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +175 -0
  124. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/config.json.mustache +83 -0
  125. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.html.mustache +31 -0
  126. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.scss.mustache +20 -0
  127. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.spec.ts.mustache +25 -0
  128. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +177 -0
  129. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/config.json.mustache +83 -0
  130. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.html.mustache +31 -0
  131. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.scss.mustache +20 -0
  132. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.spec.ts.mustache +25 -0
  133. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +179 -0
  134. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/config.json.mustache +95 -0
  135. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.html.mustache +30 -0
  136. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.scss.mustache +81 -0
  137. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.spec.ts.mustache +25 -0
  138. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +194 -0
  139. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/config.json.mustache +111 -0
  140. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +30 -0
  141. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.scss.mustache +20 -0
  142. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.spec.ts.mustache +26 -0
  143. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +174 -0
  144. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +30 -0
  145. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.scss.mustache +20 -0
  146. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.spec.ts.mustache +25 -0
  147. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +172 -0
  148. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/DefaultForm.svg +29 -0
  149. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/config.json.mustache +21 -0
  150. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.jsx.mustache +71 -0
  151. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.html.mustache +7 -0
  152. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.scss.mustache +7 -0
  153. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.spec.ts.mustache +25 -0
  154. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +121 -0
  155. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/mock.stories.js.mustache +294 -0
  156. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/TwoColumnDetails.svg +28 -0
  157. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/config.json.mustache +27 -0
  158. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.jsx.mustache +73 -0
  159. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.html.mustache +6 -0
  160. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.scss.mustache +7 -0
  161. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.spec.ts.mustache +25 -0
  162. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +92 -0
  163. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/mock.stories.js.mustache +290 -0
  164. package/src/tasks/create/templates/SDK-Angular/template/FORM/DefaultForm.svg +29 -0
  165. package/src/tasks/create/templates/SDK-Angular/template/FORM/config.json.mustache +45 -0
  166. package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.jsx.mustache +215 -0
  167. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.html.mustache +23 -0
  168. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +33 -0
  169. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.spec.ts.mustache +25 -0
  170. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +71 -0
  171. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/TwoColumn.svg +38 -0
  172. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/config.json.mustache +49 -0
  173. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.jsx.mustache +183 -0
  174. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.html.mustache +16 -0
  175. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +28 -0
  176. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.spec.ts.mustache +25 -0
  177. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +26 -0
  178. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.stories.js.mustache +132 -0
  179. package/src/tasks/create/templates/SDK-Angular/template/PAGE/OneColumnPage.svg +28 -0
  180. package/src/tasks/create/templates/SDK-Angular/template/PAGE/config.json.mustache +32 -0
  181. package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.jsx.mustache +80 -0
  182. package/src/tasks/create/templates/SDK-Angular/template/PAGE/mock.stories.js.mustache +115 -0
  183. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.html.mustache +15 -0
  184. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.scss.mustache +3 -0
  185. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.spec.ts.mustache +25 -0
  186. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +63 -0
  187. package/src/tasks/create/templates/SDK-Angular/widget/CASE/OneColumnPage.svg +36 -0
  188. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.html.mustache +15 -0
  189. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.scss.mustache +22 -0
  190. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.spec.ts.mustache +25 -0
  191. package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +111 -0
  192. package/src/tasks/create/templates/SDK-Angular/widget/CASE/config.json.mustache +23 -0
  193. package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.jsx.mustache +70 -0
  194. package/src/tasks/create/templates/SDK-Angular/widget/CASE/mock.stories.js.mustache +390 -0
  195. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/OneColumnPage.svg +36 -0
  196. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/config.json.mustache +59 -0
  197. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.jsx.mustache +29 -0
  198. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.stories.js.mustache +23 -0
  199. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +17 -0
  200. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.scss.mustache +19 -0
  201. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +32 -0
  202. package/src/tasks/create/templates/SDK-Angular/widget/PAGE/pagecomponent.spec.ts.mustache +25 -0
  203. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/OneColumnPage.svg +36 -0
  204. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/config.json.mustache +66 -0
  205. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.jsx.mustache +52 -0
  206. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/mock.stories.js.mustache +52 -0
  207. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.html.mustache +28 -0
  208. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.scss.mustache +137 -0
  209. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.spec.ts.mustache +25 -0
  210. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +115 -0
  211. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -3
  212. package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
  213. package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -7
  214. package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +5 -1
  215. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +78 -28
  216. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -3
  217. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +2 -2
  218. package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -2
  219. package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.jsx.mustache +13 -0
  220. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +30 -10
  221. package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -2
  222. package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +2 -2
  223. package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -2
  224. package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -2
  225. package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +6 -5
  226. package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +11 -0
  227. package/src/tasks/create/templates/SDK-React/field/TimeOfDay/config.json.mustache +135 -0
  228. package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/index.tsx.mustache +12 -1
  229. package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -3
  230. package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +8 -4
  231. package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +30 -20
  232. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +2 -2
  233. package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.jsx.mustache +1 -0
  234. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +4 -3
  235. package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +7 -7
  236. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +2 -10
  237. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +138 -36
  238. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.stories.js.mustache +1 -1
  239. package/src/tasks/create-all/index.js +112 -56
  240. package/src/tasks/delete/helper.js +88 -24
  241. package/src/tasks/delete/index.js +17 -8
  242. package/src/tasks/delete-all/helper.js +88 -25
  243. package/src/tasks/delete-all/index.js +15 -6
  244. package/src/tasks/list/helper.js +2 -3
  245. package/src/tasks/list/index.js +14 -7
  246. package/src/tasks/map/map.js +212 -20
  247. package/src/tasks/map-all/index.js +19 -2
  248. package/src/tasks/override/index.js +140 -79
  249. package/src/tasks/override-all/index.js +54 -6
  250. package/src/tasks/publish/helper.js +94 -51
  251. package/src/tasks/publish/index.js +87 -34
  252. package/src/tasks/publish-all/helper.js +97 -58
  253. package/src/tasks/publish-all/index.js +127 -48
  254. package/src/tasks/rename/index.js +184 -111
  255. package/src/tasks/validator/index.js +31 -7
  256. package/src/util.js +187 -39
  257. package/src/tasks/create/templates/Constellation/field/TimeofDay/styles.js.mustache +0 -7
  258. /package/src/tasks/bundle/{builder → builderAngular}/index.js +0 -0
  259. /package/src/tasks/bundle/{builder → builderAngular}/modules.js +0 -0
  260. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache +0 -0
  261. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
  262. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache +0 -0
  263. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
  264. /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/suggestions-handler.js +0 -0
  265. /package/src/tasks/create/templates/{SDK-React/field/TimeofDay → SDK-Angular/field/TimeOfDay}/config.json.mustache +0 -0
  266. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
  267. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
  268. /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache +0 -0
@@ -0,0 +1,337 @@
1
+ import { createRequire } from 'module';
2
+
3
+ import webpack from 'webpack';
4
+ import TerserPlugin from 'terser-webpack-plugin';
5
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
6
+ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
7
+ import getCSSModuleLocalIdent from 'react-dev-utils/getCSSModuleLocalIdent.js';
8
+ import ModuleNotFoundPlugin from 'react-dev-utils/ModuleNotFoundPlugin.js';
9
+ import CompressionPlugin from 'compression-webpack-plugin';
10
+
11
+ import paths from './paths.js';
12
+
13
+ const require = createRequire(import.meta.url);
14
+
15
+ // const appPackageJson = require(paths.appPackageJson);
16
+
17
+ // Source maps are resource heavy and can cause out of memory issue for large source files.
18
+
19
+ const compressionBRConfObj = {
20
+ filename: '[path][base].br',
21
+ algorithm: 'brotliCompress',
22
+ test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
23
+ compressionOptions: { level: 11 }
24
+ };
25
+
26
+ /* For gzip use below */
27
+ const compressionGZConfObj = {
28
+ filename: '[path][base].gz',
29
+ algorithm: 'gzip',
30
+ test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
31
+ compressionOptions: { level: 9 }
32
+ };
33
+
34
+ let shouldUseSourceMap = process.env.SOURCE_MAP;
35
+
36
+ const imageInlineSizeLimit = Number.parseInt(process.env.IMAGE_INLINE_SIZE_LIMIT || '10000', 10);
37
+
38
+ // style files regex
39
+ const cssRegex = /\.css$/;
40
+ const cssModuleRegex = /\.module\.css$/;
41
+ const sassRegex = /\.(scss|sass)$/;
42
+ const sassModuleRegex = /\.module\.(scss|sass)$/;
43
+
44
+ // This is the production and development configuration.
45
+ // It is focused on developer experience, fast rebuilds, and a minimal bundle.
46
+ export default (
47
+ webpackEnv,
48
+ // eslint-disable-next-line no-unused-vars
49
+ { inputFile, outputFile, componentKey, externals, globals, sourceMap, devBuild }
50
+ ) => {
51
+ const isEnvDevelopment = webpackEnv === 'development' || devBuild;
52
+ const isEnvProduction = webpackEnv === 'production';
53
+ sourceMap = sourceMap === 'true';
54
+ shouldUseSourceMap = shouldUseSourceMap || sourceMap;
55
+
56
+ // common function to get style loaders
57
+ const getStyleLoaders = (cssOptions, preProcessor) => {
58
+ const loaders = [
59
+ isEnvProduction && {
60
+ loader: MiniCssExtractPlugin.loader
61
+ },
62
+ {
63
+ loader: require.resolve('css-loader'),
64
+ options: cssOptions
65
+ },
66
+ {
67
+ // Options for PostCSS as we reference these options twice
68
+ // Adds vendor prefixing based on your specified browser support in
69
+ // package.json
70
+ loader: require.resolve('postcss-loader'),
71
+ options: {
72
+ postcssOptions: {
73
+ plugins: [
74
+ [
75
+ 'postcss-preset-env',
76
+ {
77
+ // Options
78
+ }
79
+ ]
80
+ ]
81
+ },
82
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
83
+ }
84
+ }
85
+ ].filter(Boolean);
86
+ if (preProcessor) {
87
+ loaders.push(
88
+ {
89
+ loader: require.resolve('resolve-url-loader'),
90
+ options: {
91
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
92
+ root: paths.appSrc
93
+ }
94
+ },
95
+ {
96
+ loader: require.resolve(preProcessor),
97
+ options: {
98
+ sourceMap: true
99
+ }
100
+ }
101
+ );
102
+ }
103
+ return loaders;
104
+ };
105
+ return {
106
+ mode: devBuild ? 'development' : 'production',
107
+ // Stop compilation early in production
108
+ bail: isEnvProduction,
109
+ // These are the "entry points" to our application.
110
+ // This means they will be the "root" imports that are included in JS bundle.
111
+ entry: inputFile,
112
+ devtool: devBuild ? 'eval-cheap-module-source-map' : false,
113
+ output: {
114
+ // The build folder.
115
+ path: paths.appBuild,
116
+ // There will be one main bundle, and one file per asynchronous chunk.
117
+ // In development, it does not produce real files.
118
+ filename: isEnvProduction
119
+ ? `${componentKey}/${componentKey}.js`
120
+ : isEnvDevelopment && `${componentKey}/${componentKey}.js`,
121
+ chunkFilename: isEnvProduction
122
+ ? `${componentKey}/js/[name].[contenthash:8].chunk.js`
123
+ : isEnvDevelopment && `${componentKey}/js/[name].chunk.js`,
124
+ library: {
125
+ name: componentKey,
126
+ type: 'umd',
127
+ export: 'default'
128
+ },
129
+ publicPath: ''
130
+ },
131
+ optimization: {
132
+ minimize: isEnvProduction,
133
+ minimizer: [new TerserPlugin(), new CssMinimizerPlugin()]
134
+ },
135
+ resolve: {
136
+ plugins: [],
137
+ extensions: ['.tsx', '.ts', '.js']
138
+ },
139
+ resolveLoader: {
140
+ plugins: []
141
+ },
142
+ module: {
143
+ strictExportPresence: true,
144
+ rules: [
145
+ {
146
+ // "oneOf" will traverse all following loaders until one will
147
+ // match the requirements. When no loader matches it will fall
148
+ // back to the "file" loader at the end of the loader list.
149
+ oneOf: [
150
+ // TODO: Merge this config once `image/avif` is in the mime-db
151
+ // https://github.com/jshttp/mime-db
152
+ {
153
+ test: [/\.avif$/],
154
+ loader: require.resolve('url-loader'),
155
+ options: {
156
+ limit: imageInlineSizeLimit,
157
+ mimetype: 'image/avif',
158
+ name: `${componentKey}/media/[name].[hash:8].[ext]`
159
+ }
160
+ },
161
+ // "url" loader works like "file" loader except that it embeds assets
162
+ // smaller than specified limit in bytes as data URLs to avoid requests.
163
+ // A missing `test` is equivalent to a match.
164
+ {
165
+ test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/],
166
+ loader: require.resolve('url-loader'),
167
+ options: {
168
+ limit: imageInlineSizeLimit,
169
+ name: `${componentKey}/media/[name].[hash:8].[ext]`
170
+ }
171
+ },
172
+ // Process application JS with TS-Loader.
173
+ // The preset includes JSX, Flow, TypeScript, and some ESnext features.
174
+ {
175
+ test: /\.(js|mjs|jsx)$/,
176
+ include: paths.appSrc,
177
+ loader: 'ts-loader',
178
+ options: {
179
+ configFile: paths.appTsConfig
180
+ },
181
+ exclude: /node_modules/
182
+ },
183
+
184
+ {
185
+ test: /\.(ts|tsx)$/,
186
+ loader: 'ts-loader',
187
+ options: {
188
+ configFile: paths.appTsConfig
189
+ },
190
+ exclude: /node_modules/
191
+ },
192
+ // "postcss" loader applies autoprefixer to our CSS.
193
+ // "css" loader resolves paths in CSS and adds assets as dependencies.
194
+ // "style" loader turns CSS into JS modules that inject <style> tags.
195
+ // In production, we use MiniCSSExtractPlugin to extract that CSS
196
+ // to a file, but in development "style" loader enables hot editing
197
+ // of CSS.
198
+ // By default we support CSS Modules with the extension .module.css
199
+ {
200
+ test: cssRegex,
201
+ exclude: cssModuleRegex,
202
+ use: getStyleLoaders({
203
+ importLoaders: 1,
204
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
205
+ }),
206
+ // Don't consider CSS imports dead code even if the
207
+ // containing package claims to have no side effects.
208
+ // Remove this when webpack adds a warning or an error for this.
209
+ // See https://github.com/webpack/webpack/issues/6571
210
+ sideEffects: true
211
+ },
212
+ // Adds support for CSS Modules (https://github.com/css-modules/css-modules)
213
+ // using the extension .module.css
214
+ {
215
+ test: cssModuleRegex,
216
+ use: getStyleLoaders({
217
+ importLoaders: 1,
218
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
219
+ modules: {
220
+ getLocalIdent: getCSSModuleLocalIdent
221
+ }
222
+ })
223
+ },
224
+ // Opt-in support for SASS (using .scss or .sass extensions).
225
+ // By default we support SASS Modules with the
226
+ // extensions .module.scss or .module.sass
227
+ {
228
+ test: sassRegex,
229
+ exclude: sassModuleRegex,
230
+ use: getStyleLoaders(
231
+ {
232
+ importLoaders: 3,
233
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
234
+ },
235
+ 'sass-loader'
236
+ ),
237
+ // Don't consider CSS imports dead code even if the
238
+ // containing package claims to have no side effects.
239
+ // Remove this when webpack adds a warning or an error for this.
240
+ // See https://github.com/webpack/webpack/issues/6571
241
+ sideEffects: true
242
+ },
243
+ // Adds support for CSS Modules, but using SASS
244
+ // using the extension .module.scss or .module.sass
245
+ {
246
+ test: sassModuleRegex,
247
+ use: getStyleLoaders(
248
+ {
249
+ importLoaders: 3,
250
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
251
+ modules: {
252
+ getLocalIdent: getCSSModuleLocalIdent
253
+ }
254
+ },
255
+ 'sass-loader'
256
+ )
257
+ },
258
+ // "file" loader makes sure those assets get served by WebpackDevServer.
259
+ // When you `import` an asset, you get its (virtual) filename.
260
+ // In production, they would get copied to the `build` folder.
261
+ // This loader doesn't use a "test" so it will catch all modules
262
+ // that fall through the other loaders.
263
+ {
264
+ loader: require.resolve('file-loader'),
265
+ // Exclude `js` files to keep "css" loader working as it injects
266
+ // its runtime that would otherwise be processed through "file" loader.
267
+ // Also exclude `html` and `json` extensions so they get processed
268
+ // by webpack's internal loaders.
269
+ exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
270
+ options: {
271
+ name: `${componentKey}/media/[name].[hash:8].[ext]`
272
+ }
273
+ }
274
+ // ** STOP ** Are you adding a new loader?
275
+ // Make sure to add the new loader(s) before the "file" loader.
276
+ ]
277
+ }
278
+ ]
279
+ },
280
+ plugins: [
281
+ // This gives some necessary context to module not found errors, such as
282
+ // the requesting resource.
283
+ new ModuleNotFoundPlugin(paths.appPath),
284
+ // Makes some environment variables available to the JS code, for example:
285
+ // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
286
+ // It is absolutely essential that NODE_ENV is set to production
287
+ // during a production build.
288
+ // Otherwise React will be compiled in the very slow development mode.
289
+ isEnvProduction &&
290
+ new webpack.DefinePlugin({
291
+ PRODUCTION: JSON.stringify(true)
292
+ }),
293
+ isEnvProduction &&
294
+ new MiniCssExtractPlugin({
295
+ // Options similar to the same options in webpackOptions.output
296
+ // both options are optional
297
+ filename: `${componentKey}/css/${componentKey}.[contenthash:8].css`,
298
+ chunkFilename: `${componentKey}/css/${componentKey}.[contenthash:8].chunk.css`
299
+ }),
300
+ // Moment.js is an extremely popular library that bundles large locale files
301
+ // by default due to how webpack interprets its code. This is a practical
302
+ // solution that requires the user to opt into importing specific locales.
303
+ // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
304
+ // You can remove this if you don't use Moment.js:
305
+ new webpack.IgnorePlugin({
306
+ resourceRegExp: /^\.\/locale$/,
307
+ contextRegExp: /moment$/
308
+ }),
309
+ /* Ignore cosmos icons */
310
+ new webpack.IgnorePlugin({
311
+ resourceRegExp: /^\.\/icons$/,
312
+ contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
313
+ }),
314
+
315
+ /* Ignore cosmos icons - windows */
316
+ new webpack.IgnorePlugin({
317
+ resourceRegExp: /^\.\/icons$/,
318
+ contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
319
+ }),
320
+
321
+ new webpack.optimize.LimitChunkCountPlugin({
322
+ maxChunks: 1
323
+ }),
324
+ new webpack.optimize.MinChunkSizePlugin({
325
+ minChunkSize: 100000 // Minimum number of characters
326
+ }),
327
+ !devBuild && new CompressionPlugin(compressionBRConfObj)
328
+
329
+ /* Dont generate gzip file */
330
+ /* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
331
+ ].filter(Boolean),
332
+ performance: {
333
+ hints: 'warning'
334
+ },
335
+ externals
336
+ };
337
+ };
@@ -3,13 +3,15 @@ import fs from 'fs';
3
3
  import { stat } from 'fs/promises';
4
4
 
5
5
  import { BUILD_CONFIG_JSON_FILENAME, CATEGORY_CUSTOM } from '../../constants.js';
6
- import { getComponentDirectoryPath } from '../../util.js';
6
+ import { getComponentDirectoryPath, getFramework, removeComponentPrefix } from '../../util.js';
7
7
 
8
- import buildComponent from './builder/index.js';
8
+ import buildReactComponent from './builderReact/index.js';
9
+ import buildAngularComponent from './builderAngular/index.js';
10
+ import buildAssociatedComponent from './builderAssociated/index.js';
9
11
 
10
12
  const extensions = ['ts', 'tsx', 'js', 'jsx'];
11
13
 
12
- const bundleComponent = async (componentKey, sourceMap, devBuild, category = CATEGORY_CUSTOM) => {
14
+ export const bundleAssociatedComponent = async (componentKey, sourceMap, devBuild, category = CATEGORY_CUSTOM) => {
13
15
  const componentDirectory = await getComponentDirectoryPath(componentKey, category);
14
16
 
15
17
  const idx = (
@@ -57,7 +59,7 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, category = CAT
57
59
  };
58
60
 
59
61
  globals = { ...globals, ...defaultGlobals };
60
- await buildComponent({
62
+ await buildAssociatedComponent({
61
63
  inputFile,
62
64
  outputFile,
63
65
  componentKey,
@@ -68,4 +70,119 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, category = CAT
68
70
  });
69
71
  };
70
72
 
71
- export default bundleComponent;
73
+ export const bundleReactComponent = async (componentKey, sourceMap, devBuild, category = CATEGORY_CUSTOM) => {
74
+ const componentDirectory = await getComponentDirectoryPath(componentKey, category);
75
+
76
+ const idx = (
77
+ await Promise.all(
78
+ extensions.map(ext =>
79
+ stat(path.join(componentDirectory, `index.${ext}`))
80
+ .then(() => true)
81
+ .catch(() => false)
82
+ )
83
+ )
84
+ ).findIndex(exists => exists);
85
+
86
+ if (idx === -1) throw new Error('Index file not found.');
87
+
88
+ // remove sub folder, component goes in dist directory without it
89
+ if (componentKey.indexOf("/") >=0) {
90
+ const arKey = componentKey.split("/");
91
+ componentKey = arKey[arKey.length - 1];
92
+ }
93
+
94
+ const inputFile = path.join(componentDirectory, `index.${extensions[idx]}`);
95
+ const outputFile = `${componentKey}.js`;
96
+
97
+ let buildConfig = {};
98
+
99
+ if (fs.existsSync(BUILD_CONFIG_JSON_FILENAME)) {
100
+ buildConfig = JSON.parse(fs.readFileSync(BUILD_CONFIG_JSON_FILENAME, 'utf8'));
101
+ }
102
+
103
+ let externals = buildConfig.externals || [];
104
+ externals = {
105
+ react: 'React',
106
+ 'react-dom': 'ReactDOM',
107
+ PCore: 'PCore',
108
+ ...buildConfig.externals
109
+ };
110
+
111
+ let globals = buildConfig.globals || {};
112
+
113
+ const defaultGlobals = {
114
+ react: 'React',
115
+ 'react-dom': 'ReactDOM',
116
+ PCore: 'PCore',
117
+ ...buildConfig.globals
118
+ };
119
+
120
+ globals = { ...globals, ...defaultGlobals };
121
+ await buildReactComponent({
122
+ inputFile,
123
+ outputFile,
124
+ componentKey,
125
+ externals,
126
+ globals,
127
+ sourceMap,
128
+ devBuild
129
+ });
130
+ };
131
+
132
+ export const bundleAngularComponent = async (componentKey, sourceMap, devBuild, category = CATEGORY_CUSTOM) => {
133
+ const componentDirectory = await getComponentDirectoryPath(componentKey, category);
134
+
135
+ componentKey = removeComponentPrefix(componentKey);
136
+
137
+ const idx = (
138
+ await Promise.all(
139
+ extensions.map(ext =>
140
+ stat(path.join(componentDirectory, `${componentKey}.component.${ext}`))
141
+ .then(() => true)
142
+ .catch(() => false)
143
+ )
144
+ )
145
+ ).findIndex(exists => exists);
146
+
147
+
148
+ if (idx === -1) throw new Error('Index file not found.');
149
+
150
+ // remove sub folder, component goes in dist directory without it
151
+ // if (componentKey.indexOf("/") >=0) {
152
+ // const arKey = componentKey.split("/");
153
+ // componentKey = arKey[arKey.length - 1];
154
+ // }
155
+
156
+ const inputFile = path.join(componentDirectory, `${componentKey}.component.${extensions[idx]}`);
157
+ const outputFile = `${componentKey}.js`;
158
+
159
+ let buildConfig = {};
160
+
161
+ if (fs.existsSync(BUILD_CONFIG_JSON_FILENAME)) {
162
+ buildConfig = JSON.parse(fs.readFileSync(BUILD_CONFIG_JSON_FILENAME, 'utf8'));
163
+ }
164
+
165
+ let externals = buildConfig.externals || [];
166
+ externals = {
167
+ PCore: 'PCore',
168
+ ...buildConfig.externals
169
+ };
170
+
171
+ let globals = buildConfig.globals || {};
172
+
173
+ const defaultGlobals = {
174
+ PCore: 'PCore',
175
+ ...buildConfig.globals
176
+ };
177
+
178
+ globals = { ...globals, ...defaultGlobals };
179
+ await buildAngularComponent({
180
+ inputFile,
181
+ outputFile,
182
+ componentKey,
183
+ externals,
184
+ globals,
185
+ sourceMap,
186
+ devBuild
187
+ });
188
+ };
@@ -8,8 +8,10 @@ import inquirer from 'inquirer';
8
8
  import ncp from 'ncp';
9
9
  import chalk from 'chalk';
10
10
 
11
- import { checkPathAccess, showVersion, getFramework } from '../../util.js';
12
- import { CATEGORY_CONSTELLATION,
11
+ import { checkPathAccess,
12
+ showVersion,
13
+ getFramework} from '../../util.js';
14
+ import { CATEGORY_CONSTELLATION, CATEGORY_CUSTOM,
13
15
  SDK_CONFIG_JSON_FILENAME,
14
16
  DXCB_CONFIG,
15
17
  DXCB_COMPONENT_DEFAULTS,
@@ -25,6 +27,7 @@ const pegaConfigInternalJsonPath = path.join(path.resolve(), DXCB_CONFIG_INTERNA
25
27
 
26
28
  import {
27
29
  convertIntoPascalCase,
30
+ convertIntoKebabCase,
28
31
  compileMustacheTemplate,
29
32
  getComponentDirectoryPath,
30
33
  getPegaConfig,
@@ -110,8 +113,12 @@ export const compileMustacheTemplates = async (
110
113
  allowedApplications = [].concat(allowedApplications);
111
114
  }
112
115
 
116
+ const componentKeyKebab = convertIntoKebabCase(convertIntoPascalCase(componentKey));
117
+ const framework = await getFramework();
118
+
113
119
  allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
114
120
  files.forEach(file => {
121
+
115
122
  const filePath = path.join(componentDirectory, file);
116
123
 
117
124
  const output = compileMustacheTemplate(filePath, {
@@ -119,6 +126,7 @@ export const compileMustacheTemplates = async (
119
126
  COMPONENT_NAME: componentName,
120
127
  COMPONENT_LABEL: componentLabel,
121
128
  COMPONENT_CLASS_NAME: componentClassName,
129
+ COMPONENT_CLASS_NAME_KEBAB: componentKeyKebab,
122
130
  ORGANIZATION: organization,
123
131
  VERSION: version,
124
132
  LIBRARY: library,
@@ -132,7 +140,24 @@ export const compileMustacheTemplates = async (
132
140
  IS_PHONE: isPhone
133
141
  });
134
142
  fs.writeFileSync(filePath, output);
135
- fs.renameSync(filePath, filePath.replace('.mustache', ''));
143
+
144
+ switch (framework) {
145
+ case "SDK-React":
146
+ fs.renameSync(filePath, filePath.replace('.mustache', ''));
147
+ break;
148
+ case "SDK-Angular":
149
+ let newFilePath = filePath.replace('.mustache', '');
150
+ const typeAng = convertIntoKebabCase(convertIntoPascalCase(mustacheSubType)).concat(".component");
151
+ newFilePath = newFilePath.replace(typeAng, componentKeyKebab.concat(".component"));
152
+
153
+ fs.renameSync(filePath, newFilePath);
154
+ break;
155
+ case "SDK-WebComponents":
156
+ fs.renameSync(filePath, filePath.replace('.mustache', ''));
157
+ break;
158
+ }
159
+
160
+
136
161
  });
137
162
  };
138
163
 
@@ -185,17 +210,29 @@ export const validateCompile = async (
185
210
 
186
211
  const componentKey = `${organization}_${library}_${componentName}`;
187
212
 
213
+ let targetDirectory = "";
214
+ switch (framework) {
215
+ case "SDK-React":
216
+ targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",componentKey));
217
+ break;
218
+ case "SDK-Angular":
219
+ let componentKeyAng = convertIntoKebabCase(convertIntoPascalCase(componentKey));
220
+ targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",componentKeyAng));
221
+ break;
222
+ case "SDK-WebComponents":
223
+ break;
224
+ }
188
225
 
189
- const targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",componentKey));
226
+ //const targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",componentKey));
190
227
  const targetDirectoryConstellation = await getComponentDirectoryPath(join(typeLC, "/",componentKey), CATEGORY_CONSTELLATION);
191
228
 
192
- const components = await getComponents(false);
229
+ const components = await getComponents(false, CATEGORY_CUSTOM, false);
193
230
 
194
231
  if (!onlyCompanion) {
195
232
  if (components.includes(componentKey)) {
196
233
  console.log(chalk.red(`${componentKey} component already exists in ${targetDirectory}`));
197
234
 
198
- let componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION);
235
+ let componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION, false);
199
236
  if (components.includes(componentKey)) {
200
237
  console.log(chalk.red(`${componentKey} associated component already exists in ${targetDirectoryConstellation}`));
201
238
  }
@@ -203,7 +240,7 @@ export const validateCompile = async (
203
240
  return;
204
241
  }
205
242
  // test for constellation
206
- const componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION);
243
+ const componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION, false);
207
244
  if (componentsConstellation.includes(componentKey)) {
208
245
  console.log(chalk.red(`${componentKey} associated component already exists in ${targetDirectoryConstellation}`));
209
246
  return;
@@ -211,7 +248,7 @@ export const validateCompile = async (
211
248
  }
212
249
  else {
213
250
  // test for constellation
214
- const componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION);
251
+ const componentsConstellation = await getComponents(false, CATEGORY_CONSTELLATION, false);
215
252
  if (componentsConstellation.includes(componentKey)) {
216
253
  console.log(chalk.red(`${componentKey} associated component already exists in ${targetDirectoryConstellation}`));
217
254
  return;
@@ -270,14 +307,18 @@ export const validateCompile = async (
270
307
  export default async options => {
271
308
  showVersion();
272
309
 
273
- if (options.params[9]) {
310
+ const framework = await getFramework();
311
+
312
+ if (options.params.length >= 12) {
274
313
  const type = options.params[3];
275
314
  const subtype = options.params[4];
276
315
  const componentName = options.params[5];
277
316
  const componentLabel = options.params[6];
278
- const library = options.params[7];
279
- const version = options.params[8];
280
- const description = options.params[9];
317
+ const version = options.params[7];
318
+ const library = options.params[8];
319
+ const allowedApplications = options.params[9];
320
+ const description = options.params[10];
321
+ const organization = options.params[11];
281
322
 
282
323
  await validateCompile(
283
324
  {
@@ -289,6 +330,7 @@ export default async options => {
289
330
  type,
290
331
  subtype,
291
332
  description,
333
+ allowedApplications,
292
334
  organization
293
335
  },
294
336
  options
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,13 +1,13 @@
1
1
  import dayjs from 'dayjs';
2
- import relativeTime from 'dayjs/plugin/relativeTime';
3
- import localizedFormat from 'dayjs/plugin/localizedFormat';
4
- import utc from 'dayjs/plugin/utc';
5
- import tzone from 'dayjs/plugin/timezone';
2
+ import relativeTime from 'dayjs/plugin/relativeTime.js';
3
+ import localizedFormat from 'dayjs/plugin/localizedFormat.js';
4
+ import utc from 'dayjs/plugin/utc.js';
5
+ import timezone from 'dayjs/plugin/timezone.js';
6
6
 
7
7
  dayjs.extend(relativeTime);
8
8
  dayjs.extend(localizedFormat);
9
9
  dayjs.extend(utc);
10
- dayjs.extend(tzone);
10
+ dayjs.extend(timezone);
11
11
 
12
12
  const types = ['fromNow', 'customFormat'];
13
13
 
@@ -16,12 +16,12 @@ const types = ['fromNow', 'customFormat'];
16
16
  // value should be in ISO 8601 format.
17
17
  function DateFormatter(
18
18
  value,
19
- { type = types[1], format = "DD/MM/YYYY", timezone } = {}
19
+ { type = types[1], format = "DD/MM/YYYY", tzone } = {}
20
20
  ) {
21
21
  if (!value) return value;
22
22
  switch (type) {
23
23
  case types[1]:
24
- if (timezone) return dayjs(value).tz(timezone).format(format);
24
+ if (tzone) return dayjs(value).tz(tzone).format(format);
25
25
  return dayjs(value).format(format);
26
26
  case types[0]:
27
27
  return dayjs(value).from(dayjs());