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.3.0-rc.0 to 2.3.0

src/main.metadata.json

8

index.d.ts

@@ -10,9 +10,5 @@ /**

export { CodeGenerator } from './src/codegen';
export { CompilerHost, CompilerHostContext, NodeCompilerHostContext } from './src/compiler_host';
export { CompilerHost, CompilerHostContext, ModuleResolutionHostAdapter, NodeCompilerHostContext } from './src/compiler_host';
export { Extractor } from './src/extractor';
export * from '@angular/tsc-wrapped';
import { Version } from '@angular/core';
/**
* @stable
*/
export declare const VERSION: Version;
export { VERSION } from './src/version';

@@ -19,2 +19,3 @@ "use strict";

exports.CompilerHost = compiler_host_1.CompilerHost;
exports.ModuleResolutionHostAdapter = compiler_host_1.ModuleResolutionHostAdapter;
exports.NodeCompilerHostContext = compiler_host_1.NodeCompilerHostContext;

@@ -24,7 +25,4 @@ var extractor_1 = require('./src/extractor');

__export(require('@angular/tsc-wrapped'));
var core_1 = require('@angular/core');
/**
* @stable
*/
exports.VERSION = new core_1.Version('2.3.0-rc.0');
var version_1 = require('./src/version');
exports.VERSION = version_1.VERSION;
//# sourceMappingURL=index.js.map

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

[{"__symbolic":"module","version":2,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.3.0-rc.0"]}},"exports":[{"from":"@angular/compiler","export":["AotCompilerHost",{"name":"AotCompilerHost","as":"StaticReflectorHost"},"StaticReflector","StaticSymbol"]},{"from":"./src/codegen","export":["CodeGenerator"]},{"from":"./src/compiler_host","export":["CompilerHost","CompilerHostContext","NodeCompilerHostContext"]},{"from":"./src/extractor","export":["Extractor"]},{"from":"@angular/tsc-wrapped"}]},{"__symbolic":"module","exports":[{"from":"@angular/compiler","export":["AotCompilerHost",{"name":"AotCompilerHost","as":"StaticReflectorHost"},"StaticReflector","StaticSymbol"]},{"from":"./src/codegen","export":["CodeGenerator"]},{"from":"./src/compiler_host","export":["CompilerHost","CompilerHostContext","NodeCompilerHostContext"]},{"from":"./src/extractor","export":["Extractor"]},{"from":"@angular/tsc-wrapped"}],"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["2.3.0-rc.0"]}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{},"exports":[{"from":"@angular/compiler","export":["AotCompilerHost",{"name":"AotCompilerHost","as":"StaticReflectorHost"},"StaticReflector","StaticSymbol"]},{"from":"./src/codegen","export":["CodeGenerator"]},{"from":"./src/compiler_host","export":["CompilerHost","CompilerHostContext","ModuleResolutionHostAdapter","NodeCompilerHostContext"]},{"from":"./src/extractor","export":["Extractor"]},{"from":"@angular/tsc-wrapped"},{"from":"./src/version","export":["VERSION"]}]},{"__symbolic":"module","exports":[{"from":"@angular/compiler","export":["AotCompilerHost",{"name":"AotCompilerHost","as":"StaticReflectorHost"},"StaticReflector","StaticSymbol"]},{"from":"./src/codegen","export":["CodeGenerator"]},{"from":"./src/compiler_host","export":["CompilerHost","CompilerHostContext","ModuleResolutionHostAdapter","NodeCompilerHostContext"]},{"from":"./src/extractor","export":["Extractor"]},{"from":"@angular/tsc-wrapped"},{"from":"./src/version","export":["VERSION"]}],"metadata":{},"version":1}]
{
"name": "@angular/compiler-cli",
"version": "2.3.0-rc.0",
"version": "2.3.0",
"description": "Angular - the compiler CLI for Node.js",

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

"dependencies": {
"@angular/tsc-wrapped": "0.4.1",
"@angular/tsc-wrapped": "0.4.2",
"reflect-metadata": "^0.1.2",

@@ -19,4 +19,4 @@ "minimist": "^1.2.0"

"typescript": "^2.0.2",
"@angular/compiler": "2.3.0-rc.0",
"@angular/core": "2.3.0-rc.0"
"@angular/compiler": "2.3.0",
"@angular/core": "2.3.0"
},

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

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

var GENERATED_FILES = /\.ngfactory\.ts$|\.css\.ts$|\.css\.shim\.ts$/;
var GENERATED_META_FILES = /\.json$/;
var GENERATED_OR_DTS_FILES = /\.d\.ts$|\.ngfactory\.ts$|\.css\.ts$|\.css\.shim\.ts$/;

@@ -57,5 +58,7 @@ var PREAMBLE = "/**\n * @fileoverview This file is generated by the Angular 2 template compiler.\n * Do not edit.\n * @suppress {suspiciousCode,uselessCode,missingProperties}\n */\n /* tslint:disable */\n\n";

generatedModules.forEach(function (generatedModule) {
var sourceFile = _this.program.getSourceFile(generatedModule.fileUrl);
var emitPath = _this.calculateEmitPath(generatedModule.moduleUrl);
_this.host.writeFile(emitPath, PREAMBLE + generatedModule.source, false, function () { }, [sourceFile]);
var sourceFile = _this.program.getSourceFile(generatedModule.srcFileUrl);
var emitPath = _this.calculateEmitPath(generatedModule.genFileUrl);
var source = GENERATED_META_FILES.test(emitPath) ? generatedModule.source :
PREAMBLE + generatedModule.source;
_this.host.writeFile(emitPath, source, false, function () { }, [sourceFile]);
});

@@ -67,5 +70,5 @@ });

var usePathMapping = !!options.rootDirs && options.rootDirs.length > 0;
ngCompilerHost = usePathMapping ?
new path_mapped_compiler_host_1.PathMappedCompilerHost(program, tsCompilerHost, options, compilerHostContext) :
new compiler_host_1.CompilerHost(program, tsCompilerHost, options, compilerHostContext);
var context = compilerHostContext || new compiler_host_1.ModuleResolutionHostAdapter(tsCompilerHost);
ngCompilerHost = usePathMapping ? new path_mapped_compiler_host_1.PathMappedCompilerHost(program, options, context) :
new compiler_host_1.CompilerHost(program, options, context);
}

@@ -72,0 +75,0 @@ var transFile = cliOptions.i18nFile;

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

[{"__symbolic":"module","version":2,"metadata":{"CodeGenerator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/compiler","name":"AotCompiler"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"}]}],"calculateEmitPath":[{"__symbolic":"method"}],"codegen":[{"__symbolic":"method"}]}},"excludeFilePattern":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"generateCodeForLibraries"},"right":false},"thenExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":24,"character":6,"context":{"name":"GENERATED_OR_DTS_FILES"}},"elseExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":6,"context":{"name":"GENERATED_FILES"}}}}}},{"__symbolic":"module","metadata":{"CodeGenerator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/compiler","name":"AotCompiler"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"}]}],"calculateEmitPath":[{"__symbolic":"method"}],"codegen":[{"__symbolic":"method"}]}},"excludeFilePattern":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"generateCodeForLibraries"},"right":false},"thenExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":24,"character":6,"context":{"name":"GENERATED_OR_DTS_FILES"}},"elseExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":6,"context":{"name":"GENERATED_FILES"}}}}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{"CodeGenerator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/compiler","name":"AotCompiler"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"}]}],"calculateEmitPath":[{"__symbolic":"method"}],"codegen":[{"__symbolic":"method"}]}},"excludeFilePattern":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"generateCodeForLibraries"},"right":false},"thenExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":25,"character":6,"context":{"name":"GENERATED_OR_DTS_FILES"}},"elseExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":6,"context":{"name":"GENERATED_FILES"}}}}}},{"__symbolic":"module","metadata":{"CodeGenerator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/compiler","name":"AotCompiler"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"}]}],"calculateEmitPath":[{"__symbolic":"method"}],"codegen":[{"__symbolic":"method"}]}},"excludeFilePattern":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"generateCodeForLibraries"},"right":false},"thenExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":25,"character":6,"context":{"name":"GENERATED_OR_DTS_FILES"}},"elseExpression":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":6,"context":{"name":"GENERATED_FILES"}}}}},"version":1}]

@@ -11,6 +11,3 @@ /**

import * as ts from 'typescript';
export interface CompilerHostContext {
fileExists(fileName: string): boolean;
directoryExists(directoryName: string): boolean;
readFile(fileName: string): string;
export interface CompilerHostContext extends ts.ModuleResolutionHost {
readResource(fileName: string): Promise<string>;

@@ -21,6 +18,5 @@ assumeFileExists(fileName: string): void;

protected program: ts.Program;
protected compilerHost: ts.CompilerHost;
protected options: AngularCompilerOptions;
protected context: CompilerHostContext;
protected metadataCollector: MetadataCollector;
protected context: CompilerHostContext;
private isGenDirChildOfRootDir;

@@ -30,3 +26,3 @@ protected basePath: string;

private resolverCache;
constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: CompilerHostContext);
constructor(program: ts.Program, options: AngularCompilerOptions, context: CompilerHostContext);
getCanonicalFileName(fileName: string): string;

@@ -59,12 +55,24 @@ moduleNameToFileName(m: string, containingFile: string): string;

loadResource(filePath: string): Promise<string>;
loadSummary(filePath: string): string;
getOutputFileName(sourceFilePath: string): string;
}
export declare class NodeCompilerHostContext implements CompilerHostContext {
export declare class CompilerHostContextAdapter {
protected assumedExists: {
[fileName: string]: boolean;
};
assumeFileExists(fileName: string): void;
}
export declare class ModuleResolutionHostAdapter extends CompilerHostContextAdapter implements CompilerHostContext {
private host;
constructor(host: ts.CompilerHost);
private assumedExists;
directoryExists: ((directoryName: string) => boolean) | undefined;
constructor(host: ts.ModuleResolutionHost);
fileExists(fileName: string): boolean;
readFile(fileName: string): string;
readResource(s: string): Promise<string>;
}
export declare class NodeCompilerHostContext extends CompilerHostContextAdapter implements CompilerHostContext {
fileExists(fileName: string): boolean;
directoryExists(directoryName: string): boolean;
readFile(fileName: string): string;
readResource(s: string): Promise<string>;
assumeFileExists(fileName: string): void;
}

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

"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var tsc_wrapped_1 = require('@angular/tsc-wrapped');

@@ -19,6 +24,6 @@ var fs = require('fs');

var CompilerHost = (function () {
function CompilerHost(program, compilerHost, options, context) {
function CompilerHost(program, options, context) {
this.program = program;
this.compilerHost = compilerHost;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();

@@ -29,3 +34,2 @@ this.resolverCache = new Map();

this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
this.context = context || new NodeCompilerHostContext(compilerHost);
var genPath = path.relative(this.basePath, this.genDir);

@@ -68,3 +72,3 @@ this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');

// assume it exists it so that the `resolve` method works!
if (!this.compilerHost.fileExists(importedFile)) {
if (!this.context.fileExists(importedFile)) {
this.context.assumeFileExists(importedFile);

@@ -199,13 +203,48 @@ }

CompilerHost.prototype.loadResource = function (filePath) { return this.context.readResource(filePath); };
CompilerHost.prototype.loadSummary = function (filePath) { return this.context.readFile(filePath); };
CompilerHost.prototype.getOutputFileName = function (sourceFilePath) {
return sourceFilePath.replace(EXT, '') + '.d.ts';
};
return CompilerHost;
}());
exports.CompilerHost = CompilerHost;
var NodeCompilerHostContext = (function () {
function NodeCompilerHostContext(host) {
this.host = host;
var CompilerHostContextAdapter = (function () {
function CompilerHostContextAdapter() {
this.assumedExists = {};
}
NodeCompilerHostContext.prototype.fileExists = function (fileName) {
CompilerHostContextAdapter.prototype.assumeFileExists = function (fileName) { this.assumedExists[fileName] = true; };
return CompilerHostContextAdapter;
}());
exports.CompilerHostContextAdapter = CompilerHostContextAdapter;
var ModuleResolutionHostAdapter = (function (_super) {
__extends(ModuleResolutionHostAdapter, _super);
function ModuleResolutionHostAdapter(host) {
_super.call(this);
this.host = host;
if (host.directoryExists) {
this.directoryExists = function (directoryName) { return host.directoryExists(directoryName); };
}
}
ModuleResolutionHostAdapter.prototype.fileExists = function (fileName) {
return this.assumedExists[fileName] || this.host.fileExists(fileName);
};
ModuleResolutionHostAdapter.prototype.readFile = function (fileName) { return this.host.readFile(fileName); };
ModuleResolutionHostAdapter.prototype.readResource = function (s) {
if (!this.host.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(this.host.readFile(s));
};
return ModuleResolutionHostAdapter;
}(CompilerHostContextAdapter));
exports.ModuleResolutionHostAdapter = ModuleResolutionHostAdapter;
var NodeCompilerHostContext = (function (_super) {
__extends(NodeCompilerHostContext, _super);
function NodeCompilerHostContext() {
_super.apply(this, arguments);
}
NodeCompilerHostContext.prototype.fileExists = function (fileName) {
return this.assumedExists[fileName] || fs.existsSync(fileName);
};
NodeCompilerHostContext.prototype.directoryExists = function (directoryName) {

@@ -221,12 +260,11 @@ try {

NodeCompilerHostContext.prototype.readResource = function (s) {
if (!this.host.fileExists(s)) {
if (!this.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(this.host.readFile(s));
return Promise.resolve(this.readFile(s));
};
NodeCompilerHostContext.prototype.assumeFileExists = function (fileName) { this.assumedExists[fileName] = true; };
return NodeCompilerHostContext;
}());
}(CompilerHostContextAdapter));
exports.NodeCompilerHostContext = NodeCompilerHostContext;
//# sourceMappingURL=compiler_host.js.map

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

[{"__symbolic":"module","version":2,"metadata":{"CompilerHost":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"error","message":"Could not resolve type","line":37,"character":59,"context":{"typeName":"CompilerHostContext"}}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"dotRelative":[{"__symbolic":"method"}],"rewriteGenDirPath":[{"__symbolic":"method"}],"getSourceFile":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}],"readMetadata":[{"__symbolic":"method"}],"loadResource":[{"__symbolic":"method"}]}},"NodeCompilerHostContext":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"CompilerHost"}]}],"fileExists":[{"__symbolic":"method"}],"directoryExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}],"assumeFileExists":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"CompilerHost":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"error","message":"Could not resolve type","line":37,"character":59,"context":{"typeName":"CompilerHostContext"}}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"dotRelative":[{"__symbolic":"method"}],"rewriteGenDirPath":[{"__symbolic":"method"}],"getSourceFile":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}],"readMetadata":[{"__symbolic":"method"}],"loadResource":[{"__symbolic":"method"}]}},"NodeCompilerHostContext":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"CompilerHost"}]}],"fileExists":[{"__symbolic":"method"}],"directoryExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}],"assumeFileExists":[{"__symbolic":"method"}]}}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{"CompilerHost":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"error","message":"Could not resolve type","line":33,"character":25,"context":{"typeName":"CompilerHostContext"}}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"dotRelative":[{"__symbolic":"method"}],"rewriteGenDirPath":[{"__symbolic":"method"}],"getSourceFile":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}],"readMetadata":[{"__symbolic":"method"}],"loadResource":[{"__symbolic":"method"}],"loadSummary":[{"__symbolic":"method"}],"getOutputFileName":[{"__symbolic":"method"}]}},"CompilerHostContextAdapter":{"__symbolic":"class","members":{"assumeFileExists":[{"__symbolic":"method"}]}},"ModuleResolutionHostAdapter":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CompilerHostContextAdapter"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"ModuleResolutionHost"}]}],"fileExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}]}},"NodeCompilerHostContext":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CompilerHostContextAdapter"},"members":{"fileExists":[{"__symbolic":"method"}],"directoryExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"CompilerHost":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"error","message":"Could not resolve type","line":33,"character":25,"context":{"typeName":"CompilerHostContext"}}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"dotRelative":[{"__symbolic":"method"}],"rewriteGenDirPath":[{"__symbolic":"method"}],"getSourceFile":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}],"readMetadata":[{"__symbolic":"method"}],"loadResource":[{"__symbolic":"method"}],"loadSummary":[{"__symbolic":"method"}],"getOutputFileName":[{"__symbolic":"method"}]}},"CompilerHostContextAdapter":{"__symbolic":"class","members":{"assumeFileExists":[{"__symbolic":"method"}]}},"ModuleResolutionHostAdapter":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CompilerHostContextAdapter"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"ModuleResolutionHost"}]}],"fileExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}]}},"NodeCompilerHostContext":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"CompilerHostContextAdapter"},"members":{"fileExists":[{"__symbolic":"method"}],"directoryExists":[{"__symbolic":"method"}],"readFile":[{"__symbolic":"method"}],"readResource":[{"__symbolic":"method"}]}}},"version":1}]

@@ -22,3 +22,3 @@ /**

extract(): Promise<compiler.MessageBundle>;
static create(options: tsc.AngularCompilerOptions, translationsFormat: string, program: ts.Program, tsCompilerHost: ts.CompilerHost, ngCompilerHost?: CompilerHost): Extractor;
static create(options: tsc.AngularCompilerOptions, translationsFormat: string, program: ts.Program, moduleResolverHost: ts.ModuleResolutionHost, ngCompilerHost?: CompilerHost): Extractor;
}

@@ -27,5 +27,6 @@ /**

};
Extractor.create = function (options, translationsFormat, program, tsCompilerHost, ngCompilerHost) {
Extractor.create = function (options, translationsFormat, program, moduleResolverHost, ngCompilerHost) {
if (!ngCompilerHost)
ngCompilerHost = new compiler_host_1.CompilerHost(program, tsCompilerHost, options);
ngCompilerHost =
new compiler_host_1.CompilerHost(program, options, new compiler_host_1.ModuleResolutionHostAdapter(moduleResolverHost));
var ngExtractor = compiler.Extractor.create(ngCompilerHost, { excludeFilePattern: codegen_1.excludeFilePattern(options) }).extractor;

@@ -32,0 +33,0 @@ return new Extractor(ngExtractor, ngCompilerHost, program);

import 'reflect-metadata';
export declare function main(args: any, consoleError?: (s: string) => void): Promise<number>;

@@ -9,13 +9,24 @@ #!/usr/bin/env node

}
// CLI entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
function main(args, consoleError) {
if (consoleError === void 0) { consoleError = console.error; }
var project = args.p || args.project || '.';
var cliOptions = new tsc.NgcCliOptions(args);
tsc.main(project, cliOptions, codegen).then(function (exitCode) { return process.exit(exitCode); }).catch(function (e) {
console.error(e.stack);
console.error('Compilation failed');
process.exit(1);
return tsc.main(project, cliOptions, codegen).then(function () { return 0; }).catch(function (e) {
if (e instanceof tsc.UserError) {
consoleError(e.message);
return Promise.resolve(1);
}
else {
consoleError(e.stack);
consoleError('Compilation failed');
return Promise.resolve(1);
}
});
}
exports.main = main;
// CLI entry point
if (require.main === module) {
var args = require('minimist')(process.argv.slice(2));
main(args).then(function (exitCode) { return process.exit(exitCode); });
}
//# sourceMappingURL=main.js.map

@@ -12,3 +12,3 @@ import { AngularCompilerOptions, ModuleMetadata } from '@angular/tsc-wrapped';

export declare class PathMappedCompilerHost extends CompilerHost {
constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: CompilerHostContext);
constructor(program: ts.Program, options: AngularCompilerOptions, context: CompilerHostContext);
getCanonicalFileName(fileName: string): string;

@@ -15,0 +15,0 @@ moduleNameToFileName(m: string, containingFile: string): string;

@@ -28,4 +28,4 @@ /**

__extends(PathMappedCompilerHost, _super);
function PathMappedCompilerHost(program, compilerHost, options, context) {
_super.call(this, program, compilerHost, options, context);
function PathMappedCompilerHost(program, options, context) {
_super.call(this, program, options, context);
}

@@ -115,3 +115,3 @@ PathMappedCompilerHost.prototype.getCanonicalFileName = function (fileName) {

var rootedPath = path.join(root, filePath);
if (!this.compilerHost.fileExists(rootedPath)) {
if (!this.context.fileExists(rootedPath)) {
// If the file doesn't exists then we cannot return metadata for the file.

@@ -118,0 +118,0 @@ // This will occur if the user refernced a declared module for which no file

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

[{"__symbolic":"module","version":2,"metadata":{"PathMappedCompilerHost":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHostContext"}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"PathMappedCompilerHost":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"typescript","name":"CompilerHost"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHostContext"}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}]}}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{"PathMappedCompilerHost":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHostContext"}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"PathMappedCompilerHost":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHost"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"typescript","name":"Program"},{"__symbolic":"reference","module":"@angular/tsc-wrapped","name":"AngularCompilerOptions"},{"__symbolic":"reference","module":"./compiler_host","name":"CompilerHostContext"}]}],"getCanonicalFileName":[{"__symbolic":"method"}],"moduleNameToFileName":[{"__symbolic":"method"}],"fileNameToModuleName":[{"__symbolic":"method"}],"getMetadataFor":[{"__symbolic":"method"}]}}},"version":1}]

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