Skip to content

Conversation

@kinggoesgaming
Copy link
Contributor

  • refactor: use styleText instead of chalk
  • build(deps): remove chalk

This is a rework of #798

Test Plan

No tests or docs need changing

Screenshots

No change that requires diff of screenshots

closes: #792

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Looks great, just one thing.

? 'redBright'
: 'red'
const dur = chalk[color](`${e.duration}ms`)
const dur = styleText(color, `${e.duration}ms`)
Copy link
Member

Choose a reason for hiding this comment

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

This is great except that the style text utility does not support the redBright color. So we'll have to come up with something else for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the ForegroundColors type (which is the type for text colors), the following are allowed:

type ForegroundColors =
        | "black"
        | "blackBright"
        | "blue"
        | "blueBright"
        | "cyan"
        | "cyanBright"
        | "gray"
        | "green"
        | "greenBright"
        | "grey"
        | "magenta"
        | "magentaBright"
        | "red"
        | "redBright"
        | "white"
        | "whiteBright"
        | "yellow"
        | "yellowBright";

redBright appears to be allowed (and I am not seeing any type errors)

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for double checking on that!

@kentcdodds kentcdodds merged commit af3a7f9 into epicweb-dev:main Feb 14, 2025
5 checks passed
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.

Use styleText from node:util

2 participants