Package com.vaadin.flow.server.frontend
Class FrontendToolsSettings
java.lang.Object
com.vaadin.flow.server.frontend.FrontendToolsSettings
- All Implemented Interfaces:
Serializable
Configuration object for controlling the
FrontendTools features.
This can be modified, but the choices will be locked in FrontendTools
when it is initialized. Until then any settings can be changed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFrontendToolsSettings(String baseDir, SerializableSupplier<String> alternativeDirGetter) Create a tools configuration object. -
Method Summary
Modifier and TypeMethodDescriptionGet the alternative directory getter.Get the defined base dir.Get the node download root to be used for downloading node.Get the defined node version.booleanCheck if automatic updates are enabled.booleanCheck if alternative node usage should be forced.booleanCheck if version checks should be ignored.booleanCheck if global pnpm should be used.voidsetAlternativeDirGetter(SerializableSupplier<String> alternativeDirGetter) Set the installation directory if no tools are found.voidsetAutoUpdate(boolean autoUpdate) When set to true the alternative version is updated to the latest default node version as defined for the framework.voidsetBaseDir(String baseDir) Set the base directory for locating tools.voidsetForceAlternativeNode(boolean forceAlternativeNode) Set if the alternative folder should always be used even if a global installation exists.voidsetIgnoreVersionChecks(boolean ignoreVersionChecks) Set if node and npm versions should be checked or not.voidsetNodeDownloadRoot(URI nodeDownloadRoot) Set the root URI for downloading node.voidsetNodeVersion(String nodeVersion) Set the node version to install when installation is required.voidsetUseGlobalPnpm(boolean useGlobalPnpm) Force usage of global pnpm.
-
Constructor Details
-
FrontendToolsSettings
Create a tools configuration object.The
baseDiris used as a base directory to locate the tools andalternativeDirGetteris the directory to install tools if they are not found.Note that if
alternativeDirisnulltools won't be installed.- Parameters:
baseDir- the base directory to locate the tools, notnullalternativeDirGetter- the getter for a directory where tools will be installed if they are not found globally or in thebaseDir, may benull
-
-
Method Details
-
setBaseDir
Set the base directory for locating tools.- Parameters:
baseDir- the base directory to locate the tools, notnull
-
setAlternativeDirGetter
Set the installation directory if no tools are found.- Parameters:
alternativeDirGetter- the getter for a directory where tools will be installed if they are not found globally or in thebaseDir, may benull
-
setNodeDownloadRoot
Set the root URI for downloading node.- Parameters:
nodeDownloadRoot- node download root uri, default is "https://nodejs.org/dist/"
-
setNodeVersion
Set the node version to install when installation is required.- Parameters:
nodeVersion- The node.js version to be used when node.js is installed automatically, default is "v24.10.0"
-
setIgnoreVersionChecks
public void setIgnoreVersionChecks(boolean ignoreVersionChecks) Set if node and npm versions should be checked or not. If set, system property "vaadin.ignoreVersionChecks" will override the value set here.- Parameters:
ignoreVersionChecks- set totrueif versions should be validated
-
setForceAlternativeNode
public void setForceAlternativeNode(boolean forceAlternativeNode) Set if the alternative folder should always be used even if a global installation exists.This will force the installation if a version doesn't exist in the folder defined in
alternativeDirGetter.- Parameters:
forceAlternativeNode- iftrueforce usage of node executable from alternative directory
-
setUseGlobalPnpm
public void setUseGlobalPnpm(boolean useGlobalPnpm) Force usage of global pnpm.- Parameters:
useGlobalPnpm- use globally installed pnpm instead of the default version "8.6.11"
-
setAutoUpdate
public void setAutoUpdate(boolean autoUpdate) When set to true the alternative version is updated to the latest default node version as defined for the framework.- Parameters:
autoUpdate- update node inalternativeDirGetterif version older than the current default "v24.10.0"
-
getBaseDir
Get the defined base dir.- Returns:
- defined base dir
-
getAlternativeDirGetter
Get the alternative directory getter.- Returns:
- alternative directory getter
-
getNodeVersion
Get the defined node version.- Returns:
- node version
-
getNodeDownloadRoot
Get the node download root to be used for downloading node.- Returns:
- node download root
-
isIgnoreVersionChecks
public boolean isIgnoreVersionChecks()Check if version checks should be ignored.- Returns:
- ignore version checks
-
isForceAlternativeNode
public boolean isForceAlternativeNode()Check if alternative node usage should be forced.- Returns:
- force alternative node usage
-
isUseGlobalPnpm
public boolean isUseGlobalPnpm()Check if global pnpm should be used.- Returns:
- use global pnpm
-
isAutoUpdate
public boolean isAutoUpdate()Check if automatic updates are enabled.- Returns:
- automatic update
-