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

Notify user when has a new version #107

Closed
wants to merge 1 commit into from
Closed

Notify user when has a new version #107

wants to merge 1 commit into from

Conversation

joao-alberto
Copy link
Contributor

Closes #77

Copy link
Collaborator

@lucasbento lucasbento left a comment

Choose a reason for hiding this comment

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

Hey @psicotropicos, thank you for another PR.

It looks great, just made a few requests, it also seems to have broken the build on CI because of a few ESLint errors, would you mind fixing them?

Thank you!

@@ -40,3 +43,7 @@ export const verifyYeoman = async () => { // eslint-disable-line import/prefer-d

return true;
};

export const verifyVersion = async () => { // eslint-disable-line import/prefer-default-export
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no need for the eslint-disable-line comment, it will no longer throw an error on this file since there are two exports, it's better to remove both of the comments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, since it is a one-line function, use a shorthand removing the async/await, brackets & return syntaxes.

@@ -40,3 +43,7 @@ export const verifyYeoman = async () => { // eslint-disable-line import/prefer-d

return true;
};

export const verifyVersion = async () => { // eslint-disable-line import/prefer-default-export
return await updateNotifier({pkg}).notify();
Copy link
Collaborator

@lucasbento lucasbento Sep 27, 2017

Choose a reason for hiding this comment

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

That way the notification will only work for the create-graphql package, this repo contains a Lerna project with both create-graphql (the CLI) and generator-graphql (the Yeoman generator that scaffolds the code), it's better to verify both of them since they can all be updated individually.

I also happened to run into an issue by trying to use update-notifier asynchronously, so I think it's better to use the callback function and a small check: https://github.com/lucasbento/reminders-cli/blob/master/src/utils/updateNotifier.js#L10-L13 (yeoman/update-notifier#67 (comment)).

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.

Show a notification when there's a new version of the packages
2 participants