Skip to content

chore(deps): remove unused npm packages and Angular modules - #159

Merged
djerfy merged 2 commits into
mainfrom
chore/deps-remove-unused
Oct 29, 2026
Merged

djerfy merged 2 commits into
mainfrom
chore/deps-remove-unused

Conversation

@djerfy

@djerfy djerfy commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The app still carried a large part of the Velzon template dependency set. This PR removes every npm package, Angular module, global asset and stylesheet that is not referenced by the application code, templates or build configuration.

Removed dependencies

Area Packages
UI widgets @angular/cdk, @angular/material, @ctrl/ngx-emoji-mart, @ng-select/ng-select, simplebar-angular, angular-feather, angular-ng-autocomplete, angular-ng-stepper
Charts chart.js, echarts, ng2-charts, ngx-echarts, @types/echarts
Forms & inputs angularx-flatpickr, flatpickr, ng-otp-input, ngx-mask, ngx-color-picker, ngx-drag-drop, ngx-dropzone-wrapper
Misc ngx-csv, ngx-lightbox, ngx-masonry, masonry-layout, ngx-pipes, fuzzy-search, axios, moment, leaflet, @types/leaflet, jquery, @types/jquery, prismjs, @types/prismjs, sweetalert2, metismenujs, browserslist, @types/file-saver, @types/lodash

npm uninstall dropped 118 packages in total (transitive dependencies included).

Angular modules

  • pages.module.ts: removed FlatpickrModule, SimplebarAngularModule, NgPipesModule, NgbTypeaheadModule, NgbDropdownModule (only used by the topbar), the redundant HttpClientModule and the unused ReactiveFormsModule
  • layouts.module.ts: removed SimplebarAngularModule, NgbNavModule, NgbCollapseModule, FormsModule and ReactiveFormsModule
  • shared.module.ts: removed the three unused Ngb* modules
  • app.module.ts: removed the redundant CommonModule (already exported by BrowserModule)

Build config and styles

  • angular.json: dropped the global prism.css, flatpickr.css and @ctrl/ngx-emoji-mart/picker.css styles, the jquery/apexcharts scripts (charts are bundled by ng-apexcharts) and 38 stale allowedCommonJsDependencies entries
  • deleted the 31 unused Velzon plugin partials and the never-imported RTL variants (~7,200 lines of CSS)
  • pruned the dead library overrides in angular-custom.scss, _dashboard.scss and the plugin imports in app.scss
  • deleted src/typings.d.ts (only declared CKEditor and jQuery globals)

Kept on purpose

  • @popperjs/core: peer dependency of bootstrap
  • filesize: peer dependency of ngx-filesize
  • @angular/compiler, @angular/localize, tslib, zone.js: required by the build/runtime

Verification

  • npm ci installs 330 packages with no peer dependency error
  • ng build --configuration=production: success, 0 warning (initial CSS 1.10 MB / 130.50 kB transfer)
  • ng test --watch=false: 24/24 tests across 22 files
  • Playwright smoke test (Chrome, 1440x900) on 16 routes (/, /farmers, /blocks, /farmer/:id, /rewards, /reward/:id, /chia, /pool/status, /pool/stats, /pool/logs, /partials, /info/faq, /info/fee, /info/team, /join, /login): all HTTP 200, 0 console error, 0 page error; ApexCharts, tabs, accordions, terminal, pagination and team images render correctly
  • No lint target is configured in this project (ng lint reports no target), so there is nothing to run

Supersedes

This makes the following Dependabot PRs obsolete, since the packages are removed instead of upgraded:

#101 and #99 were already closed by Dependabot as up to date.

Drop every dependency that is not referenced by the application code,
templates or build configuration:

- UI widgets: @angular/cdk, @angular/material, @ctrl/ngx-emoji-mart,
  @ng-select/ng-select, simplebar-angular, angular-feather,
  angular-ng-autocomplete, angular-ng-stepper
- charts: chart.js, echarts, ng2-charts, ngx-echarts, @types/echarts
- forms and inputs: angularx-flatpickr, flatpickr, ng-otp-input,
  ngx-mask, ngx-color-picker, ngx-drag-drop, ngx-dropzone-wrapper
- misc: ngx-csv, ngx-lightbox, ngx-masonry, masonry-layout, ngx-pipes,
  fuzzy-search, axios, moment, leaflet, @types/leaflet, jquery,
  @types/jquery, prismjs, @types/prismjs, sweetalert2, metismenujs,
  browserslist, @types/file-saver, @types/lodash

Remove the NgModule declarations that only existed for those packages
(FlatpickrModule, SimplebarAngularModule, NgPipesModule,
NgbTypeaheadModule and unused Ngb/Common/Forms modules), drop the
global CSS and JS entries from angular.json, and delete the dead
Velzon overrides in angular-custom.scss.

@popperjs/core is kept as it is a peer dependency of bootstrap.
The plugin partials only targeted third-party libraries that are no
longer installed (swiper, select2, ckeditor, datatables, dropzone,
flatpickr, prismjs, sweetalert2, ...). None of their selectors are used
by the templates, so they only inflated the shipped CSS bundle.

Also remove the unused RTL variants, which were never imported, and the
flatpickr block from the dashboard partial.
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