This repository consists of two projects:
cps-ui-kit- shared components library itselfcomposition- application for previewing compositions of components consumed from the library
- Autocomplete
- Button
- Button toggles
- Checkbox
- Chip
- Datepicker
- Dialog
- Divider
- Expansion panel
- File upload
- Icon
- Info circle
- Input
- Loader
- Menu
- Notifications
- Paginator
- Progress circular (indeterminate)
- Progress linear (indeterminate)
- Radio
- Scheduler
- Select
- Sidebar menu
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timepicker
- Tooltip directive
- Tree autocomplete
- Tree select
- Tree table
Run ng build cps-ui-kit --watch and ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.
- go to
projects/cps-ui-kit/src/lib/componentsdirectory - run:
ng g c cps-componentname --standalone --prefix - modify
projects/cps-ui-kit/src/public-api.tsto export the component from the library - update available components list in
projects/cps-ui-kit/README.md(keep alphabetical order!)
Make sure ng build cps-ui-kit --watch is running, so the library will be rebuilt on each change of its contents due to --watch flag
- go to
projects/composition/src/app/pagesdirectory - run:
ng g c componentname-page --standalone - there is no need to test composition pages, so manually delete
componentname-page.component.cy.tsfile (can't be done automatically with Angular CLI flag, since cypress is used) - provide
host: { class: 'composition-page' }into page@Component - import the components for the composition page from
cps-ui-kit, provide them to imports array of@Component - include
ComponentDocsViewerComponentinto@Componentimportsarray in case of a new component page, includeServiceDocsViewerComponentinto@Componentimportsarray in case of a new service page - import
ComponentData or ServiceDatafrom '../../api-data/cps-componentname.json' once it is generated - wrap page html template contents into
<app-component-docs-viewer [componentData]="componentData">...</app-component-docs-viewer>in case of a new component page, wrap page html template contents into<app-service-docs-viewer [serviceData]="serviceData">...</app-service-docs-viewer>in case of a new service page - go to
projects/composition/src/app/components/navigation-sidebar.component.tsfile and extend_componentsarray (keep alphabetical order!) - go to
projects/composition/src/app/app-routing.module.tsand add a new route for a new page - update available components list in
/README.md(keep alphabetical order!)
Execute npm run generate-json-api to generate documentation for any changes in the components' API.
npm run test
npm run test:playwright (headless run)
npm run test:playwright:headed to run tests in headed mode (browser visible)
npm run test:playwright:interactive to open Playwright UI mode
See playwright/README.md for full details.
Versioning and the changelog are driven by Conventional Commits. Because PRs are squash-merged, the PR title becomes the single commit on master, so the PR title is what must follow the convention (enforced by the Check PR Title workflow):
<type>(<scope>): <subject>
Type determines the version bump and changelog section:
| Type | Bump | Changelog |
|---|---|---|
feat |
minor | Features |
fix |
patch | Bug Fixes |
perf |
patch | Performance Improvements |
feat! / fix! / BREAKING CHANGE: footer |
major | Breaking section |
docs, style, refactor, test, build, ci, chore |
none | hidden |
Scope (optional) is the component the change targets, written as the component name without the cps- prefix. It only affects how the entry is grouped/labelled in the changelog (this is a single package, so the scope does not change versioning). Use the component name from the list above:
feat(chip): add dismissible variant
fix(scheduler): correct keyboard navigation in month view
fix(tree-table): resolve a11y issue with row focus
Omit the scope for cross-cutting changes that don't map to a single component (theming, shared utilities, build, repo-wide a11y sweeps):
chore: bump X package to v1.2.3
There is intentionally no fixed list of allowed scopes: scope is free-form so new components don't require a CI change. Keep names consistent with the component directory (minus
cps-).
Publishing is fully automated by Release Please. You never edit the version in package.json by hand.
- Merge feature/fix PRs to
masteras usual (squash merge, conventional title). - Release Please keeps an open "release" PR up to date, accumulating the next version bump and the generated
CHANGELOG.mdfrom the merged commits. - When you're ready to ship, merge the release PR. That tags the release and triggers the publish job, which builds and publishes to NPM via trusted publishing (OIDC), with no NPM token required.
The current released version is tracked in .release-please-manifest.json; Release Please updates both it and projects/cps-ui-kit/package.json inside the release PR.
The project uses pa11y-ci to test all components for WCAG 2.0 AA compliance.
To run accessibility tests:
-
Start the development server:
npm run start
-
In a separate terminal, run the accessibility tests:
npm run test:a11y
Alternatively, use the combined script that starts the server and runs tests:
npm run test:a11y:localFor a colorful summary with statistics:
npm run test:a11y:summaryThis will display:
- Total URLs tested with pass/fail ratio
- Total accessibility errors found
- Accessibility standard (WCAG 2.0 AA)
- Test engine (axe-core via pa11y-ci)
- Top 10 components with the most issues
The tests will check all 33 components for accessibility issues and report any violations found.