Update LKG

This commit is contained in:
Mohamed Hegazy 2016-11-15 11:53:59 -08:00
parent a8a5ea6852
commit 790a5c7735
10 changed files with 84 additions and 37 deletions

4
lib/protocol.d.ts vendored
View file

@ -1547,6 +1547,10 @@ declare namespace ts.server.protocol {
* true if install request succeeded, otherwise - false * true if install request succeeded, otherwise - false
*/ */
installSuccess: boolean; installSuccess: boolean;
/**
* version of typings installer
*/
typingsInstallerVersion: string;
} }
interface NavBarResponse extends Response { interface NavBarResponse extends Response {
body?: NavigationBarItem[]; body?: NavigationBarItem[];

View file

@ -123,6 +123,10 @@ var ts;
})(performance = ts.performance || (ts.performance = {})); })(performance = ts.performance || (ts.performance = {}));
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) {
ts.version = "2.0.10";
})(ts || (ts = {}));
var ts;
(function (ts) { (function (ts) {
var createObject = Object.create; var createObject = Object.create;
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
@ -37138,7 +37142,6 @@ var ts;
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) { (function (ts) {
ts.version = "2.0.9";
var emptyArray = []; var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) { function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; } if (configName === void 0) { configName = "tsconfig.json"; }

View file

@ -128,6 +128,10 @@ var ts;
})(performance = ts.performance || (ts.performance = {})); })(performance = ts.performance || (ts.performance = {}));
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) {
ts.version = "2.0.10";
})(ts || (ts = {}));
var ts;
(function (ts) { (function (ts) {
var createObject = Object.create; var createObject = Object.create;
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
@ -38553,7 +38557,6 @@ var ts;
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) { (function (ts) {
ts.version = "2.0.9";
var emptyArray = []; var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) { function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; } if (configName === void 0) { configName = "tsconfig.json"; }
@ -56347,7 +56350,8 @@ var ts;
telemetryEventName: "typingsInstalled", telemetryEventName: "typingsInstalled",
payload: { payload: {
installedPackages: response.packagesToInstall.join(","), installedPackages: response.packagesToInstall.join(","),
installSuccess: response.installSuccess installSuccess: response.installSuccess,
typingsInstallerVersion: response.typingsInstallerVersion
} }
}; };
var eventName = "telemetry"; var eventName = "telemetry";

View file

@ -664,6 +664,7 @@ declare namespace ts.server.protocol {
interface TypingsInstalledTelemetryEventPayload { interface TypingsInstalledTelemetryEventPayload {
installedPackages: string; installedPackages: string;
installSuccess: boolean; installSuccess: boolean;
typingsInstallerVersion: string;
} }
interface NavBarResponse extends Response { interface NavBarResponse extends Response {
body?: NavigationBarItem[]; body?: NavigationBarItem[];
@ -2930,6 +2931,9 @@ declare namespace ts.performance {
function enable(): void; function enable(): void;
function disable(): void; function disable(): void;
} }
declare namespace ts {
const version: string;
}
declare namespace ts { declare namespace ts {
const enum Ternary { const enum Ternary {
False = 0, False = 0,
@ -8258,7 +8262,6 @@ declare namespace ts {
function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitResult; function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitResult;
} }
declare namespace ts { declare namespace ts {
const version: string;
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
function resolveTripleslashReference(moduleName: string, containingFile: string): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string;
function computeCommonSourceDirectoryOfFilenames(fileNames: string[], currentDirectory: string, getCanonicalFileName: (fileName: string) => string): string; function computeCommonSourceDirectoryOfFilenames(fileNames: string[], currentDirectory: string, getCanonicalFileName: (fileName: string) => string): string;

View file

@ -128,6 +128,10 @@ var ts;
})(performance = ts.performance || (ts.performance = {})); })(performance = ts.performance || (ts.performance = {}));
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) {
ts.version = "2.0.10";
})(ts || (ts = {}));
var ts;
(function (ts) { (function (ts) {
var createObject = Object.create; var createObject = Object.create;
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
@ -38553,7 +38557,6 @@ var ts;
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) { (function (ts) {
ts.version = "2.0.9";
var emptyArray = []; var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) { function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; } if (configName === void 0) { configName = "tsconfig.json"; }

6
lib/typescript.d.ts vendored
View file

@ -1758,6 +1758,10 @@ declare namespace ts {
_children: Node[]; _children: Node[];
} }
} }
declare namespace ts {
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts { declare namespace ts {
type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
type DirectoryWatcherCallback = (fileName: string) => void; type DirectoryWatcherCallback = (fileName: string) => void;
@ -1897,8 +1901,6 @@ declare namespace ts {
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
} }
declare namespace ts { declare namespace ts {
/** The version of the TypeScript compiler release */
const version: string;
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
function resolveTripleslashReference(moduleName: string, containingFile: string): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string;
/** /**

View file

@ -1004,6 +1004,11 @@ var ts;
})(ts || (ts = {})); })(ts || (ts = {}));
/// <reference path="types.ts"/> /// <reference path="types.ts"/>
/// <reference path="performance.ts" /> /// <reference path="performance.ts" />
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.10";
})(ts || (ts = {}));
/* @internal */ /* @internal */
var ts; var ts;
(function (ts) { (function (ts) {
@ -1694,7 +1699,7 @@ var ts;
return 1 /* GreaterThan */; return 1 /* GreaterThan */;
if (ignoreCase) { if (ignoreCase) {
if (ts.collator && String.prototype.localeCompare) { if (ts.collator && String.prototype.localeCompare) {
// accent means a ≠ b, a ≠ á, a = A // accent means a ? b, a ? a´, a = A
var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
} }
@ -44687,7 +44692,6 @@ var ts;
var ts; var ts;
(function (ts) { (function (ts) {
/** The version of the TypeScript compiler release */ /** The version of the TypeScript compiler release */
ts.version = "2.0.9";
var emptyArray = []; var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) { function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; } if (configName === void 0) { configName = "tsconfig.json"; }

View file

@ -1758,6 +1758,10 @@ declare namespace ts {
_children: Node[]; _children: Node[];
} }
} }
declare namespace ts {
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts { declare namespace ts {
type FileWatcherCallback = (fileName: string, removed?: boolean) => void; type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
type DirectoryWatcherCallback = (fileName: string) => void; type DirectoryWatcherCallback = (fileName: string) => void;
@ -1897,8 +1901,6 @@ declare namespace ts {
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations;
} }
declare namespace ts { declare namespace ts {
/** The version of the TypeScript compiler release */
const version: string;
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
function resolveTripleslashReference(moduleName: string, containingFile: string): string; function resolveTripleslashReference(moduleName: string, containingFile: string): string;
/** /**

View file

@ -1004,6 +1004,11 @@ var ts;
})(ts || (ts = {})); })(ts || (ts = {}));
/// <reference path="types.ts"/> /// <reference path="types.ts"/>
/// <reference path="performance.ts" /> /// <reference path="performance.ts" />
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.10";
})(ts || (ts = {}));
/* @internal */ /* @internal */
var ts; var ts;
(function (ts) { (function (ts) {
@ -1694,7 +1699,7 @@ var ts;
return 1 /* GreaterThan */; return 1 /* GreaterThan */;
if (ignoreCase) { if (ignoreCase) {
if (ts.collator && String.prototype.localeCompare) { if (ts.collator && String.prototype.localeCompare) {
// accent means a ≠ b, a ≠ á, a = A // accent means a ? b, a ? a´, a = A
var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); var result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" });
return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
} }
@ -44687,7 +44692,6 @@ var ts;
var ts; var ts;
(function (ts) { (function (ts) {
/** The version of the TypeScript compiler release */ /** The version of the TypeScript compiler release */
ts.version = "2.0.9";
var emptyArray = []; var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) { function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; } if (configName === void 0) { configName = "tsconfig.json"; }

View file

@ -128,6 +128,10 @@ var ts;
})(performance = ts.performance || (ts.performance = {})); })(performance = ts.performance || (ts.performance = {}));
})(ts || (ts = {})); })(ts || (ts = {}));
var ts; var ts;
(function (ts) {
ts.version = "2.0.10";
})(ts || (ts = {}));
var ts;
(function (ts) { (function (ts) {
var createObject = Object.create; var createObject = Object.create;
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
@ -5725,9 +5729,17 @@ var ts;
isEnabled: function () { return false; }, isEnabled: function () { return false; },
writeLine: function () { } writeLine: function () { }
}; };
function typingToFileName(cachePath, packageName, installTypingHost) { function typingToFileName(cachePath, packageName, installTypingHost, log) {
var result = ts.resolveModuleName(packageName, ts.combinePaths(cachePath, "index.d.ts"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, installTypingHost); try {
return result.resolvedModule && result.resolvedModule.resolvedFileName; var result = ts.resolveModuleName(packageName, ts.combinePaths(cachePath, "index.d.ts"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, installTypingHost);
return result.resolvedModule && result.resolvedModule.resolvedFileName;
}
catch (e) {
if (log.isEnabled()) {
log.writeLine("Failed to resolve " + packageName + " in folder '" + cachePath + "': " + e.message);
}
return undefined;
}
} }
(function (PackageNameValidationResult) { (function (PackageNameValidationResult) {
PackageNameValidationResult[PackageNameValidationResult["Ok"] = 0] = "Ok"; PackageNameValidationResult[PackageNameValidationResult["Ok"] = 0] = "Ok";
@ -5853,8 +5865,9 @@ var ts;
if (!packageName) { if (!packageName) {
continue; continue;
} }
var typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost); var typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log);
if (!typingFile) { if (!typingFile) {
this.missingTypingsSet[packageName] = true;
continue; continue;
} }
var existingTypingFile = this.packageNameToTypingLocation[packageName]; var existingTypingFile = this.packageNameToTypingLocation[packageName];
@ -5885,7 +5898,7 @@ var ts;
var result = []; var result = [];
for (var _i = 0, typingsToInstall_1 = typingsToInstall; _i < typingsToInstall_1.length; _i++) { for (var _i = 0, typingsToInstall_1 = typingsToInstall; _i < typingsToInstall_1.length; _i++) {
var typing = typingsToInstall_1[_i]; var typing = typingsToInstall_1[_i];
if (this.missingTypingsSet[typing]) { if (this.missingTypingsSet[typing] || this.packageNameToTypingLocation[typing]) {
continue; continue;
} }
var validationResult = validatePackageName(typing); var validationResult = validatePackageName(typing);
@ -5958,7 +5971,8 @@ var ts;
_this.sendResponse({ _this.sendResponse({
kind: server.EventInstall, kind: server.EventInstall,
packagesToInstall: scopedTypings, packagesToInstall: scopedTypings,
installSuccess: ok installSuccess: ok,
typingsInstallerVersion: ts.version
}); });
} }
if (!ok) { if (!ok) {
@ -5972,17 +5986,14 @@ var ts;
return; return;
} }
if (_this.log.isEnabled()) { if (_this.log.isEnabled()) {
_this.log.writeLine("Requested to install typings " + JSON.stringify(scopedTypings) + ", installed typings " + JSON.stringify(scopedTypings)); _this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings));
} }
var installedTypingFiles = []; var installedTypingFiles = [];
for (var _a = 0, scopedTypings_1 = scopedTypings; _a < scopedTypings_1.length; _a++) { for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
var t = scopedTypings_1[_a]; var packageName = filteredTypings_2[_a];
var packageName = ts.getBaseFileName(t); var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost, _this.log);
if (!packageName) {
continue;
}
var typingFile = typingToFileName(cachePath, packageName, _this.installTypingHost);
if (!typingFile) { if (!typingFile) {
_this.missingTypingsSet[packageName] = true;
continue; continue;
} }
if (!_this.packageNameToTypingLocation[packageName]) { if (!_this.packageNameToTypingLocation[packageName]) {
@ -6121,14 +6132,13 @@ var ts;
this.log.writeLine("Process id: " + process.pid); this.log.writeLine("Process id: " + process.pid);
} }
this.npmPath = getNPMLocation(process.argv[0]); this.npmPath = getNPMLocation(process.argv[0]);
var execSync; (_a = require("child_process"), this.execSync = _a.execSync, _a);
(_a = require("child_process"), this.exec = _a.exec, execSync = _a.execSync, _a);
this.ensurePackageDirectoryExists(globalTypingsCacheLocation); this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
try { try {
if (this.log.isEnabled()) { if (this.log.isEnabled()) {
this.log.writeLine("Updating " + TypesRegistryPackageName + " npm package..."); this.log.writeLine("Updating " + TypesRegistryPackageName + " npm package...");
} }
execSync(this.npmPath + " install " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); this.execSync(this.npmPath + " install " + TypesRegistryPackageName, { cwd: globalTypingsCacheLocation, stdio: "ignore" });
} }
catch (e) { catch (e) {
if (this.log.isEnabled()) { if (this.log.isEnabled()) {
@ -6160,18 +6170,26 @@ var ts;
} }
}; };
NodeTypingsInstaller.prototype.installWorker = function (requestId, args, cwd, onRequestCompleted) { NodeTypingsInstaller.prototype.installWorker = function (requestId, args, cwd, onRequestCompleted) {
var _this = this;
if (this.log.isEnabled()) { if (this.log.isEnabled()) {
this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(args) + "'."); this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(args) + "'.");
} }
var command = this.npmPath + " install " + args.join(" ") + " --save-dev"; var command = this.npmPath + " install " + args.join(" ") + " --save-dev";
var start = Date.now(); var start = Date.now();
this.exec(command, { cwd: cwd }, function (err, stdout, stderr) { var stdout;
if (_this.log.isEnabled()) { var stderr;
_this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms" + ts.sys.newLine + "stdout: " + stdout + ts.sys.newLine + "stderr: " + stderr); var hasError = false;
} try {
onRequestCompleted(!err); stdout = this.execSync(command, { cwd: cwd });
}); }
catch (e) {
stdout = e.stdout;
stderr = e.stderr;
hasError = true;
}
if (this.log.isEnabled()) {
this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms" + ts.sys.newLine + "stdout: " + (stdout && stdout.toString()) + ts.sys.newLine + "stderr: " + (stderr && stderr.toString()));
}
onRequestCompleted(!hasError);
}; };
return NodeTypingsInstaller; return NodeTypingsInstaller;
}(typingsInstaller.TypingsInstaller)); }(typingsInstaller.TypingsInstaller));