@typescript-deploys/pr-build 5.3.0-pr-56064-15 → 5.3.0-pr-56105-6

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/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
  # TypeScript
3
3
 
4
4
  [![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
5
- [![Devops Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
6
5
  [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
7
6
  [![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
8
7
  [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript)
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-insiders.20231011`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231013`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -48109,7 +48109,7 @@ function createTypeChecker(host) {
48109
48109
  return result;
48110
48110
  }
48111
48111
  function createAnonymousTypeNode(type2) {
48112
- var _a2;
48112
+ var _a2, _b2;
48113
48113
  const typeId = type2.id;
48114
48114
  const symbol = type2.symbol;
48115
48115
  if (symbol) {
@@ -48135,6 +48135,20 @@ function createTypeChecker(host) {
48135
48135
  return visitAndTransformType(type2, createTypeNodeFromObjectType);
48136
48136
  }
48137
48137
  } else {
48138
+ const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
48139
+ if (isInstantiationExpressionType) {
48140
+ const instantiationExpressionType = type2;
48141
+ if (isTypeQueryNode(instantiationExpressionType.node)) {
48142
+ const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
48143
+ if (typeNode) {
48144
+ return typeNode;
48145
+ }
48146
+ }
48147
+ if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
48148
+ return createElidedInformationPlaceholder(context);
48149
+ }
48150
+ return visitAndTransformType(type2, createTypeNodeFromObjectType);
48151
+ }
48138
48152
  return createTypeNodeFromObjectType(type2);
48139
48153
  }
48140
48154
  function shouldWriteTypeOfFunctionSymbol() {
@@ -58977,7 +58991,6 @@ function createTypeChecker(host) {
58977
58991
  ) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
58978
58992
  }
58979
58993
  function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
58980
- Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
58981
58994
  const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
58982
58995
  if (type.objectFlags & 32 /* Mapped */) {
58983
58996
  result.declaration = type.declaration;
@@ -62225,7 +62238,6 @@ function createTypeChecker(host) {
62225
62238
  const sourceObjectFlags = getObjectFlags(source2);
62226
62239
  const targetObjectFlags = getObjectFlags(target2);
62227
62240
  if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
62228
- Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
62229
62241
  for (let i = 0; i < targetSignatures.length; i++) {
62230
62242
  const related = signatureRelatedTo(
62231
62243
  sourceSignatures[i],
@@ -69452,8 +69464,21 @@ function createTypeChecker(host) {
69452
69464
  function getEnclosingClassFromThisParameter(node) {
69453
69465
  const thisParameter = getThisParameterFromNodeContext(node);
69454
69466
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
69455
- if (thisType && thisType.flags & 262144 /* TypeParameter */) {
69456
- thisType = getConstraintOfTypeParameter(thisType);
69467
+ if (thisType) {
69468
+ if (thisType.flags & 262144 /* TypeParameter */) {
69469
+ thisType = getConstraintOfTypeParameter(thisType);
69470
+ }
69471
+ } else {
69472
+ const thisContainer = getThisContainer(
69473
+ node,
69474
+ /*includeArrowFunctions*/
69475
+ false,
69476
+ /*includeClassComputedPropertyName*/
69477
+ false
69478
+ );
69479
+ if (isFunctionLike(thisContainer)) {
69480
+ thisType = getContextualThisParameterType(thisContainer);
69481
+ }
69457
69482
  }
69458
69483
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
69459
69484
  return getTargetType(thisType);
@@ -72443,7 +72468,14 @@ function createTypeChecker(host) {
72443
72468
  hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
72444
72469
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
72445
72470
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
72446
- const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
72471
+ const result3 = createAnonymousType(
72472
+ /*symbol*/
72473
+ void 0,
72474
+ resolved.members,
72475
+ callSignatures,
72476
+ constructSignatures,
72477
+ resolved.indexInfos
72478
+ );
72447
72479
  result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
72448
72480
  result3.node = node;
72449
72481
  return result3;
package/lib/tsserver.js CHANGED
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
2330
  var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-insiders.20231011`;
2331
+ var version = `${versionMajorMinor}.0-insiders.20231013`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6573,7 +6573,6 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
6573
6573
  InternalSymbolName2["ExportEquals"] = "export=";
6574
6574
  InternalSymbolName2["Default"] = "default";
6575
6575
  InternalSymbolName2["This"] = "this";
6576
- InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
6577
6576
  return InternalSymbolName2;
6578
6577
  })(InternalSymbolName || {});
6579
6578
  var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
@@ -52822,7 +52821,7 @@ function createTypeChecker(host) {
52822
52821
  return result;
52823
52822
  }
52824
52823
  function createAnonymousTypeNode(type2) {
52825
- var _a2;
52824
+ var _a2, _b2;
52826
52825
  const typeId = type2.id;
52827
52826
  const symbol = type2.symbol;
52828
52827
  if (symbol) {
@@ -52848,6 +52847,20 @@ function createTypeChecker(host) {
52848
52847
  return visitAndTransformType(type2, createTypeNodeFromObjectType);
52849
52848
  }
52850
52849
  } else {
52850
+ const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
52851
+ if (isInstantiationExpressionType) {
52852
+ const instantiationExpressionType = type2;
52853
+ if (isTypeQueryNode(instantiationExpressionType.node)) {
52854
+ const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
52855
+ if (typeNode) {
52856
+ return typeNode;
52857
+ }
52858
+ }
52859
+ if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
52860
+ return createElidedInformationPlaceholder(context);
52861
+ }
52862
+ return visitAndTransformType(type2, createTypeNodeFromObjectType);
52863
+ }
52851
52864
  return createTypeNodeFromObjectType(type2);
52852
52865
  }
52853
52866
  function shouldWriteTypeOfFunctionSymbol() {
@@ -63690,7 +63703,6 @@ function createTypeChecker(host) {
63690
63703
  ) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
63691
63704
  }
63692
63705
  function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
63693
- Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
63694
63706
  const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
63695
63707
  if (type.objectFlags & 32 /* Mapped */) {
63696
63708
  result.declaration = type.declaration;
@@ -66938,7 +66950,6 @@ function createTypeChecker(host) {
66938
66950
  const sourceObjectFlags = getObjectFlags(source2);
66939
66951
  const targetObjectFlags = getObjectFlags(target2);
66940
66952
  if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
66941
- Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
66942
66953
  for (let i = 0; i < targetSignatures.length; i++) {
66943
66954
  const related = signatureRelatedTo(
66944
66955
  sourceSignatures[i],
@@ -74165,8 +74176,21 @@ function createTypeChecker(host) {
74165
74176
  function getEnclosingClassFromThisParameter(node) {
74166
74177
  const thisParameter = getThisParameterFromNodeContext(node);
74167
74178
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
74168
- if (thisType && thisType.flags & 262144 /* TypeParameter */) {
74169
- thisType = getConstraintOfTypeParameter(thisType);
74179
+ if (thisType) {
74180
+ if (thisType.flags & 262144 /* TypeParameter */) {
74181
+ thisType = getConstraintOfTypeParameter(thisType);
74182
+ }
74183
+ } else {
74184
+ const thisContainer = getThisContainer(
74185
+ node,
74186
+ /*includeArrowFunctions*/
74187
+ false,
74188
+ /*includeClassComputedPropertyName*/
74189
+ false
74190
+ );
74191
+ if (isFunctionLike(thisContainer)) {
74192
+ thisType = getContextualThisParameterType(thisContainer);
74193
+ }
74170
74194
  }
74171
74195
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
74172
74196
  return getTargetType(thisType);
@@ -77156,7 +77180,14 @@ function createTypeChecker(host) {
77156
77180
  hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
77157
77181
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
77158
77182
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
77159
- const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
77183
+ const result3 = createAnonymousType(
77184
+ /*symbol*/
77185
+ void 0,
77186
+ resolved.members,
77187
+ callSignatures,
77188
+ constructSignatures,
77189
+ resolved.indexInfos
77190
+ );
77160
77191
  result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
77161
77192
  result3.node = node;
77162
77193
  return result3;
@@ -130363,6 +130394,44 @@ __export(ts_JsTyping_exports, {
130363
130394
  validatePackageName: () => validatePackageName
130364
130395
  });
130365
130396
 
130397
+ // src/jsTyping/shared.ts
130398
+ var ActionSet = "action::set";
130399
+ var ActionInvalidate = "action::invalidate";
130400
+ var ActionPackageInstalled = "action::packageInstalled";
130401
+ var EventTypesRegistry = "event::typesRegistry";
130402
+ var EventBeginInstallTypes = "event::beginInstallTypes";
130403
+ var EventEndInstallTypes = "event::endInstallTypes";
130404
+ var EventInitializationFailed = "event::initializationFailed";
130405
+ var ActionWatchTypingLocations = "action::watchTypingLocations";
130406
+ var Arguments;
130407
+ ((Arguments2) => {
130408
+ Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
130409
+ Arguments2.LogFile = "--logFile";
130410
+ Arguments2.EnableTelemetry = "--enableTelemetry";
130411
+ Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
130412
+ Arguments2.TypesMapLocation = "--typesMapLocation";
130413
+ Arguments2.NpmLocation = "--npmLocation";
130414
+ Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
130415
+ })(Arguments || (Arguments = {}));
130416
+ function hasArgument(argumentName) {
130417
+ return sys.args.includes(argumentName);
130418
+ }
130419
+ function findArgument(argumentName) {
130420
+ const index = sys.args.indexOf(argumentName);
130421
+ return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
130422
+ }
130423
+ function nowString() {
130424
+ const d = /* @__PURE__ */ new Date();
130425
+ return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
130426
+ }
130427
+ var indentStr = "\n ";
130428
+ function indent2(str) {
130429
+ return indentStr + str.replace(/\n/g, indentStr);
130430
+ }
130431
+ function stringifyIndented(json) {
130432
+ return indent2(JSON.stringify(json, void 0, 2));
130433
+ }
130434
+
130366
130435
  // src/jsTyping/jsTyping.ts
130367
130436
  function isTypingUpToDate(cachedTyping, availableTypingVersions) {
130368
130437
  const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest"));
@@ -130469,21 +130538,21 @@ function discoverTypings(host, log, fileNames, projectRootPath, safeList, packag
130469
130538
  );
130470
130539
  addInferredTypings(module2, "Inferred typings from unresolved imports");
130471
130540
  }
130472
- packageNameToTypingLocation.forEach((typing, name) => {
130473
- const registryEntry = typesRegistry.get(name);
130474
- if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
130475
- inferredTypings.set(name, typing.typingLocation);
130476
- }
130477
- });
130478
130541
  for (const excludeTypingName of exclude) {
130479
130542
  const didDelete = inferredTypings.delete(excludeTypingName);
130480
130543
  if (didDelete && log)
130481
130544
  log(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`);
130482
130545
  }
130546
+ packageNameToTypingLocation.forEach((typing, name) => {
130547
+ const registryEntry = typesRegistry.get(name);
130548
+ if (inferredTypings.get(name) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
130549
+ inferredTypings.set(name, typing.typingLocation);
130550
+ }
130551
+ });
130483
130552
  const newTypingNames = [];
130484
130553
  const cachedTypingPaths = [];
130485
130554
  inferredTypings.forEach((inferred, typing) => {
130486
- if (inferred !== void 0) {
130555
+ if (inferred) {
130487
130556
  cachedTypingPaths.push(inferred);
130488
130557
  } else {
130489
130558
  newTypingNames.push(typing);
@@ -130491,11 +130560,11 @@ function discoverTypings(host, log, fileNames, projectRootPath, safeList, packag
130491
130560
  });
130492
130561
  const result = { cachedTypingPaths, newTypingNames, filesToWatch };
130493
130562
  if (log)
130494
- log(`Result: ${JSON.stringify(result)}`);
130563
+ log(`Finished typings discovery:${stringifyIndented(result)}`);
130495
130564
  return result;
130496
130565
  function addInferredTyping(typingName) {
130497
130566
  if (!inferredTypings.has(typingName)) {
130498
- inferredTypings.set(typingName, void 0);
130567
+ inferredTypings.set(typingName, false);
130499
130568
  }
130500
130569
  }
130501
130570
  function addInferredTypings(typingNames, message) {
@@ -130668,37 +130737,6 @@ function renderPackageNameValidationFailureWorker(typing, result, name, isScopeN
130668
130737
  }
130669
130738
  }
130670
130739
 
130671
- // src/jsTyping/shared.ts
130672
- var ActionSet = "action::set";
130673
- var ActionInvalidate = "action::invalidate";
130674
- var ActionPackageInstalled = "action::packageInstalled";
130675
- var EventTypesRegistry = "event::typesRegistry";
130676
- var EventBeginInstallTypes = "event::beginInstallTypes";
130677
- var EventEndInstallTypes = "event::endInstallTypes";
130678
- var EventInitializationFailed = "event::initializationFailed";
130679
- var ActionWatchTypingLocations = "action::watchTypingLocations";
130680
- var Arguments;
130681
- ((Arguments2) => {
130682
- Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
130683
- Arguments2.LogFile = "--logFile";
130684
- Arguments2.EnableTelemetry = "--enableTelemetry";
130685
- Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
130686
- Arguments2.TypesMapLocation = "--typesMapLocation";
130687
- Arguments2.NpmLocation = "--npmLocation";
130688
- Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
130689
- })(Arguments || (Arguments = {}));
130690
- function hasArgument(argumentName) {
130691
- return sys.args.includes(argumentName);
130692
- }
130693
- function findArgument(argumentName) {
130694
- const index = sys.args.indexOf(argumentName);
130695
- return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
130696
- }
130697
- function nowString() {
130698
- const d = /* @__PURE__ */ new Date();
130699
- return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
130700
- }
130701
-
130702
130740
  // src/services/types.ts
130703
130741
  var ScriptSnapshot;
130704
130742
  ((ScriptSnapshot2) => {
@@ -174689,7 +174727,7 @@ var TypingsInstaller = class {
174689
174727
  }
174690
174728
  install(req) {
174691
174729
  if (this.log.isEnabled()) {
174692
- this.log.writeLine(`Got install request ${JSON.stringify(req)}`);
174730
+ this.log.writeLine(`Got install request${stringifyIndented(req)}`);
174693
174731
  }
174694
174732
  if (req.cachePath) {
174695
174733
  if (this.log.isEnabled()) {
@@ -174712,9 +174750,6 @@ var TypingsInstaller = class {
174712
174750
  this.typesRegistry,
174713
174751
  req.compilerOptions
174714
174752
  );
174715
- if (this.log.isEnabled()) {
174716
- this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`);
174717
- }
174718
174753
  this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch);
174719
174754
  if (discoverTypingsResult.newTypingNames.length) {
174720
174755
  this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames);
@@ -174756,8 +174791,8 @@ var TypingsInstaller = class {
174756
174791
  const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson));
174757
174792
  const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson));
174758
174793
  if (this.log.isEnabled()) {
174759
- this.log.writeLine(`Loaded content of '${packageJson}': ${JSON.stringify(npmConfig)}`);
174760
- this.log.writeLine(`Loaded content of '${packageLockJson}'`);
174794
+ this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`);
174795
+ this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`);
174761
174796
  }
174762
174797
  if (npmConfig.devDependencies && npmLock.dependencies) {
174763
174798
  for (const key in npmConfig.devDependencies) {
@@ -175134,13 +175169,6 @@ function removeSorted(array, remove, compare) {
175134
175169
  array.splice(removeIndex, 1);
175135
175170
  }
175136
175171
  }
175137
- var indentStr = "\n ";
175138
- function indent2(str) {
175139
- return indentStr + str.replace(/\n/g, indentStr);
175140
- }
175141
- function stringifyIndented(json) {
175142
- return indentStr + JSON.stringify(json);
175143
- }
175144
175172
 
175145
175173
  // src/server/_namespaces/ts.server.protocol.ts
175146
175174
  var ts_server_protocol_exports = {};
@@ -177993,9 +178021,6 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
177993
178021
  includePackageJsonAutoImports() {
177994
178022
  return 0 /* Off */;
177995
178023
  }
177996
- getTypeAcquisition() {
177997
- return { enable: false };
177998
- }
177999
178024
  /** @internal */
178000
178025
  getSymlinkCache() {
178001
178026
  return this.hostProject.getSymlinkCache();
@@ -181919,7 +181944,7 @@ function formatMessage2(msg, logger, byteLength, newLine) {
181919
181944
  const verboseLogging = logger.hasLevel(3 /* verbose */);
181920
181945
  const json = JSON.stringify(msg);
181921
181946
  if (verboseLogging) {
181922
- logger.info(`${msg.type}:${indent2(JSON.stringify(msg, void 0, " "))}`);
181947
+ logger.info(`${msg.type}:${stringifyIndented(msg)}`);
181923
181948
  }
181924
181949
  const len = byteLength(json, "utf8");
181925
181950
  return `Content-Length: ${1 + len}\r
@@ -3450,7 +3450,6 @@ declare namespace ts {
3450
3450
  getLanguageService(): never;
3451
3451
  getHostForAutoImportProvider(): never;
3452
3452
  getProjectReferences(): readonly ts.ProjectReference[] | undefined;
3453
- getTypeAcquisition(): TypeAcquisition;
3454
3453
  }
3455
3454
  /**
3456
3455
  * If a file is opened, the server will look for a tsconfig (or jsconfig)
@@ -7048,7 +7047,6 @@ declare namespace ts {
7048
7047
  ExportEquals = "export=",
7049
7048
  Default = "default",
7050
7049
  This = "this",
7051
- InstantiationExpression = "__instantiationExpression",
7052
7050
  }
7053
7051
  /**
7054
7052
  * This represents a string whose leading underscore have been escaped by adding extra leading underscores.
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.3";
38
- version = `${versionMajorMinor}.0-insiders.20231011`;
38
+ version = `${versionMajorMinor}.0-insiders.20231013`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4338,7 +4338,6 @@ ${lanes.join("\n")}
4338
4338
  InternalSymbolName2["ExportEquals"] = "export=";
4339
4339
  InternalSymbolName2["Default"] = "default";
4340
4340
  InternalSymbolName2["This"] = "this";
4341
- InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
4342
4341
  return InternalSymbolName2;
4343
4342
  })(InternalSymbolName || {});
4344
4343
  NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
@@ -50589,7 +50588,7 @@ ${lanes.join("\n")}
50589
50588
  return result;
50590
50589
  }
50591
50590
  function createAnonymousTypeNode(type2) {
50592
- var _a2;
50591
+ var _a2, _b2;
50593
50592
  const typeId = type2.id;
50594
50593
  const symbol = type2.symbol;
50595
50594
  if (symbol) {
@@ -50615,6 +50614,20 @@ ${lanes.join("\n")}
50615
50614
  return visitAndTransformType(type2, createTypeNodeFromObjectType);
50616
50615
  }
50617
50616
  } else {
50617
+ const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
50618
+ if (isInstantiationExpressionType) {
50619
+ const instantiationExpressionType = type2;
50620
+ if (isTypeQueryNode(instantiationExpressionType.node)) {
50621
+ const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
50622
+ if (typeNode) {
50623
+ return typeNode;
50624
+ }
50625
+ }
50626
+ if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
50627
+ return createElidedInformationPlaceholder(context);
50628
+ }
50629
+ return visitAndTransformType(type2, createTypeNodeFromObjectType);
50630
+ }
50618
50631
  return createTypeNodeFromObjectType(type2);
50619
50632
  }
50620
50633
  function shouldWriteTypeOfFunctionSymbol() {
@@ -61457,7 +61470,6 @@ ${lanes.join("\n")}
61457
61470
  ) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
61458
61471
  }
61459
61472
  function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
61460
- Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
61461
61473
  const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
61462
61474
  if (type.objectFlags & 32 /* Mapped */) {
61463
61475
  result.declaration = type.declaration;
@@ -64705,7 +64717,6 @@ ${lanes.join("\n")}
64705
64717
  const sourceObjectFlags = getObjectFlags(source2);
64706
64718
  const targetObjectFlags = getObjectFlags(target2);
64707
64719
  if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
64708
- Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
64709
64720
  for (let i = 0; i < targetSignatures.length; i++) {
64710
64721
  const related = signatureRelatedTo(
64711
64722
  sourceSignatures[i],
@@ -71932,8 +71943,21 @@ ${lanes.join("\n")}
71932
71943
  function getEnclosingClassFromThisParameter(node) {
71933
71944
  const thisParameter = getThisParameterFromNodeContext(node);
71934
71945
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
71935
- if (thisType && thisType.flags & 262144 /* TypeParameter */) {
71936
- thisType = getConstraintOfTypeParameter(thisType);
71946
+ if (thisType) {
71947
+ if (thisType.flags & 262144 /* TypeParameter */) {
71948
+ thisType = getConstraintOfTypeParameter(thisType);
71949
+ }
71950
+ } else {
71951
+ const thisContainer = getThisContainer(
71952
+ node,
71953
+ /*includeArrowFunctions*/
71954
+ false,
71955
+ /*includeClassComputedPropertyName*/
71956
+ false
71957
+ );
71958
+ if (isFunctionLike(thisContainer)) {
71959
+ thisType = getContextualThisParameterType(thisContainer);
71960
+ }
71937
71961
  }
71938
71962
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
71939
71963
  return getTargetType(thisType);
@@ -74923,7 +74947,14 @@ ${lanes.join("\n")}
74923
74947
  hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
74924
74948
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
74925
74949
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
74926
- const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
74950
+ const result3 = createAnonymousType(
74951
+ /*symbol*/
74952
+ void 0,
74953
+ resolved.members,
74954
+ callSignatures,
74955
+ constructSignatures,
74956
+ resolved.indexInfos
74957
+ );
74927
74958
  result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
74928
74959
  result3.node = node;
74929
74960
  return result3;
@@ -128604,6 +128635,66 @@ ${lanes.join("\n")}
128604
128635
  }
128605
128636
  });
128606
128637
 
128638
+ // src/jsTyping/shared.ts
128639
+ function hasArgument(argumentName) {
128640
+ return sys.args.includes(argumentName);
128641
+ }
128642
+ function findArgument(argumentName) {
128643
+ const index = sys.args.indexOf(argumentName);
128644
+ return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
128645
+ }
128646
+ function nowString() {
128647
+ const d = /* @__PURE__ */ new Date();
128648
+ return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
128649
+ }
128650
+ function indent2(str) {
128651
+ return indentStr + str.replace(/\n/g, indentStr);
128652
+ }
128653
+ function stringifyIndented(json) {
128654
+ return indent2(JSON.stringify(json, void 0, 2));
128655
+ }
128656
+ var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments, indentStr;
128657
+ var init_shared = __esm({
128658
+ "src/jsTyping/shared.ts"() {
128659
+ "use strict";
128660
+ init_ts3();
128661
+ ActionSet = "action::set";
128662
+ ActionInvalidate = "action::invalidate";
128663
+ ActionPackageInstalled = "action::packageInstalled";
128664
+ EventTypesRegistry = "event::typesRegistry";
128665
+ EventBeginInstallTypes = "event::beginInstallTypes";
128666
+ EventEndInstallTypes = "event::endInstallTypes";
128667
+ EventInitializationFailed = "event::initializationFailed";
128668
+ ActionWatchTypingLocations = "action::watchTypingLocations";
128669
+ ((Arguments2) => {
128670
+ Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
128671
+ Arguments2.LogFile = "--logFile";
128672
+ Arguments2.EnableTelemetry = "--enableTelemetry";
128673
+ Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
128674
+ Arguments2.TypesMapLocation = "--typesMapLocation";
128675
+ Arguments2.NpmLocation = "--npmLocation";
128676
+ Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
128677
+ })(Arguments || (Arguments = {}));
128678
+ indentStr = "\n ";
128679
+ }
128680
+ });
128681
+
128682
+ // src/jsTyping/types.ts
128683
+ var init_types2 = __esm({
128684
+ "src/jsTyping/types.ts"() {
128685
+ "use strict";
128686
+ }
128687
+ });
128688
+
128689
+ // src/jsTyping/_namespaces/ts.server.ts
128690
+ var init_ts_server = __esm({
128691
+ "src/jsTyping/_namespaces/ts.server.ts"() {
128692
+ "use strict";
128693
+ init_shared();
128694
+ init_types2();
128695
+ }
128696
+ });
128697
+
128607
128698
  // src/jsTyping/jsTyping.ts
128608
128699
  function isTypingUpToDate(cachedTyping, availableTypingVersions) {
128609
128700
  const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest"));
@@ -128658,21 +128749,21 @@ ${lanes.join("\n")}
128658
128749
  );
128659
128750
  addInferredTypings(module2, "Inferred typings from unresolved imports");
128660
128751
  }
128661
- packageNameToTypingLocation.forEach((typing, name) => {
128662
- const registryEntry = typesRegistry.get(name);
128663
- if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
128664
- inferredTypings.set(name, typing.typingLocation);
128665
- }
128666
- });
128667
128752
  for (const excludeTypingName of exclude) {
128668
128753
  const didDelete = inferredTypings.delete(excludeTypingName);
128669
128754
  if (didDelete && log)
128670
128755
  log(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`);
128671
128756
  }
128757
+ packageNameToTypingLocation.forEach((typing, name) => {
128758
+ const registryEntry = typesRegistry.get(name);
128759
+ if (inferredTypings.get(name) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
128760
+ inferredTypings.set(name, typing.typingLocation);
128761
+ }
128762
+ });
128672
128763
  const newTypingNames = [];
128673
128764
  const cachedTypingPaths = [];
128674
128765
  inferredTypings.forEach((inferred, typing) => {
128675
- if (inferred !== void 0) {
128766
+ if (inferred) {
128676
128767
  cachedTypingPaths.push(inferred);
128677
128768
  } else {
128678
128769
  newTypingNames.push(typing);
@@ -128680,11 +128771,11 @@ ${lanes.join("\n")}
128680
128771
  });
128681
128772
  const result = { cachedTypingPaths, newTypingNames, filesToWatch };
128682
128773
  if (log)
128683
- log(`Result: ${JSON.stringify(result)}`);
128774
+ log(`Finished typings discovery:${stringifyIndented(result)}`);
128684
128775
  return result;
128685
128776
  function addInferredTyping(typingName) {
128686
128777
  if (!inferredTypings.has(typingName)) {
128687
- inferredTypings.set(typingName, void 0);
128778
+ inferredTypings.set(typingName, false);
128688
128779
  }
128689
128780
  }
128690
128781
  function addInferredTypings(typingNames, message) {
@@ -128851,6 +128942,7 @@ ${lanes.join("\n")}
128851
128942
  "src/jsTyping/jsTyping.ts"() {
128852
128943
  "use strict";
128853
128944
  init_ts3();
128945
+ init_ts_server();
128854
128946
  unprefixedNodeCoreModuleList = [
128855
128947
  "assert",
128856
128948
  "assert/strict",
@@ -128938,59 +129030,6 @@ ${lanes.join("\n")}
128938
129030
  }
128939
129031
  });
128940
129032
 
128941
- // src/jsTyping/shared.ts
128942
- function hasArgument(argumentName) {
128943
- return sys.args.includes(argumentName);
128944
- }
128945
- function findArgument(argumentName) {
128946
- const index = sys.args.indexOf(argumentName);
128947
- return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
128948
- }
128949
- function nowString() {
128950
- const d = /* @__PURE__ */ new Date();
128951
- return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
128952
- }
128953
- var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments;
128954
- var init_shared = __esm({
128955
- "src/jsTyping/shared.ts"() {
128956
- "use strict";
128957
- init_ts3();
128958
- ActionSet = "action::set";
128959
- ActionInvalidate = "action::invalidate";
128960
- ActionPackageInstalled = "action::packageInstalled";
128961
- EventTypesRegistry = "event::typesRegistry";
128962
- EventBeginInstallTypes = "event::beginInstallTypes";
128963
- EventEndInstallTypes = "event::endInstallTypes";
128964
- EventInitializationFailed = "event::initializationFailed";
128965
- ActionWatchTypingLocations = "action::watchTypingLocations";
128966
- ((Arguments2) => {
128967
- Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
128968
- Arguments2.LogFile = "--logFile";
128969
- Arguments2.EnableTelemetry = "--enableTelemetry";
128970
- Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
128971
- Arguments2.TypesMapLocation = "--typesMapLocation";
128972
- Arguments2.NpmLocation = "--npmLocation";
128973
- Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
128974
- })(Arguments || (Arguments = {}));
128975
- }
128976
- });
128977
-
128978
- // src/jsTyping/types.ts
128979
- var init_types2 = __esm({
128980
- "src/jsTyping/types.ts"() {
128981
- "use strict";
128982
- }
128983
- });
128984
-
128985
- // src/jsTyping/_namespaces/ts.server.ts
128986
- var init_ts_server = __esm({
128987
- "src/jsTyping/_namespaces/ts.server.ts"() {
128988
- "use strict";
128989
- init_shared();
128990
- init_types2();
128991
- }
128992
- });
128993
-
128994
129033
  // src/jsTyping/_namespaces/ts.ts
128995
129034
  var init_ts3 = __esm({
128996
129035
  "src/jsTyping/_namespaces/ts.ts"() {
@@ -171907,7 +171946,7 @@ ${options.prefix}` : "\n" : options.prefix
171907
171946
  }
171908
171947
  install(req) {
171909
171948
  if (this.log.isEnabled()) {
171910
- this.log.writeLine(`Got install request ${JSON.stringify(req)}`);
171949
+ this.log.writeLine(`Got install request${stringifyIndented(req)}`);
171911
171950
  }
171912
171951
  if (req.cachePath) {
171913
171952
  if (this.log.isEnabled()) {
@@ -171930,9 +171969,6 @@ ${options.prefix}` : "\n" : options.prefix
171930
171969
  this.typesRegistry,
171931
171970
  req.compilerOptions
171932
171971
  );
171933
- if (this.log.isEnabled()) {
171934
- this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`);
171935
- }
171936
171972
  this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch);
171937
171973
  if (discoverTypingsResult.newTypingNames.length) {
171938
171974
  this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames);
@@ -171974,8 +172010,8 @@ ${options.prefix}` : "\n" : options.prefix
171974
172010
  const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson));
171975
172011
  const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson));
171976
172012
  if (this.log.isEnabled()) {
171977
- this.log.writeLine(`Loaded content of '${packageJson}': ${JSON.stringify(npmConfig)}`);
171978
- this.log.writeLine(`Loaded content of '${packageLockJson}'`);
172013
+ this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`);
172014
+ this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`);
171979
172015
  }
171980
172016
  if (npmConfig.devDependencies && npmLock.dependencies) {
171981
172017
  for (const key in npmConfig.devDependencies) {
@@ -172322,13 +172358,7 @@ ${options.prefix}` : "\n" : options.prefix
172322
172358
  array.splice(removeIndex, 1);
172323
172359
  }
172324
172360
  }
172325
- function indent2(str) {
172326
- return indentStr + str.replace(/\n/g, indentStr);
172327
- }
172328
- function stringifyIndented(json) {
172329
- return indentStr + JSON.stringify(json);
172330
- }
172331
- var ThrottledOperations, GcTimer, indentStr;
172361
+ var ThrottledOperations, GcTimer;
172332
172362
  var init_utilities5 = __esm({
172333
172363
  "src/server/utilities.ts"() {
172334
172364
  "use strict";
@@ -172400,7 +172430,6 @@ ${options.prefix}` : "\n" : options.prefix
172400
172430
  (_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
172401
172431
  }
172402
172432
  };
172403
- indentStr = "\n ";
172404
172433
  }
172405
172434
  });
172406
172435
 
@@ -175302,9 +175331,6 @@ ${options.prefix}` : "\n" : options.prefix
175302
175331
  includePackageJsonAutoImports() {
175303
175332
  return 0 /* Off */;
175304
175333
  }
175305
- getTypeAcquisition() {
175306
- return { enable: false };
175307
- }
175308
175334
  /** @internal */
175309
175335
  getSymlinkCache() {
175310
175336
  return this.hostProject.getSymlinkCache();
@@ -179233,7 +179259,7 @@ Dynamic files must always be opened with service's current directory or service
179233
179259
  const verboseLogging = logger.hasLevel(3 /* verbose */);
179234
179260
  const json = JSON.stringify(msg);
179235
179261
  if (verboseLogging) {
179236
- logger.info(`${msg.type}:${indent2(JSON.stringify(msg, void 0, " "))}`);
179262
+ logger.info(`${msg.type}:${stringifyIndented(msg)}`);
179237
179263
  }
179238
179264
  const len = byteLength(json, "utf8");
179239
179265
  return `Content-Length: ${1 + len}\r
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20231011`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231013`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -24111,20 +24111,20 @@ var Parser;
24111
24111
  function doJSDocScan() {
24112
24112
  let state = 1 /* SawAsterisk */;
24113
24113
  let margin;
24114
- let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
24114
+ let indent3 = start - (content.lastIndexOf("\n", start) + 1) + 4;
24115
24115
  function pushComment(text) {
24116
24116
  if (!margin) {
24117
- margin = indent2;
24117
+ margin = indent3;
24118
24118
  }
24119
24119
  comments.push(text);
24120
- indent2 += text.length;
24120
+ indent3 += text.length;
24121
24121
  }
24122
24122
  nextTokenJSDoc();
24123
24123
  while (parseOptionalJsdoc(5 /* WhitespaceTrivia */))
24124
24124
  ;
24125
24125
  if (parseOptionalJsdoc(4 /* NewLineTrivia */)) {
24126
24126
  state = 0 /* BeginningOfLine */;
24127
- indent2 = 0;
24127
+ indent3 = 0;
24128
24128
  }
24129
24129
  loop:
24130
24130
  while (true) {
@@ -24133,14 +24133,14 @@ var Parser;
24133
24133
  removeTrailingWhitespace(comments);
24134
24134
  if (!commentsPos)
24135
24135
  commentsPos = getNodePos();
24136
- addTag(parseTag(indent2));
24136
+ addTag(parseTag(indent3));
24137
24137
  state = 0 /* BeginningOfLine */;
24138
24138
  margin = void 0;
24139
24139
  break;
24140
24140
  case 4 /* NewLineTrivia */:
24141
24141
  comments.push(scanner.getTokenText());
24142
24142
  state = 0 /* BeginningOfLine */;
24143
- indent2 = 0;
24143
+ indent3 = 0;
24144
24144
  break;
24145
24145
  case 42 /* AsteriskToken */:
24146
24146
  const asterisk = scanner.getTokenText();
@@ -24150,16 +24150,16 @@ var Parser;
24150
24150
  } else {
24151
24151
  Debug.assert(state === 0 /* BeginningOfLine */);
24152
24152
  state = 1 /* SawAsterisk */;
24153
- indent2 += asterisk.length;
24153
+ indent3 += asterisk.length;
24154
24154
  }
24155
24155
  break;
24156
24156
  case 5 /* WhitespaceTrivia */:
24157
24157
  Debug.assert(state !== 2 /* SavingComments */, "whitespace shouldn't come from the scanner while saving top-level comment text");
24158
24158
  const whitespace = scanner.getTokenText();
24159
- if (margin !== void 0 && indent2 + whitespace.length > margin) {
24160
- comments.push(whitespace.slice(margin - indent2));
24159
+ if (margin !== void 0 && indent3 + whitespace.length > margin) {
24160
+ comments.push(whitespace.slice(margin - indent3));
24161
24161
  }
24162
- indent2 += whitespace.length;
24162
+ indent3 += whitespace.length;
24163
24163
  break;
24164
24164
  case 1 /* EndOfFileToken */:
24165
24165
  break loop;
@@ -24361,7 +24361,7 @@ var Parser;
24361
24361
  }
24362
24362
  return parseTagComments(margin, indentText.slice(margin));
24363
24363
  }
24364
- function parseTagComments(indent2, initialMargin) {
24364
+ function parseTagComments(indent3, initialMargin) {
24365
24365
  const commentsPos2 = getNodePos();
24366
24366
  let comments2 = [];
24367
24367
  const parts2 = [];
@@ -24370,10 +24370,10 @@ var Parser;
24370
24370
  let margin;
24371
24371
  function pushComment(text) {
24372
24372
  if (!margin) {
24373
- margin = indent2;
24373
+ margin = indent3;
24374
24374
  }
24375
24375
  comments2.push(text);
24376
- indent2 += text.length;
24376
+ indent3 += text.length;
24377
24377
  }
24378
24378
  if (initialMargin !== void 0) {
24379
24379
  if (initialMargin !== "") {
@@ -24388,7 +24388,7 @@ var Parser;
24388
24388
  case 4 /* NewLineTrivia */:
24389
24389
  state = 0 /* BeginningOfLine */;
24390
24390
  comments2.push(scanner.getTokenText());
24391
- indent2 = 0;
24391
+ indent3 = 0;
24392
24392
  break;
24393
24393
  case 60 /* AtToken */:
24394
24394
  scanner.resetTokenState(scanner.getTokenEnd() - 1);
@@ -24398,11 +24398,11 @@ var Parser;
24398
24398
  case 5 /* WhitespaceTrivia */:
24399
24399
  Debug.assert(state !== 2 /* SavingComments */ && state !== 3 /* SavingBackticks */, "whitespace shouldn't come from the scanner while saving comment text");
24400
24400
  const whitespace = scanner.getTokenText();
24401
- if (margin !== void 0 && indent2 + whitespace.length > margin) {
24402
- comments2.push(whitespace.slice(margin - indent2));
24401
+ if (margin !== void 0 && indent3 + whitespace.length > margin) {
24402
+ comments2.push(whitespace.slice(margin - indent3));
24403
24403
  state = 2 /* SavingComments */;
24404
24404
  }
24405
- indent2 += whitespace.length;
24405
+ indent3 += whitespace.length;
24406
24406
  break;
24407
24407
  case 19 /* OpenBraceToken */:
24408
24408
  state = 2 /* SavingComments */;
@@ -24435,7 +24435,7 @@ var Parser;
24435
24435
  case 42 /* AsteriskToken */:
24436
24436
  if (state === 0 /* BeginningOfLine */) {
24437
24437
  state = 1 /* SawAsterisk */;
24438
- indent2 += 1;
24438
+ indent3 += 1;
24439
24439
  break;
24440
24440
  }
24441
24441
  default:
@@ -24500,8 +24500,8 @@ var Parser;
24500
24500
  function isJSDocLinkTag(kind) {
24501
24501
  return kind === "link" || kind === "linkcode" || kind === "linkplain";
24502
24502
  }
24503
- function parseUnknownTag(start2, tagName, indent2, indentText) {
24504
- return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
24503
+ function parseUnknownTag(start2, tagName, indent3, indentText) {
24504
+ return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2);
24505
24505
  }
24506
24506
  function addTag(tag) {
24507
24507
  if (!tag) {
@@ -24548,7 +24548,7 @@ var Parser;
24548
24548
  return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
24549
24549
  }
24550
24550
  }
24551
- function parseParameterOrPropertyTag(start2, tagName, target, indent2) {
24551
+ function parseParameterOrPropertyTag(start2, tagName, target, indent3) {
24552
24552
  let typeExpression = tryParseTypeExpression();
24553
24553
  let isNameFirst = !typeExpression;
24554
24554
  skipWhitespaceOrAsterisk();
@@ -24557,8 +24557,8 @@ var Parser;
24557
24557
  if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) {
24558
24558
  typeExpression = tryParseTypeExpression();
24559
24559
  }
24560
- const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
24561
- const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent2);
24560
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText);
24561
+ const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent3);
24562
24562
  if (nestedTypeLiteral) {
24563
24563
  typeExpression = nestedTypeLiteral;
24564
24564
  isNameFirst = true;
@@ -24566,12 +24566,12 @@ var Parser;
24566
24566
  const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
24567
24567
  return finishNode(result2, start2);
24568
24568
  }
24569
- function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
24569
+ function parseNestedTypeLiteral(typeExpression, name, target, indent3) {
24570
24570
  if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
24571
24571
  const pos = getNodePos();
24572
24572
  let child;
24573
24573
  let children;
24574
- while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
24574
+ while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) {
24575
24575
  if (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) {
24576
24576
  children = append(children, child);
24577
24577
  } else if (child.kind === 352 /* JSDocTemplateTag */) {
@@ -24584,14 +24584,14 @@ var Parser;
24584
24584
  }
24585
24585
  }
24586
24586
  }
24587
- function parseReturnTag(start2, tagName, indent2, indentText) {
24587
+ function parseReturnTag(start2, tagName, indent3, indentText) {
24588
24588
  if (some(tags, isJSDocReturnTag)) {
24589
24589
  parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
24590
24590
  }
24591
24591
  const typeExpression = tryParseTypeExpression();
24592
- return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
24592
+ return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2);
24593
24593
  }
24594
- function parseTypeTag(start2, tagName, indent2, indentText) {
24594
+ function parseTypeTag(start2, tagName, indent3, indentText) {
24595
24595
  if (some(tags, isJSDocTypeTag)) {
24596
24596
  parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
24597
24597
  }
@@ -24599,25 +24599,25 @@ var Parser;
24599
24599
  /*mayOmitBraces*/
24600
24600
  true
24601
24601
  );
24602
- const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
24602
+ const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0;
24603
24603
  return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2);
24604
24604
  }
24605
- function parseSeeTag(start2, tagName, indent2, indentText) {
24605
+ function parseSeeTag(start2, tagName, indent3, indentText) {
24606
24606
  const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()));
24607
24607
  const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference();
24608
- const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
24608
+ const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0;
24609
24609
  return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
24610
24610
  }
24611
- function parseThrowsTag(start2, tagName, indent2, indentText) {
24611
+ function parseThrowsTag(start2, tagName, indent3, indentText) {
24612
24612
  const typeExpression = tryParseTypeExpression();
24613
- const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
24613
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText);
24614
24614
  return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
24615
24615
  }
24616
- function parseAuthorTag(start2, tagName, indent2, indentText) {
24616
+ function parseAuthorTag(start2, tagName, indent3, indentText) {
24617
24617
  const commentStart = getNodePos();
24618
24618
  const textOnly = parseAuthorNameAndEmail();
24619
24619
  let commentEnd = scanner.getTokenFullStart();
24620
- const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText);
24620
+ const comments2 = parseTrailingTagComments(start2, commentEnd, indent3, indentText);
24621
24621
  if (!comments2) {
24622
24622
  commentEnd = scanner.getTokenFullStart();
24623
24623
  }
@@ -24701,19 +24701,19 @@ var Parser;
24701
24701
  skipWhitespace();
24702
24702
  return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
24703
24703
  }
24704
- function parseTypedefTag(start2, tagName, indent2, indentText) {
24704
+ function parseTypedefTag(start2, tagName, indent3, indentText) {
24705
24705
  let typeExpression = tryParseTypeExpression();
24706
24706
  skipWhitespaceOrAsterisk();
24707
24707
  const fullName = parseJSDocTypeNameWithNamespace();
24708
24708
  skipWhitespace();
24709
- let comment = parseTagComments(indent2);
24709
+ let comment = parseTagComments(indent3);
24710
24710
  let end2;
24711
24711
  if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) {
24712
24712
  let child;
24713
24713
  let childTypeTag;
24714
24714
  let jsDocPropertyTags;
24715
24715
  let hasChildren = false;
24716
- while (child = tryParse(() => parseChildPropertyTag(indent2))) {
24716
+ while (child = tryParse(() => parseChildPropertyTag(indent3))) {
24717
24717
  if (child.kind === 352 /* JSDocTemplateTag */) {
24718
24718
  break;
24719
24719
  }
@@ -24741,7 +24741,7 @@ var Parser;
24741
24741
  }
24742
24742
  end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end;
24743
24743
  if (!comment) {
24744
- comment = parseTrailingTagComments(start2, end2, indent2, indentText);
24744
+ comment = parseTrailingTagComments(start2, end2, indent3, indentText);
24745
24745
  }
24746
24746
  const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
24747
24747
  return finishNode(typedefTag, start2, end2);
@@ -24771,11 +24771,11 @@ var Parser;
24771
24771
  }
24772
24772
  return typeNameOrNamespaceName;
24773
24773
  }
24774
- function parseCallbackTagParameters(indent2) {
24774
+ function parseCallbackTagParameters(indent3) {
24775
24775
  const pos = getNodePos();
24776
24776
  let child;
24777
24777
  let parameters;
24778
- while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
24778
+ while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) {
24779
24779
  if (child.kind === 352 /* JSDocTemplateTag */) {
24780
24780
  parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
24781
24781
  break;
@@ -24784,11 +24784,11 @@ var Parser;
24784
24784
  }
24785
24785
  return createNodeArray(parameters || [], pos);
24786
24786
  }
24787
- function parseJSDocSignature(start2, indent2) {
24788
- const parameters = parseCallbackTagParameters(indent2);
24787
+ function parseJSDocSignature(start2, indent3) {
24788
+ const parameters = parseCallbackTagParameters(indent3);
24789
24789
  const returnTag = tryParse(() => {
24790
24790
  if (parseOptionalJsdoc(60 /* AtToken */)) {
24791
- const tag = parseTag(indent2);
24791
+ const tag = parseTag(indent3);
24792
24792
  if (tag && tag.kind === 349 /* JSDocReturnTag */) {
24793
24793
  return tag;
24794
24794
  }
@@ -24801,23 +24801,23 @@ var Parser;
24801
24801
  returnTag
24802
24802
  ), start2);
24803
24803
  }
24804
- function parseCallbackTag(start2, tagName, indent2, indentText) {
24804
+ function parseCallbackTag(start2, tagName, indent3, indentText) {
24805
24805
  const fullName = parseJSDocTypeNameWithNamespace();
24806
24806
  skipWhitespace();
24807
- let comment = parseTagComments(indent2);
24808
- const typeExpression = parseJSDocSignature(start2, indent2);
24807
+ let comment = parseTagComments(indent3);
24808
+ const typeExpression = parseJSDocSignature(start2, indent3);
24809
24809
  if (!comment) {
24810
- comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
24810
+ comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText);
24811
24811
  }
24812
24812
  const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
24813
24813
  return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
24814
24814
  }
24815
- function parseOverloadTag(start2, tagName, indent2, indentText) {
24815
+ function parseOverloadTag(start2, tagName, indent3, indentText) {
24816
24816
  skipWhitespace();
24817
- let comment = parseTagComments(indent2);
24818
- const typeExpression = parseJSDocSignature(start2, indent2);
24817
+ let comment = parseTagComments(indent3);
24818
+ const typeExpression = parseJSDocSignature(start2, indent3);
24819
24819
  if (!comment) {
24820
- comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
24820
+ comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText);
24821
24821
  }
24822
24822
  const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
24823
24823
  return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
@@ -24833,17 +24833,17 @@ var Parser;
24833
24833
  }
24834
24834
  return a.escapedText === b.escapedText;
24835
24835
  }
24836
- function parseChildPropertyTag(indent2) {
24837
- return parseChildParameterOrPropertyTag(1 /* Property */, indent2);
24836
+ function parseChildPropertyTag(indent3) {
24837
+ return parseChildParameterOrPropertyTag(1 /* Property */, indent3);
24838
24838
  }
24839
- function parseChildParameterOrPropertyTag(target, indent2, name) {
24839
+ function parseChildParameterOrPropertyTag(target, indent3, name) {
24840
24840
  let canParseTag = true;
24841
24841
  let seenAsterisk = false;
24842
24842
  while (true) {
24843
24843
  switch (nextTokenJSDoc()) {
24844
24844
  case 60 /* AtToken */:
24845
24845
  if (canParseTag) {
24846
- const child = tryParseChildTag(target, indent2);
24846
+ const child = tryParseChildTag(target, indent3);
24847
24847
  if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
24848
24848
  return false;
24849
24849
  }
@@ -24869,7 +24869,7 @@ var Parser;
24869
24869
  }
24870
24870
  }
24871
24871
  }
24872
- function tryParseChildTag(target, indent2) {
24872
+ function tryParseChildTag(target, indent3) {
24873
24873
  Debug.assert(token() === 60 /* AtToken */);
24874
24874
  const start2 = scanner.getTokenFullStart();
24875
24875
  nextTokenJSDoc();
@@ -24889,14 +24889,14 @@ var Parser;
24889
24889
  t = 2 /* Parameter */ | 4 /* CallbackParameter */;
24890
24890
  break;
24891
24891
  case "template":
24892
- return parseTemplateTag(start2, tagName, indent2, indentText);
24892
+ return parseTemplateTag(start2, tagName, indent3, indentText);
24893
24893
  default:
24894
24894
  return false;
24895
24895
  }
24896
24896
  if (!(target & t)) {
24897
24897
  return false;
24898
24898
  }
24899
- return parseParameterOrPropertyTag(start2, tagName, target, indent2);
24899
+ return parseParameterOrPropertyTag(start2, tagName, target, indent3);
24900
24900
  }
24901
24901
  function parseTemplateTagTypeParameter() {
24902
24902
  const typeParameterPos = getNodePos();
@@ -24937,10 +24937,10 @@ var Parser;
24937
24937
  } while (parseOptionalJsdoc(28 /* CommaToken */));
24938
24938
  return createNodeArray(typeParameters, pos);
24939
24939
  }
24940
- function parseTemplateTag(start2, tagName, indent2, indentText) {
24940
+ function parseTemplateTag(start2, tagName, indent3, indentText) {
24941
24941
  const constraint = token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0;
24942
24942
  const typeParameters = parseTemplateTagTypeParameters();
24943
- return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
24943
+ return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2);
24944
24944
  }
24945
24945
  function parseOptionalJsdoc(t) {
24946
24946
  if (token() === t) {
@@ -31404,6 +31404,42 @@ __export(ts_JsTyping_exports, {
31404
31404
  validatePackageName: () => validatePackageName
31405
31405
  });
31406
31406
 
31407
+ // src/jsTyping/shared.ts
31408
+ var ActionSet = "action::set";
31409
+ var ActionPackageInstalled = "action::packageInstalled";
31410
+ var EventTypesRegistry = "event::typesRegistry";
31411
+ var EventBeginInstallTypes = "event::beginInstallTypes";
31412
+ var EventEndInstallTypes = "event::endInstallTypes";
31413
+ var ActionWatchTypingLocations = "action::watchTypingLocations";
31414
+ var Arguments;
31415
+ ((Arguments2) => {
31416
+ Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
31417
+ Arguments2.LogFile = "--logFile";
31418
+ Arguments2.EnableTelemetry = "--enableTelemetry";
31419
+ Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
31420
+ Arguments2.TypesMapLocation = "--typesMapLocation";
31421
+ Arguments2.NpmLocation = "--npmLocation";
31422
+ Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
31423
+ })(Arguments || (Arguments = {}));
31424
+ function hasArgument(argumentName) {
31425
+ return sys.args.includes(argumentName);
31426
+ }
31427
+ function findArgument(argumentName) {
31428
+ const index = sys.args.indexOf(argumentName);
31429
+ return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
31430
+ }
31431
+ function nowString() {
31432
+ const d = /* @__PURE__ */ new Date();
31433
+ return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
31434
+ }
31435
+ var indentStr = "\n ";
31436
+ function indent(str) {
31437
+ return indentStr + str.replace(/\n/g, indentStr);
31438
+ }
31439
+ function stringifyIndented(json) {
31440
+ return indent(JSON.stringify(json, void 0, 2));
31441
+ }
31442
+
31407
31443
  // src/jsTyping/jsTyping.ts
31408
31444
  function isTypingUpToDate(cachedTyping, availableTypingVersions) {
31409
31445
  const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest"));
@@ -31510,21 +31546,21 @@ function discoverTypings(host, log2, fileNames, projectRootPath, safeList, packa
31510
31546
  );
31511
31547
  addInferredTypings(module2, "Inferred typings from unresolved imports");
31512
31548
  }
31513
- packageNameToTypingLocation.forEach((typing, name) => {
31514
- const registryEntry = typesRegistry.get(name);
31515
- if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
31516
- inferredTypings.set(name, typing.typingLocation);
31517
- }
31518
- });
31519
31549
  for (const excludeTypingName of exclude) {
31520
31550
  const didDelete = inferredTypings.delete(excludeTypingName);
31521
31551
  if (didDelete && log2)
31522
31552
  log2(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`);
31523
31553
  }
31554
+ packageNameToTypingLocation.forEach((typing, name) => {
31555
+ const registryEntry = typesRegistry.get(name);
31556
+ if (inferredTypings.get(name) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) {
31557
+ inferredTypings.set(name, typing.typingLocation);
31558
+ }
31559
+ });
31524
31560
  const newTypingNames = [];
31525
31561
  const cachedTypingPaths = [];
31526
31562
  inferredTypings.forEach((inferred, typing) => {
31527
- if (inferred !== void 0) {
31563
+ if (inferred) {
31528
31564
  cachedTypingPaths.push(inferred);
31529
31565
  } else {
31530
31566
  newTypingNames.push(typing);
@@ -31532,11 +31568,11 @@ function discoverTypings(host, log2, fileNames, projectRootPath, safeList, packa
31532
31568
  });
31533
31569
  const result = { cachedTypingPaths, newTypingNames, filesToWatch };
31534
31570
  if (log2)
31535
- log2(`Result: ${JSON.stringify(result)}`);
31571
+ log2(`Finished typings discovery:${stringifyIndented(result)}`);
31536
31572
  return result;
31537
31573
  function addInferredTyping(typingName) {
31538
31574
  if (!inferredTypings.has(typingName)) {
31539
- inferredTypings.set(typingName, void 0);
31575
+ inferredTypings.set(typingName, false);
31540
31576
  }
31541
31577
  }
31542
31578
  function addInferredTypings(typingNames, message) {
@@ -31709,35 +31745,6 @@ function renderPackageNameValidationFailureWorker(typing, result, name, isScopeN
31709
31745
  }
31710
31746
  }
31711
31747
 
31712
- // src/jsTyping/shared.ts
31713
- var ActionSet = "action::set";
31714
- var ActionPackageInstalled = "action::packageInstalled";
31715
- var EventTypesRegistry = "event::typesRegistry";
31716
- var EventBeginInstallTypes = "event::beginInstallTypes";
31717
- var EventEndInstallTypes = "event::endInstallTypes";
31718
- var ActionWatchTypingLocations = "action::watchTypingLocations";
31719
- var Arguments;
31720
- ((Arguments2) => {
31721
- Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation";
31722
- Arguments2.LogFile = "--logFile";
31723
- Arguments2.EnableTelemetry = "--enableTelemetry";
31724
- Arguments2.TypingSafeListLocation = "--typingSafeListLocation";
31725
- Arguments2.TypesMapLocation = "--typesMapLocation";
31726
- Arguments2.NpmLocation = "--npmLocation";
31727
- Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
31728
- })(Arguments || (Arguments = {}));
31729
- function hasArgument(argumentName) {
31730
- return sys.args.includes(argumentName);
31731
- }
31732
- function findArgument(argumentName) {
31733
- const index = sys.args.indexOf(argumentName);
31734
- return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0;
31735
- }
31736
- function nowString() {
31737
- const d = /* @__PURE__ */ new Date();
31738
- return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
31739
- }
31740
-
31741
31748
  // src/typingsInstallerCore/typingsInstaller.ts
31742
31749
  var nullLog = {
31743
31750
  isEnabled: () => false,
@@ -31820,7 +31827,7 @@ var TypingsInstaller = class {
31820
31827
  }
31821
31828
  install(req) {
31822
31829
  if (this.log.isEnabled()) {
31823
- this.log.writeLine(`Got install request ${JSON.stringify(req)}`);
31830
+ this.log.writeLine(`Got install request${stringifyIndented(req)}`);
31824
31831
  }
31825
31832
  if (req.cachePath) {
31826
31833
  if (this.log.isEnabled()) {
@@ -31843,9 +31850,6 @@ var TypingsInstaller = class {
31843
31850
  this.typesRegistry,
31844
31851
  req.compilerOptions
31845
31852
  );
31846
- if (this.log.isEnabled()) {
31847
- this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`);
31848
- }
31849
31853
  this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch);
31850
31854
  if (discoverTypingsResult.newTypingNames.length) {
31851
31855
  this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames);
@@ -31887,8 +31891,8 @@ var TypingsInstaller = class {
31887
31891
  const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson));
31888
31892
  const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson));
31889
31893
  if (this.log.isEnabled()) {
31890
- this.log.writeLine(`Loaded content of '${packageJson}': ${JSON.stringify(npmConfig)}`);
31891
- this.log.writeLine(`Loaded content of '${packageLockJson}'`);
31894
+ this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`);
31895
+ this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`);
31892
31896
  }
31893
31897
  if (npmConfig.devDependencies && npmLock.dependencies) {
31894
31898
  for (const key in npmConfig.devDependencies) {
@@ -32226,8 +32230,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
32226
32230
  }
32227
32231
  sendResponse(response) {
32228
32232
  if (this.log.isEnabled()) {
32229
- this.log.writeLine(`Sending response:
32230
- ${JSON.stringify(response)}`);
32233
+ this.log.writeLine(`Sending response:${stringifyIndented(response)}`);
32231
32234
  }
32232
32235
  process.send(response);
32233
32236
  if (this.log.isEnabled()) {
@@ -32253,12 +32256,12 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
32253
32256
  try {
32254
32257
  const stdout = this.nodeExecSync(command, { ...options, encoding: "utf-8" });
32255
32258
  if (this.log.isEnabled()) {
32256
- this.log.writeLine(` Succeeded. stdout:${indent(sys.newLine, stdout)}`);
32259
+ this.log.writeLine(` Succeeded. stdout:${indent2(sys.newLine, stdout)}`);
32257
32260
  }
32258
32261
  return false;
32259
32262
  } catch (error) {
32260
32263
  const { stdout, stderr } = error;
32261
- this.log.writeLine(` Failed. stdout:${indent(sys.newLine, stdout)}${sys.newLine} stderr:${indent(sys.newLine, stderr)}`);
32264
+ this.log.writeLine(` Failed. stdout:${indent2(sys.newLine, stdout)}${sys.newLine} stderr:${indent2(sys.newLine, stderr)}`);
32262
32265
  return true;
32263
32266
  }
32264
32267
  }
@@ -32302,7 +32305,7 @@ process.on("message", (req) => {
32302
32305
  ));
32303
32306
  installer.handleRequest(req);
32304
32307
  });
32305
- function indent(newline, str) {
32308
+ function indent2(newline, str) {
32306
32309
  return str && str.length ? `${newline} ` + str.replace(/\r?\n/, `${newline} `) : "";
32307
32310
  }
32308
32311
  // Annotate the CommonJS export names for ESM import in node:
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.3.0-pr-56064-15",
5
+ "version": "5.3.0-pr-56105-6",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "ae08d55687a71a017681b3ffbd701c119b1d3a76"
118
+ "gitHead": "566459088f5187e53c11777b58ecce6f3f3e0bea"
119
119
  }