@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
|
@@ -3,25 +3,31 @@ import Listr from 'listr';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
|
|
5
5
|
import validate from '../validator/index.js';
|
|
6
|
-
import { getComponentDirectoryPath, showVersion, getOptionsCategory, getComponentsObj } from '../../util.js';
|
|
7
|
-
import
|
|
6
|
+
import { getComponentDirectoryPath, showVersion, getOptionsCategory, getComponentsObj, getFramework, getLocalComponentKeyFromConfig, convertIntoKebabCase, convertIntoPascalCase } from '../../util.js';
|
|
7
|
+
import { bundleReactComponent, bundleAngularComponent, bundleAssociatedComponent} from '../bundle/index.js';
|
|
8
8
|
import { updateComponentMap } from '../map/map.js';
|
|
9
9
|
import { lintComponent } from '../linter/index.js';
|
|
10
10
|
import { CATEGORY_CONSTELLATION, CATEGORY_CUSTOM } from '../../constants.js';
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
import { getPublishComponentQuestions,
|
|
14
|
-
publishComponentToServer,
|
|
15
|
-
zipComponent,
|
|
16
|
-
getBuildCategory,
|
|
13
|
+
import { getPublishComponentQuestions,
|
|
14
|
+
publishComponentToServer,
|
|
15
|
+
zipComponent,
|
|
16
|
+
getBuildCategory,
|
|
17
17
|
mapConfigJsonToCompanion,
|
|
18
18
|
removeCompanionConfigJson,
|
|
19
19
|
cleanUp
|
|
20
20
|
} from './helper.js';
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
export function getCustomTasks(componentKey, category, sourceMap, devBuild, content, options) {
|
|
24
|
-
const
|
|
23
|
+
export function getCustomTasks(componentKey, category, sourceMap, devBuild, content, options, framework, associatedComponentKey) {
|
|
24
|
+
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
25
|
+
const sFramework = framework.split("-")[1];
|
|
26
|
+
|
|
27
|
+
// don't fetch if testing
|
|
28
|
+
const doFetch = options.params.length >= 7 ? false : true;
|
|
29
|
+
|
|
30
|
+
return new Listr(
|
|
25
31
|
[
|
|
26
32
|
|
|
27
33
|
{
|
|
@@ -31,7 +37,7 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
|
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
|
-
title:
|
|
40
|
+
title: `Lint ${sFramework} component`,
|
|
35
41
|
task: async () => {
|
|
36
42
|
const targetDirectory = await getComponentDirectoryPath(componentKey, category);
|
|
37
43
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
@@ -47,7 +53,7 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
|
|
|
47
53
|
{
|
|
48
54
|
title: 'Lint associated component',
|
|
49
55
|
task: async () => {
|
|
50
|
-
const targetDirectory = await getComponentDirectoryPath(
|
|
56
|
+
const targetDirectory = await getComponentDirectoryPath(associatedComponentKey, CATEGORY_CONSTELLATION);
|
|
51
57
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
52
58
|
await lintComponent(targetDirectory);
|
|
53
59
|
}
|
|
@@ -59,27 +65,39 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
|
|
|
59
65
|
}
|
|
60
66
|
},
|
|
61
67
|
{
|
|
62
|
-
title:
|
|
63
|
-
task: async () => await
|
|
68
|
+
title: `Bundle React component ${sDevBuild}`,
|
|
69
|
+
task: async () => await bundleReactComponent(componentKey, sourceMap, devBuild, category),
|
|
70
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
71
|
+
enabled: ok => framework === "SDK-React"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: `Bundle Angular component ${sDevBuild}`,
|
|
75
|
+
task: async () => await bundleAngularComponent(componentKey, sourceMap, devBuild, category),
|
|
76
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
77
|
+
enabled: ok => framework === "SDK-Angular"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: `Bundle associated component ${sDevBuild}`,
|
|
81
|
+
task: async () => await bundleAssociatedComponent(associatedComponentKey, sourceMap, devBuild, CATEGORY_CONSTELLATION),
|
|
64
82
|
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
|
|
65
83
|
},
|
|
66
84
|
{
|
|
67
85
|
title: 'Zip associated component',
|
|
68
86
|
task: async () => {
|
|
69
|
-
const output = await zipComponent(
|
|
70
|
-
content = { ...content, ...output, componentKey };
|
|
87
|
+
const output = await zipComponent(associatedComponentKey, CATEGORY_CONSTELLATION);
|
|
88
|
+
content = { ...content, ...output, componentKey : associatedComponentKey };
|
|
71
89
|
}
|
|
72
90
|
},
|
|
73
91
|
{
|
|
74
92
|
title: 'Publish associated component',
|
|
75
93
|
task: async () => {
|
|
76
|
-
await publishComponentToServer(content);
|
|
94
|
+
await publishComponentToServer(content, doFetch);
|
|
77
95
|
}
|
|
78
96
|
},
|
|
79
97
|
{
|
|
80
98
|
title: 'Clean up associated component',
|
|
81
99
|
task: async () => {
|
|
82
|
-
await removeCompanionConfigJson(
|
|
100
|
+
await removeCompanionConfigJson(associatedComponentKey);
|
|
83
101
|
}
|
|
84
102
|
}
|
|
85
103
|
],
|
|
@@ -88,12 +106,16 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
|
|
|
88
106
|
}
|
|
89
107
|
);
|
|
90
108
|
|
|
91
|
-
return customTasks;
|
|
92
109
|
}
|
|
93
110
|
|
|
94
|
-
export function getOverrideTasks(componentKey, category, sourceMap, devBuild, content, options) {
|
|
111
|
+
export function getOverrideTasks(componentKey, category, sourceMap, devBuild, content, options, framework) {
|
|
112
|
+
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
113
|
+
const sFramework = framework.split("-")[1];
|
|
95
114
|
|
|
96
|
-
|
|
115
|
+
// don't fetch if testing
|
|
116
|
+
const doFetch = options.params.length >= 7 ? false : true;
|
|
117
|
+
|
|
118
|
+
return new Listr(
|
|
97
119
|
[
|
|
98
120
|
{
|
|
99
121
|
title: 'Validate config schema',
|
|
@@ -102,7 +124,7 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
|
|
|
102
124
|
}
|
|
103
125
|
},
|
|
104
126
|
{
|
|
105
|
-
title:
|
|
127
|
+
title: `Lint ${sFramework} component`,
|
|
106
128
|
task: async () => {
|
|
107
129
|
const targetDirectory = await getComponentDirectoryPath(componentKey, category);
|
|
108
130
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
@@ -110,9 +132,16 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
|
|
|
110
132
|
}
|
|
111
133
|
},
|
|
112
134
|
{
|
|
113
|
-
title:
|
|
114
|
-
task: async () => await
|
|
115
|
-
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
|
|
135
|
+
title: `Bundle React component ${sDevBuild}`,
|
|
136
|
+
task: async () => await bundleReactComponent(componentKey, sourceMap, devBuild, category),
|
|
137
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
138
|
+
enabled: ok => framework === "SDK-React"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: `Bundle Angular component ${sDevBuild}`,
|
|
142
|
+
task: async () => await bundleAngularComponent(componentKey, sourceMap, devBuild, category),
|
|
143
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
144
|
+
enabled: ok => framework === "SDK-Angular"
|
|
116
145
|
},
|
|
117
146
|
{
|
|
118
147
|
title: 'Update component map',
|
|
@@ -130,7 +159,7 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
|
|
|
130
159
|
{
|
|
131
160
|
title: 'Publish component config',
|
|
132
161
|
task: async () => {
|
|
133
|
-
await publishComponentToServer(content);
|
|
162
|
+
await publishComponentToServer(content, doFetch);
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
],
|
|
@@ -139,40 +168,88 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
|
|
|
139
168
|
}
|
|
140
169
|
);
|
|
141
170
|
|
|
142
|
-
return overrideTasks;
|
|
143
171
|
}
|
|
144
172
|
|
|
145
173
|
|
|
146
174
|
export default async options => {
|
|
147
175
|
showVersion();
|
|
148
176
|
|
|
149
|
-
|
|
150
|
-
|
|
177
|
+
let componentKey;
|
|
178
|
+
let sourceMap;
|
|
179
|
+
let devBuild;
|
|
180
|
+
let content;
|
|
181
|
+
let category;
|
|
182
|
+
let components;
|
|
151
183
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
184
|
+
const framework = await getFramework();
|
|
185
|
+
|
|
186
|
+
if (options.params.length >= 7) {
|
|
187
|
+
category = options.params[3];
|
|
188
|
+
const rulesetName = options.params[4];
|
|
189
|
+
const rulesetVersion = options.params[5];
|
|
190
|
+
const dBuild = options.params[6];
|
|
191
|
+
devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
|
|
156
192
|
|
|
157
|
-
|
|
158
|
-
const questions = await getPublishComponentQuestions(category);
|
|
159
|
-
const answers = await inquirer.prompt(questions);
|
|
160
|
-
const {sourceMap, devBuild } = answers;
|
|
193
|
+
content = { componentKey, rulesetName, rulesetVersion, devBuild };
|
|
161
194
|
|
|
162
|
-
|
|
163
|
-
...answers
|
|
164
|
-
};
|
|
195
|
+
components = await getComponentsObj(false, category);
|
|
165
196
|
|
|
166
|
-
|
|
197
|
+
// end if find no componets
|
|
198
|
+
if (components.length == 0) {
|
|
199
|
+
console.log(chalk.redBright("No components to publish"));
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
167
202
|
|
|
203
|
+
} else {
|
|
204
|
+
const catQuestion = await getBuildCategory(options);
|
|
205
|
+
const catAnswers = await inquirer.prompt(catQuestion);
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
category = catAnswers.category;
|
|
209
|
+
if (category == null) {
|
|
210
|
+
category = getOptionsCategory(options);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
components = await getComponentsObj(false, category);
|
|
214
|
+
|
|
215
|
+
// end if find no componets
|
|
216
|
+
if (components.length == 0) {
|
|
217
|
+
console.log(chalk.redBright("No components to publish"));
|
|
218
|
+
process.exit(1);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const questions = await getPublishComponentQuestions(category);
|
|
222
|
+
const answers = await inquirer.prompt(questions);
|
|
223
|
+
({sourceMap, devBuild } = answers);
|
|
224
|
+
|
|
225
|
+
content = {
|
|
226
|
+
...answers
|
|
227
|
+
};
|
|
228
|
+
}
|
|
168
229
|
|
|
169
230
|
if (category === CATEGORY_CUSTOM) {
|
|
170
231
|
|
|
171
|
-
|
|
172
|
-
componentKey =
|
|
173
|
-
|
|
232
|
+
for (const component of components) {
|
|
233
|
+
let componentKey = component.value;
|
|
234
|
+
const componentKeyName = component.name;
|
|
235
|
+
console.log(chalk.bold.green(`Publishing: ${componentKeyName}`));
|
|
236
|
+
|
|
237
|
+
let associatedComponentKey = componentKey;
|
|
174
238
|
|
|
175
|
-
|
|
239
|
+
switch (framework) {
|
|
240
|
+
case "SDK-Angular":
|
|
241
|
+
// componentKey is in Pascal case, which is associated, need to convert to Kabab case
|
|
242
|
+
let arComp = componentKey.split("/");
|
|
243
|
+
arComp[1] = convertIntoKebabCase(convertIntoPascalCase(arComp[1]));
|
|
244
|
+
componentKey = arComp.join("/");
|
|
245
|
+
break;
|
|
246
|
+
case "SDK-React":
|
|
247
|
+
break;
|
|
248
|
+
case "SDK-WebComponents":
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
let myCustomTasks = getCustomTasks(componentKey, category, sourceMap, devBuild, content, options, framework, associatedComponentKey);
|
|
176
253
|
|
|
177
254
|
await myCustomTasks.run().catch(err => {
|
|
178
255
|
console.log(chalk.bold.red(err.toString()));
|
|
@@ -181,11 +258,13 @@ export default async options => {
|
|
|
181
258
|
|
|
182
259
|
}
|
|
183
260
|
else {
|
|
184
|
-
for (var index in components) {
|
|
185
|
-
componentKey = components[index].value;
|
|
186
|
-
console.log(chalk.bold.green("Publishing: " + components[index].name));
|
|
187
261
|
|
|
188
|
-
|
|
262
|
+
for (const component of components) {
|
|
263
|
+
const componentKey = component.value;
|
|
264
|
+
const componentKeyName = component.name;
|
|
265
|
+
console.log(chalk.bold.green(`Publishing: ${componentKeyName}`));
|
|
266
|
+
|
|
267
|
+
let myOverrideTasks = getOverrideTasks(componentKey, category, sourceMap, devBuild, content, options, framework);
|
|
189
268
|
|
|
190
269
|
await myOverrideTasks.run().catch(err => {
|
|
191
270
|
console.log(chalk.bold.red(err.toString()));
|
|
@@ -196,7 +275,7 @@ export default async options => {
|
|
|
196
275
|
|
|
197
276
|
|
|
198
277
|
// once done, remove leftover directories
|
|
199
|
-
cleanUp();
|
|
278
|
+
await cleanUp();
|
|
200
279
|
|
|
201
280
|
|
|
202
281
|
return true;
|
|
@@ -8,7 +8,7 @@ import inquirer from 'inquirer';
|
|
|
8
8
|
import ncp from 'ncp';
|
|
9
9
|
import chalk from 'chalk';
|
|
10
10
|
|
|
11
|
-
import { checkPathAccess, showVersion, getComponentsObj, getDirectoryFiles } from '../../util.js';
|
|
11
|
+
import { checkPathAccess, showVersion, getComponentsObj, getDirectoryFiles, getFramework } from '../../util.js';
|
|
12
12
|
import { CATEGORY_CONSTELLATION,
|
|
13
13
|
CATEGORY_CUSTOM,
|
|
14
14
|
SDK_CONFIG_JSON_FILENAME,
|
|
@@ -25,6 +25,7 @@ const pegaConfigJsonPath = path.join(path.resolve(), SDK_CONFIG_JSON_FILENAME);
|
|
|
25
25
|
|
|
26
26
|
import {
|
|
27
27
|
convertIntoPascalCase,
|
|
28
|
+
convertIntoKebabCase,
|
|
28
29
|
getComponentDirectoryPath,
|
|
29
30
|
getPegaConfig,
|
|
30
31
|
getComponentDefaults,
|
|
@@ -87,14 +88,31 @@ export const updateFile = async (
|
|
|
87
88
|
oldComponentKeyPC,
|
|
88
89
|
newComponentKeyPC,
|
|
89
90
|
targetDirectory,
|
|
91
|
+
framework
|
|
90
92
|
) => {
|
|
91
93
|
|
|
92
94
|
let fileData = fs.readFileSync(join(targetDirectory, "/", fileName), { encoding: 'utf8' });
|
|
93
95
|
|
|
94
96
|
if (fileData.indexOf(oldComponentKeyPC) >= 0) {
|
|
95
97
|
fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
|
|
96
|
-
|
|
98
|
+
fileData = fileData.replaceAll(convertIntoKebabCase(oldComponentKeyPC), convertIntoKebabCase(newComponentKeyPC));
|
|
99
|
+
|
|
97
100
|
fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8' });
|
|
101
|
+
|
|
102
|
+
switch (framework) {
|
|
103
|
+
case "SDK-Angular":
|
|
104
|
+
if (fileName.indexOf(".component") >=0 ) {
|
|
105
|
+
const newFileName = fileName.replaceAll(convertIntoKebabCase(oldComponentKeyPC), convertIntoKebabCase(newComponentKeyPC));
|
|
106
|
+
|
|
107
|
+
fs.renameSync(join(targetDirectory, "/", fileName), join(targetDirectory, "/", newFileName));
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "SDK-React":
|
|
111
|
+
break;
|
|
112
|
+
case "SDK-WebComponents":
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
98
116
|
}
|
|
99
117
|
|
|
100
118
|
};
|
|
@@ -117,18 +135,42 @@ export const renameComponent = async (
|
|
|
117
135
|
|
|
118
136
|
|
|
119
137
|
let pegaConfig = await getPegaConfig();
|
|
138
|
+
|
|
139
|
+
let originalComponentKey = componentKey;
|
|
140
|
+
let associatedComponentKey = componentKey;
|
|
141
|
+
|
|
142
|
+
const framework = await getFramework();
|
|
143
|
+
|
|
144
|
+
let newComponentKey = `${organization}_${library}_${componentName}`;
|
|
145
|
+
let newCustomComponentKey = newComponentKey;
|
|
146
|
+
let newComponentKeyAssociated = newComponentKey;
|
|
147
|
+
|
|
148
|
+
switch (framework) {
|
|
149
|
+
case "SDK-Angular":
|
|
150
|
+
// componentKey is in Pascal case, which is associated, need to convert to Kabab case
|
|
151
|
+
let arComp = componentKey.split("/");
|
|
152
|
+
arComp[1] = convertIntoKebabCase(convertIntoPascalCase(arComp[1]));
|
|
153
|
+
componentKey = arComp.join("/");
|
|
154
|
+
|
|
155
|
+
newCustomComponentKey = convertIntoKebabCase(convertIntoPascalCase(newCustomComponentKey));
|
|
156
|
+
break;
|
|
157
|
+
case "SDK-React":
|
|
158
|
+
break;
|
|
159
|
+
case "SDK-WebComponents":
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
|
|
120
163
|
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
const oldComponentKey = componentKey.split("/")[1];
|
|
164
|
+
const typeLC = originalComponentKey.split("/")[0];
|
|
165
|
+
const oldComponentKey = originalComponentKey.split("/")[1];
|
|
124
166
|
const newComponentKeyPC = convertIntoPascalCase(newComponentKey);
|
|
125
167
|
const oldComponentKeyPC = convertIntoPascalCase(oldComponentKey);
|
|
126
168
|
|
|
127
169
|
const currentDirectory = await getComponentDirectoryPath(componentKey);
|
|
128
|
-
const currentDirectoryConstellation = await getComponentDirectoryPath(
|
|
170
|
+
const currentDirectoryConstellation = await getComponentDirectoryPath(associatedComponentKey, CATEGORY_CONSTELLATION);
|
|
129
171
|
|
|
130
|
-
const targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",
|
|
131
|
-
const targetDirectoryConstellation = await getComponentDirectoryPath(join(typeLC, "/",
|
|
172
|
+
const targetDirectory = await getComponentDirectoryPath(join(typeLC, "/",newCustomComponentKey));
|
|
173
|
+
const targetDirectoryConstellation = await getComponentDirectoryPath(join(typeLC, "/",newComponentKeyAssociated), CATEGORY_CONSTELLATION);
|
|
132
174
|
|
|
133
175
|
|
|
134
176
|
|
|
@@ -166,7 +208,8 @@ export const renameComponent = async (
|
|
|
166
208
|
fileName,
|
|
167
209
|
oldComponentKeyPC,
|
|
168
210
|
newComponentKeyPC,
|
|
169
|
-
targetDirectory
|
|
211
|
+
targetDirectory,
|
|
212
|
+
framework );
|
|
170
213
|
|
|
171
214
|
}
|
|
172
215
|
|
|
@@ -226,108 +269,22 @@ export default async options => {
|
|
|
226
269
|
let componentDefaults = await getComponentDefaults();
|
|
227
270
|
componentDefaults.library = library;
|
|
228
271
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
message: 'Enter new component name (required, no spaces)',
|
|
243
|
-
validate: value => {
|
|
244
|
-
/* value should not be empty
|
|
245
|
-
It should not have spaces
|
|
246
|
-
It should not start with a number
|
|
247
|
-
Only case-insensitive alphanumeric values are allowed
|
|
248
|
-
*/
|
|
249
|
-
if (value && !/^\d/.test(value) && value === sanitize(value)) {
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
name: 'componentLabel',
|
|
257
|
-
message: 'Enter new component label for display (required)',
|
|
258
|
-
validate: value => {
|
|
259
|
-
if (value) {
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
return 'Please provide value for label';
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: 'organization',
|
|
267
|
-
message: 'Enter new component organization',
|
|
268
|
-
default: componentDefaults.organization,
|
|
269
|
-
validate: value => {
|
|
270
|
-
if (value) {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
return 'Please provide value for organization';
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
name: 'version',
|
|
278
|
-
message: 'Enter new component version',
|
|
279
|
-
default: componentDefaults.version,
|
|
280
|
-
validate: value => {
|
|
281
|
-
if (validateSemver(value)) {
|
|
282
|
-
return true;
|
|
283
|
-
}
|
|
284
|
-
return 'Please provide semver compatible version e.g 0.0.1';
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
name: 'library',
|
|
289
|
-
message: 'Enter new library name (required)',
|
|
290
|
-
default: componentDefaults.library,
|
|
291
|
-
validate: value => {
|
|
292
|
-
/* value should not be empty
|
|
293
|
-
It should not have spaces
|
|
294
|
-
It should not start with a number
|
|
295
|
-
Only case-insensitive alphanumeric values are allowed
|
|
296
|
-
*/
|
|
297
|
-
if (value && !/^\d/.test(value) && value === sanitize(value)) {
|
|
298
|
-
return true;
|
|
299
|
-
}
|
|
300
|
-
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
name: 'allowedApplications',
|
|
305
|
-
message: 'Please enter the application names to be supported (comma-separated). ',
|
|
306
|
-
suffix: 'Keep empty for all applications'
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
name: 'description',
|
|
310
|
-
message: 'Enter new description for the component (defaults to new label)',
|
|
311
|
-
default: componentDefaults.description,
|
|
312
|
-
/* if left blank and no defaults, mustache will use componentLabel, because description is used in app studio and
|
|
313
|
-
shouldn't be blank */
|
|
314
|
-
}
|
|
315
|
-
];
|
|
316
|
-
|
|
317
|
-
await inquirer.prompt(questions).then(async answers => {
|
|
318
|
-
const {
|
|
319
|
-
componentKey,
|
|
320
|
-
componentName,
|
|
321
|
-
componentLabel,
|
|
322
|
-
organization,
|
|
323
|
-
library,
|
|
324
|
-
version,
|
|
325
|
-
description,
|
|
326
|
-
allowedApplications
|
|
327
|
-
} = answers;
|
|
272
|
+
// since custom has differnet naming convention for Angular, will get "constellation", which has the same name
|
|
273
|
+
// regardless of framework
|
|
274
|
+
const localComponents = await getComponentsObj(true);
|
|
275
|
+
|
|
276
|
+
if (options.params.length >= 11) {
|
|
277
|
+
const componentKey = options.params[3];
|
|
278
|
+
const componentName = options.params[4];
|
|
279
|
+
const componentLabel = options.params[5];
|
|
280
|
+
const organization = options.params[6];
|
|
281
|
+
const version = options.params[7];
|
|
282
|
+
const library = options.params[8];
|
|
283
|
+
const allowedApplications = options.params[9];
|
|
284
|
+
const description = options.params[10];
|
|
328
285
|
|
|
329
286
|
await renameComponent(
|
|
330
|
-
{
|
|
287
|
+
{
|
|
331
288
|
componentKey,
|
|
332
289
|
componentName,
|
|
333
290
|
componentLabel,
|
|
@@ -339,7 +296,123 @@ export default async options => {
|
|
|
339
296
|
},
|
|
340
297
|
options
|
|
341
298
|
);
|
|
342
|
-
|
|
343
|
-
}
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
const questions = [
|
|
303
|
+
{
|
|
304
|
+
name: 'componentKey',
|
|
305
|
+
type: 'rawlist',
|
|
306
|
+
pageSize: 15,
|
|
307
|
+
message: 'Select component to rename',
|
|
308
|
+
choices: localComponents
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: 'componentName',
|
|
312
|
+
message: 'Enter new component name (required, no spaces)',
|
|
313
|
+
validate: value => {
|
|
314
|
+
/* value should not be empty
|
|
315
|
+
It should not have spaces
|
|
316
|
+
It should not start with a number
|
|
317
|
+
Only case-insensitive alphanumeric values are allowed
|
|
318
|
+
*/
|
|
319
|
+
if (value && !/^\d/.test(value) && value === sanitize(value)) {
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: 'componentLabel',
|
|
327
|
+
message: 'Enter new component label for display (required)',
|
|
328
|
+
validate: value => {
|
|
329
|
+
if (value) {
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
return 'Please provide value for label';
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'organization',
|
|
337
|
+
message: 'Enter new component organization',
|
|
338
|
+
default: componentDefaults.organization,
|
|
339
|
+
validate: value => {
|
|
340
|
+
if (value) {
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
return 'Please provide value for organization';
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'version',
|
|
348
|
+
message: 'Enter new component version',
|
|
349
|
+
default: componentDefaults.version,
|
|
350
|
+
validate: value => {
|
|
351
|
+
if (validateSemver(value)) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
return 'Please provide semver compatible version e.g 0.0.1';
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: 'library',
|
|
359
|
+
message: 'Enter new library name (required)',
|
|
360
|
+
default: componentDefaults.library,
|
|
361
|
+
validate: value => {
|
|
362
|
+
/* value should not be empty
|
|
363
|
+
It should not have spaces
|
|
364
|
+
It should not start with a number
|
|
365
|
+
Only case-insensitive alphanumeric values are allowed
|
|
366
|
+
*/
|
|
367
|
+
if (value && !/^\d/.test(value) && value === sanitize(value)) {
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: 'allowedApplications',
|
|
375
|
+
message: 'Please enter the application names to be supported (comma-separated). ',
|
|
376
|
+
suffix: 'Keep empty for all applications'
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: 'description',
|
|
380
|
+
message: 'Enter new description for the component (defaults to new label)',
|
|
381
|
+
default: componentDefaults.description,
|
|
382
|
+
/* if left blank and no defaults, mustache will use componentLabel, because description is used in app studio and
|
|
383
|
+
shouldn't be blank */
|
|
384
|
+
}
|
|
385
|
+
];
|
|
386
|
+
|
|
387
|
+
await inquirer.prompt(questions).then(async answers => {
|
|
388
|
+
const {
|
|
389
|
+
componentKey,
|
|
390
|
+
componentName,
|
|
391
|
+
componentLabel,
|
|
392
|
+
organization,
|
|
393
|
+
library,
|
|
394
|
+
version,
|
|
395
|
+
description,
|
|
396
|
+
allowedApplications
|
|
397
|
+
} = answers;
|
|
398
|
+
|
|
399
|
+
await renameComponent(
|
|
400
|
+
{
|
|
401
|
+
componentKey,
|
|
402
|
+
componentName,
|
|
403
|
+
componentLabel,
|
|
404
|
+
library,
|
|
405
|
+
version,
|
|
406
|
+
description,
|
|
407
|
+
allowedApplications,
|
|
408
|
+
organization
|
|
409
|
+
},
|
|
410
|
+
options
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
344
417
|
|
|
345
418
|
};
|