refactor(v2): improve notifier message#4257
Merged
Conversation
lex111
commented
Feb 20, 2021
| // notify user if @docusaurus packages is outdated | ||
| const notifier = updateNotifier({ | ||
| pkg, | ||
| updateCheckInterval: 1000 * 60 * 60 * 24, // one day |
Contributor
Author
There was a problem hiding this comment.
Not needed, since it is default value https://github.com/yeoman/update-notifier#updatecheckinterval
|
[V1] Deploy preview success Built with commit ccd0694 |
|
Size Change: 0 B Total Size: 543 kB ℹ️ View Unchanged
|
|
Deploy preview for docusaurus-2 ready! Built with commit ccd0694 |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4257--docusaurus-2.netlify.app/classic/ |
slorber
approved these changes
Feb 22, 2021
Collaborator
slorber
left a comment
There was a problem hiding this comment.
LGTM thanks
If there's a npm equivalent command that could be nice to add it
| )}${chalk.green( | ||
| `${notifier.update.latest}`, | ||
| )}\n\nTo upgrade Docusaurus packages with the latest version, run the following command:\n${chalk.cyan( | ||
| `yarn upgrade ${siteDocusaurusPackagesForUpdate}`, |
Collaborator
There was a problem hiding this comment.
Was wondering, is there an npm equivalent we could use here?
Contributor
Author
There was a problem hiding this comment.
Done, take a look please.
Collaborator
|
LGTM 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
According to this article, if the project has previously uses a package with caret version, then updating without specifying the version range will not update the
package.jsonfile.Therefore, we need to explicitly specify the version in notifier message in order to update the core package correctly.
And since usually not only the core package is used, in the message I also included other packages from @Docusaurus scope so that they are also upgraded.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
With two basic packages:
With several packages:
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)