@pega/custom-dx-components 0.23.3 → 0.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.json +7 -1
- package/babel.config.cjs +13 -0
- package/jest.config.cjs +18 -0
- package/package.json +18 -11
- package/src/auth.js +578 -555
- package/src/cli.js +11 -5
- package/src/constants.js +23 -25
- package/src/currentPath.cjs +1 -0
- package/src/tasks/authenticate/helper.js +82 -18
- package/src/tasks/authenticate/index.js +21 -7
- package/src/tasks/build/helper.js +17 -8
- package/src/tasks/build/index.js +29 -7
- package/src/tasks/build-all/helper.js +2 -1
- package/src/tasks/build-all/index.js +32 -25
- package/src/tasks/bundle/builder/index.js +5 -0
- package/src/tasks/bundle/builder/webpack.config.js +3 -2
- package/src/tasks/create/index.js +8 -5
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +10 -10
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +6 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/time-of-day.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +0 -1
- package/src/tasks/create-all/index.js +68 -47
- package/src/tasks/delete/helper.js +90 -40
- package/src/tasks/delete/index.js +5 -5
- package/src/tasks/delete-all/helper.js +108 -48
- package/src/tasks/delete-all/index.js +6 -6
- package/src/tasks/index.js +2 -1
- package/src/tasks/init/template/README.md +2 -204
- package/src/tasks/init/template/babel.config.cjs +13 -0
- package/src/tasks/init/template/jest.config.cjs +25 -0
- package/src/tasks/init/template/package.json.mustache +13 -5
- package/src/tasks/init/template/src/components/_components.md +1 -1
- package/src/tasks/init/template/tasks.config.json +11 -8
- package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/config.json +55 -0
- package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/demo.stories.jsx +51 -0
- package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/index.jsx +60 -0
- package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/mock.stories.js +13 -0
- package/src/tasks/init/template/test/assets/components/create/Pega_DXIL_MyTestText/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/Boolean.js +38 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/boolean-format.js +26 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/config.json +145 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/demo.stories.jsx +61 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/index.jsx +170 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/mock.stories.js +21 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/OneColumnPage.svg +36 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/config.json +23 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/demo.stories.jsx +78 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/index.jsx +73 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/mock.stories.js +390 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/config.json +291 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/demo.stories.jsx +53 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/index.jsx +296 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/mock.stories.js +23 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/DateFormatter.js +61 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/FormattedText.jsx +41 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/config.json +195 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/date.js +439 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/demo.stories.jsx +73 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/index.jsx +256 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/mock.stories.js +23 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/config.json +256 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-time.js +92 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date-utils.js +288 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/date.js +331 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/demo.stories.jsx +73 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/index.jsx +254 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/mock.stories.js +23 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/config.json +278 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/demo.stories.jsx +49 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/index.jsx +270 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/mock.stories.js +21 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/OneColumnDetails.svg +22 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/StatusWork.jsx +26 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/config.json +35 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/demo.stories.jsx +132 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/index.jsx +83 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/mock.stories.js +189 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/utils.js +152 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/config.json +111 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/demo.stories.jsx +48 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/index.jsx +231 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/mock.stories.js +22 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/DefaultForm.svg +29 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/config.json +45 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/demo.stories.jsx +166 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/index.jsx +42 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/mock.stories.js +137 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/config.json +344 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/demo.stories.jsx +49 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/index.jsx +333 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/mock.stories.js +21 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/GetNextWork.jsx +35 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/OneColumnPage.svg +36 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/config.json +32 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/demo.stories.jsx +102 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/index.jsx +70 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/localizations.json +4 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/mock.stories.js +94 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/utils.js +229 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Avatar.jsx +75 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/OneColumnPage.svg +36 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/Operator.jsx +237 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/config.json +66 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +68 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/index.jsx +108 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/mock.stories.js +51 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/OneColumnPage.svg +36 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/config.json +59 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/demo.stories.jsx +30 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/index.jsx +48 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/mock.stories.js +23 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/config.json +111 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/demo.stories.jsx +48 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/index.jsx +231 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/mock.stories.js +20 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/config.json +93 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/demo.stories.jsx +49 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/index.jsx +275 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/mock.stories.js +21 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/config.json +123 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/demo.stories.jsx +46 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/index.jsx +266 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/mock.stories.js +37 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/config.json +114 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/demo.stories.jsx +78 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/index.jsx +351 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/mock.stories.js +67 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/config.json +55 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/demo.stories.jsx +51 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/index.jsx +60 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/mock.stories.js +13 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/StatusWork.jsx +26 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/config.json +111 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/demo.stories.jsx +48 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/index.jsx +239 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/mock.stories.js +21 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/config.json +185 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/demo.stories.jsx +57 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/index.jsx +213 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/mock.stories.js +20 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/time-of-day.js +288 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/StatusWork.jsx +26 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/TwoColumnDetails.svg +28 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/config.json +42 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +136 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/index.jsx +83 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +230 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/utils.js +155 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/TwoColumn.svg +38 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/config.json +27 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +175 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/index.jsx +45 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/mock.stories.js +143 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/config.json +237 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/demo.stories.jsx +46 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/event-utils.js +18 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/index.jsx +232 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/mock.stories.js +22 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/styles.js +7 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/suggestions-handler.js +10 -0
- package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/text-url.jsx +173 -0
- package/src/tasks/init/template/test/functionTest/localCreateAllListDeleteAll.test.js +157 -0
- package/src/tasks/init/template/test/functionTest/localCreateBuildAllDeleteAll.test.js +148 -0
- package/src/tasks/init/template/test/functionTest/localCreateBuildDelete.test.js +84 -0
- package/src/tasks/init/template/test/functionTest/localCreateListDelete.test.js +108 -0
- package/src/tasks/init/template/test/functionTest/localCreatePublishAllDeleteAll.test.js +148 -0
- package/src/tasks/init/template/test/functionTest/localCreatePublishDelete.test.js +84 -0
- package/src/tasks/init/template/test/functionTest/localCreateRenameDelete.test.js +84 -0
- package/src/tasks/init/template/test/functionTest/localPromoteRevertWP.test.js +59 -0
- package/src/tasks/list/helper.js +115 -14
- package/src/tasks/promote-webpack/index.js +126 -0
- package/src/tasks/promote-webpack/webpack.config.js +376 -0
- package/src/tasks/publish/helper.js +116 -61
- package/src/tasks/publish/index.js +34 -8
- package/src/tasks/publish-all/helper.js +115 -63
- package/src/tasks/publish-all/index.js +51 -30
- package/src/tasks/rename/index.js +127 -97
- package/src/tasks/revert-webpack/index.js +71 -0
- package/src/util.js +159 -320
- package/test/unitTest/util.test.js +525 -0
- package/src/tasks/generate-ai/aiPrompt.txt.mustache +0 -23
- package/src/tasks/generate-ai/aiPromptDavinci.txt.mustache +0 -14
- package/src/tasks/generate-ai/helper.js +0 -390
- package/src/tasks/generate-ai/index.js +0 -34
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import {sep, join} from 'path';
|
|
3
|
-
import { URL, fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import inquirer from 'inquirer';
|
|
7
|
-
import _ from 'lodash';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
AI_PROMPT_FILENAME,
|
|
11
|
-
AI_DAVINCI_PROMPT_FILENAME
|
|
12
|
-
} from '../../constants.js';
|
|
13
|
-
import {
|
|
14
|
-
getComponents,
|
|
15
|
-
getComponentsOfType,
|
|
16
|
-
getDirectoryFiles,
|
|
17
|
-
getInfinityAIComponent,
|
|
18
|
-
getComponentDirectoryPath,
|
|
19
|
-
compileMustacheTemplate,
|
|
20
|
-
getComponentConfigJson,
|
|
21
|
-
getComponentConfigType
|
|
22
|
-
} from '../../util.js';
|
|
23
|
-
|
|
24
|
-
export const renameFile = (oldFileName, newFileName) => {
|
|
25
|
-
try {
|
|
26
|
-
fs.renameSync(oldFileName, newFileName);
|
|
27
|
-
|
|
28
|
-
} catch(err) {
|
|
29
|
-
console.log(err)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const generateAIComponent = async (componentKey, designSystemComponents, additionalPromptInfo) => {
|
|
34
|
-
|
|
35
|
-
const fileName = "." + sep + AI_PROMPT_FILENAME;
|
|
36
|
-
|
|
37
|
-
// get config file
|
|
38
|
-
//
|
|
39
|
-
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
40
|
-
const configFileData = await getComponentConfigJson(targetDirectory);
|
|
41
|
-
|
|
42
|
-
// let data = JSON.parse(configFileData);
|
|
43
|
-
// data.properties = [];
|
|
44
|
-
// configFileData = JSON.stringify(data);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let strPrompt = compileMustacheTemplate(fileURLToPath(new URL(fileName, import.meta.url)), {
|
|
48
|
-
COMPONENT_CONFIG: configFileData,
|
|
49
|
-
COMPONENT_DSC: designSystemComponents,
|
|
50
|
-
COMPONENT_ADDITIONAL: additionalPromptInfo
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
strPrompt = strPrompt.replaceAll("$", "//$");
|
|
54
|
-
|
|
55
|
-
strPrompt = _.unescape(strPrompt);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
let aiComponent = await getInfinityAIComponent(strPrompt);
|
|
59
|
-
|
|
60
|
-
if (aiComponent) {
|
|
61
|
-
const indexFile = join(targetDirectory, "index.jsx");
|
|
62
|
-
|
|
63
|
-
// remove enclosed ``` and "Answer:"
|
|
64
|
-
aiComponent = aiComponent.substring(aiComponent.indexOf("import"));
|
|
65
|
-
aiComponent = aiComponent.substring(0, aiComponent.lastIndexOf("```"));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// get directory list
|
|
70
|
-
// check for index-template.jsx.old
|
|
71
|
-
// if not there, copy index.jsx to index-template.jsx.old and then copy aiComponent to index.jsx
|
|
72
|
-
// if there, check if have index-genai-1.jsx.old, if not, then copy index.jsx, to index-genai-1.jsx.old
|
|
73
|
-
// otherwise, find all index-genai-X and find biggest number and add one, and save index.jsx to that and then create index.jsx
|
|
74
|
-
|
|
75
|
-
const dirList = await getDirectoryFiles(targetDirectory);
|
|
76
|
-
|
|
77
|
-
if (dirList.includes("index-template.jsx.old")) {
|
|
78
|
-
|
|
79
|
-
const genList = dirList.map( (el) => {
|
|
80
|
-
if (el.indexOf("index-genai") >= 0) {
|
|
81
|
-
return el;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
return "";
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (genList.length > 0) {
|
|
89
|
-
let lastIndex = 0;
|
|
90
|
-
|
|
91
|
-
genList.forEach((el) => {
|
|
92
|
-
const theName = el.split(".")[0];
|
|
93
|
-
const theIndex = theName.split("-")[2];
|
|
94
|
-
|
|
95
|
-
if (parseInt(theIndex) > lastIndex) {
|
|
96
|
-
lastIndex = parseInt(theIndex);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
lastIndex++;
|
|
101
|
-
|
|
102
|
-
const oldGenFileName = join(targetDirectory, "index.jsx");
|
|
103
|
-
const newGenFileName = join(targetDirectory, "index-genai-" + lastIndex + ".jsx.old");
|
|
104
|
-
|
|
105
|
-
renameFile(oldGenFileName, newGenFileName);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
const oldGenFileName = join(targetDirectory, "index.jsx");
|
|
109
|
-
const newGenFileName = join(targetDirectory, "index-genai-1.jsx.old");
|
|
110
|
-
|
|
111
|
-
renameFile(oldGenFileName, newGenFileName);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
// so only index.jsx, so rename index.jsx to index-template.jsx.old
|
|
116
|
-
// and create a new index.jsx
|
|
117
|
-
const oldFileName = join(targetDirectory, "index.jsx");
|
|
118
|
-
const newFileName = join(targetDirectory, "index-template.jsx.old");
|
|
119
|
-
|
|
120
|
-
renameFile(oldFileName, newFileName);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// creae new index.jsx
|
|
124
|
-
fs.writeFileSync(indexFile, aiComponent, err => {
|
|
125
|
-
if (err) {
|
|
126
|
-
Promise.reject(`${chalk.bold.red(err)}`);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
console.log(`Updated file ${chalk.green('index.jsx')} in directory ${chalk.green(componentKey)} with AI generated code.`);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
export const generateInfinityAIComponent = async (componentKey, additionalPromptInfo) => {
|
|
141
|
-
|
|
142
|
-
const fileName = "." + sep + AI_DAVINCI_PROMPT_FILENAME;
|
|
143
|
-
|
|
144
|
-
// get config file
|
|
145
|
-
//
|
|
146
|
-
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
147
|
-
let configFileData = await getComponentConfigJson(targetDirectory);
|
|
148
|
-
|
|
149
|
-
// need to escape $
|
|
150
|
-
configFileData = configFileData.replaceAll("$", "\\$");
|
|
151
|
-
|
|
152
|
-
let strPrompt = compileMustacheTemplate(fileURLToPath(new URL(fileName, import.meta.url)), {
|
|
153
|
-
COMPONENT_CONFIG: configFileData,
|
|
154
|
-
COMPONENT_ADDITIONAL: additionalPromptInfo
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
strPrompt = _.unescape(strPrompt);
|
|
158
|
-
|
|
159
|
-
//let strPrompt = await getAIPromptData(fileURLToPath(new URL(fileName, import.meta.url)));
|
|
160
|
-
let aiComponent = await getInfinityAIComponent(strPrompt);
|
|
161
|
-
|
|
162
|
-
//console.log(aiData);
|
|
163
|
-
|
|
164
|
-
if (aiComponent) {
|
|
165
|
-
const indexFile = join(targetDirectory, "index-genai.jsx.tmp");
|
|
166
|
-
|
|
167
|
-
// remove enclosed ``` and "Answer:"
|
|
168
|
-
if (aiComponent.indexOf("```") >= 0) {
|
|
169
|
-
aiComponent = aiComponent.substring(aiComponent.indexOf("```"));
|
|
170
|
-
aiComponent = aiComponent.substring(0, aiComponent.lastIndexOf("```"));
|
|
171
|
-
}
|
|
172
|
-
else if (aiComponent.indexOf("'") == 0) {
|
|
173
|
-
aiComponent = aiComponent.substring(aiComponent.indexOf("'"));
|
|
174
|
-
aiComponent = aiComponent.substring(0, aiComponent.lastIndexOf("'"));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
// get directory list
|
|
181
|
-
// check for index-template.jsx.old
|
|
182
|
-
// if not there, copy index.jsx to index-template.jsx.old and then copy aiComponent to index.jsx
|
|
183
|
-
// if there, check if have index-genai-1.jsx.old, if not, then copy index.jsx, to index-genai-1.jsx.old
|
|
184
|
-
// otherwise, find all index-genai-X and find biggest number and add one, and save index.jsx to that and then create index.jsx
|
|
185
|
-
|
|
186
|
-
const dirList = await getDirectoryFiles(targetDirectory);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const genList = dirList.map( (el) => {
|
|
191
|
-
if (el.indexOf("index-genai") >= 0) {
|
|
192
|
-
return el;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
return "";
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
if (genList.length > 0) {
|
|
200
|
-
let lastIndex = -1;
|
|
201
|
-
|
|
202
|
-
genList.forEach((el) => {
|
|
203
|
-
const theName = el.split(".")[0];
|
|
204
|
-
|
|
205
|
-
if (theName.indexOf("index-genai") >=0) {
|
|
206
|
-
if (lastIndex === -1) {
|
|
207
|
-
lastIndex = 0;
|
|
208
|
-
}
|
|
209
|
-
const theIndex = theName.split("-")[2];
|
|
210
|
-
|
|
211
|
-
if (parseInt(theIndex) > lastIndex) {
|
|
212
|
-
lastIndex = parseInt(theIndex);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
lastIndex++;
|
|
219
|
-
|
|
220
|
-
if (lastIndex > 0) {
|
|
221
|
-
const oldGenFileName = join(targetDirectory, "index-genai.jsx.tmp");
|
|
222
|
-
const newGenFileName = join(targetDirectory, "index-genai-" + lastIndex + ".jsx.tmp");
|
|
223
|
-
|
|
224
|
-
renameFile(oldGenFileName, newGenFileName);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
// creae new index.jsx
|
|
231
|
-
fs.writeFileSync(indexFile, aiComponent, err => {
|
|
232
|
-
if (err) {
|
|
233
|
-
Promise.reject(`${chalk.bold.red(err)}`);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
console.log(`Updated file ${chalk.green('index-genai.jsx.tmp')} in directory ${chalk.green(componentKey)} with AI generated code.`);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export const getWidgetTemplateAndGenerateAI = async (enteredKey) => {
|
|
245
|
-
const localComponents = await getComponents();
|
|
246
|
-
|
|
247
|
-
let answers;
|
|
248
|
-
|
|
249
|
-
if (localComponents.length > 0) {
|
|
250
|
-
|
|
251
|
-
answers = await inquirer.prompt([
|
|
252
|
-
{
|
|
253
|
-
name: "fileOrText",
|
|
254
|
-
type: "rawlist",
|
|
255
|
-
choices: [ {name: "Prompt via a file", value:"File"}, {name: "Prompt entered text", value:"Text"}],
|
|
256
|
-
message: 'Enter how you want to propmt for component instructions '
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
name: 'fileName',
|
|
260
|
-
message: 'Enter file name? ',
|
|
261
|
-
default: 'prompt.txt',
|
|
262
|
-
when(answers) {
|
|
263
|
-
return answers.fileOrText === 'File';
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: 'additionalPromptInfo',
|
|
268
|
-
message: 'Enter what you would like this component to do? ',
|
|
269
|
-
when(answers) {
|
|
270
|
-
return answers.fileOrText === 'Text';
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
]);
|
|
275
|
-
|
|
276
|
-
console.log("Generating component...");
|
|
277
|
-
|
|
278
|
-
if (answers.fileOrText === "Text") {
|
|
279
|
-
await generateInfinityAIComponent(enteredKey, answers.additionalPromptInfo);
|
|
280
|
-
}
|
|
281
|
-
else if (answers.fileOrText == "File") {
|
|
282
|
-
const strPrompt = await getFilePromptData(enteredKey, answers.fileName);
|
|
283
|
-
|
|
284
|
-
await generateInfinityAIComponent(enteredKey, strPrompt);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
} else {
|
|
290
|
-
console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents}`));
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
export const getFilePromptData = async (componentKey, fileName) => {
|
|
295
|
-
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
296
|
-
|
|
297
|
-
const fullFileName = join(targetDirectory, fileName);
|
|
298
|
-
|
|
299
|
-
if (fs.existsSync(fullFileName)) {
|
|
300
|
-
const promptData = fs.readFileSync(fullFileName, { encoding: 'utf8' });
|
|
301
|
-
return promptData;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
console.log(chalk.bold.redBright(`File ${fileName} does not exist.`));
|
|
305
|
-
process.exit(1);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export const getFieldAndGenerateAI = async (enteredKey) => {
|
|
312
|
-
const localComponents = await getComponents();
|
|
313
|
-
|
|
314
|
-
let answers;
|
|
315
|
-
|
|
316
|
-
if (localComponents.length > 0) {
|
|
317
|
-
|
|
318
|
-
answers = await inquirer.prompt([
|
|
319
|
-
{
|
|
320
|
-
name: 'designSystemComponents',
|
|
321
|
-
message: 'Enter comma delimited string of Design system components (ie. Input, TextArea, etc.)'
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
name: 'additionalPromptInfo',
|
|
325
|
-
message: 'Enter any additional generation information',
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
]);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
console.log("Generating component...");
|
|
332
|
-
|
|
333
|
-
await generateAIComponent(enteredKey || answers.componentKey, answers.designSystemComponents, answers.additionalPropmtInfo);
|
|
334
|
-
|
|
335
|
-
} else {
|
|
336
|
-
console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents}`));
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
export const getSelectAComponent = async() => {
|
|
343
|
-
const localComponents = await getComponentsOfType("Widget,Template");
|
|
344
|
-
|
|
345
|
-
let answers;
|
|
346
|
-
|
|
347
|
-
if (localComponents.length > 0) {
|
|
348
|
-
answers = await inquirer.prompt([
|
|
349
|
-
{
|
|
350
|
-
name: 'componentKey',
|
|
351
|
-
type: 'rawlist',
|
|
352
|
-
message: 'Select component to generateAI',
|
|
353
|
-
choices: localComponents
|
|
354
|
-
}]);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return answers;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export const determineAndGenerateAI = async (enteredKey) => {
|
|
361
|
-
|
|
362
|
-
if (!enteredKey) {
|
|
363
|
-
const answer = await getSelectAComponent();
|
|
364
|
-
if (answer) {
|
|
365
|
-
enteredKey = answer.componentKey;
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
console.log(chalk.bold.redBright(`No custom components to generate AI. Please create a Widget or Template component first.`));
|
|
369
|
-
process.exit(1);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const targetDirectory = await getComponentDirectoryPath(enteredKey);
|
|
375
|
-
const configType = await getComponentConfigType(targetDirectory);
|
|
376
|
-
|
|
377
|
-
switch (configType.toLowerCase()) {
|
|
378
|
-
case "widget":
|
|
379
|
-
case "template":
|
|
380
|
-
await getWidgetTemplateAndGenerateAI(enteredKey);
|
|
381
|
-
break;
|
|
382
|
-
case "field":
|
|
383
|
-
await getFieldAndGenerateAI(enteredKey);
|
|
384
|
-
break;
|
|
385
|
-
default:
|
|
386
|
-
break;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
determineAndGenerateAI
|
|
7
|
-
} from './helper.js';
|
|
8
|
-
|
|
9
|
-
import { showVersion } from '../../util.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default async options => {
|
|
15
|
-
showVersion();
|
|
16
|
-
|
|
17
|
-
if (options.params.length > 3 && options.params[3] != "") {
|
|
18
|
-
const sourceOfComponents = options.params[3];
|
|
19
|
-
|
|
20
|
-
//await generateAIComponent(sourceOfComponents);
|
|
21
|
-
//await getComponentAndGenerateAI(sourceOfComponents);
|
|
22
|
-
await determineAndGenerateAI(sourceOfComponents);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
|
|
26
|
-
//await getComponentAndGenerateAI();
|
|
27
|
-
await determineAndGenerateAI();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|