@typescript-deploys/pr-build 4.7.0-pr-48861-7 → 4.7.0-pr-48784-10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220427";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220429";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -3745,7 +3745,7 @@ var ts;
3745
3745
  };
3746
3746
  }
3747
3747
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
3748
- var watcher = fsWatch(dirName, 1, function (_eventName, relativeFileName) {
3748
+ var watcher = fsWatch(dirName, 1, function (_eventName, relativeFileName, modifiedTime) {
3749
3749
  if (!ts.isString(relativeFileName))
3750
3750
  return;
3751
3751
  var fileName = ts.getNormalizedAbsolutePath(relativeFileName, dirName);
@@ -3753,7 +3753,7 @@ var ts;
3753
3753
  if (callbacks) {
3754
3754
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
3755
3755
  var fileCallback = callbacks_1[_i];
3756
- fileCallback(fileName, FileWatcherEventKind.Changed);
3756
+ fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
3757
3757
  }
3758
3758
  }
3759
3759
  }, false, PollingInterval.Medium, fallbackOptions);
@@ -3805,7 +3805,7 @@ var ts;
3805
3805
  }
3806
3806
  else {
3807
3807
  cache.set(path, {
3808
- watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
3808
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
3809
3809
  refCount: 1
3810
3810
  });
3811
3811
  }
@@ -3829,7 +3829,7 @@ var ts;
3829
3829
  var newTime = modifiedTime.getTime();
3830
3830
  if (oldTime !== newTime) {
3831
3831
  watchedFile.mtime = modifiedTime;
3832
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
3832
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
3833
3833
  return true;
3834
3834
  }
3835
3835
  return false;
@@ -4043,16 +4043,17 @@ var ts;
4043
4043
  }
4044
4044
  ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
4045
4045
  function createFileWatcherCallback(callback) {
4046
- return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
4046
+ return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
4047
4047
  }
4048
4048
  ts.createFileWatcherCallback = createFileWatcherCallback;
4049
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
4050
- return function (eventName) {
4049
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
4050
+ return function (eventName, _relativeFileName, modifiedTime) {
4051
4051
  if (eventName === "rename") {
4052
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
4052
+ modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
4053
+ callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
4053
4054
  }
4054
4055
  else {
4055
- callback(fileName, FileWatcherEventKind.Changed);
4056
+ callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
4056
4057
  }
4057
4058
  };
4058
4059
  }
@@ -4071,7 +4072,7 @@ var ts;
4071
4072
  };
4072
4073
  }
4073
4074
  function createSystemWatchFunctions(_a) {
4074
- 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;
4075
+ 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;
4075
4076
  var dynamicPollingWatchFile;
4076
4077
  var fixedChunkSizePollingWatchFile;
4077
4078
  var nonPollingWatchFile;
@@ -4093,7 +4094,7 @@ var ts;
4093
4094
  case ts.WatchFileKind.FixedChunkSizePolling:
4094
4095
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, undefined, undefined);
4095
4096
  case ts.WatchFileKind.UseFsEvents:
4096
- return fsWatch(fileName, 0, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists), false, pollingInterval, ts.getFallbackOptions(options));
4097
+ return fsWatch(fileName, 0, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime), false, pollingInterval, ts.getFallbackOptions(options));
4097
4098
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
4098
4099
  if (!nonPollingWatchFile) {
4099
4100
  nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);
@@ -4250,7 +4251,6 @@ var ts;
4250
4251
  fsWatch: fsWatch,
4251
4252
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
4252
4253
  getCurrentDirectory: getCurrentDirectory,
4253
- fileExists: fileExists,
4254
4254
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
4255
4255
  directoryExists: directoryExists,
4256
4256
  getAccessibleSortedChildDirectories: function (path) { return getAccessibleFileSystemEntries(path).directories; },
@@ -4478,7 +4478,7 @@ var ts;
4478
4478
  else {
4479
4479
  eventKind = FileWatcherEventKind.Changed;
4480
4480
  }
4481
- callback(fileName, eventKind);
4481
+ callback(fileName, eventKind, curr.mtime);
4482
4482
  }
4483
4483
  }
4484
4484
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -4498,9 +4498,9 @@ var ts;
4498
4498
  watcher = undefined;
4499
4499
  }
4500
4500
  };
4501
- function invokeCallbackAndUpdateWatcher(createWatcher) {
4501
+ function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
4502
4502
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4503
- callback("rename", "");
4503
+ callback("rename", "", modifiedTime);
4504
4504
  if (watcher) {
4505
4505
  watcher.close();
4506
4506
  watcher = createWatcher();
@@ -4533,21 +4533,25 @@ var ts;
4533
4533
  }
4534
4534
  }
4535
4535
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
4536
+ var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
4536
4537
  return event === "rename" &&
4537
4538
  (!relativeName ||
4538
4539
  relativeName === lastDirectoryPart ||
4539
4540
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
4540
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
4541
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
4542
- callback(event, relativeName);
4541
+ modifiedTime === ts.missingFileModifiedTime ?
4542
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
4543
+ callback(event, relativeName, modifiedTime);
4543
4544
  }
4544
4545
  function watchPresentFileSystemEntryWithFsWatchFile() {
4545
4546
  return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
4546
4547
  }
4547
4548
  function watchMissingFileSystemEntry() {
4548
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
4549
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
4550
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
4549
+ return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
4550
+ if (eventKind === FileWatcherEventKind.Created) {
4551
+ modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
4552
+ if (modifiedTime !== ts.missingFileModifiedTime) {
4553
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
4554
+ }
4551
4555
  }
4552
4556
  }, fallbackPollingInterval, fallbackOptions);
4553
4557
  }
@@ -4686,12 +4690,17 @@ var ts;
4686
4690
  }
4687
4691
  function getModifiedTime(path) {
4688
4692
  var _a;
4693
+ var originalStackTraceLimit = Error.stackTraceLimit;
4694
+ Error.stackTraceLimit = 0;
4689
4695
  try {
4690
4696
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
4691
4697
  }
4692
4698
  catch (e) {
4693
4699
  return undefined;
4694
4700
  }
4701
+ finally {
4702
+ Error.stackTraceLimit = originalStackTraceLimit;
4703
+ }
4695
4704
  }
4696
4705
  function setModifiedTime(path, time) {
4697
4706
  try {
@@ -5456,7 +5465,7 @@ var ts;
5456
5465
  Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
5457
5466
  Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'."),
5458
5467
  Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
5459
- Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
5468
+ This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
5460
5469
  String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
5461
5470
  Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),
5462
5471
  _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),
@@ -5843,7 +5852,6 @@ var ts;
5843
5852
  A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."),
5844
5853
  Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."),
5845
5854
  Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, ts.DiagnosticCategory.Error, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),
5846
- Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
5847
5855
  Could_not_find_name_0_Did_you_mean_1: diag(2570, ts.DiagnosticCategory.Error, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"),
5848
5856
  Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
5849
5857
  A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."),
@@ -6057,6 +6065,7 @@ var ts;
6057
6065
  This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
6058
6066
  A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, ts.DiagnosticCategory.Error, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
6059
6067
  Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, ts.DiagnosticCategory.Error, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
6068
+ Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, ts.DiagnosticCategory.Error, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
6060
6069
  Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
6061
6070
  Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
6062
6071
  Class_declaration_cannot_implement_overload_list_for_0: diag(2813, ts.DiagnosticCategory.Error, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."),
@@ -6484,8 +6493,8 @@ var ts;
6484
6493
  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"),
6485
6494
  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"),
6486
6495
  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."),
6487
- 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}'"),
6488
- 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}'"),
6496
+ 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}'"),
6497
+ 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}'"),
6489
6498
  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"),
6490
6499
  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"),
6491
6500
  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"),
@@ -6529,6 +6538,8 @@ var ts;
6529
6538
  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}'."),
6530
6539
  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}'."),
6531
6540
  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."),
6541
+ 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"),
6542
+ 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"),
6532
6543
  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}'"),
6533
6544
  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."),
6534
6545
  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."),
@@ -15975,6 +15986,10 @@ var ts;
15975
15986
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
15976
15987
  }
15977
15988
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
15989
+ function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
15990
+ return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
15991
+ }
15992
+ ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
15978
15993
  function getCompilerOptionValue(options, option) {
15979
15994
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
15980
15995
  }
@@ -30687,7 +30702,8 @@ var ts;
30687
30702
  if (!comment) {
30688
30703
  comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
30689
30704
  }
30690
- return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start);
30705
+ var end = comment !== undefined ? getNodePos() : typeExpression.end;
30706
+ return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end);
30691
30707
  }
30692
30708
  function escapedTextsEqual(a, b) {
30693
30709
  while (!ts.isIdentifier(a) || !ts.isIdentifier(b)) {
@@ -31668,6 +31684,7 @@ var ts;
31668
31684
  type: "boolean",
31669
31685
  affectsSemanticDiagnostics: true,
31670
31686
  affectsEmit: true,
31687
+ affectsMultiFileEmitBuildInfo: true,
31671
31688
  category: ts.Diagnostics.Watch_and_Build_Modes,
31672
31689
  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,
31673
31690
  defaultValueDescription: false,
@@ -31701,12 +31718,39 @@ var ts;
31701
31718
  affectsSourceFile: true,
31702
31719
  affectsModuleResolution: true,
31703
31720
  affectsEmit: true,
31721
+ affectsMultiFileEmitBuildInfo: true,
31704
31722
  paramType: ts.Diagnostics.VERSION,
31705
31723
  showInSimplifiedHelpView: true,
31706
31724
  category: ts.Diagnostics.Language_and_Environment,
31707
31725
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
31708
31726
  defaultValueDescription: 0,
31709
31727
  };
31728
+ ts.moduleOptionDeclaration = {
31729
+ name: "module",
31730
+ shortName: "m",
31731
+ type: new ts.Map(ts.getEntries({
31732
+ none: ts.ModuleKind.None,
31733
+ commonjs: ts.ModuleKind.CommonJS,
31734
+ amd: ts.ModuleKind.AMD,
31735
+ system: ts.ModuleKind.System,
31736
+ umd: ts.ModuleKind.UMD,
31737
+ es6: ts.ModuleKind.ES2015,
31738
+ es2015: ts.ModuleKind.ES2015,
31739
+ es2020: ts.ModuleKind.ES2020,
31740
+ es2022: ts.ModuleKind.ES2022,
31741
+ esnext: ts.ModuleKind.ESNext,
31742
+ node12: ts.ModuleKind.Node12,
31743
+ nodenext: ts.ModuleKind.NodeNext,
31744
+ })),
31745
+ affectsModuleResolution: true,
31746
+ affectsEmit: true,
31747
+ affectsMultiFileEmitBuildInfo: true,
31748
+ paramType: ts.Diagnostics.KIND,
31749
+ showInSimplifiedHelpView: true,
31750
+ category: ts.Diagnostics.Modules,
31751
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
31752
+ defaultValueDescription: undefined,
31753
+ };
31710
31754
  var commandOptionsWithoutBuild = [
31711
31755
  {
31712
31756
  name: "all",
@@ -31767,36 +31811,13 @@ var ts;
31767
31811
  category: ts.Diagnostics.Command_line_Options,
31768
31812
  affectsSemanticDiagnostics: true,
31769
31813
  affectsEmit: true,
31814
+ affectsMultiFileEmitBuildInfo: true,
31770
31815
  isCommandLineOnly: true,
31771
31816
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
31772
31817
  defaultValueDescription: false,
31773
31818
  },
31774
31819
  ts.targetOptionDeclaration,
31775
- {
31776
- name: "module",
31777
- shortName: "m",
31778
- type: new ts.Map(ts.getEntries({
31779
- none: ts.ModuleKind.None,
31780
- commonjs: ts.ModuleKind.CommonJS,
31781
- amd: ts.ModuleKind.AMD,
31782
- system: ts.ModuleKind.System,
31783
- umd: ts.ModuleKind.UMD,
31784
- es6: ts.ModuleKind.ES2015,
31785
- es2015: ts.ModuleKind.ES2015,
31786
- es2020: ts.ModuleKind.ES2020,
31787
- es2022: ts.ModuleKind.ES2022,
31788
- esnext: ts.ModuleKind.ESNext,
31789
- node12: ts.ModuleKind.Node12,
31790
- nodenext: ts.ModuleKind.NodeNext,
31791
- })),
31792
- affectsModuleResolution: true,
31793
- affectsEmit: true,
31794
- paramType: ts.Diagnostics.KIND,
31795
- showInSimplifiedHelpView: true,
31796
- category: ts.Diagnostics.Modules,
31797
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
31798
- defaultValueDescription: undefined,
31799
- },
31820
+ ts.moduleOptionDeclaration,
31800
31821
  {
31801
31822
  name: "lib",
31802
31823
  type: "list",
@@ -31833,6 +31854,7 @@ var ts;
31833
31854
  type: jsxOptionMap,
31834
31855
  affectsSourceFile: true,
31835
31856
  affectsEmit: true,
31857
+ affectsMultiFileEmitBuildInfo: true,
31836
31858
  affectsModuleResolution: true,
31837
31859
  paramType: ts.Diagnostics.KIND,
31838
31860
  showInSimplifiedHelpView: true,
@@ -31845,6 +31867,7 @@ var ts;
31845
31867
  shortName: "d",
31846
31868
  type: "boolean",
31847
31869
  affectsEmit: true,
31870
+ affectsMultiFileEmitBuildInfo: true,
31848
31871
  showInSimplifiedHelpView: true,
31849
31872
  category: ts.Diagnostics.Emit,
31850
31873
  transpileOptionValue: undefined,
@@ -31855,6 +31878,7 @@ var ts;
31855
31878
  name: "declarationMap",
31856
31879
  type: "boolean",
31857
31880
  affectsEmit: true,
31881
+ affectsMultiFileEmitBuildInfo: true,
31858
31882
  showInSimplifiedHelpView: true,
31859
31883
  category: ts.Diagnostics.Emit,
31860
31884
  transpileOptionValue: undefined,
@@ -31865,6 +31889,7 @@ var ts;
31865
31889
  name: "emitDeclarationOnly",
31866
31890
  type: "boolean",
31867
31891
  affectsEmit: true,
31892
+ affectsMultiFileEmitBuildInfo: true,
31868
31893
  showInSimplifiedHelpView: true,
31869
31894
  category: ts.Diagnostics.Emit,
31870
31895
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -31875,6 +31900,7 @@ var ts;
31875
31900
  name: "sourceMap",
31876
31901
  type: "boolean",
31877
31902
  affectsEmit: true,
31903
+ affectsMultiFileEmitBuildInfo: true,
31878
31904
  showInSimplifiedHelpView: true,
31879
31905
  category: ts.Diagnostics.Emit,
31880
31906
  defaultValueDescription: false,
@@ -31884,6 +31910,9 @@ var ts;
31884
31910
  name: "outFile",
31885
31911
  type: "string",
31886
31912
  affectsEmit: true,
31913
+ affectsMultiFileEmitBuildInfo: true,
31914
+ affectsDeclarationPath: true,
31915
+ affectsBundleEmitBuildInfo: true,
31887
31916
  isFilePath: true,
31888
31917
  paramType: ts.Diagnostics.FILE,
31889
31918
  showInSimplifiedHelpView: true,
@@ -31895,6 +31924,8 @@ var ts;
31895
31924
  name: "outDir",
31896
31925
  type: "string",
31897
31926
  affectsEmit: true,
31927
+ affectsMultiFileEmitBuildInfo: true,
31928
+ affectsDeclarationPath: true,
31898
31929
  isFilePath: true,
31899
31930
  paramType: ts.Diagnostics.DIRECTORY,
31900
31931
  showInSimplifiedHelpView: true,
@@ -31905,6 +31936,8 @@ var ts;
31905
31936
  name: "rootDir",
31906
31937
  type: "string",
31907
31938
  affectsEmit: true,
31939
+ affectsMultiFileEmitBuildInfo: true,
31940
+ affectsDeclarationPath: true,
31908
31941
  isFilePath: true,
31909
31942
  paramType: ts.Diagnostics.LOCATION,
31910
31943
  category: ts.Diagnostics.Modules,
@@ -31915,6 +31948,8 @@ var ts;
31915
31948
  name: "composite",
31916
31949
  type: "boolean",
31917
31950
  affectsEmit: true,
31951
+ affectsMultiFileEmitBuildInfo: true,
31952
+ affectsBundleEmitBuildInfo: true,
31918
31953
  isTSConfigOnly: true,
31919
31954
  category: ts.Diagnostics.Projects,
31920
31955
  transpileOptionValue: undefined,
@@ -31925,6 +31960,8 @@ var ts;
31925
31960
  name: "tsBuildInfoFile",
31926
31961
  type: "string",
31927
31962
  affectsEmit: true,
31963
+ affectsMultiFileEmitBuildInfo: true,
31964
+ affectsBundleEmitBuildInfo: true,
31928
31965
  isFilePath: true,
31929
31966
  paramType: ts.Diagnostics.FILE,
31930
31967
  category: ts.Diagnostics.Projects,
@@ -31936,6 +31973,7 @@ var ts;
31936
31973
  name: "removeComments",
31937
31974
  type: "boolean",
31938
31975
  affectsEmit: true,
31976
+ affectsMultiFileEmitBuildInfo: true,
31939
31977
  showInSimplifiedHelpView: true,
31940
31978
  category: ts.Diagnostics.Emit,
31941
31979
  defaultValueDescription: false,
@@ -31954,6 +31992,7 @@ var ts;
31954
31992
  name: "importHelpers",
31955
31993
  type: "boolean",
31956
31994
  affectsEmit: true,
31995
+ affectsMultiFileEmitBuildInfo: true,
31957
31996
  category: ts.Diagnostics.Emit,
31958
31997
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
31959
31998
  defaultValueDescription: false,
@@ -31967,6 +32006,7 @@ var ts;
31967
32006
  })),
31968
32007
  affectsEmit: true,
31969
32008
  affectsSemanticDiagnostics: true,
32009
+ affectsMultiFileEmitBuildInfo: true,
31970
32010
  category: ts.Diagnostics.Emit,
31971
32011
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
31972
32012
  defaultValueDescription: 0,
@@ -31975,6 +32015,7 @@ var ts;
31975
32015
  name: "downlevelIteration",
31976
32016
  type: "boolean",
31977
32017
  affectsEmit: true,
32018
+ affectsMultiFileEmitBuildInfo: true,
31978
32019
  category: ts.Diagnostics.Emit,
31979
32020
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
31980
32021
  defaultValueDescription: false,
@@ -31990,6 +32031,7 @@ var ts;
31990
32031
  {
31991
32032
  name: "strict",
31992
32033
  type: "boolean",
32034
+ affectsMultiFileEmitBuildInfo: true,
31993
32035
  showInSimplifiedHelpView: true,
31994
32036
  category: ts.Diagnostics.Type_Checking,
31995
32037
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -31999,6 +32041,7 @@ var ts;
31999
32041
  name: "noImplicitAny",
32000
32042
  type: "boolean",
32001
32043
  affectsSemanticDiagnostics: true,
32044
+ affectsMultiFileEmitBuildInfo: true,
32002
32045
  strictFlag: true,
32003
32046
  category: ts.Diagnostics.Type_Checking,
32004
32047
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -32008,6 +32051,7 @@ var ts;
32008
32051
  name: "strictNullChecks",
32009
32052
  type: "boolean",
32010
32053
  affectsSemanticDiagnostics: true,
32054
+ affectsMultiFileEmitBuildInfo: true,
32011
32055
  strictFlag: true,
32012
32056
  category: ts.Diagnostics.Type_Checking,
32013
32057
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -32016,6 +32060,8 @@ var ts;
32016
32060
  {
32017
32061
  name: "strictFunctionTypes",
32018
32062
  type: "boolean",
32063
+ affectsSemanticDiagnostics: true,
32064
+ affectsMultiFileEmitBuildInfo: true,
32019
32065
  strictFlag: true,
32020
32066
  category: ts.Diagnostics.Type_Checking,
32021
32067
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -32024,6 +32070,8 @@ var ts;
32024
32070
  {
32025
32071
  name: "strictBindCallApply",
32026
32072
  type: "boolean",
32073
+ affectsSemanticDiagnostics: true,
32074
+ affectsMultiFileEmitBuildInfo: true,
32027
32075
  strictFlag: true,
32028
32076
  category: ts.Diagnostics.Type_Checking,
32029
32077
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -32033,6 +32081,7 @@ var ts;
32033
32081
  name: "strictPropertyInitialization",
32034
32082
  type: "boolean",
32035
32083
  affectsSemanticDiagnostics: true,
32084
+ affectsMultiFileEmitBuildInfo: true,
32036
32085
  strictFlag: true,
32037
32086
  category: ts.Diagnostics.Type_Checking,
32038
32087
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -32042,6 +32091,7 @@ var ts;
32042
32091
  name: "noImplicitThis",
32043
32092
  type: "boolean",
32044
32093
  affectsSemanticDiagnostics: true,
32094
+ affectsMultiFileEmitBuildInfo: true,
32045
32095
  strictFlag: true,
32046
32096
  category: ts.Diagnostics.Type_Checking,
32047
32097
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -32051,6 +32101,7 @@ var ts;
32051
32101
  name: "useUnknownInCatchVariables",
32052
32102
  type: "boolean",
32053
32103
  affectsSemanticDiagnostics: true,
32104
+ affectsMultiFileEmitBuildInfo: true,
32054
32105
  strictFlag: true,
32055
32106
  category: ts.Diagnostics.Type_Checking,
32056
32107
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -32060,6 +32111,8 @@ var ts;
32060
32111
  name: "alwaysStrict",
32061
32112
  type: "boolean",
32062
32113
  affectsSourceFile: true,
32114
+ affectsEmit: true,
32115
+ affectsMultiFileEmitBuildInfo: true,
32063
32116
  strictFlag: true,
32064
32117
  category: ts.Diagnostics.Type_Checking,
32065
32118
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -32069,6 +32122,7 @@ var ts;
32069
32122
  name: "noUnusedLocals",
32070
32123
  type: "boolean",
32071
32124
  affectsSemanticDiagnostics: true,
32125
+ affectsMultiFileEmitBuildInfo: true,
32072
32126
  category: ts.Diagnostics.Type_Checking,
32073
32127
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
32074
32128
  defaultValueDescription: false,
@@ -32077,6 +32131,7 @@ var ts;
32077
32131
  name: "noUnusedParameters",
32078
32132
  type: "boolean",
32079
32133
  affectsSemanticDiagnostics: true,
32134
+ affectsMultiFileEmitBuildInfo: true,
32080
32135
  category: ts.Diagnostics.Type_Checking,
32081
32136
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
32082
32137
  defaultValueDescription: false,
@@ -32085,6 +32140,7 @@ var ts;
32085
32140
  name: "exactOptionalPropertyTypes",
32086
32141
  type: "boolean",
32087
32142
  affectsSemanticDiagnostics: true,
32143
+ affectsMultiFileEmitBuildInfo: true,
32088
32144
  category: ts.Diagnostics.Type_Checking,
32089
32145
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
32090
32146
  defaultValueDescription: false,
@@ -32093,6 +32149,7 @@ var ts;
32093
32149
  name: "noImplicitReturns",
32094
32150
  type: "boolean",
32095
32151
  affectsSemanticDiagnostics: true,
32152
+ affectsMultiFileEmitBuildInfo: true,
32096
32153
  category: ts.Diagnostics.Type_Checking,
32097
32154
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
32098
32155
  defaultValueDescription: false,
@@ -32102,6 +32159,7 @@ var ts;
32102
32159
  type: "boolean",
32103
32160
  affectsBindDiagnostics: true,
32104
32161
  affectsSemanticDiagnostics: true,
32162
+ affectsMultiFileEmitBuildInfo: true,
32105
32163
  category: ts.Diagnostics.Type_Checking,
32106
32164
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
32107
32165
  defaultValueDescription: false,
@@ -32110,6 +32168,7 @@ var ts;
32110
32168
  name: "noUncheckedIndexedAccess",
32111
32169
  type: "boolean",
32112
32170
  affectsSemanticDiagnostics: true,
32171
+ affectsMultiFileEmitBuildInfo: true,
32113
32172
  category: ts.Diagnostics.Type_Checking,
32114
32173
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
32115
32174
  defaultValueDescription: false,
@@ -32118,6 +32177,7 @@ var ts;
32118
32177
  name: "noImplicitOverride",
32119
32178
  type: "boolean",
32120
32179
  affectsSemanticDiagnostics: true,
32180
+ affectsMultiFileEmitBuildInfo: true,
32121
32181
  category: ts.Diagnostics.Type_Checking,
32122
32182
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
32123
32183
  defaultValueDescription: false,
@@ -32125,6 +32185,8 @@ var ts;
32125
32185
  {
32126
32186
  name: "noPropertyAccessFromIndexSignature",
32127
32187
  type: "boolean",
32188
+ affectsSemanticDiagnostics: true,
32189
+ affectsMultiFileEmitBuildInfo: true,
32128
32190
  showInSimplifiedHelpView: false,
32129
32191
  category: ts.Diagnostics.Type_Checking,
32130
32192
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -32205,6 +32267,7 @@ var ts;
32205
32267
  name: "allowSyntheticDefaultImports",
32206
32268
  type: "boolean",
32207
32269
  affectsSemanticDiagnostics: true,
32270
+ affectsMultiFileEmitBuildInfo: true,
32208
32271
  category: ts.Diagnostics.Interop_Constraints,
32209
32272
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
32210
32273
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -32214,6 +32277,7 @@ var ts;
32214
32277
  type: "boolean",
32215
32278
  affectsSemanticDiagnostics: true,
32216
32279
  affectsEmit: true,
32280
+ affectsMultiFileEmitBuildInfo: true,
32217
32281
  showInSimplifiedHelpView: true,
32218
32282
  category: ts.Diagnostics.Interop_Constraints,
32219
32283
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -32230,6 +32294,7 @@ var ts;
32230
32294
  name: "allowUmdGlobalAccess",
32231
32295
  type: "boolean",
32232
32296
  affectsSemanticDiagnostics: true,
32297
+ affectsMultiFileEmitBuildInfo: true,
32233
32298
  category: ts.Diagnostics.Modules,
32234
32299
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
32235
32300
  defaultValueDescription: false,
@@ -32250,6 +32315,7 @@ var ts;
32250
32315
  name: "sourceRoot",
32251
32316
  type: "string",
32252
32317
  affectsEmit: true,
32318
+ affectsMultiFileEmitBuildInfo: true,
32253
32319
  paramType: ts.Diagnostics.LOCATION,
32254
32320
  category: ts.Diagnostics.Emit,
32255
32321
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -32258,6 +32324,7 @@ var ts;
32258
32324
  name: "mapRoot",
32259
32325
  type: "string",
32260
32326
  affectsEmit: true,
32327
+ affectsMultiFileEmitBuildInfo: true,
32261
32328
  paramType: ts.Diagnostics.LOCATION,
32262
32329
  category: ts.Diagnostics.Emit,
32263
32330
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -32266,6 +32333,7 @@ var ts;
32266
32333
  name: "inlineSourceMap",
32267
32334
  type: "boolean",
32268
32335
  affectsEmit: true,
32336
+ affectsMultiFileEmitBuildInfo: true,
32269
32337
  category: ts.Diagnostics.Emit,
32270
32338
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
32271
32339
  defaultValueDescription: false,
@@ -32274,6 +32342,7 @@ var ts;
32274
32342
  name: "inlineSources",
32275
32343
  type: "boolean",
32276
32344
  affectsEmit: true,
32345
+ affectsMultiFileEmitBuildInfo: true,
32277
32346
  category: ts.Diagnostics.Emit,
32278
32347
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
32279
32348
  defaultValueDescription: false,
@@ -32282,6 +32351,7 @@ var ts;
32282
32351
  name: "experimentalDecorators",
32283
32352
  type: "boolean",
32284
32353
  affectsSemanticDiagnostics: true,
32354
+ affectsMultiFileEmitBuildInfo: true,
32285
32355
  category: ts.Diagnostics.Language_and_Environment,
32286
32356
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
32287
32357
  defaultValueDescription: false,
@@ -32291,6 +32361,7 @@ var ts;
32291
32361
  type: "boolean",
32292
32362
  affectsSemanticDiagnostics: true,
32293
32363
  affectsEmit: true,
32364
+ affectsMultiFileEmitBuildInfo: true,
32294
32365
  category: ts.Diagnostics.Language_and_Environment,
32295
32366
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
32296
32367
  defaultValueDescription: false,
@@ -32314,6 +32385,7 @@ var ts;
32314
32385
  type: "string",
32315
32386
  affectsSemanticDiagnostics: true,
32316
32387
  affectsEmit: true,
32388
+ affectsMultiFileEmitBuildInfo: true,
32317
32389
  affectsModuleResolution: true,
32318
32390
  category: ts.Diagnostics.Language_and_Environment,
32319
32391
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -32331,6 +32403,9 @@ var ts;
32331
32403
  name: "out",
32332
32404
  type: "string",
32333
32405
  affectsEmit: true,
32406
+ affectsMultiFileEmitBuildInfo: true,
32407
+ affectsDeclarationPath: true,
32408
+ affectsBundleEmitBuildInfo: true,
32334
32409
  isFilePath: false,
32335
32410
  category: ts.Diagnostics.Backwards_Compatibility,
32336
32411
  paramType: ts.Diagnostics.FILE,
@@ -32341,6 +32416,7 @@ var ts;
32341
32416
  name: "reactNamespace",
32342
32417
  type: "string",
32343
32418
  affectsEmit: true,
32419
+ affectsMultiFileEmitBuildInfo: true,
32344
32420
  category: ts.Diagnostics.Language_and_Environment,
32345
32421
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
32346
32422
  defaultValueDescription: "`React`",
@@ -32348,6 +32424,7 @@ var ts;
32348
32424
  {
32349
32425
  name: "skipDefaultLibCheck",
32350
32426
  type: "boolean",
32427
+ affectsMultiFileEmitBuildInfo: true,
32351
32428
  category: ts.Diagnostics.Completeness,
32352
32429
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
32353
32430
  defaultValueDescription: false,
@@ -32363,6 +32440,7 @@ var ts;
32363
32440
  name: "emitBOM",
32364
32441
  type: "boolean",
32365
32442
  affectsEmit: true,
32443
+ affectsMultiFileEmitBuildInfo: true,
32366
32444
  category: ts.Diagnostics.Emit,
32367
32445
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
32368
32446
  defaultValueDescription: false,
@@ -32374,6 +32452,7 @@ var ts;
32374
32452
  lf: 1
32375
32453
  })),
32376
32454
  affectsEmit: true,
32455
+ affectsMultiFileEmitBuildInfo: true,
32377
32456
  paramType: ts.Diagnostics.NEWLINE,
32378
32457
  category: ts.Diagnostics.Emit,
32379
32458
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -32383,6 +32462,7 @@ var ts;
32383
32462
  name: "noErrorTruncation",
32384
32463
  type: "boolean",
32385
32464
  affectsSemanticDiagnostics: true,
32465
+ affectsMultiFileEmitBuildInfo: true,
32386
32466
  category: ts.Diagnostics.Output_Formatting,
32387
32467
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
32388
32468
  defaultValueDescription: false,
@@ -32409,6 +32489,7 @@ var ts;
32409
32489
  name: "stripInternal",
32410
32490
  type: "boolean",
32411
32491
  affectsEmit: true,
32492
+ affectsMultiFileEmitBuildInfo: true,
32412
32493
  category: ts.Diagnostics.Emit,
32413
32494
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
32414
32495
  defaultValueDescription: false,
@@ -32449,6 +32530,7 @@ var ts;
32449
32530
  name: "noImplicitUseStrict",
32450
32531
  type: "boolean",
32451
32532
  affectsSemanticDiagnostics: true,
32533
+ affectsMultiFileEmitBuildInfo: true,
32452
32534
  category: ts.Diagnostics.Backwards_Compatibility,
32453
32535
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
32454
32536
  defaultValueDescription: false,
@@ -32457,6 +32539,7 @@ var ts;
32457
32539
  name: "noEmitHelpers",
32458
32540
  type: "boolean",
32459
32541
  affectsEmit: true,
32542
+ affectsMultiFileEmitBuildInfo: true,
32460
32543
  category: ts.Diagnostics.Emit,
32461
32544
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
32462
32545
  defaultValueDescription: false,
@@ -32465,6 +32548,7 @@ var ts;
32465
32548
  name: "noEmitOnError",
32466
32549
  type: "boolean",
32467
32550
  affectsEmit: true,
32551
+ affectsMultiFileEmitBuildInfo: true,
32468
32552
  category: ts.Diagnostics.Emit,
32469
32553
  transpileOptionValue: undefined,
32470
32554
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -32474,6 +32558,7 @@ var ts;
32474
32558
  name: "preserveConstEnums",
32475
32559
  type: "boolean",
32476
32560
  affectsEmit: true,
32561
+ affectsMultiFileEmitBuildInfo: true,
32477
32562
  category: ts.Diagnostics.Emit,
32478
32563
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
32479
32564
  defaultValueDescription: false,
@@ -32482,6 +32567,8 @@ var ts;
32482
32567
  name: "declarationDir",
32483
32568
  type: "string",
32484
32569
  affectsEmit: true,
32570
+ affectsMultiFileEmitBuildInfo: true,
32571
+ affectsDeclarationPath: true,
32485
32572
  isFilePath: true,
32486
32573
  paramType: ts.Diagnostics.DIRECTORY,
32487
32574
  category: ts.Diagnostics.Emit,
@@ -32491,6 +32578,7 @@ var ts;
32491
32578
  {
32492
32579
  name: "skipLibCheck",
32493
32580
  type: "boolean",
32581
+ affectsMultiFileEmitBuildInfo: true,
32494
32582
  category: ts.Diagnostics.Completeness,
32495
32583
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
32496
32584
  defaultValueDescription: false,
@@ -32500,6 +32588,7 @@ var ts;
32500
32588
  type: "boolean",
32501
32589
  affectsBindDiagnostics: true,
32502
32590
  affectsSemanticDiagnostics: true,
32591
+ affectsMultiFileEmitBuildInfo: true,
32503
32592
  category: ts.Diagnostics.Type_Checking,
32504
32593
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
32505
32594
  defaultValueDescription: undefined,
@@ -32509,6 +32598,7 @@ var ts;
32509
32598
  type: "boolean",
32510
32599
  affectsBindDiagnostics: true,
32511
32600
  affectsSemanticDiagnostics: true,
32601
+ affectsMultiFileEmitBuildInfo: true,
32512
32602
  category: ts.Diagnostics.Type_Checking,
32513
32603
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
32514
32604
  defaultValueDescription: undefined,
@@ -32517,6 +32607,7 @@ var ts;
32517
32607
  name: "suppressExcessPropertyErrors",
32518
32608
  type: "boolean",
32519
32609
  affectsSemanticDiagnostics: true,
32610
+ affectsMultiFileEmitBuildInfo: true,
32520
32611
  category: ts.Diagnostics.Backwards_Compatibility,
32521
32612
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
32522
32613
  defaultValueDescription: false,
@@ -32525,6 +32616,7 @@ var ts;
32525
32616
  name: "suppressImplicitAnyIndexErrors",
32526
32617
  type: "boolean",
32527
32618
  affectsSemanticDiagnostics: true,
32619
+ affectsMultiFileEmitBuildInfo: true,
32528
32620
  category: ts.Diagnostics.Backwards_Compatibility,
32529
32621
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
32530
32622
  defaultValueDescription: false,
@@ -32549,6 +32641,7 @@ var ts;
32549
32641
  name: "noStrictGenericChecks",
32550
32642
  type: "boolean",
32551
32643
  affectsSemanticDiagnostics: true,
32644
+ affectsMultiFileEmitBuildInfo: true,
32552
32645
  category: ts.Diagnostics.Backwards_Compatibility,
32553
32646
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
32554
32647
  defaultValueDescription: false,
@@ -32558,6 +32651,7 @@ var ts;
32558
32651
  type: "boolean",
32559
32652
  affectsSemanticDiagnostics: true,
32560
32653
  affectsEmit: true,
32654
+ affectsMultiFileEmitBuildInfo: true,
32561
32655
  category: ts.Diagnostics.Language_and_Environment,
32562
32656
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
32563
32657
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -32566,6 +32660,7 @@ var ts;
32566
32660
  name: "preserveValueImports",
32567
32661
  type: "boolean",
32568
32662
  affectsEmit: true,
32663
+ affectsMultiFileEmitBuildInfo: true,
32569
32664
  category: ts.Diagnostics.Emit,
32570
32665
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
32571
32666
  defaultValueDescription: false,
@@ -32604,6 +32699,7 @@ var ts;
32604
32699
  ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
32605
32700
  ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
32606
32701
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
32702
+ ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
32607
32703
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
32608
32704
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
32609
32705
  return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
@@ -33383,6 +33479,7 @@ var ts;
33383
33479
  }
33384
33480
  });
33385
33481
  }
33482
+ ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
33386
33483
  function serializeCompilerOptions(options, pathOptions) {
33387
33484
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
33388
33485
  }
@@ -54388,18 +54485,6 @@ var ts;
54388
54485
  }
54389
54486
  }
54390
54487
  }
54391
- if (relation === comparableRelation && sourceFlags & 262144) {
54392
- var constraint = getConstraintOfTypeParameter(source);
54393
- if (constraint && hasNonCircularBaseConstraint(source)) {
54394
- while (constraint && constraint.flags & 262144) {
54395
- if (result = isRelatedTo(constraint, target, 1, false)) {
54396
- return result;
54397
- }
54398
- constraint = getConstraintOfTypeParameter(constraint);
54399
- }
54400
- }
54401
- return 0;
54402
- }
54403
54488
  }
54404
54489
  else if (targetFlags & 4194304) {
54405
54490
  var targetType_1 = target.type;
@@ -54550,18 +54635,18 @@ var ts;
54550
54635
  }
54551
54636
  if (sourceFlags & 8650752) {
54552
54637
  if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
54553
- var constraint = getConstraintOfType(source) || unknownType;
54638
+ var constraint = getConstraintOfType(source);
54554
54639
  if (!strictNullChecks && (!constraint || (sourceFlags & 262144 && constraint.flags & 1))) {
54555
54640
  if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
54556
54641
  resetErrorInfo(saveErrorInfo);
54557
54642
  return result;
54558
54643
  }
54559
54644
  }
54560
- else if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
54645
+ else if (constraint && (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState))) {
54561
54646
  resetErrorInfo(saveErrorInfo);
54562
54647
  return result;
54563
54648
  }
54564
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
54649
+ else if (constraint && (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState))) {
54565
54650
  resetErrorInfo(saveErrorInfo);
54566
54651
  return result;
54567
54652
  }
@@ -63158,8 +63243,14 @@ var ts;
63158
63243
  var parameterRange = hasRestParameter ? min
63159
63244
  : min < max ? min + "-" + max
63160
63245
  : min;
63161
- var error = hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1
63162
- : parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
63246
+ var isVoidPromiseError = !hasRestParameter && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node);
63247
+ if (isVoidPromiseError && ts.isInJSFile(node)) {
63248
+ return getDiagnosticForCallNode(node, ts.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments);
63249
+ }
63250
+ var error = hasRestParameter
63251
+ ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1
63252
+ : isVoidPromiseError
63253
+ ? ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
63163
63254
  : ts.Diagnostics.Expected_0_arguments_but_got_1;
63164
63255
  if (min < args.length && args.length < max) {
63165
63256
  return getDiagnosticForCallNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove);
@@ -69240,7 +69331,7 @@ var ts;
69240
69331
  }
69241
69332
  var yieldType = getIterationTypeOfIterable(use, 0, inputType, undefined);
69242
69333
  if (yieldType) {
69243
- return [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false];
69334
+ return [ts.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
69244
69335
  }
69245
69336
  if (isES2015OrLaterIterable((_a = inputType.symbol) === null || _a === void 0 ? void 0 : _a.escapedName)) {
69246
69337
  return [ts.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
@@ -72070,7 +72161,7 @@ var ts;
72070
72161
  var symbol = getIntrinsicTagSymbol(name.parent);
72071
72162
  return symbol === unknownSymbol ? undefined : symbol;
72072
72163
  }
72073
- var result = resolveEntityName(name, meaning, false, !isJSDoc_1, ts.getHostSignatureFromJSDoc(name));
72164
+ var result = resolveEntityName(name, meaning, false, true, ts.getHostSignatureFromJSDoc(name));
72074
72165
  if (!result && isJSDoc_1) {
72075
72166
  var container = ts.findAncestor(name, ts.or(ts.isClassLike, ts.isInterfaceDeclaration));
72076
72167
  if (container) {
@@ -73752,6 +73843,9 @@ var ts;
73752
73843
  return ts.some(types, checkGrammarExpressionWithTypeArguments);
73753
73844
  }
73754
73845
  function checkGrammarExpressionWithTypeArguments(node) {
73846
+ if (ts.isExpressionWithTypeArguments(node) && ts.isImportKeyword(node.expression) && node.typeArguments) {
73847
+ return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
73848
+ }
73755
73849
  return checkGrammarTypeArguments(node, node.typeArguments);
73756
73850
  }
73757
73851
  function checkGrammarClassDeclarationHeritageClauses(node) {
@@ -74612,7 +74706,7 @@ var ts;
74612
74706
  return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
74613
74707
  }
74614
74708
  if (node.typeArguments) {
74615
- return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
74709
+ return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
74616
74710
  }
74617
74711
  var nodeArguments = node.arguments;
74618
74712
  if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
@@ -88966,6 +89060,8 @@ var ts;
88966
89060
  var varDecl = factory.createVariableDeclaration(newId, undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined);
88967
89061
  errorFallbackNode = undefined;
88968
89062
  var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(135)] : [], factory.createVariableDeclarationList([varDecl], 2));
89063
+ preserveJsDoc(statement, input);
89064
+ ts.removeAllComments(input);
88969
89065
  return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)];
88970
89066
  }
88971
89067
  }
@@ -90120,7 +90216,8 @@ var ts;
90120
90216
  return;
90121
90217
  }
90122
90218
  var version = ts.version;
90123
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), false);
90219
+ var buildInfo = { bundle: bundle, program: program, version: version };
90220
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), false, undefined, { buildInfo: buildInfo });
90124
90221
  }
90125
90222
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
90126
90223
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -90261,12 +90358,17 @@ var ts;
90261
90358
  if (sourceMapFilePath) {
90262
90359
  var sourceMap = sourceMapGenerator.toString();
90263
90360
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
90361
+ if (printer.bundleFileInfo)
90362
+ printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
90264
90363
  }
90265
90364
  }
90266
90365
  else {
90267
90366
  writer.writeLine();
90268
90367
  }
90269
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
90368
+ var text = writer.getText();
90369
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
90370
+ if (printer.bundleFileInfo)
90371
+ printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
90270
90372
  writer.clear();
90271
90373
  }
90272
90374
  function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
@@ -90391,30 +90493,50 @@ var ts;
90391
90493
  });
90392
90494
  }
90393
90495
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
90496
+ var createHash = ts.maybeBind(host, host.createHash);
90394
90497
  var _a = getOutputPathsForBundle(config.options, false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
90395
- var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
90396
- if (!buildInfoText)
90498
+ var buildInfo;
90499
+ if (host.getBuildInfo) {
90500
+ var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
90501
+ if (!hostBuildInfo)
90502
+ return buildInfoPath;
90503
+ buildInfo = hostBuildInfo;
90504
+ }
90505
+ else {
90506
+ var buildInfoText = host.readFile(buildInfoPath);
90507
+ if (!buildInfoText)
90508
+ return buildInfoPath;
90509
+ buildInfo = getBuildInfo(buildInfoText);
90510
+ }
90511
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
90397
90512
  return buildInfoPath;
90398
90513
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
90399
90514
  if (!jsFileText)
90400
90515
  return jsFilePath;
90516
+ if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
90517
+ return jsFilePath;
90401
90518
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
90402
90519
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
90403
90520
  return sourceMapFilePath || "inline sourcemap decoding";
90521
+ if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
90522
+ return sourceMapFilePath;
90404
90523
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
90405
90524
  if (declarationFilePath && !declarationText)
90406
90525
  return declarationFilePath;
90526
+ if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
90527
+ return declarationFilePath;
90407
90528
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
90408
90529
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
90409
90530
  return declarationMapPath || "inline sourcemap decoding";
90410
- var buildInfo = getBuildInfo(buildInfoText);
90411
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
90412
- return buildInfoPath;
90531
+ if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
90532
+ return declarationMapPath;
90413
90533
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
90414
90534
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo, true);
90415
90535
  var outputFiles = [];
90416
90536
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
90417
90537
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
90538
+ var changedDtsText;
90539
+ var changedDtsData;
90418
90540
  var emitHost = {
90419
90541
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
90420
90542
  getCanonicalFileName: host.getCanonicalFileName,
@@ -90430,7 +90552,7 @@ var ts;
90430
90552
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
90431
90553
  getProjectReferenceRedirect: ts.returnUndefined,
90432
90554
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
90433
- writeFile: function (name, text, writeByteOrderMark) {
90555
+ writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
90434
90556
  switch (name) {
90435
90557
  case jsFilePath:
90436
90558
  if (jsFileText === text)
@@ -90441,19 +90563,25 @@ var ts;
90441
90563
  return;
90442
90564
  break;
90443
90565
  case buildInfoPath:
90444
- var newBuildInfo = getBuildInfo(text);
90566
+ var newBuildInfo = data.buildInfo;
90445
90567
  newBuildInfo.program = buildInfo.program;
90568
+ if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
90569
+ newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
90570
+ newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
90571
+ }
90446
90572
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
90447
90573
  newBuildInfo.bundle.js.sources = js.sources;
90448
90574
  if (dts) {
90449
90575
  newBuildInfo.bundle.dts.sources = dts.sources;
90450
90576
  }
90451
90577
  newBuildInfo.bundle.sourceFiles = sourceFiles;
90452
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
90578
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
90453
90579
  return;
90454
90580
  case declarationFilePath:
90455
90581
  if (declarationText === text)
90456
90582
  return;
90583
+ changedDtsText = text;
90584
+ changedDtsData = data;
90457
90585
  break;
90458
90586
  case declarationMapPath:
90459
90587
  if (declarationMapText === text)
@@ -90472,6 +90600,7 @@ var ts;
90472
90600
  getSourceFileFromReference: ts.returnUndefined,
90473
90601
  redirectTargetsMap: ts.createMultiMap(),
90474
90602
  getFileIncludeReasons: ts.notImplemented,
90603
+ createHash: createHash,
90475
90604
  };
90476
90605
  emitFiles(ts.notImplementedResolver, emitHost, undefined, ts.getTransformers(config.options, customTransformers));
90477
90606
  return outputFiles;
@@ -95096,7 +95225,6 @@ var ts;
95096
95225
  if (system === void 0) { system = ts.sys; }
95097
95226
  var existingDirectories = new ts.Map();
95098
95227
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
95099
- var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
95100
95228
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
95101
95229
  var text;
95102
95230
  try {
@@ -95126,7 +95254,7 @@ var ts;
95126
95254
  function writeFile(fileName, data, writeByteOrderMark, onError) {
95127
95255
  try {
95128
95256
  ts.performance.mark("beforeIOWrite");
95129
- 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); });
95257
+ 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); });
95130
95258
  ts.performance.mark("afterIOWrite");
95131
95259
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
95132
95260
  }
@@ -95136,34 +95264,6 @@ var ts;
95136
95264
  }
95137
95265
  }
95138
95266
  }
95139
- var outputFingerprints;
95140
- function writeFileWorker(fileName, data, writeByteOrderMark) {
95141
- if (!ts.isWatchSet(options) || !system.getModifiedTime) {
95142
- system.writeFile(fileName, data, writeByteOrderMark);
95143
- return;
95144
- }
95145
- if (!outputFingerprints) {
95146
- outputFingerprints = new ts.Map();
95147
- }
95148
- var hash = computeHash(data);
95149
- var mtimeBefore = system.getModifiedTime(fileName);
95150
- if (mtimeBefore) {
95151
- var fingerprint = outputFingerprints.get(fileName);
95152
- if (fingerprint &&
95153
- fingerprint.byteOrderMark === writeByteOrderMark &&
95154
- fingerprint.hash === hash &&
95155
- fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
95156
- return;
95157
- }
95158
- }
95159
- system.writeFile(fileName, data, writeByteOrderMark);
95160
- var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
95161
- outputFingerprints.set(fileName, {
95162
- hash: hash,
95163
- byteOrderMark: writeByteOrderMark,
95164
- mtime: mtimeAfter
95165
- });
95166
- }
95167
95267
  function getDefaultLibLocation() {
95168
95268
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
95169
95269
  }
@@ -96505,6 +96605,7 @@ var ts;
96505
96605
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
96506
96606
  redirectTargetsMap: redirectTargetsMap,
96507
96607
  getFileIncludeReasons: program.getFileIncludeReasons,
96608
+ createHash: ts.maybeBind(host, host.createHash),
96508
96609
  };
96509
96610
  }
96510
96611
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -98411,13 +98512,9 @@ var ts;
98411
98512
  function createManyToManyPathMap() {
98412
98513
  function create(forward, reverse, deleted) {
98413
98514
  var map = {
98414
- clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
98415
- forEach: function (fn) { return forward.forEach(fn); },
98416
98515
  getKeys: function (v) { return reverse.get(v); },
98417
98516
  getValues: function (k) { return forward.get(k); },
98418
- hasKey: function (k) { return forward.has(k); },
98419
98517
  keys: function () { return forward.keys(); },
98420
- deletedKeys: function () { return deleted; },
98421
98518
  deleteKey: function (k) {
98422
98519
  (deleted || (deleted = new ts.Set())).add(k);
98423
98520
  var set = forward.get(k);
@@ -98444,11 +98541,6 @@ var ts;
98444
98541
  });
98445
98542
  return map;
98446
98543
  },
98447
- clear: function () {
98448
- forward.clear();
98449
- reverse.clear();
98450
- deleted === null || deleted === void 0 ? void 0 : deleted.clear();
98451
- }
98452
98544
  };
98453
98545
  return map;
98454
98546
  }
@@ -98552,35 +98644,45 @@ var ts;
98552
98644
  }
98553
98645
  BuilderState.canReuseOldState = canReuseOldState;
98554
98646
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
98647
+ var _a, _b, _c;
98555
98648
  var fileInfos = new ts.Map();
98556
98649
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
98557
98650
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
98558
- var hasCalledUpdateShapeSignature = new ts.Set();
98559
98651
  var useOldState = canReuseOldState(referencedMap, oldState);
98560
98652
  newProgram.getTypeChecker();
98561
- for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
98562
- var sourceFile = _a[_i];
98653
+ for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
98654
+ var sourceFile = _d[_i];
98563
98655
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
98564
- var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
98656
+ var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
98657
+ var signature = oldUncommitedSignature === undefined ?
98658
+ useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
98659
+ oldUncommitedSignature || undefined;
98565
98660
  if (referencedMap) {
98566
98661
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
98567
98662
  if (newReferences) {
98568
98663
  referencedMap.set(sourceFile.resolvedPath, newReferences);
98569
98664
  }
98570
98665
  if (useOldState) {
98571
- var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
98666
+ var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
98667
+ var exportedModules = oldUncommitedExportedModules === undefined ?
98668
+ oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
98669
+ oldUncommitedExportedModules || undefined;
98572
98670
  if (exportedModules) {
98573
98671
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
98574
98672
  }
98575
98673
  }
98576
98674
  }
98577
- fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
98675
+ fileInfos.set(sourceFile.resolvedPath, {
98676
+ version: version_2,
98677
+ signature: signature,
98678
+ affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
98679
+ impliedFormat: sourceFile.impliedNodeFormat
98680
+ });
98578
98681
  }
98579
98682
  return {
98580
98683
  fileInfos: fileInfos,
98581
98684
  referencedMap: referencedMap,
98582
98685
  exportedModulesMap: exportedModulesMap,
98583
- hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
98584
98686
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
98585
98687
  };
98586
98688
  }
@@ -98590,52 +98692,36 @@ var ts;
98590
98692
  state.allFileNames = undefined;
98591
98693
  }
98592
98694
  BuilderState.releaseCache = releaseCache;
98593
- function clone(state) {
98695
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
98594
98696
  var _a, _b;
98595
- return {
98596
- fileInfos: new ts.Map(state.fileInfos),
98597
- referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
98598
- exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
98599
- hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
98600
- useFileVersionAsSignature: state.useFileVersionAsSignature,
98601
- };
98697
+ var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
98698
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
98699
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
98700
+ return result;
98602
98701
  }
98603
- BuilderState.clone = clone;
98604
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
98605
- var signatureCache = cacheToUpdateSignature || new ts.Map();
98702
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
98703
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
98606
98704
  var sourceFile = programOfThisState.getSourceFileByPath(path);
98607
98705
  if (!sourceFile) {
98608
98706
  return ts.emptyArray;
98609
98707
  }
98610
- if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
98708
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
98611
98709
  return [sourceFile];
98612
98710
  }
98613
- var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
98614
- if (!cacheToUpdateSignature) {
98615
- updateSignaturesFromCache(state, signatureCache);
98616
- }
98617
- return result;
98618
- }
98619
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
98620
- function updateSignaturesFromCache(state, signatureCache) {
98621
- signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
98711
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
98622
98712
  }
98623
- BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
98713
+ BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
98624
98714
  function updateSignatureOfFile(state, signature, path) {
98625
98715
  state.fileInfos.get(path).signature = signature;
98626
- state.hasCalledUpdateShapeSignature.add(path);
98716
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
98627
98717
  }
98628
98718
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
98629
- function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
98719
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
98720
+ var _a;
98630
98721
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
98631
- ts.Debug.assert(!!sourceFile);
98632
- ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
98633
- if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
98722
+ if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
98634
98723
  return false;
98635
- }
98636
98724
  var info = state.fileInfos.get(sourceFile.resolvedPath);
98637
- if (!info)
98638
- return ts.Debug.fail();
98639
98725
  var prevSignature = info.signature;
98640
98726
  var latestSignature;
98641
98727
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -98643,40 +98729,50 @@ var ts;
98643
98729
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
98644
98730
  if (firstDts_1) {
98645
98731
  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; })); });
98646
- latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
98647
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
98648
- updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
98732
+ latestSignature = computeSignature(firstDts_1.text, computeHash);
98733
+ if (latestSignature !== prevSignature) {
98734
+ updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
98649
98735
  }
98650
98736
  }
98651
98737
  }
98652
98738
  if (latestSignature === undefined) {
98653
98739
  latestSignature = sourceFile.version;
98654
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
98740
+ if (state.exportedModulesMap && latestSignature !== prevSignature) {
98741
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
98655
98742
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
98656
98743
  if (references) {
98657
- exportedModulesMapCache.set(sourceFile.resolvedPath, references);
98744
+ state.exportedModulesMap.set(sourceFile.resolvedPath, references);
98658
98745
  }
98659
98746
  else {
98660
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
98747
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
98661
98748
  }
98662
98749
  }
98663
98750
  }
98664
- cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
98751
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
98752
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
98753
+ info.signature = latestSignature;
98665
98754
  return latestSignature !== prevSignature;
98666
98755
  }
98667
98756
  BuilderState.updateShapeSignature = updateShapeSignature;
98668
- function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
98757
+ function computeSignature(text, computeHash) {
98758
+ return (computeHash || ts.generateDjb2Hash)(text);
98759
+ }
98760
+ BuilderState.computeSignature = computeSignature;
98761
+ function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
98762
+ if (!state.exportedModulesMap)
98763
+ return;
98764
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
98669
98765
  if (!exportedModulesFromDeclarationEmit) {
98670
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
98766
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
98671
98767
  return;
98672
98768
  }
98673
98769
  var exportedModules;
98674
98770
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
98675
98771
  if (exportedModules) {
98676
- exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
98772
+ state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
98677
98773
  }
98678
98774
  else {
98679
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
98775
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
98680
98776
  }
98681
98777
  function addExportedModule(exportedModulePaths) {
98682
98778
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -98688,15 +98784,6 @@ var ts;
98688
98784
  }
98689
98785
  }
98690
98786
  BuilderState.updateExportedModules = updateExportedModules;
98691
- function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
98692
- var _a;
98693
- if (exportedModulesMapCache) {
98694
- ts.Debug.assert(!!state.exportedModulesMap);
98695
- (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
98696
- exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
98697
- }
98698
- }
98699
- BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
98700
98787
  function getAllDependencies(state, programOfThisState, sourceFile) {
98701
98788
  var compilerOptions = programOfThisState.getCompilerOptions();
98702
98789
  if (ts.outFile(compilerOptions)) {
@@ -98780,7 +98867,7 @@ var ts;
98780
98867
  }
98781
98868
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
98782
98869
  }
98783
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
98870
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
98784
98871
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
98785
98872
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
98786
98873
  }
@@ -98796,7 +98883,7 @@ var ts;
98796
98883
  if (!seenFileNamesMap.has(currentPath)) {
98797
98884
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
98798
98885
  seenFileNamesMap.set(currentPath, currentSourceFile);
98799
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
98886
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
98800
98887
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
98801
98888
  }
98802
98889
  }
@@ -98811,29 +98898,31 @@ var ts;
98811
98898
  return map1 === map2 || map1 !== undefined && map2 !== undefined && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });
98812
98899
  }
98813
98900
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
98901
+ var _a, _b;
98814
98902
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
98815
98903
  state.program = newProgram;
98816
98904
  var compilerOptions = newProgram.getCompilerOptions();
98817
98905
  state.compilerOptions = compilerOptions;
98818
- if (!ts.outFile(compilerOptions)) {
98906
+ var outFilePath = ts.outFile(compilerOptions);
98907
+ if (!outFilePath) {
98819
98908
  state.semanticDiagnosticsPerFile = new ts.Map();
98820
98909
  }
98910
+ 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)) {
98911
+ state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
98912
+ }
98821
98913
  state.changedFilesSet = new ts.Set();
98914
+ state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
98822
98915
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
98823
98916
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
98824
98917
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
98825
98918
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
98919
+ var canCopyEmitSignatures = compilerOptions.composite &&
98920
+ (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
98921
+ !outFilePath &&
98922
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
98826
98923
  if (useOldState) {
98827
- if (!oldState.currentChangedFilePath) {
98828
- var affectedSignatures = oldState.currentAffectedFilesSignatures;
98829
- ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
98830
- }
98831
- var changedFilesSet = oldState.changedFilesSet;
98832
- if (canCopySemanticDiagnostics) {
98833
- ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
98834
- }
98835
- changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
98836
- if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
98924
+ (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
98925
+ if (!outFilePath && oldState.affectedFilesPendingEmit) {
98837
98926
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
98838
98927
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
98839
98928
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -98850,6 +98939,7 @@ var ts;
98850
98939
  if (!useOldState ||
98851
98940
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
98852
98941
  oldInfo.version !== info.version ||
98942
+ oldInfo.impliedFormat !== info.impliedFormat ||
98853
98943
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
98854
98944
  newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) {
98855
98945
  state.changedFilesSet.add(sourceFilePath);
@@ -98869,24 +98959,22 @@ var ts;
98869
98959
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
98870
98960
  }
98871
98961
  }
98962
+ if (canCopyEmitSignatures) {
98963
+ var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
98964
+ if (oldEmitSignature)
98965
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
98966
+ }
98872
98967
  });
98873
98968
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
98874
98969
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, undefined)
98875
98970
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
98876
98971
  }
98877
- else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
98972
+ else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
98878
98973
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1); });
98879
98974
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
98880
98975
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
98881
98976
  }
98882
- if (useOldState) {
98883
- ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
98884
- if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
98885
- state.changedFilesSet.add(sourceFilePath);
98886
- }
98887
- });
98888
- }
98889
- state.buildInfoEmitPending = !!state.changedFilesSet.size;
98977
+ state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
98890
98978
  return state;
98891
98979
  }
98892
98980
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -98919,33 +99007,40 @@ var ts;
98919
99007
  ts.BuilderState.releaseCache(state);
98920
99008
  state.program = undefined;
98921
99009
  }
98922
- function cloneBuilderProgramState(state) {
98923
- var _a;
98924
- var newState = ts.BuilderState.clone(state);
98925
- newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
98926
- newState.changedFilesSet = new ts.Set(state.changedFilesSet);
98927
- newState.affectedFiles = state.affectedFiles;
98928
- newState.affectedFilesIndex = state.affectedFilesIndex;
98929
- newState.currentChangedFilePath = state.currentChangedFilePath;
98930
- newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
98931
- newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
98932
- newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
98933
- newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
98934
- newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
98935
- newState.program = state.program;
98936
- newState.compilerOptions = state.compilerOptions;
98937
- newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
98938
- newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
98939
- newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
98940
- newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
98941
- newState.programEmitComplete = state.programEmitComplete;
98942
- return newState;
99010
+ function backupEmitBuilderProgramState(state) {
99011
+ var outFilePath = ts.outFile(state.compilerOptions);
99012
+ ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
99013
+ return {
99014
+ affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
99015
+ affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
99016
+ affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
99017
+ seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
99018
+ programEmitComplete: state.programEmitComplete,
99019
+ emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
99020
+ outSignature: state.outSignature,
99021
+ dtsChangeTime: state.dtsChangeTime,
99022
+ hasChangedEmitSignature: state.hasChangedEmitSignature,
99023
+ changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
99024
+ };
99025
+ }
99026
+ function restoreEmitBuilderProgramState(state, backupEmitState) {
99027
+ state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
99028
+ state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
99029
+ state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
99030
+ state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
99031
+ state.programEmitComplete = backupEmitState.programEmitComplete;
99032
+ state.emitSignatures = backupEmitState.emitSignatures;
99033
+ state.outSignature = backupEmitState.outSignature;
99034
+ state.dtsChangeTime = backupEmitState.dtsChangeTime;
99035
+ state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
99036
+ if (backupEmitState.changedFilesSet)
99037
+ state.changedFilesSet = backupEmitState.changedFilesSet;
98943
99038
  }
98944
99039
  function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
98945
99040
  ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
98946
99041
  }
98947
99042
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
98948
- var _a;
99043
+ var _a, _b;
98949
99044
  while (true) {
98950
99045
  var affectedFiles = state.affectedFiles;
98951
99046
  if (affectedFiles) {
@@ -98962,10 +99057,8 @@ var ts;
98962
99057
  }
98963
99058
  state.changedFilesSet.delete(state.currentChangedFilePath);
98964
99059
  state.currentChangedFilePath = undefined;
98965
- ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
98966
- state.currentAffectedFilesSignatures.clear();
98967
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
98968
- (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
99060
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
99061
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
98969
99062
  state.affectedFiles = undefined;
98970
99063
  }
98971
99064
  var nextKey = state.changedFilesSet.keys().next();
@@ -98978,12 +99071,7 @@ var ts;
98978
99071
  ts.Debug.assert(!state.semanticDiagnosticsPerFile);
98979
99072
  return program;
98980
99073
  }
98981
- if (!state.currentAffectedFilesSignatures)
98982
- state.currentAffectedFilesSignatures = new ts.Map();
98983
- if (state.exportedModulesMap) {
98984
- state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
98985
- }
98986
- state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
99074
+ state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
98987
99075
  state.currentChangedFilePath = nextKey.value;
98988
99076
  state.affectedFilesIndex = 0;
98989
99077
  if (!state.seenAffectedFiles)
@@ -99027,14 +99115,12 @@ var ts;
99027
99115
  }
99028
99116
  }
99029
99117
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
99030
- var _a;
99031
99118
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
99032
99119
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
99033
99120
  removeDiagnosticsOfLibraryFiles(state);
99034
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
99121
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
99035
99122
  return;
99036
99123
  }
99037
- 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);
99038
99124
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
99039
99125
  return;
99040
99126
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -99045,7 +99131,7 @@ var ts;
99045
99131
  var program = ts.Debug.checkDefined(state.program);
99046
99132
  var sourceFile = program.getSourceFileByPath(path);
99047
99133
  if (sourceFile) {
99048
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
99134
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
99049
99135
  if (ts.getEmitDeclarations(state.compilerOptions)) {
99050
99136
  addToAffectedFilesPendingEmit(state, path, 0);
99051
99137
  }
@@ -99061,24 +99147,10 @@ var ts;
99061
99147
  return !state.semanticDiagnosticsFromOldState.size;
99062
99148
  }
99063
99149
  function isChangedSignature(state, path) {
99064
- var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
99065
- var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
99150
+ var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
99151
+ var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
99066
99152
  return newSignature !== oldSignature;
99067
99153
  }
99068
- function forEachKeyOfExportedModulesMap(state, filePath, fn) {
99069
- var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
99070
- var result = keys && ts.forEachKey(keys, fn);
99071
- if (result)
99072
- return result;
99073
- keys = state.exportedModulesMap.getKeys(filePath);
99074
- return keys && ts.forEachKey(keys, function (exportedFromPath) {
99075
- var _a;
99076
- return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
99077
- !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
99078
- fn(exportedFromPath) :
99079
- undefined;
99080
- });
99081
- }
99082
99154
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
99083
99155
  var _a;
99084
99156
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -99089,6 +99161,7 @@ var ts;
99089
99161
  return true;
99090
99162
  }
99091
99163
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
99164
+ var _a;
99092
99165
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
99093
99166
  return;
99094
99167
  if (!isChangedSignature(state, affectedFile.resolvedPath))
@@ -99111,9 +99184,8 @@ var ts;
99111
99184
  }
99112
99185
  }
99113
99186
  }
99114
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
99115
99187
  var seenFileAndExportsOfFile = new ts.Set();
99116
- forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
99188
+ (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
99117
99189
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
99118
99190
  return true;
99119
99191
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -99123,17 +99195,16 @@ var ts;
99123
99195
  });
99124
99196
  }
99125
99197
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
99126
- var _a;
99198
+ var _a, _b;
99127
99199
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
99128
99200
  return undefined;
99129
99201
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
99130
99202
  return true;
99131
99203
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
99132
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
99133
- forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
99204
+ (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
99134
99205
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
99135
99206
  });
99136
- (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
99207
+ (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
99137
99208
  return !seenFileAndExportsOfFile.has(referencingFilePath) &&
99138
99209
  handleDtsMayChangeOf(state, referencingFilePath, cancellationToken, computeHash, host);
99139
99210
  });
@@ -99149,12 +99220,12 @@ var ts;
99149
99220
  }
99150
99221
  else {
99151
99222
  state.seenAffectedFiles.add(affected.resolvedPath);
99223
+ state.buildInfoEmitPending = true;
99152
99224
  if (emitKind !== undefined) {
99153
99225
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
99154
99226
  }
99155
99227
  if (isPendingEmit) {
99156
99228
  state.affectedFilesPendingEmitIndex++;
99157
- state.buildInfoEmitPending = true;
99158
99229
  }
99159
99230
  else {
99160
99231
  state.affectedFilesIndex++;
@@ -99186,29 +99257,65 @@ var ts;
99186
99257
  }
99187
99258
  return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
99188
99259
  }
99189
- function getProgramBuildInfo(state, getCanonicalFileName) {
99190
- if (ts.outFile(state.compilerOptions))
99191
- return undefined;
99260
+ function isProgramBundleEmitBuildInfo(info) {
99261
+ return !!ts.outFile(info.options || {});
99262
+ }
99263
+ ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
99264
+ function getProgramBuildInfo(state, getCanonicalFileName, host) {
99265
+ var outFilePath = ts.outFile(state.compilerOptions);
99266
+ if (outFilePath && !state.compilerOptions.composite)
99267
+ return;
99192
99268
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
99193
99269
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
99270
+ state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
99271
+ if (outFilePath) {
99272
+ var fileNames_1 = [];
99273
+ var fileInfos_1 = [];
99274
+ state.program.getRootFileNames().forEach(function (f) {
99275
+ var sourceFile = state.program.getSourceFile(f);
99276
+ if (!sourceFile)
99277
+ return;
99278
+ fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath));
99279
+ fileInfos_1.push(sourceFile.version);
99280
+ });
99281
+ var result_15 = {
99282
+ fileNames: fileNames_1,
99283
+ fileInfos: fileInfos_1,
99284
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
99285
+ outSignature: state.outSignature,
99286
+ dtsChangeTime: state.dtsChangeTime,
99287
+ };
99288
+ return result_15;
99289
+ }
99194
99290
  var fileNames = [];
99195
99291
  var fileNameToFileId = new ts.Map();
99196
99292
  var fileIdsList;
99197
99293
  var fileNamesToFileIdListId;
99294
+ var emitSignatures;
99198
99295
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
99296
+ var _b, _c;
99199
99297
  var key = _a[0], value = _a[1];
99200
99298
  var fileId = toFileId(key);
99201
99299
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
99202
- var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
99203
- var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
99300
+ var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
99301
+ var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
99302
+ if (state.compilerOptions.composite) {
99303
+ var file = state.program.getSourceFileByPath(key);
99304
+ if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
99305
+ var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
99306
+ if (emitSignature !== actualSignature) {
99307
+ (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
99308
+ }
99309
+ }
99310
+ }
99204
99311
  return value.version === actualSignature ?
99205
99312
  value.affectsGlobalScope || value.impliedFormat ?
99206
99313
  { version: value.version, signature: undefined, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
99207
99314
  value.version :
99208
99315
  actualSignature !== undefined ?
99209
- signature === undefined ?
99316
+ oldSignature === undefined ?
99210
99317
  value :
99211
- { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
99318
+ { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
99212
99319
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
99213
99320
  });
99214
99321
  var referencedMap;
@@ -99222,16 +99329,12 @@ var ts;
99222
99329
  if (state.exportedModulesMap) {
99223
99330
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
99224
99331
  var _a;
99225
- if (state.currentAffectedFilesExportedModulesMap) {
99226
- if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
99227
- return undefined;
99228
- }
99229
- var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
99230
- if (newValue) {
99231
- return [toFileId(key), toFileIdListId(newValue)];
99232
- }
99233
- }
99234
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
99332
+ var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
99333
+ if (oldValue === undefined)
99334
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
99335
+ if (oldValue)
99336
+ return [toFileId(key), toFileIdListId(oldValue)];
99337
+ return undefined;
99235
99338
  });
99236
99339
  }
99237
99340
  var semanticDiagnosticsPerFile;
@@ -99242,9 +99345,7 @@ var ts;
99242
99345
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
99243
99346
  [
99244
99347
  toFileId(key),
99245
- state.hasReusableDiagnostic ?
99246
- value :
99247
- convertToReusableDiagnostics(value, relativeToBuildInfo)
99348
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
99248
99349
  ] :
99249
99350
  toFileId(key));
99250
99351
  }
@@ -99259,16 +99360,27 @@ var ts;
99259
99360
  }
99260
99361
  }
99261
99362
  }
99262
- return {
99363
+ var changeFileSet;
99364
+ if (state.changedFilesSet.size) {
99365
+ for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
99366
+ var path = _e[_d];
99367
+ (changeFileSet || (changeFileSet = [])).push(toFileId(path));
99368
+ }
99369
+ }
99370
+ var result = {
99263
99371
  fileNames: fileNames,
99264
99372
  fileInfos: fileInfos,
99265
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
99373
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
99266
99374
  fileIdsList: fileIdsList,
99267
99375
  referencedMap: referencedMap,
99268
99376
  exportedModulesMap: exportedModulesMap,
99269
99377
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
99270
99378
  affectedFilesPendingEmit: affectedFilesPendingEmit,
99379
+ changeFileSet: changeFileSet,
99380
+ emitSignatures: emitSignatures,
99381
+ dtsChangeTime: state.dtsChangeTime,
99271
99382
  };
99383
+ return result;
99272
99384
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
99273
99385
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
99274
99386
  }
@@ -99293,21 +99405,18 @@ var ts;
99293
99405
  }
99294
99406
  return fileIdListId;
99295
99407
  }
99296
- }
99297
- function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
99298
- var result;
99299
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
99300
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
99301
- var name = _a[_i];
99302
- var optionKey = name.toLowerCase();
99303
- var optionInfo = optionsNameMap.get(optionKey);
99304
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
99305
- optionKey === "strict" ||
99306
- optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
99307
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
99408
+ function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
99409
+ var result;
99410
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
99411
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
99412
+ var name = _a[_i];
99413
+ var optionInfo = optionsNameMap.get(name.toLowerCase());
99414
+ if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
99415
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
99416
+ }
99308
99417
  }
99418
+ return result;
99309
99419
  }
99310
- return result;
99311
99420
  }
99312
99421
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
99313
99422
  if (option) {
@@ -99381,6 +99490,10 @@ var ts;
99381
99490
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
99382
99491
  }
99383
99492
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
99493
+ function computeSignature(text, data, computeHash) {
99494
+ return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
99495
+ }
99496
+ ts.computeSignature = computeSignature;
99384
99497
  function createBuilderProgram(kind, _a) {
99385
99498
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
99386
99499
  var oldState = oldProgram && oldProgram.getState();
@@ -99392,28 +99505,28 @@ var ts;
99392
99505
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
99393
99506
  var computeHash = ts.maybeBind(host, host.createHash);
99394
99507
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
99395
- var backupState;
99396
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
99508
+ var backupEmitState;
99509
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
99397
99510
  newProgram = undefined;
99398
99511
  oldProgram = undefined;
99399
99512
  oldState = undefined;
99400
99513
  var getState = function () { return state; };
99401
99514
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
99402
99515
  builderProgram.getState = getState;
99403
- builderProgram.backupState = function () {
99404
- ts.Debug.assert(backupState === undefined);
99405
- backupState = cloneBuilderProgramState(state);
99516
+ builderProgram.backupEmitState = function () {
99517
+ ts.Debug.assert(backupEmitState === undefined);
99518
+ backupEmitState = backupEmitBuilderProgramState(state);
99406
99519
  };
99407
- builderProgram.restoreState = function () {
99408
- state = ts.Debug.checkDefined(backupState);
99409
- backupState = undefined;
99520
+ builderProgram.restoreEmitState = function () {
99521
+ restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
99522
+ backupEmitState = undefined;
99410
99523
  };
99411
99524
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
99412
99525
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
99413
99526
  builderProgram.emit = emit;
99414
99527
  builderProgram.releaseProgram = function () {
99415
99528
  releaseCache(state);
99416
- backupState = undefined;
99529
+ backupEmitState = undefined;
99417
99530
  };
99418
99531
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
99419
99532
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -99459,35 +99572,57 @@ var ts;
99459
99572
  affected = program;
99460
99573
  }
99461
99574
  }
99462
- return toAffectedFileEmitResult(state, ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
99463
- getWriteFileUpdatingSignatureCallback(writeFile) :
99575
+ return toAffectedFileEmitResult(state, ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
99576
+ getWriteFileCallback(writeFile, customTransformers) :
99464
99577
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0, customTransformers), affected, emitKind, isPendingEmitFile);
99465
99578
  }
99466
- function getWriteFileUpdatingSignatureCallback(writeFile) {
99579
+ function getWriteFileCallback(writeFile, customTransformers) {
99467
99580
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
99468
- var _a;
99581
+ var _a, _b, _c;
99469
99582
  if (ts.isDeclarationFileName(fileName)) {
99470
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
99471
- var file = sourceFiles[0];
99472
- var info = state.fileInfos.get(file.resolvedPath);
99473
- var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
99474
- if (signature === file.version) {
99475
- var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
99476
- if (newSignature !== file.version) {
99477
- if (host.storeFilesChangingSignatureDuringEmit)
99478
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
99479
- if (state.exportedModulesMap)
99480
- ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
99481
- if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
99482
- state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
99583
+ if (!ts.outFile(state.compilerOptions)) {
99584
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
99585
+ var newSignature = void 0;
99586
+ if (!customTransformers) {
99587
+ var file = sourceFiles[0];
99588
+ var info = state.fileInfos.get(file.resolvedPath);
99589
+ if (info.signature === file.version) {
99590
+ newSignature = computeSignature(text, data, computeHash);
99591
+ if (newSignature !== file.version) {
99592
+ if (host.storeFilesChangingSignatureDuringEmit)
99593
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
99594
+ if (state.exportedModulesMap)
99595
+ ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
99596
+ if (state.affectedFiles) {
99597
+ var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
99598
+ if (existing === undefined)
99599
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
99600
+ info.signature = newSignature;
99601
+ }
99602
+ else {
99603
+ info.signature = newSignature;
99604
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
99605
+ }
99606
+ }
99483
99607
  }
99484
- else {
99485
- info.signature = newSignature;
99486
- if (state.exportedModulesMap)
99487
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
99608
+ }
99609
+ if (state.compilerOptions.composite) {
99610
+ var filePath = sourceFiles[0].resolvedPath;
99611
+ var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
99612
+ newSignature || (newSignature = computeSignature(text, data, computeHash));
99613
+ if (newSignature !== oldSignature) {
99614
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
99615
+ state.hasChangedEmitSignature = true;
99488
99616
  }
99489
99617
  }
99490
99618
  }
99619
+ else if (state.compilerOptions.composite) {
99620
+ var newSignature = computeSignature(text, data, computeHash);
99621
+ if (newSignature !== state.outSignature) {
99622
+ state.outSignature = newSignature;
99623
+ state.hasChangedEmitSignature = true;
99624
+ }
99625
+ }
99491
99626
  }
99492
99627
  if (writeFile)
99493
99628
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -99536,8 +99671,8 @@ var ts;
99536
99671
  }
99537
99672
  }
99538
99673
  }
99539
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
99540
- getWriteFileUpdatingSignatureCallback(writeFile) :
99674
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
99675
+ getWriteFileCallback(writeFile, customTransformers) :
99541
99676
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
99542
99677
  }
99543
99678
  function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
@@ -99600,29 +99735,58 @@ var ts;
99600
99735
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
99601
99736
  }
99602
99737
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
99603
- function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
99604
- var _a;
99738
+ function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
99739
+ var _a, _b, _c, _d;
99605
99740
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
99606
99741
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
99607
- var filePaths = program.fileNames.map(toPath);
99608
- var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
99609
- var fileInfos = new ts.Map();
99610
- program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
99611
- var state = {
99612
- fileInfos: fileInfos,
99613
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
99614
- referencedMap: toManyToManyPathMap(program.referencedMap),
99615
- exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
99616
- 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]; }),
99617
- hasReusableDiagnostic: true,
99618
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
99619
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
99620
- affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
99621
- };
99742
+ var state;
99743
+ var filePaths;
99744
+ var filePathsSetList;
99745
+ if (isProgramBundleEmitBuildInfo(program)) {
99746
+ state = {
99747
+ fileInfos: new ts.Map(),
99748
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
99749
+ dtsChangeTime: program.dtsChangeTime,
99750
+ outSignature: program.outSignature,
99751
+ };
99752
+ }
99753
+ else {
99754
+ filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
99755
+ filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
99756
+ var fileInfos_2 = new ts.Map();
99757
+ var emitSignatures_1 = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
99758
+ program.fileInfos.forEach(function (fileInfo, index) {
99759
+ var path = toFilePath(index + 1);
99760
+ var stateFileInfo = toBuilderStateFileInfo(fileInfo);
99761
+ fileInfos_2.set(path, stateFileInfo);
99762
+ if (emitSignatures_1 && stateFileInfo.signature)
99763
+ emitSignatures_1.set(path, stateFileInfo.signature);
99764
+ });
99765
+ (_d = program.emitSignatures) === null || _d === void 0 ? void 0 : _d.forEach(function (value) {
99766
+ if (ts.isNumber(value))
99767
+ emitSignatures_1.delete(toFilePath(value));
99768
+ else
99769
+ emitSignatures_1.set(toFilePath(value[0]), value[1]);
99770
+ });
99771
+ state = {
99772
+ fileInfos: fileInfos_2,
99773
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
99774
+ referencedMap: toManyToManyPathMap(program.referencedMap),
99775
+ exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
99776
+ 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]; }),
99777
+ hasReusableDiagnostic: true,
99778
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
99779
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
99780
+ affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
99781
+ changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
99782
+ dtsChangeTime: program.dtsChangeTime,
99783
+ emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
99784
+ };
99785
+ }
99622
99786
  return {
99623
99787
  getState: function () { return state; },
99624
- backupState: ts.noop,
99625
- restoreState: ts.noop,
99788
+ backupEmitState: ts.noop,
99789
+ restoreEmitState: ts.noop,
99626
99790
  getProgram: ts.notImplemented,
99627
99791
  getProgramOrUndefined: ts.returnUndefined,
99628
99792
  releaseProgram: ts.noop,
@@ -99667,12 +99831,24 @@ var ts;
99667
99831
  return map;
99668
99832
  }
99669
99833
  }
99670
- ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
99834
+ ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
99835
+ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
99836
+ var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
99837
+ var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
99838
+ var fileInfos = new ts.Map();
99839
+ program.fileInfos.forEach(function (fileInfo, index) {
99840
+ var path = ts.toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
99841
+ var version = ts.isString(fileInfo) ? fileInfo : fileInfo.version;
99842
+ fileInfos.set(path, version);
99843
+ });
99844
+ return fileInfos;
99845
+ }
99846
+ ts.getBuildInfoFileVersionMap = getBuildInfoFileVersionMap;
99671
99847
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
99672
99848
  return {
99673
99849
  getState: ts.notImplemented,
99674
- backupState: ts.noop,
99675
- restoreState: ts.noop,
99850
+ backupEmitState: ts.noop,
99851
+ restoreEmitState: ts.noop,
99676
99852
  getProgram: getProgram,
99677
99853
  getProgramOrUndefined: function () { return getState().program; },
99678
99854
  releaseProgram: function () { return getState().program = undefined; },
@@ -100623,9 +100799,9 @@ var ts;
100623
100799
  var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
100624
100800
  var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
100625
100801
  if (!preferSymlinks) {
100626
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
100627
- if (result_15)
100628
- return result_15;
100802
+ var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
100803
+ if (result_16)
100804
+ return result_16;
100629
100805
  }
100630
100806
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
100631
100807
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -100644,10 +100820,10 @@ var ts;
100644
100820
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
100645
100821
  var symlinkDirectory = symlinkDirectories_1[_i];
100646
100822
  var option = ts.resolvePath(symlinkDirectory, relative);
100647
- var result_16 = cb(option, target === referenceRedirect);
100823
+ var result_17 = cb(option, target === referenceRedirect);
100648
100824
  shouldFilterIgnoredPaths = true;
100649
- if (result_16)
100650
- return result_16;
100825
+ if (result_17)
100826
+ return result_17;
100651
100827
  }
100652
100828
  });
100653
100829
  });
@@ -101462,6 +101638,7 @@ var ts;
101462
101638
  readDirectory: ts.maybeBind(host, host.readDirectory),
101463
101639
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
101464
101640
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
101641
+ now: ts.maybeBind(host, host.now),
101465
101642
  };
101466
101643
  function writeFile(fileName, text, writeByteOrderMark, onError) {
101467
101644
  try {
@@ -101516,6 +101693,7 @@ var ts;
101516
101693
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
101517
101694
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
101518
101695
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
101696
+ now: ts.maybeBind(system, system.now),
101519
101697
  };
101520
101698
  }
101521
101699
  ts.createProgramHost = createProgramHost;
@@ -101571,20 +101749,26 @@ var ts;
101571
101749
  var ts;
101572
101750
  (function (ts) {
101573
101751
  function readBuilderProgram(compilerOptions, host) {
101574
- if (ts.outFile(compilerOptions))
101575
- return undefined;
101576
101752
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
101577
101753
  if (!buildInfoPath)
101578
101754
  return undefined;
101579
- var content = host.readFile(buildInfoPath);
101580
- if (!content)
101581
- return undefined;
101582
- var buildInfo = ts.getBuildInfo(content);
101755
+ var buildInfo;
101756
+ if (host.getBuildInfo) {
101757
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
101758
+ if (!buildInfo)
101759
+ return undefined;
101760
+ }
101761
+ else {
101762
+ var content = host.readFile(buildInfoPath);
101763
+ if (!content)
101764
+ return undefined;
101765
+ buildInfo = ts.getBuildInfo(content);
101766
+ }
101583
101767
  if (buildInfo.version !== ts.version)
101584
101768
  return undefined;
101585
101769
  if (!buildInfo.program)
101586
101770
  return undefined;
101587
- return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
101771
+ return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
101588
101772
  }
101589
101773
  ts.readBuilderProgram = readBuilderProgram;
101590
101774
  function createIncrementalCompilerHost(options, system) {
@@ -101593,6 +101777,7 @@ var ts;
101593
101777
  host.createHash = ts.maybeBind(system, system.createHash);
101594
101778
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
101595
101779
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
101780
+ host.now = ts.maybeBind(system, system.now);
101596
101781
  ts.setGetSourceFileAsHashVersioned(host, system);
101597
101782
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
101598
101783
  return host;
@@ -102255,11 +102440,14 @@ var ts;
102255
102440
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
102256
102441
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
102257
102442
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
102258
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
102259
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
102260
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
102261
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
102262
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
102443
+ UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
102444
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
102445
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
102446
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
102447
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
102448
+ UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 12] = "UpToDateWithInputFileText";
102449
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
102450
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
102263
102451
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
102264
102452
  function resolveConfigFileProjectName(project) {
102265
102453
  if (ts.fileExtensionIs(project, ".json")) {
@@ -102297,9 +102485,10 @@ var ts;
102297
102485
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
102298
102486
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
102299
102487
  }
102300
- function newer(date1, date2) {
102301
- return date2 > date1 ? date2 : date1;
102488
+ function getCurrentTime(host) {
102489
+ return host.now ? host.now() : new Date();
102302
102490
  }
102491
+ ts.getCurrentTime = getCurrentTime;
102303
102492
  function isCircularBuildOrder(buildOrder) {
102304
102493
  return !!buildOrder && !!buildOrder.buildOrder;
102305
102494
  }
@@ -102383,6 +102572,7 @@ var ts;
102383
102572
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
102384
102573
  };
102385
102574
  }
102575
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), undefined); };
102386
102576
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
102387
102577
  var state = {
102388
102578
  host: host,
@@ -102398,8 +102588,9 @@ var ts;
102398
102588
  resolvedConfigFilePaths: new ts.Map(),
102399
102589
  configFileCache: new ts.Map(),
102400
102590
  projectStatus: new ts.Map(),
102401
- buildInfoChecked: new ts.Map(),
102402
102591
  extendedConfigCache: new ts.Map(),
102592
+ buildInfoCache: new ts.Map(),
102593
+ outputTimeStamps: new ts.Map(),
102403
102594
  builderPrograms: new ts.Map(),
102404
102595
  diagnostics: new ts.Map(),
102405
102596
  projectPendingBuild: new ts.Map(),
@@ -102421,6 +102612,7 @@ var ts;
102421
102612
  allWatchedConfigFiles: new ts.Map(),
102422
102613
  allWatchedExtendedConfigFiles: new ts.Map(),
102423
102614
  allWatchedPackageJsonFiles: new ts.Map(),
102615
+ filesWatched: new ts.Map(),
102424
102616
  lastCachedPackageJsonLookups: new ts.Map(),
102425
102617
  timerToBuildInvalidatedProject: undefined,
102426
102618
  reportFileChangeDetected: false,
@@ -102522,11 +102714,12 @@ var ts;
102522
102714
  var noopOnDelete = { onDeleteValue: ts.noop };
102523
102715
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
102524
102716
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
102525
- ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
102526
102717
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
102527
102718
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
102528
102719
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
102529
102720
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
102721
+ ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
102722
+ ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
102530
102723
  if (state.watch) {
102531
102724
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
102532
102725
  state.allWatchedExtendedConfigFiles.forEach(function (watcher) {
@@ -102812,16 +103005,16 @@ var ts;
102812
103005
  }
102813
103006
  function emit(writeFileCallback, cancellationToken, customTransformers) {
102814
103007
  var _a;
102815
- var _b, _c;
103008
+ var _b, _c, _d;
102816
103009
  ts.Debug.assertIsDefined(program);
102817
103010
  ts.Debug.assert(step === BuildStep.Emit);
102818
- program.backupState();
103011
+ program.backupEmitState();
102819
103012
  var declDiagnostics;
102820
103013
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
102821
103014
  var outputFiles = [];
102822
- var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
103015
+ var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, 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, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
102823
103016
  if (declDiagnostics) {
102824
- program.restoreState();
103017
+ program.restoreEmitState();
102825
103018
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
102826
103019
  return {
102827
103020
  emitSkipped: true,
@@ -102830,35 +103023,43 @@ var ts;
102830
103023
  }
102831
103024
  var host = state.host, compilerHost = state.compilerHost;
102832
103025
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
102833
- var newestDeclarationFileContentChangedTime = minimumDate;
102834
- var anyDtsChanged = false;
103026
+ var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
102835
103027
  var emitterDiagnostics = ts.createDiagnosticCollection();
102836
103028
  var emittedOutputs = new ts.Map();
103029
+ var options = program.getCompilerOptions();
103030
+ var isIncremental = ts.isIncrementalCompilation(options);
103031
+ var outputTimeStampMap;
103032
+ var now;
102837
103033
  outputFiles.forEach(function (_a) {
102838
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
102839
- var priorChangeTime;
102840
- if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
102841
- if (host.fileExists(name) && state.readFileWithCache(name) === text) {
102842
- priorChangeTime = host.getModifiedTime(name);
102843
- }
102844
- else {
103034
+ var _b, _c;
103035
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
103036
+ var path = toPath(state, name);
103037
+ emittedOutputs.set(toPath(state, name), name);
103038
+ if (buildInfo) {
103039
+ setBuildInfo(state, buildInfo, projectPath, options);
103040
+ 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)) {
102845
103041
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
102846
- anyDtsChanged = true;
102847
103042
  }
102848
103043
  }
102849
- emittedOutputs.set(toPath(state, name), name);
102850
103044
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
102851
- if (priorChangeTime !== undefined) {
102852
- newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
103045
+ if (!isIncremental && state.watch) {
103046
+ (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
102853
103047
  }
102854
103048
  });
102855
- finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime, anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
103049
+ finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
102856
103050
  return emitResult;
102857
103051
  }
102858
103052
  function emitBuildInfo(writeFileCallback, cancellationToken) {
102859
103053
  ts.Debug.assertIsDefined(program);
102860
103054
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
102861
- var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
103055
+ var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
103056
+ if (data === null || data === void 0 ? void 0 : data.buildInfo)
103057
+ setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
103058
+ if (writeFileCallback)
103059
+ writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
103060
+ else
103061
+ state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
103062
+ }, cancellationToken);
102862
103063
  if (emitResult.diagnostics.length) {
102863
103064
  reportErrors(state, emitResult.diagnostics);
102864
103065
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -102871,7 +103072,7 @@ var ts;
102871
103072
  step = BuildStep.QueueReferencingProjects;
102872
103073
  return emitResult;
102873
103074
  }
102874
- function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
103075
+ function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
102875
103076
  var _a;
102876
103077
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
102877
103078
  if (emitDiagnostics.length) {
@@ -102881,13 +103082,11 @@ var ts;
102881
103082
  if (state.write) {
102882
103083
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
102883
103084
  }
102884
- var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
103085
+ updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
102885
103086
  state.diagnostics.delete(projectPath);
102886
103087
  state.projectStatus.set(projectPath, {
102887
103088
  type: ts.UpToDateStatusType.UpToDate,
102888
- newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
102889
- maximumDate :
102890
- newestDeclarationFileContentChangedTime,
103089
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
102891
103090
  oldestOutputFileName: oldestOutputFileName
102892
103091
  });
102893
103092
  afterProgramDone(state, program, config);
@@ -102920,12 +103119,21 @@ var ts;
102920
103119
  ts.Debug.assert(!!outputFiles.length);
102921
103120
  var emitterDiagnostics = ts.createDiagnosticCollection();
102922
103121
  var emittedOutputs = new ts.Map();
103122
+ var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
103123
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
102923
103124
  outputFiles.forEach(function (_a) {
102924
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
103125
+ var _b, _c;
103126
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
102925
103127
  emittedOutputs.set(toPath(state, name), name);
103128
+ if (buildInfo) {
103129
+ setBuildInfo(state, buildInfo, projectPath, config.options);
103130
+ if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
103131
+ resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
103132
+ }
103133
+ }
102926
103134
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
102927
103135
  });
102928
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate, false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
103136
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
102929
103137
  return { emitSkipped: false, diagnostics: emitDiagnostics };
102930
103138
  }
102931
103139
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -103025,7 +103233,7 @@ var ts;
103025
103233
  }
103026
103234
  continue;
103027
103235
  }
103028
- if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
103236
+ if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts.UpToDateStatusType.UpToDateWithInputFileText) {
103029
103237
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
103030
103238
  return createUpdateOutputFileStampsProject(state, project, projectPath, config, buildOrder);
103031
103239
  }
@@ -103081,7 +103289,7 @@ var ts;
103081
103289
  state.projectCompilerOptions = state.baseCompilerOptions;
103082
103290
  }
103083
103291
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
103084
- var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
103292
+ var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
103085
103293
  reportAndStoreErrors(state, resolvedPath, diagnostics);
103086
103294
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
103087
103295
  if (canEmitBuildInfo)
@@ -103089,8 +103297,94 @@ var ts;
103089
103297
  afterProgramDone(state, program, config);
103090
103298
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
103091
103299
  }
103300
+ function isFileWatcherWithModifiedTime(value) {
103301
+ return !!value.watcher;
103302
+ }
103303
+ function getModifiedTime(state, fileName) {
103304
+ var path = toPath(state, fileName);
103305
+ var existing = state.filesWatched.get(path);
103306
+ if (state.watch && !!existing) {
103307
+ if (!isFileWatcherWithModifiedTime(existing))
103308
+ return existing;
103309
+ if (existing.modifiedTime)
103310
+ return existing.modifiedTime;
103311
+ }
103312
+ var result = ts.getModifiedTime(state.host, fileName);
103313
+ if (state.watch) {
103314
+ if (existing)
103315
+ existing.modifiedTime = result;
103316
+ else
103317
+ state.filesWatched.set(path, result);
103318
+ }
103319
+ return result;
103320
+ }
103321
+ function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
103322
+ var path = toPath(state, file);
103323
+ var existing = state.filesWatched.get(path);
103324
+ if (existing && isFileWatcherWithModifiedTime(existing)) {
103325
+ existing.callbacks.push(callback);
103326
+ }
103327
+ else {
103328
+ var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
103329
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
103330
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
103331
+ existing.modifiedTime = modifiedTime;
103332
+ existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
103333
+ }, pollingInterval, options, watchType, project);
103334
+ state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
103335
+ }
103336
+ return {
103337
+ close: function () {
103338
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
103339
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
103340
+ if (existing.callbacks.length === 1) {
103341
+ state.filesWatched.delete(path);
103342
+ ts.closeFileWatcherOf(existing);
103343
+ }
103344
+ else {
103345
+ ts.unorderedRemoveItem(existing.callbacks, callback);
103346
+ }
103347
+ }
103348
+ };
103349
+ }
103350
+ function getOutputTimeStampMap(state, resolvedConfigFilePath) {
103351
+ if (!state.watch)
103352
+ return undefined;
103353
+ var result = state.outputTimeStamps.get(resolvedConfigFilePath);
103354
+ if (!result)
103355
+ state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
103356
+ return result;
103357
+ }
103358
+ function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
103359
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
103360
+ var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
103361
+ if (existing) {
103362
+ existing.buildInfo = buildInfo;
103363
+ existing.modifiedTime = getCurrentTime(state.host);
103364
+ }
103365
+ else {
103366
+ state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
103367
+ }
103368
+ }
103369
+ function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
103370
+ var path = toPath(state, buildInfoPath);
103371
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
103372
+ return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
103373
+ }
103374
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
103375
+ var path = toPath(state, buildInfoPath);
103376
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
103377
+ if (existing !== undefined && existing.path === path) {
103378
+ return existing.buildInfo || undefined;
103379
+ }
103380
+ var value = state.readFileWithCache(buildInfoPath);
103381
+ var buildInfo = value ? ts.getBuildInfo(value) : undefined;
103382
+ ts.Debug.assert(modifiedTime || !buildInfo);
103383
+ state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
103384
+ return buildInfo;
103385
+ }
103092
103386
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
103093
- var tsconfigTime = ts.getModifiedTime(state.host, configFile);
103387
+ var tsconfigTime = getModifiedTime(state, configFile);
103094
103388
  if (oldestOutputFileTime < tsconfigTime) {
103095
103389
  return {
103096
103390
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -103100,76 +103394,22 @@ var ts;
103100
103394
  }
103101
103395
  }
103102
103396
  function getUpToDateStatusWorker(state, project, resolvedPath) {
103103
- var force = !!state.options.force;
103104
- var newestInputFileName = undefined;
103105
- var newestInputFileTime = minimumDate;
103106
- var host = state.host;
103107
- for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
103108
- var inputFile = _a[_i];
103109
- if (!host.fileExists(inputFile)) {
103110
- return {
103111
- type: ts.UpToDateStatusType.Unbuildable,
103112
- reason: inputFile + " does not exist"
103113
- };
103114
- }
103115
- if (!force) {
103116
- var inputTime = ts.getModifiedTime(host, inputFile);
103117
- if (inputTime > newestInputFileTime) {
103118
- newestInputFileName = inputFile;
103119
- newestInputFileTime = inputTime;
103120
- }
103121
- }
103122
- }
103397
+ var _a, _b, _c;
103123
103398
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
103124
103399
  return {
103125
103400
  type: ts.UpToDateStatusType.ContainerOnly
103126
103401
  };
103127
103402
  }
103128
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
103129
- var oldestOutputFileName = "(none)";
103130
- var oldestOutputFileTime = maximumDate;
103131
- var newestOutputFileName = "(none)";
103132
- var newestOutputFileTime = minimumDate;
103133
- var missingOutputFileName;
103134
- var newestDeclarationFileContentChangedTime = minimumDate;
103135
- var isOutOfDateWithInputs = false;
103136
- if (!force) {
103137
- for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
103138
- var output = outputs_1[_b];
103139
- if (!host.fileExists(output)) {
103140
- missingOutputFileName = output;
103141
- break;
103142
- }
103143
- var outputTime = ts.getModifiedTime(host, output);
103144
- if (outputTime < oldestOutputFileTime) {
103145
- oldestOutputFileTime = outputTime;
103146
- oldestOutputFileName = output;
103147
- }
103148
- if (outputTime < newestInputFileTime) {
103149
- isOutOfDateWithInputs = true;
103150
- break;
103151
- }
103152
- if (outputTime > newestOutputFileTime) {
103153
- newestOutputFileTime = outputTime;
103154
- newestOutputFileName = output;
103155
- }
103156
- if (ts.isDeclarationFileName(output)) {
103157
- var outputModifiedTime = ts.getModifiedTime(host, output);
103158
- newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
103159
- }
103160
- }
103161
- }
103162
- var pseudoUpToDate = false;
103163
- var usesPrepend = false;
103164
- var upstreamChangedProject;
103403
+ var referenceStatuses;
103404
+ var force = !!state.options.force;
103165
103405
  if (project.projectReferences) {
103166
103406
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
103167
- for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
103168
- var ref = _d[_c];
103169
- usesPrepend = usesPrepend || !!(ref.prepend);
103407
+ for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
103408
+ var ref = _d[_i];
103170
103409
  var resolvedRef = ts.resolveProjectReferencePath(ref);
103171
103410
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
103172
- var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
103411
+ var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
103412
+ var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
103173
103413
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
103174
103414
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) {
103175
103415
  continue;
@@ -103188,65 +103428,169 @@ var ts;
103188
103428
  upstreamProjectName: ref.path
103189
103429
  };
103190
103430
  }
103191
- if (!force && !missingOutputFileName) {
103192
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
103193
- continue;
103194
- }
103195
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
103196
- pseudoUpToDate = true;
103197
- upstreamChangedProject = ref.path;
103198
- continue;
103199
- }
103200
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
103431
+ if (!force)
103432
+ (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
103433
+ }
103434
+ }
103435
+ if (force)
103436
+ return { type: ts.UpToDateStatusType.ForceBuild };
103437
+ var host = state.host;
103438
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
103439
+ var oldestOutputFileName = "(none)";
103440
+ var oldestOutputFileTime = maximumDate;
103441
+ var buildInfoTime;
103442
+ var buildInfoProgram;
103443
+ var buildInfoVersionMap;
103444
+ var newestDeclarationFileContentChangedTime;
103445
+ if (buildInfoPath) {
103446
+ var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
103447
+ buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
103448
+ if (buildInfoTime === ts.missingFileModifiedTime) {
103449
+ if (!buildInfoCacheEntry_1) {
103450
+ state.buildInfoCache.set(resolvedPath, {
103451
+ path: toPath(state, buildInfoPath),
103452
+ buildInfo: false,
103453
+ modifiedTime: buildInfoTime
103454
+ });
103455
+ }
103456
+ return {
103457
+ type: ts.UpToDateStatusType.OutputMissing,
103458
+ missingOutputFileName: buildInfoPath
103459
+ };
103460
+ }
103461
+ var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
103462
+ if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
103463
+ return {
103464
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
103465
+ version: buildInfo.version
103466
+ };
103467
+ }
103468
+ if (buildInfo.program) {
103469
+ if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
103470
+ (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
103201
103471
  return {
103202
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
103203
- outOfDateOutputFileName: oldestOutputFileName,
103204
- newerProjectName: ref.path
103472
+ type: ts.UpToDateStatusType.OutOfDateBuildInfo,
103473
+ buildInfoFile: buildInfoPath
103205
103474
  };
103206
103475
  }
103476
+ buildInfoProgram = buildInfo.program;
103207
103477
  }
103478
+ oldestOutputFileTime = buildInfoTime;
103479
+ oldestOutputFileName = buildInfoPath;
103480
+ newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
103208
103481
  }
103209
- if (missingOutputFileName !== undefined) {
103210
- return {
103211
- type: ts.UpToDateStatusType.OutputMissing,
103212
- missingOutputFileName: missingOutputFileName
103213
- };
103482
+ var newestInputFileName = undefined;
103483
+ var newestInputFileTime = minimumDate;
103484
+ var pseudoInputUptodate = false;
103485
+ for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
103486
+ var inputFile = _f[_e];
103487
+ var inputTime = getModifiedTime(state, inputFile);
103488
+ if (inputTime === ts.missingFileModifiedTime) {
103489
+ return {
103490
+ type: ts.UpToDateStatusType.Unbuildable,
103491
+ reason: inputFile + " does not exist"
103492
+ };
103493
+ }
103494
+ if (buildInfoTime && buildInfoTime < inputTime) {
103495
+ var version_3 = void 0;
103496
+ var currentVersion = void 0;
103497
+ if (buildInfoProgram) {
103498
+ if (!buildInfoVersionMap)
103499
+ buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
103500
+ version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
103501
+ var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
103502
+ currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
103503
+ if (version_3 && version_3 === currentVersion)
103504
+ pseudoInputUptodate = true;
103505
+ }
103506
+ if (!version_3 || version_3 !== currentVersion) {
103507
+ return {
103508
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
103509
+ outOfDateOutputFileName: buildInfoPath,
103510
+ newerInputFileName: inputFile
103511
+ };
103512
+ }
103513
+ }
103514
+ if (inputTime > newestInputFileTime) {
103515
+ newestInputFileName = inputFile;
103516
+ newestInputFileTime = inputTime;
103517
+ }
103214
103518
  }
103215
- if (isOutOfDateWithInputs) {
103216
- return {
103217
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
103218
- outOfDateOutputFileName: oldestOutputFileName,
103219
- newerInputFileName: newestInputFileName
103220
- };
103519
+ if (!buildInfoPath) {
103520
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
103521
+ var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
103522
+ for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
103523
+ var output = outputs_1[_g];
103524
+ var path = toPath(state, output);
103525
+ var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
103526
+ if (!outputTime) {
103527
+ outputTime = ts.getModifiedTime(state.host, output);
103528
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
103529
+ }
103530
+ if (outputTime === ts.missingFileModifiedTime) {
103531
+ return {
103532
+ type: ts.UpToDateStatusType.OutputMissing,
103533
+ missingOutputFileName: output
103534
+ };
103535
+ }
103536
+ if (outputTime < oldestOutputFileTime) {
103537
+ oldestOutputFileTime = outputTime;
103538
+ oldestOutputFileName = output;
103539
+ }
103540
+ if (outputTime < newestInputFileTime) {
103541
+ return {
103542
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
103543
+ outOfDateOutputFileName: oldestOutputFileName,
103544
+ newerInputFileName: newestInputFileName
103545
+ };
103546
+ }
103547
+ }
103221
103548
  }
103222
- else {
103223
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
103224
- if (configStatus)
103225
- return configStatus;
103226
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
103227
- if (extendedConfigStatus)
103228
- return extendedConfigStatus;
103229
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
103230
- var path = _a[0];
103231
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
103232
- });
103233
- if (dependentPackageFileStatus)
103234
- return dependentPackageFileStatus;
103235
- }
103236
- if (!force && !state.buildInfoChecked.has(resolvedPath)) {
103237
- state.buildInfoChecked.set(resolvedPath, true);
103238
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
103239
- if (buildInfoPath) {
103240
- var value = state.readFileWithCache(buildInfoPath);
103241
- var buildInfo = value && ts.getBuildInfo(value);
103242
- if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
103549
+ var seenRefs = buildInfoPath ? new ts.Set() : undefined;
103550
+ var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
103551
+ seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
103552
+ var pseudoUpToDate = false;
103553
+ var usesPrepend = false;
103554
+ var upstreamChangedProject;
103555
+ if (referenceStatuses) {
103556
+ for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
103557
+ var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
103558
+ usesPrepend = usesPrepend || !!(ref.prepend);
103559
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
103560
+ continue;
103561
+ }
103562
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
103243
103563
  return {
103244
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
103245
- version: buildInfo.version
103564
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
103565
+ outOfDateOutputFileName: buildInfoPath,
103566
+ newerProjectName: ref.path
103246
103567
  };
103247
103568
  }
103569
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
103570
+ pseudoUpToDate = true;
103571
+ upstreamChangedProject = ref.path;
103572
+ continue;
103573
+ }
103574
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
103575
+ return {
103576
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
103577
+ outOfDateOutputFileName: oldestOutputFileName,
103578
+ newerProjectName: ref.path
103579
+ };
103248
103580
  }
103249
103581
  }
103582
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
103583
+ if (configStatus)
103584
+ return configStatus;
103585
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
103586
+ if (extendedConfigStatus)
103587
+ return extendedConfigStatus;
103588
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
103589
+ var path = _a[0];
103590
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
103591
+ });
103592
+ if (dependentPackageFileStatus)
103593
+ return dependentPackageFileStatus;
103250
103594
  if (usesPrepend && pseudoUpToDate) {
103251
103595
  return {
103252
103596
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -103255,15 +103599,36 @@ var ts;
103255
103599
  };
103256
103600
  }
103257
103601
  return {
103258
- type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
103602
+ type: pseudoUpToDate ?
103603
+ ts.UpToDateStatusType.UpToDateWithUpstreamTypes :
103604
+ pseudoInputUptodate ?
103605
+ ts.UpToDateStatusType.UpToDateWithInputFileText :
103606
+ ts.UpToDateStatusType.UpToDate,
103259
103607
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
103260
103608
  newestInputFileTime: newestInputFileTime,
103261
- newestOutputFileTime: newestOutputFileTime,
103262
103609
  newestInputFileName: newestInputFileName,
103263
- newestOutputFileName: newestOutputFileName,
103264
103610
  oldestOutputFileName: oldestOutputFileName
103265
103611
  };
103266
103612
  }
103613
+ function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
103614
+ if (seenRefs.has(resolvedRefPath))
103615
+ return false;
103616
+ seenRefs.add(resolvedRefPath);
103617
+ var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
103618
+ if (refBuildInfo.path === buildInfoCacheEntry.path)
103619
+ return true;
103620
+ if (resolvedConfig.projectReferences) {
103621
+ for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
103622
+ var ref = _a[_i];
103623
+ var resolvedRef = ts.resolveProjectReferencePath(ref);
103624
+ var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
103625
+ var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
103626
+ if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
103627
+ return true;
103628
+ }
103629
+ }
103630
+ return false;
103631
+ }
103267
103632
  function getUpToDateStatus(state, project, resolvedPath) {
103268
103633
  if (project === undefined) {
103269
103634
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -103276,39 +103641,64 @@ var ts;
103276
103641
  state.projectStatus.set(resolvedPath, actual);
103277
103642
  return actual;
103278
103643
  }
103279
- function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
103644
+ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
103280
103645
  if (proj.options.noEmit)
103281
- return priorNewestUpdateTime;
103646
+ return;
103647
+ var now;
103648
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
103649
+ if (buildInfoPath) {
103650
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
103651
+ if (!!state.options.verbose)
103652
+ reportStatus(state, verboseMessage, proj.options.configFilePath);
103653
+ state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
103654
+ getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
103655
+ }
103656
+ state.outputTimeStamps.delete(projectPath);
103657
+ return;
103658
+ }
103282
103659
  var host = state.host;
103283
103660
  var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
103661
+ var outputTimeStampMap = getOutputTimeStampMap(state, projectPath);
103662
+ var modifiedOutputs = outputTimeStampMap ? new ts.Set() : undefined;
103284
103663
  if (!skipOutputs || outputs.length !== skipOutputs.size) {
103285
103664
  var reportVerbose = !!state.options.verbose;
103286
- var now = host.now ? host.now() : new Date();
103287
103665
  for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
103288
103666
  var file = outputs_2[_i];
103289
- if (skipOutputs && skipOutputs.has(toPath(state, file))) {
103667
+ var path = toPath(state, file);
103668
+ if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
103290
103669
  continue;
103291
- }
103292
103670
  if (reportVerbose) {
103293
103671
  reportVerbose = false;
103294
103672
  reportStatus(state, verboseMessage, proj.options.configFilePath);
103295
103673
  }
103296
- if (ts.isDeclarationFileName(file)) {
103297
- priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
103674
+ host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
103675
+ if (outputTimeStampMap) {
103676
+ outputTimeStampMap.set(path, now);
103677
+ modifiedOutputs.add(path);
103298
103678
  }
103299
- host.setModifiedTime(file, now);
103300
103679
  }
103301
103680
  }
103302
- return priorNewestUpdateTime;
103681
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.forEach(function (_value, key) {
103682
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key))
103683
+ outputTimeStampMap.delete(key);
103684
+ });
103685
+ }
103686
+ function getDtsChangeTime(state, options, resolvedConfigPath) {
103687
+ var _a;
103688
+ if (!options.composite)
103689
+ return undefined;
103690
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
103691
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, undefined);
103692
+ 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;
103303
103693
  }
103304
103694
  function updateOutputTimestamps(state, proj, resolvedPath) {
103305
103695
  if (state.options.dry) {
103306
103696
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
103307
103697
  }
103308
- var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
103698
+ updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
103309
103699
  state.projectStatus.set(resolvedPath, {
103310
103700
  type: ts.UpToDateStatusType.UpToDate,
103311
- newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
103701
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
103312
103702
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
103313
103703
  });
103314
103704
  }
@@ -103347,6 +103737,7 @@ var ts;
103347
103737
  }
103348
103738
  break;
103349
103739
  }
103740
+ case ts.UpToDateStatusType.UpToDateWithInputFileText:
103350
103741
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
103351
103742
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
103352
103743
  if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
@@ -103490,12 +103881,10 @@ var ts;
103490
103881
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
103491
103882
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
103492
103883
  return;
103493
- state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
103494
- invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
103495
- }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
103884
+ 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));
103496
103885
  }
103497
103886
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
103498
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
103887
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
103499
103888
  var _a;
103500
103889
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
103501
103890
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -103527,7 +103916,7 @@ var ts;
103527
103916
  if (!state.watch)
103528
103917
  return;
103529
103918
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
103530
- 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); },
103919
+ 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); },
103531
103920
  onDeleteValue: ts.closeFileWatcher,
103532
103921
  });
103533
103922
  }
@@ -103535,7 +103924,7 @@ var ts;
103535
103924
  if (!state.watch || !state.lastCachedPackageJsonLookups)
103536
103925
  return;
103537
103926
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
103538
- createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
103927
+ 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); },
103539
103928
  onDeleteValue: ts.closeFileWatcher,
103540
103929
  });
103541
103930
  }
@@ -103659,25 +104048,26 @@ var ts;
103659
104048
  }
103660
104049
  }
103661
104050
  function reportUpToDateStatus(state, configFileName, status) {
103662
- if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
103663
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
103664
- }
103665
104051
  switch (status.type) {
103666
104052
  case ts.UpToDateStatusType.OutOfDateWithSelf:
103667
- 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));
104053
+ 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));
103668
104054
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
103669
- 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));
104055
+ 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));
103670
104056
  case ts.UpToDateStatusType.OutputMissing:
103671
104057
  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));
104058
+ case ts.UpToDateStatusType.OutOfDateBuildInfo:
104059
+ 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));
103672
104060
  case ts.UpToDateStatusType.UpToDate:
103673
104061
  if (status.newestInputFileTime !== undefined) {
103674
- 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 || ""));
104062
+ 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 || ""));
103675
104063
  }
103676
104064
  break;
103677
104065
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
103678
104066
  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));
103679
104067
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
103680
104068
  return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName));
104069
+ case ts.UpToDateStatusType.UpToDateWithInputFileText:
104070
+ 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));
103681
104071
  case ts.UpToDateStatusType.UpstreamOutOfDate:
103682
104072
  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));
103683
104073
  case ts.UpToDateStatusType.UpstreamBlocked:
@@ -103688,6 +104078,8 @@ var ts;
103688
104078
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
103689
104079
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
103690
104080
  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);
104081
+ case ts.UpToDateStatusType.ForceBuild:
104082
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
103691
104083
  case ts.UpToDateStatusType.ContainerOnly:
103692
104084
  case ts.UpToDateStatusType.ComputingUpstream:
103693
104085
  break;