@typescript-deploys/pr-build 4.7.0-pr-48861-16 → 4.7.0-pr-48784-4

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.
@@ -6179,7 +6179,7 @@ var ts;
6179
6179
  };
6180
6180
  }
6181
6181
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6182
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6182
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6183
6183
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6184
6184
  if (!ts.isString(relativeFileName))
6185
6185
  return;
@@ -6189,7 +6189,7 @@ var ts;
6189
6189
  if (callbacks) {
6190
6190
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6191
6191
  var fileCallback = callbacks_1[_i];
6192
- fileCallback(fileName, FileWatcherEventKind.Changed);
6192
+ fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6193
6193
  }
6194
6194
  }
6195
6195
  },
@@ -6243,7 +6243,7 @@ var ts;
6243
6243
  }
6244
6244
  else {
6245
6245
  cache.set(path, {
6246
- watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6246
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6247
6247
  refCount: 1
6248
6248
  });
6249
6249
  }
@@ -6271,7 +6271,7 @@ var ts;
6271
6271
  var newTime = modifiedTime.getTime();
6272
6272
  if (oldTime !== newTime) {
6273
6273
  watchedFile.mtime = modifiedTime;
6274
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6274
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6275
6275
  return true;
6276
6276
  }
6277
6277
  return false;
@@ -6522,17 +6522,18 @@ var ts;
6522
6522
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6523
6523
  /*@internal*/
6524
6524
  function createFileWatcherCallback(callback) {
6525
- return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6525
+ return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6526
6526
  }
6527
6527
  ts.createFileWatcherCallback = createFileWatcherCallback;
6528
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6529
- return function (eventName) {
6528
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6529
+ return function (eventName, _relativeFileName, modifiedTime) {
6530
6530
  if (eventName === "rename") {
6531
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6531
+ modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6532
+ callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6532
6533
  }
6533
6534
  else {
6534
6535
  // Change
6535
- callback(fileName, FileWatcherEventKind.Changed);
6536
+ callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6536
6537
  }
6537
6538
  };
6538
6539
  }
@@ -6556,7 +6557,7 @@ var ts;
6556
6557
  }
6557
6558
  /*@internal*/
6558
6559
  function createSystemWatchFunctions(_a) {
6559
- 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;
6560
+ 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;
6560
6561
  var dynamicPollingWatchFile;
6561
6562
  var fixedChunkSizePollingWatchFile;
6562
6563
  var nonPollingWatchFile;
@@ -6578,7 +6579,7 @@ var ts;
6578
6579
  case ts.WatchFileKind.FixedChunkSizePolling:
6579
6580
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6580
6581
  case ts.WatchFileKind.UseFsEvents:
6581
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6582
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6582
6583
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6583
6584
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6584
6585
  if (!nonPollingWatchFile) {
@@ -6760,7 +6761,6 @@ var ts;
6760
6761
  fsWatch: fsWatch,
6761
6762
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6762
6763
  getCurrentDirectory: getCurrentDirectory,
6763
- fileExists: fileExists,
6764
6764
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6765
6765
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6766
6766
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7020,7 +7020,7 @@ var ts;
7020
7020
  // File changed
7021
7021
  eventKind = FileWatcherEventKind.Changed;
7022
7022
  }
7023
- callback(fileName, eventKind);
7023
+ callback(fileName, eventKind, curr.mtime);
7024
7024
  }
7025
7025
  }
7026
7026
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7046,10 +7046,10 @@ var ts;
7046
7046
  * Invoke the callback with rename and update the watcher if not closed
7047
7047
  * @param createWatcher
7048
7048
  */
7049
- function invokeCallbackAndUpdateWatcher(createWatcher) {
7049
+ function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7050
7050
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7051
7051
  // Call the callback for current directory
7052
- callback("rename", "");
7052
+ callback("rename", "", modifiedTime);
7053
7053
  // If watcher is not closed, update it
7054
7054
  if (watcher) {
7055
7055
  watcher.close();
@@ -7095,13 +7095,14 @@ var ts;
7095
7095
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7096
7096
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7097
7097
  // Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
7098
+ var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
7098
7099
  return event === "rename" &&
7099
7100
  (!relativeName ||
7100
7101
  relativeName === lastDirectoryPart ||
7101
7102
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7102
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7103
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7104
- callback(event, relativeName);
7103
+ modifiedTime === ts.missingFileModifiedTime ?
7104
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7105
+ callback(event, relativeName, modifiedTime);
7105
7106
  }
7106
7107
  /**
7107
7108
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7115,12 +7116,15 @@ var ts;
7115
7116
  * and switch to existing file or directory when the missing filesystem entry is created
7116
7117
  */
7117
7118
  function watchMissingFileSystemEntry() {
7118
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7119
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7120
- // Call the callback for current file or directory
7121
- // For now it could be callback for the inner directory creation,
7122
- // but just return current directory, better than current no-op
7123
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
7119
+ return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
7120
+ if (eventKind === FileWatcherEventKind.Created) {
7121
+ modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
7122
+ if (modifiedTime !== ts.missingFileModifiedTime) {
7123
+ // Call the callback for current file or directory
7124
+ // For now it could be callback for the inner directory creation,
7125
+ // but just return current directory, better than current no-op
7126
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
7127
+ }
7124
7128
  }
7125
7129
  }, fallbackPollingInterval, fallbackOptions);
7126
7130
  }
@@ -7270,12 +7274,19 @@ var ts;
7270
7274
  }
7271
7275
  function getModifiedTime(path) {
7272
7276
  var _a;
7277
+ // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7278
+ // the CPU time performance.
7279
+ var originalStackTraceLimit = Error.stackTraceLimit;
7280
+ Error.stackTraceLimit = 0;
7273
7281
  try {
7274
7282
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7275
7283
  }
7276
7284
  catch (e) {
7277
7285
  return undefined;
7278
7286
  }
7287
+ finally {
7288
+ Error.stackTraceLimit = originalStackTraceLimit;
7289
+ }
7279
7290
  }
7280
7291
  function setModifiedTime(path, time) {
7281
7292
  try {
@@ -9289,8 +9300,8 @@ var ts;
9289
9300
  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"),
9290
9301
  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"),
9291
9302
  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."),
9292
- 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}'"),
9293
- 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}'"),
9303
+ 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}'"),
9304
+ 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}'"),
9294
9305
  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"),
9295
9306
  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"),
9296
9307
  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"),
@@ -9334,6 +9345,7 @@ var ts;
9334
9345
  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}'."),
9335
9346
  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}'."),
9336
9347
  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."),
9348
+ 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"),
9337
9349
  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}'"),
9338
9350
  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."),
9339
9351
  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."),
@@ -20138,6 +20150,10 @@ var ts;
20138
20150
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20139
20151
  }
20140
20152
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20153
+ function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20154
+ return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20155
+ }
20156
+ ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20141
20157
  function getCompilerOptionValue(options, option) {
20142
20158
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20143
20159
  }
@@ -39176,6 +39192,7 @@ var ts;
39176
39192
  type: "boolean",
39177
39193
  affectsSemanticDiagnostics: true,
39178
39194
  affectsEmit: true,
39195
+ affectsMultiFileEmitBuildInfo: true,
39179
39196
  category: ts.Diagnostics.Watch_and_Build_Modes,
39180
39197
  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,
39181
39198
  defaultValueDescription: false,
@@ -39210,12 +39227,40 @@ var ts;
39210
39227
  affectsSourceFile: true,
39211
39228
  affectsModuleResolution: true,
39212
39229
  affectsEmit: true,
39230
+ affectsMultiFileEmitBuildInfo: true,
39213
39231
  paramType: ts.Diagnostics.VERSION,
39214
39232
  showInSimplifiedHelpView: true,
39215
39233
  category: ts.Diagnostics.Language_and_Environment,
39216
39234
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39217
39235
  defaultValueDescription: 0 /* ES3 */,
39218
39236
  };
39237
+ /*@internal*/
39238
+ ts.moduleOptionDeclaration = {
39239
+ name: "module",
39240
+ shortName: "m",
39241
+ type: new ts.Map(ts.getEntries({
39242
+ none: ts.ModuleKind.None,
39243
+ commonjs: ts.ModuleKind.CommonJS,
39244
+ amd: ts.ModuleKind.AMD,
39245
+ system: ts.ModuleKind.System,
39246
+ umd: ts.ModuleKind.UMD,
39247
+ es6: ts.ModuleKind.ES2015,
39248
+ es2015: ts.ModuleKind.ES2015,
39249
+ es2020: ts.ModuleKind.ES2020,
39250
+ es2022: ts.ModuleKind.ES2022,
39251
+ esnext: ts.ModuleKind.ESNext,
39252
+ node12: ts.ModuleKind.Node12,
39253
+ nodenext: ts.ModuleKind.NodeNext,
39254
+ })),
39255
+ affectsModuleResolution: true,
39256
+ affectsEmit: true,
39257
+ affectsMultiFileEmitBuildInfo: true,
39258
+ paramType: ts.Diagnostics.KIND,
39259
+ showInSimplifiedHelpView: true,
39260
+ category: ts.Diagnostics.Modules,
39261
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
39262
+ defaultValueDescription: undefined,
39263
+ };
39219
39264
  var commandOptionsWithoutBuild = [
39220
39265
  // CommandLine only options
39221
39266
  {
@@ -39277,37 +39322,14 @@ var ts;
39277
39322
  category: ts.Diagnostics.Command_line_Options,
39278
39323
  affectsSemanticDiagnostics: true,
39279
39324
  affectsEmit: true,
39325
+ affectsMultiFileEmitBuildInfo: true,
39280
39326
  isCommandLineOnly: true,
39281
39327
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39282
39328
  defaultValueDescription: false,
39283
39329
  },
39284
39330
  // Basic
39285
39331
  ts.targetOptionDeclaration,
39286
- {
39287
- name: "module",
39288
- shortName: "m",
39289
- type: new ts.Map(ts.getEntries({
39290
- none: ts.ModuleKind.None,
39291
- commonjs: ts.ModuleKind.CommonJS,
39292
- amd: ts.ModuleKind.AMD,
39293
- system: ts.ModuleKind.System,
39294
- umd: ts.ModuleKind.UMD,
39295
- es6: ts.ModuleKind.ES2015,
39296
- es2015: ts.ModuleKind.ES2015,
39297
- es2020: ts.ModuleKind.ES2020,
39298
- es2022: ts.ModuleKind.ES2022,
39299
- esnext: ts.ModuleKind.ESNext,
39300
- node12: ts.ModuleKind.Node12,
39301
- nodenext: ts.ModuleKind.NodeNext,
39302
- })),
39303
- affectsModuleResolution: true,
39304
- affectsEmit: true,
39305
- paramType: ts.Diagnostics.KIND,
39306
- showInSimplifiedHelpView: true,
39307
- category: ts.Diagnostics.Modules,
39308
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39309
- defaultValueDescription: undefined,
39310
- },
39332
+ ts.moduleOptionDeclaration,
39311
39333
  {
39312
39334
  name: "lib",
39313
39335
  type: "list",
@@ -39344,6 +39366,7 @@ var ts;
39344
39366
  type: jsxOptionMap,
39345
39367
  affectsSourceFile: true,
39346
39368
  affectsEmit: true,
39369
+ affectsMultiFileEmitBuildInfo: true,
39347
39370
  affectsModuleResolution: true,
39348
39371
  paramType: ts.Diagnostics.KIND,
39349
39372
  showInSimplifiedHelpView: true,
@@ -39356,6 +39379,7 @@ var ts;
39356
39379
  shortName: "d",
39357
39380
  type: "boolean",
39358
39381
  affectsEmit: true,
39382
+ affectsMultiFileEmitBuildInfo: true,
39359
39383
  showInSimplifiedHelpView: true,
39360
39384
  category: ts.Diagnostics.Emit,
39361
39385
  transpileOptionValue: undefined,
@@ -39366,6 +39390,7 @@ var ts;
39366
39390
  name: "declarationMap",
39367
39391
  type: "boolean",
39368
39392
  affectsEmit: true,
39393
+ affectsMultiFileEmitBuildInfo: true,
39369
39394
  showInSimplifiedHelpView: true,
39370
39395
  category: ts.Diagnostics.Emit,
39371
39396
  transpileOptionValue: undefined,
@@ -39376,6 +39401,7 @@ var ts;
39376
39401
  name: "emitDeclarationOnly",
39377
39402
  type: "boolean",
39378
39403
  affectsEmit: true,
39404
+ affectsMultiFileEmitBuildInfo: true,
39379
39405
  showInSimplifiedHelpView: true,
39380
39406
  category: ts.Diagnostics.Emit,
39381
39407
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39386,6 +39412,7 @@ var ts;
39386
39412
  name: "sourceMap",
39387
39413
  type: "boolean",
39388
39414
  affectsEmit: true,
39415
+ affectsMultiFileEmitBuildInfo: true,
39389
39416
  showInSimplifiedHelpView: true,
39390
39417
  category: ts.Diagnostics.Emit,
39391
39418
  defaultValueDescription: false,
@@ -39395,6 +39422,9 @@ var ts;
39395
39422
  name: "outFile",
39396
39423
  type: "string",
39397
39424
  affectsEmit: true,
39425
+ affectsMultiFileEmitBuildInfo: true,
39426
+ affectsDeclarationPath: true,
39427
+ affectsBundleEmitBuildInfo: true,
39398
39428
  isFilePath: true,
39399
39429
  paramType: ts.Diagnostics.FILE,
39400
39430
  showInSimplifiedHelpView: true,
@@ -39406,6 +39436,8 @@ var ts;
39406
39436
  name: "outDir",
39407
39437
  type: "string",
39408
39438
  affectsEmit: true,
39439
+ affectsMultiFileEmitBuildInfo: true,
39440
+ affectsDeclarationPath: true,
39409
39441
  isFilePath: true,
39410
39442
  paramType: ts.Diagnostics.DIRECTORY,
39411
39443
  showInSimplifiedHelpView: true,
@@ -39416,6 +39448,8 @@ var ts;
39416
39448
  name: "rootDir",
39417
39449
  type: "string",
39418
39450
  affectsEmit: true,
39451
+ affectsMultiFileEmitBuildInfo: true,
39452
+ affectsDeclarationPath: true,
39419
39453
  isFilePath: true,
39420
39454
  paramType: ts.Diagnostics.LOCATION,
39421
39455
  category: ts.Diagnostics.Modules,
@@ -39426,6 +39460,8 @@ var ts;
39426
39460
  name: "composite",
39427
39461
  type: "boolean",
39428
39462
  affectsEmit: true,
39463
+ affectsMultiFileEmitBuildInfo: true,
39464
+ affectsBundleEmitBuildInfo: true,
39429
39465
  isTSConfigOnly: true,
39430
39466
  category: ts.Diagnostics.Projects,
39431
39467
  transpileOptionValue: undefined,
@@ -39436,6 +39472,8 @@ var ts;
39436
39472
  name: "tsBuildInfoFile",
39437
39473
  type: "string",
39438
39474
  affectsEmit: true,
39475
+ affectsMultiFileEmitBuildInfo: true,
39476
+ affectsBundleEmitBuildInfo: true,
39439
39477
  isFilePath: true,
39440
39478
  paramType: ts.Diagnostics.FILE,
39441
39479
  category: ts.Diagnostics.Projects,
@@ -39447,6 +39485,7 @@ var ts;
39447
39485
  name: "removeComments",
39448
39486
  type: "boolean",
39449
39487
  affectsEmit: true,
39488
+ affectsMultiFileEmitBuildInfo: true,
39450
39489
  showInSimplifiedHelpView: true,
39451
39490
  category: ts.Diagnostics.Emit,
39452
39491
  defaultValueDescription: false,
@@ -39465,6 +39504,7 @@ var ts;
39465
39504
  name: "importHelpers",
39466
39505
  type: "boolean",
39467
39506
  affectsEmit: true,
39507
+ affectsMultiFileEmitBuildInfo: true,
39468
39508
  category: ts.Diagnostics.Emit,
39469
39509
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39470
39510
  defaultValueDescription: false,
@@ -39478,6 +39518,7 @@ var ts;
39478
39518
  })),
39479
39519
  affectsEmit: true,
39480
39520
  affectsSemanticDiagnostics: true,
39521
+ affectsMultiFileEmitBuildInfo: true,
39481
39522
  category: ts.Diagnostics.Emit,
39482
39523
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39483
39524
  defaultValueDescription: 0 /* Remove */,
@@ -39486,6 +39527,7 @@ var ts;
39486
39527
  name: "downlevelIteration",
39487
39528
  type: "boolean",
39488
39529
  affectsEmit: true,
39530
+ affectsMultiFileEmitBuildInfo: true,
39489
39531
  category: ts.Diagnostics.Emit,
39490
39532
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39491
39533
  defaultValueDescription: false,
@@ -39504,6 +39546,9 @@ var ts;
39504
39546
  type: "boolean",
39505
39547
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39506
39548
  // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
39549
+ // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
39550
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
39551
+ affectsMultiFileEmitBuildInfo: true,
39507
39552
  showInSimplifiedHelpView: true,
39508
39553
  category: ts.Diagnostics.Type_Checking,
39509
39554
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39513,6 +39558,7 @@ var ts;
39513
39558
  name: "noImplicitAny",
39514
39559
  type: "boolean",
39515
39560
  affectsSemanticDiagnostics: true,
39561
+ affectsMultiFileEmitBuildInfo: true,
39516
39562
  strictFlag: true,
39517
39563
  category: ts.Diagnostics.Type_Checking,
39518
39564
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39522,6 +39568,7 @@ var ts;
39522
39568
  name: "strictNullChecks",
39523
39569
  type: "boolean",
39524
39570
  affectsSemanticDiagnostics: true,
39571
+ affectsMultiFileEmitBuildInfo: true,
39525
39572
  strictFlag: true,
39526
39573
  category: ts.Diagnostics.Type_Checking,
39527
39574
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39530,6 +39577,8 @@ var ts;
39530
39577
  {
39531
39578
  name: "strictFunctionTypes",
39532
39579
  type: "boolean",
39580
+ affectsSemanticDiagnostics: true,
39581
+ affectsMultiFileEmitBuildInfo: true,
39533
39582
  strictFlag: true,
39534
39583
  category: ts.Diagnostics.Type_Checking,
39535
39584
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39538,6 +39587,8 @@ var ts;
39538
39587
  {
39539
39588
  name: "strictBindCallApply",
39540
39589
  type: "boolean",
39590
+ affectsSemanticDiagnostics: true,
39591
+ affectsMultiFileEmitBuildInfo: true,
39541
39592
  strictFlag: true,
39542
39593
  category: ts.Diagnostics.Type_Checking,
39543
39594
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39547,6 +39598,7 @@ var ts;
39547
39598
  name: "strictPropertyInitialization",
39548
39599
  type: "boolean",
39549
39600
  affectsSemanticDiagnostics: true,
39601
+ affectsMultiFileEmitBuildInfo: true,
39550
39602
  strictFlag: true,
39551
39603
  category: ts.Diagnostics.Type_Checking,
39552
39604
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39556,6 +39608,7 @@ var ts;
39556
39608
  name: "noImplicitThis",
39557
39609
  type: "boolean",
39558
39610
  affectsSemanticDiagnostics: true,
39611
+ affectsMultiFileEmitBuildInfo: true,
39559
39612
  strictFlag: true,
39560
39613
  category: ts.Diagnostics.Type_Checking,
39561
39614
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39565,6 +39618,7 @@ var ts;
39565
39618
  name: "useUnknownInCatchVariables",
39566
39619
  type: "boolean",
39567
39620
  affectsSemanticDiagnostics: true,
39621
+ affectsMultiFileEmitBuildInfo: true,
39568
39622
  strictFlag: true,
39569
39623
  category: ts.Diagnostics.Type_Checking,
39570
39624
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39574,6 +39628,8 @@ var ts;
39574
39628
  name: "alwaysStrict",
39575
39629
  type: "boolean",
39576
39630
  affectsSourceFile: true,
39631
+ affectsEmit: true,
39632
+ affectsMultiFileEmitBuildInfo: true,
39577
39633
  strictFlag: true,
39578
39634
  category: ts.Diagnostics.Type_Checking,
39579
39635
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39584,6 +39640,7 @@ var ts;
39584
39640
  name: "noUnusedLocals",
39585
39641
  type: "boolean",
39586
39642
  affectsSemanticDiagnostics: true,
39643
+ affectsMultiFileEmitBuildInfo: true,
39587
39644
  category: ts.Diagnostics.Type_Checking,
39588
39645
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39589
39646
  defaultValueDescription: false,
@@ -39592,6 +39649,7 @@ var ts;
39592
39649
  name: "noUnusedParameters",
39593
39650
  type: "boolean",
39594
39651
  affectsSemanticDiagnostics: true,
39652
+ affectsMultiFileEmitBuildInfo: true,
39595
39653
  category: ts.Diagnostics.Type_Checking,
39596
39654
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39597
39655
  defaultValueDescription: false,
@@ -39600,6 +39658,7 @@ var ts;
39600
39658
  name: "exactOptionalPropertyTypes",
39601
39659
  type: "boolean",
39602
39660
  affectsSemanticDiagnostics: true,
39661
+ affectsMultiFileEmitBuildInfo: true,
39603
39662
  category: ts.Diagnostics.Type_Checking,
39604
39663
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39605
39664
  defaultValueDescription: false,
@@ -39608,6 +39667,7 @@ var ts;
39608
39667
  name: "noImplicitReturns",
39609
39668
  type: "boolean",
39610
39669
  affectsSemanticDiagnostics: true,
39670
+ affectsMultiFileEmitBuildInfo: true,
39611
39671
  category: ts.Diagnostics.Type_Checking,
39612
39672
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39613
39673
  defaultValueDescription: false,
@@ -39617,6 +39677,7 @@ var ts;
39617
39677
  type: "boolean",
39618
39678
  affectsBindDiagnostics: true,
39619
39679
  affectsSemanticDiagnostics: true,
39680
+ affectsMultiFileEmitBuildInfo: true,
39620
39681
  category: ts.Diagnostics.Type_Checking,
39621
39682
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39622
39683
  defaultValueDescription: false,
@@ -39625,6 +39686,7 @@ var ts;
39625
39686
  name: "noUncheckedIndexedAccess",
39626
39687
  type: "boolean",
39627
39688
  affectsSemanticDiagnostics: true,
39689
+ affectsMultiFileEmitBuildInfo: true,
39628
39690
  category: ts.Diagnostics.Type_Checking,
39629
39691
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39630
39692
  defaultValueDescription: false,
@@ -39633,6 +39695,7 @@ var ts;
39633
39695
  name: "noImplicitOverride",
39634
39696
  type: "boolean",
39635
39697
  affectsSemanticDiagnostics: true,
39698
+ affectsMultiFileEmitBuildInfo: true,
39636
39699
  category: ts.Diagnostics.Type_Checking,
39637
39700
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39638
39701
  defaultValueDescription: false,
@@ -39640,6 +39703,8 @@ var ts;
39640
39703
  {
39641
39704
  name: "noPropertyAccessFromIndexSignature",
39642
39705
  type: "boolean",
39706
+ affectsSemanticDiagnostics: true,
39707
+ affectsMultiFileEmitBuildInfo: true,
39643
39708
  showInSimplifiedHelpView: false,
39644
39709
  category: ts.Diagnostics.Type_Checking,
39645
39710
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -39725,6 +39790,7 @@ var ts;
39725
39790
  name: "allowSyntheticDefaultImports",
39726
39791
  type: "boolean",
39727
39792
  affectsSemanticDiagnostics: true,
39793
+ affectsMultiFileEmitBuildInfo: true,
39728
39794
  category: ts.Diagnostics.Interop_Constraints,
39729
39795
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
39730
39796
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -39734,6 +39800,7 @@ var ts;
39734
39800
  type: "boolean",
39735
39801
  affectsSemanticDiagnostics: true,
39736
39802
  affectsEmit: true,
39803
+ affectsMultiFileEmitBuildInfo: true,
39737
39804
  showInSimplifiedHelpView: true,
39738
39805
  category: ts.Diagnostics.Interop_Constraints,
39739
39806
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -39750,6 +39817,7 @@ var ts;
39750
39817
  name: "allowUmdGlobalAccess",
39751
39818
  type: "boolean",
39752
39819
  affectsSemanticDiagnostics: true,
39820
+ affectsMultiFileEmitBuildInfo: true,
39753
39821
  category: ts.Diagnostics.Modules,
39754
39822
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
39755
39823
  defaultValueDescription: false,
@@ -39771,6 +39839,7 @@ var ts;
39771
39839
  name: "sourceRoot",
39772
39840
  type: "string",
39773
39841
  affectsEmit: true,
39842
+ affectsMultiFileEmitBuildInfo: true,
39774
39843
  paramType: ts.Diagnostics.LOCATION,
39775
39844
  category: ts.Diagnostics.Emit,
39776
39845
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -39779,6 +39848,7 @@ var ts;
39779
39848
  name: "mapRoot",
39780
39849
  type: "string",
39781
39850
  affectsEmit: true,
39851
+ affectsMultiFileEmitBuildInfo: true,
39782
39852
  paramType: ts.Diagnostics.LOCATION,
39783
39853
  category: ts.Diagnostics.Emit,
39784
39854
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -39787,6 +39857,7 @@ var ts;
39787
39857
  name: "inlineSourceMap",
39788
39858
  type: "boolean",
39789
39859
  affectsEmit: true,
39860
+ affectsMultiFileEmitBuildInfo: true,
39790
39861
  category: ts.Diagnostics.Emit,
39791
39862
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
39792
39863
  defaultValueDescription: false,
@@ -39795,6 +39866,7 @@ var ts;
39795
39866
  name: "inlineSources",
39796
39867
  type: "boolean",
39797
39868
  affectsEmit: true,
39869
+ affectsMultiFileEmitBuildInfo: true,
39798
39870
  category: ts.Diagnostics.Emit,
39799
39871
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
39800
39872
  defaultValueDescription: false,
@@ -39804,6 +39876,7 @@ var ts;
39804
39876
  name: "experimentalDecorators",
39805
39877
  type: "boolean",
39806
39878
  affectsSemanticDiagnostics: true,
39879
+ affectsMultiFileEmitBuildInfo: true,
39807
39880
  category: ts.Diagnostics.Language_and_Environment,
39808
39881
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
39809
39882
  defaultValueDescription: false,
@@ -39813,6 +39886,7 @@ var ts;
39813
39886
  type: "boolean",
39814
39887
  affectsSemanticDiagnostics: true,
39815
39888
  affectsEmit: true,
39889
+ affectsMultiFileEmitBuildInfo: true,
39816
39890
  category: ts.Diagnostics.Language_and_Environment,
39817
39891
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
39818
39892
  defaultValueDescription: false,
@@ -39837,6 +39911,7 @@ var ts;
39837
39911
  type: "string",
39838
39912
  affectsSemanticDiagnostics: true,
39839
39913
  affectsEmit: true,
39914
+ affectsMultiFileEmitBuildInfo: true,
39840
39915
  affectsModuleResolution: true,
39841
39916
  category: ts.Diagnostics.Language_and_Environment,
39842
39917
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -39854,6 +39929,9 @@ var ts;
39854
39929
  name: "out",
39855
39930
  type: "string",
39856
39931
  affectsEmit: true,
39932
+ affectsMultiFileEmitBuildInfo: true,
39933
+ affectsDeclarationPath: true,
39934
+ affectsBundleEmitBuildInfo: true,
39857
39935
  isFilePath: false,
39858
39936
  // for correct behaviour, please use outFile
39859
39937
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -39865,6 +39943,7 @@ var ts;
39865
39943
  name: "reactNamespace",
39866
39944
  type: "string",
39867
39945
  affectsEmit: true,
39946
+ affectsMultiFileEmitBuildInfo: true,
39868
39947
  category: ts.Diagnostics.Language_and_Environment,
39869
39948
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
39870
39949
  defaultValueDescription: "`React`",
@@ -39872,6 +39951,8 @@ var ts;
39872
39951
  {
39873
39952
  name: "skipDefaultLibCheck",
39874
39953
  type: "boolean",
39954
+ // We need to store these to determine whether `lib` files need to be rechecked
39955
+ affectsMultiFileEmitBuildInfo: true,
39875
39956
  category: ts.Diagnostics.Completeness,
39876
39957
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
39877
39958
  defaultValueDescription: false,
@@ -39887,6 +39968,7 @@ var ts;
39887
39968
  name: "emitBOM",
39888
39969
  type: "boolean",
39889
39970
  affectsEmit: true,
39971
+ affectsMultiFileEmitBuildInfo: true,
39890
39972
  category: ts.Diagnostics.Emit,
39891
39973
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
39892
39974
  defaultValueDescription: false,
@@ -39898,6 +39980,7 @@ var ts;
39898
39980
  lf: 1 /* LineFeed */
39899
39981
  })),
39900
39982
  affectsEmit: true,
39983
+ affectsMultiFileEmitBuildInfo: true,
39901
39984
  paramType: ts.Diagnostics.NEWLINE,
39902
39985
  category: ts.Diagnostics.Emit,
39903
39986
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -39907,6 +39990,7 @@ var ts;
39907
39990
  name: "noErrorTruncation",
39908
39991
  type: "boolean",
39909
39992
  affectsSemanticDiagnostics: true,
39993
+ affectsMultiFileEmitBuildInfo: true,
39910
39994
  category: ts.Diagnostics.Output_Formatting,
39911
39995
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
39912
39996
  defaultValueDescription: false,
@@ -39937,6 +40021,7 @@ var ts;
39937
40021
  name: "stripInternal",
39938
40022
  type: "boolean",
39939
40023
  affectsEmit: true,
40024
+ affectsMultiFileEmitBuildInfo: true,
39940
40025
  category: ts.Diagnostics.Emit,
39941
40026
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39942
40027
  defaultValueDescription: false,
@@ -39977,6 +40062,7 @@ var ts;
39977
40062
  name: "noImplicitUseStrict",
39978
40063
  type: "boolean",
39979
40064
  affectsSemanticDiagnostics: true,
40065
+ affectsMultiFileEmitBuildInfo: true,
39980
40066
  category: ts.Diagnostics.Backwards_Compatibility,
39981
40067
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
39982
40068
  defaultValueDescription: false,
@@ -39985,6 +40071,7 @@ var ts;
39985
40071
  name: "noEmitHelpers",
39986
40072
  type: "boolean",
39987
40073
  affectsEmit: true,
40074
+ affectsMultiFileEmitBuildInfo: true,
39988
40075
  category: ts.Diagnostics.Emit,
39989
40076
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
39990
40077
  defaultValueDescription: false,
@@ -39993,6 +40080,7 @@ var ts;
39993
40080
  name: "noEmitOnError",
39994
40081
  type: "boolean",
39995
40082
  affectsEmit: true,
40083
+ affectsMultiFileEmitBuildInfo: true,
39996
40084
  category: ts.Diagnostics.Emit,
39997
40085
  transpileOptionValue: undefined,
39998
40086
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40002,6 +40090,7 @@ var ts;
40002
40090
  name: "preserveConstEnums",
40003
40091
  type: "boolean",
40004
40092
  affectsEmit: true,
40093
+ affectsMultiFileEmitBuildInfo: true,
40005
40094
  category: ts.Diagnostics.Emit,
40006
40095
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40007
40096
  defaultValueDescription: false,
@@ -40010,6 +40099,8 @@ var ts;
40010
40099
  name: "declarationDir",
40011
40100
  type: "string",
40012
40101
  affectsEmit: true,
40102
+ affectsMultiFileEmitBuildInfo: true,
40103
+ affectsDeclarationPath: true,
40013
40104
  isFilePath: true,
40014
40105
  paramType: ts.Diagnostics.DIRECTORY,
40015
40106
  category: ts.Diagnostics.Emit,
@@ -40019,6 +40110,8 @@ var ts;
40019
40110
  {
40020
40111
  name: "skipLibCheck",
40021
40112
  type: "boolean",
40113
+ // We need to store these to determine whether `lib` files need to be rechecked
40114
+ affectsMultiFileEmitBuildInfo: true,
40022
40115
  category: ts.Diagnostics.Completeness,
40023
40116
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40024
40117
  defaultValueDescription: false,
@@ -40028,6 +40121,7 @@ var ts;
40028
40121
  type: "boolean",
40029
40122
  affectsBindDiagnostics: true,
40030
40123
  affectsSemanticDiagnostics: true,
40124
+ affectsMultiFileEmitBuildInfo: true,
40031
40125
  category: ts.Diagnostics.Type_Checking,
40032
40126
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40033
40127
  defaultValueDescription: undefined,
@@ -40037,6 +40131,7 @@ var ts;
40037
40131
  type: "boolean",
40038
40132
  affectsBindDiagnostics: true,
40039
40133
  affectsSemanticDiagnostics: true,
40134
+ affectsMultiFileEmitBuildInfo: true,
40040
40135
  category: ts.Diagnostics.Type_Checking,
40041
40136
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40042
40137
  defaultValueDescription: undefined,
@@ -40045,6 +40140,7 @@ var ts;
40045
40140
  name: "suppressExcessPropertyErrors",
40046
40141
  type: "boolean",
40047
40142
  affectsSemanticDiagnostics: true,
40143
+ affectsMultiFileEmitBuildInfo: true,
40048
40144
  category: ts.Diagnostics.Backwards_Compatibility,
40049
40145
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40050
40146
  defaultValueDescription: false,
@@ -40053,6 +40149,7 @@ var ts;
40053
40149
  name: "suppressImplicitAnyIndexErrors",
40054
40150
  type: "boolean",
40055
40151
  affectsSemanticDiagnostics: true,
40152
+ affectsMultiFileEmitBuildInfo: true,
40056
40153
  category: ts.Diagnostics.Backwards_Compatibility,
40057
40154
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40058
40155
  defaultValueDescription: false,
@@ -40077,6 +40174,7 @@ var ts;
40077
40174
  name: "noStrictGenericChecks",
40078
40175
  type: "boolean",
40079
40176
  affectsSemanticDiagnostics: true,
40177
+ affectsMultiFileEmitBuildInfo: true,
40080
40178
  category: ts.Diagnostics.Backwards_Compatibility,
40081
40179
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40082
40180
  defaultValueDescription: false,
@@ -40086,6 +40184,7 @@ var ts;
40086
40184
  type: "boolean",
40087
40185
  affectsSemanticDiagnostics: true,
40088
40186
  affectsEmit: true,
40187
+ affectsMultiFileEmitBuildInfo: true,
40089
40188
  category: ts.Diagnostics.Language_and_Environment,
40090
40189
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40091
40190
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40094,6 +40193,7 @@ var ts;
40094
40193
  name: "preserveValueImports",
40095
40194
  type: "boolean",
40096
40195
  affectsEmit: true,
40196
+ affectsMultiFileEmitBuildInfo: true,
40097
40197
  category: ts.Diagnostics.Emit,
40098
40198
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40099
40199
  defaultValueDescription: false,
@@ -40137,6 +40237,8 @@ var ts;
40137
40237
  /* @internal */
40138
40238
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40139
40239
  /* @internal */
40240
+ ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40241
+ /* @internal */
40140
40242
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40141
40243
  /* @internal */
40142
40244
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -40992,6 +41094,7 @@ var ts;
40992
41094
  return optionDefinition.type;
40993
41095
  }
40994
41096
  }
41097
+ /* @internal */
40995
41098
  function getNameOfCompilerOptionValue(value, customTypeMap) {
40996
41099
  // There is a typeMap associated with this command-line option so use it to map value back to its name
40997
41100
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41000,6 +41103,7 @@ var ts;
41000
41103
  }
41001
41104
  });
41002
41105
  }
41106
+ ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41003
41107
  function serializeCompilerOptions(options, pathOptions) {
41004
41108
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41005
41109
  }
@@ -65312,20 +65416,6 @@ var ts;
65312
65416
  }
65313
65417
  }
65314
65418
  }
65315
- if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
65316
- // This is a carve-out in comparability to essentially forbid comparing a type parameter
65317
- // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
65318
- var constraint = getConstraintOfTypeParameter(source);
65319
- if (constraint && hasNonCircularBaseConstraint(source)) {
65320
- while (constraint && constraint.flags & 262144 /* TypeParameter */) {
65321
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false)) {
65322
- return result;
65323
- }
65324
- constraint = getConstraintOfTypeParameter(constraint);
65325
- }
65326
- }
65327
- return 0 /* False */;
65328
- }
65329
65419
  }
65330
65420
  else if (targetFlags & 4194304 /* Index */) {
65331
65421
  var targetType_1 = target.type;
@@ -65529,8 +65619,8 @@ var ts;
65529
65619
  if (sourceFlags & 8650752 /* TypeVariable */) {
65530
65620
  // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
65531
65621
  if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
65532
- var constraint = getConstraintOfType(source) || unknownType;
65533
- if (!strictNullChecks && (!getConstraintOfType(source) || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */))) {
65622
+ var constraint = getConstraintOfType(source);
65623
+ if (!strictNullChecks && (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */))) {
65534
65624
  // A type variable with no constraint is not related to the non-primitive object type.
65535
65625
  if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
65536
65626
  resetErrorInfo(saveErrorInfo);
@@ -65538,12 +65628,12 @@ var ts;
65538
65628
  }
65539
65629
  }
65540
65630
  // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
65541
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
65631
+ else if (constraint && (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState))) {
65542
65632
  resetErrorInfo(saveErrorInfo);
65543
65633
  return result;
65544
65634
  }
65545
65635
  // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
65546
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
65636
+ else if (constraint && (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState))) {
65547
65637
  resetErrorInfo(saveErrorInfo);
65548
65638
  return result;
65549
65639
  }
@@ -109862,7 +109952,8 @@ var ts;
109862
109952
  return;
109863
109953
  }
109864
109954
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
109865
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
109955
+ var buildInfo = { bundle: bundle, program: program, version: version };
109956
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
109866
109957
  }
109867
109958
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
109868
109959
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110016,13 +110107,18 @@ var ts;
110016
110107
  if (sourceMapFilePath) {
110017
110108
  var sourceMap = sourceMapGenerator.toString();
110018
110109
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
110110
+ if (printer.bundleFileInfo)
110111
+ printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
110019
110112
  }
110020
110113
  }
110021
110114
  else {
110022
110115
  writer.writeLine();
110023
110116
  }
110024
110117
  // Write the output file
110025
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110118
+ var text = writer.getText();
110119
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110120
+ if (printer.bundleFileInfo)
110121
+ printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
110026
110122
  // Reset state
110027
110123
  writer.clear();
110028
110124
  }
@@ -110165,34 +110261,54 @@ var ts;
110165
110261
  }
110166
110262
  /*@internal*/
110167
110263
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110264
+ var createHash = ts.maybeBind(host, host.createHash);
110168
110265
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110169
- var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110170
- if (!buildInfoText)
110266
+ var buildInfo;
110267
+ if (host.getBuildInfo) {
110268
+ var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
110269
+ if (!hostBuildInfo)
110270
+ return buildInfoPath;
110271
+ buildInfo = hostBuildInfo;
110272
+ }
110273
+ else {
110274
+ var buildInfoText = host.readFile(buildInfoPath);
110275
+ if (!buildInfoText)
110276
+ return buildInfoPath;
110277
+ buildInfo = getBuildInfo(buildInfoText);
110278
+ }
110279
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
110171
110280
  return buildInfoPath;
110172
110281
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110173
110282
  if (!jsFileText)
110174
110283
  return jsFilePath;
110284
+ if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110285
+ return jsFilePath;
110175
110286
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110176
110287
  // error if no source map or for now if inline sourcemap
110177
110288
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110178
110289
  return sourceMapFilePath || "inline sourcemap decoding";
110290
+ if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110291
+ return sourceMapFilePath;
110179
110292
  // read declaration text
110180
110293
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110181
110294
  if (declarationFilePath && !declarationText)
110182
110295
  return declarationFilePath;
110296
+ if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
110297
+ return declarationFilePath;
110183
110298
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
110184
110299
  // error if no source map or for now if inline sourcemap
110185
110300
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
110186
110301
  return declarationMapPath || "inline sourcemap decoding";
110187
- var buildInfo = getBuildInfo(buildInfoText);
110188
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110189
- return buildInfoPath;
110302
+ if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
110303
+ return declarationMapPath;
110190
110304
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
110191
110305
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
110192
110306
  /*onlyOwnText*/ true);
110193
110307
  var outputFiles = [];
110194
110308
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
110195
110309
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
110310
+ var changedDtsText;
110311
+ var changedDtsData;
110196
110312
  var emitHost = {
110197
110313
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
110198
110314
  getCanonicalFileName: host.getCanonicalFileName,
@@ -110208,7 +110324,7 @@ var ts;
110208
110324
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
110209
110325
  getProjectReferenceRedirect: ts.returnUndefined,
110210
110326
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
110211
- writeFile: function (name, text, writeByteOrderMark) {
110327
+ writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110212
110328
  switch (name) {
110213
110329
  case jsFilePath:
110214
110330
  if (jsFileText === text)
@@ -110219,8 +110335,13 @@ var ts;
110219
110335
  return;
110220
110336
  break;
110221
110337
  case buildInfoPath:
110222
- var newBuildInfo = getBuildInfo(text);
110338
+ var newBuildInfo = data.buildInfo;
110223
110339
  newBuildInfo.program = buildInfo.program;
110340
+ if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
110341
+ // Update the output signature
110342
+ newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
110343
+ newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
110344
+ }
110224
110345
  // Update sourceFileInfo
110225
110346
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
110226
110347
  newBuildInfo.bundle.js.sources = js.sources;
@@ -110228,11 +110349,13 @@ var ts;
110228
110349
  newBuildInfo.bundle.dts.sources = dts.sources;
110229
110350
  }
110230
110351
  newBuildInfo.bundle.sourceFiles = sourceFiles;
110231
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
110352
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110232
110353
  return;
110233
110354
  case declarationFilePath:
110234
110355
  if (declarationText === text)
110235
110356
  return;
110357
+ changedDtsText = text;
110358
+ changedDtsData = data;
110236
110359
  break;
110237
110360
  case declarationMapPath:
110238
110361
  if (declarationMapText === text)
@@ -110251,6 +110374,7 @@ var ts;
110251
110374
  getSourceFileFromReference: ts.returnUndefined,
110252
110375
  redirectTargetsMap: ts.createMultiMap(),
110253
110376
  getFileIncludeReasons: ts.notImplemented,
110377
+ createHash: createHash,
110254
110378
  };
110255
110379
  emitFiles(ts.notImplementedResolver, emitHost,
110256
110380
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -115335,12 +115459,10 @@ var ts;
115335
115459
  }
115336
115460
  ts.createCompilerHost = createCompilerHost;
115337
115461
  /*@internal*/
115338
- // TODO(shkamat): update this after reworking ts build API
115339
115462
  function createCompilerHostWorker(options, setParentNodes, system) {
115340
115463
  if (system === void 0) { system = ts.sys; }
115341
115464
  var existingDirectories = new ts.Map();
115342
115465
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
115343
- var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
115344
115466
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
115345
115467
  var text;
115346
115468
  try {
@@ -115373,7 +115495,7 @@ var ts;
115373
115495
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
115374
115496
  // the system.writeFile will do its own directory creation and
115375
115497
  // the ensureDirectoriesExist call will always be redundant.
115376
- 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); });
115498
+ 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); });
115377
115499
  ts.performance.mark("afterIOWrite");
115378
115500
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
115379
115501
  }
@@ -115383,35 +115505,6 @@ var ts;
115383
115505
  }
115384
115506
  }
115385
115507
  }
115386
- var outputFingerprints;
115387
- function writeFileWorker(fileName, data, writeByteOrderMark) {
115388
- if (!ts.isWatchSet(options) || !system.getModifiedTime) {
115389
- system.writeFile(fileName, data, writeByteOrderMark);
115390
- return;
115391
- }
115392
- if (!outputFingerprints) {
115393
- outputFingerprints = new ts.Map();
115394
- }
115395
- var hash = computeHash(data);
115396
- var mtimeBefore = system.getModifiedTime(fileName);
115397
- if (mtimeBefore) {
115398
- var fingerprint = outputFingerprints.get(fileName);
115399
- // If output has not been changed, and the file has no external modification
115400
- if (fingerprint &&
115401
- fingerprint.byteOrderMark === writeByteOrderMark &&
115402
- fingerprint.hash === hash &&
115403
- fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
115404
- return;
115405
- }
115406
- }
115407
- system.writeFile(fileName, data, writeByteOrderMark);
115408
- var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
115409
- outputFingerprints.set(fileName, {
115410
- hash: hash,
115411
- byteOrderMark: writeByteOrderMark,
115412
- mtime: mtimeAfter
115413
- });
115414
- }
115415
115508
  function getDefaultLibLocation() {
115416
115509
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
115417
115510
  }
@@ -116963,6 +117056,7 @@ var ts;
116963
117056
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
116964
117057
  redirectTargetsMap: redirectTargetsMap,
116965
117058
  getFileIncludeReasons: program.getFileIncludeReasons,
117059
+ createHash: ts.maybeBind(host, host.createHash),
116966
117060
  };
116967
117061
  }
116968
117062
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119076,13 +119170,9 @@ var ts;
119076
119170
  function createManyToManyPathMap() {
119077
119171
  function create(forward, reverse, deleted) {
119078
119172
  var map = {
119079
- clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119080
- forEach: function (fn) { return forward.forEach(fn); },
119081
119173
  getKeys: function (v) { return reverse.get(v); },
119082
119174
  getValues: function (k) { return forward.get(k); },
119083
- hasKey: function (k) { return forward.has(k); },
119084
119175
  keys: function () { return forward.keys(); },
119085
- deletedKeys: function () { return deleted; },
119086
119176
  deleteKey: function (k) {
119087
119177
  (deleted || (deleted = new ts.Set())).add(k);
119088
119178
  var set = forward.get(k);
@@ -119109,11 +119199,6 @@ var ts;
119109
119199
  });
119110
119200
  return map;
119111
119201
  },
119112
- clear: function () {
119113
- forward.clear();
119114
- reverse.clear();
119115
- deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119116
- }
119117
119202
  };
119118
119203
  return map;
119119
119204
  }
@@ -119241,18 +119326,21 @@ var ts;
119241
119326
  * Creates the state of file references and signature for the new program from oldState if it is safe
119242
119327
  */
119243
119328
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119329
+ var _a, _b, _c;
119244
119330
  var fileInfos = new ts.Map();
119245
119331
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
119246
119332
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119247
- var hasCalledUpdateShapeSignature = new ts.Set();
119248
119333
  var useOldState = canReuseOldState(referencedMap, oldState);
119249
119334
  // Ensure source files have parent pointers set
119250
119335
  newProgram.getTypeChecker();
119251
119336
  // Create the reference map, and set the file infos
119252
- for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119253
- var sourceFile = _a[_i];
119337
+ for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
119338
+ var sourceFile = _d[_i];
119254
119339
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
119255
- var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
119340
+ var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
119341
+ var signature = oldUncommitedSignature === undefined ?
119342
+ useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
119343
+ oldUncommitedSignature || undefined;
119256
119344
  if (referencedMap) {
119257
119345
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
119258
119346
  if (newReferences) {
@@ -119260,19 +119348,26 @@ var ts;
119260
119348
  }
119261
119349
  // Copy old visible to outside files map
119262
119350
  if (useOldState) {
119263
- var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
119351
+ var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
119352
+ var exportedModules = oldUncommitedExportedModules === undefined ?
119353
+ oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
119354
+ oldUncommitedExportedModules || undefined;
119264
119355
  if (exportedModules) {
119265
119356
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119266
119357
  }
119267
119358
  }
119268
119359
  }
119269
- fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
119360
+ fileInfos.set(sourceFile.resolvedPath, {
119361
+ version: version_2,
119362
+ signature: signature,
119363
+ affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
119364
+ impliedFormat: sourceFile.impliedNodeFormat
119365
+ });
119270
119366
  }
119271
119367
  return {
119272
119368
  fileInfos: fileInfos,
119273
119369
  referencedMap: referencedMap,
119274
119370
  exportedModulesMap: exportedModulesMap,
119275
- hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
119276
119371
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
119277
119372
  };
119278
119373
  }
@@ -119286,71 +119381,42 @@ var ts;
119286
119381
  }
119287
119382
  BuilderState.releaseCache = releaseCache;
119288
119383
  /**
119289
- * Creates a clone of the state
119384
+ * Gets the files affected by the path from the program
119290
119385
  */
119291
- function clone(state) {
119386
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
119292
119387
  var _a, _b;
119293
- // Dont need to backup allFiles info since its cache anyway
119294
- return {
119295
- fileInfos: new ts.Map(state.fileInfos),
119296
- referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
119297
- exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
119298
- hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
119299
- useFileVersionAsSignature: state.useFileVersionAsSignature,
119300
- };
119388
+ var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
119389
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119390
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119391
+ return result;
119301
119392
  }
119302
- BuilderState.clone = clone;
119303
- /**
119304
- * Gets the files affected by the path from the program
119305
- */
119306
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
119307
- // Since the operation could be cancelled, the signatures are always stored in the cache
119308
- // They will be committed once it is safe to use them
119309
- // eg when calling this api from tsserver, if there is no cancellation of the operation
119310
- // In the other cases the affected files signatures are committed only after the iteration through the result is complete
119311
- var signatureCache = cacheToUpdateSignature || new ts.Map();
119393
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119394
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
119312
119395
  var sourceFile = programOfThisState.getSourceFileByPath(path);
119313
119396
  if (!sourceFile) {
119314
119397
  return ts.emptyArray;
119315
119398
  }
119316
- if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
119399
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
119317
119400
  return [sourceFile];
119318
119401
  }
119319
- var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
119320
- if (!cacheToUpdateSignature) {
119321
- // Commit all the signatures in the signature cache
119322
- updateSignaturesFromCache(state, signatureCache);
119323
- }
119324
- return result;
119325
- }
119326
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119327
- /**
119328
- * Updates the signatures from the cache into state's fileinfo signatures
119329
- * This should be called whenever it is safe to commit the state of the builder
119330
- */
119331
- function updateSignaturesFromCache(state, signatureCache) {
119332
- signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
119402
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
119333
119403
  }
119334
- BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
119404
+ BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
119335
119405
  function updateSignatureOfFile(state, signature, path) {
119336
119406
  state.fileInfos.get(path).signature = signature;
119337
- state.hasCalledUpdateShapeSignature.add(path);
119407
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
119338
119408
  }
119339
119409
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
119340
119410
  /**
119341
119411
  * Returns if the shape of the signature has changed since last emit
119342
119412
  */
119343
- function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
119413
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
119414
+ var _a;
119344
119415
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
119345
- ts.Debug.assert(!!sourceFile);
119346
- ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
119347
119416
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
119348
- if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
119417
+ if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
119349
119418
  return false;
119350
- }
119351
119419
  var info = state.fileInfos.get(sourceFile.resolvedPath);
119352
- if (!info)
119353
- return ts.Debug.fail();
119354
119420
  var prevSignature = info.signature;
119355
119421
  var latestSignature;
119356
119422
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -119361,45 +119427,55 @@ var ts;
119361
119427
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
119362
119428
  if (firstDts_1) {
119363
119429
  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; })); });
119364
- latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
119365
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119366
- updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
119430
+ latestSignature = computeSignature(firstDts_1.text, computeHash);
119431
+ if (latestSignature !== prevSignature) {
119432
+ updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
119367
119433
  }
119368
119434
  }
119369
119435
  }
119370
119436
  // Default is to use file version as signature
119371
119437
  if (latestSignature === undefined) {
119372
119438
  latestSignature = sourceFile.version;
119373
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119439
+ if (state.exportedModulesMap && latestSignature !== prevSignature) {
119440
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119374
119441
  // All the references in this file are exported
119375
119442
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
119376
119443
  if (references) {
119377
- exportedModulesMapCache.set(sourceFile.resolvedPath, references);
119444
+ state.exportedModulesMap.set(sourceFile.resolvedPath, references);
119378
119445
  }
119379
119446
  else {
119380
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119447
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119381
119448
  }
119382
119449
  }
119383
119450
  }
119384
- cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
119451
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
119452
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
119453
+ info.signature = latestSignature;
119385
119454
  return latestSignature !== prevSignature;
119386
119455
  }
119387
119456
  BuilderState.updateShapeSignature = updateShapeSignature;
119457
+ function computeSignature(text, computeHash) {
119458
+ return (computeHash || ts.generateDjb2Hash)(text);
119459
+ }
119460
+ BuilderState.computeSignature = computeSignature;
119388
119461
  /**
119389
119462
  * Coverts the declaration emit result into exported modules map
119390
119463
  */
119391
- function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
119464
+ function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
119465
+ if (!state.exportedModulesMap)
119466
+ return;
119467
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119392
119468
  if (!exportedModulesFromDeclarationEmit) {
119393
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119469
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119394
119470
  return;
119395
119471
  }
119396
119472
  var exportedModules;
119397
119473
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
119398
119474
  if (exportedModules) {
119399
- exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
119475
+ state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119400
119476
  }
119401
119477
  else {
119402
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119478
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119403
119479
  }
119404
119480
  function addExportedModule(exportedModulePaths) {
119405
119481
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -119411,19 +119487,6 @@ var ts;
119411
119487
  }
119412
119488
  }
119413
119489
  BuilderState.updateExportedModules = updateExportedModules;
119414
- /**
119415
- * Updates the exported modules from cache into state's exported modules map
119416
- * This should be called whenever it is safe to commit the state of the builder
119417
- */
119418
- function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
119419
- var _a;
119420
- if (exportedModulesMapCache) {
119421
- ts.Debug.assert(!!state.exportedModulesMap);
119422
- (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
119423
- exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
119424
- }
119425
- }
119426
- BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
119427
119490
  /**
119428
119491
  * Get all the dependencies of the sourceFile
119429
119492
  */
@@ -119544,7 +119607,7 @@ var ts;
119544
119607
  /**
119545
119608
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
119546
119609
  */
119547
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
119610
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
119548
119611
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
119549
119612
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
119550
119613
  }
@@ -119564,7 +119627,7 @@ var ts;
119564
119627
  if (!seenFileNamesMap.has(currentPath)) {
119565
119628
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
119566
119629
  seenFileNamesMap.set(currentPath, currentSourceFile);
119567
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
119630
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
119568
119631
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
119569
119632
  }
119570
119633
  }
@@ -119590,32 +119653,33 @@ var ts;
119590
119653
  * Create the state so that we can iterate on changedFiles/affected files
119591
119654
  */
119592
119655
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119656
+ var _a, _b;
119593
119657
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
119594
119658
  state.program = newProgram;
119595
119659
  var compilerOptions = newProgram.getCompilerOptions();
119596
119660
  state.compilerOptions = compilerOptions;
119661
+ var outFilePath = ts.outFile(compilerOptions);
119597
119662
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
119598
- if (!ts.outFile(compilerOptions)) {
119663
+ if (!outFilePath) {
119599
119664
  state.semanticDiagnosticsPerFile = new ts.Map();
119600
119665
  }
119666
+ 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)) {
119667
+ state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
119668
+ }
119601
119669
  state.changedFilesSet = new ts.Set();
119670
+ state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
119602
119671
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
119603
119672
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
119604
119673
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
119605
119674
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
119675
+ var canCopyEmitSignatures = compilerOptions.composite &&
119676
+ (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
119677
+ !outFilePath &&
119678
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
119606
119679
  if (useOldState) {
119607
- // Verify the sanity of old state
119608
- if (!oldState.currentChangedFilePath) {
119609
- var affectedSignatures = oldState.currentAffectedFilesSignatures;
119610
- ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
119611
- }
119612
- var changedFilesSet = oldState.changedFilesSet;
119613
- if (canCopySemanticDiagnostics) {
119614
- ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
119615
- }
119616
119680
  // Copy old state's changed files set
119617
- changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
119618
- if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
119681
+ (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
119682
+ if (!outFilePath && oldState.affectedFilesPendingEmit) {
119619
119683
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
119620
119684
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
119621
119685
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -119636,6 +119700,8 @@ var ts;
119636
119700
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
119637
119701
  // versions dont match
119638
119702
  oldInfo.version !== info.version ||
119703
+ // Implied formats dont match
119704
+ oldInfo.impliedFormat !== info.impliedFormat ||
119639
119705
  // Referenced files changed
119640
119706
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
119641
119707
  // Referenced file was deleted in the new program
@@ -119659,27 +119725,25 @@ var ts;
119659
119725
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
119660
119726
  }
119661
119727
  }
119728
+ if (canCopyEmitSignatures) {
119729
+ var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
119730
+ if (oldEmitSignature)
119731
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
119732
+ }
119662
119733
  });
119663
119734
  // If the global file is removed, add all files as changed
119664
119735
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
119665
119736
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
119666
119737
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
119667
119738
  }
119668
- else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
119739
+ else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
119669
119740
  // Add all files to affectedFilesPendingEmit since emit changed
119670
119741
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
119671
119742
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
119672
119743
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
119673
119744
  }
119674
- if (useOldState) {
119675
- // Any time the interpretation of a source file changes, mark it as changed
119676
- ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
119677
- if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
119678
- state.changedFilesSet.add(sourceFilePath);
119679
- }
119680
- });
119681
- }
119682
- state.buildInfoEmitPending = !!state.changedFilesSet.size;
119745
+ // Since old states change files set is copied, any additional change means we would need to emit build info
119746
+ state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
119683
119747
  return state;
119684
119748
  }
119685
119749
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -119715,30 +119779,35 @@ var ts;
119715
119779
  ts.BuilderState.releaseCache(state);
119716
119780
  state.program = undefined;
119717
119781
  }
119718
- /**
119719
- * Creates a clone of the state
119720
- */
119721
- function cloneBuilderProgramState(state) {
119722
- var _a;
119723
- var newState = ts.BuilderState.clone(state);
119724
- newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
119725
- newState.changedFilesSet = new ts.Set(state.changedFilesSet);
119726
- newState.affectedFiles = state.affectedFiles;
119727
- newState.affectedFilesIndex = state.affectedFilesIndex;
119728
- newState.currentChangedFilePath = state.currentChangedFilePath;
119729
- newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
119730
- newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
119731
- newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
119732
- newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
119733
- newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
119734
- newState.program = state.program;
119735
- newState.compilerOptions = state.compilerOptions;
119736
- newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
119737
- newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
119738
- newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
119739
- newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
119740
- newState.programEmitComplete = state.programEmitComplete;
119741
- return newState;
119782
+ function backupEmitBuilderProgramState(state) {
119783
+ var outFilePath = ts.outFile(state.compilerOptions);
119784
+ // Only in --out changeFileSet is kept around till emit
119785
+ ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
119786
+ return {
119787
+ affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
119788
+ affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
119789
+ affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
119790
+ seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
119791
+ programEmitComplete: state.programEmitComplete,
119792
+ emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
119793
+ outSignature: state.outSignature,
119794
+ dtsChangeTime: state.dtsChangeTime,
119795
+ hasChangedEmitSignature: state.hasChangedEmitSignature,
119796
+ changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
119797
+ };
119798
+ }
119799
+ function restoreEmitBuilderProgramState(state, backupEmitState) {
119800
+ state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
119801
+ state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
119802
+ state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
119803
+ state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
119804
+ state.programEmitComplete = backupEmitState.programEmitComplete;
119805
+ state.emitSignatures = backupEmitState.emitSignatures;
119806
+ state.outSignature = backupEmitState.outSignature;
119807
+ state.dtsChangeTime = backupEmitState.dtsChangeTime;
119808
+ state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
119809
+ if (backupEmitState.changedFilesSet)
119810
+ state.changedFilesSet = backupEmitState.changedFilesSet;
119742
119811
  }
119743
119812
  /**
119744
119813
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -119753,7 +119822,7 @@ var ts;
119753
119822
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
119754
119823
  */
119755
119824
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
119756
- var _a;
119825
+ var _a, _b;
119757
119826
  while (true) {
119758
119827
  var affectedFiles = state.affectedFiles;
119759
119828
  if (affectedFiles) {
@@ -119773,10 +119842,8 @@ var ts;
119773
119842
  state.changedFilesSet.delete(state.currentChangedFilePath);
119774
119843
  state.currentChangedFilePath = undefined;
119775
119844
  // Commit the changes in file signature
119776
- ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
119777
- state.currentAffectedFilesSignatures.clear();
119778
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
119779
- (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
119845
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119846
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119780
119847
  state.affectedFiles = undefined;
119781
119848
  }
119782
119849
  // Get next changed file
@@ -119794,12 +119861,7 @@ var ts;
119794
119861
  return program;
119795
119862
  }
119796
119863
  // Get next batch of affected files
119797
- if (!state.currentAffectedFilesSignatures)
119798
- state.currentAffectedFilesSignatures = new ts.Map();
119799
- if (state.exportedModulesMap) {
119800
- state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
119801
- }
119802
- state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
119864
+ state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
119803
119865
  state.currentChangedFilePath = nextKey.value;
119804
119866
  state.affectedFilesIndex = 0;
119805
119867
  if (!state.seenAffectedFiles)
@@ -119851,7 +119913,6 @@ var ts;
119851
119913
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
119852
119914
  */
119853
119915
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
119854
- var _a;
119855
119916
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
119856
119917
  // If affected files is everything except default library, then nothing more to do
119857
119918
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -119859,10 +119920,9 @@ var ts;
119859
119920
  // When a change affects the global scope, all files are considered to be affected without updating their signature
119860
119921
  // That means when affected file is handled, its signature can be out of date
119861
119922
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
119862
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
119923
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
119863
119924
  return;
119864
119925
  }
119865
- 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);
119866
119926
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
119867
119927
  return;
119868
119928
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -119882,7 +119942,7 @@ var ts;
119882
119942
  // This ensures that we dont later during incremental builds considering wrong signature.
119883
119943
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
119884
119944
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
119885
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
119945
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
119886
119946
  // If not dts emit, nothing more to do
119887
119947
  if (ts.getEmitDeclarations(state.compilerOptions)) {
119888
119948
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -119903,27 +119963,10 @@ var ts;
119903
119963
  return !state.semanticDiagnosticsFromOldState.size;
119904
119964
  }
119905
119965
  function isChangedSignature(state, path) {
119906
- var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
119907
- var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
119966
+ var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
119967
+ var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
119908
119968
  return newSignature !== oldSignature;
119909
119969
  }
119910
- function forEachKeyOfExportedModulesMap(state, filePath, fn) {
119911
- // Go through exported modules from cache first
119912
- var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
119913
- var result = keys && ts.forEachKey(keys, fn);
119914
- if (result)
119915
- return result;
119916
- // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
119917
- keys = state.exportedModulesMap.getKeys(filePath);
119918
- return keys && ts.forEachKey(keys, function (exportedFromPath) {
119919
- var _a;
119920
- // If the cache had an updated value, skip
119921
- return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
119922
- !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
119923
- fn(exportedFromPath) :
119924
- undefined;
119925
- });
119926
- }
119927
119970
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
119928
119971
  var _a;
119929
119972
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -119938,6 +119981,7 @@ var ts;
119938
119981
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
119939
119982
  */
119940
119983
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
119984
+ var _a;
119941
119985
  // If there was change in signature (dts output) for the changed file,
119942
119986
  // then only we need to handle pending file emit
119943
119987
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -119964,11 +120008,10 @@ var ts;
119964
120008
  }
119965
120009
  }
119966
120010
  }
119967
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
119968
120011
  var seenFileAndExportsOfFile = new ts.Set();
119969
120012
  // Go through exported modules from cache first
119970
120013
  // If exported modules has path, all files referencing file exported from are affected
119971
- forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120014
+ (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
119972
120015
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
119973
120016
  return true;
119974
120017
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -119982,19 +120025,18 @@ var ts;
119982
120025
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
119983
120026
  */
119984
120027
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
119985
- var _a;
120028
+ var _a, _b;
119986
120029
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
119987
120030
  return undefined;
119988
120031
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
119989
120032
  return true;
119990
120033
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
119991
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
119992
120034
  // If exported modules has path, all files referencing file exported from are affected
119993
- forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120035
+ (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
119994
120036
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
119995
120037
  });
119996
120038
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
119997
- (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120039
+ (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
119998
120040
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
119999
120041
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120000
120042
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120015,12 +120057,13 @@ var ts;
120015
120057
  }
120016
120058
  else {
120017
120059
  state.seenAffectedFiles.add(affected.resolvedPath);
120060
+ // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120061
+ state.buildInfoEmitPending = true;
120018
120062
  if (emitKind !== undefined) {
120019
120063
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120020
120064
  }
120021
120065
  if (isPendingEmit) {
120022
120066
  state.affectedFilesPendingEmitIndex++;
120023
- state.buildInfoEmitPending = true;
120024
120067
  }
120025
120068
  else {
120026
120069
  state.affectedFilesIndex++;
@@ -120071,22 +120114,43 @@ var ts;
120071
120114
  /**
120072
120115
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120073
120116
  */
120074
- function getProgramBuildInfo(state, getCanonicalFileName) {
120075
- if (ts.outFile(state.compilerOptions))
120076
- return undefined;
120117
+ function getProgramBuildInfo(state, getCanonicalFileName, host) {
120118
+ var outFilePath = ts.outFile(state.compilerOptions);
120119
+ if (outFilePath && !state.compilerOptions.composite)
120120
+ return;
120077
120121
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120078
120122
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
120123
+ state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
120124
+ if (outFilePath) {
120125
+ var result_15 = {
120126
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
120127
+ outSignature: state.outSignature,
120128
+ dtsChangeTime: state.dtsChangeTime,
120129
+ };
120130
+ return result_15;
120131
+ }
120079
120132
  var fileNames = [];
120080
120133
  var fileNameToFileId = new ts.Map();
120081
120134
  var fileIdsList;
120082
120135
  var fileNamesToFileIdListId;
120136
+ var emitSignatures;
120083
120137
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120138
+ var _b, _c;
120084
120139
  var key = _a[0], value = _a[1];
120085
120140
  // Ensure fileId
120086
120141
  var fileId = toFileId(key);
120087
120142
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120088
- var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120089
- var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
120143
+ var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
120144
+ var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
120145
+ if (state.compilerOptions.composite) {
120146
+ var file = state.program.getSourceFileByPath(key);
120147
+ if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
120148
+ var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
120149
+ if (emitSignature !== actualSignature) {
120150
+ (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
120151
+ }
120152
+ }
120153
+ }
120090
120154
  return value.version === actualSignature ?
120091
120155
  value.affectsGlobalScope || value.impliedFormat ?
120092
120156
  // If file version is same as signature, dont serialize signature
@@ -120094,11 +120158,11 @@ var ts;
120094
120158
  // If file info only contains version and signature and both are same we can just write string
120095
120159
  value.version :
120096
120160
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120097
- signature === undefined ?
120161
+ oldSignature === undefined ?
120098
120162
  // If we havent computed signature, use fileInfo as is
120099
120163
  value :
120100
120164
  // Serialize fileInfo with new updated signature
120101
- { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120165
+ { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120102
120166
  // Signature of the FileInfo is undefined, serialize it as false
120103
120167
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120104
120168
  });
@@ -120113,17 +120177,13 @@ var ts;
120113
120177
  if (state.exportedModulesMap) {
120114
120178
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120115
120179
  var _a;
120116
- if (state.currentAffectedFilesExportedModulesMap) {
120117
- if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120118
- return undefined;
120119
- }
120120
- var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120121
- if (newValue) {
120122
- return [toFileId(key), toFileIdListId(newValue)];
120123
- }
120124
- }
120180
+ var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120125
120181
  // Not in temporary cache, use existing value
120126
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120182
+ if (oldValue === undefined)
120183
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120184
+ if (oldValue)
120185
+ return [toFileId(key), toFileIdListId(oldValue)];
120186
+ return undefined;
120127
120187
  });
120128
120188
  }
120129
120189
  var semanticDiagnosticsPerFile;
@@ -120134,9 +120194,7 @@ var ts;
120134
120194
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120135
120195
  [
120136
120196
  toFileId(key),
120137
- state.hasReusableDiagnostic ?
120138
- value :
120139
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120197
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120140
120198
  ] :
120141
120199
  toFileId(key));
120142
120200
  }
@@ -120151,16 +120209,27 @@ var ts;
120151
120209
  }
120152
120210
  }
120153
120211
  }
120154
- return {
120212
+ var changeFileSet;
120213
+ if (state.changedFilesSet.size) {
120214
+ for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
120215
+ var path = _e[_d];
120216
+ (changeFileSet || (changeFileSet = [])).push(toFileId(path));
120217
+ }
120218
+ }
120219
+ var result = {
120155
120220
  fileNames: fileNames,
120156
120221
  fileInfos: fileInfos,
120157
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120222
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120158
120223
  fileIdsList: fileIdsList,
120159
120224
  referencedMap: referencedMap,
120160
120225
  exportedModulesMap: exportedModulesMap,
120161
120226
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120162
120227
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120228
+ changeFileSet: changeFileSet,
120229
+ emitSignatures: emitSignatures,
120230
+ dtsChangeTime: state.dtsChangeTime,
120163
120231
  };
120232
+ return result;
120164
120233
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120165
120234
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120166
120235
  }
@@ -120185,24 +120254,18 @@ var ts;
120185
120254
  }
120186
120255
  return fileIdListId;
120187
120256
  }
120188
- }
120189
- function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120190
- var result;
120191
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120192
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120193
- var name = _a[_i];
120194
- var optionKey = name.toLowerCase();
120195
- var optionInfo = optionsNameMap.get(optionKey);
120196
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120197
- // We need to store `strict`, even though it won't be examined directly, so that the
120198
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120199
- optionKey === "strict" ||
120200
- // We need to store these to determine whether `lib` files need to be rechecked.
120201
- optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120202
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
120257
+ function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
120258
+ var result;
120259
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120260
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120261
+ var name = _a[_i];
120262
+ var optionInfo = optionsNameMap.get(name.toLowerCase());
120263
+ if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
120264
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
120265
+ }
120203
120266
  }
120267
+ return result;
120204
120268
  }
120205
- return result;
120206
120269
  }
120207
120270
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
120208
120271
  if (option) {
@@ -120276,6 +120339,10 @@ var ts;
120276
120339
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
120277
120340
  }
120278
120341
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
120342
+ function computeSignature(text, data, computeHash) {
120343
+ return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
120344
+ }
120345
+ ts.computeSignature = computeSignature;
120279
120346
  function createBuilderProgram(kind, _a) {
120280
120347
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
120281
120348
  // Return same program if underlying program doesnt change
@@ -120294,8 +120361,8 @@ var ts;
120294
120361
  */
120295
120362
  var computeHash = ts.maybeBind(host, host.createHash);
120296
120363
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
120297
- var backupState;
120298
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
120364
+ var backupEmitState;
120365
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
120299
120366
  // To ensure that we arent storing any references to old program or new program without state
120300
120367
  newProgram = undefined; // TODO: GH#18217
120301
120368
  oldProgram = undefined;
@@ -120303,20 +120370,20 @@ var ts;
120303
120370
  var getState = function () { return state; };
120304
120371
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
120305
120372
  builderProgram.getState = getState;
120306
- builderProgram.backupState = function () {
120307
- ts.Debug.assert(backupState === undefined);
120308
- backupState = cloneBuilderProgramState(state);
120373
+ builderProgram.backupEmitState = function () {
120374
+ ts.Debug.assert(backupEmitState === undefined);
120375
+ backupEmitState = backupEmitBuilderProgramState(state);
120309
120376
  };
120310
- builderProgram.restoreState = function () {
120311
- state = ts.Debug.checkDefined(backupState);
120312
- backupState = undefined;
120377
+ builderProgram.restoreEmitState = function () {
120378
+ restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
120379
+ backupEmitState = undefined;
120313
120380
  };
120314
120381
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
120315
120382
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
120316
120383
  builderProgram.emit = emit;
120317
120384
  builderProgram.releaseProgram = function () {
120318
120385
  releaseCache(state);
120319
- backupState = undefined;
120386
+ backupEmitState = undefined;
120320
120387
  };
120321
120388
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
120322
120389
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -120375,35 +120442,59 @@ var ts;
120375
120442
  return toAffectedFileEmitResult(state,
120376
120443
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120377
120444
  // Otherwise just affected file
120378
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120379
- getWriteFileUpdatingSignatureCallback(writeFile) :
120445
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
120446
+ getWriteFileCallback(writeFile, customTransformers) :
120380
120447
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
120381
120448
  }
120382
- function getWriteFileUpdatingSignatureCallback(writeFile) {
120449
+ function getWriteFileCallback(writeFile, customTransformers) {
120383
120450
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
120384
- var _a;
120451
+ var _a, _b, _c;
120385
120452
  if (ts.isDeclarationFileName(fileName)) {
120386
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120387
- var file = sourceFiles[0];
120388
- var info = state.fileInfos.get(file.resolvedPath);
120389
- var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
120390
- if (signature === file.version) {
120391
- var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
120392
- if (newSignature !== file.version) { // Update it
120393
- if (host.storeFilesChangingSignatureDuringEmit)
120394
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120395
- if (state.exportedModulesMap)
120396
- ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
120397
- if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
120398
- state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
120453
+ if (!ts.outFile(state.compilerOptions)) {
120454
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120455
+ var newSignature = void 0;
120456
+ if (!customTransformers) {
120457
+ var file = sourceFiles[0];
120458
+ var info = state.fileInfos.get(file.resolvedPath);
120459
+ if (info.signature === file.version) {
120460
+ newSignature = computeSignature(text, data, computeHash);
120461
+ if (newSignature !== file.version) { // Update it
120462
+ if (host.storeFilesChangingSignatureDuringEmit)
120463
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120464
+ if (state.exportedModulesMap)
120465
+ ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
120466
+ if (state.affectedFiles) {
120467
+ // Keep old signature so we know what to undo if cancellation happens
120468
+ var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
120469
+ if (existing === undefined)
120470
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
120471
+ info.signature = newSignature;
120472
+ }
120473
+ else {
120474
+ // These are directly commited
120475
+ info.signature = newSignature;
120476
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120477
+ }
120478
+ }
120399
120479
  }
120400
- else {
120401
- info.signature = newSignature;
120402
- if (state.exportedModulesMap)
120403
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120480
+ }
120481
+ if (state.compilerOptions.composite) {
120482
+ var filePath = sourceFiles[0].resolvedPath;
120483
+ var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
120484
+ newSignature || (newSignature = computeSignature(text, data, computeHash));
120485
+ if (newSignature !== oldSignature) {
120486
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
120487
+ state.hasChangedEmitSignature = true;
120404
120488
  }
120405
120489
  }
120406
120490
  }
120491
+ else if (state.compilerOptions.composite) {
120492
+ var newSignature = computeSignature(text, data, computeHash);
120493
+ if (newSignature !== state.outSignature) {
120494
+ state.outSignature = newSignature;
120495
+ state.hasChangedEmitSignature = true;
120496
+ }
120497
+ }
120407
120498
  }
120408
120499
  if (writeFile)
120409
120500
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -120468,8 +120559,8 @@ var ts;
120468
120559
  }
120469
120560
  }
120470
120561
  }
120471
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120472
- getWriteFileUpdatingSignatureCallback(writeFile) :
120562
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
120563
+ getWriteFileCallback(writeFile, customTransformers) :
120473
120564
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
120474
120565
  }
120475
120566
  /**
@@ -120558,14 +120649,28 @@ var ts;
120558
120649
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
120559
120650
  }
120560
120651
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
120561
- function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
120562
- var _a;
120652
+ function createBuilderProgramUsingProgramBuildInfo(programFromBuildInfo, buildInfoPath, host) {
120653
+ var _a, _b, _c, _d, _e;
120563
120654
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
120564
120655
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
120565
- var filePaths = program.fileNames.map(toPath);
120566
- var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
120656
+ var program = programFromBuildInfo;
120657
+ var filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
120658
+ var filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
120567
120659
  var fileInfos = new ts.Map();
120568
- program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
120660
+ var emitSignatures = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
120661
+ (_d = program.fileInfos) === null || _d === void 0 ? void 0 : _d.forEach(function (fileInfo, index) {
120662
+ var path = toFilePath(index + 1);
120663
+ var stateFileInfo = toBuilderStateFileInfo(fileInfo);
120664
+ fileInfos.set(path, stateFileInfo);
120665
+ if (emitSignatures && stateFileInfo.signature)
120666
+ emitSignatures.set(path, stateFileInfo.signature);
120667
+ });
120668
+ (_e = program.emitSignatures) === null || _e === void 0 ? void 0 : _e.forEach(function (value) {
120669
+ if (ts.isNumber(value))
120670
+ emitSignatures.delete(toFilePath(value));
120671
+ else
120672
+ emitSignatures.set(toFilePath(value[0]), value[1]);
120673
+ });
120569
120674
  var state = {
120570
120675
  fileInfos: fileInfos,
120571
120676
  compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
@@ -120576,11 +120681,15 @@ var ts;
120576
120681
  affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
120577
120682
  affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
120578
120683
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
120684
+ changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
120685
+ dtsChangeTime: program.dtsChangeTime,
120686
+ emitSignatures: (emitSignatures === null || emitSignatures === void 0 ? void 0 : emitSignatures.size) ? emitSignatures : undefined,
120687
+ outSignature: program.outSignature,
120579
120688
  };
120580
120689
  return {
120581
120690
  getState: function () { return state; },
120582
- backupState: ts.noop,
120583
- restoreState: ts.noop,
120691
+ backupEmitState: ts.noop,
120692
+ restoreEmitState: ts.noop,
120584
120693
  getProgram: ts.notImplemented,
120585
120694
  getProgramOrUndefined: ts.returnUndefined,
120586
120695
  releaseProgram: ts.noop,
@@ -120625,12 +120734,12 @@ var ts;
120625
120734
  return map;
120626
120735
  }
120627
120736
  }
120628
- ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
120737
+ ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
120629
120738
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
120630
120739
  return {
120631
120740
  getState: ts.notImplemented,
120632
- backupState: ts.noop,
120633
- restoreState: ts.noop,
120741
+ backupEmitState: ts.noop,
120742
+ restoreEmitState: ts.noop,
120634
120743
  getProgram: getProgram,
120635
120744
  getProgramOrUndefined: function () { return getState().program; },
120636
120745
  releaseProgram: function () { return getState().program = undefined; },
@@ -121746,9 +121855,9 @@ var ts;
121746
121855
  if (!preferSymlinks) {
121747
121856
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
121748
121857
  // so we only need to remove them from the realpath filenames.
121749
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
121750
- if (result_15)
121751
- return result_15;
121858
+ var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
121859
+ if (result_16)
121860
+ return result_16;
121752
121861
  }
121753
121862
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
121754
121863
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -121768,10 +121877,10 @@ var ts;
121768
121877
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
121769
121878
  var symlinkDirectory = symlinkDirectories_1[_i];
121770
121879
  var option = ts.resolvePath(symlinkDirectory, relative);
121771
- var result_16 = cb(option, target === referenceRedirect);
121880
+ var result_17 = cb(option, target === referenceRedirect);
121772
121881
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
121773
- if (result_16)
121774
- return result_16;
121882
+ if (result_17)
121883
+ return result_17;
121775
121884
  }
121776
121885
  });
121777
121886
  });
@@ -122663,6 +122772,7 @@ var ts;
122663
122772
  readDirectory: ts.maybeBind(host, host.readDirectory),
122664
122773
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
122665
122774
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
122775
+ now: ts.maybeBind(host, host.now),
122666
122776
  };
122667
122777
  function writeFile(fileName, text, writeByteOrderMark, onError) {
122668
122778
  try {
@@ -122723,6 +122833,7 @@ var ts;
122723
122833
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
122724
122834
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
122725
122835
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
122836
+ now: ts.maybeBind(system, system.now),
122726
122837
  };
122727
122838
  }
122728
122839
  ts.createProgramHost = createProgramHost;
@@ -122790,20 +122901,26 @@ var ts;
122790
122901
  var ts;
122791
122902
  (function (ts) {
122792
122903
  function readBuilderProgram(compilerOptions, host) {
122793
- if (ts.outFile(compilerOptions))
122794
- return undefined;
122795
122904
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
122796
122905
  if (!buildInfoPath)
122797
122906
  return undefined;
122798
- var content = host.readFile(buildInfoPath);
122799
- if (!content)
122800
- return undefined;
122801
- var buildInfo = ts.getBuildInfo(content);
122907
+ var buildInfo;
122908
+ if (host.getBuildInfo) {
122909
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
122910
+ if (!buildInfo)
122911
+ return undefined;
122912
+ }
122913
+ else {
122914
+ var content = host.readFile(buildInfoPath);
122915
+ if (!content)
122916
+ return undefined;
122917
+ buildInfo = ts.getBuildInfo(content);
122918
+ }
122802
122919
  if (buildInfo.version !== ts.version)
122803
122920
  return undefined;
122804
122921
  if (!buildInfo.program)
122805
122922
  return undefined;
122806
- return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
122923
+ return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
122807
122924
  }
122808
122925
  ts.readBuilderProgram = readBuilderProgram;
122809
122926
  function createIncrementalCompilerHost(options, system) {
@@ -122812,6 +122929,7 @@ var ts;
122812
122929
  host.createHash = ts.maybeBind(system, system.createHash);
122813
122930
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
122814
122931
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
122932
+ host.now = ts.maybeBind(system, system.now);
122815
122933
  ts.setGetSourceFileAsHashVersioned(host, system);
122816
122934
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
122817
122935
  return host;
@@ -123546,14 +123664,16 @@ var ts;
123546
123664
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
123547
123665
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
123548
123666
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
123549
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
123550
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
123551
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
123552
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
123667
+ UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
123668
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
123669
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
123670
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
123671
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
123553
123672
  /**
123554
123673
  * Projects with no outputs (i.e. "solution" files)
123555
123674
  */
123556
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
123675
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 12] = "ContainerOnly";
123676
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 13] = "ForceBuild";
123557
123677
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
123558
123678
  function resolveConfigFileProjectName(project) {
123559
123679
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -123598,9 +123718,11 @@ var ts;
123598
123718
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
123599
123719
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
123600
123720
  }
123601
- function newer(date1, date2) {
123602
- return date2 > date1 ? date2 : date1;
123721
+ /*@internal*/
123722
+ function getCurrentTime(host) {
123723
+ return host.now ? host.now() : new Date();
123603
123724
  }
123725
+ ts.getCurrentTime = getCurrentTime;
123604
123726
  /*@internal*/
123605
123727
  function isCircularBuildOrder(buildOrder) {
123606
123728
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -123690,6 +123812,7 @@ var ts;
123690
123812
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
123691
123813
  };
123692
123814
  }
123815
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
123693
123816
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
123694
123817
  var state = {
123695
123818
  host: host,
@@ -123706,8 +123829,9 @@ var ts;
123706
123829
  resolvedConfigFilePaths: new ts.Map(),
123707
123830
  configFileCache: new ts.Map(),
123708
123831
  projectStatus: new ts.Map(),
123709
- buildInfoChecked: new ts.Map(),
123710
123832
  extendedConfigCache: new ts.Map(),
123833
+ buildInfoCache: new ts.Map(),
123834
+ outputTimeStamps: new ts.Map(),
123711
123835
  builderPrograms: new ts.Map(),
123712
123836
  diagnostics: new ts.Map(),
123713
123837
  projectPendingBuild: new ts.Map(),
@@ -123731,6 +123855,7 @@ var ts;
123731
123855
  allWatchedConfigFiles: new ts.Map(),
123732
123856
  allWatchedExtendedConfigFiles: new ts.Map(),
123733
123857
  allWatchedPackageJsonFiles: new ts.Map(),
123858
+ filesWatched: new ts.Map(),
123734
123859
  lastCachedPackageJsonLookups: new ts.Map(),
123735
123860
  timerToBuildInvalidatedProject: undefined,
123736
123861
  reportFileChangeDetected: false,
@@ -123837,11 +123962,12 @@ var ts;
123837
123962
  // Config file cache
123838
123963
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
123839
123964
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
123840
- ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
123841
123965
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
123842
123966
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
123843
123967
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
123844
123968
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
123969
+ ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
123970
+ ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
123845
123971
  // Remove watches for the program no longer in the solution
123846
123972
  if (state.watch) {
123847
123973
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -124132,21 +124258,21 @@ var ts;
124132
124258
  }
124133
124259
  function emit(writeFileCallback, cancellationToken, customTransformers) {
124134
124260
  var _a;
124135
- var _b, _c;
124261
+ var _b, _c, _d;
124136
124262
  ts.Debug.assertIsDefined(program);
124137
124263
  ts.Debug.assert(step === BuildStep.Emit);
124138
124264
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
124139
- program.backupState();
124265
+ program.backupEmitState();
124140
124266
  var declDiagnostics;
124141
124267
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
124142
124268
  var outputFiles = [];
124143
124269
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
124144
124270
  /*write*/ undefined,
124145
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
124271
+ /*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,
124146
124272
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
124147
124273
  // Don't emit .d.ts if there are decl file errors
124148
124274
  if (declDiagnostics) {
124149
- program.restoreState();
124275
+ program.restoreEmitState();
124150
124276
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
124151
124277
  return {
124152
124278
  emitSkipped: true,
@@ -124156,37 +124282,43 @@ var ts;
124156
124282
  // Actual Emit
124157
124283
  var host = state.host, compilerHost = state.compilerHost;
124158
124284
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124159
- var newestDeclarationFileContentChangedTime = minimumDate;
124160
- var anyDtsChanged = false;
124285
+ var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124161
124286
  var emitterDiagnostics = ts.createDiagnosticCollection();
124162
124287
  var emittedOutputs = new ts.Map();
124288
+ var options = program.getCompilerOptions();
124289
+ var isIncremental = ts.isIncrementalCompilation(options);
124290
+ var outputTimeStampMap;
124291
+ var now;
124163
124292
  outputFiles.forEach(function (_a) {
124164
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124165
- var priorChangeTime;
124166
- if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124167
- // Check for unchanged .d.ts files
124168
- if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124169
- priorChangeTime = host.getModifiedTime(name);
124170
- }
124171
- else {
124293
+ var _b, _c;
124294
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124295
+ var path = toPath(state, name);
124296
+ emittedOutputs.set(toPath(state, name), name);
124297
+ if (buildInfo) {
124298
+ setBuildInfo(state, buildInfo, projectPath, options);
124299
+ 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)) {
124172
124300
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124173
- anyDtsChanged = true;
124174
124301
  }
124175
124302
  }
124176
- emittedOutputs.set(toPath(state, name), name);
124177
124303
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124178
- if (priorChangeTime !== undefined) {
124179
- newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
124304
+ if (!isIncremental && state.watch) {
124305
+ (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124180
124306
  }
124181
124307
  });
124182
- finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124183
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124308
+ finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124184
124309
  return emitResult;
124185
124310
  }
124186
124311
  function emitBuildInfo(writeFileCallback, cancellationToken) {
124187
124312
  ts.Debug.assertIsDefined(program);
124188
124313
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
124189
- var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
124314
+ var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
124315
+ if (data === null || data === void 0 ? void 0 : data.buildInfo)
124316
+ setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
124317
+ if (writeFileCallback)
124318
+ writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
124319
+ else
124320
+ state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
124321
+ }, cancellationToken);
124190
124322
  if (emitResult.diagnostics.length) {
124191
124323
  reportErrors(state, emitResult.diagnostics);
124192
124324
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -124199,7 +124331,7 @@ var ts;
124199
124331
  step = BuildStep.QueueReferencingProjects;
124200
124332
  return emitResult;
124201
124333
  }
124202
- function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
124334
+ function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124203
124335
  var _a;
124204
124336
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
124205
124337
  if (emitDiagnostics.length) {
@@ -124210,13 +124342,11 @@ var ts;
124210
124342
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
124211
124343
  }
124212
124344
  // Update time stamps for rest of the outputs
124213
- var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124345
+ updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124214
124346
  state.diagnostics.delete(projectPath);
124215
124347
  state.projectStatus.set(projectPath, {
124216
124348
  type: ts.UpToDateStatusType.UpToDate,
124217
- newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124218
- maximumDate :
124219
- newestDeclarationFileContentChangedTime,
124349
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124220
124350
  oldestOutputFileName: oldestOutputFileName
124221
124351
  });
124222
124352
  afterProgramDone(state, program, config);
@@ -124251,13 +124381,21 @@ var ts;
124251
124381
  ts.Debug.assert(!!outputFiles.length);
124252
124382
  var emitterDiagnostics = ts.createDiagnosticCollection();
124253
124383
  var emittedOutputs = new ts.Map();
124384
+ var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124385
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
124254
124386
  outputFiles.forEach(function (_a) {
124255
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124387
+ var _b, _c;
124388
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124256
124389
  emittedOutputs.set(toPath(state, name), name);
124390
+ if (buildInfo) {
124391
+ setBuildInfo(state, buildInfo, projectPath, config.options);
124392
+ if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
124393
+ resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124394
+ }
124395
+ }
124257
124396
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124258
124397
  });
124259
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124260
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
124398
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
124261
124399
  return { emitSkipped: false, diagnostics: emitDiagnostics };
124262
124400
  }
124263
124401
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -124419,7 +124557,7 @@ var ts;
124419
124557
  state.projectCompilerOptions = state.baseCompilerOptions;
124420
124558
  }
124421
124559
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
124422
- var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
124560
+ var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
124423
124561
  reportAndStoreErrors(state, resolvedPath, diagnostics);
124424
124562
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
124425
124563
  if (canEmitBuildInfo)
@@ -124427,9 +124565,95 @@ var ts;
124427
124565
  afterProgramDone(state, program, config);
124428
124566
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
124429
124567
  }
124568
+ function isFileWatcherWithModifiedTime(value) {
124569
+ return !!value.watcher;
124570
+ }
124571
+ function getModifiedTime(state, fileName) {
124572
+ var path = toPath(state, fileName);
124573
+ var existing = state.filesWatched.get(path);
124574
+ if (state.watch && !!existing) {
124575
+ if (!isFileWatcherWithModifiedTime(existing))
124576
+ return existing;
124577
+ if (existing.modifiedTime)
124578
+ return existing.modifiedTime;
124579
+ }
124580
+ var result = ts.getModifiedTime(state.host, fileName);
124581
+ if (state.watch) {
124582
+ if (existing)
124583
+ existing.modifiedTime = result;
124584
+ else
124585
+ state.filesWatched.set(path, result);
124586
+ }
124587
+ return result;
124588
+ }
124589
+ function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
124590
+ var path = toPath(state, file);
124591
+ var existing = state.filesWatched.get(path);
124592
+ if (existing && isFileWatcherWithModifiedTime(existing)) {
124593
+ existing.callbacks.push(callback);
124594
+ }
124595
+ else {
124596
+ var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
124597
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
124598
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
124599
+ existing.modifiedTime = modifiedTime;
124600
+ existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
124601
+ }, pollingInterval, options, watchType, project);
124602
+ state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
124603
+ }
124604
+ return {
124605
+ close: function () {
124606
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
124607
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
124608
+ if (existing.callbacks.length === 1) {
124609
+ state.filesWatched.delete(path);
124610
+ ts.closeFileWatcherOf(existing);
124611
+ }
124612
+ else {
124613
+ ts.unorderedRemoveItem(existing.callbacks, callback);
124614
+ }
124615
+ }
124616
+ };
124617
+ }
124618
+ function getOutputTimeStampMap(state, resolvedConfigFilePath) {
124619
+ if (!state.watch)
124620
+ return undefined;
124621
+ var result = state.outputTimeStamps.get(resolvedConfigFilePath);
124622
+ if (!result)
124623
+ state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
124624
+ return result;
124625
+ }
124626
+ function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
124627
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
124628
+ var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
124629
+ if (existing) {
124630
+ existing.buildInfo = buildInfo;
124631
+ existing.modifiedTime = getCurrentTime(state.host);
124632
+ }
124633
+ else {
124634
+ state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
124635
+ }
124636
+ }
124637
+ function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
124638
+ var path = toPath(state, buildInfoPath);
124639
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
124640
+ return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
124641
+ }
124642
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
124643
+ var path = toPath(state, buildInfoPath);
124644
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
124645
+ if (existing !== undefined && existing.path === path) {
124646
+ return existing.buildInfo || undefined;
124647
+ }
124648
+ var value = state.readFileWithCache(buildInfoPath);
124649
+ var buildInfo = value ? ts.getBuildInfo(value) : undefined;
124650
+ ts.Debug.assert(modifiedTime || !buildInfo);
124651
+ state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
124652
+ return buildInfo;
124653
+ }
124430
124654
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
124431
124655
  // Check tsconfig time
124432
- var tsconfigTime = ts.getModifiedTime(state.host, configFile);
124656
+ var tsconfigTime = getModifiedTime(state, configFile);
124433
124657
  if (oldestOutputFileTime < tsconfigTime) {
124434
124658
  return {
124435
124659
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -124439,88 +124663,24 @@ var ts;
124439
124663
  }
124440
124664
  }
124441
124665
  function getUpToDateStatusWorker(state, project, resolvedPath) {
124442
- var force = !!state.options.force;
124443
- var newestInputFileName = undefined;
124444
- var newestInputFileTime = minimumDate;
124445
- var host = state.host;
124446
- // Get timestamps of input files
124447
- for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
124448
- var inputFile = _a[_i];
124449
- if (!host.fileExists(inputFile)) {
124450
- return {
124451
- type: ts.UpToDateStatusType.Unbuildable,
124452
- reason: inputFile + " does not exist"
124453
- };
124454
- }
124455
- if (!force) {
124456
- var inputTime = ts.getModifiedTime(host, inputFile);
124457
- if (inputTime > newestInputFileTime) {
124458
- newestInputFileName = inputFile;
124459
- newestInputFileTime = inputTime;
124460
- }
124461
- }
124462
- }
124666
+ var _a, _b, _c;
124463
124667
  // Container if no files are specified in the project
124464
124668
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
124465
124669
  return {
124466
124670
  type: ts.UpToDateStatusType.ContainerOnly
124467
124671
  };
124468
124672
  }
124469
- // Collect the expected outputs of this project
124470
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
124471
- // Now see if all outputs are newer than the newest input
124472
- var oldestOutputFileName = "(none)";
124473
- var oldestOutputFileTime = maximumDate;
124474
- var newestOutputFileName = "(none)";
124475
- var newestOutputFileTime = minimumDate;
124476
- var missingOutputFileName;
124477
- var newestDeclarationFileContentChangedTime = minimumDate;
124478
- var isOutOfDateWithInputs = false;
124479
- if (!force) {
124480
- for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
124481
- var output = outputs_1[_b];
124482
- // Output is missing; can stop checking
124483
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
124484
- if (!host.fileExists(output)) {
124485
- missingOutputFileName = output;
124486
- break;
124487
- }
124488
- var outputTime = ts.getModifiedTime(host, output);
124489
- if (outputTime < oldestOutputFileTime) {
124490
- oldestOutputFileTime = outputTime;
124491
- oldestOutputFileName = output;
124492
- }
124493
- // If an output is older than the newest input, we can stop checking
124494
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
124495
- if (outputTime < newestInputFileTime) {
124496
- isOutOfDateWithInputs = true;
124497
- break;
124498
- }
124499
- if (outputTime > newestOutputFileTime) {
124500
- newestOutputFileTime = outputTime;
124501
- newestOutputFileName = output;
124502
- }
124503
- // Keep track of when the most recent time a .d.ts file was changed.
124504
- // In addition to file timestamps, we also keep track of when a .d.ts file
124505
- // had its file touched but not had its contents changed - this allows us
124506
- // to skip a downstream typecheck
124507
- if (ts.isDeclarationFileName(output)) {
124508
- var outputModifiedTime = ts.getModifiedTime(host, output);
124509
- newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
124510
- }
124511
- }
124512
- }
124513
- var pseudoUpToDate = false;
124514
- var usesPrepend = false;
124515
- var upstreamChangedProject;
124673
+ // Fast check to see if reference projects are buildable
124674
+ var referenceStatuses;
124675
+ var force = !!state.options.force;
124516
124676
  if (project.projectReferences) {
124517
124677
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
124518
- for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
124519
- var ref = _d[_c];
124520
- usesPrepend = usesPrepend || !!(ref.prepend);
124678
+ for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
124679
+ var ref = _d[_i];
124521
124680
  var resolvedRef = ts.resolveProjectReferencePath(ref);
124522
124681
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
124523
- var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
124682
+ var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
124683
+ var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
124524
124684
  // Its a circular reference ignore the status of this project
124525
124685
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
124526
124686
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -124542,75 +124702,170 @@ var ts;
124542
124702
  upstreamProjectName: ref.path
124543
124703
  };
124544
124704
  }
124545
- // Check oldest output file name only if there is no missing output file name
124546
- // (a check we will have skipped if this is a forced build)
124547
- if (!force && !missingOutputFileName) {
124548
- // If the upstream project's newest file is older than our oldest output, we
124549
- // can't be out of date because of it
124550
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
124551
- continue;
124552
- }
124553
- // If the upstream project has only change .d.ts files, and we've built
124554
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
124555
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
124556
- pseudoUpToDate = true;
124557
- upstreamChangedProject = ref.path;
124558
- continue;
124559
- }
124560
- // We have an output older than an upstream output - we are out of date
124561
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
124705
+ if (!force)
124706
+ (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
124707
+ }
124708
+ }
124709
+ if (force)
124710
+ return { type: ts.UpToDateStatusType.ForceBuild };
124711
+ // Check buildinfo first
124712
+ var host = state.host;
124713
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
124714
+ var oldestOutputFileName = "(none)";
124715
+ var oldestOutputFileTime = maximumDate;
124716
+ var buildInfoTime;
124717
+ var newestDeclarationFileContentChangedTime;
124718
+ if (buildInfoPath) {
124719
+ var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
124720
+ buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
124721
+ if (buildInfoTime === ts.missingFileModifiedTime) {
124722
+ if (!buildInfoCacheEntry_1) {
124723
+ state.buildInfoCache.set(resolvedPath, {
124724
+ path: toPath(state, buildInfoPath),
124725
+ buildInfo: false,
124726
+ modifiedTime: buildInfoTime
124727
+ });
124728
+ }
124729
+ return {
124730
+ type: ts.UpToDateStatusType.OutputMissing,
124731
+ missingOutputFileName: buildInfoPath
124732
+ };
124733
+ }
124734
+ var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
124735
+ if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
124736
+ return {
124737
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
124738
+ version: buildInfo.version
124739
+ };
124740
+ }
124741
+ if (buildInfo.program) {
124742
+ if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
124743
+ (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
124562
124744
  return {
124563
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124564
- outOfDateOutputFileName: oldestOutputFileName,
124565
- newerProjectName: ref.path
124745
+ type: ts.UpToDateStatusType.OutOfDateBuildInfo,
124746
+ buildInfoFile: buildInfoPath
124566
124747
  };
124567
124748
  }
124568
124749
  }
124750
+ oldestOutputFileTime = buildInfoTime;
124751
+ oldestOutputFileName = buildInfoPath;
124752
+ newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
124569
124753
  }
124570
- if (missingOutputFileName !== undefined) {
124571
- return {
124572
- type: ts.UpToDateStatusType.OutputMissing,
124573
- missingOutputFileName: missingOutputFileName
124574
- };
124754
+ // Check input files
124755
+ var newestInputFileName = undefined;
124756
+ var newestInputFileTime = minimumDate;
124757
+ // Get timestamps of input files
124758
+ for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
124759
+ var inputFile = _f[_e];
124760
+ var inputTime = getModifiedTime(state, inputFile);
124761
+ if (inputTime === ts.missingFileModifiedTime) {
124762
+ return {
124763
+ type: ts.UpToDateStatusType.Unbuildable,
124764
+ reason: inputFile + " does not exist"
124765
+ };
124766
+ }
124767
+ // If an buildInfo is older than the newest input, we can stop checking
124768
+ if (buildInfoTime && buildInfoTime < inputTime) {
124769
+ return {
124770
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
124771
+ outOfDateOutputFileName: buildInfoPath,
124772
+ newerInputFileName: inputFile
124773
+ };
124774
+ }
124775
+ if (inputTime > newestInputFileTime) {
124776
+ newestInputFileName = inputFile;
124777
+ newestInputFileTime = inputTime;
124778
+ }
124575
124779
  }
124576
- if (isOutOfDateWithInputs) {
124577
- return {
124578
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
124579
- outOfDateOutputFileName: oldestOutputFileName,
124580
- newerInputFileName: newestInputFileName
124581
- };
124780
+ // Now see if all outputs are newer than the newest input
124781
+ // Dont check output timestamps if we have buildinfo telling us output is uptodate
124782
+ if (!buildInfoPath) {
124783
+ // Collect the expected outputs of this project
124784
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
124785
+ var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
124786
+ for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
124787
+ var output = outputs_1[_g];
124788
+ var path = toPath(state, output);
124789
+ // Output is missing; can stop checking
124790
+ var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
124791
+ if (!outputTime) {
124792
+ outputTime = ts.getModifiedTime(state.host, output);
124793
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
124794
+ }
124795
+ if (outputTime === ts.missingFileModifiedTime) {
124796
+ return {
124797
+ type: ts.UpToDateStatusType.OutputMissing,
124798
+ missingOutputFileName: output
124799
+ };
124800
+ }
124801
+ if (outputTime < oldestOutputFileTime) {
124802
+ oldestOutputFileTime = outputTime;
124803
+ oldestOutputFileName = output;
124804
+ }
124805
+ // If an output is older than the newest input, we can stop checking
124806
+ if (outputTime < newestInputFileTime) {
124807
+ return {
124808
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
124809
+ outOfDateOutputFileName: oldestOutputFileName,
124810
+ newerInputFileName: newestInputFileName
124811
+ };
124812
+ }
124813
+ }
124582
124814
  }
124583
- else {
124584
- // Check tsconfig time
124585
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
124586
- if (configStatus)
124587
- return configStatus;
124588
- // Check extended config time
124589
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
124590
- if (extendedConfigStatus)
124591
- return extendedConfigStatus;
124592
- // Check package file time
124593
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
124594
- var path = _a[0];
124595
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
124596
- });
124597
- if (dependentPackageFileStatus)
124598
- return dependentPackageFileStatus;
124599
- }
124600
- if (!force && !state.buildInfoChecked.has(resolvedPath)) {
124601
- state.buildInfoChecked.set(resolvedPath, true);
124602
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
124603
- if (buildInfoPath) {
124604
- var value = state.readFileWithCache(buildInfoPath);
124605
- var buildInfo = value && ts.getBuildInfo(value);
124606
- if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
124815
+ var seenRefs = buildInfoPath ? new ts.Set() : undefined;
124816
+ var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
124817
+ seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
124818
+ var pseudoUpToDate = false;
124819
+ var usesPrepend = false;
124820
+ var upstreamChangedProject;
124821
+ if (referenceStatuses) {
124822
+ for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
124823
+ var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
124824
+ usesPrepend = usesPrepend || !!(ref.prepend);
124825
+ // If the upstream project's newest file is older than our oldest output, we
124826
+ // can't be out of date because of it
124827
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
124828
+ continue;
124829
+ }
124830
+ // Check if tsbuildinfo path is shared, then we need to rebuild
124831
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
124607
124832
  return {
124608
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
124609
- version: buildInfo.version
124833
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124834
+ outOfDateOutputFileName: buildInfoPath,
124835
+ newerProjectName: ref.path
124610
124836
  };
124611
124837
  }
124838
+ // If the upstream project has only change .d.ts files, and we've built
124839
+ // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
124840
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
124841
+ pseudoUpToDate = true;
124842
+ upstreamChangedProject = ref.path;
124843
+ continue;
124844
+ }
124845
+ // We have an output older than an upstream output - we are out of date
124846
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
124847
+ return {
124848
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124849
+ outOfDateOutputFileName: oldestOutputFileName,
124850
+ newerProjectName: ref.path
124851
+ };
124612
124852
  }
124613
124853
  }
124854
+ // Check tsconfig time
124855
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
124856
+ if (configStatus)
124857
+ return configStatus;
124858
+ // Check extended config time
124859
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
124860
+ if (extendedConfigStatus)
124861
+ return extendedConfigStatus;
124862
+ // Check package file time
124863
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
124864
+ var path = _a[0];
124865
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
124866
+ });
124867
+ if (dependentPackageFileStatus)
124868
+ return dependentPackageFileStatus;
124614
124869
  if (usesPrepend && pseudoUpToDate) {
124615
124870
  return {
124616
124871
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -124623,12 +124878,30 @@ var ts;
124623
124878
  type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
124624
124879
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
124625
124880
  newestInputFileTime: newestInputFileTime,
124626
- newestOutputFileTime: newestOutputFileTime,
124627
124881
  newestInputFileName: newestInputFileName,
124628
- newestOutputFileName: newestOutputFileName,
124629
124882
  oldestOutputFileName: oldestOutputFileName
124630
124883
  };
124631
124884
  }
124885
+ function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
124886
+ if (seenRefs.has(resolvedRefPath))
124887
+ return false;
124888
+ seenRefs.add(resolvedRefPath);
124889
+ var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
124890
+ if (refBuildInfo.path === buildInfoCacheEntry.path)
124891
+ return true;
124892
+ if (resolvedConfig.projectReferences) {
124893
+ // Check references
124894
+ for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
124895
+ var ref = _a[_i];
124896
+ var resolvedRef = ts.resolveProjectReferencePath(ref);
124897
+ var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
124898
+ var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
124899
+ if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
124900
+ return true;
124901
+ }
124902
+ }
124903
+ return false;
124904
+ }
124632
124905
  function getUpToDateStatus(state, project, resolvedPath) {
124633
124906
  if (project === undefined) {
124634
124907
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -124641,39 +124914,65 @@ var ts;
124641
124914
  state.projectStatus.set(resolvedPath, actual);
124642
124915
  return actual;
124643
124916
  }
124644
- function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
124917
+ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
124645
124918
  if (proj.options.noEmit)
124646
- return priorNewestUpdateTime;
124919
+ return;
124920
+ var now;
124921
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
124922
+ if (buildInfoPath) {
124923
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
124924
+ if (!!state.options.verbose)
124925
+ reportStatus(state, verboseMessage, proj.options.configFilePath);
124926
+ state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
124927
+ getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
124928
+ }
124929
+ state.outputTimeStamps.delete(projectPath);
124930
+ return;
124931
+ }
124647
124932
  var host = state.host;
124648
124933
  var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
124934
+ var outputTimeStampMap = getOutputTimeStampMap(state, projectPath);
124935
+ var modifiedOutputs = outputTimeStampMap ? new ts.Set() : undefined;
124649
124936
  if (!skipOutputs || outputs.length !== skipOutputs.size) {
124650
124937
  var reportVerbose = !!state.options.verbose;
124651
- var now = host.now ? host.now() : new Date();
124652
124938
  for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
124653
124939
  var file = outputs_2[_i];
124654
- if (skipOutputs && skipOutputs.has(toPath(state, file))) {
124940
+ var path = toPath(state, file);
124941
+ if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
124655
124942
  continue;
124656
- }
124657
124943
  if (reportVerbose) {
124658
124944
  reportVerbose = false;
124659
124945
  reportStatus(state, verboseMessage, proj.options.configFilePath);
124660
124946
  }
124661
- if (ts.isDeclarationFileName(file)) {
124662
- priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
124947
+ host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
124948
+ if (outputTimeStampMap) {
124949
+ outputTimeStampMap.set(path, now);
124950
+ modifiedOutputs.add(path);
124663
124951
  }
124664
- host.setModifiedTime(file, now);
124665
124952
  }
124666
124953
  }
124667
- return priorNewestUpdateTime;
124954
+ // Clear out timestamps not in output list any more
124955
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.forEach(function (_value, key) {
124956
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key))
124957
+ outputTimeStampMap.delete(key);
124958
+ });
124959
+ }
124960
+ function getDtsChangeTime(state, options, resolvedConfigPath) {
124961
+ var _a;
124962
+ if (!options.composite)
124963
+ return undefined;
124964
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
124965
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
124966
+ 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;
124668
124967
  }
124669
124968
  function updateOutputTimestamps(state, proj, resolvedPath) {
124670
124969
  if (state.options.dry) {
124671
124970
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
124672
124971
  }
124673
- var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
124972
+ updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
124674
124973
  state.projectStatus.set(resolvedPath, {
124675
124974
  type: ts.UpToDateStatusType.UpToDate,
124676
- newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
124975
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
124677
124976
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
124678
124977
  });
124679
124978
  }
@@ -124866,12 +125165,10 @@ var ts;
124866
125165
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
124867
125166
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
124868
125167
  return;
124869
- state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
124870
- invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
124871
- }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125168
+ 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));
124872
125169
  }
124873
125170
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
124874
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
125171
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
124875
125172
  var _a;
124876
125173
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
124877
125174
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -124903,7 +125200,7 @@ var ts;
124903
125200
  if (!state.watch)
124904
125201
  return;
124905
125202
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
124906
- 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); },
125203
+ 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); },
124907
125204
  onDeleteValue: ts.closeFileWatcher,
124908
125205
  });
124909
125206
  }
@@ -124911,7 +125208,7 @@ var ts;
124911
125208
  if (!state.watch || !state.lastCachedPackageJsonLookups)
124912
125209
  return;
124913
125210
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
124914
- createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
125211
+ createNewValue: function (path, _input) { return watchFile(state, path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
124915
125212
  onDeleteValue: ts.closeFileWatcher,
124916
125213
  });
124917
125214
  }
@@ -125043,19 +125340,18 @@ var ts;
125043
125340
  }
125044
125341
  }
125045
125342
  function reportUpToDateStatus(state, configFileName, status) {
125046
- if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125047
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125048
- }
125049
125343
  switch (status.type) {
125050
125344
  case ts.UpToDateStatusType.OutOfDateWithSelf:
125051
- 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));
125345
+ 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));
125052
125346
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
125053
- 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));
125347
+ 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));
125054
125348
  case ts.UpToDateStatusType.OutputMissing:
125055
125349
  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));
125350
+ case ts.UpToDateStatusType.OutOfDateBuildInfo:
125351
+ 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));
125056
125352
  case ts.UpToDateStatusType.UpToDate:
125057
125353
  if (status.newestInputFileTime !== undefined) {
125058
- 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 || ""));
125354
+ 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 || ""));
125059
125355
  }
125060
125356
  // Don't report anything for "up to date because it was already built" -- too verbose
125061
125357
  break;
@@ -125073,6 +125369,8 @@ var ts;
125073
125369
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
125074
125370
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
125075
125371
  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);
125372
+ case ts.UpToDateStatusType.ForceBuild:
125373
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125076
125374
  case ts.UpToDateStatusType.ContainerOnly:
125077
125375
  // Don't report status on "solution" projects
125078
125376
  // falls through