diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/ForwardedDevProcessor.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/ForwardedDevProcessor.java index 55039c58..e201fa61 100644 --- a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/ForwardedDevProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/ForwardedDevProcessor.java @@ -34,6 +34,7 @@ import io.quarkiverse.quinoa.deployment.config.QuinoaConfig; import io.quarkiverse.quinoa.deployment.items.ConfiguredQuinoaBuildItem; import io.quarkiverse.quinoa.deployment.items.ForwardedDevServerBuildItem; +import io.quarkiverse.quinoa.deployment.items.InstalledPackageManagerBuildItem; import io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildProducer; @@ -63,6 +64,7 @@ public class ForwardedDevProcessor { public ForwardedDevServerBuildItem prepareDevService( LaunchModeBuildItem launchMode, ConfiguredQuinoaBuildItem configuredQuinoa, + InstalledPackageManagerBuildItem installedPackageManager, QuinoaConfig userConfig, BuildProducer devServices, Optional consoleInstalled, @@ -77,7 +79,7 @@ public ForwardedDevServerBuildItem prepareDevService( final DevServerConfig devServerConfig = resolvedConfig.devServer(); liveReload.setContextObject(QuinoaConfig.class, resolvedConfig); final String configuredDevServerHost = devServerConfig.host(); - final PackageManagerRunner packageManagerRunner = configuredQuinoa.getPackageManager(); + final PackageManagerRunner packageManagerRunner = installedPackageManager.getPackageManager(); final String checkPath = resolvedConfig.devServer().checkPath().orElse(null); if (devService != null) { boolean shouldShutdownTheBroker = !resolvedConfig.equals(oldConfig); diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java index 27fd4de3..df14aff1 100644 --- a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/QuinoaProcessor.java @@ -7,7 +7,6 @@ import static io.quarkiverse.quinoa.deployment.config.QuinoaConfig.isEnabled; import static io.quarkiverse.quinoa.deployment.config.QuinoaConfig.toHandlerConfig; import static io.quarkiverse.quinoa.deployment.framework.FrameworkType.overrideConfig; -import static io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerInstall.install; import static io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner.autoDetectPackageManager; import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; @@ -35,6 +34,7 @@ import io.quarkiverse.quinoa.deployment.framework.FrameworkType; import io.quarkiverse.quinoa.deployment.items.BuiltResourcesBuildItem; import io.quarkiverse.quinoa.deployment.items.ConfiguredQuinoaBuildItem; +import io.quarkiverse.quinoa.deployment.items.InstalledPackageManagerBuildItem; import io.quarkiverse.quinoa.deployment.items.TargetDirBuildItem; import io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerInstall; import io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner; @@ -78,7 +78,6 @@ FeatureBuildItem feature() { @BuildStep public ConfiguredQuinoaBuildItem prepareQuinoaDirectory( LaunchModeBuildItem launchMode, - LiveReloadBuildItem liveReload, QuinoaConfig userConfig, OutputTargetBuildItem outputTarget) { if (!isEnabled(userConfig)) { @@ -95,44 +94,56 @@ public ConfiguredQuinoaBuildItem prepareQuinoaDirectory( if (projectDirs == null) { return null; } - final Path packageJsonFile = projectDirs.uiDir.resolve("package.json"); - if (!Files.isRegularFile(packageJsonFile)) { + final Path packageJson = projectDirs.uiDir.resolve("package.json"); + if (!Files.isRegularFile(packageJson)) { throw new ConfigurationException("No package.json found in Web UI directory: '" + configuredDir + "'"); } - final QuinoaConfig resolvedConfig = overrideConfig(launchMode, userConfig, packageJsonFile); + final QuinoaConfig resolvedConfig = overrideConfig(launchMode, userConfig, packageJson); - Optional packageManagerBinary = resolvedConfig.packageManager(); - List paths = new ArrayList<>(); - if (resolvedConfig.packageManagerInstall().enabled()) { - final PackageManagerInstall.Installation result = install(resolvedConfig.packageManagerInstall(), - projectDirs); - packageManagerBinary = Optional.of(result.getPackageManagerBinary()); - paths.add(result.getNodeDirPath()); - } + return new ConfiguredQuinoaBuildItem(projectDirs.projectRootDir, projectDirs.uiDir, packageJson, resolvedConfig); + } - final PackageManagerRunner packageManagerRunner = autoDetectPackageManager(packageManagerBinary, - resolvedConfig.packageManagerCommand(), projectDirs.getUIDir(), paths); - final boolean alreadyInstalled = Files.isDirectory(packageManagerRunner.getDirectory().resolve("node_modules")); - final boolean packageFileModified = liveReload.isLiveReload() - && liveReload.getChangedResources().stream().anyMatch(r -> r.equals(packageJsonFile.toString())); - if (resolvedConfig.forceInstall() || !alreadyInstalled || packageFileModified) { - final boolean ci = resolvedConfig.ci().orElseGet(QuinoaProcessor::isCI); - if (ci) { - packageManagerRunner.ci(); - } else { - packageManagerRunner.install(); + @BuildStep + public InstalledPackageManagerBuildItem install( + ConfiguredQuinoaBuildItem configuredQuinoa, + LiveReloadBuildItem liveReload) { + if (configuredQuinoa != null) { + final QuinoaConfig resolvedConfig = configuredQuinoa.resolvedConfig(); + Optional packageManagerBinary = resolvedConfig.packageManager(); + List paths = new ArrayList<>(); + if (resolvedConfig.packageManagerInstall().enabled()) { + final PackageManagerInstall.Installation result = PackageManagerInstall.install( + resolvedConfig.packageManagerInstall(), + configuredQuinoa.projectDir()); + packageManagerBinary = Optional.of(result.getPackageManagerBinary()); + paths.add(result.getNodeDirPath()); } - } + final PackageManagerRunner packageManagerRunner = autoDetectPackageManager(packageManagerBinary, + resolvedConfig.packageManagerCommand(), configuredQuinoa.uiDir(), paths); + final boolean alreadyInstalled = Files.isDirectory(packageManagerRunner.getDirectory().resolve("node_modules")); + final boolean packageFileModified = liveReload.isLiveReload() + && liveReload.getChangedResources().stream() + .anyMatch(r -> r.equals(configuredQuinoa.packageJson().toString())); + if (resolvedConfig.forceInstall() || !alreadyInstalled || packageFileModified) { + final boolean ci = resolvedConfig.ci().orElseGet(QuinoaProcessor::isCI); + if (ci) { + packageManagerRunner.ci(); + } else { + packageManagerRunner.install(); + } - // attempt to autoconfigure settings based on the framework being used - return new ConfiguredQuinoaBuildItem(packageManagerRunner, resolvedConfig); + } + return new InstalledPackageManagerBuildItem(packageManagerRunner); + } + return null; } @BuildStep public TargetDirBuildItem processBuild( ConfiguredQuinoaBuildItem configuredQuinoa, + InstalledPackageManagerBuildItem installedPackageManager, OutputTargetBuildItem outputTarget, LaunchModeBuildItem launchMode, LiveReloadBuildItem liveReload) throws IOException { @@ -140,7 +151,7 @@ public TargetDirBuildItem processBuild( return null; } - final PackageManagerRunner packageManagerRunner = configuredQuinoa.getPackageManager(); + final PackageManagerRunner packageManagerRunner = installedPackageManager.getPackageManager(); final QuinoaLiveContext contextObject = liveReload.getContextObject(QuinoaLiveContext.class); if (launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT && isDevServerMode(configuredQuinoa.resolvedConfig())) { @@ -200,7 +211,7 @@ void watchChanges( if (quinoaDir.isEmpty() || isDevServerMode(quinoaDir.get().resolvedConfig())) { return; } - scan(quinoaDir.get().getPackageManager().getDirectory(), watchedPaths); + scan(quinoaDir.get().uiDir(), watchedPaths); } @BuildStep @@ -247,7 +258,7 @@ List hotDeploymentWatchedFiles(Optional cardPageBuildItemBuildProducer, } @BuildStep(onlyIf = IsDevelopment.class) - JsonRPCProvidersBuildItem registerJsonRpcBackend(Optional quinoaDirectoryBuildItem, + JsonRPCProvidersBuildItem registerJsonRpcBackend(InstalledPackageManagerBuildItem installedPackageManager, QuinoaConfig quinoaConfig) { DevConsoleManager.register("quinoa-install-action", - install(quinoaDirectoryBuildItem, quinoaConfig)); + install(installedPackageManager, quinoaConfig)); return new JsonRPCProvidersBuildItem(QuinoaJsonRpcService.class); } - private Function, String> install(Optional quinoaDirectoryBuildItem, + private Function, String> install(InstalledPackageManagerBuildItem installedPackageManager, QuinoaConfig quinoaConfig) { return (map -> { try { - final PackageManagerRunner packageManagerRunner = quinoaDirectoryBuildItem.orElseThrow().getPackageManager(); + final PackageManagerRunner packageManagerRunner = installedPackageManager.getPackageManager(); // install or update packages packageManagerRunner.install(); diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/ConfiguredQuinoaBuildItem.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/ConfiguredQuinoaBuildItem.java index dfb5353e..cda678a8 100644 --- a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/ConfiguredQuinoaBuildItem.java +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/ConfiguredQuinoaBuildItem.java @@ -3,26 +3,32 @@ import java.nio.file.Path; import io.quarkiverse.quinoa.deployment.config.QuinoaConfig; -import io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner; import io.quarkus.builder.item.SimpleBuildItem; public final class ConfiguredQuinoaBuildItem extends SimpleBuildItem { - private final PackageManagerRunner packageManagerRunner; - + private final Path projectDir; + private final Path uiDir; + private final Path packageJson; private final QuinoaConfig resolvedConfig; - public ConfiguredQuinoaBuildItem(PackageManagerRunner packageManagerRunner, QuinoaConfig resolvedConfig) { - this.packageManagerRunner = packageManagerRunner; + public ConfiguredQuinoaBuildItem(Path projectDir, Path uiDir, Path packageJson, QuinoaConfig resolvedConfig) { + this.projectDir = projectDir; + this.uiDir = uiDir; + this.packageJson = packageJson; this.resolvedConfig = resolvedConfig; } - public PackageManagerRunner getPackageManager() { - return packageManagerRunner; + public Path projectDir() { + return projectDir; + } + + public Path uiDir() { + return uiDir; } - public Path getDirectory() { - return getPackageManager().getDirectory(); + public Path packageJson() { + return packageJson; } public QuinoaConfig resolvedConfig() { diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/InstalledPackageManagerBuildItem.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/InstalledPackageManagerBuildItem.java new file mode 100644 index 00000000..84c80d93 --- /dev/null +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/items/InstalledPackageManagerBuildItem.java @@ -0,0 +1,17 @@ +package io.quarkiverse.quinoa.deployment.items; + +import io.quarkiverse.quinoa.deployment.packagemanager.PackageManagerRunner; +import io.quarkus.builder.item.SimpleBuildItem; + +public final class InstalledPackageManagerBuildItem extends SimpleBuildItem { + + private final PackageManagerRunner packageManagerRunner; + + public InstalledPackageManagerBuildItem(PackageManagerRunner packageManagerRunner) { + this.packageManagerRunner = packageManagerRunner; + } + + public PackageManagerRunner getPackageManager() { + return packageManagerRunner; + } +} diff --git a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/packagemanager/PackageManagerInstall.java b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/packagemanager/PackageManagerInstall.java index 6e9035f5..31fd0d52 100644 --- a/deployment/src/main/java/io/quarkiverse/quinoa/deployment/packagemanager/PackageManagerInstall.java +++ b/deployment/src/main/java/io/quarkiverse/quinoa/deployment/packagemanager/PackageManagerInstall.java @@ -1,5 +1,7 @@ package io.quarkiverse.quinoa.deployment.packagemanager; +import java.io.IOException; +import java.io.UncheckedIOException; import java.nio.file.DirectoryNotEmptyException; import java.nio.file.Path; import java.util.Collections; @@ -12,8 +14,8 @@ import com.github.eirslett.maven.plugins.frontend.lib.InstallationException; import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig; -import io.quarkiverse.quinoa.deployment.QuinoaProcessor.ProjectDirs; import io.quarkiverse.quinoa.deployment.config.PackageManagerInstallConfig; +import io.quarkus.deployment.util.FileUtil; import io.quarkus.runtime.configuration.ConfigurationException; public final class PackageManagerInstall { @@ -29,8 +31,8 @@ private PackageManagerInstall() { } - public static Installation install(PackageManagerInstallConfig config, final ProjectDirs projectDirs) { - Path installDir = resolveInstallDir(config, projectDirs).normalize(); + public static Installation install(PackageManagerInstallConfig config, final Path projectDir) { + Path installDir = resolveInstallDir(config, projectDir).normalize(); FrontendPluginFactory factory = new FrontendPluginFactory(null, installDir.toFile()); if (config.nodeVersion().isEmpty()) { throw new ConfigurationException("node-version is required to install package manager", @@ -40,74 +42,92 @@ public static Installation install(PackageManagerInstallConfig config, final Pro throw new ConfigurationException("Quinoa is not compatible with Node prior to v4.0.0", Set.of("quarkus.quinoa.package-manager-install.node-version")); } - try { - final ProxyConfig proxy = new ProxyConfig(Collections.emptyList()); + int i = 0; + Exception thrown = null; + while (i < 5) { try { - factory.getNodeInstaller(proxy) - .setNodeVersion("v" + config.nodeVersion().get()) - .setNodeDownloadRoot(config.nodeDownloadRoot()) - .setNpmVersion(config.npmVersion()) - .install(); - } catch (InstallationException e) { - if (e.getCause() instanceof DirectoryNotEmptyException && e.getCause().getMessage().contains("tmp")) { - LOG.warnf("Quinoa was not able to delete the Node install temporary directory: %s", - e.getCause().getMessage()); - } else { - throw e; + if (i > 0) { + LOG.infof("An error occurred during the previous Node.js install, retrying (%s/5)", i + 1); + FileUtil.deleteDirectory(installDir); } + return attemptInstall(config, installDir, factory); + } catch (InstallationException e) { + thrown = e; + i++; + } catch (IOException e) { + throw new UncheckedIOException(e); } + } + throw new RuntimeException("Error while installing NodeJS", thrown); + } - // Use npm if npmVersion is different from provided or if no other version is set (then it will use the version provided by nodejs) - String executionPath = NPM_PATH; - final String npmVersion = config.npmVersion(); - boolean isNpmProvided = PackageManagerInstallConfig.NPM_PROVIDED.equalsIgnoreCase(npmVersion); - if (!isNpmProvided) { - factory.getNPMInstaller(proxy) - .setNodeVersion("v" + config.nodeVersion().get()) - .setNpmVersion(npmVersion) - .setNpmDownloadRoot(config.npmDownloadRoot()) - .install(); + private static Installation attemptInstall(PackageManagerInstallConfig config, Path installDir, + FrontendPluginFactory factory) throws InstallationException { + final ProxyConfig proxy = new ProxyConfig(Collections.emptyList()); + try { + factory.getNodeInstaller(proxy) + .setNodeVersion("v" + config.nodeVersion().get()) + .setNodeDownloadRoot(config.nodeDownloadRoot()) + .setNpmVersion(config.npmVersion()) + .install(); + } catch (InstallationException e) { + if (e.getCause() instanceof DirectoryNotEmptyException && e.getCause().getMessage().contains("tmp")) { + LOG.warnf("Quinoa was not able to delete the Node install temporary directory: %s", + e.getCause().getMessage()); + } else { + throw e; } + } - // Use yarn if yarnVersion is set (and npm is provided) - final Optional yarnVersion = config.yarnVersion(); - if (yarnVersion.isPresent() && isNpmProvided) { - executionPath = YARN_PATH; - factory.getYarnInstaller(proxy) - .setYarnVersion("v" + config.yarnVersion().get()) - .setYarnDownloadRoot(config.yarnDownloadRoot()) - .setIsYarnBerry(true) - .install(); - } + // Use npm if npmVersion is different from provided or if no other version is set (then it will use the version provided by nodejs) + String executionPath = NPM_PATH; + final String npmVersion = config.npmVersion(); + boolean isNpmProvided = PackageManagerInstallConfig.NPM_PROVIDED.equalsIgnoreCase(npmVersion); + if (!isNpmProvided) { + factory.getNPMInstaller(proxy) + .setNodeVersion("v" + config.nodeVersion().get()) + .setNpmVersion(npmVersion) + .setNpmDownloadRoot(config.npmDownloadRoot()) + .install(); + } - // Use pnpm if pnpmVersion is set (and npm is provided and yarnVersion is not set) - final Optional pnpmVersion = config.pnpmVersion(); - if (pnpmVersion.isPresent() && isNpmProvided && yarnVersion.isEmpty()) { - executionPath = PNPM_PATH; - factory.getPnpmInstaller(proxy) - .setNodeVersion("v" + config.nodeVersion().get()) - .setPnpmVersion(pnpmVersion.get()) - .setPnpmDownloadRoot(config.pnpmDownloadRoot()) - .install(); - } + // Use yarn if yarnVersion is set (and npm is provided) + final Optional yarnVersion = config.yarnVersion(); + if (yarnVersion.isPresent() && isNpmProvided) { + executionPath = YARN_PATH; + factory.getYarnInstaller(proxy) + .setYarnVersion("v" + config.yarnVersion().get()) + .setYarnDownloadRoot(config.yarnDownloadRoot()) + .setIsYarnBerry(true) + .install(); + } - return resolveInstalledExecutorBinary(installDir, executionPath); - } catch (InstallationException e) { - throw new RuntimeException("Error while installing NodeJS", e); + // Use pnpm if pnpmVersion is set (and npm is provided and yarnVersion is not set) + final Optional pnpmVersion = config.pnpmVersion(); + if (pnpmVersion.isPresent() && isNpmProvided && yarnVersion.isEmpty()) { + executionPath = PNPM_PATH; + factory.getPnpmInstaller(proxy) + .setNodeVersion("v" + config.nodeVersion().get()) + .setPnpmVersion(pnpmVersion.get()) + .setPnpmDownloadRoot(config.pnpmDownloadRoot()) + .install(); } + + return resolveInstalledExecutorBinary(installDir, executionPath); + } - private static Path resolveInstallDir(PackageManagerInstallConfig config, ProjectDirs projectDirs) { + private static Path resolveInstallDir(PackageManagerInstallConfig config, Path projectDir) { final Path installPath = Path.of(config.installDir().trim()); if (installPath.isAbsolute()) { return installPath; } - if (projectDirs.getProjectRootDir() == null) { + if (projectDir == null) { throw new ConfigurationException( "Use an absolute package-manager-install.install-dir when the project root directory is not standard", Set.of("quarkus.quinoa.package-manager-install.install-dir")); } - return projectDirs.getProjectRootDir().resolve(installPath); + return projectDir.resolve(installPath); } private static Installation resolveInstalledExecutorBinary(Path installDirectory, String executionPath) { diff --git a/docs/modules/ROOT/pages/includes/quarkus-quinoa.adoc b/docs/modules/ROOT/pages/includes/quarkus-quinoa.adoc index 779a2d91..500958eb 100644 --- a/docs/modules/ROOT/pages/includes/quarkus-quinoa.adoc +++ b/docs/modules/ROOT/pages/includes/quarkus-quinoa.adoc @@ -15,6 +15,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa]]`link:#q [.description] -- +Indicate if the extension should be enabled. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA+++[] endif::add-copy-button-to-env-var[] @@ -30,6 +32,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.just-buil [.description] -- +Indicate if Quinoa should just do the build part. If true, Quinoa will NOT serve the Web UI built resources. This is handy when the output of the build is used to be served via something else (nginx, cdn, ...) Quinoa put the built files in 'target/quinoa-build' (or 'build/quinoa-build with Gradle). + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_JUST_BUILD+++[] endif::add-copy-button-to-env-var[] @@ -45,6 +49,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.ui-dir]]` [.description] -- +Path to the Web UI (NodeJS) root directory (relative to the project root). + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_UI_DIR+++[] endif::add-copy-button-to-env-var[] @@ -60,6 +66,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.build-dir [.description] -- +This the Web UI internal build system (webpack, ...) output directory. After the build, Quinoa will take the files from this directory, move them to 'target/quinoa-build' (or build/quinoa-build with Gradle) and serve them at runtime. The path is relative to the Web UI path. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_BUILD_DIR+++[] endif::add-copy-button-to-env-var[] @@ -75,6 +83,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-m [.description] -- +Name of the package manager binary. Only npm, pnpm and yarn are supported for the moment. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_PACKAGE_MANAGER+++[] endif::add-copy-button-to-env-var[] @@ -260,7 +270,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-m [.description] -- -Custom command for installing all dependencies. e.g. «ci --cache $CACHE_DIR/.npm --prefer-offline» +Custom command for installing all packages. e.g. «ci --cache $CACHE_DIR/.npm --prefer-offline» ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_INSTALL+++[] @@ -269,7 +279,24 @@ ifndef::add-copy-button-to-env-var[] Environment variable: `+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_INSTALL+++` endif::add-copy-button-to-env-var[] --|string -| +|`install` + + +a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.ci]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.ci[quarkus.quinoa.package-manager-command.ci]` + + +[.description] +-- +Custom command for installing all the packages without generating a lockfile (frozen lockfile) and failing if an update is needed (useful in CI). + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_CI+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_CI+++` +endif::add-copy-button-to-env-var[] +--|string +|`Detected based on package manager` a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.build]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.build[quarkus.quinoa.package-manager-command.build]` @@ -286,7 +313,7 @@ ifndef::add-copy-button-to-env-var[] Environment variable: `+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_BUILD+++` endif::add-copy-button-to-env-var[] --|string -|`build` +|`run build` a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.test]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.test[quarkus.quinoa.package-manager-command.test]` @@ -303,7 +330,7 @@ ifndef::add-copy-button-to-env-var[] Environment variable: `+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_TEST+++` endif::add-copy-button-to-env-var[] --|string -|`test` +|`run test` a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.dev]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.dev[quarkus.quinoa.package-manager-command.dev]` @@ -328,6 +355,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.index-pag [.description] -- +Name of the index page. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_INDEX_PAGE+++[] endif::add-copy-button-to-env-var[] @@ -343,6 +372,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.run-tests [.description] -- +Indicate if the Web UI should also be tested during the build phase (i.e: npm test). To be used in a `io.quarkus.test.junit.QuarkusTestProfile` to have Web UI test running during a `io.quarkus.test.junit.QuarkusTest` + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_RUN_TESTS+++[] endif::add-copy-button-to-env-var[] @@ -353,16 +384,18 @@ endif::add-copy-button-to-env-var[] |`false` -a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.frozen-lockfile]]`link:#quarkus-quinoa_quarkus.quinoa.frozen-lockfile[quarkus.quinoa.frozen-lockfile]` +a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.ci]]`link:#quarkus-quinoa_quarkus.quinoa.ci[quarkus.quinoa.ci]` [.description] -- +Install the packages without generating a lockfile (frozen lockfile) and failing if an update is needed (useful in CI). + ifdef::add-copy-button-to-env-var[] -Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_FROZEN_LOCKFILE+++[] +Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_CI+++[] endif::add-copy-button-to-env-var[] ifndef::add-copy-button-to-env-var[] -Environment variable: `+++QUARKUS_QUINOA_FROZEN_LOCKFILE+++` +Environment variable: `+++QUARKUS_QUINOA_CI+++` endif::add-copy-button-to-env-var[] --|boolean |`true if environment CI=true` @@ -373,6 +406,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.force-ins [.description] -- +Force install packages before building. It will install packages only if the node_modules directory is absent or when the package.json is modified in dev-mode. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_FORCE_INSTALL+++[] endif::add-copy-button-to-env-var[] @@ -383,11 +418,30 @@ endif::add-copy-button-to-env-var[] |`false` +a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.framework.detection]]`link:#quarkus-quinoa_quarkus.quinoa.framework.detection[quarkus.quinoa.framework.detection]` + + +[.description] +-- +When true, the UI Framework will be auto-detected if possible + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_FRAMEWORK_DETECTION+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_QUINOA_FRAMEWORK_DETECTION+++` +endif::add-copy-button-to-env-var[] +--|boolean +|`true` + + a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.enable-spa-routing]]`link:#quarkus-quinoa_quarkus.quinoa.enable-spa-routing[quarkus.quinoa.enable-spa-routing]` [.description] -- +Enable SPA (Single Page Application) routing, all relevant requests will be re-routed to the index page. Currently, for technical reasons, the Quinoa SPA routing configuration won't work with RESTEasy Classic. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_ENABLE_SPA_ROUTING+++[] endif::add-copy-button-to-env-var[] @@ -403,6 +457,8 @@ a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.ignored-p [.description] -- +List of path prefixes to be ignored by Quinoa. + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_IGNORED_PATH_PREFIXES+++[] endif::add-copy-button-to-env-var[] @@ -549,6 +605,23 @@ endif::add-copy-button-to-env-var[] |`false` +a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.dev-server.index-page]]`link:#quarkus-quinoa_quarkus.quinoa.dev-server.index-page[quarkus.quinoa.dev-server.index-page]` + + +[.description] +-- +Set this value if the index page is different for the dev-server + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_DEV_SERVER_INDEX_PAGE+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_QUINOA_DEV_SERVER_INDEX_PAGE+++` +endif::add-copy-button-to-env-var[] +--|string +|`auto-detected falling back to the quinoa.index-page` + + a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.install-env-install-env]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.install-env-install-env[quarkus.quinoa.package-manager-command.install-env]` @@ -566,6 +639,23 @@ endif::add-copy-button-to-env-var[] | +a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.ci-env-ci-env]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.ci-env-ci-env[quarkus.quinoa.package-manager-command.ci-env]` + + +[.description] +-- +Environment variables for ci command execution. + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_CI_ENV+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_QUINOA_PACKAGE_MANAGER_COMMAND_CI_ENV+++` +endif::add-copy-button-to-env-var[] +--|`Map` +| + + a|icon:lock[title=Fixed at build time] [[quarkus-quinoa_quarkus.quinoa.package-manager-command.build-env-build-env]]`link:#quarkus-quinoa_quarkus.quinoa.package-manager-command.build-env-build-env[quarkus.quinoa.package-manager-command.build-env]`