@pega/custom-dx-components 26.1.11 → 26.1.12-alpha.0.2

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 (323) hide show
  1. package/README.md +6 -2
  2. package/package.json +48 -64
  3. package/src/ai/README.md +44 -0
  4. package/src/ai/catalog/README.md +133 -0
  5. package/src/ai/catalog/best-practices/README.md +24 -0
  6. package/src/ai/catalog/best-practices/accessibility-for-async-components.md +53 -0
  7. package/src/ai/catalog/best-practices/error-handling-and-resiliency.md +116 -0
  8. package/src/ai/catalog/best-practices/genai-assistant-integration-patterns.md +49 -0
  9. package/src/ai/catalog/best-practices/performance-and-efficiency.md +109 -0
  10. package/src/ai/catalog/best-practices/security-considerations.md +93 -0
  11. package/src/ai/catalog/best-practices/testing-pconnect-components.md +245 -0
  12. package/src/ai/catalog/best-practices/troubleshooting-common-pitfalls.md +132 -0
  13. package/src/ai/catalog/pconnect-assignment-lifecycle/SKILL.md +44 -0
  14. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/README.md +39 -0
  15. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/approval-workflow-decision.md +47 -0
  16. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/attachment-upload.md +45 -0
  17. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/bulk-action-submit.md +50 -0
  18. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/confirm-before-destructive-action.md +43 -0
  19. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/create-and-stage-new-case.md +45 -0
  20. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/graceful-submit-failure.md +39 -0
  21. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/modal-assignment-submit.md +58 -0
  22. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/multi-step-wizard.md +44 -0
  23. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/resolve-or-ignore-duplicate.md +47 -0
  24. package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/safe-case-deletion.md +36 -0
  25. package/src/ai/catalog/pconnect-case-collaboration/SKILL.md +42 -0
  26. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/README.md +36 -0
  27. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/look-up-user-details.md +43 -0
  28. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-attachments.md +51 -0
  29. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-participants.md +52 -0
  30. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/participant-and-follower.md +40 -0
  31. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/post-and-manage-feed.md +50 -0
  32. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/relate-cases.md +35 -0
  33. package/src/ai/catalog/pconnect-case-collaboration/cookbooks/tag-case-and-find-related.md +44 -0
  34. package/src/ai/catalog/pconnect-data-subscriptions/SKILL.md +42 -0
  35. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/README.md +35 -0
  36. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/data-page-subscription-cleanup.md +41 -0
  37. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/publish-and-subscribe-events.md +40 -0
  38. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/pubsub-cleanup.md +38 -0
  39. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/query-paginated-list-data.md +44 -0
  40. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/realtime-case-subscription.md +46 -0
  41. package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/refresh-and-update-data.md +41 -0
  42. package/src/ai/catalog/pconnect-forms-and-fields/SKILL.md +44 -0
  43. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/README.md +36 -0
  44. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/autosave-tracking.md +45 -0
  45. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/cascading-dependent-fields.md +51 -0
  46. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/collect-form-changes-for-manual-save.md +45 -0
  47. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/custom-field-validators.md +44 -0
  48. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/discard-changes-and-reset-form.md +41 -0
  49. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/full-form-validation.md +38 -0
  50. package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/persist-widget-ui-state.md +41 -0
  51. package/src/ai/catalog/pconnect-lists-and-views/SKILL.md +44 -0
  52. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/README.md +35 -0
  53. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/activate-and-switch-container-items.md +52 -0
  54. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/container-item-lifecycle.md +61 -0
  55. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/insert-delete-list-rows.md +40 -0
  56. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/reorder-list-rows.md +39 -0
  57. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/repeating-row-edit.md +39 -0
  58. package/src/ai/catalog/pconnect-lists-and-views/cookbooks/view-personalization.md +60 -0
  59. package/src/ai/catalog/pconnect-navigation-locale-genai/SKILL.md +45 -0
  60. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/README.md +35 -0
  61. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/agent-conversation-for-tasks.md +54 -0
  62. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/bookmarkable-filter-state.md +40 -0
  63. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/deep-link-semantic-url.md +39 -0
  64. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/genai-assistant-conversation.md +43 -0
  65. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/locale-switch-and-relocalize.md +38 -0
  66. package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/persist-operator-preferences.md +40 -0
  67. package/src/ai/catalog/references/architecture-overview.md +52 -0
  68. package/src/ai/catalog/references/pconnect-actions-api.md +948 -0
  69. package/src/ai/catalog/references/pconnect-case-info-data-info-localization.md +618 -0
  70. package/src/ai/catalog/references/pconnect-case-validation-utilities.md +238 -0
  71. package/src/ai/catalog/references/pconnect-container-manager.md +215 -0
  72. package/src/ai/catalog/references/pconnect-list-actions.md +250 -0
  73. package/src/ai/catalog/references/pconnect-misc-suggestions-creation.md +231 -0
  74. package/src/ai/catalog/references/pconnect-reference-context-component.md +471 -0
  75. package/src/ai/catalog/references/pconnect-state-config.md +316 -0
  76. package/src/ai/catalog/references/pconnect-validation-api.md +45 -0
  77. package/src/ai/catalog/references/pcore-analytics-genai-details.md +50 -0
  78. package/src/ai/catalog/references/pcore-bootstrap-init-details.md +121 -0
  79. package/src/ai/catalog/references/pcore-bootstrap-registry-routing.md +253 -0
  80. package/src/ai/catalog/references/pcore-case-collaboration-details.md +191 -0
  81. package/src/ai/catalog/references/pcore-case-collaboration-genai.md +264 -0
  82. package/src/ai/catalog/references/pcore-environment-info-details.md +96 -0
  83. package/src/ai/catalog/references/pcore-environment-locale-namespace.md +175 -0
  84. package/src/ai/catalog/references/pcore-messaging-details.md +99 -0
  85. package/src/ai/catalog/references/pcore-misc-details.md +207 -0
  86. package/src/ai/catalog/references/pcore-misc-utilities.md +325 -0
  87. package/src/ai/catalog/references/pcore-rest-data-details.md +164 -0
  88. package/src/ai/catalog/references/pcore-rest-data-messaging.md +308 -0
  89. package/src/ai/catalog/references/pcore-store-context-details.md +40 -0
  90. package/src/ai/catalog/references/pcore-store-context-state.md +130 -0
  91. package/src/ai/index.js +154 -0
  92. package/src/ai/project/.claude/skills/boolean/SKILL.md +43 -0
  93. package/src/ai/project/.claude/skills/case/SKILL.md +58 -0
  94. package/src/ai/project/.claude/skills/create-dx-component/SKILL.md +98 -0
  95. package/src/ai/project/.claude/skills/create-dx-component/assets/PConnProps.d.ts +24 -0
  96. package/src/ai/project/.claude/skills/create-dx-component/assets/create-nonce.ts +5 -0
  97. package/src/ai/project/.claude/skills/create-dx-component/assets/event-utils.ts +18 -0
  98. package/src/ai/project/.claude/skills/create-dx-component/assets/styles.ts +7 -0
  99. package/src/ai/project/.claude/skills/create-dx-component/cookbooks/README.md +28 -0
  100. package/src/ai/project/.claude/skills/create-dx-component/cookbooks/build-a-data-widget.md +281 -0
  101. package/src/ai/project/.claude/skills/create-dx-component/cookbooks/field-with-limits-and-validation.md +156 -0
  102. package/src/ai/project/.claude/skills/create-dx-component/cookbooks/status-badge-field.md +97 -0
  103. package/src/ai/project/.claude/skills/create-dx-component/references/accessibility.md +71 -0
  104. package/src/ai/project/.claude/skills/create-dx-component/references/choosing-type-and-subtype.md +79 -0
  105. package/src/ai/project/.claude/skills/create-dx-component/references/cli-workflow.md +125 -0
  106. package/src/ai/project/.claude/skills/create-dx-component/references/component-patterns.md +241 -0
  107. package/src/ai/project/.claude/skills/create-dx-component/references/config-schema.md +296 -0
  108. package/src/ai/project/.claude/skills/create-dx-component/references/cosmos-components.md +137 -0
  109. package/src/ai/project/.claude/skills/create-dx-component/references/field-behavior.md +155 -0
  110. package/src/ai/project/.claude/skills/create-dx-component/references/field-essentials.md +90 -0
  111. package/src/ai/project/.claude/skills/create-dx-component/references/field-subtypes-extra.md +68 -0
  112. package/src/ai/project/.claude/skills/create-dx-component/references/localization.md +30 -0
  113. package/src/ai/project/.claude/skills/create-dx-component/references/pcore-pconnect-apis.md +77 -0
  114. package/src/ai/project/.claude/skills/create-dx-component/references/presentation-essentials.md +57 -0
  115. package/src/ai/project/.claude/skills/create-dx-component/references/props-contract.md +182 -0
  116. package/src/ai/project/.claude/skills/create-dx-component/references/state-matrix.md +102 -0
  117. package/src/ai/project/.claude/skills/create-dx-component/references/storybook-pattern.md +262 -0
  118. package/src/ai/project/.claude/skills/create-dx-component/references/styles-pattern.md +54 -0
  119. package/src/ai/project/.claude/skills/create-dx-component/references/template-essentials.md +87 -0
  120. package/src/ai/project/.claude/skills/create-dx-component/references/template-patterns.md +131 -0
  121. package/src/ai/project/.claude/skills/create-dx-component/references/test-pattern.md +215 -0
  122. package/src/ai/project/.claude/skills/create-dx-component/references/ui-gallery-reuse.md +93 -0
  123. package/src/ai/project/.claude/skills/create-dx-component/references/widget-essentials.md +84 -0
  124. package/src/ai/project/.claude/skills/create-dx-component/references/widget-patterns.md +164 -0
  125. package/src/ai/project/.claude/skills/currency/SKILL.md +46 -0
  126. package/src/ai/project/.claude/skills/date/SKILL.md +46 -0
  127. package/src/ai/project/.claude/skills/decimal/SKILL.md +49 -0
  128. package/src/ai/project/.claude/skills/details/SKILL.md +60 -0
  129. package/src/ai/project/.claude/skills/email/SKILL.md +42 -0
  130. package/src/ai/project/.claude/skills/field/SKILL.md +68 -0
  131. package/src/ai/project/.claude/skills/form/SKILL.md +51 -0
  132. package/src/ai/project/.claude/skills/generate-component-set/SKILL.md +80 -0
  133. package/src/ai/project/.claude/skills/generate-component-set/component-manifest.json +161 -0
  134. package/src/ai/project/.claude/skills/identify-components/SKILL.md +76 -0
  135. package/src/ai/project/.claude/skills/integer/SKILL.md +45 -0
  136. package/src/ai/project/.claude/skills/page/SKILL.md +60 -0
  137. package/src/ai/project/.claude/skills/page-widget/SKILL.md +55 -0
  138. package/src/ai/project/.claude/skills/percentage/SKILL.md +52 -0
  139. package/src/ai/project/.claude/skills/phone/SKILL.md +44 -0
  140. package/src/ai/project/.claude/skills/picklist/SKILL.md +50 -0
  141. package/src/ai/project/.claude/skills/plan-dx-component/SKILL.md +51 -0
  142. package/src/ai/project/.claude/skills/plan-dx-component/references/design-system-mapping.md +108 -0
  143. package/src/ai/project/.claude/skills/plan-dx-component/references/intake.md +146 -0
  144. package/src/ai/project/.claude/skills/plan-dx-component/references/plan-template.md +76 -0
  145. package/src/ai/project/.claude/skills/plan-dx-component/references/requirements-template.md +88 -0
  146. package/src/ai/project/.claude/skills/presentation/SKILL.md +61 -0
  147. package/src/ai/project/.claude/skills/publish-library/SKILL.md +106 -0
  148. package/src/ai/project/.claude/skills/radiobuttons/SKILL.md +51 -0
  149. package/src/ai/project/.claude/skills/review-component/SKILL.md +49 -0
  150. package/src/ai/project/.claude/skills/review-component/references/checklist.md +77 -0
  151. package/src/ai/project/.claude/skills/template/SKILL.md +60 -0
  152. package/src/ai/project/.claude/skills/text/SKILL.md +45 -0
  153. package/src/ai/project/.claude/skills/update-dx-component/SKILL.md +56 -0
  154. package/src/ai/project/.claude/skills/update-dx-component/references/maintenance.md +43 -0
  155. package/src/ai/project/.claude/skills/url/SKILL.md +46 -0
  156. package/src/ai/project/.claude/skills/validate-component/SKILL.md +78 -0
  157. package/src/ai/project/.claude/skills/validate-component/references/runtime-troubleshooting.md +56 -0
  158. package/src/ai/project/.claude/skills/validate-component/scripts/check-component.mjs +327 -0
  159. package/src/ai/project/.claude/skills/widget/SKILL.md +59 -0
  160. package/src/ai/project/.gemini/settings.json +5 -0
  161. package/src/ai/project/AGENTS.md +74 -0
  162. package/src/ai/readme-section.md +91 -0
  163. package/src/cli.js +48 -7
  164. package/src/constants.js +54 -53
  165. package/src/internal-tests.js +27 -0
  166. package/src/tasks/ai-toggle/index.js +46 -0
  167. package/src/tasks/authenticate/helper.js +38 -38
  168. package/src/tasks/authenticate/index.js +17 -15
  169. package/src/tasks/build-all/helper.js +4 -4
  170. package/src/tasks/build-all/index.js +7 -7
  171. package/src/tasks/build-comp/helper.js +17 -17
  172. package/src/tasks/build-comp/index.js +10 -10
  173. package/src/tasks/build-jest-assets/index.js +7 -9
  174. package/src/tasks/build-lib/helper.js +8 -8
  175. package/src/tasks/build-lib/index.js +8 -8
  176. package/src/tasks/bundle/builder/index.js +9 -12
  177. package/src/tasks/bundle/builder/modules.js +8 -9
  178. package/src/tasks/bundle/builder/paths.js +2 -19
  179. package/src/tasks/bundle/builder/webpack.config.js +60 -77
  180. package/src/tasks/bundle/index.js +8 -8
  181. package/src/tasks/create/index.js +35 -35
  182. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -36
  183. package/src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache +2 -2
  184. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +2 -27
  185. package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache +2 -2
  186. package/src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache +2 -2
  187. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +2 -35
  188. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +3 -36
  189. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +4 -39
  190. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +4 -53
  191. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +5 -5
  192. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +3 -36
  193. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -42
  194. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/component-constants.ts +1 -1
  195. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache +0 -2
  196. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +1 -1
  197. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -11
  198. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +3 -13
  199. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache +2 -3
  200. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +28 -28
  201. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -2
  202. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/textformat-utils.tsx.mustache +2 -3
  203. package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -33
  204. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +3 -33
  205. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +3 -31
  206. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +3 -31
  207. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +3 -35
  208. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +3 -33
  209. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +2 -3
  210. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +2 -35
  211. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.ts.mustache +2 -2
  212. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +19 -15
  213. package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +6 -6
  214. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -1
  215. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -8
  216. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +9 -9
  217. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +4 -8
  218. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +19 -15
  219. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +6 -6
  220. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -1
  221. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -1
  222. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +9 -9
  223. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
  224. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +8 -8
  225. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +8 -8
  226. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +4 -9
  227. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.test.tsx.mustache +3 -3
  228. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +19 -14
  229. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +6 -6
  230. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +1 -1
  231. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +1 -1
  232. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +5 -5
  233. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +3 -35
  234. package/src/tasks/create/templates/Launchpad/Field/__components.md +1 -1
  235. package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +8 -8
  236. package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +8 -8
  237. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.test.tsx.mustache +3 -3
  238. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -1
  239. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +1 -1
  240. package/src/tasks/create-all/index.js +42 -41
  241. package/src/tasks/create-lib/helper.js +13 -13
  242. package/src/tasks/create-lib/index.js +5 -5
  243. package/src/tasks/create-version/helper.js +10 -10
  244. package/src/tasks/create-version/index.js +3 -4
  245. package/src/tasks/delete/helper.js +20 -19
  246. package/src/tasks/delete/index.js +2 -2
  247. package/src/tasks/delete-all/helper.js +26 -25
  248. package/src/tasks/delete-all/index.js +2 -2
  249. package/src/tasks/delete-lib/helper.js +6 -6
  250. package/src/tasks/delete-lib/index.js +6 -6
  251. package/src/tasks/delete-pub/helper.js +18 -18
  252. package/src/tasks/delete-pub/index.js +8 -8
  253. package/src/tasks/delete-version/index.js +2 -2
  254. package/src/tasks/dev-server/index.js +1 -1
  255. package/src/tasks/export-archive/helper.js +21 -21
  256. package/src/tasks/export-archive/index.js +27 -40
  257. package/src/tasks/export-rc/helper.js +34 -34
  258. package/src/tasks/export-rc/index.js +21 -31
  259. package/src/tasks/import-archive/helper.js +39 -39
  260. package/src/tasks/import-archive/index.js +69 -89
  261. package/src/tasks/import-comp/helper.js +8 -8
  262. package/src/tasks/import-comp/index.js +30 -42
  263. package/src/tasks/index.js +5 -0
  264. package/src/tasks/init/Node.gitignore +149 -0
  265. package/src/tasks/init/helper.js +15 -8
  266. package/src/tasks/init/index.js +115 -35
  267. package/src/tasks/init/template/.prettierrc.json +4 -1
  268. package/src/tasks/init/template/.storybook/main.ts +1 -4
  269. package/src/tasks/init/template/.storybook/manager.ts +1 -1
  270. package/src/tasks/init/template/.storybook/preview.tsx +2 -2
  271. package/src/tasks/init/template/.storybook/theme.js +1 -1
  272. package/src/tasks/init/template/.vscode/extensions.json +0 -1
  273. package/src/tasks/init/template/README.md +2 -2
  274. package/src/tasks/init/template/eslint.config.mjs +13 -155
  275. package/src/tasks/init/template/jest.config.cjs +2 -0
  276. package/src/tasks/init/template/package-lock.json +26864 -0
  277. package/src/tasks/init/template/package.json.mustache +19 -74
  278. package/src/tasks/init/template/setupTests.ts +10 -4
  279. package/src/tasks/init/template/tsconfig.json +14 -6
  280. package/src/tasks/internal-test/index.js +21 -0
  281. package/src/tasks/internal-test-full/index.js +15 -0
  282. package/src/tasks/internal-test-functional/index.js +15 -0
  283. package/src/tasks/internal-test-unit/index.js +13 -0
  284. package/src/tasks/linter/index.js +2 -2
  285. package/src/tasks/list/helper.js +41 -40
  286. package/src/tasks/list/index.js +3 -3
  287. package/src/tasks/list-lib/helper.js +5 -5
  288. package/src/tasks/list-lib/index.js +8 -8
  289. package/src/tasks/list-pub/helper.js +23 -16
  290. package/src/tasks/list-pub/index.js +24 -21
  291. package/src/tasks/move/helper.js +8 -8
  292. package/src/tasks/move/index.js +19 -23
  293. package/src/tasks/promote-webpack/index.js +4 -4
  294. package/src/tasks/promote-webpack/webpack.config.js +62 -93
  295. package/src/tasks/publish/helper.js +21 -21
  296. package/src/tasks/publish/index.js +16 -16
  297. package/src/tasks/publish-all/helper.js +20 -20
  298. package/src/tasks/publish-all/index.js +11 -12
  299. package/src/tasks/publish-archive/helper.js +9 -9
  300. package/src/tasks/publish-archive/index.js +12 -14
  301. package/src/tasks/publish-lib/helper.js +3 -3
  302. package/src/tasks/publish-lib/index.js +28 -34
  303. package/src/tasks/quarantine/index.js +8 -8
  304. package/src/tasks/rename/index.js +26 -30
  305. package/src/tasks/rename-lib/index.js +21 -25
  306. package/src/tasks/restore/index.js +8 -8
  307. package/src/tasks/restore-config/index.js +3 -5
  308. package/src/tasks/set-perm/index.js +8 -8
  309. package/src/tasks/show-help/index.js +17 -9
  310. package/src/tasks/show-status/index.js +2 -2
  311. package/src/tasks/store/index.js +8 -8
  312. package/src/tasks/switch-lib/helper.js +7 -7
  313. package/src/tasks/switch-lib/index.js +7 -7
  314. package/src/tasks/switch-version/helper.js +6 -6
  315. package/src/tasks/switch-version/index.js +7 -7
  316. package/src/tasks/update/index.js +1 -1
  317. package/src/tasks/upgrade/index.js +7 -7
  318. package/src/tasks/validator/index.js +49 -203
  319. package/src/util.js +169 -186
  320. package/src/rules/no-pcore-pconnect-in-presentation.js +0 -103
  321. package/src/tasks/init/template/.stylelintrc.json +0 -4
  322. package/src/tasks/init/template/babel.config.cjs +0 -22
  323. package/src/tasks/init/template/cspell.json +0 -14
package/src/util.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  JEST_TESTS_FUNCTIONAL_PATH,
44
44
  IMPORT_RELATIVE_PATH,
45
45
  EXPORT_RELATIVE_PATH,
46
- MAX_RFT_CHARS
46
+ MAX_RFT_CHARS,
47
47
  } from './constants.js';
48
48
 
49
49
  const access = promisify(fs.access);
@@ -69,7 +69,7 @@ let defaultConfigs = {
69
69
  showDebug: false,
70
70
  importRelativePath: '',
71
71
  exportRelativePath: '',
72
- useInputConfig: false
72
+ useInputConfig: false,
73
73
  };
74
74
 
75
75
  let pegaConfig = null;
@@ -77,7 +77,7 @@ let pegaData = null;
77
77
  let sPegaData;
78
78
  let sPegaServerConfig;
79
79
 
80
- export const modAddAboutData = addInAboutData => {
80
+ export const modAddAboutData = (addInAboutData) => {
81
81
  // used by jest to not put in to match assets without aboutData
82
82
  addAboutData = addInAboutData;
83
83
  };
@@ -124,7 +124,7 @@ export const setUpDefaults = async () => {
124
124
  showDebug: false,
125
125
  importRelativePath: '',
126
126
  exportRelativePath: '',
127
- useInputConfig: false
127
+ useInputConfig: false,
128
128
  };
129
129
 
130
130
  // retrievedConfigData
@@ -186,7 +186,7 @@ export const setUpDefaults = async () => {
186
186
  retrievedConfigData.buildVersion = retrievedConfigData.devBuild ? `${retrievedConfigData.version}-dev` : retrievedConfigData.version;
187
187
  retrievedConfigData.currentOrgLib = `${retrievedConfigData.organization}_${retrievedConfigData.library}`;
188
188
  retrievedConfigData.displayLibVersion = `${retrievedConfigData.currentOrgLib}/${retrievedConfigData.buildVersion}`;
189
- } catch (ex) {
189
+ } catch {
190
190
  // when can't find it, always be false, assume no library based.
191
191
  // This is IMPORTANT for init (npx install)
192
192
  return false;
@@ -195,7 +195,7 @@ export const setUpDefaults = async () => {
195
195
  return JSON.parse(JSON.stringify(retrievedConfigData));
196
196
  };
197
197
 
198
- export const convertYNToBoolean = inputYN => {
198
+ export const convertYNToBoolean = (inputYN) => {
199
199
  switch (inputYN) {
200
200
  case 'Y':
201
201
  case 'y':
@@ -211,7 +211,7 @@ export const convertYNToBoolean = inputYN => {
211
211
  return false;
212
212
  };
213
213
 
214
- export const getInputConfigForCommand = async commandName => {
214
+ export const getInputConfigForCommand = async (commandName) => {
215
215
  // retrievedConfigData
216
216
  const currentDirectory = process.cwd();
217
217
  const inputConfigJsonPath = join(currentDirectory, INPUT_CONFIG_JSON_FILENAME);
@@ -237,7 +237,7 @@ export const getInputConfigForCommand = async commandName => {
237
237
  return standardCommands[commandName];
238
238
  }
239
239
  }
240
- } catch (ex) {
240
+ } catch {
241
241
  // when can't find it, always be false, assume no library based.
242
242
  // This is IMPORTANT for init (npx install)
243
243
  return {};
@@ -259,7 +259,7 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
259
259
  if (showDebug) addDebugLog('checkPathAccess', 'path: '.concat(path), '+');
260
260
  if (showDebug) addDebugLog('checkPathAccess', 'Error: '.concat(err), '');
261
261
  if (showDebug) addDebugLog('checkPathAccess', 'END', '-');
262
- throw new Error(err);
262
+ throw new Error(err.message, { cause: err });
263
263
  } else {
264
264
  if (showDebug) addDebugLog('checkPathAccess', 'path: '.concat(path), '+');
265
265
  const message = errorMessage || `${chalk.red.bold('ERROR')} Unable to access path - ${path}`;
@@ -278,7 +278,7 @@ export const getUseWebPackPromotion = async () => {
278
278
  try {
279
279
  // force to throw error and not console log
280
280
  await checkPathAccess(pegaConfigJsonPath, {}, true);
281
- } catch (ex) {
281
+ } catch {
282
282
  // when can't find it, always be false, assume no webpack override.
283
283
  // This is IMPORTANT for init (npx install)
284
284
  return false;
@@ -338,7 +338,7 @@ export const getAboutData = async (currentOrgLib, buildVersion, dateStamp) => {
338
338
  return `${currentOrgLib} ${buildVersion}, ${dateStamp}, ${infinityVersion}`;
339
339
  };
340
340
 
341
- export const applyPegaData = async configJson => {
341
+ export const applyPegaData = async (configJson) => {
342
342
  if (showDebug) addDebugLog('applyPegaData', '', '');
343
343
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
344
344
  const currentDirectory = process.cwd();
@@ -349,7 +349,7 @@ export const applyPegaData = async configJson => {
349
349
 
350
350
  try {
351
351
  currentPackageLockData = fs.readFileSync(currentPackageLockPath);
352
- } catch (ex) {
352
+ } catch {
353
353
  console.log(chalk.red(`\nUnable to retrieve current package-lock.json.`));
354
354
  process.exit(1);
355
355
  }
@@ -364,6 +364,7 @@ export const applyPegaData = async configJson => {
364
364
  let infinityVersion = '';
365
365
 
366
366
  if (tokenAndStaticServer.C11NB2S === undefined) {
367
+ // no-op, keep default infinityVersion
367
368
  } else {
368
369
  const jwt = jwtDecode(tokenAndStaticServer.C11NB2S);
369
370
  infinityVersion = jwt.infinity_version;
@@ -383,7 +384,7 @@ export const checkJWTExpiration = async () => {
383
384
  if (!isLibraryBasedCL && isLibraryBased) {
384
385
  if (tokenAndStaticServer.C11NB2S === undefined) {
385
386
  console.log(
386
- chalk.redBright('Need to authenticate, missing services token.\nBuilding a library requires authentication to acquire a token to build.')
387
+ chalk.redBright('Need to authenticate, missing services token.\nBuilding a library requires authentication to acquire a token to build.'),
387
388
  );
388
389
  process.exit(1);
389
390
  }
@@ -416,7 +417,7 @@ export const checkAccessTokenExpiration = async () => {
416
417
  }
417
418
 
418
419
  const jwt = jwtDecode(tokenAndStaticServer.access_token);
419
- const { exp, customer_org, sub, app_name, app_version, operator_access } = jwt;
420
+ const { exp } = jwt;
420
421
 
421
422
  if (exp < (new Date().getTime() + 1) / 1000) {
422
423
  console.log(chalk.redBright('Authentication token has expired, please reauthenticate.'));
@@ -458,7 +459,7 @@ export const getUseInputConfig = () => {
458
459
  return defaultConfigs.useInputConfig;
459
460
  };
460
461
 
461
- export const setLibraryBased = async isLibraryBased => {
462
+ export const setLibraryBased = async (isLibraryBased) => {
462
463
  if (showDebug) addDebugLog('setLibraryBased', '', '');
463
464
  const currentDirectory = process.cwd();
464
465
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -466,7 +467,7 @@ export const setLibraryBased = async isLibraryBased => {
466
467
  try {
467
468
  // force to throw error and not console log
468
469
  await checkPathAccess(pegaConfigJsonPath, {}, true);
469
- } catch (ex) {
470
+ } catch {
470
471
  // when can't find it, always be false, assume no library based.
471
472
  // This is IMPORTANT for init (npx install)
472
473
  return false;
@@ -494,7 +495,7 @@ export const setLibraryBased = async isLibraryBased => {
494
495
  }
495
496
  };
496
497
 
497
- export const setLibraryBasedCL = async isLibraryBasedCL => {
498
+ export const setLibraryBasedCL = async (isLibraryBasedCL) => {
498
499
  if (showDebug) addDebugLog('setLibraryBased', '', '');
499
500
  const currentDirectory = process.cwd();
500
501
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -502,7 +503,7 @@ export const setLibraryBasedCL = async isLibraryBasedCL => {
502
503
  try {
503
504
  // force to throw error and not console log
504
505
  await checkPathAccess(pegaConfigJsonPath, {}, true);
505
- } catch (ex) {
506
+ } catch {
506
507
  // when can't find it, always be false, assume no library based.
507
508
  // This is IMPORTANT for init (npx install)
508
509
  return false;
@@ -542,7 +543,7 @@ export const getShowDebug = () => {
542
543
  return defaultConfigs.showDebug;
543
544
  };
544
545
 
545
- export const deleteLocalComponent = async componentKey => {
546
+ export const deleteLocalComponent = async (componentKey) => {
546
547
  if (showDebug) addDebugLog('deleteLocalComponent', `componentKey: ${componentKey}`, '');
547
548
  const currentDirectory = process.cwd();
548
549
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -564,11 +565,11 @@ export const deleteLocalComponent = async componentKey => {
564
565
  console.log(`${chalk.red.bold(componentKey)} is deleted from Local`);
565
566
  } catch (err) {
566
567
  console.log('no file');
567
- throw new Error(`No such file ${componentKey}`);
568
+ throw new Error(`No such file ${componentKey}`, { cause: err });
568
569
  }
569
570
  };
570
571
 
571
- export const getFetchAgent = serverConfig => {
572
+ export const getFetchAgent = (serverConfig) => {
572
573
  const nodeUseEnvProxy = process.env.node_use_env_proxy || process.env.NODE_USE_ENV_PROXY;
573
574
  const agentOptions = { rejectUnauthorized: false };
574
575
  if (serverConfig.legacyTLS) {
@@ -577,16 +578,16 @@ export const getFetchAgent = serverConfig => {
577
578
  if (nodeUseEnvProxy === '1') {
578
579
  return new undici.EnvHttpProxyAgent({
579
580
  proxyTls: agentOptions,
580
- requestTls: agentOptions
581
+ requestTls: agentOptions,
581
582
  });
582
583
  }
583
584
  return new undici.Agent({ connect: agentOptions });
584
585
  };
585
586
 
586
- export const deleteServerComponent = async componentKey => {
587
+ export const deleteServerComponent = async (componentKey) => {
587
588
  if (showDebug) addDebugLog('deleteServerComponent', `componentKey: ${componentKey}`, '');
588
589
  const serverConfig = await getPegaServerConfig();
589
- const { server, user, password } = serverConfig;
590
+ const { server } = serverConfig;
590
591
  const url = constructCompleteUrl(server, DELETE_COMPONENT_SERVICE_REST_ENDPOINT);
591
592
  const [componentName, rulesetName, rulesetVersion] = componentKey.split('~|~');
592
593
  const deleteUrl = `${url}/${componentName}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
@@ -594,20 +595,20 @@ export const deleteServerComponent = async componentKey => {
594
595
  const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
595
596
 
596
597
  if (OauthData) {
597
- const { access_token: accessToken, token_type: tokenType, refresh_token: refreshToken } = JSON.parse(OauthData);
598
+ const { access_token: accessToken, token_type: tokenType } = JSON.parse(OauthData);
598
599
  fetch(deleteUrl, {
599
600
  method: 'DELETE',
600
601
  dispatcher: getFetchAgent(serverConfig),
601
602
  headers: {
602
- Authorization: `${tokenType} ${accessToken}`
603
- }
603
+ Authorization: `${tokenType} ${accessToken}`,
604
+ },
604
605
  })
605
- .then(response => response.text())
606
- .then(resp => {
606
+ .then((response) => response.text())
607
+ .then((resp) => {
607
608
  let respData;
608
609
  try {
609
610
  respData = JSON.parse(resp);
610
- } catch (e) {
611
+ } catch {
611
612
  console.log(chalk.bold.redBright(`Failure : ${resp}`));
612
613
  process.exit(1);
613
614
  }
@@ -618,7 +619,7 @@ export const deleteServerComponent = async componentKey => {
618
619
  throw new Error(`${respData.message}`);
619
620
  }
620
621
  })
621
- .catch(e => Promise.reject(`${chalk.bold.red(e)}`));
622
+ .catch((e) => Promise.reject(`${chalk.bold.red(e)}`));
622
623
  }
623
624
  } catch (error) {
624
625
  console.log(`\n${chalk.bold.red(error)}`);
@@ -675,23 +676,23 @@ export const getComponents = async (overrideDirectory = null) => {
675
676
 
676
677
  return fs
677
678
  .readdirSync(directory, { withFileTypes: true })
678
- .filter(dirent => dirent.isDirectory() && dirent.name !== SHARED_DIRECTORY)
679
- .map(dirent => dirent.name);
679
+ .filter((dirent) => dirent.isDirectory() && dirent.name !== SHARED_DIRECTORY)
680
+ .map((dirent) => dirent.name);
680
681
  };
681
682
 
682
- export const getTopLevelConfigFiles = async directory => {
683
+ export const getTopLevelConfigFiles = async (directory) => {
683
684
  if (showDebug) addDebugLog('getTopLevelConfigFiles', `directory: ${directory}`, '');
684
685
  if (fs.existsSync(directory)) {
685
686
  return fs
686
687
  .readdirSync(directory, { withFileTypes: true })
687
- .filter(dirent => !dirent.isDirectory())
688
- .map(dirent => dirent.name);
688
+ .filter((dirent) => !dirent.isDirectory())
689
+ .map((dirent) => dirent.name);
689
690
  } else {
690
691
  return [];
691
692
  }
692
693
  };
693
694
 
694
- export const removeTopLevelConfigFiles = async directory => {
695
+ export const removeTopLevelConfigFiles = async (directory) => {
695
696
  if (showDebug) addDebugLog('removeTopLevelConfigFiles', `directory: ${directory}`, '');
696
697
  const configFiles = await getTopLevelConfigFiles(directory);
697
698
 
@@ -712,7 +713,7 @@ export const removeTopLevelConfigFiles = async directory => {
712
713
  }
713
714
  };
714
715
 
715
- export const restoreTopLevelConfigFiles = async directory => {
716
+ export const restoreTopLevelConfigFiles = async (directory) => {
716
717
  if (showDebug) addDebugLog('restoreTopLevelConfigFiles', `directory: ${directory}`, '');
717
718
  const currentDirectory = process.cwd();
718
719
  const tempDirectory = join(currentDirectory, TEMP_PATH);
@@ -742,8 +743,8 @@ export const getTemplateConfigFiles = async () => {
742
743
  if (fs.existsSync(templateDir)) {
743
744
  return fs
744
745
  .readdirSync(templateDir, { withFileTypes: true })
745
- .filter(dirent => !dirent.isDirectory())
746
- .map(dirent => dirent.name);
746
+ .filter((dirent) => !dirent.isDirectory())
747
+ .map((dirent) => dirent.name);
747
748
  } else {
748
749
  return [];
749
750
  }
@@ -767,8 +768,8 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
767
768
 
768
769
  try {
769
770
  currentPackageData = fs.readFileSync(currentPackagePath);
770
- } catch (ex) {
771
- console.log($chalk.red(`\nUnable to retrieve current package.json.`));
771
+ } catch {
772
+ console.log(chalk.red(`\nUnable to retrieve current package.json.`));
772
773
  process.exit(1);
773
774
  }
774
775
  let cData = JSON.parse(currentPackageData);
@@ -776,8 +777,8 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
776
777
  let retrievedTemplateData;
777
778
  try {
778
779
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
779
- } catch (ex) {
780
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
780
+ } catch {
781
+ console.log(chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
781
782
  process.exit(1);
782
783
  }
783
784
 
@@ -834,16 +835,16 @@ export const getSubComponents = async (directory, type) => {
834
835
  const subDirectory = join(directory, type);
835
836
  return fs
836
837
  .readdirSync(subDirectory, { withFileTypes: true })
837
- .filter(dirent => dirent.isDirectory())
838
- .map(dirent => dirent.name);
838
+ .filter((dirent) => dirent.isDirectory())
839
+ .map((dirent) => dirent.name);
839
840
  };
840
841
 
841
- export const getDirectoryFiles = async directory => {
842
+ export const getDirectoryFiles = async (directory) => {
842
843
  if (showDebug) addDebugLog('getDirectoryFiles', `directory: ${directory}`, '');
843
844
  return fs
844
845
  .readdirSync(directory, { withFileTypes: true })
845
- .filter(dirent => !dirent.isDirectory())
846
- .map(dirent => dirent.name);
846
+ .filter((dirent) => !dirent.isDirectory())
847
+ .map((dirent) => dirent.name);
847
848
  };
848
849
 
849
850
  export const getComponentsObj = async () => {
@@ -855,14 +856,14 @@ export const getComponentsObj = async () => {
855
856
 
856
857
  if (componentList.length > 0) {
857
858
  compList.push(
858
- ...componentList.map(name => {
859
+ ...componentList.map((name) => {
859
860
  const container = {};
860
861
  container.name = name;
861
862
  container.value = name;
862
863
 
863
864
  if (showDebug) addDebugLog('getComponentsObj', `container: ${JSON.stringify(container)}`, '');
864
865
  return container;
865
- })
866
+ }),
866
867
  );
867
868
  }
868
869
 
@@ -907,7 +908,7 @@ export const getPegaServerConfig = async (force = false) => {
907
908
  let OAuthData;
908
909
  try {
909
910
  OAuthData = fs.readFileSync(TOKEN_PATH, 'utf8');
910
- } catch (ex) {
911
+ } catch {
911
912
  return {};
912
913
  }
913
914
 
@@ -969,7 +970,7 @@ export const updateServerConfigArchiveRuleSetAndVersion = async (rulesetName, ru
969
970
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
970
971
  };
971
972
 
972
- export const updateComponentDefaultLibrary = async library => {
973
+ export const updateComponentDefaultLibrary = async (library) => {
973
974
  if (showDebug) addDebugLog('updateComponentDefaultLibrary', `library: ${library}`, '');
974
975
  const currentDirectory = process.cwd();
975
976
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -983,7 +984,7 @@ export const updateComponentDefaultLibrary = async library => {
983
984
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8', flag: 'w' });
984
985
  };
985
986
 
986
- export const updateComponentDefaultVersion = async version => {
987
+ export const updateComponentDefaultVersion = async (version) => {
987
988
  if (showDebug) addDebugLog('updateComponentDefaultVersion', `version: ${version}`, '');
988
989
  const currentDirectory = process.cwd();
989
990
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -1009,7 +1010,7 @@ export const getConfigDevBuild = async () => {
1009
1010
  return defaultConfigs.devBuild;
1010
1011
  };
1011
1012
 
1012
- export const setConfigDevBuild = async devBuild => {
1013
+ export const setConfigDevBuild = async (devBuild) => {
1013
1014
  if (showDebug) addDebugLog('setConfigDevBuild', `devBuild: ${devBuild}`, '');
1014
1015
  const currentDirectory = process.cwd();
1015
1016
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -1029,7 +1030,7 @@ export const getConfigDevServerPort = async () => {
1029
1030
  return defaultConfigs.devServerPort;
1030
1031
  };
1031
1032
 
1032
- export const setConfigImportRelativePath = async importRelativePath => {
1033
+ export const setConfigImportRelativePath = async (importRelativePath) => {
1033
1034
  if (showDebug) addDebugLog('setConfigImportRelativePath', `importRelativePath: ${importRelativePath}`, '');
1034
1035
  const currentDirectory = process.cwd();
1035
1036
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -1041,7 +1042,7 @@ export const setConfigImportRelativePath = async importRelativePath => {
1041
1042
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1042
1043
  };
1043
1044
 
1044
- export const setConfigExportRelativePath = async exportRelativePath => {
1045
+ export const setConfigExportRelativePath = async (exportRelativePath) => {
1045
1046
  if (showDebug) addDebugLog('setConfigExportRelativePath', `exportRelativePath: ${exportRelativePath}`, '');
1046
1047
  const currentDirectory = process.cwd();
1047
1048
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -1053,7 +1054,7 @@ export const setConfigExportRelativePath = async exportRelativePath => {
1053
1054
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1054
1055
  };
1055
1056
 
1056
- export const updateDefaultOrganization = async organization => {
1057
+ export const updateDefaultOrganization = async (organization) => {
1057
1058
  if (showDebug) addDebugLog('updateDefaultOrganization', `organization: ${organization}`, '');
1058
1059
  let packageData = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf-8'));
1059
1060
 
@@ -1072,7 +1073,7 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1072
1073
  let configData;
1073
1074
  try {
1074
1075
  configData = fs.readFileSync(path.resolve(configFile), 'utf8');
1075
- } catch (err) {
1076
+ } catch {
1076
1077
  // for now, if now file just end
1077
1078
  console.log(`${chalk.bold.yellow(`Config file not available for: ${componentKey}`)}`);
1078
1079
  return;
@@ -1109,13 +1110,13 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1109
1110
  format: 'LABEL',
1110
1111
  label: 'About',
1111
1112
  name: 'PegaAboutLabel',
1112
- variant: 'h3'
1113
+ variant: 'h3',
1113
1114
  };
1114
1115
  const aboutDataJSON = {
1115
1116
  format: 'LABEL',
1116
1117
  label: aboutData,
1117
1118
  name: 'PegaAboutData',
1118
- variant: 'primary'
1119
+ variant: 'primary',
1119
1120
  };
1120
1121
  properties.push(aboutLabelJSON);
1121
1122
  properties.push(aboutDataJSON);
@@ -1123,7 +1124,7 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1123
1124
  }
1124
1125
  }
1125
1126
  } catch (er) {
1126
- throw new Error(`Invalid schema json in config.json: ${er}`);
1127
+ throw new Error(`Invalid schema json in config.json: ${er}`, { cause: er });
1127
1128
  }
1128
1129
 
1129
1130
  data.version = buildVersion;
@@ -1146,7 +1147,7 @@ export const getServerType = () => {
1146
1147
  return defaultConfigs.serverType;
1147
1148
  };
1148
1149
 
1149
- export const setServerType = async serverType => {
1150
+ export const setServerType = async (serverType) => {
1150
1151
  if (showDebug) addDebugLog('setServerType', `serverType: ${serverType}`, '');
1151
1152
  const currentDirectory = process.cwd();
1152
1153
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -1196,23 +1197,23 @@ export const compileMustacheTemplate = (file, data) => {
1196
1197
  return mustache.render(content, data);
1197
1198
  };
1198
1199
 
1199
- export const isPascalCase = string => {
1200
+ export const isPascalCase = (string) => {
1200
1201
  return string === pascalCase(string);
1201
1202
  };
1202
1203
 
1203
- export const convertIntoPascalCase = string => {
1204
+ export const convertIntoPascalCase = (string) => {
1204
1205
  return pascalCase(string);
1205
1206
  };
1206
1207
 
1207
1208
  export const constructCompleteUrl = (baseServer, endPoint) => {
1208
1209
  if (showDebug)
1209
- addDebugLog('constructCompleteUrl', `url: ${baseServer.endsWith('/')}` ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`, '');
1210
+ addDebugLog('constructCompleteUrl', `url: ${baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`}`, '');
1210
1211
  return baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`;
1211
1212
  };
1212
1213
 
1213
- export const isLaunchpadVanity = config => config?.serverType === 'launchpad' && config?.isVanity !== false;
1214
+ export const isLaunchpadVanity = (config) => config?.serverType === 'launchpad' && config?.isVanity !== false;
1214
1215
 
1215
- export const isCompleteHttpUrl = value => {
1216
+ export const isCompleteHttpUrl = (value) => {
1216
1217
  if (typeof value !== 'string' || !value.trim()) {
1217
1218
  return false;
1218
1219
  }
@@ -1220,12 +1221,12 @@ export const isCompleteHttpUrl = value => {
1220
1221
  try {
1221
1222
  const url = new URL(value);
1222
1223
  return url.protocol === 'http:' || url.protocol === 'https:';
1223
- } catch (error) {
1224
+ } catch {
1224
1225
  return false;
1225
1226
  }
1226
1227
  };
1227
1228
 
1228
- export const sanitize = str => {
1229
+ export const sanitize = (str) => {
1229
1230
  /* Allow only numbers and case insensitive alphabets */
1230
1231
  str = str.replace(/[^a-zA-Z0-9 ]/g, '');
1231
1232
  /* spaces will be replaced by - */
@@ -1233,13 +1234,13 @@ export const sanitize = str => {
1233
1234
  return str;
1234
1235
  };
1235
1236
 
1236
- export const validateSemver = str => {
1237
+ export const validateSemver = (str) => {
1237
1238
  /* basic semver version validation - 0.0.1-dev */
1238
1239
  const regex = /^[0-9]\d*\.\d+\.\d+(?:-[a-zA-Z0-9]+)?$/g;
1239
1240
  return regex.test(str);
1240
1241
  };
1241
1242
 
1242
- export const validateRulesetVersion = str => {
1243
+ export const validateRulesetVersion = (str) => {
1243
1244
  /* Ruleset version range - 01-99 */
1244
1245
  if (str.indexOf('00') !== -1) {
1245
1246
  return false;
@@ -1292,7 +1293,7 @@ export const showVersion = async () => {
1292
1293
  await checkForBranch(serverConfig.rulesetName);
1293
1294
  };
1294
1295
 
1295
- export const checkForBranch = async rulesetName => {
1296
+ export const checkForBranch = async (rulesetName) => {
1296
1297
  if (getServerType() === 'infinity') {
1297
1298
  if (rulesetName === '') {
1298
1299
  const serverConfig = await getPegaServerConfig();
@@ -1308,7 +1309,7 @@ export const checkForBranch = async rulesetName => {
1308
1309
 
1309
1310
  export const getOOTBComponents = async () => {
1310
1311
  if (showDebug) addDebugLog('getOOTBComponents', '', '');
1311
- return new Promise(resolve => {
1312
+ return new Promise((resolve) => {
1312
1313
  fs.readFile(OOTB_COMPONENTS, 'utf-8', async (error, ootbComponentsData) => {
1313
1314
  if (error) {
1314
1315
  try {
@@ -1322,15 +1323,15 @@ export const getOOTBComponents = async () => {
1322
1323
  method: 'GET',
1323
1324
  dispatcher: getFetchAgent(serverConfig),
1324
1325
  headers: {
1325
- Authorization: `${tokenType} ${accessToken}`
1326
- }
1326
+ Authorization: `${tokenType} ${accessToken}`,
1327
+ },
1327
1328
  })
1328
- .then(response => response.text())
1329
- .then(data => {
1329
+ .then((response) => response.text())
1330
+ .then((data) => {
1330
1331
  if (data.charAt() === '[') {
1331
1332
  data = data.slice(1, -1);
1332
1333
  data = data.replace(/\s/g, '');
1333
- fs.writeFile(OOTB_COMPONENTS, data, err => {
1334
+ fs.writeFile(OOTB_COMPONENTS, data, (err) => {
1334
1335
  if (err) {
1335
1336
  console.error(err);
1336
1337
  }
@@ -1340,14 +1341,14 @@ export const getOOTBComponents = async () => {
1340
1341
  data = JSON.parse(data);
1341
1342
  if (data && data.errors) {
1342
1343
  const errMessages = data.errors;
1343
- errMessages.forEach(msgArr => {
1344
+ errMessages.forEach((msgArr) => {
1344
1345
  throw new Error(`Failed with error - ${JSON.stringify(msgArr.message)}`);
1345
1346
  });
1346
1347
  }
1347
1348
  }
1348
1349
  })
1349
1350
 
1350
- .catch(e => Promise.reject(`${chalk.bold.red(e)}`));
1351
+ .catch((e) => Promise.reject(`${chalk.bold.red(e)}`));
1351
1352
  }
1352
1353
  } catch (e) {
1353
1354
  throw new Error('Error occurred in validation', e);
@@ -1359,7 +1360,7 @@ export const getOOTBComponents = async () => {
1359
1360
  });
1360
1361
  };
1361
1362
 
1362
- export const deleteInfinityServerComponent = async componentKey => {
1363
+ export const deleteInfinityServerComponent = async (componentKey) => {
1363
1364
  if (showDebug) addDebugLog('deleteInfinityServerComponent', `componentKey: ${componentKey}`, '');
1364
1365
  const serverConfig = await getPegaServerConfig();
1365
1366
  const { server } = serverConfig;
@@ -1378,8 +1379,8 @@ export const deleteInfinityServerComponent = async componentKey => {
1378
1379
  method: 'DELETE',
1379
1380
  dispatcher: getFetchAgent(serverConfig),
1380
1381
  headers: {
1381
- Authorization: `${tokenType} ${accessToken}`
1382
- }
1382
+ Authorization: `${tokenType} ${accessToken}`,
1383
+ },
1383
1384
  });
1384
1385
 
1385
1386
  status = response.status;
@@ -1409,14 +1410,14 @@ export const deleteInfinityServerComponent = async componentKey => {
1409
1410
  }
1410
1411
  } catch (err) {
1411
1412
  if (status === 500) {
1412
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
1413
+ throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
1413
1414
  } else if (status === 999) {
1414
- throw new Error(err);
1415
+ throw new Error(err, { cause: err });
1415
1416
  }
1416
1417
  }
1417
1418
  }
1418
1419
  } catch (error) {
1419
- throw new Error(error);
1420
+ throw new Error(error, { cause: error });
1420
1421
  }
1421
1422
  };
1422
1423
 
@@ -1424,8 +1425,8 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1424
1425
  if (showDebug)
1425
1426
  addDebugLog(
1426
1427
  'deleteInfinityServerComponentLibrary',
1427
- `componentKey: ${componentKey}, rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`,
1428
- ''
1428
+ `libraryName: ${libraryName}, rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`,
1429
+ '',
1429
1430
  );
1430
1431
  const serverConfig = await getPegaServerConfig();
1431
1432
  const { server } = serverConfig;
@@ -1447,8 +1448,8 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1447
1448
  method: 'DELETE',
1448
1449
  dispatcher: getFetchAgent(serverConfig),
1449
1450
  headers: {
1450
- Authorization: `${tokenType} ${accessToken}`
1451
- }
1451
+ Authorization: `${tokenType} ${accessToken}`,
1452
+ },
1452
1453
  });
1453
1454
 
1454
1455
  spinner.stop();
@@ -1486,18 +1487,18 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1486
1487
  }
1487
1488
  } catch (err) {
1488
1489
  if (status === 500) {
1489
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
1490
+ throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
1490
1491
  } else if (status === 999) {
1491
- throw new Error(err);
1492
+ throw new Error(err, { cause: err });
1492
1493
  }
1493
1494
  }
1494
1495
  }
1495
1496
  } catch (error) {
1496
- throw new Error(error);
1497
+ throw new Error(error, { cause: error });
1497
1498
  }
1498
1499
  };
1499
1500
 
1500
- export const deleteLaunchpadServerComponent = async componentKey => {
1501
+ export const deleteLaunchpadServerComponent = async (componentKey) => {
1501
1502
  if (showDebug) addDebugLog('deleteLaunchpadServerComponent', `componentKey: ${componentKey}`, '');
1502
1503
  const serverConfig = await getPegaServerConfig();
1503
1504
  const { server, isolationId } = serverConfig;
@@ -1518,19 +1519,19 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1518
1519
  const headers = {
1519
1520
  Authorization: `${tokenType} ${accessToken}`,
1520
1521
  cookie: `Pega-AAT=${accessToken}`,
1521
- 'Content-Type': 'application/json'
1522
+ 'Content-Type': 'application/json',
1522
1523
  };
1523
1524
 
1524
1525
  const apiBody = {
1525
1526
  type: 'CustomComponent',
1526
- componentName
1527
+ componentName,
1527
1528
  };
1528
1529
 
1529
1530
  const response = await fetch(deleteUrl, {
1530
1531
  method: 'DELETE',
1531
1532
  dispatcher: getFetchAgent(serverConfig),
1532
1533
  headers,
1533
- body: JSON.stringify(apiBody)
1534
+ body: JSON.stringify(apiBody),
1534
1535
  });
1535
1536
 
1536
1537
  status = response.status;
@@ -1560,14 +1561,14 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1560
1561
  }
1561
1562
  } catch (err) {
1562
1563
  if (status === 500) {
1563
- throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
1564
+ throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
1564
1565
  } else if (status === 999) {
1565
- throw new Error(err);
1566
+ throw new Error(err, { cause: err });
1566
1567
  }
1567
1568
  }
1568
1569
  }
1569
1570
  } catch (error) {
1570
- throw new Error(error);
1571
+ throw new Error(error, { cause: error });
1571
1572
  }
1572
1573
  };
1573
1574
 
@@ -1579,9 +1580,9 @@ export const getBootstrapConfig = async (restServerUrl, authorizationHeader) =>
1579
1580
  method: 'GET',
1580
1581
  dispatcher: getFetchAgent(serverConfig),
1581
1582
  headers: new Headers({
1582
- Authorization: authorizationHeader
1583
- })
1584
- }).then(response => {
1583
+ Authorization: authorizationHeader,
1584
+ }),
1585
+ }).then((response) => {
1585
1586
  if (response.ok) {
1586
1587
  return response.json();
1587
1588
  }
@@ -1621,12 +1622,11 @@ export const updateC11NB2SForLaunchpad = async () => {};
1621
1622
 
1622
1623
  export const getC11NB2STokenAndStaticServer = async () => {
1623
1624
  if (showDebug) addDebugLog('getC11NB2STokenAndStaticServer', '', '');
1624
- const serverConfig = await getPegaServerConfig();
1625
- const { server } = serverConfig;
1625
+ await getPegaServerConfig();
1626
1626
  let OAuthData;
1627
1627
  try {
1628
1628
  OAuthData = fs.readFileSync(TOKEN_PATH, 'utf8');
1629
- } catch (ex) {
1629
+ } catch {
1630
1630
  return {};
1631
1631
  }
1632
1632
 
@@ -1646,8 +1646,8 @@ export const getLocalLibraries = async () => {
1646
1646
 
1647
1647
  return fs
1648
1648
  .readdirSync(currentDirectory, { withFileTypes: true })
1649
- .filter(dirent => dirent.isDirectory() && dirent.name.startsWith(libFilter))
1650
- .map(dirent => dirent.name);
1649
+ .filter((dirent) => dirent.isDirectory() && dirent.name.startsWith(libFilter))
1650
+ .map((dirent) => dirent.name);
1651
1651
  };
1652
1652
 
1653
1653
  export const getLocalLibraryVersions = async (libraryName, currentVersion = '0.0.0') => {
@@ -1657,8 +1657,8 @@ export const getLocalLibraryVersions = async (libraryName, currentVersion = '0.0
1657
1657
  const directory = join(currentDirectory, libraryName);
1658
1658
  return fs
1659
1659
  .readdirSync(directory, { withFileTypes: true })
1660
- .filter(dirent => dirent.isDirectory() && dirent.name != currentVersion)
1661
- .map(dirent => dirent.name);
1660
+ .filter((dirent) => dirent.isDirectory() && dirent.name != currentVersion)
1661
+ .map((dirent) => dirent.name);
1662
1662
  };
1663
1663
 
1664
1664
  export const getLocalArchivedLibraryVersions = async (libraryName, currentVersion = '0.0.0') => {
@@ -1668,8 +1668,8 @@ export const getLocalArchivedLibraryVersions = async (libraryName, currentVersio
1668
1668
 
1669
1669
  return fs
1670
1670
  .readdirSync(archiveDirectory, { withFileTypes: true })
1671
- .filter(dirent => dirent.isDirectory() && dirent.name != currentVersion)
1672
- .map(dirent => dirent.name);
1671
+ .filter((dirent) => dirent.isDirectory() && dirent.name != currentVersion)
1672
+ .map((dirent) => dirent.name);
1673
1673
  };
1674
1674
 
1675
1675
  export const getLocalArchivedLibraryVersionData = async (libraryName, libraryVersion) => {
@@ -1695,7 +1695,7 @@ export const getLocalLibraryVersionData = async (libraryName, libraryVersion) =>
1695
1695
  return data;
1696
1696
  };
1697
1697
 
1698
- export const deleteLocalLibrary = async libraryName => {
1698
+ export const deleteLocalLibrary = async (libraryName) => {
1699
1699
  if (showDebug) addDebugLog('deleteLocalLibrary', `libraryName: ${libraryName}`, '');
1700
1700
  const currentDirectory = process.cwd();
1701
1701
 
@@ -1710,7 +1710,7 @@ export const deleteLocalLibrary = async libraryName => {
1710
1710
  } else {
1711
1711
  console.log(`Library: ${chalk.red.bold(libraryName)} does not exist.`);
1712
1712
  }
1713
- } catch (ex) {
1713
+ } catch {
1714
1714
  if (fs.existsSync(directory)) {
1715
1715
  fs.rmSync(directory, { recursive: true, force: true, maxRetries: 2 });
1716
1716
  console.log(`Library: ${chalk.green.bold(libraryName)} is deleted from Local`);
@@ -1726,16 +1726,12 @@ export const deleteLocalLibraryVersion = async (libraryName, libraryVersion) =>
1726
1726
 
1727
1727
  const directory = join(currentDirectory, libraryName, libraryVersion);
1728
1728
 
1729
- try {
1730
- if (fs.existsSync(directory)) {
1731
- console.log(`Deleting library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)}`);
1732
- fs.rmSync(directory, { recursive: true, force: true, maxRetries: 2 });
1733
- console.log(`Library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)} is deleted from Local`);
1734
- } else {
1735
- console.log(`Library version: ${chalk.red.bold(libraryName)}:${chalk.red.bold(libraryVersion)} does not exist.`);
1736
- }
1737
- } catch (error) {
1738
- throw error;
1729
+ if (fs.existsSync(directory)) {
1730
+ console.log(`Deleting library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)}`);
1731
+ fs.rmSync(directory, { recursive: true, force: true, maxRetries: 2 });
1732
+ console.log(`Library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)} is deleted from Local`);
1733
+ } else {
1734
+ console.log(`Library version: ${chalk.red.bold(libraryName)}:${chalk.red.bold(libraryVersion)} does not exist.`);
1739
1735
  }
1740
1736
  };
1741
1737
 
@@ -1764,7 +1760,7 @@ export const deletePublishExtras = async (libraryName, libraryVersion) => {
1764
1760
  export const cleanUp = async () => {
1765
1761
  if (showDebug) addDebugLog('cleanUp', '', '');
1766
1762
  if (fs.existsSync('dist/components')) {
1767
- fs.rm('dist/components', { recursive: true }, err => {
1763
+ fs.rm('dist/components', { recursive: true }, (err) => {
1768
1764
  if (err) {
1769
1765
  throw err;
1770
1766
  }
@@ -1772,7 +1768,7 @@ export const cleanUp = async () => {
1772
1768
  }
1773
1769
 
1774
1770
  if (fs.existsSync('lib')) {
1775
- fs.rm('lib', { recursive: true, force: true }, err => {
1771
+ fs.rm('lib', { recursive: true, force: true }, (err) => {
1776
1772
  if (err) {
1777
1773
  throw err;
1778
1774
  }
@@ -1810,7 +1806,7 @@ export const getComponentsConfigs = async (compDir = null) => {
1810
1806
  export const collectSvgFiles = (directory, results = []) => {
1811
1807
  if (!fs.existsSync(directory)) return results;
1812
1808
 
1813
- const walkDir = dir => {
1809
+ const walkDir = (dir) => {
1814
1810
  const entries = fs.readdirSync(dir, { withFileTypes: true });
1815
1811
  for (const entry of entries) {
1816
1812
  const fullPath = join(dir, entry.name);
@@ -1862,8 +1858,6 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1862
1858
  currentDirectory = process.cwd();
1863
1859
  }
1864
1860
  const srcDirectoryPath = join(currentDirectory, 'src');
1865
- const tasksConfig = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1866
- const packageJson = join(currentDirectory, PACKAGE_JSON_FILENAME);
1867
1861
  const archiveFileName = `${orgLibName}_${version}.arch.zip`;
1868
1862
 
1869
1863
  // check if components directory exists and if not, create a blank one
@@ -1883,16 +1877,14 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1883
1877
  await createComponentsConfigFile(archiveDirectory, join(srcDirectoryPath, 'components'));
1884
1878
 
1885
1879
  const archiveFile = join(archiveDirectory, archiveFileName);
1886
- if (fs.existsSync(orgLibName)) {
1887
- }
1888
1880
 
1889
1881
  const output = fs.createWriteStream(archiveFile);
1890
1882
  const archive = archiver('zip', {
1891
- zlib: { level: 9 } // Sets the compression level.
1883
+ zlib: { level: 9 }, // Sets the compression level.
1892
1884
  });
1893
1885
 
1894
1886
  const zipChunks = [];
1895
- archive.on('data', chunk => zipChunks.push(chunk));
1887
+ archive.on('data', (chunk) => zipChunks.push(chunk));
1896
1888
 
1897
1889
  // Add src directory
1898
1890
  archive.directory(srcDirectoryPath, 'src');
@@ -1941,8 +1933,6 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
1941
1933
  currentDirectory = process.cwd();
1942
1934
  }
1943
1935
  const srcDirectoryPath = join(currentDirectory, 'src');
1944
- const tasksConfig = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1945
- const packageJson = join(currentDirectory, PACKAGE_JSON_FILENAME);
1946
1936
  const archiveFileName = `${orgLibName}_${version}.arch.zip`;
1947
1937
 
1948
1938
  // const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
@@ -1956,16 +1946,14 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
1956
1946
  await createComponentsConfigFile(archiveDirectory, join(srcDirectoryPath, 'components'));
1957
1947
 
1958
1948
  const archiveFile = join(archiveDirectory, archiveFileName);
1959
- if (fs.existsSync(orgLibName)) {
1960
- }
1961
1949
 
1962
1950
  const output = fs.createWriteStream(archiveFile);
1963
1951
  const archive = archiver('zip', {
1964
- zlib: { level: 9 } // Sets the compression level.
1952
+ zlib: { level: 9 }, // Sets the compression level.
1965
1953
  });
1966
1954
 
1967
1955
  const zipChunks = [];
1968
- archive.on('data', chunk => zipChunks.push(chunk));
1956
+ archive.on('data', (chunk) => zipChunks.push(chunk));
1969
1957
 
1970
1958
  // Add src directory
1971
1959
  archive.directory(srcDirectoryPath, 'src');
@@ -2027,11 +2015,11 @@ export const zipUnArchiveToTempAndReturnBuffer = async (orgLibName, version) =>
2027
2015
 
2028
2016
  const output = fs.createWriteStream(archiveFile);
2029
2017
  const archive = archiver('zip', {
2030
- zlib: { level: 9 } // Sets the compression level.
2018
+ zlib: { level: 9 }, // Sets the compression level.
2031
2019
  });
2032
2020
 
2033
2021
  const zipChunks = [];
2034
- archive.on('data', chunk => zipChunks.push(chunk));
2022
+ archive.on('data', (chunk) => zipChunks.push(chunk));
2035
2023
 
2036
2024
  // Add src directory
2037
2025
  archive.directory(srcDirectoryPath, 'src');
@@ -2083,8 +2071,6 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2083
2071
  currentDirectory = process.cwd();
2084
2072
  }
2085
2073
  const libDirectoryPath = join(currentDirectory, orgLibName, version);
2086
- const tasksConfig = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
2087
- const packageJson = join(currentDirectory, PACKAGE_JSON_FILENAME);
2088
2074
  const archiveFileName = `${orgLibName}_${version}.zip`;
2089
2075
 
2090
2076
  // const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
@@ -2095,16 +2081,14 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2095
2081
  }
2096
2082
 
2097
2083
  const archiveFile = join(archiveDirectory, archiveFileName);
2098
- if (fs.existsSync(orgLibName)) {
2099
- }
2100
2084
 
2101
2085
  const output = fs.createWriteStream(archiveFile);
2102
2086
  const archive = archiver('zip', {
2103
- zlib: { level: 9 } // Sets the compression level.
2087
+ zlib: { level: 9 }, // Sets the compression level.
2104
2088
  });
2105
2089
 
2106
2090
  const zipChunks = [];
2107
- archive.on('data', chunk => zipChunks.push(chunk));
2091
+ archive.on('data', (chunk) => zipChunks.push(chunk));
2108
2092
 
2109
2093
  // Add src directory
2110
2094
  archive.directory(libDirectoryPath, false);
@@ -2136,7 +2120,7 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2136
2120
  return output;
2137
2121
  };
2138
2122
 
2139
- export const unZipFromArchive = async fileName => {
2123
+ export const unZipFromArchive = async (fileName) => {
2140
2124
  if (showDebug) addDebugLog('unZipFromArchive', `fileName: ${fileName}`, '');
2141
2125
  await unarchive(fileName, TEMP_PATH);
2142
2126
  };
@@ -2144,7 +2128,6 @@ export const unZipFromArchive = async fileName => {
2144
2128
  export const updateComponentTaskConfig = async () => {
2145
2129
  if (showDebug) addDebugLog('updateComponentTaskConfig', '', '');
2146
2130
  const currentDirectory = process.cwd();
2147
- const tempDirectory = join(currentDirectory, TEMP_PATH);
2148
2131
 
2149
2132
  const currentConfigPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
2150
2133
  const originalContents = fs.readFileSync(currentConfigPath);
@@ -2194,14 +2177,14 @@ export const restoreDependenciesFromPackage = async () => {
2194
2177
 
2195
2178
  try {
2196
2179
  retrievedPackageData = fs.readFileSync(tempPackagePath);
2197
- } catch (ex) {
2180
+ } catch {
2198
2181
  console.log(chalk.red(`\nUnable to retrieve package.json from store.`));
2199
2182
  process.exit(1);
2200
2183
  }
2201
2184
 
2202
2185
  try {
2203
2186
  currentPackageData = fs.readFileSync(currentPackagePath);
2204
- } catch (ex) {
2187
+ } catch {
2205
2188
  console.log(chalk.red(`\nUnable to retrieve current package.json.`));
2206
2189
  process.exit(1);
2207
2190
  }
@@ -2235,8 +2218,8 @@ export const restoreDependenciesFromPackage = async () => {
2235
2218
  let retrievedTemplateData;
2236
2219
  try {
2237
2220
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2238
- } catch (ex) {
2239
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2221
+ } catch {
2222
+ console.log(chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2240
2223
  process.exit(1);
2241
2224
  }
2242
2225
  const tData = JSON.parse(retrievedTemplateData);
@@ -2272,7 +2255,7 @@ export const restoreDependenciesFromTemplate = async () => {
2272
2255
 
2273
2256
  try {
2274
2257
  currentPackageData = fs.readFileSync(currentPackagePath);
2275
- } catch (ex) {
2258
+ } catch {
2276
2259
  console.log(chalk.red(`\nUnable to retrieve current package.json.`));
2277
2260
  process.exit(1);
2278
2261
  }
@@ -2288,8 +2271,8 @@ export const restoreDependenciesFromTemplate = async () => {
2288
2271
  let retrievedTemplateData;
2289
2272
  try {
2290
2273
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2291
- } catch (ex) {
2292
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2274
+ } catch {
2275
+ console.log(chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2293
2276
  process.exit(1);
2294
2277
  }
2295
2278
  const tData = JSON.parse(retrievedTemplateData);
@@ -2323,15 +2306,15 @@ export const restoreDependenciesFromPackage_old = async () => {
2323
2306
 
2324
2307
  try {
2325
2308
  retrievedPackageData = fs.readFileSync(tempPackagePath);
2326
- } catch (ex) {
2327
- console.log($chalk.red(`\nUnable to retrieve package.json from store.`));
2309
+ } catch {
2310
+ console.log(chalk.red(`\nUnable to retrieve package.json from store.`));
2328
2311
  process.exit(1);
2329
2312
  }
2330
2313
 
2331
2314
  try {
2332
2315
  currentPackageData = fs.readFileSync(currentPackagePath);
2333
- } catch (ex) {
2334
- console.log($chalk.red(`\nUnable to retrieve current package.json.`));
2316
+ } catch {
2317
+ console.log(chalk.red(`\nUnable to retrieve current package.json.`));
2335
2318
  process.exit(1);
2336
2319
  }
2337
2320
 
@@ -2364,8 +2347,8 @@ export const restoreDependenciesFromPackage_old = async () => {
2364
2347
  let retrievedTemplateData;
2365
2348
  try {
2366
2349
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2367
- } catch (ex) {
2368
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2350
+ } catch {
2351
+ console.log(chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2369
2352
  process.exit(1);
2370
2353
  }
2371
2354
  const tData = JSON.parse(retrievedTemplateData);
@@ -2396,8 +2379,6 @@ export const restoreFromArchive = async (fileName, orgLibName, version) => {
2396
2379
 
2397
2380
  await unZipFromArchive(archFileName);
2398
2381
 
2399
- const tempPackagePath = join(tempDirectory, PACKAGE_JSON_FILENAME);
2400
- const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2401
2382
  const tempDirectoryComponents = join(tempDirectory, 'src');
2402
2383
  const currentComponentsPath = join(currentDirectory, 'src');
2403
2384
 
@@ -2456,7 +2437,7 @@ export const clearSrcComponentsDirectory = async () => {
2456
2437
  fs.mkdirSync(currentComponentsPath, { recursive: true });
2457
2438
  };
2458
2439
 
2459
- export const isHiddenFile = fileName => {
2440
+ export const isHiddenFile = (fileName) => {
2460
2441
  if (fileName.indexOf('.') == 0) {
2461
2442
  return true;
2462
2443
  }
@@ -2486,7 +2467,9 @@ export const deleteArchives = async () => {
2486
2467
  if (hasArc) {
2487
2468
  try {
2488
2469
  fs.rmSync(archiveDirectory, { recursive: true });
2489
- } catch (err) {}
2470
+ } catch {
2471
+ // ignore, best-effort cleanup
2472
+ }
2490
2473
  }
2491
2474
  };
2492
2475
 
@@ -2534,8 +2517,8 @@ export const getLibraryArchiveDirectories = async (currentOrgLib = '') => {
2534
2517
 
2535
2518
  return fs
2536
2519
  .readdirSync(archiveDirectory, { withFileTypes: true })
2537
- .filter(dirent => dirent.isDirectory() && dirent.name != currentOrgLib)
2538
- .map(dirent => dirent.name);
2520
+ .filter((dirent) => dirent.isDirectory() && dirent.name != currentOrgLib)
2521
+ .map((dirent) => dirent.name);
2539
2522
  };
2540
2523
 
2541
2524
  export const getLibraryArchivesVersions = async (orgLibName, currentVersion) => {
@@ -2550,11 +2533,11 @@ export const getLibraryArchivesVersions = async (orgLibName, currentVersion) =>
2550
2533
 
2551
2534
  return fs
2552
2535
  .readdirSync(archiveDirectory, { withFileTypes: true })
2553
- .filter(dirent => dirent.isDirectory() && dirent.name != currentVersion)
2554
- .map(dirent => dirent.name);
2536
+ .filter((dirent) => dirent.isDirectory() && dirent.name != currentVersion)
2537
+ .map((dirent) => dirent.name);
2555
2538
  };
2556
2539
 
2557
- export const deleteLocalArchiveLibrary = async libraryName => {
2540
+ export const deleteLocalArchiveLibrary = async (libraryName) => {
2558
2541
  if (showDebug) addDebugLog('deleteLocalArchiveLibrary', `libraryName: ${libraryName}`, '');
2559
2542
  const currentDirectory = process.cwd();
2560
2543
  const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, libraryName);
@@ -2562,7 +2545,7 @@ export const deleteLocalArchiveLibrary = async libraryName => {
2562
2545
  try {
2563
2546
  fs.rmSync(archiveDirectory, { recursive: true });
2564
2547
  console.log(`${chalk.green.bold(libraryName)} is deleted from Local.`);
2565
- } catch (err) {
2548
+ } catch {
2566
2549
  console.log(`${chalk.green.red(`No such file ${libraryName}`)}`);
2567
2550
  // throw new Error(`No such file ${libraryName}`);
2568
2551
  }
@@ -2584,7 +2567,7 @@ export const deleteLocalArchiveLibraryVersion = async (libraryName, version) =>
2584
2567
  try {
2585
2568
  fs.rmSync(archiveDirectory, { recursive: true });
2586
2569
  console.log(`${chalk.green.bold(`${libraryName}/${version}`)} is deleted from Local.`);
2587
- } catch (err) {
2570
+ } catch {
2588
2571
  console.log(`${chalk.green.red(`No such file ${libraryName}/${version}`)}`);
2589
2572
  // throw new Error(`No such file ${libraryName}/${version}`);
2590
2573
  }
@@ -2600,7 +2583,7 @@ export const cleanUpTemp = async () => {
2600
2583
  }
2601
2584
  };
2602
2585
 
2603
- export const getJestFunctionalTestList = async whichTests => {
2586
+ export const getJestFunctionalTestList = async (whichTests) => {
2604
2587
  if (showDebug) addDebugLog('getJestFunctionalTestList', ``, '');
2605
2588
  const functionalDir = path.join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH);
2606
2589
  const libFilter = 'localLib';
@@ -2609,18 +2592,18 @@ export const getJestFunctionalTestList = async whichTests => {
2609
2592
  case 'ALL':
2610
2593
  return fs
2611
2594
  .readdirSync(functionalDir, { withFileTypes: true })
2612
- .filter(dirent => !dirent.isDirectory())
2613
- .map(dirent => dirent.name);
2595
+ .filter((dirent) => !dirent.isDirectory())
2596
+ .map((dirent) => dirent.name);
2614
2597
  case 'Original':
2615
2598
  return fs
2616
2599
  .readdirSync(functionalDir, { withFileTypes: true })
2617
- .filter(dirent => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
2618
- .map(dirent => dirent.name);
2600
+ .filter((dirent) => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
2601
+ .map((dirent) => dirent.name);
2619
2602
  case 'Library':
2620
2603
  return fs
2621
2604
  .readdirSync(functionalDir, { withFileTypes: true })
2622
- .filter(dirent => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
2623
- .map(dirent => dirent.name);
2605
+ .filter((dirent) => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
2606
+ .map((dirent) => dirent.name);
2624
2607
  }
2625
2608
  };
2626
2609
 
@@ -2650,7 +2633,7 @@ export const getMaxComponentNameCount = () => {
2650
2633
  return count;
2651
2634
  };
2652
2635
 
2653
- export const getMaxComponentLibraryCount = componentName => {
2636
+ export const getMaxComponentLibraryCount = (componentName) => {
2654
2637
  let count = MAX_RFT_CHARS;
2655
2638
  const configDef = getConfigDefaults();
2656
2639
  const orgLibCount = configDef.organization.length + componentName.length + 2; // 2 underscores
@@ -2672,7 +2655,7 @@ export const getStandaloneMaxComponentNameCount = () => {
2672
2655
  return count;
2673
2656
  };
2674
2657
 
2675
- export const getStandaloneMaxLibraryCount = async componentName => {
2658
+ export const getStandaloneMaxLibraryCount = async (componentName) => {
2676
2659
  let count = MAX_RFT_CHARS;
2677
2660
  const configDef = await getConfigDefaults();
2678
2661
  const orgComp = `${configDef.organization}__${componentName}`;
@@ -2693,11 +2676,11 @@ export const getStandaloneMaxPrefixCount = () => {
2693
2676
  return getStandaloneMaxComponentNameCount() - 16;
2694
2677
  };
2695
2678
 
2696
- export const getStandaloneMaxLibraryFromPrefixCount = async componentName => {
2679
+ export const getStandaloneMaxLibraryFromPrefixCount = async (componentName) => {
2697
2680
  return (await getStandaloneMaxLibraryCount(componentName)) - 16;
2698
2681
  };
2699
2682
 
2700
- export const isComponentValidLength = componentKey => {
2683
+ export const isComponentValidLength = (componentKey) => {
2701
2684
  const serverType = getServerType();
2702
2685
  if (serverType === 'launchpad') {
2703
2686
  return true;
@@ -2712,7 +2695,7 @@ export const isComponentValidLength = componentKey => {
2712
2695
  return false;
2713
2696
  };
2714
2697
 
2715
- export const emptyDirSync = dir => (fs.rmSync(dir, { recursive: true, force: true }), fs.mkdirSync(dir, { recursive: true }));
2698
+ export const emptyDirSync = (dir) => (fs.rmSync(dir, { recursive: true, force: true }), fs.mkdirSync(dir, { recursive: true }));
2716
2699
 
2717
2700
  // init
2718
2701
  await forceDefaultsUpdate();