Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Jul 7, 2024

Description

  • removes 3rd party dependency 'wrap-ansi'

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?

  • green ci

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

Copy link

codeclimate bot commented Jul 8, 2024

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

View more on Code Climate.

@sverweij sverweij merged commit 6e618ce into main Jul 8, 2024
10 checks passed
@sverweij sverweij deleted the refactor/removes-wrap-ansi-dependency branch July 8, 2024 18:18
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