com.vaadin.flow.server.frontend.
Class FrontendToolsSettings
All Implemented Interfaces:
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.
boolean
Check if automatic updates are enabled.
boolean
Check if alternative node usage should be forced.
boolean
Check if version checks should be ignored.
boolean
Check if global pnpm should be used.
void
setAlternativeDirGetter
(SerializableSupplier<String> alternativeDirGetter) Set the installation directory if no tools are found.
void
setAutoUpdate
(boolean autoUpdate) When set to true the alternative version is updated to the latest default node version as defined for the framework.
void
setBaseDir
(String baseDir) Set the base directory for locating tools.
void
setForceAlternativeNode
(boolean forceAlternativeNode) Set if the alternative folder should always be used even if a global installation exists.
void
setIgnoreVersionChecks
(boolean ignoreVersionChecks) Set if node and npm versions should be checked or not.
void
setNodeDownloadRoot
(URI nodeDownloadRoot) Set the root URI for downloading node.
void
setNodeVersion
(String nodeVersion) Set the node version to install when installation is required.
void
setUseGlobalPnpm
(boolean useGlobalPnpm) Force usage of global pnpm.
-
Constructor Details
-
FrontendToolsSettings
Create a tools configuration object.
The
baseDir
is used as a base directory to locate the tools andalternativeDirGetter
is the directory to install tools if they are not found.Note that if
alternativeDir
isnull
tools won't be installed.Parameters:
baseDir
- the base directory to locate the tools, notnull
alternativeDirGetter
- 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 "v22.14.0" -
setIgnoreVersionChecks
public void setIgnoreVersionChecks(boolean ignoreVersionChecks) Set if node and npm versions should be checked or not.
Parameters:
ignoreVersionChecks
- set if versions should be validated, default is system property for "vaadin.ignoreVersionChecks" -
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
- iftrue
force 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 inalternativeDirGetter
if version older than the current default "v22.14.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
-