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

feat(colors): Add more chalk colors. And prepare for chalk upgrade #10939

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jul 12, 2024

Instead of (ab)using colors.error just to get a red color, colors.warning just to get an orange color etc, let's define a few more useful colors.

The names I've chosen for the colors are from https://github.com/orgs/community/discussions/16925
image
And that also includes some good guidelines/hints on how/when to use the different colors.

This is what the different colors look like in my terminal. Depending on your selected color scheme they might be different for you
image

In addition to all this I also stopped using keyword as chalk v4 (which we're using) is the last version to support that. So for upgrading to v6 (current latest) we can't use that anymore. The hex code I picked is what chalk use in their docs/code as an equivalent to keyword('orange').

And for completeness, here are the rest of the colors
image

This is breaking because we no longer export green as a color. Use tip or success instead depending on what you want to convey.

@Tobbe Tobbe added the release:chore This PR is a chore (means nothing for users) label Jul 12, 2024
@Tobbe Tobbe added this to the chore milestone Jul 12, 2024
@Tobbe Tobbe force-pushed the tobbe-chalk-colors branch from e9bbeb2 to 81691e0 Compare July 12, 2024 08:57
@@ -125,7 +125,8 @@ export const formatMessage = (logData: any) => {
pretty = chalk.white(msg)
}
if (level === 'warn') {
pretty = chalk.magenta(msg)
Copy link
Member Author

Choose a reason for hiding this comment

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

Switched from magenta to orange here to align with the color we use for warnings in other places in Redwood

@Tobbe Tobbe modified the milestones: chore, next-release-major Jul 12, 2024
@Tobbe Tobbe added release:breaking This PR is a breaking change and removed release:chore This PR is a chore (means nothing for users) labels Jul 12, 2024
@Tobbe Tobbe changed the title chore(colors): Add more chalk colors. And prepare for chalk upgrade feat(colors): Add more chalk colors. And prepare for chalk upgrade Jul 12, 2024
@Tobbe Tobbe enabled auto-merge (squash) July 12, 2024 12:10
@Tobbe Tobbe merged commit 01d4f16 into redwoodjs:main Jul 12, 2024
51 checks passed
dac09 pushed a commit to dac09/redwood that referenced this pull request Jul 15, 2024
…g-dual

* 'main' of github.com:redwoodjs/redwood:
  chore(web): Use attw args instead of custom output parsing (redwoodjs#10944)
  chore(web): publint and attw (redwoodjs#10943)
  chore(auth): Fix esm cjs exports and add tooling to verify correctness (redwoodjs#10942)
  chore(middleware): Move middleware out of rwjs/vite -> rwjs/web/middleware (redwoodjs#10917)
  feat(colors): Add more chalk colors. And prepare for chalk upgrade (redwoodjs#10939)
  fix(g directive): Notes formatting (redwoodjs#10940)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants