Skip to content

Commit

Permalink
Update LKG.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Apr 23, 2019
1 parent 5cfd28b commit 7eda7ef
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/tsc.js
Expand Up @@ -60,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.4";
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
ts.emptyArray = [];
Expand Down
16 changes: 13 additions & 3 deletions lib/tsserver.js
Expand Up @@ -85,7 +85,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.4";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -123104,6 +123104,11 @@ var ts;
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
Arguments.NpmLocation = "--npmLocation";
/**
* Flag indicating that the typings installer should try to validate the default npm location.
* If the default npm is not found when this flag is enabled, fallback to `npm install`
*/
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
})(Arguments = server.Arguments || (server.Arguments = {}));
function hasArgument(argumentName) {
return ts.sys.args.indexOf(argumentName) >= 0;
Expand Down Expand Up @@ -131462,14 +131467,15 @@ var ts;
return Logger;
}());
var NodeTypingsInstaller = /** @class */ (function () {
function NodeTypingsInstaller(telemetryEnabled, logger, host, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, event) {
function NodeTypingsInstaller(telemetryEnabled, logger, host, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event) {
this.telemetryEnabled = telemetryEnabled;
this.logger = logger;
this.host = host;
this.globalTypingsCacheLocation = globalTypingsCacheLocation;
this.typingSafeListLocation = typingSafeListLocation;
this.typesMapLocation = typesMapLocation;
this.npmLocation = npmLocation;
this.validateDefaultNpmLocation = validateDefaultNpmLocation;
this.event = event;
this.activeRequestCount = 0;
this.requestQueue = [];
Expand Down Expand Up @@ -131526,6 +131532,9 @@ var ts;
if (this.npmLocation) {
args.push(server.Arguments.NpmLocation, this.npmLocation);
}
if (this.validateDefaultNpmLocation) {
args.push(server.Arguments.ValidateDefaultNpmLocation);
}
var execArgv = [];
for (var _i = 0, _a = process.execArgv; _i < _a.length; _i++) {
var arg = _a[_i];
Expand Down Expand Up @@ -131710,7 +131719,7 @@ var ts;
var host = sys;
var typingsInstaller = disableAutomaticTypingAcquisition
? undefined
: new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, event);
: new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event);
_this = _super.call(this, {
host: host,
cancellationToken: cancellationToken,
Expand Down Expand Up @@ -132105,6 +132114,7 @@ var ts;
var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); // TODO: GH#18217
var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation) || ts.combinePaths(ts.getDirectoryPath(sys.getExecutingFilePath()), "typesMap.json");
var npmLocation = server.findArgument(server.Arguments.NpmLocation);
var validateDefaultNpmLocation = server.hasArgument(server.Arguments.ValidateDefaultNpmLocation);
function parseStringArray(argName) {
var arg = server.findArgument(argName);
if (arg === undefined) {
Expand Down
7 changes: 6 additions & 1 deletion lib/tsserverlibrary.js
Expand Up @@ -84,7 +84,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.4";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -94853,6 +94853,11 @@ var ts;
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
Arguments.NpmLocation = "--npmLocation";
/**
* Flag indicating that the typings installer should try to validate the default npm location.
* If the default npm is not found when this flag is enabled, fallback to `npm install`
*/
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
})(Arguments = server.Arguments || (server.Arguments = {}));
function hasArgument(argumentName) {
return ts.sys.args.indexOf(argumentName) >= 0;
Expand Down
7 changes: 6 additions & 1 deletion lib/typescript.js
Expand Up @@ -75,7 +75,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.4";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -94844,6 +94844,11 @@ var ts;
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
Arguments.NpmLocation = "--npmLocation";
/**
* Flag indicating that the typings installer should try to validate the default npm location.
* If the default npm is not found when this flag is enabled, fallback to `npm install`
*/
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
})(Arguments = server.Arguments || (server.Arguments = {}));
function hasArgument(argumentName) {
return ts.sys.args.indexOf(argumentName) >= 0;
Expand Down
7 changes: 6 additions & 1 deletion lib/typescriptServices.js
Expand Up @@ -75,7 +75,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.4";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -94844,6 +94844,11 @@ var ts;
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
Arguments.NpmLocation = "--npmLocation";
/**
* Flag indicating that the typings installer should try to validate the default npm location.
* If the default npm is not found when this flag is enabled, fallback to `npm install`
*/
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
})(Arguments = server.Arguments || (server.Arguments = {}));
function hasArgument(argumentName) {
return ts.sys.args.indexOf(argumentName) >= 0;
Expand Down
29 changes: 20 additions & 9 deletions lib/typingsInstaller.js
Expand Up @@ -76,7 +76,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.4";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".4";
ts.version = ts.versionMajorMinor + ".5";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -94845,6 +94845,11 @@ var ts;
* typingsInstaller will run the command with `${npmLocation} install ...`.
*/
Arguments.NpmLocation = "--npmLocation";
/**
* Flag indicating that the typings installer should try to validate the default npm location.
* If the default npm is not found when this flag is enabled, fallback to `npm install`
*/
Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
})(Arguments = server.Arguments || (server.Arguments = {}));
function hasArgument(argumentName) {
return ts.sys.args.indexOf(argumentName) >= 0;
Expand Down Expand Up @@ -95663,13 +95668,17 @@ var ts;
}
return FileLog;
}());
function getDefaultNPMLocation(processName) {
function getDefaultNPMLocation(processName, validateDefaultNpmLocation, host) {
if (path.basename(processName).indexOf("node") === 0) {
return "\"" + path.join(path.dirname(process.argv[0]), "npm") + "\"";
}
else {
return "npm";
var npmPath = path.join(path.dirname(process.argv[0]), "npm");
if (!validateDefaultNpmLocation) {
return npmPath;
}
if (host.fileExists(npmPath)) {
return "\"" + npmPath + "\"";
}
}
return "npm";
}
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
if (!host.fileExists(typesRegistryFilePath)) {
Expand All @@ -95695,15 +95704,16 @@ var ts;
}
var NodeTypingsInstaller = (function (_super) {
__extends(NodeTypingsInstaller, _super);
function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, throttleLimit, log) {
function NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, throttleLimit, log) {
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;
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]);
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
_this.npmPath = "\"" + _this.npmPath + "\"";
}
if (_this.log.isEnabled()) {
_this.log.writeLine("Process id: " + process.pid);
_this.log.writeLine("NPM location: " + _this.npmPath + " (explicit '" + server.Arguments.NpmLocation + "' " + (npmLocation === undefined ? "not " : "") + " provided)");
_this.log.writeLine("validateDefaultNpmLocation: " + validateDefaultNpmLocation);
}
(_this.nodeExecSync = require("child_process").execSync);
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
Expand Down Expand Up @@ -95830,6 +95840,7 @@ var ts;
var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation);
var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation);
var npmLocation = server.findArgument(server.Arguments.NpmLocation);
var validateDefaultNpmLocation = server.hasArgument(server.Arguments.ValidateDefaultNpmLocation);
var log = new FileLog(logFilePath);
if (log.isEnabled()) {
process.on("uncaughtException", function (e) {
Expand All @@ -95842,7 +95853,7 @@ var ts;
}
process.exit(0);
});
var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, 5, log);
var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, 5, log);
installer.listen();
function indent(newline, str) {
return newline + " " + str.replace(/\r?\n/, newline + " ");
Expand Down

0 comments on commit 7eda7ef

Please sign in to comment.