typescript 5.4.0-dev.20240103 → 5.4.0-dev.20240104

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.4";
21
- var version = `${versionMajorMinor}.0-dev.20240103`;
21
+ var version = `${versionMajorMinor}.0-dev.20240104`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -33755,7 +33755,25 @@ var IncrementalParser;
33755
33755
  })(InvalidPosition || (InvalidPosition = {}));
33756
33756
  })(IncrementalParser || (IncrementalParser = {}));
33757
33757
  function isDeclarationFileName(fileName) {
33758
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
33758
+ return getDeclarationFileExtension(fileName) !== void 0;
33759
+ }
33760
+ function getDeclarationFileExtension(fileName) {
33761
+ const standardExtension = getAnyExtensionFromPath(
33762
+ fileName,
33763
+ supportedDeclarationExtensions,
33764
+ /*ignoreCase*/
33765
+ false
33766
+ );
33767
+ if (standardExtension) {
33768
+ return standardExtension;
33769
+ }
33770
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
33771
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
33772
+ if (index >= 0) {
33773
+ return fileName.substring(index);
33774
+ }
33775
+ }
33776
+ return void 0;
33759
33777
  }
33760
33778
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
33761
33779
  if (!mode) {
@@ -50961,7 +50979,7 @@ function createTypeChecker(host) {
50961
50979
  });
50962
50980
  }
50963
50981
  function serializeAsAlias(symbol, localName, modifierFlags) {
50964
- var _a2, _b, _c, _d, _e;
50982
+ var _a2, _b, _c, _d, _e, _f;
50965
50983
  const node = getDeclarationOfAliasSymbol(symbol);
50966
50984
  if (!node)
50967
50985
  return Debug.fail();
@@ -51159,6 +51177,9 @@ function createTypeChecker(host) {
51159
51177
  }
51160
51178
  case 281 /* ExportSpecifier */:
51161
51179
  const specifier = node.parent.parent.moduleSpecifier;
51180
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
51181
+ verbatimTargetName = "default" /* Default */;
51182
+ }
51162
51183
  serializeExportSpecifier(
51163
51184
  unescapeLeadingUnderscores(symbol.escapedName),
51164
51185
  specifier ? verbatimTargetName : targetName,
package/lib/tsserver.js CHANGED
@@ -269,6 +269,7 @@ __export(server_exports, {
269
269
  changeAnyExtension: () => changeAnyExtension,
270
270
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
271
271
  changeExtension: () => changeExtension,
272
+ changeFullExtension: () => changeFullExtension,
272
273
  changesAffectModuleResolution: () => changesAffectModuleResolution,
273
274
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
274
275
  childIsDecorated: () => childIsDecorated,
@@ -708,6 +709,7 @@ __export(server_exports, {
708
709
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
709
710
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
710
711
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
712
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
711
713
  getDeclarationFromName: () => getDeclarationFromName,
712
714
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
713
715
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -2339,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
2339
2341
 
2340
2342
  // src/compiler/corePublic.ts
2341
2343
  var versionMajorMinor = "5.4";
2342
- var version = `${versionMajorMinor}.0-dev.20240103`;
2344
+ var version = `${versionMajorMinor}.0-dev.20240104`;
2343
2345
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2344
2346
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2345
2347
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9107,6 +9109,13 @@ function changeAnyExtension(path, ext, extensions, ignoreCase) {
9107
9109
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
9108
9110
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
9109
9111
  }
9112
+ function changeFullExtension(path, newExtension) {
9113
+ const declarationExtension = getDeclarationFileExtension(path);
9114
+ if (declarationExtension) {
9115
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
9116
+ }
9117
+ return changeAnyExtension(path, newExtension);
9118
+ }
9110
9119
  var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
9111
9120
  function comparePathsWorker(a, b, componentComparer) {
9112
9121
  if (a === b)
@@ -38174,7 +38183,25 @@ var IncrementalParser;
38174
38183
  })(InvalidPosition || (InvalidPosition = {}));
38175
38184
  })(IncrementalParser || (IncrementalParser = {}));
38176
38185
  function isDeclarationFileName(fileName) {
38177
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
38186
+ return getDeclarationFileExtension(fileName) !== void 0;
38187
+ }
38188
+ function getDeclarationFileExtension(fileName) {
38189
+ const standardExtension = getAnyExtensionFromPath(
38190
+ fileName,
38191
+ supportedDeclarationExtensions,
38192
+ /*ignoreCase*/
38193
+ false
38194
+ );
38195
+ if (standardExtension) {
38196
+ return standardExtension;
38197
+ }
38198
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
38199
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
38200
+ if (index >= 0) {
38201
+ return fileName.substring(index);
38202
+ }
38203
+ }
38204
+ return void 0;
38178
38205
  }
38179
38206
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
38180
38207
  if (!mode) {
@@ -43173,7 +43200,7 @@ function loadEntrypointsFromExportMap(scope, exports2, state, extensions) {
43173
43200
  /*excludes*/
43174
43201
  void 0,
43175
43202
  [
43176
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
43203
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
43177
43204
  ]
43178
43205
  ).forEach((entry) => {
43179
43206
  entrypoints = appendIfUnique(entrypoints, {
@@ -55680,7 +55707,7 @@ function createTypeChecker(host) {
55680
55707
  });
55681
55708
  }
55682
55709
  function serializeAsAlias(symbol, localName, modifierFlags) {
55683
- var _a2, _b, _c, _d, _e;
55710
+ var _a2, _b, _c, _d, _e, _f;
55684
55711
  const node = getDeclarationOfAliasSymbol(symbol);
55685
55712
  if (!node)
55686
55713
  return Debug.fail();
@@ -55878,6 +55905,9 @@ function createTypeChecker(host) {
55878
55905
  }
55879
55906
  case 281 /* ExportSpecifier */:
55880
55907
  const specifier = node.parent.parent.moduleSpecifier;
55908
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
55909
+ verbatimTargetName = "default" /* Default */;
55910
+ }
55881
55911
  serializeExportSpecifier(
55882
55912
  unescapeLeadingUnderscores(symbol.escapedName),
55883
55913
  specifier ? verbatimTargetName : targetName,
@@ -173953,6 +173983,7 @@ __export(ts_exports2, {
173953
173983
  changeAnyExtension: () => changeAnyExtension,
173954
173984
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
173955
173985
  changeExtension: () => changeExtension,
173986
+ changeFullExtension: () => changeFullExtension,
173956
173987
  changesAffectModuleResolution: () => changesAffectModuleResolution,
173957
173988
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
173958
173989
  childIsDecorated: () => childIsDecorated,
@@ -174392,6 +174423,7 @@ __export(ts_exports2, {
174392
174423
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
174393
174424
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
174394
174425
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
174426
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
174395
174427
  getDeclarationFromName: () => getDeclarationFromName,
174396
174428
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
174397
174429
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -188752,6 +188784,7 @@ start(initializeNodeSystem(), require("os").platform());
188752
188784
  changeAnyExtension,
188753
188785
  changeCompilerHostLikeToUseCache,
188754
188786
  changeExtension,
188787
+ changeFullExtension,
188755
188788
  changesAffectModuleResolution,
188756
188789
  changesAffectingProgramStructure,
188757
188790
  childIsDecorated,
@@ -189191,6 +189224,7 @@ start(initializeNodeSystem(), require("os").platform());
189191
189224
  getDeclarationEmitExtensionForPath,
189192
189225
  getDeclarationEmitOutputFilePath,
189193
189226
  getDeclarationEmitOutputFilePathWorker,
189227
+ getDeclarationFileExtension,
189194
189228
  getDeclarationFromName,
189195
189229
  getDeclarationModifierFlagsFromSymbol,
189196
189230
  getDeclarationOfKind,
@@ -9914,13 +9914,13 @@ declare namespace ts {
9914
9914
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
9915
9915
  * `options` parameter.
9916
9916
  *
9917
- * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
9917
+ * @param fileName The file name to check the format of (it need not exist on disk)
9918
9918
  * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
9919
9919
  * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
9920
9920
  * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
9921
9921
  * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
9922
9922
  */
9923
- function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9923
+ function getImpliedNodeFormatForFile(fileName: string, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9924
9924
  /**
9925
9925
  * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
9926
9926
  * that represent a compilation unit.
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.4";
38
- version = `${versionMajorMinor}.0-dev.20240103`;
38
+ version = `${versionMajorMinor}.0-dev.20240104`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6862,6 +6862,13 @@ ${lanes.join("\n")}
6862
6862
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
6863
6863
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
6864
6864
  }
6865
+ function changeFullExtension(path, newExtension) {
6866
+ const declarationExtension = getDeclarationFileExtension(path);
6867
+ if (declarationExtension) {
6868
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
6869
+ }
6870
+ return changeAnyExtension(path, newExtension);
6871
+ }
6865
6872
  function comparePathsWorker(a, b, componentComparer) {
6866
6873
  if (a === b)
6867
6874
  return 0 /* EqualTo */;
@@ -28453,7 +28460,25 @@ ${lanes.join("\n")}
28453
28460
  return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
28454
28461
  }
28455
28462
  function isDeclarationFileName(fileName) {
28456
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
28463
+ return getDeclarationFileExtension(fileName) !== void 0;
28464
+ }
28465
+ function getDeclarationFileExtension(fileName) {
28466
+ const standardExtension = getAnyExtensionFromPath(
28467
+ fileName,
28468
+ supportedDeclarationExtensions,
28469
+ /*ignoreCase*/
28470
+ false
28471
+ );
28472
+ if (standardExtension) {
28473
+ return standardExtension;
28474
+ }
28475
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
28476
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
28477
+ if (index >= 0) {
28478
+ return fileName.substring(index);
28479
+ }
28480
+ }
28481
+ return void 0;
28457
28482
  }
28458
28483
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
28459
28484
  if (!mode) {
@@ -41006,7 +41031,7 @@ ${lanes.join("\n")}
41006
41031
  /*excludes*/
41007
41032
  void 0,
41008
41033
  [
41009
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
41034
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
41010
41035
  ]
41011
41036
  ).forEach((entry) => {
41012
41037
  entrypoints = appendIfUnique(entrypoints, {
@@ -53436,7 +53461,7 @@ ${lanes.join("\n")}
53436
53461
  });
53437
53462
  }
53438
53463
  function serializeAsAlias(symbol, localName, modifierFlags) {
53439
- var _a2, _b, _c, _d, _e;
53464
+ var _a2, _b, _c, _d, _e, _f;
53440
53465
  const node = getDeclarationOfAliasSymbol(symbol);
53441
53466
  if (!node)
53442
53467
  return Debug.fail();
@@ -53634,6 +53659,9 @@ ${lanes.join("\n")}
53634
53659
  }
53635
53660
  case 281 /* ExportSpecifier */:
53636
53661
  const specifier = node.parent.parent.moduleSpecifier;
53662
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
53663
+ verbatimTargetName = "default" /* Default */;
53664
+ }
53637
53665
  serializeExportSpecifier(
53638
53666
  unescapeLeadingUnderscores(symbol.escapedName),
53639
53667
  specifier ? verbatimTargetName : targetName,
@@ -185504,6 +185532,7 @@ ${e.message}`;
185504
185532
  changeAnyExtension: () => changeAnyExtension,
185505
185533
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
185506
185534
  changeExtension: () => changeExtension,
185535
+ changeFullExtension: () => changeFullExtension,
185507
185536
  changesAffectModuleResolution: () => changesAffectModuleResolution,
185508
185537
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
185509
185538
  childIsDecorated: () => childIsDecorated,
@@ -185943,6 +185972,7 @@ ${e.message}`;
185943
185972
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
185944
185973
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
185945
185974
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
185975
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
185946
185976
  getDeclarationFromName: () => getDeclarationFromName,
185947
185977
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
185948
185978
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -187924,6 +187954,7 @@ ${e.message}`;
187924
187954
  changeAnyExtension: () => changeAnyExtension,
187925
187955
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
187926
187956
  changeExtension: () => changeExtension,
187957
+ changeFullExtension: () => changeFullExtension,
187927
187958
  changesAffectModuleResolution: () => changesAffectModuleResolution,
187928
187959
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
187929
187960
  childIsDecorated: () => childIsDecorated,
@@ -188363,6 +188394,7 @@ ${e.message}`;
188363
188394
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
188364
188395
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
188365
188396
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
188397
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
188366
188398
  getDeclarationFromName: () => getDeclarationFromName,
188367
188399
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
188368
188400
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-dev.20240103`;
57
+ var version = `${versionMajorMinor}.0-dev.20240104`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -25616,7 +25616,25 @@ var IncrementalParser;
25616
25616
  })(InvalidPosition || (InvalidPosition = {}));
25617
25617
  })(IncrementalParser || (IncrementalParser = {}));
25618
25618
  function isDeclarationFileName(fileName) {
25619
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
25619
+ return getDeclarationFileExtension(fileName) !== void 0;
25620
+ }
25621
+ function getDeclarationFileExtension(fileName) {
25622
+ const standardExtension = getAnyExtensionFromPath(
25623
+ fileName,
25624
+ supportedDeclarationExtensions,
25625
+ /*ignoreCase*/
25626
+ false
25627
+ );
25628
+ if (standardExtension) {
25629
+ return standardExtension;
25630
+ }
25631
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
25632
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
25633
+ if (index >= 0) {
25634
+ return fileName.substring(index);
25635
+ }
25636
+ }
25637
+ return void 0;
25620
25638
  }
25621
25639
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
25622
25640
  if (!mode) {
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.4.0-dev.20240103",
5
+ "version": "5.4.0-dev.20240104",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "be20dbbbbb295b477660a9dee3e8a234b491b5fc"
116
+ "gitHead": "0ea57f6ca19c23e0bc690bd2706f6b6e11a97e02"
117
117
  }