@pega/custom-dx-components 0.23.2 → 0.23.4

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 (254) hide show
  1. package/.prettierrc.json +7 -1
  2. package/babel.config.cjs +13 -0
  3. package/jest.config.cjs +18 -0
  4. package/package.json +18 -10
  5. package/src/auth.js +578 -555
  6. package/src/cli.js +11 -5
  7. package/src/constants.js +23 -25
  8. package/src/currentPath.cjs +1 -0
  9. package/src/tasks/authenticate/helper.js +82 -18
  10. package/src/tasks/authenticate/index.js +21 -7
  11. package/src/tasks/build/helper.js +17 -8
  12. package/src/tasks/build/index.js +29 -7
  13. package/src/tasks/build-all/helper.js +2 -1
  14. package/src/tasks/build-all/index.js +32 -25
  15. package/src/tasks/bundle/builder/index.js +5 -0
  16. package/src/tasks/bundle/builder/webpack.config.js +3 -2
  17. package/src/tasks/create/index.js +8 -5
  18. package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +0 -1
  19. package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +7 -7
  20. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +0 -1
  21. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +8 -8
  22. package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +0 -1
  23. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +10 -10
  24. package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js.mustache +6 -5
  25. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +6 -3
  26. package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +0 -1
  27. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +0 -1
  28. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +0 -1
  29. package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +0 -1
  30. package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +0 -1
  31. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +0 -1
  32. package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +0 -1
  33. package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +0 -1
  34. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +0 -1
  35. package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +0 -1
  36. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +0 -1
  37. package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +0 -1
  38. package/src/tasks/create/templates/Constellation/Field/TimeOfDay/config.json.mustache +0 -1
  39. package/src/tasks/create/templates/Constellation/Field/TimeOfDay/time-of-day.js.mustache +6 -5
  40. package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +0 -1
  41. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +0 -1
  42. package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +0 -1
  43. package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +0 -1
  44. package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +0 -1
  45. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +0 -1
  46. package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +0 -1
  47. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +0 -1
  48. package/src/tasks/create-all/index.js +68 -47
  49. package/src/tasks/delete/helper.js +90 -40
  50. package/src/tasks/delete/index.js +5 -5
  51. package/src/tasks/delete-all/helper.js +108 -48
  52. package/src/tasks/delete-all/index.js +6 -6
  53. package/src/tasks/index.js +2 -1
  54. package/src/tasks/init/template/README.md +2 -204
  55. package/src/tasks/init/template/babel.config.cjs +13 -0
  56. package/src/tasks/init/template/jest.config.cjs +25 -0
  57. package/src/tasks/init/template/package.json.mustache +13 -5
  58. package/src/tasks/init/template/src/components/_components.md +1 -1
  59. package/src/tasks/init/template/tasks.config.json +11 -8
  60. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/config.json +55 -0
  61. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/demo.stories.jsx +51 -0
  62. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/index.jsx +60 -0
  63. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/mock.stories.js +13 -0
  64. package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/styles.js +7 -0
  65. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/Boolean.js +38 -0
  66. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/boolean-format.js +26 -0
  67. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/config.json +145 -0
  68. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/demo.stories.jsx +61 -0
  69. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/event-utils.js +18 -0
  70. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/index.jsx +170 -0
  71. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/mock.stories.js +21 -0
  72. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/styles.js +7 -0
  73. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/OneColumnPage.svg +36 -0
  74. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/config.json +23 -0
  75. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/demo.stories.jsx +78 -0
  76. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/index.jsx +73 -0
  77. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/mock.stories.js +390 -0
  78. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/styles.js +7 -0
  79. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/config.json +291 -0
  80. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/demo.stories.jsx +53 -0
  81. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/event-utils.js +18 -0
  82. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/index.jsx +296 -0
  83. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/mock.stories.js +23 -0
  84. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/styles.js +7 -0
  85. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/suggestions-handler.js +10 -0
  86. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/DateFormatter.js +61 -0
  87. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/FormattedText.jsx +41 -0
  88. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/config.json +195 -0
  89. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/date.js +439 -0
  90. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/demo.stories.jsx +73 -0
  91. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/index.jsx +256 -0
  92. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/mock.stories.js +23 -0
  93. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/styles.js +7 -0
  94. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/suggestions-handler.js +10 -0
  95. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/config.json +256 -0
  96. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-time.js +92 -0
  97. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-utils.js +288 -0
  98. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date.js +331 -0
  99. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/demo.stories.jsx +73 -0
  100. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/index.jsx +254 -0
  101. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/mock.stories.js +23 -0
  102. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/styles.js +7 -0
  103. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/suggestions-handler.js +10 -0
  104. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/config.json +278 -0
  105. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/demo.stories.jsx +49 -0
  106. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/event-utils.js +18 -0
  107. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/index.jsx +270 -0
  108. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/mock.stories.js +21 -0
  109. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/styles.js +7 -0
  110. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/suggestions-handler.js +10 -0
  111. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/OneColumnDetails.svg +22 -0
  112. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/StatusWork.jsx +26 -0
  113. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/config.json +35 -0
  114. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/demo.stories.jsx +132 -0
  115. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/index.jsx +83 -0
  116. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/mock.stories.js +189 -0
  117. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/styles.js +7 -0
  118. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/utils.js +152 -0
  119. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/config.json +111 -0
  120. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/demo.stories.jsx +48 -0
  121. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/event-utils.js +18 -0
  122. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/index.jsx +231 -0
  123. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/mock.stories.js +22 -0
  124. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/styles.js +7 -0
  125. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/suggestions-handler.js +10 -0
  126. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/DefaultForm.svg +29 -0
  127. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/config.json +45 -0
  128. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/demo.stories.jsx +166 -0
  129. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/index.jsx +42 -0
  130. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/mock.stories.js +137 -0
  131. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/styles.js +7 -0
  132. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/config.json +344 -0
  133. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/demo.stories.jsx +49 -0
  134. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/event-utils.js +18 -0
  135. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/index.jsx +333 -0
  136. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/mock.stories.js +21 -0
  137. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/styles.js +7 -0
  138. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/suggestions-handler.js +10 -0
  139. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/GetNextWork.jsx +35 -0
  140. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/OneColumnPage.svg +36 -0
  141. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/config.json +32 -0
  142. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/demo.stories.jsx +102 -0
  143. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/index.jsx +70 -0
  144. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/localizations.json +4 -0
  145. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/mock.stories.js +94 -0
  146. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/styles.js +7 -0
  147. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/utils.js +229 -0
  148. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Avatar.jsx +75 -0
  149. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/OneColumnPage.svg +36 -0
  150. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Operator.jsx +237 -0
  151. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/config.json +66 -0
  152. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +68 -0
  153. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/index.jsx +108 -0
  154. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/mock.stories.js +51 -0
  155. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/styles.js +7 -0
  156. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/OneColumnPage.svg +36 -0
  157. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/config.json +59 -0
  158. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/demo.stories.jsx +30 -0
  159. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/index.jsx +48 -0
  160. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/mock.stories.js +23 -0
  161. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/styles.js +7 -0
  162. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/config.json +111 -0
  163. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/demo.stories.jsx +48 -0
  164. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/event-utils.js +18 -0
  165. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/index.jsx +231 -0
  166. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/mock.stories.js +20 -0
  167. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/styles.js +7 -0
  168. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/suggestions-handler.js +10 -0
  169. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/config.json +93 -0
  170. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/demo.stories.jsx +49 -0
  171. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/event-utils.js +18 -0
  172. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/index.jsx +275 -0
  173. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/mock.stories.js +21 -0
  174. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/styles.js +7 -0
  175. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/suggestions-handler.js +10 -0
  176. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/config.json +123 -0
  177. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/demo.stories.jsx +46 -0
  178. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/event-utils.js +18 -0
  179. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/index.jsx +266 -0
  180. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/mock.stories.js +37 -0
  181. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/styles.js +7 -0
  182. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/suggestions-handler.js +10 -0
  183. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/config.json +114 -0
  184. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/demo.stories.jsx +78 -0
  185. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/event-utils.js +18 -0
  186. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/index.jsx +351 -0
  187. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/mock.stories.js +67 -0
  188. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/styles.js +7 -0
  189. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/suggestions-handler.js +10 -0
  190. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/config.json +55 -0
  191. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/demo.stories.jsx +51 -0
  192. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/index.jsx +60 -0
  193. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/mock.stories.js +13 -0
  194. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/styles.js +7 -0
  195. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/StatusWork.jsx +26 -0
  196. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/config.json +111 -0
  197. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/demo.stories.jsx +48 -0
  198. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/event-utils.js +18 -0
  199. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/index.jsx +239 -0
  200. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/mock.stories.js +21 -0
  201. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/styles.js +7 -0
  202. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/suggestions-handler.js +10 -0
  203. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/config.json +185 -0
  204. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/demo.stories.jsx +57 -0
  205. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/index.jsx +213 -0
  206. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/mock.stories.js +20 -0
  207. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/styles.js +7 -0
  208. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/suggestions-handler.js +10 -0
  209. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/time-of-day.js +288 -0
  210. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/StatusWork.jsx +26 -0
  211. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/TwoColumnDetails.svg +28 -0
  212. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/config.json +42 -0
  213. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +136 -0
  214. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/index.jsx +83 -0
  215. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +230 -0
  216. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/styles.js +7 -0
  217. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/utils.js +155 -0
  218. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/TwoColumn.svg +38 -0
  219. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/config.json +27 -0
  220. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +175 -0
  221. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/index.jsx +45 -0
  222. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/mock.stories.js +143 -0
  223. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/styles.js +7 -0
  224. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/config.json +237 -0
  225. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/demo.stories.jsx +46 -0
  226. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/event-utils.js +18 -0
  227. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/index.jsx +232 -0
  228. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/mock.stories.js +22 -0
  229. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/styles.js +7 -0
  230. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/suggestions-handler.js +10 -0
  231. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/text-url.jsx +173 -0
  232. package/src/tasks/init/template/test/functionTest/localCreateAllListDeleteAll.test.js +157 -0
  233. package/src/tasks/init/template/test/functionTest/localCreateBuildAllDeleteAll.test.js +148 -0
  234. package/src/tasks/init/template/test/functionTest/localCreateBuildDelete.test.js +84 -0
  235. package/src/tasks/init/template/test/functionTest/localCreateListDelete.test.js +108 -0
  236. package/src/tasks/init/template/test/functionTest/localCreatePublishAllDeleteAll.test.js +148 -0
  237. package/src/tasks/init/template/test/functionTest/localCreatePublishDelete.test.js +84 -0
  238. package/src/tasks/init/template/test/functionTest/localCreateRenameDelete.test.js +84 -0
  239. package/src/tasks/init/template/test/functionTest/localPromoteRevertWP.test.js +59 -0
  240. package/src/tasks/list/helper.js +115 -14
  241. package/src/tasks/promote-webpack/index.js +126 -0
  242. package/src/tasks/promote-webpack/webpack.config.js +376 -0
  243. package/src/tasks/publish/helper.js +116 -61
  244. package/src/tasks/publish/index.js +34 -8
  245. package/src/tasks/publish-all/helper.js +115 -63
  246. package/src/tasks/publish-all/index.js +51 -30
  247. package/src/tasks/rename/index.js +127 -97
  248. package/src/tasks/revert-webpack/index.js +71 -0
  249. package/src/util.js +159 -320
  250. package/test/unitTest/util.test.js +525 -0
  251. package/src/tasks/generate-ai/aiPrompt.txt.mustache +0 -23
  252. package/src/tasks/generate-ai/aiPromptDavinci.txt.mustache +0 -14
  253. package/src/tasks/generate-ai/helper.js +0 -357
  254. package/src/tasks/generate-ai/index.js +0 -34
@@ -0,0 +1,525 @@
1
+ import fs, {Dirent, constants} from 'fs';
2
+ import path from 'path';
3
+ import { join } from 'path';
4
+ import {expect, jest, test} from '@jest/globals';
5
+ import chalk from 'chalk';
6
+ import { createRequire } from 'module';
7
+
8
+ import fetch from 'node-fetch';
9
+
10
+ // const util = require('node:util');
11
+ import { exec } from 'child_process';
12
+
13
+ import {
14
+ deleteLocalComponent,
15
+ deleteInfinityServerComponent,
16
+ getComponents,
17
+ getSubComponents,
18
+ getDirectoryFiles,
19
+ getComponentsObj,
20
+ getPegaConfig,
21
+ getPegaServerConfig,
22
+ getComponentDefaults,
23
+ getComponentDirectoryPath,
24
+ convertIntoPascalCase,
25
+ isPascalCase,
26
+ constructCompleteUrl,
27
+ sanitize,
28
+ validateSemver,
29
+ validateRulesetVersion,
30
+ standardizeStr,
31
+ showVersion,
32
+ checkPathAccess
33
+ } from '../../src/util';
34
+
35
+
36
+ const mockAcces = {
37
+ TOKEN_PATH: '.access_token'
38
+ }
39
+
40
+ // describe('utils fetch', () => {
41
+ // let promiseStub = null;
42
+
43
+ // const fetchMessage = {
44
+ // message : "Pega_DXIL_MyTestText Component is successfully deleted"
45
+ // }
46
+
47
+ // beforeEach(() => {
48
+ // // Stub fetch response
49
+ // promiseStub = sinon.stub(fetch, "Promise");
50
+ // promiseStub.returns(
51
+ // Promise.resolve({ status: 200, json: () => Promise.resolve(fetchMessage) })
52
+ // );
53
+ // });
54
+
55
+ // afterAll(() => {
56
+ // promiseStub.restore();
57
+ // });
58
+
59
+ // afterEach(() => {
60
+ // sinon.restore();
61
+ // });
62
+
63
+ // it('deleteInfinityServerComponent', async () => {
64
+ // // remove node_module path if exists
65
+ // const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
66
+ // const cwdMock = jest.spyOn(process, 'cwd');
67
+ // cwdMock.mockReturnValue(thePath);
68
+
69
+ // const tokenPath = process.cwd();
70
+ // const logSpy = jest.spyOn(console, 'log');
71
+
72
+
73
+ // // global.fetch = jest.fn(() =>
74
+ // // Promise.resolve({
75
+ // // json: () => Promise.resolve({"message": " Pega_DXIL_MyTestText Component is successfully deleted","status":"200"}),
76
+ // // }),
77
+ // // );
78
+
79
+ // // const fetchMock = jest.spyOn(global, 'fetch').mockImplementation(() =>
80
+ // // Promise.resolve({ json: () => Promise.resolve({"message": " Pega_DXIL_MyTestText Component is successfully deleted","status":"200"}) } ));
81
+
82
+
83
+ // // const fetchMock = jest.spyOn(global, 'fetch').mockImplementation(() =>
84
+ // // new Promise((resolve) =>
85
+ // // resolve({status:"200", json: () => Promise.resolve(" Pega_DXIL_MyTestText Component is successfully deleted") }) ) );
86
+
87
+ // ////
88
+
89
+ // const mockResponse = {p_res: '{"test":"value"}', missingComponents: []}
90
+
91
+ // // stubbing fetch
92
+ // const stubbedFetch = sinon.stub(fetch, 'Promise').returns(Promise.resolve({ok:true, status: 200, json:() => Promise.resolve([{"test":"value"}])}))
93
+
94
+ // ////
95
+
96
+
97
+ // await deleteInfinityServerComponent("Pega_DXIL_MyTestText~|~LoanV2~|~01-01-01", ".access_token");
98
+
99
+
100
+ // expect(logSpy).toHaveBeenCalledWith('deleted');
101
+
102
+
103
+ // cwdMock.mockRestore();
104
+ // logSpy.mockRestore();
105
+ // tokenPathSpy.mockeRestore();
106
+
107
+
108
+ // });
109
+
110
+ // });
111
+
112
+ describe('utils test', () => {
113
+
114
+
115
+ it('checkPathAccess', async () => {
116
+ const logSpy = jest.spyOn(console, 'error')
117
+
118
+ // remove node_module path if exists
119
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
120
+
121
+ await checkPathAccess(thePath);
122
+
123
+ expect(logSpy).not.toBeCalled();
124
+
125
+ logSpy.mockRestore();
126
+
127
+
128
+ });
129
+
130
+ it('NOT checkPathAccess', async () => {
131
+ const logSpy = jest.spyOn(console, 'error')
132
+ const exitMock = jest.spyOn(process, 'exit').mockImplementation(() => {});
133
+
134
+ // remove node_module path if exists
135
+ const thePath = "/notExist";
136
+
137
+ await checkPathAccess(thePath);
138
+
139
+ expect(logSpy).toBeCalled();
140
+ expect(exitMock).toHaveBeenCalledWith(1);
141
+
142
+ logSpy.mockRestore();
143
+ exitMock.mockRestore();
144
+
145
+ });
146
+
147
+ it('getComponents', async () => {
148
+ const dir1 = new Dirent("directory1", constants.UV_DIRENT_DIR);
149
+ const dir2 = new Dirent("directory2", constants.UV_DIRENT_DIR);
150
+
151
+ // remove node_module path if exists
152
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
153
+ const cwdMock = jest.spyOn(process, 'cwd');
154
+ cwdMock.mockReturnValue(thePath);
155
+
156
+ const fsMock = jest.spyOn(fs, 'readdirSync');
157
+ fsMock.mockReturnValue([dir1, dir2]);
158
+
159
+
160
+ const compList = await getComponents();
161
+ expect(compList).not.toBeNull;
162
+ expect(compList).toMatchObject(['directory1', 'directory2']);
163
+
164
+ cwdMock.mockRestore();
165
+ fsMock.mockRestore();
166
+ });
167
+
168
+ it('NOT getComponents', async () => {
169
+ const dir1 = new Dirent("directory1", constants.UV_DIRENT_DIR);
170
+ const dir2 = new Dirent("directory2", constants.UV_DIRENT_DIR);
171
+
172
+ // remove node_module path if exists
173
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
174
+ const cwdMock = jest.spyOn(process, 'cwd');
175
+ cwdMock.mockReturnValue(thePath);
176
+
177
+ const logSpy = jest.spyOn(console, 'error')
178
+ const exitMock = jest.spyOn(process, 'exit').mockImplementation(() => { throw new Error('bad')});
179
+
180
+ const fsMock = jest.spyOn(fs, 'readdirSync');
181
+ fsMock.mockReturnValue([dir1, dir2]);
182
+
183
+ const fsFileMock = jest.spyOn(fs, 'readFileSync');
184
+ fsFileMock.mockReturnValue("{}");
185
+
186
+ try {
187
+ const compList = await getComponents();
188
+ }
189
+ catch (error) {
190
+ expect(logSpy).toBeCalled();
191
+ expect(exitMock).toHaveBeenCalledWith(1);
192
+ }
193
+
194
+
195
+ fsMock.mockRestore();
196
+ fsFileMock.mockRestore();
197
+ exitMock.mockRestore();
198
+ logSpy.mockRestore();
199
+ cwdMock.mockRestore();
200
+
201
+
202
+ });
203
+
204
+
205
+
206
+ it('getSubComponents', async () => {
207
+ const dir1 = new Dirent("directory1", constants.UV_DIRENT_DIR);
208
+ const dir2 = new Dirent("directory2", constants.UV_DIRENT_DIR);
209
+
210
+ // remove node_module path if exists
211
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
212
+ const cwdMock = jest.spyOn(process, 'cwd');
213
+ cwdMock.mockReturnValue(thePath);
214
+
215
+ const fsMock = jest.spyOn(fs, 'readdirSync');
216
+ fsMock.mockReturnValue([dir1, dir2]);
217
+
218
+ const compList = await getSubComponents("/main", "/sub");
219
+ expect(compList).not.toBeNull;
220
+ expect(compList).toMatchObject(['directory1', 'directory2']);
221
+
222
+
223
+ fsMock.mockRestore();
224
+ cwdMock.mockRestore();
225
+ });
226
+
227
+ it('getDirectoryFiles', async () => {
228
+ const file1 = new Dirent("file1", constants.UV_DIRENT_FILE);
229
+ const file2 = new Dirent("file2", constants.UV_DIRENT_FILE);
230
+
231
+ // remove node_module path if exists
232
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
233
+ const cwdMock = jest.spyOn(process, 'cwd');
234
+ cwdMock.mockReturnValue(thePath);
235
+
236
+ const fsMock = jest.spyOn(fs, 'readdirSync');
237
+ fsMock.mockReturnValue([file1, file2]);
238
+
239
+ const compList = await getDirectoryFiles("/main");
240
+ expect(compList).not.toBeNull;
241
+ expect(compList).toMatchObject(['file1', 'file2']);
242
+
243
+
244
+ fsMock.mockRestore();
245
+ cwdMock.mockRestore();
246
+ });
247
+
248
+ it('getComponentsObj', async () => {
249
+ const dir1 = new Dirent("directory1", constants.UV_DIRENT_DIR);
250
+ const dir2 = new Dirent("directory2", constants.UV_DIRENT_DIR);
251
+
252
+ // remove node_module path if exists
253
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
254
+ const cwdMock = jest.spyOn(process, 'cwd');
255
+ cwdMock.mockReturnValue(thePath);
256
+
257
+ const fsMock = jest.spyOn(fs, 'readdirSync');
258
+ fsMock.mockReturnValue([dir1, dir2]);
259
+
260
+ const compList = await getComponentsObj();
261
+ expect(compList).not.toBeNull;
262
+ expect(compList).toMatchObject([{"name": "directory1","value": "directory1"},{"name": "directory2","value": "directory2"}]);
263
+
264
+
265
+ fsMock.mockRestore();
266
+ cwdMock.mockRestore();
267
+ });
268
+
269
+ it('getPegaConfig', async () => {
270
+
271
+ // remove node_module path if exists
272
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
273
+ const cwdMock = jest.spyOn(process, 'cwd');
274
+ cwdMock.mockReturnValue(thePath);
275
+
276
+ const oConf = await getPegaConfig();
277
+
278
+ const sPath = oConf["components-directory-path"];
279
+
280
+ expect(oConf).not.toBeNull;
281
+ expect(sPath).toMatch('src/components');
282
+ expect(oConf.component.library).toMatch('DXIL');
283
+ expect(oConf.component.version).toMatch('0.0.1');
284
+
285
+ cwdMock.mockRestore();
286
+
287
+ });
288
+
289
+ it('getPegaServerConfig', async () => {
290
+ // remove node_module path if exists
291
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
292
+ const cwdMock = jest.spyOn(process, 'cwd');
293
+ cwdMock.mockReturnValue(thePath);
294
+
295
+ const oConf = await getPegaServerConfig();
296
+
297
+ expect(oConf).not.toBeNull;
298
+
299
+ expect(oConf.sourceOfComponents).toMatch('Server');
300
+ expect(oConf.serverType).toMatch('infinity');
301
+ expect(oConf.clientId).toMatch('10095186356008396159');
302
+ expect(oConf.grantType).toMatch('authCode');
303
+ expect(oConf.redirectUri).toMatch('https://localhost:4010');
304
+ expect(oConf.authService).toMatch('pega');
305
+
306
+ cwdMock.mockRestore();
307
+
308
+ });
309
+
310
+ it('getComponentDefaults', async () => {
311
+
312
+ // remove node_module path if exists
313
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
314
+ const cwdMock = jest.spyOn(process, 'cwd');
315
+ cwdMock.mockReturnValue(thePath);
316
+
317
+ const oConf = await getComponentDefaults();
318
+
319
+ expect(oConf).not.toBeNull;
320
+ expect(oConf.library).toMatch('DXIL');
321
+ expect(oConf.version).toMatch('0.0.1');
322
+
323
+ cwdMock.mockRestore();
324
+
325
+ });
326
+
327
+ it('getComponentDirectoryPath', async () => {
328
+
329
+ // remove node_module path if exists
330
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
331
+ const cwdMock = jest.spyOn(process, 'cwd');
332
+ cwdMock.mockReturnValue(thePath);
333
+
334
+ const sPath = await getComponentDirectoryPath("Pega_DXIL_MyTestText");
335
+
336
+ expect(sPath).not.toBeNull;
337
+ expect(sPath).toContain('/src/components/Pega_DXIL_MyTestText');
338
+
339
+ cwdMock.mockRestore();
340
+
341
+ });
342
+
343
+ it('NOT getComponentDirectoryPath', async () => {
344
+
345
+ // remove node_module path if exists
346
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
347
+ const cwdMock = jest.spyOn(process, 'cwd');
348
+ cwdMock.mockReturnValue(thePath);
349
+
350
+ const logSpy = jest.spyOn(console, 'error')
351
+ const exitMock = jest.spyOn(process, 'exit').mockImplementation(() => { throw new Error('bad')});
352
+
353
+ const fsFileMock = jest.spyOn(fs, 'readFileSync');
354
+ fsFileMock.mockReturnValue("{}");
355
+
356
+ try {
357
+ const sPath = await getComponentDirectoryPath("Pega_DXIL_MyTestText");
358
+ }
359
+ catch (error) {
360
+ expect(logSpy).toBeCalled();
361
+ expect(exitMock).toHaveBeenCalledWith(1);
362
+ }
363
+
364
+ fsFileMock.mockRestore();
365
+ exitMock.mockRestore();
366
+ logSpy.mockRestore();
367
+ cwdMock.mockRestore();
368
+
369
+ });
370
+
371
+ test('convertIntoPascalCase', () => {
372
+ const response = convertIntoPascalCase("Pega_DXIL_MyTestText");
373
+ expect(response).toMatch("PegaDxilMyTestText");
374
+
375
+ });
376
+
377
+ test('isPascalCase', () => {
378
+ const isPascal = isPascalCase("PegaDxilMyTestText");
379
+ expect(isPascal).toBeTruthy();
380
+
381
+ });
382
+
383
+ test('NOT isPascalCase', () => {
384
+ const isPascal = isPascalCase("Pega_DXIL_MyTestText");
385
+ expect(isPascal).not.toBeTruthy();
386
+
387
+ });
388
+
389
+ test('NOT constructCompleteUrl', () => {
390
+ const sUrl = constructCompleteUrl("/user", "myDir/myData");
391
+ expect(sUrl).toMatch("/user/myDir/myData");
392
+
393
+ });
394
+
395
+
396
+ test('sanitize', () => {
397
+ const sUrl = sanitize("%&*^abc123%*%^&*");
398
+ expect(sUrl).toMatch("abc123");
399
+
400
+ });
401
+
402
+
403
+ test('validateSemver', () => {
404
+ const bValid = validateSemver("0.0.1");
405
+ expect(bValid).toBeTruthy();
406
+
407
+ });
408
+
409
+ test('NOT validateSemver', () => {
410
+ const bValid = validateSemver("0.0.1abc");
411
+ expect(bValid).not.toBeTruthy();
412
+
413
+ });
414
+
415
+
416
+ test('validateRulesetVersion', () => {
417
+ const bValid = validateRulesetVersion("01-01-01");
418
+ expect(bValid).toBeTruthy();
419
+
420
+ });
421
+
422
+ test('NOT validateRulesetVersion', () => {
423
+ const bValid = validateRulesetVersion("01-01-01abc");
424
+ expect(bValid).not.toBeTruthy();
425
+
426
+ });
427
+
428
+ test('NOT validateRulesetVersion 00', () => {
429
+ const bValid = validateRulesetVersion("00-01-01");
430
+ expect(bValid).not.toBeTruthy();
431
+
432
+ });
433
+
434
+ test('standardizeStr', () => {
435
+ const sStr = standardizeStr("abcd", 10);
436
+ expect(sStr).toMatch("abcd ");
437
+
438
+ });
439
+
440
+
441
+ it('NOT deleteLocalComponent', async () => {
442
+ // remove node_module path if exists
443
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
444
+ const cwdMock = jest.spyOn(process, 'cwd');
445
+ cwdMock.mockReturnValue(thePath);
446
+
447
+ const logSpy = jest.spyOn(console, 'error')
448
+ const exitMock = jest.spyOn(process, 'exit').mockImplementation(() => { throw new Error('bad')});
449
+
450
+ const fsFileMock = jest.spyOn(fs, 'readFileSync');
451
+ fsFileMock.mockReturnValue("{}");
452
+
453
+ try {
454
+ await deleteLocalComponent("Pega_DXIL_MyTestText");
455
+ }
456
+ catch (error) {
457
+ expect(logSpy).toBeCalled();
458
+ expect(exitMock).toHaveBeenCalledWith(1);
459
+ }
460
+
461
+ fsFileMock.mockRestore();
462
+ exitMock.mockRestore();
463
+ logSpy.mockRestore();
464
+ cwdMock.mockRestore();
465
+
466
+ });
467
+
468
+ it('Not deleteLocalComponent no file', async () => {
469
+ // remove node_module path if exists
470
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
471
+ const cwdMock = jest.spyOn(process, 'cwd');
472
+ cwdMock.mockReturnValue(thePath);
473
+
474
+ try {
475
+ await deleteLocalComponent("Pega_DXIL_MyTestText");
476
+ }
477
+ catch (error) {
478
+ expect(error).not.toBeNull();
479
+ expect(error.toString()).toMatch("Error: No such file Pega_DXIL_MyTestText");
480
+ }
481
+
482
+
483
+
484
+ cwdMock.mockRestore();
485
+
486
+ });
487
+
488
+ it('deleteLocalComponent', async () => {
489
+ // remove node_module path if exists
490
+ const thePath = process.cwd().replace("node_modules/@pega/custom-dx-components","");
491
+ const cwdMock = jest.spyOn(process, 'cwd');
492
+ cwdMock.mockReturnValue(thePath);
493
+
494
+ const logSpy = jest.spyOn(console, 'log')
495
+ const rmSyncMock = jest.spyOn(fs, 'rmSync').mockImplementation(() => { });
496
+
497
+ await deleteLocalComponent("Pega_DXIL_MyTestText");
498
+ expect(logSpy).toHaveBeenCalled();
499
+ expect(logSpy).toHaveBeenCalledWith(`${chalk.red.bold("Pega_DXIL_MyTestText")} is deleted from Local`);
500
+
501
+ cwdMock.mockRestore();
502
+ logSpy.mockRestore();
503
+ rmSyncMock.mockRestore();
504
+
505
+ });
506
+
507
+
508
+
509
+
510
+
511
+ // test('showVersion', () => {
512
+ // const logSpy = jest.spyOn(console, 'log')
513
+
514
+ // const require = createRequire(import.meta.url);
515
+ // const pData = require("@pega/custom-dx-components/package.json");
516
+
517
+ // showVersion();
518
+
519
+ // expect(logSpy).toHaveBeenCalledWith(chalk.green("DX Component Builder v" + pData.version));
520
+
521
+ // logSpy.mockRestore();
522
+ // })
523
+
524
+
525
+ });
@@ -1,23 +0,0 @@
1
- You are a Pega Digital Experience (DX) Component and React expert who only produces sample code with no additional narrative. A Pega React DX Component is a functional component that uses hooks, PropTypes and StyledComponents.
2
-
3
-
4
- Very important: The name of the component comes from component definition compName.
5
-
6
- Very important: The type of component to be created comes from component definition subtype.
7
-
8
- Very important: A DX component has all of it's data passed in via a single object that must always be called props. The object properties are then destructured in the component. There is always a function passed in called getPConnect() that is required. All event handlers are created in the same component and not passed in via the props object. Apart from getPConnect() all of the object properties are defined in an array called properties in a file called config.json (a.k.a the component definition).
9
-
10
-
11
- Presentation components are imported from the Constellation Design System from the packages @pega/cosmos-react-core, @pega/cosmos-react-work, @pega/cosmos-react-social.
12
-
13
- {{COMPONENT_ADDITIONAL}}
14
-
15
- Build a component defined by subtype in component definition.
16
-
17
- Should use the following design system components
18
-
19
- DesignSystemComponents:
20
- {{COMPONENT_DSC}}
21
-
22
- Here is the component definition
23
- {{COMPONENT_CONFIG}}
@@ -1,14 +0,0 @@
1
- You are a Pega Digital Experience (DX) Component and React expert who only produces sample code with no additional narrative. A Pega React DX Component is a functional component that uses hooks, PropTypes and StyledComponents.
2
-
3
-
4
- Very important: The name of the component comes from component definition compName.
5
-
6
- Very important: A DX component has all of it's data passed in via a single object that must always be called props. The object properties are then destructured in the component. There is always a function passed in called getPConnect() that is required. All event handlers are created in the same component and not passed in via the props object. Apart from getPConnect() all of the object properties are defined in an array called properties in a file called config.json (a.k.a the component definition).
7
-
8
-
9
- Presentation components are imported from the Constellation Design System from the packages @pega/cosmos-react-core, @pega/cosmos-react-work, @pega/cosmos-react-social.
10
-
11
- {{COMPONENT_ADDITIONAL}}
12
-
13
- Here is the component definition
14
- {{COMPONENT_CONFIG}}