Skip to content

chore: modernization (CI gates, API guard, type ratchet, bridge tests, a11y, generator, OnPush) - #608

Draft
ghoshArnab wants to merge 43 commits into
masterfrom
chore/phase-a-modernization
Draft

ghoshArnab wants to merge 43 commits into
masterfrom
chore/phase-a-modernization

Conversation

@ghoshArnab

@ghoshArnab ghoshArnab commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Repository modernization for customers who clone and customise this repo, with an agent-assisted workflow. Everything is additive for consumers of @pega/angular-sdk-components and @pega/angular-sdk-overrides unless noted.

Library and components

  • *ngIf/*ngFor migrated to @if/@for; OnPush for synchronous field and presentational components; FieldBase<TValue = any> with a markForCheck() hook the bridge calls after store updates.
  • Deprecated API usage removed (localizeText replaces getLocalizedValue) and enforced with @typescript-eslint/no-deprecated.
  • Bridge: prop resolution and form-field cleanup extracted into _bridge/helpers; characterization tests added.
  • Bug fixes found by new behaviour tests (SemanticLink visibility, Location first render, RadioButtons locale and error display, Multiselect listType, ListViewActionButtons rejected submit, RootContainer "Missing: undefined" flash, ListView column ids, NavBar/WssNavBar page tracking).
  • Angular 21.2.25, Node 24, TypeScript ^5.9.3; unused @angular/animations and @angular/material-experimental removed; Tiptap 3.31.4; Husky v9.

Tests and tooling

  • Unit tests moved from Karma/Jasmine to Vitest 4 via @angular/build:unit-test (jsdom); about 630 tests, coverage floor raised; behaviour tests for the field components.
  • node scripts/verify.js (one command for all CI checks), public API report (api-extractor), noImplicitAny per-file ratchet, overrides type-check, tarball smoke test, scripts/new-component.js, scripts/configure-sdk.js, changelog and release-version tooling (existing CHANGELOG.md format and manual release process kept).
  • .github/workflows/quality.yml runs on ubuntu-24.04-arm with current action majors; Dependabot runs quarterly.

Agent

  • One sdk-engineer agent (.github/agents/), AGENTS.md, copilot-setup-steps.yml, and the sdk-pconnect-api skill alongside the existing Spec Kit skills.

Not verified

Playwright E2E (needs a Pega Infinity server) was not run. Rendering-affecting changes (OnPush, animations removal, localizeText, the FieldBase init order, Multiselect listType) should be checked in the MediaCo portal and embedded flows before merging.

Follow-ups (for later PRs)

  • NG0100 in the dev console (for example DataReference, Stages): to be fixed in a follow-up.
  • Localization and accessibility: FieldBase.getErrorMessage and the rich-text aria-labels are hard-coded English; templates and widgets lack ARIA and axe tests.
  • Placeholder specs: about 80 specs still assert only "should create".
  • noImplicitAny baseline: about 1,000 errors in scripts/implicit-any-baseline.json.
  • Bridge: split subscription, registration and shouldComponentUpdate into services, after more characterization tests.
  • Smaller items: constructor injection to inject(), 66 ::ng-deep uses, @angular/material-moment-adapter in date fields, CI unit tests take about 3 minutes (per-file jsdom and setup cost).
  • Decisions needed: Google Places AutocompleteService migration, test app to the esbuild builder, @pega/pcore-pconnect-typedefs 5.x, and a future major (signal inputs, @defer, secondary entry points, Angular 22 with Vitest 5).

@ghoshArnab ghoshArnab changed the title chore: phase A modernization (control flow, CI gates, API report, rel… chore: modernization (CI gates, API guard, type ratchet, bridge tests, a11y, generator, OnPush) Oct 1, 2026
@ghoshArnab
ghoshArnab force-pushed the chore/phase-a-modernization branch 4 times, most recently from 4938d67 to fcc299f Compare October 1, 2026 15:59
Arnab Ghosh added 8 commits October 1, 2026 21:35
- *ngIf/*ngFor/ngSwitch to @if/@for/@switch across component templates
- OnPush for synchronous field components and presentational components
- FieldBase<TValue> generic (default any) and markForCheck() called by the bridge
- takeUntilDestroyed for location and dashboard-filter subscriptions
- type the bridge and component map for noImplicitAny
…s and a11y checks

- global PCore/PConnect stand-ins, createMockChild, createMockActionsApi
- stubComponentMapper and getMappedComponents for isolated component tests
- _hooks.spec.ts loads first so single specs can be run with --include
- 41 of 43 skipped specs restored (ListView and RootContainer keep specific TODOs)
- new specs for CaseService, DatapageService, event-util, field-group-utils, Utils
- characterization tests for the bridge service and component map
- axe-core accessibility checks for 12 field components
- karma coverage thresholds as a floor
- npm run verify: single check runner (--quick, --only, --json, --keep-going)
- noImplicitAny per-file ratchet with baseline
- public API report with api-extractor, tarball smoke test
- overrides package type-check; build-overrides now rewrites import type paths
- component catalogue generator and component scaffolding script
- quality workflow for pull requests
…e setup

- npm run configure applies SDK_* variables to sdk-config.json with validation
- npm run doctor checks Node, dependencies, config, ports and Infinity reachability
- Playwright base URL from SDK_E2E_BASE_URL, CI reporters, failure artifacts
…n helper

- npm run changelog (add, new-release, release-date, check) preserves CHANGELOG.md format
- npm run release:version sets the version in root, both packages and the lock file
- changelog entries for this work
…p unused packages

- Angular 21 family updated to 21.2.25; engines ^24.0.0; typescript ^5.9.3
- remove unused @angular/animations and @angular/material-experimental
- Tiptap 3.31.4; husky 9 setup without the deprecated husky.sh sourcing
- npm scripts for the new tooling; package metadata for both packages
- quarterly grouped dependabot version updates
…and ADRs

- guides for setup, sdk-config.json and SDK_* variables, CI-agnostic pipeline steps
- customizing, theming, testing and troubleshooting guides; docs index
- ADR 0001 (roadmap) and ADR 0002 (outcomes and deferred work, version constraints)
- README quick start
…ency check

- AGENTS.md start-here guide: verify loop, definition of done, recipes, pitfalls
- CLAUDE.md, copilot-instructions, llms.txt, copilot-setup-steps workflow
- eight custom agents, fifteen skills and prompts under .github
- npm run check:agents validates front matter and referenced npm scripts
@ghoshArnab
ghoshArnab force-pushed the chore/phase-a-modernization branch from fcc299f to f41596e Compare October 1, 2026 16:06
Arnab Ghosh added 14 commits October 1, 2026 21:53
- use Angular's @angular/build:unit-test builder with Vitest on jsdom (no browser needed)
- global hooks are now a setup file (src/test-hooks.ts); vitest.config.ts enables isolation
- convert Jasmine APIs to Vitest (vi.fn, vi.spyOn, expect.objectContaining, rejects.toThrow)
- rewrite the accessibility spec without a dynamic template (AOT compile) and add real specs
  for four previously empty spec files
- coverage via v8 with thresholds in angular.json; drop Karma and Jasmine dependencies
- remove the test app test target whose scaffold specs never compiled
- update docs, skills, agents and instructions
Vitest stays on 4.x because @angular/build 21 supports ^4.0.8 only.
- ListView: builds its list context from engine metadata and loads data (supplied through PCore)
- RootContainer: creates preview and modal containers, display-only handling, noPortal rendering
- no unit tests are skipped any more; coverage thresholds raised to 34/31/34/32
- replace the unskip skill and prompt with guidance on strengthening placeholder specs
- add localizeText (non-deprecated localization service) and replace 22 getLocalizedValue calls
- export localizeText from the public API and refresh the API report
- enable @typescript-eslint/no-deprecated; Google AutocompleteService keeps a justified disable
- use the observer form of RxJS subscribe and provideRouter in the test app
- library build uses the @angular/build ng-packagr builder; @types/node 24.19
- update agent guidance and the changelog
Move prop resolution and form-field context cleanup into bridge helpers.
Public service API and behaviour are unchanged.
Replace placeholder 'should create' specs for 28 field components with
tests for config mapping, handlers, validation and display mode.
Raise the coverage floor to match.
- SemanticLink: boolean visibility false now hides the link
- Location: stored value shows on first render
- RadioButtons: propName available during first update; mat-error shows
- Multiselect: listType assigned so associated lists skip metadata
- ListViewActionButtons: handle rejected submit
- FieldBase: resolve actionsApi/propName before first update
Invoke the tooling scripts directly (node scripts/..., npx) from verify,
CI, docs, agents and skills so package.json stays close to master.
The single agent routes by mode (build, fix, bridge, test, accessibility,
docs, release, review, upgrade, customise, explain) and loads the skills.
Add repository knowledge, conventions, tooling, CI, mode workflows for
build, fix, bridge, test, accessibility, docs, release, review, upgrade and
customise, plus checklists, report formats, an error catalogue and glossary.
Arnab Ghosh added 21 commits October 2, 2026 01:24
copilot-setup-steps stays on ubuntu-latest, the runner the Copilot agent supports.
Delete the eight prompt files that duplicated agent modes. Add the binding
constitution, the Spec Kit workflow, 2026 Angular 21 practices, working
method and a risk and escalation matrix to the agent.
NavBar and WssNavBar rebuild navPages$ with new objects on every refresh.
With @for tracking by reference the views were recreated after they had been
checked when a store callback fired during change detection.
A store callback fired during change detection rebuilt childrenToRender and
made the @for create views after their parent was checked (NG0100).
Store callbacks fired while Angular checks the view tree changed state the
template had already been checked against, causing NG0100 with @for and @if
in Stages, NavBar, DataReference and others. The bridge now defers such
callbacks to a microtask and schedules a new pass for components that cannot
mark themselves.
NG0100 came from views that were not refreshed after state changed outside
Angular's event system: the dev-mode check pass then saw new state. The
component mapper now gives components without markForCheck one backed by
their ComponentRef, so the bridge's existing markForCheck call after store
updates refreshes them, and DataReference flags its view when its datasource
arrives. Reverts the bridge change-detection deferral, which did not address
the cause.
The sdk-engineer agent already holds the other recipes. Update references.
Remove the new guides, ADRs, llms.txt and the generated component catalogue
with its generator and check; restore README and CONTRIBUTING. Update
references in AGENTS.md, the agent and tooling.
…gineer agent

Fold the former getting-started, configuration, theming and troubleshooting
guides into the agent as Onboard, Theming and Troubleshoot modes with checks,
method, evidence collection and a runtime error catalogue.
Order the parts by purpose (principles, facts, router, modes, cross-cutting
practice, reference), renumber with consistent cross references, and add a
retrieval guide, critical rules, a question index, a table of contents and a
use-when and keywords line for every part. No content removed.
Add Part 14: boundary and component contract, integration levels, discovery
and gap analysis, token and brand layer, per-component override with a worked
example, adapter layer for a family, design-language checklist, tokens
pipeline, governance, migration plan, verification and anti-patterns. Renumber
the later parts and update the router, index and table of contents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant