typescript 5.0.0-dev.20230125 → 5.0.0-dev.20230127

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.20230125`;
26
+ var version = `${versionMajorMinor}.0-dev.20230127`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -7270,6 +7270,7 @@ var Diagnostics = {
7270
7270
  Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."),
7271
7271
  Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."),
7272
7272
  true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
7273
+ Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),
7273
7274
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
7274
7275
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
7275
7276
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -11724,6 +11725,20 @@ function getScriptTargetFeatures() {
11724
11725
  BigUint64Array: ["at"],
11725
11726
  ObjectConstructor: ["hasOwn"],
11726
11727
  Error: ["cause"]
11728
+ },
11729
+ es2023: {
11730
+ Array: ["findLastIndex", "findLast"],
11731
+ Int8Array: ["findLastIndex", "findLast"],
11732
+ Uint8Array: ["findLastIndex", "findLast"],
11733
+ Uint8ClampedArray: ["findLastIndex", "findLast"],
11734
+ Int16Array: ["findLastIndex", "findLast"],
11735
+ Uint16Array: ["findLastIndex", "findLast"],
11736
+ Int32Array: ["findLastIndex", "findLast"],
11737
+ Uint32Array: ["findLastIndex", "findLast"],
11738
+ Float32Array: ["findLastIndex", "findLast"],
11739
+ Float64Array: ["findLastIndex", "findLast"],
11740
+ BigInt64Array: ["findLastIndex", "findLast"],
11741
+ BigUint64Array: ["findLastIndex", "findLast"]
11727
11742
  }
11728
11743
  };
11729
11744
  }
@@ -15890,6 +15905,22 @@ function getAllowSyntheticDefaultImports(compilerOptions) {
15890
15905
  function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
15891
15906
  return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
15892
15907
  }
15908
+ function getResolvePackageJsonExports(compilerOptions) {
15909
+ const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
15910
+ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
15911
+ return false;
15912
+ }
15913
+ if (compilerOptions.resolvePackageJsonExports !== void 0) {
15914
+ return compilerOptions.resolvePackageJsonExports;
15915
+ }
15916
+ switch (moduleResolution) {
15917
+ case 3 /* Node16 */:
15918
+ case 99 /* NodeNext */:
15919
+ case 100 /* Bundler */:
15920
+ return true;
15921
+ }
15922
+ return false;
15923
+ }
15893
15924
  function getResolveJsonModule(compilerOptions) {
15894
15925
  if (compilerOptions.resolveJsonModule !== void 0) {
15895
15926
  return compilerOptions.resolveJsonModule;
@@ -33731,7 +33762,7 @@ var commandOptionsWithoutBuild = [
33731
33762
  {
33732
33763
  name: "allowArbitraryExtensions",
33733
33764
  type: "boolean",
33734
- affectsModuleResolution: true,
33765
+ affectsProgramStructure: true,
33735
33766
  category: Diagnostics.Modules,
33736
33767
  description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,
33737
33768
  defaultValueDescription: false
@@ -41796,8 +41827,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
41796
41827
  if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
41797
41828
  const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
41798
41829
  const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
41799
- if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) {
41800
- const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"];
41830
+ if (getResolvePackageJsonExports(options)) {
41831
+ const conditions = getConditions(options, importMode === 99 /* ESNext */);
41801
41832
  const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0;
41802
41833
  if (fromExports) {
41803
41834
  const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
@@ -46308,7 +46339,7 @@ function createTypeChecker(host) {
46308
46339
  return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
46309
46340
  function symbolToStringWorker(writer2) {
46310
46341
  const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
46311
- const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
46342
+ const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
46312
46343
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46313
46344
  printer.writeNode(
46314
46345
  4 /* Unspecified */,
@@ -46330,7 +46361,7 @@ function createTypeChecker(host) {
46330
46361
  sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
46331
46362
  }
46332
46363
  const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
46333
- const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
46364
+ const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
46334
46365
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46335
46366
  printer.writeNode(
46336
46367
  4 /* Unspecified */,
@@ -46347,8 +46378,7 @@ function createTypeChecker(host) {
46347
46378
  const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
46348
46379
  if (typeNode === void 0)
46349
46380
  return Debug.fail("should always get typenode");
46350
- const options = { removeComments: type !== unresolvedType };
46351
- const printer = createPrinter(options);
46381
+ const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
46352
46382
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
46353
46383
  printer.writeNode(
46354
46384
  4 /* Unspecified */,
@@ -49699,7 +49729,7 @@ function createTypeChecker(host) {
49699
49729
  typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
49700
49730
  // TODO: GH#18217
49701
49731
  );
49702
- const printer = createPrinter({ removeComments: true });
49732
+ const printer = createPrinterWithRemoveComments();
49703
49733
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
49704
49734
  printer.writeNode(
49705
49735
  4 /* Unspecified */,
@@ -64727,7 +64757,7 @@ function createTypeChecker(host) {
64727
64757
  return getNonMissingTypeOfSymbol(symbol);
64728
64758
  }
64729
64759
  function getControlFlowContainer(node) {
64730
- return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 295 /* CatchClause */ || node2.kind === 169 /* PropertyDeclaration */);
64760
+ return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
64731
64761
  }
64732
64762
  function isSymbolAssigned(symbol) {
64733
64763
  if (!symbol.valueDeclaration) {
@@ -64988,14 +65018,13 @@ function createTypeChecker(host) {
64988
65018
  const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
64989
65019
  const declarationContainer = getControlFlowContainer(declaration);
64990
65020
  let flowContainer = getControlFlowContainer(node);
64991
- const isCatch = flowContainer.kind === 295 /* CatchClause */;
64992
65021
  const isOuterVariable = flowContainer !== declarationContainer;
64993
65022
  const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
64994
65023
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
64995
65024
  while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
64996
65025
  flowContainer = getControlFlowContainer(flowContainer);
64997
65026
  }
64998
- const assumeInitialized = isParameter2 || isCatch || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
65027
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
64999
65028
  const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
65000
65029
  const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
65001
65030
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -78255,7 +78284,7 @@ function createTypeChecker(host) {
78255
78284
  if (typeAnnotationNode) {
78256
78285
  checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
78257
78286
  }
78258
- const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
78287
+ const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
78259
78288
  if (node.expression.kind === 79 /* Identifier */) {
78260
78289
  const id = node.expression;
78261
78290
  const sym = resolveEntityName(
@@ -106274,6 +106303,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
106274
106303
  );
106275
106304
  return outputFiles;
106276
106305
  }
106306
+ var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
106307
+ var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
106308
+ var createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
106309
+ var createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
106277
106310
  function createPrinter(printerOptions = {}, handlers = {}) {
106278
106311
  const {
106279
106312
  hasGlobalName,
@@ -116217,14 +116250,17 @@ function getBuildInfo2(state, bundle) {
116217
116250
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
116218
116251
  const fileNames = [];
116219
116252
  const fileNameToFileId = /* @__PURE__ */ new Map();
116253
+ const root = [];
116220
116254
  if (outFile(state.compilerOptions)) {
116221
116255
  const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
116222
- toFileId(key);
116256
+ const fileId = toFileId(key);
116257
+ tryAddRoot(key, fileId);
116223
116258
  return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
116224
116259
  });
116225
116260
  const program2 = {
116226
116261
  fileNames,
116227
116262
  fileInfos: fileInfos2,
116263
+ root,
116228
116264
  options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
116229
116265
  outSignature: state.outSignature,
116230
116266
  latestChangedDtsFile,
@@ -116252,6 +116288,7 @@ function getBuildInfo2(state, bundle) {
116252
116288
  const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
116253
116289
  var _a3, _b2;
116254
116290
  const fileId = toFileId(key);
116291
+ tryAddRoot(key, fileId);
116255
116292
  Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
116256
116293
  const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key);
116257
116294
  const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature;
@@ -116351,6 +116388,7 @@ function getBuildInfo2(state, bundle) {
116351
116388
  const program = {
116352
116389
  fileNames,
116353
116390
  fileInfos,
116391
+ root,
116354
116392
  options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
116355
116393
  fileIdsList,
116356
116394
  referencedMap,
@@ -116386,6 +116424,24 @@ function getBuildInfo2(state, bundle) {
116386
116424
  }
116387
116425
  return fileIdListId;
116388
116426
  }
116427
+ function tryAddRoot(path, fileId) {
116428
+ const file = state.program.getSourceFile(path);
116429
+ if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */))
116430
+ return;
116431
+ if (!root.length)
116432
+ return root.push(fileId);
116433
+ const last2 = root[root.length - 1];
116434
+ const isLastStartEnd = isArray(last2);
116435
+ if (isLastStartEnd && last2[1] === fileId - 1)
116436
+ return last2[1] = fileId;
116437
+ if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1)
116438
+ return root.push(fileId);
116439
+ const lastButOne = root[root.length - 2];
116440
+ if (!isNumber(lastButOne) || lastButOne !== last2 - 1)
116441
+ return root.push(fileId);
116442
+ root[root.length - 2] = [lastButOne, fileId];
116443
+ return root.length = root.length - 1;
116444
+ }
116389
116445
  function convertToProgramBuildInfoCompilerOptions(options) {
116390
116446
  let result;
116391
116447
  const { optionsNameMap } = getOptionsNameMap();
@@ -116893,12 +116949,28 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
116893
116949
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
116894
116950
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
116895
116951
  const fileInfos = /* @__PURE__ */ new Map();
116952
+ let rootIndex = 0;
116953
+ const roots = [];
116896
116954
  program.fileInfos.forEach((fileInfo, index) => {
116897
116955
  const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
116898
116956
  const version2 = isString(fileInfo) ? fileInfo : fileInfo.version;
116899
116957
  fileInfos.set(path, version2);
116958
+ if (rootIndex < program.root.length) {
116959
+ const current = program.root[rootIndex];
116960
+ const fileId = index + 1;
116961
+ if (isArray(current)) {
116962
+ if (current[0] <= fileId && fileId <= current[1]) {
116963
+ roots.push(path);
116964
+ if (current[1] === fileId)
116965
+ rootIndex++;
116966
+ }
116967
+ } else if (current === fileId) {
116968
+ roots.push(path);
116969
+ rootIndex++;
116970
+ }
116971
+ }
116900
116972
  });
116901
- return fileInfos;
116973
+ return { fileInfos, roots };
116902
116974
  }
116903
116975
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
116904
116976
  return {
@@ -120010,7 +120082,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
120010
120082
  }
120011
120083
  continue;
120012
120084
  }
120013
- if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) {
120085
+ if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) {
120014
120086
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
120015
120087
  return {
120016
120088
  kind: 2 /* UpdateOutputFileStamps */,
@@ -120022,7 +120094,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
120022
120094
  };
120023
120095
  }
120024
120096
  }
120025
- if (status.type === 11 /* UpstreamBlocked */) {
120097
+ if (status.type === 12 /* UpstreamBlocked */) {
120026
120098
  verboseReportProjectStatus(state, project, status);
120027
120099
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
120028
120100
  projectPendingBuild.delete(projectPath);
@@ -120036,7 +120108,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
120036
120108
  }
120037
120109
  continue;
120038
120110
  }
120039
- if (status.type === 15 /* ContainerOnly */) {
120111
+ if (status.type === 16 /* ContainerOnly */) {
120040
120112
  verboseReportProjectStatus(state, project, status);
120041
120113
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
120042
120114
  projectPendingBuild.delete(projectPath);
@@ -120223,31 +120295,31 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120223
120295
  var _a2, _b;
120224
120296
  if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
120225
120297
  return {
120226
- type: 15 /* ContainerOnly */
120298
+ type: 16 /* ContainerOnly */
120227
120299
  };
120228
120300
  }
120229
120301
  let referenceStatuses;
120230
120302
  const force = !!state.options.force;
120231
120303
  if (project.projectReferences) {
120232
- state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ });
120304
+ state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ });
120233
120305
  for (const ref of project.projectReferences) {
120234
120306
  const resolvedRef = resolveProjectReferencePath(ref);
120235
120307
  const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
120236
120308
  const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
120237
120309
  const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
120238
- if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) {
120310
+ if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) {
120239
120311
  continue;
120240
120312
  }
120241
- if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) {
120313
+ if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) {
120242
120314
  return {
120243
- type: 11 /* UpstreamBlocked */,
120315
+ type: 12 /* UpstreamBlocked */,
120244
120316
  upstreamProjectName: ref.path,
120245
- upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */
120317
+ upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */
120246
120318
  };
120247
120319
  }
120248
120320
  if (refStatus.type !== 1 /* UpToDate */) {
120249
120321
  return {
120250
- type: 10 /* UpstreamOutOfDate */,
120322
+ type: 11 /* UpstreamOutOfDate */,
120251
120323
  upstreamProjectName: ref.path
120252
120324
  };
120253
120325
  }
@@ -120256,7 +120328,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120256
120328
  }
120257
120329
  }
120258
120330
  if (force)
120259
- return { type: 16 /* ForceBuild */ };
120331
+ return { type: 17 /* ForceBuild */ };
120260
120332
  const { host } = state;
120261
120333
  const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options);
120262
120334
  let oldestOutputFileName;
@@ -120289,7 +120361,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120289
120361
  }
120290
120362
  if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) {
120291
120363
  return {
120292
- type: 13 /* TsVersionOutputOfDate */,
120364
+ type: 14 /* TsVersionOutputOfDate */,
120293
120365
  version: buildInfo.version
120294
120366
  };
120295
120367
  }
@@ -120314,6 +120386,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120314
120386
  let newestInputFileName = void 0;
120315
120387
  let newestInputFileTime = minimumDate;
120316
120388
  let pseudoInputUpToDate = false;
120389
+ const seenRoots = /* @__PURE__ */ new Set();
120317
120390
  for (const inputFile of project.fileNames) {
120318
120391
  const inputTime = getModifiedTime2(state, inputFile);
120319
120392
  if (inputTime === missingFileModifiedTime) {
@@ -120328,7 +120401,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120328
120401
  if (buildInfoProgram) {
120329
120402
  if (!buildInfoVersionMap)
120330
120403
  buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
120331
- version2 = buildInfoVersionMap.get(toPath2(state, inputFile));
120404
+ version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile));
120332
120405
  const text = version2 ? state.readFileWithCache(inputFile) : void 0;
120333
120406
  currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0;
120334
120407
  if (version2 && version2 === currentVersion)
@@ -120346,6 +120419,21 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120346
120419
  newestInputFileName = inputFile;
120347
120420
  newestInputFileTime = inputTime;
120348
120421
  }
120422
+ if (buildInfoProgram)
120423
+ seenRoots.add(toPath2(state, inputFile));
120424
+ }
120425
+ if (buildInfoProgram) {
120426
+ if (!buildInfoVersionMap)
120427
+ buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
120428
+ for (const existingRoot of buildInfoVersionMap.roots) {
120429
+ if (!seenRoots.has(existingRoot)) {
120430
+ return {
120431
+ type: 10 /* OutOfDateRoots */,
120432
+ buildInfoFile: buildInfoPath,
120433
+ inputFile: existingRoot
120434
+ };
120435
+ }
120436
+ }
120349
120437
  }
120350
120438
  if (!buildInfoPath) {
120351
120439
  const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
@@ -120427,7 +120515,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
120427
120515
  };
120428
120516
  }
120429
120517
  return {
120430
- type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
120518
+ type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
120431
120519
  newestInputFileTime,
120432
120520
  newestInputFileName,
120433
120521
  oldestOutputFileName
@@ -120546,7 +120634,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
120546
120634
  }
120547
120635
  break;
120548
120636
  }
120549
- case 14 /* UpToDateWithInputFileText */:
120637
+ case 15 /* UpToDateWithInputFileText */:
120550
120638
  case 2 /* UpToDateWithUpstreamTypes */:
120551
120639
  case 3 /* OutOfDateWithPrepend */:
120552
120640
  if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
@@ -120557,7 +120645,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
120557
120645
  });
120558
120646
  }
120559
120647
  break;
120560
- case 11 /* UpstreamBlocked */:
120648
+ case 12 /* UpstreamBlocked */:
120561
120649
  if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
120562
120650
  clearProjectStatus(state, nextProjectPath);
120563
120651
  }
@@ -121008,6 +121096,14 @@ function reportUpToDateStatus(state, configFileName, status) {
121008
121096
  relName(state, configFileName),
121009
121097
  relName(state, status.buildInfoFile)
121010
121098
  );
121099
+ case 10 /* OutOfDateRoots */:
121100
+ return reportStatus(
121101
+ state,
121102
+ Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
121103
+ relName(state, configFileName),
121104
+ relName(state, status.buildInfoFile),
121105
+ relName(state, status.inputFile)
121106
+ );
121011
121107
  case 1 /* UpToDate */:
121012
121108
  if (status.newestInputFileTime !== void 0) {
121013
121109
  return reportStatus(
@@ -121032,20 +121128,20 @@ function reportUpToDateStatus(state, configFileName, status) {
121032
121128
  Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
121033
121129
  relName(state, configFileName)
121034
121130
  );
121035
- case 14 /* UpToDateWithInputFileText */:
121131
+ case 15 /* UpToDateWithInputFileText */:
121036
121132
  return reportStatus(
121037
121133
  state,
121038
121134
  Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
121039
121135
  relName(state, configFileName)
121040
121136
  );
121041
- case 10 /* UpstreamOutOfDate */:
121137
+ case 11 /* UpstreamOutOfDate */:
121042
121138
  return reportStatus(
121043
121139
  state,
121044
121140
  Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,
121045
121141
  relName(state, configFileName),
121046
121142
  relName(state, status.upstreamProjectName)
121047
121143
  );
121048
- case 11 /* UpstreamBlocked */:
121144
+ case 12 /* UpstreamBlocked */:
121049
121145
  return reportStatus(
121050
121146
  state,
121051
121147
  status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
@@ -121059,7 +121155,7 @@ function reportUpToDateStatus(state, configFileName, status) {
121059
121155
  relName(state, configFileName),
121060
121156
  status.reason
121061
121157
  );
121062
- case 13 /* TsVersionOutputOfDate */:
121158
+ case 14 /* TsVersionOutputOfDate */:
121063
121159
  return reportStatus(
121064
121160
  state,
121065
121161
  Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
@@ -121067,14 +121163,14 @@ function reportUpToDateStatus(state, configFileName, status) {
121067
121163
  status.version,
121068
121164
  version
121069
121165
  );
121070
- case 16 /* ForceBuild */:
121166
+ case 17 /* ForceBuild */:
121071
121167
  return reportStatus(
121072
121168
  state,
121073
121169
  Diagnostics.Project_0_is_being_forcibly_rebuilt,
121074
121170
  relName(state, configFileName)
121075
121171
  );
121076
- case 15 /* ContainerOnly */:
121077
- case 12 /* ComputingUpstream */:
121172
+ case 16 /* ContainerOnly */:
121173
+ case 13 /* ComputingUpstream */:
121078
121174
  break;
121079
121175
  default:
121080
121176
  assertType(status);