@typescript-deploys/pr-build 4.8.0-pr-48784-20 → 4.8.0-pr-49285-8

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.
@@ -6405,7 +6405,7 @@ var ts;
6405
6405
  };
6406
6406
  }
6407
6407
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6408
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6408
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6409
6409
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6410
6410
  if (!ts.isString(relativeFileName))
6411
6411
  return;
@@ -6415,7 +6415,7 @@ var ts;
6415
6415
  if (callbacks) {
6416
6416
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6417
6417
  var fileCallback = callbacks_1[_i];
6418
- fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6418
+ fileCallback(fileName, FileWatcherEventKind.Changed);
6419
6419
  }
6420
6420
  }
6421
6421
  },
@@ -6469,7 +6469,7 @@ var ts;
6469
6469
  }
6470
6470
  else {
6471
6471
  cache.set(path, {
6472
- watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6472
+ watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6473
6473
  refCount: 1
6474
6474
  });
6475
6475
  }
@@ -6497,7 +6497,7 @@ var ts;
6497
6497
  var newTime = modifiedTime.getTime();
6498
6498
  if (oldTime !== newTime) {
6499
6499
  watchedFile.mtime = modifiedTime;
6500
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6500
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6501
6501
  return true;
6502
6502
  }
6503
6503
  return false;
@@ -6748,18 +6748,17 @@ var ts;
6748
6748
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6749
6749
  /*@internal*/
6750
6750
  function createFileWatcherCallback(callback) {
6751
- return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6751
+ return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6752
6752
  }
6753
6753
  ts.createFileWatcherCallback = createFileWatcherCallback;
6754
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6755
- return function (eventName, _relativeFileName, modifiedTime) {
6754
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6755
+ return function (eventName) {
6756
6756
  if (eventName === "rename") {
6757
- modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6758
- callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6757
+ callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6759
6758
  }
6760
6759
  else {
6761
6760
  // Change
6762
- callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6761
+ callback(fileName, FileWatcherEventKind.Changed);
6763
6762
  }
6764
6763
  };
6765
6764
  }
@@ -6783,7 +6782,7 @@ var ts;
6783
6782
  }
6784
6783
  /*@internal*/
6785
6784
  function createSystemWatchFunctions(_a) {
6786
- var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind;
6785
+ var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, fileExists = _a.fileExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind;
6787
6786
  var dynamicPollingWatchFile;
6788
6787
  var fixedChunkSizePollingWatchFile;
6789
6788
  var nonPollingWatchFile;
@@ -6805,7 +6804,7 @@ var ts;
6805
6804
  case ts.WatchFileKind.FixedChunkSizePolling:
6806
6805
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6807
6806
  case ts.WatchFileKind.UseFsEvents:
6808
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6807
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6809
6808
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6810
6809
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6811
6810
  if (!nonPollingWatchFile) {
@@ -6987,6 +6986,7 @@ var ts;
6987
6986
  fsWatch: fsWatch,
6988
6987
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6989
6988
  getCurrentDirectory: getCurrentDirectory,
6989
+ fileExists: fileExists,
6990
6990
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6991
6991
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6992
6992
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7246,7 +7246,7 @@ var ts;
7246
7246
  // File changed
7247
7247
  eventKind = FileWatcherEventKind.Changed;
7248
7248
  }
7249
- callback(fileName, eventKind, curr.mtime);
7249
+ callback(fileName, eventKind);
7250
7250
  }
7251
7251
  }
7252
7252
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7272,10 +7272,10 @@ var ts;
7272
7272
  * Invoke the callback with rename and update the watcher if not closed
7273
7273
  * @param createWatcher
7274
7274
  */
7275
- function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7275
+ function invokeCallbackAndUpdateWatcher(createWatcher) {
7276
7276
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7277
7277
  // Call the callback for current directory
7278
- callback("rename", "", modifiedTime);
7278
+ callback("rename", "");
7279
7279
  // If watcher is not closed, update it
7280
7280
  if (watcher) {
7281
7281
  watcher.close();
@@ -7321,14 +7321,13 @@ var ts;
7321
7321
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7322
7322
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7323
7323
  // Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
7324
- var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
7325
7324
  return event === "rename" &&
7326
7325
  (!relativeName ||
7327
7326
  relativeName === lastDirectoryPart ||
7328
7327
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7329
- modifiedTime === ts.missingFileModifiedTime ?
7330
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7331
- callback(event, relativeName, modifiedTime);
7328
+ !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7329
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7330
+ callback(event, relativeName);
7332
7331
  }
7333
7332
  /**
7334
7333
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7342,15 +7341,12 @@ var ts;
7342
7341
  * and switch to existing file or directory when the missing filesystem entry is created
7343
7342
  */
7344
7343
  function watchMissingFileSystemEntry() {
7345
- return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
7346
- if (eventKind === FileWatcherEventKind.Created) {
7347
- modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
7348
- if (modifiedTime !== ts.missingFileModifiedTime) {
7349
- // Call the callback for current file or directory
7350
- // For now it could be callback for the inner directory creation,
7351
- // but just return current directory, better than current no-op
7352
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
7353
- }
7344
+ return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7345
+ if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7346
+ // Call the callback for current file or directory
7347
+ // For now it could be callback for the inner directory creation,
7348
+ // but just return current directory, better than current no-op
7349
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
7354
7350
  }
7355
7351
  }, fallbackPollingInterval, fallbackOptions);
7356
7352
  }
@@ -7500,19 +7496,12 @@ var ts;
7500
7496
  }
7501
7497
  function getModifiedTime(path) {
7502
7498
  var _a;
7503
- // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7504
- // the CPU time performance.
7505
- var originalStackTraceLimit = Error.stackTraceLimit;
7506
- Error.stackTraceLimit = 0;
7507
7499
  try {
7508
7500
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7509
7501
  }
7510
7502
  catch (e) {
7511
7503
  return undefined;
7512
7504
  }
7513
- finally {
7514
- Error.stackTraceLimit = originalStackTraceLimit;
7515
- }
7516
7505
  }
7517
7506
  function setModifiedTime(path, time) {
7518
7507
  try {
@@ -9535,8 +9524,8 @@ var ts;
9535
9524
  Cannot_prepend_project_0_because_it_does_not_have_outFile_set: diag(6308, ts.DiagnosticCategory.Error, "Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308", "Cannot prepend project '{0}' because it does not have 'outFile' set"),
9536
9525
  Output_file_0_from_project_1_does_not_exist: diag(6309, ts.DiagnosticCategory.Error, "Output_file_0_from_project_1_does_not_exist_6309", "Output file '{0}' from project '{1}' does not exist"),
9537
9526
  Referenced_project_0_may_not_disable_emit: diag(6310, ts.DiagnosticCategory.Error, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."),
9538
- Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"),
9539
- Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),
9527
+ Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2: diag(6350, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350", "Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'"),
9528
+ Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2: diag(6351, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'"),
9540
9529
  Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"),
9541
9530
  Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"),
9542
9531
  Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"),
@@ -9580,8 +9569,6 @@ var ts;
9580
9569
  Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6396, ts.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),
9581
9570
  Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6397, ts.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),
9582
9571
  Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, ts.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),
9583
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted: diag(6399, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes are not emitted"),
9584
- Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs update to timestamps of output files that are older than input files"),
9585
9572
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.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}'"),
9586
9573
  The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
9587
9574
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -20412,10 +20399,6 @@ var ts;
20412
20399
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20413
20400
  }
20414
20401
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20415
- function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20416
- return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20417
- }
20418
- ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20419
20402
  function getCompilerOptionValue(options, option) {
20420
20403
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20421
20404
  }
@@ -39456,7 +39439,6 @@ var ts;
39456
39439
  type: "boolean",
39457
39440
  affectsSemanticDiagnostics: true,
39458
39441
  affectsEmit: true,
39459
- affectsMultiFileEmitBuildInfo: true,
39460
39442
  category: ts.Diagnostics.Watch_and_Build_Modes,
39461
39443
  description: ts.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,
39462
39444
  defaultValueDescription: false,
@@ -39491,40 +39473,12 @@ var ts;
39491
39473
  affectsSourceFile: true,
39492
39474
  affectsModuleResolution: true,
39493
39475
  affectsEmit: true,
39494
- affectsMultiFileEmitBuildInfo: true,
39495
39476
  paramType: ts.Diagnostics.VERSION,
39496
39477
  showInSimplifiedHelpView: true,
39497
39478
  category: ts.Diagnostics.Language_and_Environment,
39498
39479
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39499
39480
  defaultValueDescription: 0 /* ES3 */,
39500
39481
  };
39501
- /*@internal*/
39502
- ts.moduleOptionDeclaration = {
39503
- name: "module",
39504
- shortName: "m",
39505
- type: new ts.Map(ts.getEntries({
39506
- none: ts.ModuleKind.None,
39507
- commonjs: ts.ModuleKind.CommonJS,
39508
- amd: ts.ModuleKind.AMD,
39509
- system: ts.ModuleKind.System,
39510
- umd: ts.ModuleKind.UMD,
39511
- es6: ts.ModuleKind.ES2015,
39512
- es2015: ts.ModuleKind.ES2015,
39513
- es2020: ts.ModuleKind.ES2020,
39514
- es2022: ts.ModuleKind.ES2022,
39515
- esnext: ts.ModuleKind.ESNext,
39516
- node16: ts.ModuleKind.Node16,
39517
- nodenext: ts.ModuleKind.NodeNext,
39518
- })),
39519
- affectsModuleResolution: true,
39520
- affectsEmit: true,
39521
- affectsMultiFileEmitBuildInfo: true,
39522
- paramType: ts.Diagnostics.KIND,
39523
- showInSimplifiedHelpView: true,
39524
- category: ts.Diagnostics.Modules,
39525
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39526
- defaultValueDescription: undefined,
39527
- };
39528
39482
  var commandOptionsWithoutBuild = [
39529
39483
  // CommandLine only options
39530
39484
  {
@@ -39586,14 +39540,37 @@ var ts;
39586
39540
  category: ts.Diagnostics.Command_line_Options,
39587
39541
  affectsSemanticDiagnostics: true,
39588
39542
  affectsEmit: true,
39589
- affectsMultiFileEmitBuildInfo: true,
39590
39543
  isCommandLineOnly: true,
39591
39544
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39592
39545
  defaultValueDescription: false,
39593
39546
  },
39594
39547
  // Basic
39595
39548
  ts.targetOptionDeclaration,
39596
- ts.moduleOptionDeclaration,
39549
+ {
39550
+ name: "module",
39551
+ shortName: "m",
39552
+ type: new ts.Map(ts.getEntries({
39553
+ none: ts.ModuleKind.None,
39554
+ commonjs: ts.ModuleKind.CommonJS,
39555
+ amd: ts.ModuleKind.AMD,
39556
+ system: ts.ModuleKind.System,
39557
+ umd: ts.ModuleKind.UMD,
39558
+ es6: ts.ModuleKind.ES2015,
39559
+ es2015: ts.ModuleKind.ES2015,
39560
+ es2020: ts.ModuleKind.ES2020,
39561
+ es2022: ts.ModuleKind.ES2022,
39562
+ esnext: ts.ModuleKind.ESNext,
39563
+ node16: ts.ModuleKind.Node16,
39564
+ nodenext: ts.ModuleKind.NodeNext,
39565
+ })),
39566
+ affectsModuleResolution: true,
39567
+ affectsEmit: true,
39568
+ paramType: ts.Diagnostics.KIND,
39569
+ showInSimplifiedHelpView: true,
39570
+ category: ts.Diagnostics.Modules,
39571
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
39572
+ defaultValueDescription: undefined,
39573
+ },
39597
39574
  {
39598
39575
  name: "lib",
39599
39576
  type: "list",
@@ -39630,7 +39607,6 @@ var ts;
39630
39607
  type: jsxOptionMap,
39631
39608
  affectsSourceFile: true,
39632
39609
  affectsEmit: true,
39633
- affectsMultiFileEmitBuildInfo: true,
39634
39610
  affectsModuleResolution: true,
39635
39611
  paramType: ts.Diagnostics.KIND,
39636
39612
  showInSimplifiedHelpView: true,
@@ -39643,7 +39619,6 @@ var ts;
39643
39619
  shortName: "d",
39644
39620
  type: "boolean",
39645
39621
  affectsEmit: true,
39646
- affectsMultiFileEmitBuildInfo: true,
39647
39622
  showInSimplifiedHelpView: true,
39648
39623
  category: ts.Diagnostics.Emit,
39649
39624
  transpileOptionValue: undefined,
@@ -39654,7 +39629,6 @@ var ts;
39654
39629
  name: "declarationMap",
39655
39630
  type: "boolean",
39656
39631
  affectsEmit: true,
39657
- affectsMultiFileEmitBuildInfo: true,
39658
39632
  showInSimplifiedHelpView: true,
39659
39633
  category: ts.Diagnostics.Emit,
39660
39634
  transpileOptionValue: undefined,
@@ -39665,7 +39639,6 @@ var ts;
39665
39639
  name: "emitDeclarationOnly",
39666
39640
  type: "boolean",
39667
39641
  affectsEmit: true,
39668
- affectsMultiFileEmitBuildInfo: true,
39669
39642
  showInSimplifiedHelpView: true,
39670
39643
  category: ts.Diagnostics.Emit,
39671
39644
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39676,7 +39649,6 @@ var ts;
39676
39649
  name: "sourceMap",
39677
39650
  type: "boolean",
39678
39651
  affectsEmit: true,
39679
- affectsMultiFileEmitBuildInfo: true,
39680
39652
  showInSimplifiedHelpView: true,
39681
39653
  category: ts.Diagnostics.Emit,
39682
39654
  defaultValueDescription: false,
@@ -39686,9 +39658,6 @@ var ts;
39686
39658
  name: "outFile",
39687
39659
  type: "string",
39688
39660
  affectsEmit: true,
39689
- affectsMultiFileEmitBuildInfo: true,
39690
- affectsDeclarationPath: true,
39691
- affectsBundleEmitBuildInfo: true,
39692
39661
  isFilePath: true,
39693
39662
  paramType: ts.Diagnostics.FILE,
39694
39663
  showInSimplifiedHelpView: true,
@@ -39700,8 +39669,6 @@ var ts;
39700
39669
  name: "outDir",
39701
39670
  type: "string",
39702
39671
  affectsEmit: true,
39703
- affectsMultiFileEmitBuildInfo: true,
39704
- affectsDeclarationPath: true,
39705
39672
  isFilePath: true,
39706
39673
  paramType: ts.Diagnostics.DIRECTORY,
39707
39674
  showInSimplifiedHelpView: true,
@@ -39712,8 +39679,6 @@ var ts;
39712
39679
  name: "rootDir",
39713
39680
  type: "string",
39714
39681
  affectsEmit: true,
39715
- affectsMultiFileEmitBuildInfo: true,
39716
- affectsDeclarationPath: true,
39717
39682
  isFilePath: true,
39718
39683
  paramType: ts.Diagnostics.LOCATION,
39719
39684
  category: ts.Diagnostics.Modules,
@@ -39724,8 +39689,6 @@ var ts;
39724
39689
  name: "composite",
39725
39690
  type: "boolean",
39726
39691
  affectsEmit: true,
39727
- affectsMultiFileEmitBuildInfo: true,
39728
- affectsBundleEmitBuildInfo: true,
39729
39692
  isTSConfigOnly: true,
39730
39693
  category: ts.Diagnostics.Projects,
39731
39694
  transpileOptionValue: undefined,
@@ -39736,8 +39699,6 @@ var ts;
39736
39699
  name: "tsBuildInfoFile",
39737
39700
  type: "string",
39738
39701
  affectsEmit: true,
39739
- affectsMultiFileEmitBuildInfo: true,
39740
- affectsBundleEmitBuildInfo: true,
39741
39702
  isFilePath: true,
39742
39703
  paramType: ts.Diagnostics.FILE,
39743
39704
  category: ts.Diagnostics.Projects,
@@ -39749,7 +39710,6 @@ var ts;
39749
39710
  name: "removeComments",
39750
39711
  type: "boolean",
39751
39712
  affectsEmit: true,
39752
- affectsMultiFileEmitBuildInfo: true,
39753
39713
  showInSimplifiedHelpView: true,
39754
39714
  category: ts.Diagnostics.Emit,
39755
39715
  defaultValueDescription: false,
@@ -39768,7 +39728,6 @@ var ts;
39768
39728
  name: "importHelpers",
39769
39729
  type: "boolean",
39770
39730
  affectsEmit: true,
39771
- affectsMultiFileEmitBuildInfo: true,
39772
39731
  category: ts.Diagnostics.Emit,
39773
39732
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39774
39733
  defaultValueDescription: false,
@@ -39782,7 +39741,6 @@ var ts;
39782
39741
  })),
39783
39742
  affectsEmit: true,
39784
39743
  affectsSemanticDiagnostics: true,
39785
- affectsMultiFileEmitBuildInfo: true,
39786
39744
  category: ts.Diagnostics.Emit,
39787
39745
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39788
39746
  defaultValueDescription: 0 /* Remove */,
@@ -39791,7 +39749,6 @@ var ts;
39791
39749
  name: "downlevelIteration",
39792
39750
  type: "boolean",
39793
39751
  affectsEmit: true,
39794
- affectsMultiFileEmitBuildInfo: true,
39795
39752
  category: ts.Diagnostics.Emit,
39796
39753
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39797
39754
  defaultValueDescription: false,
@@ -39810,9 +39767,6 @@ var ts;
39810
39767
  type: "boolean",
39811
39768
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39812
39769
  // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
39813
- // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
39814
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
39815
- affectsMultiFileEmitBuildInfo: true,
39816
39770
  showInSimplifiedHelpView: true,
39817
39771
  category: ts.Diagnostics.Type_Checking,
39818
39772
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39822,7 +39776,6 @@ var ts;
39822
39776
  name: "noImplicitAny",
39823
39777
  type: "boolean",
39824
39778
  affectsSemanticDiagnostics: true,
39825
- affectsMultiFileEmitBuildInfo: true,
39826
39779
  strictFlag: true,
39827
39780
  category: ts.Diagnostics.Type_Checking,
39828
39781
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39832,7 +39785,6 @@ var ts;
39832
39785
  name: "strictNullChecks",
39833
39786
  type: "boolean",
39834
39787
  affectsSemanticDiagnostics: true,
39835
- affectsMultiFileEmitBuildInfo: true,
39836
39788
  strictFlag: true,
39837
39789
  category: ts.Diagnostics.Type_Checking,
39838
39790
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39841,8 +39793,6 @@ var ts;
39841
39793
  {
39842
39794
  name: "strictFunctionTypes",
39843
39795
  type: "boolean",
39844
- affectsSemanticDiagnostics: true,
39845
- affectsMultiFileEmitBuildInfo: true,
39846
39796
  strictFlag: true,
39847
39797
  category: ts.Diagnostics.Type_Checking,
39848
39798
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39851,8 +39801,6 @@ var ts;
39851
39801
  {
39852
39802
  name: "strictBindCallApply",
39853
39803
  type: "boolean",
39854
- affectsSemanticDiagnostics: true,
39855
- affectsMultiFileEmitBuildInfo: true,
39856
39804
  strictFlag: true,
39857
39805
  category: ts.Diagnostics.Type_Checking,
39858
39806
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39862,7 +39810,6 @@ var ts;
39862
39810
  name: "strictPropertyInitialization",
39863
39811
  type: "boolean",
39864
39812
  affectsSemanticDiagnostics: true,
39865
- affectsMultiFileEmitBuildInfo: true,
39866
39813
  strictFlag: true,
39867
39814
  category: ts.Diagnostics.Type_Checking,
39868
39815
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39872,7 +39819,6 @@ var ts;
39872
39819
  name: "noImplicitThis",
39873
39820
  type: "boolean",
39874
39821
  affectsSemanticDiagnostics: true,
39875
- affectsMultiFileEmitBuildInfo: true,
39876
39822
  strictFlag: true,
39877
39823
  category: ts.Diagnostics.Type_Checking,
39878
39824
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39882,7 +39828,6 @@ var ts;
39882
39828
  name: "useUnknownInCatchVariables",
39883
39829
  type: "boolean",
39884
39830
  affectsSemanticDiagnostics: true,
39885
- affectsMultiFileEmitBuildInfo: true,
39886
39831
  strictFlag: true,
39887
39832
  category: ts.Diagnostics.Type_Checking,
39888
39833
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39892,8 +39837,6 @@ var ts;
39892
39837
  name: "alwaysStrict",
39893
39838
  type: "boolean",
39894
39839
  affectsSourceFile: true,
39895
- affectsEmit: true,
39896
- affectsMultiFileEmitBuildInfo: true,
39897
39840
  strictFlag: true,
39898
39841
  category: ts.Diagnostics.Type_Checking,
39899
39842
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39904,7 +39847,6 @@ var ts;
39904
39847
  name: "noUnusedLocals",
39905
39848
  type: "boolean",
39906
39849
  affectsSemanticDiagnostics: true,
39907
- affectsMultiFileEmitBuildInfo: true,
39908
39850
  category: ts.Diagnostics.Type_Checking,
39909
39851
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39910
39852
  defaultValueDescription: false,
@@ -39913,7 +39855,6 @@ var ts;
39913
39855
  name: "noUnusedParameters",
39914
39856
  type: "boolean",
39915
39857
  affectsSemanticDiagnostics: true,
39916
- affectsMultiFileEmitBuildInfo: true,
39917
39858
  category: ts.Diagnostics.Type_Checking,
39918
39859
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39919
39860
  defaultValueDescription: false,
@@ -39922,7 +39863,6 @@ var ts;
39922
39863
  name: "exactOptionalPropertyTypes",
39923
39864
  type: "boolean",
39924
39865
  affectsSemanticDiagnostics: true,
39925
- affectsMultiFileEmitBuildInfo: true,
39926
39866
  category: ts.Diagnostics.Type_Checking,
39927
39867
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39928
39868
  defaultValueDescription: false,
@@ -39931,7 +39871,6 @@ var ts;
39931
39871
  name: "noImplicitReturns",
39932
39872
  type: "boolean",
39933
39873
  affectsSemanticDiagnostics: true,
39934
- affectsMultiFileEmitBuildInfo: true,
39935
39874
  category: ts.Diagnostics.Type_Checking,
39936
39875
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39937
39876
  defaultValueDescription: false,
@@ -39941,7 +39880,6 @@ var ts;
39941
39880
  type: "boolean",
39942
39881
  affectsBindDiagnostics: true,
39943
39882
  affectsSemanticDiagnostics: true,
39944
- affectsMultiFileEmitBuildInfo: true,
39945
39883
  category: ts.Diagnostics.Type_Checking,
39946
39884
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39947
39885
  defaultValueDescription: false,
@@ -39950,7 +39888,6 @@ var ts;
39950
39888
  name: "noUncheckedIndexedAccess",
39951
39889
  type: "boolean",
39952
39890
  affectsSemanticDiagnostics: true,
39953
- affectsMultiFileEmitBuildInfo: true,
39954
39891
  category: ts.Diagnostics.Type_Checking,
39955
39892
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39956
39893
  defaultValueDescription: false,
@@ -39959,7 +39896,6 @@ var ts;
39959
39896
  name: "noImplicitOverride",
39960
39897
  type: "boolean",
39961
39898
  affectsSemanticDiagnostics: true,
39962
- affectsMultiFileEmitBuildInfo: true,
39963
39899
  category: ts.Diagnostics.Type_Checking,
39964
39900
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39965
39901
  defaultValueDescription: false,
@@ -39967,8 +39903,6 @@ var ts;
39967
39903
  {
39968
39904
  name: "noPropertyAccessFromIndexSignature",
39969
39905
  type: "boolean",
39970
- affectsSemanticDiagnostics: true,
39971
- affectsMultiFileEmitBuildInfo: true,
39972
39906
  showInSimplifiedHelpView: false,
39973
39907
  category: ts.Diagnostics.Type_Checking,
39974
39908
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -40054,7 +39988,6 @@ var ts;
40054
39988
  name: "allowSyntheticDefaultImports",
40055
39989
  type: "boolean",
40056
39990
  affectsSemanticDiagnostics: true,
40057
- affectsMultiFileEmitBuildInfo: true,
40058
39991
  category: ts.Diagnostics.Interop_Constraints,
40059
39992
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
40060
39993
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -40064,7 +39997,6 @@ var ts;
40064
39997
  type: "boolean",
40065
39998
  affectsSemanticDiagnostics: true,
40066
39999
  affectsEmit: true,
40067
- affectsMultiFileEmitBuildInfo: true,
40068
40000
  showInSimplifiedHelpView: true,
40069
40001
  category: ts.Diagnostics.Interop_Constraints,
40070
40002
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -40081,7 +40013,6 @@ var ts;
40081
40013
  name: "allowUmdGlobalAccess",
40082
40014
  type: "boolean",
40083
40015
  affectsSemanticDiagnostics: true,
40084
- affectsMultiFileEmitBuildInfo: true,
40085
40016
  category: ts.Diagnostics.Modules,
40086
40017
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
40087
40018
  defaultValueDescription: false,
@@ -40103,7 +40034,6 @@ var ts;
40103
40034
  name: "sourceRoot",
40104
40035
  type: "string",
40105
40036
  affectsEmit: true,
40106
- affectsMultiFileEmitBuildInfo: true,
40107
40037
  paramType: ts.Diagnostics.LOCATION,
40108
40038
  category: ts.Diagnostics.Emit,
40109
40039
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -40112,7 +40042,6 @@ var ts;
40112
40042
  name: "mapRoot",
40113
40043
  type: "string",
40114
40044
  affectsEmit: true,
40115
- affectsMultiFileEmitBuildInfo: true,
40116
40045
  paramType: ts.Diagnostics.LOCATION,
40117
40046
  category: ts.Diagnostics.Emit,
40118
40047
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -40121,7 +40050,6 @@ var ts;
40121
40050
  name: "inlineSourceMap",
40122
40051
  type: "boolean",
40123
40052
  affectsEmit: true,
40124
- affectsMultiFileEmitBuildInfo: true,
40125
40053
  category: ts.Diagnostics.Emit,
40126
40054
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
40127
40055
  defaultValueDescription: false,
@@ -40130,7 +40058,6 @@ var ts;
40130
40058
  name: "inlineSources",
40131
40059
  type: "boolean",
40132
40060
  affectsEmit: true,
40133
- affectsMultiFileEmitBuildInfo: true,
40134
40061
  category: ts.Diagnostics.Emit,
40135
40062
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
40136
40063
  defaultValueDescription: false,
@@ -40140,7 +40067,6 @@ var ts;
40140
40067
  name: "experimentalDecorators",
40141
40068
  type: "boolean",
40142
40069
  affectsSemanticDiagnostics: true,
40143
- affectsMultiFileEmitBuildInfo: true,
40144
40070
  category: ts.Diagnostics.Language_and_Environment,
40145
40071
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
40146
40072
  defaultValueDescription: false,
@@ -40150,7 +40076,6 @@ var ts;
40150
40076
  type: "boolean",
40151
40077
  affectsSemanticDiagnostics: true,
40152
40078
  affectsEmit: true,
40153
- affectsMultiFileEmitBuildInfo: true,
40154
40079
  category: ts.Diagnostics.Language_and_Environment,
40155
40080
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
40156
40081
  defaultValueDescription: false,
@@ -40175,7 +40100,6 @@ var ts;
40175
40100
  type: "string",
40176
40101
  affectsSemanticDiagnostics: true,
40177
40102
  affectsEmit: true,
40178
- affectsMultiFileEmitBuildInfo: true,
40179
40103
  affectsModuleResolution: true,
40180
40104
  category: ts.Diagnostics.Language_and_Environment,
40181
40105
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -40193,9 +40117,6 @@ var ts;
40193
40117
  name: "out",
40194
40118
  type: "string",
40195
40119
  affectsEmit: true,
40196
- affectsMultiFileEmitBuildInfo: true,
40197
- affectsDeclarationPath: true,
40198
- affectsBundleEmitBuildInfo: true,
40199
40120
  isFilePath: false,
40200
40121
  // for correct behaviour, please use outFile
40201
40122
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -40207,7 +40128,6 @@ var ts;
40207
40128
  name: "reactNamespace",
40208
40129
  type: "string",
40209
40130
  affectsEmit: true,
40210
- affectsMultiFileEmitBuildInfo: true,
40211
40131
  category: ts.Diagnostics.Language_and_Environment,
40212
40132
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
40213
40133
  defaultValueDescription: "`React`",
@@ -40215,8 +40135,6 @@ var ts;
40215
40135
  {
40216
40136
  name: "skipDefaultLibCheck",
40217
40137
  type: "boolean",
40218
- // We need to store these to determine whether `lib` files need to be rechecked
40219
- affectsMultiFileEmitBuildInfo: true,
40220
40138
  category: ts.Diagnostics.Completeness,
40221
40139
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
40222
40140
  defaultValueDescription: false,
@@ -40232,7 +40150,6 @@ var ts;
40232
40150
  name: "emitBOM",
40233
40151
  type: "boolean",
40234
40152
  affectsEmit: true,
40235
- affectsMultiFileEmitBuildInfo: true,
40236
40153
  category: ts.Diagnostics.Emit,
40237
40154
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
40238
40155
  defaultValueDescription: false,
@@ -40244,7 +40161,6 @@ var ts;
40244
40161
  lf: 1 /* LineFeed */
40245
40162
  })),
40246
40163
  affectsEmit: true,
40247
- affectsMultiFileEmitBuildInfo: true,
40248
40164
  paramType: ts.Diagnostics.NEWLINE,
40249
40165
  category: ts.Diagnostics.Emit,
40250
40166
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -40254,7 +40170,6 @@ var ts;
40254
40170
  name: "noErrorTruncation",
40255
40171
  type: "boolean",
40256
40172
  affectsSemanticDiagnostics: true,
40257
- affectsMultiFileEmitBuildInfo: true,
40258
40173
  category: ts.Diagnostics.Output_Formatting,
40259
40174
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
40260
40175
  defaultValueDescription: false,
@@ -40285,7 +40200,6 @@ var ts;
40285
40200
  name: "stripInternal",
40286
40201
  type: "boolean",
40287
40202
  affectsEmit: true,
40288
- affectsMultiFileEmitBuildInfo: true,
40289
40203
  category: ts.Diagnostics.Emit,
40290
40204
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
40291
40205
  defaultValueDescription: false,
@@ -40326,7 +40240,6 @@ var ts;
40326
40240
  name: "noImplicitUseStrict",
40327
40241
  type: "boolean",
40328
40242
  affectsSemanticDiagnostics: true,
40329
- affectsMultiFileEmitBuildInfo: true,
40330
40243
  category: ts.Diagnostics.Backwards_Compatibility,
40331
40244
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
40332
40245
  defaultValueDescription: false,
@@ -40335,7 +40248,6 @@ var ts;
40335
40248
  name: "noEmitHelpers",
40336
40249
  type: "boolean",
40337
40250
  affectsEmit: true,
40338
- affectsMultiFileEmitBuildInfo: true,
40339
40251
  category: ts.Diagnostics.Emit,
40340
40252
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
40341
40253
  defaultValueDescription: false,
@@ -40344,7 +40256,6 @@ var ts;
40344
40256
  name: "noEmitOnError",
40345
40257
  type: "boolean",
40346
40258
  affectsEmit: true,
40347
- affectsMultiFileEmitBuildInfo: true,
40348
40259
  category: ts.Diagnostics.Emit,
40349
40260
  transpileOptionValue: undefined,
40350
40261
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40354,7 +40265,6 @@ var ts;
40354
40265
  name: "preserveConstEnums",
40355
40266
  type: "boolean",
40356
40267
  affectsEmit: true,
40357
- affectsMultiFileEmitBuildInfo: true,
40358
40268
  category: ts.Diagnostics.Emit,
40359
40269
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40360
40270
  defaultValueDescription: false,
@@ -40363,8 +40273,6 @@ var ts;
40363
40273
  name: "declarationDir",
40364
40274
  type: "string",
40365
40275
  affectsEmit: true,
40366
- affectsMultiFileEmitBuildInfo: true,
40367
- affectsDeclarationPath: true,
40368
40276
  isFilePath: true,
40369
40277
  paramType: ts.Diagnostics.DIRECTORY,
40370
40278
  category: ts.Diagnostics.Emit,
@@ -40374,8 +40282,6 @@ var ts;
40374
40282
  {
40375
40283
  name: "skipLibCheck",
40376
40284
  type: "boolean",
40377
- // We need to store these to determine whether `lib` files need to be rechecked
40378
- affectsMultiFileEmitBuildInfo: true,
40379
40285
  category: ts.Diagnostics.Completeness,
40380
40286
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40381
40287
  defaultValueDescription: false,
@@ -40385,7 +40291,6 @@ var ts;
40385
40291
  type: "boolean",
40386
40292
  affectsBindDiagnostics: true,
40387
40293
  affectsSemanticDiagnostics: true,
40388
- affectsMultiFileEmitBuildInfo: true,
40389
40294
  category: ts.Diagnostics.Type_Checking,
40390
40295
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40391
40296
  defaultValueDescription: undefined,
@@ -40395,7 +40300,6 @@ var ts;
40395
40300
  type: "boolean",
40396
40301
  affectsBindDiagnostics: true,
40397
40302
  affectsSemanticDiagnostics: true,
40398
- affectsMultiFileEmitBuildInfo: true,
40399
40303
  category: ts.Diagnostics.Type_Checking,
40400
40304
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40401
40305
  defaultValueDescription: undefined,
@@ -40404,7 +40308,6 @@ var ts;
40404
40308
  name: "suppressExcessPropertyErrors",
40405
40309
  type: "boolean",
40406
40310
  affectsSemanticDiagnostics: true,
40407
- affectsMultiFileEmitBuildInfo: true,
40408
40311
  category: ts.Diagnostics.Backwards_Compatibility,
40409
40312
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40410
40313
  defaultValueDescription: false,
@@ -40413,7 +40316,6 @@ var ts;
40413
40316
  name: "suppressImplicitAnyIndexErrors",
40414
40317
  type: "boolean",
40415
40318
  affectsSemanticDiagnostics: true,
40416
- affectsMultiFileEmitBuildInfo: true,
40417
40319
  category: ts.Diagnostics.Backwards_Compatibility,
40418
40320
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40419
40321
  defaultValueDescription: false,
@@ -40438,7 +40340,6 @@ var ts;
40438
40340
  name: "noStrictGenericChecks",
40439
40341
  type: "boolean",
40440
40342
  affectsSemanticDiagnostics: true,
40441
- affectsMultiFileEmitBuildInfo: true,
40442
40343
  category: ts.Diagnostics.Backwards_Compatibility,
40443
40344
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40444
40345
  defaultValueDescription: false,
@@ -40448,7 +40349,6 @@ var ts;
40448
40349
  type: "boolean",
40449
40350
  affectsSemanticDiagnostics: true,
40450
40351
  affectsEmit: true,
40451
- affectsMultiFileEmitBuildInfo: true,
40452
40352
  category: ts.Diagnostics.Language_and_Environment,
40453
40353
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40454
40354
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40457,7 +40357,6 @@ var ts;
40457
40357
  name: "preserveValueImports",
40458
40358
  type: "boolean",
40459
40359
  affectsEmit: true,
40460
- affectsMultiFileEmitBuildInfo: true,
40461
40360
  category: ts.Diagnostics.Emit,
40462
40361
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40463
40362
  defaultValueDescription: false,
@@ -40501,8 +40400,6 @@ var ts;
40501
40400
  /* @internal */
40502
40401
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40503
40402
  /* @internal */
40504
- ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40505
- /* @internal */
40506
40403
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40507
40404
  /* @internal */
40508
40405
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -41365,7 +41262,6 @@ var ts;
41365
41262
  return optionDefinition.type;
41366
41263
  }
41367
41264
  }
41368
- /* @internal */
41369
41265
  function getNameOfCompilerOptionValue(value, customTypeMap) {
41370
41266
  // There is a typeMap associated with this command-line option so use it to map value back to its name
41371
41267
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41374,7 +41270,6 @@ var ts;
41374
41270
  }
41375
41271
  });
41376
41272
  }
41377
- ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41378
41273
  function serializeCompilerOptions(options, pathOptions) {
41379
41274
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41380
41275
  }
@@ -110657,8 +110552,7 @@ var ts;
110657
110552
  return;
110658
110553
  }
110659
110554
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
110660
- var buildInfo = { bundle: bundle, program: program, version: version };
110661
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
110555
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
110662
110556
  }
110663
110557
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
110664
110558
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110812,18 +110706,13 @@ var ts;
110812
110706
  if (sourceMapFilePath) {
110813
110707
  var sourceMap = sourceMapGenerator.toString();
110814
110708
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
110815
- if (printer.bundleFileInfo)
110816
- printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
110817
110709
  }
110818
110710
  }
110819
110711
  else {
110820
110712
  writer.writeLine();
110821
110713
  }
110822
110714
  // Write the output file
110823
- var text = writer.getText();
110824
- ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110825
- if (printer.bundleFileInfo)
110826
- printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
110715
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110827
110716
  // Reset state
110828
110717
  writer.clear();
110829
110718
  }
@@ -110966,54 +110855,34 @@ var ts;
110966
110855
  }
110967
110856
  /*@internal*/
110968
110857
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110969
- var createHash = ts.maybeBind(host, host.createHash);
110970
110858
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110971
- var buildInfo;
110972
- if (host.getBuildInfo) {
110973
- var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
110974
- if (!hostBuildInfo)
110975
- return buildInfoPath;
110976
- buildInfo = hostBuildInfo;
110977
- }
110978
- else {
110979
- var buildInfoText = host.readFile(buildInfoPath);
110980
- if (!buildInfoText)
110981
- return buildInfoPath;
110982
- buildInfo = getBuildInfo(buildInfoText);
110983
- }
110984
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
110859
+ var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110860
+ if (!buildInfoText)
110985
110861
  return buildInfoPath;
110986
110862
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110987
110863
  if (!jsFileText)
110988
110864
  return jsFilePath;
110989
- if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110990
- return jsFilePath;
110991
110865
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110992
110866
  // error if no source map or for now if inline sourcemap
110993
110867
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110994
110868
  return sourceMapFilePath || "inline sourcemap decoding";
110995
- if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110996
- return sourceMapFilePath;
110997
110869
  // read declaration text
110998
110870
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110999
110871
  if (declarationFilePath && !declarationText)
111000
110872
  return declarationFilePath;
111001
- if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
111002
- return declarationFilePath;
111003
110873
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
111004
110874
  // error if no source map or for now if inline sourcemap
111005
110875
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
111006
110876
  return declarationMapPath || "inline sourcemap decoding";
111007
- if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
111008
- return declarationMapPath;
110877
+ var buildInfo = getBuildInfo(buildInfoText);
110878
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110879
+ return buildInfoPath;
111009
110880
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
111010
110881
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
111011
110882
  /*onlyOwnText*/ true);
111012
110883
  var outputFiles = [];
111013
110884
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
111014
110885
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
111015
- var changedDtsText;
111016
- var changedDtsData;
111017
110886
  var emitHost = {
111018
110887
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
111019
110888
  getCanonicalFileName: host.getCanonicalFileName,
@@ -111029,7 +110898,7 @@ var ts;
111029
110898
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
111030
110899
  getProjectReferenceRedirect: ts.returnUndefined,
111031
110900
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
111032
- writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110901
+ writeFile: function (name, text, writeByteOrderMark) {
111033
110902
  switch (name) {
111034
110903
  case jsFilePath:
111035
110904
  if (jsFileText === text)
@@ -111040,13 +110909,8 @@ var ts;
111040
110909
  return;
111041
110910
  break;
111042
110911
  case buildInfoPath:
111043
- var newBuildInfo = data.buildInfo;
110912
+ var newBuildInfo = getBuildInfo(text);
111044
110913
  newBuildInfo.program = buildInfo.program;
111045
- if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
111046
- // Update the output signature
111047
- newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
111048
- newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
111049
- }
111050
110914
  // Update sourceFileInfo
111051
110915
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
111052
110916
  newBuildInfo.bundle.js.sources = js.sources;
@@ -111054,13 +110918,11 @@ var ts;
111054
110918
  newBuildInfo.bundle.dts.sources = dts.sources;
111055
110919
  }
111056
110920
  newBuildInfo.bundle.sourceFiles = sourceFiles;
111057
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110921
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
111058
110922
  return;
111059
110923
  case declarationFilePath:
111060
110924
  if (declarationText === text)
111061
110925
  return;
111062
- changedDtsText = text;
111063
- changedDtsData = data;
111064
110926
  break;
111065
110927
  case declarationMapPath:
111066
110928
  if (declarationMapText === text)
@@ -111079,7 +110941,6 @@ var ts;
111079
110941
  getSourceFileFromReference: ts.returnUndefined,
111080
110942
  redirectTargetsMap: ts.createMultiMap(),
111081
110943
  getFileIncludeReasons: ts.notImplemented,
111082
- createHash: createHash,
111083
110944
  };
111084
110945
  emitFiles(ts.notImplementedResolver, emitHost,
111085
110946
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -116164,10 +116025,12 @@ var ts;
116164
116025
  }
116165
116026
  ts.createCompilerHost = createCompilerHost;
116166
116027
  /*@internal*/
116028
+ // TODO(shkamat): update this after reworking ts build API
116167
116029
  function createCompilerHostWorker(options, setParentNodes, system) {
116168
116030
  if (system === void 0) { system = ts.sys; }
116169
116031
  var existingDirectories = new ts.Map();
116170
116032
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
116033
+ var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
116171
116034
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
116172
116035
  var text;
116173
116036
  try {
@@ -116200,7 +116063,7 @@ var ts;
116200
116063
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
116201
116064
  // the system.writeFile will do its own directory creation and
116202
116065
  // the ensureDirectoriesExist call will always be redundant.
116203
- ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); });
116066
+ ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function (path, data, writeByteOrderMark) { return writeFileWorker(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); });
116204
116067
  ts.performance.mark("afterIOWrite");
116205
116068
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
116206
116069
  }
@@ -116210,6 +116073,35 @@ var ts;
116210
116073
  }
116211
116074
  }
116212
116075
  }
116076
+ var outputFingerprints;
116077
+ function writeFileWorker(fileName, data, writeByteOrderMark) {
116078
+ if (!ts.isWatchSet(options) || !system.getModifiedTime) {
116079
+ system.writeFile(fileName, data, writeByteOrderMark);
116080
+ return;
116081
+ }
116082
+ if (!outputFingerprints) {
116083
+ outputFingerprints = new ts.Map();
116084
+ }
116085
+ var hash = computeHash(data);
116086
+ var mtimeBefore = system.getModifiedTime(fileName);
116087
+ if (mtimeBefore) {
116088
+ var fingerprint = outputFingerprints.get(fileName);
116089
+ // If output has not been changed, and the file has no external modification
116090
+ if (fingerprint &&
116091
+ fingerprint.byteOrderMark === writeByteOrderMark &&
116092
+ fingerprint.hash === hash &&
116093
+ fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
116094
+ return;
116095
+ }
116096
+ }
116097
+ system.writeFile(fileName, data, writeByteOrderMark);
116098
+ var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
116099
+ outputFingerprints.set(fileName, {
116100
+ hash: hash,
116101
+ byteOrderMark: writeByteOrderMark,
116102
+ mtime: mtimeAfter
116103
+ });
116104
+ }
116213
116105
  function getDefaultLibLocation() {
116214
116106
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
116215
116107
  }
@@ -117799,7 +117691,6 @@ var ts;
117799
117691
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
117800
117692
  redirectTargetsMap: redirectTargetsMap,
117801
117693
  getFileIncludeReasons: program.getFileIncludeReasons,
117802
- createHash: ts.maybeBind(host, host.createHash),
117803
117694
  };
117804
117695
  }
117805
117696
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119913,9 +119804,13 @@ var ts;
119913
119804
  function createManyToManyPathMap() {
119914
119805
  function create(forward, reverse, deleted) {
119915
119806
  var map = {
119807
+ clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119808
+ forEach: function (fn) { return forward.forEach(fn); },
119916
119809
  getKeys: function (v) { return reverse.get(v); },
119917
119810
  getValues: function (k) { return forward.get(k); },
119811
+ hasKey: function (k) { return forward.has(k); },
119918
119812
  keys: function () { return forward.keys(); },
119813
+ deletedKeys: function () { return deleted; },
119919
119814
  deleteKey: function (k) {
119920
119815
  (deleted || (deleted = new ts.Set())).add(k);
119921
119816
  var set = forward.get(k);
@@ -119942,6 +119837,11 @@ var ts;
119942
119837
  });
119943
119838
  return map;
119944
119839
  },
119840
+ clear: function () {
119841
+ forward.clear();
119842
+ reverse.clear();
119843
+ deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119844
+ }
119945
119845
  };
119946
119846
  return map;
119947
119847
  }
@@ -120069,21 +119969,18 @@ var ts;
120069
119969
  * Creates the state of file references and signature for the new program from oldState if it is safe
120070
119970
  */
120071
119971
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120072
- var _a, _b, _c;
120073
119972
  var fileInfos = new ts.Map();
120074
119973
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
120075
119974
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119975
+ var hasCalledUpdateShapeSignature = new ts.Set();
120076
119976
  var useOldState = canReuseOldState(referencedMap, oldState);
120077
119977
  // Ensure source files have parent pointers set
120078
119978
  newProgram.getTypeChecker();
120079
119979
  // Create the reference map, and set the file infos
120080
- for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
120081
- var sourceFile = _d[_i];
119980
+ for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119981
+ var sourceFile = _a[_i];
120082
119982
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
120083
- var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
120084
- var signature = oldUncommitedSignature === undefined ?
120085
- useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
120086
- oldUncommitedSignature || undefined;
119983
+ var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
120087
119984
  if (referencedMap) {
120088
119985
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
120089
119986
  if (newReferences) {
@@ -120091,26 +119988,19 @@ var ts;
120091
119988
  }
120092
119989
  // Copy old visible to outside files map
120093
119990
  if (useOldState) {
120094
- var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
120095
- var exportedModules = oldUncommitedExportedModules === undefined ?
120096
- oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
120097
- oldUncommitedExportedModules || undefined;
119991
+ var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
120098
119992
  if (exportedModules) {
120099
119993
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
120100
119994
  }
120101
119995
  }
120102
119996
  }
120103
- fileInfos.set(sourceFile.resolvedPath, {
120104
- version: version_2,
120105
- signature: signature,
120106
- affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
120107
- impliedFormat: sourceFile.impliedNodeFormat
120108
- });
119997
+ fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
120109
119998
  }
120110
119999
  return {
120111
120000
  fileInfos: fileInfos,
120112
120001
  referencedMap: referencedMap,
120113
120002
  exportedModulesMap: exportedModulesMap,
120003
+ hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
120114
120004
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
120115
120005
  };
120116
120006
  }
@@ -120124,42 +120014,71 @@ var ts;
120124
120014
  }
120125
120015
  BuilderState.releaseCache = releaseCache;
120126
120016
  /**
120127
- * Gets the files affected by the path from the program
120017
+ * Creates a clone of the state
120128
120018
  */
120129
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
120019
+ function clone(state) {
120130
120020
  var _a, _b;
120131
- var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
120132
- (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
120133
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120134
- return result;
120021
+ // Dont need to backup allFiles info since its cache anyway
120022
+ return {
120023
+ fileInfos: new ts.Map(state.fileInfos),
120024
+ referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
120025
+ exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
120026
+ hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
120027
+ useFileVersionAsSignature: state.useFileVersionAsSignature,
120028
+ };
120135
120029
  }
120136
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
120137
- function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
120030
+ BuilderState.clone = clone;
120031
+ /**
120032
+ * Gets the files affected by the path from the program
120033
+ */
120034
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
120035
+ // Since the operation could be cancelled, the signatures are always stored in the cache
120036
+ // They will be committed once it is safe to use them
120037
+ // eg when calling this api from tsserver, if there is no cancellation of the operation
120038
+ // In the other cases the affected files signatures are committed only after the iteration through the result is complete
120039
+ var signatureCache = cacheToUpdateSignature || new ts.Map();
120138
120040
  var sourceFile = programOfThisState.getSourceFileByPath(path);
120139
120041
  if (!sourceFile) {
120140
120042
  return ts.emptyArray;
120141
120043
  }
120142
- if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
120044
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
120143
120045
  return [sourceFile];
120144
120046
  }
120145
- return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
120047
+ var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
120048
+ if (!cacheToUpdateSignature) {
120049
+ // Commit all the signatures in the signature cache
120050
+ updateSignaturesFromCache(state, signatureCache);
120051
+ }
120052
+ return result;
120053
+ }
120054
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
120055
+ /**
120056
+ * Updates the signatures from the cache into state's fileinfo signatures
120057
+ * This should be called whenever it is safe to commit the state of the builder
120058
+ */
120059
+ function updateSignaturesFromCache(state, signatureCache) {
120060
+ signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
120146
120061
  }
120147
- BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
120062
+ BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
120148
120063
  function updateSignatureOfFile(state, signature, path) {
120149
120064
  state.fileInfos.get(path).signature = signature;
120150
- (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
120065
+ state.hasCalledUpdateShapeSignature.add(path);
120151
120066
  }
120152
120067
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
120153
120068
  /**
120154
120069
  * Returns if the shape of the signature has changed since last emit
120155
120070
  */
120156
- function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
120157
- var _a;
120071
+ function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
120158
120072
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
120073
+ ts.Debug.assert(!!sourceFile);
120074
+ ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
120159
120075
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
120160
- if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
120076
+ if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
120161
120077
  return false;
120078
+ }
120162
120079
  var info = state.fileInfos.get(sourceFile.resolvedPath);
120080
+ if (!info)
120081
+ return ts.Debug.fail();
120163
120082
  var prevSignature = info.signature;
120164
120083
  var latestSignature;
120165
120084
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -120170,55 +120089,45 @@ var ts;
120170
120089
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
120171
120090
  if (firstDts_1) {
120172
120091
  ts.Debug.assert(ts.isDeclarationFileName(firstDts_1.name), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
120173
- latestSignature = computeSignature(firstDts_1.text, computeHash);
120174
- if (latestSignature !== prevSignature) {
120175
- updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
120092
+ latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
120093
+ if (exportedModulesMapCache && latestSignature !== prevSignature) {
120094
+ updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
120176
120095
  }
120177
120096
  }
120178
120097
  }
120179
120098
  // Default is to use file version as signature
120180
120099
  if (latestSignature === undefined) {
120181
120100
  latestSignature = sourceFile.version;
120182
- if (state.exportedModulesMap && latestSignature !== prevSignature) {
120183
- (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
120101
+ if (exportedModulesMapCache && latestSignature !== prevSignature) {
120184
120102
  // All the references in this file are exported
120185
120103
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
120186
120104
  if (references) {
120187
- state.exportedModulesMap.set(sourceFile.resolvedPath, references);
120105
+ exportedModulesMapCache.set(sourceFile.resolvedPath, references);
120188
120106
  }
120189
120107
  else {
120190
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120108
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120191
120109
  }
120192
120110
  }
120193
120111
  }
120194
- (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
120195
- (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
120196
- info.signature = latestSignature;
120112
+ cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
120197
120113
  return latestSignature !== prevSignature;
120198
120114
  }
120199
120115
  BuilderState.updateShapeSignature = updateShapeSignature;
120200
- function computeSignature(text, computeHash) {
120201
- return (computeHash || ts.generateDjb2Hash)(text);
120202
- }
120203
- BuilderState.computeSignature = computeSignature;
120204
120116
  /**
120205
120117
  * Coverts the declaration emit result into exported modules map
120206
120118
  */
120207
- function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
120208
- if (!state.exportedModulesMap)
120209
- return;
120210
- (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
120119
+ function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
120211
120120
  if (!exportedModulesFromDeclarationEmit) {
120212
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120121
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120213
120122
  return;
120214
120123
  }
120215
120124
  var exportedModules;
120216
120125
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
120217
120126
  if (exportedModules) {
120218
- state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
120127
+ exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
120219
120128
  }
120220
120129
  else {
120221
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120130
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120222
120131
  }
120223
120132
  function addExportedModule(exportedModulePaths) {
120224
120133
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -120230,6 +120139,19 @@ var ts;
120230
120139
  }
120231
120140
  }
120232
120141
  BuilderState.updateExportedModules = updateExportedModules;
120142
+ /**
120143
+ * Updates the exported modules from cache into state's exported modules map
120144
+ * This should be called whenever it is safe to commit the state of the builder
120145
+ */
120146
+ function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
120147
+ var _a;
120148
+ if (exportedModulesMapCache) {
120149
+ ts.Debug.assert(!!state.exportedModulesMap);
120150
+ (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
120151
+ exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
120152
+ }
120153
+ }
120154
+ BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
120233
120155
  /**
120234
120156
  * Get all the dependencies of the sourceFile
120235
120157
  */
@@ -120350,7 +120272,7 @@ var ts;
120350
120272
  /**
120351
120273
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
120352
120274
  */
120353
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
120275
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
120354
120276
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
120355
120277
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
120356
120278
  }
@@ -120370,7 +120292,7 @@ var ts;
120370
120292
  if (!seenFileNamesMap.has(currentPath)) {
120371
120293
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
120372
120294
  seenFileNamesMap.set(currentPath, currentSourceFile);
120373
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
120295
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
120374
120296
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
120375
120297
  }
120376
120298
  }
@@ -120396,33 +120318,32 @@ var ts;
120396
120318
  * Create the state so that we can iterate on changedFiles/affected files
120397
120319
  */
120398
120320
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120399
- var _a, _b;
120400
120321
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
120401
120322
  state.program = newProgram;
120402
120323
  var compilerOptions = newProgram.getCompilerOptions();
120403
120324
  state.compilerOptions = compilerOptions;
120404
- var outFilePath = ts.outFile(compilerOptions);
120405
120325
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
120406
- if (!outFilePath) {
120326
+ if (!ts.outFile(compilerOptions)) {
120407
120327
  state.semanticDiagnosticsPerFile = new ts.Map();
120408
120328
  }
120409
- else if (compilerOptions.composite && (oldState === null || oldState === void 0 ? void 0 : oldState.outSignature) && outFilePath === ts.outFile(oldState === null || oldState === void 0 ? void 0 : oldState.compilerOptions)) {
120410
- state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
120411
- }
120412
120329
  state.changedFilesSet = new ts.Set();
120413
- state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
120414
120330
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
120415
120331
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
120416
120332
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
120417
120333
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
120418
- var canCopyEmitSignatures = compilerOptions.composite &&
120419
- (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
120420
- !outFilePath &&
120421
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
120422
120334
  if (useOldState) {
120335
+ // Verify the sanity of old state
120336
+ if (!oldState.currentChangedFilePath) {
120337
+ var affectedSignatures = oldState.currentAffectedFilesSignatures;
120338
+ ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
120339
+ }
120340
+ var changedFilesSet = oldState.changedFilesSet;
120341
+ if (canCopySemanticDiagnostics) {
120342
+ ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
120343
+ }
120423
120344
  // Copy old state's changed files set
120424
- (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
120425
- if (!outFilePath && oldState.affectedFilesPendingEmit) {
120345
+ changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
120346
+ if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
120426
120347
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
120427
120348
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
120428
120349
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -120443,8 +120364,6 @@ var ts;
120443
120364
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
120444
120365
  // versions dont match
120445
120366
  oldInfo.version !== info.version ||
120446
- // Implied formats dont match
120447
- oldInfo.impliedFormat !== info.impliedFormat ||
120448
120367
  // Referenced files changed
120449
120368
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
120450
120369
  // Referenced file was deleted in the new program
@@ -120468,25 +120387,27 @@ var ts;
120468
120387
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
120469
120388
  }
120470
120389
  }
120471
- if (canCopyEmitSignatures) {
120472
- var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
120473
- if (oldEmitSignature)
120474
- (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
120475
- }
120476
120390
  });
120477
120391
  // If the global file is removed, add all files as changed
120478
120392
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
120479
120393
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
120480
120394
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
120481
120395
  }
120482
- else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120396
+ else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120483
120397
  // Add all files to affectedFilesPendingEmit since emit changed
120484
120398
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
120485
120399
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
120486
120400
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
120487
120401
  }
120488
- // Since old states change files set is copied, any additional change means we would need to emit build info
120489
- state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
120402
+ if (useOldState) {
120403
+ // Any time the interpretation of a source file changes, mark it as changed
120404
+ ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
120405
+ if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
120406
+ state.changedFilesSet.add(sourceFilePath);
120407
+ }
120408
+ });
120409
+ }
120410
+ state.buildInfoEmitPending = !!state.changedFilesSet.size;
120490
120411
  return state;
120491
120412
  }
120492
120413
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -120522,35 +120443,30 @@ var ts;
120522
120443
  ts.BuilderState.releaseCache(state);
120523
120444
  state.program = undefined;
120524
120445
  }
120525
- function backupEmitBuilderProgramState(state) {
120526
- var outFilePath = ts.outFile(state.compilerOptions);
120527
- // Only in --out changeFileSet is kept around till emit
120528
- ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
120529
- return {
120530
- affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
120531
- affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
120532
- affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
120533
- seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
120534
- programEmitComplete: state.programEmitComplete,
120535
- emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
120536
- outSignature: state.outSignature,
120537
- dtsChangeTime: state.dtsChangeTime,
120538
- hasChangedEmitSignature: state.hasChangedEmitSignature,
120539
- changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
120540
- };
120541
- }
120542
- function restoreEmitBuilderProgramState(state, backupEmitState) {
120543
- state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
120544
- state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
120545
- state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
120546
- state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
120547
- state.programEmitComplete = backupEmitState.programEmitComplete;
120548
- state.emitSignatures = backupEmitState.emitSignatures;
120549
- state.outSignature = backupEmitState.outSignature;
120550
- state.dtsChangeTime = backupEmitState.dtsChangeTime;
120551
- state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
120552
- if (backupEmitState.changedFilesSet)
120553
- state.changedFilesSet = backupEmitState.changedFilesSet;
120446
+ /**
120447
+ * Creates a clone of the state
120448
+ */
120449
+ function cloneBuilderProgramState(state) {
120450
+ var _a;
120451
+ var newState = ts.BuilderState.clone(state);
120452
+ newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
120453
+ newState.changedFilesSet = new ts.Set(state.changedFilesSet);
120454
+ newState.affectedFiles = state.affectedFiles;
120455
+ newState.affectedFilesIndex = state.affectedFilesIndex;
120456
+ newState.currentChangedFilePath = state.currentChangedFilePath;
120457
+ newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
120458
+ newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
120459
+ newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
120460
+ newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
120461
+ newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
120462
+ newState.program = state.program;
120463
+ newState.compilerOptions = state.compilerOptions;
120464
+ newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
120465
+ newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
120466
+ newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
120467
+ newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
120468
+ newState.programEmitComplete = state.programEmitComplete;
120469
+ return newState;
120554
120470
  }
120555
120471
  /**
120556
120472
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -120565,7 +120481,7 @@ var ts;
120565
120481
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
120566
120482
  */
120567
120483
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
120568
- var _a, _b;
120484
+ var _a;
120569
120485
  while (true) {
120570
120486
  var affectedFiles = state.affectedFiles;
120571
120487
  if (affectedFiles) {
@@ -120585,8 +120501,10 @@ var ts;
120585
120501
  state.changedFilesSet.delete(state.currentChangedFilePath);
120586
120502
  state.currentChangedFilePath = undefined;
120587
120503
  // Commit the changes in file signature
120588
- (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
120589
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120504
+ ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
120505
+ state.currentAffectedFilesSignatures.clear();
120506
+ ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120507
+ (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
120590
120508
  state.affectedFiles = undefined;
120591
120509
  }
120592
120510
  // Get next changed file
@@ -120604,7 +120522,12 @@ var ts;
120604
120522
  return program;
120605
120523
  }
120606
120524
  // Get next batch of affected files
120607
- state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
120525
+ if (!state.currentAffectedFilesSignatures)
120526
+ state.currentAffectedFilesSignatures = new ts.Map();
120527
+ if (state.exportedModulesMap) {
120528
+ state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
120529
+ }
120530
+ state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
120608
120531
  state.currentChangedFilePath = nextKey.value;
120609
120532
  state.affectedFilesIndex = 0;
120610
120533
  if (!state.seenAffectedFiles)
@@ -120656,6 +120579,7 @@ var ts;
120656
120579
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
120657
120580
  */
120658
120581
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120582
+ var _a;
120659
120583
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
120660
120584
  // If affected files is everything except default library, then nothing more to do
120661
120585
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -120663,9 +120587,10 @@ var ts;
120663
120587
  // When a change affects the global scope, all files are considered to be affected without updating their signature
120664
120588
  // That means when affected file is handled, its signature can be out of date
120665
120589
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
120666
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
120590
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
120667
120591
  return;
120668
120592
  }
120593
+ ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
120669
120594
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
120670
120595
  return;
120671
120596
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -120685,7 +120610,7 @@ var ts;
120685
120610
  // This ensures that we dont later during incremental builds considering wrong signature.
120686
120611
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
120687
120612
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
120688
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
120613
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
120689
120614
  // If not dts emit, nothing more to do
120690
120615
  if (ts.getEmitDeclarations(state.compilerOptions)) {
120691
120616
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -120706,10 +120631,27 @@ var ts;
120706
120631
  return !state.semanticDiagnosticsFromOldState.size;
120707
120632
  }
120708
120633
  function isChangedSignature(state, path) {
120709
- var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
120710
- var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120634
+ var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
120635
+ var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120711
120636
  return newSignature !== oldSignature;
120712
120637
  }
120638
+ function forEachKeyOfExportedModulesMap(state, filePath, fn) {
120639
+ // Go through exported modules from cache first
120640
+ var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
120641
+ var result = keys && ts.forEachKey(keys, fn);
120642
+ if (result)
120643
+ return result;
120644
+ // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
120645
+ keys = state.exportedModulesMap.getKeys(filePath);
120646
+ return keys && ts.forEachKey(keys, function (exportedFromPath) {
120647
+ var _a;
120648
+ // If the cache had an updated value, skip
120649
+ return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
120650
+ !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
120651
+ fn(exportedFromPath) :
120652
+ undefined;
120653
+ });
120654
+ }
120713
120655
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
120714
120656
  var _a;
120715
120657
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -120724,7 +120666,6 @@ var ts;
120724
120666
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
120725
120667
  */
120726
120668
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120727
- var _a;
120728
120669
  // If there was change in signature (dts output) for the changed file,
120729
120670
  // then only we need to handle pending file emit
120730
120671
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -120751,10 +120692,11 @@ var ts;
120751
120692
  }
120752
120693
  }
120753
120694
  }
120695
+ ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120754
120696
  var seenFileAndExportsOfFile = new ts.Set();
120755
120697
  // Go through exported modules from cache first
120756
120698
  // If exported modules has path, all files referencing file exported from are affected
120757
- (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120699
+ forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120758
120700
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
120759
120701
  return true;
120760
120702
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -120768,18 +120710,19 @@ var ts;
120768
120710
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
120769
120711
  */
120770
120712
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
120771
- var _a, _b;
120713
+ var _a;
120772
120714
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
120773
120715
  return undefined;
120774
120716
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
120775
120717
  return true;
120776
120718
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
120719
+ ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120777
120720
  // If exported modules has path, all files referencing file exported from are affected
120778
- (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120721
+ forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120779
120722
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
120780
120723
  });
120781
120724
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
120782
- (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
120725
+ (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120783
120726
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
120784
120727
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120785
120728
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120800,13 +120743,12 @@ var ts;
120800
120743
  }
120801
120744
  else {
120802
120745
  state.seenAffectedFiles.add(affected.resolvedPath);
120803
- // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120804
- state.buildInfoEmitPending = true;
120805
120746
  if (emitKind !== undefined) {
120806
120747
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120807
120748
  }
120808
120749
  if (isPendingEmit) {
120809
120750
  state.affectedFilesPendingEmitIndex++;
120751
+ state.buildInfoEmitPending = true;
120810
120752
  }
120811
120753
  else {
120812
120754
  state.affectedFilesIndex++;
@@ -120854,61 +120796,25 @@ var ts;
120854
120796
  }
120855
120797
  return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
120856
120798
  }
120857
- function isProgramBundleEmitBuildInfo(info) {
120858
- return !!ts.outFile(info.options || {});
120859
- }
120860
- ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
120861
120799
  /**
120862
120800
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120863
120801
  */
120864
- function getProgramBuildInfo(state, getCanonicalFileName, host) {
120865
- var outFilePath = ts.outFile(state.compilerOptions);
120866
- if (outFilePath && !state.compilerOptions.composite)
120867
- return;
120802
+ function getProgramBuildInfo(state, getCanonicalFileName) {
120803
+ if (ts.outFile(state.compilerOptions))
120804
+ return undefined;
120868
120805
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120869
120806
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
120870
- state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
120871
- if (outFilePath) {
120872
- var fileNames_1 = [];
120873
- var fileInfos_1 = [];
120874
- state.program.getRootFileNames().forEach(function (f) {
120875
- var sourceFile = state.program.getSourceFile(f);
120876
- if (!sourceFile)
120877
- return;
120878
- fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath));
120879
- fileInfos_1.push(sourceFile.version);
120880
- });
120881
- var result_15 = {
120882
- fileNames: fileNames_1,
120883
- fileInfos: fileInfos_1,
120884
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
120885
- outSignature: state.outSignature,
120886
- dtsChangeTime: state.dtsChangeTime,
120887
- };
120888
- return result_15;
120889
- }
120890
120807
  var fileNames = [];
120891
120808
  var fileNameToFileId = new ts.Map();
120892
120809
  var fileIdsList;
120893
120810
  var fileNamesToFileIdListId;
120894
- var emitSignatures;
120895
120811
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120896
- var _b, _c;
120897
120812
  var key = _a[0], value = _a[1];
120898
120813
  // Ensure fileId
120899
120814
  var fileId = toFileId(key);
120900
120815
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120901
- var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
120902
- var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
120903
- if (state.compilerOptions.composite) {
120904
- var file = state.program.getSourceFileByPath(key);
120905
- if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
120906
- var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
120907
- if (emitSignature !== actualSignature) {
120908
- (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
120909
- }
120910
- }
120911
- }
120816
+ var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120817
+ var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
120912
120818
  return value.version === actualSignature ?
120913
120819
  value.affectsGlobalScope || value.impliedFormat ?
120914
120820
  // If file version is same as signature, dont serialize signature
@@ -120916,11 +120822,11 @@ var ts;
120916
120822
  // If file info only contains version and signature and both are same we can just write string
120917
120823
  value.version :
120918
120824
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120919
- oldSignature === undefined ?
120825
+ signature === undefined ?
120920
120826
  // If we havent computed signature, use fileInfo as is
120921
120827
  value :
120922
120828
  // Serialize fileInfo with new updated signature
120923
- { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120829
+ { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120924
120830
  // Signature of the FileInfo is undefined, serialize it as false
120925
120831
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120926
120832
  });
@@ -120935,13 +120841,17 @@ var ts;
120935
120841
  if (state.exportedModulesMap) {
120936
120842
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120937
120843
  var _a;
120938
- var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120844
+ if (state.currentAffectedFilesExportedModulesMap) {
120845
+ if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120846
+ return undefined;
120847
+ }
120848
+ var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120849
+ if (newValue) {
120850
+ return [toFileId(key), toFileIdListId(newValue)];
120851
+ }
120852
+ }
120939
120853
  // Not in temporary cache, use existing value
120940
- if (oldValue === undefined)
120941
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120942
- if (oldValue)
120943
- return [toFileId(key), toFileIdListId(oldValue)];
120944
- return undefined;
120854
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120945
120855
  });
120946
120856
  }
120947
120857
  var semanticDiagnosticsPerFile;
@@ -120952,7 +120862,9 @@ var ts;
120952
120862
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120953
120863
  [
120954
120864
  toFileId(key),
120955
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120865
+ state.hasReusableDiagnostic ?
120866
+ value :
120867
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120956
120868
  ] :
120957
120869
  toFileId(key));
120958
120870
  }
@@ -120967,27 +120879,16 @@ var ts;
120967
120879
  }
120968
120880
  }
120969
120881
  }
120970
- var changeFileSet;
120971
- if (state.changedFilesSet.size) {
120972
- for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
120973
- var path = _e[_d];
120974
- (changeFileSet || (changeFileSet = [])).push(toFileId(path));
120975
- }
120976
- }
120977
- var result = {
120882
+ return {
120978
120883
  fileNames: fileNames,
120979
120884
  fileInfos: fileInfos,
120980
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120885
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120981
120886
  fileIdsList: fileIdsList,
120982
120887
  referencedMap: referencedMap,
120983
120888
  exportedModulesMap: exportedModulesMap,
120984
120889
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120985
120890
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120986
- changeFileSet: changeFileSet,
120987
- emitSignatures: emitSignatures,
120988
- dtsChangeTime: state.dtsChangeTime,
120989
120891
  };
120990
- return result;
120991
120892
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120992
120893
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120993
120894
  }
@@ -121012,18 +120913,24 @@ var ts;
121012
120913
  }
121013
120914
  return fileIdListId;
121014
120915
  }
121015
- function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
121016
- var result;
121017
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
121018
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
121019
- var name = _a[_i];
121020
- var optionInfo = optionsNameMap.get(name.toLowerCase());
121021
- if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
121022
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
121023
- }
120916
+ }
120917
+ function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120918
+ var result;
120919
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120920
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120921
+ var name = _a[_i];
120922
+ var optionKey = name.toLowerCase();
120923
+ var optionInfo = optionsNameMap.get(optionKey);
120924
+ if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120925
+ // We need to store `strict`, even though it won't be examined directly, so that the
120926
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120927
+ optionKey === "strict" ||
120928
+ // We need to store these to determine whether `lib` files need to be rechecked.
120929
+ optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120930
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
121024
120931
  }
121025
- return result;
121026
120932
  }
120933
+ return result;
121027
120934
  }
121028
120935
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
121029
120936
  if (option) {
@@ -121097,10 +121004,6 @@ var ts;
121097
121004
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
121098
121005
  }
121099
121006
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
121100
- function computeSignature(text, data, computeHash) {
121101
- return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
121102
- }
121103
- ts.computeSignature = computeSignature;
121104
121007
  function createBuilderProgram(kind, _a) {
121105
121008
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
121106
121009
  // Return same program if underlying program doesnt change
@@ -121119,8 +121022,8 @@ var ts;
121119
121022
  */
121120
121023
  var computeHash = ts.maybeBind(host, host.createHash);
121121
121024
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
121122
- var backupEmitState;
121123
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
121025
+ var backupState;
121026
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
121124
121027
  // To ensure that we arent storing any references to old program or new program without state
121125
121028
  newProgram = undefined; // TODO: GH#18217
121126
121029
  oldProgram = undefined;
@@ -121128,20 +121031,20 @@ var ts;
121128
121031
  var getState = function () { return state; };
121129
121032
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
121130
121033
  builderProgram.getState = getState;
121131
- builderProgram.backupEmitState = function () {
121132
- ts.Debug.assert(backupEmitState === undefined);
121133
- backupEmitState = backupEmitBuilderProgramState(state);
121034
+ builderProgram.backupState = function () {
121035
+ ts.Debug.assert(backupState === undefined);
121036
+ backupState = cloneBuilderProgramState(state);
121134
121037
  };
121135
- builderProgram.restoreEmitState = function () {
121136
- restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
121137
- backupEmitState = undefined;
121038
+ builderProgram.restoreState = function () {
121039
+ state = ts.Debug.checkDefined(backupState);
121040
+ backupState = undefined;
121138
121041
  };
121139
121042
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
121140
121043
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
121141
121044
  builderProgram.emit = emit;
121142
121045
  builderProgram.releaseProgram = function () {
121143
121046
  releaseCache(state);
121144
- backupEmitState = undefined;
121047
+ backupState = undefined;
121145
121048
  };
121146
121049
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
121147
121050
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -121200,59 +121103,35 @@ var ts;
121200
121103
  return toAffectedFileEmitResult(state,
121201
121104
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
121202
121105
  // Otherwise just affected file
121203
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
121204
- getWriteFileCallback(writeFile, customTransformers) :
121106
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
121107
+ getWriteFileUpdatingSignatureCallback(writeFile) :
121205
121108
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
121206
121109
  }
121207
- function getWriteFileCallback(writeFile, customTransformers) {
121110
+ function getWriteFileUpdatingSignatureCallback(writeFile) {
121208
121111
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
121209
- var _a, _b, _c;
121112
+ var _a;
121210
121113
  if (ts.isDeclarationFileName(fileName)) {
121211
- if (!ts.outFile(state.compilerOptions)) {
121212
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
121213
- var newSignature = void 0;
121214
- if (!customTransformers) {
121215
- var file = sourceFiles[0];
121216
- var info = state.fileInfos.get(file.resolvedPath);
121217
- if (info.signature === file.version) {
121218
- newSignature = computeSignature(text, data, computeHash);
121219
- if (newSignature !== file.version) { // Update it
121220
- if (host.storeFilesChangingSignatureDuringEmit)
121221
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
121222
- if (state.exportedModulesMap)
121223
- ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
121224
- if (state.affectedFiles) {
121225
- // Keep old signature so we know what to undo if cancellation happens
121226
- var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
121227
- if (existing === undefined)
121228
- (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
121229
- info.signature = newSignature;
121230
- }
121231
- else {
121232
- // These are directly commited
121233
- info.signature = newSignature;
121234
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
121235
- }
121236
- }
121114
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
121115
+ var file = sourceFiles[0];
121116
+ var info = state.fileInfos.get(file.resolvedPath);
121117
+ var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
121118
+ if (signature === file.version) {
121119
+ var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
121120
+ if (newSignature !== file.version) { // Update it
121121
+ if (host.storeFilesChangingSignatureDuringEmit)
121122
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
121123
+ if (state.exportedModulesMap)
121124
+ ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
121125
+ if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
121126
+ state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
121237
121127
  }
121238
- }
121239
- if (state.compilerOptions.composite) {
121240
- var filePath = sourceFiles[0].resolvedPath;
121241
- var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
121242
- newSignature || (newSignature = computeSignature(text, data, computeHash));
121243
- if (newSignature !== oldSignature) {
121244
- (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
121245
- state.hasChangedEmitSignature = true;
121128
+ else {
121129
+ info.signature = newSignature;
121130
+ if (state.exportedModulesMap)
121131
+ ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
121246
121132
  }
121247
121133
  }
121248
121134
  }
121249
- else if (state.compilerOptions.composite) {
121250
- var newSignature = computeSignature(text, data, computeHash);
121251
- if (newSignature !== state.outSignature) {
121252
- state.outSignature = newSignature;
121253
- state.hasChangedEmitSignature = true;
121254
- }
121255
- }
121256
121135
  }
121257
121136
  if (writeFile)
121258
121137
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -121317,8 +121196,8 @@ var ts;
121317
121196
  }
121318
121197
  }
121319
121198
  }
121320
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
121321
- getWriteFileCallback(writeFile, customTransformers) :
121199
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
121200
+ getWriteFileUpdatingSignatureCallback(writeFile) :
121322
121201
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
121323
121202
  }
121324
121203
  /**
@@ -121407,58 +121286,29 @@ var ts;
121407
121286
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
121408
121287
  }
121409
121288
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
121410
- function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121411
- var _a, _b, _c, _d;
121289
+ function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121290
+ var _a;
121412
121291
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121413
121292
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121414
- var state;
121415
- var filePaths;
121416
- var filePathsSetList;
121417
- if (isProgramBundleEmitBuildInfo(program)) {
121418
- state = {
121419
- fileInfos: new ts.Map(),
121420
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121421
- dtsChangeTime: program.dtsChangeTime,
121422
- outSignature: program.outSignature,
121423
- };
121424
- }
121425
- else {
121426
- filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
121427
- filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121428
- var fileInfos_2 = new ts.Map();
121429
- var emitSignatures_1 = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
121430
- program.fileInfos.forEach(function (fileInfo, index) {
121431
- var path = toFilePath(index + 1);
121432
- var stateFileInfo = toBuilderStateFileInfo(fileInfo);
121433
- fileInfos_2.set(path, stateFileInfo);
121434
- if (emitSignatures_1 && stateFileInfo.signature)
121435
- emitSignatures_1.set(path, stateFileInfo.signature);
121436
- });
121437
- (_d = program.emitSignatures) === null || _d === void 0 ? void 0 : _d.forEach(function (value) {
121438
- if (ts.isNumber(value))
121439
- emitSignatures_1.delete(toFilePath(value));
121440
- else
121441
- emitSignatures_1.set(toFilePath(value[0]), value[1]);
121442
- });
121443
- state = {
121444
- fileInfos: fileInfos_2,
121445
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121446
- referencedMap: toManyToManyPathMap(program.referencedMap),
121447
- exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121448
- semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
121449
- hasReusableDiagnostic: true,
121450
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121451
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121452
- affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121453
- changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
121454
- dtsChangeTime: program.dtsChangeTime,
121455
- emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
121456
- };
121457
- }
121293
+ var filePaths = program.fileNames.map(toPath);
121294
+ var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121295
+ var fileInfos = new ts.Map();
121296
+ program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
121297
+ var state = {
121298
+ fileInfos: fileInfos,
121299
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121300
+ referencedMap: toManyToManyPathMap(program.referencedMap),
121301
+ exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121302
+ semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
121303
+ hasReusableDiagnostic: true,
121304
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121305
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121306
+ affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121307
+ };
121458
121308
  return {
121459
121309
  getState: function () { return state; },
121460
- backupEmitState: ts.noop,
121461
- restoreEmitState: ts.noop,
121310
+ backupState: ts.noop,
121311
+ restoreState: ts.noop,
121462
121312
  getProgram: ts.notImplemented,
121463
121313
  getProgramOrUndefined: ts.returnUndefined,
121464
121314
  releaseProgram: ts.noop,
@@ -121503,24 +121353,12 @@ var ts;
121503
121353
  return map;
121504
121354
  }
121505
121355
  }
121506
- ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
121507
- function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
121508
- var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121509
- var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121510
- var fileInfos = new ts.Map();
121511
- program.fileInfos.forEach(function (fileInfo, index) {
121512
- var path = ts.toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
121513
- var version = ts.isString(fileInfo) ? fileInfo : fileInfo.version; // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
121514
- fileInfos.set(path, version);
121515
- });
121516
- return fileInfos;
121517
- }
121518
- ts.getBuildInfoFileVersionMap = getBuildInfoFileVersionMap;
121356
+ ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
121519
121357
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
121520
121358
  return {
121521
121359
  getState: ts.notImplemented,
121522
- backupEmitState: ts.noop,
121523
- restoreEmitState: ts.noop,
121360
+ backupState: ts.noop,
121361
+ restoreState: ts.noop,
121524
121362
  getProgram: getProgram,
121525
121363
  getProgramOrUndefined: function () { return getState().program; },
121526
121364
  releaseProgram: function () { return getState().program = undefined; },
@@ -122636,9 +122474,9 @@ var ts;
122636
122474
  if (!preferSymlinks) {
122637
122475
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
122638
122476
  // so we only need to remove them from the realpath filenames.
122639
- var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122640
- if (result_16)
122641
- return result_16;
122477
+ var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122478
+ if (result_15)
122479
+ return result_15;
122642
122480
  }
122643
122481
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
122644
122482
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -122658,10 +122496,10 @@ var ts;
122658
122496
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
122659
122497
  var symlinkDirectory = symlinkDirectories_1[_i];
122660
122498
  var option = ts.resolvePath(symlinkDirectory, relative);
122661
- var result_17 = cb(option, target === referenceRedirect);
122499
+ var result_16 = cb(option, target === referenceRedirect);
122662
122500
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
122663
- if (result_17)
122664
- return result_17;
122501
+ if (result_16)
122502
+ return result_16;
122665
122503
  }
122666
122504
  });
122667
122505
  });
@@ -123572,7 +123410,6 @@ var ts;
123572
123410
  readDirectory: ts.maybeBind(host, host.readDirectory),
123573
123411
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
123574
123412
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
123575
- now: ts.maybeBind(host, host.now),
123576
123413
  };
123577
123414
  function writeFile(fileName, text, writeByteOrderMark, onError) {
123578
123415
  try {
@@ -123633,7 +123470,6 @@ var ts;
123633
123470
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
123634
123471
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
123635
123472
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
123636
- now: ts.maybeBind(system, system.now),
123637
123473
  };
123638
123474
  }
123639
123475
  ts.createProgramHost = createProgramHost;
@@ -123701,26 +123537,20 @@ var ts;
123701
123537
  var ts;
123702
123538
  (function (ts) {
123703
123539
  function readBuilderProgram(compilerOptions, host) {
123540
+ if (ts.outFile(compilerOptions))
123541
+ return undefined;
123704
123542
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
123705
123543
  if (!buildInfoPath)
123706
123544
  return undefined;
123707
- var buildInfo;
123708
- if (host.getBuildInfo) {
123709
- buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
123710
- if (!buildInfo)
123711
- return undefined;
123712
- }
123713
- else {
123714
- var content = host.readFile(buildInfoPath);
123715
- if (!content)
123716
- return undefined;
123717
- buildInfo = ts.getBuildInfo(content);
123718
- }
123545
+ var content = host.readFile(buildInfoPath);
123546
+ if (!content)
123547
+ return undefined;
123548
+ var buildInfo = ts.getBuildInfo(content);
123719
123549
  if (buildInfo.version !== ts.version)
123720
123550
  return undefined;
123721
123551
  if (!buildInfo.program)
123722
123552
  return undefined;
123723
- return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123553
+ return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123724
123554
  }
123725
123555
  ts.readBuilderProgram = readBuilderProgram;
123726
123556
  function createIncrementalCompilerHost(options, system) {
@@ -123729,7 +123559,6 @@ var ts;
123729
123559
  host.createHash = ts.maybeBind(system, system.createHash);
123730
123560
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
123731
123561
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
123732
- host.now = ts.maybeBind(system, system.now);
123733
123562
  ts.setGetSourceFileAsHashVersioned(host, system);
123734
123563
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
123735
123564
  return host;
@@ -124465,17 +124294,14 @@ var ts;
124465
124294
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
124466
124295
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
124467
124296
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
124468
- UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
124469
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
124470
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
124471
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
124472
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
124473
- UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 12] = "UpToDateWithInputFileText";
124297
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
124298
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
124299
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
124300
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
124474
124301
  /**
124475
124302
  * Projects with no outputs (i.e. "solution" files)
124476
124303
  */
124477
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
124478
- UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
124304
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
124479
124305
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
124480
124306
  function resolveConfigFileProjectName(project) {
124481
124307
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -124520,11 +124346,9 @@ var ts;
124520
124346
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
124521
124347
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
124522
124348
  }
124523
- /*@internal*/
124524
- function getCurrentTime(host) {
124525
- return host.now ? host.now() : new Date();
124349
+ function newer(date1, date2) {
124350
+ return date2 > date1 ? date2 : date1;
124526
124351
  }
124527
- ts.getCurrentTime = getCurrentTime;
124528
124352
  /*@internal*/
124529
124353
  function isCircularBuildOrder(buildOrder) {
124530
124354
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -124616,7 +124440,6 @@ var ts;
124616
124440
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
124617
124441
  };
124618
124442
  }
124619
- compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
124620
124443
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
124621
124444
  var state = {
124622
124445
  host: host,
@@ -124633,9 +124456,8 @@ var ts;
124633
124456
  resolvedConfigFilePaths: new ts.Map(),
124634
124457
  configFileCache: new ts.Map(),
124635
124458
  projectStatus: new ts.Map(),
124459
+ buildInfoChecked: new ts.Map(),
124636
124460
  extendedConfigCache: new ts.Map(),
124637
- buildInfoCache: new ts.Map(),
124638
- outputTimeStamps: new ts.Map(),
124639
124461
  builderPrograms: new ts.Map(),
124640
124462
  diagnostics: new ts.Map(),
124641
124463
  projectPendingBuild: new ts.Map(),
@@ -124658,7 +124480,6 @@ var ts;
124658
124480
  allWatchedConfigFiles: new ts.Map(),
124659
124481
  allWatchedExtendedConfigFiles: new ts.Map(),
124660
124482
  allWatchedPackageJsonFiles: new ts.Map(),
124661
- filesWatched: new ts.Map(),
124662
124483
  lastCachedPackageJsonLookups: new ts.Map(),
124663
124484
  timerToBuildInvalidatedProject: undefined,
124664
124485
  reportFileChangeDetected: false,
@@ -124769,12 +124590,11 @@ var ts;
124769
124590
  // Config file cache
124770
124591
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
124771
124592
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
124593
+ ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
124772
124594
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
124773
124595
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
124774
124596
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
124775
124597
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
124776
- ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
124777
- ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
124778
124598
  // Remove watches for the program no longer in the solution
124779
124599
  if (state.watch) {
124780
124600
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -125071,21 +124891,21 @@ var ts;
125071
124891
  }
125072
124892
  function emit(writeFileCallback, cancellationToken, customTransformers) {
125073
124893
  var _a;
125074
- var _b, _c, _d;
124894
+ var _b, _c;
125075
124895
  ts.Debug.assertIsDefined(program);
125076
124896
  ts.Debug.assert(step === BuildStep.Emit);
125077
124897
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
125078
- program.backupEmitState();
124898
+ program.backupState();
125079
124899
  var declDiagnostics;
125080
124900
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
125081
124901
  var outputFiles = [];
125082
124902
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
125083
124903
  /*write*/ undefined,
125084
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark, buildInfo: data === null || data === void 0 ? void 0 : data.buildInfo }); }, cancellationToken,
124904
+ /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
125085
124905
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
125086
124906
  // Don't emit .d.ts if there are decl file errors
125087
124907
  if (declDiagnostics) {
125088
- program.restoreEmitState();
124908
+ program.restoreState();
125089
124909
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
125090
124910
  return {
125091
124911
  emitSkipped: true,
@@ -125095,46 +124915,40 @@ var ts;
125095
124915
  // Actual Emit
125096
124916
  var host = state.host, compilerHost = state.compilerHost;
125097
124917
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
125098
- var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124918
+ var newestDeclarationFileContentChangedTime = minimumDate;
124919
+ var anyDtsChanged = false;
125099
124920
  var emitterDiagnostics = ts.createDiagnosticCollection();
125100
124921
  var emittedOutputs = new ts.Map();
125101
- var options = program.getCompilerOptions();
125102
- var isIncremental = ts.isIncrementalCompilation(options);
125103
- var outputTimeStampMap;
125104
- var now;
125105
124922
  ts.solutionPerformance.mark("beforeOutputFilesWrite");
125106
124923
  outputFiles.forEach(function (_a) {
125107
- var _b, _c;
125108
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
125109
- var path = toPath(state, name);
125110
- emittedOutputs.set(toPath(state, name), name);
125111
- if (buildInfo) {
125112
- setBuildInfo(state, buildInfo, projectPath, options);
125113
- if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo === null || existingBuildInfo === void 0 ? void 0 : existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
124924
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124925
+ var priorChangeTime;
124926
+ if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124927
+ // Check for unchanged .d.ts files
124928
+ if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124929
+ priorChangeTime = host.getModifiedTime(name);
124930
+ }
124931
+ else {
125114
124932
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124933
+ anyDtsChanged = true;
125115
124934
  }
125116
124935
  }
124936
+ emittedOutputs.set(toPath(state, name), name);
125117
124937
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
125118
- if (!isIncremental && state.watch) {
125119
- (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124938
+ if (priorChangeTime !== undefined) {
124939
+ newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
125120
124940
  }
125121
124941
  });
125122
124942
  ts.solutionPerformance.mark("afterOutputFilesWrite");
125123
124943
  ts.solutionPerformance.measure("OutputFilesWrite", "beforeOutputFilesWrite", "afterOutputFilesWrite");
125124
- finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124944
+ finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124945
+ /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
125125
124946
  return emitResult;
125126
124947
  }
125127
124948
  function emitBuildInfo(writeFileCallback, cancellationToken) {
125128
124949
  ts.Debug.assertIsDefined(program);
125129
124950
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
125130
- var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
125131
- if (data === null || data === void 0 ? void 0 : data.buildInfo)
125132
- setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
125133
- if (writeFileCallback)
125134
- writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
125135
- else
125136
- state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
125137
- }, cancellationToken);
124951
+ var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
125138
124952
  if (emitResult.diagnostics.length) {
125139
124953
  reportErrors(state, emitResult.diagnostics);
125140
124954
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -125147,7 +124961,7 @@ var ts;
125147
124961
  step = BuildStep.QueueReferencingProjects;
125148
124962
  return emitResult;
125149
124963
  }
125150
- function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124964
+ function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
125151
124965
  var _a;
125152
124966
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
125153
124967
  if (emitDiagnostics.length) {
@@ -125158,11 +124972,13 @@ var ts;
125158
124972
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
125159
124973
  }
125160
124974
  // Update time stamps for rest of the outputs
125161
- updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124975
+ var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
125162
124976
  state.diagnostics.delete(projectPath);
125163
124977
  state.projectStatus.set(projectPath, {
125164
124978
  type: ts.UpToDateStatusType.UpToDate,
125165
- newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124979
+ newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124980
+ maximumDate :
124981
+ newestDeclarationFileContentChangedTime,
125166
124982
  oldestOutputFileName: oldestOutputFileName
125167
124983
  });
125168
124984
  afterProgramDone(state, program, config);
@@ -125197,21 +125013,13 @@ var ts;
125197
125013
  ts.Debug.assert(!!outputFiles.length);
125198
125014
  var emitterDiagnostics = ts.createDiagnosticCollection();
125199
125015
  var emittedOutputs = new ts.Map();
125200
- var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
125201
- var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
125202
125016
  outputFiles.forEach(function (_a) {
125203
- var _b, _c;
125204
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
125017
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
125205
125018
  emittedOutputs.set(toPath(state, name), name);
125206
- if (buildInfo) {
125207
- setBuildInfo(state, buildInfo, projectPath, config.options);
125208
- if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
125209
- resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
125210
- }
125211
- }
125212
125019
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
125213
125020
  });
125214
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
125021
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
125022
+ /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
125215
125023
  return { emitSkipped: false, diagnostics: emitDiagnostics };
125216
125024
  }
125217
125025
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -125317,7 +125125,7 @@ var ts;
125317
125125
  }
125318
125126
  continue;
125319
125127
  }
125320
- if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts.UpToDateStatusType.UpToDateWithInputFileText) {
125128
+ if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
125321
125129
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
125322
125130
  return {
125323
125131
  kind: InvalidatedProjectKind.UpdateOutputFileStamps,
@@ -125403,7 +125211,7 @@ var ts;
125403
125211
  state.projectCompilerOptions = state.baseCompilerOptions;
125404
125212
  }
125405
125213
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
125406
- var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
125214
+ var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
125407
125215
  reportAndStoreErrors(state, resolvedPath, diagnostics);
125408
125216
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
125409
125217
  if (canEmitBuildInfo)
@@ -125411,101 +125219,9 @@ var ts;
125411
125219
  afterProgramDone(state, program, config);
125412
125220
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
125413
125221
  }
125414
- function isFileWatcherWithModifiedTime(value) {
125415
- return !!value.watcher;
125416
- }
125417
- function getModifiedTime(state, fileName) {
125418
- var path = toPath(state, fileName);
125419
- var existing = state.filesWatched.get(path);
125420
- if (state.watch && !!existing) {
125421
- if (!isFileWatcherWithModifiedTime(existing))
125422
- return existing;
125423
- if (existing.modifiedTime)
125424
- return existing.modifiedTime;
125425
- }
125426
- var result = ts.getModifiedTime(state.host, fileName);
125427
- if (state.watch) {
125428
- if (existing)
125429
- existing.modifiedTime = result;
125430
- else
125431
- state.filesWatched.set(path, result);
125432
- }
125433
- return result;
125434
- }
125435
- function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
125436
- var path = toPath(state, file);
125437
- var existing = state.filesWatched.get(path);
125438
- if (existing && isFileWatcherWithModifiedTime(existing)) {
125439
- existing.callbacks.push(callback);
125440
- }
125441
- else {
125442
- var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
125443
- var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125444
- ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125445
- existing.modifiedTime = modifiedTime;
125446
- existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
125447
- }, pollingInterval, options, watchType, project);
125448
- state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
125449
- }
125450
- return {
125451
- close: function () {
125452
- var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125453
- ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125454
- if (existing.callbacks.length === 1) {
125455
- state.filesWatched.delete(path);
125456
- ts.closeFileWatcherOf(existing);
125457
- }
125458
- else {
125459
- ts.unorderedRemoveItem(existing.callbacks, callback);
125460
- }
125461
- }
125462
- };
125463
- }
125464
- function getOutputTimeStampMap(state, resolvedConfigFilePath) {
125465
- if (!state.watch)
125466
- return undefined;
125467
- var result = state.outputTimeStamps.get(resolvedConfigFilePath);
125468
- if (!result)
125469
- state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
125470
- return result;
125471
- }
125472
- function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
125473
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125474
- var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
125475
- if (existing) {
125476
- existing.buildInfo = buildInfo;
125477
- existing.modifiedTime = getCurrentTime(state.host);
125478
- }
125479
- else {
125480
- state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
125481
- }
125482
- }
125483
- function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
125484
- var path = toPath(state, buildInfoPath);
125485
- var existing = state.buildInfoCache.get(resolvedConfigPath);
125486
- return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
125487
- }
125488
- function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
125489
- var path = toPath(state, buildInfoPath);
125490
- var existing = state.buildInfoCache.get(resolvedConfigPath);
125491
- if (existing !== undefined && existing.path === path) {
125492
- return existing.buildInfo || undefined;
125493
- }
125494
- ts.solutionPerformance.mark("beforeGetBuildInfo");
125495
- ts.solutionPerformance.mark("beforeBuildInfoRead");
125496
- var value = state.readFileWithCache(buildInfoPath);
125497
- ts.solutionPerformance.mark("afterBuildInfoRead");
125498
- ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125499
- var buildInfo = value ? ts.getBuildInfo(value) : undefined;
125500
- ts.Debug.assert(modifiedTime || !buildInfo);
125501
- state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
125502
- ts.solutionPerformance.mark("afterGetBuildInfo");
125503
- ts.solutionPerformance.measure("GetBuildInfo", "beforeGetBuildInfo", "afterGetBuildInfo");
125504
- return buildInfo;
125505
- }
125506
125222
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
125507
125223
  // Check tsconfig time
125508
- var tsconfigTime = getModifiedTime(state, configFile);
125224
+ var tsconfigTime = ts.getModifiedTime(state.host, configFile);
125509
125225
  if (oldestOutputFileTime < tsconfigTime) {
125510
125226
  return {
125511
125227
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -125515,24 +125231,88 @@ var ts;
125515
125231
  }
125516
125232
  }
125517
125233
  function getUpToDateStatusWorker(state, project, resolvedPath) {
125518
- var _a, _b, _c;
125234
+ var force = !!state.options.force;
125235
+ var newestInputFileName = undefined;
125236
+ var newestInputFileTime = minimumDate;
125237
+ var host = state.host;
125238
+ // Get timestamps of input files
125239
+ for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
125240
+ var inputFile = _a[_i];
125241
+ if (!host.fileExists(inputFile)) {
125242
+ return {
125243
+ type: ts.UpToDateStatusType.Unbuildable,
125244
+ reason: inputFile + " does not exist"
125245
+ };
125246
+ }
125247
+ if (!force) {
125248
+ var inputTime = ts.getModifiedTime(host, inputFile);
125249
+ if (inputTime > newestInputFileTime) {
125250
+ newestInputFileName = inputFile;
125251
+ newestInputFileTime = inputTime;
125252
+ }
125253
+ }
125254
+ }
125519
125255
  // Container if no files are specified in the project
125520
125256
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
125521
125257
  return {
125522
125258
  type: ts.UpToDateStatusType.ContainerOnly
125523
125259
  };
125524
125260
  }
125525
- // Fast check to see if reference projects are buildable
125526
- var referenceStatuses;
125527
- var force = !!state.options.force;
125261
+ // Collect the expected outputs of this project
125262
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125263
+ // Now see if all outputs are newer than the newest input
125264
+ var oldestOutputFileName = "(none)";
125265
+ var oldestOutputFileTime = maximumDate;
125266
+ var newestOutputFileName = "(none)";
125267
+ var newestOutputFileTime = minimumDate;
125268
+ var missingOutputFileName;
125269
+ var newestDeclarationFileContentChangedTime = minimumDate;
125270
+ var isOutOfDateWithInputs = false;
125271
+ if (!force) {
125272
+ for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
125273
+ var output = outputs_1[_b];
125274
+ // Output is missing; can stop checking
125275
+ // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125276
+ if (!host.fileExists(output)) {
125277
+ missingOutputFileName = output;
125278
+ break;
125279
+ }
125280
+ var outputTime = ts.getModifiedTime(host, output);
125281
+ if (outputTime < oldestOutputFileTime) {
125282
+ oldestOutputFileTime = outputTime;
125283
+ oldestOutputFileName = output;
125284
+ }
125285
+ // If an output is older than the newest input, we can stop checking
125286
+ // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125287
+ if (outputTime < newestInputFileTime) {
125288
+ isOutOfDateWithInputs = true;
125289
+ break;
125290
+ }
125291
+ if (outputTime > newestOutputFileTime) {
125292
+ newestOutputFileTime = outputTime;
125293
+ newestOutputFileName = output;
125294
+ }
125295
+ // Keep track of when the most recent time a .d.ts file was changed.
125296
+ // In addition to file timestamps, we also keep track of when a .d.ts file
125297
+ // had its file touched but not had its contents changed - this allows us
125298
+ // to skip a downstream typecheck
125299
+ if (ts.isDeclarationFileName(output)) {
125300
+ var outputModifiedTime = ts.getModifiedTime(host, output);
125301
+ newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
125302
+ }
125303
+ }
125304
+ }
125305
+ var pseudoUpToDate = false;
125306
+ var usesPrepend = false;
125307
+ var upstreamChangedProject;
125528
125308
  if (project.projectReferences) {
125529
125309
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
125530
- for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
125531
- var ref = _d[_i];
125310
+ for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
125311
+ var ref = _d[_c];
125312
+ usesPrepend = usesPrepend || !!(ref.prepend);
125532
125313
  var resolvedRef = ts.resolveProjectReferencePath(ref);
125533
125314
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
125534
- var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
125535
- var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
125315
+ var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
125536
125316
  // Its a circular reference ignore the status of this project
125537
125317
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
125538
125318
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -125554,188 +125334,78 @@ var ts;
125554
125334
  upstreamProjectName: ref.path
125555
125335
  };
125556
125336
  }
125557
- if (!force)
125558
- (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
125559
- }
125560
- }
125561
- if (force)
125562
- return { type: ts.UpToDateStatusType.ForceBuild };
125563
- // Check buildinfo first
125564
- var host = state.host;
125565
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125566
- var oldestOutputFileName = "(none)";
125567
- var oldestOutputFileTime = maximumDate;
125568
- var buildInfoTime;
125569
- var buildInfoProgram;
125570
- var buildInfoVersionMap;
125571
- var newestDeclarationFileContentChangedTime;
125572
- if (buildInfoPath) {
125573
- var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
125574
- buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
125575
- if (buildInfoTime === ts.missingFileModifiedTime) {
125576
- if (!buildInfoCacheEntry_1) {
125577
- state.buildInfoCache.set(resolvedPath, {
125578
- path: toPath(state, buildInfoPath),
125579
- buildInfo: false,
125580
- modifiedTime: buildInfoTime
125581
- });
125582
- }
125583
- return {
125584
- type: ts.UpToDateStatusType.OutputMissing,
125585
- missingOutputFileName: buildInfoPath
125586
- };
125587
- }
125588
- var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
125589
- if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125590
- return {
125591
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125592
- version: buildInfo.version
125593
- };
125594
- }
125595
- if (buildInfo.program) {
125596
- if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
125597
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
125337
+ // Check oldest output file name only if there is no missing output file name
125338
+ // (a check we will have skipped if this is a forced build)
125339
+ if (!force && !missingOutputFileName) {
125340
+ // If the upstream project's newest file is older than our oldest output, we
125341
+ // can't be out of date because of it
125342
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125343
+ continue;
125344
+ }
125345
+ // If the upstream project has only change .d.ts files, and we've built
125346
+ // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125347
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125348
+ pseudoUpToDate = true;
125349
+ upstreamChangedProject = ref.path;
125350
+ continue;
125351
+ }
125352
+ // We have an output older than an upstream output - we are out of date
125353
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125598
125354
  return {
125599
- type: ts.UpToDateStatusType.OutOfDateBuildInfo,
125600
- buildInfoFile: buildInfoPath
125355
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125356
+ outOfDateOutputFileName: oldestOutputFileName,
125357
+ newerProjectName: ref.path
125601
125358
  };
125602
125359
  }
125603
- buildInfoProgram = buildInfo.program;
125604
125360
  }
125605
- oldestOutputFileTime = buildInfoTime;
125606
- oldestOutputFileName = buildInfoPath;
125607
- newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
125608
125361
  }
125609
- // Check input files
125610
- var newestInputFileName = undefined;
125611
- var newestInputFileTime = minimumDate;
125612
- var pseudoInputUptodate = false;
125613
- // Get timestamps of input files
125614
- for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
125615
- var inputFile = _f[_e];
125616
- var inputTime = getModifiedTime(state, inputFile);
125617
- if (inputTime === ts.missingFileModifiedTime) {
125618
- return {
125619
- type: ts.UpToDateStatusType.Unbuildable,
125620
- reason: inputFile + " does not exist"
125621
- };
125622
- }
125623
- // If an buildInfo is older than the newest input, we can stop checking
125624
- if (buildInfoTime && buildInfoTime < inputTime) {
125625
- var version_3 = void 0;
125626
- var currentVersion = void 0;
125627
- if (buildInfoProgram) {
125628
- // Read files and see if they are same, read is anyways cached
125629
- if (!buildInfoVersionMap)
125630
- buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
125631
- version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
125632
- var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
125633
- currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
125634
- if (version_3 && version_3 === currentVersion)
125635
- pseudoInputUptodate = true;
125636
- }
125637
- if (!version_3 || version_3 !== currentVersion) {
125638
- return {
125639
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125640
- outOfDateOutputFileName: buildInfoPath,
125641
- newerInputFileName: inputFile
125642
- };
125643
- }
125644
- }
125645
- if (inputTime > newestInputFileTime) {
125646
- newestInputFileName = inputFile;
125647
- newestInputFileTime = inputTime;
125648
- }
125362
+ if (missingOutputFileName !== undefined) {
125363
+ return {
125364
+ type: ts.UpToDateStatusType.OutputMissing,
125365
+ missingOutputFileName: missingOutputFileName
125366
+ };
125649
125367
  }
125650
- // Now see if all outputs are newer than the newest input
125651
- // Dont check output timestamps if we have buildinfo telling us output is uptodate
125652
- if (!buildInfoPath) {
125653
- // Collect the expected outputs of this project
125654
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125655
- var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
125656
- for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
125657
- var output = outputs_1[_g];
125658
- var path = toPath(state, output);
125659
- // Output is missing; can stop checking
125660
- var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
125661
- if (!outputTime) {
125662
- outputTime = ts.getModifiedTime(state.host, output);
125663
- outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
125664
- }
125665
- if (outputTime === ts.missingFileModifiedTime) {
125666
- return {
125667
- type: ts.UpToDateStatusType.OutputMissing,
125668
- missingOutputFileName: output
125669
- };
125670
- }
125671
- if (outputTime < oldestOutputFileTime) {
125672
- oldestOutputFileTime = outputTime;
125673
- oldestOutputFileName = output;
125674
- }
125675
- // If an output is older than the newest input, we can stop checking
125676
- if (outputTime < newestInputFileTime) {
125677
- return {
125678
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125679
- outOfDateOutputFileName: oldestOutputFileName,
125680
- newerInputFileName: newestInputFileName
125681
- };
125682
- }
125683
- }
125368
+ if (isOutOfDateWithInputs) {
125369
+ return {
125370
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
125371
+ outOfDateOutputFileName: oldestOutputFileName,
125372
+ newerInputFileName: newestInputFileName
125373
+ };
125684
125374
  }
125685
- var seenRefs = buildInfoPath ? new ts.Set() : undefined;
125686
- var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
125687
- seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
125688
- var pseudoUpToDate = false;
125689
- var usesPrepend = false;
125690
- var upstreamChangedProject;
125691
- if (referenceStatuses) {
125692
- for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
125693
- var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
125694
- usesPrepend = usesPrepend || !!(ref.prepend);
125695
- // If the upstream project's newest file is older than our oldest output, we
125696
- // can't be out of date because of it
125697
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125698
- continue;
125699
- }
125700
- // Check if tsbuildinfo path is shared, then we need to rebuild
125701
- if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
125375
+ else {
125376
+ // Check tsconfig time
125377
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125378
+ if (configStatus)
125379
+ return configStatus;
125380
+ // Check extended config time
125381
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125382
+ if (extendedConfigStatus)
125383
+ return extendedConfigStatus;
125384
+ // Check package file time
125385
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125386
+ var path = _a[0];
125387
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125388
+ });
125389
+ if (dependentPackageFileStatus)
125390
+ return dependentPackageFileStatus;
125391
+ }
125392
+ if (!force && !state.buildInfoChecked.has(resolvedPath)) {
125393
+ state.buildInfoChecked.set(resolvedPath, true);
125394
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125395
+ if (buildInfoPath) {
125396
+ ts.solutionPerformance.mark("beforeBuildInfoRead");
125397
+ var value = state.readFileWithCache(buildInfoPath);
125398
+ ts.solutionPerformance.mark("afterBuildInfoRead");
125399
+ ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125400
+ var buildInfo = value && ts.getBuildInfo(value);
125401
+ if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125702
125402
  return {
125703
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125704
- outOfDateOutputFileName: buildInfoPath,
125705
- newerProjectName: ref.path
125403
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125404
+ version: buildInfo.version
125706
125405
  };
125707
125406
  }
125708
- // If the upstream project has only change .d.ts files, and we've built
125709
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125710
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125711
- pseudoUpToDate = true;
125712
- upstreamChangedProject = ref.path;
125713
- continue;
125714
- }
125715
- // We have an output older than an upstream output - we are out of date
125716
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125717
- return {
125718
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125719
- outOfDateOutputFileName: oldestOutputFileName,
125720
- newerProjectName: ref.path
125721
- };
125722
125407
  }
125723
125408
  }
125724
- // Check tsconfig time
125725
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125726
- if (configStatus)
125727
- return configStatus;
125728
- // Check extended config time
125729
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125730
- if (extendedConfigStatus)
125731
- return extendedConfigStatus;
125732
- // Check package file time
125733
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125734
- var path = _a[0];
125735
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125736
- });
125737
- if (dependentPackageFileStatus)
125738
- return dependentPackageFileStatus;
125739
125409
  if (usesPrepend && pseudoUpToDate) {
125740
125410
  return {
125741
125411
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -125745,37 +125415,15 @@ var ts;
125745
125415
  }
125746
125416
  // Up to date
125747
125417
  return {
125748
- type: pseudoUpToDate ?
125749
- ts.UpToDateStatusType.UpToDateWithUpstreamTypes :
125750
- pseudoInputUptodate ?
125751
- ts.UpToDateStatusType.UpToDateWithInputFileText :
125752
- ts.UpToDateStatusType.UpToDate,
125418
+ type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
125753
125419
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
125754
125420
  newestInputFileTime: newestInputFileTime,
125421
+ newestOutputFileTime: newestOutputFileTime,
125755
125422
  newestInputFileName: newestInputFileName,
125423
+ newestOutputFileName: newestOutputFileName,
125756
125424
  oldestOutputFileName: oldestOutputFileName
125757
125425
  };
125758
125426
  }
125759
- function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
125760
- if (seenRefs.has(resolvedRefPath))
125761
- return false;
125762
- seenRefs.add(resolvedRefPath);
125763
- var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
125764
- if (refBuildInfo.path === buildInfoCacheEntry.path)
125765
- return true;
125766
- if (resolvedConfig.projectReferences) {
125767
- // Check references
125768
- for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
125769
- var ref = _a[_i];
125770
- var resolvedRef = ts.resolveProjectReferencePath(ref);
125771
- var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
125772
- var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
125773
- if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
125774
- return true;
125775
- }
125776
- }
125777
- return false;
125778
- }
125779
125427
  function getUpToDateStatus(state, project, resolvedPath) {
125780
125428
  if (project === undefined) {
125781
125429
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -125791,69 +125439,42 @@ var ts;
125791
125439
  state.projectStatus.set(resolvedPath, actual);
125792
125440
  return actual;
125793
125441
  }
125794
- function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
125442
+ function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
125795
125443
  if (proj.options.noEmit)
125796
- return;
125797
- var now;
125444
+ return priorNewestUpdateTime;
125798
125445
  ts.solutionPerformance.mark("beforeUpdateOutputTimestamps");
125799
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
125800
- if (buildInfoPath) {
125801
- if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
125802
- if (!!state.options.verbose)
125446
+ var host = state.host;
125447
+ var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125448
+ if (!skipOutputs || outputs.length !== skipOutputs.size) {
125449
+ var reportVerbose = !!state.options.verbose;
125450
+ var now = host.now ? host.now() : new Date();
125451
+ for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125452
+ var file = outputs_2[_i];
125453
+ if (skipOutputs && skipOutputs.has(toPath(state, file))) {
125454
+ continue;
125455
+ }
125456
+ if (reportVerbose) {
125457
+ reportVerbose = false;
125803
125458
  reportStatus(state, verboseMessage, proj.options.configFilePath);
125804
- state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
125805
- getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
125806
- }
125807
- state.outputTimeStamps.delete(projectPath);
125808
- }
125809
- else {
125810
- var host = state.host;
125811
- var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125812
- var outputTimeStampMap_1 = getOutputTimeStampMap(state, projectPath);
125813
- var modifiedOutputs_1 = outputTimeStampMap_1 ? new ts.Set() : undefined;
125814
- if (!skipOutputs || outputs.length !== skipOutputs.size) {
125815
- var reportVerbose = !!state.options.verbose;
125816
- for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125817
- var file = outputs_2[_i];
125818
- var path = toPath(state, file);
125819
- if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
125820
- continue;
125821
- if (reportVerbose) {
125822
- reportVerbose = false;
125823
- reportStatus(state, verboseMessage, proj.options.configFilePath);
125824
- }
125825
- host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
125826
- if (outputTimeStampMap_1) {
125827
- outputTimeStampMap_1.set(path, now);
125828
- modifiedOutputs_1.add(path);
125829
- }
125830
125459
  }
125460
+ if (ts.isDeclarationFileName(file)) {
125461
+ priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
125462
+ }
125463
+ host.setModifiedTime(file, now);
125831
125464
  }
125832
- // Clear out timestamps not in output list any more
125833
- outputTimeStampMap_1 === null || outputTimeStampMap_1 === void 0 ? void 0 : outputTimeStampMap_1.forEach(function (_value, key) {
125834
- if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs_1.has(key))
125835
- outputTimeStampMap_1.delete(key);
125836
- });
125837
125465
  }
125838
125466
  ts.solutionPerformance.mark("afterUpdateOutputTimestamps");
125839
125467
  ts.solutionPerformance.measure("UpdateOutputTimestamps", "beforeUpdateOutputTimestamps", "afterUpdateOutputTimestamps");
125840
- }
125841
- function getDtsChangeTime(state, options, resolvedConfigPath) {
125842
- var _a;
125843
- if (!options.composite)
125844
- return undefined;
125845
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125846
- var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
125847
- return ((_a = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.program) === null || _a === void 0 ? void 0 : _a.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
125468
+ return priorNewestUpdateTime;
125848
125469
  }
125849
125470
  function updateOutputTimestamps(state, proj, resolvedPath) {
125850
125471
  if (state.options.dry) {
125851
125472
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
125852
125473
  }
125853
- updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125474
+ var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125854
125475
  state.projectStatus.set(resolvedPath, {
125855
125476
  type: ts.UpToDateStatusType.UpToDate,
125856
- newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
125477
+ newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
125857
125478
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
125858
125479
  });
125859
125480
  }
@@ -125899,7 +125520,6 @@ var ts;
125899
125520
  break;
125900
125521
  }
125901
125522
  // falls through
125902
- case ts.UpToDateStatusType.UpToDateWithInputFileText:
125903
125523
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125904
125524
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
125905
125525
  if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
@@ -126091,10 +125711,12 @@ var ts;
126091
125711
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
126092
125712
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
126093
125713
  return;
126094
- state.allWatchedConfigFiles.set(resolvedPath, watchFile(state, resolved, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125714
+ state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
125715
+ invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
125716
+ }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
126095
125717
  }
126096
125718
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
126097
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
125719
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
126098
125720
  var _a;
126099
125721
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
126100
125722
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -126126,7 +125748,7 @@ var ts;
126126
125748
  if (!state.watch)
126127
125749
  return;
126128
125750
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
126129
- createNewValue: function (_path, input) { return watchFile(state, input, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.SourceFile, resolved); },
125751
+ createNewValue: function (_path, input) { return state.watchFile(input, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.SourceFile, resolved); },
126130
125752
  onDeleteValue: ts.closeFileWatcher,
126131
125753
  });
126132
125754
  }
@@ -126134,7 +125756,7 @@ var ts;
126134
125756
  if (!state.watch || !state.lastCachedPackageJsonLookups)
126135
125757
  return;
126136
125758
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
126137
- createNewValue: function (path, _input) { return watchFile(state, path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
125759
+ createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
126138
125760
  onDeleteValue: ts.closeFileWatcher,
126139
125761
  });
126140
125762
  }
@@ -126267,18 +125889,19 @@ var ts;
126267
125889
  }
126268
125890
  }
126269
125891
  function reportUpToDateStatus(state, configFileName, status) {
125892
+ if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125893
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125894
+ }
126270
125895
  switch (status.type) {
126271
125896
  case ts.UpToDateStatusType.OutOfDateWithSelf:
126272
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName));
125897
+ return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName));
126273
125898
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
126274
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName));
125899
+ return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName));
126275
125900
  case ts.UpToDateStatusType.OutputMissing:
126276
125901
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relName(state, configFileName), relName(state, status.missingOutputFileName));
126277
- case ts.UpToDateStatusType.OutOfDateBuildInfo:
126278
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted, relName(state, configFileName), relName(state, status.buildInfoFile));
126279
125902
  case ts.UpToDateStatusType.UpToDate:
126280
125903
  if (status.newestInputFileTime !== undefined) {
126281
- return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, relName(state, configFileName), relName(state, status.newestInputFileName || ""), relName(state, status.oldestOutputFileName || ""));
125904
+ return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, relName(state, configFileName), relName(state, status.newestInputFileName || ""), relName(state, status.oldestOutputFileName || ""));
126282
125905
  }
126283
125906
  // Don't report anything for "up to date because it was already built" -- too verbose
126284
125907
  break;
@@ -126286,8 +125909,6 @@ var ts;
126286
125909
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed, relName(state, configFileName), relName(state, status.newerProjectName));
126287
125910
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
126288
125911
  return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName));
126289
- case ts.UpToDateStatusType.UpToDateWithInputFileText:
126290
- return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName));
126291
125912
  case ts.UpToDateStatusType.UpstreamOutOfDate:
126292
125913
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName));
126293
125914
  case ts.UpToDateStatusType.UpstreamBlocked:
@@ -126298,8 +125919,6 @@ var ts;
126298
125919
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
126299
125920
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
126300
125921
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, relName(state, configFileName), status.version, ts.version);
126301
- case ts.UpToDateStatusType.ForceBuild:
126302
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
126303
125922
  case ts.UpToDateStatusType.ContainerOnly:
126304
125923
  // Don't report status on "solution" projects
126305
125924
  // falls through