browserslist / update-db

CLI tool to update caniuse-lite to refresh target browsers from Browserslist config
https://browsersl.ist/
MIT License
286 stars 57 forks source link

Prevent scripts from running pre or post install #2

Closed rogierslag closed 1 year ago

rogierslag commented 1 year ago

To aid developers we have a variety of preinstall scripts present. These do not work similarly on CI (which is where we run this script). Would it be an option to disable running the scripts on yarn add altogether?

ai commented 1 year ago

We are using yarn add to install caniuse-lite, which already has no scripts.

What exact problem will be solved by these changes?

rogierslag commented 1 year ago

yarn add still executes a preinstall script present (in the install phase) in the package.json of our own project (not the package.json of update-db). That script cannot reliably run in the CI environment where we automatically update our caniuse-lite databases.

ai commented 1 year ago

preinstall script of project’s package.json is used to update something on node_modules changes.

Why should we avoid it if user asked to run the script?

For instance, I have a project, where we update list of browsers and we need to call it on caniuse-lite changes https://github.com/browserslist/browserl.ist/blob/v2/client/package.json#L10