@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
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"deleteAll": "custom-dx-components deleteAll",
|
|
27
27
|
"importComponent": "custom-dx-components importComponent",
|
|
28
28
|
"help": "custom-dx-components showHelp",
|
|
29
|
+
"enableAi": "custom-dx-components enableAi",
|
|
30
|
+
"disableAi": "custom-dx-components disableAi",
|
|
29
31
|
"publish": "custom-dx-components publish",
|
|
30
32
|
"_***Component_mode_only***": "Component only commands",
|
|
31
33
|
"publishAll": "custom-dx-components publishAll",
|
|
@@ -53,27 +55,8 @@
|
|
|
53
55
|
"exportLibVersion": "custom-dx-components exportArchive",
|
|
54
56
|
"validate": "custom-dx-components buildComponent",
|
|
55
57
|
"validateAll": "custom-dx-components buildAllComponents",
|
|
56
|
-
"_***Internal_only***": "Internal usage only",
|
|
57
|
-
"_internal-test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
|
|
58
|
-
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run _internal-test-full; fi ",
|
|
59
|
-
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
60
|
-
"_internal-test-functional": "echo 'Make sure you authenticate!!' && npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
61
|
-
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
|
|
62
|
-
"_internal-build-jest-assets": "custom-dx-components buildJestAssets",
|
|
63
|
-
"_internal-buildLibrary": "custom-dx-components buildLibrary",
|
|
64
|
-
"_internal-publishLibrary": "custom-dx-components publishLibrary",
|
|
65
|
-
"_internal-restoreConfig": "custom-dx-components restoreConfig",
|
|
66
|
-
"_internal-test-quarantine": "custom-dx-components quarantine",
|
|
67
|
-
"_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
68
58
|
"_lint:format": "prettier -c .",
|
|
69
|
-
"_lint:spelling": "cspell --no-progress **/*",
|
|
70
59
|
"_lint:types": "tsc --noEmit"
|
|
71
|
-
},
|
|
72
|
-
"scriptsComments": {
|
|
73
|
-
"build": "tsc -b tsconfig.build.json",
|
|
74
|
-
"fix": "run-p -cl fix:*",
|
|
75
|
-
"fix:es": "eslint --fix .",
|
|
76
|
-
"fix:format": "prettier -w ."
|
|
77
60
|
},
|
|
78
61
|
"repository": {
|
|
79
62
|
"type": "git",
|
|
@@ -87,78 +70,40 @@
|
|
|
87
70
|
"@pega/cosmos-react-core": "~9.5.5-8",
|
|
88
71
|
"@pega/cosmos-react-work": "~9.5.5-8",
|
|
89
72
|
"@pega/cosmos-react-wss": "~9.5.5-8",
|
|
90
|
-
"@pega/eslint-config": "^0.16.3",
|
|
91
|
-
"@pega/tsconfig": "^0.16.3",
|
|
92
|
-
"babel-loader": "^10.0.0",
|
|
93
73
|
"dayjs": "^1.11.13",
|
|
94
|
-
"fast-deep-equal": "3.1.3",
|
|
95
74
|
"lodash": "^4.17.21",
|
|
96
|
-
"lodash.get": "^4.4.2",
|
|
97
|
-
"npm": "^10.8.1",
|
|
98
75
|
"react": "^18.3.1",
|
|
99
|
-
"react-autosuggest": "^10.1.0",
|
|
100
76
|
"react-dom": "^18.3.1",
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
77
|
+
"styled-components": "~6.3.12"
|
|
78
|
+
},
|
|
79
|
+
"overrides": {
|
|
80
|
+
"glob": "^13.0.0",
|
|
81
|
+
"postcss": "^8.5.23"
|
|
106
82
|
},
|
|
107
83
|
"devDependencies": {
|
|
108
|
-
"@
|
|
109
|
-
"@
|
|
110
|
-
"@
|
|
111
|
-
"@pega/configs": "^0.16.3",
|
|
112
|
-
"@pega/custom-dx-components": "~26.1.11",
|
|
84
|
+
"@eslint-react/eslint-plugin": "^5.22.1",
|
|
85
|
+
"@eslint/js": "^10.0.1",
|
|
86
|
+
"@pega/custom-dx-components": "~26.1.12-alpha.0.2",
|
|
113
87
|
"@pega/pcore-pconnect-typedefs": "^5.1.0",
|
|
114
|
-
"@storybook/addon-
|
|
115
|
-
"@storybook/
|
|
116
|
-
"@storybook/
|
|
117
|
-
"@storybook/addon-storysource": "^9.0.0-alpha.14",
|
|
118
|
-
"@storybook/manager-api": "^9.0.0-alpha.1",
|
|
119
|
-
"@storybook/react": "^9.1.7",
|
|
120
|
-
"@storybook/react-vite": "^9.1.7",
|
|
121
|
-
"@storybook/react-webpack5": "^9.1.7",
|
|
122
|
-
"@storybook/test": "^9.0.0-alpha.2",
|
|
123
|
-
"@storybook/test-runner": "^0.22.0",
|
|
124
|
-
"@storybook/theming": "^9.0.0-alpha.1",
|
|
88
|
+
"@storybook/addon-links": "^10.6.0",
|
|
89
|
+
"@storybook/react": "^10.6.0",
|
|
90
|
+
"@storybook/react-vite": "^10.6.0",
|
|
125
91
|
"@testing-library/dom": "^10.4.0",
|
|
126
92
|
"@testing-library/jest-dom": "^6.6.3",
|
|
127
93
|
"@testing-library/react": "^16.3.0",
|
|
128
|
-
"@types/emoji-mart": "^3.0.14",
|
|
129
94
|
"@types/jest": "^29.5.14",
|
|
130
|
-
"@types/lodash
|
|
95
|
+
"@types/lodash": "^4.17.25",
|
|
131
96
|
"@types/react": "^18.3.21",
|
|
132
|
-
"@types/react-color": "^3.0.13",
|
|
133
97
|
"@types/react-dom": "^18.3.7",
|
|
134
|
-
"
|
|
135
|
-
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
136
|
-
"@typescript-eslint/parser": "^8.44.1",
|
|
137
|
-
"core-js": "^3.42.0",
|
|
138
|
-
"eslint": "^9.27.0",
|
|
139
|
-
"eslint-plugin-import": "^2.31.0",
|
|
140
|
-
"eslint-plugin-jest": "^28.11.0",
|
|
141
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
142
|
-
"eslint-plugin-mdx": "^3.4.1",
|
|
143
|
-
"eslint-plugin-prettier": "^5.4.0",
|
|
144
|
-
"eslint-plugin-react": "^7.37.5",
|
|
145
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
146
|
-
"eslint-plugin-sonarjs": "^0.23.0",
|
|
147
|
-
"eslint-plugin-storybook": "^0.6.15",
|
|
148
|
-
"esm": "^3.2.25",
|
|
98
|
+
"eslint": "^10.11.0",
|
|
149
99
|
"jest": "^29.7.0",
|
|
150
100
|
"jest-canvas-mock": "^2.5.2",
|
|
151
101
|
"jest-environment-jsdom": "^29.7.0",
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"node-stream-zip": "^1.15.0",
|
|
155
|
-
"npm-run-all": "^4.1.5",
|
|
156
|
-
"prettier": "3.5.3",
|
|
157
|
-
"storybook": "^9.1.7",
|
|
158
|
-
"stylelint": "^16.19.1",
|
|
102
|
+
"prettier": "3.9.9",
|
|
103
|
+
"storybook": "^10.6.0",
|
|
159
104
|
"ts-jest": "^29.3.2",
|
|
160
|
-
"typescript": "~5.
|
|
161
|
-
"typescript-eslint": "^8.
|
|
105
|
+
"typescript": "~5.9.3",
|
|
106
|
+
"typescript-eslint": "^8.70.1",
|
|
162
107
|
"vite": "^6.3.5"
|
|
163
108
|
}
|
|
164
109
|
}
|
|
@@ -5,6 +5,12 @@ import 'jest-canvas-mock';
|
|
|
5
5
|
// Wait time needed
|
|
6
6
|
const TIMEOUT = 300000;
|
|
7
7
|
|
|
8
|
+
// jsdom has no CSS Custom Highlight API, which @pega/cosmos-react-core references at import time
|
|
9
|
+
const TestHighlight = function TestHighlight() {};
|
|
10
|
+
TestHighlight.prototype.add = () => undefined;
|
|
11
|
+
TestHighlight.prototype.delete = () => undefined;
|
|
12
|
+
Object.assign(globalThis, { Highlight: TestHighlight });
|
|
13
|
+
|
|
8
14
|
// mocks open
|
|
9
15
|
global.open = jest.fn();
|
|
10
16
|
|
|
@@ -92,8 +98,8 @@ Object.defineProperty(window, 'matchMedia', {
|
|
|
92
98
|
// }))
|
|
93
99
|
// });
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
jest.setTimeout(TIMEOUT);
|
|
96
102
|
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
|
|
103
|
+
// speeds up *ByRole queries a bit
|
|
104
|
+
// https://github.com/testing-library/dom-testing-library/issues/552
|
|
105
|
+
configure({ defaultHidden: true });
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@pega/tsconfig/index.json",
|
|
3
2
|
"include": ["./**/*", ".storybook/**/*"],
|
|
4
3
|
"exclude": ["**/*.mjs"],
|
|
5
4
|
"compilerOptions": {
|
|
5
|
+
"strict": true,
|
|
6
|
+
"noImplicitOverride": true,
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"newLine": "lf",
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
|
16
|
+
"target": "ES2024",
|
|
6
17
|
"noEmit": true,
|
|
7
18
|
"allowJs": true,
|
|
8
|
-
"importsNotUsedAsValues": "remove",
|
|
9
19
|
"skipLibCheck": true,
|
|
10
|
-
"baseUrl": "./",
|
|
11
20
|
"paths": {
|
|
12
|
-
"@pega/pcore-pconnect-typedefs/*": ["node_modules/@pega/pcore-pconnect-typedefs/*"]
|
|
21
|
+
"@pega/pcore-pconnect-typedefs/*": ["./node_modules/@pega/pcore-pconnect-typedefs/*"]
|
|
13
22
|
},
|
|
14
23
|
"esModuleInterop": true,
|
|
15
|
-
"types": ["jest", "node"
|
|
16
|
-
"verbatimModuleSyntax": false
|
|
24
|
+
"types": ["jest", "node"]
|
|
17
25
|
}
|
|
18
26
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
|
|
4
|
+
import { addDebugLog } from '../../util.js';
|
|
5
|
+
import { assertInternalTestsAvailable } from '../../internal-tests.js';
|
|
6
|
+
import internalTestFull from '../internal-test-full/index.js';
|
|
7
|
+
|
|
8
|
+
export default async () => {
|
|
9
|
+
addDebugLog('internalTest', '', '+');
|
|
10
|
+
|
|
11
|
+
assertInternalTestsAvailable();
|
|
12
|
+
|
|
13
|
+
console.log(chalk.yellow('Running functional and unit tests will DELETE existing local components.'));
|
|
14
|
+
const { proceed } = await inquirer.prompt([{ name: 'proceed', type: 'confirm', message: 'Proceed?', default: false }]);
|
|
15
|
+
|
|
16
|
+
if (proceed) {
|
|
17
|
+
await internalTestFull();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
addDebugLog('internalTest', 'END', '-');
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { addDebugLog } from '../../util.js';
|
|
2
|
+
import { assertInternalTestsAvailable } from '../../internal-tests.js';
|
|
3
|
+
import internalTestFunctional from '../internal-test-functional/index.js';
|
|
4
|
+
import internalTestUnit from '../internal-test-unit/index.js';
|
|
5
|
+
|
|
6
|
+
export default async () => {
|
|
7
|
+
addDebugLog('internalTestFull', '', '+');
|
|
8
|
+
|
|
9
|
+
assertInternalTestsAvailable();
|
|
10
|
+
|
|
11
|
+
await internalTestFunctional();
|
|
12
|
+
await internalTestUnit();
|
|
13
|
+
|
|
14
|
+
addDebugLog('internalTestFull', 'END', '-');
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
|
|
4
|
+
import { addDebugLog } from '../../util.js';
|
|
5
|
+
import { assertInternalTestsAvailable } from '../../internal-tests.js';
|
|
6
|
+
|
|
7
|
+
export default async () => {
|
|
8
|
+
addDebugLog('internalTestFunctional', '', '+');
|
|
9
|
+
|
|
10
|
+
const cwd = assertInternalTestsAvailable();
|
|
11
|
+
console.log(chalk.yellow('Make sure you authenticate!!'));
|
|
12
|
+
await execa('npm', ['run', 'test:functional:local'], { cwd, stdio: 'inherit' });
|
|
13
|
+
|
|
14
|
+
addDebugLog('internalTestFunctional', 'END', '-');
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
|
|
3
|
+
import { addDebugLog } from '../../util.js';
|
|
4
|
+
import { assertInternalTestsAvailable } from '../../internal-tests.js';
|
|
5
|
+
|
|
6
|
+
export default async () => {
|
|
7
|
+
addDebugLog('internalTestUnit', '', '+');
|
|
8
|
+
|
|
9
|
+
const cwd = assertInternalTestsAvailable();
|
|
10
|
+
await execa('npm', ['run', 'test:unit:local'], { cwd, stdio: 'inherit' });
|
|
11
|
+
|
|
12
|
+
addDebugLog('internalTestUnit', 'END', '-');
|
|
13
|
+
};
|
|
@@ -2,7 +2,7 @@ import { ESLint } from 'eslint';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
// import { addDebugLog } from '../../util.js';
|
|
4
4
|
|
|
5
|
-
export const lintComponent = async dirToLint => {
|
|
5
|
+
export const lintComponent = async (dirToLint) => {
|
|
6
6
|
// addDebugLog("lintComponent", `dirToLint: ${dirToLint}`);
|
|
7
7
|
|
|
8
8
|
// console.log("in dx-component-builder-sdk: lintComponent - dirToLint: " + dirToLint);
|
|
@@ -21,7 +21,7 @@ export const lintComponent = async dirToLint => {
|
|
|
21
21
|
// Indicate linting is complete
|
|
22
22
|
console.log(chalk.green(` linting complete...`));
|
|
23
23
|
|
|
24
|
-
if (
|
|
24
|
+
if (results.some((result) => result.errorCount > 0)) {
|
|
25
25
|
throw new Error(`Lint:\n${resultText}`);
|
|
26
26
|
} else {
|
|
27
27
|
console.log(resultText);
|
package/src/tasks/list/helper.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
COMPONENT_SCHEMA,
|
|
12
12
|
TASKS_CONFIG_JSON_FILENAME,
|
|
13
13
|
COMPONENTS_DIRECTORY_PATH,
|
|
14
|
-
COMPONENTS_PATH
|
|
14
|
+
COMPONENTS_PATH,
|
|
15
15
|
} from '../../constants.js';
|
|
16
16
|
import {
|
|
17
17
|
constructCompleteUrl,
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
getComponentsConfigs,
|
|
24
24
|
getConfigDefaults,
|
|
25
25
|
checkAccessTokenExpiration,
|
|
26
|
-
isLaunchpadVanity
|
|
26
|
+
isLaunchpadVanity,
|
|
27
27
|
} from '../../util.js';
|
|
28
28
|
|
|
29
29
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
30
30
|
SERVER: 'Server',
|
|
31
|
-
LOCAL: 'Local'
|
|
31
|
+
LOCAL: 'Local',
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export const getListComponentsQuestions = async options => {
|
|
34
|
+
export const getListComponentsQuestions = async (options) => {
|
|
35
35
|
addDebugLog('getListComponentsQuestions', '', '');
|
|
36
36
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
37
37
|
|
|
@@ -44,8 +44,8 @@ export const getListComponentsQuestions = async options => {
|
|
|
44
44
|
default: defaultPegaServerConfig.sourceOfComponents,
|
|
45
45
|
when() {
|
|
46
46
|
return !options.params[3];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
];
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -73,28 +73,28 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
73
73
|
name: 'organization',
|
|
74
74
|
message: 'Enter component organization (required)',
|
|
75
75
|
default: organization,
|
|
76
|
-
validate: value => {
|
|
76
|
+
validate: (value) => {
|
|
77
77
|
if (value) {
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
return 'Please provide value for organization';
|
|
81
|
-
}
|
|
81
|
+
},
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: 'library',
|
|
85
85
|
message: 'Enter library name (required)',
|
|
86
86
|
default: library,
|
|
87
|
-
validate: value => {
|
|
87
|
+
validate: (value) => {
|
|
88
88
|
if (value) {
|
|
89
89
|
return true;
|
|
90
90
|
}
|
|
91
91
|
return 'Please provide value for library';
|
|
92
|
-
}
|
|
93
|
-
}
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
94
|
];
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
export const listLocalComponents = async sourceOfComponents => {
|
|
97
|
+
export const listLocalComponents = async (sourceOfComponents) => {
|
|
98
98
|
addDebugLog('listLocalComponents', `sourceOfComponents: ${sourceOfComponents}`, '');
|
|
99
99
|
|
|
100
100
|
const isLibraryBased = getLibraryBased();
|
|
@@ -113,18 +113,18 @@ export const listLocalComponents = async sourceOfComponents => {
|
|
|
113
113
|
process.exit();
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
let libData = data.map(component => ({
|
|
116
|
+
let libData = data.map((component) => ({
|
|
117
117
|
Component: component.name,
|
|
118
118
|
Label: component.label,
|
|
119
119
|
Version: component.version,
|
|
120
120
|
Type: component.type,
|
|
121
|
-
'Sub Type': component.subtype
|
|
121
|
+
'Sub Type': component.subtype,
|
|
122
122
|
}));
|
|
123
123
|
console.log(chalk.bold.blueBright(`\nList of ${defConfig.library}:${defConfig.buildVersion} components.`));
|
|
124
124
|
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
|
125
125
|
} else {
|
|
126
126
|
let localComponents = await getComponents();
|
|
127
|
-
localComponents = localComponents.map(name => ({ 'Rule name': name }));
|
|
127
|
+
localComponents = localComponents.map((name) => ({ 'Rule name': name }));
|
|
128
128
|
if (localComponents.length > 0) {
|
|
129
129
|
console.log(chalk.bold.blueBright(`List of custom components in ${sourceOfComponents}`));
|
|
130
130
|
console.table(localComponents, ['Rule name']);
|
|
@@ -142,9 +142,9 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
|
142
142
|
fetch(apiUrl, {
|
|
143
143
|
method: 'GET',
|
|
144
144
|
dispatcher: getFetchAgent(serverConfig),
|
|
145
|
-
headers
|
|
145
|
+
headers,
|
|
146
146
|
})
|
|
147
|
-
.then(response => {
|
|
147
|
+
.then((response) => {
|
|
148
148
|
status = response.status;
|
|
149
149
|
if (status === 401) {
|
|
150
150
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -157,7 +157,7 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
|
157
157
|
}
|
|
158
158
|
return response.json();
|
|
159
159
|
})
|
|
160
|
-
.then(resp => {
|
|
160
|
+
.then((resp) => {
|
|
161
161
|
// const respData = JSON.parse(resp);
|
|
162
162
|
if (status === 401) {
|
|
163
163
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -170,7 +170,7 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
|
170
170
|
}
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
-
.catch(e => reject(`${chalk.bold.red(e)}`));
|
|
173
|
+
.catch((e) => reject(`${chalk.bold.red(e)}`));
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -178,22 +178,22 @@ async function fetchComponentsFromLaunchpad(apiUrl, headers) {
|
|
|
178
178
|
addDebugLog('fetchComponentsFromLaunchpad', `apiUrl: ${apiUrl}`, '');
|
|
179
179
|
const serverConfig = await getPegaServerConfig();
|
|
180
180
|
// constructing urls for all type of components
|
|
181
|
-
const urls = COMPONENT_SCHEMA.type.map(type => apiUrl.replace('{type}', type.value));
|
|
181
|
+
const urls = COMPONENT_SCHEMA.type.map((type) => apiUrl.replace('{type}', type.value));
|
|
182
182
|
const statuses = [];
|
|
183
183
|
|
|
184
184
|
return new Promise((resolve, reject) => {
|
|
185
185
|
Promise.all(
|
|
186
|
-
urls.map(async url => {
|
|
186
|
+
urls.map(async (url) => {
|
|
187
187
|
return fetch(url, {
|
|
188
188
|
method: 'GET',
|
|
189
189
|
dispatcher: getFetchAgent(serverConfig),
|
|
190
|
-
headers
|
|
190
|
+
headers,
|
|
191
191
|
});
|
|
192
|
-
})
|
|
192
|
+
}),
|
|
193
193
|
)
|
|
194
|
-
.then(responses => {
|
|
194
|
+
.then((responses) => {
|
|
195
195
|
return Promise.all(
|
|
196
|
-
responses.map(res => {
|
|
196
|
+
responses.map((res) => {
|
|
197
197
|
statuses.push(res.status);
|
|
198
198
|
if (res.status === 401 || res.status === 503) {
|
|
199
199
|
// Finding a 503 response is sometimes being returned from Launchpad in expired authentication scenario
|
|
@@ -203,15 +203,15 @@ async function fetchComponentsFromLaunchpad(apiUrl, headers) {
|
|
|
203
203
|
} else {
|
|
204
204
|
throw new Error(`Unexpected Error ${res.status} encountered. ${res.message}`);
|
|
205
205
|
}
|
|
206
|
-
})
|
|
206
|
+
}),
|
|
207
207
|
);
|
|
208
208
|
})
|
|
209
|
-
.then(data => {
|
|
210
|
-
const components = data.map(res => res.components).flat();
|
|
209
|
+
.then((data) => {
|
|
210
|
+
const components = data.map((res) => res.components).flat();
|
|
211
211
|
resolve(components);
|
|
212
212
|
})
|
|
213
213
|
|
|
214
|
-
.catch(e => reject(`${chalk.bold.red(e)}`));
|
|
214
|
+
.catch((e) => reject(`${chalk.bold.red(e)}`));
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -226,11 +226,11 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
226
226
|
? LP_VANITY_LIST_COMPONENT_SERVICE_REST_ENDPOINT
|
|
227
227
|
: isLaunchpad
|
|
228
228
|
? LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT
|
|
229
|
-
: LIST_COMPONENT_SERVICE_REST_ENDPOINT
|
|
229
|
+
: LIST_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
230
230
|
);
|
|
231
231
|
|
|
232
232
|
if (!isLaunchpad) {
|
|
233
|
-
await checkAccessTokenExpiration;
|
|
233
|
+
await checkAccessTokenExpiration();
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
return new Promise((resolve, reject) => {
|
|
@@ -248,25 +248,26 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
248
248
|
headers.cookie = `Pega-AAT=${accessToken}`;
|
|
249
249
|
|
|
250
250
|
fetchComponentsFromLaunchpad(url, headers)
|
|
251
|
-
.then(response => {
|
|
251
|
+
.then((response) => {
|
|
252
252
|
response = response.filter(
|
|
253
|
-
|
|
253
|
+
(component) =>
|
|
254
|
+
(component.library === library || library === '*') && (component.organization === organization || organization === '*'),
|
|
254
255
|
);
|
|
255
256
|
resolve(response);
|
|
256
257
|
})
|
|
257
|
-
.catch(e => reject(e));
|
|
258
|
+
.catch((e) => reject(e));
|
|
258
259
|
} else {
|
|
259
260
|
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
260
261
|
|
|
261
262
|
fetchComponentsFromInfinity(url, headers)
|
|
262
|
-
.then(response => {
|
|
263
|
+
.then((response) => {
|
|
263
264
|
// filter and only return non managed rules
|
|
264
265
|
response.pxResults = response.pxResults.filter(
|
|
265
|
-
component => component.pyManagedRule === false || component.pyManagedRule === undefined
|
|
266
|
+
(component) => component.pyManagedRule === false || component.pyManagedRule === undefined,
|
|
266
267
|
);
|
|
267
268
|
resolve(response);
|
|
268
269
|
})
|
|
269
|
-
.catch(e => reject(e));
|
|
270
|
+
.catch((e) => reject(e));
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
273
|
});
|
|
@@ -278,7 +279,7 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
278
279
|
});
|
|
279
280
|
};
|
|
280
281
|
|
|
281
|
-
export const displayServerComponents = async data => {
|
|
282
|
+
export const displayServerComponents = async (data) => {
|
|
282
283
|
addDebugLog('displayServerComponents', '', '');
|
|
283
284
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
284
285
|
const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
|
|
@@ -304,14 +305,14 @@ export const displayServerComponents = async data => {
|
|
|
304
305
|
if (isLaunchpad) {
|
|
305
306
|
return {
|
|
306
307
|
'Component Name': label,
|
|
307
|
-
Type: type
|
|
308
|
+
Type: type,
|
|
308
309
|
};
|
|
309
310
|
}
|
|
310
311
|
|
|
311
312
|
return {
|
|
312
313
|
'Rule name': label,
|
|
313
314
|
'Ruleset name': pyRuleSet,
|
|
314
|
-
'Ruleset version': pyRuleSetVersion
|
|
315
|
+
'Ruleset version': pyRuleSetVersion,
|
|
315
316
|
};
|
|
316
317
|
});
|
|
317
318
|
|
package/src/tasks/list/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getComponentsFromServer,
|
|
11
11
|
getLaunchPadFilterQuestions,
|
|
12
12
|
displayServerComponents,
|
|
13
|
-
getListComponentsQuestions
|
|
13
|
+
getListComponentsQuestions,
|
|
14
14
|
} from './helper.js';
|
|
15
15
|
|
|
16
16
|
const getList = async (sourceOfComponents, answers) => {
|
|
@@ -60,14 +60,14 @@ const getList = async (sourceOfComponents, answers) => {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export default async options => {
|
|
63
|
+
export default async (options) => {
|
|
64
64
|
await showVersion();
|
|
65
65
|
await checkLibraryAndArchives();
|
|
66
66
|
const isLibraryBased = getLibraryBased();
|
|
67
67
|
|
|
68
68
|
addDebugLog('list', '', '+');
|
|
69
69
|
|
|
70
|
-
let sourceOfComponentsOption
|
|
70
|
+
let sourceOfComponentsOption;
|
|
71
71
|
if (isLibraryBased) {
|
|
72
72
|
sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
|
|
73
73
|
await getList(sourceOfComponentsOption);
|
|
@@ -4,7 +4,7 @@ import { addDebugLog, getConfigDefaults, getLibraryArchiveDirectories } from '..
|
|
|
4
4
|
|
|
5
5
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
6
6
|
SERVER: 'Server',
|
|
7
|
-
LOCAL: 'Local'
|
|
7
|
+
LOCAL: 'Local',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const getArchiveLibraryQuestions = async () => {
|
|
@@ -17,8 +17,8 @@ export const getArchiveLibraryQuestions = async () => {
|
|
|
17
17
|
name: 'libraryName',
|
|
18
18
|
type: 'rawlist',
|
|
19
19
|
message: 'Select library',
|
|
20
|
-
choices: archLibs
|
|
21
|
-
}
|
|
20
|
+
choices: archLibs,
|
|
21
|
+
},
|
|
22
22
|
];
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ export const getLibraryVersionQuestion = async (libraryName, libVersions) => {
|
|
|
29
29
|
name: 'version',
|
|
30
30
|
type: 'rawlist',
|
|
31
31
|
message: `Select ${chalk.green.bold(`${libraryName}`)} library version`,
|
|
32
|
-
choices: libVersions
|
|
33
|
-
}
|
|
32
|
+
choices: libVersions,
|
|
33
|
+
},
|
|
34
34
|
];
|
|
35
35
|
};
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
getConfigDefaults,
|
|
11
11
|
getLocalArchivedLibraryVersionData,
|
|
12
12
|
getComponentsConfigs,
|
|
13
|
-
cleanUpTemp
|
|
13
|
+
cleanUpTemp,
|
|
14
14
|
} from '../../util.js';
|
|
15
15
|
import { getArchiveLibraryQuestions } from './helper.js';
|
|
16
16
|
|
|
17
|
-
export default async options => {
|
|
17
|
+
export default async (options) => {
|
|
18
18
|
const isLibraryBased = getLibraryBased();
|
|
19
19
|
|
|
20
20
|
if (!isLibraryBased) {
|
|
@@ -66,8 +66,8 @@ export default async options => {
|
|
|
66
66
|
name: 'libVersion',
|
|
67
67
|
type: 'rawlist',
|
|
68
68
|
message: 'Enter version',
|
|
69
|
-
choices: libVersions
|
|
70
|
-
}
|
|
69
|
+
choices: libVersions,
|
|
70
|
+
},
|
|
71
71
|
]);
|
|
72
72
|
|
|
73
73
|
selectedVersion = libAnswers.libVersion;
|
|
@@ -91,8 +91,8 @@ export default async options => {
|
|
|
91
91
|
type: 'rawlist',
|
|
92
92
|
message: 'Select current or store',
|
|
93
93
|
default: 'Current',
|
|
94
|
-
choices: ['Current', 'Store']
|
|
95
|
-
}
|
|
94
|
+
choices: ['Current', 'Store'],
|
|
95
|
+
},
|
|
96
96
|
]);
|
|
97
97
|
|
|
98
98
|
currentOrStore = archAnswers.currentOrStore;
|
|
@@ -123,12 +123,12 @@ export default async options => {
|
|
|
123
123
|
process.exit();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
let libData = data.map(component => ({
|
|
126
|
+
let libData = data.map((component) => ({
|
|
127
127
|
Component: component.name,
|
|
128
128
|
Label: component.label,
|
|
129
129
|
Version: component.version,
|
|
130
130
|
Type: component.type,
|
|
131
|
-
'Sub Type': component.subtype
|
|
131
|
+
'Sub Type': component.subtype,
|
|
132
132
|
}));
|
|
133
133
|
console.log(chalk.bold.blueBright(`\nList of ${libraryName}:${selectedVersion} components built on ${builtOn}.`));
|
|
134
134
|
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|