@angular/compiler-cli
Advanced tools
Comparing version 4.3.0-beta.1 to 4.3.0-rc.0
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "4.3.0-beta.1", | ||
"version": "4.3.0-rc.0", | ||
"description": "Angular - the compiler CLI for Node.js", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@angular/tsc-wrapped": "4.3.0-beta.1", | ||
"@angular/tsc-wrapped": "4.3.0-rc.0", | ||
"reflect-metadata": "^0.1.2", | ||
@@ -19,4 +19,4 @@ "minimist": "^1.2.0" | ||
"typescript": "^2.0.2", | ||
"@angular/compiler": "4.3.0-beta.1", | ||
"@angular/core": "4.3.0-beta.1" | ||
"@angular/compiler": "4.3.0-rc.0", | ||
"@angular/core": "4.3.0-rc.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "repository": { |
@@ -81,2 +81,5 @@ "use strict"; | ||
} | ||
if (!transContent) { | ||
missingTranslation = core_1.MissingTranslationStrategy.Ignore; | ||
} | ||
var aotCompiler = compiler.createAotCompiler(ngCompilerHost, { | ||
@@ -83,0 +86,0 @@ translations: transContent, |
@@ -276,3 +276,3 @@ /** | ||
*/ | ||
getTypeSymbol(type: StaticSymbol): Symbol; | ||
getTypeSymbol(type: StaticSymbol): Symbol | undefined; | ||
/** | ||
@@ -279,0 +279,0 @@ * Return the members that are in the context of a type's template reference. |
@@ -142,3 +142,3 @@ "use strict"; | ||
var typeSymbol = findClassSymbolInContext(type, context); | ||
return new SymbolWrapper(typeSymbol, context); | ||
return typeSymbol && new SymbolWrapper(typeSymbol, context); | ||
}; | ||
@@ -145,0 +145,0 @@ TypeScriptSymbolQuery.prototype.createSymbolTable = function (symbols) { |
@@ -62,3 +62,5 @@ "use strict"; | ||
} | ||
return bundle.write(serializer, function (sourcePath) { return sourcePath.replace(path.join(_this.options.basePath, '/'), ''); }); | ||
return bundle.write(serializer, function (sourcePath) { return _this.options.basePath ? | ||
path.relative(_this.options.basePath, sourcePath) : | ||
sourcePath; }); | ||
}; | ||
@@ -65,0 +67,0 @@ Extractor.prototype.getExtension = function (formatName) { |
@@ -14,2 +14,2 @@ /** | ||
}; | ||
export declare function main(args: string[], consoleError?: (s: string) => void): number; | ||
export declare function main(args: string[], consoleError?: (s: string) => void, files?: string[], options?: ts.CompilerOptions, ngOptions?: any): number; |
@@ -9,2 +9,10 @@ "use strict"; | ||
*/ | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,3 +38,3 @@ // Must be imported first, because Angular decorators throw on load. | ||
getCanonicalFileName: function (fileName) { return fileName; }, | ||
getNewLine: function () { return '\n'; } | ||
getNewLine: function () { return ts.sys.newLine; } | ||
}); | ||
@@ -101,10 +109,22 @@ } | ||
ngOptions.genDir = basePath; | ||
for (var _i = 0, _b = Object.keys(parsed.options); _i < _b.length; _i++) { | ||
var key = _b[_i]; | ||
ngOptions[key] = parsed.options[key]; | ||
} | ||
return { parsed: parsed, ngOptions: ngOptions }; | ||
} | ||
exports.readConfiguration = readConfiguration; | ||
function main(args, consoleError) { | ||
function getProjectDirectory(project) { | ||
var isFile; | ||
try { | ||
isFile = fs.lstatSync(project).isFile(); | ||
} | ||
catch (e) { | ||
// Project doesn't exist. Assume it is a file has an extension. This case happens | ||
// when the project file is passed to set basePath but no tsconfig.json file exists. | ||
// It is used in tests to ensure that the options can be passed in without there being | ||
// an actual config file. | ||
isFile = path.extname(project) !== ''; | ||
} | ||
// If project refers to a file, the project directory is the file's parent directory | ||
// otherwise project is the project directory. | ||
return isFile ? path.dirname(project) : project; | ||
} | ||
function main(args, consoleError, files, options, ngOptions) { | ||
if (consoleError === void 0) { consoleError = console.error; } | ||
@@ -114,9 +134,20 @@ try { | ||
var project = parsedArgs.p || parsedArgs.project || '.'; | ||
var projectDir = fs.lstatSync(project).isFile() ? path.dirname(project) : project; | ||
var projectDir = getProjectDirectory(project); | ||
// file names in tsconfig are resolved relative to this absolute path | ||
var basePath_1 = path.resolve(process.cwd(), projectDir); | ||
var _a = readConfiguration(project, basePath_1), parsed = _a.parsed, ngOptions = _a.ngOptions; | ||
if (!files || !options || !ngOptions) { | ||
var _a = readConfiguration(project, basePath_1), parsed = _a.parsed, readNgOptions = _a.ngOptions; | ||
if (!files) | ||
files = parsed.fileNames; | ||
if (!options) | ||
options = parsed.options; | ||
if (!ngOptions) | ||
ngOptions = readNgOptions; | ||
} | ||
// Ignore what the tsconfig.json for baseDir and genDir | ||
ngOptions.basePath = basePath_1; | ||
var host = ts.createCompilerHost(parsed.options, true); | ||
var rootFileNames_1 = parsed.fileNames.slice(0); | ||
ngOptions.genDir = basePath_1; | ||
var host = ts.createCompilerHost(options, true); | ||
host.realpath = function (p) { return p; }; | ||
var rootFileNames_1 = files.map(function (f) { return path.normalize(f); }); | ||
var addGeneratedFileName = function (fileName) { | ||
@@ -135,4 +166,5 @@ if (fileName.startsWith(basePath_1) && TS_EXT.exec(fileName)) { | ||
} | ||
var ngHost = ng.createHost({ tsHost: host, options: ngOptions }); | ||
var ngProgram = ng.createProgram({ rootNames: rootFileNames_1, host: ngHost, options: ngOptions }); | ||
var ngHostOptions = __assign({}, options, ngOptions); | ||
var ngHost = ng.createHost({ tsHost: host, options: ngHostOptions }); | ||
var ngProgram = ng.createProgram({ rootNames: rootFileNames_1, host: ngHost, options: ngHostOptions }); | ||
// Check parameter diagnostics | ||
@@ -139,0 +171,0 @@ check(basePath_1, ngProgram.getTsOptionDiagnostics(), ngProgram.getNgOptionDiagnostics()); |
@@ -306,2 +306,3 @@ "use strict"; | ||
this.getNewLine = function () { return originalHost.getNewLine(); }; | ||
this.realPath = function (p) { return p; }; | ||
this.fileExists = function (fileName) { | ||
@@ -308,0 +309,0 @@ return _this.generatedFiles.has(fileName) || originalHost.fileExists(fileName); |
@@ -19,3 +19,3 @@ "use strict"; | ||
*/ | ||
exports.VERSION = new core_1.Version('4.3.0-beta.1'); | ||
exports.VERSION = new core_1.Version('4.3.0-rc.0'); | ||
//# sourceMappingURL=version.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
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
566568
5223
+ Added@angular/compiler@4.3.0-rc.0(transitive)
+ Added@angular/core@4.3.0-rc.0(transitive)
+ Added@angular/tsc-wrapped@4.3.0-rc.0(transitive)
- Removed@angular/compiler@4.3.0-beta.1(transitive)
- Removed@angular/core@4.3.0-beta.1(transitive)
- Removed@angular/tsc-wrapped@4.3.0-beta.1(transitive)