@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { enableAgentFiles, removeAgentFiles, hasAgentFiles } from '../../ai/index.js';
|
|
4
|
+
|
|
5
|
+
const TOOLS = 'Copilot, Claude Code, Cursor, Codex, Gemini';
|
|
6
|
+
|
|
7
|
+
export const enableAi = async () => {
|
|
8
|
+
const projectDirectory = process.cwd();
|
|
9
|
+
const alreadyEnabled = hasAgentFiles(projectDirectory);
|
|
10
|
+
|
|
11
|
+
await enableAgentFiles(projectDirectory);
|
|
12
|
+
|
|
13
|
+
console.log(
|
|
14
|
+
alreadyEnabled
|
|
15
|
+
? `${chalk.green('AI-assisted development is already enabled.')} Missing files were restored; your edits were kept.`
|
|
16
|
+
: `${chalk.green('AI-assisted development enabled')} ${chalk.blue(`(${TOOLS})`)}.`,
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const disableAi = async (options) => {
|
|
21
|
+
const projectDirectory = process.cwd();
|
|
22
|
+
|
|
23
|
+
if (!hasAgentFiles(projectDirectory)) {
|
|
24
|
+
console.log(chalk.yellow('AI-assisted development is not enabled in this project. Nothing to remove.'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!options.yes) {
|
|
29
|
+
const { confirmed } = await inquirer.prompt([
|
|
30
|
+
{
|
|
31
|
+
type: 'confirm',
|
|
32
|
+
name: 'confirmed',
|
|
33
|
+
message:
|
|
34
|
+
'Disable AI-assisted development? This deletes the AGENTS.md and skills that were installed, including any edits you made to them. Your other files are kept.',
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
if (!confirmed) {
|
|
39
|
+
console.log('Nothing was changed.');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
await removeAgentFiles(projectDirectory);
|
|
45
|
+
console.log(`${chalk.green('AI-assisted development disabled.')} Run ${chalk.cyan('npm run enableAi')} to turn it back on.`);
|
|
46
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AUTHENTICATE_SCHEMA, AUTHENTICATE_DEFAULTS } from '../../constants.js';
|
|
2
2
|
import { isCompleteHttpUrl } from '../../util.js';
|
|
3
3
|
|
|
4
|
-
export const getAuthQuestions = async dxcbConfig => {
|
|
4
|
+
export const getAuthQuestions = async (dxcbConfig) => {
|
|
5
5
|
const defaultPegaConfig = dxcbConfig;
|
|
6
6
|
const aAlwaysAsk = dxcbConfig.questions_askAlways ? dxcbConfig.questions_askAlways.split(',') : [];
|
|
7
7
|
const aNeverAsk = dxcbConfig.questions_askNever ? dxcbConfig.questions_askNever.split(',') : [];
|
|
@@ -9,7 +9,7 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
9
9
|
const aAskedOnce = dxcbConfig.questions_askedOnce ? dxcbConfig.questions_askedOnce.split(',') : [];
|
|
10
10
|
|
|
11
11
|
// Ask if various must, never, once criteria are met
|
|
12
|
-
const askThisTime = prop => {
|
|
12
|
+
const askThisTime = (prop) => {
|
|
13
13
|
return aAlwaysAsk.includes(prop) || (!aNeverAsk.includes(prop) && aAskOnce.includes(prop) && !aAskedOnce.includes(prop));
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
20
20
|
return defaultPegaConfig[prop] ? defaultPegaConfig[prop] : defValue;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const initAnswers = answers => {
|
|
23
|
+
const initAnswers = (answers) => {
|
|
24
24
|
// Setup default answers (if they are present and non-empty)
|
|
25
25
|
answers.serverType = initAnswer('serverType', AUTHENTICATE_DEFAULTS.serverType);
|
|
26
26
|
answers.isVanity = defaultPegaConfig.isVanity;
|
|
@@ -50,103 +50,103 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
50
50
|
name: 'serverType',
|
|
51
51
|
type: 'rawlist',
|
|
52
52
|
message: 'Enter Pega server type',
|
|
53
|
-
default: answers => {
|
|
53
|
+
default: (answers) => {
|
|
54
54
|
return defaultPegaConfig.serverType;
|
|
55
55
|
},
|
|
56
56
|
choices: AUTHENTICATE_SCHEMA.serverType,
|
|
57
|
-
validate: value => {
|
|
57
|
+
validate: (value) => {
|
|
58
58
|
if (value.trim()) {
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
return 'Pega server type cannot be empty';
|
|
62
62
|
},
|
|
63
|
-
when: answers => {
|
|
63
|
+
when: (answers) => {
|
|
64
64
|
initAnswers(answers);
|
|
65
65
|
return fnStandardWhen('serverType', answers);
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
name: 'server',
|
|
70
70
|
type: 'input',
|
|
71
71
|
message: 'Enter pega server url',
|
|
72
72
|
default: defaultPegaConfig.server,
|
|
73
|
-
validate: value => {
|
|
73
|
+
validate: (value) => {
|
|
74
74
|
if (value.trim()) {
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
return 'Pega server cannot be empty';
|
|
78
78
|
},
|
|
79
|
-
when: answers => {
|
|
79
|
+
when: (answers) => {
|
|
80
80
|
return fnStandardWhen('server', answers);
|
|
81
|
-
}
|
|
81
|
+
},
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: 'grantType',
|
|
85
85
|
type: 'rawlist',
|
|
86
86
|
message: 'Enter OAuth 2.0 grant type',
|
|
87
87
|
default: defaultPegaConfig.grantType,
|
|
88
|
-
choices: answers => {
|
|
89
|
-
return AUTHENTICATE_SCHEMA.grantType.filter(gt => !(answers.serverType === 'launchpad' && gt.value === 'passwordCreds'));
|
|
88
|
+
choices: (answers) => {
|
|
89
|
+
return AUTHENTICATE_SCHEMA.grantType.filter((gt) => !(answers.serverType === 'launchpad' && gt.value === 'passwordCreds'));
|
|
90
90
|
},
|
|
91
|
-
validate: value => {
|
|
91
|
+
validate: (value) => {
|
|
92
92
|
if (value.trim()) {
|
|
93
93
|
return true;
|
|
94
94
|
}
|
|
95
95
|
return 'Grant type cannot be empty';
|
|
96
96
|
},
|
|
97
|
-
when: answers => {
|
|
97
|
+
when: (answers) => {
|
|
98
98
|
return fnStandardWhen('grantType', answers);
|
|
99
|
-
}
|
|
99
|
+
},
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
name: 'authorizeUri',
|
|
103
103
|
type: 'input',
|
|
104
104
|
message: 'Enter complete authorization URL',
|
|
105
105
|
default: defaultPegaConfig.authorizeUri,
|
|
106
|
-
validate: value => isCompleteHttpUrl(value) || 'Authorization URL must be a complete HTTP(S) URL',
|
|
107
|
-
when: answers =>
|
|
106
|
+
validate: (value) => isCompleteHttpUrl(value) || 'Authorization URL must be a complete HTTP(S) URL',
|
|
107
|
+
when: (answers) =>
|
|
108
108
|
answers.serverType === 'launchpad' &&
|
|
109
109
|
answers.isVanity !== false &&
|
|
110
110
|
answers.grantType === 'authCode' &&
|
|
111
|
-
fnStandardWhen('authorizeUri', answers)
|
|
111
|
+
fnStandardWhen('authorizeUri', answers),
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
name: 'tokenUri',
|
|
115
115
|
type: 'input',
|
|
116
116
|
message: 'Enter complete access token URL',
|
|
117
117
|
default: defaultPegaConfig.tokenUri,
|
|
118
|
-
validate: value => isCompleteHttpUrl(value) || 'Access token URL must be a complete HTTP(S) URL',
|
|
119
|
-
when: answers => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('tokenUri', answers)
|
|
118
|
+
validate: (value) => isCompleteHttpUrl(value) || 'Access token URL must be a complete HTTP(S) URL',
|
|
119
|
+
when: (answers) => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('tokenUri', answers),
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
name: 'authService',
|
|
123
123
|
type: 'input',
|
|
124
124
|
message: 'Enter authentication service alias',
|
|
125
125
|
default: defaultPegaConfig.authService,
|
|
126
|
-
validate: value => {
|
|
126
|
+
validate: (value) => {
|
|
127
127
|
if (value.trim()) {
|
|
128
128
|
return true;
|
|
129
129
|
}
|
|
130
130
|
return 'Authentication service alias cannot be empty';
|
|
131
131
|
},
|
|
132
|
-
when: answers => {
|
|
132
|
+
when: (answers) => {
|
|
133
133
|
return answers.serverType === 'infinity' && answers.grantType === 'authCode' && fnStandardWhen('authService', answers);
|
|
134
|
-
}
|
|
134
|
+
},
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
name: 'redirectUri',
|
|
138
138
|
type: 'input',
|
|
139
|
-
message: 'Enter valid redirect Uri within OAuth 2.0 client reg
|
|
139
|
+
message: 'Enter valid redirect Uri within OAuth 2.0 client reg record',
|
|
140
140
|
default: defaultPegaConfig.redirectUri,
|
|
141
|
-
validate: value => {
|
|
141
|
+
validate: (value) => {
|
|
142
142
|
if (value.trim()) {
|
|
143
143
|
return true;
|
|
144
144
|
}
|
|
145
145
|
return 'Redirect URI cannot be empty';
|
|
146
146
|
},
|
|
147
|
-
when: answers => {
|
|
147
|
+
when: (answers) => {
|
|
148
148
|
return answers.serverType === 'infinity' && answers.grantType === 'authCode' && fnStandardWhen('redirectUri', answers);
|
|
149
|
-
}
|
|
149
|
+
},
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
name: 'user',
|
|
@@ -159,9 +159,9 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
159
159
|
}
|
|
160
160
|
return 'Username cannot be empty';
|
|
161
161
|
},
|
|
162
|
-
when: answers => {
|
|
162
|
+
when: (answers) => {
|
|
163
163
|
return answers.serverType === 'infinity' && answers.grantType === 'passwordCreds' && fnStandardWhen('user', answers);
|
|
164
|
-
}
|
|
164
|
+
},
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
name: 'password',
|
|
@@ -174,42 +174,42 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
174
174
|
}
|
|
175
175
|
return 'Password cannot be empty';
|
|
176
176
|
},
|
|
177
|
-
when: answers => {
|
|
177
|
+
when: (answers) => {
|
|
178
178
|
return answers.user && answers.serverType === 'infinity' && answers.grantType === 'passwordCreds' && fnStandardWhen('password', answers);
|
|
179
|
-
}
|
|
179
|
+
},
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
name: 'clientId',
|
|
183
183
|
type: 'input',
|
|
184
184
|
message: 'Enter clientId',
|
|
185
185
|
default: defaultPegaConfig.clientId,
|
|
186
|
-
validate: value => {
|
|
186
|
+
validate: (value) => {
|
|
187
187
|
if (value.trim()) {
|
|
188
188
|
return true;
|
|
189
189
|
}
|
|
190
190
|
return 'clientId cannot be empty';
|
|
191
191
|
},
|
|
192
|
-
when: answers => {
|
|
192
|
+
when: (answers) => {
|
|
193
193
|
return fnStandardWhen('clientId', answers);
|
|
194
|
-
}
|
|
194
|
+
},
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
name: 'clientSecret',
|
|
198
198
|
type: 'password',
|
|
199
199
|
message: 'Enter clientSecret',
|
|
200
200
|
default: defaultPegaConfig.clientSecret,
|
|
201
|
-
validate: value => {
|
|
201
|
+
validate: (value) => {
|
|
202
202
|
if (value.trim()) {
|
|
203
203
|
return true;
|
|
204
204
|
}
|
|
205
205
|
return 'clientSecret cannot be empty';
|
|
206
206
|
},
|
|
207
|
-
when: answers => {
|
|
207
|
+
when: (answers) => {
|
|
208
208
|
return (
|
|
209
209
|
((answers.serverType === 'infinity' && answers.grantType !== 'authCode') || answers.serverType === 'launchpad') &&
|
|
210
210
|
fnStandardWhen('clientSecret', answers)
|
|
211
211
|
);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
214
|
];
|
|
215
215
|
};
|
|
@@ -13,9 +13,8 @@ import { getAuthQuestions } from './helper.js';
|
|
|
13
13
|
export const TASKS_CONFIG_JSON_FILENAME = 'tasks.config.json';
|
|
14
14
|
|
|
15
15
|
const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
|
|
16
|
-
const server = null;
|
|
17
16
|
|
|
18
|
-
export const generateAccessToken = async config => {
|
|
17
|
+
export const generateAccessToken = async (config) => {
|
|
19
18
|
let authSuccess = false;
|
|
20
19
|
const { serverType, authService, isolationId, grantType, clientId, clientSecret, user, password, legacyTLS } = config;
|
|
21
20
|
const launchpadVanity = isLaunchpadVanity(config);
|
|
@@ -63,7 +62,7 @@ export const generateAccessToken = async config => {
|
|
|
63
62
|
cert: config.cert,
|
|
64
63
|
key: config.key,
|
|
65
64
|
winTitle: 'DX Component Dev',
|
|
66
|
-
winBodyHtml: browserAuthSuccessMarkup
|
|
65
|
+
winBodyHtml: browserAuthSuccessMarkup,
|
|
67
66
|
}
|
|
68
67
|
: {};
|
|
69
68
|
|
|
@@ -77,7 +76,7 @@ export const generateAccessToken = async config => {
|
|
|
77
76
|
clientSecret,
|
|
78
77
|
ignoreInvalidCerts: true,
|
|
79
78
|
useNodeFetch: false,
|
|
80
|
-
...authCodeConfig
|
|
79
|
+
...authCodeConfig,
|
|
81
80
|
};
|
|
82
81
|
if (legacyTLS) {
|
|
83
82
|
authConfig.legacyTLS = true;
|
|
@@ -99,16 +98,16 @@ export const generateAccessToken = async config => {
|
|
|
99
98
|
const auth = new PegaAuth(authConfig);
|
|
100
99
|
if (grantType === 'authCode') {
|
|
101
100
|
console.log(
|
|
102
|
-
`${chalk.green('Awaiting authorization to complete (Ctrl-C to exit). You may need to enter credentials within your default browser.')}
|
|
101
|
+
`${chalk.green('Awaiting authorization to complete (Ctrl-C to exit). You may need to enter credentials within your default browser.')}`,
|
|
103
102
|
);
|
|
104
103
|
}
|
|
105
104
|
// console.log(`authConfig: ${JSON.stringify(authConfig)}`);
|
|
106
105
|
|
|
107
106
|
auth
|
|
108
107
|
.login()
|
|
109
|
-
.then(token => {
|
|
108
|
+
.then((token) => {
|
|
110
109
|
if (token?.token_type) {
|
|
111
|
-
fs.writeFile(TOKEN_PATH, JSON.stringify(token), err => {
|
|
110
|
+
fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => {
|
|
112
111
|
if (err) {
|
|
113
112
|
console.error(err);
|
|
114
113
|
return reject(authSuccess);
|
|
@@ -122,18 +121,18 @@ export const generateAccessToken = async config => {
|
|
|
122
121
|
return reject(authSuccess);
|
|
123
122
|
}
|
|
124
123
|
})
|
|
125
|
-
.catch(e => {
|
|
124
|
+
.catch((e) => {
|
|
126
125
|
console.log(`${chalk.bold.red(`Authentication failed:${e}`)}`);
|
|
127
126
|
return reject(authSuccess);
|
|
128
127
|
});
|
|
129
|
-
} catch
|
|
128
|
+
} catch {
|
|
130
129
|
console.log(`Authentication failed: Problem initializing OAuth library`);
|
|
131
130
|
return reject(authSuccess);
|
|
132
131
|
}
|
|
133
132
|
});
|
|
134
133
|
};
|
|
135
134
|
|
|
136
|
-
export default async
|
|
135
|
+
export default async () => {
|
|
137
136
|
let authOK = false;
|
|
138
137
|
|
|
139
138
|
await showVersion();
|
|
@@ -145,7 +144,7 @@ export default async options => {
|
|
|
145
144
|
if (cfgData) {
|
|
146
145
|
try {
|
|
147
146
|
data = JSON.parse(cfgData);
|
|
148
|
-
} catch
|
|
147
|
+
} catch {
|
|
149
148
|
console.log(`${chalk.red('Invalid JSON within tasks.config.json')}`);
|
|
150
149
|
process.exit(1);
|
|
151
150
|
}
|
|
@@ -175,7 +174,7 @@ export default async options => {
|
|
|
175
174
|
'redirectUri',
|
|
176
175
|
'clientSecret',
|
|
177
176
|
'user',
|
|
178
|
-
'password'
|
|
177
|
+
'password',
|
|
179
178
|
];
|
|
180
179
|
const isLaunchPad = answers.serverType === 'launchpad';
|
|
181
180
|
let bWriteUpdate = false;
|
|
@@ -223,19 +222,22 @@ export default async options => {
|
|
|
223
222
|
serverConfig.password = '';
|
|
224
223
|
}
|
|
225
224
|
console.log(`${chalk.green('Writing updated config...')}`);
|
|
226
|
-
let updCfg
|
|
225
|
+
let updCfg;
|
|
227
226
|
try {
|
|
228
227
|
updCfg = JSON.stringify(data, null, 2);
|
|
229
228
|
// console.log(`updated config: ${updCfg}`);
|
|
230
|
-
fs.writeFileSync(pegaConfigJsonPath, updCfg, err => {
|
|
229
|
+
fs.writeFileSync(pegaConfigJsonPath, updCfg, (err) => {
|
|
231
230
|
if (err) throw err;
|
|
232
231
|
});
|
|
233
|
-
} catch
|
|
232
|
+
} catch {
|
|
233
|
+
// ignore write errors
|
|
234
|
+
}
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
if (authOK) {
|
|
237
238
|
// get C11B2S token
|
|
238
239
|
if (isLaunchPad) {
|
|
240
|
+
// no-op for Launchpad, token already obtained above
|
|
239
241
|
} else {
|
|
240
242
|
// update B2N token in access token file
|
|
241
243
|
await updateC11NB2SForInfinity();
|
|
@@ -22,12 +22,12 @@ export const getBuildComponentQuestions = async () => {
|
|
|
22
22
|
name: 'devBuild',
|
|
23
23
|
type: 'confirm',
|
|
24
24
|
message: 'Generate development build ?',
|
|
25
|
-
default: defaultPegaConfig.devBuild
|
|
26
|
-
}
|
|
25
|
+
default: defaultPegaConfig.devBuild,
|
|
26
|
+
},
|
|
27
27
|
];
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const zipComponent = async componentKey => {
|
|
30
|
+
export const zipComponent = async (componentKey) => {
|
|
31
31
|
addDebugLog('zipComponent', `componentKey: ${componentKey}`, '');
|
|
32
32
|
|
|
33
33
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
@@ -37,7 +37,7 @@ export const zipComponent = async componentKey => {
|
|
|
37
37
|
|
|
38
38
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
39
39
|
const zipChunks = [];
|
|
40
|
-
archive.on('data', chunk => zipChunks.push(chunk));
|
|
40
|
+
archive.on('data', (chunk) => zipChunks.push(chunk));
|
|
41
41
|
|
|
42
42
|
// Add src directory
|
|
43
43
|
archive.directory(srcDirectory, 'src');
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getLibraryBasedCL,
|
|
16
16
|
checkLibraryAndArchives,
|
|
17
17
|
getConfigDefaults,
|
|
18
|
-
zipVersionAndArchive
|
|
18
|
+
zipVersionAndArchive,
|
|
19
19
|
} from '../../util.js';
|
|
20
20
|
|
|
21
21
|
import { getBuildComponentQuestions } from './helper.js';
|
|
@@ -32,7 +32,7 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, options, showS
|
|
|
32
32
|
title: 'Validate config schema',
|
|
33
33
|
task: async () => {
|
|
34
34
|
await validate(componentKey);
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
title: 'Lint component',
|
|
@@ -40,19 +40,19 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, options, showS
|
|
|
40
40
|
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
41
41
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
42
42
|
await lintComponent(targetDirectory);
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
title: `Bundle component ${sDevBuild}`,
|
|
47
47
|
task: async () => await bundleComponent(componentKey, sourceMap, devBuild, showStats),
|
|
48
|
-
enabled: () => !skipBuild
|
|
49
|
-
}
|
|
48
|
+
enabled: () => !skipBuild,
|
|
49
|
+
},
|
|
50
50
|
],
|
|
51
|
-
{ concurrent: false, exitOnError: true }
|
|
51
|
+
{ concurrent: false, exitOnError: true },
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export default async options => {
|
|
55
|
+
export default async (options) => {
|
|
56
56
|
await showVersion();
|
|
57
57
|
await checkLibraryAndArchives();
|
|
58
58
|
|
|
@@ -7,7 +7,7 @@ import chalk from 'chalk';
|
|
|
7
7
|
import { constructCompleteUrl, getComponentDirectoryPath, getComponents, getPegaServerConfig, getFetchAgent, getLibraryBased } from '../../util.js';
|
|
8
8
|
import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH } from '../../constants.js';
|
|
9
9
|
|
|
10
|
-
export const getPublishComponentQuestions = async componentKey => {
|
|
10
|
+
export const getPublishComponentQuestions = async (componentKey) => {
|
|
11
11
|
const isLibraryBased = getLibraryBased();
|
|
12
12
|
// validate and validateAll will be called when libraryBased, but using same code
|
|
13
13
|
// so need different label
|
|
@@ -29,26 +29,26 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
29
29
|
message: `Select component to ${buildLabel}`,
|
|
30
30
|
choices: components,
|
|
31
31
|
default: componentKey,
|
|
32
|
-
when: () => !componentKey
|
|
32
|
+
when: () => !componentKey,
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: 'sourceMap',
|
|
36
36
|
message: 'Generate source map ?',
|
|
37
37
|
default: defaultPegaConfig.sourceMap,
|
|
38
38
|
|
|
39
|
-
when: () => false
|
|
39
|
+
when: () => false,
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
name: 'devBuild',
|
|
43
43
|
type: 'confirm',
|
|
44
44
|
message: 'Generate development build ?',
|
|
45
45
|
default: defaultPegaConfig.devBuild,
|
|
46
|
-
when: () => !isLibraryBased
|
|
47
|
-
}
|
|
46
|
+
when: () => !isLibraryBased,
|
|
47
|
+
},
|
|
48
48
|
];
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export const zipComponent = async componentKey => {
|
|
51
|
+
export const zipComponent = async (componentKey) => {
|
|
52
52
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
53
53
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
54
54
|
const configJson = `${srcDirectory}/config.json`;
|
|
@@ -57,7 +57,7 @@ export const zipComponent = async componentKey => {
|
|
|
57
57
|
|
|
58
58
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
59
59
|
const zipChunks = [];
|
|
60
|
-
archive.on('data', chunk => zipChunks.push(chunk));
|
|
60
|
+
archive.on('data', (chunk) => zipChunks.push(chunk));
|
|
61
61
|
|
|
62
62
|
// Add src directory
|
|
63
63
|
archive.directory(srcDirectory, 'src');
|
|
@@ -84,7 +84,7 @@ export const zipComponent = async componentKey => {
|
|
|
84
84
|
const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
|
|
85
85
|
|
|
86
86
|
if (fs.existsSync('dist/components')) {
|
|
87
|
-
fs.rm('dist/components', { recursive: true }, err => {
|
|
87
|
+
fs.rm('dist/components', { recursive: true }, (err) => {
|
|
88
88
|
if (err) {
|
|
89
89
|
throw err;
|
|
90
90
|
}
|
|
@@ -92,7 +92,7 @@ export const zipComponent = async componentKey => {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (fs.existsSync('lib')) {
|
|
95
|
-
fs.rm('lib', { recursive: true }, err => {
|
|
95
|
+
fs.rm('lib', { recursive: true }, (err) => {
|
|
96
96
|
if (err) {
|
|
97
97
|
throw err;
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ export const zipComponent = async componentKey => {
|
|
|
102
102
|
return { zipContent, configContent };
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
export const publishComponentToServer = async data => {
|
|
105
|
+
export const publishComponentToServer = async (data) => {
|
|
106
106
|
const { configContent, zipContent, rulesetName, rulesetVersion } = data;
|
|
107
107
|
|
|
108
108
|
const apiBody = {
|
|
@@ -112,7 +112,7 @@ export const publishComponentToServer = async data => {
|
|
|
112
112
|
publishFor: 'constellation',
|
|
113
113
|
rulesetName,
|
|
114
114
|
rulesetVersion,
|
|
115
|
-
category: ''
|
|
115
|
+
category: '',
|
|
116
116
|
};
|
|
117
117
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
118
118
|
const url = constructCompleteUrl(defaultPegaConfig.server, PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT);
|
|
@@ -125,15 +125,15 @@ export const publishComponentToServer = async data => {
|
|
|
125
125
|
method: 'POST',
|
|
126
126
|
dispatcher: getFetchAgent(defaultPegaConfig),
|
|
127
127
|
headers: {
|
|
128
|
-
Authorization: `${tokenType} ${accessToken}
|
|
128
|
+
Authorization: `${tokenType} ${accessToken}`,
|
|
129
129
|
},
|
|
130
|
-
body: JSON.stringify(apiBody)
|
|
130
|
+
body: JSON.stringify(apiBody),
|
|
131
131
|
})
|
|
132
|
-
.then(response => {
|
|
132
|
+
.then((response) => {
|
|
133
133
|
status = response.status;
|
|
134
134
|
return response.text();
|
|
135
135
|
})
|
|
136
|
-
.then(resp => {
|
|
136
|
+
.then((resp) => {
|
|
137
137
|
const respData = JSON.parse(resp);
|
|
138
138
|
if (status === 401) {
|
|
139
139
|
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
@@ -146,11 +146,11 @@ export const publishComponentToServer = async data => {
|
|
|
146
146
|
}
|
|
147
147
|
})
|
|
148
148
|
|
|
149
|
-
.catch(e => Promise.reject(`${chalk.bold.red(e)}`));
|
|
149
|
+
.catch((e) => Promise.reject(`${chalk.bold.red(e)}`));
|
|
150
150
|
} else {
|
|
151
151
|
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
152
152
|
}
|
|
153
153
|
} catch (err) {
|
|
154
|
-
throw new Error(`Error occurred in authentication. Please regenerate using authenticate
|
|
154
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
|
|
155
155
|
}
|
|
156
156
|
};
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
getLibraryBased,
|
|
16
16
|
checkLibraryAndArchives,
|
|
17
17
|
getConfigDefaults,
|
|
18
|
-
zipVersionAndArchive
|
|
18
|
+
zipVersionAndArchive,
|
|
19
19
|
} from '../../util.js';
|
|
20
20
|
|
|
21
|
-
export default async options => {
|
|
21
|
+
export default async (options) => {
|
|
22
22
|
await showVersion();
|
|
23
23
|
await checkLibraryAndArchives();
|
|
24
24
|
|
|
@@ -56,7 +56,7 @@ export default async options => {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
content = {
|
|
59
|
-
...answers
|
|
59
|
+
...answers,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -67,7 +67,7 @@ export default async options => {
|
|
|
67
67
|
title: 'Validate config schema',
|
|
68
68
|
task: async () => {
|
|
69
69
|
await validate(componentKey);
|
|
70
|
-
}
|
|
70
|
+
},
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
title: 'Lint component',
|
|
@@ -75,21 +75,21 @@ export default async options => {
|
|
|
75
75
|
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
76
76
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
77
77
|
await lintComponent(targetDirectory);
|
|
78
|
-
}
|
|
78
|
+
},
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
title: `Bundle Component ${sDevBuild}`,
|
|
82
82
|
type: 'confirm',
|
|
83
83
|
task: async () => await bundleComponent(componentKey, sourceMap, devBuild, showStats),
|
|
84
|
-
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
|
|
85
|
-
}
|
|
84
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
85
|
+
},
|
|
86
86
|
],
|
|
87
87
|
{
|
|
88
|
-
exitOnError: true
|
|
89
|
-
}
|
|
88
|
+
exitOnError: true,
|
|
89
|
+
},
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
-
await tasks.run().catch(err => {
|
|
92
|
+
await tasks.run().catch((err) => {
|
|
93
93
|
console.log(chalk.bold.red(err.toString()));
|
|
94
94
|
process.exit(1);
|
|
95
95
|
});
|