-
Notifications
You must be signed in to change notification settings - Fork 663
feat(cli/unstable): Introduce Ansi module #6756
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6756 +/- ##
=======================================
Coverage 94.15% 94.15%
=======================================
Files 587 587
Lines 42468 42468
Branches 6702 6702
=======================================
Hits 39986 39986
Misses 2433 2433
Partials 49 49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
iuioiua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this should be implemented as pure functions and constants, rather than a class. We've also stepped away from using enums in this codebase.
|
I agree with @iuioiua . Class usage like this seems strange to me. |
I remember a meeting when it was decided to have classes only in std when they have a changeable state (I think it was a discussion about |
|
22 of the 43 codes would just be exporting constant variables. To add to the enum bit. It is a const enum so it disappears when the code is transpiled. The numbers behind the enum is what's important for the code and using a const enum to represent each number adds to readability. |
|
I am never attempting a rebase again |
|
Mostly looks good to me. Left some question |
kt3k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@iuioiua What do you think?
|
Let's try and iterate |
Read (#6755) for an overview.
There are many static methods and properties here. This is not an exhaustive list of what is available. Nor is everything guaranteed to work in every terminal. But I have tested each one and they all work in my terminal.
This example creates a very big "Hello World!" in terminals that support these Ansi codes.
No tests as of yet have been written for this module as I am not sure how to write unit tests to test its behaviour. The codes are either correct or incorrect and whether they work in the terminal is dependent on whether the terminal supports said code.