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
841
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 0.4.0 to 0.4.1

7

index.d.ts

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export { CodeGenerator } from './src/codegen';

@@ -2,0 +9,0 @@ export { NodeReflectorHostContext, ReflectorHost, ReflectorHostContext } from './src/reflector_host';

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ function __export(m) {

13

package.json
{
"name": "@angular/compiler-cli",
"version": "0.4.0",
"version": "0.4.1",
"description": "Execute angular2 template compiler in nodejs.",

@@ -12,11 +12,12 @@ "main": "index.js",

"dependencies": {
"@angular/tsc-wrapped": "^0.1.0",
"@angular/tsc-wrapped": "^0.2.0",
"reflect-metadata": "^0.1.2",
"parse5": "1.3.2"
"parse5": "1.3.2",
"minimist": "^1.2.0"
},
"peerDependencies": {
"typescript": "^1.9.0-dev",
"@angular/compiler": "2.0.0-rc.3",
"@angular/platform-server": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3"
"@angular/compiler": "^2.0.0-rc.4",
"@angular/platform-server": "^2.0.0-rc.4",
"@angular/core": "^2.0.0-rc.4"
},

@@ -23,0 +24,0 @@ "repository": {

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Transform template html and css into executable code.

@@ -23,5 +30,4 @@ * Intended to be used in a build step.

private calculateEmitPath(filePath);
private generateStylesheet(filepath, shim);
codegen(): Promise<any>;
static create(options: AngularCompilerOptions, program: ts.Program, compilerHost: ts.CompilerHost, reflectorHostContext?: ReflectorHostContext): CodeGenerator;
}

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -84,17 +91,4 @@ /**

};
// TODO(tbosch): add a cache for shared css files
// TODO(tbosch): detect cycles!
CodeGenerator.prototype.generateStylesheet = function (filepath, shim) {
var _this = this;
return this.compiler.loadAndCompileStylesheet(filepath, shim, '.ts')
.then(function (sourceWithImports) {
var emitPath = _this.calculateEmitPath(sourceWithImports.source.moduleUrl);
// TODO(alexeagle): should include the sourceFile to the WriteFileCallback
_this.host.writeFile(emitPath, PREAMBLE + sourceWithImports.source.source, false);
return Promise.all(sourceWithImports.importedUrls.map(function (url) { return _this.generateStylesheet(url, shim); }));
});
};
CodeGenerator.prototype.codegen = function () {
var _this = this;
var stylesheetPromises = [];
var generateOneFile = function (absSourcePath) {

@@ -106,17 +100,11 @@ return Promise.all(_this.readComponents(absSourcePath))

}
metadatas.forEach(function (metadata) {
var stylesheetPaths = metadata && metadata.template && metadata.template.styleUrls;
if (stylesheetPaths) {
stylesheetPaths.forEach(function (path) {
stylesheetPromises.push(_this.generateStylesheet(path, metadata.template.encapsulation === core_1.ViewEncapsulation.Emulated));
});
}
});
return _this.generateSource(metadatas);
})
.then(function (generated) {
if (generated) {
var sourceFile = _this.program.getSourceFile(absSourcePath);
var emitPath = _this.calculateEmitPath(generated.moduleUrl);
_this.host.writeFile(emitPath, PREAMBLE + generated.source, false, function () { }, [sourceFile]);
.then(function (generatedModules) {
if (generatedModules) {
generatedModules.forEach(function (generatedModule) {
var sourceFile = _this.program.getSourceFile(absSourcePath);
var emitPath = _this.calculateEmitPath(generatedModule.moduleUrl);
_this.host.writeFile(emitPath, PREAMBLE + generatedModule.source, false, function () { }, [sourceFile]);
});
}

@@ -130,6 +118,14 @@ })

.map(generateOneFile);
return Promise.all(stylesheetPromises.concat(compPromises));
return Promise.all(compPromises);
};
CodeGenerator.create = function (options, program, compilerHost, reflectorHostContext) {
var xhr = { get: function (s) { return Promise.resolve(compilerHost.readFile(s)); } };
var xhr = {
get: function (s) {
if (!compilerHost.fileExists(s)) {
// TODO: We should really have a test for error cases like this!
throw new Error("Compilation failed. Resource file not found: " + s);
}
return Promise.resolve(compilerHost.readFile(s));
}
};
var urlResolver = compiler.createOfflineCompileUrlResolver();

@@ -152,3 +148,3 @@ var reflectorHost = new reflector_host_1.ReflectorHost(program, compilerHost, options, reflectorHostContext);

/*console*/ null, []);
var offlineCompiler = new compiler.OfflineCompiler(normalizer, tmplParser, new compiler_private_1.StyleCompiler(urlResolver), new compiler_private_1.ViewCompiler(config), new compiler_private_1.TypeScriptEmitter(reflectorHost), xhr);
var offlineCompiler = new compiler.OfflineCompiler(normalizer, tmplParser, new compiler_private_1.StyleCompiler(urlResolver), new compiler_private_1.ViewCompiler(config), new compiler_private_1.TypeScriptEmitter(reflectorHost));
var resolver = new compiler_private_1.CompileMetadataResolver(new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), new compiler.ViewResolver(staticReflector), config, staticReflector);

@@ -155,0 +151,0 @@ return new CodeGenerator(options, program, compilerHost, staticReflector, resolver, offlineCompiler, reflectorHost);

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { __compiler_private__ as _c } from '@angular/compiler';

@@ -2,0 +9,0 @@ export declare type AssetUrl = _c.AssetUrl;

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ var compiler_1 = require('@angular/compiler');

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { __core_private_types__ as t } from '@angular/core';

@@ -2,0 +9,0 @@ export declare type ReflectorReader = t.ReflectorReader;

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ var core_1 = require('@angular/core');

@@ -109,3 +109,11 @@ #!/usr/bin/env node

Extractor.create = function (options, program, compilerHost) {
var xhr = { get: function (s) { return Promise.resolve(compilerHost.readFile(s)); } };
var xhr = {
get: function (s) {
if (!compilerHost.fileExists(s)) {
// TODO: We should really have a test for error cases like this!
throw new Error("Compilation failed. Resource file not found: " + s);
}
return Promise.resolve(compilerHost.readFile(s));
}
};
var urlResolver = compiler.createOfflineCompileUrlResolver();

@@ -128,3 +136,3 @@ var reflectorHost = new reflector_host_1.ReflectorHost(program, compilerHost, options);

/*console*/ null, []);
var offlineCompiler = new compiler.OfflineCompiler(normalizer, tmplParser, new compiler_private_1.StyleCompiler(urlResolver), new compiler_private_1.ViewCompiler(config), new compiler_private_1.TypeScriptEmitter(reflectorHost), xhr);
var offlineCompiler = new compiler.OfflineCompiler(normalizer, tmplParser, new compiler_private_1.StyleCompiler(urlResolver), new compiler_private_1.ViewCompiler(config), new compiler_private_1.TypeScriptEmitter(reflectorHost));
var resolver = new compiler_private_1.CompileMetadataResolver(new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector), new compiler.ViewResolver(staticReflector), config, staticReflector);

@@ -131,0 +139,0 @@ // TODO(vicb): handle implicit

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { AngularCompilerOptions, ModuleMetadata } from '@angular/tsc-wrapped';

@@ -2,0 +9,0 @@ import * as ts from 'typescript';

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ var tsc_wrapped_1 = require('@angular/tsc-wrapped');

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ var core_private_1 = require('./core_private');

@@ -0,1 +1,8 @@

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
"use strict";

@@ -2,0 +9,0 @@ var __extends = (this && this.__extends) || function (d, b) {

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

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