@typescript-deploys/pr-build 5.5.0-pr-55326-12 → 5.5.0-pr-57665-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +35 -42
- package/lib/tsserver.js +66 -108
- package/lib/typescript.js +35 -42
- package/lib/typingsInstaller.js +17 -47
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -33492,7 +33492,7 @@ function processPragmasIntoFields(context, reportDiagnostic) {
|
|
|
33492
33492
|
const libReferenceDirectives = context.libReferenceDirectives;
|
|
33493
33493
|
forEach(toArray(entryOrList), (arg) => {
|
|
33494
33494
|
const { types, lib, path, ["resolution-mode"]: res } = arg.arguments;
|
|
33495
|
-
if (arg.arguments["no-default-lib"]) {
|
|
33495
|
+
if (arg.arguments["no-default-lib"] === "true") {
|
|
33496
33496
|
context.hasNoDefaultLib = true;
|
|
33497
33497
|
} else if (types) {
|
|
33498
33498
|
const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
|
@@ -43797,13 +43797,6 @@ function createTypeChecker(host) {
|
|
|
43797
43797
|
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable");
|
|
43798
43798
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
43799
43799
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
43800
|
-
var nonNullUnknownType = createIntrinsicType(
|
|
43801
|
-
2 /* Unknown */,
|
|
43802
|
-
"unknown",
|
|
43803
|
-
/*objectFlags*/
|
|
43804
|
-
void 0,
|
|
43805
|
-
"non-null"
|
|
43806
|
-
);
|
|
43807
43800
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
43808
43801
|
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening");
|
|
43809
43802
|
var missingType = createIntrinsicType(
|
|
@@ -57340,7 +57333,7 @@ function createTypeChecker(host) {
|
|
|
57340
57333
|
const includes = addTypesToUnion(typeSet, 0, types);
|
|
57341
57334
|
if (unionReduction !== 0 /* None */) {
|
|
57342
57335
|
if (includes & 3 /* AnyOrUnknown */) {
|
|
57343
|
-
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType :
|
|
57336
|
+
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
|
|
57344
57337
|
}
|
|
57345
57338
|
if (includes & 32768 /* Undefined */) {
|
|
57346
57339
|
if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
|
|
@@ -65319,7 +65312,7 @@ function createTypeChecker(host) {
|
|
|
65319
65312
|
function hasMatchingArgument(expression, reference) {
|
|
65320
65313
|
if (expression.arguments) {
|
|
65321
65314
|
for (const argument of expression.arguments) {
|
|
65322
|
-
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)
|
|
65315
|
+
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
|
|
65323
65316
|
return true;
|
|
65324
65317
|
}
|
|
65325
65318
|
}
|
|
@@ -65329,36 +65322,6 @@ function createTypeChecker(host) {
|
|
|
65329
65322
|
}
|
|
65330
65323
|
return false;
|
|
65331
65324
|
}
|
|
65332
|
-
function getCandidateDiscriminantPropertyAccess(expr, reference) {
|
|
65333
|
-
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
65334
|
-
if (isIdentifier(expr)) {
|
|
65335
|
-
const symbol = getResolvedSymbol(expr);
|
|
65336
|
-
const declaration = symbol.valueDeclaration;
|
|
65337
|
-
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
65338
|
-
return declaration;
|
|
65339
|
-
}
|
|
65340
|
-
}
|
|
65341
|
-
} else if (isAccessExpression(expr)) {
|
|
65342
|
-
if (isMatchingReference(reference, expr.expression)) {
|
|
65343
|
-
return expr;
|
|
65344
|
-
}
|
|
65345
|
-
} else if (isIdentifier(expr)) {
|
|
65346
|
-
const symbol = getResolvedSymbol(expr);
|
|
65347
|
-
if (isConstantVariable(symbol)) {
|
|
65348
|
-
const declaration = symbol.valueDeclaration;
|
|
65349
|
-
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
|
65350
|
-
return declaration.initializer;
|
|
65351
|
-
}
|
|
65352
|
-
if (isBindingElement(declaration) && !declaration.initializer) {
|
|
65353
|
-
const parent = declaration.parent.parent;
|
|
65354
|
-
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
|
|
65355
|
-
return declaration;
|
|
65356
|
-
}
|
|
65357
|
-
}
|
|
65358
|
-
}
|
|
65359
|
-
}
|
|
65360
|
-
return void 0;
|
|
65361
|
-
}
|
|
65362
65325
|
function getFlowNodeId(flow) {
|
|
65363
65326
|
if (!flow.id || flow.id < 0) {
|
|
65364
65327
|
flow.id = nextFlowId;
|
|
@@ -66112,7 +66075,7 @@ function createTypeChecker(host) {
|
|
|
66112
66075
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
66113
66076
|
return declaredType;
|
|
66114
66077
|
}
|
|
66115
|
-
return resultType
|
|
66078
|
+
return resultType;
|
|
66116
66079
|
function getOrSetCacheKey() {
|
|
66117
66080
|
if (isKeySet) {
|
|
66118
66081
|
return key;
|
|
@@ -66466,9 +66429,39 @@ function createTypeChecker(host) {
|
|
|
66466
66429
|
}
|
|
66467
66430
|
return result;
|
|
66468
66431
|
}
|
|
66432
|
+
function getCandidateDiscriminantPropertyAccess(expr) {
|
|
66433
|
+
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
66434
|
+
if (isIdentifier(expr)) {
|
|
66435
|
+
const symbol = getResolvedSymbol(expr);
|
|
66436
|
+
const declaration = symbol.valueDeclaration;
|
|
66437
|
+
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
66438
|
+
return declaration;
|
|
66439
|
+
}
|
|
66440
|
+
}
|
|
66441
|
+
} else if (isAccessExpression(expr)) {
|
|
66442
|
+
if (isMatchingReference(reference, expr.expression)) {
|
|
66443
|
+
return expr;
|
|
66444
|
+
}
|
|
66445
|
+
} else if (isIdentifier(expr)) {
|
|
66446
|
+
const symbol = getResolvedSymbol(expr);
|
|
66447
|
+
if (isConstantVariable(symbol)) {
|
|
66448
|
+
const declaration = symbol.valueDeclaration;
|
|
66449
|
+
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
|
66450
|
+
return declaration.initializer;
|
|
66451
|
+
}
|
|
66452
|
+
if (isBindingElement(declaration) && !declaration.initializer) {
|
|
66453
|
+
const parent = declaration.parent.parent;
|
|
66454
|
+
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
|
|
66455
|
+
return declaration;
|
|
66456
|
+
}
|
|
66457
|
+
}
|
|
66458
|
+
}
|
|
66459
|
+
}
|
|
66460
|
+
return void 0;
|
|
66461
|
+
}
|
|
66469
66462
|
function getDiscriminantPropertyAccess(expr, computedType) {
|
|
66470
66463
|
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
|
|
66471
|
-
const access = getCandidateDiscriminantPropertyAccess(expr
|
|
66464
|
+
const access = getCandidateDiscriminantPropertyAccess(expr);
|
|
66472
66465
|
if (access) {
|
|
66473
66466
|
const name = getAccessedPropertyName(access);
|
|
66474
66467
|
if (name) {
|
package/lib/tsserver.js
CHANGED
|
@@ -15,18 +15,10 @@ and limitations under the License.
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
"use strict";
|
|
18
|
-
var __create = Object.create;
|
|
19
18
|
var __defProp = Object.defineProperty;
|
|
20
19
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
20
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
23
21
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
-
var __esm = (fn, res) => function __init() {
|
|
25
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
26
|
-
};
|
|
27
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
28
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
29
|
-
};
|
|
30
22
|
var __copyProps = (to, from, except, desc) => {
|
|
31
23
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
32
24
|
for (let key of __getOwnPropNames(from))
|
|
@@ -36,57 +28,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
36
28
|
return to;
|
|
37
29
|
};
|
|
38
30
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
43
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
44
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
45
|
-
mod
|
|
46
|
-
));
|
|
47
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/tsserver/_namespaces/ts.ts
|
|
33
|
+
var ts_exports = {};
|
|
48
34
|
|
|
49
35
|
// src/typescript/typescript.ts
|
|
50
36
|
var typescript_exports = {};
|
|
51
|
-
|
|
52
|
-
"src/typescript/typescript.ts"() {
|
|
53
|
-
"use strict";
|
|
54
|
-
__reExport(typescript_exports, require("./typescript.js"));
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// src/tsserver/_namespaces/ts.server.ts
|
|
59
|
-
var require_ts_server = __commonJS({
|
|
60
|
-
"src/tsserver/_namespaces/ts.server.ts"(exports2, module2) {
|
|
61
|
-
"use strict";
|
|
62
|
-
init_typescript();
|
|
63
|
-
module2.exports = typescript_exports.server;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// src/tsserver/server.ts
|
|
68
|
-
var server_exports = {};
|
|
69
|
-
module.exports = __toCommonJS(server_exports);
|
|
37
|
+
__reExport(typescript_exports, require("./typescript.js"));
|
|
70
38
|
|
|
71
39
|
// src/tsserver/_namespaces/ts.ts
|
|
72
|
-
var ts_exports = {};
|
|
73
|
-
init_typescript();
|
|
74
40
|
__reExport(ts_exports, typescript_exports);
|
|
75
41
|
|
|
76
|
-
// src/tsserver/server.ts
|
|
77
|
-
var import_ts5 = __toESM(require_ts_server());
|
|
78
|
-
|
|
79
|
-
// src/tsserver/nodeServer.ts
|
|
80
|
-
var import_ts3 = __toESM(require_ts_server());
|
|
81
|
-
|
|
82
42
|
// src/tsserver/common.ts
|
|
83
|
-
var import_ts = __toESM(require_ts_server());
|
|
84
43
|
function getLogLevel(level) {
|
|
85
44
|
if (level) {
|
|
86
45
|
const l = level.toLowerCase();
|
|
87
|
-
for (const name in
|
|
46
|
+
for (const name in ts_exports.server.LogLevel) {
|
|
88
47
|
if (isNaN(+name) && l === name.toLowerCase()) {
|
|
89
|
-
return
|
|
48
|
+
return ts_exports.server.LogLevel[name];
|
|
90
49
|
}
|
|
91
50
|
}
|
|
92
51
|
}
|
|
@@ -112,7 +71,7 @@ function parseLoggingEnvironmentString(logEnvStr) {
|
|
|
112
71
|
break;
|
|
113
72
|
case "-level":
|
|
114
73
|
const level = getLogLevel(value);
|
|
115
|
-
logEnv.detailLevel = level !== void 0 ? level :
|
|
74
|
+
logEnv.detailLevel = level !== void 0 ? level : ts_exports.server.LogLevel.normal;
|
|
116
75
|
break;
|
|
117
76
|
case "-traceToConsole":
|
|
118
77
|
logEnv.traceToConsole = value.toLowerCase() === "true";
|
|
@@ -140,7 +99,7 @@ function parseLoggingEnvironmentString(logEnvStr) {
|
|
|
140
99
|
}
|
|
141
100
|
}
|
|
142
101
|
function parseServerMode() {
|
|
143
|
-
const mode =
|
|
102
|
+
const mode = ts_exports.server.findArgument("--serverMode");
|
|
144
103
|
if (!mode)
|
|
145
104
|
return void 0;
|
|
146
105
|
switch (mode.toLowerCase()) {
|
|
@@ -158,7 +117,7 @@ function initializeNodeSystem() {
|
|
|
158
117
|
const sys4 = ts_exports.Debug.checkDefined(ts_exports.sys);
|
|
159
118
|
const childProcess = require("child_process");
|
|
160
119
|
const fs = require("fs");
|
|
161
|
-
class
|
|
120
|
+
class Logger {
|
|
162
121
|
constructor(logFilename, traceToConsole, level) {
|
|
163
122
|
this.logFilename = logFilename;
|
|
164
123
|
this.traceToConsole = traceToConsole;
|
|
@@ -186,13 +145,13 @@ function initializeNodeSystem() {
|
|
|
186
145
|
return this.logFilename;
|
|
187
146
|
}
|
|
188
147
|
perftrc(s) {
|
|
189
|
-
this.msg(s,
|
|
148
|
+
this.msg(s, ts_exports.server.Msg.Perf);
|
|
190
149
|
}
|
|
191
150
|
info(s) {
|
|
192
|
-
this.msg(s,
|
|
151
|
+
this.msg(s, ts_exports.server.Msg.Info);
|
|
193
152
|
}
|
|
194
153
|
err(s) {
|
|
195
|
-
this.msg(s,
|
|
154
|
+
this.msg(s, ts_exports.server.Msg.Err);
|
|
196
155
|
}
|
|
197
156
|
startGroup() {
|
|
198
157
|
this.inGroup = true;
|
|
@@ -207,13 +166,13 @@ function initializeNodeSystem() {
|
|
|
207
166
|
hasLevel(level) {
|
|
208
167
|
return this.loggingEnabled() && this.level >= level;
|
|
209
168
|
}
|
|
210
|
-
msg(s, type =
|
|
169
|
+
msg(s, type = ts_exports.server.Msg.Err) {
|
|
211
170
|
var _a, _b, _c;
|
|
212
171
|
switch (type) {
|
|
213
|
-
case
|
|
172
|
+
case ts_exports.server.Msg.Info:
|
|
214
173
|
(_a = ts_exports.perfLogger) == null ? void 0 : _a.logInfoEvent(s);
|
|
215
174
|
break;
|
|
216
|
-
case
|
|
175
|
+
case ts_exports.server.Msg.Perf:
|
|
217
176
|
(_b = ts_exports.perfLogger) == null ? void 0 : _b.logPerfEvent(s);
|
|
218
177
|
break;
|
|
219
178
|
default:
|
|
@@ -222,10 +181,10 @@ function initializeNodeSystem() {
|
|
|
222
181
|
}
|
|
223
182
|
if (!this.canWrite())
|
|
224
183
|
return;
|
|
225
|
-
s = `[${
|
|
184
|
+
s = `[${ts_exports.server.nowString()}] ${s}
|
|
226
185
|
`;
|
|
227
186
|
if (!this.inGroup || this.firstInGroup) {
|
|
228
|
-
const prefix =
|
|
187
|
+
const prefix = Logger.padStringRight(type + " " + this.seq.toString(), " ");
|
|
229
188
|
s = prefix + s;
|
|
230
189
|
}
|
|
231
190
|
this.write(s, type);
|
|
@@ -262,10 +221,10 @@ function initializeNodeSystem() {
|
|
|
262
221
|
switch (level) {
|
|
263
222
|
case ts_exports.LogLevel.Error:
|
|
264
223
|
case ts_exports.LogLevel.Warning:
|
|
265
|
-
return logger.msg(s,
|
|
224
|
+
return logger.msg(s, ts_exports.server.Msg.Err);
|
|
266
225
|
case ts_exports.LogLevel.Info:
|
|
267
226
|
case ts_exports.LogLevel.Verbose:
|
|
268
|
-
return logger.msg(s,
|
|
227
|
+
return logger.msg(s, ts_exports.server.Msg.Info);
|
|
269
228
|
}
|
|
270
229
|
}
|
|
271
230
|
};
|
|
@@ -282,29 +241,29 @@ function initializeNodeSystem() {
|
|
|
282
241
|
const cacheKey = extractWatchDirectoryCacheKey(path, currentDrive);
|
|
283
242
|
let status = cacheKey && statusCache.get(cacheKey);
|
|
284
243
|
if (status === void 0) {
|
|
285
|
-
if (logger.hasLevel(
|
|
244
|
+
if (logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
286
245
|
logger.info(`${cacheKey} for path ${path} not found in cache...`);
|
|
287
246
|
}
|
|
288
247
|
try {
|
|
289
248
|
const args = [(0, ts_exports.combinePaths)(libDirectory, "watchGuard.js"), path];
|
|
290
|
-
if (logger.hasLevel(
|
|
291
|
-
logger.info(`Starting ${process.execPath} with args:${
|
|
249
|
+
if (logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
250
|
+
logger.info(`Starting ${process.execPath} with args:${ts_exports.server.stringifyIndented(args)}`);
|
|
292
251
|
}
|
|
293
252
|
childProcess.execFileSync(process.execPath, args, { stdio: "ignore", env: { ELECTRON_RUN_AS_NODE: "1" } });
|
|
294
253
|
status = true;
|
|
295
|
-
if (logger.hasLevel(
|
|
254
|
+
if (logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
296
255
|
logger.info(`WatchGuard for path ${path} returned: OK`);
|
|
297
256
|
}
|
|
298
257
|
} catch (e) {
|
|
299
258
|
status = false;
|
|
300
|
-
if (logger.hasLevel(
|
|
259
|
+
if (logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
301
260
|
logger.info(`WatchGuard for path ${path} returned: ${e.message}`);
|
|
302
261
|
}
|
|
303
262
|
}
|
|
304
263
|
if (cacheKey) {
|
|
305
264
|
statusCache.set(cacheKey, status);
|
|
306
265
|
}
|
|
307
|
-
} else if (logger.hasLevel(
|
|
266
|
+
} else if (logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
308
267
|
logger.info(`watchDirectory for ${path} uses cached drive information.`);
|
|
309
268
|
}
|
|
310
269
|
if (status) {
|
|
@@ -332,9 +291,9 @@ function initializeNodeSystem() {
|
|
|
332
291
|
const factory = require("./cancellationToken");
|
|
333
292
|
cancellationToken = factory(sys4.args);
|
|
334
293
|
} catch (e) {
|
|
335
|
-
cancellationToken =
|
|
294
|
+
cancellationToken = ts_exports.server.nullCancellationToken;
|
|
336
295
|
}
|
|
337
|
-
const localeStr =
|
|
296
|
+
const localeStr = ts_exports.server.findArgument("--locale");
|
|
338
297
|
if (localeStr) {
|
|
339
298
|
(0, ts_exports.validateLocaleAndSetLanguage)(localeStr, sys4);
|
|
340
299
|
}
|
|
@@ -356,13 +315,13 @@ function initializeNodeSystem() {
|
|
|
356
315
|
startSession: startNodeSession
|
|
357
316
|
};
|
|
358
317
|
function createLogger() {
|
|
359
|
-
const cmdLineLogFileName =
|
|
360
|
-
const cmdLineVerbosity = getLogLevel(
|
|
318
|
+
const cmdLineLogFileName = ts_exports.server.findArgument("--logFile");
|
|
319
|
+
const cmdLineVerbosity = getLogLevel(ts_exports.server.findArgument("--logVerbosity"));
|
|
361
320
|
const envLogOptions = parseLoggingEnvironmentString(process.env.TSS_LOG);
|
|
362
321
|
const unsubstitutedLogFileName = cmdLineLogFileName ? (0, ts_exports.stripQuotes)(cmdLineLogFileName) : envLogOptions.logToFile ? envLogOptions.file || libDirectory + "/.log" + process.pid.toString() : void 0;
|
|
363
322
|
const substitutedLogFileName = unsubstitutedLogFileName ? unsubstitutedLogFileName.replace("PID", process.pid.toString()) : void 0;
|
|
364
323
|
const logVerbosity = cmdLineVerbosity || envLogOptions.detailLevel;
|
|
365
|
-
return new
|
|
324
|
+
return new Logger(substitutedLogFileName, envLogOptions.traceToConsole, logVerbosity);
|
|
366
325
|
}
|
|
367
326
|
function writeMessage(buf) {
|
|
368
327
|
if (!canWrite) {
|
|
@@ -422,7 +381,7 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
422
381
|
output: process.stdout,
|
|
423
382
|
terminal: false
|
|
424
383
|
});
|
|
425
|
-
const _NodeTypingsInstallerAdapter = class _NodeTypingsInstallerAdapter extends
|
|
384
|
+
const _NodeTypingsInstallerAdapter = class _NodeTypingsInstallerAdapter extends ts_exports.server.TypingsInstallerAdapter {
|
|
426
385
|
constructor(telemetryEnabled2, logger2, host, globalTypingsCacheLocation, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, event) {
|
|
427
386
|
super(
|
|
428
387
|
telemetryEnabled2,
|
|
@@ -438,27 +397,27 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
438
397
|
this.validateDefaultNpmLocation = validateDefaultNpmLocation2;
|
|
439
398
|
}
|
|
440
399
|
createInstallerProcess() {
|
|
441
|
-
if (this.logger.hasLevel(
|
|
400
|
+
if (this.logger.hasLevel(ts_exports.server.LogLevel.requestTime)) {
|
|
442
401
|
this.logger.info("Binding...");
|
|
443
402
|
}
|
|
444
|
-
const args = [
|
|
403
|
+
const args = [ts_exports.server.Arguments.GlobalCacheLocation, this.globalTypingsCacheLocation];
|
|
445
404
|
if (this.telemetryEnabled) {
|
|
446
|
-
args.push(
|
|
405
|
+
args.push(ts_exports.server.Arguments.EnableTelemetry);
|
|
447
406
|
}
|
|
448
407
|
if (this.logger.loggingEnabled() && this.logger.getLogFileName()) {
|
|
449
|
-
args.push(
|
|
408
|
+
args.push(ts_exports.server.Arguments.LogFile, (0, ts_exports.combinePaths)((0, ts_exports.getDirectoryPath)((0, ts_exports.normalizeSlashes)(this.logger.getLogFileName())), `ti-${process.pid}.log`));
|
|
450
409
|
}
|
|
451
410
|
if (this.typingSafeListLocation) {
|
|
452
|
-
args.push(
|
|
411
|
+
args.push(ts_exports.server.Arguments.TypingSafeListLocation, this.typingSafeListLocation);
|
|
453
412
|
}
|
|
454
413
|
if (this.typesMapLocation) {
|
|
455
|
-
args.push(
|
|
414
|
+
args.push(ts_exports.server.Arguments.TypesMapLocation, this.typesMapLocation);
|
|
456
415
|
}
|
|
457
416
|
if (this.npmLocation) {
|
|
458
|
-
args.push(
|
|
417
|
+
args.push(ts_exports.server.Arguments.NpmLocation, this.npmLocation);
|
|
459
418
|
}
|
|
460
419
|
if (this.validateDefaultNpmLocation) {
|
|
461
|
-
args.push(
|
|
420
|
+
args.push(ts_exports.server.Arguments.ValidateDefaultNpmLocation);
|
|
462
421
|
}
|
|
463
422
|
const execArgv = [];
|
|
464
423
|
for (const arg of process.execArgv) {
|
|
@@ -486,7 +445,7 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
486
445
|
// buffer, but we have yet to find a way to retrieve that value.
|
|
487
446
|
_NodeTypingsInstallerAdapter.maxActiveRequestCount = 10;
|
|
488
447
|
let NodeTypingsInstallerAdapter = _NodeTypingsInstallerAdapter;
|
|
489
|
-
class IOSession extends
|
|
448
|
+
class IOSession extends ts_exports.server.Session {
|
|
490
449
|
constructor() {
|
|
491
450
|
const event = (body, eventName) => {
|
|
492
451
|
this.event(body, eventName);
|
|
@@ -522,7 +481,7 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
522
481
|
ts_exports.Debug.assert(!!this.constructed, "Should only call `IOSession.prototype.event` on an initialized IOSession");
|
|
523
482
|
if (this.canUseEvents && this.eventPort) {
|
|
524
483
|
if (!this.eventSocket) {
|
|
525
|
-
if (this.logger.hasLevel(
|
|
484
|
+
if (this.logger.hasLevel(ts_exports.server.LogLevel.verbose)) {
|
|
526
485
|
this.logger.info(`eventPort: event "${eventName}" queued, but socket not yet initialized`);
|
|
527
486
|
}
|
|
528
487
|
(this.socketEventQueue || (this.socketEventQueue = [])).push({ body, eventName });
|
|
@@ -536,7 +495,7 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
536
495
|
}
|
|
537
496
|
}
|
|
538
497
|
writeToEventSocket(body, eventName) {
|
|
539
|
-
this.eventSocket.write(
|
|
498
|
+
this.eventSocket.write(ts_exports.server.formatMessage(ts_exports.server.toEvent(eventName, body), this.logger, this.byteLength, this.host.newLine), "utf8");
|
|
540
499
|
}
|
|
541
500
|
exit() {
|
|
542
501
|
var _a;
|
|
@@ -557,10 +516,10 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
557
516
|
}
|
|
558
517
|
class IpcIOSession extends IOSession {
|
|
559
518
|
writeMessage(msg) {
|
|
560
|
-
const verboseLogging = logger.hasLevel(
|
|
519
|
+
const verboseLogging = logger.hasLevel(ts_exports.server.LogLevel.verbose);
|
|
561
520
|
if (verboseLogging) {
|
|
562
521
|
const json = JSON.stringify(msg);
|
|
563
|
-
logger.info(`${msg.type}:${
|
|
522
|
+
logger.info(`${msg.type}:${ts_exports.server.indent(json)}`);
|
|
564
523
|
}
|
|
565
524
|
process.send(msg);
|
|
566
525
|
}
|
|
@@ -579,15 +538,15 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
579
538
|
});
|
|
580
539
|
}
|
|
581
540
|
}
|
|
582
|
-
const eventPort = parseEventPort(
|
|
583
|
-
const typingSafeListLocation =
|
|
584
|
-
const typesMapLocation =
|
|
585
|
-
const npmLocation =
|
|
586
|
-
const validateDefaultNpmLocation =
|
|
587
|
-
const disableAutomaticTypingAcquisition =
|
|
588
|
-
const useNodeIpc =
|
|
589
|
-
const telemetryEnabled =
|
|
590
|
-
const commandLineTraceDir =
|
|
541
|
+
const eventPort = parseEventPort(ts_exports.server.findArgument("--eventPort"));
|
|
542
|
+
const typingSafeListLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.TypingSafeListLocation);
|
|
543
|
+
const typesMapLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.TypesMapLocation) || (0, ts_exports.combinePaths)((0, ts_exports.getDirectoryPath)(ts_exports.sys.getExecutingFilePath()), "typesMap.json");
|
|
544
|
+
const npmLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.NpmLocation);
|
|
545
|
+
const validateDefaultNpmLocation = ts_exports.server.hasArgument(ts_exports.server.Arguments.ValidateDefaultNpmLocation);
|
|
546
|
+
const disableAutomaticTypingAcquisition = ts_exports.server.hasArgument("--disableAutomaticTypingAcquisition");
|
|
547
|
+
const useNodeIpc = ts_exports.server.hasArgument("--useNodeIpc");
|
|
548
|
+
const telemetryEnabled = ts_exports.server.hasArgument(ts_exports.server.Arguments.EnableTelemetry);
|
|
549
|
+
const commandLineTraceDir = ts_exports.server.findArgument("--traceDirectory");
|
|
591
550
|
const traceDir = commandLineTraceDir ? (0, ts_exports.stripQuotes)(commandLineTraceDir) : process.env.TSS_TRACE;
|
|
592
551
|
if (traceDir) {
|
|
593
552
|
(0, ts_exports.startTracing)("server", traceDir);
|
|
@@ -629,11 +588,10 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
629
588
|
}
|
|
630
589
|
|
|
631
590
|
// src/tsserver/server.ts
|
|
632
|
-
__reExport(server_exports, ts_exports, module.exports);
|
|
633
591
|
function findArgumentStringArray(argName) {
|
|
634
|
-
const arg =
|
|
592
|
+
const arg = ts_exports.server.findArgument(argName);
|
|
635
593
|
if (arg === void 0) {
|
|
636
|
-
return
|
|
594
|
+
return ts_exports.emptyArray;
|
|
637
595
|
}
|
|
638
596
|
return arg.split(",").filter((name) => name !== "");
|
|
639
597
|
}
|
|
@@ -643,32 +601,32 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode,
|
|
|
643
601
|
logger.info(`Arguments: ${args.join(" ")}`);
|
|
644
602
|
logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${ts_exports.sys.useCaseSensitiveFileNames}`);
|
|
645
603
|
logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`);
|
|
646
|
-
|
|
604
|
+
ts_exports.setStackTraceLimit();
|
|
647
605
|
if (ts_exports.Debug.isDebugging) {
|
|
648
606
|
ts_exports.Debug.enableDebugInfo();
|
|
649
607
|
}
|
|
650
608
|
if (ts_exports.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts_exports.sys.getEnvironmentVariable("NODE_ENV"))) {
|
|
651
609
|
ts_exports.sys.tryEnableSourceMapsForHost();
|
|
652
610
|
}
|
|
653
|
-
console.log = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "),
|
|
654
|
-
console.warn = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "),
|
|
655
|
-
console.error = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "),
|
|
611
|
+
console.log = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), ts_exports.server.Msg.Info);
|
|
612
|
+
console.warn = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), ts_exports.server.Msg.Err);
|
|
613
|
+
console.error = (...args2) => logger.msg(args2.length === 1 ? args2[0] : args2.join(", "), ts_exports.server.Msg.Err);
|
|
656
614
|
startServer(
|
|
657
615
|
{
|
|
658
616
|
globalPlugins: findArgumentStringArray("--globalPlugins"),
|
|
659
617
|
pluginProbeLocations: findArgumentStringArray("--pluginProbeLocations"),
|
|
660
|
-
allowLocalPluginLoads:
|
|
661
|
-
useSingleInferredProject:
|
|
662
|
-
useInferredProjectPerProjectRoot:
|
|
663
|
-
suppressDiagnosticEvents:
|
|
664
|
-
noGetErrOnBackgroundUpdate:
|
|
665
|
-
canUseWatchEvents:
|
|
618
|
+
allowLocalPluginLoads: ts_exports.server.hasArgument("--allowLocalPluginLoads"),
|
|
619
|
+
useSingleInferredProject: ts_exports.server.hasArgument("--useSingleInferredProject"),
|
|
620
|
+
useInferredProjectPerProjectRoot: ts_exports.server.hasArgument("--useInferredProjectPerProjectRoot"),
|
|
621
|
+
suppressDiagnosticEvents: ts_exports.server.hasArgument("--suppressDiagnosticEvents"),
|
|
622
|
+
noGetErrOnBackgroundUpdate: ts_exports.server.hasArgument("--noGetErrOnBackgroundUpdate"),
|
|
623
|
+
canUseWatchEvents: ts_exports.server.hasArgument("--canUseWatchEvents"),
|
|
666
624
|
serverMode
|
|
667
625
|
},
|
|
668
626
|
logger,
|
|
669
627
|
cancellationToken
|
|
670
628
|
);
|
|
671
629
|
}
|
|
672
|
-
|
|
630
|
+
ts_exports.setStackTraceLimit();
|
|
673
631
|
start(initializeNodeSystem(), require("os").platform());
|
|
674
632
|
//# sourceMappingURL=tsserver.js.map
|
package/lib/typescript.js
CHANGED
|
@@ -37936,7 +37936,7 @@ function processPragmasIntoFields(context, reportDiagnostic) {
|
|
|
37936
37936
|
const libReferenceDirectives = context.libReferenceDirectives;
|
|
37937
37937
|
forEach(toArray(entryOrList), (arg) => {
|
|
37938
37938
|
const { types, lib, path, ["resolution-mode"]: res } = arg.arguments;
|
|
37939
|
-
if (arg.arguments["no-default-lib"]) {
|
|
37939
|
+
if (arg.arguments["no-default-lib"] === "true") {
|
|
37940
37940
|
context.hasNoDefaultLib = true;
|
|
37941
37941
|
} else if (types) {
|
|
37942
37942
|
const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
|
@@ -48550,13 +48550,6 @@ function createTypeChecker(host) {
|
|
|
48550
48550
|
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable");
|
|
48551
48551
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
48552
48552
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
48553
|
-
var nonNullUnknownType = createIntrinsicType(
|
|
48554
|
-
2 /* Unknown */,
|
|
48555
|
-
"unknown",
|
|
48556
|
-
/*objectFlags*/
|
|
48557
|
-
void 0,
|
|
48558
|
-
"non-null"
|
|
48559
|
-
);
|
|
48560
48553
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
48561
48554
|
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening");
|
|
48562
48555
|
var missingType = createIntrinsicType(
|
|
@@ -62093,7 +62086,7 @@ function createTypeChecker(host) {
|
|
|
62093
62086
|
const includes = addTypesToUnion(typeSet, 0, types);
|
|
62094
62087
|
if (unionReduction !== 0 /* None */) {
|
|
62095
62088
|
if (includes & 3 /* AnyOrUnknown */) {
|
|
62096
|
-
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType :
|
|
62089
|
+
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
|
|
62097
62090
|
}
|
|
62098
62091
|
if (includes & 32768 /* Undefined */) {
|
|
62099
62092
|
if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
|
|
@@ -70072,7 +70065,7 @@ function createTypeChecker(host) {
|
|
|
70072
70065
|
function hasMatchingArgument(expression, reference) {
|
|
70073
70066
|
if (expression.arguments) {
|
|
70074
70067
|
for (const argument of expression.arguments) {
|
|
70075
|
-
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)
|
|
70068
|
+
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
|
|
70076
70069
|
return true;
|
|
70077
70070
|
}
|
|
70078
70071
|
}
|
|
@@ -70082,36 +70075,6 @@ function createTypeChecker(host) {
|
|
|
70082
70075
|
}
|
|
70083
70076
|
return false;
|
|
70084
70077
|
}
|
|
70085
|
-
function getCandidateDiscriminantPropertyAccess(expr, reference) {
|
|
70086
|
-
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
70087
|
-
if (isIdentifier(expr)) {
|
|
70088
|
-
const symbol = getResolvedSymbol(expr);
|
|
70089
|
-
const declaration = symbol.valueDeclaration;
|
|
70090
|
-
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
70091
|
-
return declaration;
|
|
70092
|
-
}
|
|
70093
|
-
}
|
|
70094
|
-
} else if (isAccessExpression(expr)) {
|
|
70095
|
-
if (isMatchingReference(reference, expr.expression)) {
|
|
70096
|
-
return expr;
|
|
70097
|
-
}
|
|
70098
|
-
} else if (isIdentifier(expr)) {
|
|
70099
|
-
const symbol = getResolvedSymbol(expr);
|
|
70100
|
-
if (isConstantVariable(symbol)) {
|
|
70101
|
-
const declaration = symbol.valueDeclaration;
|
|
70102
|
-
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
|
70103
|
-
return declaration.initializer;
|
|
70104
|
-
}
|
|
70105
|
-
if (isBindingElement(declaration) && !declaration.initializer) {
|
|
70106
|
-
const parent2 = declaration.parent.parent;
|
|
70107
|
-
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
|
70108
|
-
return declaration;
|
|
70109
|
-
}
|
|
70110
|
-
}
|
|
70111
|
-
}
|
|
70112
|
-
}
|
|
70113
|
-
return void 0;
|
|
70114
|
-
}
|
|
70115
70078
|
function getFlowNodeId(flow) {
|
|
70116
70079
|
if (!flow.id || flow.id < 0) {
|
|
70117
70080
|
flow.id = nextFlowId;
|
|
@@ -70865,7 +70828,7 @@ function createTypeChecker(host) {
|
|
|
70865
70828
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
70866
70829
|
return declaredType;
|
|
70867
70830
|
}
|
|
70868
|
-
return resultType
|
|
70831
|
+
return resultType;
|
|
70869
70832
|
function getOrSetCacheKey() {
|
|
70870
70833
|
if (isKeySet) {
|
|
70871
70834
|
return key;
|
|
@@ -71219,9 +71182,39 @@ function createTypeChecker(host) {
|
|
|
71219
71182
|
}
|
|
71220
71183
|
return result;
|
|
71221
71184
|
}
|
|
71185
|
+
function getCandidateDiscriminantPropertyAccess(expr) {
|
|
71186
|
+
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
71187
|
+
if (isIdentifier(expr)) {
|
|
71188
|
+
const symbol = getResolvedSymbol(expr);
|
|
71189
|
+
const declaration = symbol.valueDeclaration;
|
|
71190
|
+
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
71191
|
+
return declaration;
|
|
71192
|
+
}
|
|
71193
|
+
}
|
|
71194
|
+
} else if (isAccessExpression(expr)) {
|
|
71195
|
+
if (isMatchingReference(reference, expr.expression)) {
|
|
71196
|
+
return expr;
|
|
71197
|
+
}
|
|
71198
|
+
} else if (isIdentifier(expr)) {
|
|
71199
|
+
const symbol = getResolvedSymbol(expr);
|
|
71200
|
+
if (isConstantVariable(symbol)) {
|
|
71201
|
+
const declaration = symbol.valueDeclaration;
|
|
71202
|
+
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
|
71203
|
+
return declaration.initializer;
|
|
71204
|
+
}
|
|
71205
|
+
if (isBindingElement(declaration) && !declaration.initializer) {
|
|
71206
|
+
const parent2 = declaration.parent.parent;
|
|
71207
|
+
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
|
71208
|
+
return declaration;
|
|
71209
|
+
}
|
|
71210
|
+
}
|
|
71211
|
+
}
|
|
71212
|
+
}
|
|
71213
|
+
return void 0;
|
|
71214
|
+
}
|
|
71222
71215
|
function getDiscriminantPropertyAccess(expr, computedType) {
|
|
71223
71216
|
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
|
|
71224
|
-
const access = getCandidateDiscriminantPropertyAccess(expr
|
|
71217
|
+
const access = getCandidateDiscriminantPropertyAccess(expr);
|
|
71225
71218
|
if (access) {
|
|
71226
71219
|
const name = getAccessedPropertyName(access);
|
|
71227
71220
|
if (name) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -21,12 +21,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
21
21
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
22
|
var __getProtoOf = Object.getPrototypeOf;
|
|
23
23
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
-
var __esm = (fn, res) => function __init() {
|
|
25
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
26
|
-
};
|
|
27
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
28
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
29
|
-
};
|
|
30
24
|
var __export = (target, all) => {
|
|
31
25
|
for (var name in all)
|
|
32
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -50,33 +44,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
50
44
|
));
|
|
51
45
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
52
46
|
|
|
53
|
-
// src/typescript/typescript.ts
|
|
54
|
-
var typescript_exports = {};
|
|
55
|
-
var init_typescript = __esm({
|
|
56
|
-
"src/typescript/typescript.ts"() {
|
|
57
|
-
"use strict";
|
|
58
|
-
__reExport(typescript_exports, require("./typescript.js"));
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// src/typingsInstaller/_namespaces/ts.server.ts
|
|
63
|
-
var require_ts_server = __commonJS({
|
|
64
|
-
"src/typingsInstaller/_namespaces/ts.server.ts"(exports2, module2) {
|
|
65
|
-
"use strict";
|
|
66
|
-
init_typescript();
|
|
67
|
-
module2.exports = typescript_exports.server;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// src/typingsInstaller/_namespaces/ts.server.typingsInstaller.ts
|
|
72
|
-
var require_ts_server_typingsInstaller = __commonJS({
|
|
73
|
-
"src/typingsInstaller/_namespaces/ts.server.typingsInstaller.ts"(exports2, module2) {
|
|
74
|
-
"use strict";
|
|
75
|
-
init_typescript();
|
|
76
|
-
module2.exports = typescript_exports.server.typingsInstaller;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
47
|
// src/typingsInstaller/nodeTypingsInstaller.ts
|
|
81
48
|
var nodeTypingsInstaller_exports = {};
|
|
82
49
|
__export(nodeTypingsInstaller_exports, {
|
|
@@ -88,12 +55,15 @@ var path = __toESM(require("path"));
|
|
|
88
55
|
|
|
89
56
|
// src/typingsInstaller/_namespaces/ts.ts
|
|
90
57
|
var ts_exports = {};
|
|
91
|
-
|
|
58
|
+
|
|
59
|
+
// src/typescript/typescript.ts
|
|
60
|
+
var typescript_exports = {};
|
|
61
|
+
__reExport(typescript_exports, require("./typescript.js"));
|
|
62
|
+
|
|
63
|
+
// src/typingsInstaller/_namespaces/ts.ts
|
|
92
64
|
__reExport(ts_exports, typescript_exports);
|
|
93
65
|
|
|
94
66
|
// src/typingsInstaller/nodeTypingsInstaller.ts
|
|
95
|
-
var import_ts2 = __toESM(require_ts_server());
|
|
96
|
-
var import_ts_server = __toESM(require_ts_server_typingsInstaller());
|
|
97
67
|
var FileLog = class {
|
|
98
68
|
constructor(logFile) {
|
|
99
69
|
this.logFile = logFile;
|
|
@@ -104,7 +74,7 @@ var FileLog = class {
|
|
|
104
74
|
if (typeof this.logFile !== "string")
|
|
105
75
|
return;
|
|
106
76
|
try {
|
|
107
|
-
fs.appendFileSync(this.logFile, `[${
|
|
77
|
+
fs.appendFileSync(this.logFile, `[${ts_exports.server.nowString()}] ${text}${ts_exports.sys.newLine}`);
|
|
108
78
|
} catch (e) {
|
|
109
79
|
this.logFile = void 0;
|
|
110
80
|
}
|
|
@@ -144,7 +114,7 @@ var typesRegistryPackageName = "types-registry";
|
|
|
144
114
|
function getTypesRegistryFileLocation(globalTypingsCacheLocation2) {
|
|
145
115
|
return (0, ts_exports.combinePaths)((0, ts_exports.normalizeSlashes)(globalTypingsCacheLocation2), `node_modules/${typesRegistryPackageName}/index.json`);
|
|
146
116
|
}
|
|
147
|
-
var NodeTypingsInstaller = class extends
|
|
117
|
+
var NodeTypingsInstaller = class extends ts_exports.server.typingsInstaller.TypingsInstaller {
|
|
148
118
|
constructor(globalTypingsCacheLocation2, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, throttleLimit, log2) {
|
|
149
119
|
const libDirectory = (0, ts_exports.getDirectoryPath)((0, ts_exports.normalizePath)(ts_exports.sys.getExecutingFilePath()));
|
|
150
120
|
super(
|
|
@@ -161,7 +131,7 @@ var NodeTypingsInstaller = class extends import_ts_server.TypingsInstaller {
|
|
|
161
131
|
}
|
|
162
132
|
if (this.log.isEnabled()) {
|
|
163
133
|
this.log.writeLine(`Process id: ${process.pid}`);
|
|
164
|
-
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${
|
|
134
|
+
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${ts_exports.server.Arguments.NpmLocation}' ${npmLocation2 === void 0 ? "not " : ""} provided)`);
|
|
165
135
|
this.log.writeLine(`validateDefaultNpmLocation: ${validateDefaultNpmLocation2}`);
|
|
166
136
|
}
|
|
167
137
|
({ execSync: this.nodeExecSync } = require("child_process"));
|
|
@@ -195,7 +165,7 @@ var NodeTypingsInstaller = class extends import_ts_server.TypingsInstaller {
|
|
|
195
165
|
}
|
|
196
166
|
sendResponse(response) {
|
|
197
167
|
if (this.log.isEnabled()) {
|
|
198
|
-
this.log.writeLine(`Sending response:${
|
|
168
|
+
this.log.writeLine(`Sending response:${ts_exports.server.stringifyIndented(response)}`);
|
|
199
169
|
}
|
|
200
170
|
process.send(response);
|
|
201
171
|
if (this.log.isEnabled()) {
|
|
@@ -207,7 +177,7 @@ var NodeTypingsInstaller = class extends import_ts_server.TypingsInstaller {
|
|
|
207
177
|
this.log.writeLine(`#${requestId} with cwd: ${cwd} arguments: ${JSON.stringify(packageNames)}`);
|
|
208
178
|
}
|
|
209
179
|
const start = Date.now();
|
|
210
|
-
const hasError =
|
|
180
|
+
const hasError = ts_exports.server.typingsInstaller.installNpmPackages(this.npmPath, ts_exports.version, packageNames, (command) => this.execSyncAndLog(command, { cwd }));
|
|
211
181
|
if (this.log.isEnabled()) {
|
|
212
182
|
this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`);
|
|
213
183
|
}
|
|
@@ -231,12 +201,12 @@ var NodeTypingsInstaller = class extends import_ts_server.TypingsInstaller {
|
|
|
231
201
|
}
|
|
232
202
|
}
|
|
233
203
|
};
|
|
234
|
-
var logFilePath =
|
|
235
|
-
var globalTypingsCacheLocation =
|
|
236
|
-
var typingSafeListLocation =
|
|
237
|
-
var typesMapLocation =
|
|
238
|
-
var npmLocation =
|
|
239
|
-
var validateDefaultNpmLocation =
|
|
204
|
+
var logFilePath = ts_exports.server.findArgument(ts_exports.server.Arguments.LogFile);
|
|
205
|
+
var globalTypingsCacheLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.GlobalCacheLocation);
|
|
206
|
+
var typingSafeListLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.TypingSafeListLocation);
|
|
207
|
+
var typesMapLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.TypesMapLocation);
|
|
208
|
+
var npmLocation = ts_exports.server.findArgument(ts_exports.server.Arguments.NpmLocation);
|
|
209
|
+
var validateDefaultNpmLocation = ts_exports.server.hasArgument(ts_exports.server.Arguments.ValidateDefaultNpmLocation);
|
|
240
210
|
var log = new FileLog(logFilePath);
|
|
241
211
|
if (log.isEnabled()) {
|
|
242
212
|
process.on("uncaughtException", (e) => {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-pr-
|
|
5
|
+
"version": "5.5.0-pr-57665-10",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "9e5f276d5e775c716ed8e4f97220d1597ce4ab1e"
|
|
117
117
|
}
|