@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
|
@@ -15,15 +15,7 @@ const compressionBRConfObj = {
|
|
|
15
15
|
filename: '[path][base].br',
|
|
16
16
|
algorithm: 'brotliCompress',
|
|
17
17
|
test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
|
|
18
|
-
compressionOptions: { level: 11 }
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/* For gzip use below */
|
|
22
|
-
const compressionGZConfObj = {
|
|
23
|
-
filename: '[path][base].gz',
|
|
24
|
-
algorithm: 'gzip',
|
|
25
|
-
test: /\.(js|css|html|svg|png|jpg|woff|woff2)$/,
|
|
26
|
-
compressionOptions: { level: 9 }
|
|
18
|
+
compressionOptions: { level: 11 },
|
|
27
19
|
};
|
|
28
20
|
|
|
29
21
|
let shouldUseSourceMap = process.env.SOURCE_MAP;
|
|
@@ -39,22 +31,9 @@ const sassModuleRegex = /\.module\.(scss|sass)$/;
|
|
|
39
31
|
// Make sure any symlinks in the project folder are resolved:
|
|
40
32
|
// https://github.com/facebook/create-react-app/issues/637
|
|
41
33
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
42
|
-
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
43
|
-
|
|
44
|
-
buildPath = 'dist/components';
|
|
34
|
+
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
|
|
45
35
|
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
// Resolve file paths in the same order as webpack
|
|
49
|
-
const resolveModule = (resolveFn, filePath) => {
|
|
50
|
-
const extension = moduleFileExtensions.find(ext => fs.existsSync(resolveFn(`${filePath}.${ext}`)));
|
|
51
|
-
|
|
52
|
-
if (extension) {
|
|
53
|
-
return resolveFn(`${filePath}.${extension}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return resolveFn(`${filePath}.js`);
|
|
57
|
-
};
|
|
36
|
+
const buildPath = 'dist/components';
|
|
58
37
|
|
|
59
38
|
// config after eject: we're in ./config/
|
|
60
39
|
|
|
@@ -64,11 +43,10 @@ const appSrc = resolveApp('src');
|
|
|
64
43
|
|
|
65
44
|
// This is the production and development configuration.
|
|
66
45
|
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
|
|
67
|
-
//export default (
|
|
68
46
|
module.exports = (
|
|
69
47
|
webpackEnv,
|
|
70
48
|
// eslint-disable-next-line no-unused-vars
|
|
71
|
-
{ inputFile, outputFile, componentKey, externals, globals, sourceMap, devBuild }
|
|
49
|
+
{ inputFile, outputFile, componentKey, externals, globals, sourceMap, devBuild },
|
|
72
50
|
) => {
|
|
73
51
|
const isEnvDevelopment = webpackEnv === 'development' || devBuild;
|
|
74
52
|
const isEnvProduction = webpackEnv === 'production';
|
|
@@ -79,11 +57,11 @@ module.exports = (
|
|
|
79
57
|
const getStyleLoaders = (cssOptions, preProcessor) => {
|
|
80
58
|
const loaders = [
|
|
81
59
|
isEnvProduction && {
|
|
82
|
-
loader: MiniCssExtractPlugin.loader
|
|
60
|
+
loader: MiniCssExtractPlugin.loader,
|
|
83
61
|
},
|
|
84
62
|
{
|
|
85
63
|
loader: require.resolve('css-loader'),
|
|
86
|
-
options: cssOptions
|
|
64
|
+
options: cssOptions,
|
|
87
65
|
},
|
|
88
66
|
{
|
|
89
67
|
// Options for PostCSS as we reference these options twice
|
|
@@ -97,13 +75,13 @@ module.exports = (
|
|
|
97
75
|
'postcss-preset-env',
|
|
98
76
|
{
|
|
99
77
|
// Options
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
]
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
],
|
|
103
81
|
},
|
|
104
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
105
|
-
}
|
|
106
|
-
}
|
|
82
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
107
85
|
].filter(Boolean);
|
|
108
86
|
if (preProcessor) {
|
|
109
87
|
loaders.push(
|
|
@@ -111,15 +89,15 @@ module.exports = (
|
|
|
111
89
|
loader: require.resolve('resolve-url-loader'),
|
|
112
90
|
options: {
|
|
113
91
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
114
|
-
root: appSrc
|
|
115
|
-
}
|
|
92
|
+
root: appSrc,
|
|
93
|
+
},
|
|
116
94
|
},
|
|
117
95
|
{
|
|
118
96
|
loader: require.resolve(preProcessor),
|
|
119
97
|
options: {
|
|
120
|
-
sourceMap: true
|
|
121
|
-
}
|
|
122
|
-
}
|
|
98
|
+
sourceMap: true,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
123
101
|
);
|
|
124
102
|
}
|
|
125
103
|
return loaders;
|
|
@@ -134,8 +112,6 @@ module.exports = (
|
|
|
134
112
|
devtool: devBuild ? 'eval-cheap-module-source-map' : false,
|
|
135
113
|
output: {
|
|
136
114
|
// The build folder.
|
|
137
|
-
//path: paths.appBuild,
|
|
138
|
-
//path: resolveApp('dist/components'),
|
|
139
115
|
path: appBuild,
|
|
140
116
|
// There will be one main bundle, and one file per asynchronous chunk.
|
|
141
117
|
// In development, it does not produce real files.
|
|
@@ -146,20 +122,16 @@ module.exports = (
|
|
|
146
122
|
library: {
|
|
147
123
|
name: componentKey,
|
|
148
124
|
type: 'umd',
|
|
149
|
-
export: 'default'
|
|
125
|
+
export: 'default',
|
|
150
126
|
},
|
|
151
|
-
publicPath: ''
|
|
127
|
+
publicPath: '',
|
|
152
128
|
},
|
|
153
129
|
optimization: {
|
|
154
130
|
minimize: isEnvProduction,
|
|
155
|
-
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()]
|
|
131
|
+
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
|
|
156
132
|
},
|
|
157
133
|
resolve: {
|
|
158
|
-
|
|
159
|
-
extensions: ['.tsx', '.ts', '.js']
|
|
160
|
-
},
|
|
161
|
-
resolveLoader: {
|
|
162
|
-
plugins: []
|
|
134
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
163
135
|
},
|
|
164
136
|
module: {
|
|
165
137
|
strictExportPresence: true,
|
|
@@ -177,8 +149,8 @@ module.exports = (
|
|
|
177
149
|
options: {
|
|
178
150
|
limit: imageInlineSizeLimit,
|
|
179
151
|
mimetype: 'image/avif',
|
|
180
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
181
|
-
}
|
|
152
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
153
|
+
},
|
|
182
154
|
},
|
|
183
155
|
// "url" loader works like "file" loader except that it embeds assets
|
|
184
156
|
// smaller than specified limit in bytes as data URLs to avoid requests.
|
|
@@ -188,8 +160,8 @@ module.exports = (
|
|
|
188
160
|
loader: require.resolve('url-loader'),
|
|
189
161
|
options: {
|
|
190
162
|
limit: imageInlineSizeLimit,
|
|
191
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
192
|
-
}
|
|
163
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
164
|
+
},
|
|
193
165
|
},
|
|
194
166
|
// Process application JS with TS-Loader.
|
|
195
167
|
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
|
|
@@ -198,18 +170,18 @@ module.exports = (
|
|
|
198
170
|
include: appSrc,
|
|
199
171
|
loader: 'ts-loader',
|
|
200
172
|
options: {
|
|
201
|
-
configFile: 'tsconfig.build.json'
|
|
173
|
+
configFile: 'tsconfig.build.json',
|
|
202
174
|
},
|
|
203
|
-
exclude: /node_modules
|
|
175
|
+
exclude: /node_modules/,
|
|
204
176
|
},
|
|
205
177
|
|
|
206
178
|
{
|
|
207
179
|
test: /\.(ts|tsx)$/,
|
|
208
180
|
loader: 'ts-loader',
|
|
209
181
|
options: {
|
|
210
|
-
configFile: 'tsconfig.build.json'
|
|
182
|
+
configFile: 'tsconfig.build.json',
|
|
211
183
|
},
|
|
212
|
-
exclude: /node_modules
|
|
184
|
+
exclude: /node_modules/,
|
|
213
185
|
},
|
|
214
186
|
// "postcss" loader applies autoprefixer to our CSS.
|
|
215
187
|
// "css" loader resolves paths in CSS and adds assets as dependencies.
|
|
@@ -223,13 +195,13 @@ module.exports = (
|
|
|
223
195
|
exclude: cssModuleRegex,
|
|
224
196
|
use: getStyleLoaders({
|
|
225
197
|
importLoaders: 1,
|
|
226
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
198
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
227
199
|
}),
|
|
228
200
|
// Don't consider CSS imports dead code even if the
|
|
229
201
|
// containing package claims to have no side effects.
|
|
230
202
|
// Remove this when webpack adds a warning or an error for this.
|
|
231
203
|
// See https://github.com/webpack/webpack/issues/6571
|
|
232
|
-
sideEffects: true
|
|
204
|
+
sideEffects: true,
|
|
233
205
|
},
|
|
234
206
|
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
|
|
235
207
|
// using the extension .module.css
|
|
@@ -239,9 +211,9 @@ module.exports = (
|
|
|
239
211
|
importLoaders: 1,
|
|
240
212
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
241
213
|
modules: {
|
|
242
|
-
getLocalIdent: getCSSModuleLocalIdent
|
|
243
|
-
}
|
|
244
|
-
})
|
|
214
|
+
getLocalIdent: getCSSModuleLocalIdent,
|
|
215
|
+
},
|
|
216
|
+
}),
|
|
245
217
|
},
|
|
246
218
|
// Opt-in support for SASS (using .scss or .sass extensions).
|
|
247
219
|
// By default we support SASS Modules with the
|
|
@@ -252,15 +224,15 @@ module.exports = (
|
|
|
252
224
|
use: getStyleLoaders(
|
|
253
225
|
{
|
|
254
226
|
importLoaders: 3,
|
|
255
|
-
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
|
|
227
|
+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
256
228
|
},
|
|
257
|
-
'sass-loader'
|
|
229
|
+
'sass-loader',
|
|
258
230
|
),
|
|
259
231
|
// Don't consider CSS imports dead code even if the
|
|
260
232
|
// containing package claims to have no side effects.
|
|
261
233
|
// Remove this when webpack adds a warning or an error for this.
|
|
262
234
|
// See https://github.com/webpack/webpack/issues/6571
|
|
263
|
-
sideEffects: true
|
|
235
|
+
sideEffects: true,
|
|
264
236
|
},
|
|
265
237
|
// Adds support for CSS Modules, but using SASS
|
|
266
238
|
// using the extension .module.scss or .module.sass
|
|
@@ -271,11 +243,11 @@ module.exports = (
|
|
|
271
243
|
importLoaders: 3,
|
|
272
244
|
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
|
273
245
|
modules: {
|
|
274
|
-
getLocalIdent: getCSSModuleLocalIdent
|
|
275
|
-
}
|
|
246
|
+
getLocalIdent: getCSSModuleLocalIdent,
|
|
247
|
+
},
|
|
276
248
|
},
|
|
277
|
-
'sass-loader'
|
|
278
|
-
)
|
|
249
|
+
'sass-loader',
|
|
250
|
+
),
|
|
279
251
|
},
|
|
280
252
|
// "file" loader makes sure those assets get served by WebpackDevServer.
|
|
281
253
|
// When you `import` an asset, you get its (virtual) filename.
|
|
@@ -290,14 +262,14 @@ module.exports = (
|
|
|
290
262
|
// by webpack's internal loaders.
|
|
291
263
|
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
|
|
292
264
|
options: {
|
|
293
|
-
name: `${componentKey}/media/[name].[hash:8].[ext]
|
|
294
|
-
}
|
|
295
|
-
}
|
|
265
|
+
name: `${componentKey}/media/[name].[hash:8].[ext]`,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
296
268
|
// ** STOP ** Are you adding a new loader?
|
|
297
269
|
// Make sure to add the new loader(s) before the "file" loader.
|
|
298
|
-
]
|
|
299
|
-
}
|
|
300
|
-
]
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
],
|
|
301
273
|
},
|
|
302
274
|
plugins: [
|
|
303
275
|
// This gives some necessary context to module not found errors, such as
|
|
@@ -310,14 +282,14 @@ module.exports = (
|
|
|
310
282
|
// Otherwise React will be compiled in the very slow development mode.
|
|
311
283
|
isEnvProduction &&
|
|
312
284
|
new webpack.DefinePlugin({
|
|
313
|
-
PRODUCTION: JSON.stringify(true)
|
|
285
|
+
PRODUCTION: JSON.stringify(true),
|
|
314
286
|
}),
|
|
315
287
|
isEnvProduction &&
|
|
316
288
|
new MiniCssExtractPlugin({
|
|
317
289
|
// Options similar to the same options in webpackOptions.output
|
|
318
290
|
// both options are optional
|
|
319
291
|
filename: `${componentKey}/css/${componentKey}.[contenthash:8].css`,
|
|
320
|
-
chunkFilename: `${componentKey}/css/${componentKey}.[contenthash:8].chunk.css
|
|
292
|
+
chunkFilename: `${componentKey}/css/${componentKey}.[contenthash:8].chunk.css`,
|
|
321
293
|
}),
|
|
322
294
|
// Moment.js is an extremely popular library that bundles large locale files
|
|
323
295
|
// by default due to how webpack interprets its code. This is a practical
|
|
@@ -326,44 +298,44 @@ module.exports = (
|
|
|
326
298
|
// You can remove this if you don't use Moment.js:
|
|
327
299
|
new webpack.IgnorePlugin({
|
|
328
300
|
resourceRegExp: /^\.\/locale$/,
|
|
329
|
-
contextRegExp: /moment
|
|
301
|
+
contextRegExp: /moment$/,
|
|
330
302
|
}),
|
|
331
303
|
/* cosmos 4.x and below */
|
|
332
304
|
/* Ignore cosmos icons */
|
|
333
305
|
new webpack.IgnorePlugin({
|
|
334
306
|
resourceRegExp: /^\.\/icons$/,
|
|
335
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
307
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
336
308
|
}),
|
|
337
309
|
|
|
338
310
|
/* Ignore cosmos icons - windows */
|
|
339
311
|
new webpack.IgnorePlugin({
|
|
340
312
|
resourceRegExp: /^\.\/icons$/,
|
|
341
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
313
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
342
314
|
}),
|
|
343
315
|
|
|
344
316
|
/* Ignore cosmos streamline-icons */
|
|
345
317
|
new webpack.IgnorePlugin({
|
|
346
318
|
resourceRegExp: /^\.\/streamline-icons$/,
|
|
347
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
319
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
348
320
|
}),
|
|
349
321
|
|
|
350
322
|
/* Ignore cosmos streamline-icons - windows */
|
|
351
323
|
new webpack.IgnorePlugin({
|
|
352
324
|
resourceRegExp: /^\.\/streamline-icons$/,
|
|
353
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
325
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
354
326
|
}),
|
|
355
327
|
|
|
356
328
|
/* cosmos 6.x and above */
|
|
357
329
|
/* Ignore cosmos icons */
|
|
358
330
|
new webpack.IgnorePlugin({
|
|
359
331
|
resourceRegExp: /^\.\/.*\/.*\.icon$/,
|
|
360
|
-
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon
|
|
332
|
+
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/,
|
|
361
333
|
}),
|
|
362
334
|
|
|
363
335
|
/* Ignore cosmos icons - windows */
|
|
364
336
|
new webpack.IgnorePlugin({
|
|
365
337
|
resourceRegExp: /^\.\/.*\/.*\.icon$/,
|
|
366
|
-
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon
|
|
338
|
+
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/,
|
|
367
339
|
}),
|
|
368
340
|
|
|
369
341
|
// This configuration works on both Windows and Unix-like systems (Linux, macOS).
|
|
@@ -378,25 +350,22 @@ module.exports = (
|
|
|
378
350
|
new webpack.ContextReplacementPlugin(new RegExp('@pega[\\\\/]cosmos-react-core[\\\\/]lib[\\\\/]components[\\\\/]Icon$'), /^$/),
|
|
379
351
|
new webpack.ContextReplacementPlugin(
|
|
380
352
|
new RegExp('@pega[\\\\/]cosmos-react-core[\\\\/]lib[\\\\/]components[\\\\/]Icon[\\\\/]streamline-icons$'),
|
|
381
|
-
|
|
353
|
+
/^$/,
|
|
382
354
|
),
|
|
383
355
|
|
|
384
356
|
new webpack.optimize.LimitChunkCountPlugin({
|
|
385
|
-
maxChunks: 1
|
|
357
|
+
maxChunks: 1,
|
|
386
358
|
}),
|
|
387
359
|
new webpack.optimize.MinChunkSizePlugin({
|
|
388
|
-
minChunkSize: 100000 // Minimum number of characters
|
|
360
|
+
minChunkSize: 100000, // Minimum number of characters
|
|
389
361
|
}),
|
|
390
|
-
!devBuild && new CompressionPlugin(compressionBRConfObj)
|
|
391
|
-
|
|
392
|
-
/* Don't generate gzip file */
|
|
393
|
-
/* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
|
|
362
|
+
!devBuild && new CompressionPlugin(compressionBRConfObj),
|
|
394
363
|
].filter(Boolean),
|
|
395
364
|
performance: {
|
|
396
365
|
hints: false,
|
|
397
366
|
maxEntrypointSize: 512000,
|
|
398
|
-
maxAssetSize: 512000
|
|
367
|
+
maxAssetSize: 512000,
|
|
399
368
|
},
|
|
400
|
-
externals
|
|
369
|
+
externals,
|
|
401
370
|
};
|
|
402
371
|
};
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
getFetchAgent,
|
|
14
14
|
addDebugLog,
|
|
15
15
|
collectSvgFiles,
|
|
16
|
-
isLaunchpadVanity
|
|
16
|
+
isLaunchpadVanity,
|
|
17
17
|
} from '../../util.js';
|
|
18
18
|
import {
|
|
19
19
|
PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
20
20
|
LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
21
21
|
LP_VANITY_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
22
|
-
TOKEN_PATH
|
|
22
|
+
TOKEN_PATH,
|
|
23
23
|
} from '../../constants.js';
|
|
24
24
|
|
|
25
|
-
export const getPublishComponentQuestions = async componentKey => {
|
|
25
|
+
export const getPublishComponentQuestions = async (componentKey) => {
|
|
26
26
|
addDebugLog('getPublishComponentQuestions', `componentKey: ${componentKey}`, '');
|
|
27
27
|
const components = await getComponents();
|
|
28
28
|
|
|
@@ -40,13 +40,13 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
40
40
|
message: 'Select component to publish',
|
|
41
41
|
choices: components,
|
|
42
42
|
default: componentKey,
|
|
43
|
-
when: () => !componentKey
|
|
43
|
+
when: () => !componentKey,
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
name: 'rulesetName',
|
|
47
47
|
message: 'Enter ruleset name',
|
|
48
48
|
default: defaultPegaConfig.rulesetName,
|
|
49
|
-
validate: value => {
|
|
49
|
+
validate: (value) => {
|
|
50
50
|
if (value.trim()) {
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
@@ -54,13 +54,13 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
54
54
|
},
|
|
55
55
|
when: () => {
|
|
56
56
|
return defaultPegaConfig.serverType === 'infinity';
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
name: 'rulesetVersion',
|
|
61
61
|
message: 'Enter ruleset version',
|
|
62
62
|
default: defaultPegaConfig.rulesetVersion,
|
|
63
|
-
validate: value => {
|
|
63
|
+
validate: (value) => {
|
|
64
64
|
if (validateRulesetVersion(value)) {
|
|
65
65
|
return true;
|
|
66
66
|
}
|
|
@@ -68,26 +68,26 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
68
68
|
},
|
|
69
69
|
when: () => {
|
|
70
70
|
return defaultPegaConfig.serverType === 'infinity';
|
|
71
|
-
}
|
|
71
|
+
},
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
name: 'sourceMap',
|
|
75
75
|
message: 'Generate source map ?',
|
|
76
76
|
default: defaultPegaConfig.sourceMap,
|
|
77
77
|
|
|
78
|
-
when: () => false
|
|
78
|
+
when: () => false,
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
name: 'devBuild',
|
|
82
82
|
type: 'confirm',
|
|
83
83
|
message: 'Generate development build ?',
|
|
84
84
|
default: defaultPegaConfig.devBuild,
|
|
85
|
-
when: () => componentKey !== 'LibraryMode'
|
|
86
|
-
}
|
|
85
|
+
when: () => componentKey !== 'LibraryMode',
|
|
86
|
+
},
|
|
87
87
|
];
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
export const zipComponent = async componentKey => {
|
|
90
|
+
export const zipComponent = async (componentKey) => {
|
|
91
91
|
addDebugLog('zipComponent', `componentKey: ${componentKey}`, '');
|
|
92
92
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
93
93
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
@@ -96,7 +96,7 @@ export const zipComponent = async componentKey => {
|
|
|
96
96
|
|
|
97
97
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
98
98
|
const zipChunks = [];
|
|
99
|
-
archive.on('data', chunk => zipChunks.push(chunk));
|
|
99
|
+
archive.on('data', (chunk) => zipChunks.push(chunk));
|
|
100
100
|
|
|
101
101
|
// Add src directory
|
|
102
102
|
archive.directory(srcDirectory, 'src');
|
|
@@ -126,7 +126,7 @@ export const zipComponent = async componentKey => {
|
|
|
126
126
|
const svgContent = collectSvgFiles(srcDirectory);
|
|
127
127
|
|
|
128
128
|
if (fs.existsSync('dist')) {
|
|
129
|
-
fs.rm('dist', { recursive: true }, err => {
|
|
129
|
+
fs.rm('dist', { recursive: true }, (err) => {
|
|
130
130
|
if (err) {
|
|
131
131
|
throw err;
|
|
132
132
|
}
|
|
@@ -154,7 +154,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
154
154
|
zipContent,
|
|
155
155
|
componentName: JSON.parse(configContent).componentKey,
|
|
156
156
|
pxUpdateDateTime: '',
|
|
157
|
-
environmentID: defaultPegaServerConfig.isolationId
|
|
157
|
+
environmentID: defaultPegaServerConfig.isolationId,
|
|
158
158
|
};
|
|
159
159
|
} else {
|
|
160
160
|
apiBody = {
|
|
@@ -165,7 +165,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
165
165
|
rulesetName,
|
|
166
166
|
rulesetVersion,
|
|
167
167
|
category: '',
|
|
168
|
-
svgContent: svgContent || []
|
|
168
|
+
svgContent: svgContent || [],
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -178,7 +178,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
178
178
|
if (OauthData) {
|
|
179
179
|
const {
|
|
180
180
|
access_token: accessToken,
|
|
181
|
-
token_type: tokenType
|
|
181
|
+
token_type: tokenType,
|
|
182
182
|
// refresh_token: refreshToken
|
|
183
183
|
} = JSON.parse(OauthData);
|
|
184
184
|
let status = 500;
|
|
@@ -195,7 +195,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
195
195
|
method: 'POST',
|
|
196
196
|
dispatcher: getFetchAgent(defaultPegaConfig),
|
|
197
197
|
headers,
|
|
198
|
-
body: JSON.stringify(apiBody)
|
|
198
|
+
body: JSON.stringify(apiBody),
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
status = response.status;
|
|
@@ -225,9 +225,9 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
225
225
|
console.log(chalk.bold.green(`Success : ${isLaunchpad ? respData : respData.message}`));
|
|
226
226
|
} catch (err) {
|
|
227
227
|
if (status === 500) {
|
|
228
|
-
throw new Error(`Error occurred in authentication. Please regenerate using authenticate
|
|
228
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`, { cause: err });
|
|
229
229
|
} else if (status === 999) {
|
|
230
|
-
throw Error(err);
|
|
230
|
+
throw Error(err, { cause: err });
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
} else {
|
|
@@ -235,7 +235,7 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
235
235
|
}
|
|
236
236
|
} catch (err) {
|
|
237
237
|
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
238
|
-
throw Error(err);
|
|
238
|
+
throw Error(err, { cause: err });
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
};
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
checkForBranch,
|
|
26
26
|
getApplicationAndVersionFromToken,
|
|
27
27
|
zipVersionAndArchive,
|
|
28
|
-
applyPegaData
|
|
28
|
+
applyPegaData,
|
|
29
29
|
} from '../../util.js';
|
|
30
30
|
|
|
31
31
|
import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
|
|
@@ -34,7 +34,7 @@ import { default as publishLibrary } from '../publish-lib/index.js';
|
|
|
34
34
|
|
|
35
35
|
import { TOKEN_PATH } from '../../constants.js';
|
|
36
36
|
|
|
37
|
-
export default async options => {
|
|
37
|
+
export default async (options) => {
|
|
38
38
|
await showVersion();
|
|
39
39
|
await checkLibraryAndArchives();
|
|
40
40
|
const isLibraryBased = getLibraryBased();
|
|
@@ -97,8 +97,8 @@ export default async options => {
|
|
|
97
97
|
name: 'confirmPublish',
|
|
98
98
|
type: 'confirm',
|
|
99
99
|
message: `Publish ${chalk.bold.green(`${orgLib.displayLibVersion}`)}, proceed ?`,
|
|
100
|
-
default: true
|
|
101
|
-
}
|
|
100
|
+
default: true,
|
|
101
|
+
},
|
|
102
102
|
]);
|
|
103
103
|
|
|
104
104
|
if (publishThisVersion.confirmPublish) {
|
|
@@ -141,8 +141,8 @@ export default async options => {
|
|
|
141
141
|
name: 'confirmPublish',
|
|
142
142
|
type: 'confirm',
|
|
143
143
|
message: `You are about to publish a ${chalk.bold.yellow('PRODUCTION')} version which can ${chalk.bold.yellow('NOT')} be deleted, proceed ?`,
|
|
144
|
-
default: false
|
|
145
|
-
}
|
|
144
|
+
default: false,
|
|
145
|
+
},
|
|
146
146
|
]);
|
|
147
147
|
if (publishAnswers.confirmPublish) {
|
|
148
148
|
okToPublish = true;
|
|
@@ -218,7 +218,7 @@ export default async options => {
|
|
|
218
218
|
({ componentKey = paramComponentKey, sourceMap, devBuild } = answers);
|
|
219
219
|
|
|
220
220
|
content = {
|
|
221
|
-
...answers
|
|
221
|
+
...answers,
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -236,7 +236,7 @@ export default async options => {
|
|
|
236
236
|
title: 'Validate config schema',
|
|
237
237
|
task: async () => {
|
|
238
238
|
await validate(componentKey);
|
|
239
|
-
}
|
|
239
|
+
},
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
242
|
title: 'Lint component',
|
|
@@ -244,33 +244,33 @@ export default async options => {
|
|
|
244
244
|
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
245
245
|
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
246
246
|
await lintComponent(targetDirectory);
|
|
247
|
-
}
|
|
247
|
+
},
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
title: `Bundle Component ${sDevBuild}`,
|
|
251
251
|
task: async () => bundleComponent(componentKey, sourceMap, devBuild),
|
|
252
|
-
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined)
|
|
252
|
+
skip: () => (options.skipBundle ? 'Skipped bundling component' : undefined),
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
title: 'Zip Component',
|
|
256
256
|
task: async () => {
|
|
257
257
|
const output = await zipComponent(componentKey);
|
|
258
258
|
content = { ...content, ...output };
|
|
259
|
-
}
|
|
259
|
+
},
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
title: 'Publish Component',
|
|
263
263
|
task: async () => {
|
|
264
264
|
await publishComponentToServer(content, doFetch);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
267
|
],
|
|
268
268
|
{
|
|
269
|
-
exitOnError: true
|
|
270
|
-
}
|
|
269
|
+
exitOnError: true,
|
|
270
|
+
},
|
|
271
271
|
);
|
|
272
272
|
|
|
273
|
-
await tasks.run().catch(err => {
|
|
273
|
+
await tasks.run().catch((err) => {
|
|
274
274
|
console.log(chalk.bold.red(err.toString()));
|
|
275
275
|
process.exit(1);
|
|
276
276
|
});
|