Update frontend dependencies - #1038
Open
kaysond wants to merge 1 commit into
Open
Conversation
Refresh the lockfile onto the newest releases that build on Angular 13, drop packages that nothing imports, and pin the remaining vulnerable transitive packages with npm overrides. Removed as unused: crypto-js, rrule, ngx-markdown (registered but never rendered), quill (stylesheet only, no .ql-* markup), @types/highlight.js, and the dead tslint/codelyzer and protractor tooling. The lint architect target pointed at @angular-devkit/build-angular:tslint, which no longer ships with build-angular 13, so `ng lint` was already failing. @types/lodash, @types/node and ng-apexcharts had caret ranges that resolve to releases requiring TypeScript 4.7+ or Angular 14+, so a plain `npm install` could not build. They are now pinned to the newest releases that compile under TypeScript 4.6.4 and Angular 13. Advisories against the lockfile: 134 across 57 packages -> 24 across 6.
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.
Closes #937
Refreshes the frontend dependency tree so the open dependabot PRs can be closed, and drops the
packages that were pulling in vulnerabilities without being used. No UI changes.
What changed
Removed unused packages (each verified to have no reachable usage in
src/):crypto-js,@types/crypto-jssrc/ore2e/rrulengx-markdownMarkdownModule.forRoot({})inapp.module.ts; no<markdown>element, directive, component or service is used anywhere. Pulled inmarked,prismjsandkatex.quillquill.snow.cssinvendors.scssand a.ql-*override sheet. Nothing in the app renders.ql-*markup.tslint,codelyzer,tslint.json, thelinttargetangular.jsonpointed at@angular-devkit/build-angular:tslint, a builder that no longer exists in the installed@angular-devkit/build-angular@13.3.11, sonpm run lintwas already failing.protractor,jasmine-spec-reporter,@types/jasminewd2,e2e/, thee2etargetMakefile). It was the source ofrequest,form-data@2.3.3,webdriver-manager,adm-zip,xml2jsandtough-cookie.@types/highlight.jsBumped every remaining direct dependency to the newest release that still works on this
toolchain, and fixed three ranges that were already unsatisfiable — on
mastera plainnpm install(as opposed tonpm ci) resolves them to versions that cannot build:@types/lodash^4.14.188infer N extends numberneeds TypeScript ≥ 4.7~4.14.202@types/node^18.11.9typeof ServerResponse<…>generics, needs TypeScript ≥ 4.718.19.47ng-apexcharts^1.7.4ɵɵComponentDeclaration(8 type args; Angular 13 wants 6)~1.7.7The
@types/nodeone is the nastiest of the three: it only breaks the spec build, song testserves a 404 for
/_karma_webpack_/main.jsand printsExecuted 0 of 0 SUCCESS / TOTAL: 0 SUCCESS.The exit code is non-zero, but the human-readable output says SUCCESS.
Added an
overridesblock for the transitive packages that had advisories but no directdependency to bump.
Result
Advisories against the lockfile go from 134 across 57 packages to 24 across 6:
The production bundle also gets smaller — initial total 325.88 kB → 293.80 kB transferred
(
main207.68 → 191.61 kB from dropping ngx-markdown,styles89.21 → 86.79 kB from droppingquill,
polyfills27.63 → 13.98 kB because the refreshedcaniuse-litenarrows the browserslistresult).
One thing worth eyeballing:
apexchartsmoves 3.37.3 → 3.54.1 (within the peer rangeng-apexchartsalready declared). It is the only runtime library in this PR that draws anything, soit is the only one that could plausibly shift rendering.
What is deliberately not fixed
@angular/core,@angular/commonand@angular/compilerstill carry advisories; every fix forthem lands in Angular ≥ 18.2.15 / ≥ 19.2.26. Dependabot's proposal (#859, #981) is to jump to
v21-lts, which cannot be done without UI changes:src/@treo/styles/treo.scss,src/@treo/styles/vendors/_angular-material.scssandsrc/@treo/styles/utilities/_colors.scssare built on the legacy Angular Material Sass API(
@import '~@angular/material/theming',mat-core(),mat-light-theme($p, $a, $w)). That API wasremoved in Angular Material 15 — the same release that moved every component to MDC, which changes
component metrics and appearance and orphans the
.mat-form-field-*overrides insrc/@treo/styles/overrides/_angular-material.scss. Doing that upgrade properly means rewriting theTreo theming layer, so it wants to be its own issue rather than part of a dependency refresh.
The rest of the remainder is dev-only and unfixable on this toolchain:
webpack-dev-server@4.7.3— no fix exists in the 4.x line, and 5.x is not compatible with theAngular 13
dev-serverbuilder. Only reachable viang serve.ip— no fixed version has been published forGHSA-2p57-rm9w-gvfp.brace-expansion— the fix is 5.0.8, which is ESM-only and would breakminimatch'srequire().AI disclosure
Per AI_POLICY.md: this branch was written by Claude Code (Opus 5). It made all of
the code and config changes above, chose the override set, and ran the checks below. Everything ran
inside containers (
node:24-trixiewith headless Chromium); nothing was installed on the host.Automated verification performed, on this branch and against
masterfor comparison:npm ciandnpm install— both cleannpm run build:prod— succeeds; the bundle sizes above are measured, not estimatednpx ng test --watch=false --browsers=ChromeHeadless --code-coverage— 87/87 pass, same as masterpacote.extract()exercised end to end, to confirm thetarmajor-version override does not break@angular/cli's package fetching (ng add/ng update)That is the extent of the verification behind this PR as opened; no manual/browser testing is claimed.