@angular/compiler-cli
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "0.3.0", | ||
"description": "Execute Angular 2 template compiler in nodejs.", | ||
"version": "0.4.0", | ||
"description": "Execute angular2 template compiler in nodejs.", | ||
"main": "index.js", | ||
@@ -12,3 +12,3 @@ "typings": "index.d.ts", | ||
"dependencies": { | ||
"@angular/tsc-wrapped": "^0.2.0", | ||
"@angular/tsc-wrapped": "^0.1.0", | ||
"reflect-metadata": "^0.1.2", | ||
@@ -19,5 +19,5 @@ "parse5": "1.3.2" | ||
"typescript": "^1.9.0-dev", | ||
"@angular/compiler": "2.0.0-rc.2", | ||
"@angular/platform-server": "2.0.0-rc.2", | ||
"@angular/core": "2.0.0-rc.2" | ||
"@angular/compiler": "2.0.0-rc.3", | ||
"@angular/platform-server": "2.0.0-rc.3", | ||
"@angular/core": "2.0.0-rc.3" | ||
}, | ||
@@ -24,0 +24,0 @@ "repository": { |
@@ -8,3 +8,2 @@ "use strict"; | ||
var core_1 = require('@angular/core'); | ||
var platform_server_1 = require('@angular/platform-server'); | ||
var path = require('path'); | ||
@@ -26,2 +25,3 @@ var compiler_private_1 = require('./compiler_private'); | ||
this.reflectorHost = reflectorHost; | ||
core_1.lockRunMode(); | ||
} | ||
@@ -100,3 +100,2 @@ CodeGenerator.prototype.generateSource = function (metadatas) { | ||
var _this = this; | ||
platform_server_1.Parse5DomAdapter.makeCurrent(); | ||
var stylesheetPromises = []; | ||
@@ -142,3 +141,3 @@ var generateOneFile = function (absSourcePath) { | ||
var config = new compiler.CompilerConfig({ | ||
genDebugInfo: true, | ||
genDebugInfo: options.debug === true, | ||
defaultEncapsulation: core_1.ViewEncapsulation.Emulated, | ||
@@ -145,0 +144,0 @@ logBindingUpdate: false, |
@@ -10,3 +10,2 @@ #!/usr/bin/env node | ||
var compiler_private_1 = require('./compiler_private'); | ||
var platform_server_1 = require('@angular/platform-server'); | ||
var reflector_host_1 = require('./reflector_host'); | ||
@@ -29,2 +28,3 @@ var static_reflection_capabilities_1 = require('./static_reflection_capabilities'); | ||
this._extractor = _extractor; | ||
core_1.lockRunMode(); | ||
} | ||
@@ -85,3 +85,2 @@ Extractor.prototype._extractCmpMessages = function (metadatas) { | ||
var _this = this; | ||
platform_server_1.Parse5DomAdapter.makeCurrent(); | ||
_dirPaths.clear(); | ||
@@ -88,0 +87,0 @@ var promises = this._program.getSourceFiles() |
@@ -122,17 +122,5 @@ "use strict"; | ||
StaticReflector.prototype.registerDecoratorOrConstructor = function (type, ctor) { | ||
var _this = this; | ||
this.conversionMap.set(type, function (context, args) { | ||
var argValues = []; | ||
args.forEach(function (arg, index) { | ||
var argValue; | ||
if (typeof arg === 'object' && !arg['__symbolic']) { | ||
argValue = mapStringMap(arg, function (value, key) { return _this.simplify(context, value); }); | ||
} | ||
else { | ||
argValue = _this.simplify(context, arg); | ||
} | ||
argValues.push(argValue); | ||
}); | ||
var metadata = Object.create(ctor.prototype); | ||
ctor.apply(metadata, argValues); | ||
ctor.apply(metadata, args); | ||
return metadata; | ||
@@ -142,11 +130,3 @@ }); | ||
StaticReflector.prototype.registerFunction = function (type, fn) { | ||
var _this = this; | ||
this.conversionMap.set(type, function (context, args) { | ||
var argValues = []; | ||
args.forEach(function (arg, index) { | ||
var argValue = _this.simplify(context, arg); | ||
argValues.push(argValue); | ||
}); | ||
return fn.apply(null, argValues); | ||
}); | ||
this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); }); | ||
}; | ||
@@ -196,3 +176,3 @@ StaticReflector.prototype.initializeConversionMap = function () { | ||
var calling = new Map(); | ||
function simplifyInContext(context, value) { | ||
function simplifyInContext(context, value, depth) { | ||
function resolveReference(expression) { | ||
@@ -218,4 +198,8 @@ var staticSymbol; | ||
function simplifyCall(expression) { | ||
var context = undefined; | ||
if (expression['__symbolic'] == 'call') { | ||
var target = expression['expression']; | ||
if (target && target.__symbolic === 'reference') { | ||
context = { name: target.name }; | ||
} | ||
var targetFunction = simplify(target); | ||
@@ -237,6 +221,6 @@ if (targetFunction['__symbolic'] == 'function') { | ||
var oldScope = scope; | ||
var result = void 0; | ||
var result_1; | ||
try { | ||
scope = functionScope.done(); | ||
result = simplify(value_1); | ||
result_1 = simplify(value_1); | ||
} | ||
@@ -246,3 +230,3 @@ finally { | ||
} | ||
return result; | ||
return result_1; | ||
} | ||
@@ -252,3 +236,9 @@ calling.delete(targetFunction); | ||
} | ||
return simplify({ __symbolic: 'error', message: 'Function call not supported' }); | ||
if (depth === 0) { | ||
// If depth is 0 we are evaluating the top level expression that is describing element | ||
// decorator. In this case, it is a decorator we don't understand, such as a custom | ||
// non-angular decorator, and we should just ignore it. | ||
return { __symbolic: 'ignore' }; | ||
} | ||
return simplify({ __symbolic: 'error', message: 'Function call not supported', context: context }); | ||
} | ||
@@ -260,3 +250,3 @@ function simplify(expression) { | ||
if (expression instanceof Array) { | ||
var result = []; | ||
var result_2 = []; | ||
for (var _i = 0, _a = expression; _i < _a.length; _i++) { | ||
@@ -270,3 +260,3 @@ var item = _a[_i]; | ||
var spreadItem = spreadArray_1[_b]; | ||
result.push(spreadItem); | ||
result_2.push(spreadItem); | ||
} | ||
@@ -276,5 +266,9 @@ continue; | ||
} | ||
result.push(simplify(item)); | ||
var value_2 = simplify(item); | ||
if (shouldIgnore(value_2)) { | ||
continue; | ||
} | ||
result_2.push(value_2); | ||
} | ||
return result; | ||
return result_2; | ||
} | ||
@@ -287,3 +281,7 @@ if (expression) { | ||
var left = simplify(expression['left']); | ||
if (shouldIgnore(left)) | ||
return left; | ||
var right = simplify(expression['right']); | ||
if (shouldIgnore(right)) | ||
return right; | ||
switch (expression['operator']) { | ||
@@ -334,2 +332,4 @@ case '&&': | ||
var operand = simplify(expression['operand']); | ||
if (shouldIgnore(operand)) | ||
return operand; | ||
switch (expression['operator']) { | ||
@@ -367,3 +367,3 @@ case '+': | ||
staticSymbol = resolveReference(expression); | ||
var result = staticSymbol; | ||
var result_3 = staticSymbol; | ||
var moduleMetadata = _this.getModuleMetadata(staticSymbol.filePath); | ||
@@ -377,5 +377,5 @@ var declarationValue = moduleMetadata ? moduleMetadata['metadata'][staticSymbol.name] : null; | ||
} | ||
result = simplifyInContext(staticSymbol, declarationValue); | ||
result_3 = simplifyInContext(staticSymbol, declarationValue, depth + 1); | ||
} | ||
return result; | ||
return result_3; | ||
case 'class': | ||
@@ -401,3 +401,3 @@ return context; | ||
} | ||
return converter(context, args); | ||
return converter(context, args.map(function (arg) { return simplifyInContext(context, arg, depth + 1); })); | ||
} | ||
@@ -427,3 +427,7 @@ // Determine if the function is one we can simplify. | ||
} | ||
return simplifyInContext(context, value); | ||
var result = simplifyInContext(context, value, 0); | ||
if (shouldIgnore(result)) { | ||
return undefined; | ||
} | ||
return result; | ||
}; | ||
@@ -481,3 +485,5 @@ /** | ||
case 'Function call not supported': | ||
return 'Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function'; | ||
var prefix = error.context && error.context.name ? "Calling function '" + error.context.name + "', f" : 'F'; | ||
return prefix + | ||
'unction calls are not supported. Consider replacing the function or lambda with a reference to an exported function'; | ||
} | ||
@@ -493,3 +499,8 @@ return error.message; | ||
var result = {}; | ||
Object.keys(input).forEach(function (key) { result[key] = transform(input[key], key); }); | ||
Object.keys(input).forEach(function (key) { | ||
var value = transform(input[key], key); | ||
if (!shouldIgnore(value)) { | ||
result[key] = value; | ||
} | ||
}); | ||
return result; | ||
@@ -534,2 +545,5 @@ } | ||
} | ||
function shouldIgnore(value) { | ||
return value && value.__symbolic == 'ignore'; | ||
} | ||
//# sourceMappingURL=static_reflector.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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
119222
1332
0
+ Added@angular/common@2.0.0-rc.3(transitive)
+ Added@angular/compiler@2.0.0-rc.3(transitive)
+ Added@angular/core@2.0.0-rc.3(transitive)
+ Added@angular/platform-browser@2.0.0-rc.3(transitive)
+ Added@angular/platform-server@2.0.0-rc.3(transitive)
+ Added@angular/tsc-wrapped@0.1.0(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedtsickle@0.1.7(transitive)
+ Addedtypescript@2.9.2(transitive)
- Removed@angular/common@2.0.0-rc.2(transitive)
- Removed@angular/compiler@2.0.0-rc.2(transitive)
- Removed@angular/core@2.0.0-rc.2(transitive)
- Removed@angular/platform-browser@2.0.0-rc.2(transitive)
- Removed@angular/platform-server@2.0.0-rc.2(transitive)
- Removed@angular/tsc-wrapped@0.2.2(transitive)
- Removedtsickle@0.1.6(transitive)
Updated@angular/tsc-wrapped@^0.1.0