-
Notifications
You must be signed in to change notification settings - Fork 58
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
add colorized output and symbols in terminal #56
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this new addition, it will make looking into the terminal more pleasant.
why are you checking if it is windows and changing the character based on that is it a known encoding problem?
1- eslint errors
2- Merge conflicts
3- some comments
src/command.js
Outdated
@@ -17,6 +17,7 @@ const defaultQuickMode = false; | |||
const defaultSaveState = null; | |||
const defaultOutputType = 'terminal'; | |||
const defaultAccessToken = ''; | |||
const defaultColors = '1'; // No color 1 Ansi, 2 Chalk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be null
src/command.js
Outdated
@@ -109,6 +110,7 @@ export default (watchPath) => { | |||
.option('-l, --log-level [n]', 'Log level', handelInputValues('LOG_LEVEL', watchConfig.logLevel, defaultLogLevel)) | |||
.option('-o,--output-type [n]', 'Output type', handelInputValues('OUTPUT_TYPE', watchConfig.outputType, defaultOutputType)) | |||
.option('-e,--access-token [n]', 'etherscan access token', handelInputValues('ACCESS_TOKEN', watchConfig.accessToken, defaultAccessToken)) | |||
.option('-c,--colors [n]', 'use color 1 for ansi, 2 for chalk, any other for none', handelInputValues('COLORS', watchConfig.colors, defaultColors)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make it three values 1,2,empty any other value should raise an exception
@@ -12,6 +12,6 @@ export default (data, type = 'terminal') => { | |||
data.decodedInputDataResult, data.decodedLogs))); | |||
break; | |||
default: | |||
throw new Error(`${type} output module is undefind`); | |||
throw new Error(`${type} output module is undefined`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
src/output/terminalFormat.js
Outdated
green: styleFactory('green'), | ||
red: styleFactory('red'), | ||
yellow: styleFactory('yellow'), | ||
// blue: styleFactory('blue'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
src/output/terminalFormat.js
Outdated
@@ -1,22 +1,87 @@ | |||
import { getCommandVars } from '../command.js'; | |||
|
|||
// Dep modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use import instead of require
src/output/terminalFormat.js
Outdated
export default (data) => { | ||
const txHash = data.transaction.hash; | ||
function styleFactory(color) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to arrow function
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 74.24% 74.31% +0.07%
==========================================
Files 11 11
Lines 365 366 +1
==========================================
+ Hits 271 272 +1
Misses 94 94
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
- Coverage 74.93% 74.31% -0.62%
==========================================
Files 11 11
Lines 395 366 -29
==========================================
- Hits 296 272 -24
+ Misses 99 94 -5
Continue to review full report at Codecov.
|
# Conflicts: # README.md # src/command.js # src/output/terminalFormat.js
feedback implemented and PR up to date with master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure Travis builds your PR successfully before submitting for review.
add colored terminal and symbols :)