@angular/compiler-cli 5.2.4 → 5.2.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "5.2.4",
3
+ "version": "5.2.8",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -11,12 +11,12 @@
11
11
  "dependencies": {
12
12
  "reflect-metadata": "^0.1.2",
13
13
  "minimist": "^1.2.0",
14
- "tsickle": "^0.26.0",
14
+ "tsickle": "^0.27.2",
15
15
  "chokidar": "^1.4.2"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "typescript": ">=2.4.2 <2.7",
19
- "@angular/compiler": "5.2.4"
19
+ "@angular/compiler": "5.2.8"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
@@ -0,0 +1,2 @@
1
+ import 'reflect-metadata';
2
+ export declare function main(args: string[], consoleError?: (s: string) => void): number;
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("reflect-metadata");
5
+ var ts = require("typescript");
6
+ var main_1 = require("../main");
7
+ var bundle_index_host_1 = require("./bundle_index_host");
8
+ var ng = require("../transformers/entry_points");
9
+ function main(args, consoleError) {
10
+ if (consoleError === void 0) { consoleError = console.error; }
11
+ var _a = main_1.readCommandLineAndConfiguration(args), options = _a.options, rootNames = _a.rootNames;
12
+ var host = ng.createCompilerHost({ options: options });
13
+ var _b = bundle_index_host_1.createBundleIndexHost(options, rootNames, host), bundleHost = _b.host, indexName = _b.indexName, errors = _b.errors;
14
+ if (!indexName) {
15
+ console.error('Did not find an index.ts in the top-level of the package.');
16
+ return 1;
17
+ }
18
+ // The index file is synthetic, so we have to add it to the program after parsing the tsconfig
19
+ rootNames.push(indexName);
20
+ var program = ts.createProgram(rootNames, options, bundleHost);
21
+ var indexSourceFile = program.getSourceFile(indexName);
22
+ if (!indexSourceFile) {
23
+ console.error(indexSourceFile + " is not in the program. Please file a bug.");
24
+ return 1;
25
+ }
26
+ program.emit(indexSourceFile);
27
+ return 0;
28
+ }
29
+ exports.main = main;
30
+ // CLI entry point
31
+ if (require.main === module) {
32
+ var args = process.argv.slice(2);
33
+ process.exitCode = main(args);
34
+ }
35
+ //# sourceMappingURL=bundle_index_main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle_index_main.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/bundle_index_main.ts"],"names":[],"mappings":";;;AAUA,4BAA0B;AAE1B,+BAAiC;AAEjC,gCAAwD;AACxD,yDAA0D;AAC1D,iDAAmD;AAEnD,cAAqB,IAAc,EAAE,YAAiD;IAAjD,6BAAA,EAAA,eAAoC,OAAO,CAAC,KAAK;IAC9E,IAAA,iDAA4D,EAA3D,oBAAO,EAAE,wBAAS,CAA0C;IACnE,IAAM,IAAI,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;IACxC,IAAA,wEAAuF,EAAtF,oBAAgB,EAAE,wBAAS,EAAE,kBAAM,CAAoD;IAC9F,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC3E,MAAM,CAAC,CAAC,CAAC;IACX,CAAC;IACD,8FAA8F;IAC9F,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,IAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACjE,IAAM,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACzD,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;QACrB,OAAO,CAAC,KAAK,CAAI,eAAe,+CAA4C,CAAC,CAAC;QAC9E,MAAM,CAAC,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC9B,MAAM,CAAC,CAAC,CAAC;AACX,CAAC;AAlBD,oBAkBC;AAED,kBAAkB;AAClB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;IAC5B,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC","sourcesContent":["#!/usr/bin/env node\n/**\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// Must be imported first, because Angular decorators throw on load.\nimport 'reflect-metadata';\n\nimport * as ts from 'typescript';\nimport * as path from 'path';\nimport {readCommandLineAndConfiguration} from '../main';\nimport {createBundleIndexHost} from './bundle_index_host';\nimport * as ng from '../transformers/entry_points';\n\nexport function main(args: string[], consoleError: (s: string) => void = console.error): number {\n const {options, rootNames} = readCommandLineAndConfiguration(args);\n const host = ng.createCompilerHost({options});\n const {host: bundleHost, indexName, errors} = createBundleIndexHost(options, rootNames, host);\n if (!indexName) {\n console.error('Did not find an index.ts in the top-level of the package.');\n return 1;\n }\n // The index file is synthetic, so we have to add it to the program after parsing the tsconfig\n rootNames.push(indexName);\n const program = ts.createProgram(rootNames, options, bundleHost);\n const indexSourceFile = program.getSourceFile(indexName);\n if (!indexSourceFile) {\n console.error(`${indexSourceFile} is not in the program. Please file a bug.`);\n return 1;\n }\n program.emit(indexSourceFile);\n return 0;\n}\n\n// CLI entry point\nif (require.main === module) {\n const args = process.argv.slice(2);\n process.exitCode = main(args);\n}\n"]}
@@ -497,6 +497,8 @@ var CompilerHostAdapter = /** @class */ (function () {
497
497
  this.collector = new collector_1.MetadataCollector();
498
498
  }
499
499
  CompilerHostAdapter.prototype.getMetadataFor = function (fileName) {
500
+ if (!this.host.fileExists(fileName + '.ts'))
501
+ return undefined;
500
502
  var sourceFile = this.host.getSourceFile(fileName + '.ts', ts.ScriptTarget.Latest);
501
503
  return sourceFile && this.collector.getMetadata(sourceFile);
502
504
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/bundler.ts"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,2BAA6B;AAC7B,+BAAiC;AAEjC,mDAAwD;AACxD,6CAA+mB;AAI/mB,mDAAmD;AACnD,IAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAgExD;IAOE,yBACY,IAAY,EAAU,QAA0B,EAAU,IAAyB;QAAnF,SAAI,GAAJ,IAAI,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAkB;QAAU,SAAI,GAAJ,IAAI,CAAqB;QAPvF,cAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtC,kBAAa,GAAG,IAAI,GAAG,EAAoC,CAAC;QAC5D,YAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;QAM5C,IAAI,CAAC,UAAU,GAAG,OAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAG,CAAC;IAC/C,CAAC;IAED,2CAAiB,GAAjB;QACE,gGAAgG;QAChG,eAAe;QACf,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;QAC1C,uEAAuE;QACvE,IAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QAClD,IAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;aAC9B,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,IAAI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AC,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACvC,IAAI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3E,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxD,4EAA4E;YAC5E,UAAU,GAAG,MAAI,IAAI,CAAC,GAAG,GAAG,UAAY,CAAC;QAC3C,CAAC;QACD,oFAAoF;QACpF,kDAAkD;QAClD,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,CAAC,UAAU,CAAC;AACpB,CAAC;AAED,qBAAqB,CAAM;IACzB,MAAM,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,uBAAuB,MAAc;IACnC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3E,CAAC;AAED,8BAA8B,MAAc;IAC1C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACxE,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 */\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {MetadataCollector} from '../metadata/collector';\nimport {ClassMetadata, ConstructorMetadata, FunctionMetadata, METADATA_VERSION, MemberMetadata, MetadataEntry, MetadataError, MetadataImportedSymbolReferenceExpression, MetadataMap, MetadataObject, MetadataSymbolicExpression, MetadataSymbolicReferenceExpression, MetadataValue, MethodMetadata, ModuleExportMetadata, ModuleMetadata, isClassMetadata, isConstructorMetadata, isFunctionMetadata, isInterfaceMetadata, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportedSymbolReferenceExpression, isMetadataModuleReferenceExpression, isMetadataSymbolicExpression, isMethodMetadata} from '../metadata/schema';\n\n\n\n// The character set used to produce private names.\nconst PRIVATE_NAME_CHARS = 'abcdefghijklmnopqrstuvwxyz';\n\ninterface Symbol {\n module: string;\n name: string;\n\n // Produced by indirectly by exportAll() for symbols re-export another symbol.\n exports?: Symbol;\n\n // Produced by indirectly by exportAll() for symbols are re-exported by another symbol.\n reexportedAs?: Symbol;\n\n // Produced by canonicalizeSymbols() for all symbols. A symbol is private if it is not\n // exported by the index.\n isPrivate?: boolean;\n\n // Produced by canonicalizeSymbols() for all symbols. This is the one symbol that\n // respresents all other symbols and is the only symbol that, among all the re-exported\n // aliases, whose fields can be trusted to contain the correct information.\n // For private symbols this is the declaration symbol. For public symbols this is the\n // symbol that is exported.\n canonicalSymbol?: Symbol;\n\n // Produced by canonicalizeSymbols() for all symbols. This the symbol that originally\n // declared the value and should be used to fetch the value.\n declaration?: Symbol;\n\n // A symbol is referenced if it is exported from index or referenced by the value of\n // a referenced symbol's value.\n referenced?: boolean;\n\n // A symbol is marked as a re-export the symbol was rexported from a module that is\n // not part of the flat module bundle.\n reexport?: boolean;\n\n // Only valid for referenced canonical symbols. Produces by convertSymbols().\n value?: MetadataEntry;\n\n // Only valid for referenced private symbols. It is the name to use to import the symbol from\n // the bundle index. Produce by assignPrivateNames();\n privateName?: string;\n}\n\nexport interface BundleEntries { [name: string]: MetadataEntry; }\n\nexport interface BundlePrivateEntry {\n privateName: string;\n name: string;\n module: string;\n}\n\nexport interface BundledModule {\n metadata: ModuleMetadata;\n privates: BundlePrivateEntry[];\n}\n\nexport interface MetadataBundlerHost {\n getMetadataFor(moduleName: string): ModuleMetadata|undefined;\n}\n\ntype StaticsMetadata = {\n [name: string]: MetadataValue | FunctionMetadata;\n};\n\nexport class MetadataBundler {\n private symbolMap = new Map<string, Symbol>();\n private metadataCache = new Map<string, ModuleMetadata|undefined>();\n private exports = new Map<string, Symbol[]>();\n private rootModule: string;\n private exported: Set<Symbol>;\n\n constructor(\n private root: string, private importAs: string|undefined, private host: MetadataBundlerHost) {\n this.rootModule = `./${path.basename(root)}`;\n }\n\n getMetadataBundle(): BundledModule {\n // Export the root module. This also collects the transitive closure of all values referenced by\n // the exports.\n const exportedSymbols = this.exportAll(this.rootModule);\n this.canonicalizeSymbols(exportedSymbols);\n // TODO: exports? e.g. a module re-exports a symbol from another bundle\n const metadata = this.getEntries(exportedSymbols);\n const privates = Array.from(this.symbolMap.values())\n .filter(s => s.referenced && s.isPrivate)\n .map(s => ({\n privateName: s.privateName !,\n name: s.declaration !.name,\n module: s.declaration !.module\n }));\n const origins = Array.from(this.symbolMap.values())\n .filter(s => s.referenced && !s.reexport)\n .reduce<{[name: string]: string}>((p, s) => {\n p[s.isPrivate ? s.privateName ! : s.name] = s.declaration !.module;\n return p;\n }, {});\n const exports = this.getReExports(exportedSymbols);\n return {\n metadata: {\n __symbolic: 'module',\n version: METADATA_VERSION,\n exports: exports.length ? exports : undefined, metadata, origins,\n importAs: this.importAs !\n },\n privates\n };\n }\n\n static resolveModule(importName: string, from: string): string {\n return resolveModule(importName, from);\n }\n\n private getMetadata(moduleName: string): ModuleMetadata|undefined {\n let result = this.metadataCache.get(moduleName);\n if (!result) {\n if (moduleName.startsWith('.')) {\n const fullModuleName = resolveModule(moduleName, this.root);\n result = this.host.getMetadataFor(fullModuleName);\n }\n this.metadataCache.set(moduleName, result);\n }\n return result;\n }\n\n private exportAll(moduleName: string): Symbol[] {\n const module = this.getMetadata(moduleName);\n let result = this.exports.get(moduleName);\n\n if (result) {\n return result;\n }\n\n result = [];\n\n const exportSymbol = (exportedSymbol: Symbol, exportAs: string) => {\n const symbol = this.symbolOf(moduleName, exportAs);\n result !.push(symbol);\n exportedSymbol.reexportedAs = symbol;\n symbol.exports = exportedSymbol;\n };\n\n // Export all the symbols defined in this module.\n if (module && module.metadata) {\n for (let key in module.metadata) {\n const data = module.metadata[key];\n if (isMetadataImportedSymbolReferenceExpression(data)) {\n // This is a re-export of an imported symbol. Record this as a re-export.\n const exportFrom = resolveModule(data.module, moduleName);\n this.exportAll(exportFrom);\n const symbol = this.symbolOf(exportFrom, data.name);\n exportSymbol(symbol, key);\n } else {\n // Record that this symbol is exported by this module.\n result.push(this.symbolOf(moduleName, key));\n }\n }\n }\n\n // Export all the re-exports from this module\n if (module && module.exports) {\n for (const exportDeclaration of module.exports) {\n const exportFrom = resolveModule(exportDeclaration.from, moduleName);\n // Record all the exports from the module even if we don't use it directly.\n const exportedSymbols = this.exportAll(exportFrom);\n if (exportDeclaration.export) {\n // Re-export all the named exports from a module.\n for (const exportItem of exportDeclaration.export) {\n const name = typeof exportItem == 'string' ? exportItem : exportItem.name;\n const exportAs = typeof exportItem == 'string' ? exportItem : exportItem.as;\n const symbol = this.symbolOf(exportFrom, name);\n if (exportedSymbols && exportedSymbols.length == 1 && exportedSymbols[0].reexport &&\n exportedSymbols[0].name == '*') {\n // This is a named export from a module we have no metadata about. Record the named\n // export as a re-export.\n symbol.reexport = true;\n }\n exportSymbol(this.symbolOf(exportFrom, name), exportAs);\n }\n } else {\n // Re-export all the symbols from the module\n const exportedSymbols = this.exportAll(exportFrom);\n for (const exportedSymbol of exportedSymbols) {\n const name = exportedSymbol.name;\n exportSymbol(exportedSymbol, name);\n }\n }\n }\n }\n\n if (!module) {\n // If no metadata is found for this import then it is considered external to the\n // library and should be recorded as a re-export in the final metadata if it is\n // eventually re-exported.\n const symbol = this.symbolOf(moduleName, '*');\n symbol.reexport = true;\n result.push(symbol);\n }\n this.exports.set(moduleName, result);\n\n return result;\n }\n\n /**\n * Fill in the canonicalSymbol which is the symbol that should be imported by factories.\n * The canonical symbol is the one exported by the index file for the bundle or definition\n * symbol for private symbols that are not exported by bundle index.\n */\n private canonicalizeSymbols(exportedSymbols: Symbol[]) {\n const symbols = Array.from(this.symbolMap.values());\n this.exported = new Set(exportedSymbols);\n symbols.forEach(this.canonicalizeSymbol, this);\n }\n\n private canonicalizeSymbol(symbol: Symbol) {\n const rootExport = getRootExport(symbol);\n const declaration = getSymbolDeclaration(symbol);\n const isPrivate = !this.exported.has(rootExport);\n const canonicalSymbol = isPrivate ? declaration : rootExport;\n symbol.isPrivate = isPrivate;\n symbol.declaration = declaration;\n symbol.canonicalSymbol = canonicalSymbol;\n symbol.reexport = declaration.reexport;\n }\n\n private getEntries(exportedSymbols: Symbol[]): BundleEntries {\n const result: BundleEntries = {};\n\n const exportedNames = new Set(exportedSymbols.map(s => s.name));\n let privateName = 0;\n\n function newPrivateName(): string {\n while (true) {\n let digits: string[] = [];\n let index = privateName++;\n let base = PRIVATE_NAME_CHARS;\n while (!digits.length || index > 0) {\n digits.unshift(base[index % base.length]);\n index = Math.floor(index / base.length);\n }\n digits.unshift('\\u0275');\n const result = digits.join('');\n if (!exportedNames.has(result)) return result;\n }\n }\n\n exportedSymbols.forEach(symbol => this.convertSymbol(symbol));\n\n const symbolsMap = new Map<string, string[]>();\n Array.from(this.symbolMap.values()).forEach(symbol => {\n if (symbol.referenced && !symbol.reexport) {\n let name = symbol.name;\n const identifier = `${symbol.declaration!.module}:${symbol.declaration !.name}`;\n if (symbol.isPrivate && !symbol.privateName) {\n name = newPrivateName();\n symbol.privateName = name;\n }\n if (symbolsMap.has(identifier)) {\n const names = symbolsMap.get(identifier);\n names !.push(name);\n } else {\n symbolsMap.set(identifier, [name]);\n }\n result[name] = symbol.value !;\n }\n });\n\n // check for duplicated entries\n symbolsMap.forEach((names: string[], identifier: string) => {\n if (names.length > 1) {\n const [module, declaredName] = identifier.split(':');\n // prefer the export that uses the declared name (if any)\n let reference = names.indexOf(declaredName);\n if (reference === -1) {\n reference = 0;\n }\n\n // keep one entry and replace the others by references\n names.forEach((name: string, i: number) => {\n if (i !== reference) {\n result[name] = {__symbolic: 'reference', name: names[reference]};\n }\n });\n }\n });\n\n return result;\n }\n\n private getReExports(exportedSymbols: Symbol[]): ModuleExportMetadata[] {\n type ExportClause = {name: string, as: string}[];\n const modules = new Map<string, ExportClause>();\n const exportAlls = new Set<string>();\n for (const symbol of exportedSymbols) {\n if (symbol.reexport) {\n // symbol.declaration is guarenteed to be defined during the phase this method is called.\n const declaration = symbol.declaration !;\n const module = declaration.module;\n if (declaration !.name == '*') {\n // Reexport all the symbols.\n exportAlls.add(declaration.module);\n } else {\n // Re-export the symbol as the exported name.\n let entry = modules.get(module);\n if (!entry) {\n entry = [];\n modules.set(module, entry);\n }\n const as = symbol.name;\n const name = declaration.name;\n entry.push({name, as});\n }\n }\n }\n return [\n ...Array.from(exportAlls.values()).map(from => ({from})),\n ...Array.from(modules.entries()).map(([from, exports]) => ({export: exports, from}))\n ];\n }\n\n private convertSymbol(symbol: Symbol) {\n // canonicalSymbol is ensured to be defined before this is called.\n const canonicalSymbol = symbol.canonicalSymbol !;\n\n if (!canonicalSymbol.referenced) {\n canonicalSymbol.referenced = true;\n // declaration is ensured to be definded before this method is called.\n const declaration = canonicalSymbol.declaration !;\n const module = this.getMetadata(declaration.module);\n if (module) {\n const value = module.metadata[declaration.name];\n if (value && !declaration.name.startsWith('___')) {\n canonicalSymbol.value = this.convertEntry(declaration.module, value);\n }\n }\n }\n }\n\n private convertEntry(moduleName: string, value: MetadataEntry): MetadataEntry {\n if (isClassMetadata(value)) {\n return this.convertClass(moduleName, value);\n }\n if (isFunctionMetadata(value)) {\n return this.convertFunction(moduleName, value);\n }\n if (isInterfaceMetadata(value)) {\n return value;\n }\n return this.convertValue(moduleName, value);\n }\n\n private convertClass(moduleName: string, value: ClassMetadata): ClassMetadata {\n return {\n __symbolic: 'class',\n arity: value.arity,\n extends: this.convertExpression(moduleName, value.extends) !,\n decorators:\n value.decorators && value.decorators.map(d => this.convertExpression(moduleName, d) !),\n members: this.convertMembers(moduleName, value.members !),\n statics: value.statics && this.convertStatics(moduleName, value.statics)\n };\n }\n\n private convertMembers(moduleName: string, members: MetadataMap): MetadataMap {\n const result: MetadataMap = {};\n for (const name in members) {\n const value = members[name];\n result[name] = value.map(v => this.convertMember(moduleName, v));\n }\n return result;\n }\n\n private convertMember(moduleName: string, member: MemberMetadata) {\n const result: MemberMetadata = {__symbolic: member.__symbolic};\n result.decorators =\n member.decorators && member.decorators.map(d => this.convertExpression(moduleName, d) !);\n if (isMethodMetadata(member)) {\n (result as MethodMetadata).parameterDecorators = member.parameterDecorators &&\n member.parameterDecorators.map(\n d => d && d.map(p => this.convertExpression(moduleName, p) !));\n if (isConstructorMetadata(member)) {\n if (member.parameters) {\n (result as ConstructorMetadata).parameters =\n member.parameters.map(p => this.convertExpression(moduleName, p));\n }\n }\n }\n return result;\n }\n\n private convertStatics(moduleName: string, statics: StaticsMetadata): StaticsMetadata {\n let result: StaticsMetadata = {};\n for (const key in statics) {\n const value = statics[key];\n result[key] = isFunctionMetadata(value) ? this.convertFunction(moduleName, value) : value;\n }\n return result;\n }\n\n private convertFunction(moduleName: string, value: FunctionMetadata): FunctionMetadata {\n return {\n __symbolic: 'function',\n parameters: value.parameters,\n defaults: value.defaults && value.defaults.map(v => this.convertValue(moduleName, v)),\n value: this.convertValue(moduleName, value.value)\n };\n }\n\n private convertValue(moduleName: string, value: MetadataValue): MetadataValue {\n if (isPrimitive(value)) {\n return value;\n }\n if (isMetadataError(value)) {\n return this.convertError(moduleName, value);\n }\n if (isMetadataSymbolicExpression(value)) {\n return this.convertExpression(moduleName, value) !;\n }\n if (Array.isArray(value)) {\n return value.map(v => this.convertValue(moduleName, v));\n }\n\n // Otherwise it is a metadata object.\n const object = value as MetadataObject;\n const result: MetadataObject = {};\n for (const key in object) {\n result[key] = this.convertValue(moduleName, object[key]);\n }\n return result;\n }\n\n private convertExpression(\n moduleName: string, value: MetadataSymbolicExpression|MetadataError|null|\n undefined): MetadataSymbolicExpression|MetadataError|undefined|null {\n if (value) {\n switch (value.__symbolic) {\n case 'error':\n return this.convertError(moduleName, value as MetadataError);\n case 'reference':\n return this.convertReference(moduleName, value as MetadataSymbolicReferenceExpression);\n default:\n return this.convertExpressionNode(moduleName, value);\n }\n }\n return value;\n }\n\n private convertError(module: string, value: MetadataError): MetadataError {\n return {\n __symbolic: 'error',\n message: value.message,\n line: value.line,\n character: value.character,\n context: value.context, module\n };\n }\n\n private convertReference(moduleName: string, value: MetadataSymbolicReferenceExpression):\n MetadataSymbolicReferenceExpression|MetadataError|undefined {\n const createReference = (symbol: Symbol): MetadataSymbolicReferenceExpression => {\n const declaration = symbol.declaration !;\n if (declaration.module.startsWith('.')) {\n // Reference to a symbol defined in the module. Ensure it is converted then return a\n // references to the final symbol.\n this.convertSymbol(symbol);\n return {\n __symbolic: 'reference',\n get name() {\n // Resolved lazily because private names are assigned late.\n const canonicalSymbol = symbol.canonicalSymbol !;\n if (canonicalSymbol.isPrivate == null) {\n throw Error('Invalid state: isPrivate was not initialized');\n }\n return canonicalSymbol.isPrivate ? canonicalSymbol.privateName ! : canonicalSymbol.name;\n }\n };\n } else {\n // The symbol was a re-exported symbol from another module. Return a reference to the\n // original imported symbol.\n return {__symbolic: 'reference', name: declaration.name, module: declaration.module};\n }\n };\n\n if (isMetadataGlobalReferenceExpression(value)) {\n const metadata = this.getMetadata(moduleName);\n if (metadata && metadata.metadata && metadata.metadata[value.name]) {\n // Reference to a symbol defined in the module\n return createReference(this.canonicalSymbolOf(moduleName, value.name));\n }\n\n // If a reference has arguments, the arguments need to be converted.\n if (value.arguments) {\n return {\n __symbolic: 'reference',\n name: value.name,\n arguments: value.arguments.map(a => this.convertValue(moduleName, a))\n };\n }\n\n // Global references without arguments (such as to Math or JSON) are unmodified.\n return value;\n }\n\n if (isMetadataImportedSymbolReferenceExpression(value)) {\n // References to imported symbols are separated into two, references to bundled modules and\n // references to modules external to the bundle. If the module reference is relative it is\n // assumed to be in the bundle. If it is Global it is assumed to be outside the bundle.\n // References to symbols outside the bundle are left unmodified. References to symbol inside\n // the bundle need to be converted to a bundle import reference reachable from the bundle\n // index.\n\n if (value.module.startsWith('.')) {\n // Reference is to a symbol defined inside the module. Convert the reference to a reference\n // to the canonical symbol.\n const referencedModule = resolveModule(value.module, moduleName);\n const referencedName = value.name;\n return createReference(this.canonicalSymbolOf(referencedModule, referencedName));\n }\n\n // Value is a reference to a symbol defined outside the module.\n if (value.arguments) {\n // If a reference has arguments the arguments need to be converted.\n return {\n __symbolic: 'reference',\n name: value.name,\n module: value.module,\n arguments: value.arguments.map(a => this.convertValue(moduleName, a))\n };\n }\n return value;\n }\n\n if (isMetadataModuleReferenceExpression(value)) {\n // Cannot support references to bundled modules as the internal modules of a bundle are erased\n // by the bundler.\n if (value.module.startsWith('.')) {\n return {\n __symbolic: 'error',\n message: 'Unsupported bundled module reference',\n context: {module: value.module}\n };\n }\n\n // References to unbundled modules are unmodified.\n return value;\n }\n }\n\n private convertExpressionNode(moduleName: string, value: MetadataSymbolicExpression):\n MetadataSymbolicExpression {\n const result: MetadataSymbolicExpression = { __symbolic: value.__symbolic } as any;\n for (const key in value) {\n (result as any)[key] = this.convertValue(moduleName, (value as any)[key]);\n }\n return result;\n }\n\n private symbolOf(module: string, name: string): Symbol {\n const symbolKey = `${module}:${name}`;\n let symbol = this.symbolMap.get(symbolKey);\n if (!symbol) {\n symbol = {module, name};\n this.symbolMap.set(symbolKey, symbol);\n }\n return symbol;\n }\n\n private canonicalSymbolOf(module: string, name: string): Symbol {\n // Ensure the module has been seen.\n this.exportAll(module);\n const symbol = this.symbolOf(module, name);\n if (!symbol.canonicalSymbol) {\n this.canonicalizeSymbol(symbol);\n }\n return symbol;\n }\n}\n\nexport class CompilerHostAdapter implements MetadataBundlerHost {\n private collector = new MetadataCollector();\n\n constructor(private host: ts.CompilerHost) {}\n\n getMetadataFor(fileName: string): ModuleMetadata|undefined {\n const sourceFile = this.host.getSourceFile(fileName + '.ts', ts.ScriptTarget.Latest);\n return sourceFile && this.collector.getMetadata(sourceFile);\n }\n}\n\nfunction resolveModule(importName: string, from: string): string {\n if (importName.startsWith('.') && from) {\n let normalPath = path.normalize(path.join(path.dirname(from), importName));\n if (!normalPath.startsWith('.') && from.startsWith('.')) {\n // path.normalize() preserves leading '../' but not './'. This adds it back.\n normalPath = `.${path.sep}${normalPath}`;\n }\n // Replace windows path delimiters with forward-slashes. Otherwise the paths are not\n // TypeScript compatible when building the bundle.\n return normalPath.replace(/\\\\/g, '/');\n }\n return importName;\n}\n\nfunction isPrimitive(o: any): o is boolean|string|number {\n return o === null || (typeof o !== 'function' && typeof o !== 'object');\n}\n\nfunction getRootExport(symbol: Symbol): Symbol {\n return symbol.reexportedAs ? getRootExport(symbol.reexportedAs) : symbol;\n}\n\nfunction getSymbolDeclaration(symbol: Symbol): Symbol {\n return symbol.exports ? getSymbolDeclaration(symbol.exports) : symbol;\n}\n"]}
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/bundler.ts"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,2BAA6B;AAC7B,+BAAiC;AAEjC,mDAAwD;AACxD,6CAA+mB;AAI/mB,mDAAmD;AACnD,IAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAgExD;IAOE,yBACY,IAAY,EAAU,QAA0B,EAAU,IAAyB;QAAnF,SAAI,GAAJ,IAAI,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAkB;QAAU,SAAI,GAAJ,IAAI,CAAqB;QAPvF,cAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtC,kBAAa,GAAG,IAAI,GAAG,EAAoC,CAAC;QAC5D,YAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;QAM5C,IAAI,CAAC,UAAU,GAAG,OAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAG,CAAC;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U,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,uBAAuB,MAAc;IACnC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3E,CAAC;AAED,8BAA8B,MAAc;IAC1C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACxE,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 */\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {MetadataCollector} from '../metadata/collector';\nimport {ClassMetadata, ConstructorMetadata, FunctionMetadata, METADATA_VERSION, MemberMetadata, MetadataEntry, MetadataError, MetadataImportedSymbolReferenceExpression, MetadataMap, MetadataObject, MetadataSymbolicExpression, MetadataSymbolicReferenceExpression, MetadataValue, MethodMetadata, ModuleExportMetadata, ModuleMetadata, isClassMetadata, isConstructorMetadata, isFunctionMetadata, isInterfaceMetadata, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportedSymbolReferenceExpression, isMetadataModuleReferenceExpression, isMetadataSymbolicExpression, isMethodMetadata} from '../metadata/schema';\n\n\n\n// The character set used to produce private names.\nconst PRIVATE_NAME_CHARS = 'abcdefghijklmnopqrstuvwxyz';\n\ninterface Symbol {\n module: string;\n name: string;\n\n // Produced by indirectly by exportAll() for symbols re-export another symbol.\n exports?: Symbol;\n\n // Produced by indirectly by exportAll() for symbols are re-exported by another symbol.\n reexportedAs?: Symbol;\n\n // Produced by canonicalizeSymbols() for all symbols. A symbol is private if it is not\n // exported by the index.\n isPrivate?: boolean;\n\n // Produced by canonicalizeSymbols() for all symbols. This is the one symbol that\n // respresents all other symbols and is the only symbol that, among all the re-exported\n // aliases, whose fields can be trusted to contain the correct information.\n // For private symbols this is the declaration symbol. For public symbols this is the\n // symbol that is exported.\n canonicalSymbol?: Symbol;\n\n // Produced by canonicalizeSymbols() for all symbols. This the symbol that originally\n // declared the value and should be used to fetch the value.\n declaration?: Symbol;\n\n // A symbol is referenced if it is exported from index or referenced by the value of\n // a referenced symbol's value.\n referenced?: boolean;\n\n // A symbol is marked as a re-export the symbol was rexported from a module that is\n // not part of the flat module bundle.\n reexport?: boolean;\n\n // Only valid for referenced canonical symbols. Produces by convertSymbols().\n value?: MetadataEntry;\n\n // Only valid for referenced private symbols. It is the name to use to import the symbol from\n // the bundle index. Produce by assignPrivateNames();\n privateName?: string;\n}\n\nexport interface BundleEntries { [name: string]: MetadataEntry; }\n\nexport interface BundlePrivateEntry {\n privateName: string;\n name: string;\n module: string;\n}\n\nexport interface BundledModule {\n metadata: ModuleMetadata;\n privates: BundlePrivateEntry[];\n}\n\nexport interface MetadataBundlerHost {\n getMetadataFor(moduleName: string): ModuleMetadata|undefined;\n}\n\ntype StaticsMetadata = {\n [name: string]: MetadataValue | FunctionMetadata;\n};\n\nexport class MetadataBundler {\n private symbolMap = new Map<string, Symbol>();\n private metadataCache = new Map<string, ModuleMetadata|undefined>();\n private exports = new Map<string, Symbol[]>();\n private rootModule: string;\n private exported: Set<Symbol>;\n\n constructor(\n private root: string, private importAs: string|undefined, private host: MetadataBundlerHost) {\n this.rootModule = `./${path.basename(root)}`;\n }\n\n getMetadataBundle(): BundledModule {\n // Export the root module. This also collects the transitive closure of all values referenced by\n // the exports.\n const exportedSymbols = this.exportAll(this.rootModule);\n this.canonicalizeSymbols(exportedSymbols);\n // TODO: exports? e.g. a module re-exports a symbol from another bundle\n const metadata = this.getEntries(exportedSymbols);\n const privates = Array.from(this.symbolMap.values())\n .filter(s => s.referenced && s.isPrivate)\n .map(s => ({\n privateName: s.privateName !,\n name: s.declaration !.name,\n module: s.declaration !.module\n }));\n const origins = Array.from(this.symbolMap.values())\n .filter(s => s.referenced && !s.reexport)\n .reduce<{[name: string]: string}>((p, s) => {\n p[s.isPrivate ? s.privateName ! : s.name] = s.declaration !.module;\n return p;\n }, {});\n const exports = this.getReExports(exportedSymbols);\n return {\n metadata: {\n __symbolic: 'module',\n version: METADATA_VERSION,\n exports: exports.length ? exports : undefined, metadata, origins,\n importAs: this.importAs !\n },\n privates\n };\n }\n\n static resolveModule(importName: string, from: string): string {\n return resolveModule(importName, from);\n }\n\n private getMetadata(moduleName: string): ModuleMetadata|undefined {\n let result = this.metadataCache.get(moduleName);\n if (!result) {\n if (moduleName.startsWith('.')) {\n const fullModuleName = resolveModule(moduleName, this.root);\n result = this.host.getMetadataFor(fullModuleName);\n }\n this.metadataCache.set(moduleName, result);\n }\n return result;\n }\n\n private exportAll(moduleName: string): Symbol[] {\n const module = this.getMetadata(moduleName);\n let result = this.exports.get(moduleName);\n\n if (result) {\n return result;\n }\n\n result = [];\n\n const exportSymbol = (exportedSymbol: Symbol, exportAs: string) => {\n const symbol = this.symbolOf(moduleName, exportAs);\n result !.push(symbol);\n exportedSymbol.reexportedAs = symbol;\n symbol.exports = exportedSymbol;\n };\n\n // Export all the symbols defined in this module.\n if (module && module.metadata) {\n for (let key in module.metadata) {\n const data = module.metadata[key];\n if (isMetadataImportedSymbolReferenceExpression(data)) {\n // This is a re-export of an imported symbol. Record this as a re-export.\n const exportFrom = resolveModule(data.module, moduleName);\n this.exportAll(exportFrom);\n const symbol = this.symbolOf(exportFrom, data.name);\n exportSymbol(symbol, key);\n } else {\n // Record that this symbol is exported by this module.\n result.push(this.symbolOf(moduleName, key));\n }\n }\n }\n\n // Export all the re-exports from this module\n if (module && module.exports) {\n for (const exportDeclaration of module.exports) {\n const exportFrom = resolveModule(exportDeclaration.from, moduleName);\n // Record all the exports from the module even if we don't use it directly.\n const exportedSymbols = this.exportAll(exportFrom);\n if (exportDeclaration.export) {\n // Re-export all the named exports from a module.\n for (const exportItem of exportDeclaration.export) {\n const name = typeof exportItem == 'string' ? exportItem : exportItem.name;\n const exportAs = typeof exportItem == 'string' ? exportItem : exportItem.as;\n const symbol = this.symbolOf(exportFrom, name);\n if (exportedSymbols && exportedSymbols.length == 1 && exportedSymbols[0].reexport &&\n exportedSymbols[0].name == '*') {\n // This is a named export from a module we have no metadata about. Record the named\n // export as a re-export.\n symbol.reexport = true;\n }\n exportSymbol(this.symbolOf(exportFrom, name), exportAs);\n }\n } else {\n // Re-export all the symbols from the module\n const exportedSymbols = this.exportAll(exportFrom);\n for (const exportedSymbol of exportedSymbols) {\n const name = exportedSymbol.name;\n exportSymbol(exportedSymbol, name);\n }\n }\n }\n }\n\n if (!module) {\n // If no metadata is found for this import then it is considered external to the\n // library and should be recorded as a re-export in the final metadata if it is\n // eventually re-exported.\n const symbol = this.symbolOf(moduleName, '*');\n symbol.reexport = true;\n result.push(symbol);\n }\n this.exports.set(moduleName, result);\n\n return result;\n }\n\n /**\n * Fill in the canonicalSymbol which is the symbol that should be imported by factories.\n * The canonical symbol is the one exported by the index file for the bundle or definition\n * symbol for private symbols that are not exported by bundle index.\n */\n private canonicalizeSymbols(exportedSymbols: Symbol[]) {\n const symbols = Array.from(this.symbolMap.values());\n this.exported = new Set(exportedSymbols);\n symbols.forEach(this.canonicalizeSymbol, this);\n }\n\n private canonicalizeSymbol(symbol: Symbol) {\n const rootExport = getRootExport(symbol);\n const declaration = getSymbolDeclaration(symbol);\n const isPrivate = !this.exported.has(rootExport);\n const canonicalSymbol = isPrivate ? declaration : rootExport;\n symbol.isPrivate = isPrivate;\n symbol.declaration = declaration;\n symbol.canonicalSymbol = canonicalSymbol;\n symbol.reexport = declaration.reexport;\n }\n\n private getEntries(exportedSymbols: Symbol[]): BundleEntries {\n const result: BundleEntries = {};\n\n const exportedNames = new Set(exportedSymbols.map(s => s.name));\n let privateName = 0;\n\n function newPrivateName(): string {\n while (true) {\n let digits: string[] = [];\n let index = privateName++;\n let base = PRIVATE_NAME_CHARS;\n while (!digits.length || index > 0) {\n digits.unshift(base[index % base.length]);\n index = Math.floor(index / base.length);\n }\n digits.unshift('\\u0275');\n const result = digits.join('');\n if (!exportedNames.has(result)) return result;\n }\n }\n\n exportedSymbols.forEach(symbol => this.convertSymbol(symbol));\n\n const symbolsMap = new Map<string, string[]>();\n Array.from(this.symbolMap.values()).forEach(symbol => {\n if (symbol.referenced && !symbol.reexport) {\n let name = symbol.name;\n const identifier = `${symbol.declaration!.module}:${symbol.declaration !.name}`;\n if (symbol.isPrivate && !symbol.privateName) {\n name = newPrivateName();\n symbol.privateName = name;\n }\n if (symbolsMap.has(identifier)) {\n const names = symbolsMap.get(identifier);\n names !.push(name);\n } else {\n symbolsMap.set(identifier, [name]);\n }\n result[name] = symbol.value !;\n }\n });\n\n // check for duplicated entries\n symbolsMap.forEach((names: string[], identifier: string) => {\n if (names.length > 1) {\n const [module, declaredName] = identifier.split(':');\n // prefer the export that uses the declared name (if any)\n let reference = names.indexOf(declaredName);\n if (reference === -1) {\n reference = 0;\n }\n\n // keep one entry and replace the others by references\n names.forEach((name: string, i: number) => {\n if (i !== reference) {\n result[name] = {__symbolic: 'reference', name: names[reference]};\n }\n });\n }\n });\n\n return result;\n }\n\n private getReExports(exportedSymbols: Symbol[]): ModuleExportMetadata[] {\n type ExportClause = {name: string, as: string}[];\n const modules = new Map<string, ExportClause>();\n const exportAlls = new Set<string>();\n for (const symbol of exportedSymbols) {\n if (symbol.reexport) {\n // symbol.declaration is guarenteed to be defined during the phase this method is called.\n const declaration = symbol.declaration !;\n const module = declaration.module;\n if (declaration !.name == '*') {\n // Reexport all the symbols.\n exportAlls.add(declaration.module);\n } else {\n // Re-export the symbol as the exported name.\n let entry = modules.get(module);\n if (!entry) {\n entry = [];\n modules.set(module, entry);\n }\n const as = symbol.name;\n const name = declaration.name;\n entry.push({name, as});\n }\n }\n }\n return [\n ...Array.from(exportAlls.values()).map(from => ({from})),\n ...Array.from(modules.entries()).map(([from, exports]) => ({export: exports, from}))\n ];\n }\n\n private convertSymbol(symbol: Symbol) {\n // canonicalSymbol is ensured to be defined before this is called.\n const canonicalSymbol = symbol.canonicalSymbol !;\n\n if (!canonicalSymbol.referenced) {\n canonicalSymbol.referenced = true;\n // declaration is ensured to be definded before this method is called.\n const declaration = canonicalSymbol.declaration !;\n const module = this.getMetadata(declaration.module);\n if (module) {\n const value = module.metadata[declaration.name];\n if (value && !declaration.name.startsWith('___')) {\n canonicalSymbol.value = this.convertEntry(declaration.module, value);\n }\n }\n }\n }\n\n private convertEntry(moduleName: string, value: MetadataEntry): MetadataEntry {\n if (isClassMetadata(value)) {\n return this.convertClass(moduleName, value);\n }\n if (isFunctionMetadata(value)) {\n return this.convertFunction(moduleName, value);\n }\n if (isInterfaceMetadata(value)) {\n return value;\n }\n return this.convertValue(moduleName, value);\n }\n\n private convertClass(moduleName: string, value: ClassMetadata): ClassMetadata {\n return {\n __symbolic: 'class',\n arity: value.arity,\n extends: this.convertExpression(moduleName, value.extends) !,\n decorators:\n value.decorators && value.decorators.map(d => this.convertExpression(moduleName, d) !),\n members: this.convertMembers(moduleName, value.members !),\n statics: value.statics && this.convertStatics(moduleName, value.statics)\n };\n }\n\n private convertMembers(moduleName: string, members: MetadataMap): MetadataMap {\n const result: MetadataMap = {};\n for (const name in members) {\n const value = members[name];\n result[name] = value.map(v => this.convertMember(moduleName, v));\n }\n return result;\n }\n\n private convertMember(moduleName: string, member: MemberMetadata) {\n const result: MemberMetadata = {__symbolic: member.__symbolic};\n result.decorators =\n member.decorators && member.decorators.map(d => this.convertExpression(moduleName, d) !);\n if (isMethodMetadata(member)) {\n (result as MethodMetadata).parameterDecorators = member.parameterDecorators &&\n member.parameterDecorators.map(\n d => d && d.map(p => this.convertExpression(moduleName, p) !));\n if (isConstructorMetadata(member)) {\n if (member.parameters) {\n (result as ConstructorMetadata).parameters =\n member.parameters.map(p => this.convertExpression(moduleName, p));\n }\n }\n }\n return result;\n }\n\n private convertStatics(moduleName: string, statics: StaticsMetadata): StaticsMetadata {\n let result: StaticsMetadata = {};\n for (const key in statics) {\n const value = statics[key];\n result[key] = isFunctionMetadata(value) ? this.convertFunction(moduleName, value) : value;\n }\n return result;\n }\n\n private convertFunction(moduleName: string, value: FunctionMetadata): FunctionMetadata {\n return {\n __symbolic: 'function',\n parameters: value.parameters,\n defaults: value.defaults && value.defaults.map(v => this.convertValue(moduleName, v)),\n value: this.convertValue(moduleName, value.value)\n };\n }\n\n private convertValue(moduleName: string, value: MetadataValue): MetadataValue {\n if (isPrimitive(value)) {\n return value;\n }\n if (isMetadataError(value)) {\n return this.convertError(moduleName, value);\n }\n if (isMetadataSymbolicExpression(value)) {\n return this.convertExpression(moduleName, value) !;\n }\n if (Array.isArray(value)) {\n return value.map(v => this.convertValue(moduleName, v));\n }\n\n // Otherwise it is a metadata object.\n const object = value as MetadataObject;\n const result: MetadataObject = {};\n for (const key in object) {\n result[key] = this.convertValue(moduleName, object[key]);\n }\n return result;\n }\n\n private convertExpression(\n moduleName: string, value: MetadataSymbolicExpression|MetadataError|null|\n undefined): MetadataSymbolicExpression|MetadataError|undefined|null {\n if (value) {\n switch (value.__symbolic) {\n case 'error':\n return this.convertError(moduleName, value as MetadataError);\n case 'reference':\n return this.convertReference(moduleName, value as MetadataSymbolicReferenceExpression);\n default:\n return this.convertExpressionNode(moduleName, value);\n }\n }\n return value;\n }\n\n private convertError(module: string, value: MetadataError): MetadataError {\n return {\n __symbolic: 'error',\n message: value.message,\n line: value.line,\n character: value.character,\n context: value.context, module\n };\n }\n\n private convertReference(moduleName: string, value: MetadataSymbolicReferenceExpression):\n MetadataSymbolicReferenceExpression|MetadataError|undefined {\n const createReference = (symbol: Symbol): MetadataSymbolicReferenceExpression => {\n const declaration = symbol.declaration !;\n if (declaration.module.startsWith('.')) {\n // Reference to a symbol defined in the module. Ensure it is converted then return a\n // references to the final symbol.\n this.convertSymbol(symbol);\n return {\n __symbolic: 'reference',\n get name() {\n // Resolved lazily because private names are assigned late.\n const canonicalSymbol = symbol.canonicalSymbol !;\n if (canonicalSymbol.isPrivate == null) {\n throw Error('Invalid state: isPrivate was not initialized');\n }\n return canonicalSymbol.isPrivate ? canonicalSymbol.privateName ! : canonicalSymbol.name;\n }\n };\n } else {\n // The symbol was a re-exported symbol from another module. Return a reference to the\n // original imported symbol.\n return {__symbolic: 'reference', name: declaration.name, module: declaration.module};\n }\n };\n\n if (isMetadataGlobalReferenceExpression(value)) {\n const metadata = this.getMetadata(moduleName);\n if (metadata && metadata.metadata && metadata.metadata[value.name]) {\n // Reference to a symbol defined in the module\n return createReference(this.canonicalSymbolOf(moduleName, value.name));\n }\n\n // If a reference has arguments, the arguments need to be converted.\n if (value.arguments) {\n return {\n __symbolic: 'reference',\n name: value.name,\n arguments: value.arguments.map(a => this.convertValue(moduleName, a))\n };\n }\n\n // Global references without arguments (such as to Math or JSON) are unmodified.\n return value;\n }\n\n if (isMetadataImportedSymbolReferenceExpression(value)) {\n // References to imported symbols are separated into two, references to bundled modules and\n // references to modules external to the bundle. If the module reference is relative it is\n // assumed to be in the bundle. If it is Global it is assumed to be outside the bundle.\n // References to symbols outside the bundle are left unmodified. References to symbol inside\n // the bundle need to be converted to a bundle import reference reachable from the bundle\n // index.\n\n if (value.module.startsWith('.')) {\n // Reference is to a symbol defined inside the module. Convert the reference to a reference\n // to the canonical symbol.\n const referencedModule = resolveModule(value.module, moduleName);\n const referencedName = value.name;\n return createReference(this.canonicalSymbolOf(referencedModule, referencedName));\n }\n\n // Value is a reference to a symbol defined outside the module.\n if (value.arguments) {\n // If a reference has arguments the arguments need to be converted.\n return {\n __symbolic: 'reference',\n name: value.name,\n module: value.module,\n arguments: value.arguments.map(a => this.convertValue(moduleName, a))\n };\n }\n return value;\n }\n\n if (isMetadataModuleReferenceExpression(value)) {\n // Cannot support references to bundled modules as the internal modules of a bundle are erased\n // by the bundler.\n if (value.module.startsWith('.')) {\n return {\n __symbolic: 'error',\n message: 'Unsupported bundled module reference',\n context: {module: value.module}\n };\n }\n\n // References to unbundled modules are unmodified.\n return value;\n }\n }\n\n private convertExpressionNode(moduleName: string, value: MetadataSymbolicExpression):\n MetadataSymbolicExpression {\n const result: MetadataSymbolicExpression = { __symbolic: value.__symbolic } as any;\n for (const key in value) {\n (result as any)[key] = this.convertValue(moduleName, (value as any)[key]);\n }\n return result;\n }\n\n private symbolOf(module: string, name: string): Symbol {\n const symbolKey = `${module}:${name}`;\n let symbol = this.symbolMap.get(symbolKey);\n if (!symbol) {\n symbol = {module, name};\n this.symbolMap.set(symbolKey, symbol);\n }\n return symbol;\n }\n\n private canonicalSymbolOf(module: string, name: string): Symbol {\n // Ensure the module has been seen.\n this.exportAll(module);\n const symbol = this.symbolOf(module, name);\n if (!symbol.canonicalSymbol) {\n this.canonicalizeSymbol(symbol);\n }\n return symbol;\n }\n}\n\nexport class CompilerHostAdapter implements MetadataBundlerHost {\n private collector = new MetadataCollector();\n\n constructor(private host: ts.CompilerHost) {}\n\n getMetadataFor(fileName: string): ModuleMetadata|undefined {\n if (!this.host.fileExists(fileName + '.ts')) return undefined;\n const sourceFile = this.host.getSourceFile(fileName + '.ts', ts.ScriptTarget.Latest);\n return sourceFile && this.collector.getMetadata(sourceFile);\n }\n}\n\nfunction resolveModule(importName: string, from: string): string {\n if (importName.startsWith('.') && from) {\n let normalPath = path.normalize(path.join(path.dirname(from), importName));\n if (!normalPath.startsWith('.') && from.startsWith('.')) {\n // path.normalize() preserves leading '../' but not './'. This adds it back.\n normalPath = `.${path.sep}${normalPath}`;\n }\n // Replace windows path delimiters with forward-slashes. Otherwise the paths are not\n // TypeScript compatible when building the bundle.\n return normalPath.replace(/\\\\/g, '/');\n }\n return importName;\n}\n\nfunction isPrimitive(o: any): o is boolean|string|number {\n return o === null || (typeof o !== 'function' && typeof o !== 'object');\n}\n\nfunction getRootExport(symbol: Symbol): Symbol {\n return symbol.reexportedAs ? getRootExport(symbol.reexportedAs) : symbol;\n}\n\nfunction getSymbolDeclaration(symbol: Symbol): Symbol {\n return symbol.exports ? getSymbolDeclaration(symbol.exports) : symbol;\n}\n"]}
@@ -199,7 +199,12 @@ var TsCompilerAotCompilerTypeCheckHostAdapter = /** @class */ (function () {
199
199
  resourceName = "./" + resourceName;
200
200
  }
201
201
  var filePathWithNgResource = this.moduleNameToFileName(addNgResourceSuffix(resourceName), containingFile);
202
- return filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;
202
+ var result = filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;
203
+ // Used under Bazel to report more specific error with remediation advice
204
+ if (!result && this.context.reportMissingResource) {
205
+ this.context.reportMissingResource(resourceName);
206
+ }
207
+ return result;
203
208
  };
204
209
  TsCompilerAotCompilerTypeCheckHostAdapter.prototype.toSummaryFileName = function (fileName, referringSrcFileName) {
205
210
  return this.fileNameToModuleName(fileName, referringSrcFileName);
@@ -1 +1 @@
1
- {"version":3,"file":"compiler_host.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/compiler_host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuL;AACvL,2BAA6B;AAC7B,+BAAiC;AAMjC,qDAA8F;AAC9F,+BAA6E;AAE7E,IAAM,yBAAyB,GAAG,6CAA6C,CAAC;AAChF,IAAM,GAAG,GAAG,kCAAkC,CAAC;AAE/C,4BACI,EACwD;QADvD,oBAAO,EAAE,cAA6C,EAA7C,kEAA6C;IAEzD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAJD,gDAIC;AAiBD,gBAAmB,SAA+B;IAChD,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,qCAAqC;IACvC,CAAC;IACD,MAAM,CAAC,SAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH;IAqBE,mDACY,SAAgC,EAAU,OAAwB,EAClE,OAAqB,EAAU,gBAAkC,EACjE,aAA4B,EAC5B,gBAAoD;QAApD,iCAAA,EAAA,uBAAuB,GAAG,EAA0B;QAJhE,iBAgDC;QA/CW,cAAS,GAAT,SAAS,CAAuB;QAAU,Y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,KAAK,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,wBAAwB,QAAgB;IACtC,IAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,gCAAgC,QAAgB;IAC9C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,8BAA8B,QAAgB;IAC5C,IAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,+BAA+B,QAAgB;IAC7C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,6BAA6B,QAAgB;IAC3C,MAAM,CAAI,QAAQ,kBAAe,CAAC;AACpC,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 {AotCompilerHost, EmitterVisitorContext, ExternalReference, GeneratedFile, ParseSourceSpan, TypeScriptEmitter, collectExternalReferences, syntaxError} from '@angular/compiler';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost} from '../diagnostics/translate_diagnostics';\nimport {METADATA_VERSION, ModuleMetadata} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, LibrarySummary} from './api';\nimport {MetadataReaderHost, createMetadataReaderCache, readMetadata} from './metadata_reader';\nimport {DTS, GENERATED_FILES, isInRootDir, relativeToRootDirs} from './util';\n\nconst NODE_MODULES_PACKAGE_NAME = /node_modules\\/((\\w|-)+|(@(\\w|-)+\\/(\\w|-)+))/;\nconst EXT = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\n\nexport function createCompilerHost(\n {options, tsHost = ts.createCompilerHost(options, true)}:\n {options: CompilerOptions, tsHost?: ts.CompilerHost}): CompilerHost {\n return tsHost;\n}\n\nexport interface MetadataProvider {\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined;\n}\n\ninterface GenSourceFile {\n externalReferences: Set<string>;\n sourceFile: ts.SourceFile;\n emitCtx: EmitterVisitorContext;\n}\n\nexport interface CodeGenerator {\n generateFile(genFileName: string, baseFileName?: string): GeneratedFile;\n findGeneratedFileNames(fileName: string): string[];\n}\n\nfunction assert<T>(condition: T | null | undefined) {\n if (!condition) {\n // TODO(chuckjaz): do the right thing\n }\n return condition !;\n}\n\n/**\n * Implements the following hosts based on an api.CompilerHost:\n * - ts.CompilerHost to be consumed by a ts.Program\n * - AotCompilerHost for @angular/compiler\n * - TypeCheckHost for mapping ts errors to ng errors (via translateDiagnostics)\n */\nexport class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHost, AotCompilerHost,\n TypeCheckHost {\n private metadataReaderCache = createMetadataReaderCache();\n private flatModuleIndexCache = new Map<string, boolean>();\n private flatModuleIndexNames = new Set<string>();\n private flatModuleIndexRedirectNames = new Set<string>();\n private rootDirs: string[];\n private moduleResolutionCache: ts.ModuleResolutionCache;\n private originalSourceFiles = new Map<string, ts.SourceFile|null>();\n private originalFileExistsCache = new Map<string, boolean>();\n private generatedSourceFiles = new Map<string, GenSourceFile>();\n private generatedCodeFor = new Map<string, string[]>();\n private emitter = new TypeScriptEmitter();\n private metadataReaderHost: MetadataReaderHost;\n\n getCancellationToken: () => ts.CancellationToken;\n getDefaultLibLocation: () => string;\n trace: (s: string) => void;\n getDirectories: (path: string) => string[];\n directoryExists?: (directoryName: string) => boolean;\n\n constructor(\n private rootFiles: ReadonlyArray<string>, private options: CompilerOptions,\n private context: CompilerHost, private metadataProvider: MetadataProvider,\n private codeGenerator: CodeGenerator,\n private librarySummaries = new Map<string, LibrarySummary>()) {\n this.moduleResolutionCache = ts.createModuleResolutionCache(\n this.context.getCurrentDirectory !(), this.context.getCanonicalFileName.bind(this.context));\n const basePath = this.options.basePath !;\n this.rootDirs =\n (this.options.rootDirs || [this.options.basePath !]).map(p => path.resolve(basePath, p));\n if (context.getDirectories) {\n this.getDirectories = path => context.getDirectories !(path);\n }\n if (context.directoryExists) {\n this.directoryExists = directoryName => context.directoryExists !(directoryName);\n }\n if (context.getCancellationToken) {\n this.getCancellationToken = () => context.getCancellationToken !();\n }\n if (context.getDefaultLibLocation) {\n this.getDefaultLibLocation = () => context.getDefaultLibLocation !();\n }\n if (context.trace) {\n this.trace = s => context.trace !(s);\n }\n if (context.fileNameToModuleName) {\n this.fileNameToModuleName = context.fileNameToModuleName.bind(context);\n }\n // Note: don't copy over context.moduleNameToFileName as we first\n // normalize undefined containingFile to a filled containingFile.\n if (context.resourceNameToFileName) {\n this.resourceNameToFileName = context.resourceNameToFileName.bind(context);\n }\n if (context.toSummaryFileName) {\n this.toSummaryFileName = context.toSummaryFileName.bind(context);\n }\n if (context.fromSummaryFileName) {\n this.fromSummaryFileName = context.fromSummaryFileName.bind(context);\n }\n this.metadataReaderHost = {\n cacheMetadata: () => true,\n getSourceFileMetadata: (filePath) => {\n const sf = this.getOriginalSourceFile(filePath);\n return sf ? this.metadataProvider.getMetadata(sf) : undefined;\n },\n fileExists: (filePath) => this.originalFileExists(filePath),\n readFile: (filePath) => assert(this.context.readFile(filePath)),\n };\n }\n\n private resolveModuleName(moduleName: string, containingFile: string): ts.ResolvedModule\n |undefined {\n const rm = ts.resolveModuleName(\n moduleName, containingFile.replace(/\\\\/g, '/'), this.options, this,\n this.moduleResolutionCache)\n .resolvedModule;\n if (rm && this.isSourceFile(rm.resolvedFileName) && DTS.test(rm.resolvedFileName)) {\n // Case: generateCodeForLibraries = true and moduleName is\n // a .d.ts file in a node_modules folder.\n // Need to set isExternalLibraryImport to false so that generated files for that file\n // are emitted.\n rm.isExternalLibraryImport = false;\n }\n return rm;\n }\n\n // Note: We implement this method so that TypeScript and Angular share the same\n // ts.ModuleResolutionCache\n // and that we can tell ts.Program about our different opinion about\n // ResolvedModule.isExternalLibraryImport\n // (see our isSourceFile method).\n resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[] {\n // TODO(tbosch): this seems to be a typing error in TypeScript,\n // as it contains assertions that the result contains the same number of entries\n // as the given module names.\n return <ts.ResolvedModule[]>moduleNames.map(\n moduleName => this.resolveModuleName(moduleName, containingFile));\n }\n\n moduleNameToFileName(m: string, containingFile?: string): string|null {\n if (!containingFile) {\n if (m.indexOf('.') === 0) {\n throw new Error('Resolution of relative paths requires a containing file.');\n }\n // Any containing file gives the same result for absolute imports\n containingFile = this.rootFiles[0];\n }\n if (this.context.moduleNameToFileName) {\n return this.context.moduleNameToFileName(m, containingFile);\n }\n const resolved = this.resolveModuleName(m, containingFile);\n return resolved ? resolved.resolvedFileName : null;\n }\n\n /**\n * We want a moduleId that will appear in import statements in the generated code\n * which will be written to `containingFile`.\n *\n * Note that we also generate files for files in node_modules, as libraries\n * only ship .metadata.json files but not the generated code.\n *\n * Logic:\n * 1. if the importedFile and the containingFile are from the project sources\n * or from the same node_modules package, use a relative path\n * 2. if the importedFile is in a node_modules package,\n * use a path that starts with the package name.\n * 3. Error if the containingFile is in the node_modules package\n * and the importedFile is in the project soures,\n * as that is a violation of the principle that node_modules packages cannot\n * import project sources.\n */\n fileNameToModuleName(importedFile: string, containingFile: string): string {\n const originalImportedFile = importedFile;\n if (this.options.traceResolution) {\n console.error(\n 'fileNameToModuleName from containingFile', containingFile, 'to importedFile',\n importedFile);\n }\n\n // drop extension\n importedFile = importedFile.replace(EXT, '');\n const importedFilePackagName = getPackageName(importedFile);\n const containingFilePackageName = getPackageName(containingFile);\n\n let moduleName: string;\n if (importedFilePackagName === containingFilePackageName ||\n GENERATED_FILES.test(originalImportedFile)) {\n const rootedContainingFile = relativeToRootDirs(containingFile, this.rootDirs);\n const rootedImportedFile = relativeToRootDirs(importedFile, this.rootDirs);\n\n if (rootedContainingFile !== containingFile && rootedImportedFile !== importedFile) {\n // if both files are contained in the `rootDirs`, then strip the rootDirs\n containingFile = rootedContainingFile;\n importedFile = rootedImportedFile;\n }\n moduleName = dotRelative(path.dirname(containingFile), importedFile);\n } else if (importedFilePackagName) {\n moduleName = stripNodeModulesPrefix(importedFile);\n } else {\n throw new Error(\n `Trying to import a source file from a node_modules package: import ${originalImportedFile} from ${containingFile}`);\n }\n return moduleName;\n }\n\n resourceNameToFileName(resourceName: string, containingFile: string): string|null {\n // Note: we convert package paths into relative paths to be compatible with the the\n // previous implementation of UrlResolver.\n const firstChar = resourceName[0];\n if (firstChar === '/') {\n resourceName = resourceName.slice(1);\n } else if (firstChar !== '.') {\n resourceName = `./${resourceName}`;\n }\n const filePathWithNgResource =\n this.moduleNameToFileName(addNgResourceSuffix(resourceName), containingFile);\n return filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;\n }\n\n toSummaryFileName(fileName: string, referringSrcFileName: string): string {\n return this.fileNameToModuleName(fileName, referringSrcFileName);\n }\n\n fromSummaryFileName(fileName: string, referringLibFileName: string): string {\n const resolved = this.moduleNameToFileName(fileName, referringLibFileName);\n if (!resolved) {\n throw new Error(`Could not resolve ${fileName} from ${referringLibFileName}`);\n }\n return resolved;\n }\n\n parseSourceSpanOf(fileName: string, line: number, character: number): ParseSourceSpan|null {\n const data = this.generatedSourceFiles.get(fileName);\n if (data && data.emitCtx) {\n return data.emitCtx.spanOf(line, character);\n }\n return null;\n }\n\n private getOriginalSourceFile(\n filePath: string, languageVersion?: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile|null {\n // Note: we need the explicit check via `has` as we also cache results\n // that were null / undefined.\n if (this.originalSourceFiles.has(filePath)) {\n return this.originalSourceFiles.get(filePath) !;\n }\n if (!languageVersion) {\n languageVersion = this.options.target || ts.ScriptTarget.Latest;\n }\n // Note: This can also return undefined,\n // as the TS typings are not correct!\n const sf = this.context.getSourceFile(filePath, languageVersion, onError) || null;\n this.originalSourceFiles.set(filePath, sf);\n return sf;\n }\n\n updateGeneratedFile(genFile: GeneratedFile): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const oldGenFile = this.generatedSourceFiles.get(genFile.genFileUrl);\n if (!oldGenFile) {\n throw new Error(`Illegal State: previous GeneratedFile not found for ${genFile.genFileUrl}.`);\n }\n const newRefs = genFileExternalReferences(genFile);\n const oldRefs = oldGenFile.externalReferences;\n let refsAreEqual = oldRefs.size === newRefs.size;\n if (refsAreEqual) {\n newRefs.forEach(r => refsAreEqual = refsAreEqual && oldRefs.has(r));\n }\n if (!refsAreEqual) {\n throw new Error(\n `Illegal State: external references changed in ${genFile.genFileUrl}.\\nOld: ${Array.from(oldRefs)}.\\nNew: ${Array.from(newRefs)}`);\n }\n return this.addGeneratedFile(genFile, newRefs);\n }\n\n private addGeneratedFile(genFile: GeneratedFile, externalReferences: Set<string>): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const {sourceText, context} = this.emitter.emitStatementsAndContext(\n genFile.genFileUrl, genFile.stmts, /* preamble */ '',\n /* emitSourceMaps */ false);\n const sf = ts.createSourceFile(\n genFile.genFileUrl, sourceText, this.options.target || ts.ScriptTarget.Latest);\n if ((this.options.module === ts.ModuleKind.AMD || this.options.module === ts.ModuleKind.UMD) &&\n this.context.amdModuleName) {\n const moduleName = this.context.amdModuleName(sf);\n if (moduleName) sf.moduleName = moduleName;\n }\n this.generatedSourceFiles.set(genFile.genFileUrl, {\n sourceFile: sf,\n emitCtx: context, externalReferences,\n });\n return sf;\n }\n\n shouldGenerateFile(fileName: string): {generate: boolean, baseFileName?: string} {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n if (!isInRootDir(fileName, this.options)) {\n return {generate: false};\n }\n const genMatch = GENERATED_FILES.exec(fileName);\n if (!genMatch) {\n return {generate: false};\n }\n const [, base, genSuffix, suffix] = genMatch;\n if (suffix !== 'ts' && suffix !== 'tsx') {\n return {generate: false};\n }\n let baseFileName: string|undefined;\n if (genSuffix.indexOf('ngstyle') >= 0) {\n // Note: ngstyle files have names like `afile.css.ngstyle.ts`\n if (!this.originalFileExists(base)) {\n return {generate: false};\n }\n } else {\n // Note: on-the-fly generated files always have a `.ts` suffix,\n // but the file from which we generated it can be a `.ts`/ `.tsx`/ `.d.ts`\n // (see options.generateCodeForLibraries).\n baseFileName = [`${base}.ts`, `${base}.tsx`, `${base}.d.ts`].find(\n baseFileName => this.isSourceFile(baseFileName) && this.originalFileExists(baseFileName));\n if (!baseFileName) {\n return {generate: false};\n }\n }\n return {generate: true, baseFileName};\n }\n\n shouldGenerateFilesFor(fileName: string) {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n return !GENERATED_FILES.test(fileName) && this.isSourceFile(fileName) &&\n isInRootDir(fileName, this.options);\n }\n\n getSourceFile(\n fileName: string, languageVersion: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile {\n // Note: Don't exit early in this method to make sure\n // we always have up to date references on the file!\n let genFileNames: string[] = [];\n let sf = this.getGeneratedFile(fileName);\n if (!sf) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n if (!summary.sourceFile) {\n summary.sourceFile = ts.createSourceFile(\n fileName, summary.text, this.options.target || ts.ScriptTarget.Latest);\n }\n sf = summary.sourceFile;\n genFileNames = [];\n }\n }\n if (!sf) {\n sf = this.getOriginalSourceFile(fileName);\n const cachedGenFiles = this.generatedCodeFor.get(fileName);\n if (cachedGenFiles) {\n genFileNames = cachedGenFiles;\n } else {\n if (!this.options.noResolve && this.shouldGenerateFilesFor(fileName)) {\n genFileNames = this.codeGenerator.findGeneratedFileNames(fileName).filter(\n fileName => this.shouldGenerateFile(fileName).generate);\n }\n this.generatedCodeFor.set(fileName, genFileNames);\n }\n }\n if (sf) {\n addReferencesToSourceFile(sf, genFileNames);\n }\n // TODO(tbosch): TypeScript's typings for getSourceFile are incorrect,\n // as it can very well return undefined.\n return sf !;\n }\n\n private getGeneratedFile(fileName: string): ts.SourceFile|null {\n const genSrcFile = this.generatedSourceFiles.get(fileName);\n if (genSrcFile) {\n return genSrcFile.sourceFile;\n }\n const {generate, baseFileName} = this.shouldGenerateFile(fileName);\n if (generate) {\n const genFile = this.codeGenerator.generateFile(fileName, baseFileName);\n return this.addGeneratedFile(genFile, genFileExternalReferences(genFile));\n }\n return null;\n }\n\n private originalFileExists(fileName: string): boolean {\n let fileExists = this.originalFileExistsCache.get(fileName);\n if (fileExists == null) {\n fileExists = this.context.fileExists(fileName);\n this.originalFileExistsCache.set(fileName, fileExists);\n }\n return fileExists;\n }\n\n fileExists(fileName: string): boolean {\n fileName = stripNgResourceSuffix(fileName);\n if (this.librarySummaries.has(fileName) || this.generatedSourceFiles.has(fileName)) {\n return true;\n }\n if (this.shouldGenerateFile(fileName).generate) {\n return true;\n }\n return this.originalFileExists(fileName);\n }\n\n loadSummary(filePath: string): string|null {\n const summary = this.librarySummaries.get(filePath);\n if (summary) {\n return summary.text;\n }\n if (this.originalFileExists(filePath)) {\n return assert(this.context.readFile(filePath));\n }\n return null;\n }\n\n isSourceFile(filePath: string): boolean {\n // Don't generate any files nor typecheck them\n // if skipTemplateCodegen is set and fullTemplateTypeCheck is not yet set,\n // for backwards compatibility.\n if (this.options.skipTemplateCodegen && !this.options.fullTemplateTypeCheck) {\n return false;\n }\n // If we have a summary from a previous compilation,\n // treat the file never as a source file.\n if (this.librarySummaries.has(filePath)) {\n return false;\n }\n if (GENERATED_FILES.test(filePath)) {\n return false;\n }\n if (this.options.generateCodeForLibraries === false && DTS.test(filePath)) {\n return false;\n }\n if (DTS.test(filePath)) {\n // Check for a bundle index.\n if (this.hasBundleIndex(filePath)) {\n const normalFilePath = path.normalize(filePath);\n return this.flatModuleIndexNames.has(normalFilePath) ||\n this.flatModuleIndexRedirectNames.has(normalFilePath);\n }\n }\n return true;\n }\n\n readFile(fileName: string) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n return summary.text;\n }\n return this.context.readFile(fileName);\n }\n\n getMetadataFor(filePath: string): ModuleMetadata[]|undefined {\n return readMetadata(filePath, this.metadataReaderHost, this.metadataReaderCache);\n }\n\n loadResource(filePath: string): Promise<string>|string {\n if (this.context.readResource) return this.context.readResource(filePath);\n if (!this.originalFileExists(filePath)) {\n throw syntaxError(`Error: Resource file not found: ${filePath}`);\n }\n return assert(this.context.readFile(filePath));\n }\n\n getOutputName(filePath: string): string {\n return path.relative(this.getCurrentDirectory(), filePath);\n }\n\n private hasBundleIndex(filePath: string): boolean {\n const checkBundleIndex = (directory: string): boolean => {\n let result = this.flatModuleIndexCache.get(directory);\n if (result == null) {\n if (path.basename(directory) == 'node_module') {\n // Don't look outside the node_modules this package is installed in.\n result = false;\n } else {\n // A bundle index exists if the typings .d.ts file has a metadata.json that has an\n // importAs.\n try {\n const packageFile = path.join(directory, 'package.json');\n if (this.originalFileExists(packageFile)) {\n // Once we see a package.json file, assume false until it we find the bundle index.\n result = false;\n const packageContent: any = JSON.parse(assert(this.context.readFile(packageFile)));\n if (packageContent.typings) {\n const typings = path.normalize(path.join(directory, packageContent.typings));\n if (DTS.test(typings)) {\n const metadataFile = typings.replace(DTS, '.metadata.json');\n if (this.originalFileExists(metadataFile)) {\n const metadata = JSON.parse(assert(this.context.readFile(metadataFile)));\n if (metadata.flatModuleIndexRedirect) {\n this.flatModuleIndexRedirectNames.add(typings);\n // Note: don't set result = true,\n // as this would mark this folder\n // as having a bundleIndex too early without\n // filling the bundleIndexNames.\n } else if (metadata.importAs) {\n this.flatModuleIndexNames.add(typings);\n result = true;\n }\n }\n }\n }\n } else {\n const parent = path.dirname(directory);\n if (parent != directory) {\n // Try the parent directory.\n result = checkBundleIndex(parent);\n } else {\n result = false;\n }\n }\n } catch (e) {\n // If we encounter any errors assume we this isn't a bundle index.\n result = false;\n }\n }\n this.flatModuleIndexCache.set(directory, result);\n }\n return result;\n };\n\n return checkBundleIndex(path.dirname(filePath));\n }\n\n getDefaultLibFileName = (options: ts.CompilerOptions) =>\n this.context.getDefaultLibFileName(options)\n getCurrentDirectory = () => this.context.getCurrentDirectory();\n getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);\n useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();\n getNewLine = () => this.context.getNewLine();\n // Make sure we do not `host.realpath()` from TS as we do not want to resolve symlinks.\n // https://github.com/Microsoft/TypeScript/issues/9552\n realPath = (p: string) => p;\n writeFile = this.context.writeFile.bind(this.context);\n}\n\nfunction genFileExternalReferences(genFile: GeneratedFile): Set<string> {\n return new Set(collectExternalReferences(genFile.stmts !).map(er => er.moduleName !));\n}\n\nfunction addReferencesToSourceFile(sf: ts.SourceFile, genFileNames: string[]) {\n // Note: as we modify ts.SourceFiles we need to keep the original\n // value for `referencedFiles` around in cache the original host is caching ts.SourceFiles.\n // Note: cloning the ts.SourceFile is expensive as the nodes in have parent pointers,\n // i.e. we would also need to clone and adjust all nodes.\n let originalReferencedFiles: ReadonlyArray<ts.FileReference> =\n (sf as any).originalReferencedFiles;\n if (!originalReferencedFiles) {\n originalReferencedFiles = sf.referencedFiles;\n (sf as any).originalReferencedFiles = originalReferencedFiles;\n }\n const newReferencedFiles = [...originalReferencedFiles];\n genFileNames.forEach(gf => newReferencedFiles.push({fileName: gf, pos: 0, end: 0}));\n sf.referencedFiles = newReferencedFiles;\n}\n\nexport function getOriginalReferences(sourceFile: ts.SourceFile): ts.FileReference[]|undefined {\n return sourceFile && (sourceFile as any).originalReferencedFiles;\n}\n\nfunction dotRelative(from: string, to: string): string {\n const rPath: string = path.relative(from, to).replace(/\\\\/g, '/');\n return rPath.startsWith('.') ? rPath : './' + rPath;\n}\n\n/**\n * Moves the path into `genDir` folder while preserving the `node_modules` directory.\n */\nfunction getPackageName(filePath: string): string|null {\n const match = NODE_MODULES_PACKAGE_NAME.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNodeModulesPrefix(filePath: string): string {\n return filePath.replace(/.*node_modules\\//, '');\n}\n\nfunction getNodeModulesPrefix(filePath: string): string|null {\n const match = /.*node_modules\\//.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNgResourceSuffix(fileName: string): string {\n return fileName.replace(/\\.\\$ngresource\\$.*/, '');\n}\n\nfunction addNgResourceSuffix(fileName: string): string {\n return `${fileName}.$ngresource$`;\n}\n"]}
1
+ {"version":3,"file":"compiler_host.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/compiler_host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuL;AACvL,2BAA6B;AAC7B,+BAAiC;AAMjC,qDAA8F;AAC9F,+BAA6E;AAE7E,IAAM,yBAAyB,GAAG,6CAA6C,CAAC;AAChF,IAAM,GAAG,GAAG,kCAAkC,CAAC;AAE/C,4BACI,EACwD;QADvD,oBAAO,EAAE,cAA6C,EAA7C,kEAA6C;IAEzD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAJD,gDAIC;AAiBD,gBAAmB,SAA+B;IAChD,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,qCAAqC;IACvC,CAAC;IACD,MAAM,CAAC,SAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH;IAqBE,mDACY,SAAgC,EAAU,OAAwB,EAClE,OAAqB,EAAU,gBAAkC,EACjE,aAA4B,EAC5B,gBAAoD;QAApD,iCAAA,EAAA,uBAAuB,GAAG,EAA0B;QAJhE,iBAgDC;QA/CW,cAAS,GAAT,SAAS,CAAuB;QAAU,YAAO,GAAP,OAAO,CAAiB;QAClE,YAAO,GAAP,OAAO,CAAc;QAAU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CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,wBAAwB,QAAgB;IACtC,IAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,gCAAgC,QAAgB;IAC9C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,8BAA8B,QAAgB;IAC5C,IAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,+BAA+B,QAAgB;IAC7C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,6BAA6B,QAAgB;IAC3C,MAAM,CAAI,QAAQ,kBAAe,CAAC;AACpC,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 {AotCompilerHost, EmitterVisitorContext, ExternalReference, GeneratedFile, ParseSourceSpan, TypeScriptEmitter, collectExternalReferences, syntaxError} from '@angular/compiler';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost} from '../diagnostics/translate_diagnostics';\nimport {METADATA_VERSION, ModuleMetadata} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, LibrarySummary} from './api';\nimport {MetadataReaderHost, createMetadataReaderCache, readMetadata} from './metadata_reader';\nimport {DTS, GENERATED_FILES, isInRootDir, relativeToRootDirs} from './util';\n\nconst NODE_MODULES_PACKAGE_NAME = /node_modules\\/((\\w|-)+|(@(\\w|-)+\\/(\\w|-)+))/;\nconst EXT = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\n\nexport function createCompilerHost(\n {options, tsHost = ts.createCompilerHost(options, true)}:\n {options: CompilerOptions, tsHost?: ts.CompilerHost}): CompilerHost {\n return tsHost;\n}\n\nexport interface MetadataProvider {\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined;\n}\n\ninterface GenSourceFile {\n externalReferences: Set<string>;\n sourceFile: ts.SourceFile;\n emitCtx: EmitterVisitorContext;\n}\n\nexport interface CodeGenerator {\n generateFile(genFileName: string, baseFileName?: string): GeneratedFile;\n findGeneratedFileNames(fileName: string): string[];\n}\n\nfunction assert<T>(condition: T | null | undefined) {\n if (!condition) {\n // TODO(chuckjaz): do the right thing\n }\n return condition !;\n}\n\n/**\n * Implements the following hosts based on an api.CompilerHost:\n * - ts.CompilerHost to be consumed by a ts.Program\n * - AotCompilerHost for @angular/compiler\n * - TypeCheckHost for mapping ts errors to ng errors (via translateDiagnostics)\n */\nexport class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHost, AotCompilerHost,\n TypeCheckHost {\n private metadataReaderCache = createMetadataReaderCache();\n private flatModuleIndexCache = new Map<string, boolean>();\n private flatModuleIndexNames = new Set<string>();\n private flatModuleIndexRedirectNames = new Set<string>();\n private rootDirs: string[];\n private moduleResolutionCache: ts.ModuleResolutionCache;\n private originalSourceFiles = new Map<string, ts.SourceFile|null>();\n private originalFileExistsCache = new Map<string, boolean>();\n private generatedSourceFiles = new Map<string, GenSourceFile>();\n private generatedCodeFor = new Map<string, string[]>();\n private emitter = new TypeScriptEmitter();\n private metadataReaderHost: MetadataReaderHost;\n\n getCancellationToken: () => ts.CancellationToken;\n getDefaultLibLocation: () => string;\n trace: (s: string) => void;\n getDirectories: (path: string) => string[];\n directoryExists?: (directoryName: string) => boolean;\n\n constructor(\n private rootFiles: ReadonlyArray<string>, private options: CompilerOptions,\n private context: CompilerHost, private metadataProvider: MetadataProvider,\n private codeGenerator: CodeGenerator,\n private librarySummaries = new Map<string, LibrarySummary>()) {\n this.moduleResolutionCache = ts.createModuleResolutionCache(\n this.context.getCurrentDirectory !(), this.context.getCanonicalFileName.bind(this.context));\n const basePath = this.options.basePath !;\n this.rootDirs =\n (this.options.rootDirs || [this.options.basePath !]).map(p => path.resolve(basePath, p));\n if (context.getDirectories) {\n this.getDirectories = path => context.getDirectories !(path);\n }\n if (context.directoryExists) {\n this.directoryExists = directoryName => context.directoryExists !(directoryName);\n }\n if (context.getCancellationToken) {\n this.getCancellationToken = () => context.getCancellationToken !();\n }\n if (context.getDefaultLibLocation) {\n this.getDefaultLibLocation = () => context.getDefaultLibLocation !();\n }\n if (context.trace) {\n this.trace = s => context.trace !(s);\n }\n if (context.fileNameToModuleName) {\n this.fileNameToModuleName = context.fileNameToModuleName.bind(context);\n }\n // Note: don't copy over context.moduleNameToFileName as we first\n // normalize undefined containingFile to a filled containingFile.\n if (context.resourceNameToFileName) {\n this.resourceNameToFileName = context.resourceNameToFileName.bind(context);\n }\n if (context.toSummaryFileName) {\n this.toSummaryFileName = context.toSummaryFileName.bind(context);\n }\n if (context.fromSummaryFileName) {\n this.fromSummaryFileName = context.fromSummaryFileName.bind(context);\n }\n this.metadataReaderHost = {\n cacheMetadata: () => true,\n getSourceFileMetadata: (filePath) => {\n const sf = this.getOriginalSourceFile(filePath);\n return sf ? this.metadataProvider.getMetadata(sf) : undefined;\n },\n fileExists: (filePath) => this.originalFileExists(filePath),\n readFile: (filePath) => assert(this.context.readFile(filePath)),\n };\n }\n\n private resolveModuleName(moduleName: string, containingFile: string): ts.ResolvedModule\n |undefined {\n const rm = ts.resolveModuleName(\n moduleName, containingFile.replace(/\\\\/g, '/'), this.options, this,\n this.moduleResolutionCache)\n .resolvedModule;\n if (rm && this.isSourceFile(rm.resolvedFileName) && DTS.test(rm.resolvedFileName)) {\n // Case: generateCodeForLibraries = true and moduleName is\n // a .d.ts file in a node_modules folder.\n // Need to set isExternalLibraryImport to false so that generated files for that file\n // are emitted.\n rm.isExternalLibraryImport = false;\n }\n return rm;\n }\n\n // Note: We implement this method so that TypeScript and Angular share the same\n // ts.ModuleResolutionCache\n // and that we can tell ts.Program about our different opinion about\n // ResolvedModule.isExternalLibraryImport\n // (see our isSourceFile method).\n resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[] {\n // TODO(tbosch): this seems to be a typing error in TypeScript,\n // as it contains assertions that the result contains the same number of entries\n // as the given module names.\n return <ts.ResolvedModule[]>moduleNames.map(\n moduleName => this.resolveModuleName(moduleName, containingFile));\n }\n\n moduleNameToFileName(m: string, containingFile?: string): string|null {\n if (!containingFile) {\n if (m.indexOf('.') === 0) {\n throw new Error('Resolution of relative paths requires a containing file.');\n }\n // Any containing file gives the same result for absolute imports\n containingFile = this.rootFiles[0];\n }\n if (this.context.moduleNameToFileName) {\n return this.context.moduleNameToFileName(m, containingFile);\n }\n const resolved = this.resolveModuleName(m, containingFile);\n return resolved ? resolved.resolvedFileName : null;\n }\n\n /**\n * We want a moduleId that will appear in import statements in the generated code\n * which will be written to `containingFile`.\n *\n * Note that we also generate files for files in node_modules, as libraries\n * only ship .metadata.json files but not the generated code.\n *\n * Logic:\n * 1. if the importedFile and the containingFile are from the project sources\n * or from the same node_modules package, use a relative path\n * 2. if the importedFile is in a node_modules package,\n * use a path that starts with the package name.\n * 3. Error if the containingFile is in the node_modules package\n * and the importedFile is in the project soures,\n * as that is a violation of the principle that node_modules packages cannot\n * import project sources.\n */\n fileNameToModuleName(importedFile: string, containingFile: string): string {\n const originalImportedFile = importedFile;\n if (this.options.traceResolution) {\n console.error(\n 'fileNameToModuleName from containingFile', containingFile, 'to importedFile',\n importedFile);\n }\n\n // drop extension\n importedFile = importedFile.replace(EXT, '');\n const importedFilePackagName = getPackageName(importedFile);\n const containingFilePackageName = getPackageName(containingFile);\n\n let moduleName: string;\n if (importedFilePackagName === containingFilePackageName ||\n GENERATED_FILES.test(originalImportedFile)) {\n const rootedContainingFile = relativeToRootDirs(containingFile, this.rootDirs);\n const rootedImportedFile = relativeToRootDirs(importedFile, this.rootDirs);\n\n if (rootedContainingFile !== containingFile && rootedImportedFile !== importedFile) {\n // if both files are contained in the `rootDirs`, then strip the rootDirs\n containingFile = rootedContainingFile;\n importedFile = rootedImportedFile;\n }\n moduleName = dotRelative(path.dirname(containingFile), importedFile);\n } else if (importedFilePackagName) {\n moduleName = stripNodeModulesPrefix(importedFile);\n } else {\n throw new Error(\n `Trying to import a source file from a node_modules package: import ${originalImportedFile} from ${containingFile}`);\n }\n return moduleName;\n }\n\n resourceNameToFileName(resourceName: string, containingFile: string): string|null {\n // Note: we convert package paths into relative paths to be compatible with the the\n // previous implementation of UrlResolver.\n const firstChar = resourceName[0];\n if (firstChar === '/') {\n resourceName = resourceName.slice(1);\n } else if (firstChar !== '.') {\n resourceName = `./${resourceName}`;\n }\n const filePathWithNgResource =\n this.moduleNameToFileName(addNgResourceSuffix(resourceName), containingFile);\n const result = filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;\n // Used under Bazel to report more specific error with remediation advice\n if (!result && (this.context as any).reportMissingResource) {\n (this.context as any).reportMissingResource(resourceName);\n }\n return result;\n }\n\n toSummaryFileName(fileName: string, referringSrcFileName: string): string {\n return this.fileNameToModuleName(fileName, referringSrcFileName);\n }\n\n fromSummaryFileName(fileName: string, referringLibFileName: string): string {\n const resolved = this.moduleNameToFileName(fileName, referringLibFileName);\n if (!resolved) {\n throw new Error(`Could not resolve ${fileName} from ${referringLibFileName}`);\n }\n return resolved;\n }\n\n parseSourceSpanOf(fileName: string, line: number, character: number): ParseSourceSpan|null {\n const data = this.generatedSourceFiles.get(fileName);\n if (data && data.emitCtx) {\n return data.emitCtx.spanOf(line, character);\n }\n return null;\n }\n\n private getOriginalSourceFile(\n filePath: string, languageVersion?: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile|null {\n // Note: we need the explicit check via `has` as we also cache results\n // that were null / undefined.\n if (this.originalSourceFiles.has(filePath)) {\n return this.originalSourceFiles.get(filePath) !;\n }\n if (!languageVersion) {\n languageVersion = this.options.target || ts.ScriptTarget.Latest;\n }\n // Note: This can also return undefined,\n // as the TS typings are not correct!\n const sf = this.context.getSourceFile(filePath, languageVersion, onError) || null;\n this.originalSourceFiles.set(filePath, sf);\n return sf;\n }\n\n updateGeneratedFile(genFile: GeneratedFile): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const oldGenFile = this.generatedSourceFiles.get(genFile.genFileUrl);\n if (!oldGenFile) {\n throw new Error(`Illegal State: previous GeneratedFile not found for ${genFile.genFileUrl}.`);\n }\n const newRefs = genFileExternalReferences(genFile);\n const oldRefs = oldGenFile.externalReferences;\n let refsAreEqual = oldRefs.size === newRefs.size;\n if (refsAreEqual) {\n newRefs.forEach(r => refsAreEqual = refsAreEqual && oldRefs.has(r));\n }\n if (!refsAreEqual) {\n throw new Error(\n `Illegal State: external references changed in ${genFile.genFileUrl}.\\nOld: ${Array.from(oldRefs)}.\\nNew: ${Array.from(newRefs)}`);\n }\n return this.addGeneratedFile(genFile, newRefs);\n }\n\n private addGeneratedFile(genFile: GeneratedFile, externalReferences: Set<string>): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const {sourceText, context} = this.emitter.emitStatementsAndContext(\n genFile.genFileUrl, genFile.stmts, /* preamble */ '',\n /* emitSourceMaps */ false);\n const sf = ts.createSourceFile(\n genFile.genFileUrl, sourceText, this.options.target || ts.ScriptTarget.Latest);\n if ((this.options.module === ts.ModuleKind.AMD || this.options.module === ts.ModuleKind.UMD) &&\n this.context.amdModuleName) {\n const moduleName = this.context.amdModuleName(sf);\n if (moduleName) sf.moduleName = moduleName;\n }\n this.generatedSourceFiles.set(genFile.genFileUrl, {\n sourceFile: sf,\n emitCtx: context, externalReferences,\n });\n return sf;\n }\n\n shouldGenerateFile(fileName: string): {generate: boolean, baseFileName?: string} {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n if (!isInRootDir(fileName, this.options)) {\n return {generate: false};\n }\n const genMatch = GENERATED_FILES.exec(fileName);\n if (!genMatch) {\n return {generate: false};\n }\n const [, base, genSuffix, suffix] = genMatch;\n if (suffix !== 'ts' && suffix !== 'tsx') {\n return {generate: false};\n }\n let baseFileName: string|undefined;\n if (genSuffix.indexOf('ngstyle') >= 0) {\n // Note: ngstyle files have names like `afile.css.ngstyle.ts`\n if (!this.originalFileExists(base)) {\n return {generate: false};\n }\n } else {\n // Note: on-the-fly generated files always have a `.ts` suffix,\n // but the file from which we generated it can be a `.ts`/ `.tsx`/ `.d.ts`\n // (see options.generateCodeForLibraries).\n baseFileName = [`${base}.ts`, `${base}.tsx`, `${base}.d.ts`].find(\n baseFileName => this.isSourceFile(baseFileName) && this.originalFileExists(baseFileName));\n if (!baseFileName) {\n return {generate: false};\n }\n }\n return {generate: true, baseFileName};\n }\n\n shouldGenerateFilesFor(fileName: string) {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n return !GENERATED_FILES.test(fileName) && this.isSourceFile(fileName) &&\n isInRootDir(fileName, this.options);\n }\n\n getSourceFile(\n fileName: string, languageVersion: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile {\n // Note: Don't exit early in this method to make sure\n // we always have up to date references on the file!\n let genFileNames: string[] = [];\n let sf = this.getGeneratedFile(fileName);\n if (!sf) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n if (!summary.sourceFile) {\n summary.sourceFile = ts.createSourceFile(\n fileName, summary.text, this.options.target || ts.ScriptTarget.Latest);\n }\n sf = summary.sourceFile;\n genFileNames = [];\n }\n }\n if (!sf) {\n sf = this.getOriginalSourceFile(fileName);\n const cachedGenFiles = this.generatedCodeFor.get(fileName);\n if (cachedGenFiles) {\n genFileNames = cachedGenFiles;\n } else {\n if (!this.options.noResolve && this.shouldGenerateFilesFor(fileName)) {\n genFileNames = this.codeGenerator.findGeneratedFileNames(fileName).filter(\n fileName => this.shouldGenerateFile(fileName).generate);\n }\n this.generatedCodeFor.set(fileName, genFileNames);\n }\n }\n if (sf) {\n addReferencesToSourceFile(sf, genFileNames);\n }\n // TODO(tbosch): TypeScript's typings for getSourceFile are incorrect,\n // as it can very well return undefined.\n return sf !;\n }\n\n private getGeneratedFile(fileName: string): ts.SourceFile|null {\n const genSrcFile = this.generatedSourceFiles.get(fileName);\n if (genSrcFile) {\n return genSrcFile.sourceFile;\n }\n const {generate, baseFileName} = this.shouldGenerateFile(fileName);\n if (generate) {\n const genFile = this.codeGenerator.generateFile(fileName, baseFileName);\n return this.addGeneratedFile(genFile, genFileExternalReferences(genFile));\n }\n return null;\n }\n\n private originalFileExists(fileName: string): boolean {\n let fileExists = this.originalFileExistsCache.get(fileName);\n if (fileExists == null) {\n fileExists = this.context.fileExists(fileName);\n this.originalFileExistsCache.set(fileName, fileExists);\n }\n return fileExists;\n }\n\n fileExists(fileName: string): boolean {\n fileName = stripNgResourceSuffix(fileName);\n if (this.librarySummaries.has(fileName) || this.generatedSourceFiles.has(fileName)) {\n return true;\n }\n if (this.shouldGenerateFile(fileName).generate) {\n return true;\n }\n return this.originalFileExists(fileName);\n }\n\n loadSummary(filePath: string): string|null {\n const summary = this.librarySummaries.get(filePath);\n if (summary) {\n return summary.text;\n }\n if (this.originalFileExists(filePath)) {\n return assert(this.context.readFile(filePath));\n }\n return null;\n }\n\n isSourceFile(filePath: string): boolean {\n // Don't generate any files nor typecheck them\n // if skipTemplateCodegen is set and fullTemplateTypeCheck is not yet set,\n // for backwards compatibility.\n if (this.options.skipTemplateCodegen && !this.options.fullTemplateTypeCheck) {\n return false;\n }\n // If we have a summary from a previous compilation,\n // treat the file never as a source file.\n if (this.librarySummaries.has(filePath)) {\n return false;\n }\n if (GENERATED_FILES.test(filePath)) {\n return false;\n }\n if (this.options.generateCodeForLibraries === false && DTS.test(filePath)) {\n return false;\n }\n if (DTS.test(filePath)) {\n // Check for a bundle index.\n if (this.hasBundleIndex(filePath)) {\n const normalFilePath = path.normalize(filePath);\n return this.flatModuleIndexNames.has(normalFilePath) ||\n this.flatModuleIndexRedirectNames.has(normalFilePath);\n }\n }\n return true;\n }\n\n readFile(fileName: string) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n return summary.text;\n }\n return this.context.readFile(fileName);\n }\n\n getMetadataFor(filePath: string): ModuleMetadata[]|undefined {\n return readMetadata(filePath, this.metadataReaderHost, this.metadataReaderCache);\n }\n\n loadResource(filePath: string): Promise<string>|string {\n if (this.context.readResource) return this.context.readResource(filePath);\n if (!this.originalFileExists(filePath)) {\n throw syntaxError(`Error: Resource file not found: ${filePath}`);\n }\n return assert(this.context.readFile(filePath));\n }\n\n getOutputName(filePath: string): string {\n return path.relative(this.getCurrentDirectory(), filePath);\n }\n\n private hasBundleIndex(filePath: string): boolean {\n const checkBundleIndex = (directory: string): boolean => {\n let result = this.flatModuleIndexCache.get(directory);\n if (result == null) {\n if (path.basename(directory) == 'node_module') {\n // Don't look outside the node_modules this package is installed in.\n result = false;\n } else {\n // A bundle index exists if the typings .d.ts file has a metadata.json that has an\n // importAs.\n try {\n const packageFile = path.join(directory, 'package.json');\n if (this.originalFileExists(packageFile)) {\n // Once we see a package.json file, assume false until it we find the bundle index.\n result = false;\n const packageContent: any = JSON.parse(assert(this.context.readFile(packageFile)));\n if (packageContent.typings) {\n const typings = path.normalize(path.join(directory, packageContent.typings));\n if (DTS.test(typings)) {\n const metadataFile = typings.replace(DTS, '.metadata.json');\n if (this.originalFileExists(metadataFile)) {\n const metadata = JSON.parse(assert(this.context.readFile(metadataFile)));\n if (metadata.flatModuleIndexRedirect) {\n this.flatModuleIndexRedirectNames.add(typings);\n // Note: don't set result = true,\n // as this would mark this folder\n // as having a bundleIndex too early without\n // filling the bundleIndexNames.\n } else if (metadata.importAs) {\n this.flatModuleIndexNames.add(typings);\n result = true;\n }\n }\n }\n }\n } else {\n const parent = path.dirname(directory);\n if (parent != directory) {\n // Try the parent directory.\n result = checkBundleIndex(parent);\n } else {\n result = false;\n }\n }\n } catch (e) {\n // If we encounter any errors assume we this isn't a bundle index.\n result = false;\n }\n }\n this.flatModuleIndexCache.set(directory, result);\n }\n return result;\n };\n\n return checkBundleIndex(path.dirname(filePath));\n }\n\n getDefaultLibFileName = (options: ts.CompilerOptions) =>\n this.context.getDefaultLibFileName(options)\n getCurrentDirectory = () => this.context.getCurrentDirectory();\n getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);\n useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();\n getNewLine = () => this.context.getNewLine();\n // Make sure we do not `host.realpath()` from TS as we do not want to resolve symlinks.\n // https://github.com/Microsoft/TypeScript/issues/9552\n realPath = (p: string) => p;\n writeFile = this.context.writeFile.bind(this.context);\n}\n\nfunction genFileExternalReferences(genFile: GeneratedFile): Set<string> {\n return new Set(collectExternalReferences(genFile.stmts !).map(er => er.moduleName !));\n}\n\nfunction addReferencesToSourceFile(sf: ts.SourceFile, genFileNames: string[]) {\n // Note: as we modify ts.SourceFiles we need to keep the original\n // value for `referencedFiles` around in cache the original host is caching ts.SourceFiles.\n // Note: cloning the ts.SourceFile is expensive as the nodes in have parent pointers,\n // i.e. we would also need to clone and adjust all nodes.\n let originalReferencedFiles: ReadonlyArray<ts.FileReference> =\n (sf as any).originalReferencedFiles;\n if (!originalReferencedFiles) {\n originalReferencedFiles = sf.referencedFiles;\n (sf as any).originalReferencedFiles = originalReferencedFiles;\n }\n const newReferencedFiles = [...originalReferencedFiles];\n genFileNames.forEach(gf => newReferencedFiles.push({fileName: gf, pos: 0, end: 0}));\n sf.referencedFiles = newReferencedFiles;\n}\n\nexport function getOriginalReferences(sourceFile: ts.SourceFile): ts.FileReference[]|undefined {\n return sourceFile && (sourceFile as any).originalReferencedFiles;\n}\n\nfunction dotRelative(from: string, to: string): string {\n const rPath: string = path.relative(from, to).replace(/\\\\/g, '/');\n return rPath.startsWith('.') ? rPath : './' + rPath;\n}\n\n/**\n * Moves the path into `genDir` folder while preserving the `node_modules` directory.\n */\nfunction getPackageName(filePath: string): string|null {\n const match = NODE_MODULES_PACKAGE_NAME.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNodeModulesPrefix(filePath: string): string {\n return filePath.replace(/.*node_modules\\//, '');\n}\n\nfunction getNodeModulesPrefix(filePath: string): string|null {\n const match = /.*node_modules\\//.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNgResourceSuffix(fileName: string): string {\n return fileName.replace(/\\.\\$ngresource\\$.*/, '');\n}\n\nfunction addNgResourceSuffix(fileName: string): string {\n return `${fileName}.$ngresource$`;\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.2.4');
19
+ exports.VERSION = new compiler_1.Version('5.2.8');
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.2.4');\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.8');\n"]}