build: remove references to tsc-wrapped (#19298)

With this commit `ngc` is used instead of `tsc-wrapped` for
collecting metadata and tsickle rewriting and `tsc-wrapped`
is removed from the repository.

`@angular/tsc-wrapped@5` is now deprecated and is no longer
used, updated, or maintained as part as of Angular 5.x.x.

`@angular/tsc-wrapped@4` is still maintained and required by
Angular 4.x.x and will be maintained as long as 4.x.x is in
LTS.

PR Close #19298
This commit is contained in:
Chuck Jazdzewski
2017-09-20 09:54:47 -07:00
committed by Igor Minar
parent 4c73b52d5c
commit f96142cd7c
104 changed files with 336 additions and 6594 deletions

View File

@ -14,8 +14,7 @@ import 'reflect-metadata';
import * as path from 'path';
import * as ts from 'typescript';
import * as assert from 'assert';
import {tsc} from '@angular/tsc-wrapped/src/tsc';
import {__NGTOOLS_PRIVATE_API_2} from '@angular/compiler-cli';
import {__NGTOOLS_PRIVATE_API_2, readConfiguration} from '@angular/compiler-cli';
const glob = require('glob');
@ -50,14 +49,14 @@ function codeGenTest(forceError = false) {
const readResources: string[] = [];
const wroteFiles: string[] = [];
const config = tsc.readConfiguration(project, basePath);
const delegateHost = ts.createCompilerHost(config.parsed.options, true);
const config = readConfiguration(project);
const delegateHost = ts.createCompilerHost(config.options, true);
const host: ts.CompilerHost = Object.assign(
{}, delegateHost,
{writeFile: (fileName: string, ...rest: any[]) => { wroteFiles.push(fileName); }});
const program = ts.createProgram(config.parsed.fileNames, config.parsed.options, host);
const program = ts.createProgram(config.rootNames, config.options, host);
config.ngOptions.basePath = basePath;
config.options.basePath = basePath;
console.log(`>>> running codegen for ${project}`);
if (forceError) {
@ -66,9 +65,9 @@ function codeGenTest(forceError = false) {
return __NGTOOLS_PRIVATE_API_2
.codeGen({
basePath,
compilerOptions: config.parsed.options, program, host,
compilerOptions: config.options, program, host,
angularCompilerOptions: config.ngOptions,
angularCompilerOptions: config.options,
// i18n options.
i18nFormat: 'xlf',
@ -129,21 +128,21 @@ function i18nTest() {
const readResources: string[] = [];
const wroteFiles: string[] = [];
const config = tsc.readConfiguration(project, basePath);
const delegateHost = ts.createCompilerHost(config.parsed.options, true);
const config = readConfiguration(project);
const delegateHost = ts.createCompilerHost(config.options, true);
const host: ts.CompilerHost = Object.assign(
{}, delegateHost,
{writeFile: (fileName: string, ...rest: any[]) => { wroteFiles.push(fileName); }});
const program = ts.createProgram(config.parsed.fileNames, config.parsed.options, host);
const program = ts.createProgram(config.rootNames, config.options, host);
config.ngOptions.basePath = basePath;
config.options.basePath = basePath;
console.log(`>>> running i18n extraction for ${project}`);
return __NGTOOLS_PRIVATE_API_2
.extractI18n({
basePath,
compilerOptions: config.parsed.options, program, host,
angularCompilerOptions: config.ngOptions,
compilerOptions: config.options, program, host,
angularCompilerOptions: config.options,
i18nFormat: 'xlf',
locale: undefined,
outFile: undefined,
@ -193,18 +192,14 @@ function lazyRoutesTest() {
const basePath = path.join(__dirname, '../ngtools_src');
const project = path.join(basePath, 'tsconfig-build.json');
const config = tsc.readConfiguration(project, basePath);
const host = ts.createCompilerHost(config.parsed.options, true);
const program = ts.createProgram(config.parsed.fileNames, config.parsed.options, host);
const config = readConfiguration(project);
const host = ts.createCompilerHost(config.options, true);
const program = ts.createProgram(config.rootNames, config.options, host);
config.ngOptions.basePath = basePath;
config.options.basePath = basePath;
const lazyRoutes = __NGTOOLS_PRIVATE_API_2.listLazyRoutes({
program,
host,
angularCompilerOptions: config.ngOptions,
entryModule: 'app.module#AppModule'
});
const lazyRoutes = __NGTOOLS_PRIVATE_API_2.listLazyRoutes(
{program, host, angularCompilerOptions: config.options, entryModule: 'app.module#AppModule'});
const expectations: {[route: string]: string} = {
'./lazy.module#LazyModule': 'lazy.module.ts',