@angular/compiler-cli 5.1.3 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ import * as path from 'path';
10
10
  import * as ts from 'typescript';
11
11
  import { CompilerHost, CompilerOptions, Program } from './api';
12
12
  export declare function createProgram({rootNames, options, host, oldProgram}: {
13
- rootNames: string[];
13
+ rootNames: ReadonlyArray<string>;
14
14
  options: CompilerOptions;
15
15
  host: CompilerHost;
16
16
  oldProgram?: Program;
@@ -34,10 +34,10 @@ var defaultEmitCallback = function (_a) {
34
34
  };
35
35
  var AngularCompilerProgram = /** @class */ (function () {
36
36
  function AngularCompilerProgram(rootNames, options, host, oldProgram) {
37
- this.rootNames = rootNames;
38
37
  this.options = options;
39
38
  this.host = host;
40
39
  this._optionsDiagnostics = [];
40
+ this.rootNames = rootNames.slice();
41
41
  var _a = ts.version.split('.'), major = _a[0], minor = _a[1];
42
42
  if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 4)) {
43
43
  throw new Error('The Angular Compiler requires TypeScript >= 2.4.');
@@ -49,7 +49,7 @@ var AngularCompilerProgram = /** @class */ (function () {
49
49
  this.oldProgramEmittedSourceFiles = oldProgram.getEmittedSourceFiles();
50
50
  }
51
51
  if (options.flatModuleOutFile) {
52
- var _b = index_1.createBundleIndexHost(options, rootNames, host), bundleHost = _b.host, indexName = _b.indexName, errors = _b.errors;
52
+ var _b = index_1.createBundleIndexHost(options, this.rootNames, host), bundleHost = _b.host, indexName = _b.indexName, errors = _b.errors;
53
53
  if (errors) {
54
54
  // TODO(tbosch): once we move MetadataBundler from tsc_wrapped into compiler_cli,
55
55
  // directly create ng.Diagnostic instead of using ts.Diagnostic here.
@@ -61,7 +61,7 @@ var AngularCompilerProgram = /** @class */ (function () {
61
61
  }); }));
62
62
  }
63
63
  else {
64
- rootNames.push(indexName);
64
+ this.rootNames.push(indexName);
65
65
  this.host = bundleHost;
66
66
  }
67
67
  }
@@ -253,6 +253,7 @@ var AngularCompilerProgram = /** @class */ (function () {
253
253
  // checks that TypeScript makes for project structure reuse will succeed.
254
254
  for (var _g = 0, _h = Array.from(augmentedReferences); _g < _h.length; _g++) {
255
255
  var _j = _h[_g], sourceFile = _j[0], references = _j[1];
256
+ // TODO(chuckj): Remove any cast after updating build to 2.6
256
257
  sourceFile.referencedFiles = references;
257
258
  }
258
259
  }
@@ -267,7 +268,8 @@ var AngularCompilerProgram = /** @class */ (function () {
267
268
  }
268
269
  if (!outSrcMapping.length) {
269
270
  // if no files were emitted by TypeScript, also don't emit .json files
270
- emitResult.diagnostics.push(util_1.createMessageDiagnostic("Emitted no files."));
271
+ emitResult.diagnostics =
272
+ emitResult.diagnostics.concat([util_1.createMessageDiagnostic("Emitted no files.")]);
271
273
  return emitResult;
272
274
  }
273
275
  var sampleSrcFileName;
@@ -299,12 +301,12 @@ var AngularCompilerProgram = /** @class */ (function () {
299
301
  }
300
302
  var emitEnd = Date.now();
301
303
  if (this.options.diagnostics) {
302
- emitResult.diagnostics.push(util_1.createMessageDiagnostic([
303
- "Emitted in " + (emitEnd - emitStart) + "ms",
304
- "- " + emittedUserTsCount + " user ts files",
305
- "- " + genTsFiles.length + " generated ts files",
306
- "- " + (genJsonFiles.length + metadataJsonCount) + " generated json files",
307
- ].join('\n')));
304
+ emitResult.diagnostics = emitResult.diagnostics.concat([util_1.createMessageDiagnostic([
305
+ "Emitted in " + (emitEnd - emitStart) + "ms",
306
+ "- " + emittedUserTsCount + " user ts files",
307
+ "- " + genTsFiles.length + " generated ts files",
308
+ "- " + (genJsonFiles.length + metadataJsonCount) + " generated json files",
309
+ ].join('\n'))]);
308
310
  }
309
311
  return emitResult;
310
312
  };
@@ -702,7 +704,7 @@ function i18nExtract(formatName, outFile, host, options, bundle) {
702
704
  var content = i18nSerialize(bundle, formatName, options);
703
705
  var dstFile = outFile || "messages." + ext;
704
706
  var dstPath = path.resolve(options.outDir || options.basePath, dstFile);
705
- host.writeFile(dstPath, content, false);
707
+ host.writeFile(dstPath, content, false, undefined, []);
706
708
  return [dstPath];
707
709
  }
708
710
  exports.i18nExtract = i18nExtract;
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/program.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAA0V;AAC1V,uBAAyB;AACzB,2BAA6B;AAC7B,+BAAiC;AAEjC,8EAAyF;AACzF,2CAAwE;AAExE,6BAAwN;AACxN,iDAAgH;AAChH,yDAA8F;AAC9F,mEAA2E;AAC3E,+BAAuI;AAGvI;;;GAGG;AACH,IAAM,mCAAmC,GAAG,EAAE,CAAC;AAE/C,IAAM,YAAY,GAAsB;IACtC,SAAS,EAAE,EAAE;IACb,yBAAyB,EAAE,IAAI,GAAG,EAAE;IACpC,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,IAAM,mBAAmB,GACrB,UAAC,EACoB;QADnB,oBAAO,EAAE,sCAAgB,EAAE,wBAAS,EAAE,wCAAiB,EAAE,sCAAgB,EACzE,0CAAkB;IAChB,OAAA,OAAO,CAAC,IAAI,CACR,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC;AADzF,CACyF,CAAC;AAElG;IAoBE,gCACY,SAAmB,EAAU,OAAwB,EAAU,IAAkB,EACzF,UAAoB;QADZ,cAAS,GAAT,SAAS,CAAU;QAAU,YAAO,GAAP,OAAO,CAAiB;QAAU,SAAI,GAAJ,IAAI,CAAc;QAHrF,wBAAmB,GAAiB,EAAE,CAAC;QAKvC,IAAA,0BAAsC,EAArC,aAAK,EAAE,aAAK,CAA0B;QAC7C,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,MAAM,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AC,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAa,UAAA,CAAC,IAAI,OAAA,CAAC;YACJ,WAAW,EAAE,CAAC,CAAC,iBAAiB,EAAE;YAClC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC;YACpC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;YAC/C,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;YACrC,MAAM,EAAE,YAAM;YACd,IAAI,EAAE,wBAAkB;SACzB,CAAC,EARG,CAQH,CAAC,CAAC;IAC1C,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,CAAC;gBACN,WAAW,EAAE,KAAK,CAAC,OAAO;gBAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,2CAA2C,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC9E,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;gBACrC,MAAM,EAAE,YAAM;gBACd,IAAI,EAAE,wBAAkB;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACzB,CAAC,CAAC;IACL,CAAC;IACD,8EAA8E;IAC9E,MAAM,CAAC,CAAC;YACN,WAAW,EAAE,KAAK,CAAC,OAAO;YAC1B,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;YACrC,IAAI,EAAE,wBAAkB;YACxB,MAAM,EAAE,YAAM;SACf,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AotCompiler, AotCompilerHost, AotCompilerOptions, EmitterVisitorContext, FormattedMessageChain, GeneratedFile, MessageBundle, NgAnalyzedFile, NgAnalyzedModules, ParseSourceSpan, Position, Serializer, TypeScriptEmitter, Xliff, Xliff2, Xmb, core, createAotCompiler, getParseErrors, isFormattedError, isSyntaxError} from '@angular/compiler';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost, translateDiagnostics} from '../diagnostics/translate_diagnostics';\nimport {ModuleMetadata, createBundleIndexHost} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, CustomTransformers, DEFAULT_ERROR_CODE, Diagnostic, DiagnosticMessageChain, EmitFlags, LazyRoute, LibrarySummary, Program, SOURCE, TsEmitArguments, TsEmitCallback} from './api';\nimport {CodeGenerator, TsCompilerAotCompilerTypeCheckHostAdapter, getOriginalReferences} from './compiler_host';\nimport {LowerMetadataCache, getExpressionLoweringTransformFactory} from './lower_expressions';\nimport {getAngularEmitterTransformFactory} from './node_emitter_transform';\nimport {GENERATED_FILES, StructureIsReused, createMessageDiagnostic, isInRootDir, ngToTsDiagnostic, tsStructureIsReused} from './util';\n\n\n/**\n * Maximum number of files that are emitable via calling ts.Program.emit\n * passing individual targetSourceFiles.\n */\nconst MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT = 20;\n\nconst emptyModules: NgAnalyzedModules = {\n ngModules: [],\n ngModuleByPipeOrDirective: new Map(),\n files: []\n};\n\nconst defaultEmitCallback: TsEmitCallback =\n ({program, targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles,\n customTransformers}) =>\n program.emit(\n targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);\n\nclass AngularCompilerProgram implements Program {\n private metadataCache: LowerMetadataCache;\n private oldProgramLibrarySummaries: Map<string, LibrarySummary>|undefined;\n private oldProgramEmittedGeneratedFiles: Map<string, GeneratedFile>|undefined;\n private oldProgramEmittedSourceFiles: Map<string, ts.SourceFile>|undefined;\n // Note: This will be cleared out as soon as we create the _tsProgram\n private oldTsProgram: ts.Program|undefined;\n private emittedLibrarySummaries: LibrarySummary[]|undefined;\n private emittedGeneratedFiles: GeneratedFile[]|undefined;\n private emittedSourceFiles: ts.SourceFile[]|undefined;\n\n // Lazily initialized fields\n private _compiler: AotCompiler;\n private _hostAdapter: TsCompilerAotCompilerTypeCheckHostAdapter;\n private _tsProgram: ts.Program;\n private _analyzedModules: NgAnalyzedModules|undefined;\n private _structuralDiagnostics: Diagnostic[]|undefined;\n private _programWithStubs: ts.Program|undefined;\n private _optionsDiagnostics: Diagnostic[] = [];\n\n constructor(\n private rootNames: string[], private options: CompilerOptions, private host: CompilerHost,\n oldProgram?: Program) {\n const [major, minor] = ts.version.split('.');\n if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 4)) {\n throw new Error('The Angular Compiler requires TypeScript >= 2.4.');\n }\n this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined;\n if (oldProgram) {\n this.oldProgramLibrarySummaries = oldProgram.getLibrarySummaries();\n this.oldProgramEmittedGeneratedFiles = oldProgram.getEmittedGeneratedFiles();\n this.oldProgramEmittedSourceFiles = oldProgram.getEmittedSourceFiles();\n }\n\n if (options.flatModuleOutFile) {\n const {host: bundleHost, indexName, errors} = createBundleIndexHost(options, rootNames, host);\n if (errors) {\n // TODO(tbosch): once we move MetadataBundler from tsc_wrapped into compiler_cli,\n // directly create ng.Diagnostic instead of using ts.Diagnostic here.\n this._optionsDiagnostics.push(...errors.map(e => ({\n category: e.category,\n messageText: e.messageText as string,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n })));\n } else {\n rootNames.push(indexName !);\n this.host = bundleHost;\n }\n }\n this.metadataCache = new LowerMetadataCache({quotedNames: true}, !!options.strictMetadataEmit);\n }\n\n getLibrarySummaries(): Map<string, LibrarySummary> {\n const result = new Map<string, LibrarySummary>();\n if (this.oldProgramLibrarySummaries) {\n this.oldProgramLibrarySummaries.forEach((summary, fileName) => result.set(fileName, summary));\n }\n if (this.emittedLibrarySummaries) {\n this.emittedLibrarySummaries.forEach(\n (summary, fileName) => result.set(summary.fileName, summary));\n }\n return result;\n }\n\n getEmittedGeneratedFiles(): Map<string, GeneratedFile> {\n const result = new Map<string, GeneratedFile>();\n if (this.oldProgramEmittedGeneratedFiles) {\n this.oldProgramEmittedGeneratedFiles.forEach(\n (genFile, fileName) => result.set(fileName, genFile));\n }\n if (this.emittedGeneratedFiles) {\n this.emittedGeneratedFiles.forEach((genFile) => result.set(genFile.genFileUrl, genFile));\n }\n return result;\n }\n\n getEmittedSourceFiles(): Map<string, ts.SourceFile> {\n const result = new Map<string, ts.SourceFile>();\n if (this.oldProgramEmittedSourceFiles) {\n this.oldProgramEmittedSourceFiles.forEach((sf, fileName) => result.set(fileName, sf));\n }\n if (this.emittedSourceFiles) {\n this.emittedSourceFiles.forEach((sf) => result.set(sf.fileName, sf));\n }\n return result;\n }\n\n getTsProgram(): ts.Program { return this.tsProgram; }\n\n getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken) {\n return this.tsProgram.getOptionsDiagnostics(cancellationToken);\n }\n\n getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken): Diagnostic[] {\n return [...this._optionsDiagnostics, ...getNgOptionDiagnostics(this.options)];\n }\n\n getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ts.Diagnostic[] {\n return this.tsProgram.getSyntacticDiagnostics(sourceFile, cancellationToken);\n }\n\n getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken): Diagnostic[] {\n return this.structuralDiagnostics;\n }\n\n getTsSemanticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ts.Diagnostic[] {\n const sourceFiles = sourceFile ? [sourceFile] : this.tsProgram.getSourceFiles();\n let diags: ts.Diagnostic[] = [];\n sourceFiles.forEach(sf => {\n if (!GENERATED_FILES.test(sf.fileName)) {\n diags.push(...this.tsProgram.getSemanticDiagnostics(sf, cancellationToken));\n }\n });\n return diags;\n }\n\n getNgSemanticDiagnostics(fileName?: string, cancellationToken?: ts.CancellationToken):\n Diagnostic[] {\n let diags: ts.Diagnostic[] = [];\n this.tsProgram.getSourceFiles().forEach(sf => {\n if (GENERATED_FILES.test(sf.fileName) && !sf.isDeclarationFile) {\n diags.push(...this.tsProgram.getSemanticDiagnostics(sf, cancellationToken));\n }\n });\n const {ng} = translateDiagnostics(this.hostAdapter, diags);\n return ng;\n }\n\n loadNgStructureAsync(): Promise<void> {\n if (this._analyzedModules) {\n throw new Error('Angular structure already loaded');\n }\n return Promise.resolve()\n .then(() => {\n const {tmpProgram, sourceFiles, rootNames} = this._createProgramWithBasicStubs();\n return this.compiler.loadFilesAsync(sourceFiles).then(analyzedModules => {\n if (this._analyzedModules) {\n throw new Error('Angular structure loaded both synchronously and asynchronsly');\n }\n this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, rootNames);\n });\n })\n .catch(e => this._createProgramOnError(e));\n }\n\n listLazyRoutes(route?: string): LazyRoute[] {\n // Note: Don't analyzedModules if a route is given\n // to be fast enough.\n return this.compiler.listLazyRoutes(route, route ? undefined : this.analyzedModules);\n }\n\n emit(\n {emitFlags = EmitFlags.Default, cancellationToken, customTransformers,\n emitCallback = defaultEmitCallback}: {\n emitFlags?: EmitFlags,\n cancellationToken?: ts.CancellationToken,\n customTransformers?: CustomTransformers,\n emitCallback?: TsEmitCallback\n } = {}): ts.EmitResult {\n const emitStart = Date.now();\n if (emitFlags & EmitFlags.I18nBundle) {\n const locale = this.options.i18nOutLocale || null;\n const file = this.options.i18nOutFile || null;\n const format = this.options.i18nOutFormat || null;\n const bundle = this.compiler.emitMessageBundle(this.analyzedModules, locale);\n i18nExtract(format, file, this.host, this.options, bundle);\n }\n if ((emitFlags & (EmitFlags.JS | EmitFlags.DTS | EmitFlags.Metadata | EmitFlags.Codegen)) ===\n 0) {\n return {emitSkipped: true, diagnostics: [], emittedFiles: []};\n }\n let {genFiles, genDiags} = this.generateFilesForEmit(emitFlags);\n if (genDiags.length) {\n return {\n diagnostics: genDiags,\n emitSkipped: true,\n emittedFiles: [],\n };\n }\n this.emittedGeneratedFiles = genFiles;\n const outSrcMapping: Array<{sourceFile: ts.SourceFile, outFileName: string}> = [];\n const genFileByFileName = new Map<string, GeneratedFile>();\n genFiles.forEach(genFile => genFileByFileName.set(genFile.genFileUrl, genFile));\n this.emittedLibrarySummaries = [];\n const emittedSourceFiles = [] as ts.SourceFile[];\n const writeTsFile: ts.WriteFileCallback =\n (outFileName, outData, writeByteOrderMark, onError?, sourceFiles?) => {\n const sourceFile = sourceFiles && sourceFiles.length == 1 ? sourceFiles[0] : null;\n let genFile: GeneratedFile|undefined;\n if (sourceFile) {\n outSrcMapping.push({outFileName: outFileName, sourceFile});\n genFile = genFileByFileName.get(sourceFile.fileName);\n if (!sourceFile.isDeclarationFile && !GENERATED_FILES.test(sourceFile.fileName)) {\n // Note: sourceFile is the transformed sourcefile, not the original one!\n emittedSourceFiles.push(this.tsProgram.getSourceFile(sourceFile.fileName));\n }\n }\n this.writeFile(outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles);\n };\n const tsCustomTansformers = this.calculateTransforms(genFileByFileName, customTransformers);\n const emitOnlyDtsFiles = (emitFlags & (EmitFlags.DTS | EmitFlags.JS)) == EmitFlags.DTS;\n // Restore the original references before we emit so TypeScript doesn't emit\n // a reference to the .d.ts file.\n const augmentedReferences = new Map<ts.SourceFile, ts.FileReference[]>();\n for (const sourceFile of this.tsProgram.getSourceFiles()) {\n const originalReferences = getOriginalReferences(sourceFile);\n if (originalReferences) {\n augmentedReferences.set(sourceFile, sourceFile.referencedFiles);\n sourceFile.referencedFiles = originalReferences;\n }\n }\n const genTsFiles: GeneratedFile[] = [];\n const genJsonFiles: GeneratedFile[] = [];\n genFiles.forEach(gf => {\n if (gf.stmts) {\n genTsFiles.push(gf);\n }\n if (gf.source) {\n genJsonFiles.push(gf);\n }\n });\n let emitResult: ts.EmitResult;\n let emittedUserTsCount: number;\n try {\n const sourceFilesToEmit = this.getSourceFilesForEmit();\n if (sourceFilesToEmit &&\n (sourceFilesToEmit.length + genTsFiles.length) < MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT) {\n const fileNamesToEmit =\n [...sourceFilesToEmit.map(sf => sf.fileName), ...genTsFiles.map(gf => gf.genFileUrl)];\n emitResult = mergeEmitResults(\n fileNamesToEmit.map((fileName) => emitResult = emitCallback({\n program: this.tsProgram,\n host: this.host,\n options: this.options,\n writeFile: writeTsFile, emitOnlyDtsFiles,\n customTransformers: tsCustomTansformers,\n targetSourceFile: this.tsProgram.getSourceFile(fileName),\n })));\n emittedUserTsCount = sourceFilesToEmit.length;\n } else {\n emitResult = emitCallback({\n program: this.tsProgram,\n host: this.host,\n options: this.options,\n writeFile: writeTsFile, emitOnlyDtsFiles,\n customTransformers: tsCustomTansformers\n });\n emittedUserTsCount = this.tsProgram.getSourceFiles().length - genTsFiles.length;\n }\n } finally {\n // Restore the references back to the augmented value to ensure that the\n // checks that TypeScript makes for project structure reuse will succeed.\n for (const [sourceFile, references] of Array.from(augmentedReferences)) {\n sourceFile.referencedFiles = references;\n }\n }\n this.emittedSourceFiles = emittedSourceFiles;\n\n // Match behavior of tsc: only produce emit diagnostics if it would block\n // emit. If noEmitOnError is false, the emit will happen in spite of any\n // errors, so we should not report them.\n if (this.options.noEmitOnError === true) {\n // translate the diagnostics in the emitResult as well.\n const translatedEmitDiags = translateDiagnostics(this.hostAdapter, emitResult.diagnostics);\n emitResult.diagnostics = translatedEmitDiags.ts.concat(\n this.structuralDiagnostics.concat(translatedEmitDiags.ng).map(ngToTsDiagnostic));\n }\n\n if (!outSrcMapping.length) {\n // if no files were emitted by TypeScript, also don't emit .json files\n emitResult.diagnostics.push(createMessageDiagnostic(`Emitted no files.`));\n return emitResult;\n }\n\n let sampleSrcFileName: string|undefined;\n let sampleOutFileName: string|undefined;\n if (outSrcMapping.length) {\n sampleSrcFileName = outSrcMapping[0].sourceFile.fileName;\n sampleOutFileName = outSrcMapping[0].outFileName;\n }\n const srcToOutPath =\n createSrcToOutPathMapper(this.options.outDir, sampleSrcFileName, sampleOutFileName);\n if (emitFlags & EmitFlags.Codegen) {\n genJsonFiles.forEach(gf => {\n const outFileName = srcToOutPath(gf.genFileUrl);\n this.writeFile(outFileName, gf.source !, false, undefined, gf);\n });\n }\n let metadataJsonCount = 0;\n if (emitFlags & EmitFlags.Metadata) {\n this.tsProgram.getSourceFiles().forEach(sf => {\n if (!sf.isDeclarationFile && !GENERATED_FILES.test(sf.fileName)) {\n metadataJsonCount++;\n const metadata = this.metadataCache.getMetadata(sf);\n if (metadata) {\n const metadataText = JSON.stringify([metadata]);\n const outFileName = srcToOutPath(sf.fileName.replace(/\\.tsx?$/, '.metadata.json'));\n this.writeFile(outFileName, metadataText, false, undefined, undefined, [sf]);\n }\n }\n });\n }\n const emitEnd = Date.now();\n if (this.options.diagnostics) {\n emitResult.diagnostics.push(createMessageDiagnostic([\n `Emitted in ${emitEnd - emitStart}ms`,\n `- ${emittedUserTsCount} user ts files`,\n `- ${genTsFiles.length} generated ts files`,\n `- ${genJsonFiles.length + metadataJsonCount} generated json files`,\n ].join('\\n')));\n }\n return emitResult;\n }\n\n // Private members\n private get compiler(): AotCompiler {\n if (!this._compiler) {\n this._createCompiler();\n }\n return this._compiler !;\n }\n\n private get hostAdapter(): TsCompilerAotCompilerTypeCheckHostAdapter {\n if (!this._hostAdapter) {\n this._createCompiler();\n }\n return this._hostAdapter !;\n }\n\n private get analyzedModules(): NgAnalyzedModules {\n if (!this._analyzedModules) {\n this.initSync();\n }\n return this._analyzedModules !;\n }\n\n private get structuralDiagnostics(): Diagnostic[] {\n let diagnostics = this._structuralDiagnostics;\n if (!diagnostics) {\n this.initSync();\n diagnostics = (this._structuralDiagnostics = this._structuralDiagnostics || []);\n }\n return diagnostics;\n }\n\n private get tsProgram(): ts.Program {\n if (!this._tsProgram) {\n this.initSync();\n }\n return this._tsProgram !;\n }\n\n private calculateTransforms(\n genFiles: Map<string, GeneratedFile>,\n customTransformers?: CustomTransformers): ts.CustomTransformers {\n const beforeTs: ts.TransformerFactory<ts.SourceFile>[] = [];\n if (!this.options.disableExpressionLowering) {\n beforeTs.push(getExpressionLoweringTransformFactory(this.metadataCache, this.tsProgram));\n }\n beforeTs.push(getAngularEmitterTransformFactory(genFiles, this.getTsProgram()));\n if (customTransformers && customTransformers.beforeTs) {\n beforeTs.push(...customTransformers.beforeTs);\n }\n const afterTs = customTransformers ? customTransformers.afterTs : undefined;\n return {before: beforeTs, after: afterTs};\n }\n\n private initSync() {\n if (this._analyzedModules) {\n return;\n }\n try {\n const {tmpProgram, sourceFiles, rootNames} = this._createProgramWithBasicStubs();\n const analyzedModules = this.compiler.loadFilesSync(sourceFiles);\n this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, rootNames);\n } catch (e) {\n this._createProgramOnError(e);\n }\n }\n\n private _createCompiler() {\n const codegen: CodeGenerator = {\n generateFile: (genFileName, baseFileName) =>\n this._compiler.emitBasicStub(genFileName, baseFileName),\n findGeneratedFileNames: (fileName) => this._compiler.findGeneratedFileNames(fileName),\n };\n\n this._hostAdapter = new TsCompilerAotCompilerTypeCheckHostAdapter(\n this.rootNames, this.options, this.host, this.metadataCache, codegen,\n this.oldProgramLibrarySummaries);\n const aotOptions = getAotCompilerOptions(this.options);\n const errorCollector = (this.options.collectAllErrors || this.options.fullTemplateTypeCheck) ?\n (err: any) => this._addStructuralDiagnostics(err) :\n undefined;\n this._compiler = createAotCompiler(this._hostAdapter, aotOptions, errorCollector).compiler;\n }\n\n private _createProgramWithBasicStubs(): {\n tmpProgram: ts.Program,\n rootNames: string[],\n sourceFiles: string[],\n } {\n if (this._analyzedModules) {\n throw new Error(`Internal Error: already initalized!`);\n }\n // Note: This is important to not produce a memory leak!\n const oldTsProgram = this.oldTsProgram;\n this.oldTsProgram = undefined;\n\n const codegen: CodeGenerator = {\n generateFile: (genFileName, baseFileName) =>\n this.compiler.emitBasicStub(genFileName, baseFileName),\n findGeneratedFileNames: (fileName) => this.compiler.findGeneratedFileNames(fileName),\n };\n\n\n let rootNames = [...this.rootNames];\n if (this.options.generateCodeForLibraries !== false) {\n // if we should generateCodeForLibraries, never include\n // generated files in the program as otherwise we will\n // ovewrite them and typescript will report the error\n // TS5055: Cannot write file ... because it would overwrite input file.\n rootNames = rootNames.filter(fn => !GENERATED_FILES.test(fn));\n }\n if (this.options.noResolve) {\n this.rootNames.forEach(rootName => {\n if (this.hostAdapter.shouldGenerateFilesFor(rootName)) {\n rootNames.push(...this.compiler.findGeneratedFileNames(rootName));\n }\n });\n }\n\n const tmpProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram);\n const sourceFiles: string[] = [];\n tmpProgram.getSourceFiles().forEach(sf => {\n if (this.hostAdapter.isSourceFile(sf.fileName)) {\n sourceFiles.push(sf.fileName);\n }\n });\n return {tmpProgram, sourceFiles, rootNames};\n }\n\n private _updateProgramWithTypeCheckStubs(\n tmpProgram: ts.Program, analyzedModules: NgAnalyzedModules, rootNames: string[]) {\n this._analyzedModules = analyzedModules;\n tmpProgram.getSourceFiles().forEach(sf => {\n if (sf.fileName.endsWith('.ngfactory.ts')) {\n const {generate, baseFileName} = this.hostAdapter.shouldGenerateFile(sf.fileName);\n if (generate) {\n // Note: ! is ok as hostAdapter.shouldGenerateFile will always return a basefileName\n // for .ngfactory.ts files.\n const genFile = this.compiler.emitTypeCheckStub(sf.fileName, baseFileName !);\n if (genFile) {\n this.hostAdapter.updateGeneratedFile(genFile);\n }\n }\n }\n });\n this._tsProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, tmpProgram);\n // Note: the new ts program should be completely reusable by TypeScript as:\n // - we cache all the files in the hostAdapter\n // - new new stubs use the exactly same imports/exports as the old once (we assert that in\n // hostAdapter.updateGeneratedFile).\n if (tsStructureIsReused(tmpProgram) !== StructureIsReused.Completely) {\n throw new Error(`Internal Error: The structure of the program changed during codegen.`);\n }\n }\n\n private _createProgramOnError(e: any) {\n // Still fill the analyzedModules and the tsProgram\n // so that we don't cause other errors for users who e.g. want to emit the ngProgram.\n this._analyzedModules = emptyModules;\n this.oldTsProgram = undefined;\n this._hostAdapter.isSourceFile = () => false;\n this._tsProgram = ts.createProgram(this.rootNames, this.options, this.hostAdapter);\n if (isSyntaxError(e)) {\n this._addStructuralDiagnostics(e);\n return;\n }\n throw e;\n }\n\n private _addStructuralDiagnostics(error: Error) {\n const diagnostics = this._structuralDiagnostics || (this._structuralDiagnostics = []);\n if (isSyntaxError(error)) {\n diagnostics.push(...syntaxErrorToDiagnostics(error));\n } else {\n diagnostics.push({\n messageText: error.toString(),\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n });\n }\n }\n\n // Note: this returns a ts.Diagnostic so that we\n // can return errors in a ts.EmitResult\n private generateFilesForEmit(emitFlags: EmitFlags):\n {genFiles: GeneratedFile[], genDiags: ts.Diagnostic[]} {\n try {\n if (!(emitFlags & EmitFlags.Codegen)) {\n return {genFiles: [], genDiags: []};\n }\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n let genFiles = this.compiler.emitAllImpls(this.analyzedModules)\n .filter(genFile => isInRootDir(genFile.genFileUrl, this.options));\n if (this.oldProgramEmittedGeneratedFiles) {\n const oldProgramEmittedGeneratedFiles = this.oldProgramEmittedGeneratedFiles;\n genFiles = genFiles.filter(genFile => {\n const oldGenFile = oldProgramEmittedGeneratedFiles.get(genFile.genFileUrl);\n return !oldGenFile || !genFile.isEquivalent(oldGenFile);\n });\n }\n return {genFiles, genDiags: []};\n } catch (e) {\n // TODO(tbosch): check whether we can actually have syntax errors here,\n // as we already parsed the metadata and templates before to create the type check block.\n if (isSyntaxError(e)) {\n const genDiags: ts.Diagnostic[] = [{\n file: undefined,\n start: undefined,\n length: undefined,\n messageText: e.message,\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }];\n return {genFiles: [], genDiags};\n }\n throw e;\n }\n }\n\n /**\n * Returns undefined if all files should be emitted.\n */\n private getSourceFilesForEmit(): ts.SourceFile[]|undefined {\n // TODO(tbosch): if one of the files contains a `const enum`\n // always emit all files -> return undefined!\n let sourceFilesToEmit: ts.SourceFile[]|undefined;\n if (this.oldProgramEmittedSourceFiles) {\n sourceFilesToEmit = this.tsProgram.getSourceFiles().filter(sf => {\n const oldFile = this.oldProgramEmittedSourceFiles !.get(sf.fileName);\n return !sf.isDeclarationFile && !GENERATED_FILES.test(sf.fileName) && sf !== oldFile;\n });\n }\n return sourceFilesToEmit;\n }\n\n private writeFile(\n outFileName: string, outData: string, writeByteOrderMark: boolean,\n onError?: (message: string) => void, genFile?: GeneratedFile,\n sourceFiles?: ReadonlyArray<ts.SourceFile>) {\n // collect emittedLibrarySummaries\n let baseFile: ts.SourceFile|undefined;\n if (genFile) {\n baseFile = this.tsProgram.getSourceFile(genFile.srcFileUrl);\n if (baseFile) {\n if (!this.emittedLibrarySummaries) {\n this.emittedLibrarySummaries = [];\n }\n if (genFile.genFileUrl.endsWith('.ngsummary.json') && baseFile.fileName.endsWith('.d.ts')) {\n this.emittedLibrarySummaries.push({\n fileName: baseFile.fileName,\n text: baseFile.text,\n sourceFile: baseFile,\n });\n this.emittedLibrarySummaries.push({fileName: genFile.genFileUrl, text: outData});\n if (!this.options.declaration) {\n // If we don't emit declarations, still record an empty .ngfactory.d.ts file,\n // as we might need it lateron for resolving module names from summaries.\n const ngFactoryDts =\n genFile.genFileUrl.substring(0, genFile.genFileUrl.length - 15) + '.ngfactory.d.ts';\n this.emittedLibrarySummaries.push({fileName: ngFactoryDts, text: ''});\n }\n } else if (outFileName.endsWith('.d.ts') && baseFile.fileName.endsWith('.d.ts')) {\n const dtsSourceFilePath = genFile.genFileUrl.replace(/\\.ts$/, '.d.ts');\n // Note: Don't use sourceFiles here as the created .d.ts has a path in the outDir,\n // but we need one that is next to the .ts file\n this.emittedLibrarySummaries.push({fileName: dtsSourceFilePath, text: outData});\n }\n }\n }\n // Filter out generated files for which we didn't generate code.\n // This can happen as the stub caclulation is not completely exact.\n // Note: sourceFile refers to the .ngfactory.ts / .ngsummary.ts file\n // node_emitter_transform already set the file contents to be empty,\n // so this code only needs to skip the file if !allowEmptyCodegenFiles.\n const isGenerated = GENERATED_FILES.test(outFileName);\n if (isGenerated && !this.options.allowEmptyCodegenFiles &&\n (!genFile || !genFile.stmts || genFile.stmts.length === 0)) {\n return;\n }\n if (baseFile) {\n sourceFiles = sourceFiles ? [...sourceFiles, baseFile] : [baseFile];\n }\n // TODO: remove any when TS 2.4 support is removed.\n this.host.writeFile(outFileName, outData, writeByteOrderMark, onError, sourceFiles as any);\n }\n}\n\nexport function createProgram(\n {rootNames, options, host, oldProgram}:\n {rootNames: string[], options: CompilerOptions, host: CompilerHost, oldProgram?: Program}):\n Program {\n return new AngularCompilerProgram(rootNames, options, host, oldProgram);\n}\n\n// Compute the AotCompiler options\nfunction getAotCompilerOptions(options: CompilerOptions): AotCompilerOptions {\n let missingTranslation = core.MissingTranslationStrategy.Warning;\n\n switch (options.i18nInMissingTranslations) {\n case 'ignore':\n missingTranslation = core.MissingTranslationStrategy.Ignore;\n break;\n case 'error':\n missingTranslation = core.MissingTranslationStrategy.Error;\n break;\n }\n\n let translations: string = '';\n\n if (options.i18nInFile) {\n if (!options.i18nInLocale) {\n throw new Error(`The translation file (${options.i18nInFile}) locale must be provided.`);\n }\n translations = fs.readFileSync(options.i18nInFile, 'utf8');\n } else {\n // No translations are provided, ignore any errors\n // We still go through i18n to remove i18n attributes\n missingTranslation = core.MissingTranslationStrategy.Ignore;\n }\n\n return {\n locale: options.i18nInLocale,\n i18nFormat: options.i18nInFormat || options.i18nOutFormat, translations, missingTranslation,\n enableLegacyTemplate: options.enableLegacyTemplate,\n enableSummariesForJit: options.enableSummariesForJit,\n preserveWhitespaces: options.preserveWhitespaces,\n fullTemplateTypeCheck: options.fullTemplateTypeCheck,\n allowEmptyCodegenFiles: options.allowEmptyCodegenFiles,\n };\n}\n\nfunction getNgOptionDiagnostics(options: CompilerOptions): Diagnostic[] {\n if (options.annotationsAs) {\n switch (options.annotationsAs) {\n case 'decorators':\n case 'static fields':\n break;\n default:\n return [{\n messageText:\n 'Angular compiler options \"annotationsAs\" only supports \"static fields\" and \"decorators\"',\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }];\n }\n }\n return [];\n}\n\nfunction normalizeSeparators(path: string): string {\n return path.replace(/\\\\/g, '/');\n}\n\n/**\n * Returns a function that can adjust a path from source path to out path,\n * based on an existing mapping from source to out path.\n *\n * TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir`\n * if none was specified.\n *\n * Note: This function works on normalized paths from typescript.\n *\n * @param outDir\n * @param outSrcMappings\n */\nexport function createSrcToOutPathMapper(\n outDir: string | undefined, sampleSrcFileName: string | undefined,\n sampleOutFileName: string | undefined, host: {\n dirname: typeof path.dirname,\n resolve: typeof path.resolve,\n relative: typeof path.relative\n } = path): (srcFileName: string) => string {\n let srcToOutPath: (srcFileName: string) => string;\n if (outDir) {\n let path: {} = {}; // Ensure we error if we use `path` instead of `host`.\n if (sampleSrcFileName == null || sampleOutFileName == null) {\n throw new Error(`Can't calculate the rootDir without a sample srcFileName / outFileName. `);\n }\n const srcFileDir = normalizeSeparators(host.dirname(sampleSrcFileName));\n const outFileDir = normalizeSeparators(host.dirname(sampleOutFileName));\n if (srcFileDir === outFileDir) {\n return (srcFileName) => srcFileName;\n }\n // calculate the common suffix, stopping\n // at `outDir`.\n const srcDirParts = srcFileDir.split('/');\n const outDirParts = normalizeSeparators(host.relative(outDir, outFileDir)).split('/');\n let i = 0;\n while (i < Math.min(srcDirParts.length, outDirParts.length) &&\n srcDirParts[srcDirParts.length - 1 - i] === outDirParts[outDirParts.length - 1 - i])\n i++;\n const rootDir = srcDirParts.slice(0, srcDirParts.length - i).join('/');\n srcToOutPath = (srcFileName) => host.resolve(outDir, host.relative(rootDir, srcFileName));\n } else {\n srcToOutPath = (srcFileName) => srcFileName;\n }\n return srcToOutPath;\n}\n\nexport function i18nExtract(\n formatName: string | null, outFile: string | null, host: ts.CompilerHost,\n options: CompilerOptions, bundle: MessageBundle): string[] {\n formatName = formatName || 'xlf';\n // Checks the format and returns the extension\n const ext = i18nGetExtension(formatName);\n const content = i18nSerialize(bundle, formatName, options);\n const dstFile = outFile || `messages.${ext}`;\n const dstPath = path.resolve(options.outDir || options.basePath, dstFile);\n host.writeFile(dstPath, content, false);\n return [dstPath];\n}\n\nexport function i18nSerialize(\n bundle: MessageBundle, formatName: string, options: CompilerOptions): string {\n const format = formatName.toLowerCase();\n let serializer: Serializer;\n\n switch (format) {\n case 'xmb':\n serializer = new Xmb();\n break;\n case 'xliff2':\n case 'xlf2':\n serializer = new Xliff2();\n break;\n case 'xlf':\n case 'xliff':\n default:\n serializer = new Xliff();\n }\n\n return bundle.write(serializer, getPathNormalizer(options.basePath));\n}\n\nfunction getPathNormalizer(basePath?: string) {\n // normalize sourcepaths by removing the base path and always using \"/\" as a separator\n return (sourcePath: string) => {\n sourcePath = basePath ? path.relative(basePath, sourcePath) : sourcePath;\n return sourcePath.split(path.sep).join('/');\n };\n}\n\nexport function i18nGetExtension(formatName: string): string {\n const format = formatName.toLowerCase();\n\n switch (format) {\n case 'xmb':\n return 'xmb';\n case 'xlf':\n case 'xlif':\n case 'xliff':\n case 'xlf2':\n case 'xliff2':\n return 'xlf';\n }\n\n throw new Error(`Unsupported format \"${formatName}\"`);\n}\n\nfunction mergeEmitResults(emitResults: ts.EmitResult[]): ts.EmitResult {\n const diagnostics: ts.Diagnostic[] = [];\n let emitSkipped = false;\n const emittedFiles: string[] = [];\n for (const er of emitResults) {\n diagnostics.push(...er.diagnostics);\n emitSkipped = emitSkipped || er.emitSkipped;\n emittedFiles.push(...er.emittedFiles);\n }\n return {diagnostics, emitSkipped, emittedFiles};\n}\n\nfunction diagnosticSourceOfSpan(span: ParseSourceSpan): ts.SourceFile {\n // For diagnostics, TypeScript only uses the fileName and text properties.\n // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.\n return ({ fileName: span.start.file.url, text: span.start.file.content } as any);\n}\n\nfunction diagnosticSourceOfFileName(fileName: string, program: ts.Program): ts.SourceFile {\n const sourceFile = program.getSourceFile(fileName);\n if (sourceFile) return sourceFile;\n\n // If we are reporting diagnostics for a source file that is not in the project then we need\n // to fake a source file so the diagnostic formatting routines can emit the file name.\n // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.\n return ({ fileName, text: '' } as any);\n}\n\n\nfunction diagnosticChainFromFormattedDiagnosticChain(chain: FormattedMessageChain):\n DiagnosticMessageChain {\n return {\n messageText: chain.message,\n next: chain.next && diagnosticChainFromFormattedDiagnosticChain(chain.next),\n position: chain.position\n };\n}\n\nfunction syntaxErrorToDiagnostics(error: Error): Diagnostic[] {\n const parserErrors = getParseErrors(error);\n if (parserErrors && parserErrors.length) {\n return parserErrors.map<Diagnostic>(e => ({\n messageText: e.contextualMessage(),\n file: diagnosticSourceOfSpan(e.span),\n start: e.span.start.offset,\n length: e.span.end.offset - e.span.start.offset,\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }));\n } else if (isFormattedError(error)) {\n return [{\n messageText: error.message,\n chain: error.chain && diagnosticChainFromFormattedDiagnosticChain(error.chain),\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE,\n position: error.position\n }];\n }\n // Produce a Diagnostic anyway since we know for sure `error` is a SyntaxError\n return [{\n messageText: error.message,\n category: ts.DiagnosticCategory.Error,\n code: DEFAULT_ERROR_CODE,\n source: SOURCE,\n }];\n}\n"]}
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/program.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAA0V;AAC1V,uB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G,CAAa,UAAA,CAAC,IAAI,OAAA,CAAC;YACJ,WAAW,EAAE,CAAC,CAAC,iBAAiB,EAAE;YAClC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC;YACpC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;YAC/C,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;YACrC,MAAM,EAAE,YAAM;YACd,IAAI,EAAE,wBAAkB;SACzB,CAAC,EARG,CAQH,CAAC,CAAC;IAC1C,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,CAAC;gBACN,WAAW,EAAE,KAAK,CAAC,OAAO;gBAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,2CAA2C,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC9E,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;gBACrC,MAAM,EAAE,YAAM;gBACd,IAAI,EAAE,wBAAkB;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACzB,CAAC,CAAC;IACL,CAAC;IACD,8EAA8E;IAC9E,MAAM,CAAC,CAAC;YACN,WAAW,EAAE,KAAK,CAAC,OAAO;YAC1B,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK;YACrC,IAAI,EAAE,wBAAkB;YACxB,MAAM,EAAE,YAAM;SACf,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AotCompiler, AotCompilerHost, AotCompilerOptions, EmitterVisitorContext, FormattedMessageChain, GeneratedFile, MessageBundle, NgAnalyzedFile, NgAnalyzedModules, ParseSourceSpan, Position, Serializer, TypeScriptEmitter, Xliff, Xliff2, Xmb, core, createAotCompiler, getParseErrors, isFormattedError, isSyntaxError} from '@angular/compiler';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost, translateDiagnostics} from '../diagnostics/translate_diagnostics';\nimport {ModuleMetadata, createBundleIndexHost} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, CustomTransformers, DEFAULT_ERROR_CODE, Diagnostic, DiagnosticMessageChain, EmitFlags, LazyRoute, LibrarySummary, Program, SOURCE, TsEmitArguments, TsEmitCallback} from './api';\nimport {CodeGenerator, TsCompilerAotCompilerTypeCheckHostAdapter, getOriginalReferences} from './compiler_host';\nimport {LowerMetadataCache, getExpressionLoweringTransformFactory} from './lower_expressions';\nimport {getAngularEmitterTransformFactory} from './node_emitter_transform';\nimport {GENERATED_FILES, StructureIsReused, createMessageDiagnostic, isInRootDir, ngToTsDiagnostic, tsStructureIsReused} from './util';\n\n\n/**\n * Maximum number of files that are emitable via calling ts.Program.emit\n * passing individual targetSourceFiles.\n */\nconst MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT = 20;\n\nconst emptyModules: NgAnalyzedModules = {\n ngModules: [],\n ngModuleByPipeOrDirective: new Map(),\n files: []\n};\n\nconst defaultEmitCallback: TsEmitCallback =\n ({program, targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles,\n customTransformers}) =>\n program.emit(\n targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);\n\nclass AngularCompilerProgram implements Program {\n private rootNames: string[];\n private metadataCache: LowerMetadataCache;\n private oldProgramLibrarySummaries: Map<string, LibrarySummary>|undefined;\n private oldProgramEmittedGeneratedFiles: Map<string, GeneratedFile>|undefined;\n private oldProgramEmittedSourceFiles: Map<string, ts.SourceFile>|undefined;\n // Note: This will be cleared out as soon as we create the _tsProgram\n private oldTsProgram: ts.Program|undefined;\n private emittedLibrarySummaries: LibrarySummary[]|undefined;\n private emittedGeneratedFiles: GeneratedFile[]|undefined;\n private emittedSourceFiles: ts.SourceFile[]|undefined;\n\n // Lazily initialized fields\n private _compiler: AotCompiler;\n private _hostAdapter: TsCompilerAotCompilerTypeCheckHostAdapter;\n private _tsProgram: ts.Program;\n private _analyzedModules: NgAnalyzedModules|undefined;\n private _structuralDiagnostics: Diagnostic[]|undefined;\n private _programWithStubs: ts.Program|undefined;\n private _optionsDiagnostics: Diagnostic[] = [];\n\n constructor(\n rootNames: ReadonlyArray<string>, private options: CompilerOptions,\n private host: CompilerHost, oldProgram?: Program) {\n this.rootNames = [...rootNames];\n const [major, minor] = ts.version.split('.');\n if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 4)) {\n throw new Error('The Angular Compiler requires TypeScript >= 2.4.');\n }\n this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined;\n if (oldProgram) {\n this.oldProgramLibrarySummaries = oldProgram.getLibrarySummaries();\n this.oldProgramEmittedGeneratedFiles = oldProgram.getEmittedGeneratedFiles();\n this.oldProgramEmittedSourceFiles = oldProgram.getEmittedSourceFiles();\n }\n\n if (options.flatModuleOutFile) {\n const {host: bundleHost, indexName, errors} =\n createBundleIndexHost(options, this.rootNames, host);\n if (errors) {\n // TODO(tbosch): once we move MetadataBundler from tsc_wrapped into compiler_cli,\n // directly create ng.Diagnostic instead of using ts.Diagnostic here.\n this._optionsDiagnostics.push(...errors.map(e => ({\n category: e.category,\n messageText: e.messageText as string,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n })));\n } else {\n this.rootNames.push(indexName !);\n this.host = bundleHost;\n }\n }\n this.metadataCache = new LowerMetadataCache({quotedNames: true}, !!options.strictMetadataEmit);\n }\n\n getLibrarySummaries(): Map<string, LibrarySummary> {\n const result = new Map<string, LibrarySummary>();\n if (this.oldProgramLibrarySummaries) {\n this.oldProgramLibrarySummaries.forEach((summary, fileName) => result.set(fileName, summary));\n }\n if (this.emittedLibrarySummaries) {\n this.emittedLibrarySummaries.forEach(\n (summary, fileName) => result.set(summary.fileName, summary));\n }\n return result;\n }\n\n getEmittedGeneratedFiles(): Map<string, GeneratedFile> {\n const result = new Map<string, GeneratedFile>();\n if (this.oldProgramEmittedGeneratedFiles) {\n this.oldProgramEmittedGeneratedFiles.forEach(\n (genFile, fileName) => result.set(fileName, genFile));\n }\n if (this.emittedGeneratedFiles) {\n this.emittedGeneratedFiles.forEach((genFile) => result.set(genFile.genFileUrl, genFile));\n }\n return result;\n }\n\n getEmittedSourceFiles(): Map<string, ts.SourceFile> {\n const result = new Map<string, ts.SourceFile>();\n if (this.oldProgramEmittedSourceFiles) {\n this.oldProgramEmittedSourceFiles.forEach((sf, fileName) => result.set(fileName, sf));\n }\n if (this.emittedSourceFiles) {\n this.emittedSourceFiles.forEach((sf) => result.set(sf.fileName, sf));\n }\n return result;\n }\n\n getTsProgram(): ts.Program { return this.tsProgram; }\n\n getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken) {\n return this.tsProgram.getOptionsDiagnostics(cancellationToken);\n }\n\n getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic> {\n return [...this._optionsDiagnostics, ...getNgOptionDiagnostics(this.options)];\n }\n\n getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic> {\n return this.tsProgram.getSyntacticDiagnostics(sourceFile, cancellationToken);\n }\n\n getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic> {\n return this.structuralDiagnostics;\n }\n\n getTsSemanticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic> {\n const sourceFiles = sourceFile ? [sourceFile] : this.tsProgram.getSourceFiles();\n let diags: ts.Diagnostic[] = [];\n sourceFiles.forEach(sf => {\n if (!GENERATED_FILES.test(sf.fileName)) {\n diags.push(...this.tsProgram.getSemanticDiagnostics(sf, cancellationToken));\n }\n });\n return diags;\n }\n\n getNgSemanticDiagnostics(fileName?: string, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<Diagnostic> {\n let diags: ts.Diagnostic[] = [];\n this.tsProgram.getSourceFiles().forEach(sf => {\n if (GENERATED_FILES.test(sf.fileName) && !sf.isDeclarationFile) {\n diags.push(...this.tsProgram.getSemanticDiagnostics(sf, cancellationToken));\n }\n });\n const {ng} = translateDiagnostics(this.hostAdapter, diags);\n return ng;\n }\n\n loadNgStructureAsync(): Promise<void> {\n if (this._analyzedModules) {\n throw new Error('Angular structure already loaded');\n }\n return Promise.resolve()\n .then(() => {\n const {tmpProgram, sourceFiles, rootNames} = this._createProgramWithBasicStubs();\n return this.compiler.loadFilesAsync(sourceFiles).then(analyzedModules => {\n if (this._analyzedModules) {\n throw new Error('Angular structure loaded both synchronously and asynchronsly');\n }\n this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, rootNames);\n });\n })\n .catch(e => this._createProgramOnError(e));\n }\n\n listLazyRoutes(route?: string): LazyRoute[] {\n // Note: Don't analyzedModules if a route is given\n // to be fast enough.\n return this.compiler.listLazyRoutes(route, route ? undefined : this.analyzedModules);\n }\n\n emit(\n {emitFlags = EmitFlags.Default, cancellationToken, customTransformers,\n emitCallback = defaultEmitCallback}: {\n emitFlags?: EmitFlags,\n cancellationToken?: ts.CancellationToken,\n customTransformers?: CustomTransformers,\n emitCallback?: TsEmitCallback\n } = {}): ts.EmitResult {\n const emitStart = Date.now();\n if (emitFlags & EmitFlags.I18nBundle) {\n const locale = this.options.i18nOutLocale || null;\n const file = this.options.i18nOutFile || null;\n const format = this.options.i18nOutFormat || null;\n const bundle = this.compiler.emitMessageBundle(this.analyzedModules, locale);\n i18nExtract(format, file, this.host, this.options, bundle);\n }\n if ((emitFlags & (EmitFlags.JS | EmitFlags.DTS | EmitFlags.Metadata | EmitFlags.Codegen)) ===\n 0) {\n return {emitSkipped: true, diagnostics: [], emittedFiles: []};\n }\n let {genFiles, genDiags} = this.generateFilesForEmit(emitFlags);\n if (genDiags.length) {\n return {\n diagnostics: genDiags,\n emitSkipped: true,\n emittedFiles: [],\n };\n }\n this.emittedGeneratedFiles = genFiles;\n const outSrcMapping: Array<{sourceFile: ts.SourceFile, outFileName: string}> = [];\n const genFileByFileName = new Map<string, GeneratedFile>();\n genFiles.forEach(genFile => genFileByFileName.set(genFile.genFileUrl, genFile));\n this.emittedLibrarySummaries = [];\n const emittedSourceFiles = [] as ts.SourceFile[];\n const writeTsFile: ts.WriteFileCallback =\n (outFileName, outData, writeByteOrderMark, onError?, sourceFiles?) => {\n const sourceFile = sourceFiles && sourceFiles.length == 1 ? sourceFiles[0] : null;\n let genFile: GeneratedFile|undefined;\n if (sourceFile) {\n outSrcMapping.push({outFileName: outFileName, sourceFile});\n genFile = genFileByFileName.get(sourceFile.fileName);\n if (!sourceFile.isDeclarationFile && !GENERATED_FILES.test(sourceFile.fileName)) {\n // Note: sourceFile is the transformed sourcefile, not the original one!\n emittedSourceFiles.push(this.tsProgram.getSourceFile(sourceFile.fileName));\n }\n }\n this.writeFile(outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles);\n };\n const tsCustomTansformers = this.calculateTransforms(genFileByFileName, customTransformers);\n const emitOnlyDtsFiles = (emitFlags & (EmitFlags.DTS | EmitFlags.JS)) == EmitFlags.DTS;\n // Restore the original references before we emit so TypeScript doesn't emit\n // a reference to the .d.ts file.\n const augmentedReferences = new Map<ts.SourceFile, ReadonlyArray<ts.FileReference>>();\n for (const sourceFile of this.tsProgram.getSourceFiles()) {\n const originalReferences = getOriginalReferences(sourceFile);\n if (originalReferences) {\n augmentedReferences.set(sourceFile, sourceFile.referencedFiles);\n sourceFile.referencedFiles = originalReferences;\n }\n }\n const genTsFiles: GeneratedFile[] = [];\n const genJsonFiles: GeneratedFile[] = [];\n genFiles.forEach(gf => {\n if (gf.stmts) {\n genTsFiles.push(gf);\n }\n if (gf.source) {\n genJsonFiles.push(gf);\n }\n });\n let emitResult: ts.EmitResult;\n let emittedUserTsCount: number;\n try {\n const sourceFilesToEmit = this.getSourceFilesForEmit();\n if (sourceFilesToEmit &&\n (sourceFilesToEmit.length + genTsFiles.length) < MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT) {\n const fileNamesToEmit =\n [...sourceFilesToEmit.map(sf => sf.fileName), ...genTsFiles.map(gf => gf.genFileUrl)];\n emitResult = mergeEmitResults(\n fileNamesToEmit.map((fileName) => emitResult = emitCallback({\n program: this.tsProgram,\n host: this.host,\n options: this.options,\n writeFile: writeTsFile, emitOnlyDtsFiles,\n customTransformers: tsCustomTansformers,\n targetSourceFile: this.tsProgram.getSourceFile(fileName),\n })));\n emittedUserTsCount = sourceFilesToEmit.length;\n } else {\n emitResult = emitCallback({\n program: this.tsProgram,\n host: this.host,\n options: this.options,\n writeFile: writeTsFile, emitOnlyDtsFiles,\n customTransformers: tsCustomTansformers\n });\n emittedUserTsCount = this.tsProgram.getSourceFiles().length - genTsFiles.length;\n }\n } finally {\n // Restore the references back to the augmented value to ensure that the\n // checks that TypeScript makes for project structure reuse will succeed.\n for (const [sourceFile, references] of Array.from(augmentedReferences)) {\n // TODO(chuckj): Remove any cast after updating build to 2.6\n (sourceFile as any).referencedFiles = references;\n }\n }\n this.emittedSourceFiles = emittedSourceFiles;\n\n // Match behavior of tsc: only produce emit diagnostics if it would block\n // emit. If noEmitOnError is false, the emit will happen in spite of any\n // errors, so we should not report them.\n if (this.options.noEmitOnError === true) {\n // translate the diagnostics in the emitResult as well.\n const translatedEmitDiags = translateDiagnostics(this.hostAdapter, emitResult.diagnostics);\n emitResult.diagnostics = translatedEmitDiags.ts.concat(\n this.structuralDiagnostics.concat(translatedEmitDiags.ng).map(ngToTsDiagnostic));\n }\n\n if (!outSrcMapping.length) {\n // if no files were emitted by TypeScript, also don't emit .json files\n emitResult.diagnostics =\n emitResult.diagnostics.concat([createMessageDiagnostic(`Emitted no files.`)]);\n return emitResult;\n }\n\n let sampleSrcFileName: string|undefined;\n let sampleOutFileName: string|undefined;\n if (outSrcMapping.length) {\n sampleSrcFileName = outSrcMapping[0].sourceFile.fileName;\n sampleOutFileName = outSrcMapping[0].outFileName;\n }\n const srcToOutPath =\n createSrcToOutPathMapper(this.options.outDir, sampleSrcFileName, sampleOutFileName);\n if (emitFlags & EmitFlags.Codegen) {\n genJsonFiles.forEach(gf => {\n const outFileName = srcToOutPath(gf.genFileUrl);\n this.writeFile(outFileName, gf.source !, false, undefined, gf);\n });\n }\n let metadataJsonCount = 0;\n if (emitFlags & EmitFlags.Metadata) {\n this.tsProgram.getSourceFiles().forEach(sf => {\n if (!sf.isDeclarationFile && !GENERATED_FILES.test(sf.fileName)) {\n metadataJsonCount++;\n const metadata = this.metadataCache.getMetadata(sf);\n if (metadata) {\n const metadataText = JSON.stringify([metadata]);\n const outFileName = srcToOutPath(sf.fileName.replace(/\\.tsx?$/, '.metadata.json'));\n this.writeFile(outFileName, metadataText, false, undefined, undefined, [sf]);\n }\n }\n });\n }\n const emitEnd = Date.now();\n if (this.options.diagnostics) {\n emitResult.diagnostics = emitResult.diagnostics.concat([createMessageDiagnostic([\n `Emitted in ${emitEnd - emitStart}ms`,\n `- ${emittedUserTsCount} user ts files`,\n `- ${genTsFiles.length} generated ts files`,\n `- ${genJsonFiles.length + metadataJsonCount} generated json files`,\n ].join('\\n'))]);\n }\n return emitResult;\n }\n\n // Private members\n private get compiler(): AotCompiler {\n if (!this._compiler) {\n this._createCompiler();\n }\n return this._compiler !;\n }\n\n private get hostAdapter(): TsCompilerAotCompilerTypeCheckHostAdapter {\n if (!this._hostAdapter) {\n this._createCompiler();\n }\n return this._hostAdapter !;\n }\n\n private get analyzedModules(): NgAnalyzedModules {\n if (!this._analyzedModules) {\n this.initSync();\n }\n return this._analyzedModules !;\n }\n\n private get structuralDiagnostics(): ReadonlyArray<Diagnostic> {\n let diagnostics = this._structuralDiagnostics;\n if (!diagnostics) {\n this.initSync();\n diagnostics = (this._structuralDiagnostics = this._structuralDiagnostics || []);\n }\n return diagnostics;\n }\n\n private get tsProgram(): ts.Program {\n if (!this._tsProgram) {\n this.initSync();\n }\n return this._tsProgram !;\n }\n\n private calculateTransforms(\n genFiles: Map<string, GeneratedFile>,\n customTransformers?: CustomTransformers): ts.CustomTransformers {\n const beforeTs: ts.TransformerFactory<ts.SourceFile>[] = [];\n if (!this.options.disableExpressionLowering) {\n beforeTs.push(getExpressionLoweringTransformFactory(this.metadataCache, this.tsProgram));\n }\n beforeTs.push(getAngularEmitterTransformFactory(genFiles, this.getTsProgram()));\n if (customTransformers && customTransformers.beforeTs) {\n beforeTs.push(...customTransformers.beforeTs);\n }\n const afterTs = customTransformers ? customTransformers.afterTs : undefined;\n return {before: beforeTs, after: afterTs};\n }\n\n private initSync() {\n if (this._analyzedModules) {\n return;\n }\n try {\n const {tmpProgram, sourceFiles, rootNames} = this._createProgramWithBasicStubs();\n const analyzedModules = this.compiler.loadFilesSync(sourceFiles);\n this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, rootNames);\n } catch (e) {\n this._createProgramOnError(e);\n }\n }\n\n private _createCompiler() {\n const codegen: CodeGenerator = {\n generateFile: (genFileName, baseFileName) =>\n this._compiler.emitBasicStub(genFileName, baseFileName),\n findGeneratedFileNames: (fileName) => this._compiler.findGeneratedFileNames(fileName),\n };\n\n this._hostAdapter = new TsCompilerAotCompilerTypeCheckHostAdapter(\n this.rootNames, this.options, this.host, this.metadataCache, codegen,\n this.oldProgramLibrarySummaries);\n const aotOptions = getAotCompilerOptions(this.options);\n const errorCollector = (this.options.collectAllErrors || this.options.fullTemplateTypeCheck) ?\n (err: any) => this._addStructuralDiagnostics(err) :\n undefined;\n this._compiler = createAotCompiler(this._hostAdapter, aotOptions, errorCollector).compiler;\n }\n\n private _createProgramWithBasicStubs(): {\n tmpProgram: ts.Program,\n rootNames: string[],\n sourceFiles: string[],\n } {\n if (this._analyzedModules) {\n throw new Error(`Internal Error: already initalized!`);\n }\n // Note: This is important to not produce a memory leak!\n const oldTsProgram = this.oldTsProgram;\n this.oldTsProgram = undefined;\n\n const codegen: CodeGenerator = {\n generateFile: (genFileName, baseFileName) =>\n this.compiler.emitBasicStub(genFileName, baseFileName),\n findGeneratedFileNames: (fileName) => this.compiler.findGeneratedFileNames(fileName),\n };\n\n\n let rootNames = [...this.rootNames];\n if (this.options.generateCodeForLibraries !== false) {\n // if we should generateCodeForLibraries, never include\n // generated files in the program as otherwise we will\n // ovewrite them and typescript will report the error\n // TS5055: Cannot write file ... because it would overwrite input file.\n rootNames = rootNames.filter(fn => !GENERATED_FILES.test(fn));\n }\n if (this.options.noResolve) {\n this.rootNames.forEach(rootName => {\n if (this.hostAdapter.shouldGenerateFilesFor(rootName)) {\n rootNames.push(...this.compiler.findGeneratedFileNames(rootName));\n }\n });\n }\n\n const tmpProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram);\n const sourceFiles: string[] = [];\n tmpProgram.getSourceFiles().forEach(sf => {\n if (this.hostAdapter.isSourceFile(sf.fileName)) {\n sourceFiles.push(sf.fileName);\n }\n });\n return {tmpProgram, sourceFiles, rootNames};\n }\n\n private _updateProgramWithTypeCheckStubs(\n tmpProgram: ts.Program, analyzedModules: NgAnalyzedModules, rootNames: string[]) {\n this._analyzedModules = analyzedModules;\n tmpProgram.getSourceFiles().forEach(sf => {\n if (sf.fileName.endsWith('.ngfactory.ts')) {\n const {generate, baseFileName} = this.hostAdapter.shouldGenerateFile(sf.fileName);\n if (generate) {\n // Note: ! is ok as hostAdapter.shouldGenerateFile will always return a basefileName\n // for .ngfactory.ts files.\n const genFile = this.compiler.emitTypeCheckStub(sf.fileName, baseFileName !);\n if (genFile) {\n this.hostAdapter.updateGeneratedFile(genFile);\n }\n }\n }\n });\n this._tsProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, tmpProgram);\n // Note: the new ts program should be completely reusable by TypeScript as:\n // - we cache all the files in the hostAdapter\n // - new new stubs use the exactly same imports/exports as the old once (we assert that in\n // hostAdapter.updateGeneratedFile).\n if (tsStructureIsReused(tmpProgram) !== StructureIsReused.Completely) {\n throw new Error(`Internal Error: The structure of the program changed during codegen.`);\n }\n }\n\n private _createProgramOnError(e: any) {\n // Still fill the analyzedModules and the tsProgram\n // so that we don't cause other errors for users who e.g. want to emit the ngProgram.\n this._analyzedModules = emptyModules;\n this.oldTsProgram = undefined;\n this._hostAdapter.isSourceFile = () => false;\n this._tsProgram = ts.createProgram(this.rootNames, this.options, this.hostAdapter);\n if (isSyntaxError(e)) {\n this._addStructuralDiagnostics(e);\n return;\n }\n throw e;\n }\n\n private _addStructuralDiagnostics(error: Error) {\n const diagnostics = this._structuralDiagnostics || (this._structuralDiagnostics = []);\n if (isSyntaxError(error)) {\n diagnostics.push(...syntaxErrorToDiagnostics(error));\n } else {\n diagnostics.push({\n messageText: error.toString(),\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n });\n }\n }\n\n // Note: this returns a ts.Diagnostic so that we\n // can return errors in a ts.EmitResult\n private generateFilesForEmit(emitFlags: EmitFlags):\n {genFiles: GeneratedFile[], genDiags: ts.Diagnostic[]} {\n try {\n if (!(emitFlags & EmitFlags.Codegen)) {\n return {genFiles: [], genDiags: []};\n }\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n let genFiles = this.compiler.emitAllImpls(this.analyzedModules)\n .filter(genFile => isInRootDir(genFile.genFileUrl, this.options));\n if (this.oldProgramEmittedGeneratedFiles) {\n const oldProgramEmittedGeneratedFiles = this.oldProgramEmittedGeneratedFiles;\n genFiles = genFiles.filter(genFile => {\n const oldGenFile = oldProgramEmittedGeneratedFiles.get(genFile.genFileUrl);\n return !oldGenFile || !genFile.isEquivalent(oldGenFile);\n });\n }\n return {genFiles, genDiags: []};\n } catch (e) {\n // TODO(tbosch): check whether we can actually have syntax errors here,\n // as we already parsed the metadata and templates before to create the type check block.\n if (isSyntaxError(e)) {\n const genDiags: ts.Diagnostic[] = [{\n file: undefined,\n start: undefined,\n length: undefined,\n messageText: e.message,\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }];\n return {genFiles: [], genDiags};\n }\n throw e;\n }\n }\n\n /**\n * Returns undefined if all files should be emitted.\n */\n private getSourceFilesForEmit(): ts.SourceFile[]|undefined {\n // TODO(tbosch): if one of the files contains a `const enum`\n // always emit all files -> return undefined!\n let sourceFilesToEmit: ts.SourceFile[]|undefined;\n if (this.oldProgramEmittedSourceFiles) {\n sourceFilesToEmit = this.tsProgram.getSourceFiles().filter(sf => {\n const oldFile = this.oldProgramEmittedSourceFiles !.get(sf.fileName);\n return !sf.isDeclarationFile && !GENERATED_FILES.test(sf.fileName) && sf !== oldFile;\n });\n }\n return sourceFilesToEmit;\n }\n\n private writeFile(\n outFileName: string, outData: string, writeByteOrderMark: boolean,\n onError?: (message: string) => void, genFile?: GeneratedFile,\n sourceFiles?: ReadonlyArray<ts.SourceFile>) {\n // collect emittedLibrarySummaries\n let baseFile: ts.SourceFile|undefined;\n if (genFile) {\n baseFile = this.tsProgram.getSourceFile(genFile.srcFileUrl);\n if (baseFile) {\n if (!this.emittedLibrarySummaries) {\n this.emittedLibrarySummaries = [];\n }\n if (genFile.genFileUrl.endsWith('.ngsummary.json') && baseFile.fileName.endsWith('.d.ts')) {\n this.emittedLibrarySummaries.push({\n fileName: baseFile.fileName,\n text: baseFile.text,\n sourceFile: baseFile,\n });\n this.emittedLibrarySummaries.push({fileName: genFile.genFileUrl, text: outData});\n if (!this.options.declaration) {\n // If we don't emit declarations, still record an empty .ngfactory.d.ts file,\n // as we might need it lateron for resolving module names from summaries.\n const ngFactoryDts =\n genFile.genFileUrl.substring(0, genFile.genFileUrl.length - 15) + '.ngfactory.d.ts';\n this.emittedLibrarySummaries.push({fileName: ngFactoryDts, text: ''});\n }\n } else if (outFileName.endsWith('.d.ts') && baseFile.fileName.endsWith('.d.ts')) {\n const dtsSourceFilePath = genFile.genFileUrl.replace(/\\.ts$/, '.d.ts');\n // Note: Don't use sourceFiles here as the created .d.ts has a path in the outDir,\n // but we need one that is next to the .ts file\n this.emittedLibrarySummaries.push({fileName: dtsSourceFilePath, text: outData});\n }\n }\n }\n // Filter out generated files for which we didn't generate code.\n // This can happen as the stub caclulation is not completely exact.\n // Note: sourceFile refers to the .ngfactory.ts / .ngsummary.ts file\n // node_emitter_transform already set the file contents to be empty,\n // so this code only needs to skip the file if !allowEmptyCodegenFiles.\n const isGenerated = GENERATED_FILES.test(outFileName);\n if (isGenerated && !this.options.allowEmptyCodegenFiles &&\n (!genFile || !genFile.stmts || genFile.stmts.length === 0)) {\n return;\n }\n if (baseFile) {\n sourceFiles = sourceFiles ? [...sourceFiles, baseFile] : [baseFile];\n }\n // TODO: remove any when TS 2.4 support is removed.\n this.host.writeFile(outFileName, outData, writeByteOrderMark, onError, sourceFiles as any);\n }\n}\n\nexport function createProgram({rootNames, options, host, oldProgram}: {\n rootNames: ReadonlyArray<string>,\n options: CompilerOptions,\n host: CompilerHost, oldProgram?: Program\n}): Program {\n return new AngularCompilerProgram(rootNames, options, host, oldProgram);\n}\n\n// Compute the AotCompiler options\nfunction getAotCompilerOptions(options: CompilerOptions): AotCompilerOptions {\n let missingTranslation = core.MissingTranslationStrategy.Warning;\n\n switch (options.i18nInMissingTranslations) {\n case 'ignore':\n missingTranslation = core.MissingTranslationStrategy.Ignore;\n break;\n case 'error':\n missingTranslation = core.MissingTranslationStrategy.Error;\n break;\n }\n\n let translations: string = '';\n\n if (options.i18nInFile) {\n if (!options.i18nInLocale) {\n throw new Error(`The translation file (${options.i18nInFile}) locale must be provided.`);\n }\n translations = fs.readFileSync(options.i18nInFile, 'utf8');\n } else {\n // No translations are provided, ignore any errors\n // We still go through i18n to remove i18n attributes\n missingTranslation = core.MissingTranslationStrategy.Ignore;\n }\n\n return {\n locale: options.i18nInLocale,\n i18nFormat: options.i18nInFormat || options.i18nOutFormat, translations, missingTranslation,\n enableLegacyTemplate: options.enableLegacyTemplate,\n enableSummariesForJit: options.enableSummariesForJit,\n preserveWhitespaces: options.preserveWhitespaces,\n fullTemplateTypeCheck: options.fullTemplateTypeCheck,\n allowEmptyCodegenFiles: options.allowEmptyCodegenFiles,\n };\n}\n\nfunction getNgOptionDiagnostics(options: CompilerOptions): ReadonlyArray<Diagnostic> {\n if (options.annotationsAs) {\n switch (options.annotationsAs) {\n case 'decorators':\n case 'static fields':\n break;\n default:\n return [{\n messageText:\n 'Angular compiler options \"annotationsAs\" only supports \"static fields\" and \"decorators\"',\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }];\n }\n }\n return [];\n}\n\nfunction normalizeSeparators(path: string): string {\n return path.replace(/\\\\/g, '/');\n}\n\n/**\n * Returns a function that can adjust a path from source path to out path,\n * based on an existing mapping from source to out path.\n *\n * TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir`\n * if none was specified.\n *\n * Note: This function works on normalized paths from typescript.\n *\n * @param outDir\n * @param outSrcMappings\n */\nexport function createSrcToOutPathMapper(\n outDir: string | undefined, sampleSrcFileName: string | undefined,\n sampleOutFileName: string | undefined, host: {\n dirname: typeof path.dirname,\n resolve: typeof path.resolve,\n relative: typeof path.relative\n } = path): (srcFileName: string) => string {\n let srcToOutPath: (srcFileName: string) => string;\n if (outDir) {\n let path: {} = {}; // Ensure we error if we use `path` instead of `host`.\n if (sampleSrcFileName == null || sampleOutFileName == null) {\n throw new Error(`Can't calculate the rootDir without a sample srcFileName / outFileName. `);\n }\n const srcFileDir = normalizeSeparators(host.dirname(sampleSrcFileName));\n const outFileDir = normalizeSeparators(host.dirname(sampleOutFileName));\n if (srcFileDir === outFileDir) {\n return (srcFileName) => srcFileName;\n }\n // calculate the common suffix, stopping\n // at `outDir`.\n const srcDirParts = srcFileDir.split('/');\n const outDirParts = normalizeSeparators(host.relative(outDir, outFileDir)).split('/');\n let i = 0;\n while (i < Math.min(srcDirParts.length, outDirParts.length) &&\n srcDirParts[srcDirParts.length - 1 - i] === outDirParts[outDirParts.length - 1 - i])\n i++;\n const rootDir = srcDirParts.slice(0, srcDirParts.length - i).join('/');\n srcToOutPath = (srcFileName) => host.resolve(outDir, host.relative(rootDir, srcFileName));\n } else {\n srcToOutPath = (srcFileName) => srcFileName;\n }\n return srcToOutPath;\n}\n\nexport function i18nExtract(\n formatName: string | null, outFile: string | null, host: ts.CompilerHost,\n options: CompilerOptions, bundle: MessageBundle): string[] {\n formatName = formatName || 'xlf';\n // Checks the format and returns the extension\n const ext = i18nGetExtension(formatName);\n const content = i18nSerialize(bundle, formatName, options);\n const dstFile = outFile || `messages.${ext}`;\n const dstPath = path.resolve(options.outDir || options.basePath, dstFile);\n host.writeFile(dstPath, content, false, undefined, []);\n return [dstPath];\n}\n\nexport function i18nSerialize(\n bundle: MessageBundle, formatName: string, options: CompilerOptions): string {\n const format = formatName.toLowerCase();\n let serializer: Serializer;\n\n switch (format) {\n case 'xmb':\n serializer = new Xmb();\n break;\n case 'xliff2':\n case 'xlf2':\n serializer = new Xliff2();\n break;\n case 'xlf':\n case 'xliff':\n default:\n serializer = new Xliff();\n }\n\n return bundle.write(serializer, getPathNormalizer(options.basePath));\n}\n\nfunction getPathNormalizer(basePath?: string) {\n // normalize sourcepaths by removing the base path and always using \"/\" as a separator\n return (sourcePath: string) => {\n sourcePath = basePath ? path.relative(basePath, sourcePath) : sourcePath;\n return sourcePath.split(path.sep).join('/');\n };\n}\n\nexport function i18nGetExtension(formatName: string): string {\n const format = formatName.toLowerCase();\n\n switch (format) {\n case 'xmb':\n return 'xmb';\n case 'xlf':\n case 'xlif':\n case 'xliff':\n case 'xlf2':\n case 'xliff2':\n return 'xlf';\n }\n\n throw new Error(`Unsupported format \"${formatName}\"`);\n}\n\nfunction mergeEmitResults(emitResults: ts.EmitResult[]): ts.EmitResult {\n const diagnostics: ts.Diagnostic[] = [];\n let emitSkipped = false;\n const emittedFiles: string[] = [];\n for (const er of emitResults) {\n diagnostics.push(...er.diagnostics);\n emitSkipped = emitSkipped || er.emitSkipped;\n emittedFiles.push(...er.emittedFiles);\n }\n return {diagnostics, emitSkipped, emittedFiles};\n}\n\nfunction diagnosticSourceOfSpan(span: ParseSourceSpan): ts.SourceFile {\n // For diagnostics, TypeScript only uses the fileName and text properties.\n // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.\n return ({ fileName: span.start.file.url, text: span.start.file.content } as any);\n}\n\nfunction diagnosticSourceOfFileName(fileName: string, program: ts.Program): ts.SourceFile {\n const sourceFile = program.getSourceFile(fileName);\n if (sourceFile) return sourceFile;\n\n // If we are reporting diagnostics for a source file that is not in the project then we need\n // to fake a source file so the diagnostic formatting routines can emit the file name.\n // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.\n return ({ fileName, text: '' } as any);\n}\n\n\nfunction diagnosticChainFromFormattedDiagnosticChain(chain: FormattedMessageChain):\n DiagnosticMessageChain {\n return {\n messageText: chain.message,\n next: chain.next && diagnosticChainFromFormattedDiagnosticChain(chain.next),\n position: chain.position\n };\n}\n\nfunction syntaxErrorToDiagnostics(error: Error): Diagnostic[] {\n const parserErrors = getParseErrors(error);\n if (parserErrors && parserErrors.length) {\n return parserErrors.map<Diagnostic>(e => ({\n messageText: e.contextualMessage(),\n file: diagnosticSourceOfSpan(e.span),\n start: e.span.start.offset,\n length: e.span.end.offset - e.span.start.offset,\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE\n }));\n } else if (isFormattedError(error)) {\n return [{\n messageText: error.message,\n chain: error.chain && diagnosticChainFromFormattedDiagnosticChain(error.chain),\n category: ts.DiagnosticCategory.Error,\n source: SOURCE,\n code: DEFAULT_ERROR_CODE,\n position: error.position\n }];\n }\n // Produce a Diagnostic anyway since we know for sure `error` is a SyntaxError\n return [{\n messageText: error.message,\n category: ts.DiagnosticCategory.Error,\n code: DEFAULT_ERROR_CODE,\n source: SOURCE,\n }];\n}\n"]}
package/src/version.js CHANGED
@@ -16,5 +16,5 @@ var compiler_1 = require("@angular/compiler");
16
16
  /**
17
17
  * @stable
18
18
  */
19
- exports.VERSION = new compiler_1.Version('5.1.3');
19
+ exports.VERSION = new compiler_1.Version('5.2.0');
20
20
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../packages/compiler-cli/src/version.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH;;;;GAIG;AAEH,8CAA0C;AAC1C;;GAEG;AACU,QAAA,OAAO,GAAG,IAAI,kBAAO,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\nimport {Version} from '@angular/compiler';\n/**\n * @stable\n */\nexport const VERSION = new Version('5.1.3');\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../packages/compiler-cli/src/version.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH;;;;GAIG;AAEH,8CAA0C;AAC1C;;GAEG;AACU,QAAA,OAAO,GAAG,IAAI,kBAAO,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\nimport {Version} from '@angular/compiler';\n/**\n * @stable\n */\nexport const VERSION = new Version('5.2.0');\n"]}