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

Add update-browserslist-db mention on --update-db call and deprecation hint. #791

Merged
merged 2 commits into from Sep 21, 2023

Conversation

konclave
Copy link
Contributor

The --update-db key is missing in the usage hint printed to the terminal when CLI is called with the --help key.

The --update-db key is missing in the usage hint printed to the terminal when CLI is called with the --help key.
@ai
Copy link
Member

ai commented Sep 21, 2023

We don’t have --update-db here anymore. It is now just an alias for external tool npx update-browserslist-db.

This is why we removed it from docs.

Do you know how we can mention it in another way?

@konclave
Copy link
Contributor Author

konclave commented Sep 21, 2023

But update-browserslist-db prints to console warning: npx browserslist@latest --update-db, and I was pretty surprised when I ran npx browserslist@latest --help and didn't see this key.

As I understand, --update-db is kept for the legacy support, right? Then, probably, it is worth replacing the console hint from update-browserslist-db with ... call npx update-browserslist-db ...?

@ai
Copy link
Member

ai commented Sep 21, 2023

prints to console warning: npx browserslist@latest --update-db

I fixed the warning browserslist/update-db@3fff4d6

But are you sure that this warning was not from Browserslist?

@konclave
Copy link
Contributor Author

About 75% sure =). I did the repository search in GitHub and haven't found any string containing npx browserslist@latest --update-db. And the only place with just --update-db is cli.js.

@ai
Copy link
Member

ai commented Sep 21, 2023

Since we fixed warning there. Can we close it or do you have maybe another idea what to add to docs here?

@konclave
Copy link
Contributor Author

Probably, add a hint when browserslist is called with --update-db that tells that --update-db is deprecated and npx update-browserslist-db should be used instead.

That's the last idea I have.

@ai
Copy link
Member

ai commented Sep 21, 2023

Yes, I like it. Can you send PR? :)

@konclave
Copy link
Contributor Author

Sure

And rollback the --update-db print in the help hint.
@konclave konclave changed the title Add --update-db key to the usage hint Add --update-db key deprecation hint, add update-browserslist-db mention on --update-db call Sep 21, 2023
@konclave konclave changed the title Add --update-db key deprecation hint, add update-browserslist-db mention on --update-db call Add update-browserslist-db mention on --update-db call and deprecation hint. Sep 21, 2023
@konclave
Copy link
Contributor Author

done

@@ -38,6 +38,8 @@ if (isArg('--help') || isArg('-h')) {
} else if (isArg('--version') || isArg('-v')) {
process.stdout.write('browserslist ' + pkg.version + '\n')
} else if (isArg('--update-db')) {
process.stdout.write('The --update-db command is deprecated. Please use npx update-browserslist-db@latest instead.\n')
process.stdout.write('Browserslist DB update will still be made.\n')
/* c8 ignore next 3 */
Copy link
Member

Choose a reason for hiding this comment

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

Can you just move this lines above and increase 3 to 5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As you merged it, I won't make any following changes.

@ai ai merged commit def7b9f into browserslist:main Sep 21, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants