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.21k stars 867 forks source link

Add support for .nvmrc and .node-version files #1047

Open atl-mk opened 1 year ago

atl-mk commented 1 year ago

Do you want to request a feature or report a bug? Feature

What is the current behavior? Node version has to be manually specified as a property

What is the expected behavior? frontend-maven-plugin can use the .nvmrc or .node-version file if present for the node version. I don't care if the configuration of the plugin has to specifically opt-in or if a fallback strategy is used.

I deal with dozens of repos, and it's a bit of a pain to setup different automations to bump both versions. I also have teach both frontenders and backenders that there's a separate place to update the other. I try to do it with comments, but one of the more popular node managers refuses to add support for comments in the node lockfile.

I don't mind implementing this myself and raising a PR, but first I'd like to gauge the maintainers' opinion.

eirslett commented 1 year ago

I'm reluctant to add it -there's already a lot of feature bloat in this plugin, there are bugs galore and I'd rather not introduce any new functionality. There were also other suggestions like synchronizing pom.xml config with npmrc (not nvmrc) and so on.

If I had any time, I would rewrite frontend-maven-plugin to version 2.0, and it would be fully based on nvm (and maybe nodist on Windows).

dalbani commented 1 year ago

I understand your standpoint as a maintainer, @eirslett. But as a user of the plugin, the ability to retrieve the version from .nvmrc would be very useful to us.

srl295 commented 1 year ago

in the linked PR https://github.com/unicode-org/cldr/pull/2823/files#diff-fc2c8e56a8e38d8c5c3ef2cf291e0541a63ab57c99528a12d28f6747a5d0072aR155-R192 (link to specific code) I worked around this using the ant plugin and some duct tape. Seems to work…

then i can use <nodeVersion>${node.version}</nodeVersion> in the plugin config to use the version coming from .node-version