uber / bufrw

Buffer Reading and Writing
MIT License
32 stars 19 forks source link

Fixed FusionJS issue 622 by using ansi-colors instead of ansi-color #68

Open ajbogh opened 4 years ago

ajbogh commented 4 years ago

Related: fusionjs/fusion-cli#622 https://github.com/jcorbin/hexer/pull/17

ansi-color uses octal notation for colors that seems to cause errors when using Babel's es2015 preset which uses strict mode for Javascript. This strict mode doesn't allow hex codes starting with \0xy, it must start with \u0xy instead. Instead of attempting to fix very old code within ansi-color, I have changed the package dependency to use a better supported utility called ansi-colors.

While making this decision to use ansi-colors, we also could have used chalk. Both are well used and supported, but ansi-colors was a better near drop-in replacement to ansi-color. This change makes the external contract the same, so users of hexer will notice no difference and won't need to change their code at all besides the package version.

It's entirely possible to create a patch or minor version update since this is an internal change that doesn't affect external code.