sverweij / dependency-cruiser

Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
https://npmjs.com/dependency-cruiser
MIT License
5.27k stars 250 forks source link

refactor: removes 3rd party dependency 'wrap-ansi' #946

Closed sverweij closed 3 months ago

sverweij commented 3 months ago

Description

Motivation and Context

Reduces the number of 3rd party dependencies by 7, which is good for download size & performance and reduces potential vulnerabilities and maintenance burden.

We do wrap with ansi-codes, but if we apply the ansi codes after wrapping, we don't need the specialised wrap-ansi package anymore and can do with a simple hand-rolled function for wrapping, which is what this PR implements (the function is ugly, and might not cover all edge cases but it works well enough for our use case).

From npmgraph:

shows wrap-ansi's module dependency graph, with its 6 indirect dependencies shows the number of bytes wrap-ansi adds to dependency-cruiser's install size; 96kb unpacked, with emoji-regex and get-east-asian-width as the largest contributors

How Has This Been Tested?

Types of changes

Checklist

codeclimate[bot] commented 3 months ago

Code Climate has analyzed commit 3f89e5ec and detected 0 issues on this pull request.

View more on Code Climate.