@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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getC11NB2STokenAndStaticServer,
|
|
8
8
|
getApplicationAndVersionFromToken,
|
|
9
9
|
constructCompleteUrl,
|
|
10
|
-
getFetchAgent
|
|
10
|
+
getFetchAgent,
|
|
11
11
|
} from '../../util.js';
|
|
12
12
|
|
|
13
13
|
import { listLibJSONResponse } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
@@ -15,10 +15,10 @@ import { LIST_COMPONENT_LIBRARIES_SERVICE_REST_ENDPOINT, TOKEN_PATH } from '../.
|
|
|
15
15
|
|
|
16
16
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
17
17
|
SERVER: 'Server',
|
|
18
|
-
LOCAL: 'Local'
|
|
18
|
+
LOCAL: 'Local',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const getListLibraryQuestions = async libraryName => {
|
|
21
|
+
export const getListLibraryQuestions = async (libraryName) => {
|
|
22
22
|
addDebugLog('getListLibraryQuestions', `libraryName: ${libraryName}`, '');
|
|
23
23
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
24
24
|
|
|
@@ -28,8 +28,8 @@ export const getListLibraryQuestions = async libraryName => {
|
|
|
28
28
|
type: 'rawlist',
|
|
29
29
|
message: `List library ${chalk.bold.green(`${libraryName}`)} from Server or Local ?`,
|
|
30
30
|
choices: Object.values(SOURCE_OF_COMPONENT_TYPES),
|
|
31
|
-
default: defaultPegaConfig.sourceOfComponents
|
|
32
|
-
}
|
|
31
|
+
default: defaultPegaConfig.sourceOfComponents,
|
|
32
|
+
},
|
|
33
33
|
];
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -40,8 +40,8 @@ export const getLibraryVersionQuestion = async (libraryName, libVersions) => {
|
|
|
40
40
|
name: 'version',
|
|
41
41
|
type: 'rawlist',
|
|
42
42
|
message: `Select ${chalk.green.bold(`${libraryName}`)} library version (or ALL) to delete`,
|
|
43
|
-
choices: libVersions
|
|
44
|
-
}
|
|
43
|
+
choices: libVersions,
|
|
44
|
+
},
|
|
45
45
|
];
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -55,8 +55,8 @@ export const getServerLocalQuestion = async () => {
|
|
|
55
55
|
type: 'rawlist',
|
|
56
56
|
message: `List from Server or Local ?`,
|
|
57
57
|
choices: Object.values(SOURCE_OF_COMPONENT_TYPES),
|
|
58
|
-
default: 'defaultPegaConfig.sourceOfComponents'
|
|
59
|
-
}
|
|
58
|
+
default: 'defaultPegaConfig.sourceOfComponents',
|
|
59
|
+
},
|
|
60
60
|
];
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -81,9 +81,9 @@ async function fetchComponentLibrariesFromInfinity(apiUrl, headers) {
|
|
|
81
81
|
fetch(apiUrl, {
|
|
82
82
|
method: 'GET',
|
|
83
83
|
dispatcher: getFetchAgent(serverConfig),
|
|
84
|
-
headers
|
|
84
|
+
headers,
|
|
85
85
|
})
|
|
86
|
-
.then(response => {
|
|
86
|
+
.then((response) => {
|
|
87
87
|
status = response.status;
|
|
88
88
|
if (status === 401) {
|
|
89
89
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -94,9 +94,16 @@ async function fetchComponentLibrariesFromInfinity(apiUrl, headers) {
|
|
|
94
94
|
} else if (status === 408) {
|
|
95
95
|
throw new Error('408: Server timed out');
|
|
96
96
|
}
|
|
97
|
-
return response.
|
|
97
|
+
return response.text().then((text) => {
|
|
98
|
+
try {
|
|
99
|
+
return JSON.parse(text);
|
|
100
|
+
} catch {
|
|
101
|
+
// Server returns an HTML login page when the session is not valid
|
|
102
|
+
throw new Error(`Unexpected non-JSON response from server (status ${status}). Please reauthenticate using: npm run authenticate`);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
98
105
|
})
|
|
99
|
-
.then(resp => {
|
|
106
|
+
.then((resp) => {
|
|
100
107
|
// const respData = JSON.parse(resp);
|
|
101
108
|
if (status === 401) {
|
|
102
109
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -109,7 +116,7 @@ async function fetchComponentLibrariesFromInfinity(apiUrl, headers) {
|
|
|
109
116
|
}
|
|
110
117
|
})
|
|
111
118
|
|
|
112
|
-
.catch(e => reject(`${chalk.bold.red(e)}`));
|
|
119
|
+
.catch((e) => reject(`${chalk.bold.red(e)}`));
|
|
113
120
|
});
|
|
114
121
|
}
|
|
115
122
|
|
|
@@ -144,8 +151,8 @@ export const getInfinityLibraries = async () => {
|
|
|
144
151
|
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
145
152
|
|
|
146
153
|
fetchComponentLibrariesFromInfinity(url, headers)
|
|
147
|
-
.then(response => resolve(response))
|
|
148
|
-
.catch(e => reject(e));
|
|
154
|
+
.then((response) => resolve(response))
|
|
155
|
+
.catch((e) => reject(e));
|
|
149
156
|
}
|
|
150
157
|
});
|
|
151
158
|
} catch (error) {
|
|
@@ -14,14 +14,15 @@ import {
|
|
|
14
14
|
cleanUpTemp,
|
|
15
15
|
getPegaServerConfig,
|
|
16
16
|
getLibraryBasedCL,
|
|
17
|
-
getApplicationAndVersionFromToken
|
|
17
|
+
getApplicationAndVersionFromToken,
|
|
18
|
+
checkAccessTokenExpiration,
|
|
18
19
|
} from '../../util.js';
|
|
19
20
|
|
|
20
21
|
import { listLibJSONResponse } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
21
22
|
|
|
22
23
|
import { SOURCE_OF_COMPONENT_TYPES, getServerLibraries, getInfinityLibraries, getServerLocalQuestion } from './helper.js';
|
|
23
24
|
|
|
24
|
-
export const getServerLibraryVersions = async libraryName => {
|
|
25
|
+
export const getServerLibraryVersions = async (libraryName) => {
|
|
25
26
|
addDebugLog('getServerLibraryVersions', `libraryName: ${libraryName}`, '');
|
|
26
27
|
|
|
27
28
|
// server
|
|
@@ -44,7 +45,7 @@ export const getServerLibraryVersions = async libraryName => {
|
|
|
44
45
|
return versionList;
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
export default async options => {
|
|
48
|
+
export default async (options) => {
|
|
48
49
|
const isLibraryBased = getLibraryBased();
|
|
49
50
|
if (!isLibraryBased) {
|
|
50
51
|
console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`);
|
|
@@ -90,8 +91,8 @@ export default async options => {
|
|
|
90
91
|
name: 'library',
|
|
91
92
|
type: 'rawlist',
|
|
92
93
|
message: 'Pick library',
|
|
93
|
-
choices: arLibs
|
|
94
|
-
}
|
|
94
|
+
choices: arLibs,
|
|
95
|
+
},
|
|
95
96
|
]);
|
|
96
97
|
|
|
97
98
|
libraryName = libAnswers.library;
|
|
@@ -110,8 +111,8 @@ export default async options => {
|
|
|
110
111
|
name: 'libVersion',
|
|
111
112
|
type: 'rawlist',
|
|
112
113
|
message: 'Enter version',
|
|
113
|
-
choices: libVersions
|
|
114
|
-
}
|
|
114
|
+
choices: libVersions,
|
|
115
|
+
},
|
|
115
116
|
]);
|
|
116
117
|
|
|
117
118
|
selectedVersion = libAnswers.libVersion;
|
|
@@ -126,12 +127,12 @@ export default async options => {
|
|
|
126
127
|
builtOn = new Date(data[0].buildDate);
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
let libData = data.map(component => ({
|
|
130
|
+
let libData = data.map((component) => ({
|
|
130
131
|
Component: component.name,
|
|
131
132
|
Label: component.label,
|
|
132
133
|
Version: component.version,
|
|
133
134
|
Type: component.type,
|
|
134
|
-
'Sub Type': component.subtype
|
|
135
|
+
'Sub Type': component.subtype,
|
|
135
136
|
}));
|
|
136
137
|
console.log(chalk.bold.blueBright(`\nList of ${chalk.inverse(`Local`)} ${libraryName}:${selectedVersion} components built on ${builtOn}.`));
|
|
137
138
|
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
|
@@ -146,6 +147,8 @@ export default async options => {
|
|
|
146
147
|
console.log(chalk.redBright(`\nNo local libraries exist.`));
|
|
147
148
|
}
|
|
148
149
|
} else {
|
|
150
|
+
await checkAccessTokenExpiration();
|
|
151
|
+
|
|
149
152
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
150
153
|
if (isLibraryBasedCL) {
|
|
151
154
|
const arLibs = await getInfinityLibraries();
|
|
@@ -155,7 +158,7 @@ export default async options => {
|
|
|
155
158
|
// const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
|
|
156
159
|
const libs = arLibs.pxResults.map((oLib, index) => ({
|
|
157
160
|
name: `${oLib.pyLabel} (${oLib.pyRuleSet}:${oLib.pyRuleSetVersion})`,
|
|
158
|
-
value: index
|
|
161
|
+
value: index,
|
|
159
162
|
}));
|
|
160
163
|
|
|
161
164
|
const serverConfig = await getPegaServerConfig();
|
|
@@ -168,8 +171,8 @@ export default async options => {
|
|
|
168
171
|
name: 'library',
|
|
169
172
|
type: 'rawlist',
|
|
170
173
|
message: 'Pick component library',
|
|
171
|
-
choices: libs
|
|
172
|
-
}
|
|
174
|
+
choices: libs,
|
|
175
|
+
},
|
|
173
176
|
]);
|
|
174
177
|
|
|
175
178
|
const libraryIndex = libAnswers.library;
|
|
@@ -185,15 +188,15 @@ export default async options => {
|
|
|
185
188
|
builtOn = new Date(data[0].buildDate);
|
|
186
189
|
}
|
|
187
190
|
|
|
188
|
-
let libData = data.map(component => ({
|
|
191
|
+
let libData = data.map((component) => ({
|
|
189
192
|
Component: component.name,
|
|
190
193
|
Label: component.label,
|
|
191
194
|
Version: component.version,
|
|
192
195
|
Type: component.type,
|
|
193
|
-
'Sub Type': component.subtype
|
|
196
|
+
'Sub Type': component.subtype,
|
|
194
197
|
}));
|
|
195
198
|
console.log(
|
|
196
|
-
chalk.bold.blueBright(`\nList of ${library} from ${chalk.inverse(`${ruleSet}:${ruleSetVersion}`)} components built on ${builtOn}.`)
|
|
199
|
+
chalk.bold.blueBright(`\nList of ${library} from ${chalk.inverse(`${ruleSet}:${ruleSetVersion}`)} components built on ${builtOn}.`),
|
|
197
200
|
);
|
|
198
201
|
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
|
199
202
|
} else {
|
|
@@ -215,8 +218,8 @@ export default async options => {
|
|
|
215
218
|
name: 'library',
|
|
216
219
|
type: 'rawlist',
|
|
217
220
|
message: 'Pick library',
|
|
218
|
-
choices: arLibs
|
|
219
|
-
}
|
|
221
|
+
choices: arLibs,
|
|
222
|
+
},
|
|
220
223
|
]);
|
|
221
224
|
|
|
222
225
|
libraryName = libAnswers.library;
|
|
@@ -229,8 +232,8 @@ export default async options => {
|
|
|
229
232
|
name: 'libVersion',
|
|
230
233
|
type: 'rawlist',
|
|
231
234
|
message: 'Enter version',
|
|
232
|
-
choices: keys
|
|
233
|
-
}
|
|
235
|
+
choices: keys,
|
|
236
|
+
},
|
|
234
237
|
]);
|
|
235
238
|
|
|
236
239
|
const selectedVersion = libVersionAnswers.libVersion;
|
|
@@ -244,12 +247,12 @@ export default async options => {
|
|
|
244
247
|
builtOn = new data[0].buildDate();
|
|
245
248
|
}
|
|
246
249
|
|
|
247
|
-
let libData = data.map(component => ({
|
|
250
|
+
let libData = data.map((component) => ({
|
|
248
251
|
Component: component.name,
|
|
249
252
|
Label: component.label,
|
|
250
253
|
Version: component.version,
|
|
251
254
|
Type: component.type,
|
|
252
|
-
'Sub Type': component.subtype
|
|
255
|
+
'Sub Type': component.subtype,
|
|
253
256
|
}));
|
|
254
257
|
console.log(chalk.bold.blueBright(`\nList of ${libraryName}/${selectedVersion} components built on ${builtOn}.`));
|
|
255
258
|
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
package/src/tasks/move/helper.js
CHANGED
|
@@ -12,12 +12,12 @@ export const getComponentKeyQuestion = async (localComponents, copyMoveLC, param
|
|
|
12
12
|
pageSize: 15,
|
|
13
13
|
message: `Select component to ${copyMoveLC} ${orAll}`,
|
|
14
14
|
choices: localComponents,
|
|
15
|
-
when: () => !paramComponentKey
|
|
16
|
-
}
|
|
15
|
+
when: () => !paramComponentKey,
|
|
16
|
+
},
|
|
17
17
|
];
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const getLibraryQuestions = async archLibs => {
|
|
20
|
+
export const getLibraryQuestions = async (archLibs) => {
|
|
21
21
|
addDebugLog('getLibraryQuestions', '', '');
|
|
22
22
|
const configDef = getConfigDefaults();
|
|
23
23
|
|
|
@@ -26,8 +26,8 @@ export const getLibraryQuestions = async archLibs => {
|
|
|
26
26
|
name: 'libraryName',
|
|
27
27
|
type: 'rawlist',
|
|
28
28
|
message: 'Select library to move to',
|
|
29
|
-
choices: archLibs
|
|
30
|
-
}
|
|
29
|
+
choices: archLibs,
|
|
30
|
+
},
|
|
31
31
|
];
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -40,14 +40,14 @@ export const getLibraryVersionQuestion = async (libraryName, libVersions, copyOr
|
|
|
40
40
|
name: 'version',
|
|
41
41
|
type: 'rawlist',
|
|
42
42
|
message: `Select ${chalk.green.bold(`${libraryName}`)} library version to ${copyOrMove} to`,
|
|
43
|
-
choices: libVersions
|
|
43
|
+
choices: libVersions,
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
name: 'copyShared',
|
|
47
47
|
type: 'confirm',
|
|
48
48
|
message: `Copy ${chalk.yellow.bold('/shared')} directory (same named files will be overridden) ?`,
|
|
49
49
|
default: true,
|
|
50
|
-
when: answers => answers.version != configDef.buildVersion && libraryName != configDef.library
|
|
51
|
-
}
|
|
50
|
+
when: (answers) => answers.version != configDef.buildVersion && libraryName != configDef.library,
|
|
51
|
+
},
|
|
52
52
|
];
|
|
53
53
|
};
|
package/src/tasks/move/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
2
|
import { join } from 'path';
|
|
4
3
|
|
|
5
4
|
import inquirer from 'inquirer';
|
|
6
|
-
import ncp from 'ncp';
|
|
7
5
|
import chalk from 'chalk';
|
|
8
6
|
|
|
9
7
|
import {
|
|
@@ -20,7 +18,7 @@ import {
|
|
|
20
18
|
zipVersionAndArchive,
|
|
21
19
|
getLibraryArchivesVersions,
|
|
22
20
|
getLibraryArchiveDirectories,
|
|
23
|
-
cleanUpTemp
|
|
21
|
+
cleanUpTemp,
|
|
24
22
|
} from '../../util.js';
|
|
25
23
|
import { TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, ARCHIVES_PATH, TEMP_PATH } from '../../constants.js';
|
|
26
24
|
import { getComponentKeyQuestion, getLibraryQuestions, getLibraryVersionQuestion } from './helper.js';
|
|
@@ -31,12 +29,10 @@ const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
|
31
29
|
|
|
32
30
|
import { convertIntoPascalCase, getComponentDirectoryPath } from '../../util.js';
|
|
33
31
|
|
|
34
|
-
const copy = promisify(ncp);
|
|
35
|
-
|
|
36
32
|
export const updateConfig = async (
|
|
37
33
|
{ oldComponentKey, newComponentKey, compName, library, version, compLabel, targetDirectory },
|
|
38
34
|
options,
|
|
39
|
-
onlyCompanion = false
|
|
35
|
+
onlyCompanion = false,
|
|
40
36
|
) => {
|
|
41
37
|
addDebugLog('updateConfig', `oldComponentKey: ${oldComponentKey}, newComponentKey: ${newComponentKey}`, '');
|
|
42
38
|
|
|
@@ -56,7 +52,7 @@ export const updateConfig = async (
|
|
|
56
52
|
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
57
53
|
fs.writeFileSync(join(targetDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
|
|
58
54
|
encoding: 'utf8',
|
|
59
|
-
flag: 'w'
|
|
55
|
+
flag: 'w',
|
|
60
56
|
});
|
|
61
57
|
};
|
|
62
58
|
|
|
@@ -64,7 +60,7 @@ export const updateFile = async (fileName, oldComponentKeyPC, newComponentKeyPC,
|
|
|
64
60
|
addDebugLog(
|
|
65
61
|
'updateFile',
|
|
66
62
|
`fileName: ${fileName}, oldComponentKeyPC: ${oldComponentKeyPC}, newComponentKeyPC: ${newComponentKeyPC}, targetDirectory: ${targetDirectory}`,
|
|
67
|
-
''
|
|
63
|
+
'',
|
|
68
64
|
);
|
|
69
65
|
|
|
70
66
|
let fileData = fs.readFileSync(join(targetDirectory, '/', fileName), { encoding: 'utf8' });
|
|
@@ -122,9 +118,9 @@ export const renameComponent = async (componentKey, library, version, copyMove,
|
|
|
122
118
|
library,
|
|
123
119
|
version,
|
|
124
120
|
compLabel,
|
|
125
|
-
targetDirectory
|
|
121
|
+
targetDirectory,
|
|
126
122
|
},
|
|
127
|
-
options
|
|
123
|
+
options,
|
|
128
124
|
);
|
|
129
125
|
} else {
|
|
130
126
|
await updateFile(fileName, oldComponentKeyPC, newComponentKeyPC, targetDirectory);
|
|
@@ -159,7 +155,7 @@ export const moveComp = async (componentKey, copyMove, orgLibName, version, copy
|
|
|
159
155
|
newComponentKey = await localMoveCopyComp(localComponentKey.value, orgLibName, version, copyMove, currentDirectory, tempDirectory);
|
|
160
156
|
if (newComponentKey) {
|
|
161
157
|
console.log(
|
|
162
|
-
`${copiedOrMoved} ${chalk.green(`${localComponentKey.value}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}
|
|
158
|
+
`${copiedOrMoved} ${chalk.green(`${localComponentKey.value}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}`,
|
|
163
159
|
);
|
|
164
160
|
} else {
|
|
165
161
|
console.log(chalk.yellow(`Not ${copiedOrMoved}`));
|
|
@@ -193,7 +189,7 @@ export const moveComp = async (componentKey, copyMove, orgLibName, version, copy
|
|
|
193
189
|
}
|
|
194
190
|
|
|
195
191
|
console.log(
|
|
196
|
-
`\n${copiedOrMoved} ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n
|
|
192
|
+
`\n${copiedOrMoved} ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n`,
|
|
197
193
|
);
|
|
198
194
|
|
|
199
195
|
// rearchive temp directory
|
|
@@ -203,7 +199,7 @@ export const moveComp = async (componentKey, copyMove, orgLibName, version, copy
|
|
|
203
199
|
if (orgLibName === configDef.currentOrgLib && version === configDef.buildVersion && copyMove === 'Copy') {
|
|
204
200
|
fs.cpSync(join(tempCompPath, newComponentKey), join(currentCompPath, newComponentKey), {
|
|
205
201
|
recursive: true,
|
|
206
|
-
force: true
|
|
202
|
+
force: true,
|
|
207
203
|
});
|
|
208
204
|
}
|
|
209
205
|
} else {
|
|
@@ -234,7 +230,7 @@ export const localMoveCopyComp = async (componentKey, orgLibName, version, copyM
|
|
|
234
230
|
{
|
|
235
231
|
name: 'componentName',
|
|
236
232
|
message: 'Enter component name (required)',
|
|
237
|
-
validate: value => {
|
|
233
|
+
validate: (value) => {
|
|
238
234
|
/* value should not be empty
|
|
239
235
|
It should not have spaces
|
|
240
236
|
It should not start with a number
|
|
@@ -244,18 +240,18 @@ export const localMoveCopyComp = async (componentKey, orgLibName, version, copyM
|
|
|
244
240
|
return true;
|
|
245
241
|
}
|
|
246
242
|
return 'Only alphanumeric values are allowed, starting with alphabets, no spaces.';
|
|
247
|
-
}
|
|
243
|
+
},
|
|
248
244
|
},
|
|
249
245
|
{
|
|
250
246
|
name: 'componentLabel',
|
|
251
247
|
message: 'Enter component label for display (required)',
|
|
252
|
-
validate: value => {
|
|
248
|
+
validate: (value) => {
|
|
253
249
|
if (value) {
|
|
254
250
|
return true;
|
|
255
251
|
}
|
|
256
252
|
return 'Please provide value for label';
|
|
257
|
-
}
|
|
258
|
-
}
|
|
253
|
+
},
|
|
254
|
+
},
|
|
259
255
|
]);
|
|
260
256
|
|
|
261
257
|
//
|
|
@@ -267,8 +263,8 @@ export const localMoveCopyComp = async (componentKey, orgLibName, version, copyM
|
|
|
267
263
|
name: 'confirmOverride',
|
|
268
264
|
type: 'confirm',
|
|
269
265
|
message: `Component ${chalk.yellow(`${tempCompName}`)} currently exists in ${chalk.yellow(`${orgLibName}/${version}`)}, override?`,
|
|
270
|
-
default: false
|
|
271
|
-
}
|
|
266
|
+
default: false,
|
|
267
|
+
},
|
|
272
268
|
]);
|
|
273
269
|
if (!answers.confirmOverride) {
|
|
274
270
|
return null;
|
|
@@ -284,7 +280,7 @@ export const localMoveCopyComp = async (componentKey, orgLibName, version, copyM
|
|
|
284
280
|
return newComponentKey;
|
|
285
281
|
};
|
|
286
282
|
|
|
287
|
-
export default async options => {
|
|
283
|
+
export default async (options) => {
|
|
288
284
|
await showVersion();
|
|
289
285
|
await checkLibraryAndArchives();
|
|
290
286
|
|
|
@@ -367,8 +363,8 @@ export default async options => {
|
|
|
367
363
|
type: 'rawlist',
|
|
368
364
|
message: 'Copy or Move',
|
|
369
365
|
choices: ['Copy', 'Move'],
|
|
370
|
-
default: 'Copy'
|
|
371
|
-
}
|
|
366
|
+
default: 'Copy',
|
|
367
|
+
},
|
|
372
368
|
];
|
|
373
369
|
|
|
374
370
|
const copyMoveAnswer = await inquirer.prompt(copyMoveQuestion);
|
|
@@ -23,11 +23,11 @@ export const copyWebPack = async () => {
|
|
|
23
23
|
name: 'override',
|
|
24
24
|
type: 'confirm',
|
|
25
25
|
message: `Overwrite`,
|
|
26
|
-
default: false
|
|
27
|
-
}
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
28
|
];
|
|
29
29
|
|
|
30
|
-
await inquirer.prompt(questions).then(async answers => {
|
|
30
|
+
await inquirer.prompt(questions).then(async (answers) => {
|
|
31
31
|
override = answers.override;
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -64,7 +64,7 @@ export const copyWebPack = async () => {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
export default async options => {
|
|
67
|
+
export default async (options) => {
|
|
68
68
|
const isLibraryBased = getLibraryBased();
|
|
69
69
|
if (isLibraryBased) {
|
|
70
70
|
console.log(`Command only supported for ${chalk.bold.green('non library mode')} components.`);
|