mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
added extra check to prevent multiple installation of the same typing, added version field to telemetry event (#12258)
* added extra check to prevent multiple installation of the same typing, added version field to telemetry event * use ts.version
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
|
||||
export const version = "2.0.9";
|
||||
|
||||
/**
|
||||
* Ternary values are defined such that
|
||||
* x & y is False if either x or y is False.
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
|
||||
export const version = "2.0.9";
|
||||
|
||||
const emptyArray: any[] = [];
|
||||
|
||||
export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string {
|
||||
|
||||
@@ -1968,6 +1968,11 @@ namespace ts.server.protocol {
|
||||
* true if install request succeeded, otherwise - false
|
||||
*/
|
||||
installSuccess: boolean;
|
||||
|
||||
/**
|
||||
* version of typings installer
|
||||
*/
|
||||
typingsInstallerVersion: string;
|
||||
}
|
||||
|
||||
export interface NavBarResponse extends Response {
|
||||
|
||||
@@ -266,7 +266,8 @@ namespace ts.server {
|
||||
telemetryEventName: "typingsInstalled",
|
||||
payload: {
|
||||
installedPackages: response.packagesToInstall.join(","),
|
||||
installSuccess: response.installSuccess
|
||||
installSuccess: response.installSuccess,
|
||||
typingsInstallerVersion: response.typingsInstallerVersion
|
||||
}
|
||||
};
|
||||
const eventName: protocol.TelemetryEventName = "telemetry";
|
||||
|
||||
Vendored
+1
@@ -63,6 +63,7 @@ declare namespace ts.server {
|
||||
readonly packagesToInstall: ReadonlyArray<string>;
|
||||
readonly kind: EventInstall;
|
||||
readonly installSuccess: boolean;
|
||||
readonly typingsInstallerVersion: string;
|
||||
}
|
||||
|
||||
export interface InstallTypingHost extends JsTyping.TypingResolutionHost {
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
const result: string[] = [];
|
||||
for (const typing of typingsToInstall) {
|
||||
if (this.missingTypingsSet[typing]) {
|
||||
if (this.missingTypingsSet[typing] || this.packageNameToTypingLocation[typing]) {
|
||||
continue;
|
||||
}
|
||||
const validationResult = validatePackageName(typing);
|
||||
@@ -308,7 +308,8 @@ namespace ts.server.typingsInstaller {
|
||||
this.sendResponse(<TypingsInstallEvent>{
|
||||
kind: EventInstall,
|
||||
packagesToInstall: scopedTypings,
|
||||
installSuccess: ok
|
||||
installSuccess: ok,
|
||||
typingsInstallerVersion: ts.version // qualified explicitly to prevent occasional shadowing
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user