How pegasystems/web-components-sdk works
Based on our review of the complete file tree and the README file, this project is the Web Components SDK. Its purpose is to enable Pega customers to create digital experience (DX) components by bridging Pega’s ConstellationJS Engine APIs with a custom, Lion-based design system. In other words, it is a front-end SDK for building replaceable and extensible web components that are used on Pega Infinity applications.
Main Components
• SDK Core & Bridge Layer:
• “constellation” directory and the “bridge” folder inside “src”. These folders form the core connection between the Constellation APIs and the SDK, enabling integration with Pega Infinity.
• UI Components (Design System):
• One large, modular segment is the “src/components” folder, which houses a variety of sub-folders: fields, templates, widgets, forms, and design system extensions. Each subfolder includes its own styles, configuration files, and code.
▪ Form & Field Components (e.g., AutoComplete, Checkbox, Date, TextInput)
▪ Template Components (e.g., CaseView, ListView, TwoColumn)
▪ Widget Components (e.g., AppAnnouncement, CaseOperator, FileUtility)
▪ Extension Components (under designSystemExtension)
• That these components are built with LitElement, lit-html, and upgraded Lion web components.
• Sample Applications:
• The “src/samples” directory contains sample implementations (Embedded, FullPortal, SimplePortal, etc.) which demonstrate how the SDK is integrated into real-world use cases.
• Helpers, Utilities & Configuration:
• The “src/helpers” folder encapsulates utility functions, formatters, and support code that assist the UI components.
• Build and Testing Infrastructure:
• Also, include the “tests” directory—a set of automated tests (end-to-end tests with Playwright and other integration tests) that validate the SDK’s functionality.
Relationships and Interactions
• The “Bridge Layer” interacts with the Constellation API, passing data to and from the “UI Components.”
• The “UI Components” consume helper functions and utilities from the “helpers” folder.
• Sample applications illustrate how the SDK’s components are instantiated and interact with the Pega backend.
Architectural Patterns and Design Principles
• Modularity and reusability: The project is highly componentized, grouping similar UI and form elements together.
• Layered Architecture: Illustrate a separation between the presentation layer (UI components), the integration/bridge layer (connecting to Pega APIs), and the configuration/test/build layers.
Relevant Technologies and Frameworks
• Frontend Libraries: LitElement, lit-html.
• Design System: Lion web components (now using @lion/ui).
• Build Tools: Webpack, Babel.
• Testing: Playwright for e2e tests.
• CI/CD: GitHub Actions workflows as evidenced in the “.github/workflows” folder.