Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@angular/compiler-cli

Package Overview
Dependencies
Maintainers
1
Versions
843
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/compiler-cli - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0-beta.0

6

package.json
{
"name": "@angular/compiler-cli",
"version": "2.1.0",
"version": "2.2.0-beta.0",
"description": "Angular - the compiler CLI for Node.js",

@@ -18,4 +18,4 @@ "main": "index.js",

"typescript": "^2.0.2",
"@angular/compiler": "2.1.0",
"@angular/core": "2.1.0"
"@angular/compiler": "2.2.0-beta.0",
"@angular/core": "2.2.0-beta.0"
},

@@ -22,0 +22,0 @@ "repository": {

@@ -44,4 +44,4 @@ /**

fileUrl: string;
components: StaticSymbol[];
directives: StaticSymbol[];
ngModules: StaticSymbol[];
}

@@ -17,3 +17,2 @@ /**

var path_mapped_reflector_host_1 = require('./path_mapped_reflector_host');
var private_import_compiler_1 = require('./private_import_compiler');
var private_import_core_1 = require('./private_import_core');

@@ -52,3 +51,3 @@ var reflector_host_1 = require('./reflector_host');

var moduleMetadata = this.staticReflector.getModuleMetadata(absSourcePath);
var result = { components: [], ngModules: [], fileUrl: absSourcePath };
var result = { directives: [], ngModules: [], fileUrl: absSourcePath };
if (!moduleMetadata) {

@@ -74,4 +73,4 @@ console.log("WARNING: no metadata found for " + absSourcePath);

}
else if (annotation instanceof core_1.Component) {
result.components.push(staticType);
else if (annotation instanceof core_1.Directive) {
result.directives.push(staticType);
}

@@ -128,3 +127,3 @@ });

return _this.compiler
.compile(fileMeta.fileUrl, analyzedNgModules, fileMeta.components, fileMeta.ngModules)
.compile(fileMeta.fileUrl, analyzedNgModules, fileMeta.directives, fileMeta.ngModules)
.then(function (generatedModules) {

@@ -167,3 +166,3 @@ generatedModules.forEach(function (generatedModule) {

static_reflection_capabilities_1.StaticAndDynamicReflectionCapabilities.install(staticReflector);
var htmlParser = new compiler.I18NHtmlParser(new private_import_compiler_1.HtmlParser(), transContent, cliOptions.i18nFormat);
var htmlParser = new compiler.I18NHtmlParser(new compiler.HtmlParser(), transContent, cliOptions.i18nFormat);
var config = new compiler.CompilerConfig({

@@ -175,10 +174,10 @@ genDebugInfo: options.debug === true,

});
var normalizer = new private_import_compiler_1.DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
var expressionParser = new private_import_compiler_1.Parser(new private_import_compiler_1.Lexer());
var elementSchemaRegistry = new private_import_compiler_1.DomElementSchemaRegistry();
var normalizer = new compiler.DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
var expressionParser = new compiler.Parser(new compiler.Lexer());
var elementSchemaRegistry = new compiler.DomElementSchemaRegistry();
var console = new private_import_core_1.Console();
var tmplParser = new private_import_compiler_1.TemplateParser(expressionParser, elementSchemaRegistry, htmlParser, console, []);
var resolver = new private_import_compiler_1.CompileMetadataResolver(new compiler.NgModuleResolver(staticReflector), new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), elementSchemaRegistry, staticReflector);
var tmplParser = new compiler.TemplateParser(expressionParser, elementSchemaRegistry, htmlParser, console, []);
var resolver = new compiler.CompileMetadataResolver(new compiler.NgModuleResolver(staticReflector), new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), elementSchemaRegistry, staticReflector);
// TODO(vicb): do not pass cliOptions.i18nFormat here
var offlineCompiler = new compiler.OfflineCompiler(resolver, normalizer, tmplParser, new private_import_compiler_1.StyleCompiler(urlResolver), new private_import_compiler_1.ViewCompiler(config), new private_import_compiler_1.NgModuleCompiler(), new private_import_compiler_1.TypeScriptEmitter(reflectorHost), cliOptions.locale, cliOptions.i18nFormat);
var offlineCompiler = new compiler.OfflineCompiler(resolver, normalizer, tmplParser, new compiler.StyleCompiler(urlResolver), new compiler.ViewCompiler(config), new compiler.DirectiveWrapperCompiler(config), new compiler.NgModuleCompiler(), new compiler.TypeScriptEmitter(reflectorHost), cliOptions.locale, cliOptions.i18nFormat);
return new CodeGenerator(options, program, compilerHost, staticReflector, offlineCompiler, reflectorHost);

@@ -185,0 +184,0 @@ };

@@ -5,3 +5,2 @@ import 'reflect-metadata';

import * as tsc from '@angular/tsc-wrapped';
import { CompileMetadataResolver, DirectiveNormalizer } from './private_import_compiler';
import { ReflectorHost, ReflectorHostContext } from './reflector_host';

@@ -17,4 +16,3 @@ import { StaticReflector } from './static_reflector';

private directiveNormalizer;
private compiler;
constructor(program: ts.Program, host: ts.CompilerHost, staticReflector: StaticReflector, messageBundle: compiler.MessageBundle, reflectorHost: ReflectorHost, metadataResolver: CompileMetadataResolver, directiveNormalizer: DirectiveNormalizer, compiler: compiler.OfflineCompiler);
constructor(program: ts.Program, host: ts.CompilerHost, staticReflector: StaticReflector, messageBundle: compiler.MessageBundle, reflectorHost: ReflectorHost, metadataResolver: compiler.CompileMetadataResolver, directiveNormalizer: compiler.DirectiveNormalizer);
private readFileMetadata(absSourcePath);

@@ -21,0 +19,0 @@ extract(): Promise<compiler.MessageBundle>;

@@ -8,4 +8,2 @@ #!/usr/bin/env node

var tsc = require('@angular/tsc-wrapped');
var private_import_compiler_1 = require('./private_import_compiler');
var private_import_core_1 = require('./private_import_core');
var reflector_host_1 = require('./reflector_host');

@@ -15,3 +13,3 @@ var static_reflection_capabilities_1 = require('./static_reflection_capabilities');

function extract(ngOptions, cliOptions, program, host) {
var htmlParser = new compiler.I18NHtmlParser(new private_import_compiler_1.HtmlParser());
var htmlParser = new compiler.I18NHtmlParser(new compiler.HtmlParser());
var extractor = Extractor.create(ngOptions, cliOptions.i18nFormat, program, host, htmlParser);

@@ -41,3 +39,3 @@ var bundlePromise = extractor.extract();

var Extractor = (function () {
function Extractor(program, host, staticReflector, messageBundle, reflectorHost, metadataResolver, directiveNormalizer, compiler) {
function Extractor(program, host, staticReflector, messageBundle, reflectorHost, metadataResolver, directiveNormalizer) {
this.program = program;

@@ -50,3 +48,2 @@ this.host = host;

this.directiveNormalizer = directiveNormalizer;
this.compiler = compiler;
}

@@ -96,3 +93,3 @@ Extractor.prototype.readFileMetadata = function (absSourcePath) {

}, []);
var analyzedNgModules = this.compiler.analyzeModules(ngModules);
var analyzedNgModules = compiler.analyzeModules(ngModules, this.metadataResolver);
var errors = [];

@@ -104,3 +101,3 @@ var bundlePromise = Promise

var compMeta = _this.metadataResolver.getDirectiveMetadata(compType);
var ngModule = analyzedNgModules.ngModuleByComponent.get(compType);
var ngModule = analyzedNgModules.ngModuleByDirective.get(compType);
if (!ngModule) {

@@ -147,12 +144,8 @@ throw new Error("Cannot determine the module for component " + compMeta.type.name + "!");

});
var normalizer = new private_import_compiler_1.DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
var expressionParser = new private_import_compiler_1.Parser(new private_import_compiler_1.Lexer());
var elementSchemaRegistry = new private_import_compiler_1.DomElementSchemaRegistry();
var console = new private_import_core_1.Console();
var tmplParser = new private_import_compiler_1.TemplateParser(expressionParser, elementSchemaRegistry, htmlParser, console, []);
var resolver = new private_import_compiler_1.CompileMetadataResolver(new compiler.NgModuleResolver(staticReflector), new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), elementSchemaRegistry, staticReflector);
var offlineCompiler = new compiler.OfflineCompiler(resolver, normalizer, tmplParser, new private_import_compiler_1.StyleCompiler(urlResolver), new private_import_compiler_1.ViewCompiler(config), new private_import_compiler_1.NgModuleCompiler(), new private_import_compiler_1.TypeScriptEmitter(reflectorHost), null, null);
var normalizer = new compiler.DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
var elementSchemaRegistry = new compiler.DomElementSchemaRegistry();
var resolver = new compiler.CompileMetadataResolver(new compiler.NgModuleResolver(staticReflector), new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), elementSchemaRegistry, staticReflector);
// TODO(vicb): implicit tags & attributes
var messageBundle = new compiler.MessageBundle(htmlParser, [], {});
return new Extractor(program, compilerHost, staticReflector, messageBundle, reflectorHost, resolver, normalizer, offlineCompiler);
return new Extractor(program, compilerHost, staticReflector, messageBundle, reflectorHost, resolver, normalizer);
};

@@ -159,0 +152,0 @@ return Extractor;

@@ -8,5 +8,5 @@ /**

*/
import { ImportGenerator } from '@angular/compiler';
import { AngularCompilerOptions, MetadataCollector, ModuleMetadata } from '@angular/tsc-wrapped';
import * as ts from 'typescript';
import { ImportGenerator } from './private_import_compiler';
import { StaticReflectorHost, StaticSymbol } from './static_reflector';

@@ -13,0 +13,0 @@ export interface ReflectorHostContext {

@@ -9,2 +9,3 @@ /**

"use strict";
var compiler_1 = require('@angular/compiler');
var tsc_wrapped_1 = require('@angular/tsc-wrapped');

@@ -14,3 +15,2 @@ var fs = require('fs');

var ts = require('typescript');
var private_import_compiler_1 = require('./private_import_compiler');
var static_reflector_1 = require('./static_reflector');

@@ -56,3 +56,3 @@ var EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;

ReflectorHost.prototype.normalizeAssetUrl = function (url) {
var assetUrl = private_import_compiler_1.AssetUrl.parse(url);
var assetUrl = compiler_1.AssetUrl.parse(url);
var path = assetUrl ? assetUrl.packageName + "/" + assetUrl.modulePath : null;

@@ -59,0 +59,0 @@ return this.getCanonicalFileName(path);

@@ -17,4 +17,3 @@ /**

factory(type: any): Function;
interfaces(type: any): any[];
hasLifecycleHook(type: any, lcInterface: any, lcProperty: string): boolean;
hasLifecycleHook(type: any, lcProperty: string): boolean;
parameters(type: any): any[][];

@@ -21,0 +20,0 @@ annotations(type: any): any[];

@@ -20,7 +20,5 @@ /**

StaticAndDynamicReflectionCapabilities.prototype.factory = function (type) { return this.dynamicDelegate.factory(type); };
StaticAndDynamicReflectionCapabilities.prototype.interfaces = function (type) { return this.dynamicDelegate.interfaces(type); };
StaticAndDynamicReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcInterface, lcProperty) {
return isStaticType(type) ?
this.staticDelegate.hasLifecycleHook(type, lcInterface, lcProperty) :
this.dynamicDelegate.hasLifecycleHook(type, lcInterface, lcProperty);
StaticAndDynamicReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcProperty) {
return isStaticType(type) ? this.staticDelegate.hasLifecycleHook(type, lcProperty) :
this.dynamicDelegate.hasLifecycleHook(type, lcProperty);
};

@@ -27,0 +25,0 @@ StaticAndDynamicReflectionCapabilities.prototype.parameters = function (type) {

@@ -67,3 +67,3 @@ import { ReflectorReader } from './private_import_core';

parameters(type: StaticSymbol): any[];
hasLifecycleHook(type: any, lcInterface: any, lcProperty: string): boolean;
hasLifecycleHook(type: any, lcProperty: string): boolean;
private registerDecoratorOrConstructor(type, ctor);

@@ -70,0 +70,0 @@ private registerFunction(type, fn);

@@ -129,3 +129,3 @@ /**

};
StaticReflector.prototype.hasLifecycleHook = function (type, lcInterface, lcProperty) {
StaticReflector.prototype.hasLifecycleHook = function (type, lcProperty) {
if (!(type instanceof StaticSymbol)) {

@@ -136,3 +136,3 @@ throw new Error("hasLifecycleHook received " + JSON.stringify(type) + " which is not a StaticSymbol");

var members = classMetadata ? classMetadata['members'] : null;
var member = members ? members[lcProperty] : null;
var member = members && members.hasOwnProperty(lcProperty) ? members[lcProperty] : null;
return member ? member.some(function (a) { return a['__symbolic'] == 'method'; }) : false;

@@ -139,0 +139,0 @@ };

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc