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
*/
installSuccess: boolean;
/**
* version of typings installer
*/
typingsInstallerVersion: string;
}
interface NavBarResponse extends Response {
body?: NavigationBarItem[];

View file

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

View file

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

View file

@ -664,6 +664,7 @@ declare namespace ts.server.protocol {
interface TypingsInstalledTelemetryEventPayload {
installedPackages: string;
installSuccess: boolean;
typingsInstallerVersion: string;
}
interface NavBarResponse extends Response {
body?: NavigationBarItem[];
@ -2930,6 +2931,9 @@ declare namespace ts.performance {
function enable(): void;
function disable(): void;
}
declare namespace ts {
const version: string;
}
declare namespace ts {
const enum Ternary {
False = 0,
@ -8258,7 +8262,6 @@ declare namespace ts {
function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitResult;
}
declare namespace ts {
const version: string;
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
function resolveTripleslashReference(moduleName: string, containingFile: 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 = {}));
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.0.10";
})(ts || (ts = {}));
var ts;
(function (ts) {
var createObject = Object.create;
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
@ -38553,7 +38557,6 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }

6
lib/typescript.d.ts vendored
View file

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

View file

@ -1004,6 +1004,11 @@ var ts;
})(ts || (ts = {}));
/// <reference path="types.ts"/>
/// <reference path="performance.ts" />
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.10";
})(ts || (ts = {}));
/* @internal */
var ts;
(function (ts) {
@ -1694,7 +1699,7 @@ var ts;
return 1 /* GreaterThan */;
if (ignoreCase) {
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" });
return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
}
@ -44687,7 +44692,6 @@ var ts;
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }

View file

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

View file

@ -1004,6 +1004,11 @@ var ts;
})(ts || (ts = {}));
/// <reference path="types.ts"/>
/// <reference path="performance.ts" />
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.10";
})(ts || (ts = {}));
/* @internal */
var ts;
(function (ts) {
@ -1694,7 +1699,7 @@ var ts;
return 1 /* GreaterThan */;
if (ignoreCase) {
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" });
return result < 0 ? -1 /* LessThan */ : result > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
}
@ -44687,7 +44692,6 @@ var ts;
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }

View file

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