@pega/dx-component-builder-sdk 0.1.0

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 (279) hide show
  1. package/.access_token +1 -0
  2. package/.agilestudio +3 -0
  3. package/.eslintrc.json +18 -0
  4. package/.prettierignore +2 -0
  5. package/.prettierrc.json +1 -0
  6. package/LICENSE +185 -0
  7. package/README.md +199 -0
  8. package/bin/index.js +5 -0
  9. package/cspell.json +26 -0
  10. package/package.json +67 -0
  11. package/src/cli.js +104 -0
  12. package/src/constants.js +134 -0
  13. package/src/tasks/authenticate/helper.js +60 -0
  14. package/src/tasks/authenticate/index.js +81 -0
  15. package/src/tasks/build/helper.js +125 -0
  16. package/src/tasks/build/index.js +52 -0
  17. package/src/tasks/bundle/builder/index.js +218 -0
  18. package/src/tasks/bundle/builder/modules.js +139 -0
  19. package/src/tasks/bundle/builder/paths.js +50 -0
  20. package/src/tasks/bundle/builder/webpack.config.js +336 -0
  21. package/src/tasks/bundle/index.js +65 -0
  22. package/src/tasks/create/index.js +380 -0
  23. package/src/tasks/create/template/config.json.mustache +62 -0
  24. package/src/tasks/create/template/demo.stories.jsx.mustache +44 -0
  25. package/src/tasks/create/template/index.jsx.mustache +55 -0
  26. package/src/tasks/create/template/styles.js.mustache +7 -0
  27. package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +38 -0
  28. package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +26 -0
  29. package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +145 -0
  30. package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.js.mustache +18 -0
  31. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +171 -0
  32. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +7 -0
  33. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +195 -0
  34. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +327 -0
  35. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +44 -0
  36. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +254 -0
  37. package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +7 -0
  38. package/src/tasks/create/templates/Constellation/Field/Date/suggestions-handler.js +10 -0
  39. package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +256 -0
  40. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +93 -0
  41. package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js +286 -0
  42. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +327 -0
  43. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +44 -0
  44. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +252 -0
  45. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +7 -0
  46. package/src/tasks/create/templates/Constellation/Field/DateTime/suggestions-handler.js +10 -0
  47. package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +278 -0
  48. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +44 -0
  49. package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.js.mustache +18 -0
  50. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +272 -0
  51. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +7 -0
  52. package/src/tasks/create/templates/Constellation/Field/Decimal/suggestions-handler.js +10 -0
  53. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +291 -0
  54. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
  55. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.js.mustache +18 -0
  56. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +300 -0
  57. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +7 -0
  58. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/suggestions-handler.js +10 -0
  59. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +93 -0
  60. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
  61. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.js.mustache +18 -0
  62. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +275 -0
  63. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +7 -0
  64. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/suggestions-handler.js +10 -0
  65. package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +347 -0
  66. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +44 -0
  67. package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.js.mustache +18 -0
  68. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +335 -0
  69. package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +7 -0
  70. package/src/tasks/create/templates/Constellation/Field/Integer/suggestions-handler.js +10 -0
  71. package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +114 -0
  72. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +44 -0
  73. package/src/tasks/create/templates/Constellation/Field/Picklist/event-utils.js.mustache +18 -0
  74. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +308 -0
  75. package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
  76. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +7 -0
  77. package/src/tasks/create/templates/Constellation/Field/Picklist/suggestions-handler.js +10 -0
  78. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +62 -0
  79. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +44 -0
  80. package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +60 -0
  81. package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +7 -0
  82. package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +111 -0
  83. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +44 -0
  84. package/src/tasks/create/templates/Constellation/Field/Text-Email/event-utils.js.mustache +18 -0
  85. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +189 -0
  86. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +7 -0
  87. package/src/tasks/create/templates/Constellation/Field/Text-Email/suggestions-handler.js +10 -0
  88. package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
  89. package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.js +27 -0
  90. package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +111 -0
  91. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +44 -0
  92. package/src/tasks/create/templates/Constellation/Field/Text-Input/event-utils.js.mustache +18 -0
  93. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +196 -0
  94. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +7 -0
  95. package/src/tasks/create/templates/Constellation/Field/Text-Input/suggestions-handler.js +10 -0
  96. package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
  97. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +111 -0
  98. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
  99. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/event-utils.js.mustache +18 -0
  100. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +189 -0
  101. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +7 -0
  102. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/suggestions-handler.js +10 -0
  103. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
  104. package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +123 -0
  105. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
  106. package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.js.mustache +18 -0
  107. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +223 -0
  108. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +7 -0
  109. package/src/tasks/create/templates/Constellation/Field/Text-Phone/suggestions-handler.js +10 -0
  110. package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
  111. package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +237 -0
  112. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +44 -0
  113. package/src/tasks/create/templates/Constellation/Field/Text-URL/event-utils.js.mustache +18 -0
  114. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +232 -0
  115. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +7 -0
  116. package/src/tasks/create/templates/Constellation/Field/Text-URL/suggestions-handler.js +10 -0
  117. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +172 -0
  118. package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +185 -0
  119. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
  120. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +213 -0
  121. package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +7 -0
  122. package/src/tasks/create/templates/Constellation/Field/TimeofDay/suggestions-handler.js +10 -0
  123. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +286 -0
  124. package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
  125. package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +35 -0
  126. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +88 -0
  127. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +7 -0
  128. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +155 -0
  129. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
  130. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +42 -0
  131. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +88 -0
  132. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +7 -0
  133. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +155 -0
  134. package/src/tasks/create/templates/Constellation/Template/FORM/DefaultForm.svg +29 -0
  135. package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +45 -0
  136. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +49 -0
  137. package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +7 -0
  138. package/src/tasks/create/templates/Constellation/Template/FORM-region/TwoColumn.svg +38 -0
  139. package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +27 -0
  140. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +51 -0
  141. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +7 -0
  142. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.js.mustache +29 -0
  143. package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
  144. package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +32 -0
  145. package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +68 -0
  146. package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
  147. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +7 -0
  148. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +226 -0
  149. package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
  150. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +23 -0
  151. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +75 -0
  152. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +7 -0
  153. package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
  154. package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +59 -0
  155. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
  156. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +7 -0
  157. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.js.mustache +73 -0
  158. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
  159. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.js.mustache +239 -0
  160. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +66 -0
  161. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
  162. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +7 -0
  163. package/src/tasks/create/templates/SDK-Angular/Field/__components.md +4 -0
  164. package/src/tasks/create/templates/SDK-Angular/Template/__components.md +4 -0
  165. package/src/tasks/create/templates/SDK-Angular/Widget/__components.md +4 -0
  166. package/src/tasks/create/templates/SDK-React/Field/Boolean/config.json.mustache +73 -0
  167. package/src/tasks/create/templates/SDK-React/Field/Boolean/demo.stories.jsx.mustache +44 -0
  168. package/src/tasks/create/templates/SDK-React/Field/Boolean/index.tsx.mustache +109 -0
  169. package/src/tasks/create/templates/SDK-React/Field/Boolean/styles.js.mustache +7 -0
  170. package/src/tasks/create/templates/SDK-React/Field/Date/config.json.mustache +133 -0
  171. package/src/tasks/create/templates/SDK-React/Field/Date/demo.stories.jsx.mustache +44 -0
  172. package/src/tasks/create/templates/SDK-React/Field/Date/index.tsx.mustache +122 -0
  173. package/src/tasks/create/templates/SDK-React/Field/Date/styles.js.mustache +7 -0
  174. package/src/tasks/create/templates/SDK-React/Field/DateTime/config.json.mustache +190 -0
  175. package/src/tasks/create/templates/SDK-React/Field/DateTime/demo.stories.jsx.mustache +44 -0
  176. package/src/tasks/create/templates/SDK-React/Field/DateTime/index.tsx.mustache +112 -0
  177. package/src/tasks/create/templates/SDK-React/Field/DateTime/styles.js.mustache +7 -0
  178. package/src/tasks/create/templates/SDK-React/Field/Decimal/config.json.mustache +80 -0
  179. package/src/tasks/create/templates/SDK-React/Field/Decimal/demo.stories.jsx.mustache +44 -0
  180. package/src/tasks/create/templates/SDK-React/Field/Decimal/index.tsx.mustache +105 -0
  181. package/src/tasks/create/templates/SDK-React/Field/Decimal/styles.js.mustache +7 -0
  182. package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/config.json.mustache +111 -0
  183. package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
  184. package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/index.tsx.mustache +131 -0
  185. package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/styles.js.mustache +7 -0
  186. package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/config.json.mustache +80 -0
  187. package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
  188. package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/index.tsx.mustache +128 -0
  189. package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/styles.js.mustache +7 -0
  190. package/src/tasks/create/templates/SDK-React/Field/Integer/config.json.mustache +74 -0
  191. package/src/tasks/create/templates/SDK-React/Field/Integer/demo.stories.jsx.mustache +44 -0
  192. package/src/tasks/create/templates/SDK-React/Field/Integer/index.tsx.mustache +124 -0
  193. package/src/tasks/create/templates/SDK-React/Field/Integer/styles.js.mustache +7 -0
  194. package/src/tasks/create/templates/SDK-React/Field/Picklist/config.json.mustache +72 -0
  195. package/src/tasks/create/templates/SDK-React/Field/Picklist/demo.stories.jsx.mustache +44 -0
  196. package/src/tasks/create/templates/SDK-React/Field/Picklist/index.tsx.mustache +141 -0
  197. package/src/tasks/create/templates/SDK-React/Field/Picklist/styles.js.mustache +7 -0
  198. package/src/tasks/create/templates/SDK-React/Field/Text/config.json.mustache +69 -0
  199. package/src/tasks/create/templates/SDK-React/Field/Text/demo.stories.jsx.mustache +44 -0
  200. package/src/tasks/create/templates/SDK-React/Field/Text/index.tsx.mustache +119 -0
  201. package/src/tasks/create/templates/SDK-React/Field/Text/styles.js.mustache +7 -0
  202. package/src/tasks/create/templates/SDK-React/Field/Text-Email/config.json.mustache +69 -0
  203. package/src/tasks/create/templates/SDK-React/Field/Text-Email/demo.stories.jsx.mustache +44 -0
  204. package/src/tasks/create/templates/SDK-React/Field/Text-Email/index.tsx.mustache +121 -0
  205. package/src/tasks/create/templates/SDK-React/Field/Text-Email/styles.js.mustache +7 -0
  206. package/src/tasks/create/templates/SDK-React/Field/Text-Input/config.json.mustache +69 -0
  207. package/src/tasks/create/templates/SDK-React/Field/Text-Input/demo.stories.jsx.mustache +44 -0
  208. package/src/tasks/create/templates/SDK-React/Field/Text-Input/index.tsx.mustache +119 -0
  209. package/src/tasks/create/templates/SDK-React/Field/Text-Input/styles.js.mustache +7 -0
  210. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/config.json.mustache +69 -0
  211. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
  212. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/index.tsx.mustache +123 -0
  213. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/styles.js.mustache +7 -0
  214. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/config.json.mustache +81 -0
  215. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
  216. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/index.tsx.mustache +147 -0
  217. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/styles.js.mustache +7 -0
  218. package/src/tasks/create/templates/SDK-React/Field/Text-URL/config.json.mustache +111 -0
  219. package/src/tasks/create/templates/SDK-React/Field/Text-URL/demo.stories.jsx.mustache +44 -0
  220. package/src/tasks/create/templates/SDK-React/Field/Text-URL/index.tsx.mustache +98 -0
  221. package/src/tasks/create/templates/SDK-React/Field/Text-URL/styles.js.mustache +7 -0
  222. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/config.json.mustache +121 -0
  223. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
  224. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/index.tsx.mustache +120 -0
  225. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/styles.js.mustache +7 -0
  226. package/src/tasks/create/templates/SDK-React/Template/DETAILS/DefaultForm.svg +29 -0
  227. package/src/tasks/create/templates/SDK-React/Template/DETAILS/config.json.mustache +21 -0
  228. package/src/tasks/create/templates/SDK-React/Template/DETAILS/index.tsx.mustache +45 -0
  229. package/src/tasks/create/templates/SDK-React/Template/DETAILS/styles.js.mustache +7 -0
  230. package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
  231. package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/config.json.mustache +27 -0
  232. package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/index.tsx.mustache +53 -0
  233. package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/styles.js.mustache +7 -0
  234. package/src/tasks/create/templates/SDK-React/Template/FORM/DefaultForm.css +25 -0
  235. package/src/tasks/create/templates/SDK-React/Template/FORM/DefaultForm.svg +29 -0
  236. package/src/tasks/create/templates/SDK-React/Template/FORM/config.json.mustache +45 -0
  237. package/src/tasks/create/templates/SDK-React/Template/FORM/index.tsx.mustache +63 -0
  238. package/src/tasks/create/templates/SDK-React/Template/FORM/styles.js.mustache +7 -0
  239. package/src/tasks/create/templates/SDK-React/Template/FORM-region/TwoColumn.svg +38 -0
  240. package/src/tasks/create/templates/SDK-React/Template/FORM-region/config.json.mustache +49 -0
  241. package/src/tasks/create/templates/SDK-React/Template/FORM-region/index.tsx.mustache +69 -0
  242. package/src/tasks/create/templates/SDK-React/Template/FORM-region/styles.js.mustache +7 -0
  243. package/src/tasks/create/templates/SDK-React/Template/PAGE/OneColumn.tsx.mustache +32 -0
  244. package/src/tasks/create/templates/SDK-React/Template/PAGE/OneColumnPage.svg +28 -0
  245. package/src/tasks/create/templates/SDK-React/Template/PAGE/config.json.mustache +32 -0
  246. package/src/tasks/create/templates/SDK-React/Template/PAGE/index.tsx.mustache +31 -0
  247. package/src/tasks/create/templates/SDK-React/Template/PAGE/styles.js.mustache +7 -0
  248. package/src/tasks/create/templates/SDK-React/Widget/CASE/OneColumnPage.svg +36 -0
  249. package/src/tasks/create/templates/SDK-React/Widget/CASE/config.json.mustache +23 -0
  250. package/src/tasks/create/templates/SDK-React/Widget/CASE/index.tsx.mustache +183 -0
  251. package/src/tasks/create/templates/SDK-React/Widget/CASE/styles.js.mustache +7 -0
  252. package/src/tasks/create/templates/SDK-React/Widget/PAGE/OneColumnPage.svg +36 -0
  253. package/src/tasks/create/templates/SDK-React/Widget/PAGE/config.json.mustache +59 -0
  254. package/src/tasks/create/templates/SDK-React/Widget/PAGE/index.tsx.mustache +78 -0
  255. package/src/tasks/create/templates/SDK-React/Widget/PAGE/styles.js.mustache +7 -0
  256. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
  257. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/config.json.mustache +66 -0
  258. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/index.tsx.mustache +239 -0
  259. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/styles.js.mustache +7 -0
  260. package/src/tasks/create/templates/SDK-WebComponents/Field/__components.md +4 -0
  261. package/src/tasks/create/templates/SDK-WebComponents/Template/__components.md +4 -0
  262. package/src/tasks/create/templates/SDK-WebComponents/Widget/__components.md +4 -0
  263. package/src/tasks/delete/helper.js +122 -0
  264. package/src/tasks/delete/index.js +45 -0
  265. package/src/tasks/delete-all/helper.js +177 -0
  266. package/src/tasks/delete-all/index.js +45 -0
  267. package/src/tasks/index.js +11 -0
  268. package/src/tasks/linter/index.js +46 -0
  269. package/src/tasks/list/helper.js +118 -0
  270. package/src/tasks/list/index.js +51 -0
  271. package/src/tasks/map/map.js +118 -0
  272. package/src/tasks/publish/helper.js +147 -0
  273. package/src/tasks/publish/index.js +72 -0
  274. package/src/tasks/publish-all/helper.js +139 -0
  275. package/src/tasks/publish-all/index.js +84 -0
  276. package/src/tasks/update/index.js +5 -0
  277. package/src/tasks/upgrade/index.js +31 -0
  278. package/src/tasks/validator/index.js +216 -0
  279. package/src/util.js +442 -0
package/.access_token ADDED
@@ -0,0 +1 @@
1
+ {"access_token":"eyJraWQiOiJkYjVlMjE5MDZlNjA5NDQ4N2I1OTdhNjY2YWU3YjA3OSIsInR5cCI6IkpXVCIsImFsZyI6IlJTMjU2In0.eyJhdWQiOiJ1cm46MTI3ODI1ODAwMjM4NzAzMTE4NTEiLCJzdWIiOiJBZG1pbkBsb2FudjIiLCJhcHBfbmFtZSI6IkxvYW5WMiIsIm5iZiI6MTY3MDM1Mjc0OCwiYXBwX3ZlcnNpb24iOiIwMS4wMS4wMSIsImlzcyI6InVybjpsb2NhbGhvc3QiLCJleHAiOjE2NzAzNTYzNDgsImlhdCI6MTY3MDM1Mjc0OCwianRpIjoiYTU4MzcyOGVhNGIwNzRmZjU1ZjU3MmNmNzNmMzhlNWIiLCJvcGVyYXRvcl9hY2Nlc3MiOiJMb2FuVjI6QXV0aG9ycyJ9.LiLs5f9I_6z-wLHFM30Yj_VIExxCITbARGaIGd0cBrPyN-28BrJcMmEx783PwNgQhlnoYr2JoGS6sC11Xb5TC9p2lOrou0aOGwNrdpo5MDiZ450m3czLKAZWd1OVsX_FPYFWE6wLP-5u20cE25ShLyEnKF_5tjr_kYBbJJ4UNwfk8lqdaqDw_myJc44lYBz5Ou3jUIlIR3ykLBjRTJviua91hF4ntdzdlQJ8_eWqmTOrLzmlke7dUUlILtebFPCFpe5qEaYs5IskbVlFvKH32jl1_dG4k4uzmHPdhGhKZMRwWQ1MKu_xF0Rzm5dMo94A3w6JqLW_x9rVj0KyfCnvZO6IeXMncv-dXHQ5ejFwPh_m7-7Gj9Z7i-L7Hpn6Gq_xR72m-6P8--0yvl8RbddC4JbyHgIrZfidbJu_HhpOH6V3eijgZmvir-A7soFNWatZsro5Btlr7_uJqS0HBWtNqKfEV6IJFidi9UbfiImO1pr8X2lhVgHPmih6c_hkVsqY62bGyXwiJuPB87HkG3aybCf9SkeaqdhHdIWJBXxRd55HVDfkaFV1LQdRJqW31xaFZpp4Uaw3INjqhUTPbJZ7l-7uOPXQwrgZmhwNianMGzCa6tcZm2XmgiC4KzQJUHfNPMbhiPCsKm8pjwIylK2hZvsnA9qmNTxm9YSB4SskIGs","token_type":"bearer","expires_in":3600}
package/.agilestudio ADDED
@@ -0,0 +1,3 @@
1
+ PRD_ID=PRD-6848
2
+ BL_ID=BL-10043
3
+ TEAM_ID=PROJ-2279
package/.eslintrc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "root": true,
3
+ "extends": ["@pega"],
4
+ "ignorePatterns": ["node_modules", "**/template/**"],
5
+ "env": {
6
+ "browser": false,
7
+ "node": true
8
+ },
9
+ "rules": {
10
+ "prettier/prettier": "off",
11
+ "sonarjs/cognitive-complexity": "off",
12
+ "sonarjs/no-identical-functions": "off",
13
+ "sonarjs/no-duplicate-string": "off",
14
+ "sonarjs/no-nested-template-literals": "off",
15
+ "no-console": "off",
16
+ "import/extensions": ["error", "ignorePackages"]
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ *.md
@@ -0,0 +1 @@
1
+ "@pega/prettier-config"
package/LICENSE ADDED
@@ -0,0 +1,185 @@
1
+ Cosmos License
2
+ Version 1.0, September 2020
3
+ This is a proprietary license that is based on the Apache 2.0 license and
4
+ is intended to provide a similar set of rights with the exception that any and
5
+ all Cosmos components shall be used only with Pegasystems Software.
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work.
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ "Pegasystems" (or "Pega") shall mean Pegasystems Inc., a Massachusetts
68
+ Corporation, having an office at One Rogers Street, Cambridge, MA 02142.
69
+
70
+ "Pegasystems Software" shall mean duly licensed Pegasystems software
71
+ and/or subscription services including but not limited to the Pega
72
+ Platform.
73
+
74
+ 2. Grant of Copyright License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ copyright license to reproduce, prepare Derivative Works of,
78
+ publicly display, publicly perform, sublicense, and distribute the
79
+ Work and such Derivative Works in Source or Object form solely for
80
+ use with Pegasystems Software.
81
+
82
+ 3. Grant of Patent License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ (except as stated in this section) patent license to make, have made,
86
+ use, offer to sell, sell, import, and otherwise transfer the Work,
87
+ where such license applies only to those patent claims licensable
88
+ by such Contributor that are necessarily infringed by their
89
+ Contribution(s) alone or by combination of their Contribution(s)
90
+ with the Work to which such Contribution(s) was submitted. If You
91
+ institute patent litigation against any entity (including a
92
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
93
+ or a Contribution incorporated within the Work constitutes direct
94
+ or contributory patent infringement, then any patent licenses
95
+ granted to You under this License for that Work shall terminate
96
+ as of the date such litigation is filed.
97
+
98
+ 4. Redistribution. You may reproduce and distribute copies of the
99
+ Work or Derivative Works thereof in any medium, with or without
100
+ modifications, and in Source or Object form, provided that You
101
+ meet the following conditions:
102
+
103
+ (a) You must give any other recipients of the Work or
104
+ Derivative Works a copy of this License; and
105
+
106
+ (b) You must cause any modified files to carry prominent notices
107
+ stating that You changed the files; and
108
+
109
+ (c) You must retain, in the Source form of any Derivative Works
110
+ that You distribute, all copyright, patent, trademark, and
111
+ attribution notices from the Source form of the Work,
112
+ excluding those notices that do not pertain to any part of
113
+ the Derivative Works; and
114
+
115
+ (d) If the Work includes a "NOTICE" text file as part of its
116
+ distribution, then any Derivative Works that You distribute must
117
+ include a readable copy of the attribution notices contained
118
+ within such NOTICE file, excluding those notices that do not
119
+ pertain to any part of the Derivative Works, in at least one
120
+ of the following places: within a NOTICE text file distributed
121
+ as part of the Derivative Works; within the Source form or
122
+ documentation, if provided along with the Derivative Works; or,
123
+ within a display generated by the Derivative Works, if and
124
+ wherever such third-party notices normally appear. The contents
125
+ of the NOTICE file are for informational purposes only and
126
+ do not modify the License. You may add Your own attribution
127
+ notices within Derivative Works that You distribute, alongside
128
+ or as an addendum to the NOTICE text from the Work, provided
129
+ that such additional attribution notices cannot be construed
130
+ as modifying the License.
131
+
132
+ You may add Your own copyright statement to Your modifications and
133
+ may provide additional or different license terms and conditions
134
+ for use, reproduction, or distribution of Your modifications, or
135
+ for any such Derivative Works as a whole, provided Your use,
136
+ reproduction, and distribution of the Work otherwise complies with
137
+ the conditions stated in this License including the limitation that
138
+ the Work be used only with Pegasystems Software.
139
+
140
+ 5. Submission of Contributions. Any Contribution intentionally submitted
141
+ for inclusion in the Work by You to the Licensor shall be under the
142
+ terms and conditions of this License, without any additional terms or
143
+ conditions. Notwithstanding the above, nothing herein shall supersede
144
+ or modify the terms of any separate license agreement you may have
145
+ executed with Licensor regarding such Contributions.
146
+
147
+ 6. Trademarks. This License does not grant permission to use the trade
148
+ names, trademarks, service marks, or product names of the Licensor,
149
+ except as required for reasonable and customary use in describing the
150
+ origin of the Work and reproducing the content of the NOTICE file.
151
+
152
+ 7. Disclaimer of Warranty. Unless required by applicable law or
153
+ agreed to in writing, Licensor provides the Work (and each
154
+ Contributor provides its Contributions) on an "AS IS" BASIS,
155
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156
+ implied, including, without limitation, any warranties or conditions
157
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
158
+ PARTICULAR PURPOSE. You are solely responsible for determining the
159
+ appropriateness of using or redistributing the Work and assume any
160
+ risks associated with Your exercise of permissions under this License.
161
+
162
+ 8. Limitation of Liability. In no event and under no legal theory,
163
+ whether in tort (including negligence), contract, or otherwise,
164
+ unless required by applicable law (such as deliberate and grossly
165
+ negligent acts) or agreed to in writing, shall any Contributor be
166
+ liable to You for damages, including any direct, indirect, special,
167
+ incidental, or consequential damages of any character arising as a
168
+ result of this License or out of the use or inability to use the
169
+ Work (including but not limited to damages for loss of goodwill,
170
+ work stoppage, computer failure or malfunction, or any and all
171
+ other commercial damages or losses), even if such Contributor
172
+ has been advised of the possibility of such damages.
173
+
174
+ 9. Accepting Warranty or Additional Liability. While redistributing
175
+ the Work or Derivative Works thereof, You may choose to offer,
176
+ and charge a fee for, acceptance of support, warranty, indemnity,
177
+ or other liability obligations and/or rights consistent with this
178
+ License. However, in accepting such obligations, You may act only
179
+ on Your own behalf and on Your sole responsibility, not on behalf
180
+ of any other Contributor, and only if You agree to indemnify,
181
+ defend, and hold each Contributor harmless for any liability
182
+ incurred by, or claims asserted against, such Contributor by reason
183
+ of your accepting any such warranty or additional liability.
184
+
185
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # Using Custom Components for SDK-R
2
+
3
+ ## Overview
4
+
5
+ This project provides you with an environment to extend SDK-R by giving you tools to create and publish custom components that are not available from the SDK-R release.
6
+
7
+ ## Prerequisites
8
+
9
+ Ensure you have access to the following in your system:
10
+
11
+ - Pega Infinity Server version 8.8 or later
12
+
13
+ - Git version 2.30 or later
14
+
15
+ - System node version 18
16
+
17
+ - System npm version 8
18
+
19
+ - Installed SDK-R, as the below commands live in the package.json of the SDK-R an NOT in this npm module
20
+
21
+
22
+ ## Create custom components
23
+
24
+ Create custom components using the following procedure:
25
+
26
+ 1. Enter the following command to create a component:
27
+ `npm run create`
28
+ You will then be asked to enter or review the following details of the component:
29
+ - Name of the component (required)
30
+ Example - `customcomp0`
31
+ - Name of component label (required)
32
+ Example - `custom component`
33
+ - Name of the library (required)
34
+ Example - `basic`
35
+ - Component version (required)
36
+ Example - `0.0.1`
37
+ - Type of component (required)
38
+ Example - `Field`
39
+ - Sub-type of component (required)
40
+ Example - `Text`
41
+ - Description of the component (optional)
42
+ Example - `This is a customized searchbox that filters data.`
43
+ The component is created in the following path: _/Users/your_user_name/project_name/src/components/type/component_name_ (where type is currently field, template or widget)
44
+
45
+ You can also pre-configure the values for the above options in a dxcb.config.json file as shown below.
46
+
47
+ ```json
48
+ {
49
+ "component": {
50
+ "library": "basic",
51
+ "version": "0.0.1",
52
+ "type": "field",
53
+ "subtype": "text",
54
+ "description": "basic field for capturing textual data",
55
+ "icon": "basic-field-text.svg"
56
+ }
57
+ }
58
+ ```
59
+ >**Note**:
60
+ Alternatively, you can enter the following command to skip entering the details of the component now and can manually enter the details in the config.json file after the component is created:
61
+ `npm run create <enter_component_name>`
62
+
63
+ A _src/components_ folder is created and the necessary files required to build the component are initialized as seen below.
64
+
65
+ ```sh
66
+ ├── src
67
+ ├── components
68
+ ├── type (field, template or widget)
69
+ ├── <component_name>
70
+ ├── index.js
71
+ ├── demo.stories.js
72
+ ├── config.json
73
+ ```
74
+
75
+
76
+ The *index.js* file contains the actual component rendering logic.
77
+ The *demo.stories.js* file contains the demo that can be viewed in the storybook.
78
+ The *config.json* file contains the mapping of properties for configuring the auto generated property panel. This property panel appears in AppStudio when an application is being authored to use the custom component.
79
+
80
+
81
+ 2. Enter the following command to start the storybook to view the demo.
82
+ `npm start`
83
+
84
+ 3. Modify the source files to build your own component. You can also install and import third-party libraries if required for your component.
85
+
86
+ The custom component is now created. We use the information provided to create uniquely namespaced components in this convention - `<organization>_<library>_<component name>`.
87
+
88
+ 4. local build, you can build the component locally to check for config validation and component validation. Enter
89
+ `npm buildComponent`
90
+
91
+ buildComponent will do the same first 2 steps as publish, but will not publish to the server. This allows you to compile your component locally and fix errors before publish.
92
+
93
+ ## Authenticate the user
94
+
95
+ Before we publish the custom component to the Pega Infinity Server, authenticate the user to access the resources in the Pega Infinity Server.
96
+
97
+ >**Note**:
98
+ It is required that you configure a value for clientId, clientSecret, and accessTokenUri.
99
+ 1. Login to Pega Infinity Server, navigate to Records / Security / OAuth 2.0 Client Registration landing page and open the *DX-CustomComponents* record.
100
+ 2. Click **Regenerate Client Secret**, download the Client Credentials (as the Client ID, Client Secret, and Access token endpoint will be needed), and save the record.
101
+ 3. Update the the task.config.json file with these downloaded values:
102
+ ```json
103
+ "server-config": {
104
+ "server": "https://127.0.0.1:8080/prweb",
105
+ "user": "customcomponentoperator",
106
+ "password": "pwd",
107
+ "clientId": "<mention client ID here>",
108
+ "clientSecret": "<mention client secret here>",
109
+ "accessTokenUri": "https://127.0.0.1:8080/prweb/PRRestService/oauth2/v1/token"
110
+ },
111
+ ```
112
+ 4. Enter the following command to initiate authentication.
113
+ `npm run authenticate`
114
+
115
+ The user is now authenticated and can proceed to either publish or list the components.
116
+
117
+ ## Publish custom components
118
+ Enter the following command to publish custom components to Pega Infinity Server:
119
+ `npm run publish`
120
+ `npm run publishAll`
121
+ Publish the finalized custom components changes to Pega Infinity Server so that it can be discoverable in authoring (design palette).
122
+ You will then be asked to enter the following details:
123
+
124
+ - The component to be published to Pega Infinity Server. It will be updated if the component exists.
125
+ - If publishAll, then you won't get a list
126
+ - The name of the ruleset where the component must be published.
127
+ - The version of the ruleset where the component must be published.
128
+ - Specify if the development build should be generated for debugging.
129
+
130
+ - If publishAll, will sequentially go through the list of local components and publish them
131
+ You can also pre-configure the values for the above options in a tasks.config.json file as shown below. The server, user name, and password must be pre-configured.
132
+
133
+ ```json
134
+ {
135
+ "components-server-config": {
136
+ "server": "http://127.0.0.1:8080/prweb",
137
+ "user": "customcomponentoperator",
138
+ "password": "pwd"
139
+ "rulesetName": "TestPega-C11nGall",
140
+ "rulesetVersion": "01-01-03",
141
+ "sourceOfComponents": "Server",
142
+ "devBuild": false,
143
+ }
144
+ }
145
+ ```
146
+ When the component is successfully published, you can use the newly published component in App Studio's view authoring.
147
+
148
+ > **Note**:
149
+ > The Rule-UI-Component instance (with component name) is created on the Pega Infinity Server after publishing the component.
150
+
151
+ ## List custom components
152
+
153
+ View the available components in the local machine or the server.
154
+
155
+ Enter the following command to list custom components:
156
+ `npm run list`
157
+
158
+ You will then be asked to enter the following details:
159
+
160
+ - List components from Server or Local?
161
+ Example - `Server`
162
+
163
+ The custom components will now be listed in the terminal.
164
+
165
+ ## Delete custom components
166
+
167
+ Delete the available or published components in the local machine or the server.
168
+
169
+ Enter the following command to delete custom components:
170
+ `npm run delete`
171
+ `npm run deleteAll`
172
+
173
+ You will then be asked to enter the following details:
174
+
175
+ - Delete components from Server or Local?
176
+ Example - `Local`
177
+
178
+ - Select component to delete
179
+ The list of available components in the following path will be displayed: \_/Users/your_user_name/project_name/src/components
180
+ Select the component to be deleted from this list.
181
+ - For deleteAll you will see the full list and asked if you want to delete them all.
182
+
183
+ - Are you sure?
184
+ Example - `yes`
185
+
186
+ > **Note**:
187
+ > If you choose to delete components from the server, the successfully published components along with their ruleset name and ruleset version from the Pega Infinity Server will be displayed. Select the component to be deleted from this list.
188
+
189
+ ## View existing custom components in storybook
190
+
191
+ View custom components in a storybook by performing the following procedure:
192
+
193
+ 1. Enter the following command to open the project.
194
+ `cd <enter your project's name>`
195
+
196
+ 2. Enter the following command to start the storybook in development mode.
197
+ `npm start`
198
+
199
+ The storybook is launched in a browser where you can view the components working in isolation.
package/bin/index.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import cli from '../src/cli.js';
4
+
5
+ cli(process.argv);
package/cspell.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "version": "0.2",
3
+ "import": "@pega/cspell-config",
4
+ "language": "en-US",
5
+ "ignorePaths": [
6
+ "package-lock.json",
7
+ "**/*.tsbuildinfo",
8
+ "**/node_modules/**",
9
+ "**/.DS_Store",
10
+ "**/*.zip",
11
+ "**/*.tgz"
12
+ ],
13
+ "words": [
14
+ "avif",
15
+ "datapage",
16
+ "datasource",
17
+ "execa",
18
+ "listr",
19
+ "pascalcase",
20
+ "picklist",
21
+ "prpc",
22
+ "rawlist",
23
+ "ruleset",
24
+ "storysource"
25
+ ]
26
+ }
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@pega/dx-component-builder-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Utility for building custom UI components",
5
+ "bin": "./bin/index.js",
6
+ "scripts": {
7
+ "lint:es": "eslint .",
8
+ "lint:format": "prettier -c .",
9
+ "lint:spelling": "cspell **/*",
10
+ "fix:es": "eslint --fix .",
11
+ "fix:format": "prettier -w ."
12
+ },
13
+ "type": "module",
14
+ "sideEffects": false,
15
+ "dependencies": {
16
+ "@babel/core": "^7.19.1",
17
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
18
+ "@babel/preset-env": "^7.19.1",
19
+ "@babel/preset-react": "^7.18.6",
20
+ "adm-zip": "^0.5.9",
21
+ "ajv": "^8.11.0",
22
+ "arg": "^5.0.2",
23
+ "babel-loader": "^8.2.5",
24
+ "chalk": "^5.0.1",
25
+ "compression-webpack-plugin": "^10.0.0",
26
+ "css-loader": "6.7.1",
27
+ "css-minimizer-webpack-plugin": "^4.1.0",
28
+ "execa": "^6.1.0",
29
+ "file-loader": "6.2.0",
30
+ "fs-extra": "^10.1.0",
31
+ "gitignore": "^0.7.0",
32
+ "inquirer": "^9.1.1",
33
+ "listr": "^0.14.3",
34
+ "mini-css-extract-plugin": "2.6.1",
35
+ "mustache": "^4.2.0",
36
+ "ncp": "^2.0.0",
37
+ "node-fetch": "^3.2.10",
38
+ "ora": "^6.1.2",
39
+ "pascalcase": "^2.0.0",
40
+ "postcss": "^8.4.16",
41
+ "postcss-loader": "7.0.1",
42
+ "postcss-preset-env": "7.8.2",
43
+ "prop-types": "^15.8.1",
44
+ "react": "^18.2.0",
45
+ "react-dev-utils": "^12.0.1",
46
+ "resolve": "1.22.1",
47
+ "resolve-url-loader": "^5.0.0",
48
+ "sass-loader": "^13.0.2",
49
+ "terser-webpack-plugin": "5.3.6",
50
+ "ts-loader": "^9.3.1",
51
+ "typescript": "^4.8.3",
52
+ "url-loader": "4.1.1",
53
+ "webpack": "5.74.0"
54
+ },
55
+ "author": "Custom component dev",
56
+ "license": "SEE LICENSE IN LICENSE",
57
+ "keywords": [
58
+ "pega",
59
+ "custom-components-sdk"
60
+ ],
61
+ "devDependencies": {
62
+ "@pega/configs": "^0.3.3",
63
+ "cspell": "^6.9.0",
64
+ "eslint": "^8.23.1",
65
+ "prettier": "2.7.1"
66
+ }
67
+ }
package/src/cli.js ADDED
@@ -0,0 +1,104 @@
1
+ import arg from 'arg';
2
+ import chalk from 'chalk';
3
+
4
+ import {
5
+ authenticate,
6
+ buildComponent,
7
+ createComponent,
8
+ deleteComponent,
9
+ deleteAllComponents,
10
+ listComponents,
11
+ publishComponent,
12
+ publishAllComponents,
13
+ updateComponent,
14
+ validate,
15
+ upgrade
16
+ } from './tasks/index.js';
17
+
18
+ const TASKS = {
19
+ CREATE: 'create',
20
+ BUILD: 'buildComponent',
21
+ PUBLISH: 'publish',
22
+ PUBLISH_All: 'publishAll',
23
+ LIST: 'list',
24
+ VALIDATE_SCHEMA: 'validateSchema',
25
+ UPDATE: 'update',
26
+ DELETE: 'delete',
27
+ DELETE_ALL: "deleteAll",
28
+ AUTHENTICATE: 'authenticate',
29
+ UPGRADE: 'upgrade'
30
+ };
31
+
32
+ const parseArgumentsIntoOptions = rawArgs => {
33
+ const args = arg(
34
+ {
35
+ '--install': Boolean,
36
+ '--skipBundle': Boolean
37
+ },
38
+ {
39
+ argv: rawArgs.slice(2)
40
+ }
41
+ );
42
+ return {
43
+ task: args._[0],
44
+ git: true, // args['--git'] || false
45
+ runInstall: true, // args['--install'] || false
46
+ skipBundle: false,
47
+ params: rawArgs
48
+ };
49
+ };
50
+
51
+ export default async (args = []) => {
52
+ const options = parseArgumentsIntoOptions(args);
53
+ const { task } = options;
54
+ switch (task) {
55
+ case TASKS.CREATE: {
56
+ createComponent(options);
57
+ break;
58
+ }
59
+ case TASKS.PUBLISH: {
60
+ publishComponent(options);
61
+ break;
62
+ }
63
+ case TASKS.PUBLISH_All: {
64
+ publishAllComponents(options);
65
+ break;
66
+ }
67
+ case TASKS.BUILD: {
68
+ buildComponent(options);
69
+ break;
70
+ }
71
+ case TASKS.LIST: {
72
+ listComponents(options);
73
+ break;
74
+ }
75
+ case TASKS.VALIDATE_SCHEMA: {
76
+ validate(options);
77
+ break;
78
+ }
79
+ case TASKS.UPDATE: {
80
+ updateComponent(options);
81
+ break;
82
+ }
83
+ case TASKS.DELETE: {
84
+ deleteComponent(options);
85
+ break;
86
+ }
87
+ case TASKS.DELETE_ALL: {
88
+ deleteAllComponents(options);
89
+ break;
90
+ }
91
+ case TASKS.AUTHENTICATE: {
92
+ authenticate(options);
93
+ break;
94
+ }
95
+ case TASKS.UPGRADE: {
96
+ upgrade(options);
97
+ break;
98
+ }
99
+ default: {
100
+ console.log(chalk.red(`No task matched with ${task}`));
101
+ break;
102
+ }
103
+ }
104
+ };