Skip to content

refactor(v2): improve notifier message - #4257

Merged
slorber merged 2 commits into
masterfrom
lex111/improve-notifier-message
Feb 23, 2021
Merged

refactor(v2): improve notifier message#4257
slorber merged 2 commits into
masterfrom
lex111/improve-notifier-message

Conversation

@lex111

@lex111 lex111 commented Feb 20, 2021

Copy link
Copy Markdown
Contributor

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
// notify user if @docusaurus packages is outdated
const notifier = updateNotifier({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24, // one day

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@netlify

netlify Bot commented Feb 20, 2021

Copy link
Copy Markdown

[V1] Deploy preview success

Built with commit ccd0694

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

@github-actions

github-actions Bot commented Feb 20, 2021

Copy link
Copy Markdown

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

netlify Bot commented Feb 20, 2021

Copy link
Copy Markdown

Deploy preview for docusaurus-2 ready!

Built with commit ccd0694

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

@github-actions

github-actions Bot commented Feb 20, 2021

Copy link
Copy Markdown

⚡️ 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/

@slorber slorber left a comment

Copy link
Copy Markdown
Collaborator

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

Comment thread packages/docusaurus/bin/docusaurus.js Outdated
)}${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
Copy Markdown
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
Copy Markdown
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

slorber commented Feb 23, 2021

Copy link
Copy Markdown
Collaborator

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
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* refactor(v2): improve notifier message

* Add support for npm
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