@pega/dx-component-builder-sdk 0.1.47 → 0.1.49
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/package.json +3 -2
- package/src/auth.js +726 -508
- package/src/cli.js +1 -1
- package/src/constants.js +728 -2
- package/src/tasks/authenticate/index.js +12 -2
- package/src/tasks/build/helper.js +10 -6
- package/src/tasks/build/index.js +76 -22
- package/src/tasks/build-all/helper.js +16 -11
- package/src/tasks/build-all/index.js +106 -42
- package/src/tasks/bundle/{builder → builderAngular}/paths.js +3 -2
- package/src/tasks/bundle/builderAngular/webpack.config.js +342 -0
- package/src/tasks/bundle/builderAssociated/index.js +218 -0
- package/src/tasks/bundle/builderAssociated/modules.js +139 -0
- package/src/tasks/bundle/builderAssociated/paths.js +51 -0
- package/src/tasks/bundle/{builder → builderAssociated}/webpack.config.js +5 -4
- package/src/tasks/bundle/builderReact/index.js +218 -0
- package/src/tasks/bundle/builderReact/modules.js +139 -0
- package/src/tasks/bundle/builderReact/paths.js +51 -0
- package/src/tasks/bundle/builderReact/webpack.config.js +337 -0
- package/src/tasks/bundle/index.js +122 -5
- package/src/tasks/create/index.js +54 -12
- package/src/tasks/create/templates/Constellation/field/Boolean/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache +7 -7
- package/src/tasks/create/templates/Constellation/field/Date/date.js.mustache +8 -8
- package/src/tasks/create/templates/Constellation/field/Date/styles.js.mustache +13 -6
- 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/DateTime/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +4 -4
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Integer/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Picklist/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Email/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Input/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-URL/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/time-of-day.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.jsx.mustache +20 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS/mock.stories.js.mustache +20 -10
- package/src/tasks/create/templates/Constellation/template/DETAILS/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.jsx.mustache +20 -7
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.stories.js.mustache +28 -13
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.jsx.mustache +92 -16
- package/src/tasks/create/templates/Constellation/template/FORM/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.jsx.mustache +91 -13
- package/src/tasks/create/templates/Constellation/template/FORM-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM-region/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/template/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +42 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.scss.mustache +24 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +165 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/config.json.mustache +87 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.jsx.mustache +56 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/mock.stories.js.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/config.json.mustache +147 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +35 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +209 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/config.json.mustache +204 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +170 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/config.json.mustache +125 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +176 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/config.json.mustache +88 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +180 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/config.json.mustache +86 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.scss.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +195 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.scss.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +145 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +179 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/config.json.mustache +95 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.scss.mustache +81 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +194 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/config.json.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.spec.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +174 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +172 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/config.json.mustache +21 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.jsx.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.html.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +121 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/mock.stories.js.mustache +294 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.html.mustache +6 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +92 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/mock.stories.js.mustache +290 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.jsx.mustache +215 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.html.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/config.json.mustache +49 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.jsx.mustache +183 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.html.mustache +16 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.stories.js.mustache +132 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/OneColumnPage.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.jsx.mustache +80 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/mock.stories.js.mustache +115 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.scss.mustache +3 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +63 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.scss.mustache +22 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.jsx.mustache +70 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.jsx.mustache +29 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.scss.mustache +19 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/pagecomponent.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.jsx.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/mock.stories.js.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.html.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.scss.mustache +137 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +115 -0
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -7
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +78 -28
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.jsx.mustache +13 -0
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +30 -10
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +6 -5
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +11 -0
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/config.json.mustache +135 -0
- package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/index.tsx.mustache +12 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -3
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +30 -20
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +7 -7
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +2 -10
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +138 -36
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.stories.js.mustache +1 -1
- package/src/tasks/create-all/index.js +112 -56
- package/src/tasks/delete/helper.js +88 -24
- package/src/tasks/delete/index.js +17 -8
- package/src/tasks/delete-all/helper.js +88 -25
- package/src/tasks/delete-all/index.js +15 -6
- package/src/tasks/list/helper.js +2 -3
- package/src/tasks/list/index.js +14 -7
- package/src/tasks/map/map.js +212 -20
- package/src/tasks/map-all/index.js +19 -2
- package/src/tasks/override/index.js +140 -79
- package/src/tasks/override-all/index.js +54 -6
- package/src/tasks/publish/helper.js +94 -51
- package/src/tasks/publish/index.js +87 -34
- package/src/tasks/publish-all/helper.js +97 -58
- package/src/tasks/publish-all/index.js +127 -48
- package/src/tasks/rename/index.js +184 -111
- package/src/tasks/validator/index.js +31 -7
- package/src/util.js +187 -39
- package/src/tasks/create/templates/Constellation/field/TimeofDay/styles.js.mustache +0 -7
- /package/src/tasks/bundle/{builder → builderAngular}/index.js +0 -0
- /package/src/tasks/bundle/{builder → builderAngular}/modules.js +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/suggestions-handler.js +0 -0
- /package/src/tasks/create/templates/{SDK-React/field/TimeofDay → SDK-Angular/field/TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache +0 -0
package/src/tasks/list/helper.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import https from 'https';
|
|
3
2
|
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fetch from 'node-fetch';
|
|
6
5
|
|
|
7
6
|
import { LIST_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH, COMPONENT_SCHEMA, CATEGORY_CUSTOM } from '../../constants.js';
|
|
8
|
-
import { constructCompleteUrl, getComponents, getPegaServerConfig } from '../../util.js';
|
|
7
|
+
import { constructCompleteUrl, getComponents, getPegaServerConfig, getHttpsAgent } from '../../util.js';
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
@@ -75,7 +74,7 @@ export const getComponentsFromServer = async data => {
|
|
|
75
74
|
let status = 500;
|
|
76
75
|
fetch(url, {
|
|
77
76
|
method: 'GET',
|
|
78
|
-
agent:
|
|
77
|
+
agent: getHttpsAgent(defaultPegaServerConfig),
|
|
79
78
|
headers: {
|
|
80
79
|
Authorization: `${tokenType} ${accessToken}`
|
|
81
80
|
}
|
package/src/tasks/list/index.js
CHANGED
|
@@ -12,10 +12,17 @@ import {
|
|
|
12
12
|
import { showVersion, getOptionsCategory } from '../../util.js';
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
const getList = async (sourceOfComponents, answers) => {
|
|
15
|
+
const getList = async (sourceOfComponents, answers, options) => {
|
|
16
16
|
switch (sourceOfComponents) {
|
|
17
17
|
case SOURCE_OF_COMPONENT_TYPES.LOCAL: {
|
|
18
|
-
|
|
18
|
+
let category;
|
|
19
|
+
if (answers) {
|
|
20
|
+
category = answers.category;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
category = options.params[4];
|
|
24
|
+
}
|
|
25
|
+
await listLocalComponents(sourceOfComponents, category);
|
|
19
26
|
break;
|
|
20
27
|
}
|
|
21
28
|
case SOURCE_OF_COMPONENT_TYPES.SERVER: {
|
|
@@ -39,14 +46,14 @@ export default async options => {
|
|
|
39
46
|
|
|
40
47
|
let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
|
|
41
48
|
|
|
42
|
-
if (options.params[
|
|
49
|
+
if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
|
|
43
50
|
sourceOfComponentsOption = options.params[3];
|
|
44
|
-
await getList(sourceOfComponentsOption);
|
|
45
|
-
} else if (options.params[
|
|
51
|
+
await getList(sourceOfComponentsOption, null, options);
|
|
52
|
+
} else if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.SERVER) {
|
|
46
53
|
sourceOfComponentsOption = options.params[3];
|
|
47
54
|
const questions = await getListComponentsQuestions(options, sourceOfComponentsOption);
|
|
48
55
|
const answers = await inquirer.prompt(questions);
|
|
49
|
-
await getList(sourceOfComponentsOption, answers);
|
|
56
|
+
await getList(sourceOfComponentsOption, answers), options;
|
|
50
57
|
} else {
|
|
51
58
|
const questions = await getListComponentsQuestions(options);
|
|
52
59
|
let answers = await inquirer.prompt(questions);
|
|
@@ -58,6 +65,6 @@ export default async options => {
|
|
|
58
65
|
if (categoryType != null) {
|
|
59
66
|
answers.category = categoryType;
|
|
60
67
|
}
|
|
61
|
-
await getList(sourceOfComponents, answers);
|
|
68
|
+
await getList(sourceOfComponents, answers, options);
|
|
62
69
|
}
|
|
63
70
|
};
|
package/src/tasks/map/map.js
CHANGED
|
@@ -5,27 +5,36 @@ import { join } from 'path';
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
convertIntoPascalCase,
|
|
8
|
+
convertIntoKebabCase,
|
|
9
|
+
reverseKebabCase,
|
|
8
10
|
removeComponentPrefix,
|
|
11
|
+
getLocalComponentKeyFromConfig,
|
|
9
12
|
getFramework
|
|
10
13
|
} from '../../util.js';
|
|
11
14
|
|
|
12
15
|
import {
|
|
13
|
-
|
|
16
|
+
REACT_COMPONENTS_DIRECTORY_PATH,
|
|
17
|
+
ANGULAR_COMPONENTS_DIRECTORY_PATH,
|
|
18
|
+
ANGULAR_COMPONENTS_APP_DIRECTORY_PATH,
|
|
14
19
|
SDK_CONFIG_JSON_FILENAME,
|
|
15
20
|
CATEGORY_CUSTOM,
|
|
16
21
|
CATEGORY_CONSTELLATION,
|
|
17
22
|
COMPONENT_DIRECTORY_PREFIX_CUSTOM,
|
|
18
23
|
COMPONENT_DIRECTORY_SUFFIX_SDK,
|
|
19
|
-
COMPONENT_REACT_LIB_PATH
|
|
24
|
+
COMPONENT_REACT_LIB_PATH,
|
|
25
|
+
COMPONENT_ANGULAR_LIB_PATH
|
|
20
26
|
} from '../../constants.js';
|
|
27
|
+
import { or } from 'ajv/dist/compile/codegen/index.js';
|
|
21
28
|
|
|
22
|
-
export const
|
|
29
|
+
export const SDK_LOCAL_REACT_COMPONENT_MAP_FILENAME = "sdk-local-component-map.js";
|
|
30
|
+
export const SDK_LOCAL_ANGULAR_COMPONENT_MAP_FILENAME = "sdk-local-component-map.ts";
|
|
23
31
|
export const IMPORT_END_TAG = "/*import end";
|
|
24
32
|
export const MAP_END_TAG = "/*map end";
|
|
25
33
|
|
|
26
34
|
export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
|
|
27
35
|
const pegaConfigInternalJsonPath = path.join(path.resolve(), DXCB_CONFIG_INTERNAL_JSON_FILENAME);
|
|
28
|
-
const
|
|
36
|
+
const pegaLocalReactComponentMapPath = path.join(path.resolve(), SDK_LOCAL_REACT_COMPONENT_MAP_FILENAME);
|
|
37
|
+
const pegaLocalAngularComponentMapPath = path.join(path.resolve(), SDK_LOCAL_ANGULAR_COMPONENT_MAP_FILENAME);
|
|
29
38
|
|
|
30
39
|
export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
31
40
|
|
|
@@ -39,9 +48,9 @@ export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTO
|
|
|
39
48
|
const componentNameNoPrefix = removeComponentPrefix(componentKey);
|
|
40
49
|
const componentName = convertIntoPascalCase(componentNameNoPrefix);
|
|
41
50
|
|
|
42
|
-
let mapData = fs.readFileSync(
|
|
51
|
+
let mapData = fs.readFileSync(pegaLocalReactComponentMapPath, { encoding: 'utf8' });
|
|
43
52
|
|
|
44
|
-
let importComponent = join(
|
|
53
|
+
let importComponent = join(REACT_COMPONENTS_DIRECTORY_PATH, categoryDirectory, componentKey);
|
|
45
54
|
importComponent = "./".concat(importComponent);
|
|
46
55
|
|
|
47
56
|
let importFull = "import ".concat(componentName).concat(" from '").concat(importComponent).concat("/';");
|
|
@@ -64,14 +73,55 @@ export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTO
|
|
|
64
73
|
|
|
65
74
|
mapData = mapDataStart.concat(" ").concat(mapFull).concat("\n").concat(mapDataEnd);
|
|
66
75
|
|
|
67
|
-
fs.writeFileSync(
|
|
76
|
+
fs.writeFileSync(pegaLocalReactComponentMapPath, mapData, { encoding: 'utf8' });
|
|
68
77
|
|
|
69
78
|
|
|
70
79
|
}
|
|
71
80
|
break;
|
|
72
81
|
case 'SDK-Angular' :
|
|
82
|
+
const categoryDirectoryAng = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase() + COMPONENT_DIRECTORY_SUFFIX_SDK);
|
|
83
|
+
|
|
84
|
+
const componentNameNoPrefixAng = removeComponentPrefix(componentKey);
|
|
85
|
+
const originalComponenttNameConfigAng = await getLocalComponentKeyFromConfig(componentKey, category);
|
|
86
|
+
const originalComponentName = originalComponenttNameConfigAng != "" ? originalComponenttNameConfigAng : reverseKebabCase(componentNameNoPrefixAng);
|
|
87
|
+
|
|
88
|
+
const componentComponentNameAng = convertIntoPascalCase(originalComponentName).concat("Component");
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
let mapDataAng = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
94
|
+
|
|
95
|
+
// componentKey twice for directory and file
|
|
96
|
+
let importComponentAng = join(ANGULAR_COMPONENTS_DIRECTORY_PATH, categoryDirectoryAng, componentKey, componentNameNoPrefixAng);
|
|
97
|
+
importComponentAng = "./".concat(importComponentAng);
|
|
98
|
+
|
|
99
|
+
let importFullAng = "import { ".concat(componentComponentNameAng).concat(" } from '").concat(importComponentAng).concat(".component';");
|
|
100
|
+
let mapFullAng = "\"".concat(originalComponentName).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
101
|
+
|
|
102
|
+
if (mapDataAng.indexOf(importComponentAng.concat(".component")) < 0) {
|
|
103
|
+
// not present so we can add
|
|
104
|
+
|
|
105
|
+
// add import
|
|
106
|
+
let endImportIndex = mapDataAng.indexOf(IMPORT_END_TAG);
|
|
107
|
+
let mapDataStart = mapDataAng.substring(0, endImportIndex);
|
|
108
|
+
let mapDataEnd = mapDataAng.substring(endImportIndex);
|
|
109
|
+
|
|
110
|
+
mapDataAng = mapDataStart.concat(importFullAng).concat("\n").concat(mapDataEnd);
|
|
111
|
+
|
|
112
|
+
// add map
|
|
113
|
+
let endMapIndex = mapDataAng.indexOf(MAP_END_TAG);
|
|
114
|
+
mapDataStart = mapDataAng.substring(0, endMapIndex);
|
|
115
|
+
mapDataEnd = mapDataAng.substring(endMapIndex);
|
|
116
|
+
|
|
117
|
+
mapDataAng = mapDataStart.concat(" ").concat(mapFullAng).concat("\n").concat(mapDataEnd);
|
|
118
|
+
|
|
119
|
+
fs.writeFileSync(pegaLocalAngularComponentMapPath, mapDataAng, { encoding: 'utf8' });
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
}
|
|
73
123
|
break;
|
|
74
|
-
case 'WebComponents' :
|
|
124
|
+
case 'SDK-WebComponents' :
|
|
75
125
|
break;
|
|
76
126
|
|
|
77
127
|
}
|
|
@@ -85,6 +135,7 @@ export const deleteFromComponentMap = async (componentKey, category = CATEGORY_C
|
|
|
85
135
|
|
|
86
136
|
const framework = await getFramework();
|
|
87
137
|
|
|
138
|
+
|
|
88
139
|
switch (framework) {
|
|
89
140
|
case 'SDK-React' :
|
|
90
141
|
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase() + COMPONENT_DIRECTORY_SUFFIX_SDK);
|
|
@@ -92,9 +143,9 @@ export const deleteFromComponentMap = async (componentKey, category = CATEGORY_C
|
|
|
92
143
|
const componentNameNoPrefix = removeComponentPrefix(componentKey);
|
|
93
144
|
const componentName = convertIntoPascalCase(componentNameNoPrefix);
|
|
94
145
|
|
|
95
|
-
let mapData = fs.readFileSync(
|
|
146
|
+
let mapData = fs.readFileSync(pegaLocalReactComponentMapPath, { encoding: 'utf8' });
|
|
96
147
|
|
|
97
|
-
let importComponent = join(
|
|
148
|
+
let importComponent = join(REACT_COMPONENTS_DIRECTORY_PATH, categoryDirectory, componentKey);
|
|
98
149
|
importComponent = "./".concat(importComponent);
|
|
99
150
|
|
|
100
151
|
let importFull = "import ".concat(componentName).concat(" from '").concat(importComponent).concat("/';");
|
|
@@ -109,13 +160,44 @@ export const deleteFromComponentMap = async (componentKey, category = CATEGORY_C
|
|
|
109
160
|
mapData = mapData.replace(removeImport, "");
|
|
110
161
|
mapData = mapData.replace(removeMap, "");
|
|
111
162
|
|
|
112
|
-
fs.writeFileSync(
|
|
163
|
+
fs.writeFileSync(pegaLocalReactComponentMapPath, mapData, { encoding: 'utf8' });
|
|
113
164
|
|
|
114
165
|
}
|
|
115
166
|
break;
|
|
116
167
|
case 'SDK-Angular' :
|
|
168
|
+
const categoryDirectoryAng = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase() + COMPONENT_DIRECTORY_SUFFIX_SDK);
|
|
169
|
+
|
|
170
|
+
const componentNameNoPrefixAng = removeComponentPrefix(componentKey);
|
|
171
|
+
const originalComponenttNameConfigAng = await getLocalComponentKeyFromConfig(componentKey, category);
|
|
172
|
+
const originalComponentName = originalComponenttNameConfigAng != "" ? originalComponenttNameConfigAng : reverseKebabCase(componentNameNoPrefixAng);
|
|
173
|
+
|
|
174
|
+
const componentComponentNameAng = convertIntoPascalCase(originalComponentName).concat("Component");
|
|
175
|
+
|
|
176
|
+
let mapDataAng = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
177
|
+
|
|
178
|
+
// componentKey twice for directory and file
|
|
179
|
+
let importComponentAng = join(ANGULAR_COMPONENTS_DIRECTORY_PATH, categoryDirectoryAng, componentKey, componentNameNoPrefixAng);
|
|
180
|
+
importComponentAng = "./".concat(importComponentAng);
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
let importFullAng = "import { ".concat(componentComponentNameAng).concat(" } from '").concat(importComponentAng).concat(".component';");
|
|
184
|
+
let mapFullAng = "\"".concat(originalComponentName).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
if (mapDataAng.indexOf(importFullAng) >= 0) {
|
|
188
|
+
|
|
189
|
+
let removeImport = importFullAng.concat("\n");
|
|
190
|
+
let removeMap = " ".concat(mapFullAng).concat("\n");
|
|
191
|
+
|
|
192
|
+
mapDataAng = mapDataAng.replace(removeImport, "");
|
|
193
|
+
mapDataAng = mapDataAng.replace(removeMap, "");
|
|
194
|
+
|
|
195
|
+
fs.writeFileSync(pegaLocalAngularComponentMapPath, mapDataAng, { encoding: 'utf8' });
|
|
196
|
+
|
|
197
|
+
}
|
|
117
198
|
break;
|
|
118
|
-
|
|
199
|
+
break;
|
|
200
|
+
case 'SDK-WebComponents' :
|
|
119
201
|
break;
|
|
120
202
|
|
|
121
203
|
}
|
|
@@ -138,23 +220,45 @@ export const renameComponentInMap = async (oldComponentKey, newComponentKey) =>
|
|
|
138
220
|
const newComponentNameNoPrefix = removeComponentPrefix(newComponentKey);
|
|
139
221
|
const newComponentName = convertIntoPascalCase(newComponentNameNoPrefix);
|
|
140
222
|
|
|
141
|
-
let mapData = fs.readFileSync(
|
|
223
|
+
let mapData = fs.readFileSync(pegaLocalReactComponentMapPath, { encoding: 'utf8' });
|
|
142
224
|
|
|
143
225
|
if (mapData.indexOf(oldComponentName) >= 0) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
226
|
+
|
|
147
227
|
mapData = mapData.replaceAll(oldComponentName + " ", newComponentName + " ");
|
|
148
228
|
mapData = mapData.replaceAll(oldComponentName + ",", newComponentName + ",");
|
|
149
229
|
|
|
150
230
|
mapData = mapData.replaceAll(oldComponentNameNoPrefix + "/", newComponentNameNoPrefix + "/");
|
|
151
231
|
mapData = mapData.replaceAll( '"' + oldComponentNameNoPrefix + '"' , '"' + newComponentNameNoPrefix + '"');
|
|
152
232
|
|
|
153
|
-
fs.writeFileSync(
|
|
233
|
+
fs.writeFileSync(pegaLocalReactComponentMapPath, mapData, { encoding: 'utf8' });
|
|
154
234
|
|
|
155
235
|
}
|
|
156
236
|
break;
|
|
157
237
|
case 'SDK-Angular' :
|
|
238
|
+
const oldComponentNameNoPrefixAng = removeComponentPrefix(oldComponentKey);
|
|
239
|
+
const oldComponentNameAng = convertIntoPascalCase(oldComponentNameNoPrefixAng);
|
|
240
|
+
const oldComponentKebabNameAng = convertIntoKebabCase(oldComponentNameAng);
|
|
241
|
+
|
|
242
|
+
const newComponentNameNoPrefixAng = removeComponentPrefix(newComponentKey);
|
|
243
|
+
const newComponentNameAng = convertIntoPascalCase(newComponentNameNoPrefixAng);
|
|
244
|
+
const newComponentKebabNameAng = convertIntoKebabCase(newComponentNameAng);
|
|
245
|
+
|
|
246
|
+
let mapDataAng = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
247
|
+
|
|
248
|
+
if (mapDataAng.indexOf(oldComponentNameAng) >= 0) {
|
|
249
|
+
|
|
250
|
+
mapDataAng = mapDataAng.replaceAll(oldComponentNameAng + " ", newComponentNameAng + " ");
|
|
251
|
+
mapDataAng = mapDataAng.replaceAll(oldComponentNameAng + ",", newComponentNameAng + ",");
|
|
252
|
+
|
|
253
|
+
mapDataAng = mapDataAng.replaceAll(oldComponentKebabNameAng + "/", newComponentKebabNameAng + "/");
|
|
254
|
+
mapDataAng = mapDataAng.replaceAll(oldComponentKebabNameAng + ".component", newComponentKebabNameAng + ".component");
|
|
255
|
+
|
|
256
|
+
mapDataAng = mapDataAng.replaceAll( '"' + oldComponentNameNoPrefixAng + '"' , '"' + newComponentNameNoPrefixAng + '"');
|
|
257
|
+
mapDataAng = mapDataAng.replaceAll( oldComponentNameAng + 'Component' , newComponentNameAng + 'Component');
|
|
258
|
+
|
|
259
|
+
fs.writeFileSync(pegaLocalAngularComponentMapPath, mapDataAng, { encoding: 'utf8' });
|
|
260
|
+
|
|
261
|
+
}
|
|
158
262
|
break;
|
|
159
263
|
case 'WebComponents' :
|
|
160
264
|
break;
|
|
@@ -169,19 +273,28 @@ export const renameComponentInMap = async (oldComponentKey, newComponentKey) =>
|
|
|
169
273
|
export const clearComponentMap = async () => {
|
|
170
274
|
|
|
171
275
|
const framework = await getFramework();
|
|
276
|
+
let blankMap;
|
|
277
|
+
let blankMapData;
|
|
172
278
|
|
|
173
279
|
switch (framework) {
|
|
174
280
|
case 'SDK-React' :
|
|
175
281
|
// get blank version
|
|
176
|
-
|
|
282
|
+
blankMap = path.join(path.resolve(), COMPONENT_REACT_LIB_PATH, SDK_LOCAL_REACT_COMPONENT_MAP_FILENAME);
|
|
177
283
|
|
|
178
|
-
|
|
284
|
+
blankMapData = fs.readFileSync(blankMap, { encoding: 'utf8' });
|
|
179
285
|
|
|
180
286
|
// store blank version in sdk-local-component-map.js
|
|
181
|
-
fs.writeFileSync(
|
|
287
|
+
fs.writeFileSync(pegaLocalReactComponentMapPath, blankMapData, { encoding: 'utf8' });
|
|
182
288
|
|
|
183
289
|
break;
|
|
184
290
|
case 'SDK-Angular' :
|
|
291
|
+
// get blank version
|
|
292
|
+
blankMap = path.join(path.resolve(), COMPONENT_ANGULAR_LIB_PATH, SDK_LOCAL_ANGULAR_COMPONENT_MAP_FILENAME);
|
|
293
|
+
|
|
294
|
+
blankMapData= fs.readFileSync(blankMap, { encoding: 'utf8' });
|
|
295
|
+
|
|
296
|
+
// store blank version in sdk-local-component-map.js
|
|
297
|
+
fs.writeFileSync(pegaLocalAngularComponentMapPath, blankMapData, { encoding: 'utf8' });
|
|
185
298
|
break;
|
|
186
299
|
case 'WebComponents' :
|
|
187
300
|
break;
|
|
@@ -190,3 +303,82 @@ export const clearComponentMap = async () => {
|
|
|
190
303
|
|
|
191
304
|
};
|
|
192
305
|
|
|
306
|
+
export const isComponentInMap = (componentName, framework) => {
|
|
307
|
+
|
|
308
|
+
let isInMap = true;
|
|
309
|
+
|
|
310
|
+
switch (framework) {
|
|
311
|
+
|
|
312
|
+
case "SDK-React":
|
|
313
|
+
const mapData = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
314
|
+
const componentPascal = convertIntoPascalCase(componentName)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
if (mapDataAng.indexOf(componentName) < 0) {
|
|
318
|
+
isInMap = false;
|
|
319
|
+
}
|
|
320
|
+
if (mapDataAng.indexOf(componentPascal) < 0) {
|
|
321
|
+
isInMap = false;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
break;
|
|
325
|
+
case "SDK-Angular":
|
|
326
|
+
const mapDataAng = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
327
|
+
const componentPascalAng = convertIntoPascalCase(componentName);
|
|
328
|
+
const componentKebabAng = convertIntoKebabCase(componentPascalAng);
|
|
329
|
+
|
|
330
|
+
if (mapDataAng.indexOf(componentName) < 0) {
|
|
331
|
+
isInMap = false;
|
|
332
|
+
}
|
|
333
|
+
if (mapDataAng.indexOf(componentPascalAng) < 0) {
|
|
334
|
+
isInMap = false;
|
|
335
|
+
}
|
|
336
|
+
if (mapDataAng.indexOf(componentKebabAng) < 0) {
|
|
337
|
+
isInMap = false;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
break;
|
|
341
|
+
case "SDK-WebComponents":
|
|
342
|
+
// need to handle this
|
|
343
|
+
isInMap = false;
|
|
344
|
+
break
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return isInMap;
|
|
348
|
+
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export const isComponentMapEmpty = (framework) => {
|
|
352
|
+
let isEmpty = false;
|
|
353
|
+
let blankMap;
|
|
354
|
+
let blankMapData;
|
|
355
|
+
let mapData;
|
|
356
|
+
|
|
357
|
+
switch (framework) {
|
|
358
|
+
case "SDk-React":
|
|
359
|
+
blankMap = path.join(path.resolve(), COMPONENT_REACT_LIB_PATH, SDK_LOCAL_REACT_COMPONENT_MAP_FILENAME);
|
|
360
|
+
blankMapData = fs.readFileSync(blankMap, { encoding: 'utf8' });
|
|
361
|
+
mapData = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
362
|
+
|
|
363
|
+
if (mapData === blankMapData) {
|
|
364
|
+
isEmpty = true;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
break;
|
|
368
|
+
case "SDK-Angular":
|
|
369
|
+
blankMap = path.join(path.resolve(), COMPONENT_ANGULAR_LIB_PATH, SDK_LOCAL_ANGULAR_COMPONENT_MAP_FILENAME);
|
|
370
|
+
blankMapData= fs.readFileSync(blankMap, { encoding: 'utf8' });
|
|
371
|
+
mapData = fs.readFileSync(pegaLocalAngularComponentMapPath, { encoding: 'utf8' });
|
|
372
|
+
|
|
373
|
+
if (mapData === blankMapData) {
|
|
374
|
+
isEmpty = true;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
break;
|
|
378
|
+
case "SDK-WebComponents":
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return isEmpty;
|
|
383
|
+
};
|
|
384
|
+
|
|
@@ -2,15 +2,18 @@ import inquirer from 'inquirer';
|
|
|
2
2
|
import Listr from 'listr';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
|
|
5
|
-
import { showVersion, getOptionsCategory, getComponentsObj } from '../../util.js';
|
|
5
|
+
import { showVersion, getOptionsCategory, getComponentsObj, getFramework, convertIntoKebabCase, convertIntoPascalCase } from '../../util.js';
|
|
6
6
|
import { updateComponentMap } from '../map/map.js';
|
|
7
7
|
import { getBuildCategory } from './helper.js';
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
export default async options => {
|
|
12
13
|
showVersion();
|
|
13
14
|
|
|
15
|
+
const framework = await getFramework();
|
|
16
|
+
|
|
14
17
|
const catQuestion = await getBuildCategory(options);
|
|
15
18
|
const catAnswers = await inquirer.prompt(catQuestion);
|
|
16
19
|
|
|
@@ -23,7 +26,7 @@ export default async options => {
|
|
|
23
26
|
const components = await getComponentsObj(false, category);
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
let componentKey;
|
|
27
30
|
|
|
28
31
|
const customTasks = new Listr(
|
|
29
32
|
[
|
|
@@ -44,6 +47,20 @@ export default async options => {
|
|
|
44
47
|
for (var index in components) {
|
|
45
48
|
componentKey = components[index].value;
|
|
46
49
|
console.log(chalk.bold.green("Mapping: " + components[index].name));
|
|
50
|
+
|
|
51
|
+
switch (framework) {
|
|
52
|
+
case "SDK-Angular":
|
|
53
|
+
// componentKey is in Pascal case, which is associated, need to convert to Kabab case
|
|
54
|
+
let arComp = componentKey.split("/");
|
|
55
|
+
arComp[1] = convertIntoKebabCase(convertIntoPascalCase(arComp[1]));
|
|
56
|
+
componentKey = arComp.join("/");
|
|
57
|
+
break;
|
|
58
|
+
case "SDK-React":
|
|
59
|
+
break;
|
|
60
|
+
case "SDK-WebComponents":
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
47
64
|
await customTasks.run().catch(err => {
|
|
48
65
|
console.log(chalk.bold.red(err.toString()));
|
|
49
66
|
});
|