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

Request: Update Browserslist #8615

Closed
service-paradis opened this issue Feb 9, 2021 · 6 comments
Closed

Request: Update Browserslist #8615

service-paradis opened this issue Feb 9, 2021 · 6 comments
Labels
auto:reproduction A minimal reproduction is necessary to proceed status:requirements Full requirements are not yet known, so implementation should not be started type:docs Documentation

Comments

@service-paradis
Copy link
Contributor

What would you like Renovate to be able to do?

As stated in Browserslist documentation, we can run npx browserslist@latest --update-db from time to time to update browsers list.

It would be great if renovatebot was able to detect that browserslist is in use (maybe by checking if there is a .browserslistrc file) and run this command while renovating.

Did you already have any implementation ideas?

  • Detect if Browserslist is used
  • Run the update command
  • Create a PR with the updated list
@rarkins
Copy link
Collaborator

rarkins commented Feb 10, 2021

Please provide a minimal reproduction repo with an outdated browser list so we can look at the structure.

@rarkins rarkins added auto:reproduction A minimal reproduction is necessary to proceed type:docs Documentation status:requirements Full requirements are not yet known, so implementation should not be started labels Feb 10, 2021
@service-paradis
Copy link
Contributor Author

@rarkins Sure, thank you for the follow up!

Youi can use this minimal repo.
As you can see, there is a single dependency (autoprefixer). It does not need any update (10.2.4 is the latest version to this date). We got no results by running npm outdated.

If we take a look min package-lock.json, we can see the a peer dependency caniuse-lite using version 1.0.30001181. The latest version is 1.0.30001185.

"caniuse-lite": {
      "version": "1.0.30001181",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001181.tgz",
      "integrity": "sha512-Fpi4kVNtNvJ15H0F6vwmXtb3tukv3Zg3qhKkOGUq7KJ1J6b9kf4dnNgtEAFXhRsJo0gNj9W60+wBvn0JcTvdTg=="
    }

We can obtain the latest version by running npx browserslist@latest --update-db. It will gives the following results:
image

If we take another look at package-lock.json, we will see the updated dependency:

"caniuse-lite": {
      "version": "1.0.30001185",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001185.tgz",
      "integrity": "sha512-Fpi4kVNtNvJ15H0F6vwmXtb3tukv3Zg3qhKkOGUq7KJ1J6b9kf4dnNgtEAFXhRsJo0gNj9W60+wBvn0JcTvdTg=="
    },

In this minimal repo, there was no target browsers changes (No target browser changes). It sometimes change and gives a result similar to the following:
image

Hope it helps!

@viceice
Copy link
Member

viceice commented Feb 10, 2021

Lockfile maintenance will do this for you. No need for a new feature.

https://docs.renovatebot.com/configuration-options/#lockfilemaintenance

@service-paradis
Copy link
Contributor Author

service-paradis commented Feb 10, 2021

🤦‍♂️ How did I miss that! Will try it soon!
Thank you for your support!

I have a question about it though. Is there a way to specify which packages exactly we want to be updated?
In my case, I want to specifically update caniuse-lite dependency, but not necessarily every dependency found in my local file.

@HonkingGoose
Copy link
Collaborator

Hi @service-paradis,

Renovate can only update all dependencies within the lockfile, you cannot pick-and-choose what you like Renovate to update within the lockfile.
By default if you enable lockfileMaintenance, you'll get a lockfile update PR "once a week on monday", but you can increase/decrease the frequency of lockfile updates via the schedule configuration option.

See https://docs.renovatebot.com/configuration-options/#schedule for more on scheduling.

@service-paradis
Copy link
Contributor Author

Ok, thank you for your answer.
Looks like it does not solve what I'm trying to achieve. I think it would be great to be able to manage this use case using Renovate (updating caniuse db), but I understand it might not be something you want to add.
I will continue managing it using a workaround. Thank you all for your time!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto:reproduction A minimal reproduction is necessary to proceed status:requirements Full requirements are not yet known, so implementation should not be started type:docs Documentation
Projects
None yet
Development

No branches or pull requests

4 participants