feat: remove primeng/@primeuix/* dependencies and vendor MIT-licensed source (cps-ui-kit)#719
Merged
Merged
Conversation
Last MIT-licensed PrimeNG release before v22's license change. Pinned exactly (not ^) since this version becomes the source-of-truth for the upcoming vendoring work that removes the primeng dependency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PrimeNG drops MIT licensing starting v22 (see https://primeui.dev/nextchapter). 21.1.9 is the last MIT release, so its source for the ~14 PrimeNG submodules cps-ui-kit actually uses (plus their full 37-module/437-file transitive dependency closure, e.g. Table's template internally renders Button/Checkbox/ Select/icons) is vendored into projects/cps-ui-kit/src/lib/primeng-temp/ instead of depending on the primeng npm package. - Copied unmodified from primefaces/primeng tag 21.1.9 via scripts/rewrite-primeng-imports.mjs, which also mechanically rewrote every `primeng/x` import to a relative path and stamped each file with a provenance header. - Added `// @ts-nocheck` to vendored files (this repo's tsconfig is stricter than PrimeNG's own) plus targeted `$any()` template casts and a handful of widened shared-helper type signatures where Angular's strictTemplates flagged type mismatches that `@ts-nocheck` alone can't suppress. See primeng-temp/NOTICE.md for the itemized list of every non-mechanical change and why each was needed, including two cases that deliberately preserve pre-existing upstream quirks rather than "fixing" them. - Removed `primeng`/`primeicons` from package.json; added `@primeuix/motion` and `@primeuix/styles` as explicit direct/peer dependencies (previously only transitive via primeng). - Added root NOTICE + primeng-temp/NOTICE.md for MIT attribution per license terms and this repo's own Apache-2.0 §4 redistribution requirements. - Excluded primeng-temp from eslint/prettier/jest-coverage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
projects/cps-ui-kit/styles/styles.scss (bundled with the published library via ng-package.json assets) still had `@use 'primeicons/primeicons.css'` after primeicons was dropped as a dependency. Nothing in cps-ui-kit references pi-* icon classes (confirmed during the primeng vendoring work), so this was dead weight rather than something to reinstate the dependency for. Caught by a Playwright run: the missing stylesheet broke the whole demo app via Vite's error overlay intercepting pointer events. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…maining npm deps The vendored PrimeNG code (primeng-temp/) still depended on four npm packages published under PrimeTek's separate primeuix monorepo. Vendors those too, into projects/cps-ui-kit/src/lib/primeuix-temp/, so cps-ui-kit has zero external primeng-ecosystem dependencies. - Copied from primefaces/primeuix HEAD (commit b9467bc4) via scripts/rewrite-primeuix-imports.mjs - no matching git tags exist for the currently-installed npm versions, so HEAD was used after confirming every function/symbol actually used matches in shape (see primeuix-temp/NOTICE.md for the full version-drift disclosure). - @primeuix/styles scoped to only the 17 component subdirectories actually referenced (of 94 available upstream); utils/styled/motion vendored in full since their barrels re-export everything. - Original src/ (and motion's sibling types/) directory nesting preserved exactly per package, unlike primeng-temp - primeuix has real relative imports reaching outside src/ that depend on that nesting depth. - No @ts-nocheck needed (primeuix's own tsconfig is already as strict as this repo's); only 7 small mechanical fixes were required (an explicit return, six underscore-prefixed unused parameters) - see primeuix-temp/NOTICE.md for the itemized list. - Removed @primeuix/{utils,styled,motion,styles} from package.json entirely. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…temp/ Prompted by a fair question: was every vendored file actually needed, or did the original vendoring just blindly copy whole directories? Answer: mostly needed, but not entirely. Built a precise call-graph trace - starting from every symbol actually imported by name anywhere in cps-ui-kit/src, through real re-export chains to each symbol's true declaring file, then through that file's own real imports - as opposed to the original vendoring's coarser module/package-level reachability check. - primeng-temp: 437 -> 417 files. Removed whole types/<component>/ directories for components never vendored at all (chart, contextmenu, dataview, multiselect, password, picklist, textarea), plus orphaned index.ts stubs shadowed by public_api.ts. - primeuix-temp: 183 -> 116 files. Removed 70 files from utils/styled that were vendored in full (their own index.ts re-exports everything, which made the original module-level check see "reachable via the barrel" without checking whether anything actually calls the specific function) - including styled's entire theme-customization action API (definePreset, usePreset, etc.), never reachable through cps-ui-kit's own public API either. motion and styles had zero waste (styles was already hand-scoped from the start). Verified by deleting and rebuilding, not just by trusting the static analysis - this caught 3 files the analysis incorrectly flagged, restored after the rebuild surfaced them: primeng-temp/dom/domhandler.ts consumes them via a namespace import (import * as utils) + property access rather than a named import, which the symbol-scan missed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 "optional chain not nullable" warnings appeared on `ng serve`, confined to three vendored PrimeNG files. Fixed each at its actual root cause instead of suppressing the check: - button.ts: Button.buttonProps (and, for consistency, the unused ButtonDirective's buttonProps) was typed as always-defined despite having no default value and never being bound anywhere in this codebase - the type was simply wrong, not the defensive `?.` in the template. Widened both to `ButtonProps | undefined`. - table.ts: filterButtonProps has a full default object, so it's genuinely always defined - the leading `?.` in 5 template expressions was truly redundant. Removed just that one operator in each case, kept the deeper `popover?.x` chains since popover's own type legitimately allows undefined. - tree.ts: a native (input) event bound directly on a static element guarantees a non-null $event.target - removed the redundant `?.`. Verified individually via the compiler's own reported diagnostic location for each case before touching it, since a blind strip-the- operator pass would have been unsafe for the button.ts cases. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Precise per-feature audit of what cps-table/cps-tree-table/cps-datepicker/ cps-select actually expose from their vendored PrimeNG dependencies found these were already dead today, independent of any further edits: - 27 icon components (icons/) never rendered by any exposed feature - reachable only because icons/public_api.ts is a blanket `export *` barrel, the same blind spot already fixed once for primeuix-temp but never re-run against primeng-temp's own barrels. - FilterSlashIcon: imported and listed in TableModule but never actually rendered (no data-p-icon="filter-slash" anywhere). - api/contextmenuservice.ts: wires a <p-contextMenu> overlay that isn't vendored/used anywhere. 417 -> 360 files in primeng-temp/. A separate, much larger opportunity was also identified and precisely quantified (stripping ~3200 dead lines of unexposed Table/TreeTable features - column reordering, context-menu rows, cell/row editing - which would cascade into removing RadioButton and 2 more icons) but requires editing table.ts/treetable.ts's own component logic rather than deleting files, and was deliberately left out of scope for this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
primeng/@primeuix/* dependencies and vendor MIT-licensed source (cps-ui-kit)primeng/@primeuix/* dependencies and vendor MIT-licensed source (cps-ui-kit)
Contributor
Coverage report for library
Test suite run success2391 tests passing in 76 suites. Report generated by 🧪jest coverage report action from 6910acc |
Contributor
Playwright test resultsDetails
|
TerranceKhumalo-absa
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR targets the
next-majorbranch, rather thanmaster, as it is part of the next major version update.Summary
21.1.9(last MIT release before v22's license change) intoprojects/cps-ui-kit/src/lib/primeng-temp/, and the@primeuix/{utils,styled,motion,styles}packages it depends on intoprimeuix-temp/. Removesprimeng,primeicons,@primeuix/styled,@primeuix/utilsfrompackage.json-cps-ui-kitnow has zero primeng-ecosystem npm dependenciescps-ui-kitsource files that imported from these packages to point at the vendored code instead (mechanical import-path rewrite, no logic changes)primeng-temp+ 116primeuix-temp)NOTICEfiles documenting MIT attribution, provenance (source repo, commit/tag, fetch date), and every non-mechanical modification made to the vendored code, per MIT's terms and this repo's own Apache-2.0 §4 redistribution requirementsnext-major: composition app's shipped JS is not larger (initial bundle −13.3 kB raw / −2.4 kB gzip-estimate; total JS −26.4 kB) - the publishedcps-ui-kitpackage itself is larger (+4.7 MB, since it now contains the vendored source), but that doesn't reach the app's final bundle since it's tree-shakenWhy
PrimeNG drops MIT licensing at v22 (primeui.dev/nextchapter).
The change in the current PR freezes the code, removes the dependency risk ahead of Angular 22 upgrade, allows to tune it in case of any compatibilities with Angular 22, and allows us to gradually get rid of the PrimeNG code from the library: #686
Additional notes
primeng-temp//primeuix-temp/are large (476 files) but every file carries a provenance header; seeNOTICE.mdin each directory for the itemized list of every non-mechanical changecps-table/cps-tree-table/etc. (native column filter, cell editing, context menus, drag-drop, etc.) and could be stripped for a further few files - but that means editing PrimeNG's own component logic, which is a fundamentally different (and higher-maintenance) kind of change than vendoring. Anyways, we will eventually get rid of this code while reimplementing/refactoring the components that depend on itRelease notes:
primeng/@primeuix/*dependencies and vendor MIT-licensed source (cps-ui-kit)