@pega/sdk 0.0.4 → 0.0.5
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/dist/index.js +287 -1
- package/package.json +1 -1
- package/templates/angular-sdk-reference/package.json +12 -12
- package/templates/angular-sdk-reference/tsconfig.json +1 -1
- package/templates/react-native-sdk-reference/expo-env.d.ts +3 -0
- package/templates/react-sdk-reference/{.github/agents/implementation-expert.agent.md → .ai-common/agents/implementation-expert.md} +23 -26
- package/templates/react-sdk-reference/{.github/copilot-instructions.md → .ai-common/global/ai-agent-instructions.md} +7 -7
- package/templates/react-sdk-reference/{.github/instructions/component-map.instructions.md → .ai-common/instructions/component-map.md} +8 -1
- package/templates/react-sdk-reference/{.github/instructions/dse-component.instructions.md → .ai-common/instructions/dse-component.md} +1 -1
- package/templates/react-sdk-reference/{.github/instructions/field-component.instructions.md → .ai-common/instructions/field-component.md} +2 -1
- package/templates/react-sdk-reference/{.github/instructions/template-component.instructions.md → .ai-common/instructions/template-component.md} +1 -1
- package/templates/react-sdk-reference/{.github/instructions/widget-component.instructions.md → .ai-common/instructions/widget-component.md} +1 -1
- package/templates/react-sdk-reference/{.github/prompts/add-component.prompt.md → .ai-common/prompts/add-component.md} +45 -18
- package/templates/react-sdk-reference/{.cursor/rules → .ai-common}/prompts/component-manifest.json +8 -2
- package/templates/react-sdk-reference/{.github/prompts/generate-all-components.prompt.md → .ai-common/prompts/generate-all-components.md} +195 -78
- package/templates/react-sdk-reference/{.github/prompts/generate-dse-components.prompt.md → .ai-common/prompts/generate-dse-components.md} +28 -17
- package/templates/react-sdk-reference/{.github/prompts/generate-field-components.prompt.md → .ai-common/prompts/generate-field-components.md} +32 -16
- package/templates/react-sdk-reference/{.github/prompts/generate-template-components.prompt.md → .ai-common/prompts/generate-template-components.md} +76 -22
- package/templates/react-sdk-reference/{.github/prompts/generate-widget-components.prompt.md → .ai-common/prompts/generate-widget-components.md} +44 -30
- package/templates/react-sdk-reference/{.claude → .ai-common}/prompts/identify-components.md +4 -0
- package/templates/react-sdk-reference/{.cursor/rules/prompts/replace-design-system.mdrules → .ai-common/prompts/replace-design-system.md} +2 -3
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/AlertBanner.md +50 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/design-system-extension-skills/Banner.md +44 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/design-system-extension-skills/CaseSummaryFields.md +54 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/design-system-extension-skills/DetailsFields.md +49 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/FieldGroup.md +44 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/design-system-extension-skills/FieldGroupList.md +43 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/FieldValueList.md +46 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/design-system-extension-skills/Operator.md +67 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/Pulse.md +20 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/RichTextEditor.md +58 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension-skills/WssQuickCreate.md +31 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/design-system-extension.md +1 -1
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-components.md +18 -1
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +298 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/CancelAlert.md +132 -3
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +358 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +230 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +221 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +213 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/Decimal.md +112 -13
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/Dropdown.md +127 -1
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/Email.md +68 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/Group.md +51 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/Integer.md +81 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/Location.md +105 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/Multiselect.md +70 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/ObjectReference.md +74 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/Percentage.md +84 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/Phone.md +81 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/RadioButtons.md +93 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/RichText.md +85 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/ScalarList.md +54 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/SelectableCard.md +55 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/SemanticLink.md +64 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/TextArea.md +66 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/TextContent.md +28 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/TextInput.md +67 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/Time.md +67 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/field-skills/URL.md +59 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/field-skills/UserReference.md +90 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-components.md +83 -52
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/AdvancedSearch.md +77 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +273 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/BannerPage.md +39 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/CaseSummary.md +79 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +399 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +282 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/Confirmation.md +89 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/DataReference.md +50 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/DefaultForm.md +117 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/DefaultPage.md +49 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/Details.md +59 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/DetailsSubTabs.md +60 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/DetailsThreeColumn.md +12 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/DetailsTwoColumn.md +12 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/DynamicTabs.md +67 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/FieldGroupTemplate.md +119 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/HierarchicalForm.md +45 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/InlineDashboard.md +41 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/InlineDashboardPage.md +56 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/ListPage.md +18 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +419 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/MultiReferenceReadOnly.md +40 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/NarrowWide.md +66 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/OneColumn.md +34 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/PromotedFilters.md +92 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/SelfServiceCaseView.md +56 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/SimpleTable.md +59 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/SingleReferenceReadOnly.md +52 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/template-skills/SubTabs.md +47 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/TwoColumn.md +49 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/WssNavBar.md +71 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-components.md +1 -1
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-skills/AppAnnouncement.md +38 -1
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-skills/Attachment.md +58 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-skills/CaseHistory.md +63 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/widget-skills/FileUtility.md +81 -14
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-skills/Followers.md +20 -0
- package/templates/react-sdk-reference/{.github → .ai-common}/skills/widget-skills/QuickCreate.md +48 -0
- package/templates/react-sdk-reference/{.claude → .ai-common}/skills/widget-skills/SummaryItem.md +66 -0
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +492 -0
- package/templates/react-sdk-reference/package.minimal.json +29 -0
- package/templates/react-sdk-reference/src/AppProviders.tsx +17 -0
- package/templates/react-sdk-reference/src/MashupApp.tsx +8 -19
- package/templates/react-sdk-reference/src/PortalApp.tsx +6 -17
- package/templates/react-sdk-reference/.claude/instructions/component-map.md +0 -38
- package/templates/react-sdk-reference/.claude/instructions/dse-component.md +0 -75
- package/templates/react-sdk-reference/.claude/instructions/field-component.md +0 -75
- package/templates/react-sdk-reference/.claude/instructions/template-component.md +0 -93
- package/templates/react-sdk-reference/.claude/instructions/widget-component.md +0 -88
- package/templates/react-sdk-reference/.claude/prompts/add-component.md +0 -152
- package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +0 -193
- package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +0 -158
- package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +0 -140
- package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +0 -153
- package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +0 -165
- package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +0 -138
- package/templates/react-sdk-reference/.claude/prompts/replace-design-system.md +0 -519
- package/templates/react-sdk-reference/.claude/skills/component-contracts.md +0 -140
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +0 -137
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +0 -134
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +0 -118
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +0 -85
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +0 -232
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +0 -137
- package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +0 -291
- package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +0 -113
- package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +0 -175
- package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +0 -109
- package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +0 -101
- package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +0 -106
- package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +0 -88
- package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +0 -188
- package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +0 -173
- package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +0 -93
- package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +0 -129
- package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +0 -167
- package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +0 -149
- package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +0 -134
- package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +0 -231
- package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +0 -155
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +0 -107
- package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +0 -89
- package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +0 -86
- package/templates/react-sdk-reference/.claude/skills/template-components.md +0 -321
- package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +0 -150
- package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +0 -124
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +0 -106
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +0 -137
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +0 -131
- package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +0 -109
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +0 -97
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +0 -80
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +0 -70
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +0 -142
- package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +0 -82
- package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +0 -114
- package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +0 -131
- package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +0 -108
- package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +0 -82
- package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +0 -206
- package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +0 -118
- package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +0 -198
- package/templates/react-sdk-reference/.cursor/rules/component-map.mdrules +0 -41
- package/templates/react-sdk-reference/.cursor/rules/dse-component.mdrules +0 -78
- package/templates/react-sdk-reference/.cursor/rules/field-component.mdrules +0 -74
- package/templates/react-sdk-reference/.cursor/rules/pega-sdk.mdrules +0 -247
- package/templates/react-sdk-reference/.cursor/rules/prompts/add-component.mdrules +0 -149
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-all-components.mdrules +0 -154
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-dse-components.mdrules +0 -131
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-field-components.mdrules +0 -144
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-template-components.mdrules +0 -156
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-widget-components.mdrules +0 -129
- package/templates/react-sdk-reference/.cursor/rules/prompts/identify-components.mdrules +0 -110
- package/templates/react-sdk-reference/.cursor/rules/skills/component-contracts.mdrules +0 -145
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/AlertBanner.mdrules +0 -140
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Banner.mdrules +0 -154
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/CaseSummaryFields.mdrules +0 -159
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/DetailsFields.mdrules +0 -149
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroup.mdrules +0 -136
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroupList.mdrules +0 -116
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldValueList.mdrules +0 -120
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Operator.mdrules +0 -154
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Pulse.mdrules +0 -88
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/RichTextEditor.mdrules +0 -211
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/WssQuickCreate.mdrules +0 -140
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension.mdrules +0 -294
- package/templates/react-sdk-reference/.cursor/rules/skills/field-components.mdrules +0 -299
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/AutoComplete.mdrules +0 -117
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/CancelAlert.mdrules +0 -208
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Checkbox.mdrules +0 -163
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Currency.mdrules +0 -111
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Date.mdrules +0 -104
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/DateTime.mdrules +0 -108
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Decimal.mdrules +0 -103
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Dropdown.mdrules +0 -119
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Email.mdrules +0 -112
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Group.mdrules +0 -95
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Integer.mdrules +0 -92
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Location.mdrules +0 -141
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Multiselect.mdrules +0 -169
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ObjectReference.mdrules +0 -169
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Percentage.mdrules +0 -97
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Phone.mdrules +0 -115
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RadioButtons.mdrules +0 -151
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RichText.mdrules +0 -143
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ScalarList.mdrules +0 -129
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SelectableCard.mdrules +0 -221
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SemanticLink.mdrules +0 -153
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextArea.mdrules +0 -101
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextContent.mdrules +0 -106
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextInput.mdrules +0 -109
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Time.mdrules +0 -93
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/URL.mdrules +0 -90
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/UserReference.mdrules +0 -185
- package/templates/react-sdk-reference/.cursor/rules/skills/run-and-verify.mdrules +0 -73
- package/templates/react-sdk-reference/.cursor/rules/skills/template-components.mdrules +0 -327
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AdvancedSearch.mdrules +0 -149
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AppShell.mdrules +0 -127
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/BannerPage.mdrules +0 -88
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseSummary.mdrules +0 -105
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseView.mdrules +0 -136
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseViewActionsMenu.mdrules +0 -131
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Confirmation.mdrules +0 -112
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DataReference.mdrules +0 -125
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultForm.mdrules +0 -107
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultPage.mdrules +0 -115
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Details.mdrules +0 -93
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsSubTabs.mdrules +0 -100
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsThreeColumn.mdrules +0 -83
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsTwoColumn.mdrules +0 -83
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DynamicTabs.mdrules +0 -106
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/FieldGroupTemplate.mdrules +0 -114
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/HierarchicalForm.mdrules +0 -118
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboard.mdrules +0 -109
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboardPage.mdrules +0 -90
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListPage.mdrules +0 -73
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListView.mdrules +0 -144
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/MultiReferenceReadOnly.mdrules +0 -85
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/NarrowWide.mdrules +0 -146
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/OneColumn.mdrules +0 -114
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/PromotedFilters.mdrules +0 -129
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SelfServiceCaseView.mdrules +0 -140
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SimpleTable.mdrules +0 -132
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SingleReferenceReadOnly.mdrules +0 -108
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SubTabs.mdrules +0 -84
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/TwoColumn.mdrules +0 -136
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WideNarrow.mdrules +0 -155
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WssNavBar.mdrules +0 -140
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-components.mdrules +0 -276
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules +0 -87
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Attachment.mdrules +0 -151
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/CaseHistory.mdrules +0 -112
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/FileUtility.mdrules +0 -205
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Followers.mdrules +0 -104
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/QuickCreate.mdrules +0 -119
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/SummaryItem.mdrules +0 -172
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/ToDo.mdrules +0 -195
- package/templates/react-sdk-reference/.cursor/rules/template-component.mdrules +0 -95
- package/templates/react-sdk-reference/.cursor/rules/widget-component.mdrules +0 -90
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +0 -193
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +0 -110
- package/templates/react-sdk-reference/.github/prompts/replace-design-system.prompt.md +0 -524
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +0 -140
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +0 -152
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +0 -159
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +0 -148
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +0 -113
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +0 -155
- package/templates/react-sdk-reference/.github/skills/field-components.md +0 -295
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +0 -113
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +0 -211
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +0 -175
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +0 -109
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +0 -101
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +0 -106
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +0 -99
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +0 -134
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +0 -109
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +0 -96
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +0 -145
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +0 -98
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +0 -117
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +0 -203
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +0 -70
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +0 -124
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +0 -86
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +0 -137
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +0 -131
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +0 -124
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +0 -104
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +0 -112
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +0 -90
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +0 -80
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +0 -106
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +0 -112
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +0 -116
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +0 -108
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +0 -82
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +0 -142
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +0 -143
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +0 -130
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +0 -142
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +0 -133
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +0 -152
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +0 -139
- package/templates/react-sdk-reference/.github/skills/widget-components.md +0 -260
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +0 -84
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +0 -151
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +0 -110
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +0 -103
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +0 -169
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +0 -198
- package/templates/react-sdk-reference/AGENTS.md +0 -246
- /package/templates/react-sdk-reference/{.claude → .ai-common}/skills/run-and-verify.md +0 -0
- /package/templates/react-sdk-reference/{.claude → .ai-common}/skills/template-skills/WideNarrow.md +0 -0
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as p from "@clack/prompts";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import path2 from "path";
|
|
7
|
+
import { createRequire } from "module";
|
|
7
8
|
|
|
8
9
|
// src/scaffold.ts
|
|
9
10
|
import fs from "fs";
|
|
@@ -361,6 +362,13 @@ async function scaffold(choices, targetDir, onProgress) {
|
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
364
|
fs.writeFileSync(path.join(componentsDir, "component-map.ts"), generateMinimalComponentMap());
|
|
365
|
+
if (framework === "react") {
|
|
366
|
+
fs.writeFileSync(path.join(targetDir, "src", "AppProviders.tsx"), generateMinimalReactProviders());
|
|
367
|
+
const muiThemeAugmentation = path.join(targetDir, "src", "mui-theme-augmentation.d.ts");
|
|
368
|
+
if (fs.existsSync(muiThemeAugmentation)) {
|
|
369
|
+
fs.rmSync(muiThemeAugmentation);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
364
372
|
} else {
|
|
365
373
|
const allCategories = ["fields", "templates", "widgets", "infra", "designSystemExtension"];
|
|
366
374
|
for (const cat of allCategories) {
|
|
@@ -376,7 +384,7 @@ async function scaffold(choices, targetDir, onProgress) {
|
|
|
376
384
|
}
|
|
377
385
|
}
|
|
378
386
|
if (!aiTool) {
|
|
379
|
-
for (const dir of [".github", ".cursor", "AGENTS.md", ".claude"]) {
|
|
387
|
+
for (const dir of [".github", ".cursor", "AGENTS.md", ".claude", ".ai-common"]) {
|
|
380
388
|
const target = path.join(targetDir, dir);
|
|
381
389
|
if (fs.existsSync(target)) {
|
|
382
390
|
fs.rmSync(target, { recursive: true });
|
|
@@ -398,10 +406,13 @@ async function scaffold(choices, targetDir, onProgress) {
|
|
|
398
406
|
}
|
|
399
407
|
}
|
|
400
408
|
}
|
|
409
|
+
generateAiConfigs(targetDir, aiTool);
|
|
401
410
|
}
|
|
402
411
|
report("Finalizing project configuration\u2026");
|
|
412
|
+
selectReactPackageManifest(targetDir, framework, includeTemplates, componentCategories);
|
|
403
413
|
transformPackageJson(path.join(targetDir, "package.json"), projectName);
|
|
404
414
|
transformTsConfig(path.join(targetDir, "tsconfig.json"));
|
|
415
|
+
transformSdkConfig(path.join(targetDir, "sdk-config.json"));
|
|
405
416
|
report("Installing dependencies (this may take a minute)\u2026");
|
|
406
417
|
try {
|
|
407
418
|
await runInstall(targetDir);
|
|
@@ -429,6 +440,18 @@ function transformPackageJson(pkgJsonPath, projectName) {
|
|
|
429
440
|
delete pkgJson.private;
|
|
430
441
|
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n");
|
|
431
442
|
}
|
|
443
|
+
function selectReactPackageManifest(targetDir, framework, includeTemplates, componentCategories) {
|
|
444
|
+
if (framework !== "react") return;
|
|
445
|
+
const pkgJsonPath = path.join(targetDir, "package.json");
|
|
446
|
+
const minimalPkgJsonPath = path.join(targetDir, "package.minimal.json");
|
|
447
|
+
const hasSampleComponents = includeTemplates && componentCategories.length > 0;
|
|
448
|
+
if (!hasSampleComponents && fs.existsSync(minimalPkgJsonPath)) {
|
|
449
|
+
fs.copyFileSync(minimalPkgJsonPath, pkgJsonPath);
|
|
450
|
+
}
|
|
451
|
+
if (fs.existsSync(minimalPkgJsonPath)) {
|
|
452
|
+
fs.rmSync(minimalPkgJsonPath);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
432
455
|
function transformTsConfig(tsconfigPath) {
|
|
433
456
|
if (!fs.existsSync(tsconfigPath)) return;
|
|
434
457
|
const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, "utf-8"));
|
|
@@ -453,6 +476,21 @@ function transformTsConfig(tsconfigPath) {
|
|
|
453
476
|
}
|
|
454
477
|
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
455
478
|
}
|
|
479
|
+
function transformSdkConfig(sdkConfigPath) {
|
|
480
|
+
if (!fs.existsSync(sdkConfigPath)) return;
|
|
481
|
+
const sdkConfig = JSON.parse(fs.readFileSync(sdkConfigPath, "utf-8"));
|
|
482
|
+
if (sdkConfig.serverConfig) {
|
|
483
|
+
if ("infinityRestServerUrl" in sdkConfig.serverConfig) sdkConfig.serverConfig.infinityRestServerUrl = "";
|
|
484
|
+
if ("appAlias" in sdkConfig.serverConfig) sdkConfig.serverConfig.appAlias = "";
|
|
485
|
+
if ("appMashupCaseType" in sdkConfig.serverConfig) sdkConfig.serverConfig.appMashupCaseType = "";
|
|
486
|
+
}
|
|
487
|
+
if (sdkConfig.authConfig) {
|
|
488
|
+
if ("mashupClientId" in sdkConfig.authConfig) sdkConfig.authConfig.mashupClientId = "";
|
|
489
|
+
if ("mashupUserIdentifier" in sdkConfig.authConfig) sdkConfig.authConfig.mashupUserIdentifier = "";
|
|
490
|
+
if ("portalClientId" in sdkConfig.authConfig) sdkConfig.authConfig.portalClientId = "";
|
|
491
|
+
}
|
|
492
|
+
fs.writeFileSync(sdkConfigPath, JSON.stringify(sdkConfig, null, 2) + "\n");
|
|
493
|
+
}
|
|
456
494
|
function generateMinimalComponentMap() {
|
|
457
495
|
return `import { sdkComponents } from '@pega/sdk-react';
|
|
458
496
|
import type { ComponentRegistry } from '@pega/sdk-types';
|
|
@@ -480,6 +518,251 @@ export function registerSampleComponents(
|
|
|
480
518
|
}
|
|
481
519
|
`;
|
|
482
520
|
}
|
|
521
|
+
function generateMinimalReactProviders() {
|
|
522
|
+
return `import type { PropsWithChildren } from 'react';
|
|
523
|
+
|
|
524
|
+
export function AppProviders({ children }: PropsWithChildren) {
|
|
525
|
+
return <>{children}</>;
|
|
526
|
+
}
|
|
527
|
+
`;
|
|
528
|
+
}
|
|
529
|
+
var AI_GEN_CONFIGS = {
|
|
530
|
+
copilot: {
|
|
531
|
+
skillDir: ".github/skills",
|
|
532
|
+
promptDir: ".github/prompts",
|
|
533
|
+
instructionsDir: ".github/instructions",
|
|
534
|
+
agentsDir: ".github/agents",
|
|
535
|
+
skillExt: "md",
|
|
536
|
+
promptExt: "prompt.md",
|
|
537
|
+
instructionsExt: "instructions.md",
|
|
538
|
+
agentExt: "agent.md",
|
|
539
|
+
tokens: {
|
|
540
|
+
"{{PROMPT_DIR}}": ".github/prompts",
|
|
541
|
+
"{{SKILL_DIR}}": ".github/skills",
|
|
542
|
+
"{{PROMPT_EXT}}": ".prompt.md",
|
|
543
|
+
"{{SKILL_EXT}}": ".md",
|
|
544
|
+
"{{AI_FILE_EXT}}": ".instructions.md"
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"claude-code": {
|
|
548
|
+
skillDir: ".claude/skills",
|
|
549
|
+
promptDir: ".claude/prompts",
|
|
550
|
+
instructionsDir: ".claude/instructions",
|
|
551
|
+
agentsDir: ".claude/agents",
|
|
552
|
+
skillExt: "md",
|
|
553
|
+
promptExt: "md",
|
|
554
|
+
instructionsExt: "md",
|
|
555
|
+
agentExt: "md",
|
|
556
|
+
tokens: {
|
|
557
|
+
"{{PROMPT_DIR}}": ".claude/prompts",
|
|
558
|
+
"{{SKILL_DIR}}": ".claude/skills",
|
|
559
|
+
"{{PROMPT_EXT}}": ".md",
|
|
560
|
+
"{{SKILL_EXT}}": ".md",
|
|
561
|
+
"{{AI_FILE_EXT}}": ".md"
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
cursor: {
|
|
565
|
+
skillDir: ".cursor/rules/skills",
|
|
566
|
+
promptDir: ".cursor/rules/prompts",
|
|
567
|
+
instructionsDir: ".cursor/rules",
|
|
568
|
+
agentsDir: ".cursor/rules/agents",
|
|
569
|
+
skillExt: "mdrules",
|
|
570
|
+
promptExt: "mdrules",
|
|
571
|
+
instructionsExt: "mdrules",
|
|
572
|
+
agentExt: "mdrules",
|
|
573
|
+
tokens: {
|
|
574
|
+
"{{PROMPT_DIR}}": ".cursor/rules/prompts",
|
|
575
|
+
"{{SKILL_DIR}}": ".cursor/rules/skills",
|
|
576
|
+
"{{PROMPT_EXT}}": ".mdrules",
|
|
577
|
+
"{{SKILL_EXT}}": ".mdrules",
|
|
578
|
+
"{{AI_FILE_EXT}}": ".mdrules"
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
function parseAiMeta(content) {
|
|
583
|
+
const match = content.match(/^---\n([\s\S]*?)\n---\n\n?/);
|
|
584
|
+
if (!match) return { meta: {}, body: content };
|
|
585
|
+
const meta = {};
|
|
586
|
+
for (const line of match[1].split("\n")) {
|
|
587
|
+
const colonIdx = line.indexOf(":");
|
|
588
|
+
if (colonIdx === -1) continue;
|
|
589
|
+
const key = line.slice(0, colonIdx).trim();
|
|
590
|
+
const val = line.slice(colonIdx + 1).trim().replace(/^"|"$/g, "");
|
|
591
|
+
if (key.startsWith("ai-")) meta[key.slice(3)] = val;
|
|
592
|
+
}
|
|
593
|
+
return { meta, body: content.slice(match[0].length) };
|
|
594
|
+
}
|
|
595
|
+
function applyTokens(content, tokens) {
|
|
596
|
+
let result = content;
|
|
597
|
+
for (const [token, value] of Object.entries(tokens)) {
|
|
598
|
+
result = result.split(token).join(value);
|
|
599
|
+
}
|
|
600
|
+
return result;
|
|
601
|
+
}
|
|
602
|
+
function cursorSkillDescription(relPath) {
|
|
603
|
+
const parts = relPath.split("/");
|
|
604
|
+
if (parts.length >= 2) {
|
|
605
|
+
const subdir = parts[parts.length - 2];
|
|
606
|
+
const name = parts[parts.length - 1].replace(/\.md$/, "");
|
|
607
|
+
if (subdir === "field-skills") return `Field component skill: ${name}`;
|
|
608
|
+
if (subdir === "template-skills") return `Template component skill: ${name}`;
|
|
609
|
+
if (subdir === "widget-skills") return `Widget component skill: ${name}`;
|
|
610
|
+
if (subdir === "design-system-extension-skills") return `DSE component skill: ${name}`;
|
|
611
|
+
}
|
|
612
|
+
return relPath.replace(/\.md$/, "").split("/").pop();
|
|
613
|
+
}
|
|
614
|
+
function generateAiConfigs(targetDir, aiTool) {
|
|
615
|
+
const aiCommonDir = path.join(targetDir, ".ai-common");
|
|
616
|
+
if (!fs.existsSync(aiCommonDir)) return;
|
|
617
|
+
const cfg = AI_GEN_CONFIGS[aiTool];
|
|
618
|
+
const { tokens } = cfg;
|
|
619
|
+
const skillsSrc = path.join(aiCommonDir, "skills");
|
|
620
|
+
if (fs.existsSync(skillsSrc)) {
|
|
621
|
+
let processSkillsDir2 = function(srcDir, relDir = "") {
|
|
622
|
+
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
623
|
+
const relPath = relDir ? `${relDir}/${entry.name}` : entry.name;
|
|
624
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
625
|
+
if (entry.isDirectory()) {
|
|
626
|
+
processSkillsDir2(srcPath, relPath);
|
|
627
|
+
} else if (entry.name.endsWith(".md")) {
|
|
628
|
+
const { body } = parseAiMeta(fs.readFileSync(srcPath, "utf-8"));
|
|
629
|
+
const outContent = applyTokens(body, tokens);
|
|
630
|
+
let frontmatter = "";
|
|
631
|
+
if (aiTool === "cursor") {
|
|
632
|
+
const desc = cursorSkillDescription(relPath);
|
|
633
|
+
frontmatter = `---
|
|
634
|
+
description: ${desc}
|
|
635
|
+
alwaysApply: false
|
|
636
|
+
---
|
|
637
|
+
|
|
638
|
+
`;
|
|
639
|
+
}
|
|
640
|
+
const outName = `${entry.name.replace(/\.md$/, "")}.${cfg.skillExt}`;
|
|
641
|
+
const outDir = path.join(targetDir, cfg.skillDir, relDir);
|
|
642
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
643
|
+
fs.writeFileSync(path.join(outDir, outName), frontmatter + outContent);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
var processSkillsDir = processSkillsDir2;
|
|
648
|
+
processSkillsDir2(skillsSrc);
|
|
649
|
+
}
|
|
650
|
+
const promptsSrc = path.join(aiCommonDir, "prompts");
|
|
651
|
+
if (fs.existsSync(promptsSrc)) {
|
|
652
|
+
const promptsDest = path.join(targetDir, cfg.promptDir);
|
|
653
|
+
fs.mkdirSync(promptsDest, { recursive: true });
|
|
654
|
+
for (const entry of fs.readdirSync(promptsSrc, { withFileTypes: true })) {
|
|
655
|
+
const srcPath = path.join(promptsSrc, entry.name);
|
|
656
|
+
if (entry.name === "component-manifest.json") {
|
|
657
|
+
fs.copyFileSync(srcPath, path.join(promptsDest, entry.name));
|
|
658
|
+
} else if (entry.name.endsWith(".md")) {
|
|
659
|
+
const { meta, body } = parseAiMeta(fs.readFileSync(srcPath, "utf-8"));
|
|
660
|
+
const outContent = applyTokens(body, tokens);
|
|
661
|
+
const basename = entry.name.replace(/\.md$/, "");
|
|
662
|
+
let frontmatter = "";
|
|
663
|
+
if (aiTool === "copilot") {
|
|
664
|
+
frontmatter = `---
|
|
665
|
+
agent: agent
|
|
666
|
+
description: ${meta.description || basename}
|
|
667
|
+
---
|
|
668
|
+
|
|
669
|
+
`;
|
|
670
|
+
} else if (aiTool === "cursor") {
|
|
671
|
+
frontmatter = `---
|
|
672
|
+
description: Workflow prompt: ${basename}
|
|
673
|
+
alwaysApply: false
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
`;
|
|
677
|
+
}
|
|
678
|
+
fs.writeFileSync(path.join(promptsDest, `${basename}.${cfg.promptExt}`), frontmatter + outContent);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
const instructionsSrc = path.join(aiCommonDir, "instructions");
|
|
683
|
+
if (fs.existsSync(instructionsSrc)) {
|
|
684
|
+
const instructionsDest = path.join(targetDir, cfg.instructionsDir);
|
|
685
|
+
fs.mkdirSync(instructionsDest, { recursive: true });
|
|
686
|
+
for (const entry of fs.readdirSync(instructionsSrc, { withFileTypes: true })) {
|
|
687
|
+
if (!entry.name.endsWith(".md")) continue;
|
|
688
|
+
const { meta, body } = parseAiMeta(fs.readFileSync(path.join(instructionsSrc, entry.name), "utf-8"));
|
|
689
|
+
const outContent = applyTokens(body, tokens);
|
|
690
|
+
const basename = entry.name.replace(/\.md$/, "");
|
|
691
|
+
let frontmatter = "";
|
|
692
|
+
if (aiTool === "cursor") {
|
|
693
|
+
frontmatter = meta.globs ? `---
|
|
694
|
+
globs: ["${meta.globs}"]
|
|
695
|
+
---
|
|
696
|
+
|
|
697
|
+
` : `---
|
|
698
|
+
alwaysApply: false
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
`;
|
|
702
|
+
} else if (aiTool === "copilot") {
|
|
703
|
+
if (meta.globs) frontmatter = `---
|
|
704
|
+
applyTo: '${meta.globs}'
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
`;
|
|
708
|
+
}
|
|
709
|
+
fs.writeFileSync(path.join(instructionsDest, `${basename}.${cfg.instructionsExt}`), frontmatter + outContent);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
const agentsSrc = path.join(aiCommonDir, "agents");
|
|
713
|
+
if (fs.existsSync(agentsSrc)) {
|
|
714
|
+
const agentsDest = path.join(targetDir, cfg.agentsDir);
|
|
715
|
+
fs.mkdirSync(agentsDest, { recursive: true });
|
|
716
|
+
for (const entry of fs.readdirSync(agentsSrc, { withFileTypes: true })) {
|
|
717
|
+
if (!entry.name.endsWith(".md")) continue;
|
|
718
|
+
const basename = entry.name.replace(/\.md$/, "");
|
|
719
|
+
const srcPath = path.join(agentsSrc, entry.name);
|
|
720
|
+
const { meta, body } = parseAiMeta(fs.readFileSync(srcPath, "utf-8"));
|
|
721
|
+
const outContent = applyTokens(body, tokens);
|
|
722
|
+
let frontmatter = "";
|
|
723
|
+
if (aiTool === "copilot") {
|
|
724
|
+
const description = applyTokens(meta.description || "", tokens);
|
|
725
|
+
const name = meta.name || basename.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
726
|
+
frontmatter = `---
|
|
727
|
+
description: "${description}"
|
|
728
|
+
name: '${name}'
|
|
729
|
+
tools: [read, edit, search, execute, agent, vscode_askQuestions]
|
|
730
|
+
user-invocable: true
|
|
731
|
+
disable-model-invocation: false
|
|
732
|
+
---
|
|
733
|
+
|
|
734
|
+
`;
|
|
735
|
+
} else if (aiTool === "cursor") {
|
|
736
|
+
const description = applyTokens(meta.description || `Agent config: ${basename}`, tokens);
|
|
737
|
+
frontmatter = `---
|
|
738
|
+
description: ${description}
|
|
739
|
+
alwaysApply: false
|
|
740
|
+
---
|
|
741
|
+
|
|
742
|
+
`;
|
|
743
|
+
}
|
|
744
|
+
fs.writeFileSync(path.join(agentsDest, `${basename}.${cfg.agentExt}`), frontmatter + outContent);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const globalSrc = path.join(aiCommonDir, "global");
|
|
748
|
+
if (fs.existsSync(globalSrc)) {
|
|
749
|
+
const instructionsSrc2 = path.join(globalSrc, "ai-agent-instructions.md");
|
|
750
|
+
if (fs.existsSync(instructionsSrc2)) {
|
|
751
|
+
const content = applyTokens(fs.readFileSync(instructionsSrc2, "utf-8"), tokens);
|
|
752
|
+
if (aiTool === "copilot") {
|
|
753
|
+
fs.mkdirSync(path.join(targetDir, ".github"), { recursive: true });
|
|
754
|
+
fs.writeFileSync(path.join(targetDir, ".github", "copilot-instructions.md"), content);
|
|
755
|
+
} else if (aiTool === "cursor") {
|
|
756
|
+
fs.mkdirSync(path.join(targetDir, ".cursor", "rules"), { recursive: true });
|
|
757
|
+
const fm = "---\ndescription: Core rules for working with Pega SDK components\nalwaysApply: true\n---\n\n";
|
|
758
|
+
fs.writeFileSync(path.join(targetDir, ".cursor", "rules", "pega-sdk.mdrules"), fm + content);
|
|
759
|
+
} else if (aiTool === "claude-code") {
|
|
760
|
+
fs.writeFileSync(path.join(targetDir, "AGENTS.md"), content);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
fs.rmSync(aiCommonDir, { recursive: true });
|
|
765
|
+
}
|
|
483
766
|
function copyDir(src, dest) {
|
|
484
767
|
fs.mkdirSync(dest, { recursive: true });
|
|
485
768
|
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
@@ -495,9 +778,12 @@ function copyDir(src, dest) {
|
|
|
495
778
|
}
|
|
496
779
|
|
|
497
780
|
// src/index.ts
|
|
781
|
+
var require2 = createRequire(import.meta.url);
|
|
782
|
+
var { version: sdkVersion } = require2("../package.json");
|
|
498
783
|
async function main() {
|
|
499
784
|
console.clear();
|
|
500
785
|
p.intro(pc.bgCyan(pc.black(" @pega/sdk ")));
|
|
786
|
+
p.log.info(`Using @pega/sdk v${sdkVersion}`);
|
|
501
787
|
const args = process.argv.slice(2);
|
|
502
788
|
const command = args[0];
|
|
503
789
|
if (command !== "init") {
|
package/package.json
CHANGED
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
"dev": "ng serve --open"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@angular/animations": "^
|
|
13
|
-
"@angular/common": "^
|
|
14
|
-
"@angular/compiler": "^
|
|
15
|
-
"@angular/core": "^
|
|
16
|
-
"@angular/forms": "^
|
|
17
|
-
"@angular/platform-browser": "^
|
|
18
|
-
"@angular/platform-browser-dynamic": "^
|
|
19
|
-
"@angular/router": "^
|
|
12
|
+
"@angular/animations": "^21.2.0",
|
|
13
|
+
"@angular/common": "^21.2.0",
|
|
14
|
+
"@angular/compiler": "^21.2.0",
|
|
15
|
+
"@angular/core": "^21.2.0",
|
|
16
|
+
"@angular/forms": "^21.2.0",
|
|
17
|
+
"@angular/platform-browser": "^21.2.0",
|
|
18
|
+
"@angular/platform-browser-dynamic": "^21.2.0",
|
|
19
|
+
"@angular/router": "^21.2.0",
|
|
20
20
|
"@pega/sdk-angular": "^0.1.0",
|
|
21
21
|
"rxjs": "~7.8.2",
|
|
22
22
|
"tslib": "^2.8.1",
|
|
23
23
|
"zone.js": "~0.16.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@angular-devkit/build-angular": "^
|
|
27
|
-
"@angular/cli": "^
|
|
28
|
-
"@angular/compiler-cli": "^
|
|
29
|
-
"typescript": "~
|
|
26
|
+
"@angular-devkit/build-angular": "^21.2.0",
|
|
27
|
+
"@angular/cli": "^21.2.0",
|
|
28
|
+
"@angular/compiler-cli": "^21.2.0",
|
|
29
|
+
"typescript": "~5.9.3"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@pega/sdk-angular": ["../../packages/sdk-angular/src/index.ts"],
|
|
22
22
|
"@pega/sdk-types": ["../../packages/sdk-types/src/index.ts"]
|
|
23
23
|
},
|
|
24
|
-
"ignoreDeprecations": "
|
|
24
|
+
"ignoreDeprecations": "5.0"
|
|
25
25
|
},
|
|
26
26
|
"angularCompilerOptions": {
|
|
27
27
|
"enableI18nLegacyMessageIdFormat": false,
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tools: [read, edit, search, execute, agent, vscode_askQuestions]
|
|
5
|
-
user-invocable: true
|
|
6
|
-
disable-model-invocation: false
|
|
2
|
+
ai-name: Implementation Expert
|
|
3
|
+
ai-description: "Use when the user wants to generate, create, add, replace, migrate, or identify UI components (field, template, widget, design system extension, or infra) in this Pega SDK reference app — a single component, a batch, or the entire app — with any design system (Ant Design, Chakra UI, Radix, Shadcn, Carbon, MUI, etc.). Handles trigger phrases like 'generate a component', 'add a component', 'replace all field components with...', 'migrate the design system to...', 'replace everything with...', 'what components are in this screenshot'. Executes the repo's existing {{PROMPT_DIR}} workflows end-to-end — generation, batch generation, full-app generation, screenshot-based identification, and full/targeted design-system migration — including component-map.ts registration, provider setup, and build verification."
|
|
7
4
|
---
|
|
8
5
|
|
|
9
6
|
You are the **Implementation Expert** for this Pega Infinity SDK React reference application. You are not limited
|
|
10
|
-
to generating new components — you implement the **entire component lifecycle flow** defined in
|
|
7
|
+
to generating new components — you implement the **entire component lifecycle flow** defined in `{{PROMPT_DIR}}/`:
|
|
11
8
|
creating components, batch-generating them, generating the whole app, identifying components from screenshots, and
|
|
12
9
|
migrating the design system of components that already exist. You execute these workflows end-to-end exactly as
|
|
13
10
|
written, rather than improvising your own approach.
|
|
@@ -57,31 +54,31 @@ before writing any code**. Never paraphrase or execute steps from memory — alw
|
|
|
57
54
|
skill file it tells you to read) at the start of the task, and follow every numbered step in order without
|
|
58
55
|
skipping or shortcutting any of them.
|
|
59
56
|
|
|
60
|
-
| Request shape | Prompt file to read and follow
|
|
61
|
-
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
-
| One new/replacement component, one type (e.g. "add an AutoComplete field with Chakra UI") |
|
|
63
|
-
| Multiple/all field components, one design system |
|
|
64
|
-
| Multiple/all template components, one design system |
|
|
65
|
-
| Multiple/all widget components, one design system |
|
|
66
|
-
| Multiple/all design system extension components, one design system |
|
|
67
|
-
| Multiple component types at once, or "generate all components" |
|
|
68
|
-
| A screenshot/image is attached and the user wants to know what components are in it (no migration requested) |
|
|
69
|
-
| Migrating/replacing the design system of components that **already exist** — full app, or scoped by folder/named-shorthand/explicit list/screenshot |
|
|
57
|
+
| Request shape | Prompt file to read and follow |
|
|
58
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| One new/replacement component, one type (e.g. "add an AutoComplete field with Chakra UI") | `{{PROMPT_DIR}}/add-component{{PROMPT_EXT}}` |
|
|
60
|
+
| Multiple/all field components, one design system | `{{PROMPT_DIR}}/generate-field-components{{PROMPT_EXT}}` |
|
|
61
|
+
| Multiple/all template components, one design system | `{{PROMPT_DIR}}/generate-template-components{{PROMPT_EXT}}` |
|
|
62
|
+
| Multiple/all widget components, one design system | `{{PROMPT_DIR}}/generate-widget-components{{PROMPT_EXT}}` |
|
|
63
|
+
| Multiple/all design system extension components, one design system | `{{PROMPT_DIR}}/generate-dse-components{{PROMPT_EXT}}` |
|
|
64
|
+
| Multiple component types at once, or "generate all components" | `{{PROMPT_DIR}}/generate-all-components{{PROMPT_EXT}}` (wave-based orchestration — launch subagents via `runSubagent`, respecting the ≤10-subagents-per-wave limit defined in that prompt) |
|
|
65
|
+
| A screenshot/image is attached and the user wants to know what components are in it (no migration requested) | `{{PROMPT_DIR}}/identify-components{{PROMPT_EXT}}` — output only the single `components="..."` line it specifies |
|
|
66
|
+
| Migrating/replacing the design system of components that **already exist** — full app, or scoped by folder/named-shorthand/explicit list/screenshot | `{{PROMPT_DIR}}/replace-design-system{{PROMPT_EXT}}` (reads `{{PROMPT_DIR}}/component-manifest.json` for scope resolution; targeted migration for ≤10 resolved components, full 9-wave migration otherwise) |
|
|
70
67
|
|
|
71
68
|
If a request mixes generation and migration ambiguously, use `vscode_askQuestions` to ask which they mean (options:
|
|
72
69
|
"Generate/replace" vs "Migrate existing") before picking a prompt — generation prompts assume the component
|
|
73
70
|
doesn't exist yet (or is being fully rewritten), migration assumes it exists and only its design-system primitives
|
|
74
71
|
change.
|
|
75
72
|
|
|
76
|
-
### Migration-specific notes (`replace-design-system
|
|
73
|
+
### Migration-specific notes (`replace-design-system{{PROMPT_EXT}}`)
|
|
77
74
|
|
|
78
75
|
- That prompt tells you to launch per-component subagents using prompts named `replace-field` (fields) and
|
|
79
|
-
`replace-component` (everything else). **These files do not exist in
|
|
76
|
+
`replace-component` (everything else). **These files do not exist in `{{PROMPT_DIR}}/`.** When launching those
|
|
80
77
|
subagents yourself via `runSubagent`, give each one the equivalent instructions inline instead: the relevant
|
|
81
|
-
general skill (
|
|
78
|
+
general skill (`{{SKILL_DIR}}/field-components.md`, `template-components.md`, `widget-components.md`, or
|
|
82
79
|
`design-system-extension.md`), the component-specific skill file
|
|
83
|
-
(
|
|
84
|
-
keep default export name / update in place" constraints that `add-component
|
|
80
|
+
(`{{SKILL_DIR}}/{type}-skills/<Name>.md`), the target design system, and the same "preserve visual intent /
|
|
81
|
+
keep default export name / update in place" constraints that `add-component{{PROMPT_EXT}}` uses for a single
|
|
85
82
|
component.
|
|
86
83
|
- Root provider setup (Step T1.3 / 1.3) and `FieldValueList` replacement (Step T1.4 / 1.4) are blocking
|
|
87
84
|
prerequisites — complete them before launching any migration subagent wave.
|
|
@@ -89,7 +86,7 @@ change.
|
|
|
89
86
|
## Step 0 — resolve missing inputs
|
|
90
87
|
|
|
91
88
|
Every generation prompt requires: component name(s), component type, target design system, and output path.
|
|
92
|
-
`replace-design-system
|
|
89
|
+
`replace-design-system{{PROMPT_EXT}}` requires a target design system plus at least one way to resolve scope
|
|
93
90
|
(screenshot, `components=` list, or `scope=` folder/shorthand) — if none are given, it defaults to a full 9-wave
|
|
94
91
|
migration, so confirm that's really what the user wants before proceeding. If any required input is missing or
|
|
95
92
|
ambiguous, use the `vscode_askQuestions` tool to ask — present concrete, selectable options (e.g. the known
|
|
@@ -102,17 +99,17 @@ design system or silently default to MUI.
|
|
|
102
99
|
- **One folder per component — never a shared/monolithic file.** Every component (field, template, widget, or
|
|
103
100
|
designSystemExtension) must be created at `<outputPath>/<ComponentName>/<ComponentName>.tsx` plus a sibling
|
|
104
101
|
`<outputPath>/<ComponentName>/index.tsx` that does `export { default } from './<ComponentName>';` — exactly as
|
|
105
|
-
Step 5/6 of `add-component
|
|
102
|
+
Step 5/6 of `add-component{{PROMPT_EXT}}` specifies. Never write multiple components into one `.tsx` file, never
|
|
106
103
|
create a catch-all file like `generated/<designSystem>Components.tsx`, and never export a single bundled object
|
|
107
104
|
(e.g. `generatedComponents`) that `component-map.ts` spreads in one line. This applies identically whether you
|
|
108
|
-
generate one component, a batch of one type, or "all components" via `generate-all-components
|
|
105
|
+
generate one component, a batch of one type, or "all components" via `generate-all-components{{PROMPT_EXT}}` — the
|
|
109
106
|
wave/subagent orchestration in that flow does not change the per-component file-and-folder contract.
|
|
110
107
|
- `component-map.ts` must get one **named import + one map entry per component**, added under the matching
|
|
111
108
|
category comment (Fields / Templates / Widgets / Design System Extension), never a single spread of a bundled
|
|
112
109
|
object.
|
|
113
110
|
- Never modify the auth/bootstrap logic in `src/MashupApp.tsx`/`src/PortalApp.tsx`, `src/components/infra/`
|
|
114
111
|
(beyond what a migration prompt explicitly directs), `src/components/helpers/event-utils.ts`, or anything under
|
|
115
|
-
`@pega/sdk-react`. The one exception: `replace-design-system
|
|
112
|
+
`@pega/sdk-react`. The one exception: `replace-design-system{{PROMPT_EXT}}` explicitly requires wrapping the
|
|
116
113
|
existing provider tree in `MashupApp.tsx`/`PortalApp.tsx` with a new design-system provider — that specific,
|
|
117
114
|
additive change is allowed only during a migration flow.
|
|
118
115
|
- Never remove the `...sdkComponents` spread in `src/components/component-map.ts` — only add or replace entries.
|
|
@@ -127,7 +124,7 @@ design system or silently default to MUI.
|
|
|
127
124
|
|
|
128
125
|
## Verification
|
|
129
126
|
|
|
130
|
-
After generation or migration, run the build (`npm run build`, or the steps in
|
|
127
|
+
After generation or migration, run the build (`npm run build`, or the steps in `{{SKILL_DIR}}/run-and-verify{{SKILL_EXT}}`
|
|
131
128
|
if the prompt references it) and report the result. Before declaring success, confirm the folder-per-component
|
|
132
129
|
contract held: every generated/replaced component has its own `<ComponentName>/<ComponentName>.tsx` +
|
|
133
130
|
`<ComponentName>/index.tsx`, and no monolithic/shared/"generated" bundle file was created. Summarize: which
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pega SDK — React Reference App
|
|
2
2
|
|
|
3
3
|
You are assisting developers in a React reference application that demonstrates the Pega Infinity SDK. Customers clone this repo and **replace the sample UI components with their own design system** (MUI, Chakra, Radix, Shadcn, Ant Design, or any other).
|
|
4
4
|
|
|
@@ -189,7 +189,7 @@ import handleEvent from '../../helpers/event-utils';
|
|
|
189
189
|
## 9. Component Generation Workflow — Single Component
|
|
190
190
|
|
|
191
191
|
When the user asks to generate, create, add, or replace **a single UI component** (e.g., "generate an AutoComplete component", "add a Dropdown using Chakra UI"),
|
|
192
|
-
read the full contents of
|
|
192
|
+
read the full contents of `{{PROMPT_DIR}}/add-component{{PROMPT_EXT}}` and
|
|
193
193
|
execute every step in order before writing any code.
|
|
194
194
|
Do not skip steps or proceed without reading the required skill files first.
|
|
195
195
|
|
|
@@ -200,7 +200,7 @@ Do not skip steps or proceed without reading the required skill files first.
|
|
|
200
200
|
## 10. Batch Field Component Generation
|
|
201
201
|
|
|
202
202
|
When the user asks to generate, create, or replace **multiple field components** or **all field components** with a design system (e.g., "generate field components with Ant Design", "replace all fields with Chakra UI", "generate all field components using Radix"),
|
|
203
|
-
read the full contents of
|
|
203
|
+
read the full contents of `{{PROMPT_DIR}}/generate-field-components{{PROMPT_EXT}}` and
|
|
204
204
|
execute every step in order before writing any code.
|
|
205
205
|
Do not skip steps or proceed without reading the required skill files first.
|
|
206
206
|
|
|
@@ -209,7 +209,7 @@ Do not skip steps or proceed without reading the required skill files first.
|
|
|
209
209
|
## 11. Batch Template Component Generation
|
|
210
210
|
|
|
211
211
|
When the user asks to generate, create, or replace **multiple template components** or **all template components** with a design system (e.g., "generate template components with Ant Design", "replace all templates with Chakra UI", "generate layout templates using Radix"),
|
|
212
|
-
read the full contents of
|
|
212
|
+
read the full contents of `{{PROMPT_DIR}}/generate-template-components{{PROMPT_EXT}}` and
|
|
213
213
|
execute every step in order before writing any code.
|
|
214
214
|
Do not skip steps or proceed without reading the required skill files first.
|
|
215
215
|
|
|
@@ -218,7 +218,7 @@ Do not skip steps or proceed without reading the required skill files first.
|
|
|
218
218
|
## 12. Batch Widget Component Generation
|
|
219
219
|
|
|
220
220
|
When the user asks to generate, create, or replace **multiple widget components** or **all widget components** with a design system (e.g., "generate widget components with Ant Design", "replace all widgets with Chakra UI", "generate widgets using Carbon"),
|
|
221
|
-
read the full contents of
|
|
221
|
+
read the full contents of `{{PROMPT_DIR}}/generate-widget-components{{PROMPT_EXT}}` and
|
|
222
222
|
execute every step in order before writing any code.
|
|
223
223
|
Do not skip steps or proceed without reading the required skill files first.
|
|
224
224
|
|
|
@@ -227,7 +227,7 @@ Do not skip steps or proceed without reading the required skill files first.
|
|
|
227
227
|
## 13. Batch Design System Extension Component Generation
|
|
228
228
|
|
|
229
229
|
When the user asks to generate, create, or replace **multiple design system extension components** or **all DSE components** with a design system (e.g., "generate DSE components with Ant Design", "replace design system extension components with Chakra UI", "generate designSystemExtension components using Carbon"),
|
|
230
|
-
read the full contents of
|
|
230
|
+
read the full contents of `{{PROMPT_DIR}}/generate-dse-components{{PROMPT_EXT}}` and
|
|
231
231
|
execute every step in order before writing any code.
|
|
232
232
|
Do not skip steps or proceed without reading the required skill files first.
|
|
233
233
|
|
|
@@ -236,7 +236,7 @@ Do not skip steps or proceed without reading the required skill files first.
|
|
|
236
236
|
## 14. Generate All Components (Multi-Type)
|
|
237
237
|
|
|
238
238
|
When the user asks to generate, create, or replace components across **multiple types** or **all component types** at once (e.g., "generate all components with Ant Design", "replace everything with Chakra UI", "generate field and widget components using Carbon", "regenerate all components"),
|
|
239
|
-
read the full contents of
|
|
239
|
+
read the full contents of `{{PROMPT_DIR}}/generate-all-components{{PROMPT_EXT}}` and
|
|
240
240
|
execute every step in order before writing any code.
|
|
241
241
|
Do not skip steps or proceed without reading the required skill files first.
|
|
242
242
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
ai-globs: **/component-map.ts
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Component Map Rules
|
|
@@ -38,3 +38,10 @@ function getSampleComponentMap() {
|
|
|
38
38
|
- `Todo: ToDo` (casing difference)
|
|
39
39
|
|
|
40
40
|
6. **Keep the `registerSampleComponents` function** — it registers all entries into the `ComponentRegistry` instance used by the PConnect bridge.
|
|
41
|
+
|
|
42
|
+
7. **Sub-component registration** — Some template/widget components internally render sub-components via `getComponentFromRegistry()`. These sub-components MUST also be registered in the component map or they will be `undefined` at runtime. Known sub-components:
|
|
43
|
+
- `SearchForm` — used by `DataReference` and `AdvancedSearch`
|
|
44
|
+
- `SearchGroups` — used by `AdvancedSearch`
|
|
45
|
+
- `ActionButtonsForFileUtil` — used by `FileUtility`
|
|
46
|
+
|
|
47
|
+
8. **`Todo` vs `ToDo` key** — The Pega engine sends `Todo` (capital T, lowercase odo). The component variable may be named `ToDo`, but the map key MUST be `Todo: ToDo`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
ai-globs: src/components/field/**/*.tsx
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Field Component Rules
|
|
@@ -75,3 +75,4 @@ The replacement must look the same as the original component:
|
|
|
75
75
|
- Hardcode component imports for components that exist in the registry
|
|
76
76
|
- Remove the `handleEvent` import from `../../helpers/event-utils`
|
|
77
77
|
- Drop visual styles when removing `makeStyles` — always map them to an equivalent
|
|
78
|
+
- **Import the same symbol twice from `field-utils`** — if you import `DynamicFieldProps` (or any other export) in one import statement, do NOT add a separate `import type { DynamicFieldProps }` line. This causes `"DynamicFieldProps is already defined"` errors. Use a single import: `import { commitField, DynamicFieldProps, FieldValue, getFieldContext } from '../field-utils';`
|