@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
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
validateRulesetVersion,
|
|
12
12
|
getFetchAgent,
|
|
13
13
|
addDebugLog,
|
|
14
|
-
isLaunchpadVanity
|
|
14
|
+
isLaunchpadVanity,
|
|
15
15
|
} from '../../util.js';
|
|
16
16
|
import {
|
|
17
17
|
PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
18
18
|
LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
19
19
|
LP_VANITY_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
20
|
-
TOKEN_PATH
|
|
20
|
+
TOKEN_PATH,
|
|
21
21
|
} from '../../constants.js';
|
|
22
22
|
|
|
23
23
|
export const getPublishComponentQuestions = async () => {
|
|
@@ -30,7 +30,7 @@ export const getPublishComponentQuestions = async () => {
|
|
|
30
30
|
name: 'rulesetName',
|
|
31
31
|
message: 'Enter ruleset name',
|
|
32
32
|
default: defaultPegaConfig.rulesetName,
|
|
33
|
-
validate: value => {
|
|
33
|
+
validate: (value) => {
|
|
34
34
|
if (value.trim()) {
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
@@ -38,13 +38,13 @@ export const getPublishComponentQuestions = async () => {
|
|
|
38
38
|
},
|
|
39
39
|
when: () => {
|
|
40
40
|
return defaultPegaConfig.serverType === 'infinity';
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'rulesetVersion',
|
|
45
45
|
message: 'Enter ruleset version',
|
|
46
46
|
default: defaultPegaConfig.rulesetVersion,
|
|
47
|
-
validate: value => {
|
|
47
|
+
validate: (value) => {
|
|
48
48
|
if (validateRulesetVersion(value)) {
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
@@ -52,25 +52,25 @@ export const getPublishComponentQuestions = async () => {
|
|
|
52
52
|
},
|
|
53
53
|
when: () => {
|
|
54
54
|
return defaultPegaConfig.serverType === 'infinity';
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
name: 'sourceMap',
|
|
59
59
|
message: 'Generate source map ?',
|
|
60
60
|
default: defaultPegaConfig.sourceMap,
|
|
61
61
|
|
|
62
|
-
when: () => false
|
|
62
|
+
when: () => false,
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
name: 'devBuild',
|
|
66
66
|
type: 'confirm',
|
|
67
67
|
message: 'Generate development build ?',
|
|
68
|
-
default: defaultPegaConfig.devBuild
|
|
69
|
-
}
|
|
68
|
+
default: defaultPegaConfig.devBuild,
|
|
69
|
+
},
|
|
70
70
|
];
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
export const zipComponent = async componentKey => {
|
|
73
|
+
export const zipComponent = async (componentKey) => {
|
|
74
74
|
addDebugLog('zipComponent', `componentKey: ${componentKey}`, '');
|
|
75
75
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
76
76
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
@@ -79,7 +79,7 @@ export const zipComponent = async componentKey => {
|
|
|
79
79
|
|
|
80
80
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
81
81
|
const zipChunks = [];
|
|
82
|
-
archive.on('data', chunk => zipChunks.push(chunk));
|
|
82
|
+
archive.on('data', (chunk) => zipChunks.push(chunk));
|
|
83
83
|
|
|
84
84
|
// Add src directory
|
|
85
85
|
archive.directory(srcDirectory, 'src');
|
|
@@ -112,7 +112,7 @@ export const cleanUp = async () => {
|
|
|
112
112
|
addDebugLog('cleanUp', '', '');
|
|
113
113
|
|
|
114
114
|
if (fs.existsSync('dist/components')) {
|
|
115
|
-
fs.rm('dist/components', { recursive: true }, err => {
|
|
115
|
+
fs.rm('dist/components', { recursive: true }, (err) => {
|
|
116
116
|
if (err) {
|
|
117
117
|
throw err;
|
|
118
118
|
}
|
|
@@ -120,7 +120,7 @@ export const cleanUp = async () => {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
if (fs.existsSync('lib')) {
|
|
123
|
-
fs.rm('lib', { recursive: true }, err => {
|
|
123
|
+
fs.rm('lib', { recursive: true }, (err) => {
|
|
124
124
|
if (err) {
|
|
125
125
|
throw err;
|
|
126
126
|
}
|
|
@@ -147,7 +147,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
147
147
|
zipContent,
|
|
148
148
|
componentName: JSON.parse(configContent).componentKey,
|
|
149
149
|
pxUpdateDateTime: '',
|
|
150
|
-
environmentID: defaultPegaServerConfig.isolationId
|
|
150
|
+
environmentID: defaultPegaServerConfig.isolationId,
|
|
151
151
|
};
|
|
152
152
|
} else {
|
|
153
153
|
apiBody = {
|
|
@@ -157,7 +157,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
157
157
|
publishFor: 'constellation',
|
|
158
158
|
rulesetName,
|
|
159
159
|
rulesetVersion,
|
|
160
|
-
category: ''
|
|
160
|
+
category: '',
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -170,7 +170,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
170
170
|
if (OauthData) {
|
|
171
171
|
const {
|
|
172
172
|
access_token: accessToken,
|
|
173
|
-
token_type: tokenType
|
|
173
|
+
token_type: tokenType,
|
|
174
174
|
// refresh_token: refreshToken
|
|
175
175
|
} = JSON.parse(OauthData);
|
|
176
176
|
let status = 500;
|
|
@@ -187,7 +187,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
187
187
|
method: 'POST',
|
|
188
188
|
dispatcher: getFetchAgent(defaultPegaConfig),
|
|
189
189
|
headers,
|
|
190
|
-
body: JSON.stringify(apiBody)
|
|
190
|
+
body: JSON.stringify(apiBody),
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
status = response.status;
|
|
@@ -217,9 +217,9 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
217
217
|
}
|
|
218
218
|
} catch (err) {
|
|
219
219
|
if (status === 500) {
|
|
220
|
-
throw new Error(`Error occurred in authentication. Please regenerate using authenticate
|
|
220
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
|
|
221
221
|
} else if (status === 999) {
|
|
222
|
-
throw new Error(err);
|
|
222
|
+
throw new Error(err, { cause: err });
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
} else {
|
|
@@ -227,7 +227,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
227
227
|
}
|
|
228
228
|
} catch (err) {
|
|
229
229
|
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
230
|
-
throw new Error(err);
|
|
230
|
+
throw new Error(err, { cause: err });
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
};
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getPegaServerConfig,
|
|
16
16
|
updateServerConfigRuleSetAndVersion,
|
|
17
17
|
checkLibraryAndArchives,
|
|
18
|
-
checkForBranch
|
|
18
|
+
checkForBranch,
|
|
19
19
|
} from '../../util.js';
|
|
20
20
|
|
|
21
21
|
import { getPublishComponentQuestions, publishComponentToServer, zipComponent, cleanUp } from './helper.js';
|
|
@@ -32,7 +32,7 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
|
|
|
32
32
|
title: 'Validate config schema',
|
|
33
33
|
task: async () => {
|
|
34
34
|
await validate(componentKey);
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
title: 'Lint component',
|
|
@@ -40,34 +40,34 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
|
|
|
40
40
|
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
41
41
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
42
42
|
await lintComponent(targetDirectory);
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
title: `Bundle Component ${sDevBuild}`,
|
|
47
47
|
task: async () => {
|
|
48
48
|
await bundleComponent(componentKey, sourceMap, devBuild);
|
|
49
49
|
},
|
|
50
|
-
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
|
|
50
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
title: 'Zip Component',
|
|
54
54
|
task: async () => {
|
|
55
55
|
const output = await zipComponent(componentKey);
|
|
56
56
|
content = { ...content, ...output };
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
title: 'Publish Component',
|
|
61
61
|
task: async () => {
|
|
62
62
|
await publishComponentToServer(content, doFetch);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
65
|
],
|
|
66
|
-
{ concurrent: false, exitOnError: true }
|
|
66
|
+
{ concurrent: false, exitOnError: true },
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export default async options => {
|
|
70
|
+
export default async (options) => {
|
|
71
71
|
const isLibraryBased = getLibraryBased();
|
|
72
72
|
if (isLibraryBased) {
|
|
73
73
|
console.log(`Command only supported for ${chalk.bold.green('non library mode')} components.`);
|
|
@@ -89,7 +89,6 @@ export default async options => {
|
|
|
89
89
|
process.exit();
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
let componentKey;
|
|
93
92
|
let sourceMap;
|
|
94
93
|
let devBuild;
|
|
95
94
|
let content;
|
|
@@ -100,14 +99,14 @@ export default async options => {
|
|
|
100
99
|
const dBuild = options.params[5];
|
|
101
100
|
devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
|
|
102
101
|
|
|
103
|
-
content = {
|
|
102
|
+
content = { rulesetName, rulesetVersion, devBuild };
|
|
104
103
|
} else {
|
|
105
104
|
const questions = await getPublishComponentQuestions();
|
|
106
105
|
const answers = await inquirer.prompt(questions);
|
|
107
106
|
({ sourceMap, devBuild } = answers);
|
|
108
107
|
|
|
109
108
|
content = {
|
|
110
|
-
...answers
|
|
109
|
+
...answers,
|
|
111
110
|
};
|
|
112
111
|
}
|
|
113
112
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { addDebugLog, getPegaServerConfig, validateRulesetVersion } from '../../util.js';
|
|
2
2
|
|
|
3
|
-
export const getLibraryVersionQuestion = async libVersions => {
|
|
3
|
+
export const getLibraryVersionQuestion = async (libVersions) => {
|
|
4
4
|
addDebugLog('getLibraryVersionQuestion', `libVersions: ${libVersions}`, '');
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
7
7
|
name: 'version',
|
|
8
8
|
type: 'rawlist',
|
|
9
9
|
message: 'Select library version to publish',
|
|
10
|
-
choices: libVersions
|
|
11
|
-
}
|
|
10
|
+
choices: libVersions,
|
|
11
|
+
},
|
|
12
12
|
];
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export const getPublishComponentQuestions = async componentKey => {
|
|
15
|
+
export const getPublishComponentQuestions = async (componentKey) => {
|
|
16
16
|
addDebugLog('getPublishComponentQuestions', `componentKey: ${componentKey}`, '');
|
|
17
17
|
|
|
18
18
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
@@ -22,7 +22,7 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
22
22
|
name: 'rulesetName',
|
|
23
23
|
message: 'Enter ruleset name',
|
|
24
24
|
default: defaultPegaConfig.archiveRulesetName,
|
|
25
|
-
validate: value => {
|
|
25
|
+
validate: (value) => {
|
|
26
26
|
if (value.trim()) {
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
@@ -30,13 +30,13 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
30
30
|
},
|
|
31
31
|
when: () => {
|
|
32
32
|
return defaultPegaConfig.serverType === 'infinity';
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
name: 'rulesetVersion',
|
|
37
37
|
message: 'Enter ruleset version',
|
|
38
38
|
default: defaultPegaConfig.archiveRulesetVersion,
|
|
39
|
-
validate: value => {
|
|
39
|
+
validate: (value) => {
|
|
40
40
|
if (validateRulesetVersion(value)) {
|
|
41
41
|
return true;
|
|
42
42
|
}
|
|
@@ -44,7 +44,7 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
44
44
|
},
|
|
45
45
|
when: () => {
|
|
46
46
|
return defaultPegaConfig.serverType === 'infinity';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
];
|
|
50
50
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getConfigDefaults,
|
|
14
14
|
zipVersionAndArchive,
|
|
15
15
|
updateServerConfigArchiveRuleSetAndVersion,
|
|
16
|
-
isLaunchpadVanity
|
|
16
|
+
isLaunchpadVanity,
|
|
17
17
|
} from '../../util.js';
|
|
18
18
|
|
|
19
19
|
import { getPublishComponentQuestions } from './helper.js';
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
PUBLISH_COMPONENT_LIBRARY_ARCHIVE_SERVICE_REST_ENDPOINT,
|
|
25
25
|
TEMP_PATH,
|
|
26
26
|
TOKEN_PATH,
|
|
27
|
-
ARCHIVES_PATH
|
|
27
|
+
ARCHIVES_PATH,
|
|
28
28
|
} from '../../constants.js';
|
|
29
29
|
|
|
30
30
|
export const publishComponentLibraryArchiveToServer = async (data, zipContent, doFetch) => {
|
|
@@ -37,7 +37,6 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
37
37
|
const launchpadRestEndpoint = isLaunchpadVanity(defaultPegaServerConfig)
|
|
38
38
|
? LP_VANITY_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT
|
|
39
39
|
: LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT.replace('{isolationId}', isolationId || 'undefined');
|
|
40
|
-
let apiBody;
|
|
41
40
|
let urlParams;
|
|
42
41
|
|
|
43
42
|
if (isLaunchpad) {
|
|
@@ -49,7 +48,7 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
49
48
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
50
49
|
let url = constructCompleteUrl(
|
|
51
50
|
defaultPegaConfig.server,
|
|
52
|
-
isLaunchpad ? launchpadRestEndpoint : PUBLISH_COMPONENT_LIBRARY_ARCHIVE_SERVICE_REST_ENDPOINT
|
|
51
|
+
isLaunchpad ? launchpadRestEndpoint : PUBLISH_COMPONENT_LIBRARY_ARCHIVE_SERVICE_REST_ENDPOINT,
|
|
53
52
|
);
|
|
54
53
|
|
|
55
54
|
url = url.concat(urlParams);
|
|
@@ -60,7 +59,7 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
60
59
|
if (OauthData) {
|
|
61
60
|
const {
|
|
62
61
|
access_token: accessToken,
|
|
63
|
-
token_type: tokenType
|
|
62
|
+
token_type: tokenType,
|
|
64
63
|
// refresh_token: refreshToken
|
|
65
64
|
} = JSON.parse(OauthData);
|
|
66
65
|
let status = 500;
|
|
@@ -78,7 +77,7 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
78
77
|
method: 'POST',
|
|
79
78
|
dispatcher: getFetchAgent(defaultPegaConfig),
|
|
80
79
|
headers,
|
|
81
|
-
body: JSON.stringify(zipContent)
|
|
80
|
+
body: JSON.stringify(zipContent),
|
|
82
81
|
});
|
|
83
82
|
|
|
84
83
|
status = response.status;
|
|
@@ -108,10 +107,9 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
108
107
|
}
|
|
109
108
|
} catch (err) {
|
|
110
109
|
if (status === 500) {
|
|
111
|
-
|
|
112
|
-
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
110
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
|
|
113
111
|
} else if (status === 999) {
|
|
114
|
-
throw new Error(err);
|
|
112
|
+
throw new Error(err, { cause: err });
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
115
|
} else {
|
|
@@ -119,7 +117,7 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
119
117
|
}
|
|
120
118
|
} catch (err) {
|
|
121
119
|
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
122
|
-
throw Error(err);
|
|
120
|
+
throw Error(err, { cause: err });
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
};
|
|
@@ -127,7 +125,7 @@ export const publishComponentLibraryArchiveToServer = async (data, zipContent, d
|
|
|
127
125
|
export default async (orgLibName, selectedVersion) => {
|
|
128
126
|
// console.log(orgLibName + ", " + selectedVersion);
|
|
129
127
|
const configDef = await getConfigDefaults();
|
|
130
|
-
let archiveBeforeStore
|
|
128
|
+
let archiveBeforeStore;
|
|
131
129
|
|
|
132
130
|
const rulesetQuestions = await getPublishComponentQuestions();
|
|
133
131
|
const rulesetAnswers = await inquirer.prompt(rulesetQuestions);
|
|
@@ -138,7 +136,7 @@ export default async (orgLibName, selectedVersion) => {
|
|
|
138
136
|
libraryName: orgLibName,
|
|
139
137
|
version: selectedVersion,
|
|
140
138
|
rulesetName,
|
|
141
|
-
rulesetVersion
|
|
139
|
+
rulesetVersion,
|
|
142
140
|
};
|
|
143
141
|
|
|
144
142
|
// update so will get archived
|
|
@@ -171,7 +169,7 @@ export default async (orgLibName, selectedVersion) => {
|
|
|
171
169
|
spinner.stop();
|
|
172
170
|
console.log(chalk.green.bold(`Success: Published Archive ${content.libraryName}/${content.version} to server.`));
|
|
173
171
|
})
|
|
174
|
-
.catch(err => {
|
|
172
|
+
.catch((err) => {
|
|
175
173
|
spinner.stop();
|
|
176
174
|
console.log(chalk.red.bold(err));
|
|
177
175
|
});
|
|
@@ -206,7 +204,7 @@ export default async (orgLibName, selectedVersion) => {
|
|
|
206
204
|
.then(() => {
|
|
207
205
|
console.log(chalk.green.bold(`Success: Published Archive ${content.libraryName}/${content.version} to server.`));
|
|
208
206
|
})
|
|
209
|
-
.catch(err => {
|
|
207
|
+
.catch((err) => {
|
|
210
208
|
console.log(chalk.red.bold(err));
|
|
211
209
|
});
|
|
212
210
|
} catch (err) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { addDebugLog } from '../../util.js';
|
|
2
2
|
|
|
3
|
-
export const getLibraryVersionQuestion = async libVersions => {
|
|
3
|
+
export const getLibraryVersionQuestion = async (libVersions) => {
|
|
4
4
|
addDebugLog('getLibraryVersionQuestion', `libVersions: ${libVersions}`, '');
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
7
7
|
name: 'version',
|
|
8
8
|
type: 'rawlist',
|
|
9
9
|
message: 'Select library version to publish',
|
|
10
|
-
choices: libVersions
|
|
11
|
-
}
|
|
10
|
+
choices: libVersions,
|
|
11
|
+
},
|
|
12
12
|
];
|
|
13
13
|
};
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getConfigDefaults,
|
|
26
26
|
checkForBranch,
|
|
27
27
|
collectAllComponentSvgFiles,
|
|
28
|
-
isLaunchpadVanity
|
|
28
|
+
isLaunchpadVanity,
|
|
29
29
|
} from '../../util.js';
|
|
30
30
|
|
|
31
31
|
import { publishLib, listLibJSONResponse, deleteLibVersion } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
@@ -36,20 +36,19 @@ import {
|
|
|
36
36
|
LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
37
37
|
LP_VANITY_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
38
38
|
PUBLISH_COMPONENT_LIBRARY_SERVICE_REST_ENDPOINT,
|
|
39
|
-
TOKEN_PATH
|
|
39
|
+
TOKEN_PATH,
|
|
40
40
|
} from '../../constants.js';
|
|
41
41
|
|
|
42
|
-
export function getCustomTasks(componentKey, sourceMap, devBuild
|
|
42
|
+
export function getCustomTasks(componentKey, sourceMap, devBuild) {
|
|
43
43
|
addDebugLog('getCustomTasks', `componentKey: ${componentKey}, sourceMap: ${sourceMap}, devBuild: ${devBuild}`, '');
|
|
44
44
|
|
|
45
|
-
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
46
45
|
return new Listr(
|
|
47
46
|
[
|
|
48
47
|
{
|
|
49
48
|
title: 'Validate config schema',
|
|
50
49
|
task: async () => {
|
|
51
50
|
await validate(componentKey);
|
|
52
|
-
}
|
|
51
|
+
},
|
|
53
52
|
},
|
|
54
53
|
{
|
|
55
54
|
title: 'Lint component',
|
|
@@ -57,10 +56,10 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
|
|
|
57
56
|
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
58
57
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
59
58
|
await lintComponent(targetDirectory);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
59
|
+
},
|
|
60
|
+
},
|
|
62
61
|
],
|
|
63
|
-
{ concurrent: false, exitOnError: true }
|
|
62
|
+
{ concurrent: false, exitOnError: true },
|
|
64
63
|
);
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -91,7 +90,7 @@ export const zipLibraryComponent = async (libraryName, version) => {
|
|
|
91
90
|
|
|
92
91
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
93
92
|
const zipChunks = [];
|
|
94
|
-
archive.on('data', chunk => zipChunks.push(chunk));
|
|
93
|
+
archive.on('data', (chunk) => zipChunks.push(chunk));
|
|
95
94
|
|
|
96
95
|
// No going to add full list of created by buildLib, instead
|
|
97
96
|
// below going just just *.js files and a few specific .json files
|
|
@@ -166,7 +165,7 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
166
165
|
category: '',
|
|
167
166
|
localizationsContent,
|
|
168
167
|
svgContent: svgContent || [],
|
|
169
|
-
manifestContent
|
|
168
|
+
manifestContent,
|
|
170
169
|
};
|
|
171
170
|
}
|
|
172
171
|
|
|
@@ -179,7 +178,7 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
179
178
|
if (OauthData) {
|
|
180
179
|
const {
|
|
181
180
|
access_token: accessToken,
|
|
182
|
-
token_type: tokenType
|
|
181
|
+
token_type: tokenType,
|
|
183
182
|
// refresh_token: refreshToken
|
|
184
183
|
} = JSON.parse(OauthData);
|
|
185
184
|
let status = 500;
|
|
@@ -201,7 +200,7 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
201
200
|
method: 'POST',
|
|
202
201
|
dispatcher: getFetchAgent(defaultPegaConfig),
|
|
203
202
|
headers,
|
|
204
|
-
body: JSON.stringify(apiBody)
|
|
203
|
+
body: JSON.stringify(apiBody),
|
|
205
204
|
});
|
|
206
205
|
|
|
207
206
|
spinner.stop();
|
|
@@ -240,9 +239,9 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
240
239
|
console.log(chalk.bold.green(`Success : ${respMessage}`));
|
|
241
240
|
} catch (err) {
|
|
242
241
|
if (status === 500) {
|
|
243
|
-
throw new Error(`Server error, please check server logs for error
|
|
242
|
+
throw new Error(`Server error, please check server logs for error.`, { cause: err });
|
|
244
243
|
} else if (status === 999) {
|
|
245
|
-
throw new Error(err);
|
|
244
|
+
throw new Error(err, { cause: err });
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
247
|
} else {
|
|
@@ -250,17 +249,17 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
250
249
|
}
|
|
251
250
|
} catch (err) {
|
|
252
251
|
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
253
|
-
throw new Error(err);
|
|
252
|
+
throw new Error(err, { cause: err });
|
|
254
253
|
}
|
|
255
254
|
}
|
|
256
255
|
};
|
|
257
256
|
|
|
258
|
-
export const publishUILibraryComponentToInfinity = async content => {
|
|
257
|
+
export const publishUILibraryComponentToInfinity = async (content) => {
|
|
259
258
|
addDebugLog('publishUILibraryComponentToInfinity', `content: ${content}`, '');
|
|
260
259
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
261
260
|
|
|
262
261
|
console.log(
|
|
263
|
-
chalk.green(`Publishing ${content.libraryName}/${content.version} to server ${chalk.green.bold(`${defaultPegaServerConfig.server}`)}.`)
|
|
262
|
+
chalk.green(`Publishing ${content.libraryName}/${content.version} to server ${chalk.green.bold(`${defaultPegaServerConfig.server}`)}.`),
|
|
264
263
|
);
|
|
265
264
|
|
|
266
265
|
const fromZip = await zipLibraryComponent(content.libraryName, content.version);
|
|
@@ -290,7 +289,7 @@ export const publishNewLibraryAsync = async (libraryName, version, checkDeleted
|
|
|
290
289
|
let count = 0;
|
|
291
290
|
while (libExists) {
|
|
292
291
|
// sleep a second and try again
|
|
293
|
-
await new Promise(r => setTimeout(r, 1000));
|
|
292
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
294
293
|
|
|
295
294
|
// keep checking until no longer exists
|
|
296
295
|
libExists = await doesLibraryExist(libraryName, version);
|
|
@@ -307,14 +306,14 @@ export const publishNewLibraryAsync = async (libraryName, version, checkDeleted
|
|
|
307
306
|
}
|
|
308
307
|
|
|
309
308
|
console.log(
|
|
310
|
-
`\nPublishing Library ${chalk.bold.green(`${libraryName}/${version}`)} to ${chalk.bold.green(`${tokenAndStaticServer.appStaticContentServer}`)}
|
|
309
|
+
`\nPublishing Library ${chalk.bold.green(`${libraryName}/${version}`)} to ${chalk.bold.green(`${tokenAndStaticServer.appStaticContentServer}`)}`,
|
|
311
310
|
);
|
|
312
311
|
addDebugLog('publishLib', 'services call', '');
|
|
313
312
|
await publishLib(libraryName, version, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
314
313
|
addDebugLog('deleteLib', 'services end', '');
|
|
315
314
|
};
|
|
316
315
|
|
|
317
|
-
export default async options => {
|
|
316
|
+
export default async (options) => {
|
|
318
317
|
const isLibraryBased = getLibraryBased();
|
|
319
318
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
320
319
|
|
|
@@ -332,10 +331,7 @@ export default async options => {
|
|
|
332
331
|
|
|
333
332
|
addDebugLog('publishLibrary', '', '+');
|
|
334
333
|
|
|
335
|
-
let organization;
|
|
336
|
-
let library;
|
|
337
334
|
let version;
|
|
338
|
-
let devBuild;
|
|
339
335
|
let internalPublish = false;
|
|
340
336
|
let rulesetName;
|
|
341
337
|
let rulesetVersion;
|
|
@@ -360,8 +356,6 @@ export default async options => {
|
|
|
360
356
|
// internal call from publish
|
|
361
357
|
internalPublish = true;
|
|
362
358
|
const orgLib = getConfigDefaults();
|
|
363
|
-
library = orgLib.library;
|
|
364
|
-
organization = orgLib.organization;
|
|
365
359
|
libraryName = orgLib.currentOrgLib;
|
|
366
360
|
|
|
367
361
|
version = orgLib.buildVersion;
|
|
@@ -373,7 +367,7 @@ export default async options => {
|
|
|
373
367
|
|
|
374
368
|
if (tokenAndStaticServer.C11NB2S === undefined) {
|
|
375
369
|
console.log(
|
|
376
|
-
chalk.redBright('Need to authenticate, missing services token.\nPublishing a library requires authentication to acquire a token to publish.')
|
|
370
|
+
chalk.redBright('Need to authenticate, missing services token.\nPublishing a library requires authentication to acquire a token to publish.'),
|
|
377
371
|
);
|
|
378
372
|
process.exit(1);
|
|
379
373
|
}
|
|
@@ -381,13 +375,13 @@ export default async options => {
|
|
|
381
375
|
let libVersions = [];
|
|
382
376
|
if (!libraryName) {
|
|
383
377
|
const compDef = getConfigDefaults();
|
|
384
|
-
organization = compDef.organization;
|
|
385
|
-
library = compDef.library;
|
|
386
378
|
libraryName = compDef.currentOrgLib;
|
|
387
379
|
|
|
388
380
|
try {
|
|
389
381
|
libVersions = await getLocalLibraryVersions(libraryName);
|
|
390
|
-
} catch
|
|
382
|
+
} catch {
|
|
383
|
+
// ignore, keep default libVersions
|
|
384
|
+
}
|
|
391
385
|
}
|
|
392
386
|
|
|
393
387
|
console.log(`\nPreparing to publish ${chalk.bold.green(`${libraryName}/${version}`)} `);
|
|
@@ -417,8 +411,8 @@ export default async options => {
|
|
|
417
411
|
name: 'confirmPublish',
|
|
418
412
|
type: 'confirm',
|
|
419
413
|
message: `You are about to publish a ${chalk.bold.yellow('PRODUCTION')} version which can ${chalk.bold.yellow('NOT')} be deleted, proceed ?`,
|
|
420
|
-
default: false
|
|
421
|
-
}
|
|
414
|
+
default: false,
|
|
415
|
+
},
|
|
422
416
|
]);
|
|
423
417
|
if (publishAnswers.confirmPublish) {
|
|
424
418
|
okToPublish = true;
|
|
@@ -455,11 +449,11 @@ export default async options => {
|
|
|
455
449
|
name: 'override',
|
|
456
450
|
type: 'confirm',
|
|
457
451
|
message: `Do you wish to overwrite it`,
|
|
458
|
-
default: false
|
|
459
|
-
}
|
|
452
|
+
default: false,
|
|
453
|
+
},
|
|
460
454
|
];
|
|
461
455
|
|
|
462
|
-
await inquirer.prompt(questions).then(async answers => {
|
|
456
|
+
await inquirer.prompt(questions).then(async (answers) => {
|
|
463
457
|
overrideExisting = answers.override;
|
|
464
458
|
});
|
|
465
459
|
}
|
|
@@ -7,7 +7,7 @@ import { showVersion, addDebugLog, getJestFunctionalTestList } from '../../util.
|
|
|
7
7
|
|
|
8
8
|
import { JEST_TESTS_FUNCTIONAL_PATH } from '../../constants.js';
|
|
9
9
|
|
|
10
|
-
export const quarnUnquarnTests = async answers => {
|
|
10
|
+
export const quarnUnquarnTests = async (answers) => {
|
|
11
11
|
switch (answers.QuarUnQuar) {
|
|
12
12
|
case 'Quarantine':
|
|
13
13
|
await quarantineTests(answers);
|
|
@@ -18,7 +18,7 @@ export const quarnUnquarnTests = async answers => {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const quarantineTests = async answers => {
|
|
21
|
+
export const quarantineTests = async (answers) => {
|
|
22
22
|
const testList = await getJestFunctionalTestList(answers.whichTests);
|
|
23
23
|
const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH);
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ export const quarantineTests = async answers => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export const unquarantineTests = async answers => {
|
|
32
|
+
export const unquarantineTests = async (answers) => {
|
|
33
33
|
const testList = await getJestFunctionalTestList(answers.whichTests);
|
|
34
34
|
const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH);
|
|
35
35
|
|
|
@@ -40,7 +40,7 @@ export const unquarantineTests = async answers => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export default async options => {
|
|
43
|
+
export default async (options) => {
|
|
44
44
|
addDebugLog('quarantine', '', '+');
|
|
45
45
|
|
|
46
46
|
await showVersion();
|
|
@@ -51,15 +51,15 @@ export default async options => {
|
|
|
51
51
|
type: 'rawlist',
|
|
52
52
|
message: `Quarantine or UnQuarantine tests`,
|
|
53
53
|
choices: ['Quarantine', 'Unquarantine'],
|
|
54
|
-
default: 'Quarantine'
|
|
54
|
+
default: 'Quarantine',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
name: 'whichTests',
|
|
58
58
|
type: 'rawlist',
|
|
59
|
-
message: answers => `Which tests to ${answers.QuarUnQuar}`,
|
|
59
|
+
message: (answers) => `Which tests to ${answers.QuarUnQuar}`,
|
|
60
60
|
default: 'ALL',
|
|
61
|
-
choices: ['ALL', 'Original', 'Library']
|
|
62
|
-
}
|
|
61
|
+
choices: ['ALL', 'Original', 'Library'],
|
|
62
|
+
},
|
|
63
63
|
]);
|
|
64
64
|
|
|
65
65
|
// await showCurrentStatus();
|