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

add colorized output and symbols in terminal #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cedricwalter
Copy link

add colored terminal and symbols :)

2017-12-12 15_57_37-smart-contract-watch-cedric c__users_cedric_ideaprojects_smart-contract-watch-c

Copy link
Member

@Moejoe90 Moejoe90 left a 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
Copy link
Member

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))
Copy link
Member

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`);
Copy link
Member

Choose a reason for hiding this comment

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

nice catch

green: styleFactory('green'),
red: styleFactory('red'),
yellow: styleFactory('yellow'),
// blue: styleFactory('blue'),
Copy link
Member

Choose a reason for hiding this comment

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

remove comment

@@ -1,22 +1,87 @@
import { getCommandVars } from '../command.js';

// Dep modules
Copy link
Member

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

export default (data) => {
const txHash = data.transaction.hash;
function styleFactory(color) {
Copy link
Member

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
Copy link

codecov bot commented Jan 25, 2018

Codecov Report

Merging #56 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/command.js 96.15% <100%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 565946e...d2388be. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 25, 2018

Codecov Report

Merging #56 into master will decrease coverage by 0.61%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/command.js 96.15% <100%> (-0.34%) ⬇️
src/jsonrpc.js 63.2% <0%> (-1.66%) ⬇️
src/decoder.js 64.76% <0%> (-1.61%) ⬇️
src/utils.js 100% <0%> (+19.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 777df97...8355eee. Read the comment docs.

# Conflicts:
#	README.md
#	src/command.js
#	src/output/terminalFormat.js
@cedricwalter
Copy link
Author

feedback implemented and PR up to date with master

Copy link
Member

@Moejoe90 Moejoe90 left a 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.

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.

2 participants