Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c8c808b
feat: Install Node.js in version-specific directories with fallback s…
Artur- Nov 22, 2025
5b4f17c
feat: Cache resolved node installation across FrontendTools instances
Artur- Nov 23, 2025
a5a0e52
fix: Use platform-specific path for npm-cli.js in NodeInstaller
Artur- Nov 23, 2025
f8f15ab
Make it serializable
Artur- Nov 23, 2025
fac44ff
refactor: Remove node.auto.update setting
Artur- Nov 23, 2025
d975ea2
Merge remote-tracking branch 'origin/main' into HEAD
Artur- Nov 24, 2025
f96f1ee
fix: Install node when npm/npx not found in getNpmCliToolExecutable
Artur- Nov 24, 2025
b66aa93
Merge branch 'main' into version-installed-node
Artur- Nov 24, 2025
176a98b
Merge branch 'main' into version-installed-node
Artur- Nov 24, 2025
81dc963
Merge branch 'main' into version-installed-node
Artur- Nov 24, 2025
d9def5a
refactor: Remove project folder node/npm support from FrontendTools
Artur- Nov 24, 2025
0281a2b
refactor: Extract node resolution to NodeResolver class
Artur- Nov 24, 2025
9f296b7
fix: Add existence check for npx-cli.js path
Artur- Nov 24, 2025
ecb64d5
Merge branch 'main' into version-installed-node
Artur- Nov 25, 2025
93c0424
format
Artur- Nov 25, 2025
1ed04f7
fix: Normalize node version comparison in NodeInstaller
Artur- Nov 25, 2025
82159ae
format
Artur- Nov 25, 2025
668c038
Make tests pass and remove non-needed public API
Artur- Nov 26, 2025
8e008df
Merge branch 'main' into version-installed-node
Artur- Nov 26, 2025
3cd5ff5
format
Artur- Nov 26, 2025
15c9dfe
Remove random file
Artur- Nov 26, 2025
5516aeb
Remove extra files
Artur- Nov 26, 2025
b9ed5b7
refactor: Separate resolution logic from installation in NodeInstaller
Artur- Nov 26, 2025
ca96517
refactor: Remove redundant forceAlternativeNodeExecutable() method
Artur- Nov 26, 2025
08b0923
style: Use static import instead of fully qualified name
Artur- Nov 26, 2025
64bbfc5
refactor: Remove unnecessary local variable in ensureNodeResolved
Artur- Nov 26, 2025
db9cf94
test: Remove obsolete tests and fix ignored tests in FrontendToolsTest
Artur- Nov 27, 2025
3e54d1d
format
Artur- Nov 27, 2025
0d3c61e
fix: Use global Node.js when found and improve error messages
Artur- Nov 27, 2025
57dd30e
feat: Add manual testing main method to FrontendToolsTest
Artur- Nov 27, 2025
544a9d7
format
Artur- Nov 27, 2025
1302b1b
docs: Clarify manual test output for Node.js version resolution
Artur- Nov 27, 2025
37ec5f9
feat: Add maximum Node.js major version constraint
Artur- Nov 27, 2025
f3787db
format
Artur- Nov 27, 2025
659f569
chore: Update default pnpm version to 10.24.0
Artur- Nov 27, 2025
b2ccf8b
feat: Add stricter version requirement for auto-installed Node.js
Artur- Nov 28, 2025
1e77dcf
Revert "chore: Update default pnpm version to 10.24.0"
Artur- Nov 28, 2025
4f39a86
refactor: Remove outdated INSTALL_NODE_LOCALLY constant and simplify …
Artur- Nov 28, 2025
0f9c990
Add import
Artur- Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ public class BuildDevBundleMojo extends AbstractMojo
@Parameter(property = InitParameters.NODE_VERSION, defaultValue = FrontendTools.DEFAULT_NODE_VERSION)
private String nodeVersion;

/**
* Setting defining if the automatically installed node version may be
* updated to the default Vaadin node version.
*/
@Parameter(property = InitParameters.NODE_AUTO_UPDATE, defaultValue = ""
+ Constants.DEFAULT_NODE_AUTO_UPDATE)
private boolean nodeAutoUpdate;

@Parameter(defaultValue = "${project}", readonly = true, required = true)
MavenProject project;

Expand Down Expand Up @@ -412,11 +404,6 @@ public URI nodeDownloadRoot() throws URISyntaxException {
}
}

@Override
public boolean nodeAutoUpdate() {
return nodeAutoUpdate;
}

@Override
public String nodeVersion() {
return nodeVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GradleVersionSupportTest(private val versionUnderTest: GradleVersion) : Ab
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
}
vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MiscMultiModuleTest : AbstractGradleTest() {
}

vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
}
""".trimIndent())
Expand Down Expand Up @@ -104,7 +104,7 @@ class MiscMultiModuleTest : AbstractGradleTest() {
}

vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
}
""".trimIndent())
Expand Down Expand Up @@ -161,7 +161,7 @@ class MiscMultiModuleTest : AbstractGradleTest() {
}

vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
""".trimIndent())

Expand Down Expand Up @@ -212,7 +212,7 @@ class MiscMultiModuleTest : AbstractGradleTest() {
}

vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
applicationIdentifier = 'MY_APP_ID'
}
""".trimIndent())
Expand Down Expand Up @@ -266,7 +266,7 @@ class MiscMultiModuleTest : AbstractGradleTest() {
}

vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
applicationIdentifier = 'MY_APP_ID'
}
""".trimIndent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class MiscSingleModuleTest : AbstractGradleTest() {
}
def jettyVersion = "11.0.12"
vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
dependencies {
implementation("com.vaadin:flow:$flowVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class VaadinSmokeTest : AbstractGradleTest() {
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
}
vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
""")
}
Expand Down Expand Up @@ -285,7 +285,7 @@ class VaadinSmokeTest : AbstractGradleTest() {
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
}
vaadin {
nodeAutoUpdate = true // test the vaadin{} block by changing some innocent property with limited side-effect
eagerServerLoad = false // test the vaadin{} block by changing some innocent property with limited side-effect
}
""")
testProject.newFolder("libs")
Expand Down Expand Up @@ -487,7 +487,7 @@ class VaadinSmokeTest : AbstractGradleTest() {
assertContains(result.output, "Configuration cache entry stored")

val buildFile = testProject.buildFile.readText()
.replace("nodeAutoUpdate = true", "nodeAutoUpdate = false")
.replace("eagerServerLoad = false", "eagerServerLoad = true")
testProject.buildFile.writeText(buildFile)

val result2 = testProject.build("--configuration-cache", "vaadinPrepareFrontend", checkTasksSuccessful = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ internal class GradlePluginAdapter private constructor(
override fun nodeDownloadRoot(): URI =
URI.create(config.nodeDownloadRoot.get())

override fun nodeAutoUpdate(): Boolean = config.nodeAutoUpdate.get()

override fun nodeVersion(): String = config.nodeVersion.get()

override fun npmFolder(): File = config.npmFolder.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ internal class PrepareFrontendInputProperties(
@Input
fun getNodeDownloadRoot(): Provider<String> = config.nodeDownloadRoot

@Input
fun getNodeAutoUpdate(): Provider<Boolean> = config.nodeAutoUpdate

@Input
fun getProjectBuildDir(): Provider<String> = config.projectBuildDir

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ public abstract class VaadinFlowPluginExtension @Inject constructor(private val
*/
public abstract val nodeDownloadRoot: Property<String>

/**
* Allow automatic update of node installed to alternate location. Default `false`
*/
public abstract val nodeAutoUpdate: Property<Boolean>

/**
* Defines the output directory for generated non-served resources, such as
* the token file. Defaults to `build/vaadin-generated` folder.
Expand Down Expand Up @@ -502,9 +497,6 @@ public class PluginEffectiveConfiguration(
public val nodeDownloadRoot: Property<String> = extension.nodeDownloadRoot
.convention(Platform.guess().nodeDownloadRoot)

public val nodeAutoUpdate: Property<Boolean> = extension.nodeAutoUpdate
.convention(false)

public val resourceOutputDirectory: Property<File> =
extension.resourceOutputDirectory
.convention(
Expand Down Expand Up @@ -671,7 +663,6 @@ public class PluginEffectiveConfiguration(
"generatedTsFolder=${generatedTsFolder.get()}, " +
"nodeVersion=${nodeVersion.get()}, " +
"nodeDownloadRoot=${nodeDownloadRoot.get()}, " +
"nodeAutoUpdate=${nodeAutoUpdate.get()}, " +
"resourceOutputDirectory=${resourceOutputDirectory.get()}, " +
"projectBuildDir=${projectBuildDir.get()}, " +
"postinstallPackages=${postinstallPackages.get()}, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ public abstract class FlowModeAbstractMojo extends AbstractMojo
@Parameter(property = InitParameters.NODE_VERSION, defaultValue = FrontendTools.DEFAULT_NODE_VERSION)
private String nodeVersion;

/**
* Setting defining if the automatically installed node version may be
* updated to the default Vaadin node version.
*/
@Parameter(property = InitParameters.NODE_AUTO_UPDATE, defaultValue = ""
+ Constants.DEFAULT_NODE_AUTO_UPDATE)
private boolean nodeAutoUpdate;

/**
* The folder where `package.json` file is located. Default is project root
* dir.
Expand Down Expand Up @@ -586,11 +578,6 @@ public URI nodeDownloadRoot() throws URISyntaxException {
}
}

@Override
public boolean nodeAutoUpdate() {
return nodeAutoUpdate;
}

@Override
public String nodeVersion() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ protected void executeInternal()
.withFrontendGeneratedFolder(generatedTsFolder())
.withNodeVersion(nodeVersion())
.withNodeDownloadRoot(nodeDownloadRoot())
.setNodeAutoUpdate(nodeAutoUpdate())
.withHomeNodeExecRequired(requireHomeNodeExec())
.setJavaResourceFolder(javaResourceFolder())
.withProductionMode(productionMode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public static void prepareFrontend(PluginAdapterBase adapter)

FrontendToolsSettings settings = getFrontendToolsSettings(adapter);
FrontendTools tools = new FrontendTools(settings);
tools.validateNodeAndNpmVersion();

ClassFinder classFinder = adapter.getClassFinder();
Lookup lookup = adapter.createLookup(classFinder);
Expand All @@ -166,7 +165,6 @@ public static void prepareFrontend(PluginAdapterBase adapter)
getGeneratedFrontendDirectory(adapter))
.withNodeVersion(adapter.nodeVersion())
.withNodeDownloadRoot(nodeDownloadRootURI)
.setNodeAutoUpdate(adapter.nodeAutoUpdate())
.withHomeNodeExecRequired(adapter.requireHomeNodeExec())
.setJavaResourceFolder(adapter.javaResourceFolder())
.withProductionMode(false).withReact(adapter.isReactEnabled())
Expand Down Expand Up @@ -210,7 +208,6 @@ private static FrontendToolsSettings getFrontendToolsSettings(
() -> FrontendUtils.getVaadinHomeDirectory().getAbsolutePath());
settings.setNodeDownloadRoot(adapter.nodeDownloadRoot());
settings.setNodeVersion(adapter.nodeVersion());
settings.setAutoUpdate(adapter.nodeAutoUpdate());
settings.setUseGlobalPnpm(adapter.useGlobalPnpm());
settings.setForceAlternativeNode(adapter.requireHomeNodeExec());
settings.setIgnoreVersionChecks(
Expand Down Expand Up @@ -361,7 +358,6 @@ public static void runNodeUpdater(PluginAdapterBuild adapter,
.withHomeNodeExecRequired(adapter.requireHomeNodeExec())
.withNodeVersion(adapter.nodeVersion())
.withNodeDownloadRoot(nodeDownloadRootURI)
.setNodeAutoUpdate(adapter.nodeAutoUpdate())
.setJavaResourceFolder(adapter.javaResourceFolder())
.withPostinstallPackages(adapter.postinstallPackages())
.withCiBuild(adapter.ciBuild())
Expand Down Expand Up @@ -434,7 +430,6 @@ public static void runDevBuildNodeUpdater(PluginAdapterBuild adapter)
.withHomeNodeExecRequired(adapter.requireHomeNodeExec())
.withNodeVersion(adapter.nodeVersion())
.withNodeDownloadRoot(nodeDownloadRootURI)
.setNodeAutoUpdate(adapter.nodeAutoUpdate())
.setJavaResourceFolder(adapter.javaResourceFolder())
.withPostinstallPackages(adapter.postinstallPackages())
.withBundleBuild(true)
Expand Down Expand Up @@ -507,7 +502,6 @@ public static void runFrontendBuild(PluginAdapterBase adapter)

FrontendToolsSettings settings = getFrontendToolsSettings(adapter);
FrontendTools tools = new FrontendTools(settings);
tools.validateNodeAndNpmVersion();
BuildFrontendUtil.runVite(adapter, tools);
String tokenContent = "";
File tokenFile = getTokenFile(adapter);
Expand Down Expand Up @@ -570,12 +564,7 @@ private static void runFrontendBuildTool(PluginAdapterBase adapter,
toolName, buildExecutable.getAbsolutePath()));
}

String nodePath;
if (adapter.requireHomeNodeExec()) {
nodePath = frontendTools.forceAlternativeNodeExecutable();
} else {
nodePath = frontendTools.getNodeExecutable();
}
String nodePath = frontendTools.getNodeExecutable();

List<String> command = new ArrayList<>();
command.add(nodePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ private FrontendToolsSettings getFrontendToolsSettings()
() -> FrontendUtils.getVaadinHomeDirectory().getAbsolutePath());
settings.setNodeDownloadRoot(adapter.nodeDownloadRoot());
settings.setNodeVersion(adapter.nodeVersion());
settings.setAutoUpdate(adapter.nodeAutoUpdate());
settings.setUseGlobalPnpm(adapter.useGlobalPnpm());
settings.setForceAlternativeNode(adapter.requireHomeNodeExec());
settings.setIgnoreVersionChecks(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ default Lookup createLookup(ClassFinder classFinder) {
*/
URI nodeDownloadRoot() throws URISyntaxException;

/**
* Whether the alternative node may be auto-updated or not.
*
* @return {@code true} to update node if older than default
*/
boolean nodeAutoUpdate();

/**
* The node.js version to be used when node.js is installed automatically by
* Vaadin, for example `"v12.18.3"`. Defaults to null which uses the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ public final class Constants implements Serializable {
*/
public static final boolean GLOBAL_PNPM_DEFAULT = false;

/**
* The default value for {@link InitParameters#NODE_AUTO_UPDATE}.
*/
public static final boolean DEFAULT_NODE_AUTO_UPDATE = true;

/**
* The default value for
* {@link InitParameters#REQUIRE_HOME_NODE_EXECUTABLE}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@ public class InitParameters implements Serializable {
*/
public static final String REQUIRE_HOME_NODE_EXECUTABLE = "require.home.node";

/**
* Configuration parameter name for requiring node executable installed in
* home directory.
*
*/
public static final String NODE_AUTO_UPDATE = "node.auto.update";

/**
* Configuration name for the parameter that sets the compiled web
* components path. The path should be the same as
Expand Down
Loading
Loading