Skip to content

Commit f463e09

Browse files
committed
fix(ngc): work with typescript@next
This is required due to breaking change in TS, see microsoft/TypeScript#8841 (comment)
1 parent 42a5b6c commit f463e09

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

scripts/ci-lite/offline_compiler_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ cp -v package.json $TMP
3131
# TODO(alexeagle): allow this to be npm link instead
3232
npm install ${LINKABLE_PKGS[*]}
3333

34+
./node_modules/.bin/tsc --version
3435
# Compile the compiler-cli integration tests
3536
./node_modules/.bin/ngc
3637
./node_modules/.bin/ng-xi18n
3738

3839
./node_modules/.bin/jasmine init
3940
# Run compiler-cli integration tests in node
4041
./node_modules/.bin/jasmine test/*_spec.js
42+
43+
# Compile again with a differently named tsconfig file
44+
mv tsconfig.json othername.json
45+
./node_modules/.bin/ngc -p othername.json
4146
)

tools/@angular/tsc-wrapped/src/tsc.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ export class Tsc implements CompilerInterface {
5454
this.basePath = basePath;
5555

5656
// Allow a directory containing tsconfig.json as the project value
57+
// Note, TS@next returns an empty array, while earlier versions throw
5758
try {
58-
this.readDirectory(project);
59-
project = path.join(project, 'tsconfig.json');
59+
if (this.readDirectory(project).length > 0) {
60+
project = path.join(project, 'tsconfig.json');
61+
}
6062
} catch (e) {
6163
// Was not a directory, continue on assuming it's a file
6264
}

0 commit comments

Comments
 (0)