@pega/custom-dx-components 0.23.35 → 0.23.37

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 (330) hide show
  1. package/SECURITY.md +10 -0
  2. package/package.json +1 -1
  3. package/src/constants.js +1 -0
  4. package/src/tasks/build-all/index.js +10 -25
  5. package/src/tasks/build-comp/index.js +1 -0
  6. package/src/tasks/bundle/builder/index.js +6 -3
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.ts.mustache +35 -0
  8. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +8 -5
  9. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +10 -47
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.ts.mustache +7 -14
  11. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/DateFormatter.js → src/tasks/create/templates/Constellation/Field/Date/DateFormatter.ts.mustache} +6 -6
  12. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.tsx.mustache +20 -0
  13. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/date.js → src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache} +2 -2
  14. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -5
  15. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +29 -70
  16. package/src/tasks/create/templates/Constellation/Field/Date/styles.ts.mustache +7 -14
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/{date-time.js.mustache → date-time.ts.mustache} +12 -12
  18. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.js → src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache} +27 -26
  19. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.js → src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache} +1 -0
  20. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +9 -6
  21. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +12 -59
  22. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.ts.mustache +7 -14
  23. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +8 -5
  24. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +14 -67
  25. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.ts.mustache +7 -14
  26. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +8 -5
  27. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +21 -75
  28. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.ts.mustache +7 -14
  29. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +8 -5
  30. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +13 -54
  31. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.ts.mustache +7 -14
  32. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +8 -5
  33. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +23 -87
  34. package/src/tasks/create/templates/Constellation/Field/Integer/styles.ts.mustache +7 -14
  35. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +8 -5
  36. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +12 -60
  37. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.ts.mustache +7 -14
  38. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache} +2 -1
  39. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +8 -5
  40. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache} +2 -1
  41. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +15 -76
  42. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/picklist-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.ts.mustache} +1 -0
  43. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.ts.mustache} +1 -1
  44. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{repeat-utils.js.mustache → repeat-utils.ts.mustache} +6 -12
  45. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/styles.ts.mustache +7 -14
  46. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/textformat-utils.jsx → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache} +30 -10
  47. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  48. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +8 -5
  49. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +11 -55
  50. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/styles.ts.mustache +7 -14
  51. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +8 -5
  52. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -22
  53. package/src/tasks/create/templates/Constellation/Field/Text/styles.ts.mustache +7 -14
  54. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +8 -5
  55. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +9 -46
  56. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.ts.mustache +7 -14
  57. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +7 -4
  58. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +10 -50
  59. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.ts.mustache +7 -14
  60. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +8 -5
  61. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +12 -48
  62. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.ts.mustache +7 -14
  63. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +8 -5
  64. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +13 -52
  65. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.ts.mustache +7 -14
  66. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +8 -5
  67. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +15 -71
  68. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.ts.mustache +7 -14
  69. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/text-url.jsx → src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache} +4 -3
  70. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +8 -6
  71. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +16 -52
  72. package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.ts.mustache +7 -14
  73. package/src/tasks/create/templates/Constellation/Field/{DateTime/date-utils.js.mustache → TimeofDay/time-of-day.ts.mustache} +24 -23
  74. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +14 -5
  75. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -17
  76. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +7 -14
  77. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +10 -3
  78. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +4 -18
  79. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +7 -14
  80. package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/utils.js → src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache} +15 -13
  81. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +11 -5
  82. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +5 -13
  83. package/src/tasks/create/templates/Constellation/Template/FORM/styles.ts.mustache +7 -14
  84. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +11 -5
  85. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +4 -10
  86. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.ts.mustache +7 -14
  87. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +8 -5
  88. package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +5 -16
  89. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.ts.mustache +7 -14
  90. package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.js → src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache} +28 -14
  91. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +8 -5
  92. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +3 -10
  93. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.ts.mustache +7 -14
  94. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +8 -5
  95. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +4 -18
  96. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.ts.mustache +7 -14
  97. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +3 -13
  98. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +4 -19
  99. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
  100. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +24 -39
  101. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.ts.mustache +7 -14
  102. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +8 -5
  103. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +3 -9
  104. package/src/tasks/create/templates/Launchpad/Widget/CASE/styles.ts.mustache +7 -14
  105. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -11
  106. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.tsx.mustache +33 -51
  107. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
  108. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +22 -21
  109. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/styles.ts.mustache +7 -14
  110. package/src/tasks/delete-all/helper.js +37 -5
  111. package/src/tasks/init/template/package.json.mustache +6 -6
  112. package/src/tasks/init/template/tasks.config.json +2 -1
  113. package/src/tasks/linter/index.js +7 -4
  114. package/src/tasks/list/helper.js +10 -0
  115. package/src/tasks/list/index.js +20 -3
  116. package/src/tasks/promote-webpack/index.js +3 -26
  117. package/src/tasks/publish/helper.js +1 -1
  118. package/src/tasks/publish/index.js +6 -4
  119. package/src/tasks/publish-all/helper.js +52 -40
  120. package/src/tasks/publish-all/index.js +16 -17
  121. package/src/tasks/revert-webpack/index.js +3 -23
  122. package/src/util.js +152 -61
  123. package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +8 -5
  124. package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +4 -22
  125. package/tests/assets/components/create/Pega_DXIL_MyTestText/styles.ts +7 -14
  126. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
  127. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
  128. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +10 -47
  129. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/styles.ts +7 -14
  130. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
  131. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +3 -10
  132. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
  133. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
  134. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +21 -75
  135. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/styles.ts +7 -14
  136. package/{src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
  137. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
  138. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDate/date.js → Constellation/Pega_DXIL_MyDate/date.ts} +2 -2
  139. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
  140. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +18 -59
  141. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/styles.ts +7 -14
  142. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDateTime/date-time.js → Constellation/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
  143. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
  144. package/{src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.ts} +1 -0
  145. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
  146. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +12 -59
  147. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/styles.ts +7 -14
  148. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
  149. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +14 -67
  150. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/styles.ts +7 -14
  151. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
  152. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +4 -17
  153. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +7 -14
  154. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
  155. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +9 -46
  156. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/styles.ts +7 -14
  157. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
  158. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +5 -13
  159. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/styles.ts +7 -14
  160. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
  161. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +23 -87
  162. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/styles.ts +7 -14
  163. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
  164. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +5 -16
  165. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/styles.ts +7 -14
  166. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/{utils.js → utils.ts} +28 -14
  167. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +3 -13
  168. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +4 -19
  169. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
  170. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +24 -39
  171. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
  172. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
  173. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -18
  174. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/styles.ts +7 -14
  175. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
  176. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +12 -48
  177. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/styles.ts +7 -14
  178. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
  179. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +13 -54
  180. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/styles.ts +7 -14
  181. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
  182. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +13 -52
  183. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/styles.ts +7 -14
  184. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
  185. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +12 -60
  186. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/styles.ts +7 -14
  187. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
  188. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
  189. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
  190. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{date.js → date.ts} +2 -1
  191. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
  192. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{embed-utils.js → embed-utils.ts} +2 -1
  193. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +15 -76
  194. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/picklist-utils.js → Constellation/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
  195. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{repeat-constants.js → repeat-constants.ts} +1 -1
  196. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/repeat-utils.js → Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
  197. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/styles.ts +7 -14
  198. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/textformat-utils.jsx → Constellation/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
  199. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +1 -1
  200. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +8 -5
  201. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +4 -22
  202. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/styles.ts +7 -14
  203. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
  204. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +10 -50
  205. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/styles.ts +7 -14
  206. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
  207. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
  208. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
  209. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/{time-of-day.js → time-of-day.ts} +24 -23
  210. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
  211. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
  212. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
  213. package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.js → Constellation/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
  214. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
  215. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
  216. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
  217. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
  218. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +15 -71
  219. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/styles.ts +7 -14
  220. package/{src/tasks/create/templates/Constellation/Field/Text-URL/text-url.jsx.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/text-url.tsx} +4 -3
  221. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
  222. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
  223. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +10 -47
  224. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/styles.ts +7 -14
  225. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
  226. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +3 -9
  227. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
  228. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
  229. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +21 -75
  230. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/styles.ts +7 -14
  231. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDate/DateFormatter.js → Launchpad/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
  232. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
  233. package/{src/tasks/create/templates/Constellation/Field/Date/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/date.ts} +2 -2
  234. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
  235. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +18 -59
  236. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/styles.ts +7 -14
  237. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDateTime/date-time.js → Launchpad/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
  238. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
  239. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/{date.js → date.ts} +1 -0
  240. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
  241. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +12 -59
  242. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/styles.ts +7 -14
  243. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
  244. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +14 -67
  245. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/styles.ts +7 -14
  246. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
  247. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +4 -17
  248. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +7 -14
  249. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
  250. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +9 -46
  251. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/styles.ts +7 -14
  252. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
  253. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +5 -13
  254. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/styles.ts +7 -14
  255. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
  256. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +23 -87
  257. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/styles.ts +7 -14
  258. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
  259. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +5 -16
  260. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/styles.ts +7 -14
  261. package/{src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.ts} +28 -14
  262. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +1 -11
  263. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Operator.tsx +33 -51
  264. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
  265. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.tsx +22 -20
  266. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
  267. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
  268. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +4 -18
  269. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/styles.ts +7 -14
  270. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
  271. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +12 -48
  272. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/styles.ts +7 -14
  273. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
  274. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +13 -54
  275. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/styles.ts +7 -14
  276. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
  277. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +13 -52
  278. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/styles.ts +7 -14
  279. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
  280. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +12 -60
  281. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/styles.ts +7 -14
  282. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
  283. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
  284. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
  285. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.ts} +2 -1
  286. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
  287. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.ts} +2 -1
  288. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +15 -76
  289. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
  290. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.ts} +1 -1
  291. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MySearchbox/repeat-utils.js → Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
  292. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/styles.ts +7 -14
  293. package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.jsx.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
  294. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +1 -1
  295. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +8 -5
  296. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +4 -22
  297. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/styles.ts +7 -14
  298. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
  299. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +10 -50
  300. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/styles.ts +7 -14
  301. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
  302. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
  303. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
  304. package/{src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.ts} +24 -23
  305. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
  306. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
  307. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
  308. package/{src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
  309. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
  310. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
  311. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
  312. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
  313. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +15 -71
  314. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/styles.ts +7 -14
  315. package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyURL/text-url.jsx → Launchpad/Pega_DXIL_MyURL/text-url.tsx} +4 -3
  316. package/tests/functional/localCreateAllListDeleteAll.test.js +10 -3
  317. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +0 -38
  318. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
  319. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.js +0 -38
  320. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
  321. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.js +0 -38
  322. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
  323. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.js +0 -287
  324. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.js +0 -287
  325. /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{component-constants.js → component-constants.ts} +0 -0
  326. /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{format-constants.js.mustache → format-constants.ts.mustache} +0 -0
  327. /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
  328. /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
  329. /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
  330. /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
@@ -1,17 +1,20 @@
1
1
  /* eslint-disable react/jsx-no-useless-fragment */
2
2
  // @ts-nocheck
3
- import { withKnobs } from '@storybook/addon-knobs';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
4
 
5
5
  import {{COMPONENT_CLASS_NAME}} from './index';
6
6
 
7
7
  import { configProps, operatorDetails } from './mock';
8
8
 
9
- export default {
9
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
10
10
  title: '{{COMPONENT_CLASS_NAME}}',
11
- decorators: [withKnobs],
12
- component: {{COMPONENT_CLASS_NAME}}
11
+ component: {{COMPONENT_CLASS_NAME}},
12
+ excludeStories: /.*Data$/
13
13
  };
14
14
 
15
+ export default meta;
16
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
17
+
15
18
  if (!window.PCore) {
16
19
  window.PCore = {};
17
20
  }
@@ -34,7 +37,7 @@ window.PCore.getUserApi = () => {
34
37
  };
35
38
  };
36
39
 
37
- export const Base{{COMPONENT_CLASS_NAME}} = () => {
40
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
38
41
 
39
42
  const props = {
40
43
  label: configProps.label,
@@ -1,6 +1,5 @@
1
1
  import { Fragment } from 'react';
2
- import { DateTimeDisplay, Card, CardHeader, CardContent, Flex } from '@pega/cosmos-react-core';
3
- import PropTypes from 'prop-types';
2
+ import { DateTimeDisplay, Card, CardHeader, CardContent, Flex, withConfiguration } from '@pega/cosmos-react-core';
4
3
  import type { PConnFieldProps } from './PConnProps';
5
4
 
6
5
  // includes in bundle
@@ -21,12 +20,12 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
21
20
 
22
21
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
23
22
  // any default values in config.pros should be set in defaultProps at bottom of this file
24
- export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
23
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
25
24
 
26
25
  const {
27
26
  getPConnect,
28
- title,
29
- label,
27
+ title = 'Create operator',
28
+ label = 'Create operator',
30
29
  createLabel,
31
30
  updateLabel
32
31
  } = props;
@@ -48,8 +47,22 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
48
47
  <CardContent>
49
48
  {{! pick new delimiters for mustache }} {{=<% %>=}}
50
49
  <Flex container={{ direction: 'row'}}>
51
- <Operator label={_label} name={user} id={user} getPConnect={getPConnect} value={undefined} validatemessage='' hideLabel={false} readOnly={false} required={false} disabled={false} externalUser={undefined} />
52
- <%={{ }}=%> {{! revert delimiters for mustache }}
50
+ <Operator
51
+ label={_label}
52
+ name={user}
53
+ id={user}
54
+ getPConnect={getPConnect}
55
+ value={undefined}
56
+ validatemessage=''
57
+ hideLabel={false}
58
+ readOnly={false}
59
+ required={false}
60
+ disabled={false}
61
+ externalUser={undefined}
62
+ testId=''
63
+ helperText=''
64
+ metaObj={undefined}
65
+ /><%={{ }}=%> {{! revert delimiters for mustache }}
53
66
  {dateTimeValue && (
54
67
  <Fragment>
55
68
  {' '}
@@ -67,20 +80,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
67
80
 
68
81
  }
69
82
 
70
- {{COMPONENT_CLASS_NAME}}.defaultProps = {
71
- "label": "Create operator",
72
- "title": "Create operator",
73
- createLabel: null,
74
- updateLabel: null
75
- };
76
-
77
- {{COMPONENT_CLASS_NAME}}.propTypes = {
78
- getPConnect: PropTypes.func.isRequired,
79
- label: PropTypes.string,
80
- title: PropTypes.string,
81
- createLabel: PropTypes.string,
82
- updateLabel: PropTypes.string
83
- };
83
+
84
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
84
85
 
85
86
  // as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
86
87
  // same key value pairs in obj. hence using custom comparison function on when to re-render
@@ -1,15 +1,8 @@
1
-
2
- // utilizing theming, comment out, if want individual style
3
- import styled from 'styled-components';
4
- import { Configuration } from '@pega/cosmos-react-core';
5
-
6
- export default styled(Configuration)``;
7
-
8
1
  // individual style, comment out above, and uncomment here and add styles
9
- // import styled, { css } from 'styled-components';
10
- //
11
- // export default styled.div(() => {
12
- // return css`
13
- // margin: 0px 0;
14
- // `;
15
- // });
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -143,9 +143,26 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
143
143
  ({library, organization} = lpAnswers);
144
144
  }
145
145
 
146
- const spinner = ora('Fetching components from server').start();
147
- const data = await getComponentsFromServer(library, organization);
148
- spinner.stop();
146
+
147
+ let spinner;
148
+ let data;
149
+ try {
150
+ spinner = ora('Fetching components from server').start();
151
+ data = await getComponentsFromServer(library, organization);
152
+ spinner.stop();
153
+ }
154
+ catch (error) {
155
+ spinner.stop();
156
+ if (error.indexOf("ECONNREFUSED") >= 0) {
157
+ console.log(`\n${chalk.bold.red('Error occurred in authentication. Please regenerate using authenticate')}`);
158
+ }
159
+ else {
160
+ console.log(`${chalk.bold.red(error)}`);
161
+ }
162
+
163
+ // spinner.stop();
164
+ process.exit(1);
165
+ }
149
166
 
150
167
 
151
168
  // const serverComponents = isLaunchpad ? data : data.pxResults;
@@ -185,7 +202,13 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
185
202
  const componentsList = serverComponents.map((component) => `${component.name}~|~`);
186
203
  for (const componentToDelete of componentsList) {
187
204
  // eslint-disable-next-line no-await-in-loop
188
- await deleteLaunchpadServerComponent(componentToDelete);
205
+ try {
206
+ await deleteLaunchpadServerComponent(componentToDelete);
207
+ }
208
+ catch (err) {
209
+ console.log(chalk.bold.red(err.toString()));
210
+ process.exit(1);
211
+ }
189
212
  }
190
213
  }
191
214
  } else {
@@ -253,7 +276,16 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
253
276
  const [name, rulesetName, rulesetVersion] = componentToDelete.split('~|~');
254
277
  if (rulesetName === selectedComp.rulesetName && rulesetVersion === selectedComp.rulesetVersion) {
255
278
  // eslint-disable-next-line no-await-in-loop
256
- await deleteInfinityServerComponent(componentToDelete);
279
+
280
+ try {
281
+ await deleteInfinityServerComponent(componentToDelete);
282
+ }
283
+ catch (err) {
284
+ console.log(chalk.bold.red(err.toString()));
285
+ process.exit(1);
286
+ }
287
+
288
+
257
289
  }
258
290
  }
259
291
  }
@@ -28,11 +28,11 @@
28
28
  "lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
29
29
  "lint:format": "prettier -c .",
30
30
  "lint:spelling": "cspell --no-progress **/*",
31
- "test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run test:full; fi ",
32
- "test:full": "npm run test:functional && npm run test:unit",
33
- "test:functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
34
31
  "test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
35
- "test:unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components"
32
+ "_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run internal-test-full; fi ",
33
+ "_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
34
+ "_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
35
+ "_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components"
36
36
  },
37
37
  "scriptsComments": {
38
38
  "build": "tsc -b tsconfig.build.json",
@@ -69,8 +69,8 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@pega/configs": "^0.6.0",
72
- "@pega/custom-dx-components": "0.23.35",
73
- "@pega/pcore-pconnect-typedefs": "2.0.0",
72
+ "@pega/custom-dx-components": "0.23.37",
73
+ "@pega/pcore-pconnect-typedefs": "~2.1.1",
74
74
  "@storybook/addon-actions": "^7.6.7",
75
75
  "@storybook/addon-essentials": "^7.6.7",
76
76
  "@storybook/addon-knobs": "^7.0.2",
@@ -34,5 +34,6 @@
34
34
  "subtype": "",
35
35
  "description": "",
36
36
  "icon": ""
37
- }
37
+ },
38
+ "usePromotedWebPack": false
38
39
  }
@@ -15,12 +15,15 @@ export const lintComponent = async (dirToLint) => {
15
15
  const formatter = await eslint.loadFormatter("stylish");
16
16
  const resultText = formatter.format(results);
17
17
 
18
- // 4. Output it.
19
- // console.log(`lint resultText: ${resultText}`);
20
- console.log(resultText);
21
-
22
18
  // Indicate linting is complete
23
19
  console.log(chalk.green(` linting complete...`));
20
+
21
+ if (resultText.length > 0 && resultText.indexOf("error") >= 0) {
22
+ throw new Error( "Lint:\n" + resultText );
23
+ }
24
+ else {
25
+ console.log(resultText);
26
+ }
24
27
  };
25
28
 
26
29
  // inpsired by https://eslint.org/docs/latest/developer-guide/nodejs-api
@@ -102,6 +102,15 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
102
102
  })
103
103
  .then((response) => {
104
104
  status = response.status;
105
+ if (status === 404){
106
+ throw new Error('404: Server resource not found');
107
+ }
108
+ else if (status === 405){
109
+ throw new Error('405: Server method not allowed');
110
+ }
111
+ else if (status === 408){
112
+ throw new Error('408: Server timed out');
113
+ }
105
114
  return response.json();
106
115
  })
107
116
  .then((resp) => {
@@ -122,6 +131,7 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
122
131
  }
123
132
 
124
133
  async function fetchComponentsFromLaunchpad(apiUrl, headers) {
134
+
125
135
  const serverConfig = await getPegaServerConfig();
126
136
  // constructing urls for all type of components
127
137
  const urls = COMPONENT_SCHEMA.type.map((type) => apiUrl.replace('{type}', type.value));
@@ -1,5 +1,6 @@
1
1
  import inquirer from 'inquirer';
2
2
  import ora from 'ora';
3
+ import chalk from 'chalk';
3
4
 
4
5
  import { showVersion, getPegaServerConfig } from '../../util.js';
5
6
 
@@ -35,9 +36,25 @@ const getList = async (sourceOfComponents, answers) => {
35
36
 
36
37
 
37
38
  const spinner = ora('Fetching components from server\n').start();
38
- const data = await getComponentsFromServer(library, organization);
39
- spinner.stop();
40
- await displayServerComponents(data, answers);
39
+
40
+ try {
41
+ const data = await getComponentsFromServer(library, organization);
42
+ spinner.stop();
43
+ await displayServerComponents(data, answers);
44
+ }
45
+ catch (error) {
46
+
47
+ if (error.indexOf("ECONNREFUSED") >= 0) {
48
+ console.log(`\n${chalk.bold.red('Error occurred in authentication. Please regenerate using authenticate')}`);
49
+ }
50
+ else {
51
+ console.log(`${chalk.bold.red(error)}`);
52
+ }
53
+
54
+ // spinner.stop();
55
+ process.exit(1);
56
+ }
57
+
41
58
 
42
59
  break;
43
60
  }
@@ -9,7 +9,8 @@ import inquirer from 'inquirer';
9
9
  import {
10
10
  convertIntoPascalCase,
11
11
  checkPathAccess,
12
- showVersion
12
+ showVersion,
13
+ updateUseWebPackPromotion
13
14
  } from '../../util.js';
14
15
 
15
16
  import {
@@ -91,36 +92,12 @@ export const copyWebPack = async () => {
91
92
 
92
93
  }
93
94
 
94
- export const updateBuilder = async () => {
95
95
 
96
- const builderIndexDir = fileURLToPath(new URL(BUILDER_INDEX_FILE_PATH, import.meta.url));
97
-
98
- let indexFileJS = fs.readFileSync(builderIndexDir, { encoding: 'utf8' });
99
-
100
- if (indexFileJS.length > 0) {
101
- // comment out original webpack reference
102
-
103
- // if not commented out, comment out
104
- if (indexFileJS.indexOf("// import configFactory from './webpack.config.js';") < 0) {
105
- indexFileJS = indexFileJS.replaceAll("import configFactory from './webpack.config.js';", "// import configFactory from './webpack.config.js';");
106
- }
107
-
108
- // uncomment out promoted webpack reference
109
- indexFileJS = indexFileJS.replaceAll("// import configFactory from '../../../../../../../webpack.config.js';", "import configFactory from '../../../../../../../webpack.config.js';");
110
-
111
- fs.writeFileSync(builderIndexDir, indexFileJS, { encoding: 'utf8' });
112
-
113
- console.log(chalk.bold.green(`Bundler now using ${redirectFile}.`));
114
- console.log(chalk.bold.green(`Utilize this file for webpack modifications.`));
115
- }
116
-
117
-
118
- }
119
96
 
120
97
  export default async options => {
121
98
  showVersion();
122
99
 
123
100
  await copyWebPack();
124
- await updateBuilder();
101
+ await updateUseWebPackPromotion(true);
125
102
 
126
103
  };
@@ -94,7 +94,7 @@ export const zipComponent = async componentKey => {
94
94
 
95
95
  const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
96
96
 
97
- fs.rmdir('dist', { recursive: true }, err => {
97
+ fs.rm('dist', { recursive: true }, err => {
98
98
  if (err) {
99
99
  throw err;
100
100
  }
@@ -9,7 +9,7 @@ import { getComponentDirectoryPath, showVersion } from '../../util.js';
9
9
 
10
10
  import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
11
11
 
12
- export default async (options) => {
12
+ export default async options => {
13
13
  showVersion();
14
14
 
15
15
  let componentKey;
@@ -19,13 +19,15 @@ export default async (options) => {
19
19
 
20
20
  let doFetch = true;
21
21
 
22
- if (options.params.length >= 8) {
22
+ if (options.params.length >= 7) {
23
23
  componentKey = options.params[3];
24
24
  const rulesetName = options.params[4];
25
25
  const rulesetVersion = options.params[5];
26
26
  const dBuild = options.params[6];
27
27
  devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
28
- doFetch = false;
28
+
29
+ // eslint-disable-next-line no-unneeded-ternary,no-nested-ternary
30
+ doFetch = options.params.length >= 7 ? (options.params[7] === 'noFetch' ? false : true) : true;
29
31
 
30
32
  content = { componentKey, rulesetName, rulesetVersion, devBuild };
31
33
  } else {
@@ -79,7 +81,7 @@ export default async (options) => {
79
81
  }
80
82
  );
81
83
 
82
- await tasks.run().catch((err) => {
84
+ await tasks.run().catch(err => {
83
85
  console.log(chalk.bold.red(err.toString()));
84
86
  });
85
87
  return true;
@@ -159,55 +159,67 @@ export const publishComponentToServer = async (data, doFetch) => {
159
159
  headers.Authorization = `${tokenType} ${accessToken}`;
160
160
  }
161
161
 
162
- fetch(url, {
162
+
163
+ const response = await fetch(url, {
163
164
  method: 'POST',
164
165
  agent: getHttpsAgent(defaultPegaConfig),
165
- headers,
166
+ headers: headers,
166
167
  body: JSON.stringify(apiBody)
167
- })
168
- .then(response => {
169
- status = response.status;
170
- return response.text();
171
- })
172
- .then(resp => {
173
- const respData = isLaunchpad ? resp : JSON.parse(resp);
174
- if (status === 401) {
175
- throw new Error(
176
- 'Error occurred in authentication. Please regenerate using authenticate'
177
- );
178
- // console.log(accessTokenUri, refreshToken);
179
- /* TODO - Handle refresh_token */
180
- } else if (status === 200 || status === 201) {
181
- console.log(
168
+ });
169
+
170
+ status = response.status;
171
+ if (!response.ok) {
172
+ if (status === 401) {
173
+ throw new Error(
174
+ 'Error occurred in authentication. Please regenerate using authenticate'
175
+ );
176
+ // console.log(accessTokenUri, refreshToken);
177
+ /* TODO - Handle refresh_token */
178
+ }
179
+ else if (status === 404){
180
+ throw new Error('404: Server resource not found');
181
+ }
182
+ else if (status === 405){
183
+ throw new Error('405: Server method not allowed');
184
+ }
185
+ else if (status === 408){
186
+ throw new Error('408: Server timed out');
187
+ }
188
+ else if (response.status === 403) {
189
+ throw new Error(
190
+ 'Error forbidden: User does not have privileges to Publish.'
191
+ );
192
+ }
193
+ }
194
+
195
+ try {
196
+ const respData = isLaunchpad ? await response.text() : await response.json();
197
+ console.log(
182
198
  chalk.bold.green(`Success : ${isLaunchpad ? respData : respData.message}`)
199
+ );
200
+
201
+ if (status === 500) {
202
+ status = 999;
203
+ throw new Error(respData.message);
204
+ }
205
+ }
206
+ catch (err) {
207
+ if (status === 500) {
208
+ throw new Error(
209
+ `Error occurred in authentication. Please regenerate using authenticate`
183
210
  );
184
- } else {
185
- throw new Error(`${respData.message}`);
186
- }
187
- })
188
- .catch(e => {
189
- if (e.code === 'ECONNREFUSED') {
190
- // eslint-disable-next-line prefer-promise-reject-errors
191
- Promise.reject(
192
- `${chalk.bold.red(
193
- 'Error occurred in authentication. Please regenerate using authenticate'
194
- )}`
195
- );
196
- } else if (status === 403) {
197
- // eslint-disable-next-line prefer-promise-reject-errors
198
- Promise.reject(
199
- `${chalk.bold.red('Error forbidden: User does not have privileges to Publish.')}`
200
- );
201
- } else {
202
- // eslint-disable-next-line prefer-promise-reject-errors
203
- Promise.reject(`${chalk.bold.red(e)}`);
204
- }
205
- });
211
+ }
212
+ else if (status === 999) {
213
+ throw new Error (err);
214
+ }
215
+ }
216
+
206
217
  } else {
207
218
  throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
208
219
  }
209
220
  } catch (err) {
210
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
221
+ // throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
222
+ throw new Error(err);
211
223
  }
212
224
  }
213
225
  };
@@ -16,8 +16,8 @@ import {
16
16
 
17
17
  export function getCustomTasks(componentKey, sourceMap, devBuild, content, options) {
18
18
  const sDevBuild = devBuild ? '(dev build)' : '';
19
- // eslint-disable-next-line no-unneeded-ternary
20
- const doFetch = options.params.length >= 7 ? false : true;
19
+ // eslint-disable no-unneeded-ternary,no-nested-ternary
20
+ const doFetch = options.params.length >= 7 ? (options.params[6] === 'noFetch' ? false : true) : true;
21
21
  return new Listr(
22
22
  [
23
23
  {
@@ -26,13 +26,6 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
26
26
  await validate(componentKey);
27
27
  }
28
28
  },
29
- {
30
- title: `Bundle Component ${sDevBuild}`,
31
- task: async () => {
32
- await bundleComponent(componentKey, sourceMap, devBuild);
33
- },
34
- skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
35
- },
36
29
  {
37
30
  title: 'Lint component',
38
31
  task: async () => {
@@ -41,6 +34,13 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
41
34
  await lintComponent(targetDirectory);
42
35
  }
43
36
  },
37
+ {
38
+ title: `Bundle Component ${sDevBuild}`,
39
+ task: async () => {
40
+ await bundleComponent(componentKey, sourceMap, devBuild);
41
+ },
42
+ skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
43
+ },
44
44
  {
45
45
  title: 'Zip Component',
46
46
  task: async () => {
@@ -55,9 +55,7 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
55
55
  }
56
56
  }
57
57
  ],
58
- {
59
- exitOnError: true
60
- }
58
+ { concurrent: false, exitOnError: true }
61
59
  );
62
60
  }
63
61
 
@@ -76,7 +74,7 @@ export default async options => {
76
74
  let devBuild;
77
75
  let content;
78
76
 
79
- if (options.params.length >= 7) {
77
+ if (options.params.length >= 6) {
80
78
  const rulesetName = options.params[3];
81
79
  const rulesetVersion = options.params[4];
82
80
  const dBuild = options.params[5];
@@ -94,16 +92,17 @@ export default async options => {
94
92
  }
95
93
 
96
94
  // eslint-disable-next-line no-shadow
97
- for (const componentKey of components) {
95
+ for await (const componentKey of components) {
98
96
  console.log(chalk.bold.green(`Publishing: ${componentKey}`));
99
97
 
100
98
  const myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild, content, options);
101
99
 
102
- // eslint-disable-next-line no-await-in-loop
103
- await myCustomTasks.run().catch(err => {
100
+ try {
101
+ await myCustomTasks.run();
102
+ } catch (err) {
104
103
  console.log(chalk.bold.red(err.toString()));
105
104
  process.exit(1);
106
- });
105
+ }
107
106
  }
108
107
 
109
108
  // once done, remove leftover directories
@@ -8,7 +8,8 @@ import { up } from 'inquirer/lib/utils/readline.js';
8
8
 
9
9
  import {
10
10
  convertIntoPascalCase,
11
- showVersion
11
+ showVersion,
12
+ updateUseWebPackPromotion
12
13
  } from '../../util.js';
13
14
  import {
14
15
  WEBPACK_CONFIG_JS_FILENAME,
@@ -37,33 +38,12 @@ export const renamePromotedWebPack = async () => {
37
38
 
38
39
  }
39
40
 
40
- export const revertBuilder = async () => {
41
41
 
42
- const builderIndexDir = fileURLToPath(new URL(BUILDER_INDEX_FILE_PATH, import.meta.url));
43
-
44
- let indexFileJS = fs.readFileSync(builderIndexDir, { encoding: 'utf8' });
45
-
46
- if (indexFileJS.length > 0) {
47
- // uncomment out original webpack reference
48
- indexFileJS = indexFileJS.replaceAll("// import configFactory from './webpack.config.js';", "import configFactory from './webpack.config.js';");
49
-
50
- // comment out promoted webpack reference
51
- if (indexFileJS.indexOf("// import configFactory from '../../../../../../../webpack.config.js';") < 0) {
52
- indexFileJS = indexFileJS.replaceAll("import configFactory from '../../../../../../../webpack.config.js';", "// import configFactory from '../../../../../../../webpack.config.js';");
53
- }
54
-
55
- fs.writeFileSync(builderIndexDir, indexFileJS, { encoding: 'utf8' });
56
-
57
- console.log(chalk.bold.green(`Bundler reverted to using internal webpack.config.js.`));
58
- }
59
-
60
-
61
- }
62
42
 
63
43
  export default async options => {
64
44
  showVersion();
65
45
 
66
46
  await renamePromotedWebPack();
67
- await revertBuilder();
47
+ await updateUseWebPackPromotion(false);
68
48
 
69
49
  };