skratchdot / npm-dview

Compare current package.json dependency version numbers with latest remote version number.
MIT License
31 stars 3 forks source link

More distinct Current flag #2

Closed adrianblynch closed 9 years ago

adrianblynch commented 9 years ago

I'll preface this with, I don't expect this PR to be accepted as it's not complete and is unlikely to work on windows or be fit for piped parsing...

I found it hard to scan the list and see only the false values in the current column so I took inspiration from Mocha's spec output and put some checks and crosses in place of the booleans.

Tests still passed which is a little worrying(?)

screen shot 2015-08-14 at 09 17 17
skratchdot commented 9 years ago

I like this change. Was also thinking about making the whole row red or green (depending on true or false values). Not sure if that would help (or make things illegible).

Check out this file: https://github.com/mochajs/mocha/blob/03af0fe3764b718c32a57e47d8cd26f88e72371b/lib/reporters/base.js

Searching the above mocha file for "symbol" and "color" comes up w/ some good ways of handling the cross-platform stuff. Right now I'm using "cli-table" which uses "colors" for cli coloring. It seems like I should probably follow mocha's approach (using "supports-colors" and having a symbol map for windows vs other).

adrianblynch commented 9 years ago

I was thinking the same thing.

The checks and crosses are a nice touch but come with a price, not working on Windows is one. I think Mocha fixed it by dropping back to characters in the available console fonts.

Either way, a nice tool which has highlighted a need for us to update a bunch of modules!