typescript 6.0.0-dev.20250825 → 6.0.0-dev.20250828

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 = "6.0";
21
- var version = `${versionMajorMinor}.0-dev.20250825`;
21
+ var version = `${versionMajorMinor}.0-dev.20250828`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -14890,6 +14890,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
14890
14890
  function isBindingElementOfBareOrAccessedRequire(node) {
14891
14891
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
14892
14892
  }
14893
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
14894
+ if (isVariableDeclarationInitializedToRequire(node)) {
14895
+ return node.initializer.arguments[0];
14896
+ }
14897
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
14898
+ const leftmost = getLeftmostAccessExpression(node.initializer);
14899
+ if (isRequireCall(
14900
+ leftmost,
14901
+ /*requireStringLiteralLikeArgument*/
14902
+ true
14903
+ )) {
14904
+ return leftmost.arguments[0];
14905
+ }
14906
+ }
14907
+ return void 0;
14908
+ }
14893
14909
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
14894
14910
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
14895
14911
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -17966,9 +17982,6 @@ var _computedOptions = createComputedCompilerOptions({
17966
17982
  let moduleResolution = compilerOptions.moduleResolution;
17967
17983
  if (moduleResolution === void 0) {
17968
17984
  switch (_computedOptions.module.computeValue(compilerOptions)) {
17969
- case 1 /* CommonJS */:
17970
- moduleResolution = 2 /* Node10 */;
17971
- break;
17972
17985
  case 100 /* Node16 */:
17973
17986
  case 101 /* Node18 */:
17974
17987
  case 102 /* Node20 */:
@@ -17977,6 +17990,7 @@ var _computedOptions = createComputedCompilerOptions({
17977
17990
  case 199 /* NodeNext */:
17978
17991
  moduleResolution = 99 /* NodeNext */;
17979
17992
  break;
17993
+ case 1 /* CommonJS */:
17980
17994
  case 200 /* Preserve */:
17981
17995
  moduleResolution = 100 /* Bundler */;
17982
17996
  break;
@@ -49409,11 +49423,7 @@ function createTypeChecker(host) {
49409
49423
  return ambientModule;
49410
49424
  }
49411
49425
  const currentSourceFile = getSourceFileOfNode(location);
49412
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
49413
- location.initializer,
49414
- /*requireStringLiteralLikeArgument*/
49415
- true
49416
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49426
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49417
49427
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
49418
49428
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
49419
49429
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -124493,7 +124503,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124493
124503
  function getIgnoreDeprecationsVersion() {
124494
124504
  const ignoreDeprecations = options.ignoreDeprecations;
124495
124505
  if (ignoreDeprecations) {
124496
- if (ignoreDeprecations === "5.0") {
124506
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
124497
124507
  return new Version(ignoreDeprecations);
124498
124508
  }
124499
124509
  reportInvalidIgnoreDeprecations();
@@ -124602,6 +124612,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124602
124612
  );
124603
124613
  }
124604
124614
  });
124615
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
124616
+ if (options.moduleResolution === 2 /* Node10 */) {
124617
+ createDeprecatedDiagnostic("moduleResolution", "node10");
124618
+ }
124619
+ });
124605
124620
  }
124606
124621
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
124607
124622
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -2530,6 +2530,7 @@ declare namespace ts {
2530
2530
  Node = "node",
2531
2531
  /** @deprecated Renamed to `Node10` */
2532
2532
  NodeJs = "node",
2533
+ /** @deprecated */
2533
2534
  Node10 = "node10",
2534
2535
  Node16 = "node16",
2535
2536
  NodeNext = "nodenext",
@@ -6958,6 +6959,9 @@ declare namespace ts {
6958
6959
  * Use the new name or consider switching to a modern module resolution target.
6959
6960
  */
6960
6961
  NodeJs = 2,
6962
+ /**
6963
+ * @deprecated
6964
+ */
6961
6965
  Node10 = 2,
6962
6966
  Node16 = 3,
6963
6967
  NodeNext = 99,
package/lib/typescript.js CHANGED
@@ -881,6 +881,7 @@ __export(typescript_exports, {
881
881
  getModuleInstanceState: () => getModuleInstanceState,
882
882
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
883
883
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
884
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
884
885
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
885
886
  getNameForExportedSymbol: () => getNameForExportedSymbol,
886
887
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -2285,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2286
 
2286
2287
  // src/compiler/corePublic.ts
2287
2288
  var versionMajorMinor = "6.0";
2288
- var version = `${versionMajorMinor}.0-dev.20250825`;
2289
+ var version = `${versionMajorMinor}.0-dev.20250828`;
2289
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -18580,6 +18581,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
18580
18581
  function isBindingElementOfBareOrAccessedRequire(node) {
18581
18582
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
18582
18583
  }
18584
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
18585
+ if (isVariableDeclarationInitializedToRequire(node)) {
18586
+ return node.initializer.arguments[0];
18587
+ }
18588
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
18589
+ const leftmost = getLeftmostAccessExpression(node.initializer);
18590
+ if (isRequireCall(
18591
+ leftmost,
18592
+ /*requireStringLiteralLikeArgument*/
18593
+ true
18594
+ )) {
18595
+ return leftmost.arguments[0];
18596
+ }
18597
+ }
18598
+ return void 0;
18599
+ }
18583
18600
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
18584
18601
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
18585
18602
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -21921,9 +21938,6 @@ var _computedOptions = createComputedCompilerOptions({
21921
21938
  let moduleResolution = compilerOptions.moduleResolution;
21922
21939
  if (moduleResolution === void 0) {
21923
21940
  switch (_computedOptions.module.computeValue(compilerOptions)) {
21924
- case 1 /* CommonJS */:
21925
- moduleResolution = 2 /* Node10 */;
21926
- break;
21927
21941
  case 100 /* Node16 */:
21928
21942
  case 101 /* Node18 */:
21929
21943
  case 102 /* Node20 */:
@@ -21932,6 +21946,7 @@ var _computedOptions = createComputedCompilerOptions({
21932
21946
  case 199 /* NodeNext */:
21933
21947
  moduleResolution = 99 /* NodeNext */;
21934
21948
  break;
21949
+ case 1 /* CommonJS */:
21935
21950
  case 200 /* Preserve */:
21936
21951
  moduleResolution = 100 /* Bundler */;
21937
21952
  break;
@@ -54017,11 +54032,7 @@ function createTypeChecker(host) {
54017
54032
  return ambientModule;
54018
54033
  }
54019
54034
  const currentSourceFile = getSourceFileOfNode(location);
54020
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
54021
- location.initializer,
54022
- /*requireStringLiteralLikeArgument*/
54023
- true
54024
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54035
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54025
54036
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
54026
54037
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
54027
54038
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -129340,7 +129351,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129340
129351
  function getIgnoreDeprecationsVersion() {
129341
129352
  const ignoreDeprecations = options.ignoreDeprecations;
129342
129353
  if (ignoreDeprecations) {
129343
- if (ignoreDeprecations === "5.0") {
129354
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
129344
129355
  return new Version(ignoreDeprecations);
129345
129356
  }
129346
129357
  reportInvalidIgnoreDeprecations();
@@ -129449,6 +129460,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129449
129460
  );
129450
129461
  }
129451
129462
  });
129463
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
129464
+ if (options.moduleResolution === 2 /* Node10 */) {
129465
+ createDeprecatedDiagnostic("moduleResolution", "node10");
129466
+ }
129467
+ });
129452
129468
  }
129453
129469
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
129454
129470
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -169445,9 +169461,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169445
169461
  return charactersFuzzyMatchInString(symbolName2, lowerCaseTokenText);
169446
169462
  },
169447
169463
  (info, symbolName2, isFromAmbientModule, exportMapKey) => {
169448
- if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
169449
- return;
169450
- }
169451
169464
  info = filter(info, isImportableExportInfo);
169452
169465
  if (!info.length) {
169453
169466
  return;
@@ -169458,6 +169471,9 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169458
169471
  if (result !== "skipped") {
169459
169472
  ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
169460
169473
  }
169474
+ if (detailsEntryId && (detailsEntryId.source !== moduleSpecifier && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name)))) {
169475
+ return;
169476
+ }
169461
169477
  const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
169462
169478
  const symbol = isDefaultExport && getLocalSymbolForExportDefault(Debug.checkDefined(exportInfo2.symbol)) || Debug.checkDefined(exportInfo2.symbol);
169463
169479
  pushAutoImportSymbol(symbol, {
@@ -171548,7 +171564,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171548
171564
  if (tryFileExists(host, packageFile)) {
171549
171565
  const packageJson = readJson(packageFile, host);
171550
171566
  const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
171551
- exportsOrImportsLookup(
171567
+ if (exportsOrImportsLookup(
171552
171568
  packageJson.exports,
171553
171569
  fragmentSubpath,
171554
171570
  packageDirectory,
@@ -171556,8 +171572,9 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171556
171572
  true,
171557
171573
  /*isImports*/
171558
171574
  false
171559
- );
171560
- return;
171575
+ )) {
171576
+ return;
171577
+ }
171561
171578
  }
171562
171579
  return nodeModulesDirectoryOrImportsLookup(ancestor);
171563
171580
  };
@@ -171568,7 +171585,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171568
171585
  return arrayFrom(result.values());
171569
171586
  function exportsOrImportsLookup(lookupTable, fragment2, baseDirectory, isExports, isImports) {
171570
171587
  if (typeof lookupTable !== "object" || lookupTable === null) {
171571
- return;
171588
+ return lookupTable !== void 0;
171572
171589
  }
171573
171590
  const keys = getOwnKeys(lookupTable);
171574
171591
  const conditions = getConditions(compilerOptions, mode);
@@ -171592,6 +171609,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171592
171609
  },
171593
171610
  comparePatternKeys
171594
171611
  );
171612
+ return true;
171595
171613
  }
171596
171614
  }
171597
171615
  function getPatternFromFirstMatchingCondition(target, conditions) {
@@ -184091,6 +184109,7 @@ __export(ts_exports2, {
184091
184109
  getModuleInstanceState: () => getModuleInstanceState,
184092
184110
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
184093
184111
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
184112
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
184094
184113
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
184095
184114
  getNameForExportedSymbol: () => getNameForExportedSymbol,
184096
184115
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -198852,6 +198871,7 @@ if (typeof console !== "undefined") {
198852
198871
  getModuleInstanceState,
198853
198872
  getModuleNameStringLiteralAt,
198854
198873
  getModuleSpecifierEndingPreference,
198874
+ getModuleSpecifierOfBareOrAccessedRequire,
198855
198875
  getModuleSpecifierResolverHost,
198856
198876
  getNameForExportedSymbol,
198857
198877
  getNameFromImportAttribute,
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": "6.0.0-dev.20250825",
5
+ "version": "6.0.0-dev.20250828",
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": "e635bb97f59c892f62c5061cbfeab5af211d743c"
118
+ "gitHead": "7956c00166df552a1d6da6c2f996b558e5dd94ff"
119
119
  }