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

Replace popsicle with isomorphic-fetch #4

Merged
merged 9 commits into from
Jun 11, 2017
Merged

Conversation

radiovisual
Copy link
Member

@radiovisual radiovisual commented Jun 11, 2017

This PR keeps the application running as expected, but also fixes the problem where running the tests is failing (possibly) due to nock + popsicle.

It also increases code coverage from 83% to 92% 100%. 🎉

@coveralls
Copy link

coveralls commented Jun 11, 2017

Coverage Status

Changes Unknown when pulling f7f8082 on radiovisual:fetch into ** on brh55:master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3b3f567 on radiovisual:fetch into ** on brh55:master**.

1 similar comment
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3b3f567 on radiovisual:fetch into ** on brh55:master**.

@coveralls
Copy link

coveralls commented Jun 11, 2017

Coverage Status

Changes Unknown when pulling a649039 on radiovisual:fetch into ** on brh55:master**.

Copy link
Member

@brh55 brh55 left a comment

Choose a reason for hiding this comment

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

Nice fetch is a great choice. Take a look at my comments and tell me what you think. 👏

cli.js Outdated
@@ -26,7 +26,7 @@ const cli = meow(`
USD: 261.91
`);

const input = cli.input.map(item => item.replace(/,|\s+/g, '')).join(',');
const input = cli.input.map(item => item.replace(/,\s+/g, '')).join(',');
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the same is logic is happening in the API(LOC 7), you should be able to just turn the array to a string and pass it to the API to format.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, you are right. No need to do this in more than one place.

package.json Outdated
@@ -27,9 +27,9 @@
"cryptocurrency"
],
"dependencies": {
"isomorphic-fetch": "^2.2.1",
Copy link
Member

Choose a reason for hiding this comment

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

Looks like it needs a tab or space

@coveralls
Copy link

coveralls commented Jun 11, 2017

Coverage Status

Changes Unknown when pulling ff8060f on radiovisual:fetch into ** on brh55:master**.

@coveralls
Copy link

coveralls commented Jun 11, 2017

Coverage Status

Changes Unknown when pulling 3988026 on radiovisual:fetch into ** on brh55:master**.

@radiovisual
Copy link
Member Author

radiovisual commented Jun 11, 2017

I think I made all the changes you requested. GitHub is saying that there are still changes pending, but I think I covered everything. Let me know if I missed something.

Copy link
Member

@brh55 brh55 left a comment

Choose a reason for hiding this comment

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

Looks good!

@brh55 brh55 merged commit 9de10b1 into crypti:master Jun 11, 2017
@brh55
Copy link
Member

brh55 commented Jun 11, 2017

I'm thinking we could strip out the API to a core module such as (crypto-price) and make several different CLI for different cryptos. Since I would like to do one for Lisk as well.

@radiovisual
Copy link
Member Author

I'm thinking we could strip out the API to a core module such as (crypto-price) and make several different CLI for different cryptos. Since I would like to do one for Lisk as well.

I like this idea. I would like to be able to compare different crypto-currencies from the command line, but also have the freedom to write applications in node to consume this data as well. I am happy to help if you want me to extract the API.

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

I'm thinking we could make an org? Something crypto related, and perhaps move this over to it? Thoughts?

@radiovisual
Copy link
Member Author

I'm thinking we could make an org? Something crypto related, and perhaps move this over to it?

I would love that, and I would be happy to help building crypto-related modules. Please start the org and send me an invite!

@radiovisual radiovisual deleted the fetch branch June 12, 2017 07:22
@brh55
Copy link
Member

brh55 commented Jun 12, 2017

@radiovisual Have any good names to call the org? lol

@radiovisual
Copy link
Member Author

@brh55

If not already taken:

  • crypto
  • crypt

Only if its cryptocoin-centric:

  • cryptocoin (only if its cryptocoin-centric)
  • cryptoin
  • ccoin

I also like:

  • cryto (read "cry-dough")
  • krypto
  • kriptoin

Maybe I will think of something better later on...

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Available Options:

  • crypto-devs
  • crydo
  • cryptdoe
  • dcryptos
  • crypto-code
  • krycode
  • crypto-tools
  • cctools

@radiovisual
Copy link
Member Author

Dang, all the good names are taken. Looks like we will need to get creative. haha.

I like crypto-code, but cryptocode is already taken, and I think that could lead to some namespace confusion.

@radiovisual
Copy link
Member Author

Maybe we can find some cool keywords from the decentralized and cryptographic keyword space and find something unique that hasn't been taken yet, but still feels relevant.

@radiovisual
Copy link
Member Author

radiovisual commented Jun 12, 2017

These are all available:

  • crypt-chart
  • crypt-space
  • crypti
  • cryp-tip
  • cryptools
  • crypline
  • cryp-line
  • crypterm
  • cryp-term
  • cryminal 🔫

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Yeah, we might need a interesting name completely different from "crypto". Also crypto-craft is an option

@radiovisual
Copy link
Member Author

crypto-craft is cool.

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Haha I just like the shortness of crypti 💃

@radiovisual
Copy link
Member Author

radiovisual commented Jun 12, 2017

I really like crypti as well. 👍 😄 🌮

Makes us feel relevant and serious, but super hipster and cool at the same time. 🤣

@radiovisual
Copy link
Member Author

I like crypto-craft and crypti so far the best.

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Invited you for crypti 🍡 👍 , transferring this repo over now

@radiovisual
Copy link
Member Author

Alright! Now we can get to work. 🕺 🚀

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Made you owner as well, feel free to re-word the org description and add a logo. 🎢

@radiovisual
Copy link
Member Author

Made you owner as well, feel free to re-word the org description and add a logo

Ok, awesome. Thanks!

@radiovisual
Copy link
Member Author

So do you want a separate command line tool for each crypto currency, or one tool that can manage them all?

It would be cool if we had a tool that could compare cryptocurrencies like we pair currencies in Forex:

$ ccoin eth/usd, btc/usd
Converting...
   ETH/USD: 000.00
   BTC/USD: 0000.00

Or something like: $ ccoin <from> <to>

$ ccoin eth,btc usd,jpy
Converting...
   ETH/USD: 000.00
   ETH/JPY: 000.00
   BTC/USD: 0000.00
   BTC/JPY: 0000.00

Or even cooler, if you don't remember all the coin codes, you can have an interface that helps you decide:

$ ccoin
Which cryptocurrencies do you want?
  [x] Ethereum
  [ ] BitCoin

What currencies do you want to convert to?
 [x] American Dollar (USD)
 [ ] Japanese Yen (JPY)

ETH/USD: 000.00

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

Whew the last option is awesome. I'm thinking we have one core CLI / module that does both $ ccoin <from> <to>, and when it's blank it prompts the user.

But we should also have a defaults, so when you run ccoin and it will always show your stored preferences.

$ ccoin
Which cryptocurrencies do you want?
  [x] Ethereum
  [ ] BitCoin

What currencies do you want to convert to?
 [x] American Dollar (USD)
 [ ] Japanese Yen (JPY)

Would you like to set default conversions? y/n

ETH/USD: 000.00

as well as: $ ccoin btc usd,eth,ltc --save || $ ccoin btc usd,eth,ltc --set-default

@brh55
Copy link
Member

brh55 commented Jun 12, 2017

The only downside is cryptocompare supports 100 different currencies (https://www.cryptocompare.com/api/data/coinlist/), so I can imagine that list being extremely long lol.

@radiovisual
Copy link
Member Author

radiovisual commented Jun 12, 2017

Ok cool. I like that the ability to save preferences or profiles.

So I could possibly do something like (assuming I had a profile saved called yen-stuff) :

$ ccoin -p yen-stuff

where -p is the flag to load a saved profile?

Or if I wanted to create a profile called yen-stuff:

$ ccoin btc,jpy, usd,jpy --save-as=yen-stuff

and then finally, the prompt could also ask if you want to save your settings as a profile:

Which cryptocurrencies do you want?
  [x] Ethereum
  [ ] BitCoin

What currencies do you want to convert to?
 [ ] American Dollar (USD)
 [x] Japanese Yen (JPY)

Do you want to save these settings? (Y/n) Y
What would you like to name this profile? yen-stuff
Ok, now you can run this profile with `$ ccoin -p yen-stuff`

Something like that?

@radiovisual
Copy link
Member Author

The only downside is cryptocompare supports 100 different currencies hahaha

Yeah, baby-steps! 🍼 haha.

@radiovisual
Copy link
Member Author

@brh55 has work begun on crypti/ccoin? I see the repo has been made, but nothing has been committed?

@brh55
Copy link
Member

brh55 commented Jun 14, 2017

@radiovisual Ah yes, I was going to commit the base repo from the generator but got side-tracked.

@radiovisual
Copy link
Member Author

Ok, cool. I will monitor the progress and pitch in where needed. Are you going to make a separate module for the API calls to cryptocompare, or just hard-wire it into ccoin?

@brh55
Copy link
Member

brh55 commented Jun 14, 2017

I was thinking of making ccoin the core, but I could perhaps leverage this module?

@radiovisual
Copy link
Member Author

yeah, I like that plan. I would use that module you pointed to since it already has the API we need. 😎

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.

None yet

3 participants