-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
refactor(v2): improve notifier message #4257
Conversation
const notifier = updateNotifier({ | ||
pkg, | ||
updateCheckInterval: 1000 * 60 * 60 * 24, // one day |
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.
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/ |
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.
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}`, |
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.
Was wondering, is there an npm equivalent we could use here?
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.
Done, take a look please.
LGTM 👍 |
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.json
file.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.)