Skip to content

Commit c5c32c5

Browse files
committed
feat: invoke ngc thru @angular/compiler-cli version 5.0.x
Fixes #219
1 parent 2c6db4f commit c5c32c5

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,18 @@
4949
"vinyl-fs": "^2.4.4"
5050
},
5151
"peerDependencies": {
52-
"@angular/tsc-wrapped": "~4.4.5",
52+
"@angular/compiler": "~5.0.0",
53+
"@angular/compiler-cli": "~5.0.0",
5354
"typescript": "~2.4.2"
5455
},
5556
"devDependencies": {
5657
"@angular/cdk": "~5.0.0-rc0",
5758
"@angular/common": "~5.0.0",
59+
"@angular/compiler": "~5.0.0",
60+
"@angular/compiler-cli": "~5.0.0",
5861
"@angular/core": "~5.0.0",
5962
"@angular/http": "~5.0.0",
6063
"@angular/platform-browser": "~5.0.0",
61-
"@angular/tsc-wrapped": "~4.4.5",
6264
"@commitlint/cli": "^4.0.0",
6365
"@commitlint/config-angular": "^4.2.0",
6466
"@types/chai": "^4.0.0",

src/lib/steps/ngc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { main as tsc, AngularCompilerOptions } from '@angular/tsc-wrapped';
2+
import { performCompilation, readConfiguration, AngularCompilerOptions } from '@angular/compiler-cli';
33
import { NgPackageData } from '../model/ng-package-data';
44
import { readJson, writeJson } from 'fs-extra';
55
import { debug } from '../util/log';
@@ -37,7 +37,10 @@ export async function ngc(ngPkg: NgPackageData, basePath: string): Promise<strin
3737
debug(`ngc ${tsConfigPath}, { basePath: ${basePath} })`);
3838

3939
await prepareTsConfig(ngPkg, tsConfigPath);
40-
await tsc(tsConfigPath, { basePath });
40+
41+
// invoke ngc programmatic API
42+
const compilerConfig = readConfiguration(tsConfigPath);
43+
performCompilation(compilerConfig);
4144

4245
debug('Reading tsconfig from ' + tsConfigPath);
4346
const tsConfig = await readJson(tsConfigPath);

yarn.lock

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414
dependencies:
1515
tslib "^1.7.1"
1616

17+
"@angular/compiler-cli@~5.0.0":
18+
version "5.0.1"
19+
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-5.0.1.tgz#526dc1bb394fb16ad916601eea9aa00eb44b4fff"
20+
dependencies:
21+
chokidar "^1.4.2"
22+
minimist "^1.2.0"
23+
reflect-metadata "^0.1.2"
24+
tsickle "^0.24.0"
25+
26+
"@angular/compiler@~5.0.0":
27+
version "5.0.1"
28+
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-5.0.1.tgz#7fd4c7fa4bbbef4c146962fa946b827330a6c8ed"
29+
dependencies:
30+
tslib "^1.7.1"
31+
1732
"@angular/core@~5.0.0":
1833
version "5.0.1"
1934
resolved "https://registry.yarnpkg.com/@angular/core/-/core-5.0.1.tgz#a4a74afc7e2058d30b8263eb6d66daace9f427ba"
@@ -32,12 +47,6 @@
3247
dependencies:
3348
tslib "^1.7.1"
3449

35-
"@angular/tsc-wrapped@~4.4.5":
36-
version "4.4.6"
37-
resolved "https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-4.4.6.tgz#16787cbbf50bdc7e738123b19c32527f244e178d"
38-
dependencies:
39-
tsickle "^0.21.0"
40-
4150
"@commitlint/cli@^4.0.0":
4251
version "4.2.1"
4352
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-4.2.1.tgz#5b1a99db20f54e3548d9f8ffbb722f8c7134a066"
@@ -537,7 +546,7 @@ check-error@^1.0.1:
537546
version "1.0.2"
538547
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
539548

540-
chokidar@^1.6.0:
549+
chokidar@^1.4.2, chokidar@^1.6.0:
541550
version "1.7.0"
542551
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
543552
dependencies:
@@ -2903,6 +2912,10 @@ redent@^1.0.0:
29032912
indent-string "^2.1.0"
29042913
strip-indent "^1.0.1"
29052914

2915+
reflect-metadata@^0.1.2:
2916+
version "0.1.10"
2917+
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"
2918+
29062919
regenerator-runtime@^0.10.5:
29072920
version "0.10.5"
29082921
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
@@ -3527,9 +3540,9 @@ tsconfig@^6.0.0:
35273540
strip-bom "^3.0.0"
35283541
strip-json-comments "^2.0.0"
35293542

3530-
tsickle@^0.21.0:
3531-
version "0.21.6"
3532-
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.21.6.tgz#53b01b979c5c13fdb13afb3fb958177e5991588d"
3543+
tsickle@^0.24.0:
3544+
version "0.24.1"
3545+
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.24.1.tgz#039343b205bf517a333b0703978892f80a7d848e"
35333546
dependencies:
35343547
minimist "^1.2.0"
35353548
mkdirp "^0.5.1"
@@ -3558,9 +3571,9 @@ typedarray@^0.0.6:
35583571
version "0.0.6"
35593572
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
35603573

3561-
typescript@~2.3.4:
3562-
version "2.3.4"
3563-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
3574+
typescript@~2.4.2:
3575+
version "2.4.2"
3576+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"
35643577

35653578
ua-parser-js@^0.7.9:
35663579
version "0.7.17"

0 commit comments

Comments
 (0)