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

feat(v2): notify users when docusaurus version is outdated #3032

Merged
merged 4 commits into from
Jul 13, 2020

Conversation

teikjun
Copy link
Contributor

@teikjun teikjun commented Jul 8, 2020

Motivation

Notify the user when their @docusaurus/core version is outdated.
The interval between notifications is set to one day so that it is not too naggy.
This PR closes #2199.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan (edited)

  1. Run yarn install in the root directory
  2. Open package.json file in /packages/docusaurus, change line 4 to "version": "2.0.0-alpha.56",
  3. Go to the /website directory in your terminal, run yarn start. You should see a notification like the one below!

  1. Run yarn start again, there should be no notification this time because the interval is set to one day

Additional Remarks

The notify method of update-notifier does not work directly with our docusaurus command, so the implementation needed to be modified.

@teikjun teikjun requested a review from yangshun as a code owner July 8, 2020 12:42
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 8, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jul 8, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 4dc8560

https://deploy-preview-3032--docusaurus-2.netlify.app

@slorber slorber added pr: new feature This PR adds a new API or behavior. pr: polish This PR adds a very minor behavior improvement that users will enjoy. and removed pr: polish This PR adds a very minor behavior improvement that users will enjoy. labels Jul 8, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 8, 2020

Hey @teikjun

how do you test this exactly?

"@docusaurus/core": "2.0.0-alpha.57" 

does not exist (bad release)

and

"@docusaurus/core": "2.0.0-alpha.56" 

I get:

image

@teikjun
Copy link
Contributor Author

teikjun commented Jul 8, 2020

Hi @slorber
Sorry, my previous testing instruction was completely incorrect (I got mixed up), please ignore it.
I ran through the testing process from the start and I've updated the first post with exact instructions for testing.

@slorber
Copy link
Collaborator

slorber commented Jul 9, 2020

Thanks @teikjun

It seems to almost work, but not on the 1st run of the update notifier for this package.

You can clear its cache on macos with the following command:

rm -rf ~/.config/configstore/update-notifier-@docusaurus

image

Can you ensure it works fine on the first run too?

@teikjun
Copy link
Contributor Author

teikjun commented Jul 10, 2020

It works on the first run now! The testing instructions are similar to before :)

@slorber slorber merged commit f947036 into facebook:master Jul 13, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 13, 2020

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CLI]: 🔔Notify users if they're using an older version
4 participants