@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
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getDirectoryFiles,
|
|
15
15
|
setConfigImportRelativePath,
|
|
16
16
|
forceDefaultsUpdate,
|
|
17
|
-
constructCompleteUrl
|
|
17
|
+
constructCompleteUrl,
|
|
18
18
|
} from '../../util.js';
|
|
19
19
|
import {
|
|
20
20
|
TASKS_CONFIG_JSON_FILENAME,
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
PACKAGE_JSON_FILENAME,
|
|
23
23
|
LIST_COMPONENT_LIBRARY_ARCHIVES_SERVICE_REST_ENDPOINT,
|
|
24
24
|
COMPONENT_LIBRARY_ARCHIVE_SERVICE_REST_ENDPOINT,
|
|
25
|
-
TOKEN_PATH
|
|
25
|
+
TOKEN_PATH,
|
|
26
26
|
} from '../../constants.js';
|
|
27
27
|
|
|
28
28
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
29
29
|
SERVER: 'Server',
|
|
30
|
-
LOCAL: 'Local'
|
|
30
|
+
LOCAL: 'Local',
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const setTasksConfig = async (libraryName, version, devBuild, currDir) => {
|
|
@@ -74,7 +74,7 @@ export const updateConfig = async ({ oldComponentKey, newComponentKey, organizat
|
|
|
74
74
|
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
75
75
|
fs.writeFileSync(join(currentDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
|
|
76
76
|
encoding: 'utf8',
|
|
77
|
-
flag: 'w'
|
|
77
|
+
flag: 'w',
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ export const updateFile = async (fileName, oldComponentKeyPC, newComponentKeyPC,
|
|
|
82
82
|
addDebugLog(
|
|
83
83
|
'updateFile',
|
|
84
84
|
`fileName: ${fileName}, oldComponentKeyPC: ${oldComponentKeyPC}, newComponentKeyPC: ${newComponentKeyPC}, currentDirectory: ${currentDirectory}`,
|
|
85
|
-
''
|
|
85
|
+
'',
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
let fileData = fs.readFileSync(join(currentDirectory, '/', fileName), { encoding: 'utf8' });
|
|
@@ -147,7 +147,7 @@ export const renameComponent = async (componentKey, library, version, currDir) =
|
|
|
147
147
|
organization,
|
|
148
148
|
library,
|
|
149
149
|
version,
|
|
150
|
-
currentDirectory
|
|
150
|
+
currentDirectory,
|
|
151
151
|
});
|
|
152
152
|
} else {
|
|
153
153
|
await updateFile(fileName, oldComponentKeyPC, newComponentKeyPC, currentDirectory);
|
|
@@ -180,13 +180,13 @@ export const updateTempArchive = async (libraryName, version, devBuild) => {
|
|
|
180
180
|
title: 'Update tasks.config',
|
|
181
181
|
task: async () => {
|
|
182
182
|
await setTasksConfig(libraryName, justVersion, devBuild, tempStoreDirectory);
|
|
183
|
-
}
|
|
183
|
+
},
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
title: 'Update package.json',
|
|
187
187
|
task: async () => {
|
|
188
188
|
await setPackageOrg(configDef.organization, tempStoreDirectory);
|
|
189
|
-
}
|
|
189
|
+
},
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
title: `Renaming components`,
|
|
@@ -195,15 +195,15 @@ export const updateTempArchive = async (libraryName, version, devBuild) => {
|
|
|
195
195
|
const compList = await getComponents(compDir);
|
|
196
196
|
|
|
197
197
|
await renameComponents(compList, libraryName, version, compDir);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
200
|
],
|
|
201
201
|
{
|
|
202
|
-
exitOnError: true
|
|
203
|
-
}
|
|
202
|
+
exitOnError: true,
|
|
203
|
+
},
|
|
204
204
|
);
|
|
205
205
|
|
|
206
|
-
await tasks.run().catch(err => {
|
|
206
|
+
await tasks.run().catch((err) => {
|
|
207
207
|
console.log(chalk.bold.red(err.toString()));
|
|
208
208
|
process.exit(1);
|
|
209
209
|
});
|
|
@@ -219,10 +219,10 @@ export const getServerOrDirectoryQuestion = async () => {
|
|
|
219
219
|
message: `Import from`,
|
|
220
220
|
choices: [
|
|
221
221
|
{ name: 'Local directory', value: 'Directory' },
|
|
222
|
-
{ name: 'Server', value: 'Server' }
|
|
222
|
+
{ name: 'Server', value: 'Server' },
|
|
223
223
|
],
|
|
224
|
-
default: 'Directory'
|
|
225
|
-
}
|
|
224
|
+
default: 'Directory',
|
|
225
|
+
},
|
|
226
226
|
];
|
|
227
227
|
};
|
|
228
228
|
|
|
@@ -257,10 +257,10 @@ export const getFilePathQuestions = async () => {
|
|
|
257
257
|
type: 'fuzzypath',
|
|
258
258
|
message: 'Enter full file path of zip file location:',
|
|
259
259
|
default: defaultPath,
|
|
260
|
-
excludePath: nodePath => nodePath.startsWith('node_modules'),
|
|
260
|
+
excludePath: (nodePath) => nodePath.startsWith('node_modules'),
|
|
261
261
|
// excludePath :: (String) -> Bool
|
|
262
262
|
// excludePath to exclude some paths from the file-system scan
|
|
263
|
-
excludeFilter: nodePath => nodePath.indexOf('/.') >= 0,
|
|
263
|
+
excludeFilter: (nodePath) => nodePath.indexOf('/.') >= 0,
|
|
264
264
|
// excludeFilter :: (String) -> Bool
|
|
265
265
|
// excludeFilter to exclude some paths from the final list, e.g. '.'
|
|
266
266
|
itemType: 'directory',
|
|
@@ -274,15 +274,15 @@ export const getFilePathQuestions = async () => {
|
|
|
274
274
|
suggestOnly: false,
|
|
275
275
|
// suggestOnly :: Bool
|
|
276
276
|
// Restrict prompt answer to available choices or use them as suggestions
|
|
277
|
-
depthLimit: 2
|
|
277
|
+
depthLimit: 2,
|
|
278
278
|
// depthLimit :: integer >= 0
|
|
279
279
|
// Limit the depth of sub-folders to scan
|
|
280
280
|
// Defaults to infinite depth if undefined
|
|
281
|
-
}
|
|
281
|
+
},
|
|
282
282
|
];
|
|
283
283
|
};
|
|
284
284
|
|
|
285
|
-
export const getFileNameQuestions = async zipFileList => {
|
|
285
|
+
export const getFileNameQuestions = async (zipFileList) => {
|
|
286
286
|
addDebugLog('getFileNameQuestions', '', '');
|
|
287
287
|
|
|
288
288
|
return [
|
|
@@ -290,12 +290,12 @@ export const getFileNameQuestions = async zipFileList => {
|
|
|
290
290
|
name: 'fileName',
|
|
291
291
|
type: 'rawlist',
|
|
292
292
|
message: `Select zip file`,
|
|
293
|
-
choices: zipFileList
|
|
294
|
-
}
|
|
293
|
+
choices: zipFileList,
|
|
294
|
+
},
|
|
295
295
|
];
|
|
296
296
|
};
|
|
297
297
|
|
|
298
|
-
export const updateSavedFilePath = async filePath => {
|
|
298
|
+
export const updateSavedFilePath = async (filePath) => {
|
|
299
299
|
const currentDirectory = process.cwd();
|
|
300
300
|
const arPathParts = currentDirectory.split(path.sep);
|
|
301
301
|
|
|
@@ -341,9 +341,9 @@ async function fetchComponentLibraryArchivesFromInfinity(apiUrl, headers) {
|
|
|
341
341
|
fetch(apiUrl, {
|
|
342
342
|
method: 'GET',
|
|
343
343
|
dispatcher: getFetchAgent(serverConfig),
|
|
344
|
-
headers
|
|
344
|
+
headers,
|
|
345
345
|
})
|
|
346
|
-
.then(response => {
|
|
346
|
+
.then((response) => {
|
|
347
347
|
status = response.status;
|
|
348
348
|
if (status === 401) {
|
|
349
349
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -356,7 +356,7 @@ async function fetchComponentLibraryArchivesFromInfinity(apiUrl, headers) {
|
|
|
356
356
|
}
|
|
357
357
|
return response.json();
|
|
358
358
|
})
|
|
359
|
-
.then(resp => {
|
|
359
|
+
.then((resp) => {
|
|
360
360
|
// const respData = JSON.parse(resp);
|
|
361
361
|
if (status === 401) {
|
|
362
362
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -369,7 +369,7 @@ async function fetchComponentLibraryArchivesFromInfinity(apiUrl, headers) {
|
|
|
369
369
|
}
|
|
370
370
|
})
|
|
371
371
|
|
|
372
|
-
.catch(e => reject(`${chalk.bold.red(e)}`));
|
|
372
|
+
.catch((e) => reject(`${chalk.bold.red(e)}`));
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
|
|
@@ -392,8 +392,8 @@ export const getServerLibraryArchives = async () => {
|
|
|
392
392
|
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
393
393
|
|
|
394
394
|
fetchComponentLibraryArchivesFromInfinity(url, headers)
|
|
395
|
-
.then(response => resolve(response))
|
|
396
|
-
.catch(e => reject(e));
|
|
395
|
+
.then((response) => resolve(response))
|
|
396
|
+
.catch((e) => reject(e));
|
|
397
397
|
}
|
|
398
398
|
});
|
|
399
399
|
} catch (error) {
|
|
@@ -404,15 +404,15 @@ export const getServerLibraryArchives = async () => {
|
|
|
404
404
|
});
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
-
export const getLibraryArchiveQuestion = async archiveVersions => {
|
|
407
|
+
export const getLibraryArchiveQuestion = async (archiveVersions) => {
|
|
408
408
|
addDebugLog('getLibraryArchiveQuestion', `archiveVersions: ${archiveVersions}`, '');
|
|
409
409
|
return [
|
|
410
410
|
{
|
|
411
411
|
name: 'archiveData',
|
|
412
412
|
type: 'rawlist',
|
|
413
413
|
message: `Select an archive`,
|
|
414
|
-
choices: archiveVersions
|
|
415
|
-
}
|
|
414
|
+
choices: archiveVersions,
|
|
415
|
+
},
|
|
416
416
|
];
|
|
417
417
|
};
|
|
418
418
|
|
|
@@ -424,9 +424,9 @@ async function fetchComponentLibraryArchiveFromInfinity(apiUrl, headers) {
|
|
|
424
424
|
fetch(apiUrl, {
|
|
425
425
|
method: 'GET',
|
|
426
426
|
dispatcher: getFetchAgent(serverConfig),
|
|
427
|
-
headers
|
|
427
|
+
headers,
|
|
428
428
|
})
|
|
429
|
-
.then(response => {
|
|
429
|
+
.then((response) => {
|
|
430
430
|
status = response.status;
|
|
431
431
|
if (status === 401) {
|
|
432
432
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -439,7 +439,7 @@ async function fetchComponentLibraryArchiveFromInfinity(apiUrl, headers) {
|
|
|
439
439
|
}
|
|
440
440
|
return response.json();
|
|
441
441
|
})
|
|
442
|
-
.then(resp => {
|
|
442
|
+
.then((resp) => {
|
|
443
443
|
// const respData = JSON.parse(resp);
|
|
444
444
|
if (status === 401) {
|
|
445
445
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -452,7 +452,7 @@ async function fetchComponentLibraryArchiveFromInfinity(apiUrl, headers) {
|
|
|
452
452
|
}
|
|
453
453
|
})
|
|
454
454
|
|
|
455
|
-
.catch(e => reject(`${chalk.bold.red(e)}`));
|
|
455
|
+
.catch((e) => reject(`${chalk.bold.red(e)}`));
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
|
|
@@ -479,8 +479,8 @@ export const getServerLibraryArchive = async (appName, fileName, fileType, ruleS
|
|
|
479
479
|
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
480
480
|
|
|
481
481
|
fetchComponentLibraryArchiveFromInfinity(url, headers)
|
|
482
|
-
.then(response => resolve(response))
|
|
483
|
-
.catch(e => reject(e));
|
|
482
|
+
.then((response) => resolve(response))
|
|
483
|
+
.catch((e) => reject(e));
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
} catch (error) {
|
|
@@ -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
|
import { Listr } from 'listr2';
|
|
9
7
|
|
|
@@ -32,7 +30,7 @@ import {
|
|
|
32
30
|
forceDefaultsUpdate,
|
|
33
31
|
getUseInputConfig,
|
|
34
32
|
getInputConfigForCommand,
|
|
35
|
-
getPegaServerConfig
|
|
33
|
+
getPegaServerConfig,
|
|
36
34
|
} from '../../util.js';
|
|
37
35
|
import { TASKS_CONFIG_JSON_FILENAME, ARCHIVES_PATH, TEMP_PATH } from '../../constants.js';
|
|
38
36
|
import {
|
|
@@ -43,7 +41,7 @@ import {
|
|
|
43
41
|
getServerOrDirectoryQuestion,
|
|
44
42
|
getLibraryArchiveQuestion,
|
|
45
43
|
getServerLibraryArchives,
|
|
46
|
-
getServerLibraryArchive
|
|
44
|
+
getServerLibraryArchive,
|
|
47
45
|
} from './helper.js';
|
|
48
46
|
import { showCurrentStatus } from '../show-status/index.js';
|
|
49
47
|
|
|
@@ -53,9 +51,7 @@ const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
|
53
51
|
|
|
54
52
|
import { convertIntoPascalCase, getComponentDirectoryPath } from '../../util.js';
|
|
55
53
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
export const updateConfig = async ({ oldComponentKey, newComponentKey, library, version, targetDirectory }, options, onlyCompanion = false) => {
|
|
54
|
+
export const updateConfig = async ({ oldComponentKey, newComponentKey, library, version, targetDirectory }) => {
|
|
59
55
|
addDebugLog('updateConfig', `oldComponentKey: ${oldComponentKey}, newComponentKey: ${newComponentKey}`, '');
|
|
60
56
|
|
|
61
57
|
let configData = fs.readFileSync(join(targetDirectory, '/config.json'), { encoding: 'utf8' });
|
|
@@ -69,7 +65,7 @@ export const updateConfig = async ({ oldComponentKey, newComponentKey, library,
|
|
|
69
65
|
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
70
66
|
fs.writeFileSync(join(targetDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
|
|
71
67
|
encoding: 'utf8',
|
|
72
|
-
flag: 'w'
|
|
68
|
+
flag: 'w',
|
|
73
69
|
});
|
|
74
70
|
};
|
|
75
71
|
|
|
@@ -77,7 +73,7 @@ export const updateFile = async (fileName, oldComponentKeyPC, newComponentKeyPC,
|
|
|
77
73
|
addDebugLog(
|
|
78
74
|
'updateFile',
|
|
79
75
|
`fileName: ${fileName}, oldComponentKeyPC: ${oldComponentKeyPC}, newComponentKeyPC: ${newComponentKeyPC}, targetDirectory: ${targetDirectory}`,
|
|
80
|
-
''
|
|
76
|
+
'',
|
|
81
77
|
);
|
|
82
78
|
|
|
83
79
|
let fileData = fs.readFileSync(join(targetDirectory, '/', fileName), { encoding: 'utf8' });
|
|
@@ -90,13 +86,11 @@ export const updateFile = async (fileName, oldComponentKeyPC, newComponentKeyPC,
|
|
|
90
86
|
};
|
|
91
87
|
|
|
92
88
|
// rename the component
|
|
93
|
-
export const renameComponent = async (componentKey, library, version
|
|
89
|
+
export const renameComponent = async (componentKey, library, version) => {
|
|
94
90
|
addDebugLog('renameComponent', `library: ${library}, componentKey: ${componentKey}`, '');
|
|
95
91
|
|
|
96
92
|
const componentName = componentKey.split('_')[2];
|
|
97
93
|
|
|
98
|
-
const configDef = getConfigDefaults();
|
|
99
|
-
|
|
100
94
|
const newComponentKey = `${library}_${componentName}`;
|
|
101
95
|
|
|
102
96
|
const oldComponentKey = componentKey;
|
|
@@ -119,17 +113,14 @@ export const renameComponent = async (componentKey, library, version, options) =
|
|
|
119
113
|
const fileName = targetFileList[fileIndex];
|
|
120
114
|
|
|
121
115
|
if (fileName === 'config.json') {
|
|
122
|
-
await updateConfig(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
options
|
|
132
|
-
);
|
|
116
|
+
await updateConfig({
|
|
117
|
+
oldComponentKey,
|
|
118
|
+
newComponentKey,
|
|
119
|
+
componentName,
|
|
120
|
+
library,
|
|
121
|
+
version,
|
|
122
|
+
targetDirectory,
|
|
123
|
+
});
|
|
133
124
|
} else {
|
|
134
125
|
await updateFile(fileName, oldComponentKeyPC, newComponentKeyPC, targetDirectory);
|
|
135
126
|
}
|
|
@@ -138,14 +129,14 @@ export const renameComponent = async (componentKey, library, version, options) =
|
|
|
138
129
|
return newComponentKey;
|
|
139
130
|
};
|
|
140
131
|
|
|
141
|
-
export const getPackageOrg = async packagePath => {
|
|
132
|
+
export const getPackageOrg = async (packagePath) => {
|
|
142
133
|
const sPackData = fs.readFileSync(packagePath, { encoding: 'utf8' });
|
|
143
134
|
const packData = sPackData && JSON.parse(sPackData);
|
|
144
135
|
|
|
145
136
|
return packData.organization;
|
|
146
137
|
};
|
|
147
138
|
|
|
148
|
-
export const getLocalConfigData = async tasksPath => {
|
|
139
|
+
export const getLocalConfigData = async (tasksPath) => {
|
|
149
140
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
150
141
|
let configData = { library: '', version: '', buildVersion: '', devBuild: false };
|
|
151
142
|
const sTaskData = fs.readFileSync(tasksPath, { encoding: 'utf8' });
|
|
@@ -167,7 +158,7 @@ export const getLocalConfigData = async tasksPath => {
|
|
|
167
158
|
return configData;
|
|
168
159
|
};
|
|
169
160
|
|
|
170
|
-
export const moveComp = async (componentKey, orgLibName, version, copyShared
|
|
161
|
+
export const moveComp = async (componentKey, orgLibName, version, copyShared) => {
|
|
171
162
|
// put lib/version into temp directory
|
|
172
163
|
const currentDirectory = process.cwd();
|
|
173
164
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
@@ -243,7 +234,7 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
243
234
|
|
|
244
235
|
// Do not forget to close the file once you're done
|
|
245
236
|
await testZip.close();
|
|
246
|
-
} catch
|
|
237
|
+
} catch {
|
|
247
238
|
passCount = 0;
|
|
248
239
|
}
|
|
249
240
|
|
|
@@ -269,7 +260,7 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
269
260
|
|
|
270
261
|
if (organization !== configDef.organization) {
|
|
271
262
|
console.log(
|
|
272
|
-
`\nImported ${chalk.yellow(`${orgLibName}/${version}`)} is not the same organization as your current organization: ${chalk.yellow(`${configDef.organization}`)}
|
|
263
|
+
`\nImported ${chalk.yellow(`${orgLibName}/${version}`)} is not the same organization as your current organization: ${chalk.yellow(`${configDef.organization}`)}.`,
|
|
273
264
|
);
|
|
274
265
|
console.log(`\nTo import, the organization of the components will be changed to match your organization.`);
|
|
275
266
|
console.log(`\n\t>>> If you don't want this to happen, then end and create a new project with an organization`);
|
|
@@ -280,8 +271,8 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
280
271
|
name: 'okToContinue',
|
|
281
272
|
type: 'confirm',
|
|
282
273
|
message: `Ok to proceed ?`,
|
|
283
|
-
default: true
|
|
284
|
-
}
|
|
274
|
+
default: true,
|
|
275
|
+
},
|
|
285
276
|
]);
|
|
286
277
|
|
|
287
278
|
if (proceedAnswers.okToContinue) {
|
|
@@ -295,7 +286,7 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
295
286
|
{
|
|
296
287
|
name: 'libraryName',
|
|
297
288
|
message: 'Enter new library name',
|
|
298
|
-
validate: value => {
|
|
289
|
+
validate: (value) => {
|
|
299
290
|
/* value should not be empty
|
|
300
291
|
It should not have spaces
|
|
301
292
|
It should not start with a number
|
|
@@ -315,8 +306,8 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
315
306
|
} else {
|
|
316
307
|
return 'Only alphanumeric values are allowed, starting with alphabets, no spaces.';
|
|
317
308
|
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
309
|
+
},
|
|
310
|
+
},
|
|
320
311
|
]);
|
|
321
312
|
|
|
322
313
|
libName = newLibNameAnswers.libraryName;
|
|
@@ -362,15 +353,15 @@ export const importArch = async (filePath, fileName, hadArchive) => {
|
|
|
362
353
|
title: `Restoring ${orgLibName}/${version}`,
|
|
363
354
|
task: async () => {
|
|
364
355
|
await restoreFromArchive(switchToFileName, orgLibName, version);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
356
|
+
},
|
|
357
|
+
},
|
|
367
358
|
],
|
|
368
|
-
{ concurrent: false, exitOnError: true }
|
|
359
|
+
{ concurrent: false, exitOnError: true },
|
|
369
360
|
);
|
|
370
361
|
|
|
371
362
|
console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
|
|
372
363
|
|
|
373
|
-
await tasks.run().catch(err => {
|
|
364
|
+
await tasks.run().catch((err) => {
|
|
374
365
|
console.log(chalk.bold.red(err.toString()));
|
|
375
366
|
process.exit(1);
|
|
376
367
|
});
|
|
@@ -421,7 +412,7 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
421
412
|
passCount++;
|
|
422
413
|
}
|
|
423
414
|
}
|
|
424
|
-
} catch
|
|
415
|
+
} catch {
|
|
425
416
|
passCount = 0;
|
|
426
417
|
}
|
|
427
418
|
|
|
@@ -438,7 +429,7 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
438
429
|
const newDirPath = join(TEMP_PATH, dirName);
|
|
439
430
|
fs.mkdirSync(newDirPath);
|
|
440
431
|
|
|
441
|
-
|
|
432
|
+
await testZip.extract(null, newDirPath);
|
|
442
433
|
|
|
443
434
|
// Do not forget to close the file once you're done
|
|
444
435
|
await testZip.close();
|
|
@@ -463,7 +454,7 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
463
454
|
|
|
464
455
|
if (organization !== configDef.organization) {
|
|
465
456
|
console.log(
|
|
466
|
-
`\nImported ${chalk.yellow(`${orgLibName}/${version}`)} is not the same organization as your current organization: ${chalk.yellow(`${configDef.organization}`)}
|
|
457
|
+
`\nImported ${chalk.yellow(`${orgLibName}/${version}`)} is not the same organization as your current organization: ${chalk.yellow(`${configDef.organization}`)}.`,
|
|
467
458
|
);
|
|
468
459
|
console.log(`\nTo import, the organization of the components will be changed to match your organization.`);
|
|
469
460
|
console.log(`\n\t>>> If you don't want this to happen, then end and create a new project with an organization`);
|
|
@@ -474,8 +465,8 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
474
465
|
name: 'okToContinue',
|
|
475
466
|
type: 'confirm',
|
|
476
467
|
message: `Ok to proceed ?`,
|
|
477
|
-
default: true
|
|
478
|
-
}
|
|
468
|
+
default: true,
|
|
469
|
+
},
|
|
479
470
|
]);
|
|
480
471
|
|
|
481
472
|
if (proceedAnswers.okToContinue) {
|
|
@@ -489,7 +480,7 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
489
480
|
{
|
|
490
481
|
name: 'libraryName',
|
|
491
482
|
message: 'Enter new library name',
|
|
492
|
-
validate: value => {
|
|
483
|
+
validate: (value) => {
|
|
493
484
|
/* value should not be empty
|
|
494
485
|
It should not have spaces
|
|
495
486
|
It should not start with a number
|
|
@@ -509,8 +500,8 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
509
500
|
} else {
|
|
510
501
|
return 'Only alphanumeric values are allowed, starting with alphabets, no spaces.';
|
|
511
502
|
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
503
|
+
},
|
|
504
|
+
},
|
|
514
505
|
]);
|
|
515
506
|
|
|
516
507
|
libName = newLibNameAnswers.libraryName;
|
|
@@ -556,15 +547,15 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
556
547
|
title: `Restoring ${orgLibName}/${version}`,
|
|
557
548
|
task: async () => {
|
|
558
549
|
await restoreFromArchive(switchToFileName, orgLibName, version);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
550
|
+
},
|
|
551
|
+
},
|
|
561
552
|
],
|
|
562
|
-
{ concurrent: false, exitOnError: true }
|
|
553
|
+
{ concurrent: false, exitOnError: true },
|
|
563
554
|
);
|
|
564
555
|
|
|
565
556
|
console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
|
|
566
557
|
|
|
567
|
-
await tasks.run().catch(err => {
|
|
558
|
+
await tasks.run().catch((err) => {
|
|
568
559
|
console.log(chalk.bold.red(err.toString()));
|
|
569
560
|
process.exit(1);
|
|
570
561
|
});
|
|
@@ -583,28 +574,18 @@ export const importArchServer = async (filePath, fileName, hadArchive) => {
|
|
|
583
574
|
}
|
|
584
575
|
};
|
|
585
576
|
|
|
586
|
-
export const getZipFileList = async filePath => {
|
|
577
|
+
export const getZipFileList = async (filePath) => {
|
|
587
578
|
if (fs.existsSync(filePath)) {
|
|
588
579
|
return fs
|
|
589
580
|
.readdirSync(filePath, { withFileTypes: true })
|
|
590
|
-
.filter(dirent => !dirent.isDirectory() && dirent.name.match(/.*\.(zip?)/gi))
|
|
591
|
-
.map(dirent => dirent.name);
|
|
581
|
+
.filter((dirent) => !dirent.isDirectory() && dirent.name.match(/.*\.(zip?)/gi))
|
|
582
|
+
.map((dirent) => dirent.name);
|
|
592
583
|
} else {
|
|
593
584
|
console.log(chalk.red.bold(`File path: ${filePath} does not exist or no permissions.`));
|
|
594
585
|
process.exit(1);
|
|
595
586
|
}
|
|
596
587
|
};
|
|
597
588
|
|
|
598
|
-
function decodeBase64(encodedString) {
|
|
599
|
-
try {
|
|
600
|
-
const decodedString = atob(encodedString);
|
|
601
|
-
return decodedString;
|
|
602
|
-
} catch (error) {
|
|
603
|
-
console.error('Error decoding base64 string:', error);
|
|
604
|
-
return null;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
589
|
export const writeZipBuffer = async (fileName, fileBuffer) => {
|
|
609
590
|
const currentDirectory = process.cwd();
|
|
610
591
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
@@ -622,7 +603,7 @@ export const writeZipBuffer = async (fileName, fileBuffer) => {
|
|
|
622
603
|
fs.writeFileSync(filePath, fileBuffer, 'base64');
|
|
623
604
|
};
|
|
624
605
|
|
|
625
|
-
export default async options => {
|
|
606
|
+
export default async (options) => {
|
|
626
607
|
await showVersion();
|
|
627
608
|
// await checkLibraryAndArchives();
|
|
628
609
|
|
|
@@ -643,7 +624,6 @@ export default async options => {
|
|
|
643
624
|
addDebugLog('importArchive', '', '+');
|
|
644
625
|
|
|
645
626
|
if (options.params.length >= 6) {
|
|
646
|
-
const localOrServer = options.params[3];
|
|
647
627
|
const filePath = options.params[4];
|
|
648
628
|
const fileName = options.params[5];
|
|
649
629
|
|
|
@@ -671,7 +651,7 @@ export default async options => {
|
|
|
671
651
|
|
|
672
652
|
if (serverArchiveName) {
|
|
673
653
|
// ALL option
|
|
674
|
-
|
|
654
|
+
await getPegaServerConfig();
|
|
675
655
|
|
|
676
656
|
let fileName = `${serverArchiveName}.${serverArchiveType}`;
|
|
677
657
|
let fileData;
|
|
@@ -689,9 +669,9 @@ export default async options => {
|
|
|
689
669
|
serverArchiveName,
|
|
690
670
|
serverArchiveType,
|
|
691
671
|
serverRulesetName,
|
|
692
|
-
serverRulesetVersion
|
|
672
|
+
serverRulesetVersion,
|
|
693
673
|
);
|
|
694
|
-
}
|
|
674
|
+
},
|
|
695
675
|
},
|
|
696
676
|
{
|
|
697
677
|
title: 'Saving archive in store',
|
|
@@ -703,13 +683,13 @@ export default async options => {
|
|
|
703
683
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
704
684
|
|
|
705
685
|
await importArchServer(tempDirectory, fileName, hasArch);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
686
|
+
},
|
|
687
|
+
},
|
|
708
688
|
],
|
|
709
|
-
{ concurrent: false, exitOnError: true }
|
|
689
|
+
{ concurrent: false, exitOnError: true },
|
|
710
690
|
);
|
|
711
691
|
|
|
712
|
-
await tasks.run().catch(err => {
|
|
692
|
+
await tasks.run().catch((err) => {
|
|
713
693
|
console.log(chalk.bold.red(err.toString()));
|
|
714
694
|
process.exit(1);
|
|
715
695
|
});
|
|
@@ -725,13 +705,13 @@ export default async options => {
|
|
|
725
705
|
title: `Importing archive`,
|
|
726
706
|
task: async () => {
|
|
727
707
|
await importArch(filePath, fileName, hasArch);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
708
|
+
},
|
|
709
|
+
},
|
|
730
710
|
],
|
|
731
|
-
{ concurrent: false, exitOnError: true }
|
|
711
|
+
{ concurrent: false, exitOnError: true },
|
|
732
712
|
);
|
|
733
713
|
|
|
734
|
-
await tasks.run().catch(err => {
|
|
714
|
+
await tasks.run().catch((err) => {
|
|
735
715
|
console.log(chalk.bold.red(err.toString()));
|
|
736
716
|
process.exit(1);
|
|
737
717
|
});
|
|
@@ -745,7 +725,7 @@ export default async options => {
|
|
|
745
725
|
} else {
|
|
746
726
|
inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
|
|
747
727
|
|
|
748
|
-
let importFrom
|
|
728
|
+
let importFrom;
|
|
749
729
|
|
|
750
730
|
if (isLibraryBasedCL) {
|
|
751
731
|
const localOrServerQuestion = await getServerOrDirectoryQuestion();
|
|
@@ -773,9 +753,9 @@ export default async options => {
|
|
|
773
753
|
console.log(`\nRetrieved archives from server ${chalk.bold.green(`${defaultPegaServerConfig.server}`)}.`);
|
|
774
754
|
|
|
775
755
|
// to name value pairs
|
|
776
|
-
const archiveResults = archiveVersions['pxResults'].map(archive => ({
|
|
756
|
+
const archiveResults = archiveVersions['pxResults'].map((archive) => ({
|
|
777
757
|
value: `${archive.pyApplicationName},${archive.pyFileName},${archive.pyFileType},${archive.pyRuleSet},${archive.pyRuleSetVersion}`,
|
|
778
|
-
name: `${archive.pyLabel}, ${archive.pyRuleSet}:${archive.pyRuleSetVersion}
|
|
758
|
+
name: `${archive.pyLabel}, ${archive.pyRuleSet}:${archive.pyRuleSetVersion}`,
|
|
779
759
|
}));
|
|
780
760
|
|
|
781
761
|
const versionQuestions = await getLibraryArchiveQuestion(archiveResults);
|
|
@@ -797,7 +777,7 @@ export default async options => {
|
|
|
797
777
|
task: async () => {
|
|
798
778
|
// get archive
|
|
799
779
|
fileData = await getServerLibraryArchive(arArchData[0], arArchData[1], arArchData[2], arArchData[3], arArchData[4]);
|
|
800
|
-
}
|
|
780
|
+
},
|
|
801
781
|
},
|
|
802
782
|
{
|
|
803
783
|
title: 'Saving archive in store',
|
|
@@ -809,13 +789,13 @@ export default async options => {
|
|
|
809
789
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
810
790
|
|
|
811
791
|
await importArchServer(tempDirectory, fileName, hasArch);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
792
|
+
},
|
|
793
|
+
},
|
|
814
794
|
],
|
|
815
|
-
{ concurrent: false, exitOnError: true }
|
|
795
|
+
{ concurrent: false, exitOnError: true },
|
|
816
796
|
);
|
|
817
797
|
|
|
818
|
-
await tasks.run().catch(err => {
|
|
798
|
+
await tasks.run().catch((err) => {
|
|
819
799
|
console.log(chalk.bold.red(err.toString()));
|
|
820
800
|
process.exit(1);
|
|
821
801
|
});
|
|
@@ -829,14 +809,14 @@ export default async options => {
|
|
|
829
809
|
let filePathQuestions;
|
|
830
810
|
try {
|
|
831
811
|
filePathQuestions = await getFilePathQuestions();
|
|
832
|
-
} catch
|
|
812
|
+
} catch {
|
|
833
813
|
process.exit(1);
|
|
834
814
|
}
|
|
835
815
|
|
|
836
816
|
let filePathAnswers;
|
|
837
817
|
try {
|
|
838
818
|
filePathAnswers = await inquirer.prompt(filePathQuestions);
|
|
839
|
-
} catch
|
|
819
|
+
} catch {
|
|
840
820
|
process.exit(1);
|
|
841
821
|
}
|
|
842
822
|
|
|
@@ -862,13 +842,13 @@ export default async options => {
|
|
|
862
842
|
title: `Importing archive`,
|
|
863
843
|
task: async () => {
|
|
864
844
|
await importArch(filePath, fileName, hasArch);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
845
|
+
},
|
|
846
|
+
},
|
|
867
847
|
],
|
|
868
|
-
{ concurrent: false, exitOnError: true }
|
|
848
|
+
{ concurrent: false, exitOnError: true },
|
|
869
849
|
);
|
|
870
850
|
|
|
871
|
-
await tasks.run().catch(err => {
|
|
851
|
+
await tasks.run().catch((err) => {
|
|
872
852
|
console.log(chalk.bold.red(err.toString()));
|
|
873
853
|
process.exit(1);
|
|
874
854
|
});
|