typescript 5.1.0-dev.20230417 → 5.1.0-dev.20230418

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 CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.1";
21
- var version = `${versionMajorMinor}.0-dev.20230417`;
21
+ var version = `${versionMajorMinor}.0-dev.20230418`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -37633,22 +37633,22 @@ var nodeModulesPathPart = "/node_modules/";
37633
37633
  function pathContainsNodeModules(path) {
37634
37634
  return stringContains(path, nodeModulesPathPart);
37635
37635
  }
37636
- function parseNodeModuleFromPath(resolved) {
37636
+ function parseNodeModuleFromPath(resolved, isFolder) {
37637
37637
  const path = normalizePath(resolved);
37638
37638
  const idx = path.lastIndexOf(nodeModulesPathPart);
37639
37639
  if (idx === -1) {
37640
37640
  return void 0;
37641
37641
  }
37642
37642
  const indexAfterNodeModules = idx + nodeModulesPathPart.length;
37643
- let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules);
37643
+ let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules, isFolder);
37644
37644
  if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) {
37645
- indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
37645
+ indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName, isFolder);
37646
37646
  }
37647
37647
  return path.slice(0, indexAfterPackageName);
37648
37648
  }
37649
- function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
37649
+ function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex, isFolder) {
37650
37650
  const nextSeparatorIndex = path.indexOf(directorySeparator, prevSeparatorIndex + 1);
37651
- return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
37651
+ return nextSeparatorIndex === -1 ? isFolder ? path.length : prevSeparatorIndex : nextSeparatorIndex;
37652
37652
  }
37653
37653
  function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
37654
37654
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
@@ -39024,7 +39024,7 @@ function createBinder() {
39024
39024
  return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText);
39025
39025
  }
39026
39026
  if (isJsxNamespacedName(name)) {
39027
- return getEscapedTextOfJsxAttributeName(name);
39027
+ return getEscapedTextOfJsxNamespacedName(name);
39028
39028
  }
39029
39029
  return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
39030
39030
  }
@@ -66895,7 +66895,7 @@ function createTypeChecker(host) {
66895
66895
  return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : void 0;
66896
66896
  }
66897
66897
  function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
66898
- const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
66898
+ const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags);
66899
66899
  const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
66900
66900
  if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
66901
66901
  return void 0;
@@ -118493,6 +118493,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118493
118493
  reusedNames,
118494
118494
  loader,
118495
118495
  getResolutionWithResolvedFileName,
118496
+ deferWatchingNonRelativeResolution,
118496
118497
  shouldRetryResolution,
118497
118498
  logChanges
118498
118499
  }) {
@@ -118517,7 +118518,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118517
118518
  resolutionHost.onDiscoveredSymlink();
118518
118519
  }
118519
118520
  resolutionsInFile.set(name, mode, resolution);
118520
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
118521
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
118521
118522
  if (existingResolution) {
118522
118523
  stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
118523
118524
  }
@@ -118593,7 +118594,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118593
118594
  typeReferenceDirectiveResolutionCache
118594
118595
  ),
118595
118596
  getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
118596
- shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
118597
+ shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
118598
+ deferWatchingNonRelativeResolution: false
118597
118599
  });
118598
118600
  }
118599
118601
  function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
@@ -118612,7 +118614,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118612
118614
  ),
118613
118615
  getResolutionWithResolvedFileName: getResolvedModule2,
118614
118616
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
118615
- logChanges: logChangesWhenResolvingModule
118617
+ logChanges: logChangesWhenResolvingModule,
118618
+ deferWatchingNonRelativeResolution: true
118619
+ // Defer non relative resolution watch because we could be using ambient modules
118616
118620
  });
118617
118621
  }
118618
118622
  function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
@@ -118630,7 +118634,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118630
118634
  function isNodeModulesAtTypesDirectory(dirPath) {
118631
118635
  return endsWith(dirPath, "/node_modules/@types");
118632
118636
  }
118633
- function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
118637
+ function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
118634
118638
  var _a;
118635
118639
  if (resolution.refCount) {
118636
118640
  resolution.refCount++;
@@ -118638,7 +118642,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118638
118642
  } else {
118639
118643
  resolution.refCount = 1;
118640
118644
  Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
118641
- if (isExternalModuleNameRelative(name)) {
118645
+ if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
118642
118646
  watchFailedLookupLocationOfResolution(resolution);
118643
118647
  } else {
118644
118648
  nonRelativeExternalModuleResolutions.add(name, resolution);
@@ -118918,7 +118922,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
118918
118922
  return false;
118919
118923
  }
118920
118924
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
118921
- const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath);
118925
+ const packagePath = parseNodeModuleFromPath(
118926
+ fileOrDirectoryPath,
118927
+ /*isFolder*/
118928
+ true
118929
+ );
118922
118930
  if (packagePath)
118923
118931
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath);
118924
118932
  }
package/lib/tsserver.js CHANGED
@@ -2301,7 +2301,7 @@ module.exports = __toCommonJS(server_exports);
2301
2301
 
2302
2302
  // src/compiler/corePublic.ts
2303
2303
  var versionMajorMinor = "5.1";
2304
- var version = `${versionMajorMinor}.0-dev.20230417`;
2304
+ var version = `${versionMajorMinor}.0-dev.20230418`;
2305
2305
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2306
2306
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2307
2307
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -42132,22 +42132,22 @@ var nodeModulesPathPart = "/node_modules/";
42132
42132
  function pathContainsNodeModules(path) {
42133
42133
  return stringContains(path, nodeModulesPathPart);
42134
42134
  }
42135
- function parseNodeModuleFromPath(resolved) {
42135
+ function parseNodeModuleFromPath(resolved, isFolder) {
42136
42136
  const path = normalizePath(resolved);
42137
42137
  const idx = path.lastIndexOf(nodeModulesPathPart);
42138
42138
  if (idx === -1) {
42139
42139
  return void 0;
42140
42140
  }
42141
42141
  const indexAfterNodeModules = idx + nodeModulesPathPart.length;
42142
- let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules);
42142
+ let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules, isFolder);
42143
42143
  if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) {
42144
- indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
42144
+ indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName, isFolder);
42145
42145
  }
42146
42146
  return path.slice(0, indexAfterPackageName);
42147
42147
  }
42148
- function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
42148
+ function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex, isFolder) {
42149
42149
  const nextSeparatorIndex = path.indexOf(directorySeparator, prevSeparatorIndex + 1);
42150
- return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
42150
+ return nextSeparatorIndex === -1 ? isFolder ? path.length : prevSeparatorIndex : nextSeparatorIndex;
42151
42151
  }
42152
42152
  function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
42153
42153
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
@@ -43630,7 +43630,7 @@ function createBinder() {
43630
43630
  return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText);
43631
43631
  }
43632
43632
  if (isJsxNamespacedName(name)) {
43633
- return getEscapedTextOfJsxAttributeName(name);
43633
+ return getEscapedTextOfJsxNamespacedName(name);
43634
43634
  }
43635
43635
  return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
43636
43636
  }
@@ -71549,7 +71549,7 @@ function createTypeChecker(host) {
71549
71549
  return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
71550
71550
  }
71551
71551
  function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
71552
- const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
71552
+ const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags);
71553
71553
  const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
71554
71554
  if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
71555
71555
  return void 0;
@@ -123418,6 +123418,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123418
123418
  reusedNames,
123419
123419
  loader,
123420
123420
  getResolutionWithResolvedFileName,
123421
+ deferWatchingNonRelativeResolution,
123421
123422
  shouldRetryResolution,
123422
123423
  logChanges
123423
123424
  }) {
@@ -123442,7 +123443,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123442
123443
  resolutionHost.onDiscoveredSymlink();
123443
123444
  }
123444
123445
  resolutionsInFile.set(name, mode, resolution);
123445
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
123446
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
123446
123447
  if (existingResolution) {
123447
123448
  stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
123448
123449
  }
@@ -123518,7 +123519,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123518
123519
  typeReferenceDirectiveResolutionCache
123519
123520
  ),
123520
123521
  getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
123521
- shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
123522
+ shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
123523
+ deferWatchingNonRelativeResolution: false
123522
123524
  });
123523
123525
  }
123524
123526
  function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
@@ -123537,7 +123539,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123537
123539
  ),
123538
123540
  getResolutionWithResolvedFileName: getResolvedModule2,
123539
123541
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
123540
- logChanges: logChangesWhenResolvingModule
123542
+ logChanges: logChangesWhenResolvingModule,
123543
+ deferWatchingNonRelativeResolution: true
123544
+ // Defer non relative resolution watch because we could be using ambient modules
123541
123545
  });
123542
123546
  }
123543
123547
  function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
@@ -123555,7 +123559,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123555
123559
  function isNodeModulesAtTypesDirectory(dirPath) {
123556
123560
  return endsWith(dirPath, "/node_modules/@types");
123557
123561
  }
123558
- function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
123562
+ function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
123559
123563
  var _a;
123560
123564
  if (resolution.refCount) {
123561
123565
  resolution.refCount++;
@@ -123563,7 +123567,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123563
123567
  } else {
123564
123568
  resolution.refCount = 1;
123565
123569
  Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
123566
- if (isExternalModuleNameRelative(name)) {
123570
+ if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
123567
123571
  watchFailedLookupLocationOfResolution(resolution);
123568
123572
  } else {
123569
123573
  nonRelativeExternalModuleResolutions.add(name, resolution);
@@ -123843,7 +123847,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123843
123847
  return false;
123844
123848
  }
123845
123849
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
123846
- const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath);
123850
+ const packagePath = parseNodeModuleFromPath(
123851
+ fileOrDirectoryPath,
123852
+ /*isFolder*/
123853
+ true
123854
+ );
123847
123855
  if (packagePath)
123848
123856
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath);
123849
123857
  }
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-dev.20230417`;
38
+ version = `${versionMajorMinor}.0-dev.20230418`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -40003,22 +40003,22 @@ ${lanes.join("\n")}
40003
40003
  function pathContainsNodeModules(path) {
40004
40004
  return stringContains(path, nodeModulesPathPart);
40005
40005
  }
40006
- function parseNodeModuleFromPath(resolved) {
40006
+ function parseNodeModuleFromPath(resolved, isFolder) {
40007
40007
  const path = normalizePath(resolved);
40008
40008
  const idx = path.lastIndexOf(nodeModulesPathPart);
40009
40009
  if (idx === -1) {
40010
40010
  return void 0;
40011
40011
  }
40012
40012
  const indexAfterNodeModules = idx + nodeModulesPathPart.length;
40013
- let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules);
40013
+ let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules, isFolder);
40014
40014
  if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) {
40015
- indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
40015
+ indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName, isFolder);
40016
40016
  }
40017
40017
  return path.slice(0, indexAfterPackageName);
40018
40018
  }
40019
- function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
40019
+ function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex, isFolder) {
40020
40020
  const nextSeparatorIndex = path.indexOf(directorySeparator, prevSeparatorIndex + 1);
40021
- return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
40021
+ return nextSeparatorIndex === -1 ? isFolder ? path.length : prevSeparatorIndex : nextSeparatorIndex;
40022
40022
  }
40023
40023
  function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
40024
40024
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
@@ -41516,7 +41516,7 @@ ${lanes.join("\n")}
41516
41516
  return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText);
41517
41517
  }
41518
41518
  if (isJsxNamespacedName(name)) {
41519
- return getEscapedTextOfJsxAttributeName(name);
41519
+ return getEscapedTextOfJsxNamespacedName(name);
41520
41520
  }
41521
41521
  return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
41522
41522
  }
@@ -69343,7 +69343,7 @@ ${lanes.join("\n")}
69343
69343
  return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
69344
69344
  }
69345
69345
  function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
69346
- const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
69346
+ const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags);
69347
69347
  const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
69348
69348
  if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
69349
69349
  return void 0;
@@ -121575,6 +121575,7 @@ ${lanes.join("\n")}
121575
121575
  reusedNames,
121576
121576
  loader,
121577
121577
  getResolutionWithResolvedFileName,
121578
+ deferWatchingNonRelativeResolution,
121578
121579
  shouldRetryResolution,
121579
121580
  logChanges
121580
121581
  }) {
@@ -121599,7 +121600,7 @@ ${lanes.join("\n")}
121599
121600
  resolutionHost.onDiscoveredSymlink();
121600
121601
  }
121601
121602
  resolutionsInFile.set(name, mode, resolution);
121602
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
121603
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
121603
121604
  if (existingResolution) {
121604
121605
  stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
121605
121606
  }
@@ -121675,7 +121676,8 @@ ${lanes.join("\n")}
121675
121676
  typeReferenceDirectiveResolutionCache
121676
121677
  ),
121677
121678
  getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
121678
- shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
121679
+ shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
121680
+ deferWatchingNonRelativeResolution: false
121679
121681
  });
121680
121682
  }
121681
121683
  function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
@@ -121694,7 +121696,9 @@ ${lanes.join("\n")}
121694
121696
  ),
121695
121697
  getResolutionWithResolvedFileName: getResolvedModule2,
121696
121698
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
121697
- logChanges: logChangesWhenResolvingModule
121699
+ logChanges: logChangesWhenResolvingModule,
121700
+ deferWatchingNonRelativeResolution: true
121701
+ // Defer non relative resolution watch because we could be using ambient modules
121698
121702
  });
121699
121703
  }
121700
121704
  function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
@@ -121712,7 +121716,7 @@ ${lanes.join("\n")}
121712
121716
  function isNodeModulesAtTypesDirectory(dirPath) {
121713
121717
  return endsWith(dirPath, "/node_modules/@types");
121714
121718
  }
121715
- function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
121719
+ function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
121716
121720
  var _a;
121717
121721
  if (resolution.refCount) {
121718
121722
  resolution.refCount++;
@@ -121720,7 +121724,7 @@ ${lanes.join("\n")}
121720
121724
  } else {
121721
121725
  resolution.refCount = 1;
121722
121726
  Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
121723
- if (isExternalModuleNameRelative(name)) {
121727
+ if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
121724
121728
  watchFailedLookupLocationOfResolution(resolution);
121725
121729
  } else {
121726
121730
  nonRelativeExternalModuleResolutions.add(name, resolution);
@@ -122000,7 +122004,11 @@ ${lanes.join("\n")}
122000
122004
  return false;
122001
122005
  }
122002
122006
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
122003
- const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath);
122007
+ const packagePath = parseNodeModuleFromPath(
122008
+ fileOrDirectoryPath,
122009
+ /*isFolder*/
122010
+ true
122011
+ );
122004
122012
  if (packagePath)
122005
122013
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath);
122006
122014
  }
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.1";
38
- version = `${versionMajorMinor}.0-dev.20230417`;
38
+ version = `${versionMajorMinor}.0-dev.20230418`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -40003,22 +40003,22 @@ ${lanes.join("\n")}
40003
40003
  function pathContainsNodeModules(path) {
40004
40004
  return stringContains(path, nodeModulesPathPart);
40005
40005
  }
40006
- function parseNodeModuleFromPath(resolved) {
40006
+ function parseNodeModuleFromPath(resolved, isFolder) {
40007
40007
  const path = normalizePath(resolved);
40008
40008
  const idx = path.lastIndexOf(nodeModulesPathPart);
40009
40009
  if (idx === -1) {
40010
40010
  return void 0;
40011
40011
  }
40012
40012
  const indexAfterNodeModules = idx + nodeModulesPathPart.length;
40013
- let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules);
40013
+ let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules, isFolder);
40014
40014
  if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) {
40015
- indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
40015
+ indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName, isFolder);
40016
40016
  }
40017
40017
  return path.slice(0, indexAfterPackageName);
40018
40018
  }
40019
- function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {
40019
+ function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex, isFolder) {
40020
40020
  const nextSeparatorIndex = path.indexOf(directorySeparator, prevSeparatorIndex + 1);
40021
- return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
40021
+ return nextSeparatorIndex === -1 ? isFolder ? path.length : prevSeparatorIndex : nextSeparatorIndex;
40022
40022
  }
40023
40023
  function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
40024
40024
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
@@ -41516,7 +41516,7 @@ ${lanes.join("\n")}
41516
41516
  return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText);
41517
41517
  }
41518
41518
  if (isJsxNamespacedName(name)) {
41519
- return getEscapedTextOfJsxAttributeName(name);
41519
+ return getEscapedTextOfJsxNamespacedName(name);
41520
41520
  }
41521
41521
  return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
41522
41522
  }
@@ -69343,7 +69343,7 @@ ${lanes.join("\n")}
69343
69343
  return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
69344
69344
  }
69345
69345
  function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
69346
- const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
69346
+ const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags);
69347
69347
  const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
69348
69348
  if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
69349
69349
  return void 0;
@@ -121575,6 +121575,7 @@ ${lanes.join("\n")}
121575
121575
  reusedNames,
121576
121576
  loader,
121577
121577
  getResolutionWithResolvedFileName,
121578
+ deferWatchingNonRelativeResolution,
121578
121579
  shouldRetryResolution,
121579
121580
  logChanges
121580
121581
  }) {
@@ -121599,7 +121600,7 @@ ${lanes.join("\n")}
121599
121600
  resolutionHost.onDiscoveredSymlink();
121600
121601
  }
121601
121602
  resolutionsInFile.set(name, mode, resolution);
121602
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
121603
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
121603
121604
  if (existingResolution) {
121604
121605
  stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
121605
121606
  }
@@ -121675,7 +121676,8 @@ ${lanes.join("\n")}
121675
121676
  typeReferenceDirectiveResolutionCache
121676
121677
  ),
121677
121678
  getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
121678
- shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
121679
+ shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
121680
+ deferWatchingNonRelativeResolution: false
121679
121681
  });
121680
121682
  }
121681
121683
  function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
@@ -121694,7 +121696,9 @@ ${lanes.join("\n")}
121694
121696
  ),
121695
121697
  getResolutionWithResolvedFileName: getResolvedModule2,
121696
121698
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
121697
- logChanges: logChangesWhenResolvingModule
121699
+ logChanges: logChangesWhenResolvingModule,
121700
+ deferWatchingNonRelativeResolution: true
121701
+ // Defer non relative resolution watch because we could be using ambient modules
121698
121702
  });
121699
121703
  }
121700
121704
  function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
@@ -121712,7 +121716,7 @@ ${lanes.join("\n")}
121712
121716
  function isNodeModulesAtTypesDirectory(dirPath) {
121713
121717
  return endsWith(dirPath, "/node_modules/@types");
121714
121718
  }
121715
- function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
121719
+ function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
121716
121720
  var _a;
121717
121721
  if (resolution.refCount) {
121718
121722
  resolution.refCount++;
@@ -121720,7 +121724,7 @@ ${lanes.join("\n")}
121720
121724
  } else {
121721
121725
  resolution.refCount = 1;
121722
121726
  Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
121723
- if (isExternalModuleNameRelative(name)) {
121727
+ if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
121724
121728
  watchFailedLookupLocationOfResolution(resolution);
121725
121729
  } else {
121726
121730
  nonRelativeExternalModuleResolutions.add(name, resolution);
@@ -122000,7 +122004,11 @@ ${lanes.join("\n")}
122000
122004
  return false;
122001
122005
  }
122002
122006
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
122003
- const packagePath = parseNodeModuleFromPath(fileOrDirectoryPath);
122007
+ const packagePath = parseNodeModuleFromPath(
122008
+ fileOrDirectoryPath,
122009
+ /*isFolder*/
122010
+ true
122011
+ );
122004
122012
  if (packagePath)
122005
122013
  (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath);
122006
122014
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-dev.20230417`;
57
+ var version = `${versionMajorMinor}.0-dev.20230418`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -27734,22 +27734,22 @@ var nodeModulesPathPart = "/node_modules/";
27734
27734
  function pathContainsNodeModules(path2) {
27735
27735
  return stringContains(path2, nodeModulesPathPart);
27736
27736
  }
27737
- function parseNodeModuleFromPath(resolved) {
27737
+ function parseNodeModuleFromPath(resolved, isFolder) {
27738
27738
  const path2 = normalizePath(resolved);
27739
27739
  const idx = path2.lastIndexOf(nodeModulesPathPart);
27740
27740
  if (idx === -1) {
27741
27741
  return void 0;
27742
27742
  }
27743
27743
  const indexAfterNodeModules = idx + nodeModulesPathPart.length;
27744
- let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterNodeModules);
27744
+ let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterNodeModules, isFolder);
27745
27745
  if (path2.charCodeAt(indexAfterNodeModules) === 64 /* at */) {
27746
- indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterPackageName);
27746
+ indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterPackageName, isFolder);
27747
27747
  }
27748
27748
  return path2.slice(0, indexAfterPackageName);
27749
27749
  }
27750
- function moveToNextDirectorySeparatorIfAvailable(path2, prevSeparatorIndex) {
27750
+ function moveToNextDirectorySeparatorIfAvailable(path2, prevSeparatorIndex, isFolder) {
27751
27751
  const nextSeparatorIndex = path2.indexOf(directorySeparator, prevSeparatorIndex + 1);
27752
- return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
27752
+ return nextSeparatorIndex === -1 ? isFolder ? path2.length : prevSeparatorIndex : nextSeparatorIndex;
27753
27753
  }
27754
27754
  function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
27755
27755
  return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-dev.20230417",
5
+ "version": "5.1.0-dev.20230418",
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": "14.21.1",
114
114
  "npm": "8.19.3"
115
115
  },
116
- "gitHead": "430c5be783928c71e1b16ef267fad26d2998d7ab"
116
+ "gitHead": "3d3b2c724eb7adb8afbd44d2e3ad48fa8b0e8a84"
117
117
  }