Skip to content

Commit 7eda7ef

Browse files
Update LKG.
1 parent 5cfd28b commit 7eda7ef

File tree

6 files changed

+52
-16
lines changed

6 files changed

+52
-16
lines changed

lib/tsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6060
var ts;
6161
(function (ts) {
6262
ts.versionMajorMinor = "3.4";
63-
ts.version = ts.versionMajorMinor + ".4";
63+
ts.version = ts.versionMajorMinor + ".5";
6464
})(ts || (ts = {}));
6565
(function (ts) {
6666
ts.emptyArray = [];

lib/tsserver.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var ts;
8585
// If changing the text in this section, be sure to test `configureNightly` too.
8686
ts.versionMajorMinor = "3.4";
8787
/** The version of the TypeScript compiler release */
88-
ts.version = ts.versionMajorMinor + ".4";
88+
ts.version = ts.versionMajorMinor + ".5";
8989
})(ts || (ts = {}));
9090
(function (ts) {
9191
/* @internal */
@@ -123104,6 +123104,11 @@ var ts;
123104123104
* typingsInstaller will run the command with `${npmLocation} install ...`.
123105123105
*/
123106123106
Arguments.NpmLocation = "--npmLocation";
123107+
/**
123108+
* Flag indicating that the typings installer should try to validate the default npm location.
123109+
* If the default npm is not found when this flag is enabled, fallback to `npm install`
123110+
*/
123111+
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
123107123112
})(Arguments = server.Arguments || (server.Arguments = {}));
123108123113
function hasArgument(argumentName) {
123109123114
return ts.sys.args.indexOf(argumentName) >= 0;
@@ -131462,14 +131467,15 @@ var ts;
131462131467
return Logger;
131463131468
}());
131464131469
var NodeTypingsInstaller = /** @class */ (function () {
131465-
function NodeTypingsInstaller(telemetryEnabled, logger, host, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, event) {
131470+
function NodeTypingsInstaller(telemetryEnabled, logger, host, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event) {
131466131471
this.telemetryEnabled = telemetryEnabled;
131467131472
this.logger = logger;
131468131473
this.host = host;
131469131474
this.globalTypingsCacheLocation = globalTypingsCacheLocation;
131470131475
this.typingSafeListLocation = typingSafeListLocation;
131471131476
this.typesMapLocation = typesMapLocation;
131472131477
this.npmLocation = npmLocation;
131478+
this.validateDefaultNpmLocation = validateDefaultNpmLocation;
131473131479
this.event = event;
131474131480
this.activeRequestCount = 0;
131475131481
this.requestQueue = [];
@@ -131526,6 +131532,9 @@ var ts;
131526131532
if (this.npmLocation) {
131527131533
args.push(server.Arguments.NpmLocation, this.npmLocation);
131528131534
}
131535+
if (this.validateDefaultNpmLocation) {
131536+
args.push(server.Arguments.ValidateDefaultNpmLocation);
131537+
}
131529131538
var execArgv = [];
131530131539
for (var _i = 0, _a = process.execArgv; _i < _a.length; _i++) {
131531131540
var arg = _a[_i];
@@ -131710,7 +131719,7 @@ var ts;
131710131719
var host = sys;
131711131720
var typingsInstaller = disableAutomaticTypingAcquisition
131712131721
? undefined
131713-
: new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, event);
131722+
: new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event);
131714131723
_this = _super.call(this, {
131715131724
host: host,
131716131725
cancellationToken: cancellationToken,
@@ -132105,6 +132114,7 @@ var ts;
132105132114
var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); // TODO: GH#18217
132106132115
var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation) || ts.combinePaths(ts.getDirectoryPath(sys.getExecutingFilePath()), "typesMap.json");
132107132116
var npmLocation = server.findArgument(server.Arguments.NpmLocation);
132117+
var validateDefaultNpmLocation = server.hasArgument(server.Arguments.ValidateDefaultNpmLocation);
132108132118
function parseStringArray(argName) {
132109132119
var arg = server.findArgument(argName);
132110132120
if (arg === undefined) {

lib/tsserverlibrary.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var ts;
8484
// If changing the text in this section, be sure to test `configureNightly` too.
8585
ts.versionMajorMinor = "3.4";
8686
/** The version of the TypeScript compiler release */
87-
ts.version = ts.versionMajorMinor + ".4";
87+
ts.version = ts.versionMajorMinor + ".5";
8888
})(ts || (ts = {}));
8989
(function (ts) {
9090
/* @internal */
@@ -94853,6 +94853,11 @@ var ts;
9485394853
* typingsInstaller will run the command with `${npmLocation} install ...`.
9485494854
*/
9485594855
Arguments.NpmLocation = "--npmLocation";
94856+
/**
94857+
* Flag indicating that the typings installer should try to validate the default npm location.
94858+
* If the default npm is not found when this flag is enabled, fallback to `npm install`
94859+
*/
94860+
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
9485694861
})(Arguments = server.Arguments || (server.Arguments = {}));
9485794862
function hasArgument(argumentName) {
9485894863
return ts.sys.args.indexOf(argumentName) >= 0;

lib/typescript.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var ts;
7575
// If changing the text in this section, be sure to test `configureNightly` too.
7676
ts.versionMajorMinor = "3.4";
7777
/** The version of the TypeScript compiler release */
78-
ts.version = ts.versionMajorMinor + ".4";
78+
ts.version = ts.versionMajorMinor + ".5";
7979
})(ts || (ts = {}));
8080
(function (ts) {
8181
/* @internal */
@@ -94844,6 +94844,11 @@ var ts;
9484494844
* typingsInstaller will run the command with `${npmLocation} install ...`.
9484594845
*/
9484694846
Arguments.NpmLocation = "--npmLocation";
94847+
/**
94848+
* Flag indicating that the typings installer should try to validate the default npm location.
94849+
* If the default npm is not found when this flag is enabled, fallback to `npm install`
94850+
*/
94851+
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
9484794852
})(Arguments = server.Arguments || (server.Arguments = {}));
9484894853
function hasArgument(argumentName) {
9484994854
return ts.sys.args.indexOf(argumentName) >= 0;

lib/typescriptServices.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var ts;
7575
// If changing the text in this section, be sure to test `configureNightly` too.
7676
ts.versionMajorMinor = "3.4";
7777
/** The version of the TypeScript compiler release */
78-
ts.version = ts.versionMajorMinor + ".4";
78+
ts.version = ts.versionMajorMinor + ".5";
7979
})(ts || (ts = {}));
8080
(function (ts) {
8181
/* @internal */
@@ -94844,6 +94844,11 @@ var ts;
9484494844
* typingsInstaller will run the command with `${npmLocation} install ...`.
9484594845
*/
9484694846
Arguments.NpmLocation = "--npmLocation";
94847+
/**
94848+
* Flag indicating that the typings installer should try to validate the default npm location.
94849+
* If the default npm is not found when this flag is enabled, fallback to `npm install`
94850+
*/
94851+
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
9484794852
})(Arguments = server.Arguments || (server.Arguments = {}));
9484894853
function hasArgument(argumentName) {
9484994854
return ts.sys.args.indexOf(argumentName) >= 0;

lib/typingsInstaller.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var ts;
7676
// If changing the text in this section, be sure to test `configureNightly` too.
7777
ts.versionMajorMinor = "3.4";
7878
/** The version of the TypeScript compiler release */
79-
ts.version = ts.versionMajorMinor + ".4";
79+
ts.version = ts.versionMajorMinor + ".5";
8080
})(ts || (ts = {}));
8181
(function (ts) {
8282
/* @internal */
@@ -94845,6 +94845,11 @@ var ts;
9484594845
* typingsInstaller will run the command with `${npmLocation} install ...`.
9484694846
*/
9484794847
Arguments.NpmLocation = "--npmLocation";
94848+
/**
94849+
* Flag indicating that the typings installer should try to validate the default npm location.
94850+
* If the default npm is not found when this flag is enabled, fallback to `npm install`
94851+
*/
94852+
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
9484894853
})(Arguments = server.Arguments || (server.Arguments = {}));
9484994854
function hasArgument(argumentName) {
9485094855
return ts.sys.args.indexOf(argumentName) >= 0;
@@ -95663,13 +95668,17 @@ var ts;
9566395668
}
9566495669
return FileLog;
9566595670
}());
95666-
function getDefaultNPMLocation(processName) {
95671+
function getDefaultNPMLocation(processName, validateDefaultNpmLocation, host) {
9566795672
if (path.basename(processName).indexOf("node") === 0) {
95668-
return "\"" + path.join(path.dirname(process.argv[0]), "npm") + "\"";
95669-
}
95670-
else {
95671-
return "npm";
95673+
var npmPath = path.join(path.dirname(process.argv[0]), "npm");
95674+
if (!validateDefaultNpmLocation) {
95675+
return npmPath;
95676+
}
95677+
if (host.fileExists(npmPath)) {
95678+
return "\"" + npmPath + "\"";
95679+
}
9567295680
}
95681+
return "npm";
9567395682
}
9567495683
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
9567595684
if (!host.fileExists(typesRegistryFilePath)) {
@@ -95695,15 +95704,16 @@ var ts;
9569595704
}
9569695705
var NodeTypingsInstaller = (function (_super) {
9569795706
__extends(NodeTypingsInstaller, _super);
95698-
function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, throttleLimit, log) {
95707+
function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, throttleLimit, log) {
9569995708
var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), typesMapLocation ? ts.toPath(typesMapLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typesMap.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this;
95700-
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]);
95709+
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
9570195710
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
9570295711
_this.npmPath = "\"" + _this.npmPath + "\"";
9570395712
}
9570495713
if (_this.log.isEnabled()) {
9570595714
_this.log.writeLine("Process id: " + process.pid);
9570695715
_this.log.writeLine("NPM location: " + _this.npmPath + " (explicit '" + server.Arguments.NpmLocation + "' " + (npmLocation === undefined ? "not " : "") + " provided)");
95716+
_this.log.writeLine("validateDefaultNpmLocation: " + validateDefaultNpmLocation);
9570795717
}
9570895718
(_this.nodeExecSync = require("child_process").execSync);
9570995719
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
@@ -95830,6 +95840,7 @@ var ts;
9583095840
var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation);
9583195841
var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation);
9583295842
var npmLocation = server.findArgument(server.Arguments.NpmLocation);
95843+
var validateDefaultNpmLocation = server.hasArgument(server.Arguments.ValidateDefaultNpmLocation);
9583395844
var log = new FileLog(logFilePath);
9583495845
if (log.isEnabled()) {
9583595846
process.on("uncaughtException", function (e) {
@@ -95842,7 +95853,7 @@ var ts;
9584295853
}
9584395854
process.exit(0);
9584495855
});
95845-
var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, 5, log);
95856+
var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, 5, log);
9584695857
installer.listen();
9584795858
function indent(newline, str) {
9584895859
return newline + " " + str.replace(/\r?\n/, newline + " ");

0 commit comments

Comments
 (0)