eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 867 forks source link

Check for yarn berry (.yarnrc.yml) in configured working directory #1097

Open blutorange opened 1 year ago

blutorange commented 1 year ago

See #928 and #1012, which added the feature that yarn 1.x is not reinstalled when yarn 2.x+ is used. The changes in #1012 only checks for the .yarnrc.yml in the root directory of the Maven project (https://github.com/eirslett/frontend-maven-plugin/blob/master/frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/InstallNodeAndYarnMojo.java#L79-L81). We have the yarn project with multiple workspace in src/main/web, which is not checked by this plugin, so it reinstalls yarn every time.

The plugin does have a workingDirectory property, which points to the root folder of the yarn project (at least in our case). Could we also check for a .yarnrc.yml in that folder?