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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6200,7 +6200,7 @@ var ts;
6200
6200
  };
6201
6201
  }
6202
6202
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6203
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6203
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6204
6204
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6205
6205
  if (!ts.isString(relativeFileName))
6206
6206
  return;
@@ -6210,7 +6210,7 @@ var ts;
6210
6210
  if (callbacks) {
6211
6211
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6212
6212
  var fileCallback = callbacks_1[_i];
6213
- fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6213
+ fileCallback(fileName, FileWatcherEventKind.Changed);
6214
6214
  }
6215
6215
  }
6216
6216
  },
@@ -6264,7 +6264,7 @@ var ts;
6264
6264
  }
6265
6265
  else {
6266
6266
  cache.set(path, {
6267
- watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6267
+ watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6268
6268
  refCount: 1
6269
6269
  });
6270
6270
  }
@@ -6292,7 +6292,7 @@ var ts;
6292
6292
  var newTime = modifiedTime.getTime();
6293
6293
  if (oldTime !== newTime) {
6294
6294
  watchedFile.mtime = modifiedTime;
6295
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6295
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6296
6296
  return true;
6297
6297
  }
6298
6298
  return false;
@@ -6543,18 +6543,17 @@ var ts;
6543
6543
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6544
6544
  /*@internal*/
6545
6545
  function createFileWatcherCallback(callback) {
6546
- return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6546
+ return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6547
6547
  }
6548
6548
  ts.createFileWatcherCallback = createFileWatcherCallback;
6549
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6550
- return function (eventName, _relativeFileName, modifiedTime) {
6549
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6550
+ return function (eventName) {
6551
6551
  if (eventName === "rename") {
6552
- modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6553
- callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6552
+ callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6554
6553
  }
6555
6554
  else {
6556
6555
  // Change
6557
- callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6556
+ callback(fileName, FileWatcherEventKind.Changed);
6558
6557
  }
6559
6558
  };
6560
6559
  }
@@ -6578,7 +6577,7 @@ var ts;
6578
6577
  }
6579
6578
  /*@internal*/
6580
6579
  function createSystemWatchFunctions(_a) {
6581
- var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind;
6580
+ 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;
6582
6581
  var dynamicPollingWatchFile;
6583
6582
  var fixedChunkSizePollingWatchFile;
6584
6583
  var nonPollingWatchFile;
@@ -6600,7 +6599,7 @@ var ts;
6600
6599
  case ts.WatchFileKind.FixedChunkSizePolling:
6601
6600
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6602
6601
  case ts.WatchFileKind.UseFsEvents:
6603
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6602
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6604
6603
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6605
6604
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6606
6605
  if (!nonPollingWatchFile) {
@@ -6782,6 +6781,7 @@ var ts;
6782
6781
  fsWatch: fsWatch,
6783
6782
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6784
6783
  getCurrentDirectory: getCurrentDirectory,
6784
+ fileExists: fileExists,
6785
6785
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6786
6786
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6787
6787
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7041,7 +7041,7 @@ var ts;
7041
7041
  // File changed
7042
7042
  eventKind = FileWatcherEventKind.Changed;
7043
7043
  }
7044
- callback(fileName, eventKind, curr.mtime);
7044
+ callback(fileName, eventKind);
7045
7045
  }
7046
7046
  }
7047
7047
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7067,10 +7067,10 @@ var ts;
7067
7067
  * Invoke the callback with rename and update the watcher if not closed
7068
7068
  * @param createWatcher
7069
7069
  */
7070
- function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7070
+ function invokeCallbackAndUpdateWatcher(createWatcher) {
7071
7071
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7072
7072
  // Call the callback for current directory
7073
- callback("rename", "", modifiedTime);
7073
+ callback("rename", "");
7074
7074
  // If watcher is not closed, update it
7075
7075
  if (watcher) {
7076
7076
  watcher.close();
@@ -7116,14 +7116,13 @@ var ts;
7116
7116
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7117
7117
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7118
7118
  // Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
7119
- var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
7120
7119
  return event === "rename" &&
7121
7120
  (!relativeName ||
7122
7121
  relativeName === lastDirectoryPart ||
7123
7122
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7124
- modifiedTime === ts.missingFileModifiedTime ?
7125
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7126
- callback(event, relativeName, modifiedTime);
7123
+ !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7124
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7125
+ callback(event, relativeName);
7127
7126
  }
7128
7127
  /**
7129
7128
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7137,15 +7136,12 @@ var ts;
7137
7136
  * and switch to existing file or directory when the missing filesystem entry is created
7138
7137
  */
7139
7138
  function watchMissingFileSystemEntry() {
7140
- return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
7141
- if (eventKind === FileWatcherEventKind.Created) {
7142
- modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
7143
- if (modifiedTime !== ts.missingFileModifiedTime) {
7144
- // Call the callback for current file or directory
7145
- // For now it could be callback for the inner directory creation,
7146
- // but just return current directory, better than current no-op
7147
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
7148
- }
7139
+ return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7140
+ if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7141
+ // Call the callback for current file or directory
7142
+ // For now it could be callback for the inner directory creation,
7143
+ // but just return current directory, better than current no-op
7144
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
7149
7145
  }
7150
7146
  }, fallbackPollingInterval, fallbackOptions);
7151
7147
  }
@@ -7295,19 +7291,12 @@ var ts;
7295
7291
  }
7296
7292
  function getModifiedTime(path) {
7297
7293
  var _a;
7298
- // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7299
- // the CPU time performance.
7300
- var originalStackTraceLimit = Error.stackTraceLimit;
7301
- Error.stackTraceLimit = 0;
7302
7294
  try {
7303
7295
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7304
7296
  }
7305
7297
  catch (e) {
7306
7298
  return undefined;
7307
7299
  }
7308
- finally {
7309
- Error.stackTraceLimit = originalStackTraceLimit;
7310
- }
7311
7300
  }
7312
7301
  function setModifiedTime(path, time) {
7313
7302
  try {
@@ -9330,8 +9319,8 @@ var ts;
9330
9319
  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"),
9331
9320
  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"),
9332
9321
  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."),
9333
- Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"),
9334
- Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),
9322
+ 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}'"),
9323
+ 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}'"),
9335
9324
  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"),
9336
9325
  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"),
9337
9326
  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"),
@@ -9375,8 +9364,6 @@ var ts;
9375
9364
  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}'."),
9376
9365
  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}'."),
9377
9366
  Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, ts.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),
9378
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted: diag(6399, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes are not emitted"),
9379
- Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs update to timestamps of output files that are older than input files"),
9380
9367
  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}'"),
9381
9368
  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."),
9382
9369
  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."),
@@ -20207,10 +20194,6 @@ var ts;
20207
20194
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20208
20195
  }
20209
20196
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20210
- function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20211
- return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20212
- }
20213
- ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20214
20197
  function getCompilerOptionValue(options, option) {
20215
20198
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20216
20199
  }
@@ -39251,7 +39234,6 @@ var ts;
39251
39234
  type: "boolean",
39252
39235
  affectsSemanticDiagnostics: true,
39253
39236
  affectsEmit: true,
39254
- affectsMultiFileEmitBuildInfo: true,
39255
39237
  category: ts.Diagnostics.Watch_and_Build_Modes,
39256
39238
  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,
39257
39239
  defaultValueDescription: false,
@@ -39286,40 +39268,12 @@ var ts;
39286
39268
  affectsSourceFile: true,
39287
39269
  affectsModuleResolution: true,
39288
39270
  affectsEmit: true,
39289
- affectsMultiFileEmitBuildInfo: true,
39290
39271
  paramType: ts.Diagnostics.VERSION,
39291
39272
  showInSimplifiedHelpView: true,
39292
39273
  category: ts.Diagnostics.Language_and_Environment,
39293
39274
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39294
39275
  defaultValueDescription: 0 /* ES3 */,
39295
39276
  };
39296
- /*@internal*/
39297
- ts.moduleOptionDeclaration = {
39298
- name: "module",
39299
- shortName: "m",
39300
- type: new ts.Map(ts.getEntries({
39301
- none: ts.ModuleKind.None,
39302
- commonjs: ts.ModuleKind.CommonJS,
39303
- amd: ts.ModuleKind.AMD,
39304
- system: ts.ModuleKind.System,
39305
- umd: ts.ModuleKind.UMD,
39306
- es6: ts.ModuleKind.ES2015,
39307
- es2015: ts.ModuleKind.ES2015,
39308
- es2020: ts.ModuleKind.ES2020,
39309
- es2022: ts.ModuleKind.ES2022,
39310
- esnext: ts.ModuleKind.ESNext,
39311
- node16: ts.ModuleKind.Node16,
39312
- nodenext: ts.ModuleKind.NodeNext,
39313
- })),
39314
- affectsModuleResolution: true,
39315
- affectsEmit: true,
39316
- affectsMultiFileEmitBuildInfo: true,
39317
- paramType: ts.Diagnostics.KIND,
39318
- showInSimplifiedHelpView: true,
39319
- category: ts.Diagnostics.Modules,
39320
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39321
- defaultValueDescription: undefined,
39322
- };
39323
39277
  var commandOptionsWithoutBuild = [
39324
39278
  // CommandLine only options
39325
39279
  {
@@ -39381,14 +39335,37 @@ var ts;
39381
39335
  category: ts.Diagnostics.Command_line_Options,
39382
39336
  affectsSemanticDiagnostics: true,
39383
39337
  affectsEmit: true,
39384
- affectsMultiFileEmitBuildInfo: true,
39385
39338
  isCommandLineOnly: true,
39386
39339
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39387
39340
  defaultValueDescription: false,
39388
39341
  },
39389
39342
  // Basic
39390
39343
  ts.targetOptionDeclaration,
39391
- ts.moduleOptionDeclaration,
39344
+ {
39345
+ name: "module",
39346
+ shortName: "m",
39347
+ type: new ts.Map(ts.getEntries({
39348
+ none: ts.ModuleKind.None,
39349
+ commonjs: ts.ModuleKind.CommonJS,
39350
+ amd: ts.ModuleKind.AMD,
39351
+ system: ts.ModuleKind.System,
39352
+ umd: ts.ModuleKind.UMD,
39353
+ es6: ts.ModuleKind.ES2015,
39354
+ es2015: ts.ModuleKind.ES2015,
39355
+ es2020: ts.ModuleKind.ES2020,
39356
+ es2022: ts.ModuleKind.ES2022,
39357
+ esnext: ts.ModuleKind.ESNext,
39358
+ node16: ts.ModuleKind.Node16,
39359
+ nodenext: ts.ModuleKind.NodeNext,
39360
+ })),
39361
+ affectsModuleResolution: true,
39362
+ affectsEmit: true,
39363
+ paramType: ts.Diagnostics.KIND,
39364
+ showInSimplifiedHelpView: true,
39365
+ category: ts.Diagnostics.Modules,
39366
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
39367
+ defaultValueDescription: undefined,
39368
+ },
39392
39369
  {
39393
39370
  name: "lib",
39394
39371
  type: "list",
@@ -39425,7 +39402,6 @@ var ts;
39425
39402
  type: jsxOptionMap,
39426
39403
  affectsSourceFile: true,
39427
39404
  affectsEmit: true,
39428
- affectsMultiFileEmitBuildInfo: true,
39429
39405
  affectsModuleResolution: true,
39430
39406
  paramType: ts.Diagnostics.KIND,
39431
39407
  showInSimplifiedHelpView: true,
@@ -39438,7 +39414,6 @@ var ts;
39438
39414
  shortName: "d",
39439
39415
  type: "boolean",
39440
39416
  affectsEmit: true,
39441
- affectsMultiFileEmitBuildInfo: true,
39442
39417
  showInSimplifiedHelpView: true,
39443
39418
  category: ts.Diagnostics.Emit,
39444
39419
  transpileOptionValue: undefined,
@@ -39449,7 +39424,6 @@ var ts;
39449
39424
  name: "declarationMap",
39450
39425
  type: "boolean",
39451
39426
  affectsEmit: true,
39452
- affectsMultiFileEmitBuildInfo: true,
39453
39427
  showInSimplifiedHelpView: true,
39454
39428
  category: ts.Diagnostics.Emit,
39455
39429
  transpileOptionValue: undefined,
@@ -39460,7 +39434,6 @@ var ts;
39460
39434
  name: "emitDeclarationOnly",
39461
39435
  type: "boolean",
39462
39436
  affectsEmit: true,
39463
- affectsMultiFileEmitBuildInfo: true,
39464
39437
  showInSimplifiedHelpView: true,
39465
39438
  category: ts.Diagnostics.Emit,
39466
39439
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39471,7 +39444,6 @@ var ts;
39471
39444
  name: "sourceMap",
39472
39445
  type: "boolean",
39473
39446
  affectsEmit: true,
39474
- affectsMultiFileEmitBuildInfo: true,
39475
39447
  showInSimplifiedHelpView: true,
39476
39448
  category: ts.Diagnostics.Emit,
39477
39449
  defaultValueDescription: false,
@@ -39481,9 +39453,6 @@ var ts;
39481
39453
  name: "outFile",
39482
39454
  type: "string",
39483
39455
  affectsEmit: true,
39484
- affectsMultiFileEmitBuildInfo: true,
39485
- affectsDeclarationPath: true,
39486
- affectsBundleEmitBuildInfo: true,
39487
39456
  isFilePath: true,
39488
39457
  paramType: ts.Diagnostics.FILE,
39489
39458
  showInSimplifiedHelpView: true,
@@ -39495,8 +39464,6 @@ var ts;
39495
39464
  name: "outDir",
39496
39465
  type: "string",
39497
39466
  affectsEmit: true,
39498
- affectsMultiFileEmitBuildInfo: true,
39499
- affectsDeclarationPath: true,
39500
39467
  isFilePath: true,
39501
39468
  paramType: ts.Diagnostics.DIRECTORY,
39502
39469
  showInSimplifiedHelpView: true,
@@ -39507,8 +39474,6 @@ var ts;
39507
39474
  name: "rootDir",
39508
39475
  type: "string",
39509
39476
  affectsEmit: true,
39510
- affectsMultiFileEmitBuildInfo: true,
39511
- affectsDeclarationPath: true,
39512
39477
  isFilePath: true,
39513
39478
  paramType: ts.Diagnostics.LOCATION,
39514
39479
  category: ts.Diagnostics.Modules,
@@ -39519,8 +39484,6 @@ var ts;
39519
39484
  name: "composite",
39520
39485
  type: "boolean",
39521
39486
  affectsEmit: true,
39522
- affectsMultiFileEmitBuildInfo: true,
39523
- affectsBundleEmitBuildInfo: true,
39524
39487
  isTSConfigOnly: true,
39525
39488
  category: ts.Diagnostics.Projects,
39526
39489
  transpileOptionValue: undefined,
@@ -39531,8 +39494,6 @@ var ts;
39531
39494
  name: "tsBuildInfoFile",
39532
39495
  type: "string",
39533
39496
  affectsEmit: true,
39534
- affectsMultiFileEmitBuildInfo: true,
39535
- affectsBundleEmitBuildInfo: true,
39536
39497
  isFilePath: true,
39537
39498
  paramType: ts.Diagnostics.FILE,
39538
39499
  category: ts.Diagnostics.Projects,
@@ -39544,7 +39505,6 @@ var ts;
39544
39505
  name: "removeComments",
39545
39506
  type: "boolean",
39546
39507
  affectsEmit: true,
39547
- affectsMultiFileEmitBuildInfo: true,
39548
39508
  showInSimplifiedHelpView: true,
39549
39509
  category: ts.Diagnostics.Emit,
39550
39510
  defaultValueDescription: false,
@@ -39563,7 +39523,6 @@ var ts;
39563
39523
  name: "importHelpers",
39564
39524
  type: "boolean",
39565
39525
  affectsEmit: true,
39566
- affectsMultiFileEmitBuildInfo: true,
39567
39526
  category: ts.Diagnostics.Emit,
39568
39527
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39569
39528
  defaultValueDescription: false,
@@ -39577,7 +39536,6 @@ var ts;
39577
39536
  })),
39578
39537
  affectsEmit: true,
39579
39538
  affectsSemanticDiagnostics: true,
39580
- affectsMultiFileEmitBuildInfo: true,
39581
39539
  category: ts.Diagnostics.Emit,
39582
39540
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39583
39541
  defaultValueDescription: 0 /* Remove */,
@@ -39586,7 +39544,6 @@ var ts;
39586
39544
  name: "downlevelIteration",
39587
39545
  type: "boolean",
39588
39546
  affectsEmit: true,
39589
- affectsMultiFileEmitBuildInfo: true,
39590
39547
  category: ts.Diagnostics.Emit,
39591
39548
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39592
39549
  defaultValueDescription: false,
@@ -39605,9 +39562,6 @@ var ts;
39605
39562
  type: "boolean",
39606
39563
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39607
39564
  // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
39608
- // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
39609
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
39610
- affectsMultiFileEmitBuildInfo: true,
39611
39565
  showInSimplifiedHelpView: true,
39612
39566
  category: ts.Diagnostics.Type_Checking,
39613
39567
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39617,7 +39571,6 @@ var ts;
39617
39571
  name: "noImplicitAny",
39618
39572
  type: "boolean",
39619
39573
  affectsSemanticDiagnostics: true,
39620
- affectsMultiFileEmitBuildInfo: true,
39621
39574
  strictFlag: true,
39622
39575
  category: ts.Diagnostics.Type_Checking,
39623
39576
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39627,7 +39580,6 @@ var ts;
39627
39580
  name: "strictNullChecks",
39628
39581
  type: "boolean",
39629
39582
  affectsSemanticDiagnostics: true,
39630
- affectsMultiFileEmitBuildInfo: true,
39631
39583
  strictFlag: true,
39632
39584
  category: ts.Diagnostics.Type_Checking,
39633
39585
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39636,8 +39588,6 @@ var ts;
39636
39588
  {
39637
39589
  name: "strictFunctionTypes",
39638
39590
  type: "boolean",
39639
- affectsSemanticDiagnostics: true,
39640
- affectsMultiFileEmitBuildInfo: true,
39641
39591
  strictFlag: true,
39642
39592
  category: ts.Diagnostics.Type_Checking,
39643
39593
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39646,8 +39596,6 @@ var ts;
39646
39596
  {
39647
39597
  name: "strictBindCallApply",
39648
39598
  type: "boolean",
39649
- affectsSemanticDiagnostics: true,
39650
- affectsMultiFileEmitBuildInfo: true,
39651
39599
  strictFlag: true,
39652
39600
  category: ts.Diagnostics.Type_Checking,
39653
39601
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39657,7 +39605,6 @@ var ts;
39657
39605
  name: "strictPropertyInitialization",
39658
39606
  type: "boolean",
39659
39607
  affectsSemanticDiagnostics: true,
39660
- affectsMultiFileEmitBuildInfo: true,
39661
39608
  strictFlag: true,
39662
39609
  category: ts.Diagnostics.Type_Checking,
39663
39610
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39667,7 +39614,6 @@ var ts;
39667
39614
  name: "noImplicitThis",
39668
39615
  type: "boolean",
39669
39616
  affectsSemanticDiagnostics: true,
39670
- affectsMultiFileEmitBuildInfo: true,
39671
39617
  strictFlag: true,
39672
39618
  category: ts.Diagnostics.Type_Checking,
39673
39619
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39677,7 +39623,6 @@ var ts;
39677
39623
  name: "useUnknownInCatchVariables",
39678
39624
  type: "boolean",
39679
39625
  affectsSemanticDiagnostics: true,
39680
- affectsMultiFileEmitBuildInfo: true,
39681
39626
  strictFlag: true,
39682
39627
  category: ts.Diagnostics.Type_Checking,
39683
39628
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39687,8 +39632,6 @@ var ts;
39687
39632
  name: "alwaysStrict",
39688
39633
  type: "boolean",
39689
39634
  affectsSourceFile: true,
39690
- affectsEmit: true,
39691
- affectsMultiFileEmitBuildInfo: true,
39692
39635
  strictFlag: true,
39693
39636
  category: ts.Diagnostics.Type_Checking,
39694
39637
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39699,7 +39642,6 @@ var ts;
39699
39642
  name: "noUnusedLocals",
39700
39643
  type: "boolean",
39701
39644
  affectsSemanticDiagnostics: true,
39702
- affectsMultiFileEmitBuildInfo: true,
39703
39645
  category: ts.Diagnostics.Type_Checking,
39704
39646
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39705
39647
  defaultValueDescription: false,
@@ -39708,7 +39650,6 @@ var ts;
39708
39650
  name: "noUnusedParameters",
39709
39651
  type: "boolean",
39710
39652
  affectsSemanticDiagnostics: true,
39711
- affectsMultiFileEmitBuildInfo: true,
39712
39653
  category: ts.Diagnostics.Type_Checking,
39713
39654
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39714
39655
  defaultValueDescription: false,
@@ -39717,7 +39658,6 @@ var ts;
39717
39658
  name: "exactOptionalPropertyTypes",
39718
39659
  type: "boolean",
39719
39660
  affectsSemanticDiagnostics: true,
39720
- affectsMultiFileEmitBuildInfo: true,
39721
39661
  category: ts.Diagnostics.Type_Checking,
39722
39662
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39723
39663
  defaultValueDescription: false,
@@ -39726,7 +39666,6 @@ var ts;
39726
39666
  name: "noImplicitReturns",
39727
39667
  type: "boolean",
39728
39668
  affectsSemanticDiagnostics: true,
39729
- affectsMultiFileEmitBuildInfo: true,
39730
39669
  category: ts.Diagnostics.Type_Checking,
39731
39670
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39732
39671
  defaultValueDescription: false,
@@ -39736,7 +39675,6 @@ var ts;
39736
39675
  type: "boolean",
39737
39676
  affectsBindDiagnostics: true,
39738
39677
  affectsSemanticDiagnostics: true,
39739
- affectsMultiFileEmitBuildInfo: true,
39740
39678
  category: ts.Diagnostics.Type_Checking,
39741
39679
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39742
39680
  defaultValueDescription: false,
@@ -39745,7 +39683,6 @@ var ts;
39745
39683
  name: "noUncheckedIndexedAccess",
39746
39684
  type: "boolean",
39747
39685
  affectsSemanticDiagnostics: true,
39748
- affectsMultiFileEmitBuildInfo: true,
39749
39686
  category: ts.Diagnostics.Type_Checking,
39750
39687
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39751
39688
  defaultValueDescription: false,
@@ -39754,7 +39691,6 @@ var ts;
39754
39691
  name: "noImplicitOverride",
39755
39692
  type: "boolean",
39756
39693
  affectsSemanticDiagnostics: true,
39757
- affectsMultiFileEmitBuildInfo: true,
39758
39694
  category: ts.Diagnostics.Type_Checking,
39759
39695
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39760
39696
  defaultValueDescription: false,
@@ -39762,8 +39698,6 @@ var ts;
39762
39698
  {
39763
39699
  name: "noPropertyAccessFromIndexSignature",
39764
39700
  type: "boolean",
39765
- affectsSemanticDiagnostics: true,
39766
- affectsMultiFileEmitBuildInfo: true,
39767
39701
  showInSimplifiedHelpView: false,
39768
39702
  category: ts.Diagnostics.Type_Checking,
39769
39703
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -39849,7 +39783,6 @@ var ts;
39849
39783
  name: "allowSyntheticDefaultImports",
39850
39784
  type: "boolean",
39851
39785
  affectsSemanticDiagnostics: true,
39852
- affectsMultiFileEmitBuildInfo: true,
39853
39786
  category: ts.Diagnostics.Interop_Constraints,
39854
39787
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
39855
39788
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -39859,7 +39792,6 @@ var ts;
39859
39792
  type: "boolean",
39860
39793
  affectsSemanticDiagnostics: true,
39861
39794
  affectsEmit: true,
39862
- affectsMultiFileEmitBuildInfo: true,
39863
39795
  showInSimplifiedHelpView: true,
39864
39796
  category: ts.Diagnostics.Interop_Constraints,
39865
39797
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -39876,7 +39808,6 @@ var ts;
39876
39808
  name: "allowUmdGlobalAccess",
39877
39809
  type: "boolean",
39878
39810
  affectsSemanticDiagnostics: true,
39879
- affectsMultiFileEmitBuildInfo: true,
39880
39811
  category: ts.Diagnostics.Modules,
39881
39812
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
39882
39813
  defaultValueDescription: false,
@@ -39898,7 +39829,6 @@ var ts;
39898
39829
  name: "sourceRoot",
39899
39830
  type: "string",
39900
39831
  affectsEmit: true,
39901
- affectsMultiFileEmitBuildInfo: true,
39902
39832
  paramType: ts.Diagnostics.LOCATION,
39903
39833
  category: ts.Diagnostics.Emit,
39904
39834
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -39907,7 +39837,6 @@ var ts;
39907
39837
  name: "mapRoot",
39908
39838
  type: "string",
39909
39839
  affectsEmit: true,
39910
- affectsMultiFileEmitBuildInfo: true,
39911
39840
  paramType: ts.Diagnostics.LOCATION,
39912
39841
  category: ts.Diagnostics.Emit,
39913
39842
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -39916,7 +39845,6 @@ var ts;
39916
39845
  name: "inlineSourceMap",
39917
39846
  type: "boolean",
39918
39847
  affectsEmit: true,
39919
- affectsMultiFileEmitBuildInfo: true,
39920
39848
  category: ts.Diagnostics.Emit,
39921
39849
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
39922
39850
  defaultValueDescription: false,
@@ -39925,7 +39853,6 @@ var ts;
39925
39853
  name: "inlineSources",
39926
39854
  type: "boolean",
39927
39855
  affectsEmit: true,
39928
- affectsMultiFileEmitBuildInfo: true,
39929
39856
  category: ts.Diagnostics.Emit,
39930
39857
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
39931
39858
  defaultValueDescription: false,
@@ -39935,7 +39862,6 @@ var ts;
39935
39862
  name: "experimentalDecorators",
39936
39863
  type: "boolean",
39937
39864
  affectsSemanticDiagnostics: true,
39938
- affectsMultiFileEmitBuildInfo: true,
39939
39865
  category: ts.Diagnostics.Language_and_Environment,
39940
39866
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
39941
39867
  defaultValueDescription: false,
@@ -39945,7 +39871,6 @@ var ts;
39945
39871
  type: "boolean",
39946
39872
  affectsSemanticDiagnostics: true,
39947
39873
  affectsEmit: true,
39948
- affectsMultiFileEmitBuildInfo: true,
39949
39874
  category: ts.Diagnostics.Language_and_Environment,
39950
39875
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
39951
39876
  defaultValueDescription: false,
@@ -39970,7 +39895,6 @@ var ts;
39970
39895
  type: "string",
39971
39896
  affectsSemanticDiagnostics: true,
39972
39897
  affectsEmit: true,
39973
- affectsMultiFileEmitBuildInfo: true,
39974
39898
  affectsModuleResolution: true,
39975
39899
  category: ts.Diagnostics.Language_and_Environment,
39976
39900
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -39988,9 +39912,6 @@ var ts;
39988
39912
  name: "out",
39989
39913
  type: "string",
39990
39914
  affectsEmit: true,
39991
- affectsMultiFileEmitBuildInfo: true,
39992
- affectsDeclarationPath: true,
39993
- affectsBundleEmitBuildInfo: true,
39994
39915
  isFilePath: false,
39995
39916
  // for correct behaviour, please use outFile
39996
39917
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -40002,7 +39923,6 @@ var ts;
40002
39923
  name: "reactNamespace",
40003
39924
  type: "string",
40004
39925
  affectsEmit: true,
40005
- affectsMultiFileEmitBuildInfo: true,
40006
39926
  category: ts.Diagnostics.Language_and_Environment,
40007
39927
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
40008
39928
  defaultValueDescription: "`React`",
@@ -40010,8 +39930,6 @@ var ts;
40010
39930
  {
40011
39931
  name: "skipDefaultLibCheck",
40012
39932
  type: "boolean",
40013
- // We need to store these to determine whether `lib` files need to be rechecked
40014
- affectsMultiFileEmitBuildInfo: true,
40015
39933
  category: ts.Diagnostics.Completeness,
40016
39934
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
40017
39935
  defaultValueDescription: false,
@@ -40027,7 +39945,6 @@ var ts;
40027
39945
  name: "emitBOM",
40028
39946
  type: "boolean",
40029
39947
  affectsEmit: true,
40030
- affectsMultiFileEmitBuildInfo: true,
40031
39948
  category: ts.Diagnostics.Emit,
40032
39949
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
40033
39950
  defaultValueDescription: false,
@@ -40039,7 +39956,6 @@ var ts;
40039
39956
  lf: 1 /* LineFeed */
40040
39957
  })),
40041
39958
  affectsEmit: true,
40042
- affectsMultiFileEmitBuildInfo: true,
40043
39959
  paramType: ts.Diagnostics.NEWLINE,
40044
39960
  category: ts.Diagnostics.Emit,
40045
39961
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -40049,7 +39965,6 @@ var ts;
40049
39965
  name: "noErrorTruncation",
40050
39966
  type: "boolean",
40051
39967
  affectsSemanticDiagnostics: true,
40052
- affectsMultiFileEmitBuildInfo: true,
40053
39968
  category: ts.Diagnostics.Output_Formatting,
40054
39969
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
40055
39970
  defaultValueDescription: false,
@@ -40080,7 +39995,6 @@ var ts;
40080
39995
  name: "stripInternal",
40081
39996
  type: "boolean",
40082
39997
  affectsEmit: true,
40083
- affectsMultiFileEmitBuildInfo: true,
40084
39998
  category: ts.Diagnostics.Emit,
40085
39999
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
40086
40000
  defaultValueDescription: false,
@@ -40121,7 +40035,6 @@ var ts;
40121
40035
  name: "noImplicitUseStrict",
40122
40036
  type: "boolean",
40123
40037
  affectsSemanticDiagnostics: true,
40124
- affectsMultiFileEmitBuildInfo: true,
40125
40038
  category: ts.Diagnostics.Backwards_Compatibility,
40126
40039
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
40127
40040
  defaultValueDescription: false,
@@ -40130,7 +40043,6 @@ var ts;
40130
40043
  name: "noEmitHelpers",
40131
40044
  type: "boolean",
40132
40045
  affectsEmit: true,
40133
- affectsMultiFileEmitBuildInfo: true,
40134
40046
  category: ts.Diagnostics.Emit,
40135
40047
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
40136
40048
  defaultValueDescription: false,
@@ -40139,7 +40051,6 @@ var ts;
40139
40051
  name: "noEmitOnError",
40140
40052
  type: "boolean",
40141
40053
  affectsEmit: true,
40142
- affectsMultiFileEmitBuildInfo: true,
40143
40054
  category: ts.Diagnostics.Emit,
40144
40055
  transpileOptionValue: undefined,
40145
40056
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40149,7 +40060,6 @@ var ts;
40149
40060
  name: "preserveConstEnums",
40150
40061
  type: "boolean",
40151
40062
  affectsEmit: true,
40152
- affectsMultiFileEmitBuildInfo: true,
40153
40063
  category: ts.Diagnostics.Emit,
40154
40064
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40155
40065
  defaultValueDescription: false,
@@ -40158,8 +40068,6 @@ var ts;
40158
40068
  name: "declarationDir",
40159
40069
  type: "string",
40160
40070
  affectsEmit: true,
40161
- affectsMultiFileEmitBuildInfo: true,
40162
- affectsDeclarationPath: true,
40163
40071
  isFilePath: true,
40164
40072
  paramType: ts.Diagnostics.DIRECTORY,
40165
40073
  category: ts.Diagnostics.Emit,
@@ -40169,8 +40077,6 @@ var ts;
40169
40077
  {
40170
40078
  name: "skipLibCheck",
40171
40079
  type: "boolean",
40172
- // We need to store these to determine whether `lib` files need to be rechecked
40173
- affectsMultiFileEmitBuildInfo: true,
40174
40080
  category: ts.Diagnostics.Completeness,
40175
40081
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40176
40082
  defaultValueDescription: false,
@@ -40180,7 +40086,6 @@ var ts;
40180
40086
  type: "boolean",
40181
40087
  affectsBindDiagnostics: true,
40182
40088
  affectsSemanticDiagnostics: true,
40183
- affectsMultiFileEmitBuildInfo: true,
40184
40089
  category: ts.Diagnostics.Type_Checking,
40185
40090
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40186
40091
  defaultValueDescription: undefined,
@@ -40190,7 +40095,6 @@ var ts;
40190
40095
  type: "boolean",
40191
40096
  affectsBindDiagnostics: true,
40192
40097
  affectsSemanticDiagnostics: true,
40193
- affectsMultiFileEmitBuildInfo: true,
40194
40098
  category: ts.Diagnostics.Type_Checking,
40195
40099
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40196
40100
  defaultValueDescription: undefined,
@@ -40199,7 +40103,6 @@ var ts;
40199
40103
  name: "suppressExcessPropertyErrors",
40200
40104
  type: "boolean",
40201
40105
  affectsSemanticDiagnostics: true,
40202
- affectsMultiFileEmitBuildInfo: true,
40203
40106
  category: ts.Diagnostics.Backwards_Compatibility,
40204
40107
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40205
40108
  defaultValueDescription: false,
@@ -40208,7 +40111,6 @@ var ts;
40208
40111
  name: "suppressImplicitAnyIndexErrors",
40209
40112
  type: "boolean",
40210
40113
  affectsSemanticDiagnostics: true,
40211
- affectsMultiFileEmitBuildInfo: true,
40212
40114
  category: ts.Diagnostics.Backwards_Compatibility,
40213
40115
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40214
40116
  defaultValueDescription: false,
@@ -40233,7 +40135,6 @@ var ts;
40233
40135
  name: "noStrictGenericChecks",
40234
40136
  type: "boolean",
40235
40137
  affectsSemanticDiagnostics: true,
40236
- affectsMultiFileEmitBuildInfo: true,
40237
40138
  category: ts.Diagnostics.Backwards_Compatibility,
40238
40139
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40239
40140
  defaultValueDescription: false,
@@ -40243,7 +40144,6 @@ var ts;
40243
40144
  type: "boolean",
40244
40145
  affectsSemanticDiagnostics: true,
40245
40146
  affectsEmit: true,
40246
- affectsMultiFileEmitBuildInfo: true,
40247
40147
  category: ts.Diagnostics.Language_and_Environment,
40248
40148
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40249
40149
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40252,7 +40152,6 @@ var ts;
40252
40152
  name: "preserveValueImports",
40253
40153
  type: "boolean",
40254
40154
  affectsEmit: true,
40255
- affectsMultiFileEmitBuildInfo: true,
40256
40155
  category: ts.Diagnostics.Emit,
40257
40156
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40258
40157
  defaultValueDescription: false,
@@ -40296,8 +40195,6 @@ var ts;
40296
40195
  /* @internal */
40297
40196
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40298
40197
  /* @internal */
40299
- ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40300
- /* @internal */
40301
40198
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40302
40199
  /* @internal */
40303
40200
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -41160,7 +41057,6 @@ var ts;
41160
41057
  return optionDefinition.type;
41161
41058
  }
41162
41059
  }
41163
- /* @internal */
41164
41060
  function getNameOfCompilerOptionValue(value, customTypeMap) {
41165
41061
  // There is a typeMap associated with this command-line option so use it to map value back to its name
41166
41062
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41169,7 +41065,6 @@ var ts;
41169
41065
  }
41170
41066
  });
41171
41067
  }
41172
- ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41173
41068
  function serializeCompilerOptions(options, pathOptions) {
41174
41069
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41175
41070
  }
@@ -110452,8 +110347,7 @@ var ts;
110452
110347
  return;
110453
110348
  }
110454
110349
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
110455
- var buildInfo = { bundle: bundle, program: program, version: version };
110456
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
110350
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
110457
110351
  }
110458
110352
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
110459
110353
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110607,18 +110501,13 @@ var ts;
110607
110501
  if (sourceMapFilePath) {
110608
110502
  var sourceMap = sourceMapGenerator.toString();
110609
110503
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
110610
- if (printer.bundleFileInfo)
110611
- printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
110612
110504
  }
110613
110505
  }
110614
110506
  else {
110615
110507
  writer.writeLine();
110616
110508
  }
110617
110509
  // Write the output file
110618
- var text = writer.getText();
110619
- ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110620
- if (printer.bundleFileInfo)
110621
- printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
110510
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110622
110511
  // Reset state
110623
110512
  writer.clear();
110624
110513
  }
@@ -110761,54 +110650,34 @@ var ts;
110761
110650
  }
110762
110651
  /*@internal*/
110763
110652
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110764
- var createHash = ts.maybeBind(host, host.createHash);
110765
110653
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110766
- var buildInfo;
110767
- if (host.getBuildInfo) {
110768
- var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
110769
- if (!hostBuildInfo)
110770
- return buildInfoPath;
110771
- buildInfo = hostBuildInfo;
110772
- }
110773
- else {
110774
- var buildInfoText = host.readFile(buildInfoPath);
110775
- if (!buildInfoText)
110776
- return buildInfoPath;
110777
- buildInfo = getBuildInfo(buildInfoText);
110778
- }
110779
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
110654
+ var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110655
+ if (!buildInfoText)
110780
110656
  return buildInfoPath;
110781
110657
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110782
110658
  if (!jsFileText)
110783
110659
  return jsFilePath;
110784
- if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110785
- return jsFilePath;
110786
110660
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110787
110661
  // error if no source map or for now if inline sourcemap
110788
110662
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110789
110663
  return sourceMapFilePath || "inline sourcemap decoding";
110790
- if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110791
- return sourceMapFilePath;
110792
110664
  // read declaration text
110793
110665
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110794
110666
  if (declarationFilePath && !declarationText)
110795
110667
  return declarationFilePath;
110796
- if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
110797
- return declarationFilePath;
110798
110668
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
110799
110669
  // error if no source map or for now if inline sourcemap
110800
110670
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
110801
110671
  return declarationMapPath || "inline sourcemap decoding";
110802
- if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
110803
- return declarationMapPath;
110672
+ var buildInfo = getBuildInfo(buildInfoText);
110673
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110674
+ return buildInfoPath;
110804
110675
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
110805
110676
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
110806
110677
  /*onlyOwnText*/ true);
110807
110678
  var outputFiles = [];
110808
110679
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
110809
110680
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
110810
- var changedDtsText;
110811
- var changedDtsData;
110812
110681
  var emitHost = {
110813
110682
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
110814
110683
  getCanonicalFileName: host.getCanonicalFileName,
@@ -110824,7 +110693,7 @@ var ts;
110824
110693
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
110825
110694
  getProjectReferenceRedirect: ts.returnUndefined,
110826
110695
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
110827
- writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110696
+ writeFile: function (name, text, writeByteOrderMark) {
110828
110697
  switch (name) {
110829
110698
  case jsFilePath:
110830
110699
  if (jsFileText === text)
@@ -110835,13 +110704,8 @@ var ts;
110835
110704
  return;
110836
110705
  break;
110837
110706
  case buildInfoPath:
110838
- var newBuildInfo = data.buildInfo;
110707
+ var newBuildInfo = getBuildInfo(text);
110839
110708
  newBuildInfo.program = buildInfo.program;
110840
- if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
110841
- // Update the output signature
110842
- newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
110843
- newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
110844
- }
110845
110709
  // Update sourceFileInfo
110846
110710
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
110847
110711
  newBuildInfo.bundle.js.sources = js.sources;
@@ -110849,13 +110713,11 @@ var ts;
110849
110713
  newBuildInfo.bundle.dts.sources = dts.sources;
110850
110714
  }
110851
110715
  newBuildInfo.bundle.sourceFiles = sourceFiles;
110852
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110716
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
110853
110717
  return;
110854
110718
  case declarationFilePath:
110855
110719
  if (declarationText === text)
110856
110720
  return;
110857
- changedDtsText = text;
110858
- changedDtsData = data;
110859
110721
  break;
110860
110722
  case declarationMapPath:
110861
110723
  if (declarationMapText === text)
@@ -110874,7 +110736,6 @@ var ts;
110874
110736
  getSourceFileFromReference: ts.returnUndefined,
110875
110737
  redirectTargetsMap: ts.createMultiMap(),
110876
110738
  getFileIncludeReasons: ts.notImplemented,
110877
- createHash: createHash,
110878
110739
  };
110879
110740
  emitFiles(ts.notImplementedResolver, emitHost,
110880
110741
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -115959,10 +115820,12 @@ var ts;
115959
115820
  }
115960
115821
  ts.createCompilerHost = createCompilerHost;
115961
115822
  /*@internal*/
115823
+ // TODO(shkamat): update this after reworking ts build API
115962
115824
  function createCompilerHostWorker(options, setParentNodes, system) {
115963
115825
  if (system === void 0) { system = ts.sys; }
115964
115826
  var existingDirectories = new ts.Map();
115965
115827
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
115828
+ var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
115966
115829
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
115967
115830
  var text;
115968
115831
  try {
@@ -115995,7 +115858,7 @@ var ts;
115995
115858
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
115996
115859
  // the system.writeFile will do its own directory creation and
115997
115860
  // the ensureDirectoriesExist call will always be redundant.
115998
- ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); });
115861
+ 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); });
115999
115862
  ts.performance.mark("afterIOWrite");
116000
115863
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
116001
115864
  }
@@ -116005,6 +115868,35 @@ var ts;
116005
115868
  }
116006
115869
  }
116007
115870
  }
115871
+ var outputFingerprints;
115872
+ function writeFileWorker(fileName, data, writeByteOrderMark) {
115873
+ if (!ts.isWatchSet(options) || !system.getModifiedTime) {
115874
+ system.writeFile(fileName, data, writeByteOrderMark);
115875
+ return;
115876
+ }
115877
+ if (!outputFingerprints) {
115878
+ outputFingerprints = new ts.Map();
115879
+ }
115880
+ var hash = computeHash(data);
115881
+ var mtimeBefore = system.getModifiedTime(fileName);
115882
+ if (mtimeBefore) {
115883
+ var fingerprint = outputFingerprints.get(fileName);
115884
+ // If output has not been changed, and the file has no external modification
115885
+ if (fingerprint &&
115886
+ fingerprint.byteOrderMark === writeByteOrderMark &&
115887
+ fingerprint.hash === hash &&
115888
+ fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
115889
+ return;
115890
+ }
115891
+ }
115892
+ system.writeFile(fileName, data, writeByteOrderMark);
115893
+ var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
115894
+ outputFingerprints.set(fileName, {
115895
+ hash: hash,
115896
+ byteOrderMark: writeByteOrderMark,
115897
+ mtime: mtimeAfter
115898
+ });
115899
+ }
116008
115900
  function getDefaultLibLocation() {
116009
115901
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
116010
115902
  }
@@ -117594,7 +117486,6 @@ var ts;
117594
117486
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
117595
117487
  redirectTargetsMap: redirectTargetsMap,
117596
117488
  getFileIncludeReasons: program.getFileIncludeReasons,
117597
- createHash: ts.maybeBind(host, host.createHash),
117598
117489
  };
117599
117490
  }
117600
117491
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119708,9 +119599,13 @@ var ts;
119708
119599
  function createManyToManyPathMap() {
119709
119600
  function create(forward, reverse, deleted) {
119710
119601
  var map = {
119602
+ clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119603
+ forEach: function (fn) { return forward.forEach(fn); },
119711
119604
  getKeys: function (v) { return reverse.get(v); },
119712
119605
  getValues: function (k) { return forward.get(k); },
119606
+ hasKey: function (k) { return forward.has(k); },
119713
119607
  keys: function () { return forward.keys(); },
119608
+ deletedKeys: function () { return deleted; },
119714
119609
  deleteKey: function (k) {
119715
119610
  (deleted || (deleted = new ts.Set())).add(k);
119716
119611
  var set = forward.get(k);
@@ -119737,6 +119632,11 @@ var ts;
119737
119632
  });
119738
119633
  return map;
119739
119634
  },
119635
+ clear: function () {
119636
+ forward.clear();
119637
+ reverse.clear();
119638
+ deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119639
+ }
119740
119640
  };
119741
119641
  return map;
119742
119642
  }
@@ -119864,21 +119764,18 @@ var ts;
119864
119764
  * Creates the state of file references and signature for the new program from oldState if it is safe
119865
119765
  */
119866
119766
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119867
- var _a, _b, _c;
119868
119767
  var fileInfos = new ts.Map();
119869
119768
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
119870
119769
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119770
+ var hasCalledUpdateShapeSignature = new ts.Set();
119871
119771
  var useOldState = canReuseOldState(referencedMap, oldState);
119872
119772
  // Ensure source files have parent pointers set
119873
119773
  newProgram.getTypeChecker();
119874
119774
  // Create the reference map, and set the file infos
119875
- for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
119876
- var sourceFile = _d[_i];
119775
+ for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119776
+ var sourceFile = _a[_i];
119877
119777
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
119878
- var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
119879
- var signature = oldUncommitedSignature === undefined ?
119880
- useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
119881
- oldUncommitedSignature || undefined;
119778
+ var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
119882
119779
  if (referencedMap) {
119883
119780
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
119884
119781
  if (newReferences) {
@@ -119886,26 +119783,19 @@ var ts;
119886
119783
  }
119887
119784
  // Copy old visible to outside files map
119888
119785
  if (useOldState) {
119889
- var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
119890
- var exportedModules = oldUncommitedExportedModules === undefined ?
119891
- oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
119892
- oldUncommitedExportedModules || undefined;
119786
+ var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
119893
119787
  if (exportedModules) {
119894
119788
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119895
119789
  }
119896
119790
  }
119897
119791
  }
119898
- fileInfos.set(sourceFile.resolvedPath, {
119899
- version: version_2,
119900
- signature: signature,
119901
- affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
119902
- impliedFormat: sourceFile.impliedNodeFormat
119903
- });
119792
+ fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
119904
119793
  }
119905
119794
  return {
119906
119795
  fileInfos: fileInfos,
119907
119796
  referencedMap: referencedMap,
119908
119797
  exportedModulesMap: exportedModulesMap,
119798
+ hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
119909
119799
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
119910
119800
  };
119911
119801
  }
@@ -119919,42 +119809,71 @@ var ts;
119919
119809
  }
119920
119810
  BuilderState.releaseCache = releaseCache;
119921
119811
  /**
119922
- * Gets the files affected by the path from the program
119812
+ * Creates a clone of the state
119923
119813
  */
119924
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
119814
+ function clone(state) {
119925
119815
  var _a, _b;
119926
- var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
119927
- (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119928
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119929
- return result;
119816
+ // Dont need to backup allFiles info since its cache anyway
119817
+ return {
119818
+ fileInfos: new ts.Map(state.fileInfos),
119819
+ referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
119820
+ exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
119821
+ hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
119822
+ useFileVersionAsSignature: state.useFileVersionAsSignature,
119823
+ };
119930
119824
  }
119931
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119932
- function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
119825
+ BuilderState.clone = clone;
119826
+ /**
119827
+ * Gets the files affected by the path from the program
119828
+ */
119829
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
119830
+ // Since the operation could be cancelled, the signatures are always stored in the cache
119831
+ // They will be committed once it is safe to use them
119832
+ // eg when calling this api from tsserver, if there is no cancellation of the operation
119833
+ // In the other cases the affected files signatures are committed only after the iteration through the result is complete
119834
+ var signatureCache = cacheToUpdateSignature || new ts.Map();
119933
119835
  var sourceFile = programOfThisState.getSourceFileByPath(path);
119934
119836
  if (!sourceFile) {
119935
119837
  return ts.emptyArray;
119936
119838
  }
119937
- if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
119839
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
119938
119840
  return [sourceFile];
119939
119841
  }
119940
- return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
119842
+ var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
119843
+ if (!cacheToUpdateSignature) {
119844
+ // Commit all the signatures in the signature cache
119845
+ updateSignaturesFromCache(state, signatureCache);
119846
+ }
119847
+ return result;
119848
+ }
119849
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119850
+ /**
119851
+ * Updates the signatures from the cache into state's fileinfo signatures
119852
+ * This should be called whenever it is safe to commit the state of the builder
119853
+ */
119854
+ function updateSignaturesFromCache(state, signatureCache) {
119855
+ signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
119941
119856
  }
119942
- BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
119857
+ BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
119943
119858
  function updateSignatureOfFile(state, signature, path) {
119944
119859
  state.fileInfos.get(path).signature = signature;
119945
- (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
119860
+ state.hasCalledUpdateShapeSignature.add(path);
119946
119861
  }
119947
119862
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
119948
119863
  /**
119949
119864
  * Returns if the shape of the signature has changed since last emit
119950
119865
  */
119951
- function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
119952
- var _a;
119866
+ function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
119953
119867
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
119868
+ ts.Debug.assert(!!sourceFile);
119869
+ ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
119954
119870
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
119955
- if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
119871
+ if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
119956
119872
  return false;
119873
+ }
119957
119874
  var info = state.fileInfos.get(sourceFile.resolvedPath);
119875
+ if (!info)
119876
+ return ts.Debug.fail();
119958
119877
  var prevSignature = info.signature;
119959
119878
  var latestSignature;
119960
119879
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -119965,55 +119884,45 @@ var ts;
119965
119884
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
119966
119885
  if (firstDts_1) {
119967
119886
  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; })); });
119968
- latestSignature = computeSignature(firstDts_1.text, computeHash);
119969
- if (latestSignature !== prevSignature) {
119970
- updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
119887
+ latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
119888
+ if (exportedModulesMapCache && latestSignature !== prevSignature) {
119889
+ updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
119971
119890
  }
119972
119891
  }
119973
119892
  }
119974
119893
  // Default is to use file version as signature
119975
119894
  if (latestSignature === undefined) {
119976
119895
  latestSignature = sourceFile.version;
119977
- if (state.exportedModulesMap && latestSignature !== prevSignature) {
119978
- (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119896
+ if (exportedModulesMapCache && latestSignature !== prevSignature) {
119979
119897
  // All the references in this file are exported
119980
119898
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
119981
119899
  if (references) {
119982
- state.exportedModulesMap.set(sourceFile.resolvedPath, references);
119900
+ exportedModulesMapCache.set(sourceFile.resolvedPath, references);
119983
119901
  }
119984
119902
  else {
119985
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119903
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119986
119904
  }
119987
119905
  }
119988
119906
  }
119989
- (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
119990
- (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
119991
- info.signature = latestSignature;
119907
+ cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
119992
119908
  return latestSignature !== prevSignature;
119993
119909
  }
119994
119910
  BuilderState.updateShapeSignature = updateShapeSignature;
119995
- function computeSignature(text, computeHash) {
119996
- return (computeHash || ts.generateDjb2Hash)(text);
119997
- }
119998
- BuilderState.computeSignature = computeSignature;
119999
119911
  /**
120000
119912
  * Coverts the declaration emit result into exported modules map
120001
119913
  */
120002
- function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
120003
- if (!state.exportedModulesMap)
120004
- return;
120005
- (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119914
+ function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
120006
119915
  if (!exportedModulesFromDeclarationEmit) {
120007
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119916
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120008
119917
  return;
120009
119918
  }
120010
119919
  var exportedModules;
120011
119920
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
120012
119921
  if (exportedModules) {
120013
- state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119922
+ exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
120014
119923
  }
120015
119924
  else {
120016
- state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119925
+ exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
120017
119926
  }
120018
119927
  function addExportedModule(exportedModulePaths) {
120019
119928
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -120025,6 +119934,19 @@ var ts;
120025
119934
  }
120026
119935
  }
120027
119936
  BuilderState.updateExportedModules = updateExportedModules;
119937
+ /**
119938
+ * Updates the exported modules from cache into state's exported modules map
119939
+ * This should be called whenever it is safe to commit the state of the builder
119940
+ */
119941
+ function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
119942
+ var _a;
119943
+ if (exportedModulesMapCache) {
119944
+ ts.Debug.assert(!!state.exportedModulesMap);
119945
+ (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
119946
+ exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
119947
+ }
119948
+ }
119949
+ BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
120028
119950
  /**
120029
119951
  * Get all the dependencies of the sourceFile
120030
119952
  */
@@ -120145,7 +120067,7 @@ var ts;
120145
120067
  /**
120146
120068
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
120147
120069
  */
120148
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
120070
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
120149
120071
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
120150
120072
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
120151
120073
  }
@@ -120165,7 +120087,7 @@ var ts;
120165
120087
  if (!seenFileNamesMap.has(currentPath)) {
120166
120088
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
120167
120089
  seenFileNamesMap.set(currentPath, currentSourceFile);
120168
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
120090
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
120169
120091
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
120170
120092
  }
120171
120093
  }
@@ -120191,33 +120113,32 @@ var ts;
120191
120113
  * Create the state so that we can iterate on changedFiles/affected files
120192
120114
  */
120193
120115
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
120194
- var _a, _b;
120195
120116
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
120196
120117
  state.program = newProgram;
120197
120118
  var compilerOptions = newProgram.getCompilerOptions();
120198
120119
  state.compilerOptions = compilerOptions;
120199
- var outFilePath = ts.outFile(compilerOptions);
120200
120120
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
120201
- if (!outFilePath) {
120121
+ if (!ts.outFile(compilerOptions)) {
120202
120122
  state.semanticDiagnosticsPerFile = new ts.Map();
120203
120123
  }
120204
- else if (compilerOptions.composite && (oldState === null || oldState === void 0 ? void 0 : oldState.outSignature) && outFilePath === ts.outFile(oldState === null || oldState === void 0 ? void 0 : oldState.compilerOptions)) {
120205
- state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
120206
- }
120207
120124
  state.changedFilesSet = new ts.Set();
120208
- state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
120209
120125
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
120210
120126
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
120211
120127
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
120212
120128
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
120213
- var canCopyEmitSignatures = compilerOptions.composite &&
120214
- (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
120215
- !outFilePath &&
120216
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
120217
120129
  if (useOldState) {
120130
+ // Verify the sanity of old state
120131
+ if (!oldState.currentChangedFilePath) {
120132
+ var affectedSignatures = oldState.currentAffectedFilesSignatures;
120133
+ ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
120134
+ }
120135
+ var changedFilesSet = oldState.changedFilesSet;
120136
+ if (canCopySemanticDiagnostics) {
120137
+ ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
120138
+ }
120218
120139
  // Copy old state's changed files set
120219
- (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
120220
- if (!outFilePath && oldState.affectedFilesPendingEmit) {
120140
+ changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
120141
+ if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
120221
120142
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
120222
120143
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
120223
120144
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -120238,8 +120159,6 @@ var ts;
120238
120159
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
120239
120160
  // versions dont match
120240
120161
  oldInfo.version !== info.version ||
120241
- // Implied formats dont match
120242
- oldInfo.impliedFormat !== info.impliedFormat ||
120243
120162
  // Referenced files changed
120244
120163
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
120245
120164
  // Referenced file was deleted in the new program
@@ -120263,25 +120182,27 @@ var ts;
120263
120182
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
120264
120183
  }
120265
120184
  }
120266
- if (canCopyEmitSignatures) {
120267
- var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
120268
- if (oldEmitSignature)
120269
- (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
120270
- }
120271
120185
  });
120272
120186
  // If the global file is removed, add all files as changed
120273
120187
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
120274
120188
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
120275
120189
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
120276
120190
  }
120277
- else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120191
+ else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
120278
120192
  // Add all files to affectedFilesPendingEmit since emit changed
120279
120193
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
120280
120194
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
120281
120195
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
120282
120196
  }
120283
- // Since old states change files set is copied, any additional change means we would need to emit build info
120284
- state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
120197
+ if (useOldState) {
120198
+ // Any time the interpretation of a source file changes, mark it as changed
120199
+ ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
120200
+ if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
120201
+ state.changedFilesSet.add(sourceFilePath);
120202
+ }
120203
+ });
120204
+ }
120205
+ state.buildInfoEmitPending = !!state.changedFilesSet.size;
120285
120206
  return state;
120286
120207
  }
120287
120208
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -120317,35 +120238,30 @@ var ts;
120317
120238
  ts.BuilderState.releaseCache(state);
120318
120239
  state.program = undefined;
120319
120240
  }
120320
- function backupEmitBuilderProgramState(state) {
120321
- var outFilePath = ts.outFile(state.compilerOptions);
120322
- // Only in --out changeFileSet is kept around till emit
120323
- ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
120324
- return {
120325
- affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
120326
- affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
120327
- affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
120328
- seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
120329
- programEmitComplete: state.programEmitComplete,
120330
- emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
120331
- outSignature: state.outSignature,
120332
- dtsChangeTime: state.dtsChangeTime,
120333
- hasChangedEmitSignature: state.hasChangedEmitSignature,
120334
- changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
120335
- };
120336
- }
120337
- function restoreEmitBuilderProgramState(state, backupEmitState) {
120338
- state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
120339
- state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
120340
- state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
120341
- state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
120342
- state.programEmitComplete = backupEmitState.programEmitComplete;
120343
- state.emitSignatures = backupEmitState.emitSignatures;
120344
- state.outSignature = backupEmitState.outSignature;
120345
- state.dtsChangeTime = backupEmitState.dtsChangeTime;
120346
- state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
120347
- if (backupEmitState.changedFilesSet)
120348
- state.changedFilesSet = backupEmitState.changedFilesSet;
120241
+ /**
120242
+ * Creates a clone of the state
120243
+ */
120244
+ function cloneBuilderProgramState(state) {
120245
+ var _a;
120246
+ var newState = ts.BuilderState.clone(state);
120247
+ newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
120248
+ newState.changedFilesSet = new ts.Set(state.changedFilesSet);
120249
+ newState.affectedFiles = state.affectedFiles;
120250
+ newState.affectedFilesIndex = state.affectedFilesIndex;
120251
+ newState.currentChangedFilePath = state.currentChangedFilePath;
120252
+ newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
120253
+ newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
120254
+ newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
120255
+ newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
120256
+ newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
120257
+ newState.program = state.program;
120258
+ newState.compilerOptions = state.compilerOptions;
120259
+ newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
120260
+ newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
120261
+ newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
120262
+ newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
120263
+ newState.programEmitComplete = state.programEmitComplete;
120264
+ return newState;
120349
120265
  }
120350
120266
  /**
120351
120267
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -120360,7 +120276,7 @@ var ts;
120360
120276
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
120361
120277
  */
120362
120278
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
120363
- var _a, _b;
120279
+ var _a;
120364
120280
  while (true) {
120365
120281
  var affectedFiles = state.affectedFiles;
120366
120282
  if (affectedFiles) {
@@ -120380,8 +120296,10 @@ var ts;
120380
120296
  state.changedFilesSet.delete(state.currentChangedFilePath);
120381
120297
  state.currentChangedFilePath = undefined;
120382
120298
  // Commit the changes in file signature
120383
- (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
120384
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120299
+ ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
120300
+ state.currentAffectedFilesSignatures.clear();
120301
+ ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120302
+ (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
120385
120303
  state.affectedFiles = undefined;
120386
120304
  }
120387
120305
  // Get next changed file
@@ -120399,7 +120317,12 @@ var ts;
120399
120317
  return program;
120400
120318
  }
120401
120319
  // Get next batch of affected files
120402
- state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
120320
+ if (!state.currentAffectedFilesSignatures)
120321
+ state.currentAffectedFilesSignatures = new ts.Map();
120322
+ if (state.exportedModulesMap) {
120323
+ state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
120324
+ }
120325
+ state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
120403
120326
  state.currentChangedFilePath = nextKey.value;
120404
120327
  state.affectedFilesIndex = 0;
120405
120328
  if (!state.seenAffectedFiles)
@@ -120451,6 +120374,7 @@ var ts;
120451
120374
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
120452
120375
  */
120453
120376
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120377
+ var _a;
120454
120378
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
120455
120379
  // If affected files is everything except default library, then nothing more to do
120456
120380
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -120458,9 +120382,10 @@ var ts;
120458
120382
  // When a change affects the global scope, all files are considered to be affected without updating their signature
120459
120383
  // That means when affected file is handled, its signature can be out of date
120460
120384
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
120461
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
120385
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
120462
120386
  return;
120463
120387
  }
120388
+ 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);
120464
120389
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
120465
120390
  return;
120466
120391
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -120480,7 +120405,7 @@ var ts;
120480
120405
  // This ensures that we dont later during incremental builds considering wrong signature.
120481
120406
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
120482
120407
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
120483
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
120408
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
120484
120409
  // If not dts emit, nothing more to do
120485
120410
  if (ts.getEmitDeclarations(state.compilerOptions)) {
120486
120411
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -120501,10 +120426,27 @@ var ts;
120501
120426
  return !state.semanticDiagnosticsFromOldState.size;
120502
120427
  }
120503
120428
  function isChangedSignature(state, path) {
120504
- var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
120505
- var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120429
+ var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
120430
+ var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
120506
120431
  return newSignature !== oldSignature;
120507
120432
  }
120433
+ function forEachKeyOfExportedModulesMap(state, filePath, fn) {
120434
+ // Go through exported modules from cache first
120435
+ var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
120436
+ var result = keys && ts.forEachKey(keys, fn);
120437
+ if (result)
120438
+ return result;
120439
+ // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
120440
+ keys = state.exportedModulesMap.getKeys(filePath);
120441
+ return keys && ts.forEachKey(keys, function (exportedFromPath) {
120442
+ var _a;
120443
+ // If the cache had an updated value, skip
120444
+ return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
120445
+ !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
120446
+ fn(exportedFromPath) :
120447
+ undefined;
120448
+ });
120449
+ }
120508
120450
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
120509
120451
  var _a;
120510
120452
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -120519,7 +120461,6 @@ var ts;
120519
120461
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
120520
120462
  */
120521
120463
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
120522
- var _a;
120523
120464
  // If there was change in signature (dts output) for the changed file,
120524
120465
  // then only we need to handle pending file emit
120525
120466
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -120546,10 +120487,11 @@ var ts;
120546
120487
  }
120547
120488
  }
120548
120489
  }
120490
+ ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120549
120491
  var seenFileAndExportsOfFile = new ts.Set();
120550
120492
  // Go through exported modules from cache first
120551
120493
  // If exported modules has path, all files referencing file exported from are affected
120552
- (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120494
+ forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120553
120495
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
120554
120496
  return true;
120555
120497
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -120563,18 +120505,19 @@ var ts;
120563
120505
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
120564
120506
  */
120565
120507
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
120566
- var _a, _b;
120508
+ var _a;
120567
120509
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
120568
120510
  return undefined;
120569
120511
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
120570
120512
  return true;
120571
120513
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
120514
+ ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120572
120515
  // If exported modules has path, all files referencing file exported from are affected
120573
- (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120516
+ forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120574
120517
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
120575
120518
  });
120576
120519
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
120577
- (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
120520
+ (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120578
120521
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
120579
120522
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120580
120523
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120595,13 +120538,12 @@ var ts;
120595
120538
  }
120596
120539
  else {
120597
120540
  state.seenAffectedFiles.add(affected.resolvedPath);
120598
- // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120599
- state.buildInfoEmitPending = true;
120600
120541
  if (emitKind !== undefined) {
120601
120542
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120602
120543
  }
120603
120544
  if (isPendingEmit) {
120604
120545
  state.affectedFilesPendingEmitIndex++;
120546
+ state.buildInfoEmitPending = true;
120605
120547
  }
120606
120548
  else {
120607
120549
  state.affectedFilesIndex++;
@@ -120649,61 +120591,25 @@ var ts;
120649
120591
  }
120650
120592
  return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions);
120651
120593
  }
120652
- function isProgramBundleEmitBuildInfo(info) {
120653
- return !!ts.outFile(info.options || {});
120654
- }
120655
- ts.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo;
120656
120594
  /**
120657
120595
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120658
120596
  */
120659
- function getProgramBuildInfo(state, getCanonicalFileName, host) {
120660
- var outFilePath = ts.outFile(state.compilerOptions);
120661
- if (outFilePath && !state.compilerOptions.composite)
120662
- return;
120597
+ function getProgramBuildInfo(state, getCanonicalFileName) {
120598
+ if (ts.outFile(state.compilerOptions))
120599
+ return undefined;
120663
120600
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120664
120601
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
120665
- state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
120666
- if (outFilePath) {
120667
- var fileNames_1 = [];
120668
- var fileInfos_1 = [];
120669
- state.program.getRootFileNames().forEach(function (f) {
120670
- var sourceFile = state.program.getSourceFile(f);
120671
- if (!sourceFile)
120672
- return;
120673
- fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath));
120674
- fileInfos_1.push(sourceFile.version);
120675
- });
120676
- var result_15 = {
120677
- fileNames: fileNames_1,
120678
- fileInfos: fileInfos_1,
120679
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
120680
- outSignature: state.outSignature,
120681
- dtsChangeTime: state.dtsChangeTime,
120682
- };
120683
- return result_15;
120684
- }
120685
120602
  var fileNames = [];
120686
120603
  var fileNameToFileId = new ts.Map();
120687
120604
  var fileIdsList;
120688
120605
  var fileNamesToFileIdListId;
120689
- var emitSignatures;
120690
120606
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120691
- var _b, _c;
120692
120607
  var key = _a[0], value = _a[1];
120693
120608
  // Ensure fileId
120694
120609
  var fileId = toFileId(key);
120695
120610
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120696
- var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
120697
- var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
120698
- if (state.compilerOptions.composite) {
120699
- var file = state.program.getSourceFileByPath(key);
120700
- if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
120701
- var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
120702
- if (emitSignature !== actualSignature) {
120703
- (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
120704
- }
120705
- }
120706
- }
120611
+ var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120612
+ var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
120707
120613
  return value.version === actualSignature ?
120708
120614
  value.affectsGlobalScope || value.impliedFormat ?
120709
120615
  // If file version is same as signature, dont serialize signature
@@ -120711,11 +120617,11 @@ var ts;
120711
120617
  // If file info only contains version and signature and both are same we can just write string
120712
120618
  value.version :
120713
120619
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120714
- oldSignature === undefined ?
120620
+ signature === undefined ?
120715
120621
  // If we havent computed signature, use fileInfo as is
120716
120622
  value :
120717
120623
  // Serialize fileInfo with new updated signature
120718
- { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120624
+ { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120719
120625
  // Signature of the FileInfo is undefined, serialize it as false
120720
120626
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120721
120627
  });
@@ -120730,13 +120636,17 @@ var ts;
120730
120636
  if (state.exportedModulesMap) {
120731
120637
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120732
120638
  var _a;
120733
- var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120639
+ if (state.currentAffectedFilesExportedModulesMap) {
120640
+ if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120641
+ return undefined;
120642
+ }
120643
+ var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120644
+ if (newValue) {
120645
+ return [toFileId(key), toFileIdListId(newValue)];
120646
+ }
120647
+ }
120734
120648
  // Not in temporary cache, use existing value
120735
- if (oldValue === undefined)
120736
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120737
- if (oldValue)
120738
- return [toFileId(key), toFileIdListId(oldValue)];
120739
- return undefined;
120649
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120740
120650
  });
120741
120651
  }
120742
120652
  var semanticDiagnosticsPerFile;
@@ -120747,7 +120657,9 @@ var ts;
120747
120657
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120748
120658
  [
120749
120659
  toFileId(key),
120750
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120660
+ state.hasReusableDiagnostic ?
120661
+ value :
120662
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120751
120663
  ] :
120752
120664
  toFileId(key));
120753
120665
  }
@@ -120762,27 +120674,16 @@ var ts;
120762
120674
  }
120763
120675
  }
120764
120676
  }
120765
- var changeFileSet;
120766
- if (state.changedFilesSet.size) {
120767
- for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
120768
- var path = _e[_d];
120769
- (changeFileSet || (changeFileSet = [])).push(toFileId(path));
120770
- }
120771
- }
120772
- var result = {
120677
+ return {
120773
120678
  fileNames: fileNames,
120774
120679
  fileInfos: fileInfos,
120775
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120680
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120776
120681
  fileIdsList: fileIdsList,
120777
120682
  referencedMap: referencedMap,
120778
120683
  exportedModulesMap: exportedModulesMap,
120779
120684
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120780
120685
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120781
- changeFileSet: changeFileSet,
120782
- emitSignatures: emitSignatures,
120783
- dtsChangeTime: state.dtsChangeTime,
120784
120686
  };
120785
- return result;
120786
120687
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120787
120688
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120788
120689
  }
@@ -120807,18 +120708,24 @@ var ts;
120807
120708
  }
120808
120709
  return fileIdListId;
120809
120710
  }
120810
- function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
120811
- var result;
120812
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120813
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120814
- var name = _a[_i];
120815
- var optionInfo = optionsNameMap.get(name.toLowerCase());
120816
- if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
120817
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
120818
- }
120711
+ }
120712
+ function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120713
+ var result;
120714
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120715
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120716
+ var name = _a[_i];
120717
+ var optionKey = name.toLowerCase();
120718
+ var optionInfo = optionsNameMap.get(optionKey);
120719
+ if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120720
+ // We need to store `strict`, even though it won't be examined directly, so that the
120721
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120722
+ optionKey === "strict" ||
120723
+ // We need to store these to determine whether `lib` files need to be rechecked.
120724
+ optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120725
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
120819
120726
  }
120820
- return result;
120821
120727
  }
120728
+ return result;
120822
120729
  }
120823
120730
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
120824
120731
  if (option) {
@@ -120892,10 +120799,6 @@ var ts;
120892
120799
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
120893
120800
  }
120894
120801
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
120895
- function computeSignature(text, data, computeHash) {
120896
- return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
120897
- }
120898
- ts.computeSignature = computeSignature;
120899
120802
  function createBuilderProgram(kind, _a) {
120900
120803
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
120901
120804
  // Return same program if underlying program doesnt change
@@ -120914,8 +120817,8 @@ var ts;
120914
120817
  */
120915
120818
  var computeHash = ts.maybeBind(host, host.createHash);
120916
120819
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
120917
- var backupEmitState;
120918
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
120820
+ var backupState;
120821
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
120919
120822
  // To ensure that we arent storing any references to old program or new program without state
120920
120823
  newProgram = undefined; // TODO: GH#18217
120921
120824
  oldProgram = undefined;
@@ -120923,20 +120826,20 @@ var ts;
120923
120826
  var getState = function () { return state; };
120924
120827
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
120925
120828
  builderProgram.getState = getState;
120926
- builderProgram.backupEmitState = function () {
120927
- ts.Debug.assert(backupEmitState === undefined);
120928
- backupEmitState = backupEmitBuilderProgramState(state);
120829
+ builderProgram.backupState = function () {
120830
+ ts.Debug.assert(backupState === undefined);
120831
+ backupState = cloneBuilderProgramState(state);
120929
120832
  };
120930
- builderProgram.restoreEmitState = function () {
120931
- restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
120932
- backupEmitState = undefined;
120833
+ builderProgram.restoreState = function () {
120834
+ state = ts.Debug.checkDefined(backupState);
120835
+ backupState = undefined;
120933
120836
  };
120934
120837
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
120935
120838
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
120936
120839
  builderProgram.emit = emit;
120937
120840
  builderProgram.releaseProgram = function () {
120938
120841
  releaseCache(state);
120939
- backupEmitState = undefined;
120842
+ backupState = undefined;
120940
120843
  };
120941
120844
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
120942
120845
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -120995,59 +120898,35 @@ var ts;
120995
120898
  return toAffectedFileEmitResult(state,
120996
120899
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120997
120900
  // Otherwise just affected file
120998
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
120999
- getWriteFileCallback(writeFile, customTransformers) :
120901
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120902
+ getWriteFileUpdatingSignatureCallback(writeFile) :
121000
120903
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
121001
120904
  }
121002
- function getWriteFileCallback(writeFile, customTransformers) {
120905
+ function getWriteFileUpdatingSignatureCallback(writeFile) {
121003
120906
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
121004
- var _a, _b, _c;
120907
+ var _a;
121005
120908
  if (ts.isDeclarationFileName(fileName)) {
121006
- if (!ts.outFile(state.compilerOptions)) {
121007
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
121008
- var newSignature = void 0;
121009
- if (!customTransformers) {
121010
- var file = sourceFiles[0];
121011
- var info = state.fileInfos.get(file.resolvedPath);
121012
- if (info.signature === file.version) {
121013
- newSignature = computeSignature(text, data, computeHash);
121014
- if (newSignature !== file.version) { // Update it
121015
- if (host.storeFilesChangingSignatureDuringEmit)
121016
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
121017
- if (state.exportedModulesMap)
121018
- ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
121019
- if (state.affectedFiles) {
121020
- // Keep old signature so we know what to undo if cancellation happens
121021
- var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
121022
- if (existing === undefined)
121023
- (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
121024
- info.signature = newSignature;
121025
- }
121026
- else {
121027
- // These are directly commited
121028
- info.signature = newSignature;
121029
- (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
121030
- }
121031
- }
120909
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120910
+ var file = sourceFiles[0];
120911
+ var info = state.fileInfos.get(file.resolvedPath);
120912
+ var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
120913
+ if (signature === file.version) {
120914
+ var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
120915
+ if (newSignature !== file.version) { // Update it
120916
+ if (host.storeFilesChangingSignatureDuringEmit)
120917
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120918
+ if (state.exportedModulesMap)
120919
+ ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
120920
+ if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
120921
+ state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
121032
120922
  }
121033
- }
121034
- if (state.compilerOptions.composite) {
121035
- var filePath = sourceFiles[0].resolvedPath;
121036
- var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
121037
- newSignature || (newSignature = computeSignature(text, data, computeHash));
121038
- if (newSignature !== oldSignature) {
121039
- (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
121040
- state.hasChangedEmitSignature = true;
120923
+ else {
120924
+ info.signature = newSignature;
120925
+ if (state.exportedModulesMap)
120926
+ ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
121041
120927
  }
121042
120928
  }
121043
120929
  }
121044
- else if (state.compilerOptions.composite) {
121045
- var newSignature = computeSignature(text, data, computeHash);
121046
- if (newSignature !== state.outSignature) {
121047
- state.outSignature = newSignature;
121048
- state.hasChangedEmitSignature = true;
121049
- }
121050
- }
121051
120930
  }
121052
120931
  if (writeFile)
121053
120932
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -121112,8 +120991,8 @@ var ts;
121112
120991
  }
121113
120992
  }
121114
120993
  }
121115
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
121116
- getWriteFileCallback(writeFile, customTransformers) :
120994
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120995
+ getWriteFileUpdatingSignatureCallback(writeFile) :
121117
120996
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
121118
120997
  }
121119
120998
  /**
@@ -121202,58 +121081,29 @@ var ts;
121202
121081
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
121203
121082
  }
121204
121083
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
121205
- function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121206
- var _a, _b, _c, _d;
121084
+ function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
121085
+ var _a;
121207
121086
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121208
121087
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121209
- var state;
121210
- var filePaths;
121211
- var filePathsSetList;
121212
- if (isProgramBundleEmitBuildInfo(program)) {
121213
- state = {
121214
- fileInfos: new ts.Map(),
121215
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121216
- dtsChangeTime: program.dtsChangeTime,
121217
- outSignature: program.outSignature,
121218
- };
121219
- }
121220
- else {
121221
- filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
121222
- filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121223
- var fileInfos_2 = new ts.Map();
121224
- var emitSignatures_1 = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
121225
- program.fileInfos.forEach(function (fileInfo, index) {
121226
- var path = toFilePath(index + 1);
121227
- var stateFileInfo = toBuilderStateFileInfo(fileInfo);
121228
- fileInfos_2.set(path, stateFileInfo);
121229
- if (emitSignatures_1 && stateFileInfo.signature)
121230
- emitSignatures_1.set(path, stateFileInfo.signature);
121231
- });
121232
- (_d = program.emitSignatures) === null || _d === void 0 ? void 0 : _d.forEach(function (value) {
121233
- if (ts.isNumber(value))
121234
- emitSignatures_1.delete(toFilePath(value));
121235
- else
121236
- emitSignatures_1.set(toFilePath(value[0]), value[1]);
121237
- });
121238
- state = {
121239
- fileInfos: fileInfos_2,
121240
- compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121241
- referencedMap: toManyToManyPathMap(program.referencedMap),
121242
- exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121243
- semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
121244
- hasReusableDiagnostic: true,
121245
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121246
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121247
- affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121248
- changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
121249
- dtsChangeTime: program.dtsChangeTime,
121250
- emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : undefined,
121251
- };
121252
- }
121088
+ var filePaths = program.fileNames.map(toPath);
121089
+ var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
121090
+ var fileInfos = new ts.Map();
121091
+ program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
121092
+ var state = {
121093
+ fileInfos: fileInfos,
121094
+ compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
121095
+ referencedMap: toManyToManyPathMap(program.referencedMap),
121096
+ exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
121097
+ 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]; }),
121098
+ hasReusableDiagnostic: true,
121099
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
121100
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
121101
+ affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
121102
+ };
121253
121103
  return {
121254
121104
  getState: function () { return state; },
121255
- backupEmitState: ts.noop,
121256
- restoreEmitState: ts.noop,
121105
+ backupState: ts.noop,
121106
+ restoreState: ts.noop,
121257
121107
  getProgram: ts.notImplemented,
121258
121108
  getProgramOrUndefined: ts.returnUndefined,
121259
121109
  releaseProgram: ts.noop,
@@ -121298,24 +121148,12 @@ var ts;
121298
121148
  return map;
121299
121149
  }
121300
121150
  }
121301
- ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
121302
- function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
121303
- var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121304
- var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121305
- var fileInfos = new ts.Map();
121306
- program.fileInfos.forEach(function (fileInfo, index) {
121307
- var path = ts.toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
121308
- var version = ts.isString(fileInfo) ? fileInfo : fileInfo.version; // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
121309
- fileInfos.set(path, version);
121310
- });
121311
- return fileInfos;
121312
- }
121313
- ts.getBuildInfoFileVersionMap = getBuildInfoFileVersionMap;
121151
+ ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
121314
121152
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
121315
121153
  return {
121316
121154
  getState: ts.notImplemented,
121317
- backupEmitState: ts.noop,
121318
- restoreEmitState: ts.noop,
121155
+ backupState: ts.noop,
121156
+ restoreState: ts.noop,
121319
121157
  getProgram: getProgram,
121320
121158
  getProgramOrUndefined: function () { return getState().program; },
121321
121159
  releaseProgram: function () { return getState().program = undefined; },
@@ -122431,9 +122269,9 @@ var ts;
122431
122269
  if (!preferSymlinks) {
122432
122270
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
122433
122271
  // so we only need to remove them from the realpath filenames.
122434
- var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122435
- if (result_16)
122436
- return result_16;
122272
+ var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
122273
+ if (result_15)
122274
+ return result_15;
122437
122275
  }
122438
122276
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
122439
122277
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -122453,10 +122291,10 @@ var ts;
122453
122291
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
122454
122292
  var symlinkDirectory = symlinkDirectories_1[_i];
122455
122293
  var option = ts.resolvePath(symlinkDirectory, relative);
122456
- var result_17 = cb(option, target === referenceRedirect);
122294
+ var result_16 = cb(option, target === referenceRedirect);
122457
122295
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
122458
- if (result_17)
122459
- return result_17;
122296
+ if (result_16)
122297
+ return result_16;
122460
122298
  }
122461
122299
  });
122462
122300
  });
@@ -123367,7 +123205,6 @@ var ts;
123367
123205
  readDirectory: ts.maybeBind(host, host.readDirectory),
123368
123206
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
123369
123207
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
123370
- now: ts.maybeBind(host, host.now),
123371
123208
  };
123372
123209
  function writeFile(fileName, text, writeByteOrderMark, onError) {
123373
123210
  try {
@@ -123428,7 +123265,6 @@ var ts;
123428
123265
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
123429
123266
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
123430
123267
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
123431
- now: ts.maybeBind(system, system.now),
123432
123268
  };
123433
123269
  }
123434
123270
  ts.createProgramHost = createProgramHost;
@@ -123496,26 +123332,20 @@ var ts;
123496
123332
  var ts;
123497
123333
  (function (ts) {
123498
123334
  function readBuilderProgram(compilerOptions, host) {
123335
+ if (ts.outFile(compilerOptions))
123336
+ return undefined;
123499
123337
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
123500
123338
  if (!buildInfoPath)
123501
123339
  return undefined;
123502
- var buildInfo;
123503
- if (host.getBuildInfo) {
123504
- buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
123505
- if (!buildInfo)
123506
- return undefined;
123507
- }
123508
- else {
123509
- var content = host.readFile(buildInfoPath);
123510
- if (!content)
123511
- return undefined;
123512
- buildInfo = ts.getBuildInfo(content);
123513
- }
123340
+ var content = host.readFile(buildInfoPath);
123341
+ if (!content)
123342
+ return undefined;
123343
+ var buildInfo = ts.getBuildInfo(content);
123514
123344
  if (buildInfo.version !== ts.version)
123515
123345
  return undefined;
123516
123346
  if (!buildInfo.program)
123517
123347
  return undefined;
123518
- return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123348
+ return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
123519
123349
  }
123520
123350
  ts.readBuilderProgram = readBuilderProgram;
123521
123351
  function createIncrementalCompilerHost(options, system) {
@@ -123524,7 +123354,6 @@ var ts;
123524
123354
  host.createHash = ts.maybeBind(system, system.createHash);
123525
123355
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
123526
123356
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
123527
- host.now = ts.maybeBind(system, system.now);
123528
123357
  ts.setGetSourceFileAsHashVersioned(host, system);
123529
123358
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
123530
123359
  return host;
@@ -124260,17 +124089,14 @@ var ts;
124260
124089
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
124261
124090
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
124262
124091
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
124263
- UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
124264
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
124265
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
124266
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
124267
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
124268
- UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 12] = "UpToDateWithInputFileText";
124092
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
124093
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
124094
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
124095
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
124269
124096
  /**
124270
124097
  * Projects with no outputs (i.e. "solution" files)
124271
124098
  */
124272
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
124273
- UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
124099
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
124274
124100
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
124275
124101
  function resolveConfigFileProjectName(project) {
124276
124102
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -124315,11 +124141,9 @@ var ts;
124315
124141
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
124316
124142
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
124317
124143
  }
124318
- /*@internal*/
124319
- function getCurrentTime(host) {
124320
- return host.now ? host.now() : new Date();
124144
+ function newer(date1, date2) {
124145
+ return date2 > date1 ? date2 : date1;
124321
124146
  }
124322
- ts.getCurrentTime = getCurrentTime;
124323
124147
  /*@internal*/
124324
124148
  function isCircularBuildOrder(buildOrder) {
124325
124149
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -124411,7 +124235,6 @@ var ts;
124411
124235
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
124412
124236
  };
124413
124237
  }
124414
- compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
124415
124238
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
124416
124239
  var state = {
124417
124240
  host: host,
@@ -124428,9 +124251,8 @@ var ts;
124428
124251
  resolvedConfigFilePaths: new ts.Map(),
124429
124252
  configFileCache: new ts.Map(),
124430
124253
  projectStatus: new ts.Map(),
124254
+ buildInfoChecked: new ts.Map(),
124431
124255
  extendedConfigCache: new ts.Map(),
124432
- buildInfoCache: new ts.Map(),
124433
- outputTimeStamps: new ts.Map(),
124434
124256
  builderPrograms: new ts.Map(),
124435
124257
  diagnostics: new ts.Map(),
124436
124258
  projectPendingBuild: new ts.Map(),
@@ -124453,7 +124275,6 @@ var ts;
124453
124275
  allWatchedConfigFiles: new ts.Map(),
124454
124276
  allWatchedExtendedConfigFiles: new ts.Map(),
124455
124277
  allWatchedPackageJsonFiles: new ts.Map(),
124456
- filesWatched: new ts.Map(),
124457
124278
  lastCachedPackageJsonLookups: new ts.Map(),
124458
124279
  timerToBuildInvalidatedProject: undefined,
124459
124280
  reportFileChangeDetected: false,
@@ -124564,12 +124385,11 @@ var ts;
124564
124385
  // Config file cache
124565
124386
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
124566
124387
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
124388
+ ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
124567
124389
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
124568
124390
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
124569
124391
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
124570
124392
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
124571
- ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
124572
- ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
124573
124393
  // Remove watches for the program no longer in the solution
124574
124394
  if (state.watch) {
124575
124395
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -124866,21 +124686,21 @@ var ts;
124866
124686
  }
124867
124687
  function emit(writeFileCallback, cancellationToken, customTransformers) {
124868
124688
  var _a;
124869
- var _b, _c, _d;
124689
+ var _b, _c;
124870
124690
  ts.Debug.assertIsDefined(program);
124871
124691
  ts.Debug.assert(step === BuildStep.Emit);
124872
124692
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
124873
- program.backupEmitState();
124693
+ program.backupState();
124874
124694
  var declDiagnostics;
124875
124695
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
124876
124696
  var outputFiles = [];
124877
124697
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
124878
124698
  /*write*/ undefined,
124879
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark, buildInfo: data === null || data === void 0 ? void 0 : data.buildInfo }); }, cancellationToken,
124699
+ /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
124880
124700
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
124881
124701
  // Don't emit .d.ts if there are decl file errors
124882
124702
  if (declDiagnostics) {
124883
- program.restoreEmitState();
124703
+ program.restoreState();
124884
124704
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
124885
124705
  return {
124886
124706
  emitSkipped: true,
@@ -124890,46 +124710,40 @@ var ts;
124890
124710
  // Actual Emit
124891
124711
  var host = state.host, compilerHost = state.compilerHost;
124892
124712
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124893
- var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124713
+ var newestDeclarationFileContentChangedTime = minimumDate;
124714
+ var anyDtsChanged = false;
124894
124715
  var emitterDiagnostics = ts.createDiagnosticCollection();
124895
124716
  var emittedOutputs = new ts.Map();
124896
- var options = program.getCompilerOptions();
124897
- var isIncremental = ts.isIncrementalCompilation(options);
124898
- var outputTimeStampMap;
124899
- var now;
124900
124717
  ts.solutionPerformance.mark("beforeOutputFilesWrite");
124901
124718
  outputFiles.forEach(function (_a) {
124902
- var _b, _c;
124903
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124904
- var path = toPath(state, name);
124905
- emittedOutputs.set(toPath(state, name), name);
124906
- if (buildInfo) {
124907
- setBuildInfo(state, buildInfo, projectPath, options);
124908
- if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo === null || existingBuildInfo === void 0 ? void 0 : existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
124719
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124720
+ var priorChangeTime;
124721
+ if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124722
+ // Check for unchanged .d.ts files
124723
+ if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124724
+ priorChangeTime = host.getModifiedTime(name);
124725
+ }
124726
+ else {
124909
124727
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124728
+ anyDtsChanged = true;
124910
124729
  }
124911
124730
  }
124731
+ emittedOutputs.set(toPath(state, name), name);
124912
124732
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124913
- if (!isIncremental && state.watch) {
124914
- (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124733
+ if (priorChangeTime !== undefined) {
124734
+ newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
124915
124735
  }
124916
124736
  });
124917
124737
  ts.solutionPerformance.mark("afterOutputFilesWrite");
124918
124738
  ts.solutionPerformance.measure("OutputFilesWrite", "beforeOutputFilesWrite", "afterOutputFilesWrite");
124919
- finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124739
+ finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124740
+ /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124920
124741
  return emitResult;
124921
124742
  }
124922
124743
  function emitBuildInfo(writeFileCallback, cancellationToken) {
124923
124744
  ts.Debug.assertIsDefined(program);
124924
124745
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
124925
- var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
124926
- if (data === null || data === void 0 ? void 0 : data.buildInfo)
124927
- setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
124928
- if (writeFileCallback)
124929
- writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
124930
- else
124931
- state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
124932
- }, cancellationToken);
124746
+ var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
124933
124747
  if (emitResult.diagnostics.length) {
124934
124748
  reportErrors(state, emitResult.diagnostics);
124935
124749
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -124942,7 +124756,7 @@ var ts;
124942
124756
  step = BuildStep.QueueReferencingProjects;
124943
124757
  return emitResult;
124944
124758
  }
124945
- function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124759
+ function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
124946
124760
  var _a;
124947
124761
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
124948
124762
  if (emitDiagnostics.length) {
@@ -124953,11 +124767,13 @@ var ts;
124953
124767
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
124954
124768
  }
124955
124769
  // Update time stamps for rest of the outputs
124956
- updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124770
+ var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124957
124771
  state.diagnostics.delete(projectPath);
124958
124772
  state.projectStatus.set(projectPath, {
124959
124773
  type: ts.UpToDateStatusType.UpToDate,
124960
- newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124774
+ newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124775
+ maximumDate :
124776
+ newestDeclarationFileContentChangedTime,
124961
124777
  oldestOutputFileName: oldestOutputFileName
124962
124778
  });
124963
124779
  afterProgramDone(state, program, config);
@@ -124992,21 +124808,13 @@ var ts;
124992
124808
  ts.Debug.assert(!!outputFiles.length);
124993
124809
  var emitterDiagnostics = ts.createDiagnosticCollection();
124994
124810
  var emittedOutputs = new ts.Map();
124995
- var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124996
- var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
124997
124811
  outputFiles.forEach(function (_a) {
124998
- var _b, _c;
124999
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124812
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
125000
124813
  emittedOutputs.set(toPath(state, name), name);
125001
- if (buildInfo) {
125002
- setBuildInfo(state, buildInfo, projectPath, config.options);
125003
- if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
125004
- resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
125005
- }
125006
- }
125007
124814
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
125008
124815
  });
125009
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
124816
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124817
+ /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
125010
124818
  return { emitSkipped: false, diagnostics: emitDiagnostics };
125011
124819
  }
125012
124820
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -125112,7 +124920,7 @@ var ts;
125112
124920
  }
125113
124921
  continue;
125114
124922
  }
125115
- if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts.UpToDateStatusType.UpToDateWithInputFileText) {
124923
+ if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
125116
124924
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
125117
124925
  return {
125118
124926
  kind: InvalidatedProjectKind.UpdateOutputFileStamps,
@@ -125198,7 +125006,7 @@ var ts;
125198
125006
  state.projectCompilerOptions = state.baseCompilerOptions;
125199
125007
  }
125200
125008
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
125201
- var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
125009
+ var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
125202
125010
  reportAndStoreErrors(state, resolvedPath, diagnostics);
125203
125011
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
125204
125012
  if (canEmitBuildInfo)
@@ -125206,101 +125014,9 @@ var ts;
125206
125014
  afterProgramDone(state, program, config);
125207
125015
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
125208
125016
  }
125209
- function isFileWatcherWithModifiedTime(value) {
125210
- return !!value.watcher;
125211
- }
125212
- function getModifiedTime(state, fileName) {
125213
- var path = toPath(state, fileName);
125214
- var existing = state.filesWatched.get(path);
125215
- if (state.watch && !!existing) {
125216
- if (!isFileWatcherWithModifiedTime(existing))
125217
- return existing;
125218
- if (existing.modifiedTime)
125219
- return existing.modifiedTime;
125220
- }
125221
- var result = ts.getModifiedTime(state.host, fileName);
125222
- if (state.watch) {
125223
- if (existing)
125224
- existing.modifiedTime = result;
125225
- else
125226
- state.filesWatched.set(path, result);
125227
- }
125228
- return result;
125229
- }
125230
- function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
125231
- var path = toPath(state, file);
125232
- var existing = state.filesWatched.get(path);
125233
- if (existing && isFileWatcherWithModifiedTime(existing)) {
125234
- existing.callbacks.push(callback);
125235
- }
125236
- else {
125237
- var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
125238
- var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125239
- ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125240
- existing.modifiedTime = modifiedTime;
125241
- existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
125242
- }, pollingInterval, options, watchType, project);
125243
- state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
125244
- }
125245
- return {
125246
- close: function () {
125247
- var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
125248
- ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
125249
- if (existing.callbacks.length === 1) {
125250
- state.filesWatched.delete(path);
125251
- ts.closeFileWatcherOf(existing);
125252
- }
125253
- else {
125254
- ts.unorderedRemoveItem(existing.callbacks, callback);
125255
- }
125256
- }
125257
- };
125258
- }
125259
- function getOutputTimeStampMap(state, resolvedConfigFilePath) {
125260
- if (!state.watch)
125261
- return undefined;
125262
- var result = state.outputTimeStamps.get(resolvedConfigFilePath);
125263
- if (!result)
125264
- state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
125265
- return result;
125266
- }
125267
- function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
125268
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125269
- var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
125270
- if (existing) {
125271
- existing.buildInfo = buildInfo;
125272
- existing.modifiedTime = getCurrentTime(state.host);
125273
- }
125274
- else {
125275
- state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
125276
- }
125277
- }
125278
- function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
125279
- var path = toPath(state, buildInfoPath);
125280
- var existing = state.buildInfoCache.get(resolvedConfigPath);
125281
- return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
125282
- }
125283
- function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
125284
- var path = toPath(state, buildInfoPath);
125285
- var existing = state.buildInfoCache.get(resolvedConfigPath);
125286
- if (existing !== undefined && existing.path === path) {
125287
- return existing.buildInfo || undefined;
125288
- }
125289
- ts.solutionPerformance.mark("beforeGetBuildInfo");
125290
- ts.solutionPerformance.mark("beforeBuildInfoRead");
125291
- var value = state.readFileWithCache(buildInfoPath);
125292
- ts.solutionPerformance.mark("afterBuildInfoRead");
125293
- ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125294
- var buildInfo = value ? ts.getBuildInfo(value) : undefined;
125295
- ts.Debug.assert(modifiedTime || !buildInfo);
125296
- state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
125297
- ts.solutionPerformance.mark("afterGetBuildInfo");
125298
- ts.solutionPerformance.measure("GetBuildInfo", "beforeGetBuildInfo", "afterGetBuildInfo");
125299
- return buildInfo;
125300
- }
125301
125017
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
125302
125018
  // Check tsconfig time
125303
- var tsconfigTime = getModifiedTime(state, configFile);
125019
+ var tsconfigTime = ts.getModifiedTime(state.host, configFile);
125304
125020
  if (oldestOutputFileTime < tsconfigTime) {
125305
125021
  return {
125306
125022
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -125310,24 +125026,88 @@ var ts;
125310
125026
  }
125311
125027
  }
125312
125028
  function getUpToDateStatusWorker(state, project, resolvedPath) {
125313
- var _a, _b, _c;
125029
+ var force = !!state.options.force;
125030
+ var newestInputFileName = undefined;
125031
+ var newestInputFileTime = minimumDate;
125032
+ var host = state.host;
125033
+ // Get timestamps of input files
125034
+ for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
125035
+ var inputFile = _a[_i];
125036
+ if (!host.fileExists(inputFile)) {
125037
+ return {
125038
+ type: ts.UpToDateStatusType.Unbuildable,
125039
+ reason: inputFile + " does not exist"
125040
+ };
125041
+ }
125042
+ if (!force) {
125043
+ var inputTime = ts.getModifiedTime(host, inputFile);
125044
+ if (inputTime > newestInputFileTime) {
125045
+ newestInputFileName = inputFile;
125046
+ newestInputFileTime = inputTime;
125047
+ }
125048
+ }
125049
+ }
125314
125050
  // Container if no files are specified in the project
125315
125051
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
125316
125052
  return {
125317
125053
  type: ts.UpToDateStatusType.ContainerOnly
125318
125054
  };
125319
125055
  }
125320
- // Fast check to see if reference projects are buildable
125321
- var referenceStatuses;
125322
- var force = !!state.options.force;
125056
+ // Collect the expected outputs of this project
125057
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125058
+ // Now see if all outputs are newer than the newest input
125059
+ var oldestOutputFileName = "(none)";
125060
+ var oldestOutputFileTime = maximumDate;
125061
+ var newestOutputFileName = "(none)";
125062
+ var newestOutputFileTime = minimumDate;
125063
+ var missingOutputFileName;
125064
+ var newestDeclarationFileContentChangedTime = minimumDate;
125065
+ var isOutOfDateWithInputs = false;
125066
+ if (!force) {
125067
+ for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
125068
+ var output = outputs_1[_b];
125069
+ // Output is missing; can stop checking
125070
+ // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125071
+ if (!host.fileExists(output)) {
125072
+ missingOutputFileName = output;
125073
+ break;
125074
+ }
125075
+ var outputTime = ts.getModifiedTime(host, output);
125076
+ if (outputTime < oldestOutputFileTime) {
125077
+ oldestOutputFileTime = outputTime;
125078
+ oldestOutputFileName = output;
125079
+ }
125080
+ // If an output is older than the newest input, we can stop checking
125081
+ // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
125082
+ if (outputTime < newestInputFileTime) {
125083
+ isOutOfDateWithInputs = true;
125084
+ break;
125085
+ }
125086
+ if (outputTime > newestOutputFileTime) {
125087
+ newestOutputFileTime = outputTime;
125088
+ newestOutputFileName = output;
125089
+ }
125090
+ // Keep track of when the most recent time a .d.ts file was changed.
125091
+ // In addition to file timestamps, we also keep track of when a .d.ts file
125092
+ // had its file touched but not had its contents changed - this allows us
125093
+ // to skip a downstream typecheck
125094
+ if (ts.isDeclarationFileName(output)) {
125095
+ var outputModifiedTime = ts.getModifiedTime(host, output);
125096
+ newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
125097
+ }
125098
+ }
125099
+ }
125100
+ var pseudoUpToDate = false;
125101
+ var usesPrepend = false;
125102
+ var upstreamChangedProject;
125323
125103
  if (project.projectReferences) {
125324
125104
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
125325
- for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
125326
- var ref = _d[_i];
125105
+ for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
125106
+ var ref = _d[_c];
125107
+ usesPrepend = usesPrepend || !!(ref.prepend);
125327
125108
  var resolvedRef = ts.resolveProjectReferencePath(ref);
125328
125109
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
125329
- var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
125330
- var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
125110
+ var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
125331
125111
  // Its a circular reference ignore the status of this project
125332
125112
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
125333
125113
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -125349,188 +125129,78 @@ var ts;
125349
125129
  upstreamProjectName: ref.path
125350
125130
  };
125351
125131
  }
125352
- if (!force)
125353
- (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
125354
- }
125355
- }
125356
- if (force)
125357
- return { type: ts.UpToDateStatusType.ForceBuild };
125358
- // Check buildinfo first
125359
- var host = state.host;
125360
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125361
- var oldestOutputFileName = "(none)";
125362
- var oldestOutputFileTime = maximumDate;
125363
- var buildInfoTime;
125364
- var buildInfoProgram;
125365
- var buildInfoVersionMap;
125366
- var newestDeclarationFileContentChangedTime;
125367
- if (buildInfoPath) {
125368
- var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
125369
- buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
125370
- if (buildInfoTime === ts.missingFileModifiedTime) {
125371
- if (!buildInfoCacheEntry_1) {
125372
- state.buildInfoCache.set(resolvedPath, {
125373
- path: toPath(state, buildInfoPath),
125374
- buildInfo: false,
125375
- modifiedTime: buildInfoTime
125376
- });
125377
- }
125378
- return {
125379
- type: ts.UpToDateStatusType.OutputMissing,
125380
- missingOutputFileName: buildInfoPath
125381
- };
125382
- }
125383
- var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
125384
- if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125385
- return {
125386
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125387
- version: buildInfo.version
125388
- };
125389
- }
125390
- if (buildInfo.program) {
125391
- if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
125392
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
125132
+ // Check oldest output file name only if there is no missing output file name
125133
+ // (a check we will have skipped if this is a forced build)
125134
+ if (!force && !missingOutputFileName) {
125135
+ // If the upstream project's newest file is older than our oldest output, we
125136
+ // can't be out of date because of it
125137
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125138
+ continue;
125139
+ }
125140
+ // If the upstream project has only change .d.ts files, and we've built
125141
+ // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125142
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125143
+ pseudoUpToDate = true;
125144
+ upstreamChangedProject = ref.path;
125145
+ continue;
125146
+ }
125147
+ // We have an output older than an upstream output - we are out of date
125148
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125393
125149
  return {
125394
- type: ts.UpToDateStatusType.OutOfDateBuildInfo,
125395
- buildInfoFile: buildInfoPath
125150
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125151
+ outOfDateOutputFileName: oldestOutputFileName,
125152
+ newerProjectName: ref.path
125396
125153
  };
125397
125154
  }
125398
- buildInfoProgram = buildInfo.program;
125399
125155
  }
125400
- oldestOutputFileTime = buildInfoTime;
125401
- oldestOutputFileName = buildInfoPath;
125402
- newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
125403
125156
  }
125404
- // Check input files
125405
- var newestInputFileName = undefined;
125406
- var newestInputFileTime = minimumDate;
125407
- var pseudoInputUptodate = false;
125408
- // Get timestamps of input files
125409
- for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
125410
- var inputFile = _f[_e];
125411
- var inputTime = getModifiedTime(state, inputFile);
125412
- if (inputTime === ts.missingFileModifiedTime) {
125413
- return {
125414
- type: ts.UpToDateStatusType.Unbuildable,
125415
- reason: inputFile + " does not exist"
125416
- };
125417
- }
125418
- // If an buildInfo is older than the newest input, we can stop checking
125419
- if (buildInfoTime && buildInfoTime < inputTime) {
125420
- var version_3 = void 0;
125421
- var currentVersion = void 0;
125422
- if (buildInfoProgram) {
125423
- // Read files and see if they are same, read is anyways cached
125424
- if (!buildInfoVersionMap)
125425
- buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
125426
- version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
125427
- var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
125428
- currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
125429
- if (version_3 && version_3 === currentVersion)
125430
- pseudoInputUptodate = true;
125431
- }
125432
- if (!version_3 || version_3 !== currentVersion) {
125433
- return {
125434
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125435
- outOfDateOutputFileName: buildInfoPath,
125436
- newerInputFileName: inputFile
125437
- };
125438
- }
125439
- }
125440
- if (inputTime > newestInputFileTime) {
125441
- newestInputFileName = inputFile;
125442
- newestInputFileTime = inputTime;
125443
- }
125157
+ if (missingOutputFileName !== undefined) {
125158
+ return {
125159
+ type: ts.UpToDateStatusType.OutputMissing,
125160
+ missingOutputFileName: missingOutputFileName
125161
+ };
125444
125162
  }
125445
- // Now see if all outputs are newer than the newest input
125446
- // Dont check output timestamps if we have buildinfo telling us output is uptodate
125447
- if (!buildInfoPath) {
125448
- // Collect the expected outputs of this project
125449
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
125450
- var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
125451
- for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
125452
- var output = outputs_1[_g];
125453
- var path = toPath(state, output);
125454
- // Output is missing; can stop checking
125455
- var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
125456
- if (!outputTime) {
125457
- outputTime = ts.getModifiedTime(state.host, output);
125458
- outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
125459
- }
125460
- if (outputTime === ts.missingFileModifiedTime) {
125461
- return {
125462
- type: ts.UpToDateStatusType.OutputMissing,
125463
- missingOutputFileName: output
125464
- };
125465
- }
125466
- if (outputTime < oldestOutputFileTime) {
125467
- oldestOutputFileTime = outputTime;
125468
- oldestOutputFileName = output;
125469
- }
125470
- // If an output is older than the newest input, we can stop checking
125471
- if (outputTime < newestInputFileTime) {
125472
- return {
125473
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
125474
- outOfDateOutputFileName: oldestOutputFileName,
125475
- newerInputFileName: newestInputFileName
125476
- };
125477
- }
125478
- }
125163
+ if (isOutOfDateWithInputs) {
125164
+ return {
125165
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
125166
+ outOfDateOutputFileName: oldestOutputFileName,
125167
+ newerInputFileName: newestInputFileName
125168
+ };
125479
125169
  }
125480
- var seenRefs = buildInfoPath ? new ts.Set() : undefined;
125481
- var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
125482
- seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
125483
- var pseudoUpToDate = false;
125484
- var usesPrepend = false;
125485
- var upstreamChangedProject;
125486
- if (referenceStatuses) {
125487
- for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
125488
- var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
125489
- usesPrepend = usesPrepend || !!(ref.prepend);
125490
- // If the upstream project's newest file is older than our oldest output, we
125491
- // can't be out of date because of it
125492
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
125493
- continue;
125494
- }
125495
- // Check if tsbuildinfo path is shared, then we need to rebuild
125496
- if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
125170
+ else {
125171
+ // Check tsconfig time
125172
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125173
+ if (configStatus)
125174
+ return configStatus;
125175
+ // Check extended config time
125176
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125177
+ if (extendedConfigStatus)
125178
+ return extendedConfigStatus;
125179
+ // Check package file time
125180
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125181
+ var path = _a[0];
125182
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125183
+ });
125184
+ if (dependentPackageFileStatus)
125185
+ return dependentPackageFileStatus;
125186
+ }
125187
+ if (!force && !state.buildInfoChecked.has(resolvedPath)) {
125188
+ state.buildInfoChecked.set(resolvedPath, true);
125189
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
125190
+ if (buildInfoPath) {
125191
+ ts.solutionPerformance.mark("beforeBuildInfoRead");
125192
+ var value = state.readFileWithCache(buildInfoPath);
125193
+ ts.solutionPerformance.mark("afterBuildInfoRead");
125194
+ ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
125195
+ var buildInfo = value && ts.getBuildInfo(value);
125196
+ if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
125497
125197
  return {
125498
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125499
- outOfDateOutputFileName: buildInfoPath,
125500
- newerProjectName: ref.path
125198
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
125199
+ version: buildInfo.version
125501
125200
  };
125502
125201
  }
125503
- // If the upstream project has only change .d.ts files, and we've built
125504
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
125505
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
125506
- pseudoUpToDate = true;
125507
- upstreamChangedProject = ref.path;
125508
- continue;
125509
- }
125510
- // We have an output older than an upstream output - we are out of date
125511
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
125512
- return {
125513
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125514
- outOfDateOutputFileName: oldestOutputFileName,
125515
- newerProjectName: ref.path
125516
- };
125517
125202
  }
125518
125203
  }
125519
- // Check tsconfig time
125520
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
125521
- if (configStatus)
125522
- return configStatus;
125523
- // Check extended config time
125524
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
125525
- if (extendedConfigStatus)
125526
- return extendedConfigStatus;
125527
- // Check package file time
125528
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
125529
- var path = _a[0];
125530
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
125531
- });
125532
- if (dependentPackageFileStatus)
125533
- return dependentPackageFileStatus;
125534
125204
  if (usesPrepend && pseudoUpToDate) {
125535
125205
  return {
125536
125206
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -125540,37 +125210,15 @@ var ts;
125540
125210
  }
125541
125211
  // Up to date
125542
125212
  return {
125543
- type: pseudoUpToDate ?
125544
- ts.UpToDateStatusType.UpToDateWithUpstreamTypes :
125545
- pseudoInputUptodate ?
125546
- ts.UpToDateStatusType.UpToDateWithInputFileText :
125547
- ts.UpToDateStatusType.UpToDate,
125213
+ type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
125548
125214
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
125549
125215
  newestInputFileTime: newestInputFileTime,
125216
+ newestOutputFileTime: newestOutputFileTime,
125550
125217
  newestInputFileName: newestInputFileName,
125218
+ newestOutputFileName: newestOutputFileName,
125551
125219
  oldestOutputFileName: oldestOutputFileName
125552
125220
  };
125553
125221
  }
125554
- function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
125555
- if (seenRefs.has(resolvedRefPath))
125556
- return false;
125557
- seenRefs.add(resolvedRefPath);
125558
- var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
125559
- if (refBuildInfo.path === buildInfoCacheEntry.path)
125560
- return true;
125561
- if (resolvedConfig.projectReferences) {
125562
- // Check references
125563
- for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
125564
- var ref = _a[_i];
125565
- var resolvedRef = ts.resolveProjectReferencePath(ref);
125566
- var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
125567
- var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
125568
- if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
125569
- return true;
125570
- }
125571
- }
125572
- return false;
125573
- }
125574
125222
  function getUpToDateStatus(state, project, resolvedPath) {
125575
125223
  if (project === undefined) {
125576
125224
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -125586,69 +125234,42 @@ var ts;
125586
125234
  state.projectStatus.set(resolvedPath, actual);
125587
125235
  return actual;
125588
125236
  }
125589
- function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
125237
+ function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
125590
125238
  if (proj.options.noEmit)
125591
- return;
125592
- var now;
125239
+ return priorNewestUpdateTime;
125593
125240
  ts.solutionPerformance.mark("beforeUpdateOutputTimestamps");
125594
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
125595
- if (buildInfoPath) {
125596
- if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
125597
- if (!!state.options.verbose)
125241
+ var host = state.host;
125242
+ var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125243
+ if (!skipOutputs || outputs.length !== skipOutputs.size) {
125244
+ var reportVerbose = !!state.options.verbose;
125245
+ var now = host.now ? host.now() : new Date();
125246
+ for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125247
+ var file = outputs_2[_i];
125248
+ if (skipOutputs && skipOutputs.has(toPath(state, file))) {
125249
+ continue;
125250
+ }
125251
+ if (reportVerbose) {
125252
+ reportVerbose = false;
125598
125253
  reportStatus(state, verboseMessage, proj.options.configFilePath);
125599
- state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
125600
- getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
125601
- }
125602
- state.outputTimeStamps.delete(projectPath);
125603
- }
125604
- else {
125605
- var host = state.host;
125606
- var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
125607
- var outputTimeStampMap_1 = getOutputTimeStampMap(state, projectPath);
125608
- var modifiedOutputs_1 = outputTimeStampMap_1 ? new ts.Set() : undefined;
125609
- if (!skipOutputs || outputs.length !== skipOutputs.size) {
125610
- var reportVerbose = !!state.options.verbose;
125611
- for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
125612
- var file = outputs_2[_i];
125613
- var path = toPath(state, file);
125614
- if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
125615
- continue;
125616
- if (reportVerbose) {
125617
- reportVerbose = false;
125618
- reportStatus(state, verboseMessage, proj.options.configFilePath);
125619
- }
125620
- host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
125621
- if (outputTimeStampMap_1) {
125622
- outputTimeStampMap_1.set(path, now);
125623
- modifiedOutputs_1.add(path);
125624
- }
125625
125254
  }
125255
+ if (ts.isDeclarationFileName(file)) {
125256
+ priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
125257
+ }
125258
+ host.setModifiedTime(file, now);
125626
125259
  }
125627
- // Clear out timestamps not in output list any more
125628
- outputTimeStampMap_1 === null || outputTimeStampMap_1 === void 0 ? void 0 : outputTimeStampMap_1.forEach(function (_value, key) {
125629
- if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs_1.has(key))
125630
- outputTimeStampMap_1.delete(key);
125631
- });
125632
125260
  }
125633
125261
  ts.solutionPerformance.mark("afterUpdateOutputTimestamps");
125634
125262
  ts.solutionPerformance.measure("UpdateOutputTimestamps", "beforeUpdateOutputTimestamps", "afterUpdateOutputTimestamps");
125635
- }
125636
- function getDtsChangeTime(state, options, resolvedConfigPath) {
125637
- var _a;
125638
- if (!options.composite)
125639
- return undefined;
125640
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
125641
- var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
125642
- return ((_a = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.program) === null || _a === void 0 ? void 0 : _a.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
125263
+ return priorNewestUpdateTime;
125643
125264
  }
125644
125265
  function updateOutputTimestamps(state, proj, resolvedPath) {
125645
125266
  if (state.options.dry) {
125646
125267
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
125647
125268
  }
125648
- updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125269
+ var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
125649
125270
  state.projectStatus.set(resolvedPath, {
125650
125271
  type: ts.UpToDateStatusType.UpToDate,
125651
- newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
125272
+ newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
125652
125273
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
125653
125274
  });
125654
125275
  }
@@ -125694,7 +125315,6 @@ var ts;
125694
125315
  break;
125695
125316
  }
125696
125317
  // falls through
125697
- case ts.UpToDateStatusType.UpToDateWithInputFileText:
125698
125318
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125699
125319
  case ts.UpToDateStatusType.OutOfDateWithPrepend:
125700
125320
  if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
@@ -125886,10 +125506,12 @@ var ts;
125886
125506
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
125887
125507
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
125888
125508
  return;
125889
- state.allWatchedConfigFiles.set(resolvedPath, watchFile(state, resolved, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125509
+ state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
125510
+ invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
125511
+ }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125890
125512
  }
125891
125513
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
125892
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
125514
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
125893
125515
  var _a;
125894
125516
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
125895
125517
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -125921,7 +125543,7 @@ var ts;
125921
125543
  if (!state.watch)
125922
125544
  return;
125923
125545
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
125924
- createNewValue: function (_path, input) { return watchFile(state, input, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.SourceFile, resolved); },
125546
+ 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); },
125925
125547
  onDeleteValue: ts.closeFileWatcher,
125926
125548
  });
125927
125549
  }
@@ -125929,7 +125551,7 @@ var ts;
125929
125551
  if (!state.watch || !state.lastCachedPackageJsonLookups)
125930
125552
  return;
125931
125553
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
125932
- createNewValue: function (path, _input) { return watchFile(state, path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
125554
+ createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
125933
125555
  onDeleteValue: ts.closeFileWatcher,
125934
125556
  });
125935
125557
  }
@@ -126062,18 +125684,19 @@ var ts;
126062
125684
  }
126063
125685
  }
126064
125686
  function reportUpToDateStatus(state, configFileName, status) {
125687
+ if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125688
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125689
+ }
126065
125690
  switch (status.type) {
126066
125691
  case ts.UpToDateStatusType.OutOfDateWithSelf:
126067
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName));
125692
+ 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));
126068
125693
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
126069
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName));
125694
+ 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));
126070
125695
  case ts.UpToDateStatusType.OutputMissing:
126071
125696
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relName(state, configFileName), relName(state, status.missingOutputFileName));
126072
- case ts.UpToDateStatusType.OutOfDateBuildInfo:
126073
- return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_are_not_emitted, relName(state, configFileName), relName(state, status.buildInfoFile));
126074
125697
  case ts.UpToDateStatusType.UpToDate:
126075
125698
  if (status.newestInputFileTime !== undefined) {
126076
- return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, relName(state, configFileName), relName(state, status.newestInputFileName || ""), relName(state, status.oldestOutputFileName || ""));
125699
+ 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 || ""));
126077
125700
  }
126078
125701
  // Don't report anything for "up to date because it was already built" -- too verbose
126079
125702
  break;
@@ -126081,8 +125704,6 @@ var ts;
126081
125704
  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));
126082
125705
  case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
126083
125706
  return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName));
126084
- case ts.UpToDateStatusType.UpToDateWithInputFileText:
126085
- return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_but_needs_update_to_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName));
126086
125707
  case ts.UpToDateStatusType.UpstreamOutOfDate:
126087
125708
  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));
126088
125709
  case ts.UpToDateStatusType.UpstreamBlocked:
@@ -126093,8 +125714,6 @@ var ts;
126093
125714
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
126094
125715
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
126095
125716
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, relName(state, configFileName), status.version, ts.version);
126096
- case ts.UpToDateStatusType.ForceBuild:
126097
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
126098
125717
  case ts.UpToDateStatusType.ContainerOnly:
126099
125718
  // Don't report status on "solution" projects
126100
125719
  // falls through