-
Notifications
You must be signed in to change notification settings - Fork 38
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
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.
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 |
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.
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.
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.
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(); |
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.
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 (sindresorhus/update-notifier#67 (comment)).
Closes #77