Skip to content

Conversation

@fbartho
Copy link

@fbartho fbartho commented Jan 12, 2022

This PR migrates prettyjson from colors to chalk - Related: #57 #54

This breaks support for the following "colors":

  • rainbow
  • zebra
  • america
  • trap
  • random
  • zalgo

These were present in colors.js and are not present in chalk

One of these "colors" (rainbow) is referenced in a unit test. Options:
A. Delete the unit test
B. Implement this color (and other alternative colors?) on top of chalk.js

Additionally, in chalk 5.x, they have gone ESM-only, so I pinned us to chalk @ 4.x -- chalk's 5.0 release links to Pure ESM

Features

  • Hex Color Support! "#FFFFFF"
  • options.unknownColorHandler by default warns users if a color isn't supported. This warning can be disabled via "ignore", or the user can provide a custom function to render a given input into the expected "color"
  • Allow overriding of true/false color via options.trueColor, options.falseColor
  • Allow overriding of null/undefined color via options.nullUndefinedColor

Remaining Tasks

  • Resolve the broken test / alternative-colors decision
  • Acknowledge chalk < 5 constraint, or decide how to proceed

@@ -0,0 +1 @@
14
Copy link
Author

Choose a reason for hiding this comment

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

npm versions higher than 6 (which is what comes with node 14) change the version of package-lock.json from 1 to 2.

Version 2 is backwards compatible with package-lock.json version 1, but I didn't want to make that change in this PR.

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