@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
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
getInputConfigForCommand,
|
|
21
21
|
convertYNToBoolean,
|
|
22
22
|
hasArchives,
|
|
23
|
-
getLibraryBasedCL
|
|
23
|
+
getLibraryBasedCL,
|
|
24
24
|
} from '../../util.js';
|
|
25
25
|
|
|
26
26
|
import { getSwitchLibraryComponentQuestions, getSwitchVersionComponentQuestions } from './helper.js';
|
|
27
27
|
import { showCurrentStatus } from '../show-status/index.js';
|
|
28
28
|
import { arch } from 'os';
|
|
29
29
|
|
|
30
|
-
export default async options => {
|
|
30
|
+
export default async (options) => {
|
|
31
31
|
const isLibraryBased = getLibraryBased();
|
|
32
32
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
33
33
|
|
|
@@ -154,19 +154,19 @@ export default async options => {
|
|
|
154
154
|
title: `Storing ${orgLib.displayLibVersion}`,
|
|
155
155
|
task: async () => {
|
|
156
156
|
await zipVersionAndArchive(existingOrgLib, oldVersion);
|
|
157
|
-
}
|
|
157
|
+
},
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
title: `Restoring ${newOrgLib}/${newVersion}`,
|
|
161
161
|
task: async () => {
|
|
162
162
|
await restoreFromArchive(switchToFileName, newOrgLib, newVersion);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
165
|
],
|
|
166
|
-
{ concurrent: false, exitOnError: true }
|
|
166
|
+
{ concurrent: false, exitOnError: true },
|
|
167
167
|
);
|
|
168
168
|
|
|
169
|
-
await tasks.run().catch(err => {
|
|
169
|
+
await tasks.run().catch((err) => {
|
|
170
170
|
console.log(chalk.bold.red(err.toString()));
|
|
171
171
|
process.exit(1);
|
|
172
172
|
});
|
|
@@ -6,7 +6,7 @@ import { getComponents, updateConfigVersion, getLibraryArchivesVersions, addDebu
|
|
|
6
6
|
|
|
7
7
|
const exec = promisify(LocalExec);
|
|
8
8
|
|
|
9
|
-
export const updateAllComponentsConfig = async newVersion => {
|
|
9
|
+
export const updateAllComponentsConfig = async (newVersion) => {
|
|
10
10
|
addDebugLog('updateAllComponentsConfig', `newVersion: ${newVersion}`, '');
|
|
11
11
|
const componentList = await getComponents();
|
|
12
12
|
const orgLib = getConfigDefaults();
|
|
@@ -37,7 +37,7 @@ export const getSwitchVersionComponentQuestions = async () => {
|
|
|
37
37
|
name: 'okToContinue',
|
|
38
38
|
type: 'confirm',
|
|
39
39
|
message: 'Ok to continue ?',
|
|
40
|
-
default: true
|
|
40
|
+
default: true,
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
name: 'version',
|
|
@@ -46,8 +46,8 @@ export const getSwitchVersionComponentQuestions = async () => {
|
|
|
46
46
|
choices: archVersionList,
|
|
47
47
|
when(answers) {
|
|
48
48
|
return answers.okToContinue;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
51
|
];
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -61,8 +61,8 @@ export const getRunNpmQuestions = async () => {
|
|
|
61
61
|
name: 'updateNpm',
|
|
62
62
|
type: 'confirm',
|
|
63
63
|
message: 'Run npm update?',
|
|
64
|
-
default: true
|
|
65
|
-
}
|
|
64
|
+
default: true,
|
|
65
|
+
},
|
|
66
66
|
];
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
getInputConfigForCommand,
|
|
23
23
|
convertYNToBoolean,
|
|
24
24
|
hasArchives,
|
|
25
|
-
hasLibraryAndVersion
|
|
25
|
+
hasLibraryAndVersion,
|
|
26
26
|
} from '../../util.js';
|
|
27
27
|
|
|
28
28
|
import { getSwitchVersionComponentQuestions } from './helper.js';
|
|
29
29
|
import { showCurrentStatus } from '../show-status/index.js';
|
|
30
30
|
|
|
31
|
-
export default async options => {
|
|
31
|
+
export default async (options) => {
|
|
32
32
|
const isLibraryBased = getLibraryBased();
|
|
33
33
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
34
34
|
|
|
@@ -135,19 +135,19 @@ export default async options => {
|
|
|
135
135
|
title: `Storing ${orgLib.displayLibVersion}`,
|
|
136
136
|
task: async () => {
|
|
137
137
|
await zipVersionAndArchive(existingOrgLib, oldVersion);
|
|
138
|
-
}
|
|
138
|
+
},
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
title: `Restoring ${existingOrgLib}/${newVersion}`,
|
|
142
142
|
task: async () => {
|
|
143
143
|
await restoreFromArchive(switchToFileName, existingOrgLib, newVersion);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
146
|
],
|
|
147
|
-
{ concurrent: false, exitOnError: true }
|
|
147
|
+
{ concurrent: false, exitOnError: true },
|
|
148
148
|
);
|
|
149
149
|
|
|
150
|
-
await tasks.run().catch(err => {
|
|
150
|
+
await tasks.run().catch((err) => {
|
|
151
151
|
console.log(chalk.bold.red(err.toString()));
|
|
152
152
|
process.exit(1);
|
|
153
153
|
});
|
|
@@ -5,7 +5,7 @@ import { Listr } from 'listr2';
|
|
|
5
5
|
|
|
6
6
|
const execPromise = promisify(exec);
|
|
7
7
|
|
|
8
|
-
export default async options => {
|
|
8
|
+
export default async (options) => {
|
|
9
9
|
const installDependenciesText = `Upgrading package to latest version.`;
|
|
10
10
|
|
|
11
11
|
const tasks = new Listr(
|
|
@@ -14,17 +14,17 @@ export default async options => {
|
|
|
14
14
|
title: installDependenciesText,
|
|
15
15
|
task: async () => {
|
|
16
16
|
await execPromise('npm uninstall --save-dev @pega/custom-dx-components', {
|
|
17
|
-
cwd: options.targetDirectory
|
|
17
|
+
cwd: options.targetDirectory,
|
|
18
18
|
});
|
|
19
19
|
await execPromise('npm install --save-dev @pega/custom-dx-components', {
|
|
20
|
-
cwd: options.targetDirectory
|
|
20
|
+
cwd: options.targetDirectory,
|
|
21
21
|
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
24
|
],
|
|
25
25
|
{
|
|
26
|
-
exitOnError: false
|
|
27
|
-
}
|
|
26
|
+
exitOnError: false,
|
|
27
|
+
},
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
await tasks.run();
|
|
@@ -11,34 +11,16 @@ import { getComponentDirectoryPath, getComponents, isComponentValidLength, getCo
|
|
|
11
11
|
|
|
12
12
|
const ajv = new Ajv({ allErrors: true });
|
|
13
13
|
|
|
14
|
-
const combinationTypes = ['PAGE', 'CASE'];
|
|
15
|
-
|
|
16
14
|
const configDef = getConfigDefaults();
|
|
17
15
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
18
16
|
|
|
19
17
|
const allowedSubtypes = [
|
|
20
|
-
...new Set([
|
|
21
|
-
...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
|
|
22
|
-
...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
|
|
23
|
-
...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value),
|
|
24
|
-
...COMPONENT_SCHEMA.subtype.presentation.map(({ value }) => value)
|
|
25
|
-
])
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
// additional subtypes are manually added below
|
|
29
|
-
const allowedOverrideSubtypes = [
|
|
30
18
|
...new Set([
|
|
31
19
|
...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
|
|
32
20
|
...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
|
|
33
21
|
...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value),
|
|
34
22
|
...COMPONENT_SCHEMA.subtype.presentation.map(({ value }) => value),
|
|
35
|
-
|
|
36
|
-
'DATA_CAPTURE',
|
|
37
|
-
'SUMMARY',
|
|
38
|
-
'CASEVIEW',
|
|
39
|
-
'DATAVIEW',
|
|
40
|
-
'LIST'
|
|
41
|
-
])
|
|
23
|
+
]),
|
|
42
24
|
];
|
|
43
25
|
|
|
44
26
|
const schema = {
|
|
@@ -56,7 +38,7 @@ const schema = {
|
|
|
56
38
|
subtype: {
|
|
57
39
|
anyOf: [{ type: 'string' }, { type: 'array' }],
|
|
58
40
|
|
|
59
|
-
enum: allowedSubtypes
|
|
41
|
+
enum: allowedSubtypes,
|
|
60
42
|
},
|
|
61
43
|
icon: { type: 'string' },
|
|
62
44
|
properties: {
|
|
@@ -69,9 +51,9 @@ const schema = {
|
|
|
69
51
|
properties: {
|
|
70
52
|
name: { type: 'string' },
|
|
71
53
|
label: { type: 'string' },
|
|
72
|
-
format: { type: 'string' }
|
|
54
|
+
format: { type: 'string' },
|
|
73
55
|
},
|
|
74
|
-
required: ['name', 'label', 'format']
|
|
56
|
+
required: ['name', 'label', 'format'],
|
|
75
57
|
},
|
|
76
58
|
{
|
|
77
59
|
type: 'object',
|
|
@@ -82,9 +64,9 @@ const schema = {
|
|
|
82
64
|
properties: {
|
|
83
65
|
name: { type: 'string' },
|
|
84
66
|
label: { type: 'string' },
|
|
85
|
-
format: { type: 'string' }
|
|
67
|
+
format: { type: 'string' },
|
|
86
68
|
},
|
|
87
|
-
required: ['name', 'label', 'format']
|
|
69
|
+
required: ['name', 'label', 'format'],
|
|
88
70
|
},
|
|
89
71
|
cascadeElements: {
|
|
90
72
|
type: 'array',
|
|
@@ -97,150 +79,15 @@ const schema = {
|
|
|
97
79
|
key: { type: 'string' },
|
|
98
80
|
name: { type: 'string' },
|
|
99
81
|
label: { type: 'string' },
|
|
100
|
-
format: { type: 'string' }
|
|
101
|
-
},
|
|
102
|
-
required: ['key', 'name', 'label', 'format']
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
required: ['format']
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
type: 'object',
|
|
112
|
-
properties: {
|
|
113
|
-
label: { type: 'string' },
|
|
114
|
-
format: { type: 'string' },
|
|
115
|
-
properties: {
|
|
116
|
-
type: 'array',
|
|
117
|
-
uniqueItems: true,
|
|
118
|
-
items: {
|
|
119
|
-
anyOf: [
|
|
120
|
-
{
|
|
121
|
-
type: 'object',
|
|
122
|
-
properties: {
|
|
123
|
-
name: { type: 'string' },
|
|
124
|
-
label: { type: 'string' },
|
|
125
|
-
format: { type: 'string' }
|
|
126
|
-
},
|
|
127
|
-
required: ['name', 'label', 'format']
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
type: 'object',
|
|
131
|
-
properties: {
|
|
132
|
-
variant: { type: 'string' },
|
|
133
|
-
label: { type: 'string' },
|
|
134
|
-
format: { type: 'string' }
|
|
135
|
-
},
|
|
136
|
-
required: ['variant', 'label', 'format']
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
type: 'object',
|
|
140
|
-
properties: {
|
|
141
82
|
format: { type: 'string' },
|
|
142
|
-
elements: {
|
|
143
|
-
type: 'array',
|
|
144
|
-
uniqueItems: true,
|
|
145
|
-
items: {
|
|
146
|
-
anyOf: [
|
|
147
|
-
{
|
|
148
|
-
type: 'object',
|
|
149
|
-
properties: {
|
|
150
|
-
key: { type: 'string' },
|
|
151
|
-
name: { type: 'string' },
|
|
152
|
-
label: { type: 'string' },
|
|
153
|
-
format: { type: 'string' },
|
|
154
|
-
variant: { type: 'string' }
|
|
155
|
-
},
|
|
156
|
-
required: ['key', 'format', 'label']
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
83
|
},
|
|
162
|
-
required: ['
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
required: ['label', 'format']
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
defaultConfig: { type: 'object' }
|
|
174
|
-
},
|
|
175
|
-
required: ['componentKey', 'name', 'description', 'type', 'subtype', 'properties'],
|
|
176
|
-
additionalProperties: true
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const overrideSchema = {
|
|
180
|
-
type: 'object',
|
|
181
|
-
properties: {
|
|
182
|
-
baseComponentName: { type: 'string' },
|
|
183
|
-
componentKey: { type: 'string', pattern: '^[A-Za-z0-9]+$' },
|
|
184
|
-
name: { type: 'string', pattern: '^[A-Za-z0-9]+$' },
|
|
185
|
-
label: { type: 'string' },
|
|
186
|
-
description: { type: 'string' },
|
|
187
|
-
organization: { type: 'string' },
|
|
188
|
-
version: { type: 'string' },
|
|
189
|
-
library: { type: 'string' },
|
|
190
|
-
type: { type: 'string', enum: COMPONENT_SCHEMA.type.map(({ value }) => value) },
|
|
191
|
-
subtype: {
|
|
192
|
-
anyOf: [{ type: 'string' }, { type: 'array' }],
|
|
193
|
-
|
|
194
|
-
enum: allowedOverrideSubtypes
|
|
195
|
-
},
|
|
196
|
-
icon: { type: 'string' },
|
|
197
|
-
properties: {
|
|
198
|
-
type: 'array',
|
|
199
|
-
uniqueItems: true,
|
|
200
|
-
items: {
|
|
201
|
-
anyOf: [
|
|
202
|
-
{
|
|
203
|
-
type: 'object',
|
|
204
|
-
properties: {
|
|
205
|
-
name: { type: 'string' },
|
|
206
|
-
label: { type: 'string' },
|
|
207
|
-
format: { type: 'string' }
|
|
208
|
-
},
|
|
209
|
-
required: ['name', 'label', 'format']
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
type: 'object',
|
|
213
|
-
properties: {
|
|
214
|
-
format: { type: 'string' },
|
|
215
|
-
source: {
|
|
216
|
-
type: 'object',
|
|
217
|
-
properties: {
|
|
218
|
-
name: { type: 'string' },
|
|
219
|
-
label: { type: 'string' },
|
|
220
|
-
format: { type: 'string' }
|
|
84
|
+
required: ['key', 'name', 'label', 'format'],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
221
87
|
},
|
|
222
|
-
required: ['name', 'label', 'format']
|
|
223
88
|
},
|
|
224
|
-
cascadeElements: {
|
|
225
|
-
type: 'array',
|
|
226
|
-
uniqueItems: true,
|
|
227
|
-
items: {
|
|
228
|
-
anyOf: [
|
|
229
|
-
{
|
|
230
|
-
type: 'object',
|
|
231
|
-
properties: {
|
|
232
|
-
key: { type: 'string' },
|
|
233
|
-
name: { type: 'string' },
|
|
234
|
-
label: { type: 'string' },
|
|
235
|
-
format: { type: 'string' }
|
|
236
|
-
},
|
|
237
|
-
required: ['key', 'name', 'label', 'format']
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
89
|
},
|
|
243
|
-
required: ['format']
|
|
90
|
+
required: ['format'],
|
|
244
91
|
},
|
|
245
92
|
{
|
|
246
93
|
type: 'object',
|
|
@@ -257,18 +104,18 @@ const overrideSchema = {
|
|
|
257
104
|
properties: {
|
|
258
105
|
name: { type: 'string' },
|
|
259
106
|
label: { type: 'string' },
|
|
260
|
-
format: { type: 'string' }
|
|
107
|
+
format: { type: 'string' },
|
|
261
108
|
},
|
|
262
|
-
required: ['name', 'label', 'format']
|
|
109
|
+
required: ['name', 'label', 'format'],
|
|
263
110
|
},
|
|
264
111
|
{
|
|
265
112
|
type: 'object',
|
|
266
113
|
properties: {
|
|
267
114
|
variant: { type: 'string' },
|
|
268
115
|
label: { type: 'string' },
|
|
269
|
-
format: { type: 'string' }
|
|
116
|
+
format: { type: 'string' },
|
|
270
117
|
},
|
|
271
|
-
required: ['variant', 'label', 'format']
|
|
118
|
+
required: ['variant', 'label', 'format'],
|
|
272
119
|
},
|
|
273
120
|
{
|
|
274
121
|
type: 'object',
|
|
@@ -286,33 +133,32 @@ const overrideSchema = {
|
|
|
286
133
|
name: { type: 'string' },
|
|
287
134
|
label: { type: 'string' },
|
|
288
135
|
format: { type: 'string' },
|
|
289
|
-
variant: { type: 'string' }
|
|
136
|
+
variant: { type: 'string' },
|
|
290
137
|
},
|
|
291
|
-
required: ['key', 'format', 'label']
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
}
|
|
295
|
-
}
|
|
138
|
+
required: ['key', 'format', 'label'],
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
296
143
|
},
|
|
297
|
-
required: ['format', 'elements']
|
|
298
|
-
}
|
|
299
|
-
]
|
|
300
|
-
}
|
|
301
|
-
}
|
|
144
|
+
required: ['format', 'elements'],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
302
149
|
},
|
|
303
|
-
required: ['label', 'format']
|
|
304
|
-
}
|
|
305
|
-
]
|
|
306
|
-
}
|
|
150
|
+
required: ['label', 'format'],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
307
154
|
},
|
|
308
|
-
defaultConfig: { type: 'object' }
|
|
155
|
+
defaultConfig: { type: 'object' },
|
|
309
156
|
},
|
|
310
|
-
required: ['name', '
|
|
311
|
-
additionalProperties: true
|
|
157
|
+
required: ['componentKey', 'name', 'description', 'type', 'subtype', 'properties'],
|
|
158
|
+
additionalProperties: true,
|
|
312
159
|
};
|
|
313
160
|
|
|
314
161
|
const validateSchema = ajv.compile(schema);
|
|
315
|
-
const validateOverrideSchema = ajv.compile(overrideSchema);
|
|
316
162
|
|
|
317
163
|
/**
|
|
318
164
|
* Validates that a Presentation component uses only allowed subtypes, and that
|
|
@@ -323,20 +169,20 @@ export function validatePresentationSubtype(data) {
|
|
|
323
169
|
const presentationSubtypes = COMPONENT_SCHEMA.subtype.presentation.map(({ value }) => value);
|
|
324
170
|
if (data.type === 'Presentation' && !presentationSubtypes.includes(data.subtype)) {
|
|
325
171
|
throw new Error(
|
|
326
|
-
`Error: Invalid subtype '${data.subtype}' for Presentation component '${data.name}'.\n --> Allowed subtypes for Presentation are: ${presentationSubtypes.join(', ')}
|
|
172
|
+
`Error: Invalid subtype '${data.subtype}' for Presentation component '${data.name}'.\n --> Allowed subtypes for Presentation are: ${presentationSubtypes.join(', ')}.`,
|
|
327
173
|
);
|
|
328
174
|
}
|
|
329
175
|
if (data.type !== 'Presentation' && presentationSubtypes.includes(data.subtype)) {
|
|
330
176
|
throw new Error(
|
|
331
|
-
`Error: Subtype '${data.subtype}' is only allowed for Presentation components. Component '${data.name}' has type '${data.type}'
|
|
177
|
+
`Error: Subtype '${data.subtype}' is only allowed for Presentation components. Component '${data.name}' has type '${data.type}'.`,
|
|
332
178
|
);
|
|
333
179
|
}
|
|
334
180
|
}
|
|
335
181
|
|
|
336
|
-
export default async option => {
|
|
182
|
+
export default async (option) => {
|
|
337
183
|
// addDebugLog("validate","", "");
|
|
338
184
|
|
|
339
|
-
let componentToValidate
|
|
185
|
+
let componentToValidate;
|
|
340
186
|
let throwTheError = false;
|
|
341
187
|
if (option.params && option.params[3]) {
|
|
342
188
|
componentToValidate = option.params[3];
|
|
@@ -347,7 +193,7 @@ export default async option => {
|
|
|
347
193
|
name: 'component',
|
|
348
194
|
type: 'rawlist',
|
|
349
195
|
message: 'Select component to validate',
|
|
350
|
-
choices: localComponents
|
|
196
|
+
choices: localComponents,
|
|
351
197
|
});
|
|
352
198
|
|
|
353
199
|
componentToValidate = answer.component;
|
|
@@ -368,7 +214,7 @@ export default async option => {
|
|
|
368
214
|
const arPrefix = componentToValidate.split('_');
|
|
369
215
|
const sPrefix = `${arPrefix[0]}_${arPrefix[1]}`;
|
|
370
216
|
throw new Error(
|
|
371
|
-
`Component: ${componentToValidate} prefix invalid.\n --> '${sPrefix}' prefix does not match configuration '${configDef.currentOrgLib}'. \n --> Org_Lib prefix of component must match Organization and Library values \n --> in package.json and tasks.config.json respectively
|
|
217
|
+
`Component: ${componentToValidate} prefix invalid.\n --> '${sPrefix}' prefix does not match configuration '${configDef.currentOrgLib}'. \n --> Org_Lib prefix of component must match Organization and Library values \n --> in package.json and tasks.config.json respectively.`,
|
|
372
218
|
);
|
|
373
219
|
}
|
|
374
220
|
}
|
|
@@ -380,7 +226,7 @@ export default async option => {
|
|
|
380
226
|
let configData;
|
|
381
227
|
try {
|
|
382
228
|
configData = fs.readFileSync(path.resolve(configFile), 'utf8');
|
|
383
|
-
} catch
|
|
229
|
+
} catch {
|
|
384
230
|
// for now, if now file just end
|
|
385
231
|
console.log(`${chalk.bold.yellow(`Config file not available for: ${componentToValidate}`)}`);
|
|
386
232
|
return;
|
|
@@ -391,7 +237,7 @@ export default async option => {
|
|
|
391
237
|
try {
|
|
392
238
|
data = JSON.parse(configData);
|
|
393
239
|
} catch (er) {
|
|
394
|
-
throw new Error(`Invalid schema json in config.json: ${er}
|
|
240
|
+
throw new Error(`Invalid schema json in config.json: ${er}`, { cause: er });
|
|
395
241
|
}
|
|
396
242
|
|
|
397
243
|
const valid = validateSchema(data);
|
|
@@ -406,11 +252,11 @@ export default async option => {
|
|
|
406
252
|
if (componentToValidate && !/^[A-Za-z0-9]+_[A-Za-z0-9]+_[A-Za-z0-9]+$/.test(componentToValidate)) {
|
|
407
253
|
if (throwTheError) {
|
|
408
254
|
throw new Error(
|
|
409
|
-
`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}
|
|
255
|
+
`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}`,
|
|
410
256
|
);
|
|
411
257
|
}
|
|
412
258
|
console.log(
|
|
413
|
-
`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}
|
|
259
|
+
`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}`,
|
|
414
260
|
);
|
|
415
261
|
process.exit(1);
|
|
416
262
|
}
|
|
@@ -418,13 +264,13 @@ export default async option => {
|
|
|
418
264
|
if (isLibraryBasedCL) {
|
|
419
265
|
if (data.library !== configDef.library) {
|
|
420
266
|
throw new Error(
|
|
421
|
-
`${chalk.redBright(`Error: Invalid library in config.json for component '${data.name}'.\n -->Library: '${data.library}' must match tasks.config library: '${configDef.library}'.`)}
|
|
267
|
+
`${chalk.redBright(`Error: Invalid library in config.json for component '${data.name}'.\n -->Library: '${data.library}' must match tasks.config library: '${configDef.library}'.`)}`,
|
|
422
268
|
);
|
|
423
269
|
}
|
|
424
270
|
|
|
425
271
|
if (data.organization !== configDef.organization) {
|
|
426
272
|
throw new Error(
|
|
427
|
-
`${chalk.redBright(`Error: Invalid organization in config.json for component '${data.name}'.\n -->Organization: '${data.organization}' must match package.json organization: '${configDef.organization}'.`)}
|
|
273
|
+
`${chalk.redBright(`Error: Invalid organization in config.json for component '${data.name}'.\n -->Organization: '${data.organization}' must match package.json organization: '${configDef.organization}'.`)}`,
|
|
428
274
|
);
|
|
429
275
|
}
|
|
430
276
|
|
|
@@ -432,31 +278,31 @@ export default async option => {
|
|
|
432
278
|
const arPrefix = data.componentKey.split('_');
|
|
433
279
|
const sPrefix = `${arPrefix[0]}_${arPrefix[1]}`;
|
|
434
280
|
throw new Error(
|
|
435
|
-
`${chalk.redBright(`Error: Invalid componentKey in config.json for component '${data.name}'.\n --> Component prefix Org_Lib: '${sPrefix}' must match '${configDef.currentOrgLib}'. \n --> These represent organization and library values found in package.json and tasks.config.json respectively. `)}
|
|
281
|
+
`${chalk.redBright(`Error: Invalid componentKey in config.json for component '${data.name}'.\n --> Component prefix Org_Lib: '${sPrefix}' must match '${configDef.currentOrgLib}'. \n --> These represent organization and library values found in package.json and tasks.config.json respectively. `)}`,
|
|
436
282
|
);
|
|
437
283
|
}
|
|
438
284
|
|
|
439
285
|
if (data.componentKey !== componentToValidate) {
|
|
440
286
|
throw new Error(
|
|
441
|
-
`${chalk.redBright(`Error: Invalid folder name or componentKey in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match component key '${data.componentKey}'.\n --> NOTE: Values are case
|
|
287
|
+
`${chalk.redBright(`Error: Invalid folder name or componentKey in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match component key '${data.componentKey}'.\n --> NOTE: Values are case sensitive.`)}`,
|
|
442
288
|
);
|
|
443
289
|
}
|
|
444
290
|
|
|
445
291
|
if (data.name !== componentToValidate) {
|
|
446
292
|
throw new Error(
|
|
447
|
-
`${chalk.redBright(`Error: Invalid folder name or name in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match name '${data.name}'.\n --> NOTE: Values are case
|
|
293
|
+
`${chalk.redBright(`Error: Invalid folder name or name in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match name '${data.name}'.\n --> NOTE: Values are case sensitive.`)}`,
|
|
448
294
|
);
|
|
449
295
|
}
|
|
450
296
|
} else {
|
|
451
297
|
if (data.componentKey !== componentToValidate) {
|
|
452
298
|
throw new Error(
|
|
453
|
-
`${chalk.redBright(`Error: Invalid folder name or componentKey in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match component key '${data.componentKey}'.\n --> NOTE: Values are case
|
|
299
|
+
`${chalk.redBright(`Error: Invalid folder name or componentKey in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match component key '${data.componentKey}'.\n --> NOTE: Values are case sensitive.`)}`,
|
|
454
300
|
);
|
|
455
301
|
}
|
|
456
302
|
|
|
457
303
|
if (data.name !== componentToValidate) {
|
|
458
304
|
throw new Error(
|
|
459
|
-
`${chalk.redBright(`Error: Invalid folder name or name in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match name '${data.name}'.\n --> NOTE: Values are case
|
|
305
|
+
`${chalk.redBright(`Error: Invalid folder name or name in config.json for component '${data.name}'.\n --> Component folder name: '${componentToValidate}' must match name '${data.name}'.\n --> NOTE: Values are case sensitive.`)}`,
|
|
460
306
|
);
|
|
461
307
|
}
|
|
462
308
|
}
|