sindresorhus / emoj

Find relevant emoji from text on the command-line :open_mouth: :sparkles: :raised_hands: :horse: :boom: :see_no_evil:
MIT License
2.37k stars 58 forks source link

Inkify #20

Closed vadimdemedes closed 7 years ago

vadimdemedes commented 7 years ago

Let's spill some ink on emoj!

Added features and fixed bugs:

vadimdemedes commented 7 years ago

Is there a better workaround for using return in cli.js, aside extracting code into a separate file?

sindresorhus commented 7 years ago

Is there a better workaround for using return in cli.js, aside extracting code into a separate file?

No... You can't return top-level. We only could that in CommonJS Node.js because it was wrapped in an IIFE.

sindresorhus commented 7 years ago

I'm getting an error when running it locally:

/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:10
const isClassComponent = component => component.prototype instanceof Component;
                                               ^

TypeError: Cannot read property 'prototype' of undefined
    at isClassComponent (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:10:48)
    at new Instance (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:40:27)
    at getOrCreateInstance (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:20:14)
    at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:84:27)
    at Array.forEach (native)
    at Instance.mount (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:82:17)
    at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:87:19)
    at Array.forEach (native)
    at Instance.mount (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:82:17)
    at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:87:19)
vadimdemedes commented 7 years ago

I'm getting an error when running it locally:

Do you see this immediately after execution or after some actions?

vadimdemedes commented 7 years ago

Oh no, I forgot to push latest changes. You should be able to run it now ;)

sindresorhus commented 7 years ago

Instead of using the underline style to indicate the selected emoji, I think it would look better to use ^ (with the color green or cyan?) and place it on the next line.

screen shot 2017-07-02 at 15 39 53
vadimdemedes commented 7 years ago

Agree, ^ is more visible than underline. I guess cyan should look best, but I'll try the other ones too ;)

vadimdemedes commented 7 years ago

How about using instead of ^? It looks more aligned to the start of the emoji.

screen shot 2017-07-02 at 7 36 53 pm

vs

screen shot 2017-07-02 at 7 37 06 pm
sindresorhus commented 7 years ago

How about using instead of ^?

👍

vadimdemedes commented 7 years ago

Cool, in that case it's ready ;)

sindresorhus commented 7 years ago

The arrow doesn't move correctly. This is the maximum it goes:

😄  🎉  😁  😃  😊  ☺  👍🏽
      ↑

Could you also make it circular, so when it goes beyond either side it starts on the different side?

vadimdemedes commented 7 years ago

Run npm update and it should be fine. I should publish ink as a scoped package to prevent these kinds of errors.

Re circular, sure!

vadimdemedes commented 7 years ago

Released Ink on npm and updated PR to use it. Should be fine now.

sindresorhus commented 7 years ago

This is amazing and the JSX thing makes it so much more readable.

leo-clapping

sindresorhus commented 7 years ago

@vadimdemedes I opened an issue https://github.com/sindresorhus/emoj/issues/21 for:

Re circular, sure!

sindresorhus commented 7 years ago

I just noticed one small issue. When you write a search query, then use backspace until the search query is gone, the last search result is still there, but you can't move the arrow selector. It should clear the search result in that case.

screen shot 2017-07-06 at 13 20 31
vadimdemedes commented 7 years ago

Thanks, will fix!