com.vaadin.flow.server.frontend.
Class NodeUpdater
- java.lang.Object
-
- com.vaadin.flow.server.frontend.NodeUpdater
-
All Implemented Interfaces:
Direct Known Subclasses:
TaskGeneratePackageJson
,TaskUpdateImports
,TaskUpdatePackages
public abstract class NodeUpdater extends Object implements FallibleCommand
Base abstract class for frontend updaters that needs to be run when in dev-mode or from the flow maven plugin.
For internal use only. May be renamed or removed in a future release.
Since:
2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected String
buildDir
protected static String
DEP_NAME_FLOW_DEPS
protected static String
DEP_NAME_FLOW_JARS
protected File
flowResourcesFolder
Base directory for flow dependencies coming from jars.
protected FrontendDependenciesScanner
frontDeps
The
FrontendDependencies
object representing the application dependencies.static String
GENERATED_PREFIX
Relative paths of generated should be prefixed with this value, so they can be correctly separated from {projectDir}/frontend files.
protected File
generatedFolder
Base directory for flow generated files.
protected File
nodeModulesFolder
The path to the
FrontendUtils.NODE_MODULES
directory.protected File
npmFolder
Base directory for
Constants.PACKAGE_JSON
,FrontendUtils.WEBPACK_CONFIG
,FrontendUtils.NODE_MODULES
.protected static String
POLYMER_VERSION
-
Constructor Summary
Constructors Modifier Constructor Description protected
NodeUpdater(ClassFinder finder, FrontendDependenciesScanner frontendDependencies, File npmFolder, File generatedPath, File flowResourcesPath, String buildDir, FeatureFlags featureFlags)
Constructor.
-
Method Summary
All Methods Modifier and Type Method Description protected String
generateVersionsJson()
Generate versions json file for version locking.
protected File
getPackageJsonFile()
protected File
getPackageLockFile()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.server.frontend.FallibleCommand
execute
-
-
-
-
Field Detail
-
GENERATED_PREFIX
public static final String GENERATED_PREFIX
Relative paths of generated should be prefixed with this value, so they can be correctly separated from {projectDir}/frontend files.
See Also:
-
DEP_NAME_FLOW_DEPS
protected static final String DEP_NAME_FLOW_DEPS
See Also:
-
DEP_NAME_FLOW_JARS
protected static final String DEP_NAME_FLOW_JARS
See Also:
-
POLYMER_VERSION
protected static final String POLYMER_VERSION
See Also:
-
npmFolder
protected final File npmFolder
Base directory for
Constants.PACKAGE_JSON
,FrontendUtils.WEBPACK_CONFIG
,FrontendUtils.NODE_MODULES
.
-
nodeModulesFolder
protected final File nodeModulesFolder
The path to the
FrontendUtils.NODE_MODULES
directory.
-
generatedFolder
protected final File generatedFolder
Base directory for flow generated files.
-
flowResourcesFolder
protected final File flowResourcesFolder
Base directory for flow dependencies coming from jars.
-
frontDeps
protected final FrontendDependenciesScanner frontDeps
The
FrontendDependencies
object representing the application dependencies.
-
buildDir
protected String buildDir
-
-
Constructor Detail
-
NodeUpdater
protected NodeUpdater(ClassFinder finder, FrontendDependenciesScanner frontendDependencies, File npmFolder, File generatedPath, File flowResourcesPath, String buildDir, FeatureFlags featureFlags)
Constructor.
Parameters:
finder
- a reusable class finderfrontendDependencies
- a reusable frontend dependenciesnpmFolder
- folder with the `package.json` filegeneratedPath
- folder where flow generated files will be placed.flowResourcesPath
- folder where flow dependencies will be copied to.buildDir
- the used build directoryfeatureFlags
- FeatureFlags for this build
-
-
Method Detail
-
getPackageJsonFile
protected File getPackageJsonFile()
-
getPackageLockFile
protected File getPackageLockFile()
-
generateVersionsJson
protected String generateVersionsJson() throws IOException
Generate versions json file for version locking.
Returns:
generated versions json file path
Throws:
IOException
- when file IO fails
-
-