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

refactor(v2): improve notifier message #4257

Merged
merged 2 commits into from
Feb 23, 2021
Merged

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Feb 20, 2021

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:

image

With several packages:

image

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.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Feb 20, 2021
@lex111 lex111 requested a review from slorber as a code owner February 20, 2021 10:33
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 20, 2021
const notifier = updateNotifier({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24, // one day
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@netlify
Copy link

netlify bot commented Feb 20, 2021

[V1] Deploy preview success

Built with commit ccd0694

https://deploy-preview-4257--docusaurus-1.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 20, 2021

Size Change: 0 B

Total Size: 543 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 86.6 kB 0 B
website/build/assets/js/main.********.js 370 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 60.5 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 25.6 kB 0 B

compressed-size-action

@netlify
Copy link

netlify bot commented Feb 20, 2021

Deploy preview for docusaurus-2 ready!

Built with commit ccd0694

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

@github-actions
Copy link

github-actions bot commented Feb 20, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 68
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4257--docusaurus-2.netlify.app/classic/

Copy link
Collaborator

@slorber slorber left a 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}`,
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@slorber
Copy link
Collaborator

slorber commented Feb 23, 2021

LGTM 👍

@slorber slorber merged commit 6ab5084 into master Feb 23, 2021
@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 1, 2021
@slorber slorber deleted the lex111/improve-notifier-message branch August 17, 2021 18:01
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: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants