forked from eirslett/frontend-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DCA11Y-1145: fail quickly when nvm can't fails, e.g. no versioning fi…
…le found
- Loading branch information
Showing
15 changed files
with
166 additions
and
35 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/.bash_profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FNM_DIR=$HOME/.fnm | ||
PATH=$FNM_DIR:$PATH | ||
eval "$(fnm env --use-on-cd --shell bash)" |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
9 changes: 9 additions & 0 deletions
9
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/install-fnm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# invoker env variables are not loaded yet | ||
export HOME="$(dirname "$0")" | ||
|
||
export FNM_DIR="$HOME/.fnm"; | ||
mkdir "$FNM_DIR" | ||
|
||
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$FNM_DIR" --skip-shell --force-install |
5 changes: 5 additions & 0 deletions
5
...tend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
invoker.buildResult=failure | ||
|
||
invoker.environmentVariables.HOME=${basedir}/target/it/node-version-manager/fnm/with-no-version-file | ||
invoker.environmentVariables.FNM_DIR=${basedir}/target/it/node-version-manager/fnm/with-no-version-file/.fnm | ||
invoker.environmentVariables.XDG_DATA_HOME=${basedir}/target/it/node-version-manager/fnm/with-no-version-file |
27 changes: 27 additions & 0 deletions
27
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "example", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"classnames": "^2.3.2" | ||
}, | ||
"scripts": { | ||
"prebuild": "npm install" | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>fnm-with-npm</artifactId> | ||
<version>0</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md --> | ||
<version>@project.version@</version> | ||
|
||
<configuration> | ||
<workingDirectory>${basedir}</workingDirectory> | ||
</configuration> | ||
|
||
<executions> | ||
<execution> | ||
<id>install node</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>npm ci</id> | ||
<goals> | ||
<goal>npm</goal> | ||
</goals> | ||
<!-- Optional configuration which provides for running any npm command --> | ||
<configuration> | ||
<arguments>ci</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
4 changes: 4 additions & 0 deletions
4
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/prebuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// TODO share installation as test utils https://maven.apache.org/plugins/maven-invoker-plugin/integration-test-mojo.html#addTestClassPath | ||
def p = "bash $basedir/install-fnm.sh".execute() | ||
p.waitFor() | ||
println p.text |
5 changes: 5 additions & 0 deletions
5
frontend-maven-plugin/src/it/node-version-manager/fnm/with-no-version-file/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import org.codehaus.plexus.util.FileUtils | ||
|
||
String buildLog = FileUtils.fileRead(new File(basedir, 'build.log')) | ||
assert buildLog.contains('Installing node with FNM') : 'Node has been installed with a different version manager' | ||
assert buildLog.contains('error: Can\'t find version in dotfiles. Please provide a version manually to the command.') : 'Node installation hasn\'t failed with a descriptive message' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters