@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.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-insiders.20220531";
92
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -3512,6 +3512,7 @@ var ts;
3512
3512
  var marks = new ts.Map();
3513
3513
  var counts = new ts.Map();
3514
3514
  var durations = new ts.Map();
3515
+ var durationMarks = new ts.Set();
3515
3516
  return {
3516
3517
  createTimerIf: createTimerIf,
3517
3518
  createTimer: createTimer,
@@ -3520,6 +3521,7 @@ var ts;
3520
3521
  getCount: getCount,
3521
3522
  getDuration: getDuration,
3522
3523
  forEachMeasure: forEachMeasure,
3524
+ forEachCount: forEachCount,
3523
3525
  isEnabled: isEnabled,
3524
3526
  enable: enable,
3525
3527
  disable: disable,
@@ -3574,6 +3576,7 @@ var ts;
3574
3576
  function measure(measureName, startMarkName, endMarkName) {
3575
3577
  var _a, _b;
3576
3578
  if (enabled) {
3579
+ durationMarks.add(startMarkName).add(endMarkName);
3577
3580
  var end = (_a = marks.get(endMarkName)) !== null && _a !== void 0 ? _a : ts.timestamp();
3578
3581
  var start = (_b = marks.get(startMarkName)) !== null && _b !== void 0 ? _b : timeorigin;
3579
3582
  var previousDuration = durations.get(measureName) || 0;
@@ -3605,6 +3608,14 @@ var ts;
3605
3608
  function forEachMeasure(cb) {
3606
3609
  durations.forEach(function (duration, measureName) { return cb(measureName, duration); });
3607
3610
  }
3611
+ /**
3612
+ * Iterate over each count which is not duration mark, performing some action
3613
+ *
3614
+ * @param cb The action to perform for each measure
3615
+ */
3616
+ function forEachCount(cb) {
3617
+ counts.forEach(function (count, countName) { return !durationMarks.has(countName) && cb(countName, count); });
3618
+ }
3608
3619
  /**
3609
3620
  * Indicates whether the performance API is enabled.
3610
3621
  */
@@ -6189,7 +6200,7 @@ var ts;
6189
6200
  };
6190
6201
  }
6191
6202
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6192
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6203
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6193
6204
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6194
6205
  if (!ts.isString(relativeFileName))
6195
6206
  return;
@@ -6199,7 +6210,7 @@ var ts;
6199
6210
  if (callbacks) {
6200
6211
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6201
6212
  var fileCallback = callbacks_1[_i];
6202
- fileCallback(fileName, FileWatcherEventKind.Changed);
6213
+ fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6203
6214
  }
6204
6215
  }
6205
6216
  },
@@ -6253,7 +6264,7 @@ var ts;
6253
6264
  }
6254
6265
  else {
6255
6266
  cache.set(path, {
6256
- watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6267
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6257
6268
  refCount: 1
6258
6269
  });
6259
6270
  }
@@ -6281,7 +6292,7 @@ var ts;
6281
6292
  var newTime = modifiedTime.getTime();
6282
6293
  if (oldTime !== newTime) {
6283
6294
  watchedFile.mtime = modifiedTime;
6284
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6295
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6285
6296
  return true;
6286
6297
  }
6287
6298
  return false;
@@ -6532,17 +6543,18 @@ var ts;
6532
6543
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6533
6544
  /*@internal*/
6534
6545
  function createFileWatcherCallback(callback) {
6535
- return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6546
+ return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6536
6547
  }
6537
6548
  ts.createFileWatcherCallback = createFileWatcherCallback;
6538
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6539
- return function (eventName) {
6549
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6550
+ return function (eventName, _relativeFileName, modifiedTime) {
6540
6551
  if (eventName === "rename") {
6541
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6552
+ modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6553
+ callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6542
6554
  }
6543
6555
  else {
6544
6556
  // Change
6545
- callback(fileName, FileWatcherEventKind.Changed);
6557
+ callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6546
6558
  }
6547
6559
  };
6548
6560
  }
@@ -6566,7 +6578,7 @@ var ts;
6566
6578
  }
6567
6579
  /*@internal*/
6568
6580
  function createSystemWatchFunctions(_a) {
6569
- 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;
6581
+ 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;
6570
6582
  var dynamicPollingWatchFile;
6571
6583
  var fixedChunkSizePollingWatchFile;
6572
6584
  var nonPollingWatchFile;
@@ -6588,7 +6600,7 @@ var ts;
6588
6600
  case ts.WatchFileKind.FixedChunkSizePolling:
6589
6601
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6590
6602
  case ts.WatchFileKind.UseFsEvents:
6591
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6603
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6592
6604
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6593
6605
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6594
6606
  if (!nonPollingWatchFile) {
@@ -6770,7 +6782,6 @@ var ts;
6770
6782
  fsWatch: fsWatch,
6771
6783
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6772
6784
  getCurrentDirectory: getCurrentDirectory,
6773
- fileExists: fileExists,
6774
6785
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6775
6786
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6776
6787
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7030,7 +7041,7 @@ var ts;
7030
7041
  // File changed
7031
7042
  eventKind = FileWatcherEventKind.Changed;
7032
7043
  }
7033
- callback(fileName, eventKind);
7044
+ callback(fileName, eventKind, curr.mtime);
7034
7045
  }
7035
7046
  }
7036
7047
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7056,10 +7067,10 @@ var ts;
7056
7067
  * Invoke the callback with rename and update the watcher if not closed
7057
7068
  * @param createWatcher
7058
7069
  */
7059
- function invokeCallbackAndUpdateWatcher(createWatcher) {
7070
+ function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7060
7071
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7061
7072
  // Call the callback for current directory
7062
- callback("rename", "");
7073
+ callback("rename", "", modifiedTime);
7063
7074
  // If watcher is not closed, update it
7064
7075
  if (watcher) {
7065
7076
  watcher.close();
@@ -7105,13 +7116,14 @@ var ts;
7105
7116
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7106
7117
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7107
7118
  // Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
7119
+ var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
7108
7120
  return event === "rename" &&
7109
7121
  (!relativeName ||
7110
7122
  relativeName === lastDirectoryPart ||
7111
7123
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7112
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7113
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7114
- callback(event, relativeName);
7124
+ modifiedTime === ts.missingFileModifiedTime ?
7125
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7126
+ callback(event, relativeName, modifiedTime);
7115
7127
  }
7116
7128
  /**
7117
7129
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7125,12 +7137,15 @@ var ts;
7125
7137
  * and switch to existing file or directory when the missing filesystem entry is created
7126
7138
  */
7127
7139
  function watchMissingFileSystemEntry() {
7128
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7129
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7130
- // Call the callback for current file or directory
7131
- // For now it could be callback for the inner directory creation,
7132
- // but just return current directory, better than current no-op
7133
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
7140
+ return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
7141
+ if (eventKind === FileWatcherEventKind.Created) {
7142
+ modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
7143
+ if (modifiedTime !== ts.missingFileModifiedTime) {
7144
+ // Call the callback for current file or directory
7145
+ // For now it could be callback for the inner directory creation,
7146
+ // but just return current directory, better than current no-op
7147
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
7148
+ }
7134
7149
  }
7135
7150
  }, fallbackPollingInterval, fallbackOptions);
7136
7151
  }
@@ -7280,12 +7295,19 @@ var ts;
7280
7295
  }
7281
7296
  function getModifiedTime(path) {
7282
7297
  var _a;
7298
+ // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7299
+ // the CPU time performance.
7300
+ var originalStackTraceLimit = Error.stackTraceLimit;
7301
+ Error.stackTraceLimit = 0;
7283
7302
  try {
7284
7303
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7285
7304
  }
7286
7305
  catch (e) {
7287
7306
  return undefined;
7288
7307
  }
7308
+ finally {
7309
+ Error.stackTraceLimit = originalStackTraceLimit;
7310
+ }
7289
7311
  }
7290
7312
  function setModifiedTime(path, time) {
7291
7313
  try {
@@ -8897,6 +8919,7 @@ var ts;
8897
8919
  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."),
8898
8920
  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."),
8899
8921
  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."),
8922
+ 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"),
8900
8923
  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}'."),
8901
8924
  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}'."),
8902
8925
  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}'."),
@@ -9307,8 +9330,8 @@ var ts;
9307
9330
  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"),
9308
9331
  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"),
9309
9332
  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."),
9310
- 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}'"),
9311
- 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}'"),
9333
+ 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}'"),
9334
+ 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}'"),
9312
9335
  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"),
9313
9336
  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"),
9314
9337
  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"),
@@ -9339,7 +9362,7 @@ var ts;
9339
9362
  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"),
9340
9363
  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."),
9341
9364
  _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),
9342
- 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."),
9365
+ 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."),
9343
9366
  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),
9344
9367
  Project_0_is_being_forcibly_rebuilt: diag(6388, ts.DiagnosticCategory.Message, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"),
9345
9368
  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."),
@@ -9352,6 +9375,8 @@ var ts;
9352
9375
  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}'."),
9353
9376
  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}'."),
9354
9377
  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."),
9378
+ 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"),
9379
+ 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"),
9355
9380
  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}'"),
9356
9381
  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."),
9357
9382
  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."),
@@ -9473,6 +9498,7 @@ var ts;
9473
9498
  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."),
9474
9499
  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."),
9475
9500
  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."),
9501
+ 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."),
9476
9502
  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'."),
9477
9503
  one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
9478
9504
  one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
@@ -20181,6 +20207,10 @@ var ts;
20181
20207
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20182
20208
  }
20183
20209
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20210
+ function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20211
+ return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20212
+ }
20213
+ ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20184
20214
  function getCompilerOptionValue(options, option) {
20185
20215
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20186
20216
  }
@@ -39221,6 +39251,7 @@ var ts;
39221
39251
  type: "boolean",
39222
39252
  affectsSemanticDiagnostics: true,
39223
39253
  affectsEmit: true,
39254
+ affectsMultiFileEmitBuildInfo: true,
39224
39255
  category: ts.Diagnostics.Watch_and_Build_Modes,
39225
39256
  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,
39226
39257
  defaultValueDescription: false,
@@ -39255,12 +39286,40 @@ var ts;
39255
39286
  affectsSourceFile: true,
39256
39287
  affectsModuleResolution: true,
39257
39288
  affectsEmit: true,
39289
+ affectsMultiFileEmitBuildInfo: true,
39258
39290
  paramType: ts.Diagnostics.VERSION,
39259
39291
  showInSimplifiedHelpView: true,
39260
39292
  category: ts.Diagnostics.Language_and_Environment,
39261
39293
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39262
39294
  defaultValueDescription: 0 /* ES3 */,
39263
39295
  };
39296
+ /*@internal*/
39297
+ ts.moduleOptionDeclaration = {
39298
+ name: "module",
39299
+ shortName: "m",
39300
+ type: new ts.Map(ts.getEntries({
39301
+ none: ts.ModuleKind.None,
39302
+ commonjs: ts.ModuleKind.CommonJS,
39303
+ amd: ts.ModuleKind.AMD,
39304
+ system: ts.ModuleKind.System,
39305
+ umd: ts.ModuleKind.UMD,
39306
+ es6: ts.ModuleKind.ES2015,
39307
+ es2015: ts.ModuleKind.ES2015,
39308
+ es2020: ts.ModuleKind.ES2020,
39309
+ es2022: ts.ModuleKind.ES2022,
39310
+ esnext: ts.ModuleKind.ESNext,
39311
+ node16: ts.ModuleKind.Node16,
39312
+ nodenext: ts.ModuleKind.NodeNext,
39313
+ })),
39314
+ affectsModuleResolution: true,
39315
+ affectsEmit: true,
39316
+ affectsMultiFileEmitBuildInfo: true,
39317
+ paramType: ts.Diagnostics.KIND,
39318
+ showInSimplifiedHelpView: true,
39319
+ category: ts.Diagnostics.Modules,
39320
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
39321
+ defaultValueDescription: undefined,
39322
+ };
39264
39323
  var commandOptionsWithoutBuild = [
39265
39324
  // CommandLine only options
39266
39325
  {
@@ -39322,37 +39381,14 @@ var ts;
39322
39381
  category: ts.Diagnostics.Command_line_Options,
39323
39382
  affectsSemanticDiagnostics: true,
39324
39383
  affectsEmit: true,
39384
+ affectsMultiFileEmitBuildInfo: true,
39325
39385
  isCommandLineOnly: true,
39326
39386
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39327
39387
  defaultValueDescription: false,
39328
39388
  },
39329
39389
  // Basic
39330
39390
  ts.targetOptionDeclaration,
39331
- {
39332
- name: "module",
39333
- shortName: "m",
39334
- type: new ts.Map(ts.getEntries({
39335
- none: ts.ModuleKind.None,
39336
- commonjs: ts.ModuleKind.CommonJS,
39337
- amd: ts.ModuleKind.AMD,
39338
- system: ts.ModuleKind.System,
39339
- umd: ts.ModuleKind.UMD,
39340
- es6: ts.ModuleKind.ES2015,
39341
- es2015: ts.ModuleKind.ES2015,
39342
- es2020: ts.ModuleKind.ES2020,
39343
- es2022: ts.ModuleKind.ES2022,
39344
- esnext: ts.ModuleKind.ESNext,
39345
- node16: ts.ModuleKind.Node16,
39346
- nodenext: ts.ModuleKind.NodeNext,
39347
- })),
39348
- affectsModuleResolution: true,
39349
- affectsEmit: true,
39350
- paramType: ts.Diagnostics.KIND,
39351
- showInSimplifiedHelpView: true,
39352
- category: ts.Diagnostics.Modules,
39353
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39354
- defaultValueDescription: undefined,
39355
- },
39391
+ ts.moduleOptionDeclaration,
39356
39392
  {
39357
39393
  name: "lib",
39358
39394
  type: "list",
@@ -39389,6 +39425,7 @@ var ts;
39389
39425
  type: jsxOptionMap,
39390
39426
  affectsSourceFile: true,
39391
39427
  affectsEmit: true,
39428
+ affectsMultiFileEmitBuildInfo: true,
39392
39429
  affectsModuleResolution: true,
39393
39430
  paramType: ts.Diagnostics.KIND,
39394
39431
  showInSimplifiedHelpView: true,
@@ -39401,6 +39438,7 @@ var ts;
39401
39438
  shortName: "d",
39402
39439
  type: "boolean",
39403
39440
  affectsEmit: true,
39441
+ affectsMultiFileEmitBuildInfo: true,
39404
39442
  showInSimplifiedHelpView: true,
39405
39443
  category: ts.Diagnostics.Emit,
39406
39444
  transpileOptionValue: undefined,
@@ -39411,6 +39449,7 @@ var ts;
39411
39449
  name: "declarationMap",
39412
39450
  type: "boolean",
39413
39451
  affectsEmit: true,
39452
+ affectsMultiFileEmitBuildInfo: true,
39414
39453
  showInSimplifiedHelpView: true,
39415
39454
  category: ts.Diagnostics.Emit,
39416
39455
  transpileOptionValue: undefined,
@@ -39421,6 +39460,7 @@ var ts;
39421
39460
  name: "emitDeclarationOnly",
39422
39461
  type: "boolean",
39423
39462
  affectsEmit: true,
39463
+ affectsMultiFileEmitBuildInfo: true,
39424
39464
  showInSimplifiedHelpView: true,
39425
39465
  category: ts.Diagnostics.Emit,
39426
39466
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39431,6 +39471,7 @@ var ts;
39431
39471
  name: "sourceMap",
39432
39472
  type: "boolean",
39433
39473
  affectsEmit: true,
39474
+ affectsMultiFileEmitBuildInfo: true,
39434
39475
  showInSimplifiedHelpView: true,
39435
39476
  category: ts.Diagnostics.Emit,
39436
39477
  defaultValueDescription: false,
@@ -39440,6 +39481,9 @@ var ts;
39440
39481
  name: "outFile",
39441
39482
  type: "string",
39442
39483
  affectsEmit: true,
39484
+ affectsMultiFileEmitBuildInfo: true,
39485
+ affectsDeclarationPath: true,
39486
+ affectsBundleEmitBuildInfo: true,
39443
39487
  isFilePath: true,
39444
39488
  paramType: ts.Diagnostics.FILE,
39445
39489
  showInSimplifiedHelpView: true,
@@ -39451,6 +39495,8 @@ var ts;
39451
39495
  name: "outDir",
39452
39496
  type: "string",
39453
39497
  affectsEmit: true,
39498
+ affectsMultiFileEmitBuildInfo: true,
39499
+ affectsDeclarationPath: true,
39454
39500
  isFilePath: true,
39455
39501
  paramType: ts.Diagnostics.DIRECTORY,
39456
39502
  showInSimplifiedHelpView: true,
@@ -39461,6 +39507,8 @@ var ts;
39461
39507
  name: "rootDir",
39462
39508
  type: "string",
39463
39509
  affectsEmit: true,
39510
+ affectsMultiFileEmitBuildInfo: true,
39511
+ affectsDeclarationPath: true,
39464
39512
  isFilePath: true,
39465
39513
  paramType: ts.Diagnostics.LOCATION,
39466
39514
  category: ts.Diagnostics.Modules,
@@ -39471,6 +39519,8 @@ var ts;
39471
39519
  name: "composite",
39472
39520
  type: "boolean",
39473
39521
  affectsEmit: true,
39522
+ affectsMultiFileEmitBuildInfo: true,
39523
+ affectsBundleEmitBuildInfo: true,
39474
39524
  isTSConfigOnly: true,
39475
39525
  category: ts.Diagnostics.Projects,
39476
39526
  transpileOptionValue: undefined,
@@ -39481,6 +39531,8 @@ var ts;
39481
39531
  name: "tsBuildInfoFile",
39482
39532
  type: "string",
39483
39533
  affectsEmit: true,
39534
+ affectsMultiFileEmitBuildInfo: true,
39535
+ affectsBundleEmitBuildInfo: true,
39484
39536
  isFilePath: true,
39485
39537
  paramType: ts.Diagnostics.FILE,
39486
39538
  category: ts.Diagnostics.Projects,
@@ -39492,6 +39544,7 @@ var ts;
39492
39544
  name: "removeComments",
39493
39545
  type: "boolean",
39494
39546
  affectsEmit: true,
39547
+ affectsMultiFileEmitBuildInfo: true,
39495
39548
  showInSimplifiedHelpView: true,
39496
39549
  category: ts.Diagnostics.Emit,
39497
39550
  defaultValueDescription: false,
@@ -39510,6 +39563,7 @@ var ts;
39510
39563
  name: "importHelpers",
39511
39564
  type: "boolean",
39512
39565
  affectsEmit: true,
39566
+ affectsMultiFileEmitBuildInfo: true,
39513
39567
  category: ts.Diagnostics.Emit,
39514
39568
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39515
39569
  defaultValueDescription: false,
@@ -39523,6 +39577,7 @@ var ts;
39523
39577
  })),
39524
39578
  affectsEmit: true,
39525
39579
  affectsSemanticDiagnostics: true,
39580
+ affectsMultiFileEmitBuildInfo: true,
39526
39581
  category: ts.Diagnostics.Emit,
39527
39582
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39528
39583
  defaultValueDescription: 0 /* Remove */,
@@ -39531,6 +39586,7 @@ var ts;
39531
39586
  name: "downlevelIteration",
39532
39587
  type: "boolean",
39533
39588
  affectsEmit: true,
39589
+ affectsMultiFileEmitBuildInfo: true,
39534
39590
  category: ts.Diagnostics.Emit,
39535
39591
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39536
39592
  defaultValueDescription: false,
@@ -39549,6 +39605,9 @@ var ts;
39549
39605
  type: "boolean",
39550
39606
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39551
39607
  // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
39608
+ // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
39609
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
39610
+ affectsMultiFileEmitBuildInfo: true,
39552
39611
  showInSimplifiedHelpView: true,
39553
39612
  category: ts.Diagnostics.Type_Checking,
39554
39613
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39558,6 +39617,7 @@ var ts;
39558
39617
  name: "noImplicitAny",
39559
39618
  type: "boolean",
39560
39619
  affectsSemanticDiagnostics: true,
39620
+ affectsMultiFileEmitBuildInfo: true,
39561
39621
  strictFlag: true,
39562
39622
  category: ts.Diagnostics.Type_Checking,
39563
39623
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39567,6 +39627,7 @@ var ts;
39567
39627
  name: "strictNullChecks",
39568
39628
  type: "boolean",
39569
39629
  affectsSemanticDiagnostics: true,
39630
+ affectsMultiFileEmitBuildInfo: true,
39570
39631
  strictFlag: true,
39571
39632
  category: ts.Diagnostics.Type_Checking,
39572
39633
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39575,6 +39636,8 @@ var ts;
39575
39636
  {
39576
39637
  name: "strictFunctionTypes",
39577
39638
  type: "boolean",
39639
+ affectsSemanticDiagnostics: true,
39640
+ affectsMultiFileEmitBuildInfo: true,
39578
39641
  strictFlag: true,
39579
39642
  category: ts.Diagnostics.Type_Checking,
39580
39643
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39583,6 +39646,8 @@ var ts;
39583
39646
  {
39584
39647
  name: "strictBindCallApply",
39585
39648
  type: "boolean",
39649
+ affectsSemanticDiagnostics: true,
39650
+ affectsMultiFileEmitBuildInfo: true,
39586
39651
  strictFlag: true,
39587
39652
  category: ts.Diagnostics.Type_Checking,
39588
39653
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39592,6 +39657,7 @@ var ts;
39592
39657
  name: "strictPropertyInitialization",
39593
39658
  type: "boolean",
39594
39659
  affectsSemanticDiagnostics: true,
39660
+ affectsMultiFileEmitBuildInfo: true,
39595
39661
  strictFlag: true,
39596
39662
  category: ts.Diagnostics.Type_Checking,
39597
39663
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39601,6 +39667,7 @@ var ts;
39601
39667
  name: "noImplicitThis",
39602
39668
  type: "boolean",
39603
39669
  affectsSemanticDiagnostics: true,
39670
+ affectsMultiFileEmitBuildInfo: true,
39604
39671
  strictFlag: true,
39605
39672
  category: ts.Diagnostics.Type_Checking,
39606
39673
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39610,6 +39677,7 @@ var ts;
39610
39677
  name: "useUnknownInCatchVariables",
39611
39678
  type: "boolean",
39612
39679
  affectsSemanticDiagnostics: true,
39680
+ affectsMultiFileEmitBuildInfo: true,
39613
39681
  strictFlag: true,
39614
39682
  category: ts.Diagnostics.Type_Checking,
39615
39683
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39619,6 +39687,8 @@ var ts;
39619
39687
  name: "alwaysStrict",
39620
39688
  type: "boolean",
39621
39689
  affectsSourceFile: true,
39690
+ affectsEmit: true,
39691
+ affectsMultiFileEmitBuildInfo: true,
39622
39692
  strictFlag: true,
39623
39693
  category: ts.Diagnostics.Type_Checking,
39624
39694
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39629,6 +39699,7 @@ var ts;
39629
39699
  name: "noUnusedLocals",
39630
39700
  type: "boolean",
39631
39701
  affectsSemanticDiagnostics: true,
39702
+ affectsMultiFileEmitBuildInfo: true,
39632
39703
  category: ts.Diagnostics.Type_Checking,
39633
39704
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39634
39705
  defaultValueDescription: false,
@@ -39637,6 +39708,7 @@ var ts;
39637
39708
  name: "noUnusedParameters",
39638
39709
  type: "boolean",
39639
39710
  affectsSemanticDiagnostics: true,
39711
+ affectsMultiFileEmitBuildInfo: true,
39640
39712
  category: ts.Diagnostics.Type_Checking,
39641
39713
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39642
39714
  defaultValueDescription: false,
@@ -39645,6 +39717,7 @@ var ts;
39645
39717
  name: "exactOptionalPropertyTypes",
39646
39718
  type: "boolean",
39647
39719
  affectsSemanticDiagnostics: true,
39720
+ affectsMultiFileEmitBuildInfo: true,
39648
39721
  category: ts.Diagnostics.Type_Checking,
39649
39722
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39650
39723
  defaultValueDescription: false,
@@ -39653,6 +39726,7 @@ var ts;
39653
39726
  name: "noImplicitReturns",
39654
39727
  type: "boolean",
39655
39728
  affectsSemanticDiagnostics: true,
39729
+ affectsMultiFileEmitBuildInfo: true,
39656
39730
  category: ts.Diagnostics.Type_Checking,
39657
39731
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39658
39732
  defaultValueDescription: false,
@@ -39662,6 +39736,7 @@ var ts;
39662
39736
  type: "boolean",
39663
39737
  affectsBindDiagnostics: true,
39664
39738
  affectsSemanticDiagnostics: true,
39739
+ affectsMultiFileEmitBuildInfo: true,
39665
39740
  category: ts.Diagnostics.Type_Checking,
39666
39741
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39667
39742
  defaultValueDescription: false,
@@ -39670,6 +39745,7 @@ var ts;
39670
39745
  name: "noUncheckedIndexedAccess",
39671
39746
  type: "boolean",
39672
39747
  affectsSemanticDiagnostics: true,
39748
+ affectsMultiFileEmitBuildInfo: true,
39673
39749
  category: ts.Diagnostics.Type_Checking,
39674
39750
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39675
39751
  defaultValueDescription: false,
@@ -39678,6 +39754,7 @@ var ts;
39678
39754
  name: "noImplicitOverride",
39679
39755
  type: "boolean",
39680
39756
  affectsSemanticDiagnostics: true,
39757
+ affectsMultiFileEmitBuildInfo: true,
39681
39758
  category: ts.Diagnostics.Type_Checking,
39682
39759
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39683
39760
  defaultValueDescription: false,
@@ -39685,6 +39762,8 @@ var ts;
39685
39762
  {
39686
39763
  name: "noPropertyAccessFromIndexSignature",
39687
39764
  type: "boolean",
39765
+ affectsSemanticDiagnostics: true,
39766
+ affectsMultiFileEmitBuildInfo: true,
39688
39767
  showInSimplifiedHelpView: false,
39689
39768
  category: ts.Diagnostics.Type_Checking,
39690
39769
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -39770,6 +39849,7 @@ var ts;
39770
39849
  name: "allowSyntheticDefaultImports",
39771
39850
  type: "boolean",
39772
39851
  affectsSemanticDiagnostics: true,
39852
+ affectsMultiFileEmitBuildInfo: true,
39773
39853
  category: ts.Diagnostics.Interop_Constraints,
39774
39854
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
39775
39855
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -39779,6 +39859,7 @@ var ts;
39779
39859
  type: "boolean",
39780
39860
  affectsSemanticDiagnostics: true,
39781
39861
  affectsEmit: true,
39862
+ affectsMultiFileEmitBuildInfo: true,
39782
39863
  showInSimplifiedHelpView: true,
39783
39864
  category: ts.Diagnostics.Interop_Constraints,
39784
39865
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -39795,6 +39876,7 @@ var ts;
39795
39876
  name: "allowUmdGlobalAccess",
39796
39877
  type: "boolean",
39797
39878
  affectsSemanticDiagnostics: true,
39879
+ affectsMultiFileEmitBuildInfo: true,
39798
39880
  category: ts.Diagnostics.Modules,
39799
39881
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
39800
39882
  defaultValueDescription: false,
@@ -39816,6 +39898,7 @@ var ts;
39816
39898
  name: "sourceRoot",
39817
39899
  type: "string",
39818
39900
  affectsEmit: true,
39901
+ affectsMultiFileEmitBuildInfo: true,
39819
39902
  paramType: ts.Diagnostics.LOCATION,
39820
39903
  category: ts.Diagnostics.Emit,
39821
39904
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -39824,6 +39907,7 @@ var ts;
39824
39907
  name: "mapRoot",
39825
39908
  type: "string",
39826
39909
  affectsEmit: true,
39910
+ affectsMultiFileEmitBuildInfo: true,
39827
39911
  paramType: ts.Diagnostics.LOCATION,
39828
39912
  category: ts.Diagnostics.Emit,
39829
39913
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -39832,6 +39916,7 @@ var ts;
39832
39916
  name: "inlineSourceMap",
39833
39917
  type: "boolean",
39834
39918
  affectsEmit: true,
39919
+ affectsMultiFileEmitBuildInfo: true,
39835
39920
  category: ts.Diagnostics.Emit,
39836
39921
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
39837
39922
  defaultValueDescription: false,
@@ -39840,6 +39925,7 @@ var ts;
39840
39925
  name: "inlineSources",
39841
39926
  type: "boolean",
39842
39927
  affectsEmit: true,
39928
+ affectsMultiFileEmitBuildInfo: true,
39843
39929
  category: ts.Diagnostics.Emit,
39844
39930
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
39845
39931
  defaultValueDescription: false,
@@ -39849,6 +39935,7 @@ var ts;
39849
39935
  name: "experimentalDecorators",
39850
39936
  type: "boolean",
39851
39937
  affectsSemanticDiagnostics: true,
39938
+ affectsMultiFileEmitBuildInfo: true,
39852
39939
  category: ts.Diagnostics.Language_and_Environment,
39853
39940
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
39854
39941
  defaultValueDescription: false,
@@ -39858,6 +39945,7 @@ var ts;
39858
39945
  type: "boolean",
39859
39946
  affectsSemanticDiagnostics: true,
39860
39947
  affectsEmit: true,
39948
+ affectsMultiFileEmitBuildInfo: true,
39861
39949
  category: ts.Diagnostics.Language_and_Environment,
39862
39950
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
39863
39951
  defaultValueDescription: false,
@@ -39882,6 +39970,7 @@ var ts;
39882
39970
  type: "string",
39883
39971
  affectsSemanticDiagnostics: true,
39884
39972
  affectsEmit: true,
39973
+ affectsMultiFileEmitBuildInfo: true,
39885
39974
  affectsModuleResolution: true,
39886
39975
  category: ts.Diagnostics.Language_and_Environment,
39887
39976
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -39899,6 +39988,9 @@ var ts;
39899
39988
  name: "out",
39900
39989
  type: "string",
39901
39990
  affectsEmit: true,
39991
+ affectsMultiFileEmitBuildInfo: true,
39992
+ affectsDeclarationPath: true,
39993
+ affectsBundleEmitBuildInfo: true,
39902
39994
  isFilePath: false,
39903
39995
  // for correct behaviour, please use outFile
39904
39996
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -39910,6 +40002,7 @@ var ts;
39910
40002
  name: "reactNamespace",
39911
40003
  type: "string",
39912
40004
  affectsEmit: true,
40005
+ affectsMultiFileEmitBuildInfo: true,
39913
40006
  category: ts.Diagnostics.Language_and_Environment,
39914
40007
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
39915
40008
  defaultValueDescription: "`React`",
@@ -39917,6 +40010,8 @@ var ts;
39917
40010
  {
39918
40011
  name: "skipDefaultLibCheck",
39919
40012
  type: "boolean",
40013
+ // We need to store these to determine whether `lib` files need to be rechecked
40014
+ affectsMultiFileEmitBuildInfo: true,
39920
40015
  category: ts.Diagnostics.Completeness,
39921
40016
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
39922
40017
  defaultValueDescription: false,
@@ -39932,6 +40027,7 @@ var ts;
39932
40027
  name: "emitBOM",
39933
40028
  type: "boolean",
39934
40029
  affectsEmit: true,
40030
+ affectsMultiFileEmitBuildInfo: true,
39935
40031
  category: ts.Diagnostics.Emit,
39936
40032
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
39937
40033
  defaultValueDescription: false,
@@ -39943,6 +40039,7 @@ var ts;
39943
40039
  lf: 1 /* LineFeed */
39944
40040
  })),
39945
40041
  affectsEmit: true,
40042
+ affectsMultiFileEmitBuildInfo: true,
39946
40043
  paramType: ts.Diagnostics.NEWLINE,
39947
40044
  category: ts.Diagnostics.Emit,
39948
40045
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -39952,6 +40049,7 @@ var ts;
39952
40049
  name: "noErrorTruncation",
39953
40050
  type: "boolean",
39954
40051
  affectsSemanticDiagnostics: true,
40052
+ affectsMultiFileEmitBuildInfo: true,
39955
40053
  category: ts.Diagnostics.Output_Formatting,
39956
40054
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
39957
40055
  defaultValueDescription: false,
@@ -39982,6 +40080,7 @@ var ts;
39982
40080
  name: "stripInternal",
39983
40081
  type: "boolean",
39984
40082
  affectsEmit: true,
40083
+ affectsMultiFileEmitBuildInfo: true,
39985
40084
  category: ts.Diagnostics.Emit,
39986
40085
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39987
40086
  defaultValueDescription: false,
@@ -40022,6 +40121,7 @@ var ts;
40022
40121
  name: "noImplicitUseStrict",
40023
40122
  type: "boolean",
40024
40123
  affectsSemanticDiagnostics: true,
40124
+ affectsMultiFileEmitBuildInfo: true,
40025
40125
  category: ts.Diagnostics.Backwards_Compatibility,
40026
40126
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
40027
40127
  defaultValueDescription: false,
@@ -40030,6 +40130,7 @@ var ts;
40030
40130
  name: "noEmitHelpers",
40031
40131
  type: "boolean",
40032
40132
  affectsEmit: true,
40133
+ affectsMultiFileEmitBuildInfo: true,
40033
40134
  category: ts.Diagnostics.Emit,
40034
40135
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
40035
40136
  defaultValueDescription: false,
@@ -40038,6 +40139,7 @@ var ts;
40038
40139
  name: "noEmitOnError",
40039
40140
  type: "boolean",
40040
40141
  affectsEmit: true,
40142
+ affectsMultiFileEmitBuildInfo: true,
40041
40143
  category: ts.Diagnostics.Emit,
40042
40144
  transpileOptionValue: undefined,
40043
40145
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40047,6 +40149,7 @@ var ts;
40047
40149
  name: "preserveConstEnums",
40048
40150
  type: "boolean",
40049
40151
  affectsEmit: true,
40152
+ affectsMultiFileEmitBuildInfo: true,
40050
40153
  category: ts.Diagnostics.Emit,
40051
40154
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40052
40155
  defaultValueDescription: false,
@@ -40055,6 +40158,8 @@ var ts;
40055
40158
  name: "declarationDir",
40056
40159
  type: "string",
40057
40160
  affectsEmit: true,
40161
+ affectsMultiFileEmitBuildInfo: true,
40162
+ affectsDeclarationPath: true,
40058
40163
  isFilePath: true,
40059
40164
  paramType: ts.Diagnostics.DIRECTORY,
40060
40165
  category: ts.Diagnostics.Emit,
@@ -40064,6 +40169,8 @@ var ts;
40064
40169
  {
40065
40170
  name: "skipLibCheck",
40066
40171
  type: "boolean",
40172
+ // We need to store these to determine whether `lib` files need to be rechecked
40173
+ affectsMultiFileEmitBuildInfo: true,
40067
40174
  category: ts.Diagnostics.Completeness,
40068
40175
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40069
40176
  defaultValueDescription: false,
@@ -40073,6 +40180,7 @@ var ts;
40073
40180
  type: "boolean",
40074
40181
  affectsBindDiagnostics: true,
40075
40182
  affectsSemanticDiagnostics: true,
40183
+ affectsMultiFileEmitBuildInfo: true,
40076
40184
  category: ts.Diagnostics.Type_Checking,
40077
40185
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40078
40186
  defaultValueDescription: undefined,
@@ -40082,6 +40190,7 @@ var ts;
40082
40190
  type: "boolean",
40083
40191
  affectsBindDiagnostics: true,
40084
40192
  affectsSemanticDiagnostics: true,
40193
+ affectsMultiFileEmitBuildInfo: true,
40085
40194
  category: ts.Diagnostics.Type_Checking,
40086
40195
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40087
40196
  defaultValueDescription: undefined,
@@ -40090,6 +40199,7 @@ var ts;
40090
40199
  name: "suppressExcessPropertyErrors",
40091
40200
  type: "boolean",
40092
40201
  affectsSemanticDiagnostics: true,
40202
+ affectsMultiFileEmitBuildInfo: true,
40093
40203
  category: ts.Diagnostics.Backwards_Compatibility,
40094
40204
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40095
40205
  defaultValueDescription: false,
@@ -40098,6 +40208,7 @@ var ts;
40098
40208
  name: "suppressImplicitAnyIndexErrors",
40099
40209
  type: "boolean",
40100
40210
  affectsSemanticDiagnostics: true,
40211
+ affectsMultiFileEmitBuildInfo: true,
40101
40212
  category: ts.Diagnostics.Backwards_Compatibility,
40102
40213
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40103
40214
  defaultValueDescription: false,
@@ -40122,6 +40233,7 @@ var ts;
40122
40233
  name: "noStrictGenericChecks",
40123
40234
  type: "boolean",
40124
40235
  affectsSemanticDiagnostics: true,
40236
+ affectsMultiFileEmitBuildInfo: true,
40125
40237
  category: ts.Diagnostics.Backwards_Compatibility,
40126
40238
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40127
40239
  defaultValueDescription: false,
@@ -40131,6 +40243,7 @@ var ts;
40131
40243
  type: "boolean",
40132
40244
  affectsSemanticDiagnostics: true,
40133
40245
  affectsEmit: true,
40246
+ affectsMultiFileEmitBuildInfo: true,
40134
40247
  category: ts.Diagnostics.Language_and_Environment,
40135
40248
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40136
40249
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40139,6 +40252,7 @@ var ts;
40139
40252
  name: "preserveValueImports",
40140
40253
  type: "boolean",
40141
40254
  affectsEmit: true,
40255
+ affectsMultiFileEmitBuildInfo: true,
40142
40256
  category: ts.Diagnostics.Emit,
40143
40257
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40144
40258
  defaultValueDescription: false,
@@ -40182,6 +40296,8 @@ var ts;
40182
40296
  /* @internal */
40183
40297
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40184
40298
  /* @internal */
40299
+ ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40300
+ /* @internal */
40185
40301
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40186
40302
  /* @internal */
40187
40303
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -40226,7 +40342,14 @@ var ts;
40226
40342
  description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
40227
40343
  type: "boolean",
40228
40344
  defaultValueDescription: false,
40229
- }
40345
+ },
40346
+ {
40347
+ name: "solutionDiagnostics",
40348
+ type: "boolean",
40349
+ category: ts.Diagnostics.Compiler_Diagnostics,
40350
+ description: ts.Diagnostics.Output_more_detailed_solution_performance_information_after_building,
40351
+ defaultValueDescription: false,
40352
+ },
40230
40353
  ];
40231
40354
  /* @internal */
40232
40355
  ts.buildOpts = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), ts.optionsForBuild, true);
@@ -41037,6 +41160,7 @@ var ts;
41037
41160
  return optionDefinition.type;
41038
41161
  }
41039
41162
  }
41163
+ /* @internal */
41040
41164
  function getNameOfCompilerOptionValue(value, customTypeMap) {
41041
41165
  // There is a typeMap associated with this command-line option so use it to map value back to its name
41042
41166
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41045,6 +41169,7 @@ var ts;
41045
41169
  }
41046
41170
  });
41047
41171
  }
41172
+ ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41048
41173
  function serializeCompilerOptions(options, pathOptions) {
41049
41174
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41050
41175
  }
@@ -44166,8 +44291,8 @@ var ts;
44166
44291
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
44167
44292
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
44168
44293
  if (!pathAndExtension && packageInfo
44169
- && packageInfo.packageJsonContent.exports === undefined
44170
- && packageInfo.packageJsonContent.main === undefined
44294
+ // eslint-disable-next-line no-null/no-null
44295
+ && (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
44171
44296
  && state.features & NodeResolutionFeatures.EsmMode) {
44172
44297
  // EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
44173
44298
  // a default `index.js` entrypoint if no `main` or `exports` are present
@@ -47832,7 +47957,10 @@ var ts;
47832
47957
  TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
47833
47958
  TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
47834
47959
  TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
47835
- TypeFacts[TypeFacts["All"] = 16777215] = "All";
47960
+ TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
47961
+ TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
47962
+ TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
47963
+ TypeFacts[TypeFacts["All"] = 134217727] = "All";
47836
47964
  // The following members encode facts about particular kinds of types for use in the getTypeFacts function.
47837
47965
  // The presence of a particular fact means that the given test is true for some (and possibly all) values
47838
47966
  // of that kind of type.
@@ -47874,14 +48002,16 @@ var ts;
47874
48002
  TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
47875
48003
  TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
47876
48004
  TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
47877
- TypeFacts[TypeFacts["UndefinedFacts"] = 9830144] = "UndefinedFacts";
47878
- TypeFacts[TypeFacts["NullFacts"] = 9363232] = "NullFacts";
47879
- TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
48005
+ TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
48006
+ TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
48007
+ TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
48008
+ TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
48009
+ TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
48010
+ TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
47880
48011
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
47881
- TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
47882
48012
  // Masks
47883
48013
  TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
47884
- TypeFacts[TypeFacts["AndFactsMask"] = 16768959] = "AndFactsMask";
48014
+ TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
47885
48015
  })(TypeFacts || (TypeFacts = {}));
47886
48016
  var typeofEQFacts = new ts.Map(ts.getEntries({
47887
48017
  string: 1 /* TypeofEQString */,
@@ -50045,7 +50175,12 @@ var ts;
50045
50175
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
50046
50176
  if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
50047
50177
  if (isPrimitiveTypeName(name)) {
50048
- error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50178
+ if (isExtendedByInterface(errorLocation)) {
50179
+ 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));
50180
+ }
50181
+ else {
50182
+ error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50183
+ }
50049
50184
  return true;
50050
50185
  }
50051
50186
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
@@ -50065,6 +50200,16 @@ var ts;
50065
50200
  }
50066
50201
  return false;
50067
50202
  }
50203
+ function isExtendedByInterface(node) {
50204
+ var grandparent = node.parent.parent;
50205
+ var parentOfGrandparent = grandparent.parent;
50206
+ if (grandparent && parentOfGrandparent) {
50207
+ var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
50208
+ var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
50209
+ return isExtending && isInterface;
50210
+ }
50211
+ return false;
50212
+ }
50068
50213
  function maybeMappedType(node, symbol) {
50069
50214
  var container = ts.findAncestor(node.parent, function (n) {
50070
50215
  return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
@@ -52905,7 +53050,7 @@ var ts;
52905
53050
  anyType : getNonMissingTypeOfSymbol(propertySymbol);
52906
53051
  var saveEnclosingDeclaration = context.enclosingDeclaration;
52907
53052
  context.enclosingDeclaration = undefined;
52908
- if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */ && isLateBoundName(propertySymbol.escapedName)) {
53053
+ if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
52909
53054
  if (propertySymbol.declarations) {
52910
53055
  var decl = ts.first(propertySymbol.declarations);
52911
53056
  if (hasLateBindableName(decl)) {
@@ -54589,7 +54734,7 @@ var ts;
54589
54734
  ? getBaseConstructorTypeOfClass(staticType)
54590
54735
  : anyType;
54591
54736
  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);
54592
- var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
54737
+ var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
54593
54738
  var publicSymbolProps = ts.filter(symbolProps, function (s) {
54594
54739
  // `valueDeclaration` could be undefined if inherited from
54595
54740
  // a union/intersection base type, but inherited properties
@@ -55727,7 +55872,7 @@ var ts;
55727
55872
  if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
55728
55873
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
55729
55874
  // undefined from the final type.
55730
- return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
55875
+ return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
55731
55876
  }
55732
55877
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
55733
55878
  }
@@ -58930,7 +59075,7 @@ var ts;
58930
59075
  var objectType;
58931
59076
  return !!(type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ &&
58932
59077
  !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
58933
- !objectType.declaration.questionToken && !objectType.declaration.nameType);
59078
+ !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
58934
59079
  }
58935
59080
  /**
58936
59081
  * For a type parameter, return the base constraint of the type parameter. For the string, number,
@@ -64222,7 +64367,7 @@ var ts;
64222
64367
  var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
64223
64368
  var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
64224
64369
  var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
64225
- (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */);
64370
+ (getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
64226
64371
  var related = callbacks ?
64227
64372
  compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
64228
64373
  !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
@@ -67440,30 +67585,8 @@ var ts;
67440
67585
  var value = _a.value;
67441
67586
  return value.base10Value === "0";
67442
67587
  }
67443
- function getFalsyFlagsOfTypes(types) {
67444
- var result = 0;
67445
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
67446
- var t = types_14[_i];
67447
- result |= getFalsyFlags(t);
67448
- }
67449
- return result;
67450
- }
67451
- // Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
67452
- // flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
67453
- // no flags for all other types (including non-falsy literal types).
67454
- function getFalsyFlags(type) {
67455
- var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
67456
- return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
67457
- t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
67458
- t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
67459
- t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
67460
- t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
67461
- t.flags & 117724 /* PossiblyFalsy */;
67462
- }
67463
67588
  function removeDefinitelyFalsyTypes(type) {
67464
- return getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ ?
67465
- filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
67466
- type;
67589
+ return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
67467
67590
  }
67468
67591
  function extractDefinitelyFalsyTypes(type) {
67469
67592
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -67506,14 +67629,7 @@ var ts;
67506
67629
  getIntersectionType([type, emptyObjectType]);
67507
67630
  }
67508
67631
  function getNonNullableType(type) {
67509
- if (strictNullChecks) {
67510
- // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
67511
- // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
67512
- // that isn't eliminated by a NonNullable<T> instantiation.
67513
- var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
67514
- return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
67515
- }
67516
- return type;
67632
+ return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
67517
67633
  }
67518
67634
  function addOptionalTypeMarker(type) {
67519
67635
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -68657,8 +68773,8 @@ var ts;
68657
68773
  }
68658
68774
  function getSingleTypeVariableFromIntersectionTypes(types) {
68659
68775
  var typeVariable;
68660
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
68661
- var type = types_15[_i];
68776
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
68777
+ var type = types_14[_i];
68662
68778
  var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
68663
68779
  if (!t || typeVariable && t !== typeVariable) {
68664
68780
  return undefined;
@@ -69411,8 +69527,8 @@ var ts;
69411
69527
  }
69412
69528
  }
69413
69529
  };
69414
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
69415
- var type = types_16[_i];
69530
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
69531
+ var type = types_15[_i];
69416
69532
  var state_9 = _loop_24(type);
69417
69533
  if (typeof state_9 === "object")
69418
69534
  return state_9.value;
@@ -69527,14 +69643,16 @@ var ts;
69527
69643
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
69528
69644
  resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
69529
69645
  }
69530
- function getTypeFacts(type, ignoreObjects) {
69531
- if (ignoreObjects === void 0) { ignoreObjects = false; }
69646
+ function getTypeFacts(type) {
69647
+ if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
69648
+ type = getBaseConstraintOfType(type) || unknownType;
69649
+ }
69532
69650
  var flags = type.flags;
69533
- if (flags & 4 /* String */) {
69651
+ if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
69534
69652
  return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
69535
69653
  }
69536
- if (flags & 128 /* StringLiteral */) {
69537
- var isEmpty = type.value === "";
69654
+ if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
69655
+ var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
69538
69656
  return strictNullChecks ?
69539
69657
  isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
69540
69658
  isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
@@ -69566,20 +69684,20 @@ var ts;
69566
69684
  (type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
69567
69685
  }
69568
69686
  if (flags & 524288 /* Object */) {
69569
- if (ignoreObjects) {
69570
- return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
69571
- }
69572
69687
  return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
69573
- strictNullChecks ? 16318463 /* EmptyObjectStrictFacts */ : 16777215 /* EmptyObjectFacts */ :
69688
+ strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
69574
69689
  isFunctionObjectType(type) ?
69575
69690
  strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
69576
69691
  strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
69577
69692
  }
69578
- if (flags & (16384 /* Void */ | 32768 /* Undefined */)) {
69579
- return 9830144 /* UndefinedFacts */;
69693
+ if (flags & 16384 /* Void */) {
69694
+ return 9830144 /* VoidFacts */;
69695
+ }
69696
+ if (flags & 32768 /* Undefined */) {
69697
+ return 26607360 /* UndefinedFacts */;
69580
69698
  }
69581
69699
  if (flags & 65536 /* Null */) {
69582
- return 9363232 /* NullFacts */;
69700
+ return 42917664 /* NullFacts */;
69583
69701
  }
69584
69702
  if (flags & 12288 /* ESSymbolLike */) {
69585
69703
  return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
@@ -69590,38 +69708,39 @@ var ts;
69590
69708
  if (flags & 131072 /* Never */) {
69591
69709
  return 0 /* None */;
69592
69710
  }
69593
- if (flags & 465829888 /* Instantiable */) {
69594
- return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
69595
- strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
69596
- }
69597
69711
  if (flags & 1048576 /* Union */) {
69598
- return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0 /* None */);
69712
+ return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
69599
69713
  }
69600
69714
  if (flags & 2097152 /* Intersection */) {
69601
- // When an intersection contains a primitive type we ignore object type constituents as they are
69602
- // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69603
- ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
69604
- return getIntersectionTypeFacts(type, ignoreObjects);
69715
+ return getIntersectionTypeFacts(type);
69605
69716
  }
69606
- return 16777215 /* All */;
69717
+ return 83886079 /* UnknownFacts */;
69607
69718
  }
69608
- function getIntersectionTypeFacts(type, ignoreObjects) {
69719
+ function getIntersectionTypeFacts(type) {
69720
+ // When an intersection contains a primitive type we ignore object type constituents as they are
69721
+ // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69722
+ var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
69609
69723
  // When computing the type facts of an intersection type, certain type facts are computed as `and`
69610
69724
  // and others are computed as `or`.
69611
69725
  var oredFacts = 0 /* None */;
69612
- var andedFacts = 16777215 /* All */;
69726
+ var andedFacts = 134217727 /* All */;
69613
69727
  for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
69614
69728
  var t = _a[_i];
69615
- var f = getTypeFacts(t, ignoreObjects);
69616
- oredFacts |= f;
69617
- andedFacts &= f;
69729
+ if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
69730
+ var f = getTypeFacts(t);
69731
+ oredFacts |= f;
69732
+ andedFacts &= f;
69733
+ }
69618
69734
  }
69619
- return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 16768959 /* AndFactsMask */;
69735
+ return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
69620
69736
  }
69621
69737
  function getTypeWithFacts(type, include) {
69622
69738
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
69623
69739
  }
69624
- function getIntersectionWithFacts(type, facts) {
69740
+ // This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
69741
+ // unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
69742
+ // instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
69743
+ function getAdjustedTypeWithFacts(type, facts) {
69625
69744
  var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
69626
69745
  if (strictNullChecks) {
69627
69746
  switch (facts) {
@@ -69887,8 +70006,8 @@ var ts;
69887
70006
  var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
69888
70007
  var mappedTypes;
69889
70008
  var changed = false;
69890
- for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
69891
- var t = types_17[_i];
70009
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
70010
+ var t = types_16[_i];
69892
70011
  var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
69893
70012
  changed || (changed = t !== mapped);
69894
70013
  if (mapped) {
@@ -69974,8 +70093,8 @@ var ts;
69974
70093
  }
69975
70094
  function isEvolvingArrayTypeList(types) {
69976
70095
  var hasEvolvingArrayType = false;
69977
- for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
69978
- var t = types_18[_i];
70096
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
70097
+ var t = types_17[_i];
69979
70098
  if (!(t.flags & 131072 /* Never */)) {
69980
70099
  if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
69981
70100
  return false;
@@ -70798,10 +70917,10 @@ var ts;
70798
70917
  }
70799
70918
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
70800
70919
  if (isMatchingReference(reference, expr)) {
70801
- return getIntersectionWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
70920
+ return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
70802
70921
  }
70803
70922
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
70804
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
70923
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
70805
70924
  }
70806
70925
  var access = getDiscriminantPropertyAccess(expr, type);
70807
70926
  if (access) {
@@ -70941,7 +71060,7 @@ var ts;
70941
71060
  // Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
70942
71061
  var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
70943
71062
  equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
70944
- return removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
71063
+ return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
70945
71064
  }
70946
71065
  function narrowTypeByEquality(type, operator, value, assumeTrue) {
70947
71066
  if (type.flags & 1 /* Any */) {
@@ -70970,7 +71089,7 @@ var ts;
70970
71089
  valueType.flags & 65536 /* Null */ ?
70971
71090
  assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
70972
71091
  assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
70973
- return getIntersectionWithFacts(type, facts);
71092
+ return getAdjustedTypeWithFacts(type, facts);
70974
71093
  }
70975
71094
  if (assumeTrue) {
70976
71095
  var filterFn = operator === 34 /* EqualsEqualsToken */ ?
@@ -70991,7 +71110,7 @@ var ts;
70991
71110
  var target = getReferenceCandidate(typeOfExpr.expression);
70992
71111
  if (!isMatchingReference(reference, target)) {
70993
71112
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
70994
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71113
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
70995
71114
  }
70996
71115
  return type;
70997
71116
  }
@@ -71195,7 +71314,7 @@ var ts;
71195
71314
  var left = getReferenceCandidate(expr.left);
71196
71315
  if (!isMatchingReference(reference, left)) {
71197
71316
  if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
71198
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71317
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71199
71318
  }
71200
71319
  return type;
71201
71320
  }
@@ -71283,7 +71402,7 @@ var ts;
71283
71402
  }
71284
71403
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
71285
71404
  !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
71286
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71405
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71287
71406
  }
71288
71407
  var access = getDiscriminantPropertyAccess(predicateArgument, type);
71289
71408
  if (access) {
@@ -71340,7 +71459,7 @@ var ts;
71340
71459
  }
71341
71460
  function narrowTypeByOptionality(type, expr, assumePresent) {
71342
71461
  if (isMatchingReference(reference, expr)) {
71343
- return getTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71462
+ return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71344
71463
  }
71345
71464
  var access = getDiscriminantPropertyAccess(expr, type);
71346
71465
  if (access) {
@@ -71426,8 +71545,8 @@ var ts;
71426
71545
  var annotationIncludesUndefined = strictNullChecks &&
71427
71546
  declaration.kind === 164 /* Parameter */ &&
71428
71547
  declaration.initializer &&
71429
- getFalsyFlags(declaredType) & 32768 /* Undefined */ &&
71430
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */);
71548
+ getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
71549
+ !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
71431
71550
  popTypeResolution();
71432
71551
  return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
71433
71552
  }
@@ -71755,7 +71874,7 @@ var ts;
71755
71874
  return convertAutoToAny(flowType);
71756
71875
  }
71757
71876
  }
71758
- else if (!assumeInitialized && !(getFalsyFlags(type) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
71877
+ else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
71759
71878
  error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
71760
71879
  // Return the declared type to reduce follow-on errors
71761
71880
  return type;
@@ -73284,8 +73403,8 @@ var ts;
73284
73403
  }
73285
73404
  var signatureList;
73286
73405
  var types = type.types;
73287
- for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
73288
- var current = types_19[_i];
73406
+ for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
73407
+ var current = types_18[_i];
73289
73408
  var signature = getContextualCallSignature(current, node);
73290
73409
  if (signature) {
73291
73410
  if (!signatureList) {
@@ -74447,19 +74566,19 @@ var ts;
74447
74566
  return checkNonNullType(checkExpression(node), node);
74448
74567
  }
74449
74568
  function isNullableType(type) {
74450
- return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */);
74569
+ return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
74451
74570
  }
74452
74571
  function getNonNullableTypeIfNeeded(type) {
74453
74572
  return isNullableType(type) ? getNonNullableType(type) : type;
74454
74573
  }
74455
- function reportObjectPossiblyNullOrUndefinedError(node, flags) {
74456
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74574
+ function reportObjectPossiblyNullOrUndefinedError(node, facts) {
74575
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74457
74576
  ts.Diagnostics.Object_is_possibly_null_or_undefined :
74458
74577
  ts.Diagnostics.Object_is_possibly_undefined :
74459
74578
  ts.Diagnostics.Object_is_possibly_null);
74460
74579
  }
74461
- function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {
74462
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74580
+ function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
74581
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74463
74582
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
74464
74583
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
74465
74584
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
@@ -74469,9 +74588,9 @@ var ts;
74469
74588
  error(node, ts.Diagnostics.Object_is_of_type_unknown);
74470
74589
  return errorType;
74471
74590
  }
74472
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */;
74473
- if (kind) {
74474
- reportError(node, kind);
74591
+ var facts = getTypeFacts(type);
74592
+ if (facts & 50331648 /* IsUndefinedOrNull */) {
74593
+ reportError(node, facts);
74475
74594
  var t = getNonNullableType(type);
74476
74595
  return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
74477
74596
  }
@@ -74766,7 +74885,7 @@ var ts;
74766
74885
  assumeUninitialized = true;
74767
74886
  }
74768
74887
  var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
74769
- if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
74888
+ if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
74770
74889
  error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
74771
74890
  // Return the declared type to reduce follow-on errors
74772
74891
  return propType;
@@ -76682,8 +76801,8 @@ var ts;
76682
76801
  if (apparentType.flags & 1048576 /* Union */) {
76683
76802
  var types = apparentType.types;
76684
76803
  var hasSignatures = false;
76685
- for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
76686
- var constituent = types_20[_i];
76804
+ for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
76805
+ var constituent = types_19[_i];
76687
76806
  var signatures = getSignaturesOfType(constituent, kind);
76688
76807
  if (signatures.length !== 0) {
76689
76808
  hasSignatures = true;
@@ -78374,7 +78493,7 @@ var ts;
78374
78493
  var type = getTypeOfSymbol(symbol);
78375
78494
  if (strictNullChecks &&
78376
78495
  !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
78377
- !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getFalsyFlags(type) & 32768 /* Undefined */)) {
78496
+ !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
78378
78497
  error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
78379
78498
  }
78380
78499
  }
@@ -78542,8 +78661,8 @@ var ts;
78542
78661
  }
78543
78662
  if (type.flags & 3145728 /* UnionOrIntersection */) {
78544
78663
  var types = type.types;
78545
- for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
78546
- var t = types_21[_i];
78664
+ for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
78665
+ var t = types_20[_i];
78547
78666
  if (maybeTypeOfKind(t, kind)) {
78548
78667
  return true;
78549
78668
  }
@@ -78770,7 +78889,7 @@ var ts;
78770
78889
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
78771
78890
  // undefined from the final type.
78772
78891
  if (strictNullChecks &&
78773
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768 /* Undefined */)) {
78892
+ !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
78774
78893
  sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
78775
78894
  }
78776
78895
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -79170,7 +79289,7 @@ var ts;
79170
79289
  case 56 /* BarBarToken */:
79171
79290
  case 75 /* BarBarEqualsToken */: {
79172
79291
  var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
79173
- getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
79292
+ getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
79174
79293
  leftType;
79175
79294
  if (operator === 75 /* BarBarEqualsToken */) {
79176
79295
  checkAssignmentOperator(rightType);
@@ -81711,8 +81830,8 @@ var ts;
81711
81830
  }
81712
81831
  function getEntityNameForDecoratorMetadataFromTypeList(types) {
81713
81832
  var commonEntityName;
81714
- for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
81715
- var typeNode = types_22[_i];
81833
+ for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
81834
+ var typeNode = types_21[_i];
81716
81835
  while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
81717
81836
  typeNode = typeNode.type; // Skip parens if need be
81718
81837
  }
@@ -82731,7 +82850,7 @@ var ts;
82731
82850
  return;
82732
82851
  var type = checkTruthinessExpression(location);
82733
82852
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
82734
- if (getFalsyFlags(type) || isPropertyExpressionCast)
82853
+ if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
82735
82854
  return;
82736
82855
  // While it technically should be invalid for any known-truthy value
82737
82856
  // to be tested, we de-scope to functions and Promises unreferenced in
@@ -84417,18 +84536,17 @@ var ts;
84417
84536
  // but not by other kinds of members.
84418
84537
  // Base class instance member variables and accessors can be overridden by
84419
84538
  // derived class instance member variables and accessors, but not by other kinds of members.
84420
- var _a, _b;
84539
+ var _a, _b, _c, _d;
84421
84540
  // NOTE: assignability is checked in checkClassDeclaration
84422
84541
  var baseProperties = getPropertiesOfType(baseType);
84423
- basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84424
- var baseProperty = baseProperties_1[_i];
84542
+ var _loop_33 = function (baseProperty) {
84425
84543
  var base = getTargetSymbol(baseProperty);
84426
84544
  if (base.flags & 4194304 /* Prototype */) {
84427
- continue;
84545
+ return "continue";
84428
84546
  }
84429
84547
  var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
84430
84548
  if (!baseSymbol) {
84431
- continue;
84549
+ return "continue";
84432
84550
  }
84433
84551
  var derived = getTargetSymbol(baseSymbol);
84434
84552
  var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
@@ -84446,14 +84564,14 @@ var ts;
84446
84564
  // Searches other base types for a declaration that would satisfy the inherited abstract member.
84447
84565
  // (The class may have more than one base type via declaration merging with an interface with the
84448
84566
  // same name.)
84449
- for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
84450
- var otherBaseType = _d[_c];
84567
+ for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
84568
+ var otherBaseType = _f[_e];
84451
84569
  if (otherBaseType === baseType)
84452
84570
  continue;
84453
84571
  var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
84454
84572
  var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
84455
84573
  if (derivedElsewhere && derivedElsewhere !== base) {
84456
- continue basePropertyCheck;
84574
+ return "continue-basePropertyCheck";
84457
84575
  }
84458
84576
  }
84459
84577
  if (derivedClassDecl.kind === 226 /* ClassExpression */) {
@@ -84468,20 +84586,19 @@ var ts;
84468
84586
  // derived overrides base.
84469
84587
  var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
84470
84588
  if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
84471
- // either base or derived property is private - not override, skip it
84472
- continue;
84589
+ return "continue";
84473
84590
  }
84474
84591
  var errorMessage = void 0;
84475
84592
  var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
84476
84593
  var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
84477
84594
  if (basePropertyFlags && derivedPropertyFlags) {
84478
84595
  // property/accessor is overridden with property/accessor
84479
- if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
84480
- || base.valueDeclaration && base.valueDeclaration.parent.kind === 258 /* InterfaceDeclaration */
84596
+ if ((ts.getCheckFlags(base) & 6 /* Synthetic */
84597
+ ? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
84598
+ : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
84599
+ || ts.getCheckFlags(base) & 262144 /* Mapped */
84481
84600
  || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
84482
- // when the base property is abstract or from an interface, base/derived flags don't need to match
84483
- // same when the derived property is from an assignment
84484
- continue;
84601
+ return "continue";
84485
84602
  }
84486
84603
  var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
84487
84604
  var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
@@ -84492,12 +84609,12 @@ var ts;
84492
84609
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
84493
84610
  }
84494
84611
  else if (useDefineForClassFields) {
84495
- var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84612
+ var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84496
84613
  if (uninitialized
84497
84614
  && !(derived.flags & 33554432 /* Transient */)
84498
84615
  && !(baseDeclarationFlags & 128 /* Abstract */)
84499
84616
  && !(derivedDeclarationFlags & 128 /* Abstract */)
84500
- && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84617
+ && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84501
84618
  var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
84502
84619
  var propName = uninitialized.name;
84503
84620
  if (uninitialized.exclamationToken
@@ -84510,13 +84627,11 @@ var ts;
84510
84627
  }
84511
84628
  }
84512
84629
  }
84513
- // correct case
84514
- continue;
84630
+ return "continue";
84515
84631
  }
84516
84632
  else if (isPrototypeProperty(base)) {
84517
84633
  if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
84518
- // method is overridden with method or property -- correct case
84519
- continue;
84634
+ return "continue";
84520
84635
  }
84521
84636
  else {
84522
84637
  ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
@@ -84531,9 +84646,20 @@ var ts;
84531
84646
  }
84532
84647
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
84533
84648
  }
84649
+ };
84650
+ basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84651
+ var baseProperty = baseProperties_1[_i];
84652
+ var state_10 = _loop_33(baseProperty);
84653
+ switch (state_10) {
84654
+ case "continue-basePropertyCheck": continue basePropertyCheck;
84655
+ }
84534
84656
  }
84535
84657
  }
84536
- function getNonInterhitedProperties(type, baseTypes, properties) {
84658
+ function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
84659
+ return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
84660
+ || ts.isInterfaceDeclaration(declaration.parent);
84661
+ }
84662
+ function getNonInheritedProperties(type, baseTypes, properties) {
84537
84663
  if (!ts.length(baseTypes)) {
84538
84664
  return properties;
84539
84665
  }
@@ -84602,7 +84728,7 @@ var ts;
84602
84728
  var propName = member.name;
84603
84729
  if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
84604
84730
  var type = getTypeOfSymbol(getSymbolOfNode(member));
84605
- if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
84731
+ if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
84606
84732
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
84607
84733
  error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
84608
84734
  }
@@ -84627,7 +84753,7 @@ var ts;
84627
84753
  ts.setParent(reference, staticBlock);
84628
84754
  reference.flowNode = staticBlock.returnFlowNode;
84629
84755
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84630
- if (!(getFalsyFlags(flowType) & 32768 /* Undefined */)) {
84756
+ if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
84631
84757
  return true;
84632
84758
  }
84633
84759
  }
@@ -84642,7 +84768,7 @@ var ts;
84642
84768
  ts.setParent(reference, constructor);
84643
84769
  reference.flowNode = constructor.returnFlowNode;
84644
84770
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84645
- return !(getFalsyFlags(flowType) & 32768 /* Undefined */);
84771
+ return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
84646
84772
  }
84647
84773
  function checkInterfaceDeclaration(node) {
84648
84774
  // Grammar checking
@@ -92930,8 +93056,8 @@ var ts;
92930
93056
  // Note when updating logic here also update getEntityNameForDecoratorMetadata
92931
93057
  // so that aliases can be marked as referenced
92932
93058
  var serializedUnion;
92933
- for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
92934
- var typeNode = types_23[_i];
93059
+ for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
93060
+ var typeNode = types_22[_i];
92935
93061
  while (typeNode.kind === 191 /* ParenthesizedType */) {
92936
93062
  typeNode = typeNode.type; // Skip parens if need be
92937
93063
  }
@@ -110326,7 +110452,8 @@ var ts;
110326
110452
  return;
110327
110453
  }
110328
110454
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
110329
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
110455
+ var buildInfo = { bundle: bundle, program: program, version: version };
110456
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
110330
110457
  }
110331
110458
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
110332
110459
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110348,7 +110475,7 @@ var ts;
110348
110475
  sourceMap: compilerOptions.sourceMap,
110349
110476
  inlineSourceMap: compilerOptions.inlineSourceMap,
110350
110477
  inlineSources: compilerOptions.inlineSources,
110351
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110478
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110352
110479
  writeBundleFileInfo: !!bundleBuildInfo,
110353
110480
  relativeToBuildInfo: relativeToBuildInfo
110354
110481
  };
@@ -110400,7 +110527,7 @@ var ts;
110400
110527
  target: compilerOptions.target,
110401
110528
  sourceMap: compilerOptions.sourceMap,
110402
110529
  inlineSourceMap: compilerOptions.inlineSourceMap,
110403
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110530
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110404
110531
  onlyPrintJsDocStyle: true,
110405
110532
  writeBundleFileInfo: !!bundleBuildInfo,
110406
110533
  recordInternalSection: !!bundleBuildInfo,
@@ -110422,7 +110549,7 @@ var ts;
110422
110549
  sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
110423
110550
  sourceRoot: compilerOptions.sourceRoot,
110424
110551
  mapRoot: compilerOptions.mapRoot,
110425
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
110552
+ extendedDiagnostics: compilerOptions.extendedDiagnostics || compilerOptions.solutionDiagnostics,
110426
110553
  // Explicitly do not passthru either `inline` option
110427
110554
  });
110428
110555
  if (forceDtsEmit && declarationTransform.transformed[0].kind === 305 /* SourceFile */) {
@@ -110480,13 +110607,18 @@ var ts;
110480
110607
  if (sourceMapFilePath) {
110481
110608
  var sourceMap = sourceMapGenerator.toString();
110482
110609
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
110610
+ if (printer.bundleFileInfo)
110611
+ printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
110483
110612
  }
110484
110613
  }
110485
110614
  else {
110486
110615
  writer.writeLine();
110487
110616
  }
110488
110617
  // Write the output file
110489
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110618
+ var text = writer.getText();
110619
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110620
+ if (printer.bundleFileInfo)
110621
+ printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
110490
110622
  // Reset state
110491
110623
  writer.clear();
110492
110624
  }
@@ -110629,34 +110761,54 @@ var ts;
110629
110761
  }
110630
110762
  /*@internal*/
110631
110763
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110764
+ var createHash = ts.maybeBind(host, host.createHash);
110632
110765
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110633
- var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110634
- if (!buildInfoText)
110766
+ var buildInfo;
110767
+ if (host.getBuildInfo) {
110768
+ var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
110769
+ if (!hostBuildInfo)
110770
+ return buildInfoPath;
110771
+ buildInfo = hostBuildInfo;
110772
+ }
110773
+ else {
110774
+ var buildInfoText = host.readFile(buildInfoPath);
110775
+ if (!buildInfoText)
110776
+ return buildInfoPath;
110777
+ buildInfo = getBuildInfo(buildInfoText);
110778
+ }
110779
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
110635
110780
  return buildInfoPath;
110636
110781
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110637
110782
  if (!jsFileText)
110638
110783
  return jsFilePath;
110784
+ if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110785
+ return jsFilePath;
110639
110786
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110640
110787
  // error if no source map or for now if inline sourcemap
110641
110788
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110642
110789
  return sourceMapFilePath || "inline sourcemap decoding";
110790
+ if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110791
+ return sourceMapFilePath;
110643
110792
  // read declaration text
110644
110793
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110645
110794
  if (declarationFilePath && !declarationText)
110646
110795
  return declarationFilePath;
110796
+ if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
110797
+ return declarationFilePath;
110647
110798
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
110648
110799
  // error if no source map or for now if inline sourcemap
110649
110800
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
110650
110801
  return declarationMapPath || "inline sourcemap decoding";
110651
- var buildInfo = getBuildInfo(buildInfoText);
110652
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110653
- return buildInfoPath;
110802
+ if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
110803
+ return declarationMapPath;
110654
110804
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
110655
110805
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
110656
110806
  /*onlyOwnText*/ true);
110657
110807
  var outputFiles = [];
110658
110808
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
110659
110809
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
110810
+ var changedDtsText;
110811
+ var changedDtsData;
110660
110812
  var emitHost = {
110661
110813
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
110662
110814
  getCanonicalFileName: host.getCanonicalFileName,
@@ -110672,7 +110824,7 @@ var ts;
110672
110824
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
110673
110825
  getProjectReferenceRedirect: ts.returnUndefined,
110674
110826
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
110675
- writeFile: function (name, text, writeByteOrderMark) {
110827
+ writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110676
110828
  switch (name) {
110677
110829
  case jsFilePath:
110678
110830
  if (jsFileText === text)
@@ -110683,8 +110835,13 @@ var ts;
110683
110835
  return;
110684
110836
  break;
110685
110837
  case buildInfoPath:
110686
- var newBuildInfo = getBuildInfo(text);
110838
+ var newBuildInfo = data.buildInfo;
110687
110839
  newBuildInfo.program = buildInfo.program;
110840
+ if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
110841
+ // Update the output signature
110842
+ newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
110843
+ newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
110844
+ }
110688
110845
  // Update sourceFileInfo
110689
110846
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
110690
110847
  newBuildInfo.bundle.js.sources = js.sources;
@@ -110692,11 +110849,13 @@ var ts;
110692
110849
  newBuildInfo.bundle.dts.sources = dts.sources;
110693
110850
  }
110694
110851
  newBuildInfo.bundle.sourceFiles = sourceFiles;
110695
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
110852
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110696
110853
  return;
110697
110854
  case declarationFilePath:
110698
110855
  if (declarationText === text)
110699
110856
  return;
110857
+ changedDtsText = text;
110858
+ changedDtsData = data;
110700
110859
  break;
110701
110860
  case declarationMapPath:
110702
110861
  if (declarationMapText === text)
@@ -110715,6 +110874,7 @@ var ts;
110715
110874
  getSourceFileFromReference: ts.returnUndefined,
110716
110875
  redirectTargetsMap: ts.createMultiMap(),
110717
110876
  getFileIncludeReasons: ts.notImplemented,
110877
+ createHash: createHash,
110718
110878
  };
110719
110879
  emitFiles(ts.notImplementedResolver, emitHost,
110720
110880
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -113546,8 +113706,8 @@ var ts;
113546
113706
  bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
113547
113707
  writeLine();
113548
113708
  }
113549
- for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
113550
- var directive = types_24[_d];
113709
+ for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
113710
+ var directive = types_23[_d];
113551
113711
  var pos = writer.getTextPos();
113552
113712
  var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
113553
113713
  ? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
@@ -115799,12 +115959,10 @@ var ts;
115799
115959
  }
115800
115960
  ts.createCompilerHost = createCompilerHost;
115801
115961
  /*@internal*/
115802
- // TODO(shkamat): update this after reworking ts build API
115803
115962
  function createCompilerHostWorker(options, setParentNodes, system) {
115804
115963
  if (system === void 0) { system = ts.sys; }
115805
115964
  var existingDirectories = new ts.Map();
115806
115965
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
115807
- var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
115808
115966
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
115809
115967
  var text;
115810
115968
  try {
@@ -115837,7 +115995,7 @@ var ts;
115837
115995
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
115838
115996
  // the system.writeFile will do its own directory creation and
115839
115997
  // the ensureDirectoriesExist call will always be redundant.
115840
- 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); });
115998
+ 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); });
115841
115999
  ts.performance.mark("afterIOWrite");
115842
116000
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
115843
116001
  }
@@ -115847,35 +116005,6 @@ var ts;
115847
116005
  }
115848
116006
  }
115849
116007
  }
115850
- var outputFingerprints;
115851
- function writeFileWorker(fileName, data, writeByteOrderMark) {
115852
- if (!ts.isWatchSet(options) || !system.getModifiedTime) {
115853
- system.writeFile(fileName, data, writeByteOrderMark);
115854
- return;
115855
- }
115856
- if (!outputFingerprints) {
115857
- outputFingerprints = new ts.Map();
115858
- }
115859
- var hash = computeHash(data);
115860
- var mtimeBefore = system.getModifiedTime(fileName);
115861
- if (mtimeBefore) {
115862
- var fingerprint = outputFingerprints.get(fileName);
115863
- // If output has not been changed, and the file has no external modification
115864
- if (fingerprint &&
115865
- fingerprint.byteOrderMark === writeByteOrderMark &&
115866
- fingerprint.hash === hash &&
115867
- fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
115868
- return;
115869
- }
115870
- }
115871
- system.writeFile(fileName, data, writeByteOrderMark);
115872
- var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
115873
- outputFingerprints.set(fileName, {
115874
- hash: hash,
115875
- byteOrderMark: writeByteOrderMark,
115876
- mtime: mtimeAfter
115877
- });
115878
- }
115879
116008
  function getDefaultLibLocation() {
115880
116009
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
115881
116010
  }
@@ -117465,6 +117594,7 @@ var ts;
117465
117594
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
117466
117595
  redirectTargetsMap: redirectTargetsMap,
117467
117596
  getFileIncludeReasons: program.getFileIncludeReasons,
117597
+ createHash: ts.maybeBind(host, host.createHash),
117468
117598
  };
117469
117599
  }
117470
117600
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119578,13 +119708,9 @@ var ts;
119578
119708
  function createManyToManyPathMap() {
119579
119709
  function create(forward, reverse, deleted) {
119580
119710
  var map = {
119581
- clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119582
- forEach: function (fn) { return forward.forEach(fn); },
119583
119711
  getKeys: function (v) { return reverse.get(v); },
119584
119712
  getValues: function (k) { return forward.get(k); },
119585
- hasKey: function (k) { return forward.has(k); },
119586
119713
  keys: function () { return forward.keys(); },
119587
- deletedKeys: function () { return deleted; },
119588
119714
  deleteKey: function (k) {
119589
119715
  (deleted || (deleted = new ts.Set())).add(k);
119590
119716
  var set = forward.get(k);
@@ -119611,11 +119737,6 @@ var ts;
119611
119737
  });
119612
119738
  return map;
119613
119739
  },
119614
- clear: function () {
119615
- forward.clear();
119616
- reverse.clear();
119617
- deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119618
- }
119619
119740
  };
119620
119741
  return map;
119621
119742
  }
@@ -119743,18 +119864,21 @@ var ts;
119743
119864
  * Creates the state of file references and signature for the new program from oldState if it is safe
119744
119865
  */
119745
119866
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119867
+ var _a, _b, _c;
119746
119868
  var fileInfos = new ts.Map();
119747
119869
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
119748
119870
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119749
- var hasCalledUpdateShapeSignature = new ts.Set();
119750
119871
  var useOldState = canReuseOldState(referencedMap, oldState);
119751
119872
  // Ensure source files have parent pointers set
119752
119873
  newProgram.getTypeChecker();
119753
119874
  // Create the reference map, and set the file infos
119754
- for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119755
- var sourceFile = _a[_i];
119875
+ for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
119876
+ var sourceFile = _d[_i];
119756
119877
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
119757
- var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
119878
+ var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
119879
+ var signature = oldUncommitedSignature === undefined ?
119880
+ useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
119881
+ oldUncommitedSignature || undefined;
119758
119882
  if (referencedMap) {
119759
119883
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
119760
119884
  if (newReferences) {
@@ -119762,19 +119886,26 @@ var ts;
119762
119886
  }
119763
119887
  // Copy old visible to outside files map
119764
119888
  if (useOldState) {
119765
- var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
119889
+ var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
119890
+ var exportedModules = oldUncommitedExportedModules === undefined ?
119891
+ oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
119892
+ oldUncommitedExportedModules || undefined;
119766
119893
  if (exportedModules) {
119767
119894
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119768
119895
  }
119769
119896
  }
119770
119897
  }
119771
- fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
119898
+ fileInfos.set(sourceFile.resolvedPath, {
119899
+ version: version_2,
119900
+ signature: signature,
119901
+ affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
119902
+ impliedFormat: sourceFile.impliedNodeFormat
119903
+ });
119772
119904
  }
119773
119905
  return {
119774
119906
  fileInfos: fileInfos,
119775
119907
  referencedMap: referencedMap,
119776
119908
  exportedModulesMap: exportedModulesMap,
119777
- hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
119778
119909
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
119779
119910
  };
119780
119911
  }
@@ -119788,71 +119919,42 @@ var ts;
119788
119919
  }
119789
119920
  BuilderState.releaseCache = releaseCache;
119790
119921
  /**
119791
- * Creates a clone of the state
119922
+ * Gets the files affected by the path from the program
119792
119923
  */
119793
- function clone(state) {
119924
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
119794
119925
  var _a, _b;
119795
- // Dont need to backup allFiles info since its cache anyway
119796
- return {
119797
- fileInfos: new ts.Map(state.fileInfos),
119798
- referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
119799
- exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
119800
- hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
119801
- useFileVersionAsSignature: state.useFileVersionAsSignature,
119802
- };
119926
+ var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
119927
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119928
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119929
+ return result;
119803
119930
  }
119804
- BuilderState.clone = clone;
119805
- /**
119806
- * Gets the files affected by the path from the program
119807
- */
119808
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
119809
- // Since the operation could be cancelled, the signatures are always stored in the cache
119810
- // They will be committed once it is safe to use them
119811
- // eg when calling this api from tsserver, if there is no cancellation of the operation
119812
- // In the other cases the affected files signatures are committed only after the iteration through the result is complete
119813
- var signatureCache = cacheToUpdateSignature || new ts.Map();
119931
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119932
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
119814
119933
  var sourceFile = programOfThisState.getSourceFileByPath(path);
119815
119934
  if (!sourceFile) {
119816
119935
  return ts.emptyArray;
119817
119936
  }
119818
- if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
119937
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
119819
119938
  return [sourceFile];
119820
119939
  }
119821
- var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
119822
- if (!cacheToUpdateSignature) {
119823
- // Commit all the signatures in the signature cache
119824
- updateSignaturesFromCache(state, signatureCache);
119825
- }
119826
- return result;
119940
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
119827
119941
  }
119828
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119829
- /**
119830
- * Updates the signatures from the cache into state's fileinfo signatures
119831
- * This should be called whenever it is safe to commit the state of the builder
119832
- */
119833
- function updateSignaturesFromCache(state, signatureCache) {
119834
- signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
119835
- }
119836
- BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
119942
+ BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
119837
119943
  function updateSignatureOfFile(state, signature, path) {
119838
119944
  state.fileInfos.get(path).signature = signature;
119839
- state.hasCalledUpdateShapeSignature.add(path);
119945
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
119840
119946
  }
119841
119947
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
119842
119948
  /**
119843
119949
  * Returns if the shape of the signature has changed since last emit
119844
119950
  */
119845
- function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
119951
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
119952
+ var _a;
119846
119953
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
119847
- ts.Debug.assert(!!sourceFile);
119848
- ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
119849
119954
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
119850
- if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
119955
+ if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
119851
119956
  return false;
119852
- }
119853
119957
  var info = state.fileInfos.get(sourceFile.resolvedPath);
119854
- if (!info)
119855
- return ts.Debug.fail();
119856
119958
  var prevSignature = info.signature;
119857
119959
  var latestSignature;
119858
119960
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -119863,45 +119965,55 @@ var ts;
119863
119965
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
119864
119966
  if (firstDts_1) {
119865
119967
  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; })); });
119866
- latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
119867
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119868
- updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
119968
+ latestSignature = computeSignature(firstDts_1.text, computeHash);
119969
+ if (latestSignature !== prevSignature) {
119970
+ updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
119869
119971
  }
119870
119972
  }
119871
119973
  }
119872
119974
  // Default is to use file version as signature
119873
119975
  if (latestSignature === undefined) {
119874
119976
  latestSignature = sourceFile.version;
119875
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119977
+ if (state.exportedModulesMap && latestSignature !== prevSignature) {
119978
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119876
119979
  // All the references in this file are exported
119877
119980
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
119878
119981
  if (references) {
119879
- exportedModulesMapCache.set(sourceFile.resolvedPath, references);
119982
+ state.exportedModulesMap.set(sourceFile.resolvedPath, references);
119880
119983
  }
119881
119984
  else {
119882
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119985
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119883
119986
  }
119884
119987
  }
119885
119988
  }
119886
- cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
119989
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
119990
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
119991
+ info.signature = latestSignature;
119887
119992
  return latestSignature !== prevSignature;
119888
119993
  }
119889
119994
  BuilderState.updateShapeSignature = updateShapeSignature;
119995
+ function computeSignature(text, computeHash) {
119996
+ return (computeHash || ts.generateDjb2Hash)(text);
119997
+ }
119998
+ BuilderState.computeSignature = computeSignature;
119890
119999
  /**
119891
120000
  * Coverts the declaration emit result into exported modules map
119892
120001
  */
119893
- function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
120002
+ function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
120003
+ if (!state.exportedModulesMap)
120004
+ return;
120005
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119894
120006
  if (!exportedModulesFromDeclarationEmit) {
119895
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120007
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119896
120008
  return;
119897
120009
  }
119898
120010
  var exportedModules;
119899
120011
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
119900
120012
  if (exportedModules) {
119901
- exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
120013
+ state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119902
120014
  }
119903
120015
  else {
119904
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120016
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119905
120017
  }
119906
120018
  function addExportedModule(exportedModulePaths) {
119907
120019
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -119913,19 +120025,6 @@ var ts;
119913
120025
  }
119914
120026
  }
119915
120027
  BuilderState.updateExportedModules = updateExportedModules;
119916
- /**
119917
- * Updates the exported modules from cache into state's exported modules map
119918
- * This should be called whenever it is safe to commit the state of the builder
119919
- */
119920
- function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
119921
- var _a;
119922
- if (exportedModulesMapCache) {
119923
- ts.Debug.assert(!!state.exportedModulesMap);
119924
- (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
119925
- exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
119926
- }
119927
- }
119928
- BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
119929
120028
  /**
119930
120029
  * Get all the dependencies of the sourceFile
119931
120030
  */
@@ -120046,7 +120145,7 @@ var ts;
120046
120145
  /**
120047
120146
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
120048
120147
  */
120049
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
120148
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
120050
120149
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
120051
120150
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
120052
120151
  }
@@ -120066,7 +120165,7 @@ var ts;
120066
120165
  if (!seenFileNamesMap.has(currentPath)) {
120067
120166
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
120068
120167
  seenFileNamesMap.set(currentPath, currentSourceFile);
120069
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
120168
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
120070
120169
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
120071
120170
  }
120072
120171
  }
@@ -120092,32 +120191,33 @@ var ts;
120092
120191
  * Create the state so that we can iterate on changedFiles/affected files
120093
120192
  */
120094
120193
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120194
+ var _a, _b;
120095
120195
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
120096
120196
  state.program = newProgram;
120097
120197
  var compilerOptions = newProgram.getCompilerOptions();
120098
120198
  state.compilerOptions = compilerOptions;
120199
+ var outFilePath = ts.outFile(compilerOptions);
120099
120200
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
120100
- if (!ts.outFile(compilerOptions)) {
120201
+ if (!outFilePath) {
120101
120202
  state.semanticDiagnosticsPerFile = new ts.Map();
120102
120203
  }
120204
+ 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)) {
120205
+ state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
120206
+ }
120103
120207
  state.changedFilesSet = new ts.Set();
120208
+ state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
120104
120209
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
120105
120210
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
120106
120211
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
120107
120212
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
120213
+ var canCopyEmitSignatures = compilerOptions.composite &&
120214
+ (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
120215
+ !outFilePath &&
120216
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
120108
120217
  if (useOldState) {
120109
- // Verify the sanity of old state
120110
- if (!oldState.currentChangedFilePath) {
120111
- var affectedSignatures = oldState.currentAffectedFilesSignatures;
120112
- ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
120113
- }
120114
- var changedFilesSet = oldState.changedFilesSet;
120115
- if (canCopySemanticDiagnostics) {
120116
- ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
120117
- }
120118
120218
  // Copy old state's changed files set
120119
- changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
120120
- if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
120219
+ (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
120220
+ if (!outFilePath && oldState.affectedFilesPendingEmit) {
120121
120221
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
120122
120222
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
120123
120223
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -120138,6 +120238,8 @@ var ts;
120138
120238
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
120139
120239
  // versions dont match
120140
120240
  oldInfo.version !== info.version ||
120241
+ // Implied formats dont match
120242
+ oldInfo.impliedFormat !== info.impliedFormat ||
120141
120243
  // Referenced files changed
120142
120244
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
120143
120245
  // Referenced file was deleted in the new program
@@ -120161,27 +120263,25 @@ var ts;
120161
120263
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
120162
120264
  }
120163
120265
  }
120266
+ if (canCopyEmitSignatures) {
120267
+ var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
120268
+ if (oldEmitSignature)
120269
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
120270
+ }
120164
120271
  });
120165
120272
  // If the global file is removed, add all files as changed
120166
120273
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
120167
120274
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
120168
120275
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
120169
120276
  }
120170
- else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120277
+ else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120171
120278
  // Add all files to affectedFilesPendingEmit since emit changed
120172
120279
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
120173
120280
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
120174
120281
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
120175
120282
  }
120176
- if (useOldState) {
120177
- // Any time the interpretation of a source file changes, mark it as changed
120178
- ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
120179
- if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
120180
- state.changedFilesSet.add(sourceFilePath);
120181
- }
120182
- });
120183
- }
120184
- state.buildInfoEmitPending = !!state.changedFilesSet.size;
120283
+ // Since old states change files set is copied, any additional change means we would need to emit build info
120284
+ state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
120185
120285
  return state;
120186
120286
  }
120187
120287
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -120217,30 +120317,35 @@ var ts;
120217
120317
  ts.BuilderState.releaseCache(state);
120218
120318
  state.program = undefined;
120219
120319
  }
120220
- /**
120221
- * Creates a clone of the state
120222
- */
120223
- function cloneBuilderProgramState(state) {
120224
- var _a;
120225
- var newState = ts.BuilderState.clone(state);
120226
- newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
120227
- newState.changedFilesSet = new ts.Set(state.changedFilesSet);
120228
- newState.affectedFiles = state.affectedFiles;
120229
- newState.affectedFilesIndex = state.affectedFilesIndex;
120230
- newState.currentChangedFilePath = state.currentChangedFilePath;
120231
- newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
120232
- newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
120233
- newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
120234
- newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
120235
- newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
120236
- newState.program = state.program;
120237
- newState.compilerOptions = state.compilerOptions;
120238
- newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
120239
- newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
120240
- newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
120241
- newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
120242
- newState.programEmitComplete = state.programEmitComplete;
120243
- return newState;
120320
+ function backupEmitBuilderProgramState(state) {
120321
+ var outFilePath = ts.outFile(state.compilerOptions);
120322
+ // Only in --out changeFileSet is kept around till emit
120323
+ ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
120324
+ return {
120325
+ affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
120326
+ affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
120327
+ affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
120328
+ seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
120329
+ programEmitComplete: state.programEmitComplete,
120330
+ emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
120331
+ outSignature: state.outSignature,
120332
+ dtsChangeTime: state.dtsChangeTime,
120333
+ hasChangedEmitSignature: state.hasChangedEmitSignature,
120334
+ changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
120335
+ };
120336
+ }
120337
+ function restoreEmitBuilderProgramState(state, backupEmitState) {
120338
+ state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
120339
+ state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
120340
+ state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
120341
+ state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
120342
+ state.programEmitComplete = backupEmitState.programEmitComplete;
120343
+ state.emitSignatures = backupEmitState.emitSignatures;
120344
+ state.outSignature = backupEmitState.outSignature;
120345
+ state.dtsChangeTime = backupEmitState.dtsChangeTime;
120346
+ state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
120347
+ if (backupEmitState.changedFilesSet)
120348
+ state.changedFilesSet = backupEmitState.changedFilesSet;
120244
120349
  }
120245
120350
  /**
120246
120351
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -120255,7 +120360,7 @@ var ts;
120255
120360
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
120256
120361
  */
120257
120362
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
120258
- var _a;
120363
+ var _a, _b;
120259
120364
  while (true) {
120260
120365
  var affectedFiles = state.affectedFiles;
120261
120366
  if (affectedFiles) {
@@ -120275,10 +120380,8 @@ var ts;
120275
120380
  state.changedFilesSet.delete(state.currentChangedFilePath);
120276
120381
  state.currentChangedFilePath = undefined;
120277
120382
  // Commit the changes in file signature
120278
- ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
120279
- state.currentAffectedFilesSignatures.clear();
120280
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120281
- (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
120383
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
120384
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120282
120385
  state.affectedFiles = undefined;
120283
120386
  }
120284
120387
  // Get next changed file
@@ -120296,12 +120399,7 @@ var ts;
120296
120399
  return program;
120297
120400
  }
120298
120401
  // Get next batch of affected files
120299
- if (!state.currentAffectedFilesSignatures)
120300
- state.currentAffectedFilesSignatures = new ts.Map();
120301
- if (state.exportedModulesMap) {
120302
- state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
120303
- }
120304
- state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
120402
+ state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
120305
120403
  state.currentChangedFilePath = nextKey.value;
120306
120404
  state.affectedFilesIndex = 0;
120307
120405
  if (!state.seenAffectedFiles)
@@ -120353,7 +120451,6 @@ var ts;
120353
120451
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
120354
120452
  */
120355
120453
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120356
- var _a;
120357
120454
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
120358
120455
  // If affected files is everything except default library, then nothing more to do
120359
120456
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -120361,10 +120458,9 @@ var ts;
120361
120458
  // When a change affects the global scope, all files are considered to be affected without updating their signature
120362
120459
  // That means when affected file is handled, its signature can be out of date
120363
120460
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
120364
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
120461
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
120365
120462
  return;
120366
120463
  }
120367
- 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);
120368
120464
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
120369
120465
  return;
120370
120466
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -120384,7 +120480,7 @@ var ts;
120384
120480
  // This ensures that we dont later during incremental builds considering wrong signature.
120385
120481
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
120386
120482
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
120387
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
120483
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
120388
120484
  // If not dts emit, nothing more to do
120389
120485
  if (ts.getEmitDeclarations(state.compilerOptions)) {
120390
120486
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -120405,27 +120501,10 @@ var ts;
120405
120501
  return !state.semanticDiagnosticsFromOldState.size;
120406
120502
  }
120407
120503
  function isChangedSignature(state, path) {
120408
- var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
120409
- var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120504
+ var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
120505
+ var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120410
120506
  return newSignature !== oldSignature;
120411
120507
  }
120412
- function forEachKeyOfExportedModulesMap(state, filePath, fn) {
120413
- // Go through exported modules from cache first
120414
- var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
120415
- var result = keys && ts.forEachKey(keys, fn);
120416
- if (result)
120417
- return result;
120418
- // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
120419
- keys = state.exportedModulesMap.getKeys(filePath);
120420
- return keys && ts.forEachKey(keys, function (exportedFromPath) {
120421
- var _a;
120422
- // If the cache had an updated value, skip
120423
- return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
120424
- !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
120425
- fn(exportedFromPath) :
120426
- undefined;
120427
- });
120428
- }
120429
120508
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
120430
120509
  var _a;
120431
120510
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -120440,6 +120519,7 @@ var ts;
120440
120519
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
120441
120520
  */
120442
120521
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120522
+ var _a;
120443
120523
  // If there was change in signature (dts output) for the changed file,
120444
120524
  // then only we need to handle pending file emit
120445
120525
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -120466,11 +120546,10 @@ var ts;
120466
120546
  }
120467
120547
  }
120468
120548
  }
120469
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120470
120549
  var seenFileAndExportsOfFile = new ts.Set();
120471
120550
  // Go through exported modules from cache first
120472
120551
  // If exported modules has path, all files referencing file exported from are affected
120473
- forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120552
+ (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120474
120553
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
120475
120554
  return true;
120476
120555
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -120484,19 +120563,18 @@ var ts;
120484
120563
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
120485
120564
  */
120486
120565
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
120487
- var _a;
120566
+ var _a, _b;
120488
120567
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
120489
120568
  return undefined;
120490
120569
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
120491
120570
  return true;
120492
120571
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
120493
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120494
120572
  // If exported modules has path, all files referencing file exported from are affected
120495
- forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120573
+ (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120496
120574
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
120497
120575
  });
120498
120576
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
120499
- (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120577
+ (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
120500
120578
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
120501
120579
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120502
120580
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120517,12 +120595,13 @@ var ts;
120517
120595
  }
120518
120596
  else {
120519
120597
  state.seenAffectedFiles.add(affected.resolvedPath);
120598
+ // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120599
+ state.buildInfoEmitPending = true;
120520
120600
  if (emitKind !== undefined) {
120521
120601
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120522
120602
  }
120523
120603
  if (isPendingEmit) {
120524
120604
  state.affectedFilesPendingEmitIndex++;
120525
- state.buildInfoEmitPending = true;
120526
120605
  }
120527
120606
  else {
120528
120607
  state.affectedFilesIndex++;
@@ -120570,25 +120649,61 @@ var ts;
120570
120649
  }
120571
120650
  return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
120572
120651
  }
120652
+ function isProgramBundleEmitBuildInfo(info) {
120653
+ return !!ts.outFile(info.options || {});
120654
+ }
120655
+ ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
120573
120656
  /**
120574
120657
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120575
120658
  */
120576
- function getProgramBuildInfo(state, getCanonicalFileName) {
120577
- if (ts.outFile(state.compilerOptions))
120578
- return undefined;
120659
+ function getProgramBuildInfo(state, getCanonicalFileName, host) {
120660
+ var outFilePath = ts.outFile(state.compilerOptions);
120661
+ if (outFilePath && !state.compilerOptions.composite)
120662
+ return;
120579
120663
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120580
120664
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
120665
+ state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
120666
+ if (outFilePath) {
120667
+ var fileNames_1 = [];
120668
+ var fileInfos_1 = [];
120669
+ state.program.getRootFileNames().forEach(function (f) {
120670
+ var sourceFile = state.program.getSourceFile(f);
120671
+ if (!sourceFile)
120672
+ return;
120673
+ fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath));
120674
+ fileInfos_1.push(sourceFile.version);
120675
+ });
120676
+ var result_15 = {
120677
+ fileNames: fileNames_1,
120678
+ fileInfos: fileInfos_1,
120679
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
120680
+ outSignature: state.outSignature,
120681
+ dtsChangeTime: state.dtsChangeTime,
120682
+ };
120683
+ return result_15;
120684
+ }
120581
120685
  var fileNames = [];
120582
120686
  var fileNameToFileId = new ts.Map();
120583
120687
  var fileIdsList;
120584
120688
  var fileNamesToFileIdListId;
120689
+ var emitSignatures;
120585
120690
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120691
+ var _b, _c;
120586
120692
  var key = _a[0], value = _a[1];
120587
120693
  // Ensure fileId
120588
120694
  var fileId = toFileId(key);
120589
120695
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120590
- var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120591
- var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
120696
+ var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
120697
+ var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
120698
+ if (state.compilerOptions.composite) {
120699
+ var file = state.program.getSourceFileByPath(key);
120700
+ if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
120701
+ var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
120702
+ if (emitSignature !== actualSignature) {
120703
+ (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
120704
+ }
120705
+ }
120706
+ }
120592
120707
  return value.version === actualSignature ?
120593
120708
  value.affectsGlobalScope || value.impliedFormat ?
120594
120709
  // If file version is same as signature, dont serialize signature
@@ -120596,11 +120711,11 @@ var ts;
120596
120711
  // If file info only contains version and signature and both are same we can just write string
120597
120712
  value.version :
120598
120713
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120599
- signature === undefined ?
120714
+ oldSignature === undefined ?
120600
120715
  // If we havent computed signature, use fileInfo as is
120601
120716
  value :
120602
120717
  // Serialize fileInfo with new updated signature
120603
- { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120718
+ { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120604
120719
  // Signature of the FileInfo is undefined, serialize it as false
120605
120720
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120606
120721
  });
@@ -120615,17 +120730,13 @@ var ts;
120615
120730
  if (state.exportedModulesMap) {
120616
120731
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120617
120732
  var _a;
120618
- if (state.currentAffectedFilesExportedModulesMap) {
120619
- if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120620
- return undefined;
120621
- }
120622
- var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120623
- if (newValue) {
120624
- return [toFileId(key), toFileIdListId(newValue)];
120625
- }
120626
- }
120733
+ var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120627
120734
  // Not in temporary cache, use existing value
120628
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120735
+ if (oldValue === undefined)
120736
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120737
+ if (oldValue)
120738
+ return [toFileId(key), toFileIdListId(oldValue)];
120739
+ return undefined;
120629
120740
  });
120630
120741
  }
120631
120742
  var semanticDiagnosticsPerFile;
@@ -120636,9 +120747,7 @@ var ts;
120636
120747
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120637
120748
  [
120638
120749
  toFileId(key),
120639
- state.hasReusableDiagnostic ?
120640
- value :
120641
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120750
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120642
120751
  ] :
120643
120752
  toFileId(key));
120644
120753
  }
@@ -120653,16 +120762,27 @@ var ts;
120653
120762
  }
120654
120763
  }
120655
120764
  }
120656
- return {
120765
+ var changeFileSet;
120766
+ if (state.changedFilesSet.size) {
120767
+ for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
120768
+ var path = _e[_d];
120769
+ (changeFileSet || (changeFileSet = [])).push(toFileId(path));
120770
+ }
120771
+ }
120772
+ var result = {
120657
120773
  fileNames: fileNames,
120658
120774
  fileInfos: fileInfos,
120659
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120775
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120660
120776
  fileIdsList: fileIdsList,
120661
120777
  referencedMap: referencedMap,
120662
120778
  exportedModulesMap: exportedModulesMap,
120663
120779
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120664
120780
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120781
+ changeFileSet: changeFileSet,
120782
+ emitSignatures: emitSignatures,
120783
+ dtsChangeTime: state.dtsChangeTime,
120665
120784
  };
120785
+ return result;
120666
120786
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120667
120787
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120668
120788
  }
@@ -120687,24 +120807,18 @@ var ts;
120687
120807
  }
120688
120808
  return fileIdListId;
120689
120809
  }
120690
- }
120691
- function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120692
- var result;
120693
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120694
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120695
- var name = _a[_i];
120696
- var optionKey = name.toLowerCase();
120697
- var optionInfo = optionsNameMap.get(optionKey);
120698
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120699
- // We need to store `strict`, even though it won't be examined directly, so that the
120700
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120701
- optionKey === "strict" ||
120702
- // We need to store these to determine whether `lib` files need to be rechecked.
120703
- optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120704
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
120810
+ function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
120811
+ var result;
120812
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120813
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120814
+ var name = _a[_i];
120815
+ var optionInfo = optionsNameMap.get(name.toLowerCase());
120816
+ if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
120817
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
120818
+ }
120705
120819
  }
120820
+ return result;
120706
120821
  }
120707
- return result;
120708
120822
  }
120709
120823
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
120710
120824
  if (option) {
@@ -120778,6 +120892,10 @@ var ts;
120778
120892
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
120779
120893
  }
120780
120894
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
120895
+ function computeSignature(text, data, computeHash) {
120896
+ return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
120897
+ }
120898
+ ts.computeSignature = computeSignature;
120781
120899
  function createBuilderProgram(kind, _a) {
120782
120900
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
120783
120901
  // Return same program if underlying program doesnt change
@@ -120796,8 +120914,8 @@ var ts;
120796
120914
  */
120797
120915
  var computeHash = ts.maybeBind(host, host.createHash);
120798
120916
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
120799
- var backupState;
120800
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
120917
+ var backupEmitState;
120918
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
120801
120919
  // To ensure that we arent storing any references to old program or new program without state
120802
120920
  newProgram = undefined; // TODO: GH#18217
120803
120921
  oldProgram = undefined;
@@ -120805,20 +120923,20 @@ var ts;
120805
120923
  var getState = function () { return state; };
120806
120924
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
120807
120925
  builderProgram.getState = getState;
120808
- builderProgram.backupState = function () {
120809
- ts.Debug.assert(backupState === undefined);
120810
- backupState = cloneBuilderProgramState(state);
120926
+ builderProgram.backupEmitState = function () {
120927
+ ts.Debug.assert(backupEmitState === undefined);
120928
+ backupEmitState = backupEmitBuilderProgramState(state);
120811
120929
  };
120812
- builderProgram.restoreState = function () {
120813
- state = ts.Debug.checkDefined(backupState);
120814
- backupState = undefined;
120930
+ builderProgram.restoreEmitState = function () {
120931
+ restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
120932
+ backupEmitState = undefined;
120815
120933
  };
120816
120934
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
120817
120935
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
120818
120936
  builderProgram.emit = emit;
120819
120937
  builderProgram.releaseProgram = function () {
120820
120938
  releaseCache(state);
120821
- backupState = undefined;
120939
+ backupEmitState = undefined;
120822
120940
  };
120823
120941
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
120824
120942
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -120877,35 +120995,59 @@ var ts;
120877
120995
  return toAffectedFileEmitResult(state,
120878
120996
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120879
120997
  // Otherwise just affected file
120880
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120881
- getWriteFileUpdatingSignatureCallback(writeFile) :
120998
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
120999
+ getWriteFileCallback(writeFile, customTransformers) :
120882
121000
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
120883
121001
  }
120884
- function getWriteFileUpdatingSignatureCallback(writeFile) {
121002
+ function getWriteFileCallback(writeFile, customTransformers) {
120885
121003
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
120886
- var _a;
121004
+ var _a, _b, _c;
120887
121005
  if (ts.isDeclarationFileName(fileName)) {
120888
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120889
- var file = sourceFiles[0];
120890
- var info = state.fileInfos.get(file.resolvedPath);
120891
- var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
120892
- if (signature === file.version) {
120893
- var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
120894
- if (newSignature !== file.version) { // Update it
120895
- if (host.storeFilesChangingSignatureDuringEmit)
120896
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120897
- if (state.exportedModulesMap)
120898
- ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
120899
- if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
120900
- state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
121006
+ if (!ts.outFile(state.compilerOptions)) {
121007
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
121008
+ var newSignature = void 0;
121009
+ if (!customTransformers) {
121010
+ var file = sourceFiles[0];
121011
+ var info = state.fileInfos.get(file.resolvedPath);
121012
+ if (info.signature === file.version) {
121013
+ newSignature = computeSignature(text, data, computeHash);
121014
+ if (newSignature !== file.version) { // Update it
121015
+ if (host.storeFilesChangingSignatureDuringEmit)
121016
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
121017
+ if (state.exportedModulesMap)
121018
+ ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
121019
+ if (state.affectedFiles) {
121020
+ // Keep old signature so we know what to undo if cancellation happens
121021
+ var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
121022
+ if (existing === undefined)
121023
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
121024
+ info.signature = newSignature;
121025
+ }
121026
+ else {
121027
+ // These are directly commited
121028
+ info.signature = newSignature;
121029
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
121030
+ }
121031
+ }
120901
121032
  }
120902
- else {
120903
- info.signature = newSignature;
120904
- if (state.exportedModulesMap)
120905
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
121033
+ }
121034
+ if (state.compilerOptions.composite) {
121035
+ var filePath = sourceFiles[0].resolvedPath;
121036
+ var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
121037
+ newSignature || (newSignature = computeSignature(text, data, computeHash));
121038
+ if (newSignature !== oldSignature) {
121039
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
121040
+ state.hasChangedEmitSignature = true;
120906
121041
  }
120907
121042
  }
120908
121043
  }
121044
+ else if (state.compilerOptions.composite) {
121045
+ var newSignature = computeSignature(text, data, computeHash);
121046
+ if (newSignature !== state.outSignature) {
121047
+ state.outSignature = newSignature;
121048
+ state.hasChangedEmitSignature = true;
121049
+ }
121050
+ }
120909
121051
  }
120910
121052
  if (writeFile)
120911
121053
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -120970,8 +121112,8 @@ var ts;
120970
121112
  }
120971
121113
  }
120972
121114
  }
120973
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120974
- getWriteFileUpdatingSignatureCallback(writeFile) :
121115
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
121116
+ getWriteFileCallback(writeFile, customTransformers) :
120975
121117
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
120976
121118
  }
120977
121119
  /**
@@ -121060,29 +121202,58 @@ var ts;
121060
121202
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
121061
121203
  }
121062
121204
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
121063
- function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121064
- var _a;
121205
+ function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121206
+ var _a, _b, _c, _d;
121065
121207
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121066
121208
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121067
- var filePaths = program.fileNames.map(toPath);
121068
- var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121069
- var fileInfos = new ts.Map();
121070
- program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
121071
- var state = {
121072
- fileInfos: fileInfos,
121073
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121074
- referencedMap: toManyToManyPathMap(program.referencedMap),
121075
- exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121076
- 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]; }),
121077
- hasReusableDiagnostic: true,
121078
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121079
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121080
- affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121081
- };
121209
+ var state;
121210
+ var filePaths;
121211
+ var filePathsSetList;
121212
+ if (isProgramBundleEmitBuildInfo(program)) {
121213
+ state = {
121214
+ fileInfos: new ts.Map(),
121215
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121216
+ dtsChangeTime: program.dtsChangeTime,
121217
+ outSignature: program.outSignature,
121218
+ };
121219
+ }
121220
+ else {
121221
+ filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
121222
+ filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121223
+ var fileInfos_2 = new ts.Map();
121224
+ var emitSignatures_1 = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
121225
+ program.fileInfos.forEach(function (fileInfo, index) {
121226
+ var path = toFilePath(index + 1);
121227
+ var stateFileInfo = toBuilderStateFileInfo(fileInfo);
121228
+ fileInfos_2.set(path, stateFileInfo);
121229
+ if (emitSignatures_1 && stateFileInfo.signature)
121230
+ emitSignatures_1.set(path, stateFileInfo.signature);
121231
+ });
121232
+ (_d = program.emitSignatures) === null || _d === void 0 ? void 0 : _d.forEach(function (value) {
121233
+ if (ts.isNumber(value))
121234
+ emitSignatures_1.delete(toFilePath(value));
121235
+ else
121236
+ emitSignatures_1.set(toFilePath(value[0]), value[1]);
121237
+ });
121238
+ state = {
121239
+ fileInfos: fileInfos_2,
121240
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121241
+ referencedMap: toManyToManyPathMap(program.referencedMap),
121242
+ exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121243
+ 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]; }),
121244
+ hasReusableDiagnostic: true,
121245
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121246
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121247
+ affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121248
+ changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
121249
+ dtsChangeTime: program.dtsChangeTime,
121250
+ emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
121251
+ };
121252
+ }
121082
121253
  return {
121083
121254
  getState: function () { return state; },
121084
- backupState: ts.noop,
121085
- restoreState: ts.noop,
121255
+ backupEmitState: ts.noop,
121256
+ restoreEmitState: ts.noop,
121086
121257
  getProgram: ts.notImplemented,
121087
121258
  getProgramOrUndefined: ts.returnUndefined,
121088
121259
  releaseProgram: ts.noop,
@@ -121127,12 +121298,24 @@ var ts;
121127
121298
  return map;
121128
121299
  }
121129
121300
  }
121130
- ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
121301
+ ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
121302
+ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
121303
+ var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121304
+ var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121305
+ var fileInfos = new ts.Map();
121306
+ program.fileInfos.forEach(function (fileInfo, index) {
121307
+ var path = ts.toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
121308
+ var version = ts.isString(fileInfo) ? fileInfo : fileInfo.version; // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
121309
+ fileInfos.set(path, version);
121310
+ });
121311
+ return fileInfos;
121312
+ }
121313
+ ts.getBuildInfoFileVersionMap = getBuildInfoFileVersionMap;
121131
121314
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
121132
121315
  return {
121133
121316
  getState: ts.notImplemented,
121134
- backupState: ts.noop,
121135
- restoreState: ts.noop,
121317
+ backupEmitState: ts.noop,
121318
+ restoreEmitState: ts.noop,
121136
121319
  getProgram: getProgram,
121137
121320
  getProgramOrUndefined: function () { return getState().program; },
121138
121321
  releaseProgram: function () { return getState().program = undefined; },
@@ -122248,9 +122431,9 @@ var ts;
122248
122431
  if (!preferSymlinks) {
122249
122432
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
122250
122433
  // so we only need to remove them from the realpath filenames.
122251
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122252
- if (result_15)
122253
- return result_15;
122434
+ var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122435
+ if (result_16)
122436
+ return result_16;
122254
122437
  }
122255
122438
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
122256
122439
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -122270,10 +122453,10 @@ var ts;
122270
122453
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
122271
122454
  var symlinkDirectory = symlinkDirectories_1[_i];
122272
122455
  var option = ts.resolvePath(symlinkDirectory, relative);
122273
- var result_16 = cb(option, target === referenceRedirect);
122456
+ var result_17 = cb(option, target === referenceRedirect);
122274
122457
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
122275
- if (result_16)
122276
- return result_16;
122458
+ if (result_17)
122459
+ return result_17;
122277
122460
  }
122278
122461
  });
122279
122462
  });
@@ -122315,7 +122498,7 @@ var ts;
122315
122498
  });
122316
122499
  // Sort by paths closest to importing file Name directory
122317
122500
  var sortedPaths = [];
122318
- var _loop_33 = function (directory) {
122501
+ var _loop_34 = function (directory) {
122319
122502
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
122320
122503
  var pathsInDirectory;
122321
122504
  allFileNames.forEach(function (_a, fileName) {
@@ -122339,9 +122522,9 @@ var ts;
122339
122522
  };
122340
122523
  var out_directory_1;
122341
122524
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
122342
- var state_10 = _loop_33(directory);
122525
+ var state_11 = _loop_34(directory);
122343
122526
  directory = out_directory_1;
122344
- if (state_10 === "break")
122527
+ if (state_11 === "break")
122345
122528
  break;
122346
122529
  }
122347
122530
  if (allFileNames.size) {
@@ -122734,6 +122917,7 @@ var ts;
122734
122917
  if (system.clearScreen &&
122735
122918
  !options.preserveWatchOutput &&
122736
122919
  !options.extendedDiagnostics &&
122920
+ !options.solutionDiagnostics &&
122737
122921
  !options.diagnostics &&
122738
122922
  ts.contains(ts.screenStartingMessageCodes, diagnostic.code)) {
122739
122923
  system.clearScreen();
@@ -123183,6 +123367,7 @@ var ts;
123183
123367
  readDirectory: ts.maybeBind(host, host.readDirectory),
123184
123368
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
123185
123369
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
123370
+ now: ts.maybeBind(host, host.now),
123186
123371
  };
123187
123372
  function writeFile(fileName, text, writeByteOrderMark, onError) {
123188
123373
  try {
@@ -123243,6 +123428,7 @@ var ts;
123243
123428
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
123244
123429
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
123245
123430
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
123431
+ now: ts.maybeBind(system, system.now),
123246
123432
  };
123247
123433
  }
123248
123434
  ts.createProgramHost = createProgramHost;
@@ -123310,20 +123496,26 @@ var ts;
123310
123496
  var ts;
123311
123497
  (function (ts) {
123312
123498
  function readBuilderProgram(compilerOptions, host) {
123313
- if (ts.outFile(compilerOptions))
123314
- return undefined;
123315
123499
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
123316
123500
  if (!buildInfoPath)
123317
123501
  return undefined;
123318
- var content = host.readFile(buildInfoPath);
123319
- if (!content)
123320
- return undefined;
123321
- var buildInfo = ts.getBuildInfo(content);
123502
+ var buildInfo;
123503
+ if (host.getBuildInfo) {
123504
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
123505
+ if (!buildInfo)
123506
+ return undefined;
123507
+ }
123508
+ else {
123509
+ var content = host.readFile(buildInfoPath);
123510
+ if (!content)
123511
+ return undefined;
123512
+ buildInfo = ts.getBuildInfo(content);
123513
+ }
123322
123514
  if (buildInfo.version !== ts.version)
123323
123515
  return undefined;
123324
123516
  if (!buildInfo.program)
123325
123517
  return undefined;
123326
- return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123518
+ return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123327
123519
  }
123328
123520
  ts.readBuilderProgram = readBuilderProgram;
123329
123521
  function createIncrementalCompilerHost(options, system) {
@@ -123332,6 +123524,7 @@ var ts;
123332
123524
  host.createHash = ts.maybeBind(system, system.createHash);
123333
123525
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
123334
123526
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
123527
+ host.now = ts.maybeBind(system, system.now);
123335
123528
  ts.setGetSourceFileAsHashVersioned(host, system);
123336
123529
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
123337
123530
  return host;
@@ -124067,14 +124260,17 @@ var ts;
124067
124260
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
124068
124261
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
124069
124262
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
124070
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
124071
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
124072
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
124073
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
124263
+ UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
124264
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
124265
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
124266
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
124267
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
124268
+ UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 12] = "UpToDateWithInputFileText";
124074
124269
  /**
124075
124270
  * Projects with no outputs (i.e. "solution" files)
124076
124271
  */
124077
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
124272
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
124273
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
124078
124274
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
124079
124275
  function resolveConfigFileProjectName(project) {
124080
124276
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -124119,9 +124315,11 @@ var ts;
124119
124315
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
124120
124316
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
124121
124317
  }
124122
- function newer(date1, date2) {
124123
- return date2 > date1 ? date2 : date1;
124318
+ /*@internal*/
124319
+ function getCurrentTime(host) {
124320
+ return host.now ? host.now() : new Date();
124124
124321
  }
124322
+ ts.getCurrentTime = getCurrentTime;
124125
124323
  /*@internal*/
124126
124324
  function isCircularBuildOrder(buildOrder) {
124127
124325
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -124174,6 +124372,8 @@ var ts;
124174
124372
  if (ts.hasProperty(buildOptions, option.name))
124175
124373
  result[option.name] = buildOptions[option.name];
124176
124374
  });
124375
+ if (buildOptions.solutionDiagnostics)
124376
+ result.solutionDiagnostics = true;
124177
124377
  return result;
124178
124378
  }
124179
124379
  function createSolutionBuilder(host, rootNames, defaultOptions) {
@@ -124211,6 +124411,7 @@ var ts;
124211
124411
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
124212
124412
  };
124213
124413
  }
124414
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
124214
124415
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
124215
124416
  var state = {
124216
124417
  host: host,
@@ -124227,8 +124428,9 @@ var ts;
124227
124428
  resolvedConfigFilePaths: new ts.Map(),
124228
124429
  configFileCache: new ts.Map(),
124229
124430
  projectStatus: new ts.Map(),
124230
- buildInfoChecked: new ts.Map(),
124231
124431
  extendedConfigCache: new ts.Map(),
124432
+ buildInfoCache: new ts.Map(),
124433
+ outputTimeStamps: new ts.Map(),
124232
124434
  builderPrograms: new ts.Map(),
124233
124435
  diagnostics: new ts.Map(),
124234
124436
  projectPendingBuild: new ts.Map(),
@@ -124251,6 +124453,7 @@ var ts;
124251
124453
  allWatchedConfigFiles: new ts.Map(),
124252
124454
  allWatchedExtendedConfigFiles: new ts.Map(),
124253
124455
  allWatchedPackageJsonFiles: new ts.Map(),
124456
+ filesWatched: new ts.Map(),
124254
124457
  lastCachedPackageJsonLookups: new ts.Map(),
124255
124458
  timerToBuildInvalidatedProject: undefined,
124256
124459
  reportFileChangeDetected: false,
@@ -124361,11 +124564,12 @@ var ts;
124361
124564
  // Config file cache
124362
124565
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
124363
124566
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
124364
- ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
124365
124567
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
124366
124568
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
124367
124569
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
124368
124570
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
124571
+ ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
124572
+ ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
124369
124573
  // Remove watches for the program no longer in the solution
124370
124574
  if (state.watch) {
124371
124575
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -124662,21 +124866,21 @@ var ts;
124662
124866
  }
124663
124867
  function emit(writeFileCallback, cancellationToken, customTransformers) {
124664
124868
  var _a;
124665
- var _b, _c;
124869
+ var _b, _c, _d;
124666
124870
  ts.Debug.assertIsDefined(program);
124667
124871
  ts.Debug.assert(step === BuildStep.Emit);
124668
124872
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
124669
- program.backupState();
124873
+ program.backupEmitState();
124670
124874
  var declDiagnostics;
124671
124875
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
124672
124876
  var outputFiles = [];
124673
124877
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
124674
124878
  /*write*/ undefined,
124675
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
124879
+ /*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,
124676
124880
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
124677
124881
  // Don't emit .d.ts if there are decl file errors
124678
124882
  if (declDiagnostics) {
124679
- program.restoreState();
124883
+ program.restoreEmitState();
124680
124884
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
124681
124885
  return {
124682
124886
  emitSkipped: true,
@@ -124686,40 +124890,46 @@ var ts;
124686
124890
  // Actual Emit
124687
124891
  var host = state.host, compilerHost = state.compilerHost;
124688
124892
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124689
- var newestDeclarationFileContentChangedTime = minimumDate;
124690
- var anyDtsChanged = false;
124893
+ var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124691
124894
  var emitterDiagnostics = ts.createDiagnosticCollection();
124692
124895
  var emittedOutputs = new ts.Map();
124896
+ var options = program.getCompilerOptions();
124897
+ var isIncremental = ts.isIncrementalCompilation(options);
124898
+ var outputTimeStampMap;
124899
+ var now;
124693
124900
  ts.solutionPerformance.mark("beforeOutputFilesWrite");
124694
124901
  outputFiles.forEach(function (_a) {
124695
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124696
- var priorChangeTime;
124697
- if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124698
- // Check for unchanged .d.ts files
124699
- if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124700
- priorChangeTime = host.getModifiedTime(name);
124701
- }
124702
- else {
124902
+ var _b, _c;
124903
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124904
+ var path = toPath(state, name);
124905
+ emittedOutputs.set(toPath(state, name), name);
124906
+ if (buildInfo) {
124907
+ setBuildInfo(state, buildInfo, projectPath, options);
124908
+ 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)) {
124703
124909
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124704
- anyDtsChanged = true;
124705
124910
  }
124706
124911
  }
124707
- emittedOutputs.set(toPath(state, name), name);
124708
124912
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124709
- if (priorChangeTime !== undefined) {
124710
- newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
124913
+ if (!isIncremental && state.watch) {
124914
+ (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124711
124915
  }
124712
124916
  });
124713
124917
  ts.solutionPerformance.mark("afterOutputFilesWrite");
124714
124918
  ts.solutionPerformance.measure("OutputFilesWrite", "beforeOutputFilesWrite", "afterOutputFilesWrite");
124715
- finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124716
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124919
+ finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124717
124920
  return emitResult;
124718
124921
  }
124719
124922
  function emitBuildInfo(writeFileCallback, cancellationToken) {
124720
124923
  ts.Debug.assertIsDefined(program);
124721
124924
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
124722
- var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
124925
+ var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
124926
+ if (data === null || data === void 0 ? void 0 : data.buildInfo)
124927
+ setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
124928
+ if (writeFileCallback)
124929
+ writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
124930
+ else
124931
+ state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
124932
+ }, cancellationToken);
124723
124933
  if (emitResult.diagnostics.length) {
124724
124934
  reportErrors(state, emitResult.diagnostics);
124725
124935
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -124732,7 +124942,7 @@ var ts;
124732
124942
  step = BuildStep.QueueReferencingProjects;
124733
124943
  return emitResult;
124734
124944
  }
124735
- function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
124945
+ function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124736
124946
  var _a;
124737
124947
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
124738
124948
  if (emitDiagnostics.length) {
@@ -124743,13 +124953,11 @@ var ts;
124743
124953
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
124744
124954
  }
124745
124955
  // Update time stamps for rest of the outputs
124746
- var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124956
+ updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124747
124957
  state.diagnostics.delete(projectPath);
124748
124958
  state.projectStatus.set(projectPath, {
124749
124959
  type: ts.UpToDateStatusType.UpToDate,
124750
- newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124751
- maximumDate :
124752
- newestDeclarationFileContentChangedTime,
124960
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124753
124961
  oldestOutputFileName: oldestOutputFileName
124754
124962
  });
124755
124963
  afterProgramDone(state, program, config);
@@ -124784,13 +124992,21 @@ var ts;
124784
124992
  ts.Debug.assert(!!outputFiles.length);
124785
124993
  var emitterDiagnostics = ts.createDiagnosticCollection();
124786
124994
  var emittedOutputs = new ts.Map();
124995
+ var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124996
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
124787
124997
  outputFiles.forEach(function (_a) {
124788
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124998
+ var _b, _c;
124999
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124789
125000
  emittedOutputs.set(toPath(state, name), name);
125001
+ if (buildInfo) {
125002
+ setBuildInfo(state, buildInfo, projectPath, config.options);
125003
+ if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
125004
+ resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
125005
+ }
125006
+ }
124790
125007
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124791
125008
  });
124792
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124793
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
125009
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
124794
125010
  return { emitSkipped: false, diagnostics: emitDiagnostics };
124795
125011
  }
124796
125012
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -124896,7 +125112,7 @@ var ts;
124896
125112
  }
124897
125113
  continue;
124898
125114
  }
124899
- if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
125115
+ if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts.UpToDateStatusType.UpToDateWithInputFileText) {
124900
125116
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
124901
125117
  return {
124902
125118
  kind: InvalidatedProjectKind.UpdateOutputFileStamps,
@@ -124982,7 +125198,7 @@ var ts;
124982
125198
  state.projectCompilerOptions = state.baseCompilerOptions;
124983
125199
  }
124984
125200
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
124985
- var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
125201
+ var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
124986
125202
  reportAndStoreErrors(state, resolvedPath, diagnostics);
124987
125203
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
124988
125204
  if (canEmitBuildInfo)
@@ -124990,9 +125206,101 @@ var ts;
124990
125206
  afterProgramDone(state, program, config);
124991
125207
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
124992
125208
  }
125209
+ function isFileWatcherWithModifiedTime(value) {
125210
+ return !!value.watcher;
125211
+ }
125212
+ function getModifiedTime(state, fileName) {
125213
+ var path = toPath(state, fileName);
125214
+ var existing = state.filesWatched.get(path);
125215
+ if (state.watch && !!existing) {
125216
+ if (!isFileWatcherWithModifiedTime(existing))
125217
+ return existing;
125218
+ if (existing.modifiedTime)
125219
+ return existing.modifiedTime;
125220
+ }
125221
+ var result = ts.getModifiedTime(state.host, fileName);
125222
+ if (state.watch) {
125223
+ if (existing)
125224
+ existing.modifiedTime = result;
125225
+ else
125226
+ state.filesWatched.set(path, result);
125227
+ }
125228
+ return result;
125229
+ }
125230
+ function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
125231
+ var path = toPath(state, file);
125232
+ var existing = state.filesWatched.get(path);
125233
+ if (existing && isFileWatcherWithModifiedTime(existing)) {
125234
+ existing.callbacks.push(callback);
125235
+ }
125236
+ else {
125237
+ var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
125238
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125239
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125240
+ existing.modifiedTime = modifiedTime;
125241
+ existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
125242
+ }, pollingInterval, options, watchType, project);
125243
+ state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
125244
+ }
125245
+ return {
125246
+ close: function () {
125247
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125248
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125249
+ if (existing.callbacks.length === 1) {
125250
+ state.filesWatched.delete(path);
125251
+ ts.closeFileWatcherOf(existing);
125252
+ }
125253
+ else {
125254
+ ts.unorderedRemoveItem(existing.callbacks, callback);
125255
+ }
125256
+ }
125257
+ };
125258
+ }
125259
+ function getOutputTimeStampMap(state, resolvedConfigFilePath) {
125260
+ if (!state.watch)
125261
+ return undefined;
125262
+ var result = state.outputTimeStamps.get(resolvedConfigFilePath);
125263
+ if (!result)
125264
+ state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
125265
+ return result;
125266
+ }
125267
+ function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
125268
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125269
+ var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
125270
+ if (existing) {
125271
+ existing.buildInfo = buildInfo;
125272
+ existing.modifiedTime = getCurrentTime(state.host);
125273
+ }
125274
+ else {
125275
+ state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
125276
+ }
125277
+ }
125278
+ function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
125279
+ var path = toPath(state, buildInfoPath);
125280
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
125281
+ return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
125282
+ }
125283
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
125284
+ var path = toPath(state, buildInfoPath);
125285
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
125286
+ if (existing !== undefined && existing.path === path) {
125287
+ return existing.buildInfo || undefined;
125288
+ }
125289
+ ts.solutionPerformance.mark("beforeGetBuildInfo");
125290
+ ts.solutionPerformance.mark("beforeBuildInfoRead");
125291
+ var value = state.readFileWithCache(buildInfoPath);
125292
+ ts.solutionPerformance.mark("afterBuildInfoRead");
125293
+ ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125294
+ var buildInfo = value ? ts.getBuildInfo(value) : undefined;
125295
+ ts.Debug.assert(modifiedTime || !buildInfo);
125296
+ state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
125297
+ ts.solutionPerformance.mark("afterGetBuildInfo");
125298
+ ts.solutionPerformance.measure("GetBuildInfo", "beforeGetBuildInfo", "afterGetBuildInfo");
125299
+ return buildInfo;
125300
+ }
124993
125301
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
124994
125302
  // Check tsconfig time
124995
- var tsconfigTime = ts.getModifiedTime(state.host, configFile);
125303
+ var tsconfigTime = getModifiedTime(state, configFile);
124996
125304
  if (oldestOutputFileTime < tsconfigTime) {
124997
125305
  return {
124998
125306
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -125002,88 +125310,24 @@ var ts;
125002
125310
  }
125003
125311
  }
125004
125312
  function getUpToDateStatusWorker(state, project, resolvedPath) {
125005
- var force = !!state.options.force;
125006
- var newestInputFileName = undefined;
125007
- var newestInputFileTime = minimumDate;
125008
- var host = state.host;
125009
- // Get timestamps of input files
125010
- for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
125011
- var inputFile = _a[_i];
125012
- if (!host.fileExists(inputFile)) {
125013
- return {
125014
- type: ts.UpToDateStatusType.Unbuildable,
125015
- reason: inputFile + " does not exist"
125016
- };
125017
- }
125018
- if (!force) {
125019
- var inputTime = ts.getModifiedTime(host, inputFile);
125020
- if (inputTime > newestInputFileTime) {
125021
- newestInputFileName = inputFile;
125022
- newestInputFileTime = inputTime;
125023
- }
125024
- }
125025
- }
125313
+ var _a, _b, _c;
125026
125314
  // Container if no files are specified in the project
125027
125315
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
125028
125316
  return {
125029
125317
  type: ts.UpToDateStatusType.ContainerOnly
125030
125318
  };
125031
125319
  }
125032
- // Collect the expected outputs of this project
125033
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125034
- // Now see if all outputs are newer than the newest input
125035
- var oldestOutputFileName = "(none)";
125036
- var oldestOutputFileTime = maximumDate;
125037
- var newestOutputFileName = "(none)";
125038
- var newestOutputFileTime = minimumDate;
125039
- var missingOutputFileName;
125040
- var newestDeclarationFileContentChangedTime = minimumDate;
125041
- var isOutOfDateWithInputs = false;
125042
- if (!force) {
125043
- for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
125044
- var output = outputs_1[_b];
125045
- // Output is missing; can stop checking
125046
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125047
- if (!host.fileExists(output)) {
125048
- missingOutputFileName = output;
125049
- break;
125050
- }
125051
- var outputTime = ts.getModifiedTime(host, output);
125052
- if (outputTime < oldestOutputFileTime) {
125053
- oldestOutputFileTime = outputTime;
125054
- oldestOutputFileName = output;
125055
- }
125056
- // If an output is older than the newest input, we can stop checking
125057
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125058
- if (outputTime < newestInputFileTime) {
125059
- isOutOfDateWithInputs = true;
125060
- break;
125061
- }
125062
- if (outputTime > newestOutputFileTime) {
125063
- newestOutputFileTime = outputTime;
125064
- newestOutputFileName = output;
125065
- }
125066
- // Keep track of when the most recent time a .d.ts file was changed.
125067
- // In addition to file timestamps, we also keep track of when a .d.ts file
125068
- // had its file touched but not had its contents changed - this allows us
125069
- // to skip a downstream typecheck
125070
- if (ts.isDeclarationFileName(output)) {
125071
- var outputModifiedTime = ts.getModifiedTime(host, output);
125072
- newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
125073
- }
125074
- }
125075
- }
125076
- var pseudoUpToDate = false;
125077
- var usesPrepend = false;
125078
- var upstreamChangedProject;
125320
+ // Fast check to see if reference projects are buildable
125321
+ var referenceStatuses;
125322
+ var force = !!state.options.force;
125079
125323
  if (project.projectReferences) {
125080
125324
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
125081
- for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
125082
- var ref = _d[_c];
125083
- usesPrepend = usesPrepend || !!(ref.prepend);
125325
+ for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
125326
+ var ref = _d[_i];
125084
125327
  var resolvedRef = ts.resolveProjectReferencePath(ref);
125085
125328
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
125086
- var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
125329
+ var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
125330
+ var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
125087
125331
  // Its a circular reference ignore the status of this project
125088
125332
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
125089
125333
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -125105,78 +125349,188 @@ var ts;
125105
125349
  upstreamProjectName: ref.path
125106
125350
  };
125107
125351
  }
125108
- // Check oldest output file name only if there is no missing output file name
125109
- // (a check we will have skipped if this is a forced build)
125110
- if (!force && !missingOutputFileName) {
125111
- // If the upstream project's newest file is older than our oldest output, we
125112
- // can't be out of date because of it
125113
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125114
- continue;
125115
- }
125116
- // If the upstream project has only change .d.ts files, and we've built
125117
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125118
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125119
- pseudoUpToDate = true;
125120
- upstreamChangedProject = ref.path;
125121
- continue;
125122
- }
125123
- // We have an output older than an upstream output - we are out of date
125124
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125352
+ if (!force)
125353
+ (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
125354
+ }
125355
+ }
125356
+ if (force)
125357
+ return { type: ts.UpToDateStatusType.ForceBuild };
125358
+ // Check buildinfo first
125359
+ var host = state.host;
125360
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125361
+ var oldestOutputFileName = "(none)";
125362
+ var oldestOutputFileTime = maximumDate;
125363
+ var buildInfoTime;
125364
+ var buildInfoProgram;
125365
+ var buildInfoVersionMap;
125366
+ var newestDeclarationFileContentChangedTime;
125367
+ if (buildInfoPath) {
125368
+ var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
125369
+ buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
125370
+ if (buildInfoTime === ts.missingFileModifiedTime) {
125371
+ if (!buildInfoCacheEntry_1) {
125372
+ state.buildInfoCache.set(resolvedPath, {
125373
+ path: toPath(state, buildInfoPath),
125374
+ buildInfo: false,
125375
+ modifiedTime: buildInfoTime
125376
+ });
125377
+ }
125378
+ return {
125379
+ type: ts.UpToDateStatusType.OutputMissing,
125380
+ missingOutputFileName: buildInfoPath
125381
+ };
125382
+ }
125383
+ var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
125384
+ if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125385
+ return {
125386
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125387
+ version: buildInfo.version
125388
+ };
125389
+ }
125390
+ if (buildInfo.program) {
125391
+ if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
125392
+ (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
125125
125393
  return {
125126
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125127
- outOfDateOutputFileName: oldestOutputFileName,
125128
- newerProjectName: ref.path
125394
+ type: ts.UpToDateStatusType.OutOfDateBuildInfo,
125395
+ buildInfoFile: buildInfoPath
125129
125396
  };
125130
125397
  }
125398
+ buildInfoProgram = buildInfo.program;
125131
125399
  }
125400
+ oldestOutputFileTime = buildInfoTime;
125401
+ oldestOutputFileName = buildInfoPath;
125402
+ newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
125132
125403
  }
125133
- if (missingOutputFileName !== undefined) {
125134
- return {
125135
- type: ts.UpToDateStatusType.OutputMissing,
125136
- missingOutputFileName: missingOutputFileName
125137
- };
125404
+ // Check input files
125405
+ var newestInputFileName = undefined;
125406
+ var newestInputFileTime = minimumDate;
125407
+ var pseudoInputUptodate = false;
125408
+ // Get timestamps of input files
125409
+ for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
125410
+ var inputFile = _f[_e];
125411
+ var inputTime = getModifiedTime(state, inputFile);
125412
+ if (inputTime === ts.missingFileModifiedTime) {
125413
+ return {
125414
+ type: ts.UpToDateStatusType.Unbuildable,
125415
+ reason: inputFile + " does not exist"
125416
+ };
125417
+ }
125418
+ // If an buildInfo is older than the newest input, we can stop checking
125419
+ if (buildInfoTime && buildInfoTime < inputTime) {
125420
+ var version_3 = void 0;
125421
+ var currentVersion = void 0;
125422
+ if (buildInfoProgram) {
125423
+ // Read files and see if they are same, read is anyways cached
125424
+ if (!buildInfoVersionMap)
125425
+ buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
125426
+ version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
125427
+ var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
125428
+ currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
125429
+ if (version_3 && version_3 === currentVersion)
125430
+ pseudoInputUptodate = true;
125431
+ }
125432
+ if (!version_3 || version_3 !== currentVersion) {
125433
+ return {
125434
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
125435
+ outOfDateOutputFileName: buildInfoPath,
125436
+ newerInputFileName: inputFile
125437
+ };
125438
+ }
125439
+ }
125440
+ if (inputTime > newestInputFileTime) {
125441
+ newestInputFileName = inputFile;
125442
+ newestInputFileTime = inputTime;
125443
+ }
125138
125444
  }
125139
- if (isOutOfDateWithInputs) {
125140
- return {
125141
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125142
- outOfDateOutputFileName: oldestOutputFileName,
125143
- newerInputFileName: newestInputFileName
125144
- };
125445
+ // Now see if all outputs are newer than the newest input
125446
+ // Dont check output timestamps if we have buildinfo telling us output is uptodate
125447
+ if (!buildInfoPath) {
125448
+ // Collect the expected outputs of this project
125449
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125450
+ var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
125451
+ for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
125452
+ var output = outputs_1[_g];
125453
+ var path = toPath(state, output);
125454
+ // Output is missing; can stop checking
125455
+ var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
125456
+ if (!outputTime) {
125457
+ outputTime = ts.getModifiedTime(state.host, output);
125458
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
125459
+ }
125460
+ if (outputTime === ts.missingFileModifiedTime) {
125461
+ return {
125462
+ type: ts.UpToDateStatusType.OutputMissing,
125463
+ missingOutputFileName: output
125464
+ };
125465
+ }
125466
+ if (outputTime < oldestOutputFileTime) {
125467
+ oldestOutputFileTime = outputTime;
125468
+ oldestOutputFileName = output;
125469
+ }
125470
+ // If an output is older than the newest input, we can stop checking
125471
+ if (outputTime < newestInputFileTime) {
125472
+ return {
125473
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
125474
+ outOfDateOutputFileName: oldestOutputFileName,
125475
+ newerInputFileName: newestInputFileName
125476
+ };
125477
+ }
125478
+ }
125145
125479
  }
125146
- else {
125147
- // Check tsconfig time
125148
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125149
- if (configStatus)
125150
- return configStatus;
125151
- // Check extended config time
125152
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125153
- if (extendedConfigStatus)
125154
- return extendedConfigStatus;
125155
- // Check package file time
125156
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125157
- var path = _a[0];
125158
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125159
- });
125160
- if (dependentPackageFileStatus)
125161
- return dependentPackageFileStatus;
125162
- }
125163
- if (!force && !state.buildInfoChecked.has(resolvedPath)) {
125164
- state.buildInfoChecked.set(resolvedPath, true);
125165
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125166
- if (buildInfoPath) {
125167
- ts.solutionPerformance.mark("beforeBuildInfoRead");
125168
- var value = state.readFileWithCache(buildInfoPath);
125169
- ts.solutionPerformance.mark("afterBuildInfoRead");
125170
- ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125171
- var buildInfo = value && ts.getBuildInfo(value);
125172
- if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125480
+ var seenRefs = buildInfoPath ? new ts.Set() : undefined;
125481
+ var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
125482
+ seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
125483
+ var pseudoUpToDate = false;
125484
+ var usesPrepend = false;
125485
+ var upstreamChangedProject;
125486
+ if (referenceStatuses) {
125487
+ for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
125488
+ var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
125489
+ usesPrepend = usesPrepend || !!(ref.prepend);
125490
+ // If the upstream project's newest file is older than our oldest output, we
125491
+ // can't be out of date because of it
125492
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125493
+ continue;
125494
+ }
125495
+ // Check if tsbuildinfo path is shared, then we need to rebuild
125496
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
125173
125497
  return {
125174
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125175
- version: buildInfo.version
125498
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125499
+ outOfDateOutputFileName: buildInfoPath,
125500
+ newerProjectName: ref.path
125176
125501
  };
125177
125502
  }
125503
+ // If the upstream project has only change .d.ts files, and we've built
125504
+ // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125505
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125506
+ pseudoUpToDate = true;
125507
+ upstreamChangedProject = ref.path;
125508
+ continue;
125509
+ }
125510
+ // We have an output older than an upstream output - we are out of date
125511
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125512
+ return {
125513
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125514
+ outOfDateOutputFileName: oldestOutputFileName,
125515
+ newerProjectName: ref.path
125516
+ };
125178
125517
  }
125179
125518
  }
125519
+ // Check tsconfig time
125520
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125521
+ if (configStatus)
125522
+ return configStatus;
125523
+ // Check extended config time
125524
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125525
+ if (extendedConfigStatus)
125526
+ return extendedConfigStatus;
125527
+ // Check package file time
125528
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125529
+ var path = _a[0];
125530
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125531
+ });
125532
+ if (dependentPackageFileStatus)
125533
+ return dependentPackageFileStatus;
125180
125534
  if (usesPrepend && pseudoUpToDate) {
125181
125535
  return {
125182
125536
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -125186,15 +125540,37 @@ var ts;
125186
125540
  }
125187
125541
  // Up to date
125188
125542
  return {
125189
- type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
125543
+ type: pseudoUpToDate ?
125544
+ ts.UpToDateStatusType.UpToDateWithUpstreamTypes :
125545
+ pseudoInputUptodate ?
125546
+ ts.UpToDateStatusType.UpToDateWithInputFileText :
125547
+ ts.UpToDateStatusType.UpToDate,
125190
125548
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
125191
125549
  newestInputFileTime: newestInputFileTime,
125192
- newestOutputFileTime: newestOutputFileTime,
125193
125550
  newestInputFileName: newestInputFileName,
125194
- newestOutputFileName: newestOutputFileName,
125195
125551
  oldestOutputFileName: oldestOutputFileName
125196
125552
  };
125197
125553
  }
125554
+ function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
125555
+ if (seenRefs.has(resolvedRefPath))
125556
+ return false;
125557
+ seenRefs.add(resolvedRefPath);
125558
+ var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
125559
+ if (refBuildInfo.path === buildInfoCacheEntry.path)
125560
+ return true;
125561
+ if (resolvedConfig.projectReferences) {
125562
+ // Check references
125563
+ for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
125564
+ var ref = _a[_i];
125565
+ var resolvedRef = ts.resolveProjectReferencePath(ref);
125566
+ var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
125567
+ var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
125568
+ if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
125569
+ return true;
125570
+ }
125571
+ }
125572
+ return false;
125573
+ }
125198
125574
  function getUpToDateStatus(state, project, resolvedPath) {
125199
125575
  if (project === undefined) {
125200
125576
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -125210,42 +125586,69 @@ var ts;
125210
125586
  state.projectStatus.set(resolvedPath, actual);
125211
125587
  return actual;
125212
125588
  }
125213
- function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
125589
+ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
125214
125590
  if (proj.options.noEmit)
125215
- return priorNewestUpdateTime;
125591
+ return;
125592
+ var now;
125216
125593
  ts.solutionPerformance.mark("beforeUpdateOutputTimestamps");
125217
- var host = state.host;
125218
- var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125219
- if (!skipOutputs || outputs.length !== skipOutputs.size) {
125220
- var reportVerbose = !!state.options.verbose;
125221
- var now = host.now ? host.now() : new Date();
125222
- for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125223
- var file = outputs_2[_i];
125224
- if (skipOutputs && skipOutputs.has(toPath(state, file))) {
125225
- continue;
125226
- }
125227
- if (reportVerbose) {
125228
- reportVerbose = false;
125594
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
125595
+ if (buildInfoPath) {
125596
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
125597
+ if (!!state.options.verbose)
125229
125598
  reportStatus(state, verboseMessage, proj.options.configFilePath);
125599
+ state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
125600
+ getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
125601
+ }
125602
+ state.outputTimeStamps.delete(projectPath);
125603
+ }
125604
+ else {
125605
+ var host = state.host;
125606
+ var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125607
+ var outputTimeStampMap_1 = getOutputTimeStampMap(state, projectPath);
125608
+ var modifiedOutputs_1 = outputTimeStampMap_1 ? new ts.Set() : undefined;
125609
+ if (!skipOutputs || outputs.length !== skipOutputs.size) {
125610
+ var reportVerbose = !!state.options.verbose;
125611
+ for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125612
+ var file = outputs_2[_i];
125613
+ var path = toPath(state, file);
125614
+ if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
125615
+ continue;
125616
+ if (reportVerbose) {
125617
+ reportVerbose = false;
125618
+ reportStatus(state, verboseMessage, proj.options.configFilePath);
125619
+ }
125620
+ host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
125621
+ if (outputTimeStampMap_1) {
125622
+ outputTimeStampMap_1.set(path, now);
125623
+ modifiedOutputs_1.add(path);
125624
+ }
125230
125625
  }
125231
- if (ts.isDeclarationFileName(file)) {
125232
- priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
125233
- }
125234
- host.setModifiedTime(file, now);
125235
125626
  }
125627
+ // Clear out timestamps not in output list any more
125628
+ outputTimeStampMap_1 === null || outputTimeStampMap_1 === void 0 ? void 0 : outputTimeStampMap_1.forEach(function (_value, key) {
125629
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs_1.has(key))
125630
+ outputTimeStampMap_1.delete(key);
125631
+ });
125236
125632
  }
125237
125633
  ts.solutionPerformance.mark("afterUpdateOutputTimestamps");
125238
125634
  ts.solutionPerformance.measure("UpdateOutputTimestamps", "beforeUpdateOutputTimestamps", "afterUpdateOutputTimestamps");
125239
- return priorNewestUpdateTime;
125635
+ }
125636
+ function getDtsChangeTime(state, options, resolvedConfigPath) {
125637
+ var _a;
125638
+ if (!options.composite)
125639
+ return undefined;
125640
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125641
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
125642
+ 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;
125240
125643
  }
125241
125644
  function updateOutputTimestamps(state, proj, resolvedPath) {
125242
125645
  if (state.options.dry) {
125243
125646
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
125244
125647
  }
125245
- var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125648
+ updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125246
125649
  state.projectStatus.set(resolvedPath, {
125247
125650
  type: ts.UpToDateStatusType.UpToDate,
125248
- newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
125651
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
125249
125652
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
125250
125653
  });
125251
125654
  }
@@ -125291,6 +125694,7 @@ var ts;
125291
125694
  break;
125292
125695
  }
125293
125696
  // falls through
125697
+ case ts.UpToDateStatusType.UpToDateWithInputFileText:
125294
125698
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125295
125699
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
125296
125700
  if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
@@ -125351,6 +125755,13 @@ var ts;
125351
125755
  : ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
125352
125756
  }
125353
125757
  function clean(state, project, onlyReferences) {
125758
+ ts.solutionPerformance.mark("beforeClean");
125759
+ var result = cleanWorker(state, project, onlyReferences);
125760
+ ts.solutionPerformance.mark("afterClean");
125761
+ ts.solutionPerformance.measure("Clean", "beforeClean", "afterClean");
125762
+ return result;
125763
+ }
125764
+ function cleanWorker(state, project, onlyReferences) {
125354
125765
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
125355
125766
  if (!buildOrder)
125356
125767
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -125475,12 +125886,10 @@ var ts;
125475
125886
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
125476
125887
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
125477
125888
  return;
125478
- state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
125479
- invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
125480
- }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125889
+ 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));
125481
125890
  }
125482
125891
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
125483
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
125892
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
125484
125893
  var _a;
125485
125894
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
125486
125895
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -125512,7 +125921,7 @@ var ts;
125512
125921
  if (!state.watch)
125513
125922
  return;
125514
125923
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
125515
- 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); },
125924
+ 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); },
125516
125925
  onDeleteValue: ts.closeFileWatcher,
125517
125926
  });
125518
125927
  }
@@ -125520,7 +125929,7 @@ var ts;
125520
125929
  if (!state.watch || !state.lastCachedPackageJsonLookups)
125521
125930
  return;
125522
125931
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
125523
- 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); },
125932
+ 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); },
125524
125933
  onDeleteValue: ts.closeFileWatcher,
125525
125934
  });
125526
125935
  }
@@ -125653,19 +126062,18 @@ var ts;
125653
126062
  }
125654
126063
  }
125655
126064
  function reportUpToDateStatus(state, configFileName, status) {
125656
- if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125657
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125658
- }
125659
126065
  switch (status.type) {
125660
126066
  case ts.UpToDateStatusType.OutOfDateWithSelf:
125661
- 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));
126067
+ 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));
125662
126068
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
125663
- 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));
126069
+ 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));
125664
126070
  case ts.UpToDateStatusType.OutputMissing:
125665
126071
  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));
126072
+ case ts.UpToDateStatusType.OutOfDateBuildInfo:
126073
+ 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));
125666
126074
  case ts.UpToDateStatusType.UpToDate:
125667
126075
  if (status.newestInputFileTime !== undefined) {
125668
- 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 || ""));
126076
+ 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 || ""));
125669
126077
  }
125670
126078
  // Don't report anything for "up to date because it was already built" -- too verbose
125671
126079
  break;
@@ -125673,6 +126081,8 @@ var ts;
125673
126081
  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));
125674
126082
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125675
126083
  return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName));
126084
+ case ts.UpToDateStatusType.UpToDateWithInputFileText:
126085
+ 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));
125676
126086
  case ts.UpToDateStatusType.UpstreamOutOfDate:
125677
126087
  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));
125678
126088
  case ts.UpToDateStatusType.UpstreamBlocked:
@@ -125683,6 +126093,8 @@ var ts;
125683
126093
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
125684
126094
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
125685
126095
  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);
126096
+ case ts.UpToDateStatusType.ForceBuild:
126097
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125686
126098
  case ts.UpToDateStatusType.ContainerOnly:
125687
126099
  // Don't report status on "solution" projects
125688
126100
  // falls through