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

--no-color fix #5207

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

--no-color fix #5207

wants to merge 3 commits into from

Conversation

amcaplan
Copy link
Contributor

@amcaplan amcaplan commented Jan 15, 2025

WHY are these changes introduced?

The user's expressed --no-color preference is not respected when logging warnings and errors.

Additional context: Some versions of node color console.warn output yellow and console.error output red unless they output is already colored explicitly. While this has been rolled back, it seems safest to stop relying on these functions and simply write directly to stdout/stderr.

WHAT is this pull request doing?

$ p shopify kitchen-sink static --no-color

Before:

Screenshot 2025-01-15 at 23 31 49

After:

Screenshot 2025-01-15 at 23 33 46

How to test your changes?

$ p shopify kitchen-sink static with and without --no-color

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@amcaplan amcaplan requested review from a team as code owners January 15, 2025 21:34
Copy link
Contributor

@jamieguerrero jamieguerrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tophatted and LGTM!

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75.16% 8893/11832
🟡 Branches 70.28% 4342/6178
🟡 Functions 75.06% 2326/3099
🟡 Lines
75.71% (+0.01% 🔼)
8408/11105
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%

Test suite run success

2007 tests passing in 906 suites.

Report generated by 🧪jest coverage report action from ed0047f

jamesmengo and others added 3 commits January 15, 2025 23:41
Certain versions of node add colors to console.warn and console.error
which doesn't respect our control of colors via chalk. To avoid this
kind of interference with the CLI, we should write directly to output
streams.
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.

3 participants