@pega/custom-dx-components 26.1.11 → 26.1.12-alpha.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/package.json +48 -64
- package/src/ai/README.md +44 -0
- package/src/ai/catalog/README.md +133 -0
- package/src/ai/catalog/best-practices/README.md +24 -0
- package/src/ai/catalog/best-practices/accessibility-for-async-components.md +53 -0
- package/src/ai/catalog/best-practices/error-handling-and-resiliency.md +116 -0
- package/src/ai/catalog/best-practices/genai-assistant-integration-patterns.md +49 -0
- package/src/ai/catalog/best-practices/performance-and-efficiency.md +109 -0
- package/src/ai/catalog/best-practices/security-considerations.md +93 -0
- package/src/ai/catalog/best-practices/testing-pconnect-components.md +245 -0
- package/src/ai/catalog/best-practices/troubleshooting-common-pitfalls.md +132 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/README.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/approval-workflow-decision.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/attachment-upload.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/bulk-action-submit.md +50 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/confirm-before-destructive-action.md +43 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/create-and-stage-new-case.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/graceful-submit-failure.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/modal-assignment-submit.md +58 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/multi-step-wizard.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/resolve-or-ignore-duplicate.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/safe-case-deletion.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/look-up-user-details.md +43 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-attachments.md +51 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-participants.md +52 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/participant-and-follower.md +40 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/post-and-manage-feed.md +50 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/relate-cases.md +35 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/tag-case-and-find-related.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/data-page-subscription-cleanup.md +41 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/publish-and-subscribe-events.md +40 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/pubsub-cleanup.md +38 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/query-paginated-list-data.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/realtime-case-subscription.md +46 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/refresh-and-update-data.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/autosave-tracking.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/cascading-dependent-fields.md +51 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/collect-form-changes-for-manual-save.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/custom-field-validators.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/discard-changes-and-reset-form.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/full-form-validation.md +38 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/persist-widget-ui-state.md +41 -0
- package/src/ai/catalog/pconnect-lists-and-views/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/activate-and-switch-container-items.md +52 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/container-item-lifecycle.md +61 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/insert-delete-list-rows.md +40 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/reorder-list-rows.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/repeating-row-edit.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/view-personalization.md +60 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/SKILL.md +45 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/agent-conversation-for-tasks.md +54 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/bookmarkable-filter-state.md +40 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/deep-link-semantic-url.md +39 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/genai-assistant-conversation.md +43 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/locale-switch-and-relocalize.md +38 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/persist-operator-preferences.md +40 -0
- package/src/ai/catalog/references/architecture-overview.md +52 -0
- package/src/ai/catalog/references/pconnect-actions-api.md +948 -0
- package/src/ai/catalog/references/pconnect-case-info-data-info-localization.md +618 -0
- package/src/ai/catalog/references/pconnect-case-validation-utilities.md +238 -0
- package/src/ai/catalog/references/pconnect-container-manager.md +215 -0
- package/src/ai/catalog/references/pconnect-list-actions.md +250 -0
- package/src/ai/catalog/references/pconnect-misc-suggestions-creation.md +231 -0
- package/src/ai/catalog/references/pconnect-reference-context-component.md +471 -0
- package/src/ai/catalog/references/pconnect-state-config.md +316 -0
- package/src/ai/catalog/references/pconnect-validation-api.md +45 -0
- package/src/ai/catalog/references/pcore-analytics-genai-details.md +50 -0
- package/src/ai/catalog/references/pcore-bootstrap-init-details.md +121 -0
- package/src/ai/catalog/references/pcore-bootstrap-registry-routing.md +253 -0
- package/src/ai/catalog/references/pcore-case-collaboration-details.md +191 -0
- package/src/ai/catalog/references/pcore-case-collaboration-genai.md +264 -0
- package/src/ai/catalog/references/pcore-environment-info-details.md +96 -0
- package/src/ai/catalog/references/pcore-environment-locale-namespace.md +175 -0
- package/src/ai/catalog/references/pcore-messaging-details.md +99 -0
- package/src/ai/catalog/references/pcore-misc-details.md +207 -0
- package/src/ai/catalog/references/pcore-misc-utilities.md +325 -0
- package/src/ai/catalog/references/pcore-rest-data-details.md +164 -0
- package/src/ai/catalog/references/pcore-rest-data-messaging.md +308 -0
- package/src/ai/catalog/references/pcore-store-context-details.md +40 -0
- package/src/ai/catalog/references/pcore-store-context-state.md +130 -0
- package/src/ai/index.js +154 -0
- package/src/ai/project/.claude/skills/boolean/SKILL.md +43 -0
- package/src/ai/project/.claude/skills/case/SKILL.md +58 -0
- package/src/ai/project/.claude/skills/create-dx-component/SKILL.md +98 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/PConnProps.d.ts +24 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/create-nonce.ts +5 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/event-utils.ts +18 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/styles.ts +7 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/README.md +28 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/build-a-data-widget.md +281 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/field-with-limits-and-validation.md +156 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/status-badge-field.md +97 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/accessibility.md +71 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/choosing-type-and-subtype.md +79 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cli-workflow.md +125 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/component-patterns.md +241 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/config-schema.md +296 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cosmos-components.md +137 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-behavior.md +155 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-essentials.md +90 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-subtypes-extra.md +68 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/localization.md +30 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/pcore-pconnect-apis.md +77 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/presentation-essentials.md +57 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/props-contract.md +182 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/state-matrix.md +102 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/storybook-pattern.md +262 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/styles-pattern.md +54 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-essentials.md +87 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-patterns.md +131 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/test-pattern.md +215 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/ui-gallery-reuse.md +93 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-essentials.md +84 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-patterns.md +164 -0
- package/src/ai/project/.claude/skills/currency/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/date/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/decimal/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/details/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/email/SKILL.md +42 -0
- package/src/ai/project/.claude/skills/field/SKILL.md +68 -0
- package/src/ai/project/.claude/skills/form/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/generate-component-set/SKILL.md +80 -0
- package/src/ai/project/.claude/skills/generate-component-set/component-manifest.json +161 -0
- package/src/ai/project/.claude/skills/identify-components/SKILL.md +76 -0
- package/src/ai/project/.claude/skills/integer/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/page/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/page-widget/SKILL.md +55 -0
- package/src/ai/project/.claude/skills/percentage/SKILL.md +52 -0
- package/src/ai/project/.claude/skills/phone/SKILL.md +44 -0
- package/src/ai/project/.claude/skills/picklist/SKILL.md +50 -0
- package/src/ai/project/.claude/skills/plan-dx-component/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/design-system-mapping.md +108 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/intake.md +146 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/plan-template.md +76 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/requirements-template.md +88 -0
- package/src/ai/project/.claude/skills/presentation/SKILL.md +61 -0
- package/src/ai/project/.claude/skills/publish-library/SKILL.md +106 -0
- package/src/ai/project/.claude/skills/radiobuttons/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/review-component/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/review-component/references/checklist.md +77 -0
- package/src/ai/project/.claude/skills/template/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/text/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/update-dx-component/SKILL.md +56 -0
- package/src/ai/project/.claude/skills/update-dx-component/references/maintenance.md +43 -0
- package/src/ai/project/.claude/skills/url/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/validate-component/SKILL.md +78 -0
- package/src/ai/project/.claude/skills/validate-component/references/runtime-troubleshooting.md +56 -0
- package/src/ai/project/.claude/skills/validate-component/scripts/check-component.mjs +327 -0
- package/src/ai/project/.claude/skills/widget/SKILL.md +59 -0
- package/src/ai/project/.gemini/settings.json +5 -0
- package/src/ai/project/AGENTS.md +74 -0
- package/src/ai/readme-section.md +91 -0
- package/src/cli.js +48 -7
- package/src/constants.js +54 -53
- package/src/internal-tests.js +27 -0
- package/src/tasks/ai-toggle/index.js +46 -0
- package/src/tasks/authenticate/helper.js +38 -38
- package/src/tasks/authenticate/index.js +17 -15
- package/src/tasks/build-all/helper.js +4 -4
- package/src/tasks/build-all/index.js +7 -7
- package/src/tasks/build-comp/helper.js +17 -17
- package/src/tasks/build-comp/index.js +10 -10
- package/src/tasks/build-jest-assets/index.js +7 -9
- package/src/tasks/build-lib/helper.js +8 -8
- package/src/tasks/build-lib/index.js +8 -8
- package/src/tasks/bundle/builder/index.js +9 -12
- package/src/tasks/bundle/builder/modules.js +8 -9
- package/src/tasks/bundle/builder/paths.js +2 -19
- package/src/tasks/bundle/builder/webpack.config.js +60 -77
- package/src/tasks/bundle/index.js +8 -8
- package/src/tasks/create/index.js +35 -35
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -36
- package/src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +2 -27
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +4 -39
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +4 -53
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -42
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/component-constants.ts +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -11
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +28 -28
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +4 -9
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +19 -14
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Launchpad/Field/__components.md +1 -1
- package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create-all/index.js +42 -41
- package/src/tasks/create-lib/helper.js +13 -13
- package/src/tasks/create-lib/index.js +5 -5
- package/src/tasks/create-version/helper.js +10 -10
- package/src/tasks/create-version/index.js +3 -4
- package/src/tasks/delete/helper.js +20 -19
- package/src/tasks/delete/index.js +2 -2
- package/src/tasks/delete-all/helper.js +26 -25
- package/src/tasks/delete-all/index.js +2 -2
- package/src/tasks/delete-lib/helper.js +6 -6
- package/src/tasks/delete-lib/index.js +6 -6
- package/src/tasks/delete-pub/helper.js +18 -18
- package/src/tasks/delete-pub/index.js +8 -8
- package/src/tasks/delete-version/index.js +2 -2
- package/src/tasks/dev-server/index.js +1 -1
- package/src/tasks/export-archive/helper.js +21 -21
- package/src/tasks/export-archive/index.js +27 -40
- package/src/tasks/export-rc/helper.js +34 -34
- package/src/tasks/export-rc/index.js +21 -31
- package/src/tasks/import-archive/helper.js +39 -39
- package/src/tasks/import-archive/index.js +69 -89
- package/src/tasks/import-comp/helper.js +8 -8
- package/src/tasks/import-comp/index.js +30 -42
- package/src/tasks/index.js +5 -0
- package/src/tasks/init/Node.gitignore +149 -0
- package/src/tasks/init/helper.js +15 -8
- package/src/tasks/init/index.js +115 -35
- package/src/tasks/init/template/.prettierrc.json +4 -1
- package/src/tasks/init/template/.storybook/main.ts +1 -4
- package/src/tasks/init/template/.storybook/manager.ts +1 -1
- package/src/tasks/init/template/.storybook/preview.tsx +2 -2
- package/src/tasks/init/template/.storybook/theme.js +1 -1
- package/src/tasks/init/template/.vscode/extensions.json +0 -1
- package/src/tasks/init/template/README.md +2 -2
- package/src/tasks/init/template/eslint.config.mjs +13 -155
- package/src/tasks/init/template/jest.config.cjs +2 -0
- package/src/tasks/init/template/package-lock.json +26864 -0
- package/src/tasks/init/template/package.json.mustache +19 -74
- package/src/tasks/init/template/setupTests.ts +10 -4
- package/src/tasks/init/template/tsconfig.json +14 -6
- package/src/tasks/internal-test/index.js +21 -0
- package/src/tasks/internal-test-full/index.js +15 -0
- package/src/tasks/internal-test-functional/index.js +15 -0
- package/src/tasks/internal-test-unit/index.js +13 -0
- package/src/tasks/linter/index.js +2 -2
- package/src/tasks/list/helper.js +41 -40
- package/src/tasks/list/index.js +3 -3
- package/src/tasks/list-lib/helper.js +5 -5
- package/src/tasks/list-lib/index.js +8 -8
- package/src/tasks/list-pub/helper.js +23 -16
- package/src/tasks/list-pub/index.js +24 -21
- package/src/tasks/move/helper.js +8 -8
- package/src/tasks/move/index.js +19 -23
- package/src/tasks/promote-webpack/index.js +4 -4
- package/src/tasks/promote-webpack/webpack.config.js +62 -93
- package/src/tasks/publish/helper.js +21 -21
- package/src/tasks/publish/index.js +16 -16
- package/src/tasks/publish-all/helper.js +20 -20
- package/src/tasks/publish-all/index.js +11 -12
- package/src/tasks/publish-archive/helper.js +9 -9
- package/src/tasks/publish-archive/index.js +12 -14
- package/src/tasks/publish-lib/helper.js +3 -3
- package/src/tasks/publish-lib/index.js +28 -34
- package/src/tasks/quarantine/index.js +8 -8
- package/src/tasks/rename/index.js +26 -30
- package/src/tasks/rename-lib/index.js +21 -25
- package/src/tasks/restore/index.js +8 -8
- package/src/tasks/restore-config/index.js +3 -5
- package/src/tasks/set-perm/index.js +8 -8
- package/src/tasks/show-help/index.js +17 -9
- package/src/tasks/show-status/index.js +2 -2
- package/src/tasks/store/index.js +8 -8
- package/src/tasks/switch-lib/helper.js +7 -7
- package/src/tasks/switch-lib/index.js +7 -7
- package/src/tasks/switch-version/helper.js +6 -6
- package/src/tasks/switch-version/index.js +7 -7
- package/src/tasks/update/index.js +1 -1
- package/src/tasks/upgrade/index.js +7 -7
- package/src/tasks/validator/index.js +49 -203
- package/src/util.js +169 -186
- package/src/rules/no-pcore-pconnect-in-presentation.js +0 -103
- package/src/tasks/init/template/.stylelintrc.json +0 -4
- package/src/tasks/init/template/babel.config.cjs +0 -22
- package/src/tasks/init/template/cspell.json +0 -14
|
@@ -12,23 +12,13 @@ import paths from './paths.js';
|
|
|
12
12
|
|
|
13
13
|
const require = createRequire(import.meta.url);
|
|
14
14
|
|
|
15
|
-
// const appPackageJson = require(paths.appPackageJson);
|
|
16
|
-
|
|
17
15
|
// Source maps are resource heavy and can cause out of memory issue for large source files.
|
|
18
16
|
|
|
19
17
|
const compressionBRConfObj = {
|
|
20
18
|
filename: '[path][base].br',
|
|
21
19
|
algorithm: 'brotliCompress',
|
|
22
20
|
test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
|
|
23
|
-
compressionOptions: { level: 11 }
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/* For gzip use below */
|
|
27
|
-
const compressionGZConfObj = {
|
|
28
|
-
filename: '[path][base].gz',
|
|
29
|
-
algorithm: 'gzip',
|
|
30
|
-
test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
|
|
31
|
-
compressionOptions: { level: 9 }
|
|
21
|
+
compressionOptions: { level: 11 },
|
|
32
22
|
};
|
|
33
23
|
|
|
34
24
|
let shouldUseSourceMap = process.env.SOURCE_MAP;
|
|
@@ -46,7 +36,7 @@ const sassModuleRegex = /\.module\.(scss|sass)$/;
|
|
|
46
36
|
export default (
|
|
47
37
|
webpackEnv,
|
|
48
38
|
// eslint-disable-next-line no-unused-vars
|
|
49
|
-
{ inputFile, outputFile, componentKey, externals, globals, sourceMap, devBuild }
|
|
39
|
+
{ inputFile, outputFile, componentKey, externals, globals, sourceMap, devBuild },
|
|
50
40
|
) => {
|
|
51
41
|
const isEnvDevelopment = webpackEnv === 'development' || devBuild;
|
|
52
42
|
const isEnvProduction = webpackEnv === 'production';
|
|
@@ -57,11 +47,11 @@ export default (
|
|
|
57
47
|
const getStyleLoaders = (cssOptions, preProcessor) => {
|
|
58
48
|
const loaders = [
|
|
59
49
|
isEnvProduction && {
|
|
60
|
-
loader: MiniCssExtractPlugin.loader
|
|
50
|
+
loader: MiniCssExtractPlugin.loader,
|
|
61
51
|
},
|
|
62
52
|
{
|
|
63
53
|
loader: require.resolve('css-loader'),
|
|
64
|
-
options: cssOptions
|
|
54
|
+
options: cssOptions,
|
|
65
55
|
},
|
|
66
56
|
{
|
|
67
57
|
// Options for PostCSS as we reference these options twice
|
|
@@ -75,13 +65,13 @@ export default (
|
|
|
75
65
|
'postcss-preset-env',
|
|
76
66
|
{
|
|
77
67
|
// Options
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
]
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
],
|
|
81
71
|
},
|
|
82
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
83
|
-
}
|
|
84
|
-
}
|
|
72
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
85
75
|
].filter(Boolean);
|
|
86
76
|
if (preProcessor) {
|
|
87
77
|
loaders.push(
|
|
@@ -89,15 +79,15 @@ export default (
|
|
|
89
79
|
loader: require.resolve('resolve-url-loader'),
|
|
90
80
|
options: {
|
|
91
81
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
92
|
-
root: paths.appSrc
|
|
93
|
-
}
|
|
82
|
+
root: paths.appSrc,
|
|
83
|
+
},
|
|
94
84
|
},
|
|
95
85
|
{
|
|
96
86
|
loader: require.resolve(preProcessor),
|
|
97
87
|
options: {
|
|
98
|
-
sourceMap: true
|
|
99
|
-
}
|
|
100
|
-
}
|
|
88
|
+
sourceMap: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
101
91
|
);
|
|
102
92
|
}
|
|
103
93
|
return loaders;
|
|
@@ -122,20 +112,16 @@ export default (
|
|
|
122
112
|
library: {
|
|
123
113
|
name: componentKey,
|
|
124
114
|
type: 'umd',
|
|
125
|
-
export: 'default'
|
|
115
|
+
export: 'default',
|
|
126
116
|
},
|
|
127
|
-
publicPath: ''
|
|
117
|
+
publicPath: '',
|
|
128
118
|
},
|
|
129
119
|
optimization: {
|
|
130
120
|
minimize: isEnvProduction,
|
|
131
|
-
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()]
|
|
121
|
+
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
|
|
132
122
|
},
|
|
133
123
|
resolve: {
|
|
134
|
-
|
|
135
|
-
extensions: ['.tsx', '.ts', '.js']
|
|
136
|
-
},
|
|
137
|
-
resolveLoader: {
|
|
138
|
-
plugins: []
|
|
124
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
139
125
|
},
|
|
140
126
|
module: {
|
|
141
127
|
strictExportPresence: true,
|
|
@@ -153,8 +139,8 @@ export default (
|
|
|
153
139
|
options: {
|
|
154
140
|
limit: imageInlineSizeLimit,
|
|
155
141
|
mimetype: 'image/avif',
|
|
156
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
157
|
-
}
|
|
142
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
143
|
+
},
|
|
158
144
|
},
|
|
159
145
|
// "url" loader works like "file" loader except that it embeds assets
|
|
160
146
|
// smaller than specified limit in bytes as data URLs to avoid requests.
|
|
@@ -164,8 +150,8 @@ export default (
|
|
|
164
150
|
loader: require.resolve('url-loader'),
|
|
165
151
|
options: {
|
|
166
152
|
limit: imageInlineSizeLimit,
|
|
167
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
168
|
-
}
|
|
153
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
154
|
+
},
|
|
169
155
|
},
|
|
170
156
|
// Process application JS with TS-Loader.
|
|
171
157
|
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
|
|
@@ -174,18 +160,18 @@ export default (
|
|
|
174
160
|
include: paths.appSrc,
|
|
175
161
|
loader: 'ts-loader',
|
|
176
162
|
options: {
|
|
177
|
-
configFile: 'tsconfig.build.json'
|
|
163
|
+
configFile: 'tsconfig.build.json',
|
|
178
164
|
},
|
|
179
|
-
exclude: /node_modules
|
|
165
|
+
exclude: /node_modules/,
|
|
180
166
|
},
|
|
181
167
|
|
|
182
168
|
{
|
|
183
169
|
test: /\.(ts|tsx)$/,
|
|
184
170
|
loader: 'ts-loader',
|
|
185
171
|
options: {
|
|
186
|
-
configFile: 'tsconfig.build.json'
|
|
172
|
+
configFile: 'tsconfig.build.json',
|
|
187
173
|
},
|
|
188
|
-
exclude: /node_modules
|
|
174
|
+
exclude: /node_modules/,
|
|
189
175
|
},
|
|
190
176
|
// "postcss" loader applies autoprefixer to our CSS.
|
|
191
177
|
// "css" loader resolves paths in CSS and adds assets as dependencies.
|
|
@@ -199,13 +185,13 @@ export default (
|
|
|
199
185
|
exclude: cssModuleRegex,
|
|
200
186
|
use: getStyleLoaders({
|
|
201
187
|
importLoaders: 1,
|
|
202
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
188
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
203
189
|
}),
|
|
204
190
|
// Don't consider CSS imports dead code even if the
|
|
205
191
|
// containing package claims to have no side effects.
|
|
206
192
|
// Remove this when webpack adds a warning or an error for this.
|
|
207
193
|
// See https://github.com/webpack/webpack/issues/6571
|
|
208
|
-
sideEffects: true
|
|
194
|
+
sideEffects: true,
|
|
209
195
|
},
|
|
210
196
|
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
|
|
211
197
|
// using the extension .module.css
|
|
@@ -215,9 +201,9 @@ export default (
|
|
|
215
201
|
importLoaders: 1,
|
|
216
202
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
217
203
|
modules: {
|
|
218
|
-
getLocalIdent: getCSSModuleLocalIdent
|
|
219
|
-
}
|
|
220
|
-
})
|
|
204
|
+
getLocalIdent: getCSSModuleLocalIdent,
|
|
205
|
+
},
|
|
206
|
+
}),
|
|
221
207
|
},
|
|
222
208
|
// Opt-in support for SASS (using .scss or .sass extensions).
|
|
223
209
|
// By default we support SASS Modules with the
|
|
@@ -228,15 +214,15 @@ export default (
|
|
|
228
214
|
use: getStyleLoaders(
|
|
229
215
|
{
|
|
230
216
|
importLoaders: 3,
|
|
231
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
217
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
232
218
|
},
|
|
233
|
-
'sass-loader'
|
|
219
|
+
'sass-loader',
|
|
234
220
|
),
|
|
235
221
|
// Don't consider CSS imports dead code even if the
|
|
236
222
|
// containing package claims to have no side effects.
|
|
237
223
|
// Remove this when webpack adds a warning or an error for this.
|
|
238
224
|
// See https://github.com/webpack/webpack/issues/6571
|
|
239
|
-
sideEffects: true
|
|
225
|
+
sideEffects: true,
|
|
240
226
|
},
|
|
241
227
|
// Adds support for CSS Modules, but using SASS
|
|
242
228
|
// using the extension .module.scss or .module.sass
|
|
@@ -247,11 +233,11 @@ export default (
|
|
|
247
233
|
importLoaders: 3,
|
|
248
234
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
249
235
|
modules: {
|
|
250
|
-
getLocalIdent: getCSSModuleLocalIdent
|
|
251
|
-
}
|
|
236
|
+
getLocalIdent: getCSSModuleLocalIdent,
|
|
237
|
+
},
|
|
252
238
|
},
|
|
253
|
-
'sass-loader'
|
|
254
|
-
)
|
|
239
|
+
'sass-loader',
|
|
240
|
+
),
|
|
255
241
|
},
|
|
256
242
|
// "file" loader makes sure those assets get served by WebpackDevServer.
|
|
257
243
|
// When you `import` an asset, you get its (virtual) filename.
|
|
@@ -266,14 +252,14 @@ export default (
|
|
|
266
252
|
// by webpack's internal loaders.
|
|
267
253
|
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
|
|
268
254
|
options: {
|
|
269
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
270
|
-
}
|
|
271
|
-
}
|
|
255
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
272
258
|
// ** STOP ** Are you adding a new loader?
|
|
273
259
|
// Make sure to add the new loader(s) before the "file" loader.
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
]
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
277
263
|
},
|
|
278
264
|
plugins: [
|
|
279
265
|
// This gives some necessary context to module not found errors, such as
|
|
@@ -286,14 +272,14 @@ export default (
|
|
|
286
272
|
// Otherwise React will be compiled in the very slow development mode.
|
|
287
273
|
isEnvProduction &&
|
|
288
274
|
new webpack.DefinePlugin({
|
|
289
|
-
PRODUCTION: JSON.stringify(true)
|
|
275
|
+
PRODUCTION: JSON.stringify(true),
|
|
290
276
|
}),
|
|
291
277
|
isEnvProduction &&
|
|
292
278
|
new MiniCssExtractPlugin({
|
|
293
279
|
// Options similar to the same options in webpackOptions.output
|
|
294
280
|
// both options are optional
|
|
295
281
|
filename: `${componentKey}/css/${componentKey}.[contenthash:8].css`,
|
|
296
|
-
chunkFilename: `${componentKey}/css/${componentKey}.[contenthash:8].chunk.css
|
|
282
|
+
chunkFilename: `${componentKey}/css/${componentKey}.[contenthash:8].chunk.css`,
|
|
297
283
|
}),
|
|
298
284
|
// Moment.js is an extremely popular library that bundles large locale files
|
|
299
285
|
// by default due to how webpack interprets its code. This is a practical
|
|
@@ -302,44 +288,44 @@ export default (
|
|
|
302
288
|
// You can remove this if you don't use Moment.js:
|
|
303
289
|
new webpack.IgnorePlugin({
|
|
304
290
|
resourceRegExp: /^\.\/locale$/,
|
|
305
|
-
contextRegExp: /moment
|
|
291
|
+
contextRegExp: /moment$/,
|
|
306
292
|
}),
|
|
307
293
|
/* cosmos 4.x and below */
|
|
308
294
|
/* Ignore cosmos icons */
|
|
309
295
|
new webpack.IgnorePlugin({
|
|
310
296
|
resourceRegExp: /^\.\/icons$/,
|
|
311
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
297
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
312
298
|
}),
|
|
313
299
|
|
|
314
300
|
/* Ignore cosmos icons - windows */
|
|
315
301
|
new webpack.IgnorePlugin({
|
|
316
302
|
resourceRegExp: /^\.\/icons$/,
|
|
317
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
303
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
318
304
|
}),
|
|
319
305
|
|
|
320
306
|
/* Ignore cosmos streamline-icons */
|
|
321
307
|
new webpack.IgnorePlugin({
|
|
322
308
|
resourceRegExp: /^\.\/streamline-icons$/,
|
|
323
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
309
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
324
310
|
}),
|
|
325
311
|
|
|
326
312
|
/* Ignore cosmos streamline-icons - windows */
|
|
327
313
|
new webpack.IgnorePlugin({
|
|
328
314
|
resourceRegExp: /^\.\/streamline-icons$/,
|
|
329
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
315
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
330
316
|
}),
|
|
331
317
|
|
|
332
318
|
/* cosmos 6.x and above */
|
|
333
319
|
/* Ignore cosmos icons */
|
|
334
320
|
new webpack.IgnorePlugin({
|
|
335
321
|
resourceRegExp: /^\.\/.*\/.*\.icon$/,
|
|
336
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
322
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
337
323
|
}),
|
|
338
324
|
|
|
339
325
|
/* Ignore cosmos icons - windows */
|
|
340
326
|
new webpack.IgnorePlugin({
|
|
341
327
|
resourceRegExp: /^\.\/.*\/.*\.icon$/,
|
|
342
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
328
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
343
329
|
}),
|
|
344
330
|
|
|
345
331
|
// This configuration works on both Windows and Unix-like systems (Linux, macOS).
|
|
@@ -354,25 +340,22 @@ export default (
|
|
|
354
340
|
new webpack.ContextReplacementPlugin(new RegExp('@pega[\\\\/]cosmos-react-core[\\\\/]lib[\\\\/]components[\\\\/]Icon$'), /^$/),
|
|
355
341
|
new webpack.ContextReplacementPlugin(
|
|
356
342
|
new RegExp('@pega[\\\\/]cosmos-react-core[\\\\/]lib[\\\\/]components[\\\\/]Icon[\\\\/]streamline-icons$'),
|
|
357
|
-
|
|
343
|
+
/^$/,
|
|
358
344
|
),
|
|
359
345
|
|
|
360
346
|
new webpack.optimize.LimitChunkCountPlugin({
|
|
361
|
-
maxChunks: 1
|
|
347
|
+
maxChunks: 1,
|
|
362
348
|
}),
|
|
363
349
|
new webpack.optimize.MinChunkSizePlugin({
|
|
364
|
-
minChunkSize: 100000 // Minimum number of characters
|
|
350
|
+
minChunkSize: 100000, // Minimum number of characters
|
|
365
351
|
}),
|
|
366
|
-
!devBuild && new CompressionPlugin(compressionBRConfObj)
|
|
367
|
-
|
|
368
|
-
/* Dont generate gzip file */
|
|
369
|
-
/* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
|
|
352
|
+
!devBuild && new CompressionPlugin(compressionBRConfObj),
|
|
370
353
|
].filter(Boolean),
|
|
371
354
|
performance: {
|
|
372
355
|
hints: false,
|
|
373
356
|
maxEntrypointSize: 512000,
|
|
374
|
-
maxAssetSize: 512000
|
|
357
|
+
maxAssetSize: 512000,
|
|
375
358
|
},
|
|
376
|
-
externals
|
|
359
|
+
externals,
|
|
377
360
|
};
|
|
378
361
|
};
|
|
@@ -16,13 +16,13 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = tr
|
|
|
16
16
|
|
|
17
17
|
const idx = (
|
|
18
18
|
await Promise.all(
|
|
19
|
-
extensions.map(ext =>
|
|
19
|
+
extensions.map((ext) =>
|
|
20
20
|
stat(path.join(componentDirectory, `index.${ext}`))
|
|
21
21
|
.then(() => true)
|
|
22
|
-
.catch(() => false)
|
|
23
|
-
)
|
|
22
|
+
.catch(() => false),
|
|
23
|
+
),
|
|
24
24
|
)
|
|
25
|
-
).findIndex(exists => exists);
|
|
25
|
+
).findIndex((exists) => exists);
|
|
26
26
|
|
|
27
27
|
if (idx === -1) throw new Error('Index file not found.');
|
|
28
28
|
|
|
@@ -35,12 +35,12 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = tr
|
|
|
35
35
|
buildConfig = JSON.parse(fs.readFileSync(BUILD_CONFIG_JSON_FILENAME, 'utf8'));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
let externals
|
|
38
|
+
let externals;
|
|
39
39
|
externals = {
|
|
40
40
|
react: 'React',
|
|
41
41
|
'react-dom': 'ReactDOM',
|
|
42
42
|
PCore: 'PCore',
|
|
43
|
-
...buildConfig.externals
|
|
43
|
+
...buildConfig.externals,
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
let globals = buildConfig.globals || {};
|
|
@@ -49,7 +49,7 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = tr
|
|
|
49
49
|
react: 'React',
|
|
50
50
|
'react-dom': 'ReactDOM',
|
|
51
51
|
PCore: 'PCore',
|
|
52
|
-
...buildConfig.globals
|
|
52
|
+
...buildConfig.globals,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
globals = { ...globals, ...defaultGlobals };
|
|
@@ -61,7 +61,7 @@ const bundleComponent = async (componentKey, sourceMap, devBuild, showStats = tr
|
|
|
61
61
|
globals,
|
|
62
62
|
sourceMap,
|
|
63
63
|
devBuild,
|
|
64
|
-
showStats
|
|
64
|
+
showStats,
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { URL, fileURLToPath } from 'url';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import { promisify } from 'util';
|
|
5
4
|
|
|
6
5
|
import inquirer from 'inquirer';
|
|
7
|
-
import ncp from 'ncp';
|
|
8
6
|
import chalk from 'chalk';
|
|
9
7
|
|
|
10
8
|
import {
|
|
@@ -28,21 +26,23 @@ import {
|
|
|
28
26
|
getMaxComponentNameCount,
|
|
29
27
|
getStandaloneMaxLibraryCount,
|
|
30
28
|
getStandaloneMaxComponentNameCount,
|
|
31
|
-
getStandaloneMaxLibraryFromPrefixCount
|
|
29
|
+
getStandaloneMaxLibraryFromPrefixCount,
|
|
32
30
|
} from '../../util.js';
|
|
33
31
|
import { COMPONENT_SCHEMA, SHARED_FILE_NAMES } from '../../constants.js';
|
|
34
32
|
|
|
35
|
-
const copy =
|
|
33
|
+
const copy = fs.promises.cp;
|
|
36
34
|
|
|
37
|
-
const copyComponentTemplate = async options => {
|
|
35
|
+
const copyComponentTemplate = async (options) => {
|
|
38
36
|
return copy(options.templateDirectory, options.targetDirectory, {
|
|
39
|
-
|
|
37
|
+
recursive: true,
|
|
38
|
+
force: false,
|
|
39
|
+
errorOnExist: false,
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const compileMustacheTemplates = async (
|
|
44
44
|
componentDirectory,
|
|
45
|
-
{ componentKey, componentName, componentLabel, library, version, type, subtype, description, organization }
|
|
45
|
+
{ componentKey, componentName, componentLabel, library, version, type, subtype, description, organization },
|
|
46
46
|
) => {
|
|
47
47
|
const files = fs.readdirSync(componentDirectory);
|
|
48
48
|
const componentClassName = convertIntoPascalCase(componentKey);
|
|
@@ -92,7 +92,7 @@ const compileMustacheTemplates = async (
|
|
|
92
92
|
// }
|
|
93
93
|
|
|
94
94
|
// allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
|
|
95
|
-
files.forEach(file => {
|
|
95
|
+
files.forEach((file) => {
|
|
96
96
|
const filePath = path.join(componentDirectory, file);
|
|
97
97
|
|
|
98
98
|
const subTypeLabel = getSubTypeLabel(type, subtype);
|
|
@@ -112,7 +112,7 @@ const compileMustacheTemplates = async (
|
|
|
112
112
|
IS_TEMPLATE: isTemplate,
|
|
113
113
|
IS_PICKLIST: isPicklist,
|
|
114
114
|
IS_BOOLEAN: isBool,
|
|
115
|
-
IS_PHONE: isPhone
|
|
115
|
+
IS_PHONE: isPhone,
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
const realFileName = file.replace('.mustache', '');
|
|
@@ -216,7 +216,7 @@ const validateCompile = async ({ componentName, componentLabel, library, version
|
|
|
216
216
|
await copyComponentTemplate({
|
|
217
217
|
...options,
|
|
218
218
|
targetDirectory,
|
|
219
|
-
templateDirectory
|
|
219
|
+
templateDirectory,
|
|
220
220
|
});
|
|
221
221
|
await compileMustacheTemplates(targetDirectory, {
|
|
222
222
|
componentKey,
|
|
@@ -227,13 +227,13 @@ const validateCompile = async ({ componentName, componentLabel, library, version
|
|
|
227
227
|
type,
|
|
228
228
|
subtype,
|
|
229
229
|
description,
|
|
230
|
-
organization
|
|
230
|
+
organization,
|
|
231
231
|
});
|
|
232
232
|
|
|
233
233
|
console.log(chalk.green(`${componentKey} component is created in ${targetDirectory}`));
|
|
234
234
|
};
|
|
235
235
|
|
|
236
|
-
export default async options => {
|
|
236
|
+
export default async (options) => {
|
|
237
237
|
await showVersion();
|
|
238
238
|
|
|
239
239
|
await checkLibraryAndArchives();
|
|
@@ -262,9 +262,9 @@ export default async options => {
|
|
|
262
262
|
type,
|
|
263
263
|
subtype,
|
|
264
264
|
description,
|
|
265
|
-
organization
|
|
265
|
+
organization,
|
|
266
266
|
},
|
|
267
|
-
options
|
|
267
|
+
options,
|
|
268
268
|
);
|
|
269
269
|
} else {
|
|
270
270
|
const framework = 'Constellation';
|
|
@@ -277,7 +277,7 @@ export default async options => {
|
|
|
277
277
|
type: 'rawlist',
|
|
278
278
|
message: 'Enter type of component',
|
|
279
279
|
default: componentDefaults.type,
|
|
280
|
-
choices: COMPONENT_SCHEMA.type
|
|
280
|
+
choices: COMPONENT_SCHEMA.type,
|
|
281
281
|
},
|
|
282
282
|
{
|
|
283
283
|
name: 'subtype',
|
|
@@ -287,7 +287,7 @@ export default async options => {
|
|
|
287
287
|
choices: COMPONENT_SCHEMA.subtype.field,
|
|
288
288
|
when(answers) {
|
|
289
289
|
return answers.type === 'Field';
|
|
290
|
-
}
|
|
290
|
+
},
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
name: 'subtype',
|
|
@@ -297,7 +297,7 @@ export default async options => {
|
|
|
297
297
|
choices: COMPONENT_SCHEMA.subtype.template,
|
|
298
298
|
when(answers) {
|
|
299
299
|
return answers.type === 'Template';
|
|
300
|
-
}
|
|
300
|
+
},
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
303
|
name: 'subtype',
|
|
@@ -308,13 +308,13 @@ export default async options => {
|
|
|
308
308
|
when(answers) {
|
|
309
309
|
return answers.type === 'Widget';
|
|
310
310
|
},
|
|
311
|
-
validate: value => {
|
|
311
|
+
validate: (value) => {
|
|
312
312
|
/* value should not be empty */
|
|
313
313
|
if (Array.isArray(value) && value.length) {
|
|
314
314
|
return true;
|
|
315
315
|
}
|
|
316
316
|
return 'Please select subtype';
|
|
317
|
-
}
|
|
317
|
+
},
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
name: 'subtype',
|
|
@@ -324,18 +324,18 @@ export default async options => {
|
|
|
324
324
|
choices: COMPONENT_SCHEMA.subtype.presentation,
|
|
325
325
|
when(answers) {
|
|
326
326
|
return answers.type === 'Presentation';
|
|
327
|
-
}
|
|
327
|
+
},
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
330
|
name: 'componentName',
|
|
331
|
-
message: value => {
|
|
331
|
+
message: (value) => {
|
|
332
332
|
if (serverType === 'launchpad') {
|
|
333
333
|
return `Enter component name (required)`;
|
|
334
334
|
} else {
|
|
335
335
|
return `Enter component name (required) (${maxChars} max chars)`;
|
|
336
336
|
}
|
|
337
337
|
},
|
|
338
|
-
validate: value => {
|
|
338
|
+
validate: (value) => {
|
|
339
339
|
/* value should not be empty
|
|
340
340
|
It should not have spaces
|
|
341
341
|
It should not start with a number
|
|
@@ -349,30 +349,30 @@ export default async options => {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
return 'Only alphanumeric values are allowed, starting with alphabets, no spaces.';
|
|
352
|
-
}
|
|
352
|
+
},
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
355
|
name: 'componentLabel',
|
|
356
356
|
message: 'Enter component label for display (required)',
|
|
357
|
-
validate: value => {
|
|
357
|
+
validate: (value) => {
|
|
358
358
|
if (value) {
|
|
359
359
|
return true;
|
|
360
360
|
}
|
|
361
361
|
return 'Please provide value for label';
|
|
362
|
-
}
|
|
362
|
+
},
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
365
|
name: 'version',
|
|
366
366
|
message: 'Enter component version',
|
|
367
367
|
default: componentDefaults.version,
|
|
368
|
-
validate: value => {
|
|
368
|
+
validate: (value) => {
|
|
369
369
|
if (validateSemver(value)) {
|
|
370
370
|
return true;
|
|
371
371
|
}
|
|
372
372
|
return 'Please provide semver compatible version e.g 0.0.1';
|
|
373
373
|
},
|
|
374
|
-
when: () => !isLibraryBased
|
|
375
|
-
}
|
|
374
|
+
when: () => !isLibraryBased,
|
|
375
|
+
},
|
|
376
376
|
];
|
|
377
377
|
|
|
378
378
|
const answers = await inquirer.prompt(questions);
|
|
@@ -381,7 +381,7 @@ export default async options => {
|
|
|
381
381
|
const libQuestions = [
|
|
382
382
|
{
|
|
383
383
|
name: 'library',
|
|
384
|
-
message: value => {
|
|
384
|
+
message: (value) => {
|
|
385
385
|
if (serverType === 'launchpad') {
|
|
386
386
|
return `Enter library name (required)`;
|
|
387
387
|
} else {
|
|
@@ -389,7 +389,7 @@ export default async options => {
|
|
|
389
389
|
}
|
|
390
390
|
},
|
|
391
391
|
default: componentDefaults.library,
|
|
392
|
-
validate: value => {
|
|
392
|
+
validate: (value) => {
|
|
393
393
|
/* value should not be empty
|
|
394
394
|
It should not have spaces
|
|
395
395
|
It should not start with a number
|
|
@@ -403,13 +403,13 @@ export default async options => {
|
|
|
403
403
|
}
|
|
404
404
|
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
405
405
|
},
|
|
406
|
-
when: () => !isLibraryBased
|
|
406
|
+
when: () => !isLibraryBased,
|
|
407
407
|
},
|
|
408
408
|
{
|
|
409
409
|
name: 'description',
|
|
410
410
|
message: 'Enter description for the component (default is label)',
|
|
411
|
-
default: componentDefaults.description
|
|
412
|
-
}
|
|
411
|
+
default: componentDefaults.description,
|
|
412
|
+
},
|
|
413
413
|
];
|
|
414
414
|
|
|
415
415
|
const libAnswers = await inquirer.prompt(libQuestions);
|
|
@@ -423,9 +423,9 @@ export default async options => {
|
|
|
423
423
|
framework,
|
|
424
424
|
type: answers.type,
|
|
425
425
|
subtype: answers.subtype,
|
|
426
|
-
description: libAnswers.description
|
|
426
|
+
description: libAnswers.description,
|
|
427
427
|
},
|
|
428
|
-
options
|
|
428
|
+
options,
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkbox as CosmosCheckbox,
|
|
3
3
|
CheckboxGroup,
|
|
4
|
-
|
|
5
|
-
Text,
|
|
6
|
-
withConfiguration,
|
|
4
|
+
withConfiguration,
|
|
7
5
|
BooleanDisplay
|
|
8
6
|
} from "@pega/cosmos-react-core";
|
|
9
7
|
|
|
@@ -53,7 +51,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
53
51
|
testId,
|
|
54
52
|
additionalProps = {},
|
|
55
53
|
displayMode,
|
|
56
|
-
variant = 'inline',
|
|
57
54
|
trueLabel,
|
|
58
55
|
falseLabel
|
|
59
56
|
} = props;
|
|
@@ -110,39 +107,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
110
107
|
);
|
|
111
108
|
}
|
|
112
109
|
|
|
113
|
-
if (displayMode === "LABELS_LEFT") {
|
|
114
|
-
return (
|
|
115
|
-
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
116
|
-
<FieldValueList
|
|
117
|
-
variant={hideLabel ? 'stacked' : variant}
|
|
118
|
-
data-testid={testId}
|
|
119
|
-
fields={[{ id: '1', name: hideLabel ? '' : caption, value: displayComponent }]}
|
|
120
|
-
/>
|
|
121
|
-
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
110
|
|
|
125
|
-
if (displayMode === "STACKED_LARGE_VAL") {
|
|
126
|
-
return (
|
|
127
|
-
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
128
|
-
<FieldValueList
|
|
129
|
-
variant='stacked'
|
|
130
|
-
data-testid={testId}
|
|
131
|
-
fields={[
|
|
132
|
-
{
|
|
133
|
-
id: '2',
|
|
134
|
-
name: hideLabel ? '' : caption,
|
|
135
|
-
value: (
|
|
136
|
-
<Text variant='h1' as='span'>
|
|
137
|
-
{displayComponent}
|
|
138
|
-
</Text>
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
]}
|
|
142
|
-
/>
|
|
143
|
-
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
111
|
|
|
147
112
|
|
|
148
113
|
return (
|