Skip to content
Merged
Show file tree
Hide file tree
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 @@ -219,6 +219,7 @@ private void applyAngularVersion(String versionRange) {
private void addDependencies(SemVer angularVersion) {
if (additionalProperties.containsKey(NPM_NAME)) {
supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json"));
supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json"));
supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json"));
additionalProperties.put("zonejsVersion", "0.10.2");
additionalProperties.put("rxjsVersion", "6.6.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
],
"license": "Unlicense",
"scripts": {
"build": "ng-packagr -p package.json"
},
"ngPackage": {
"lib": {
"entryFile": "public_api.ts"
},
"dest": "{{{buildDist}}}"
"build": "ng-packagr -p ng-package.json"
},
"peerDependencies": {
"@angular/core": "^{{ngVersion}}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.backbase.oss.codegen.angular;

import java.util.Optional;
import java.util.stream.Collectors;
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -90,6 +92,22 @@ void generate(Combination param) {
assertThat(this.files.size(), not(equalTo(0)));
}

@Check
public void ngPackageConfig() throws IOException {
var ngPackageFiles = selectFiles("/ng-package\\.json$");
if (this.param.npmName) {
assertThat(ngPackageFiles, hasSize(1));
List<String> content;
try (var lines = Files.lines(Paths.get(ngPackageFiles.get(0)))) {
content = lines.collect(Collectors.toList());
}
var dist = Optional.ofNullable(this.param.buildDist).orElse("dist");
assertThat(content, hasItem(containsString("\"dest\": \"" + dist + "\"")));
} else {
assertThat(ngPackageFiles, hasSize(0));
}
}

@Check
public void npmName() {
assertThat(
Expand Down