devoto13 / yarn-plugin-engines

Yarn Berry plugin to enforce Node version
MIT License
55 stars 13 forks source link

Allow ignoring check #9

Closed 7rulnik closed 1 year ago

7rulnik commented 2 years ago

Engines are very useful in big companies with a lot of developers. We can make engines pretty strict, for example, allow only one exact version

{
  "engines": {
    "node": "16.10.0"
  }
}

But sometimes we can't control the environment. For example within renovate which uses 14.19.1 right now. It would be nice if we can ignore engine checks sometimes. For example with the environment variable.

devoto13 commented 2 years ago

This sounds like a good idea!

I can look into it in the coming weeks. Or feel free to send a PR.

7rulnik commented 2 years ago

Mention me if you will start working on it. I need to finish some other PRs :D

devoto13 commented 2 years ago

Looks like Yarn considers any environment variables prefixed with YARN_ as its configuration options and fails installation with:

Unrecognized or legacy configuration settings found: pluginEnginesDisable - run "yarn config -v" to see the list of settings supported in Yarn.

Need to come up with a good name not starting with YARN_ I guess 😄

teriu commented 1 year ago

@devoto13 Did you need a hand with this? I wonder if we can use PLUGIN_YARN_ENGINES_DISABLE instead to prevent that name collision with YARN_.

devoto13 commented 1 year ago

Was just not happy with all variants except the original one, so was thinking to wait until maybe Yarn removes the check on their side (it was only for migration from v1 AFAIU). But I guess it does not really matter that much. So will merge your PR, thanks!