typescript 5.0.0-dev.20221219 → 5.0.0-dev.20221220

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20221219`;
26
+ var version = `${versionMajorMinor}.0-dev.20221220`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -33016,7 +33016,7 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
33016
33016
  }
33017
33017
  return extendedConfigPath;
33018
33018
  }
33019
- const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
33019
+ const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host);
33020
33020
  if (resolved.resolvedModule) {
33021
33021
  return resolved.resolvedModule.resolvedFileName;
33022
33022
  }
@@ -34398,6 +34398,9 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
34398
34398
  }
34399
34399
  return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
34400
34400
  }
34401
+ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
34402
+ return nodeModuleNameResolverWorker(8 /* Exports */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, host, void 0, 8 /* Json */, true, void 0);
34403
+ }
34401
34404
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
34402
34405
  var _a2, _b;
34403
34406
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -34573,11 +34576,15 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
34573
34576
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
34574
34577
  }
34575
34578
  }
34576
- function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
34579
+ function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
34577
34580
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
34578
34581
  const result = tryFile(candidate, onlyRecordFailures, state);
34579
34582
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
34580
34583
  }
34584
+ if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
34585
+ const result = tryFile(candidate, onlyRecordFailures, state);
34586
+ return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0;
34587
+ }
34581
34588
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
34582
34589
  }
34583
34590
  function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
@@ -34988,7 +34995,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
34988
34995
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
34989
34996
  if (inputLink)
34990
34997
  return inputLink;
34991
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
34998
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, finalPath, false, state)));
34992
34999
  } else if (typeof target === "object" && target !== null) {
34993
35000
  if (!Array.isArray(target)) {
34994
35001
  for (const condition of getOwnKeys(target)) {
@@ -35083,7 +35090,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
35083
35090
  continue;
35084
35091
  const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
35085
35092
  if (state.host.fileExists(possibleInputWithInputExtension)) {
35086
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
35093
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, possibleInputWithInputExtension, false, state)));
35087
35094
  }
35088
35095
  }
35089
35096
  }
@@ -70350,7 +70357,7 @@ function createTypeChecker(host) {
70350
70357
  } else {
70351
70358
  if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
70352
70359
  grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
70353
- } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
70360
+ } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
70354
70361
  grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
70355
70362
  }
70356
70363
  }
@@ -103876,7 +103883,7 @@ function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) {
103876
103883
  return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine;
103877
103884
  }
103878
103885
  function getLocaleTimeString(system) {
103879
- return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
103886
+ return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ");
103880
103887
  }
103881
103888
  function createWatchStatusReporter(system, pretty) {
103882
103889
  return pretty ? (diagnostic, newLine, options) => {
package/lib/tsserver.js CHANGED
@@ -2040,6 +2040,7 @@ __export(server_exports, {
2040
2040
  nodeIsSynthesized: () => nodeIsSynthesized,
2041
2041
  nodeModuleNameResolver: () => nodeModuleNameResolver,
2042
2042
  nodeModulesPathPart: () => nodeModulesPathPart,
2043
+ nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver,
2043
2044
  nodeOrChildIsDecorated: () => nodeOrChildIsDecorated,
2044
2045
  nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd,
2045
2046
  nodePosToString: () => nodePosToString,
@@ -2669,7 +2670,7 @@ __export(ts_server_exports3, {
2669
2670
 
2670
2671
  // src/compiler/corePublic.ts
2671
2672
  var versionMajorMinor = "5.0";
2672
- var version = `${versionMajorMinor}.0-dev.20221219`;
2673
+ var version = `${versionMajorMinor}.0-dev.20221220`;
2673
2674
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2674
2675
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2675
2676
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37802,7 +37803,7 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
37802
37803
  }
37803
37804
  return extendedConfigPath;
37804
37805
  }
37805
- const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
37806
+ const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host);
37806
37807
  if (resolved.resolvedModule) {
37807
37808
  return resolved.resolvedModule.resolvedFileName;
37808
37809
  }
@@ -39244,6 +39245,9 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
39244
39245
  }
39245
39246
  return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
39246
39247
  }
39248
+ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
39249
+ return nodeModuleNameResolverWorker(8 /* Exports */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, host, void 0, 8 /* Json */, true, void 0);
39250
+ }
39247
39251
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
39248
39252
  var _a2, _b;
39249
39253
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -39419,11 +39423,15 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
39419
39423
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
39420
39424
  }
39421
39425
  }
39422
- function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
39426
+ function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
39423
39427
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
39424
39428
  const result = tryFile(candidate, onlyRecordFailures, state);
39425
39429
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
39426
39430
  }
39431
+ if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
39432
+ const result = tryFile(candidate, onlyRecordFailures, state);
39433
+ return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0;
39434
+ }
39427
39435
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
39428
39436
  }
39429
39437
  function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
@@ -39566,7 +39574,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
39566
39574
  }
39567
39575
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
39568
39576
  const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2));
39569
- const result = loadJSOrExactTSFileName(extensions, finalPath, false, state);
39577
+ const result = loadFileNameFromPackageJsonField(extensions, finalPath, false, state);
39570
39578
  if (result) {
39571
39579
  entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
39572
39580
  return true;
@@ -39920,7 +39928,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
39920
39928
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
39921
39929
  if (inputLink)
39922
39930
  return inputLink;
39923
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
39931
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, finalPath, false, state)));
39924
39932
  } else if (typeof target === "object" && target !== null) {
39925
39933
  if (!Array.isArray(target)) {
39926
39934
  for (const condition of getOwnKeys(target)) {
@@ -40015,7 +40023,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
40015
40023
  continue;
40016
40024
  const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
40017
40025
  if (state.host.fileExists(possibleInputWithInputExtension)) {
40018
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
40026
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, possibleInputWithInputExtension, false, state)));
40019
40027
  }
40020
40028
  }
40021
40029
  }
@@ -75325,7 +75333,7 @@ function createTypeChecker(host) {
75325
75333
  } else {
75326
75334
  if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
75327
75335
  grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
75328
- } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
75336
+ } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
75329
75337
  grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
75330
75338
  }
75331
75339
  }
@@ -109113,7 +109121,7 @@ function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) {
109113
109121
  return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine;
109114
109122
  }
109115
109123
  function getLocaleTimeString(system) {
109116
- return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
109124
+ return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ");
109117
109125
  }
109118
109126
  function createWatchStatusReporter(system, pretty) {
109119
109127
  return pretty ? (diagnostic, newLine, options) => {
@@ -114703,6 +114711,7 @@ __export(ts_exports3, {
114703
114711
  nodeIsSynthesized: () => nodeIsSynthesized,
114704
114712
  nodeModuleNameResolver: () => nodeModuleNameResolver,
114705
114713
  nodeModulesPathPart: () => nodeModulesPathPart,
114714
+ nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver,
114706
114715
  nodeOrChildIsDecorated: () => nodeOrChildIsDecorated,
114707
114716
  nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd,
114708
114717
  nodePosToString: () => nodePosToString,
@@ -134926,7 +134935,7 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options,
134926
134935
  elements.push(factory.createNumericLiteral(type.value));
134927
134936
  break;
134928
134937
  case "string":
134929
- elements.push(factory.createStringLiteral(type.value));
134938
+ elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */));
134930
134939
  break;
134931
134940
  }
134932
134941
  }
@@ -142225,14 +142234,14 @@ function addNodeOutliningSpans(sourceFile, cancellationToken, out) {
142225
142234
  const n = statements.length;
142226
142235
  while (current < n) {
142227
142236
  while (current < n && !isAnyImportSyntax(statements[current])) {
142228
- visitNonImportNode(statements[current]);
142237
+ visitNode3(statements[current]);
142229
142238
  current++;
142230
142239
  }
142231
142240
  if (current === n)
142232
142241
  break;
142233
142242
  const firstImport = current;
142234
142243
  while (current < n && isAnyImportSyntax(statements[current])) {
142235
- addOutliningForLeadingCommentsForNode(statements[current], sourceFile, cancellationToken, out);
142244
+ visitNode3(statements[current]);
142236
142245
  current++;
142237
142246
  }
142238
142247
  const lastImport = current - 1;
@@ -142240,7 +142249,7 @@ function addNodeOutliningSpans(sourceFile, cancellationToken, out) {
142240
142249
  out.push(createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], 100 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */));
142241
142250
  }
142242
142251
  }
142243
- function visitNonImportNode(n2) {
142252
+ function visitNode3(n2) {
142244
142253
  var _a2;
142245
142254
  if (depthRemaining === 0)
142246
142255
  return;
@@ -142263,18 +142272,18 @@ function addNodeOutliningSpans(sourceFile, cancellationToken, out) {
142263
142272
  depthRemaining--;
142264
142273
  if (isCallExpression(n2)) {
142265
142274
  depthRemaining++;
142266
- visitNonImportNode(n2.expression);
142275
+ visitNode3(n2.expression);
142267
142276
  depthRemaining--;
142268
- n2.arguments.forEach(visitNonImportNode);
142269
- (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNonImportNode);
142277
+ n2.arguments.forEach(visitNode3);
142278
+ (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNode3);
142270
142279
  } else if (isIfStatement(n2) && n2.elseStatement && isIfStatement(n2.elseStatement)) {
142271
- visitNonImportNode(n2.expression);
142272
- visitNonImportNode(n2.thenStatement);
142280
+ visitNode3(n2.expression);
142281
+ visitNode3(n2.thenStatement);
142273
142282
  depthRemaining++;
142274
- visitNonImportNode(n2.elseStatement);
142283
+ visitNode3(n2.elseStatement);
142275
142284
  depthRemaining--;
142276
142285
  } else {
142277
- n2.forEachChild(visitNonImportNode);
142286
+ n2.forEachChild(visitNode3);
142278
142287
  }
142279
142288
  depthRemaining++;
142280
142289
  }
@@ -142424,6 +142433,21 @@ function getOutliningSpanForNode(n, sourceFile) {
142424
142433
  return spanForCallExpression(n);
142425
142434
  case 214 /* ParenthesizedExpression */:
142426
142435
  return spanForParenthesizedExpression(n);
142436
+ case 272 /* NamedImports */:
142437
+ case 276 /* NamedExports */:
142438
+ case 296 /* AssertClause */:
142439
+ return spanForNamedImportsOrExportsOrAssertClause(n);
142440
+ }
142441
+ function spanForNamedImportsOrExportsOrAssertClause(node) {
142442
+ if (!node.elements.length) {
142443
+ return void 0;
142444
+ }
142445
+ const openToken = findChildOfKind(node, 18 /* OpenBraceToken */, sourceFile);
142446
+ const closeToken = findChildOfKind(node, 19 /* CloseBraceToken */, sourceFile);
142447
+ if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) {
142448
+ return void 0;
142449
+ }
142450
+ return spanBetweenTokens(openToken, closeToken, node, sourceFile, false, false);
142427
142451
  }
142428
142452
  function spanForCallExpression(node) {
142429
142453
  if (!node.arguments.length) {
@@ -165487,6 +165511,7 @@ start(initializeNodeSystem(), require("os").platform());
165487
165511
  nodeIsSynthesized,
165488
165512
  nodeModuleNameResolver,
165489
165513
  nodeModulesPathPart,
165514
+ nodeNextJsonConfigResolver,
165490
165515
  nodeOrChildIsDecorated,
165491
165516
  nodeOverlapsWithStartEnd,
165492
165517
  nodePosToString,
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221219`;
45
+ version = `${versionMajorMinor}.0-dev.20221220`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -33869,7 +33869,7 @@ ${lanes.join("\n")}
33869
33869
  }
33870
33870
  return extendedConfigPath;
33871
33871
  }
33872
- const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
33872
+ const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host);
33873
33873
  if (resolved.resolvedModule) {
33874
33874
  return resolved.resolvedModule.resolvedFileName;
33875
33875
  }
@@ -36756,6 +36756,9 @@ ${lanes.join("\n")}
36756
36756
  }
36757
36757
  return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
36758
36758
  }
36759
+ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
36760
+ return nodeModuleNameResolverWorker(8 /* Exports */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, host, void 0, 8 /* Json */, true, void 0);
36761
+ }
36759
36762
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
36760
36763
  var _a2, _b;
36761
36764
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -36930,11 +36933,15 @@ ${lanes.join("\n")}
36930
36933
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
36931
36934
  }
36932
36935
  }
36933
- function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
36936
+ function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
36934
36937
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
36935
36938
  const result = tryFile(candidate, onlyRecordFailures, state);
36936
36939
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
36937
36940
  }
36941
+ if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
36942
+ const result = tryFile(candidate, onlyRecordFailures, state);
36943
+ return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0;
36944
+ }
36938
36945
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
36939
36946
  }
36940
36947
  function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
@@ -37077,7 +37084,7 @@ ${lanes.join("\n")}
37077
37084
  }
37078
37085
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
37079
37086
  const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2));
37080
- const result = loadJSOrExactTSFileName(extensions, finalPath, false, state);
37087
+ const result = loadFileNameFromPackageJsonField(extensions, finalPath, false, state);
37081
37088
  if (result) {
37082
37089
  entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
37083
37090
  return true;
@@ -37431,7 +37438,7 @@ ${lanes.join("\n")}
37431
37438
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
37432
37439
  if (inputLink)
37433
37440
  return inputLink;
37434
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
37441
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, finalPath, false, state)));
37435
37442
  } else if (typeof target === "object" && target !== null) {
37436
37443
  if (!Array.isArray(target)) {
37437
37444
  for (const condition of getOwnKeys(target)) {
@@ -37526,7 +37533,7 @@ ${lanes.join("\n")}
37526
37533
  continue;
37527
37534
  const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
37528
37535
  if (state.host.fileExists(possibleInputWithInputExtension)) {
37529
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
37536
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, possibleInputWithInputExtension, false, state)));
37530
37537
  }
37531
37538
  }
37532
37539
  }
@@ -72760,7 +72767,7 @@ ${lanes.join("\n")}
72760
72767
  } else {
72761
72768
  if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
72762
72769
  grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
72763
- } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
72770
+ } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
72764
72771
  grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
72765
72772
  }
72766
72773
  }
@@ -106907,7 +106914,7 @@ ${lanes.join("\n")}
106907
106914
  return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine;
106908
106915
  }
106909
106916
  function getLocaleTimeString(system) {
106910
- return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
106917
+ return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ");
106911
106918
  }
106912
106919
  function createWatchStatusReporter(system, pretty) {
106913
106920
  return pretty ? (diagnostic, newLine, options) => {
@@ -130980,7 +130987,7 @@ ${lanes.join("\n")}
130980
130987
  elements.push(factory.createNumericLiteral(type.value));
130981
130988
  break;
130982
130989
  case "string":
130983
- elements.push(factory.createStringLiteral(type.value));
130990
+ elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */));
130984
130991
  break;
130985
130992
  }
130986
130993
  }
@@ -138435,14 +138442,14 @@ ${lanes.join("\n")}
138435
138442
  const n = statements.length;
138436
138443
  while (current < n) {
138437
138444
  while (current < n && !isAnyImportSyntax(statements[current])) {
138438
- visitNonImportNode(statements[current]);
138445
+ visitNode3(statements[current]);
138439
138446
  current++;
138440
138447
  }
138441
138448
  if (current === n)
138442
138449
  break;
138443
138450
  const firstImport = current;
138444
138451
  while (current < n && isAnyImportSyntax(statements[current])) {
138445
- addOutliningForLeadingCommentsForNode(statements[current], sourceFile, cancellationToken, out);
138452
+ visitNode3(statements[current]);
138446
138453
  current++;
138447
138454
  }
138448
138455
  const lastImport = current - 1;
@@ -138450,7 +138457,7 @@ ${lanes.join("\n")}
138450
138457
  out.push(createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], 100 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */));
138451
138458
  }
138452
138459
  }
138453
- function visitNonImportNode(n2) {
138460
+ function visitNode3(n2) {
138454
138461
  var _a2;
138455
138462
  if (depthRemaining === 0)
138456
138463
  return;
@@ -138473,18 +138480,18 @@ ${lanes.join("\n")}
138473
138480
  depthRemaining--;
138474
138481
  if (isCallExpression(n2)) {
138475
138482
  depthRemaining++;
138476
- visitNonImportNode(n2.expression);
138483
+ visitNode3(n2.expression);
138477
138484
  depthRemaining--;
138478
- n2.arguments.forEach(visitNonImportNode);
138479
- (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNonImportNode);
138485
+ n2.arguments.forEach(visitNode3);
138486
+ (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNode3);
138480
138487
  } else if (isIfStatement(n2) && n2.elseStatement && isIfStatement(n2.elseStatement)) {
138481
- visitNonImportNode(n2.expression);
138482
- visitNonImportNode(n2.thenStatement);
138488
+ visitNode3(n2.expression);
138489
+ visitNode3(n2.thenStatement);
138483
138490
  depthRemaining++;
138484
- visitNonImportNode(n2.elseStatement);
138491
+ visitNode3(n2.elseStatement);
138485
138492
  depthRemaining--;
138486
138493
  } else {
138487
- n2.forEachChild(visitNonImportNode);
138494
+ n2.forEachChild(visitNode3);
138488
138495
  }
138489
138496
  depthRemaining++;
138490
138497
  }
@@ -138633,6 +138640,21 @@ ${lanes.join("\n")}
138633
138640
  return spanForCallExpression(n);
138634
138641
  case 214 /* ParenthesizedExpression */:
138635
138642
  return spanForParenthesizedExpression(n);
138643
+ case 272 /* NamedImports */:
138644
+ case 276 /* NamedExports */:
138645
+ case 296 /* AssertClause */:
138646
+ return spanForNamedImportsOrExportsOrAssertClause(n);
138647
+ }
138648
+ function spanForNamedImportsOrExportsOrAssertClause(node) {
138649
+ if (!node.elements.length) {
138650
+ return void 0;
138651
+ }
138652
+ const openToken = findChildOfKind(node, 18 /* OpenBraceToken */, sourceFile);
138653
+ const closeToken = findChildOfKind(node, 19 /* CloseBraceToken */, sourceFile);
138654
+ if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) {
138655
+ return void 0;
138656
+ }
138657
+ return spanBetweenTokens(openToken, closeToken, node, sourceFile, false, false);
138636
138658
  }
138637
138659
  function spanForCallExpression(node) {
138638
138660
  if (!node.arguments.length) {
@@ -161620,6 +161642,7 @@ ${e.message}`;
161620
161642
  nodeIsSynthesized: () => nodeIsSynthesized,
161621
161643
  nodeModuleNameResolver: () => nodeModuleNameResolver,
161622
161644
  nodeModulesPathPart: () => nodeModulesPathPart,
161645
+ nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver,
161623
161646
  nodeOrChildIsDecorated: () => nodeOrChildIsDecorated,
161624
161647
  nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd,
161625
161648
  nodePosToString: () => nodePosToString,
@@ -164268,6 +164291,7 @@ ${e.message}`;
164268
164291
  nodeIsSynthesized: () => nodeIsSynthesized,
164269
164292
  nodeModuleNameResolver: () => nodeModuleNameResolver,
164270
164293
  nodeModulesPathPart: () => nodeModulesPathPart,
164294
+ nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver,
164271
164295
  nodeOrChildIsDecorated: () => nodeOrChildIsDecorated,
164272
164296
  nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd,
164273
164297
  nodePosToString: () => nodePosToString,
package/lib/typescript.js CHANGED
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221219`;
45
+ version = `${versionMajorMinor}.0-dev.20221220`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -33869,7 +33869,7 @@ ${lanes.join("\n")}
33869
33869
  }
33870
33870
  return extendedConfigPath;
33871
33871
  }
33872
- const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
33872
+ const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host);
33873
33873
  if (resolved.resolvedModule) {
33874
33874
  return resolved.resolvedModule.resolvedFileName;
33875
33875
  }
@@ -36756,6 +36756,9 @@ ${lanes.join("\n")}
36756
36756
  }
36757
36757
  return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
36758
36758
  }
36759
+ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
36760
+ return nodeModuleNameResolverWorker(8 /* Exports */, moduleName, getDirectoryPath(containingFile), { moduleResolution: 99 /* NodeNext */ }, host, void 0, 8 /* Json */, true, void 0);
36761
+ }
36759
36762
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
36760
36763
  var _a2, _b;
36761
36764
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -36930,11 +36933,15 @@ ${lanes.join("\n")}
36930
36933
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
36931
36934
  }
36932
36935
  }
36933
- function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
36936
+ function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
36934
36937
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
36935
36938
  const result = tryFile(candidate, onlyRecordFailures, state);
36936
36939
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
36937
36940
  }
36941
+ if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
36942
+ const result = tryFile(candidate, onlyRecordFailures, state);
36943
+ return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0;
36944
+ }
36938
36945
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
36939
36946
  }
36940
36947
  function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
@@ -37077,7 +37084,7 @@ ${lanes.join("\n")}
37077
37084
  }
37078
37085
  const resolvedTarget = combinePaths(scope.packageDirectory, target);
37079
37086
  const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2));
37080
- const result = loadJSOrExactTSFileName(extensions, finalPath, false, state);
37087
+ const result = loadFileNameFromPackageJsonField(extensions, finalPath, false, state);
37081
37088
  if (result) {
37082
37089
  entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
37083
37090
  return true;
@@ -37431,7 +37438,7 @@ ${lanes.join("\n")}
37431
37438
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
37432
37439
  if (inputLink)
37433
37440
  return inputLink;
37434
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
37441
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, finalPath, false, state)));
37435
37442
  } else if (typeof target === "object" && target !== null) {
37436
37443
  if (!Array.isArray(target)) {
37437
37444
  for (const condition of getOwnKeys(target)) {
@@ -37526,7 +37533,7 @@ ${lanes.join("\n")}
37526
37533
  continue;
37527
37534
  const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
37528
37535
  if (state.host.fileExists(possibleInputWithInputExtension)) {
37529
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
37536
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, possibleInputWithInputExtension, false, state)));
37530
37537
  }
37531
37538
  }
37532
37539
  }
@@ -72760,7 +72767,7 @@ ${lanes.join("\n")}
72760
72767
  } else {
72761
72768
  if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
72762
72769
  grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
72763
- } else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
72770
+ } else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
72764
72771
  grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
72765
72772
  }
72766
72773
  }
@@ -106907,7 +106914,7 @@ ${lanes.join("\n")}
106907
106914
  return contains(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine;
106908
106915
  }
106909
106916
  function getLocaleTimeString(system) {
106910
- return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
106917
+ return !system.now ? new Date().toLocaleTimeString() : system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ");
106911
106918
  }
106912
106919
  function createWatchStatusReporter(system, pretty) {
106913
106920
  return pretty ? (diagnostic, newLine, options) => {
@@ -130994,7 +131001,7 @@ ${lanes.join("\n")}
130994
131001
  elements.push(factory.createNumericLiteral(type.value));
130995
131002
  break;
130996
131003
  case "string":
130997
- elements.push(factory.createStringLiteral(type.value));
131004
+ elements.push(factory.createStringLiteral(type.value, quotePreference === 0 /* Single */));
130998
131005
  break;
130999
131006
  }
131000
131007
  }
@@ -138449,14 +138456,14 @@ ${lanes.join("\n")}
138449
138456
  const n = statements.length;
138450
138457
  while (current < n) {
138451
138458
  while (current < n && !isAnyImportSyntax(statements[current])) {
138452
- visitNonImportNode(statements[current]);
138459
+ visitNode3(statements[current]);
138453
138460
  current++;
138454
138461
  }
138455
138462
  if (current === n)
138456
138463
  break;
138457
138464
  const firstImport = current;
138458
138465
  while (current < n && isAnyImportSyntax(statements[current])) {
138459
- addOutliningForLeadingCommentsForNode(statements[current], sourceFile, cancellationToken, out);
138466
+ visitNode3(statements[current]);
138460
138467
  current++;
138461
138468
  }
138462
138469
  const lastImport = current - 1;
@@ -138464,7 +138471,7 @@ ${lanes.join("\n")}
138464
138471
  out.push(createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], 100 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */));
138465
138472
  }
138466
138473
  }
138467
- function visitNonImportNode(n2) {
138474
+ function visitNode3(n2) {
138468
138475
  var _a2;
138469
138476
  if (depthRemaining === 0)
138470
138477
  return;
@@ -138487,18 +138494,18 @@ ${lanes.join("\n")}
138487
138494
  depthRemaining--;
138488
138495
  if (isCallExpression(n2)) {
138489
138496
  depthRemaining++;
138490
- visitNonImportNode(n2.expression);
138497
+ visitNode3(n2.expression);
138491
138498
  depthRemaining--;
138492
- n2.arguments.forEach(visitNonImportNode);
138493
- (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNonImportNode);
138499
+ n2.arguments.forEach(visitNode3);
138500
+ (_a2 = n2.typeArguments) == null ? void 0 : _a2.forEach(visitNode3);
138494
138501
  } else if (isIfStatement(n2) && n2.elseStatement && isIfStatement(n2.elseStatement)) {
138495
- visitNonImportNode(n2.expression);
138496
- visitNonImportNode(n2.thenStatement);
138502
+ visitNode3(n2.expression);
138503
+ visitNode3(n2.thenStatement);
138497
138504
  depthRemaining++;
138498
- visitNonImportNode(n2.elseStatement);
138505
+ visitNode3(n2.elseStatement);
138499
138506
  depthRemaining--;
138500
138507
  } else {
138501
- n2.forEachChild(visitNonImportNode);
138508
+ n2.forEachChild(visitNode3);
138502
138509
  }
138503
138510
  depthRemaining++;
138504
138511
  }
@@ -138647,6 +138654,21 @@ ${lanes.join("\n")}
138647
138654
  return spanForCallExpression(n);
138648
138655
  case 214 /* ParenthesizedExpression */:
138649
138656
  return spanForParenthesizedExpression(n);
138657
+ case 272 /* NamedImports */:
138658
+ case 276 /* NamedExports */:
138659
+ case 296 /* AssertClause */:
138660
+ return spanForNamedImportsOrExportsOrAssertClause(n);
138661
+ }
138662
+ function spanForNamedImportsOrExportsOrAssertClause(node) {
138663
+ if (!node.elements.length) {
138664
+ return void 0;
138665
+ }
138666
+ const openToken = findChildOfKind(node, 18 /* OpenBraceToken */, sourceFile);
138667
+ const closeToken = findChildOfKind(node, 19 /* CloseBraceToken */, sourceFile);
138668
+ if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) {
138669
+ return void 0;
138670
+ }
138671
+ return spanBetweenTokens(openToken, closeToken, node, sourceFile, false, false);
138650
138672
  }
138651
138673
  function spanForCallExpression(node) {
138652
138674
  if (!node.arguments.length) {
@@ -151996,6 +152018,7 @@ ${options.prefix}` : "\n" : options.prefix
151996
152018
  nodeIsSynthesized: () => nodeIsSynthesized,
151997
152019
  nodeModuleNameResolver: () => nodeModuleNameResolver,
151998
152020
  nodeModulesPathPart: () => nodeModulesPathPart,
152021
+ nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver,
151999
152022
  nodeOrChildIsDecorated: () => nodeOrChildIsDecorated,
152000
152023
  nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd,
152001
152024
  nodePosToString: () => nodePosToString,
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
50
50
 
51
51
  // src/compiler/corePublic.ts
52
52
  var versionMajorMinor = "5.0";
53
- var version = `${versionMajorMinor}.0-dev.20221219`;
53
+ var version = `${versionMajorMinor}.0-dev.20221220`;
54
54
 
55
55
  // src/compiler/core.ts
56
56
  var emptyArray = [];
@@ -26889,11 +26889,15 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
26889
26889
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
26890
26890
  }
26891
26891
  }
26892
- function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
26892
+ function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
26893
26893
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
26894
26894
  const result = tryFile(candidate, onlyRecordFailures, state);
26895
26895
  return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
26896
26896
  }
26897
+ if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
26898
+ const result = tryFile(candidate, onlyRecordFailures, state);
26899
+ return result !== void 0 ? { path: candidate, ext: ".json" /* Json */, resolvedUsingTsExtension: void 0 } : void 0;
26900
+ }
26897
26901
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
26898
26902
  }
26899
26903
  function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
@@ -27289,7 +27293,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
27289
27293
  const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
27290
27294
  if (inputLink)
27291
27295
  return inputLink;
27292
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state)));
27296
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, finalPath, false, state)));
27293
27297
  } else if (typeof target === "object" && target !== null) {
27294
27298
  if (!Array.isArray(target)) {
27295
27299
  for (const condition of getOwnKeys(target)) {
@@ -27384,7 +27388,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
27384
27388
  continue;
27385
27389
  const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
27386
27390
  if (state.host.fileExists(possibleInputWithInputExtension)) {
27387
- return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
27391
+ return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(extensions, possibleInputWithInputExtension, false, state)));
27388
27392
  }
27389
27393
  }
27390
27394
  }
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.0.0-dev.20221219",
5
+ "version": "5.0.0-dev.20221220",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [