@pega/custom-dx-components 0.23.3 → 0.23.5

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 +37 -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 +17 -7
  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 +72 -48
  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 +21 -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 +544 -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 -390
  254. package/src/tasks/generate-ai/index.js +0 -34
package/src/cli.js CHANGED
@@ -9,12 +9,13 @@ import {
9
9
  createAllComponents,
10
10
  deleteComponent,
11
11
  deleteAllComponents,
12
- generateWithAI,
13
12
  initProject,
14
13
  listComponents,
15
14
  publishComponent,
16
15
  publishAllComponents,
17
16
  renameComponent,
17
+ revertWebPack,
18
+ promoteWebPack,
18
19
  updateComponent,
19
20
  validate,
20
21
  upgrade
@@ -26,7 +27,8 @@ const TASKS = {
26
27
  CREATE_ALL: 'createAll',
27
28
  BUILD: 'buildComponent',
28
29
  BUILD_ALL: 'buildAllComponents',
29
- GENERATE_WITH_AI: 'generateWithAI',
30
+ PROMOTE_WEBPACK: 'promoteWebPack',
31
+ REVERT_WEBPACK: 'revertWebPack',
30
32
  PUBLISH: 'publish',
31
33
  PUBLISH_All: 'publishAll',
32
34
  RENAME: 'rename',
@@ -53,7 +55,7 @@ const parseArgumentsIntoOptions = rawArgs => {
53
55
  task: args._[0],
54
56
  git: true, // args['--git'] || false
55
57
  runInstall: true, // args['--install'] || false
56
- skipBundle: false,
58
+ skipBundle: args['--skipBundle'] || false,
57
59
  params: rawArgs
58
60
  };
59
61
  };
@@ -74,8 +76,12 @@ export default async (args = []) => {
74
76
  createAllComponents(options);
75
77
  break;
76
78
  }
77
- case TASKS.GENERATE_WITH_AI: {
78
- generateWithAI(options);
79
+ case TASKS.PROMOTE_WEBPACK: {
80
+ promoteWebPack(options);
81
+ break;
82
+ }
83
+ case TASKS.REVERT_WEBPACK: {
84
+ revertWebPack(options);
79
85
  break;
80
86
  }
81
87
  case TASKS.PUBLISH: {
package/src/constants.js CHANGED
@@ -1,40 +1,48 @@
1
1
  // cSpell:ignore words timeofday caseview casepreview objectview
2
2
  export const TASKS_CONFIG_JSON_FILENAME = 'tasks.config.json';
3
+ export const PACKAGE_JSON_FILENAME = 'package.json';
3
4
  export const BUILD_CONFIG_JSON_FILENAME = 'build.config.json';
5
+ export const WEBPACK_CONFIG_JS_FILENAME = 'webpack.config.js';
6
+ export const WEBPACK_PATHS_JS_FILENAME = 'paths.js';
4
7
  export const COMPONENTS_DIRECTORY_PATH = 'components-directory-path';
5
- export const COMPONENTS_PATH = 'component'
8
+ export const COMPONENTS_PATH = 'component';
6
9
  export const TOKEN_PATH = 'node_modules/@pega/custom-dx-components/.access_token';
7
- export const SERVICE_TOKEN_PATH = 'node_modules/@pega/custom-dx-components/.service_token';
8
10
  export const OOTB_COMPONENTS = 'node_modules/@pega/custom-dx-components/.ootb_components';
9
- export const AI_PROMPT_FILENAME = 'aiPrompt.txt.mustache';
10
- export const AI_DAVINCI_PROMPT_FILENAME = 'aiPromptDavinci.txt.mustache';
11
11
 
12
12
  /* REST end points */
13
13
  export const PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT = 'PRRestService/dev/v1/publish_component';
14
14
  export const LIST_COMPONENT_SERVICE_REST_ENDPOINT = 'PRRestService/dev/v1/list_component';
15
15
  export const OOTB_COMPONENT_SERVICE_REST_ENDPOINT = 'PRRestService/dev/v1/ootb_component';
16
16
  export const DELETE_COMPONENT_SERVICE_REST_ENDPOINT = 'PRRestService/dev/v1/delete_component';
17
- export const BOOTSTRAP_SERVICE_REST_ENDPOINT = "PRRestService/application/v2/data_views/D_pxBootstrapConfig";
18
- export const DXCOMPGENAI_SERVICE_REST_ENDPOINT = "PRRestService/application/v2/data_views/D_DXCompAIGenList";
19
-
20
- export const SERVICES_AI_REST_ENDPOINT = 'generativeai';
21
17
  export const INF_TOKEN_URL_V1 = 'PRRestService/oauth2/v1/token';
22
18
  export const INF_AUTHORIZE_URL_V1 = 'PRRestService/oauth2/v1/authorize';
23
19
  export const LP_TOKEN_URL = 'uas/oauth/token';
24
20
  export const LP_AUTHORIZE_URL = 'uas/oauth/authorize';
25
- export const LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT = 'pegalaunchpad/c11n/v103/app/appstudiox/componentslist';
26
-
27
-
21
+ export const LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT = 'pegalaunchpad/c11n/v103/app/appstudiox/componentslist?field0=type&value0={type}';
22
+ export const LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT = 'pegalaunchpad/c11n/isolations/{isolationId}/v102/assetsUpdate';
23
+ export const LP_DELETE_COMPONENT_SERVICE_REST_ENDPOINT = 'pegalaunchpad/c11n/isolations/{isolationId}/v102/assetsUpdate';
28
24
 
29
25
  export const FIELD_PATH = '/field';
30
26
  export const TEMPLATE_PATH = '/template';
31
27
  export const WIDGET_PATH = '/widget';
32
28
 
33
- export const COMPONENT_PREFIX_FIELD_PATH = "field/";
34
- export const COMPONENT_PREFIX_TEMPLATE_PATH = "template/";
35
- export const COMPONENT_PREFIX_WIDGET_PATH = "widget/";
29
+ export const COMPONENT_PREFIX_FIELD_PATH = 'field/';
30
+ export const COMPONENT_PREFIX_TEMPLATE_PATH = 'template/';
31
+ export const COMPONENT_PREFIX_WIDGET_PATH = 'widget/';
36
32
 
37
- export const CATEGORY_CONSTELLATION = "constellation";
33
+ export const BUILDER_INDEX_FILE_PATH = '../bundle/builder/index.js';
34
+ export const BUILDER_DIR_FILE_PATH = '../bundle/builder';
35
+
36
+ export const CATEGORY_CONSTELLATION = 'constellation';
37
+
38
+ export const AUTHENTICATE_DEFAULTS = {
39
+ serverType: 'infinity',
40
+ server: 'https://localhost:1080/prweb',
41
+ clientId: '10095186356008396159',
42
+ grantType: 'authCode',
43
+ authService: 'pega',
44
+ redirectUri: 'https://localhost:4010/'
45
+ };
38
46
 
39
47
  export const AUTHENTICATE_SCHEMA = {
40
48
  serverType: [
@@ -64,16 +72,6 @@ export const AUTHENTICATE_SCHEMA = {
64
72
  };
65
73
 
66
74
  export const COMPONENT_SCHEMA = {
67
- generationType: [
68
- {
69
- name: 'Constellation Design System',
70
- value: 'CDS'
71
- },
72
- {
73
- name: 'AI Generation',
74
- value: 'AI'
75
- }
76
- ],
77
75
  framework: [
78
76
  {
79
77
  name: 'Constellation',
@@ -0,0 +1 @@
1
+ module.exports = __dirname;
@@ -1,30 +1,47 @@
1
1
  /* eslint-disable import/prefer-default-export */
2
- import { getPegaServerConfig } from '../../util.js';
3
-
4
- import { AUTHENTICATE_SCHEMA } from '../../constants.js';
2
+ import { AUTHENTICATE_SCHEMA, AUTHENTICATE_DEFAULTS } from '../../constants.js';
5
3
 
6
4
  export const getAuthQuestions = async (dxcbConfig) => {
7
5
  const defaultPegaConfig = dxcbConfig;
8
- const aMustAsk = dxcbConfig['questions_askAlways'] ? dxcbConfig['questions_askAlways'].split(',') : [];
9
- const aNeverAsk = dxcbConfig['questions_askNever'] ? dxcbConfig['questions_askNever'].split(',') : [];
6
+ const aAlwaysAsk = dxcbConfig.questions_askAlways ? dxcbConfig.questions_askAlways.split(',') : [];
7
+ const aNeverAsk = dxcbConfig.questions_askNever ? dxcbConfig.questions_askNever.split(',') : [];
8
+ const aAskOnce = dxcbConfig.questions_askOnce ? dxcbConfig.questions_askOnce.split(',') : [];
9
+ const aAskedOnce = dxcbConfig.questions_askedOnce ? dxcbConfig.questions_askedOnce.split(',') : [];
10
+
11
+ // Ask if various must, never, once criteria are met
12
+ const askThisTime = (prop) => {
13
+ return aAlwaysAsk.includes(prop) ||
14
+ (!aNeverAsk.includes(prop) && (aAskOnce.includes(prop) && !aAskedOnce.includes(prop)));
15
+ };
16
+
17
+ const initAnswer = (prop, defValue) => {
18
+ if (askThisTime(prop)) {
19
+ return undefined;
20
+ }
21
+ return defaultPegaConfig[prop] ? defaultPegaConfig[prop] : defValue;
22
+ };
10
23
 
11
24
  const initAnswers = (answers) => {
12
25
  // Setup default answers (if they are present and non-empty)
13
- answers.serverType = defaultPegaConfig.serverType || "infinity";
14
- answers.server = defaultPegaConfig.server || undefined;
15
- answers.isolationId = defaultPegaConfig.isolationId || undefined;
16
- answers.clientId = defaultPegaConfig.clientId || undefined;
17
- answers.grantType = defaultPegaConfig.grantType || "authCode";
18
- answers.clientSecret = defaultPegaConfig.clientSecret || undefined;
19
- answers.user = defaultPegaConfig.user || undefined;
20
- answers.password = defaultPegaConfig.password || undefined;
26
+ answers.serverType = initAnswer('serverType', AUTHENTICATE_DEFAULTS.serverType);
27
+ answers.server = initAnswer('server', AUTHENTICATE_DEFAULTS.server);
28
+ answers.isolationId = initAnswer('isolationId');
29
+ answers.clientId = initAnswer('clientId', AUTHENTICATE_DEFAULTS.clientId);
30
+ answers.grantType = initAnswer('grantType', AUTHENTICATE_DEFAULTS.grantType);
31
+ answers.authService = initAnswer('authService', AUTHENTICATE_DEFAULTS.authService);
32
+ answers.redirectUri = initAnswer('redirectUri', AUTHENTICATE_DEFAULTS.redirectUri);
33
+ answers.clientSecret = initAnswer('clientSecret');
34
+ answers.user = initAnswer('user');
35
+ answers.password = initAnswer('password');
36
+ answers.aAsked = [];
21
37
  };
22
38
 
23
39
  const fnStandardWhen = (prop, answers) => {
24
- if (aNeverAsk.includes(prop)) {
25
- return false;
40
+ const ask = askThisTime(prop) || !answers[prop];
41
+ if (ask) {
42
+ answers.aAsked.push(prop);
26
43
  }
27
- return aMustAsk.includes(prop) || !answers[prop];
44
+ return ask;
28
45
  };
29
46
 
30
47
  return [
@@ -49,16 +66,30 @@ export const getAuthQuestions = async (dxcbConfig) => {
49
66
  },
50
67
  {
51
68
  name: 'server',
69
+ type: 'input',
52
70
  message: 'Enter pega server url',
53
71
  default: defaultPegaConfig.server,
72
+ validate: value => {
73
+ if (value.trim()) {
74
+ return true;
75
+ }
76
+ return 'Pega server cannot be empty';
77
+ },
54
78
  when: answers => {
55
79
  return fnStandardWhen('server', answers);
56
80
  }
57
81
  },
58
82
  {
59
83
  name: 'isolationId',
84
+ tpye: 'input',
60
85
  message: 'Enter isolation id',
61
86
  default: defaultPegaConfig.isolationId,
87
+ validate: value => {
88
+ if (value.trim()) {
89
+ return true;
90
+ }
91
+ return 'Launchpad isolationId cannot be empty';
92
+ },
62
93
  when: answers => {
63
94
  return answers.serverType === "launchpad" && fnStandardWhen('isolationId', answers);
64
95
  }
@@ -81,8 +112,39 @@ export const getAuthQuestions = async (dxcbConfig) => {
81
112
  return fnStandardWhen('grantType', answers);
82
113
  }
83
114
  },
115
+ {
116
+ name: 'authService',
117
+ type: 'input',
118
+ message: 'Enter authentication service alias',
119
+ default: defaultPegaConfig.authService,
120
+ validate: value => {
121
+ if (value.trim()) {
122
+ return true;
123
+ }
124
+ return 'Authentication service alias cannot be empty';
125
+ },
126
+ when: answers => {
127
+ return answers.serverType === "infinity" && answers.grantType === "authCode" && fnStandardWhen('authService', answers);
128
+ }
129
+ },
130
+ {
131
+ name: 'redirectUri',
132
+ type: 'input',
133
+ message: 'Enter valid redirect Uri within OAuth 2.0 client reg reccord',
134
+ default: defaultPegaConfig.redirectUri,
135
+ validate: value => {
136
+ if (value.trim()) {
137
+ return true;
138
+ }
139
+ return 'Redirect URI cannot be empty';
140
+ },
141
+ when: answers => {
142
+ return answers.serverType === "infinity" && answers.grantType === "authCode" && fnStandardWhen('redirectUri', answers);
143
+ }
144
+ },
84
145
  {
85
146
  name: 'user',
147
+ type: 'input',
86
148
  message: 'Enter user id',
87
149
  default: defaultPegaConfig.user,
88
150
  validate: (value, answers) => {
@@ -112,6 +174,7 @@ export const getAuthQuestions = async (dxcbConfig) => {
112
174
  },
113
175
  {
114
176
  name: 'clientId',
177
+ type: 'input',
115
178
  message: 'Enter clientId',
116
179
  default: defaultPegaConfig.clientId,
117
180
  validate: value => {
@@ -129,14 +192,15 @@ export const getAuthQuestions = async (dxcbConfig) => {
129
192
  type: 'password',
130
193
  message: 'Enter clientSecret',
131
194
  default: defaultPegaConfig.clientSecret,
132
- validate: (value, answers) => {
195
+ validate: value => {
133
196
  if (value.trim()) {
134
197
  return true;
135
198
  }
136
199
  return 'clientSecret cannot be empty';
137
200
  },
138
201
  when: answers => {
139
- return (answers.grantType !== "authCode" && fnStandardWhen('clientSecret', answers));
202
+ return (((answers.serverType === "infinity" && answers.grantType !== "authCode") ||
203
+ answers.serverType === "launchpad") && fnStandardWhen('clientSecret', answers));
140
204
  }
141
205
  }
142
206
  ];
@@ -4,7 +4,7 @@ import fs from 'node:fs';
4
4
  import chalk from 'chalk';
5
5
  import inquirer from 'inquirer';
6
6
 
7
- import { checkPathAccess, showVersion, storeServicesToken } from '../../util.js';
7
+ import { checkPathAccess, showVersion } from '../../util.js';
8
8
  import { TOKEN_PATH, INF_TOKEN_URL_V1, INF_AUTHORIZE_URL_V1, LP_TOKEN_URL, LP_AUTHORIZE_URL } from '../../constants.js';
9
9
 
10
10
  import { getAuthQuestions } from './helper.js';
@@ -144,8 +144,9 @@ export default async options => {
144
144
  const questions = await getAuthQuestions(serverConfig);
145
145
  // console.log(`questions: ${JSON.stringify(questions)}`);
146
146
  const answers = await inquirer.prompt(questions);
147
- const aProps = ['serverType', 'server', 'isolationId', 'clientId', 'grantType', 'clientSecret', 'user', 'password'];
148
- serverConfig.authService = serverConfig.authService || 'pega';
147
+ const aAsked = answers.aAsked;
148
+ delete answers.aAsked;
149
+ const aProps = ['serverType', 'server', 'isolationId', 'clientId', 'grantType', 'authService', 'redirectUri', 'clientSecret', 'user', 'password'];
149
150
  const isLaunchPad = answers.serverType === "launchpad";
150
151
  let bWriteUpdate = false;
151
152
  for (let i = 0; i < aProps.length; i += 1) {
@@ -161,6 +162,23 @@ export default async options => {
161
162
  }
162
163
  }
163
164
  }
165
+ // Update the askedOnce array based on askOnce criteria
166
+ const aAskOnce = serverConfig['questions_askOnce'] ? serverConfig['questions_askOnce'].split(',') : [];
167
+ const aAskedOnce = serverConfig['questions_askedOnce'] ? serverConfig['questions_askedOnce'].split(',') : [];
168
+ let bAskedOnceUpdated = false;
169
+ for (let j = 0; j < aAsked.length; j += 1) {
170
+ const prop = aAsked[j];
171
+ if (aAskOnce.includes(prop) && !aAskedOnce.includes(prop)) {
172
+ // Add entries we want to only ask once to the asked list if appropriate
173
+ aAskedOnce.push(prop);
174
+ bAskedOnceUpdated = true;
175
+ }
176
+ }
177
+ // If askedOnce array was updated we need to update value in config
178
+ if (bAskedOnceUpdated) {
179
+ serverConfig['questions_askedOnce'] = aAskedOnce.join(',');
180
+ bWriteUpdate = true;
181
+ }
164
182
 
165
183
  try {
166
184
  // console.log(`serverConfig: ${JSON.stringify(serverConfig)}`);
@@ -169,10 +187,6 @@ export default async options => {
169
187
  console.log(`${chalk.bold.red('Authentication failed:' + JSON.stringify(e))}`);
170
188
  }
171
189
 
172
- if (authOK) {
173
- await storeServicesToken();
174
- }
175
-
176
190
  if (authOK & bWriteUpdate) {
177
191
  // Don't write password value (unless it already had a value)
178
192
  if (!isPwdNonEmpty) {
@@ -16,6 +16,12 @@ import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH } from '../../const
16
16
 
17
17
  export const getPublishComponentQuestions = async () => {
18
18
  const components = await getComponents();
19
+
20
+ if (components.length === 0) {
21
+ console.log(chalk.redBright('No components to build'));
22
+ process.exit(1);
23
+ }
24
+
19
25
  const defaultPegaConfig = await getPegaServerConfig();
20
26
 
21
27
  return [
@@ -29,17 +35,19 @@ export const getPublishComponentQuestions = async () => {
29
35
  name: 'sourceMap',
30
36
  message: 'Generate source map ?',
31
37
  default: defaultPegaConfig.sourceMap,
38
+ // eslint-disable-next-line sonarjs/no-redundant-boolean
32
39
  when: () => false && !process.env.SOURCE_MAP
33
40
  },
34
41
  {
35
42
  name: 'devBuild',
43
+ type: 'confirm',
36
44
  message: 'Generate development build ?',
37
45
  default: defaultPegaConfig.devBuild
38
46
  }
39
47
  ];
40
48
  };
41
49
 
42
- export const zipComponent = async componentKey => {
50
+ export const zipComponent = async (componentKey) => {
43
51
  const srcDirectory = await getComponentDirectoryPath(componentKey);
44
52
  const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
45
53
  const configJson = `${srcDirectory}/config.json`;
@@ -52,7 +60,7 @@ export const zipComponent = async componentKey => {
52
60
  const zipContent = zip.toBuffer().toString('base64');
53
61
 
54
62
  const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
55
- fs.rmdir('dist', { recursive: true }, err => {
63
+ fs.rmdir('dist', { recursive: true }, (err) => {
56
64
  if (err) {
57
65
  throw err;
58
66
  }
@@ -60,8 +68,8 @@ export const zipComponent = async componentKey => {
60
68
  return { zipContent, configContent };
61
69
  };
62
70
 
63
- export const publishComponentToServer = async data => {
64
- const { configContent, zipContent, componentKey, rulesetName, rulesetVersion } = data;
71
+ export const publishComponentToServer = async (data) => {
72
+ const { configContent, zipContent, rulesetName, rulesetVersion } = data;
65
73
 
66
74
  const apiBody = {
67
75
  configContent,
@@ -94,11 +102,11 @@ export const publishComponentToServer = async data => {
94
102
  },
95
103
  body: JSON.stringify(apiBody)
96
104
  })
97
- .then(response => {
105
+ .then((response) => {
98
106
  status = response.status;
99
107
  return response.text();
100
108
  })
101
- .then(resp => {
109
+ .then((resp) => {
102
110
  const respData = JSON.parse(resp);
103
111
  if (status === 401) {
104
112
  throw new Error(
@@ -106,13 +114,14 @@ export const publishComponentToServer = async data => {
106
114
  );
107
115
  // console.log(accessTokenUri, refreshToken);
108
116
  /* TODO - Handle refresh_token */
109
- } else if (status == 200) {
117
+ } else if (status === 200) {
110
118
  console.log(chalk.bold.green(`Success : ${respData.message}`));
111
119
  } else {
112
120
  throw new Error(`${respData.message}`);
113
121
  }
114
122
  })
115
- .catch(e => Promise.reject(`${chalk.bold.red(e)}`));
123
+ // eslint-disable-next-line prefer-promise-reject-errors
124
+ .catch((e) => Promise.reject(`${chalk.bold.red(e)}`));
116
125
  } else {
117
126
  throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
118
127
  }
@@ -12,14 +12,35 @@ import { getComponentDirectoryPath, showVersion } from '../../util.js';
12
12
  export default async options => {
13
13
  showVersion();
14
14
 
15
- const questions = await getPublishComponentQuestions();
16
- const answers = await inquirer.prompt(questions);
17
- const { componentKey, sourceMap, devBuild } = answers;
15
+ let componentKey;
16
+ let sourceMap;
17
+ let devBuild;
18
+ let content;
18
19
 
19
- let content = {
20
- ...answers
21
- };
20
+ if (options.params.length >= 6) {
21
+ componentKey = options.params[3];
22
+ sourceMap = options.params[4];
23
+ const dBuild = options.params[5];
24
+ devBuild = (dBuild === 'Y' ||
25
+ dBuild === 'y' ||
26
+ dBuild === true ||
27
+ dBuild === 'true') ? true : false;
22
28
 
29
+ content = { componentKey, sourceMap, devBuild};
30
+ }
31
+ else {
32
+ const questions = await getPublishComponentQuestions();
33
+ const answers = await inquirer.prompt(questions);
34
+ ({ componentKey, sourceMap, devBuild } = answers);
35
+
36
+ content = {
37
+ ...answers
38
+ };
39
+ }
40
+
41
+
42
+
43
+ const sDevBuild = devBuild ? '(dev build)' : '';
23
44
  const tasks = new Listr(
24
45
  [
25
46
  {
@@ -37,7 +58,8 @@ export default async options => {
37
58
  }
38
59
  },
39
60
  {
40
- title: 'Bundle Component',
61
+ title: `Bundle Component ${sDevBuild}`,
62
+ type: 'confirm',
41
63
  task: async () => await bundleComponent(componentKey, sourceMap, devBuild),
42
64
  skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
43
65
  }
@@ -32,13 +32,14 @@ export const getBuildComponentQuestions = async () => {
32
32
  const defaultPegaConfig = await getPegaServerConfig();
33
33
 
34
34
  if (components.length == 0) {
35
- console.log(chalk.bold.yellow(`No components to build`));
35
+ console.log(chalk.redBright("No components to build"));
36
36
  process.exit(1);
37
37
  }
38
38
 
39
39
  return [
40
40
  {
41
41
  name: 'devBuild',
42
+ type: 'confirm',
42
43
  message: 'Generate development build ?',
43
44
  default: defaultPegaConfig.devBuild
44
45
  }
@@ -3,18 +3,17 @@ import Listr from 'listr';
3
3
  import chalk from 'chalk';
4
4
 
5
5
  import validate from '../validator/index.js';
6
-
7
6
  import bundleComponent from '../bundle/index.js';
8
- import lintComponent from '../linter/index.js';
9
- import { getBuildComponentQuestions, cleanUp } from './helper.js';
10
- import { getComponentDirectoryPath, showVersion, getComponentsObj } from '../../util.js';
7
+ import { lintComponent } from '../linter/index.js';
8
+ import { getComponentDirectoryPath, showVersion, getComponents } from '../../util.js';
11
9
 
12
- import { CATEGORY_CONSTELLATION } from '../../constants.js';
10
+ import { getBuildComponentQuestions, cleanUp } from './helper.js';
13
11
 
14
12
 
15
- export function getCustomTasks(componentKey, sourceMap, devBuild) {
13
+ export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
16
14
 
17
- const customTasks = new Listr(
15
+ const sDevBuild = devBuild ? '(dev build)' : '';
16
+ return new Listr(
18
17
  [
19
18
  {
20
19
  title: 'Validate config schema',
@@ -31,8 +30,9 @@ export function getCustomTasks(componentKey, sourceMap, devBuild) {
31
30
  }
32
31
  },
33
32
  {
34
- title: 'Bundle component',
35
- task: async () => await bundleComponent(componentKey, sourceMap, devBuild),
33
+ title: `Bundle component ${sDevBuild}`,
34
+ task: async () => bundleComponent(componentKey, sourceMap, devBuild),
35
+ skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
36
36
  }
37
37
  ],
38
38
  {
@@ -40,40 +40,47 @@ export function getCustomTasks(componentKey, sourceMap, devBuild) {
40
40
  }
41
41
  );
42
42
 
43
- return customTasks;
43
+
44
44
  }
45
45
 
46
46
 
47
47
 
48
48
 
49
- export default async options => {
49
+ export default async (options) => {
50
50
  showVersion();
51
51
 
52
- let category = CATEGORY_CONSTELLATION;
53
-
54
- const components = await getComponentsObj();
55
- const questions = await getBuildComponentQuestions();
56
- const answers = await inquirer.prompt(questions);
57
- const { sourceMap, devBuild } = answers;
58
52
 
53
+ const components = await getComponents();
54
+ let sourceMap;
55
+ let devBuild;
59
56
 
60
-
61
- var componentKey;
57
+ if (options.params.length >= 4) {
58
+ const dBuild = options.params[3];
59
+ devBuild = (dBuild === 'Y' ||
60
+ dBuild === 'y' ||
61
+ dBuild === true ||
62
+ dBuild === 'true') ? true : false;
63
+ }
64
+ else {
65
+ const questions = await getBuildComponentQuestions();
66
+ const answers = await inquirer.prompt(questions);
67
+ ({ sourceMap, devBuild } = answers);
68
+ }
62
69
 
63
70
 
64
- for (var index in components) {
65
- componentKey = components[index].value;
66
- console.log(chalk.bold.green("Building: " + components[index].name));
71
+ for (const componentKey of components) {
72
+ console.log(chalk.bold.green(`Building ${componentKey}`));
67
73
 
68
- let myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild );
74
+ const myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild, options );
69
75
 
76
+ // eslint-disable-next-line no-await-in-loop
70
77
  await myCustomTasks.run().catch(err => {
71
78
  console.log(chalk.bold.red(err.toString()));
72
79
  });
73
80
  }
74
81
 
75
-
76
- cleanUp();
82
+ // once done, remove leftover directories
83
+ await cleanUp();
77
84
 
78
85
  return true;
79
86
  };
@@ -4,7 +4,12 @@ import webpack from 'webpack';
4
4
  import FileSizeReporter from 'react-dev-utils/FileSizeReporter.js';
5
5
  import printBuildError from 'react-dev-utils/printBuildError.js';
6
6
 
7
+
8
+ // used by promote and revert webPack commands, do not change
7
9
  import configFactory from './webpack.config.js';
10
+ // import configFactory from '../../../../../../../webpack.config.js';
11
+ // do not change
12
+
8
13
  import paths from './paths.js';
9
14
 
10
15
  // Do this as the first thing so that any code reading it knows the right env.
@@ -125,7 +125,8 @@ export default (
125
125
  name: componentKey,
126
126
  type: 'umd',
127
127
  export: 'default'
128
- }
128
+ },
129
+ publicPath: ''
129
130
  },
130
131
  optimization: {
131
132
  minimize: isEnvProduction,
@@ -318,7 +319,7 @@ export default (
318
319
  }),
319
320
 
320
321
  new webpack.optimize.LimitChunkCountPlugin({
321
- maxChunks: 5
322
+ maxChunks: 1
322
323
  }),
323
324
  new webpack.optimize.MinChunkSizePlugin({
324
325
  minChunkSize: 100000 // Minimum number of characters