Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCA11Y-1145: Support standard Node version files #3

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c57447e
DCA11Y-1145: Support standard files
atl-mk Jul 19, 2024
25a8b8e
DCA11Y-1145: Validate and fixup node versions
atl-mk Jul 21, 2024
adbc21b
DCA11Y-1145: Log where the version of Node was found
atl-mk Jul 21, 2024
f220262
DCA11Y-1145: Fix .tools-version filename
atl-mk Jul 21, 2024
8804ff5
DCA11Y-1145: Support node version file being specified
atl-mk Jul 21, 2024
a438004
DCA11Y-1145: Fix compiling node version file
atl-mk Jul 22, 2024
d5fa3cf
DCA11Y-1145: Fix name to 'tool versions' inline with the file
atl-mk Jul 24, 2024
3f9fb33
DCA11Y-1145: Add .tool-versions IT
atl-mk Jul 24, 2024
999f9b6
DCA11Y-1145: Add support for comments on the main line of .nvmrc like…
atl-mk Jul 24, 2024
9b07808
DCA11Y-1145: Add IT for .nvmrc files
atl-mk Jul 24, 2024
aff09fd
DCA11Y-1145: Fix nodeVersion being a readOnly property
atl-mk Jul 24, 2024
8e95116
DCA11Y-1145: Add empty line UT
atl-mk Jul 24, 2024
8f4da9b
DCA11Y-1145: Add specified version file IT
atl-mk Jul 24, 2024
9f84ec9
DCA11Y-1145: Use the working directory
atl-mk Jul 24, 2024
3c0ed88
DCA11Y-1145: Update the CHANGELOG
atl-mk Jul 24, 2024
44ef7af
DCA11Y-1145: Update the README.md with usage guidance
atl-mk Jul 24, 2024
d9f4116
DCA11Y-1145: Work around test runner setup
atl-mk Jul 24, 2024
589f352
DCA11Y-1145: Fix unreadable version file exception message to include…
atl-mk Sep 20, 2024
e14561f
DCA11Y-1145: Add support for mise config files
atl-mk Sep 20, 2024
a71d7f8
DCA11Y-1145: Add future code name releases
atl-mk Sep 20, 2024
13eb4d1
DCA11Y-1145: Comment reason for lowercasing the version
atl-mk Sep 20, 2024
710764d
DCA11Y-1145: Add handling of loosely-defined major versions
atl-mk Sep 27, 2024
a816c38
DCA11Y-1145: normalize printed paths
flipatlas Sep 30, 2024
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 @@ -3,7 +3,7 @@
import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory;
import com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionDetector;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper;
import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.lifecycle.LifecycleExecutionException;
Expand All @@ -14,7 +14,7 @@
import org.apache.maven.settings.Server;
import org.apache.maven.settings.crypto.SettingsDecrypter;

import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser.fixupMinorVersionErrors;
import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper.getDownloadableVersion;
import static java.util.Objects.isNull;

@Mojo(name="install-node-and-npm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
Expand Down Expand Up @@ -95,11 +95,11 @@ public void execute(FrontendPluginFactory factory) throws Exception {
throw new LifecycleExecutionException("Node version could not be detected from a file and was not set");
atl-mk marked this conversation as resolved.
Show resolved Hide resolved
}

if (!NodeVersionParser.validateVersion(nodeVersion)) {
if (!NodeVersionHelper.validateVersion(nodeVersion)) {
throw new LifecycleExecutionException("Node version (" + nodeVersion + ") is not valid. If you think it actually is, raise an issue");
}

String validNodeVersion = fixupMinorVersionErrors(nodeVersion);
String validNodeVersion = getDownloadableVersion(nodeVersion);

if (null != server) {
factory.getNodeInstaller(proxyConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionDetector;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper;
import com.github.eirslett.maven.plugins.frontend.lib.PnpmInstaller;
import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig;
import org.apache.maven.execution.MavenSession;
Expand All @@ -14,7 +14,7 @@
import org.apache.maven.settings.Server;
import org.apache.maven.settings.crypto.SettingsDecrypter;

import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser.fixupMinorVersionErrors;
import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper.getDownloadableVersion;
import static java.util.Objects.isNull;

@Mojo(name="install-node-and-pnpm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
Expand Down Expand Up @@ -101,11 +101,11 @@ public void execute(FrontendPluginFactory factory) throws Exception {
throw new LifecycleExecutionException("Node version could not be detected from a file and was not set");
}

if (!NodeVersionParser.validateVersion(nodeVersion)) {
if (!NodeVersionHelper.validateVersion(nodeVersion)) {
throw new LifecycleExecutionException("Node version (" + nodeVersion + ") is not valid. If you think it actually is, raise an issue");
}

String validNodeVersion = fixupMinorVersionErrors(nodeVersion);
String validNodeVersion = getDownloadableVersion(nodeVersion);

if (null != server) {
factory.getNodeInstaller(proxyConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionDetector;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser;
import com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper;
import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig;
import com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller;
import org.apache.maven.execution.MavenSession;
Expand All @@ -14,7 +14,7 @@
import org.apache.maven.settings.Server;
import org.apache.maven.settings.crypto.SettingsDecrypter;

import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionParser.fixupMinorVersionErrors;
import static com.github.eirslett.maven.plugins.frontend.lib.NodeVersionHelper.getDownloadableVersion;
import static com.github.eirslett.maven.plugins.frontend.mojo.YarnUtils.isYarnrcYamlFilePresent;
import static java.util.Objects.isNull;

Expand Down Expand Up @@ -89,11 +89,11 @@ public void execute(FrontendPluginFactory factory) throws Exception {
throw new LifecycleExecutionException("Node version could not be detected from a file and was not set");
}

if (!NodeVersionParser.validateVersion(nodeVersion)) {
if (!NodeVersionHelper.validateVersion(nodeVersion)) {
throw new LifecycleExecutionException("Node version (" + nodeVersion + ") is not valid. If you think it actually is, raise an issue");
}

String validNodeVersion = fixupMinorVersionErrors(nodeVersion);
String validNodeVersion = getDownloadableVersion(nodeVersion);

boolean isYarnYamlFilePresent = isYarnrcYamlFilePresent(this.session, this.workingDirectory);

Expand Down
Loading