Skip to content
New issue

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

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

Already on GitHub? # to your account

test: Use project .npmrc for tests #3089

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Changes from all commits
Commits
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 @@ -41,21 +41,26 @@ public void setUpTaskApplication() throws IOException, URISyntaxException,
.resolve(getFrontendDirectory());
Files.createDirectories(frontendDir);

var packagesDirectory = Path
Path packagesPath = Path
.of(getClass().getClassLoader().getResource("").toURI())
.getParent() // target
.getParent() // engine-runtime
.getParent() // java
.getParent() // packages
.resolve("ts");
.getParent(); // packages

Path projectRoot = packagesPath.getParent();
Files.copy(projectRoot.resolve(".npmrc"),
temporaryDirectory.resolve(".npmrc"));
var tsPackagesDirectory = packagesPath.resolve("ts");

var shellCmd = FrontendUtils.isWindows() ? Stream.of("cmd.exe", "/c")
: Stream.<String> empty();

var npmCmd = Stream.of("npm", "--no-update-notifier", "--no-audit",
"install", "--no-save", "--install-links");

var generatorFiles = Files.list(packagesDirectory).map(Path::toString);
var generatorFiles = Files.list(tsPackagesDirectory)
.map(Path::toString);

var command = Stream.of(shellCmd, npmCmd, generatorFiles)
.flatMap(Function.identity()).toList();
Expand Down
Loading