@angular/compiler-cli
Advanced tools
Comparing version 2.1.0-rc.0 to 2.1.0
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "2.1.0-rc.0", | ||
"version": "2.1.0", | ||
"description": "Angular - the compiler CLI for Node.js", | ||
@@ -14,3 +14,2 @@ "main": "index.js", | ||
"reflect-metadata": "^0.1.2", | ||
"parse5": "^2.2.1", | ||
"minimist": "^1.2.0" | ||
@@ -20,5 +19,4 @@ }, | ||
"typescript": "^2.0.2", | ||
"@angular/compiler": "2.1.0-rc.0", | ||
"@angular/platform-server": "2.1.0-rc.0", | ||
"@angular/core": "2.1.0-rc.0" | ||
"@angular/compiler": "2.1.0", | ||
"@angular/core": "2.1.0" | ||
}, | ||
@@ -25,0 +23,0 @@ "repository": { |
@@ -16,3 +16,15 @@ /** | ||
import { ReflectorHost, ReflectorHostContext } from './reflector_host'; | ||
import { StaticReflector } from './static_reflector'; | ||
import { StaticReflector, StaticReflectorHost, StaticSymbol } from './static_reflector'; | ||
export declare class CodeGeneratorModuleCollector { | ||
private staticReflector; | ||
private reflectorHost; | ||
private program; | ||
private options; | ||
constructor(staticReflector: StaticReflector, reflectorHost: StaticReflectorHost, program: ts.Program, options: AngularCompilerOptions); | ||
getModuleSymbols(program: ts.Program): { | ||
fileMetas: FileMetadata[]; | ||
ngModules: StaticSymbol[]; | ||
}; | ||
private readFileMetadata(absSourcePath); | ||
} | ||
export declare class CodeGenerator { | ||
@@ -25,4 +37,4 @@ private options; | ||
private reflectorHost; | ||
constructor(options: AngularCompilerOptions, program: ts.Program, host: ts.CompilerHost, staticReflector: StaticReflector, compiler: compiler.OfflineCompiler, reflectorHost: ReflectorHost); | ||
private readFileMetadata(absSourcePath); | ||
private moduleCollector; | ||
constructor(options: AngularCompilerOptions, program: ts.Program, host: ts.CompilerHost, staticReflector: StaticReflector, compiler: compiler.OfflineCompiler, reflectorHost: StaticReflectorHost); | ||
private calculateEmitPath(filePath); | ||
@@ -32,1 +44,6 @@ codegen(): Promise<any>; | ||
} | ||
export interface FileMetadata { | ||
fileUrl: string; | ||
components: StaticSymbol[]; | ||
ngModules: StaticSymbol[]; | ||
} |
@@ -26,12 +26,26 @@ /** | ||
var PREAMBLE = "/**\n * This file is generated by the Angular 2 template compiler.\n * Do not edit.\n */\n /* tslint:disable */\n\n"; | ||
var CodeGenerator = (function () { | ||
function CodeGenerator(options, program, host, staticReflector, compiler, reflectorHost) { | ||
this.options = options; | ||
this.program = program; | ||
this.host = host; | ||
var CodeGeneratorModuleCollector = (function () { | ||
function CodeGeneratorModuleCollector(staticReflector, reflectorHost, program, options) { | ||
this.staticReflector = staticReflector; | ||
this.compiler = compiler; | ||
this.reflectorHost = reflectorHost; | ||
this.program = program; | ||
this.options = options; | ||
} | ||
CodeGenerator.prototype.readFileMetadata = function (absSourcePath) { | ||
CodeGeneratorModuleCollector.prototype.getModuleSymbols = function (program) { | ||
var _this = this; | ||
// Compare with false since the default should be true | ||
var skipFileNames = (this.options.generateCodeForLibraries === false) ? | ||
GENERATED_OR_DTS_FILES : | ||
GENERATED_FILES; | ||
var filePaths = this.program.getSourceFiles() | ||
.filter(function (sf) { return !skipFileNames.test(sf.fileName); }) | ||
.map(function (sf) { return _this.reflectorHost.getCanonicalFileName(sf.fileName); }); | ||
var fileMetas = filePaths.map(function (filePath) { return _this.readFileMetadata(filePath); }); | ||
var ngModules = fileMetas.reduce(function (ngModules, fileMeta) { | ||
ngModules.push.apply(ngModules, fileMeta.ngModules); | ||
return ngModules; | ||
}, []); | ||
return { fileMetas: fileMetas, ngModules: ngModules }; | ||
}; | ||
CodeGeneratorModuleCollector.prototype.readFileMetadata = function (absSourcePath) { | ||
var moduleMetadata = this.staticReflector.getModuleMetadata(absSourcePath); | ||
@@ -71,2 +85,16 @@ var result = { components: [], ngModules: [], fileUrl: absSourcePath }; | ||
}; | ||
return CodeGeneratorModuleCollector; | ||
}()); | ||
exports.CodeGeneratorModuleCollector = CodeGeneratorModuleCollector; | ||
var CodeGenerator = (function () { | ||
function CodeGenerator(options, program, host, staticReflector, compiler, reflectorHost) { | ||
this.options = options; | ||
this.program = program; | ||
this.host = host; | ||
this.staticReflector = staticReflector; | ||
this.compiler = compiler; | ||
this.reflectorHost = reflectorHost; | ||
this.moduleCollector = | ||
new CodeGeneratorModuleCollector(staticReflector, reflectorHost, program, options); | ||
} | ||
// Write codegen in a directory structure matching the sources. | ||
@@ -95,14 +123,3 @@ CodeGenerator.prototype.calculateEmitPath = function (filePath) { | ||
var _this = this; | ||
// Compare with false since the default should be true | ||
var skipFileNames = (this.options.generateCodeForLibraries === false) ? | ||
GENERATED_OR_DTS_FILES : | ||
GENERATED_FILES; | ||
var filePaths = this.program.getSourceFiles() | ||
.filter(function (sf) { return !skipFileNames.test(sf.fileName); }) | ||
.map(function (sf) { return _this.reflectorHost.getCanonicalFileName(sf.fileName); }); | ||
var fileMetas = filePaths.map(function (filePath) { return _this.readFileMetadata(filePath); }); | ||
var ngModules = fileMetas.reduce(function (ngModules, fileMeta) { | ||
ngModules.push.apply(ngModules, fileMeta.ngModules); | ||
return ngModules; | ||
}, []); | ||
var _a = this.moduleCollector.getModuleSymbols(this.program), fileMetas = _a.fileMetas, ngModules = _a.ngModules; | ||
var analyzedNgModules = this.compiler.analyzeModules(ngModules); | ||
@@ -109,0 +126,0 @@ return Promise.all(fileMetas.map(function (fileMeta) { |
@@ -33,2 +33,3 @@ import { ReflectorReader } from './private_import_core'; | ||
}; | ||
getCanonicalFileName(fileName: string): string; | ||
} | ||
@@ -35,0 +36,0 @@ /** |
@@ -308,2 +308,5 @@ /** | ||
} | ||
if (expression instanceof StaticSymbol) { | ||
return expression; | ||
} | ||
if (expression) { | ||
@@ -310,0 +313,0 @@ if (expression['__symbolic']) { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
159123
6
1895
1
+ Added@angular/compiler@2.1.0(transitive)
+ Added@angular/core@2.1.0(transitive)
- Removedparse5@^2.2.1
- Removed@angular/common@2.1.0-rc.0(transitive)
- Removed@angular/compiler@2.1.0-rc.0(transitive)
- Removed@angular/core@2.1.0-rc.0(transitive)
- Removed@angular/platform-browser@2.1.0-rc.0(transitive)
- Removed@angular/platform-server@2.1.0-rc.0(transitive)
- Removedparse5@2.2.3(transitive)