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

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.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-insiders.20220531";
297
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -3717,6 +3717,7 @@ var ts;
3717
3717
  var marks = new ts.Map();
3718
3718
  var counts = new ts.Map();
3719
3719
  var durations = new ts.Map();
3720
+ var durationMarks = new ts.Set();
3720
3721
  return {
3721
3722
  createTimerIf: createTimerIf,
3722
3723
  createTimer: createTimer,
@@ -3725,6 +3726,7 @@ var ts;
3725
3726
  getCount: getCount,
3726
3727
  getDuration: getDuration,
3727
3728
  forEachMeasure: forEachMeasure,
3729
+ forEachCount: forEachCount,
3728
3730
  isEnabled: isEnabled,
3729
3731
  enable: enable,
3730
3732
  disable: disable,
@@ -3779,6 +3781,7 @@ var ts;
3779
3781
  function measure(measureName, startMarkName, endMarkName) {
3780
3782
  var _a, _b;
3781
3783
  if (enabled) {
3784
+ durationMarks.add(startMarkName).add(endMarkName);
3782
3785
  var end = (_a = marks.get(endMarkName)) !== null && _a !== void 0 ? _a : ts.timestamp();
3783
3786
  var start = (_b = marks.get(startMarkName)) !== null && _b !== void 0 ? _b : timeorigin;
3784
3787
  var previousDuration = durations.get(measureName) || 0;
@@ -3810,6 +3813,14 @@ var ts;
3810
3813
  function forEachMeasure(cb) {
3811
3814
  durations.forEach(function (duration, measureName) { return cb(measureName, duration); });
3812
3815
  }
3816
+ /**
3817
+ * Iterate over each count which is not duration mark, performing some action
3818
+ *
3819
+ * @param cb The action to perform for each measure
3820
+ */
3821
+ function forEachCount(cb) {
3822
+ counts.forEach(function (count, countName) { return !durationMarks.has(countName) && cb(countName, count); });
3823
+ }
3813
3824
  /**
3814
3825
  * Indicates whether the performance API is enabled.
3815
3826
  */
@@ -6394,7 +6405,7 @@ var ts;
6394
6405
  };
6395
6406
  }
6396
6407
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6397
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6408
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6398
6409
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6399
6410
  if (!ts.isString(relativeFileName))
6400
6411
  return;
@@ -6404,7 +6415,7 @@ var ts;
6404
6415
  if (callbacks) {
6405
6416
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6406
6417
  var fileCallback = callbacks_1[_i];
6407
- fileCallback(fileName, FileWatcherEventKind.Changed);
6418
+ fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6408
6419
  }
6409
6420
  }
6410
6421
  },
@@ -6458,7 +6469,7 @@ var ts;
6458
6469
  }
6459
6470
  else {
6460
6471
  cache.set(path, {
6461
- watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6472
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6462
6473
  refCount: 1
6463
6474
  });
6464
6475
  }
@@ -6486,7 +6497,7 @@ var ts;
6486
6497
  var newTime = modifiedTime.getTime();
6487
6498
  if (oldTime !== newTime) {
6488
6499
  watchedFile.mtime = modifiedTime;
6489
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6500
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6490
6501
  return true;
6491
6502
  }
6492
6503
  return false;
@@ -6737,17 +6748,18 @@ var ts;
6737
6748
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6738
6749
  /*@internal*/
6739
6750
  function createFileWatcherCallback(callback) {
6740
- return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6751
+ return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6741
6752
  }
6742
6753
  ts.createFileWatcherCallback = createFileWatcherCallback;
6743
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6744
- return function (eventName) {
6754
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6755
+ return function (eventName, _relativeFileName, modifiedTime) {
6745
6756
  if (eventName === "rename") {
6746
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6757
+ modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6758
+ callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6747
6759
  }
6748
6760
  else {
6749
6761
  // Change
6750
- callback(fileName, FileWatcherEventKind.Changed);
6762
+ callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6751
6763
  }
6752
6764
  };
6753
6765
  }
@@ -6771,7 +6783,7 @@ var ts;
6771
6783
  }
6772
6784
  /*@internal*/
6773
6785
  function createSystemWatchFunctions(_a) {
6774
- 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;
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;
6775
6787
  var dynamicPollingWatchFile;
6776
6788
  var fixedChunkSizePollingWatchFile;
6777
6789
  var nonPollingWatchFile;
@@ -6793,7 +6805,7 @@ var ts;
6793
6805
  case ts.WatchFileKind.FixedChunkSizePolling:
6794
6806
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6795
6807
  case ts.WatchFileKind.UseFsEvents:
6796
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6808
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6797
6809
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6798
6810
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6799
6811
  if (!nonPollingWatchFile) {
@@ -6975,7 +6987,6 @@ var ts;
6975
6987
  fsWatch: fsWatch,
6976
6988
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6977
6989
  getCurrentDirectory: getCurrentDirectory,
6978
- fileExists: fileExists,
6979
6990
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6980
6991
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6981
6992
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7235,7 +7246,7 @@ var ts;
7235
7246
  // File changed
7236
7247
  eventKind = FileWatcherEventKind.Changed;
7237
7248
  }
7238
- callback(fileName, eventKind);
7249
+ callback(fileName, eventKind, curr.mtime);
7239
7250
  }
7240
7251
  }
7241
7252
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7261,10 +7272,10 @@ var ts;
7261
7272
  * Invoke the callback with rename and update the watcher if not closed
7262
7273
  * @param createWatcher
7263
7274
  */
7264
- function invokeCallbackAndUpdateWatcher(createWatcher) {
7275
+ function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7265
7276
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7266
7277
  // Call the callback for current directory
7267
- callback("rename", "");
7278
+ callback("rename", "", modifiedTime);
7268
7279
  // If watcher is not closed, update it
7269
7280
  if (watcher) {
7270
7281
  watcher.close();
@@ -7310,13 +7321,14 @@ var ts;
7310
7321
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7311
7322
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7312
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;
7313
7325
  return event === "rename" &&
7314
7326
  (!relativeName ||
7315
7327
  relativeName === lastDirectoryPart ||
7316
7328
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7317
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7318
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7319
- callback(event, relativeName);
7329
+ modifiedTime === ts.missingFileModifiedTime ?
7330
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7331
+ callback(event, relativeName, modifiedTime);
7320
7332
  }
7321
7333
  /**
7322
7334
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7330,12 +7342,15 @@ var ts;
7330
7342
  * and switch to existing file or directory when the missing filesystem entry is created
7331
7343
  */
7332
7344
  function watchMissingFileSystemEntry() {
7333
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7334
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7335
- // Call the callback for current file or directory
7336
- // For now it could be callback for the inner directory creation,
7337
- // but just return current directory, better than current no-op
7338
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
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
+ }
7339
7354
  }
7340
7355
  }, fallbackPollingInterval, fallbackOptions);
7341
7356
  }
@@ -7485,12 +7500,19 @@ var ts;
7485
7500
  }
7486
7501
  function getModifiedTime(path) {
7487
7502
  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;
7488
7507
  try {
7489
7508
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7490
7509
  }
7491
7510
  catch (e) {
7492
7511
  return undefined;
7493
7512
  }
7513
+ finally {
7514
+ Error.stackTraceLimit = originalStackTraceLimit;
7515
+ }
7494
7516
  }
7495
7517
  function setModifiedTime(path, time) {
7496
7518
  try {
@@ -9102,6 +9124,7 @@ var ts;
9102
9124
  Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
9103
9125
  All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
9104
9126
  This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
9127
+ An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, ts.DiagnosticCategory.Error, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
9105
9128
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
9106
9129
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
9107
9130
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -9512,8 +9535,8 @@ var ts;
9512
9535
  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"),
9513
9536
  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"),
9514
9537
  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."),
9515
- 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}'"),
9516
- 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}'"),
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}'"),
9517
9540
  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"),
9518
9541
  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"),
9519
9542
  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"),
@@ -9544,7 +9567,7 @@ var ts;
9544
9567
  Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"),
9545
9568
  Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),
9546
9569
  _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),
9547
- Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),
9570
+ Performance_timings_for_diagnostics_or_extendedDiagnostics_or_solutionDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_or_solutionDiagnostics_are_not_available__6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' or '--solutionDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),
9548
9571
  The_signature_0_of_1_is_deprecated: diag(6387, ts.DiagnosticCategory.Suggestion, "The_signature_0_of_1_is_deprecated_6387", "The signature '{0}' of '{1}' is deprecated.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),
9549
9572
  Project_0_is_being_forcibly_rebuilt: diag(6388, ts.DiagnosticCategory.Message, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"),
9550
9573
  Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: diag(6389, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),
@@ -9557,6 +9580,8 @@ var ts;
9557
9580
  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}'."),
9558
9581
  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}'."),
9559
9582
  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"),
9560
9585
  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}'"),
9561
9586
  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."),
9562
9587
  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."),
@@ -9678,6 +9703,7 @@ var ts;
9678
9703
  Specify_how_the_TypeScript_watch_mode_works: diag(6715, ts.DiagnosticCategory.Message, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."),
9679
9704
  Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts.DiagnosticCategory.Message, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
9680
9705
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
9706
+ Output_more_detailed_solution_performance_information_after_building: diag(6719, ts.DiagnosticCategory.Message, "Output_more_detailed_solution_performance_information_after_building_6719", "Output more detailed solution performance information after building."),
9681
9707
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
9682
9708
  one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
9683
9709
  one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
@@ -20386,6 +20412,10 @@ var ts;
20386
20412
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20387
20413
  }
20388
20414
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20415
+ function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20416
+ return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20417
+ }
20418
+ ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20389
20419
  function getCompilerOptionValue(options, option) {
20390
20420
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20391
20421
  }
@@ -39426,6 +39456,7 @@ var ts;
39426
39456
  type: "boolean",
39427
39457
  affectsSemanticDiagnostics: true,
39428
39458
  affectsEmit: true,
39459
+ affectsMultiFileEmitBuildInfo: true,
39429
39460
  category: ts.Diagnostics.Watch_and_Build_Modes,
39430
39461
  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,
39431
39462
  defaultValueDescription: false,
@@ -39460,12 +39491,40 @@ var ts;
39460
39491
  affectsSourceFile: true,
39461
39492
  affectsModuleResolution: true,
39462
39493
  affectsEmit: true,
39494
+ affectsMultiFileEmitBuildInfo: true,
39463
39495
  paramType: ts.Diagnostics.VERSION,
39464
39496
  showInSimplifiedHelpView: true,
39465
39497
  category: ts.Diagnostics.Language_and_Environment,
39466
39498
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39467
39499
  defaultValueDescription: 0 /* ES3 */,
39468
39500
  };
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
+ };
39469
39528
  var commandOptionsWithoutBuild = [
39470
39529
  // CommandLine only options
39471
39530
  {
@@ -39527,37 +39586,14 @@ var ts;
39527
39586
  category: ts.Diagnostics.Command_line_Options,
39528
39587
  affectsSemanticDiagnostics: true,
39529
39588
  affectsEmit: true,
39589
+ affectsMultiFileEmitBuildInfo: true,
39530
39590
  isCommandLineOnly: true,
39531
39591
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39532
39592
  defaultValueDescription: false,
39533
39593
  },
39534
39594
  // Basic
39535
39595
  ts.targetOptionDeclaration,
39536
- {
39537
- name: "module",
39538
- shortName: "m",
39539
- type: new ts.Map(ts.getEntries({
39540
- none: ts.ModuleKind.None,
39541
- commonjs: ts.ModuleKind.CommonJS,
39542
- amd: ts.ModuleKind.AMD,
39543
- system: ts.ModuleKind.System,
39544
- umd: ts.ModuleKind.UMD,
39545
- es6: ts.ModuleKind.ES2015,
39546
- es2015: ts.ModuleKind.ES2015,
39547
- es2020: ts.ModuleKind.ES2020,
39548
- es2022: ts.ModuleKind.ES2022,
39549
- esnext: ts.ModuleKind.ESNext,
39550
- node16: ts.ModuleKind.Node16,
39551
- nodenext: ts.ModuleKind.NodeNext,
39552
- })),
39553
- affectsModuleResolution: true,
39554
- affectsEmit: true,
39555
- paramType: ts.Diagnostics.KIND,
39556
- showInSimplifiedHelpView: true,
39557
- category: ts.Diagnostics.Modules,
39558
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39559
- defaultValueDescription: undefined,
39560
- },
39596
+ ts.moduleOptionDeclaration,
39561
39597
  {
39562
39598
  name: "lib",
39563
39599
  type: "list",
@@ -39594,6 +39630,7 @@ var ts;
39594
39630
  type: jsxOptionMap,
39595
39631
  affectsSourceFile: true,
39596
39632
  affectsEmit: true,
39633
+ affectsMultiFileEmitBuildInfo: true,
39597
39634
  affectsModuleResolution: true,
39598
39635
  paramType: ts.Diagnostics.KIND,
39599
39636
  showInSimplifiedHelpView: true,
@@ -39606,6 +39643,7 @@ var ts;
39606
39643
  shortName: "d",
39607
39644
  type: "boolean",
39608
39645
  affectsEmit: true,
39646
+ affectsMultiFileEmitBuildInfo: true,
39609
39647
  showInSimplifiedHelpView: true,
39610
39648
  category: ts.Diagnostics.Emit,
39611
39649
  transpileOptionValue: undefined,
@@ -39616,6 +39654,7 @@ var ts;
39616
39654
  name: "declarationMap",
39617
39655
  type: "boolean",
39618
39656
  affectsEmit: true,
39657
+ affectsMultiFileEmitBuildInfo: true,
39619
39658
  showInSimplifiedHelpView: true,
39620
39659
  category: ts.Diagnostics.Emit,
39621
39660
  transpileOptionValue: undefined,
@@ -39626,6 +39665,7 @@ var ts;
39626
39665
  name: "emitDeclarationOnly",
39627
39666
  type: "boolean",
39628
39667
  affectsEmit: true,
39668
+ affectsMultiFileEmitBuildInfo: true,
39629
39669
  showInSimplifiedHelpView: true,
39630
39670
  category: ts.Diagnostics.Emit,
39631
39671
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39636,6 +39676,7 @@ var ts;
39636
39676
  name: "sourceMap",
39637
39677
  type: "boolean",
39638
39678
  affectsEmit: true,
39679
+ affectsMultiFileEmitBuildInfo: true,
39639
39680
  showInSimplifiedHelpView: true,
39640
39681
  category: ts.Diagnostics.Emit,
39641
39682
  defaultValueDescription: false,
@@ -39645,6 +39686,9 @@ var ts;
39645
39686
  name: "outFile",
39646
39687
  type: "string",
39647
39688
  affectsEmit: true,
39689
+ affectsMultiFileEmitBuildInfo: true,
39690
+ affectsDeclarationPath: true,
39691
+ affectsBundleEmitBuildInfo: true,
39648
39692
  isFilePath: true,
39649
39693
  paramType: ts.Diagnostics.FILE,
39650
39694
  showInSimplifiedHelpView: true,
@@ -39656,6 +39700,8 @@ var ts;
39656
39700
  name: "outDir",
39657
39701
  type: "string",
39658
39702
  affectsEmit: true,
39703
+ affectsMultiFileEmitBuildInfo: true,
39704
+ affectsDeclarationPath: true,
39659
39705
  isFilePath: true,
39660
39706
  paramType: ts.Diagnostics.DIRECTORY,
39661
39707
  showInSimplifiedHelpView: true,
@@ -39666,6 +39712,8 @@ var ts;
39666
39712
  name: "rootDir",
39667
39713
  type: "string",
39668
39714
  affectsEmit: true,
39715
+ affectsMultiFileEmitBuildInfo: true,
39716
+ affectsDeclarationPath: true,
39669
39717
  isFilePath: true,
39670
39718
  paramType: ts.Diagnostics.LOCATION,
39671
39719
  category: ts.Diagnostics.Modules,
@@ -39676,6 +39724,8 @@ var ts;
39676
39724
  name: "composite",
39677
39725
  type: "boolean",
39678
39726
  affectsEmit: true,
39727
+ affectsMultiFileEmitBuildInfo: true,
39728
+ affectsBundleEmitBuildInfo: true,
39679
39729
  isTSConfigOnly: true,
39680
39730
  category: ts.Diagnostics.Projects,
39681
39731
  transpileOptionValue: undefined,
@@ -39686,6 +39736,8 @@ var ts;
39686
39736
  name: "tsBuildInfoFile",
39687
39737
  type: "string",
39688
39738
  affectsEmit: true,
39739
+ affectsMultiFileEmitBuildInfo: true,
39740
+ affectsBundleEmitBuildInfo: true,
39689
39741
  isFilePath: true,
39690
39742
  paramType: ts.Diagnostics.FILE,
39691
39743
  category: ts.Diagnostics.Projects,
@@ -39697,6 +39749,7 @@ var ts;
39697
39749
  name: "removeComments",
39698
39750
  type: "boolean",
39699
39751
  affectsEmit: true,
39752
+ affectsMultiFileEmitBuildInfo: true,
39700
39753
  showInSimplifiedHelpView: true,
39701
39754
  category: ts.Diagnostics.Emit,
39702
39755
  defaultValueDescription: false,
@@ -39715,6 +39768,7 @@ var ts;
39715
39768
  name: "importHelpers",
39716
39769
  type: "boolean",
39717
39770
  affectsEmit: true,
39771
+ affectsMultiFileEmitBuildInfo: true,
39718
39772
  category: ts.Diagnostics.Emit,
39719
39773
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39720
39774
  defaultValueDescription: false,
@@ -39728,6 +39782,7 @@ var ts;
39728
39782
  })),
39729
39783
  affectsEmit: true,
39730
39784
  affectsSemanticDiagnostics: true,
39785
+ affectsMultiFileEmitBuildInfo: true,
39731
39786
  category: ts.Diagnostics.Emit,
39732
39787
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39733
39788
  defaultValueDescription: 0 /* Remove */,
@@ -39736,6 +39791,7 @@ var ts;
39736
39791
  name: "downlevelIteration",
39737
39792
  type: "boolean",
39738
39793
  affectsEmit: true,
39794
+ affectsMultiFileEmitBuildInfo: true,
39739
39795
  category: ts.Diagnostics.Emit,
39740
39796
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39741
39797
  defaultValueDescription: false,
@@ -39754,6 +39810,9 @@ var ts;
39754
39810
  type: "boolean",
39755
39811
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39756
39812
  // 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,
39757
39816
  showInSimplifiedHelpView: true,
39758
39817
  category: ts.Diagnostics.Type_Checking,
39759
39818
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39763,6 +39822,7 @@ var ts;
39763
39822
  name: "noImplicitAny",
39764
39823
  type: "boolean",
39765
39824
  affectsSemanticDiagnostics: true,
39825
+ affectsMultiFileEmitBuildInfo: true,
39766
39826
  strictFlag: true,
39767
39827
  category: ts.Diagnostics.Type_Checking,
39768
39828
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39772,6 +39832,7 @@ var ts;
39772
39832
  name: "strictNullChecks",
39773
39833
  type: "boolean",
39774
39834
  affectsSemanticDiagnostics: true,
39835
+ affectsMultiFileEmitBuildInfo: true,
39775
39836
  strictFlag: true,
39776
39837
  category: ts.Diagnostics.Type_Checking,
39777
39838
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39780,6 +39841,8 @@ var ts;
39780
39841
  {
39781
39842
  name: "strictFunctionTypes",
39782
39843
  type: "boolean",
39844
+ affectsSemanticDiagnostics: true,
39845
+ affectsMultiFileEmitBuildInfo: true,
39783
39846
  strictFlag: true,
39784
39847
  category: ts.Diagnostics.Type_Checking,
39785
39848
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39788,6 +39851,8 @@ var ts;
39788
39851
  {
39789
39852
  name: "strictBindCallApply",
39790
39853
  type: "boolean",
39854
+ affectsSemanticDiagnostics: true,
39855
+ affectsMultiFileEmitBuildInfo: true,
39791
39856
  strictFlag: true,
39792
39857
  category: ts.Diagnostics.Type_Checking,
39793
39858
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39797,6 +39862,7 @@ var ts;
39797
39862
  name: "strictPropertyInitialization",
39798
39863
  type: "boolean",
39799
39864
  affectsSemanticDiagnostics: true,
39865
+ affectsMultiFileEmitBuildInfo: true,
39800
39866
  strictFlag: true,
39801
39867
  category: ts.Diagnostics.Type_Checking,
39802
39868
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39806,6 +39872,7 @@ var ts;
39806
39872
  name: "noImplicitThis",
39807
39873
  type: "boolean",
39808
39874
  affectsSemanticDiagnostics: true,
39875
+ affectsMultiFileEmitBuildInfo: true,
39809
39876
  strictFlag: true,
39810
39877
  category: ts.Diagnostics.Type_Checking,
39811
39878
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39815,6 +39882,7 @@ var ts;
39815
39882
  name: "useUnknownInCatchVariables",
39816
39883
  type: "boolean",
39817
39884
  affectsSemanticDiagnostics: true,
39885
+ affectsMultiFileEmitBuildInfo: true,
39818
39886
  strictFlag: true,
39819
39887
  category: ts.Diagnostics.Type_Checking,
39820
39888
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39824,6 +39892,8 @@ var ts;
39824
39892
  name: "alwaysStrict",
39825
39893
  type: "boolean",
39826
39894
  affectsSourceFile: true,
39895
+ affectsEmit: true,
39896
+ affectsMultiFileEmitBuildInfo: true,
39827
39897
  strictFlag: true,
39828
39898
  category: ts.Diagnostics.Type_Checking,
39829
39899
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39834,6 +39904,7 @@ var ts;
39834
39904
  name: "noUnusedLocals",
39835
39905
  type: "boolean",
39836
39906
  affectsSemanticDiagnostics: true,
39907
+ affectsMultiFileEmitBuildInfo: true,
39837
39908
  category: ts.Diagnostics.Type_Checking,
39838
39909
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39839
39910
  defaultValueDescription: false,
@@ -39842,6 +39913,7 @@ var ts;
39842
39913
  name: "noUnusedParameters",
39843
39914
  type: "boolean",
39844
39915
  affectsSemanticDiagnostics: true,
39916
+ affectsMultiFileEmitBuildInfo: true,
39845
39917
  category: ts.Diagnostics.Type_Checking,
39846
39918
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39847
39919
  defaultValueDescription: false,
@@ -39850,6 +39922,7 @@ var ts;
39850
39922
  name: "exactOptionalPropertyTypes",
39851
39923
  type: "boolean",
39852
39924
  affectsSemanticDiagnostics: true,
39925
+ affectsMultiFileEmitBuildInfo: true,
39853
39926
  category: ts.Diagnostics.Type_Checking,
39854
39927
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39855
39928
  defaultValueDescription: false,
@@ -39858,6 +39931,7 @@ var ts;
39858
39931
  name: "noImplicitReturns",
39859
39932
  type: "boolean",
39860
39933
  affectsSemanticDiagnostics: true,
39934
+ affectsMultiFileEmitBuildInfo: true,
39861
39935
  category: ts.Diagnostics.Type_Checking,
39862
39936
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39863
39937
  defaultValueDescription: false,
@@ -39867,6 +39941,7 @@ var ts;
39867
39941
  type: "boolean",
39868
39942
  affectsBindDiagnostics: true,
39869
39943
  affectsSemanticDiagnostics: true,
39944
+ affectsMultiFileEmitBuildInfo: true,
39870
39945
  category: ts.Diagnostics.Type_Checking,
39871
39946
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39872
39947
  defaultValueDescription: false,
@@ -39875,6 +39950,7 @@ var ts;
39875
39950
  name: "noUncheckedIndexedAccess",
39876
39951
  type: "boolean",
39877
39952
  affectsSemanticDiagnostics: true,
39953
+ affectsMultiFileEmitBuildInfo: true,
39878
39954
  category: ts.Diagnostics.Type_Checking,
39879
39955
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39880
39956
  defaultValueDescription: false,
@@ -39883,6 +39959,7 @@ var ts;
39883
39959
  name: "noImplicitOverride",
39884
39960
  type: "boolean",
39885
39961
  affectsSemanticDiagnostics: true,
39962
+ affectsMultiFileEmitBuildInfo: true,
39886
39963
  category: ts.Diagnostics.Type_Checking,
39887
39964
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39888
39965
  defaultValueDescription: false,
@@ -39890,6 +39967,8 @@ var ts;
39890
39967
  {
39891
39968
  name: "noPropertyAccessFromIndexSignature",
39892
39969
  type: "boolean",
39970
+ affectsSemanticDiagnostics: true,
39971
+ affectsMultiFileEmitBuildInfo: true,
39893
39972
  showInSimplifiedHelpView: false,
39894
39973
  category: ts.Diagnostics.Type_Checking,
39895
39974
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -39975,6 +40054,7 @@ var ts;
39975
40054
  name: "allowSyntheticDefaultImports",
39976
40055
  type: "boolean",
39977
40056
  affectsSemanticDiagnostics: true,
40057
+ affectsMultiFileEmitBuildInfo: true,
39978
40058
  category: ts.Diagnostics.Interop_Constraints,
39979
40059
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
39980
40060
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -39984,6 +40064,7 @@ var ts;
39984
40064
  type: "boolean",
39985
40065
  affectsSemanticDiagnostics: true,
39986
40066
  affectsEmit: true,
40067
+ affectsMultiFileEmitBuildInfo: true,
39987
40068
  showInSimplifiedHelpView: true,
39988
40069
  category: ts.Diagnostics.Interop_Constraints,
39989
40070
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -40000,6 +40081,7 @@ var ts;
40000
40081
  name: "allowUmdGlobalAccess",
40001
40082
  type: "boolean",
40002
40083
  affectsSemanticDiagnostics: true,
40084
+ affectsMultiFileEmitBuildInfo: true,
40003
40085
  category: ts.Diagnostics.Modules,
40004
40086
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
40005
40087
  defaultValueDescription: false,
@@ -40021,6 +40103,7 @@ var ts;
40021
40103
  name: "sourceRoot",
40022
40104
  type: "string",
40023
40105
  affectsEmit: true,
40106
+ affectsMultiFileEmitBuildInfo: true,
40024
40107
  paramType: ts.Diagnostics.LOCATION,
40025
40108
  category: ts.Diagnostics.Emit,
40026
40109
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -40029,6 +40112,7 @@ var ts;
40029
40112
  name: "mapRoot",
40030
40113
  type: "string",
40031
40114
  affectsEmit: true,
40115
+ affectsMultiFileEmitBuildInfo: true,
40032
40116
  paramType: ts.Diagnostics.LOCATION,
40033
40117
  category: ts.Diagnostics.Emit,
40034
40118
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -40037,6 +40121,7 @@ var ts;
40037
40121
  name: "inlineSourceMap",
40038
40122
  type: "boolean",
40039
40123
  affectsEmit: true,
40124
+ affectsMultiFileEmitBuildInfo: true,
40040
40125
  category: ts.Diagnostics.Emit,
40041
40126
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
40042
40127
  defaultValueDescription: false,
@@ -40045,6 +40130,7 @@ var ts;
40045
40130
  name: "inlineSources",
40046
40131
  type: "boolean",
40047
40132
  affectsEmit: true,
40133
+ affectsMultiFileEmitBuildInfo: true,
40048
40134
  category: ts.Diagnostics.Emit,
40049
40135
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
40050
40136
  defaultValueDescription: false,
@@ -40054,6 +40140,7 @@ var ts;
40054
40140
  name: "experimentalDecorators",
40055
40141
  type: "boolean",
40056
40142
  affectsSemanticDiagnostics: true,
40143
+ affectsMultiFileEmitBuildInfo: true,
40057
40144
  category: ts.Diagnostics.Language_and_Environment,
40058
40145
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
40059
40146
  defaultValueDescription: false,
@@ -40063,6 +40150,7 @@ var ts;
40063
40150
  type: "boolean",
40064
40151
  affectsSemanticDiagnostics: true,
40065
40152
  affectsEmit: true,
40153
+ affectsMultiFileEmitBuildInfo: true,
40066
40154
  category: ts.Diagnostics.Language_and_Environment,
40067
40155
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
40068
40156
  defaultValueDescription: false,
@@ -40087,6 +40175,7 @@ var ts;
40087
40175
  type: "string",
40088
40176
  affectsSemanticDiagnostics: true,
40089
40177
  affectsEmit: true,
40178
+ affectsMultiFileEmitBuildInfo: true,
40090
40179
  affectsModuleResolution: true,
40091
40180
  category: ts.Diagnostics.Language_and_Environment,
40092
40181
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -40104,6 +40193,9 @@ var ts;
40104
40193
  name: "out",
40105
40194
  type: "string",
40106
40195
  affectsEmit: true,
40196
+ affectsMultiFileEmitBuildInfo: true,
40197
+ affectsDeclarationPath: true,
40198
+ affectsBundleEmitBuildInfo: true,
40107
40199
  isFilePath: false,
40108
40200
  // for correct behaviour, please use outFile
40109
40201
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -40115,6 +40207,7 @@ var ts;
40115
40207
  name: "reactNamespace",
40116
40208
  type: "string",
40117
40209
  affectsEmit: true,
40210
+ affectsMultiFileEmitBuildInfo: true,
40118
40211
  category: ts.Diagnostics.Language_and_Environment,
40119
40212
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
40120
40213
  defaultValueDescription: "`React`",
@@ -40122,6 +40215,8 @@ var ts;
40122
40215
  {
40123
40216
  name: "skipDefaultLibCheck",
40124
40217
  type: "boolean",
40218
+ // We need to store these to determine whether `lib` files need to be rechecked
40219
+ affectsMultiFileEmitBuildInfo: true,
40125
40220
  category: ts.Diagnostics.Completeness,
40126
40221
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
40127
40222
  defaultValueDescription: false,
@@ -40137,6 +40232,7 @@ var ts;
40137
40232
  name: "emitBOM",
40138
40233
  type: "boolean",
40139
40234
  affectsEmit: true,
40235
+ affectsMultiFileEmitBuildInfo: true,
40140
40236
  category: ts.Diagnostics.Emit,
40141
40237
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
40142
40238
  defaultValueDescription: false,
@@ -40148,6 +40244,7 @@ var ts;
40148
40244
  lf: 1 /* LineFeed */
40149
40245
  })),
40150
40246
  affectsEmit: true,
40247
+ affectsMultiFileEmitBuildInfo: true,
40151
40248
  paramType: ts.Diagnostics.NEWLINE,
40152
40249
  category: ts.Diagnostics.Emit,
40153
40250
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -40157,6 +40254,7 @@ var ts;
40157
40254
  name: "noErrorTruncation",
40158
40255
  type: "boolean",
40159
40256
  affectsSemanticDiagnostics: true,
40257
+ affectsMultiFileEmitBuildInfo: true,
40160
40258
  category: ts.Diagnostics.Output_Formatting,
40161
40259
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
40162
40260
  defaultValueDescription: false,
@@ -40187,6 +40285,7 @@ var ts;
40187
40285
  name: "stripInternal",
40188
40286
  type: "boolean",
40189
40287
  affectsEmit: true,
40288
+ affectsMultiFileEmitBuildInfo: true,
40190
40289
  category: ts.Diagnostics.Emit,
40191
40290
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
40192
40291
  defaultValueDescription: false,
@@ -40227,6 +40326,7 @@ var ts;
40227
40326
  name: "noImplicitUseStrict",
40228
40327
  type: "boolean",
40229
40328
  affectsSemanticDiagnostics: true,
40329
+ affectsMultiFileEmitBuildInfo: true,
40230
40330
  category: ts.Diagnostics.Backwards_Compatibility,
40231
40331
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
40232
40332
  defaultValueDescription: false,
@@ -40235,6 +40335,7 @@ var ts;
40235
40335
  name: "noEmitHelpers",
40236
40336
  type: "boolean",
40237
40337
  affectsEmit: true,
40338
+ affectsMultiFileEmitBuildInfo: true,
40238
40339
  category: ts.Diagnostics.Emit,
40239
40340
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
40240
40341
  defaultValueDescription: false,
@@ -40243,6 +40344,7 @@ var ts;
40243
40344
  name: "noEmitOnError",
40244
40345
  type: "boolean",
40245
40346
  affectsEmit: true,
40347
+ affectsMultiFileEmitBuildInfo: true,
40246
40348
  category: ts.Diagnostics.Emit,
40247
40349
  transpileOptionValue: undefined,
40248
40350
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40252,6 +40354,7 @@ var ts;
40252
40354
  name: "preserveConstEnums",
40253
40355
  type: "boolean",
40254
40356
  affectsEmit: true,
40357
+ affectsMultiFileEmitBuildInfo: true,
40255
40358
  category: ts.Diagnostics.Emit,
40256
40359
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40257
40360
  defaultValueDescription: false,
@@ -40260,6 +40363,8 @@ var ts;
40260
40363
  name: "declarationDir",
40261
40364
  type: "string",
40262
40365
  affectsEmit: true,
40366
+ affectsMultiFileEmitBuildInfo: true,
40367
+ affectsDeclarationPath: true,
40263
40368
  isFilePath: true,
40264
40369
  paramType: ts.Diagnostics.DIRECTORY,
40265
40370
  category: ts.Diagnostics.Emit,
@@ -40269,6 +40374,8 @@ var ts;
40269
40374
  {
40270
40375
  name: "skipLibCheck",
40271
40376
  type: "boolean",
40377
+ // We need to store these to determine whether `lib` files need to be rechecked
40378
+ affectsMultiFileEmitBuildInfo: true,
40272
40379
  category: ts.Diagnostics.Completeness,
40273
40380
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40274
40381
  defaultValueDescription: false,
@@ -40278,6 +40385,7 @@ var ts;
40278
40385
  type: "boolean",
40279
40386
  affectsBindDiagnostics: true,
40280
40387
  affectsSemanticDiagnostics: true,
40388
+ affectsMultiFileEmitBuildInfo: true,
40281
40389
  category: ts.Diagnostics.Type_Checking,
40282
40390
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40283
40391
  defaultValueDescription: undefined,
@@ -40287,6 +40395,7 @@ var ts;
40287
40395
  type: "boolean",
40288
40396
  affectsBindDiagnostics: true,
40289
40397
  affectsSemanticDiagnostics: true,
40398
+ affectsMultiFileEmitBuildInfo: true,
40290
40399
  category: ts.Diagnostics.Type_Checking,
40291
40400
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40292
40401
  defaultValueDescription: undefined,
@@ -40295,6 +40404,7 @@ var ts;
40295
40404
  name: "suppressExcessPropertyErrors",
40296
40405
  type: "boolean",
40297
40406
  affectsSemanticDiagnostics: true,
40407
+ affectsMultiFileEmitBuildInfo: true,
40298
40408
  category: ts.Diagnostics.Backwards_Compatibility,
40299
40409
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40300
40410
  defaultValueDescription: false,
@@ -40303,6 +40413,7 @@ var ts;
40303
40413
  name: "suppressImplicitAnyIndexErrors",
40304
40414
  type: "boolean",
40305
40415
  affectsSemanticDiagnostics: true,
40416
+ affectsMultiFileEmitBuildInfo: true,
40306
40417
  category: ts.Diagnostics.Backwards_Compatibility,
40307
40418
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40308
40419
  defaultValueDescription: false,
@@ -40327,6 +40438,7 @@ var ts;
40327
40438
  name: "noStrictGenericChecks",
40328
40439
  type: "boolean",
40329
40440
  affectsSemanticDiagnostics: true,
40441
+ affectsMultiFileEmitBuildInfo: true,
40330
40442
  category: ts.Diagnostics.Backwards_Compatibility,
40331
40443
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40332
40444
  defaultValueDescription: false,
@@ -40336,6 +40448,7 @@ var ts;
40336
40448
  type: "boolean",
40337
40449
  affectsSemanticDiagnostics: true,
40338
40450
  affectsEmit: true,
40451
+ affectsMultiFileEmitBuildInfo: true,
40339
40452
  category: ts.Diagnostics.Language_and_Environment,
40340
40453
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40341
40454
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40344,6 +40457,7 @@ var ts;
40344
40457
  name: "preserveValueImports",
40345
40458
  type: "boolean",
40346
40459
  affectsEmit: true,
40460
+ affectsMultiFileEmitBuildInfo: true,
40347
40461
  category: ts.Diagnostics.Emit,
40348
40462
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40349
40463
  defaultValueDescription: false,
@@ -40387,6 +40501,8 @@ var ts;
40387
40501
  /* @internal */
40388
40502
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40389
40503
  /* @internal */
40504
+ ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40505
+ /* @internal */
40390
40506
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40391
40507
  /* @internal */
40392
40508
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -40431,7 +40547,14 @@ var ts;
40431
40547
  description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
40432
40548
  type: "boolean",
40433
40549
  defaultValueDescription: false,
40434
- }
40550
+ },
40551
+ {
40552
+ name: "solutionDiagnostics",
40553
+ type: "boolean",
40554
+ category: ts.Diagnostics.Compiler_Diagnostics,
40555
+ description: ts.Diagnostics.Output_more_detailed_solution_performance_information_after_building,
40556
+ defaultValueDescription: false,
40557
+ },
40435
40558
  ];
40436
40559
  /* @internal */
40437
40560
  ts.buildOpts = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), ts.optionsForBuild, true);
@@ -41242,6 +41365,7 @@ var ts;
41242
41365
  return optionDefinition.type;
41243
41366
  }
41244
41367
  }
41368
+ /* @internal */
41245
41369
  function getNameOfCompilerOptionValue(value, customTypeMap) {
41246
41370
  // There is a typeMap associated with this command-line option so use it to map value back to its name
41247
41371
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41250,6 +41374,7 @@ var ts;
41250
41374
  }
41251
41375
  });
41252
41376
  }
41377
+ ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41253
41378
  function serializeCompilerOptions(options, pathOptions) {
41254
41379
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41255
41380
  }
@@ -44371,8 +44496,8 @@ var ts;
44371
44496
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
44372
44497
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
44373
44498
  if (!pathAndExtension && packageInfo
44374
- && packageInfo.packageJsonContent.exports === undefined
44375
- && packageInfo.packageJsonContent.main === undefined
44499
+ // eslint-disable-next-line no-null/no-null
44500
+ && (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
44376
44501
  && state.features & NodeResolutionFeatures.EsmMode) {
44377
44502
  // EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
44378
44503
  // a default `index.js` entrypoint if no `main` or `exports` are present
@@ -48037,7 +48162,10 @@ var ts;
48037
48162
  TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
48038
48163
  TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
48039
48164
  TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
48040
- TypeFacts[TypeFacts["All"] = 16777215] = "All";
48165
+ TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
48166
+ TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
48167
+ TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
48168
+ TypeFacts[TypeFacts["All"] = 134217727] = "All";
48041
48169
  // The following members encode facts about particular kinds of types for use in the getTypeFacts function.
48042
48170
  // The presence of a particular fact means that the given test is true for some (and possibly all) values
48043
48171
  // of that kind of type.
@@ -48079,14 +48207,16 @@ var ts;
48079
48207
  TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
48080
48208
  TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
48081
48209
  TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
48082
- TypeFacts[TypeFacts["UndefinedFacts"] = 9830144] = "UndefinedFacts";
48083
- TypeFacts[TypeFacts["NullFacts"] = 9363232] = "NullFacts";
48084
- TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
48210
+ TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
48211
+ TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
48212
+ TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
48213
+ TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
48214
+ TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
48215
+ TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
48085
48216
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
48086
- TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
48087
48217
  // Masks
48088
48218
  TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
48089
- TypeFacts[TypeFacts["AndFactsMask"] = 16768959] = "AndFactsMask";
48219
+ TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
48090
48220
  })(TypeFacts || (TypeFacts = {}));
48091
48221
  var typeofEQFacts = new ts.Map(ts.getEntries({
48092
48222
  string: 1 /* TypeofEQString */,
@@ -50250,7 +50380,12 @@ var ts;
50250
50380
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
50251
50381
  if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
50252
50382
  if (isPrimitiveTypeName(name)) {
50253
- error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50383
+ if (isExtendedByInterface(errorLocation)) {
50384
+ error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
50385
+ }
50386
+ else {
50387
+ error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50388
+ }
50254
50389
  return true;
50255
50390
  }
50256
50391
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
@@ -50270,6 +50405,16 @@ var ts;
50270
50405
  }
50271
50406
  return false;
50272
50407
  }
50408
+ function isExtendedByInterface(node) {
50409
+ var grandparent = node.parent.parent;
50410
+ var parentOfGrandparent = grandparent.parent;
50411
+ if (grandparent && parentOfGrandparent) {
50412
+ var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
50413
+ var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
50414
+ return isExtending && isInterface;
50415
+ }
50416
+ return false;
50417
+ }
50273
50418
  function maybeMappedType(node, symbol) {
50274
50419
  var container = ts.findAncestor(node.parent, function (n) {
50275
50420
  return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
@@ -53110,7 +53255,7 @@ var ts;
53110
53255
  anyType : getNonMissingTypeOfSymbol(propertySymbol);
53111
53256
  var saveEnclosingDeclaration = context.enclosingDeclaration;
53112
53257
  context.enclosingDeclaration = undefined;
53113
- if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */ && isLateBoundName(propertySymbol.escapedName)) {
53258
+ if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
53114
53259
  if (propertySymbol.declarations) {
53115
53260
  var decl = ts.first(propertySymbol.declarations);
53116
53261
  if (hasLateBindableName(decl)) {
@@ -54794,7 +54939,7 @@ var ts;
54794
54939
  ? getBaseConstructorTypeOfClass(staticType)
54795
54940
  : anyType;
54796
54941
  var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(94 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))], true), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(117 /* ImplementsKeyword */, implementsExpressions)], true);
54797
- var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
54942
+ var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
54798
54943
  var publicSymbolProps = ts.filter(symbolProps, function (s) {
54799
54944
  // `valueDeclaration` could be undefined if inherited from
54800
54945
  // a union/intersection base type, but inherited properties
@@ -55932,7 +56077,7 @@ var ts;
55932
56077
  if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
55933
56078
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
55934
56079
  // undefined from the final type.
55935
- return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
56080
+ return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
55936
56081
  }
55937
56082
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
55938
56083
  }
@@ -59135,7 +59280,7 @@ var ts;
59135
59280
  var objectType;
59136
59281
  return !!(type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ &&
59137
59282
  !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
59138
- !objectType.declaration.questionToken && !objectType.declaration.nameType);
59283
+ !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
59139
59284
  }
59140
59285
  /**
59141
59286
  * For a type parameter, return the base constraint of the type parameter. For the string, number,
@@ -64427,7 +64572,7 @@ var ts;
64427
64572
  var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
64428
64573
  var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
64429
64574
  var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
64430
- (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */);
64575
+ (getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
64431
64576
  var related = callbacks ?
64432
64577
  compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
64433
64578
  !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
@@ -67645,30 +67790,8 @@ var ts;
67645
67790
  var value = _a.value;
67646
67791
  return value.base10Value === "0";
67647
67792
  }
67648
- function getFalsyFlagsOfTypes(types) {
67649
- var result = 0;
67650
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
67651
- var t = types_14[_i];
67652
- result |= getFalsyFlags(t);
67653
- }
67654
- return result;
67655
- }
67656
- // Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
67657
- // flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
67658
- // no flags for all other types (including non-falsy literal types).
67659
- function getFalsyFlags(type) {
67660
- var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
67661
- return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
67662
- t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
67663
- t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
67664
- t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
67665
- t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
67666
- t.flags & 117724 /* PossiblyFalsy */;
67667
- }
67668
67793
  function removeDefinitelyFalsyTypes(type) {
67669
- return getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ ?
67670
- filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
67671
- type;
67794
+ return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
67672
67795
  }
67673
67796
  function extractDefinitelyFalsyTypes(type) {
67674
67797
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -67711,14 +67834,7 @@ var ts;
67711
67834
  getIntersectionType([type, emptyObjectType]);
67712
67835
  }
67713
67836
  function getNonNullableType(type) {
67714
- if (strictNullChecks) {
67715
- // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
67716
- // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
67717
- // that isn't eliminated by a NonNullable<T> instantiation.
67718
- var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
67719
- return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
67720
- }
67721
- return type;
67837
+ return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
67722
67838
  }
67723
67839
  function addOptionalTypeMarker(type) {
67724
67840
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -68862,8 +68978,8 @@ var ts;
68862
68978
  }
68863
68979
  function getSingleTypeVariableFromIntersectionTypes(types) {
68864
68980
  var typeVariable;
68865
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
68866
- var type = types_15[_i];
68981
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
68982
+ var type = types_14[_i];
68867
68983
  var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
68868
68984
  if (!t || typeVariable && t !== typeVariable) {
68869
68985
  return undefined;
@@ -69616,8 +69732,8 @@ var ts;
69616
69732
  }
69617
69733
  }
69618
69734
  };
69619
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
69620
- var type = types_16[_i];
69735
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
69736
+ var type = types_15[_i];
69621
69737
  var state_9 = _loop_24(type);
69622
69738
  if (typeof state_9 === "object")
69623
69739
  return state_9.value;
@@ -69732,14 +69848,16 @@ var ts;
69732
69848
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
69733
69849
  resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
69734
69850
  }
69735
- function getTypeFacts(type, ignoreObjects) {
69736
- if (ignoreObjects === void 0) { ignoreObjects = false; }
69851
+ function getTypeFacts(type) {
69852
+ if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
69853
+ type = getBaseConstraintOfType(type) || unknownType;
69854
+ }
69737
69855
  var flags = type.flags;
69738
- if (flags & 4 /* String */) {
69856
+ if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
69739
69857
  return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
69740
69858
  }
69741
- if (flags & 128 /* StringLiteral */) {
69742
- var isEmpty = type.value === "";
69859
+ if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
69860
+ var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
69743
69861
  return strictNullChecks ?
69744
69862
  isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
69745
69863
  isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
@@ -69771,20 +69889,20 @@ var ts;
69771
69889
  (type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
69772
69890
  }
69773
69891
  if (flags & 524288 /* Object */) {
69774
- if (ignoreObjects) {
69775
- return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
69776
- }
69777
69892
  return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
69778
- strictNullChecks ? 16318463 /* EmptyObjectStrictFacts */ : 16777215 /* EmptyObjectFacts */ :
69893
+ strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
69779
69894
  isFunctionObjectType(type) ?
69780
69895
  strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
69781
69896
  strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
69782
69897
  }
69783
- if (flags & (16384 /* Void */ | 32768 /* Undefined */)) {
69784
- return 9830144 /* UndefinedFacts */;
69898
+ if (flags & 16384 /* Void */) {
69899
+ return 9830144 /* VoidFacts */;
69900
+ }
69901
+ if (flags & 32768 /* Undefined */) {
69902
+ return 26607360 /* UndefinedFacts */;
69785
69903
  }
69786
69904
  if (flags & 65536 /* Null */) {
69787
- return 9363232 /* NullFacts */;
69905
+ return 42917664 /* NullFacts */;
69788
69906
  }
69789
69907
  if (flags & 12288 /* ESSymbolLike */) {
69790
69908
  return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
@@ -69795,38 +69913,39 @@ var ts;
69795
69913
  if (flags & 131072 /* Never */) {
69796
69914
  return 0 /* None */;
69797
69915
  }
69798
- if (flags & 465829888 /* Instantiable */) {
69799
- return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
69800
- strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
69801
- }
69802
69916
  if (flags & 1048576 /* Union */) {
69803
- return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0 /* None */);
69917
+ return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
69804
69918
  }
69805
69919
  if (flags & 2097152 /* Intersection */) {
69806
- // When an intersection contains a primitive type we ignore object type constituents as they are
69807
- // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69808
- ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
69809
- return getIntersectionTypeFacts(type, ignoreObjects);
69920
+ return getIntersectionTypeFacts(type);
69810
69921
  }
69811
- return 16777215 /* All */;
69922
+ return 83886079 /* UnknownFacts */;
69812
69923
  }
69813
- function getIntersectionTypeFacts(type, ignoreObjects) {
69924
+ function getIntersectionTypeFacts(type) {
69925
+ // When an intersection contains a primitive type we ignore object type constituents as they are
69926
+ // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69927
+ var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
69814
69928
  // When computing the type facts of an intersection type, certain type facts are computed as `and`
69815
69929
  // and others are computed as `or`.
69816
69930
  var oredFacts = 0 /* None */;
69817
- var andedFacts = 16777215 /* All */;
69931
+ var andedFacts = 134217727 /* All */;
69818
69932
  for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
69819
69933
  var t = _a[_i];
69820
- var f = getTypeFacts(t, ignoreObjects);
69821
- oredFacts |= f;
69822
- andedFacts &= f;
69934
+ if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
69935
+ var f = getTypeFacts(t);
69936
+ oredFacts |= f;
69937
+ andedFacts &= f;
69938
+ }
69823
69939
  }
69824
- return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 16768959 /* AndFactsMask */;
69940
+ return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
69825
69941
  }
69826
69942
  function getTypeWithFacts(type, include) {
69827
69943
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
69828
69944
  }
69829
- function getIntersectionWithFacts(type, facts) {
69945
+ // This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
69946
+ // unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
69947
+ // instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
69948
+ function getAdjustedTypeWithFacts(type, facts) {
69830
69949
  var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
69831
69950
  if (strictNullChecks) {
69832
69951
  switch (facts) {
@@ -70092,8 +70211,8 @@ var ts;
70092
70211
  var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
70093
70212
  var mappedTypes;
70094
70213
  var changed = false;
70095
- for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
70096
- var t = types_17[_i];
70214
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
70215
+ var t = types_16[_i];
70097
70216
  var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
70098
70217
  changed || (changed = t !== mapped);
70099
70218
  if (mapped) {
@@ -70179,8 +70298,8 @@ var ts;
70179
70298
  }
70180
70299
  function isEvolvingArrayTypeList(types) {
70181
70300
  var hasEvolvingArrayType = false;
70182
- for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
70183
- var t = types_18[_i];
70301
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
70302
+ var t = types_17[_i];
70184
70303
  if (!(t.flags & 131072 /* Never */)) {
70185
70304
  if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
70186
70305
  return false;
@@ -71003,10 +71122,10 @@ var ts;
71003
71122
  }
71004
71123
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
71005
71124
  if (isMatchingReference(reference, expr)) {
71006
- return getIntersectionWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
71125
+ return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
71007
71126
  }
71008
71127
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
71009
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71128
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71010
71129
  }
71011
71130
  var access = getDiscriminantPropertyAccess(expr, type);
71012
71131
  if (access) {
@@ -71146,7 +71265,7 @@ var ts;
71146
71265
  // Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
71147
71266
  var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
71148
71267
  equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
71149
- return removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
71268
+ return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
71150
71269
  }
71151
71270
  function narrowTypeByEquality(type, operator, value, assumeTrue) {
71152
71271
  if (type.flags & 1 /* Any */) {
@@ -71175,7 +71294,7 @@ var ts;
71175
71294
  valueType.flags & 65536 /* Null */ ?
71176
71295
  assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
71177
71296
  assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
71178
- return getIntersectionWithFacts(type, facts);
71297
+ return getAdjustedTypeWithFacts(type, facts);
71179
71298
  }
71180
71299
  if (assumeTrue) {
71181
71300
  var filterFn = operator === 34 /* EqualsEqualsToken */ ?
@@ -71196,7 +71315,7 @@ var ts;
71196
71315
  var target = getReferenceCandidate(typeOfExpr.expression);
71197
71316
  if (!isMatchingReference(reference, target)) {
71198
71317
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
71199
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71318
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71200
71319
  }
71201
71320
  return type;
71202
71321
  }
@@ -71400,7 +71519,7 @@ var ts;
71400
71519
  var left = getReferenceCandidate(expr.left);
71401
71520
  if (!isMatchingReference(reference, left)) {
71402
71521
  if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
71403
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71522
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71404
71523
  }
71405
71524
  return type;
71406
71525
  }
@@ -71488,7 +71607,7 @@ var ts;
71488
71607
  }
71489
71608
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
71490
71609
  !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
71491
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71610
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71492
71611
  }
71493
71612
  var access = getDiscriminantPropertyAccess(predicateArgument, type);
71494
71613
  if (access) {
@@ -71545,7 +71664,7 @@ var ts;
71545
71664
  }
71546
71665
  function narrowTypeByOptionality(type, expr, assumePresent) {
71547
71666
  if (isMatchingReference(reference, expr)) {
71548
- return getTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71667
+ return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71549
71668
  }
71550
71669
  var access = getDiscriminantPropertyAccess(expr, type);
71551
71670
  if (access) {
@@ -71631,8 +71750,8 @@ var ts;
71631
71750
  var annotationIncludesUndefined = strictNullChecks &&
71632
71751
  declaration.kind === 164 /* Parameter */ &&
71633
71752
  declaration.initializer &&
71634
- getFalsyFlags(declaredType) & 32768 /* Undefined */ &&
71635
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */);
71753
+ getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
71754
+ !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
71636
71755
  popTypeResolution();
71637
71756
  return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
71638
71757
  }
@@ -71960,7 +72079,7 @@ var ts;
71960
72079
  return convertAutoToAny(flowType);
71961
72080
  }
71962
72081
  }
71963
- else if (!assumeInitialized && !(getFalsyFlags(type) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
72082
+ else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
71964
72083
  error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
71965
72084
  // Return the declared type to reduce follow-on errors
71966
72085
  return type;
@@ -73489,8 +73608,8 @@ var ts;
73489
73608
  }
73490
73609
  var signatureList;
73491
73610
  var types = type.types;
73492
- for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
73493
- var current = types_19[_i];
73611
+ for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
73612
+ var current = types_18[_i];
73494
73613
  var signature = getContextualCallSignature(current, node);
73495
73614
  if (signature) {
73496
73615
  if (!signatureList) {
@@ -74652,19 +74771,19 @@ var ts;
74652
74771
  return checkNonNullType(checkExpression(node), node);
74653
74772
  }
74654
74773
  function isNullableType(type) {
74655
- return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */);
74774
+ return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
74656
74775
  }
74657
74776
  function getNonNullableTypeIfNeeded(type) {
74658
74777
  return isNullableType(type) ? getNonNullableType(type) : type;
74659
74778
  }
74660
- function reportObjectPossiblyNullOrUndefinedError(node, flags) {
74661
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74779
+ function reportObjectPossiblyNullOrUndefinedError(node, facts) {
74780
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74662
74781
  ts.Diagnostics.Object_is_possibly_null_or_undefined :
74663
74782
  ts.Diagnostics.Object_is_possibly_undefined :
74664
74783
  ts.Diagnostics.Object_is_possibly_null);
74665
74784
  }
74666
- function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {
74667
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74785
+ function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
74786
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74668
74787
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
74669
74788
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
74670
74789
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
@@ -74674,9 +74793,9 @@ var ts;
74674
74793
  error(node, ts.Diagnostics.Object_is_of_type_unknown);
74675
74794
  return errorType;
74676
74795
  }
74677
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */;
74678
- if (kind) {
74679
- reportError(node, kind);
74796
+ var facts = getTypeFacts(type);
74797
+ if (facts & 50331648 /* IsUndefinedOrNull */) {
74798
+ reportError(node, facts);
74680
74799
  var t = getNonNullableType(type);
74681
74800
  return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
74682
74801
  }
@@ -74971,7 +75090,7 @@ var ts;
74971
75090
  assumeUninitialized = true;
74972
75091
  }
74973
75092
  var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
74974
- if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
75093
+ if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
74975
75094
  error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
74976
75095
  // Return the declared type to reduce follow-on errors
74977
75096
  return propType;
@@ -76887,8 +77006,8 @@ var ts;
76887
77006
  if (apparentType.flags & 1048576 /* Union */) {
76888
77007
  var types = apparentType.types;
76889
77008
  var hasSignatures = false;
76890
- for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
76891
- var constituent = types_20[_i];
77009
+ for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
77010
+ var constituent = types_19[_i];
76892
77011
  var signatures = getSignaturesOfType(constituent, kind);
76893
77012
  if (signatures.length !== 0) {
76894
77013
  hasSignatures = true;
@@ -78579,7 +78698,7 @@ var ts;
78579
78698
  var type = getTypeOfSymbol(symbol);
78580
78699
  if (strictNullChecks &&
78581
78700
  !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
78582
- !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getFalsyFlags(type) & 32768 /* Undefined */)) {
78701
+ !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
78583
78702
  error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
78584
78703
  }
78585
78704
  }
@@ -78747,8 +78866,8 @@ var ts;
78747
78866
  }
78748
78867
  if (type.flags & 3145728 /* UnionOrIntersection */) {
78749
78868
  var types = type.types;
78750
- for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
78751
- var t = types_21[_i];
78869
+ for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
78870
+ var t = types_20[_i];
78752
78871
  if (maybeTypeOfKind(t, kind)) {
78753
78872
  return true;
78754
78873
  }
@@ -78975,7 +79094,7 @@ var ts;
78975
79094
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
78976
79095
  // undefined from the final type.
78977
79096
  if (strictNullChecks &&
78978
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768 /* Undefined */)) {
79097
+ !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
78979
79098
  sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
78980
79099
  }
78981
79100
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -79375,7 +79494,7 @@ var ts;
79375
79494
  case 56 /* BarBarToken */:
79376
79495
  case 75 /* BarBarEqualsToken */: {
79377
79496
  var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
79378
- getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
79497
+ getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
79379
79498
  leftType;
79380
79499
  if (operator === 75 /* BarBarEqualsToken */) {
79381
79500
  checkAssignmentOperator(rightType);
@@ -81916,8 +82035,8 @@ var ts;
81916
82035
  }
81917
82036
  function getEntityNameForDecoratorMetadataFromTypeList(types) {
81918
82037
  var commonEntityName;
81919
- for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
81920
- var typeNode = types_22[_i];
82038
+ for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
82039
+ var typeNode = types_21[_i];
81921
82040
  while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
81922
82041
  typeNode = typeNode.type; // Skip parens if need be
81923
82042
  }
@@ -82936,7 +83055,7 @@ var ts;
82936
83055
  return;
82937
83056
  var type = checkTruthinessExpression(location);
82938
83057
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
82939
- if (getFalsyFlags(type) || isPropertyExpressionCast)
83058
+ if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
82940
83059
  return;
82941
83060
  // While it technically should be invalid for any known-truthy value
82942
83061
  // to be tested, we de-scope to functions and Promises unreferenced in
@@ -84622,18 +84741,17 @@ var ts;
84622
84741
  // but not by other kinds of members.
84623
84742
  // Base class instance member variables and accessors can be overridden by
84624
84743
  // derived class instance member variables and accessors, but not by other kinds of members.
84625
- var _a, _b;
84744
+ var _a, _b, _c, _d;
84626
84745
  // NOTE: assignability is checked in checkClassDeclaration
84627
84746
  var baseProperties = getPropertiesOfType(baseType);
84628
- basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84629
- var baseProperty = baseProperties_1[_i];
84747
+ var _loop_33 = function (baseProperty) {
84630
84748
  var base = getTargetSymbol(baseProperty);
84631
84749
  if (base.flags & 4194304 /* Prototype */) {
84632
- continue;
84750
+ return "continue";
84633
84751
  }
84634
84752
  var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
84635
84753
  if (!baseSymbol) {
84636
- continue;
84754
+ return "continue";
84637
84755
  }
84638
84756
  var derived = getTargetSymbol(baseSymbol);
84639
84757
  var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
@@ -84651,14 +84769,14 @@ var ts;
84651
84769
  // Searches other base types for a declaration that would satisfy the inherited abstract member.
84652
84770
  // (The class may have more than one base type via declaration merging with an interface with the
84653
84771
  // same name.)
84654
- for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
84655
- var otherBaseType = _d[_c];
84772
+ for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
84773
+ var otherBaseType = _f[_e];
84656
84774
  if (otherBaseType === baseType)
84657
84775
  continue;
84658
84776
  var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
84659
84777
  var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
84660
84778
  if (derivedElsewhere && derivedElsewhere !== base) {
84661
- continue basePropertyCheck;
84779
+ return "continue-basePropertyCheck";
84662
84780
  }
84663
84781
  }
84664
84782
  if (derivedClassDecl.kind === 226 /* ClassExpression */) {
@@ -84673,20 +84791,19 @@ var ts;
84673
84791
  // derived overrides base.
84674
84792
  var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
84675
84793
  if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
84676
- // either base or derived property is private - not override, skip it
84677
- continue;
84794
+ return "continue";
84678
84795
  }
84679
84796
  var errorMessage = void 0;
84680
84797
  var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
84681
84798
  var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
84682
84799
  if (basePropertyFlags && derivedPropertyFlags) {
84683
84800
  // property/accessor is overridden with property/accessor
84684
- if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
84685
- || base.valueDeclaration && base.valueDeclaration.parent.kind === 258 /* InterfaceDeclaration */
84801
+ if ((ts.getCheckFlags(base) & 6 /* Synthetic */
84802
+ ? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
84803
+ : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
84804
+ || ts.getCheckFlags(base) & 262144 /* Mapped */
84686
84805
  || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
84687
- // when the base property is abstract or from an interface, base/derived flags don't need to match
84688
- // same when the derived property is from an assignment
84689
- continue;
84806
+ return "continue";
84690
84807
  }
84691
84808
  var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
84692
84809
  var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
@@ -84697,12 +84814,12 @@ var ts;
84697
84814
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
84698
84815
  }
84699
84816
  else if (useDefineForClassFields) {
84700
- var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84817
+ var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84701
84818
  if (uninitialized
84702
84819
  && !(derived.flags & 33554432 /* Transient */)
84703
84820
  && !(baseDeclarationFlags & 128 /* Abstract */)
84704
84821
  && !(derivedDeclarationFlags & 128 /* Abstract */)
84705
- && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84822
+ && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84706
84823
  var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
84707
84824
  var propName = uninitialized.name;
84708
84825
  if (uninitialized.exclamationToken
@@ -84715,13 +84832,11 @@ var ts;
84715
84832
  }
84716
84833
  }
84717
84834
  }
84718
- // correct case
84719
- continue;
84835
+ return "continue";
84720
84836
  }
84721
84837
  else if (isPrototypeProperty(base)) {
84722
84838
  if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
84723
- // method is overridden with method or property -- correct case
84724
- continue;
84839
+ return "continue";
84725
84840
  }
84726
84841
  else {
84727
84842
  ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
@@ -84736,9 +84851,20 @@ var ts;
84736
84851
  }
84737
84852
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
84738
84853
  }
84854
+ };
84855
+ basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84856
+ var baseProperty = baseProperties_1[_i];
84857
+ var state_10 = _loop_33(baseProperty);
84858
+ switch (state_10) {
84859
+ case "continue-basePropertyCheck": continue basePropertyCheck;
84860
+ }
84739
84861
  }
84740
84862
  }
84741
- function getNonInterhitedProperties(type, baseTypes, properties) {
84863
+ function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
84864
+ return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
84865
+ || ts.isInterfaceDeclaration(declaration.parent);
84866
+ }
84867
+ function getNonInheritedProperties(type, baseTypes, properties) {
84742
84868
  if (!ts.length(baseTypes)) {
84743
84869
  return properties;
84744
84870
  }
@@ -84807,7 +84933,7 @@ var ts;
84807
84933
  var propName = member.name;
84808
84934
  if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
84809
84935
  var type = getTypeOfSymbol(getSymbolOfNode(member));
84810
- if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
84936
+ if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
84811
84937
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
84812
84938
  error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
84813
84939
  }
@@ -84832,7 +84958,7 @@ var ts;
84832
84958
  ts.setParent(reference, staticBlock);
84833
84959
  reference.flowNode = staticBlock.returnFlowNode;
84834
84960
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84835
- if (!(getFalsyFlags(flowType) & 32768 /* Undefined */)) {
84961
+ if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
84836
84962
  return true;
84837
84963
  }
84838
84964
  }
@@ -84847,7 +84973,7 @@ var ts;
84847
84973
  ts.setParent(reference, constructor);
84848
84974
  reference.flowNode = constructor.returnFlowNode;
84849
84975
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84850
- return !(getFalsyFlags(flowType) & 32768 /* Undefined */);
84976
+ return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
84851
84977
  }
84852
84978
  function checkInterfaceDeclaration(node) {
84853
84979
  // Grammar checking
@@ -93135,8 +93261,8 @@ var ts;
93135
93261
  // Note when updating logic here also update getEntityNameForDecoratorMetadata
93136
93262
  // so that aliases can be marked as referenced
93137
93263
  var serializedUnion;
93138
- for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
93139
- var typeNode = types_23[_i];
93264
+ for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
93265
+ var typeNode = types_22[_i];
93140
93266
  while (typeNode.kind === 191 /* ParenthesizedType */) {
93141
93267
  typeNode = typeNode.type; // Skip parens if need be
93142
93268
  }
@@ -110531,7 +110657,8 @@ var ts;
110531
110657
  return;
110532
110658
  }
110533
110659
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
110534
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
110660
+ var buildInfo = { bundle: bundle, program: program, version: version };
110661
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
110535
110662
  }
110536
110663
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
110537
110664
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110553,7 +110680,7 @@ var ts;
110553
110680
  sourceMap: compilerOptions.sourceMap,
110554
110681
  inlineSourceMap: compilerOptions.inlineSourceMap,
110555
110682
  inlineSources: compilerOptions.inlineSources,
110556
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110683
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110557
110684
  writeBundleFileInfo: !!bundleBuildInfo,
110558
110685
  relativeToBuildInfo: relativeToBuildInfo
110559
110686
  };
@@ -110605,7 +110732,7 @@ var ts;
110605
110732
  target: compilerOptions.target,
110606
110733
  sourceMap: compilerOptions.sourceMap,
110607
110734
  inlineSourceMap: compilerOptions.inlineSourceMap,
110608
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110735
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110609
110736
  onlyPrintJsDocStyle: true,
110610
110737
  writeBundleFileInfo: !!bundleBuildInfo,
110611
110738
  recordInternalSection: !!bundleBuildInfo,
@@ -110627,7 +110754,7 @@ var ts;
110627
110754
  sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
110628
110755
  sourceRoot: compilerOptions.sourceRoot,
110629
110756
  mapRoot: compilerOptions.mapRoot,
110630
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110757
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110631
110758
  // Explicitly do not passthru either `inline` option
110632
110759
  });
110633
110760
  if (forceDtsEmit && declarationTransform.transformed[0].kind === 305 /* SourceFile */) {
@@ -110685,13 +110812,18 @@ var ts;
110685
110812
  if (sourceMapFilePath) {
110686
110813
  var sourceMap = sourceMapGenerator.toString();
110687
110814
  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));
110688
110817
  }
110689
110818
  }
110690
110819
  else {
110691
110820
  writer.writeLine();
110692
110821
  }
110693
110822
  // Write the output file
110694
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
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));
110695
110827
  // Reset state
110696
110828
  writer.clear();
110697
110829
  }
@@ -110834,34 +110966,54 @@ var ts;
110834
110966
  }
110835
110967
  /*@internal*/
110836
110968
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110969
+ var createHash = ts.maybeBind(host, host.createHash);
110837
110970
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110838
- var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110839
- if (!buildInfoText)
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))
110840
110985
  return buildInfoPath;
110841
110986
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110842
110987
  if (!jsFileText)
110843
110988
  return jsFilePath;
110989
+ if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110990
+ return jsFilePath;
110844
110991
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110845
110992
  // error if no source map or for now if inline sourcemap
110846
110993
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110847
110994
  return sourceMapFilePath || "inline sourcemap decoding";
110995
+ if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110996
+ return sourceMapFilePath;
110848
110997
  // read declaration text
110849
110998
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110850
110999
  if (declarationFilePath && !declarationText)
110851
111000
  return declarationFilePath;
111001
+ if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
111002
+ return declarationFilePath;
110852
111003
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
110853
111004
  // error if no source map or for now if inline sourcemap
110854
111005
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
110855
111006
  return declarationMapPath || "inline sourcemap decoding";
110856
- var buildInfo = getBuildInfo(buildInfoText);
110857
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110858
- return buildInfoPath;
111007
+ if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
111008
+ return declarationMapPath;
110859
111009
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
110860
111010
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
110861
111011
  /*onlyOwnText*/ true);
110862
111012
  var outputFiles = [];
110863
111013
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
110864
111014
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
111015
+ var changedDtsText;
111016
+ var changedDtsData;
110865
111017
  var emitHost = {
110866
111018
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
110867
111019
  getCanonicalFileName: host.getCanonicalFileName,
@@ -110877,7 +111029,7 @@ var ts;
110877
111029
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
110878
111030
  getProjectReferenceRedirect: ts.returnUndefined,
110879
111031
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
110880
- writeFile: function (name, text, writeByteOrderMark) {
111032
+ writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110881
111033
  switch (name) {
110882
111034
  case jsFilePath:
110883
111035
  if (jsFileText === text)
@@ -110888,8 +111040,13 @@ var ts;
110888
111040
  return;
110889
111041
  break;
110890
111042
  case buildInfoPath:
110891
- var newBuildInfo = getBuildInfo(text);
111043
+ var newBuildInfo = data.buildInfo;
110892
111044
  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
+ }
110893
111050
  // Update sourceFileInfo
110894
111051
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
110895
111052
  newBuildInfo.bundle.js.sources = js.sources;
@@ -110897,11 +111054,13 @@ var ts;
110897
111054
  newBuildInfo.bundle.dts.sources = dts.sources;
110898
111055
  }
110899
111056
  newBuildInfo.bundle.sourceFiles = sourceFiles;
110900
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
111057
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110901
111058
  return;
110902
111059
  case declarationFilePath:
110903
111060
  if (declarationText === text)
110904
111061
  return;
111062
+ changedDtsText = text;
111063
+ changedDtsData = data;
110905
111064
  break;
110906
111065
  case declarationMapPath:
110907
111066
  if (declarationMapText === text)
@@ -110920,6 +111079,7 @@ var ts;
110920
111079
  getSourceFileFromReference: ts.returnUndefined,
110921
111080
  redirectTargetsMap: ts.createMultiMap(),
110922
111081
  getFileIncludeReasons: ts.notImplemented,
111082
+ createHash: createHash,
110923
111083
  };
110924
111084
  emitFiles(ts.notImplementedResolver, emitHost,
110925
111085
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -113751,8 +113911,8 @@ var ts;
113751
113911
  bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
113752
113912
  writeLine();
113753
113913
  }
113754
- for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
113755
- var directive = types_24[_d];
113914
+ for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
113915
+ var directive = types_23[_d];
113756
113916
  var pos = writer.getTextPos();
113757
113917
  var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
113758
113918
  ? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
@@ -116004,12 +116164,10 @@ var ts;
116004
116164
  }
116005
116165
  ts.createCompilerHost = createCompilerHost;
116006
116166
  /*@internal*/
116007
- // TODO(shkamat): update this after reworking ts build API
116008
116167
  function createCompilerHostWorker(options, setParentNodes, system) {
116009
116168
  if (system === void 0) { system = ts.sys; }
116010
116169
  var existingDirectories = new ts.Map();
116011
116170
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
116012
- var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
116013
116171
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
116014
116172
  var text;
116015
116173
  try {
@@ -116042,7 +116200,7 @@ var ts;
116042
116200
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
116043
116201
  // the system.writeFile will do its own directory creation and
116044
116202
  // the ensureDirectoriesExist call will always be redundant.
116045
- 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); });
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); });
116046
116204
  ts.performance.mark("afterIOWrite");
116047
116205
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
116048
116206
  }
@@ -116052,35 +116210,6 @@ var ts;
116052
116210
  }
116053
116211
  }
116054
116212
  }
116055
- var outputFingerprints;
116056
- function writeFileWorker(fileName, data, writeByteOrderMark) {
116057
- if (!ts.isWatchSet(options) || !system.getModifiedTime) {
116058
- system.writeFile(fileName, data, writeByteOrderMark);
116059
- return;
116060
- }
116061
- if (!outputFingerprints) {
116062
- outputFingerprints = new ts.Map();
116063
- }
116064
- var hash = computeHash(data);
116065
- var mtimeBefore = system.getModifiedTime(fileName);
116066
- if (mtimeBefore) {
116067
- var fingerprint = outputFingerprints.get(fileName);
116068
- // If output has not been changed, and the file has no external modification
116069
- if (fingerprint &&
116070
- fingerprint.byteOrderMark === writeByteOrderMark &&
116071
- fingerprint.hash === hash &&
116072
- fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
116073
- return;
116074
- }
116075
- }
116076
- system.writeFile(fileName, data, writeByteOrderMark);
116077
- var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
116078
- outputFingerprints.set(fileName, {
116079
- hash: hash,
116080
- byteOrderMark: writeByteOrderMark,
116081
- mtime: mtimeAfter
116082
- });
116083
- }
116084
116213
  function getDefaultLibLocation() {
116085
116214
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
116086
116215
  }
@@ -117670,6 +117799,7 @@ var ts;
117670
117799
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
117671
117800
  redirectTargetsMap: redirectTargetsMap,
117672
117801
  getFileIncludeReasons: program.getFileIncludeReasons,
117802
+ createHash: ts.maybeBind(host, host.createHash),
117673
117803
  };
117674
117804
  }
117675
117805
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119783,13 +119913,9 @@ var ts;
119783
119913
  function createManyToManyPathMap() {
119784
119914
  function create(forward, reverse, deleted) {
119785
119915
  var map = {
119786
- clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119787
- forEach: function (fn) { return forward.forEach(fn); },
119788
119916
  getKeys: function (v) { return reverse.get(v); },
119789
119917
  getValues: function (k) { return forward.get(k); },
119790
- hasKey: function (k) { return forward.has(k); },
119791
119918
  keys: function () { return forward.keys(); },
119792
- deletedKeys: function () { return deleted; },
119793
119919
  deleteKey: function (k) {
119794
119920
  (deleted || (deleted = new ts.Set())).add(k);
119795
119921
  var set = forward.get(k);
@@ -119816,11 +119942,6 @@ var ts;
119816
119942
  });
119817
119943
  return map;
119818
119944
  },
119819
- clear: function () {
119820
- forward.clear();
119821
- reverse.clear();
119822
- deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119823
- }
119824
119945
  };
119825
119946
  return map;
119826
119947
  }
@@ -119948,18 +120069,21 @@ var ts;
119948
120069
  * Creates the state of file references and signature for the new program from oldState if it is safe
119949
120070
  */
119950
120071
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120072
+ var _a, _b, _c;
119951
120073
  var fileInfos = new ts.Map();
119952
120074
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
119953
120075
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119954
- var hasCalledUpdateShapeSignature = new ts.Set();
119955
120076
  var useOldState = canReuseOldState(referencedMap, oldState);
119956
120077
  // Ensure source files have parent pointers set
119957
120078
  newProgram.getTypeChecker();
119958
120079
  // Create the reference map, and set the file infos
119959
- for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119960
- var sourceFile = _a[_i];
120080
+ for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
120081
+ var sourceFile = _d[_i];
119961
120082
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
119962
- var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
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;
119963
120087
  if (referencedMap) {
119964
120088
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
119965
120089
  if (newReferences) {
@@ -119967,19 +120091,26 @@ var ts;
119967
120091
  }
119968
120092
  // Copy old visible to outside files map
119969
120093
  if (useOldState) {
119970
- var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
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;
119971
120098
  if (exportedModules) {
119972
120099
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119973
120100
  }
119974
120101
  }
119975
120102
  }
119976
- fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
120103
+ fileInfos.set(sourceFile.resolvedPath, {
120104
+ version: version_2,
120105
+ signature: signature,
120106
+ affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
120107
+ impliedFormat: sourceFile.impliedNodeFormat
120108
+ });
119977
120109
  }
119978
120110
  return {
119979
120111
  fileInfos: fileInfos,
119980
120112
  referencedMap: referencedMap,
119981
120113
  exportedModulesMap: exportedModulesMap,
119982
- hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
119983
120114
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
119984
120115
  };
119985
120116
  }
@@ -119993,71 +120124,42 @@ var ts;
119993
120124
  }
119994
120125
  BuilderState.releaseCache = releaseCache;
119995
120126
  /**
119996
- * Creates a clone of the state
120127
+ * Gets the files affected by the path from the program
119997
120128
  */
119998
- function clone(state) {
120129
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
119999
120130
  var _a, _b;
120000
- // Dont need to backup allFiles info since its cache anyway
120001
- return {
120002
- fileInfos: new ts.Map(state.fileInfos),
120003
- referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
120004
- exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
120005
- hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
120006
- useFileVersionAsSignature: state.useFileVersionAsSignature,
120007
- };
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;
120008
120135
  }
120009
- BuilderState.clone = clone;
120010
- /**
120011
- * Gets the files affected by the path from the program
120012
- */
120013
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
120014
- // Since the operation could be cancelled, the signatures are always stored in the cache
120015
- // They will be committed once it is safe to use them
120016
- // eg when calling this api from tsserver, if there is no cancellation of the operation
120017
- // In the other cases the affected files signatures are committed only after the iteration through the result is complete
120018
- var signatureCache = cacheToUpdateSignature || new ts.Map();
120136
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
120137
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
120019
120138
  var sourceFile = programOfThisState.getSourceFileByPath(path);
120020
120139
  if (!sourceFile) {
120021
120140
  return ts.emptyArray;
120022
120141
  }
120023
- if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
120142
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
120024
120143
  return [sourceFile];
120025
120144
  }
120026
- var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
120027
- if (!cacheToUpdateSignature) {
120028
- // Commit all the signatures in the signature cache
120029
- updateSignaturesFromCache(state, signatureCache);
120030
- }
120031
- return result;
120145
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
120032
120146
  }
120033
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
120034
- /**
120035
- * Updates the signatures from the cache into state's fileinfo signatures
120036
- * This should be called whenever it is safe to commit the state of the builder
120037
- */
120038
- function updateSignaturesFromCache(state, signatureCache) {
120039
- signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
120040
- }
120041
- BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
120147
+ BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
120042
120148
  function updateSignatureOfFile(state, signature, path) {
120043
120149
  state.fileInfos.get(path).signature = signature;
120044
- state.hasCalledUpdateShapeSignature.add(path);
120150
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
120045
120151
  }
120046
120152
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
120047
120153
  /**
120048
120154
  * Returns if the shape of the signature has changed since last emit
120049
120155
  */
120050
- function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
120156
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
120157
+ var _a;
120051
120158
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
120052
- ts.Debug.assert(!!sourceFile);
120053
- ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
120054
120159
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
120055
- if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
120160
+ if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
120056
120161
  return false;
120057
- }
120058
120162
  var info = state.fileInfos.get(sourceFile.resolvedPath);
120059
- if (!info)
120060
- return ts.Debug.fail();
120061
120163
  var prevSignature = info.signature;
120062
120164
  var latestSignature;
120063
120165
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -120068,45 +120170,55 @@ var ts;
120068
120170
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
120069
120171
  if (firstDts_1) {
120070
120172
  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; })); });
120071
- latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
120072
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
120073
- updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
120173
+ latestSignature = computeSignature(firstDts_1.text, computeHash);
120174
+ if (latestSignature !== prevSignature) {
120175
+ updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
120074
120176
  }
120075
120177
  }
120076
120178
  }
120077
120179
  // Default is to use file version as signature
120078
120180
  if (latestSignature === undefined) {
120079
120181
  latestSignature = sourceFile.version;
120080
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
120182
+ if (state.exportedModulesMap && latestSignature !== prevSignature) {
120183
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
120081
120184
  // All the references in this file are exported
120082
120185
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
120083
120186
  if (references) {
120084
- exportedModulesMapCache.set(sourceFile.resolvedPath, references);
120187
+ state.exportedModulesMap.set(sourceFile.resolvedPath, references);
120085
120188
  }
120086
120189
  else {
120087
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120190
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120088
120191
  }
120089
120192
  }
120090
120193
  }
120091
- cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
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;
120092
120197
  return latestSignature !== prevSignature;
120093
120198
  }
120094
120199
  BuilderState.updateShapeSignature = updateShapeSignature;
120200
+ function computeSignature(text, computeHash) {
120201
+ return (computeHash || ts.generateDjb2Hash)(text);
120202
+ }
120203
+ BuilderState.computeSignature = computeSignature;
120095
120204
  /**
120096
120205
  * Coverts the declaration emit result into exported modules map
120097
120206
  */
120098
- function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
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);
120099
120211
  if (!exportedModulesFromDeclarationEmit) {
120100
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120212
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120101
120213
  return;
120102
120214
  }
120103
120215
  var exportedModules;
120104
120216
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
120105
120217
  if (exportedModules) {
120106
- exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
120218
+ state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
120107
120219
  }
120108
120220
  else {
120109
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120221
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
120110
120222
  }
120111
120223
  function addExportedModule(exportedModulePaths) {
120112
120224
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -120118,19 +120230,6 @@ var ts;
120118
120230
  }
120119
120231
  }
120120
120232
  BuilderState.updateExportedModules = updateExportedModules;
120121
- /**
120122
- * Updates the exported modules from cache into state's exported modules map
120123
- * This should be called whenever it is safe to commit the state of the builder
120124
- */
120125
- function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
120126
- var _a;
120127
- if (exportedModulesMapCache) {
120128
- ts.Debug.assert(!!state.exportedModulesMap);
120129
- (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
120130
- exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
120131
- }
120132
- }
120133
- BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
120134
120233
  /**
120135
120234
  * Get all the dependencies of the sourceFile
120136
120235
  */
@@ -120251,7 +120350,7 @@ var ts;
120251
120350
  /**
120252
120351
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
120253
120352
  */
120254
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
120353
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
120255
120354
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
120256
120355
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
120257
120356
  }
@@ -120271,7 +120370,7 @@ var ts;
120271
120370
  if (!seenFileNamesMap.has(currentPath)) {
120272
120371
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
120273
120372
  seenFileNamesMap.set(currentPath, currentSourceFile);
120274
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
120373
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
120275
120374
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
120276
120375
  }
120277
120376
  }
@@ -120297,32 +120396,33 @@ var ts;
120297
120396
  * Create the state so that we can iterate on changedFiles/affected files
120298
120397
  */
120299
120398
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120399
+ var _a, _b;
120300
120400
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
120301
120401
  state.program = newProgram;
120302
120402
  var compilerOptions = newProgram.getCompilerOptions();
120303
120403
  state.compilerOptions = compilerOptions;
120404
+ var outFilePath = ts.outFile(compilerOptions);
120304
120405
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
120305
- if (!ts.outFile(compilerOptions)) {
120406
+ if (!outFilePath) {
120306
120407
  state.semanticDiagnosticsPerFile = new ts.Map();
120307
120408
  }
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
+ }
120308
120412
  state.changedFilesSet = new ts.Set();
120413
+ state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
120309
120414
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
120310
120415
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
120311
120416
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
120312
120417
  !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);
120313
120422
  if (useOldState) {
120314
- // Verify the sanity of old state
120315
- if (!oldState.currentChangedFilePath) {
120316
- var affectedSignatures = oldState.currentAffectedFilesSignatures;
120317
- ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
120318
- }
120319
- var changedFilesSet = oldState.changedFilesSet;
120320
- if (canCopySemanticDiagnostics) {
120321
- ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
120322
- }
120323
120423
  // Copy old state's changed files set
120324
- changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
120325
- if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
120424
+ (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
120425
+ if (!outFilePath && oldState.affectedFilesPendingEmit) {
120326
120426
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
120327
120427
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
120328
120428
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -120343,6 +120443,8 @@ var ts;
120343
120443
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
120344
120444
  // versions dont match
120345
120445
  oldInfo.version !== info.version ||
120446
+ // Implied formats dont match
120447
+ oldInfo.impliedFormat !== info.impliedFormat ||
120346
120448
  // Referenced files changed
120347
120449
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
120348
120450
  // Referenced file was deleted in the new program
@@ -120366,27 +120468,25 @@ var ts;
120366
120468
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
120367
120469
  }
120368
120470
  }
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
+ }
120369
120476
  });
120370
120477
  // If the global file is removed, add all files as changed
120371
120478
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
120372
120479
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
120373
120480
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
120374
120481
  }
120375
- else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120482
+ else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120376
120483
  // Add all files to affectedFilesPendingEmit since emit changed
120377
120484
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
120378
120485
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
120379
120486
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
120380
120487
  }
120381
- if (useOldState) {
120382
- // Any time the interpretation of a source file changes, mark it as changed
120383
- ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
120384
- if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
120385
- state.changedFilesSet.add(sourceFilePath);
120386
- }
120387
- });
120388
- }
120389
- state.buildInfoEmitPending = !!state.changedFilesSet.size;
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);
120390
120490
  return state;
120391
120491
  }
120392
120492
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -120422,30 +120522,35 @@ var ts;
120422
120522
  ts.BuilderState.releaseCache(state);
120423
120523
  state.program = undefined;
120424
120524
  }
120425
- /**
120426
- * Creates a clone of the state
120427
- */
120428
- function cloneBuilderProgramState(state) {
120429
- var _a;
120430
- var newState = ts.BuilderState.clone(state);
120431
- newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
120432
- newState.changedFilesSet = new ts.Set(state.changedFilesSet);
120433
- newState.affectedFiles = state.affectedFiles;
120434
- newState.affectedFilesIndex = state.affectedFilesIndex;
120435
- newState.currentChangedFilePath = state.currentChangedFilePath;
120436
- newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
120437
- newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
120438
- newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
120439
- newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
120440
- newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
120441
- newState.program = state.program;
120442
- newState.compilerOptions = state.compilerOptions;
120443
- newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
120444
- newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
120445
- newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
120446
- newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
120447
- newState.programEmitComplete = state.programEmitComplete;
120448
- return newState;
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;
120449
120554
  }
120450
120555
  /**
120451
120556
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -120460,7 +120565,7 @@ var ts;
120460
120565
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
120461
120566
  */
120462
120567
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
120463
- var _a;
120568
+ var _a, _b;
120464
120569
  while (true) {
120465
120570
  var affectedFiles = state.affectedFiles;
120466
120571
  if (affectedFiles) {
@@ -120480,10 +120585,8 @@ var ts;
120480
120585
  state.changedFilesSet.delete(state.currentChangedFilePath);
120481
120586
  state.currentChangedFilePath = undefined;
120482
120587
  // Commit the changes in file signature
120483
- ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
120484
- state.currentAffectedFilesSignatures.clear();
120485
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120486
- (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
120588
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
120589
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120487
120590
  state.affectedFiles = undefined;
120488
120591
  }
120489
120592
  // Get next changed file
@@ -120501,12 +120604,7 @@ var ts;
120501
120604
  return program;
120502
120605
  }
120503
120606
  // Get next batch of affected files
120504
- if (!state.currentAffectedFilesSignatures)
120505
- state.currentAffectedFilesSignatures = new ts.Map();
120506
- if (state.exportedModulesMap) {
120507
- state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
120508
- }
120509
- state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
120607
+ state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
120510
120608
  state.currentChangedFilePath = nextKey.value;
120511
120609
  state.affectedFilesIndex = 0;
120512
120610
  if (!state.seenAffectedFiles)
@@ -120558,7 +120656,6 @@ var ts;
120558
120656
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
120559
120657
  */
120560
120658
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120561
- var _a;
120562
120659
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
120563
120660
  // If affected files is everything except default library, then nothing more to do
120564
120661
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -120566,10 +120663,9 @@ var ts;
120566
120663
  // When a change affects the global scope, all files are considered to be affected without updating their signature
120567
120664
  // That means when affected file is handled, its signature can be out of date
120568
120665
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
120569
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
120666
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
120570
120667
  return;
120571
120668
  }
120572
- 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);
120573
120669
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
120574
120670
  return;
120575
120671
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -120589,7 +120685,7 @@ var ts;
120589
120685
  // This ensures that we dont later during incremental builds considering wrong signature.
120590
120686
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
120591
120687
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
120592
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
120688
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
120593
120689
  // If not dts emit, nothing more to do
120594
120690
  if (ts.getEmitDeclarations(state.compilerOptions)) {
120595
120691
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -120610,27 +120706,10 @@ var ts;
120610
120706
  return !state.semanticDiagnosticsFromOldState.size;
120611
120707
  }
120612
120708
  function isChangedSignature(state, path) {
120613
- var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
120614
- var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120709
+ var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
120710
+ var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120615
120711
  return newSignature !== oldSignature;
120616
120712
  }
120617
- function forEachKeyOfExportedModulesMap(state, filePath, fn) {
120618
- // Go through exported modules from cache first
120619
- var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
120620
- var result = keys && ts.forEachKey(keys, fn);
120621
- if (result)
120622
- return result;
120623
- // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
120624
- keys = state.exportedModulesMap.getKeys(filePath);
120625
- return keys && ts.forEachKey(keys, function (exportedFromPath) {
120626
- var _a;
120627
- // If the cache had an updated value, skip
120628
- return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
120629
- !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
120630
- fn(exportedFromPath) :
120631
- undefined;
120632
- });
120633
- }
120634
120713
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
120635
120714
  var _a;
120636
120715
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -120645,6 +120724,7 @@ var ts;
120645
120724
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
120646
120725
  */
120647
120726
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120727
+ var _a;
120648
120728
  // If there was change in signature (dts output) for the changed file,
120649
120729
  // then only we need to handle pending file emit
120650
120730
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -120671,11 +120751,10 @@ var ts;
120671
120751
  }
120672
120752
  }
120673
120753
  }
120674
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120675
120754
  var seenFileAndExportsOfFile = new ts.Set();
120676
120755
  // Go through exported modules from cache first
120677
120756
  // If exported modules has path, all files referencing file exported from are affected
120678
- forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120757
+ (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120679
120758
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
120680
120759
  return true;
120681
120760
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -120689,19 +120768,18 @@ var ts;
120689
120768
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
120690
120769
  */
120691
120770
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
120692
- var _a;
120771
+ var _a, _b;
120693
120772
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
120694
120773
  return undefined;
120695
120774
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
120696
120775
  return true;
120697
120776
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
120698
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120699
120777
  // If exported modules has path, all files referencing file exported from are affected
120700
- forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120778
+ (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120701
120779
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
120702
120780
  });
120703
120781
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
120704
- (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120782
+ (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
120705
120783
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
120706
120784
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120707
120785
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120722,12 +120800,13 @@ var ts;
120722
120800
  }
120723
120801
  else {
120724
120802
  state.seenAffectedFiles.add(affected.resolvedPath);
120803
+ // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120804
+ state.buildInfoEmitPending = true;
120725
120805
  if (emitKind !== undefined) {
120726
120806
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120727
120807
  }
120728
120808
  if (isPendingEmit) {
120729
120809
  state.affectedFilesPendingEmitIndex++;
120730
- state.buildInfoEmitPending = true;
120731
120810
  }
120732
120811
  else {
120733
120812
  state.affectedFilesIndex++;
@@ -120775,25 +120854,61 @@ var ts;
120775
120854
  }
120776
120855
  return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
120777
120856
  }
120857
+ function isProgramBundleEmitBuildInfo(info) {
120858
+ return !!ts.outFile(info.options || {});
120859
+ }
120860
+ ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
120778
120861
  /**
120779
120862
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120780
120863
  */
120781
- function getProgramBuildInfo(state, getCanonicalFileName) {
120782
- if (ts.outFile(state.compilerOptions))
120783
- return undefined;
120864
+ function getProgramBuildInfo(state, getCanonicalFileName, host) {
120865
+ var outFilePath = ts.outFile(state.compilerOptions);
120866
+ if (outFilePath && !state.compilerOptions.composite)
120867
+ return;
120784
120868
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120785
120869
  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
+ }
120786
120890
  var fileNames = [];
120787
120891
  var fileNameToFileId = new ts.Map();
120788
120892
  var fileIdsList;
120789
120893
  var fileNamesToFileIdListId;
120894
+ var emitSignatures;
120790
120895
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120896
+ var _b, _c;
120791
120897
  var key = _a[0], value = _a[1];
120792
120898
  // Ensure fileId
120793
120899
  var fileId = toFileId(key);
120794
120900
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120795
- var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120796
- var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
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
+ }
120797
120912
  return value.version === actualSignature ?
120798
120913
  value.affectsGlobalScope || value.impliedFormat ?
120799
120914
  // If file version is same as signature, dont serialize signature
@@ -120801,11 +120916,11 @@ var ts;
120801
120916
  // If file info only contains version and signature and both are same we can just write string
120802
120917
  value.version :
120803
120918
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120804
- signature === undefined ?
120919
+ oldSignature === undefined ?
120805
120920
  // If we havent computed signature, use fileInfo as is
120806
120921
  value :
120807
120922
  // Serialize fileInfo with new updated signature
120808
- { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120923
+ { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120809
120924
  // Signature of the FileInfo is undefined, serialize it as false
120810
120925
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120811
120926
  });
@@ -120820,17 +120935,13 @@ var ts;
120820
120935
  if (state.exportedModulesMap) {
120821
120936
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120822
120937
  var _a;
120823
- if (state.currentAffectedFilesExportedModulesMap) {
120824
- if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120825
- return undefined;
120826
- }
120827
- var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120828
- if (newValue) {
120829
- return [toFileId(key), toFileIdListId(newValue)];
120830
- }
120831
- }
120938
+ var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120832
120939
  // Not in temporary cache, use existing value
120833
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
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;
120834
120945
  });
120835
120946
  }
120836
120947
  var semanticDiagnosticsPerFile;
@@ -120841,9 +120952,7 @@ var ts;
120841
120952
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120842
120953
  [
120843
120954
  toFileId(key),
120844
- state.hasReusableDiagnostic ?
120845
- value :
120846
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120955
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120847
120956
  ] :
120848
120957
  toFileId(key));
120849
120958
  }
@@ -120858,16 +120967,27 @@ var ts;
120858
120967
  }
120859
120968
  }
120860
120969
  }
120861
- return {
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 = {
120862
120978
  fileNames: fileNames,
120863
120979
  fileInfos: fileInfos,
120864
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120980
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120865
120981
  fileIdsList: fileIdsList,
120866
120982
  referencedMap: referencedMap,
120867
120983
  exportedModulesMap: exportedModulesMap,
120868
120984
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120869
120985
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120986
+ changeFileSet: changeFileSet,
120987
+ emitSignatures: emitSignatures,
120988
+ dtsChangeTime: state.dtsChangeTime,
120870
120989
  };
120990
+ return result;
120871
120991
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120872
120992
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120873
120993
  }
@@ -120892,24 +121012,18 @@ var ts;
120892
121012
  }
120893
121013
  return fileIdListId;
120894
121014
  }
120895
- }
120896
- function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120897
- var result;
120898
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120899
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120900
- var name = _a[_i];
120901
- var optionKey = name.toLowerCase();
120902
- var optionInfo = optionsNameMap.get(optionKey);
120903
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120904
- // We need to store `strict`, even though it won't be examined directly, so that the
120905
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120906
- optionKey === "strict" ||
120907
- // We need to store these to determine whether `lib` files need to be rechecked.
120908
- optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120909
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
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
+ }
120910
121024
  }
121025
+ return result;
120911
121026
  }
120912
- return result;
120913
121027
  }
120914
121028
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
120915
121029
  if (option) {
@@ -120983,6 +121097,10 @@ var ts;
120983
121097
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
120984
121098
  }
120985
121099
  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;
120986
121104
  function createBuilderProgram(kind, _a) {
120987
121105
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
120988
121106
  // Return same program if underlying program doesnt change
@@ -121001,8 +121119,8 @@ var ts;
121001
121119
  */
121002
121120
  var computeHash = ts.maybeBind(host, host.createHash);
121003
121121
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
121004
- var backupState;
121005
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
121122
+ var backupEmitState;
121123
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
121006
121124
  // To ensure that we arent storing any references to old program or new program without state
121007
121125
  newProgram = undefined; // TODO: GH#18217
121008
121126
  oldProgram = undefined;
@@ -121010,20 +121128,20 @@ var ts;
121010
121128
  var getState = function () { return state; };
121011
121129
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
121012
121130
  builderProgram.getState = getState;
121013
- builderProgram.backupState = function () {
121014
- ts.Debug.assert(backupState === undefined);
121015
- backupState = cloneBuilderProgramState(state);
121131
+ builderProgram.backupEmitState = function () {
121132
+ ts.Debug.assert(backupEmitState === undefined);
121133
+ backupEmitState = backupEmitBuilderProgramState(state);
121016
121134
  };
121017
- builderProgram.restoreState = function () {
121018
- state = ts.Debug.checkDefined(backupState);
121019
- backupState = undefined;
121135
+ builderProgram.restoreEmitState = function () {
121136
+ restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
121137
+ backupEmitState = undefined;
121020
121138
  };
121021
121139
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
121022
121140
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
121023
121141
  builderProgram.emit = emit;
121024
121142
  builderProgram.releaseProgram = function () {
121025
121143
  releaseCache(state);
121026
- backupState = undefined;
121144
+ backupEmitState = undefined;
121027
121145
  };
121028
121146
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
121029
121147
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -121082,35 +121200,59 @@ var ts;
121082
121200
  return toAffectedFileEmitResult(state,
121083
121201
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
121084
121202
  // Otherwise just affected file
121085
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
121086
- getWriteFileUpdatingSignatureCallback(writeFile) :
121203
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
121204
+ getWriteFileCallback(writeFile, customTransformers) :
121087
121205
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
121088
121206
  }
121089
- function getWriteFileUpdatingSignatureCallback(writeFile) {
121207
+ function getWriteFileCallback(writeFile, customTransformers) {
121090
121208
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
121091
- var _a;
121209
+ var _a, _b, _c;
121092
121210
  if (ts.isDeclarationFileName(fileName)) {
121093
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
121094
- var file = sourceFiles[0];
121095
- var info = state.fileInfos.get(file.resolvedPath);
121096
- var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
121097
- if (signature === file.version) {
121098
- var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
121099
- if (newSignature !== file.version) { // Update it
121100
- if (host.storeFilesChangingSignatureDuringEmit)
121101
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
121102
- if (state.exportedModulesMap)
121103
- ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
121104
- if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
121105
- state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
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
+ }
121106
121237
  }
121107
- else {
121108
- info.signature = newSignature;
121109
- if (state.exportedModulesMap)
121110
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
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;
121111
121246
  }
121112
121247
  }
121113
121248
  }
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
+ }
121114
121256
  }
121115
121257
  if (writeFile)
121116
121258
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -121175,8 +121317,8 @@ var ts;
121175
121317
  }
121176
121318
  }
121177
121319
  }
121178
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
121179
- getWriteFileUpdatingSignatureCallback(writeFile) :
121320
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
121321
+ getWriteFileCallback(writeFile, customTransformers) :
121180
121322
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
121181
121323
  }
121182
121324
  /**
@@ -121265,29 +121407,58 @@ var ts;
121265
121407
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
121266
121408
  }
121267
121409
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
121268
- function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121269
- var _a;
121410
+ function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121411
+ var _a, _b, _c, _d;
121270
121412
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121271
121413
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121272
- var filePaths = program.fileNames.map(toPath);
121273
- var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121274
- var fileInfos = new ts.Map();
121275
- program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
121276
- var state = {
121277
- fileInfos: fileInfos,
121278
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121279
- referencedMap: toManyToManyPathMap(program.referencedMap),
121280
- exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121281
- 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]; }),
121282
- hasReusableDiagnostic: true,
121283
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121284
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121285
- affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121286
- };
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
+ }
121287
121458
  return {
121288
121459
  getState: function () { return state; },
121289
- backupState: ts.noop,
121290
- restoreState: ts.noop,
121460
+ backupEmitState: ts.noop,
121461
+ restoreEmitState: ts.noop,
121291
121462
  getProgram: ts.notImplemented,
121292
121463
  getProgramOrUndefined: ts.returnUndefined,
121293
121464
  releaseProgram: ts.noop,
@@ -121332,12 +121503,24 @@ var ts;
121332
121503
  return map;
121333
121504
  }
121334
121505
  }
121335
- ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
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;
121336
121519
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
121337
121520
  return {
121338
121521
  getState: ts.notImplemented,
121339
- backupState: ts.noop,
121340
- restoreState: ts.noop,
121522
+ backupEmitState: ts.noop,
121523
+ restoreEmitState: ts.noop,
121341
121524
  getProgram: getProgram,
121342
121525
  getProgramOrUndefined: function () { return getState().program; },
121343
121526
  releaseProgram: function () { return getState().program = undefined; },
@@ -122453,9 +122636,9 @@ var ts;
122453
122636
  if (!preferSymlinks) {
122454
122637
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
122455
122638
  // so we only need to remove them from the realpath filenames.
122456
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122457
- if (result_15)
122458
- return result_15;
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;
122459
122642
  }
122460
122643
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
122461
122644
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -122475,10 +122658,10 @@ var ts;
122475
122658
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
122476
122659
  var symlinkDirectory = symlinkDirectories_1[_i];
122477
122660
  var option = ts.resolvePath(symlinkDirectory, relative);
122478
- var result_16 = cb(option, target === referenceRedirect);
122661
+ var result_17 = cb(option, target === referenceRedirect);
122479
122662
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
122480
- if (result_16)
122481
- return result_16;
122663
+ if (result_17)
122664
+ return result_17;
122482
122665
  }
122483
122666
  });
122484
122667
  });
@@ -122520,7 +122703,7 @@ var ts;
122520
122703
  });
122521
122704
  // Sort by paths closest to importing file Name directory
122522
122705
  var sortedPaths = [];
122523
- var _loop_33 = function (directory) {
122706
+ var _loop_34 = function (directory) {
122524
122707
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
122525
122708
  var pathsInDirectory;
122526
122709
  allFileNames.forEach(function (_a, fileName) {
@@ -122544,9 +122727,9 @@ var ts;
122544
122727
  };
122545
122728
  var out_directory_1;
122546
122729
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
122547
- var state_10 = _loop_33(directory);
122730
+ var state_11 = _loop_34(directory);
122548
122731
  directory = out_directory_1;
122549
- if (state_10 === "break")
122732
+ if (state_11 === "break")
122550
122733
  break;
122551
122734
  }
122552
122735
  if (allFileNames.size) {
@@ -122939,6 +123122,7 @@ var ts;
122939
123122
  if (system.clearScreen &&
122940
123123
  !options.preserveWatchOutput &&
122941
123124
  !options.extendedDiagnostics &&
123125
+ !options.solutionDiagnostics &&
122942
123126
  !options.diagnostics &&
122943
123127
  ts.contains(ts.screenStartingMessageCodes, diagnostic.code)) {
122944
123128
  system.clearScreen();
@@ -123388,6 +123572,7 @@ var ts;
123388
123572
  readDirectory: ts.maybeBind(host, host.readDirectory),
123389
123573
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
123390
123574
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
123575
+ now: ts.maybeBind(host, host.now),
123391
123576
  };
123392
123577
  function writeFile(fileName, text, writeByteOrderMark, onError) {
123393
123578
  try {
@@ -123448,6 +123633,7 @@ var ts;
123448
123633
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
123449
123634
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
123450
123635
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
123636
+ now: ts.maybeBind(system, system.now),
123451
123637
  };
123452
123638
  }
123453
123639
  ts.createProgramHost = createProgramHost;
@@ -123515,20 +123701,26 @@ var ts;
123515
123701
  var ts;
123516
123702
  (function (ts) {
123517
123703
  function readBuilderProgram(compilerOptions, host) {
123518
- if (ts.outFile(compilerOptions))
123519
- return undefined;
123520
123704
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
123521
123705
  if (!buildInfoPath)
123522
123706
  return undefined;
123523
- var content = host.readFile(buildInfoPath);
123524
- if (!content)
123525
- return undefined;
123526
- var buildInfo = ts.getBuildInfo(content);
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
+ }
123527
123719
  if (buildInfo.version !== ts.version)
123528
123720
  return undefined;
123529
123721
  if (!buildInfo.program)
123530
123722
  return undefined;
123531
- return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123723
+ return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123532
123724
  }
123533
123725
  ts.readBuilderProgram = readBuilderProgram;
123534
123726
  function createIncrementalCompilerHost(options, system) {
@@ -123537,6 +123729,7 @@ var ts;
123537
123729
  host.createHash = ts.maybeBind(system, system.createHash);
123538
123730
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
123539
123731
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
123732
+ host.now = ts.maybeBind(system, system.now);
123540
123733
  ts.setGetSourceFileAsHashVersioned(host, system);
123541
123734
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
123542
123735
  return host;
@@ -124272,14 +124465,17 @@ var ts;
124272
124465
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
124273
124466
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
124274
124467
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
124275
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
124276
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
124277
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
124278
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
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";
124279
124474
  /**
124280
124475
  * Projects with no outputs (i.e. "solution" files)
124281
124476
  */
124282
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
124477
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
124478
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
124283
124479
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
124284
124480
  function resolveConfigFileProjectName(project) {
124285
124481
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -124324,9 +124520,11 @@ var ts;
124324
124520
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
124325
124521
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
124326
124522
  }
124327
- function newer(date1, date2) {
124328
- return date2 > date1 ? date2 : date1;
124523
+ /*@internal*/
124524
+ function getCurrentTime(host) {
124525
+ return host.now ? host.now() : new Date();
124329
124526
  }
124527
+ ts.getCurrentTime = getCurrentTime;
124330
124528
  /*@internal*/
124331
124529
  function isCircularBuildOrder(buildOrder) {
124332
124530
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -124379,6 +124577,8 @@ var ts;
124379
124577
  if (ts.hasProperty(buildOptions, option.name))
124380
124578
  result[option.name] = buildOptions[option.name];
124381
124579
  });
124580
+ if (buildOptions.solutionDiagnostics)
124581
+ result.solutionDiagnostics = true;
124382
124582
  return result;
124383
124583
  }
124384
124584
  function createSolutionBuilder(host, rootNames, defaultOptions) {
@@ -124416,6 +124616,7 @@ var ts;
124416
124616
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
124417
124617
  };
124418
124618
  }
124619
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
124419
124620
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
124420
124621
  var state = {
124421
124622
  host: host,
@@ -124432,8 +124633,9 @@ var ts;
124432
124633
  resolvedConfigFilePaths: new ts.Map(),
124433
124634
  configFileCache: new ts.Map(),
124434
124635
  projectStatus: new ts.Map(),
124435
- buildInfoChecked: new ts.Map(),
124436
124636
  extendedConfigCache: new ts.Map(),
124637
+ buildInfoCache: new ts.Map(),
124638
+ outputTimeStamps: new ts.Map(),
124437
124639
  builderPrograms: new ts.Map(),
124438
124640
  diagnostics: new ts.Map(),
124439
124641
  projectPendingBuild: new ts.Map(),
@@ -124456,6 +124658,7 @@ var ts;
124456
124658
  allWatchedConfigFiles: new ts.Map(),
124457
124659
  allWatchedExtendedConfigFiles: new ts.Map(),
124458
124660
  allWatchedPackageJsonFiles: new ts.Map(),
124661
+ filesWatched: new ts.Map(),
124459
124662
  lastCachedPackageJsonLookups: new ts.Map(),
124460
124663
  timerToBuildInvalidatedProject: undefined,
124461
124664
  reportFileChangeDetected: false,
@@ -124566,11 +124769,12 @@ var ts;
124566
124769
  // Config file cache
124567
124770
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
124568
124771
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
124569
- ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
124570
124772
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
124571
124773
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
124572
124774
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
124573
124775
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
124776
+ ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
124777
+ ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
124574
124778
  // Remove watches for the program no longer in the solution
124575
124779
  if (state.watch) {
124576
124780
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -124867,21 +125071,21 @@ var ts;
124867
125071
  }
124868
125072
  function emit(writeFileCallback, cancellationToken, customTransformers) {
124869
125073
  var _a;
124870
- var _b, _c;
125074
+ var _b, _c, _d;
124871
125075
  ts.Debug.assertIsDefined(program);
124872
125076
  ts.Debug.assert(step === BuildStep.Emit);
124873
125077
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
124874
- program.backupState();
125078
+ program.backupEmitState();
124875
125079
  var declDiagnostics;
124876
125080
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
124877
125081
  var outputFiles = [];
124878
125082
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
124879
125083
  /*write*/ undefined,
124880
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
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,
124881
125085
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
124882
125086
  // Don't emit .d.ts if there are decl file errors
124883
125087
  if (declDiagnostics) {
124884
- program.restoreState();
125088
+ program.restoreEmitState();
124885
125089
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
124886
125090
  return {
124887
125091
  emitSkipped: true,
@@ -124891,40 +125095,46 @@ var ts;
124891
125095
  // Actual Emit
124892
125096
  var host = state.host, compilerHost = state.compilerHost;
124893
125097
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124894
- var newestDeclarationFileContentChangedTime = minimumDate;
124895
- var anyDtsChanged = false;
125098
+ var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124896
125099
  var emitterDiagnostics = ts.createDiagnosticCollection();
124897
125100
  var emittedOutputs = new ts.Map();
125101
+ var options = program.getCompilerOptions();
125102
+ var isIncremental = ts.isIncrementalCompilation(options);
125103
+ var outputTimeStampMap;
125104
+ var now;
124898
125105
  ts.solutionPerformance.mark("beforeOutputFilesWrite");
124899
125106
  outputFiles.forEach(function (_a) {
124900
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124901
- var priorChangeTime;
124902
- if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124903
- // Check for unchanged .d.ts files
124904
- if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124905
- priorChangeTime = host.getModifiedTime(name);
124906
- }
124907
- else {
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)) {
124908
125114
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124909
- anyDtsChanged = true;
124910
125115
  }
124911
125116
  }
124912
- emittedOutputs.set(toPath(state, name), name);
124913
125117
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124914
- if (priorChangeTime !== undefined) {
124915
- newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
125118
+ if (!isIncremental && state.watch) {
125119
+ (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124916
125120
  }
124917
125121
  });
124918
125122
  ts.solutionPerformance.mark("afterOutputFilesWrite");
124919
125123
  ts.solutionPerformance.measure("OutputFilesWrite", "beforeOutputFilesWrite", "afterOutputFilesWrite");
124920
- finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124921
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
125124
+ finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124922
125125
  return emitResult;
124923
125126
  }
124924
125127
  function emitBuildInfo(writeFileCallback, cancellationToken) {
124925
125128
  ts.Debug.assertIsDefined(program);
124926
125129
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
124927
- var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
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);
124928
125138
  if (emitResult.diagnostics.length) {
124929
125139
  reportErrors(state, emitResult.diagnostics);
124930
125140
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -124937,7 +125147,7 @@ var ts;
124937
125147
  step = BuildStep.QueueReferencingProjects;
124938
125148
  return emitResult;
124939
125149
  }
124940
- function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
125150
+ function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124941
125151
  var _a;
124942
125152
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
124943
125153
  if (emitDiagnostics.length) {
@@ -124948,13 +125158,11 @@ var ts;
124948
125158
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
124949
125159
  }
124950
125160
  // Update time stamps for rest of the outputs
124951
- var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
125161
+ updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124952
125162
  state.diagnostics.delete(projectPath);
124953
125163
  state.projectStatus.set(projectPath, {
124954
125164
  type: ts.UpToDateStatusType.UpToDate,
124955
- newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124956
- maximumDate :
124957
- newestDeclarationFileContentChangedTime,
125165
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124958
125166
  oldestOutputFileName: oldestOutputFileName
124959
125167
  });
124960
125168
  afterProgramDone(state, program, config);
@@ -124989,13 +125197,21 @@ var ts;
124989
125197
  ts.Debug.assert(!!outputFiles.length);
124990
125198
  var emitterDiagnostics = ts.createDiagnosticCollection();
124991
125199
  var emittedOutputs = new ts.Map();
125200
+ var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
125201
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
124992
125202
  outputFiles.forEach(function (_a) {
124993
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
125203
+ var _b, _c;
125204
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124994
125205
  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
+ }
124995
125212
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124996
125213
  });
124997
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124998
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
125214
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
124999
125215
  return { emitSkipped: false, diagnostics: emitDiagnostics };
125000
125216
  }
125001
125217
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -125101,7 +125317,7 @@ var ts;
125101
125317
  }
125102
125318
  continue;
125103
125319
  }
125104
- if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
125320
+ if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts.UpToDateStatusType.UpToDateWithInputFileText) {
125105
125321
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
125106
125322
  return {
125107
125323
  kind: InvalidatedProjectKind.UpdateOutputFileStamps,
@@ -125187,7 +125403,7 @@ var ts;
125187
125403
  state.projectCompilerOptions = state.baseCompilerOptions;
125188
125404
  }
125189
125405
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
125190
- var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
125406
+ var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
125191
125407
  reportAndStoreErrors(state, resolvedPath, diagnostics);
125192
125408
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
125193
125409
  if (canEmitBuildInfo)
@@ -125195,9 +125411,101 @@ var ts;
125195
125411
  afterProgramDone(state, program, config);
125196
125412
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
125197
125413
  }
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
+ }
125198
125506
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
125199
125507
  // Check tsconfig time
125200
- var tsconfigTime = ts.getModifiedTime(state.host, configFile);
125508
+ var tsconfigTime = getModifiedTime(state, configFile);
125201
125509
  if (oldestOutputFileTime < tsconfigTime) {
125202
125510
  return {
125203
125511
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -125207,88 +125515,24 @@ var ts;
125207
125515
  }
125208
125516
  }
125209
125517
  function getUpToDateStatusWorker(state, project, resolvedPath) {
125210
- var force = !!state.options.force;
125211
- var newestInputFileName = undefined;
125212
- var newestInputFileTime = minimumDate;
125213
- var host = state.host;
125214
- // Get timestamps of input files
125215
- for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
125216
- var inputFile = _a[_i];
125217
- if (!host.fileExists(inputFile)) {
125218
- return {
125219
- type: ts.UpToDateStatusType.Unbuildable,
125220
- reason: inputFile + " does not exist"
125221
- };
125222
- }
125223
- if (!force) {
125224
- var inputTime = ts.getModifiedTime(host, inputFile);
125225
- if (inputTime > newestInputFileTime) {
125226
- newestInputFileName = inputFile;
125227
- newestInputFileTime = inputTime;
125228
- }
125229
- }
125230
- }
125518
+ var _a, _b, _c;
125231
125519
  // Container if no files are specified in the project
125232
125520
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
125233
125521
  return {
125234
125522
  type: ts.UpToDateStatusType.ContainerOnly
125235
125523
  };
125236
125524
  }
125237
- // Collect the expected outputs of this project
125238
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125239
- // Now see if all outputs are newer than the newest input
125240
- var oldestOutputFileName = "(none)";
125241
- var oldestOutputFileTime = maximumDate;
125242
- var newestOutputFileName = "(none)";
125243
- var newestOutputFileTime = minimumDate;
125244
- var missingOutputFileName;
125245
- var newestDeclarationFileContentChangedTime = minimumDate;
125246
- var isOutOfDateWithInputs = false;
125247
- if (!force) {
125248
- for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
125249
- var output = outputs_1[_b];
125250
- // Output is missing; can stop checking
125251
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125252
- if (!host.fileExists(output)) {
125253
- missingOutputFileName = output;
125254
- break;
125255
- }
125256
- var outputTime = ts.getModifiedTime(host, output);
125257
- if (outputTime < oldestOutputFileTime) {
125258
- oldestOutputFileTime = outputTime;
125259
- oldestOutputFileName = output;
125260
- }
125261
- // If an output is older than the newest input, we can stop checking
125262
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125263
- if (outputTime < newestInputFileTime) {
125264
- isOutOfDateWithInputs = true;
125265
- break;
125266
- }
125267
- if (outputTime > newestOutputFileTime) {
125268
- newestOutputFileTime = outputTime;
125269
- newestOutputFileName = output;
125270
- }
125271
- // Keep track of when the most recent time a .d.ts file was changed.
125272
- // In addition to file timestamps, we also keep track of when a .d.ts file
125273
- // had its file touched but not had its contents changed - this allows us
125274
- // to skip a downstream typecheck
125275
- if (ts.isDeclarationFileName(output)) {
125276
- var outputModifiedTime = ts.getModifiedTime(host, output);
125277
- newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
125278
- }
125279
- }
125280
- }
125281
- var pseudoUpToDate = false;
125282
- var usesPrepend = false;
125283
- var upstreamChangedProject;
125525
+ // Fast check to see if reference projects are buildable
125526
+ var referenceStatuses;
125527
+ var force = !!state.options.force;
125284
125528
  if (project.projectReferences) {
125285
125529
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
125286
- for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
125287
- var ref = _d[_c];
125288
- usesPrepend = usesPrepend || !!(ref.prepend);
125530
+ for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
125531
+ var ref = _d[_i];
125289
125532
  var resolvedRef = ts.resolveProjectReferencePath(ref);
125290
125533
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
125291
- var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
125534
+ var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
125535
+ var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
125292
125536
  // Its a circular reference ignore the status of this project
125293
125537
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
125294
125538
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -125310,78 +125554,188 @@ var ts;
125310
125554
  upstreamProjectName: ref.path
125311
125555
  };
125312
125556
  }
125313
- // Check oldest output file name only if there is no missing output file name
125314
- // (a check we will have skipped if this is a forced build)
125315
- if (!force && !missingOutputFileName) {
125316
- // If the upstream project's newest file is older than our oldest output, we
125317
- // can't be out of date because of it
125318
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125319
- continue;
125320
- }
125321
- // If the upstream project has only change .d.ts files, and we've built
125322
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125323
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125324
- pseudoUpToDate = true;
125325
- upstreamChangedProject = ref.path;
125326
- continue;
125327
- }
125328
- // We have an output older than an upstream output - we are out of date
125329
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
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))) {
125330
125598
  return {
125331
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125332
- outOfDateOutputFileName: oldestOutputFileName,
125333
- newerProjectName: ref.path
125599
+ type: ts.UpToDateStatusType.OutOfDateBuildInfo,
125600
+ buildInfoFile: buildInfoPath
125334
125601
  };
125335
125602
  }
125603
+ buildInfoProgram = buildInfo.program;
125336
125604
  }
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;
125337
125608
  }
125338
- if (missingOutputFileName !== undefined) {
125339
- return {
125340
- type: ts.UpToDateStatusType.OutputMissing,
125341
- missingOutputFileName: missingOutputFileName
125342
- };
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
+ }
125343
125649
  }
125344
- if (isOutOfDateWithInputs) {
125345
- return {
125346
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125347
- outOfDateOutputFileName: oldestOutputFileName,
125348
- newerInputFileName: newestInputFileName
125349
- };
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
+ }
125350
125684
  }
125351
- else {
125352
- // Check tsconfig time
125353
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125354
- if (configStatus)
125355
- return configStatus;
125356
- // Check extended config time
125357
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125358
- if (extendedConfigStatus)
125359
- return extendedConfigStatus;
125360
- // Check package file time
125361
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125362
- var path = _a[0];
125363
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125364
- });
125365
- if (dependentPackageFileStatus)
125366
- return dependentPackageFileStatus;
125367
- }
125368
- if (!force && !state.buildInfoChecked.has(resolvedPath)) {
125369
- state.buildInfoChecked.set(resolvedPath, true);
125370
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125371
- if (buildInfoPath) {
125372
- ts.solutionPerformance.mark("beforeBuildInfoRead");
125373
- var value = state.readFileWithCache(buildInfoPath);
125374
- ts.solutionPerformance.mark("afterBuildInfoRead");
125375
- ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125376
- var buildInfo = value && ts.getBuildInfo(value);
125377
- if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
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)) {
125378
125702
  return {
125379
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125380
- version: buildInfo.version
125703
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125704
+ outOfDateOutputFileName: buildInfoPath,
125705
+ newerProjectName: ref.path
125381
125706
  };
125382
125707
  }
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
+ };
125383
125722
  }
125384
125723
  }
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;
125385
125739
  if (usesPrepend && pseudoUpToDate) {
125386
125740
  return {
125387
125741
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -125391,15 +125745,37 @@ var ts;
125391
125745
  }
125392
125746
  // Up to date
125393
125747
  return {
125394
- type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
125748
+ type: pseudoUpToDate ?
125749
+ ts.UpToDateStatusType.UpToDateWithUpstreamTypes :
125750
+ pseudoInputUptodate ?
125751
+ ts.UpToDateStatusType.UpToDateWithInputFileText :
125752
+ ts.UpToDateStatusType.UpToDate,
125395
125753
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
125396
125754
  newestInputFileTime: newestInputFileTime,
125397
- newestOutputFileTime: newestOutputFileTime,
125398
125755
  newestInputFileName: newestInputFileName,
125399
- newestOutputFileName: newestOutputFileName,
125400
125756
  oldestOutputFileName: oldestOutputFileName
125401
125757
  };
125402
125758
  }
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
+ }
125403
125779
  function getUpToDateStatus(state, project, resolvedPath) {
125404
125780
  if (project === undefined) {
125405
125781
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -125415,42 +125791,69 @@ var ts;
125415
125791
  state.projectStatus.set(resolvedPath, actual);
125416
125792
  return actual;
125417
125793
  }
125418
- function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
125794
+ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
125419
125795
  if (proj.options.noEmit)
125420
- return priorNewestUpdateTime;
125796
+ return;
125797
+ var now;
125421
125798
  ts.solutionPerformance.mark("beforeUpdateOutputTimestamps");
125422
- var host = state.host;
125423
- var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125424
- if (!skipOutputs || outputs.length !== skipOutputs.size) {
125425
- var reportVerbose = !!state.options.verbose;
125426
- var now = host.now ? host.now() : new Date();
125427
- for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125428
- var file = outputs_2[_i];
125429
- if (skipOutputs && skipOutputs.has(toPath(state, file))) {
125430
- continue;
125431
- }
125432
- if (reportVerbose) {
125433
- reportVerbose = false;
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)
125434
125803
  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
+ }
125435
125830
  }
125436
- if (ts.isDeclarationFileName(file)) {
125437
- priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
125438
- }
125439
- host.setModifiedTime(file, now);
125440
125831
  }
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
+ });
125441
125837
  }
125442
125838
  ts.solutionPerformance.mark("afterUpdateOutputTimestamps");
125443
125839
  ts.solutionPerformance.measure("UpdateOutputTimestamps", "beforeUpdateOutputTimestamps", "afterUpdateOutputTimestamps");
125444
- return priorNewestUpdateTime;
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;
125445
125848
  }
125446
125849
  function updateOutputTimestamps(state, proj, resolvedPath) {
125447
125850
  if (state.options.dry) {
125448
125851
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
125449
125852
  }
125450
- var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125853
+ updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125451
125854
  state.projectStatus.set(resolvedPath, {
125452
125855
  type: ts.UpToDateStatusType.UpToDate,
125453
- newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
125856
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
125454
125857
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
125455
125858
  });
125456
125859
  }
@@ -125496,6 +125899,7 @@ var ts;
125496
125899
  break;
125497
125900
  }
125498
125901
  // falls through
125902
+ case ts.UpToDateStatusType.UpToDateWithInputFileText:
125499
125903
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125500
125904
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
125501
125905
  if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
@@ -125556,6 +125960,13 @@ var ts;
125556
125960
  : ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
125557
125961
  }
125558
125962
  function clean(state, project, onlyReferences) {
125963
+ ts.solutionPerformance.mark("beforeClean");
125964
+ var result = cleanWorker(state, project, onlyReferences);
125965
+ ts.solutionPerformance.mark("afterClean");
125966
+ ts.solutionPerformance.measure("Clean", "beforeClean", "afterClean");
125967
+ return result;
125968
+ }
125969
+ function cleanWorker(state, project, onlyReferences) {
125559
125970
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
125560
125971
  if (!buildOrder)
125561
125972
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -125680,12 +126091,10 @@ var ts;
125680
126091
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
125681
126092
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
125682
126093
  return;
125683
- state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
125684
- invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
125685
- }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
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));
125686
126095
  }
125687
126096
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
125688
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
126097
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
125689
126098
  var _a;
125690
126099
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
125691
126100
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -125717,7 +126126,7 @@ var ts;
125717
126126
  if (!state.watch)
125718
126127
  return;
125719
126128
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
125720
- 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); },
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); },
125721
126130
  onDeleteValue: ts.closeFileWatcher,
125722
126131
  });
125723
126132
  }
@@ -125725,7 +126134,7 @@ var ts;
125725
126134
  if (!state.watch || !state.lastCachedPackageJsonLookups)
125726
126135
  return;
125727
126136
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
125728
- 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); },
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); },
125729
126138
  onDeleteValue: ts.closeFileWatcher,
125730
126139
  });
125731
126140
  }
@@ -125858,19 +126267,18 @@ var ts;
125858
126267
  }
125859
126268
  }
125860
126269
  function reportUpToDateStatus(state, configFileName, status) {
125861
- if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125862
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125863
- }
125864
126270
  switch (status.type) {
125865
126271
  case ts.UpToDateStatusType.OutOfDateWithSelf:
125866
- 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));
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));
125867
126273
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
125868
- 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));
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));
125869
126275
  case ts.UpToDateStatusType.OutputMissing:
125870
126276
  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));
125871
126279
  case ts.UpToDateStatusType.UpToDate:
125872
126280
  if (status.newestInputFileTime !== undefined) {
125873
- 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 || ""));
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 || ""));
125874
126282
  }
125875
126283
  // Don't report anything for "up to date because it was already built" -- too verbose
125876
126284
  break;
@@ -125878,6 +126286,8 @@ var ts;
125878
126286
  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));
125879
126287
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125880
126288
  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));
125881
126291
  case ts.UpToDateStatusType.UpstreamOutOfDate:
125882
126292
  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));
125883
126293
  case ts.UpToDateStatusType.UpstreamBlocked:
@@ -125888,6 +126298,8 @@ var ts;
125888
126298
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
125889
126299
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
125890
126300
  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));
125891
126303
  case ts.UpToDateStatusType.ContainerOnly:
125892
126304
  // Don't report status on "solution" projects
125893
126305
  // falls through
@@ -144707,7 +145119,7 @@ var ts;
144707
145119
  if (!ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
144708
145120
  return;
144709
145121
  }
144710
- if (ts.isTypeNode(node)) {
145122
+ if (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node)) {
144711
145123
  return;
144712
145124
  }
144713
145125
  if (preferences.includeInlayVariableTypeHints && ts.isVariableDeclaration(node)) {
@@ -147818,7 +148230,6 @@ var ts;
147818
148230
  case 280 /* JsxOpeningElement */:
147819
148231
  case 281 /* JsxClosingElement */:
147820
148232
  case 279 /* JsxSelfClosingElement */:
147821
- case 228 /* ExpressionWithTypeArguments */:
147822
148233
  return false;
147823
148234
  }
147824
148235
  break;
@@ -147988,7 +148399,7 @@ var ts;
147988
148399
  var listEndToken = getCloseTokenForOpenToken(listStartToken);
147989
148400
  if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
147990
148401
  var tokenInfo = formattingScanner.readTokenInfo(parent);
147991
- if (tokenInfo.token.kind === 27 /* CommaToken */ && ts.isCallLikeExpression(parent)) {
148402
+ if (tokenInfo.token.kind === 27 /* CommaToken */) {
147992
148403
  // consume the comma
147993
148404
  consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
147994
148405
  tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent) : undefined;
@@ -148392,6 +148803,12 @@ var ts;
148392
148803
  case 169 /* MethodDeclaration */:
148393
148804
  case 168 /* MethodSignature */:
148394
148805
  case 214 /* ArrowFunction */:
148806
+ case 174 /* CallSignature */:
148807
+ case 175 /* ConstructSignature */:
148808
+ case 179 /* FunctionType */:
148809
+ case 180 /* ConstructorType */:
148810
+ case 172 /* GetAccessor */:
148811
+ case 173 /* SetAccessor */:
148395
148812
  if (node.typeParameters === list) {
148396
148813
  return 29 /* LessThanToken */;
148397
148814
  }
@@ -148408,7 +148825,19 @@ var ts;
148408
148825
  return 20 /* OpenParenToken */;
148409
148826
  }
148410
148827
  break;
148828
+ case 257 /* ClassDeclaration */:
148829
+ case 226 /* ClassExpression */:
148830
+ case 258 /* InterfaceDeclaration */:
148831
+ case 259 /* TypeAliasDeclaration */:
148832
+ if (node.typeParameters === list) {
148833
+ return 29 /* LessThanToken */;
148834
+ }
148835
+ break;
148411
148836
  case 178 /* TypeReference */:
148837
+ case 210 /* TaggedTemplateExpression */:
148838
+ case 181 /* TypeQuery */:
148839
+ case 228 /* ExpressionWithTypeArguments */:
148840
+ case 200 /* ImportType */:
148412
148841
  if (node.typeArguments === list) {
148413
148842
  return 29 /* LessThanToken */;
148414
148843
  }