@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
@@ -3,39 +3,80 @@ import Listr from 'listr';
3
3
  import chalk from 'chalk';
4
4
 
5
5
  import validate from '../validator/index.js';
6
- import { getComponentDirectoryPath, showVersion, getOptionsCategory } from '../../util.js';
7
- import bundleComponent from '../bundle/index.js';
6
+ import { getComponentDirectoryPath, showVersion, getOptionsCategory, getFramework, getLocalComponentKeyFromConfig, convertIntoKebabCase, convertIntoPascalCase } from '../../util.js';
7
+ import { bundleReactComponent, bundleAngularComponent, bundleAssociatedComponent} from '../bundle/index.js';
8
8
  import { updateComponentMap } from '../map/map.js';
9
9
  import { lintComponent } from '../linter/index.js';
10
10
  import { CATEGORY_CONSTELLATION, CATEGORY_CUSTOM } from '../../constants.js';
11
11
 
12
12
 
13
- import { getPublishComponentQuestions,
14
- publishComponentToServer,
15
- zipComponent,
16
- getBuildCategory,
17
- mapConfigJsonToCompanion,
13
+ import { getPublishComponentQuestions,
14
+ publishComponentToServer,
15
+ zipComponent,
16
+ getBuildCategory,
17
+ mapConfigJsonToCompanion,
18
18
  removeCompanionConfigJson} from './helper.js';
19
19
 
20
20
 
21
21
  export default async options => {
22
22
  showVersion();
23
23
 
24
- const catQuestion = await getBuildCategory(options);
25
- const catAnswers = await inquirer.prompt(catQuestion);
24
+ const framework = await getFramework();
25
+
26
+ let componentKey;
27
+ let sourceMap;
28
+ let devBuild;
29
+ let content;
30
+ let category;
31
+
32
+ let doFetch = true;
33
+
34
+ if (options.params.length >= 8) {
35
+ category = options.params[3];
36
+ componentKey = options.params[4];
37
+ const rulesetName = options.params[5];
38
+ const rulesetVersion = options.params[6];
39
+ const dBuild = options.params[7];
40
+ devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
41
+ doFetch = false;
42
+
43
+ content = { componentKey, rulesetName, rulesetVersion, devBuild };
44
+ } else {
45
+ const catQuestion = await getBuildCategory(options);
46
+ const catAnswers = await inquirer.prompt(catQuestion);
47
+
48
+ category = catAnswers.category;
49
+ if (category == null) {
50
+ category = getOptionsCategory(options);
51
+ }
52
+
53
+ const questions = await getPublishComponentQuestions(category);
54
+ const answers = await inquirer.prompt(questions);
55
+ ({ componentKey, sourceMap, devBuild } = answers);
26
56
 
27
- let category = catAnswers.category;
28
- if (category == null) {
29
- category = getOptionsCategory(options);
57
+ content = {
58
+ ...answers
59
+ };
30
60
  }
31
61
 
32
- const questions = await getPublishComponentQuestions(category);
33
- const answers = await inquirer.prompt(questions);
34
- const { componentKey, sourceMap, devBuild } = answers;
35
62
 
36
- let content = {
37
- ...answers
38
- };
63
+ const sDevBuild = devBuild ? '(dev build)' : '';
64
+ const sFramework = framework.split("-")[1];
65
+
66
+ let associatedComponentKey = componentKey;
67
+
68
+ switch (framework) {
69
+ case "SDK-Angular":
70
+ // componentKey is in Pascal case, which is associated, need to convert to Kabab case
71
+ let arComp = componentKey.split("/");
72
+ arComp[1] = convertIntoKebabCase(convertIntoPascalCase(arComp[1]));
73
+ componentKey = arComp.join("/");
74
+ break;
75
+ case "SDK-React":
76
+ break;
77
+ case "SDK-WebComponents":
78
+ break;
79
+ }
39
80
 
40
81
  const customTasks = new Listr(
41
82
  [
@@ -47,7 +88,7 @@ export default async options => {
47
88
  }
48
89
  },
49
90
  {
50
- title: 'Lint component',
91
+ title: `Lint ${sFramework} component`,
51
92
  task: async () => {
52
93
  const targetDirectory = await getComponentDirectoryPath(componentKey, category);
53
94
  // console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
@@ -55,9 +96,16 @@ export default async options => {
55
96
  }
56
97
  },
57
98
  {
58
- title: 'Bundle component',
59
- task: async () => await bundleComponent(componentKey, sourceMap, devBuild, category),
60
- skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
99
+ title: `Bundle React component ${sDevBuild}`,
100
+ task: async () => await bundleReactComponent(componentKey, sourceMap, devBuild, category),
101
+ skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
102
+ enabled: ok => framework === "SDK-React"
103
+ },
104
+ {
105
+ title: `Bundle Angular component ${sDevBuild}`,
106
+ task: async () => await bundleAngularComponent(componentKey, sourceMap, devBuild, category),
107
+ skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
108
+ enabled: ok => framework === "SDK-Angular"
61
109
  },
62
110
  {
63
111
  title: 'Update component map',
@@ -68,7 +116,7 @@ export default async options => {
68
116
  {
69
117
  title: 'Lint associated component',
70
118
  task: async () => {
71
- const targetDirectory = await getComponentDirectoryPath(componentKey, CATEGORY_CONSTELLATION);
119
+ const targetDirectory = await getComponentDirectoryPath(associatedComponentKey, CATEGORY_CONSTELLATION);
72
120
  // console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
73
121
  await lintComponent(targetDirectory);
74
122
  }
@@ -80,27 +128,27 @@ export default async options => {
80
128
  }
81
129
  },
82
130
  {
83
- title: 'Bundle associated component',
84
- task: async () => await bundleComponent(componentKey, sourceMap, devBuild, CATEGORY_CONSTELLATION),
131
+ title: `Bundle associated component ${sDevBuild}`,
132
+ task: async () => await bundleAssociatedComponent(associatedComponentKey, sourceMap, devBuild, CATEGORY_CONSTELLATION),
85
133
  skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
86
134
  },
87
135
  {
88
136
  title: 'Zip associated component',
89
137
  task: async () => {
90
- const output = await zipComponent(componentKey, CATEGORY_CONSTELLATION);
138
+ const output = await zipComponent(associatedComponentKey, CATEGORY_CONSTELLATION);
91
139
  content = { ...content, ...output };
92
140
  }
93
141
  },
94
142
  {
95
143
  title: 'Publish associated component',
96
144
  task: async () => {
97
- await publishComponentToServer(content);
145
+ await publishComponentToServer(content, doFetch);
98
146
  }
99
147
  },
100
148
  {
101
149
  title: 'Clean up associated',
102
150
  task: async () => {
103
- await removeCompanionConfigJson(componentKey);
151
+ await removeCompanionConfigJson(associatedComponentKey);
104
152
  }
105
153
  }
106
154
  ],
@@ -118,7 +166,7 @@ export default async options => {
118
166
  }
119
167
  },
120
168
  {
121
- title: 'Lint component',
169
+ title: `Lint ${sFramework} component`,
122
170
  task: async () => {
123
171
  const targetDirectory = await getComponentDirectoryPath(componentKey, category);
124
172
  // console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
@@ -126,9 +174,14 @@ export default async options => {
126
174
  }
127
175
  },
128
176
  {
129
- title: 'Bundle component',
130
- task: async () => await bundleComponent(componentKey, sourceMap, devBuild, category),
131
- skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
177
+ title: `Bundle React component ${sDevBuild}`,
178
+ task: async () => await bundleReactComponent(componentKey, sourceMap, devBuild, category),
179
+ enabled: ok => framework === "SDK-React"
180
+ },
181
+ {
182
+ title: `Bundle Angular component ${sDevBuild}`,
183
+ task: async () => await bundleAngularComponent(componentKey, sourceMap, devBuild, category),
184
+ enabled: ok => framework === "SDK-Angular"
132
185
  },
133
186
  {
134
187
  title: 'Update component map',
@@ -139,14 +192,14 @@ export default async options => {
139
192
  {
140
193
  title: 'Zip component config',
141
194
  task: async () => {
142
- const output = await zipComponent(componentKey, category);
195
+ const output = await zipComponent(associatedComponentKey, category);
143
196
  content = { ...content, ...output };
144
197
  }
145
198
  },
146
199
  {
147
200
  title: 'Publish component config',
148
201
  task: async () => {
149
- await publishComponentToServer(content);
202
+ await publishComponentToServer(content, doFetch);
150
203
  }
151
204
  }
152
205
 
@@ -1,6 +1,5 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
- import https from 'https';
4
3
 
5
4
  import fetch from 'node-fetch';
6
5
  import AdmZip from 'adm-zip';
@@ -12,20 +11,40 @@ import {
12
11
  getComponentsObj,
13
12
  validateRulesetVersion,
14
13
  getPegaServerConfig,
15
- getOptionsCategory
14
+ getOptionsCategory,
15
+ getLocalComponentKeyFromConfig,
16
+ getFramework,
17
+ getHttpsAgent
16
18
  } from '../../util.js';
17
19
 
18
- import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
19
- TOKEN_PATH,
20
- COMPONENT_SCHEMA,
21
- CATEGORY_CONSTELLATION,
20
+ import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
21
+ TOKEN_PATH,
22
+ COMPONENT_SCHEMA,
23
+ CATEGORY_CONSTELLATION,
22
24
  CATEGORY_CUSTOM } from '../../constants.js';
23
25
 
24
26
 
25
27
  export const mapConfigJsonToCompanion = async ( componentKey ) => {
26
28
  const srcDirectory = await getComponentDirectoryPath(componentKey, CATEGORY_CUSTOM);
27
- const companionDirectory = await getComponentDirectoryPath(componentKey, CATEGORY_CONSTELLATION);
28
29
  let configContent = fs.readFileSync(`${srcDirectory}/config.json`, { encoding: 'utf8' });
30
+ const framework = await getFramework();
31
+
32
+ let associatedComponentKey = componentKey;
33
+
34
+ switch (framework) {
35
+ case "SDK-Angular":
36
+ let arComp = associatedComponentKey.split("/");
37
+ const componentKeyPascal = await getLocalComponentKeyFromConfig(associatedComponentKey);
38
+ arComp[1] = componentKeyPascal;
39
+ associatedComponentKey = arComp.join("/")
40
+ break;
41
+ case "SDK-React":
42
+ break;
43
+ case "SDK-WebComponents":
44
+ break;
45
+ }
46
+
47
+ const companionDirectory = await getComponentDirectoryPath(associatedComponentKey, CATEGORY_CONSTELLATION);
29
48
 
30
49
  fs.writeFileSync(`${companionDirectory}/config.json`, configContent, { encoding: 'utf8' });
31
50
 
@@ -54,8 +73,8 @@ export const getBuildCategory = async (options) => {
54
73
  ];
55
74
  };
56
75
 
57
- export const getPublishComponentQuestions = async () => {
58
- const components = await getComponentsObj();
76
+ export const getPublishComponentQuestions = async (category) => {
77
+
59
78
  const defaultPegaConfig = await getPegaServerConfig();
60
79
 
61
80
  return [
@@ -89,6 +108,7 @@ export const getPublishComponentQuestions = async () => {
89
108
  },
90
109
  {
91
110
  name: 'devBuild',
111
+ type: 'confirm',
92
112
  message: 'Generate development build ?',
93
113
  default: defaultPegaConfig.devBuild
94
114
  }
@@ -162,20 +182,25 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
162
182
  };
163
183
 
164
184
  export const cleanUp = async () => {
165
- fs.rm('dist/components', { recursive: true }, err => {
166
- if (err) {
167
- throw err;
168
- }
169
- });
170
185
 
171
- fs.rm('lib', { recursive: true }, err => {
172
- if (err) {
173
- throw err;
174
- }
175
- });
186
+ if (fs.existsSync('dist/components')) {
187
+ fs.rm('dist/components', { recursive: true }, err => {
188
+ if (err) {
189
+ throw err;
190
+ }
191
+ });
192
+ }
193
+
194
+ if (fs.existsSync('lib')) {
195
+ fs.rm('lib', { recursive: true }, err => {
196
+ if (err) {
197
+ throw err;
198
+ }
199
+ });
200
+ }
176
201
  }
177
202
 
178
- export const publishComponentToServer = async data => {
203
+ export const publishComponentToServer = async (data, doFetch = true) => {
179
204
  const { configContent, zipContent, rulesetName, rulesetVersion } = data;
180
205
  let { componentKey } = data;
181
206
 
@@ -206,46 +231,60 @@ export const publishComponentToServer = async data => {
206
231
  defaultPegaConfig.server,
207
232
  PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT
208
233
  );
209
- try {
210
- const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
211
- if (OauthData) {
212
- const {
213
- access_token: accessToken,
214
- token_type: tokenType,
215
- refresh_token: refreshToken
216
- } = JSON.parse(OauthData);
217
- let status = 500;
218
- fetch(url, {
219
- method: 'POST',
220
- agent: new https.Agent({ rejectUnauthorized: false }),
221
- headers: {
222
- Authorization: `${tokenType} ${accessToken}`
223
- },
224
- body: JSON.stringify(apiBody)
225
- })
226
- .then(response => {
227
- status = response.status;
228
- return response.text();
229
- })
230
- .then(resp => {
231
- const respData = JSON.parse(resp);
232
- if (status === 401) {
233
- throw new Error(
234
- 'Error occurred in authentication. Please regenerate using authenticate'
235
- );
236
- // console.log(accessTokenUri, refreshToken);
237
- /* TODO - Handle refresh_token */
238
- } else if (status == 200) {
239
- console.log(chalk.bold.green(`Success : ${respData.message}`));
240
- } else {
241
- throw new Error(`${respData.message}`);
242
- }
234
+
235
+ // fetch if not testing
236
+ if (doFetch) {
237
+ try {
238
+ const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
239
+ if (OauthData) {
240
+ const {
241
+ access_token: accessToken,
242
+ token_type: tokenType,
243
+ refresh_token: refreshToken
244
+ } = JSON.parse(OauthData);
245
+ let status = 500;
246
+ fetch(url, {
247
+ method: 'POST',
248
+ agent: getHttpsAgent(defaultPegaConfig),
249
+ headers: {
250
+ Authorization: `${tokenType} ${accessToken}`
251
+ },
252
+ body: JSON.stringify(apiBody)
243
253
  })
244
- .catch(e => Promise.reject(`${chalk.bold.red(e)}`));
245
- } else {
254
+ .then(response => {
255
+ status = response.status;
256
+ return response.text();
257
+ })
258
+ .then(resp => {
259
+ const respData = JSON.parse(resp);
260
+ if (status === 401) {
261
+ throw new Error(
262
+ 'Error occurred in authentication. Please regenerate using authenticate'
263
+ );
264
+ // console.log(accessTokenUri, refreshToken);
265
+ /* TODO - Handle refresh_token */
266
+ } else if (status == 200) {
267
+ console.log(chalk.bold.green(`Success : ${respData.message}`));
268
+ }
269
+ else if (status === 403) {
270
+ // eslint-disable-next-line prefer-promise-reject-errors
271
+ Promise.reject(
272
+ `${chalk.bold.red(
273
+ 'Error forbidden: User does not have privileges to Publish.'
274
+ )}`
275
+ );
276
+ }
277
+ else {
278
+ throw new Error(`${respData.message}`);
279
+ }
280
+ })
281
+ .catch(e => Promise.reject(`${chalk.bold.red(e)}`));
282
+ } else {
283
+ throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
284
+ }
285
+ } catch (err) {
246
286
  throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
247
287
  }
248
- } catch (err) {
249
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
250
288
  }
289
+
251
290
  };