@angular/compiler-cli
Advanced tools
Comparing version 4.2.0-rc.0 to 4.2.0-rc.1
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "4.2.0-rc.0", | ||
"version": "4.2.0-rc.1", | ||
"description": "Angular - the compiler CLI for Node.js", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@angular/tsc-wrapped": "4.2.0-rc.0", | ||
"@angular/tsc-wrapped": "4.2.0-rc.1", | ||
"reflect-metadata": "^0.1.2", | ||
@@ -19,4 +19,4 @@ "minimist": "^1.2.0" | ||
"typescript": "^2.0.2", | ||
"@angular/compiler": "4.2.0-rc.0", | ||
"@angular/core": "4.2.0-rc.0" | ||
"@angular/compiler": "4.2.0-rc.1", | ||
"@angular/core": "4.2.0-rc.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "repository": { |
@@ -23,4 +23,4 @@ /** | ||
constructor(options: AngularCompilerOptions, program: ts.Program, host: ts.CompilerHost, compiler: compiler.AotCompiler, ngCompilerHost: CompilerHost); | ||
codegen(): Promise<any>; | ||
codegen(): Promise<string[]>; | ||
static create(options: AngularCompilerOptions, cliOptions: NgcCliOptions, program: ts.Program, tsCompilerHost: ts.CompilerHost, compilerHostContext?: CompilerHostContext, ngCompilerHost?: CompilerHost): CodeGenerator; | ||
} |
@@ -32,10 +32,11 @@ "use strict"; | ||
return this.compiler | ||
.compileAll(this.program.getSourceFiles().map(function (sf) { return _this.ngCompilerHost.getCanonicalFileName(sf.fileName); })) | ||
.analyzeModulesAsync(this.program.getSourceFiles().map(function (sf) { return _this.ngCompilerHost.getCanonicalFileName(sf.fileName); })) | ||
.then(function (analyzedModules) { return _this.compiler.emitAllImpls(analyzedModules); }) | ||
.then(function (generatedModules) { | ||
generatedModules.forEach(function (generatedModule) { | ||
return generatedModules.map(function (generatedModule) { | ||
var sourceFile = _this.program.getSourceFile(generatedModule.srcFileUrl); | ||
var emitPath = _this.ngCompilerHost.calculateEmitPath(generatedModule.genFileUrl); | ||
var source = GENERATED_META_FILES.test(emitPath) ? generatedModule.source : | ||
generatedModule.source; | ||
var source = generatedModule.source || compiler.toTypeScript(generatedModule, PREAMBLE); | ||
_this.host.writeFile(emitPath, source, false, function () { }, [sourceFile]); | ||
return emitPath; | ||
}); | ||
@@ -79,3 +80,2 @@ }); | ||
enableLegacyTemplate: options.enableLegacyTemplate !== false, | ||
genFilePreamble: PREAMBLE, | ||
}).compiler; | ||
@@ -82,0 +82,0 @@ return new CodeGenerator(options, program, tsCompilerHost, aotCompiler, ngCompilerHost); |
@@ -24,4 +24,5 @@ /** | ||
private resolverCache; | ||
private bundleIndexCache; | ||
private bundleIndexNames; | ||
private flatModuleIndexCache; | ||
private flatModuleIndexNames; | ||
private flatModuleIndexRedirectNames; | ||
private moduleFileNames; | ||
@@ -28,0 +29,0 @@ protected resolveModuleNameHost: CompilerHostContext; |
@@ -39,4 +39,5 @@ "use strict"; | ||
this.resolverCache = new Map(); | ||
this.bundleIndexCache = new Map(); | ||
this.bundleIndexNames = new Set(); | ||
this.flatModuleIndexCache = new Map(); | ||
this.flatModuleIndexNames = new Set(); | ||
this.flatModuleIndexRedirectNames = new Set(); | ||
this.moduleFileNames = new Map(); | ||
@@ -269,3 +270,4 @@ // normalize the path so that it never ends with '/'. | ||
var normalFilePath = path.normalize(filePath); | ||
return this.bundleIndexNames.has(normalFilePath); | ||
return this.flatModuleIndexNames.has(normalFilePath) || | ||
this.flatModuleIndexRedirectNames.has(normalFilePath); | ||
} | ||
@@ -299,3 +301,3 @@ } | ||
var checkBundleIndex = function (directory) { | ||
var result = _this.bundleIndexCache.get(directory); | ||
var result = _this.flatModuleIndexCache.get(directory); | ||
if (result == null) { | ||
@@ -321,4 +323,11 @@ if (path.basename(directory) == 'node_module') { | ||
var metadata = JSON.parse(_this.context.readFile(metadataFile)); | ||
if (metadata.importAs) { | ||
_this.bundleIndexNames.add(typings); | ||
if (metadata.flatModuleIndexRedirect) { | ||
_this.flatModuleIndexRedirectNames.add(typings); | ||
// Note: don't set result = true, | ||
// as this would mark this folder | ||
// as having a bundleIndex too early without | ||
// filling the bundleIndexNames. | ||
} | ||
else if (metadata.importAs) { | ||
_this.flatModuleIndexNames.add(typings); | ||
result = true; | ||
@@ -346,3 +355,3 @@ } | ||
} | ||
_this.bundleIndexCache.set(directory, result); | ||
_this.flatModuleIndexCache.set(directory, result); | ||
} | ||
@@ -349,0 +358,0 @@ return result; |
@@ -23,3 +23,3 @@ /** | ||
constructor(options: tsc.AngularCompilerOptions, ngExtractor: compiler.Extractor, host: ts.CompilerHost, ngCompilerHost: CompilerHost, program: ts.Program); | ||
extract(formatName: string, outFile: string | null): Promise<void>; | ||
extract(formatName: string, outFile: string | null): Promise<string[]>; | ||
extractBundle(): Promise<compiler.MessageBundle>; | ||
@@ -26,0 +26,0 @@ serialize(bundle: compiler.MessageBundle, formatName: string): string; |
@@ -37,2 +37,3 @@ "use strict"; | ||
_this.host.writeFile(dstPath, content, false); | ||
return [dstPath]; | ||
}); | ||
@@ -39,0 +40,0 @@ }; |
@@ -44,3 +44,3 @@ import { AngularCompilerOptions } from '@angular/tsc-wrapped'; | ||
*/ | ||
static codeGen(options: NgTools_InternalApi_NG2_CodeGen_Options): Promise<void>; | ||
static codeGen(options: NgTools_InternalApi_NG2_CodeGen_Options): Promise<any>; | ||
/** | ||
@@ -55,3 +55,3 @@ * @internal | ||
*/ | ||
static extractI18n(options: NgTools_InternalApi_NG2_ExtractI18n_Options): Promise<void>; | ||
static extractI18n(options: NgTools_InternalApi_NG2_ExtractI18n_Options): Promise<any>; | ||
} |
@@ -19,3 +19,3 @@ "use strict"; | ||
*/ | ||
exports.VERSION = new core_1.Version('4.2.0-rc.0'); | ||
exports.VERSION = new core_1.Version('4.2.0-rc.1'); | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
352723
3496
+ Added@angular/compiler@4.2.0-rc.1(transitive)
+ Added@angular/core@4.2.0-rc.1(transitive)
+ Added@angular/tsc-wrapped@4.2.0-rc.1(transitive)
+ Addedtslib@1.14.1(transitive)
- Removed@angular/compiler@4.2.0-rc.0(transitive)
- Removed@angular/core@4.2.0-rc.0(transitive)
- Removed@angular/tsc-wrapped@4.2.0-rc.0(transitive)