@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.
package/lib/tsserver.js CHANGED
@@ -6190,7 +6190,7 @@ var ts;
6190
6190
  };
6191
6191
  }
6192
6192
  function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6193
- var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {
6193
+ var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName, modifiedTime) {
6194
6194
  // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6195
6195
  if (!ts.isString(relativeFileName))
6196
6196
  return;
@@ -6200,7 +6200,7 @@ var ts;
6200
6200
  if (callbacks) {
6201
6201
  for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6202
6202
  var fileCallback = callbacks_1[_i];
6203
- fileCallback(fileName, FileWatcherEventKind.Changed);
6203
+ fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6204
6204
  }
6205
6205
  }
6206
6206
  },
@@ -6254,7 +6254,7 @@ var ts;
6254
6254
  }
6255
6255
  else {
6256
6256
  cache.set(path, {
6257
- watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),
6257
+ watcher: watchFile(fileName, function (fileName, eventKind, modifiedTime) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind, modifiedTime); }); }, pollingInterval, options),
6258
6258
  refCount: 1
6259
6259
  });
6260
6260
  }
@@ -6282,7 +6282,7 @@ var ts;
6282
6282
  var newTime = modifiedTime.getTime();
6283
6283
  if (oldTime !== newTime) {
6284
6284
  watchedFile.mtime = modifiedTime;
6285
- watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));
6285
+ watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime);
6286
6286
  return true;
6287
6287
  }
6288
6288
  return false;
@@ -6533,17 +6533,18 @@ var ts;
6533
6533
  })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
6534
6534
  /*@internal*/
6535
6535
  function createFileWatcherCallback(callback) {
6536
- return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
6536
+ return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
6537
6537
  }
6538
6538
  ts.createFileWatcherCallback = createFileWatcherCallback;
6539
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
6540
- return function (eventName) {
6539
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
6540
+ return function (eventName, _relativeFileName, modifiedTime) {
6541
6541
  if (eventName === "rename") {
6542
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
6542
+ modifiedTime || (modifiedTime = getModifiedTime(fileName) || ts.missingFileModifiedTime);
6543
+ callback(fileName, modifiedTime !== ts.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime);
6543
6544
  }
6544
6545
  else {
6545
6546
  // Change
6546
- callback(fileName, FileWatcherEventKind.Changed);
6547
+ callback(fileName, FileWatcherEventKind.Changed, modifiedTime);
6547
6548
  }
6548
6549
  };
6549
6550
  }
@@ -6567,7 +6568,7 @@ var ts;
6567
6568
  }
6568
6569
  /*@internal*/
6569
6570
  function createSystemWatchFunctions(_a) {
6570
- 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;
6571
+ 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;
6571
6572
  var dynamicPollingWatchFile;
6572
6573
  var fixedChunkSizePollingWatchFile;
6573
6574
  var nonPollingWatchFile;
@@ -6589,7 +6590,7 @@ var ts;
6589
6590
  case ts.WatchFileKind.FixedChunkSizePolling:
6590
6591
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
6591
6592
  case ts.WatchFileKind.UseFsEvents:
6592
- return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists),
6593
+ return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime),
6593
6594
  /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
6594
6595
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
6595
6596
  if (!nonPollingWatchFile) {
@@ -6771,7 +6772,6 @@ var ts;
6771
6772
  fsWatch: fsWatch,
6772
6773
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
6773
6774
  getCurrentDirectory: getCurrentDirectory,
6774
- fileExists: fileExists,
6775
6775
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
6776
6776
  // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
6777
6777
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
@@ -7031,7 +7031,7 @@ var ts;
7031
7031
  // File changed
7032
7032
  eventKind = FileWatcherEventKind.Changed;
7033
7033
  }
7034
- callback(fileName, eventKind);
7034
+ callback(fileName, eventKind, curr.mtime);
7035
7035
  }
7036
7036
  }
7037
7037
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
@@ -7057,10 +7057,10 @@ var ts;
7057
7057
  * Invoke the callback with rename and update the watcher if not closed
7058
7058
  * @param createWatcher
7059
7059
  */
7060
- function invokeCallbackAndUpdateWatcher(createWatcher) {
7060
+ function invokeCallbackAndUpdateWatcher(createWatcher, modifiedTime) {
7061
7061
  sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
7062
7062
  // Call the callback for current directory
7063
- callback("rename", "");
7063
+ callback("rename", "", modifiedTime);
7064
7064
  // If watcher is not closed, update it
7065
7065
  if (watcher) {
7066
7066
  watcher.close();
@@ -7106,13 +7106,14 @@ var ts;
7106
7106
  function callbackChangingToMissingFileSystemEntry(event, relativeName) {
7107
7107
  // because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
7108
7108
  // Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
7109
+ var modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime;
7109
7110
  return event === "rename" &&
7110
7111
  (!relativeName ||
7111
7112
  relativeName === lastDirectoryPart ||
7112
7113
  (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
7113
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
7114
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
7115
- callback(event, relativeName);
7114
+ modifiedTime === ts.missingFileModifiedTime ?
7115
+ invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry, modifiedTime) :
7116
+ callback(event, relativeName, modifiedTime);
7116
7117
  }
7117
7118
  /**
7118
7119
  * Watch the file or directory using fs.watchFile since fs.watch threw exception
@@ -7126,12 +7127,15 @@ var ts;
7126
7127
  * and switch to existing file or directory when the missing filesystem entry is created
7127
7128
  */
7128
7129
  function watchMissingFileSystemEntry() {
7129
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
7130
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
7131
- // Call the callback for current file or directory
7132
- // For now it could be callback for the inner directory creation,
7133
- // but just return current directory, better than current no-op
7134
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
7130
+ return watchFile(fileOrDirectory, function (_fileName, eventKind, modifiedTime) {
7131
+ if (eventKind === FileWatcherEventKind.Created) {
7132
+ modifiedTime || (modifiedTime = getModifiedTime(fileOrDirectory) || ts.missingFileModifiedTime);
7133
+ if (modifiedTime !== ts.missingFileModifiedTime) {
7134
+ // Call the callback for current file or directory
7135
+ // For now it could be callback for the inner directory creation,
7136
+ // but just return current directory, better than current no-op
7137
+ invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry, modifiedTime);
7138
+ }
7135
7139
  }
7136
7140
  }, fallbackPollingInterval, fallbackOptions);
7137
7141
  }
@@ -7281,12 +7285,19 @@ var ts;
7281
7285
  }
7282
7286
  function getModifiedTime(path) {
7283
7287
  var _a;
7288
+ // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7289
+ // the CPU time performance.
7290
+ var originalStackTraceLimit = Error.stackTraceLimit;
7291
+ Error.stackTraceLimit = 0;
7284
7292
  try {
7285
7293
  return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
7286
7294
  }
7287
7295
  catch (e) {
7288
7296
  return undefined;
7289
7297
  }
7298
+ finally {
7299
+ Error.stackTraceLimit = originalStackTraceLimit;
7300
+ }
7290
7301
  }
7291
7302
  function setModifiedTime(path, time) {
7292
7303
  try {
@@ -9300,8 +9311,8 @@ var ts;
9300
9311
  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"),
9301
9312
  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"),
9302
9313
  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."),
9303
- 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}'"),
9304
- 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}'"),
9314
+ 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}'"),
9315
+ 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}'"),
9305
9316
  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"),
9306
9317
  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"),
9307
9318
  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"),
@@ -9345,6 +9356,7 @@ var ts;
9345
9356
  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}'."),
9346
9357
  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}'."),
9347
9358
  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."),
9359
+ 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"),
9348
9360
  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}'"),
9349
9361
  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."),
9350
9362
  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."),
@@ -20149,6 +20161,10 @@ var ts;
20149
20161
  return optionsHaveChanges(oldOptions, newOptions, ts.affectsEmitOptionDeclarations);
20150
20162
  }
20151
20163
  ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;
20164
+ function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) {
20165
+ return optionsHaveChanges(oldOptions, newOptions, ts.affectsDeclarationPathOptionDeclarations);
20166
+ }
20167
+ ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
20152
20168
  function getCompilerOptionValue(options, option) {
20153
20169
  return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
20154
20170
  }
@@ -39187,6 +39203,7 @@ var ts;
39187
39203
  type: "boolean",
39188
39204
  affectsSemanticDiagnostics: true,
39189
39205
  affectsEmit: true,
39206
+ affectsMultiFileEmitBuildInfo: true,
39190
39207
  category: ts.Diagnostics.Watch_and_Build_Modes,
39191
39208
  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,
39192
39209
  defaultValueDescription: false,
@@ -39221,12 +39238,40 @@ var ts;
39221
39238
  affectsSourceFile: true,
39222
39239
  affectsModuleResolution: true,
39223
39240
  affectsEmit: true,
39241
+ affectsMultiFileEmitBuildInfo: true,
39224
39242
  paramType: ts.Diagnostics.VERSION,
39225
39243
  showInSimplifiedHelpView: true,
39226
39244
  category: ts.Diagnostics.Language_and_Environment,
39227
39245
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
39228
39246
  defaultValueDescription: 0 /* ES3 */,
39229
39247
  };
39248
+ /*@internal*/
39249
+ ts.moduleOptionDeclaration = {
39250
+ name: "module",
39251
+ shortName: "m",
39252
+ type: new ts.Map(ts.getEntries({
39253
+ none: ts.ModuleKind.None,
39254
+ commonjs: ts.ModuleKind.CommonJS,
39255
+ amd: ts.ModuleKind.AMD,
39256
+ system: ts.ModuleKind.System,
39257
+ umd: ts.ModuleKind.UMD,
39258
+ es6: ts.ModuleKind.ES2015,
39259
+ es2015: ts.ModuleKind.ES2015,
39260
+ es2020: ts.ModuleKind.ES2020,
39261
+ es2022: ts.ModuleKind.ES2022,
39262
+ esnext: ts.ModuleKind.ESNext,
39263
+ node12: ts.ModuleKind.Node12,
39264
+ nodenext: ts.ModuleKind.NodeNext,
39265
+ })),
39266
+ affectsModuleResolution: true,
39267
+ affectsEmit: true,
39268
+ affectsMultiFileEmitBuildInfo: true,
39269
+ paramType: ts.Diagnostics.KIND,
39270
+ showInSimplifiedHelpView: true,
39271
+ category: ts.Diagnostics.Modules,
39272
+ description: ts.Diagnostics.Specify_what_module_code_is_generated,
39273
+ defaultValueDescription: undefined,
39274
+ };
39230
39275
  var commandOptionsWithoutBuild = [
39231
39276
  // CommandLine only options
39232
39277
  {
@@ -39288,37 +39333,14 @@ var ts;
39288
39333
  category: ts.Diagnostics.Command_line_Options,
39289
39334
  affectsSemanticDiagnostics: true,
39290
39335
  affectsEmit: true,
39336
+ affectsMultiFileEmitBuildInfo: true,
39291
39337
  isCommandLineOnly: true,
39292
39338
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
39293
39339
  defaultValueDescription: false,
39294
39340
  },
39295
39341
  // Basic
39296
39342
  ts.targetOptionDeclaration,
39297
- {
39298
- name: "module",
39299
- shortName: "m",
39300
- type: new ts.Map(ts.getEntries({
39301
- none: ts.ModuleKind.None,
39302
- commonjs: ts.ModuleKind.CommonJS,
39303
- amd: ts.ModuleKind.AMD,
39304
- system: ts.ModuleKind.System,
39305
- umd: ts.ModuleKind.UMD,
39306
- es6: ts.ModuleKind.ES2015,
39307
- es2015: ts.ModuleKind.ES2015,
39308
- es2020: ts.ModuleKind.ES2020,
39309
- es2022: ts.ModuleKind.ES2022,
39310
- esnext: ts.ModuleKind.ESNext,
39311
- node12: ts.ModuleKind.Node12,
39312
- nodenext: ts.ModuleKind.NodeNext,
39313
- })),
39314
- affectsModuleResolution: true,
39315
- affectsEmit: true,
39316
- paramType: ts.Diagnostics.KIND,
39317
- showInSimplifiedHelpView: true,
39318
- category: ts.Diagnostics.Modules,
39319
- description: ts.Diagnostics.Specify_what_module_code_is_generated,
39320
- defaultValueDescription: undefined,
39321
- },
39343
+ ts.moduleOptionDeclaration,
39322
39344
  {
39323
39345
  name: "lib",
39324
39346
  type: "list",
@@ -39355,6 +39377,7 @@ var ts;
39355
39377
  type: jsxOptionMap,
39356
39378
  affectsSourceFile: true,
39357
39379
  affectsEmit: true,
39380
+ affectsMultiFileEmitBuildInfo: true,
39358
39381
  affectsModuleResolution: true,
39359
39382
  paramType: ts.Diagnostics.KIND,
39360
39383
  showInSimplifiedHelpView: true,
@@ -39367,6 +39390,7 @@ var ts;
39367
39390
  shortName: "d",
39368
39391
  type: "boolean",
39369
39392
  affectsEmit: true,
39393
+ affectsMultiFileEmitBuildInfo: true,
39370
39394
  showInSimplifiedHelpView: true,
39371
39395
  category: ts.Diagnostics.Emit,
39372
39396
  transpileOptionValue: undefined,
@@ -39377,6 +39401,7 @@ var ts;
39377
39401
  name: "declarationMap",
39378
39402
  type: "boolean",
39379
39403
  affectsEmit: true,
39404
+ affectsMultiFileEmitBuildInfo: true,
39380
39405
  showInSimplifiedHelpView: true,
39381
39406
  category: ts.Diagnostics.Emit,
39382
39407
  transpileOptionValue: undefined,
@@ -39387,6 +39412,7 @@ var ts;
39387
39412
  name: "emitDeclarationOnly",
39388
39413
  type: "boolean",
39389
39414
  affectsEmit: true,
39415
+ affectsMultiFileEmitBuildInfo: true,
39390
39416
  showInSimplifiedHelpView: true,
39391
39417
  category: ts.Diagnostics.Emit,
39392
39418
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
@@ -39397,6 +39423,7 @@ var ts;
39397
39423
  name: "sourceMap",
39398
39424
  type: "boolean",
39399
39425
  affectsEmit: true,
39426
+ affectsMultiFileEmitBuildInfo: true,
39400
39427
  showInSimplifiedHelpView: true,
39401
39428
  category: ts.Diagnostics.Emit,
39402
39429
  defaultValueDescription: false,
@@ -39406,6 +39433,9 @@ var ts;
39406
39433
  name: "outFile",
39407
39434
  type: "string",
39408
39435
  affectsEmit: true,
39436
+ affectsMultiFileEmitBuildInfo: true,
39437
+ affectsDeclarationPath: true,
39438
+ affectsBundleEmitBuildInfo: true,
39409
39439
  isFilePath: true,
39410
39440
  paramType: ts.Diagnostics.FILE,
39411
39441
  showInSimplifiedHelpView: true,
@@ -39417,6 +39447,8 @@ var ts;
39417
39447
  name: "outDir",
39418
39448
  type: "string",
39419
39449
  affectsEmit: true,
39450
+ affectsMultiFileEmitBuildInfo: true,
39451
+ affectsDeclarationPath: true,
39420
39452
  isFilePath: true,
39421
39453
  paramType: ts.Diagnostics.DIRECTORY,
39422
39454
  showInSimplifiedHelpView: true,
@@ -39427,6 +39459,8 @@ var ts;
39427
39459
  name: "rootDir",
39428
39460
  type: "string",
39429
39461
  affectsEmit: true,
39462
+ affectsMultiFileEmitBuildInfo: true,
39463
+ affectsDeclarationPath: true,
39430
39464
  isFilePath: true,
39431
39465
  paramType: ts.Diagnostics.LOCATION,
39432
39466
  category: ts.Diagnostics.Modules,
@@ -39437,6 +39471,8 @@ var ts;
39437
39471
  name: "composite",
39438
39472
  type: "boolean",
39439
39473
  affectsEmit: true,
39474
+ affectsMultiFileEmitBuildInfo: true,
39475
+ affectsBundleEmitBuildInfo: true,
39440
39476
  isTSConfigOnly: true,
39441
39477
  category: ts.Diagnostics.Projects,
39442
39478
  transpileOptionValue: undefined,
@@ -39447,6 +39483,8 @@ var ts;
39447
39483
  name: "tsBuildInfoFile",
39448
39484
  type: "string",
39449
39485
  affectsEmit: true,
39486
+ affectsMultiFileEmitBuildInfo: true,
39487
+ affectsBundleEmitBuildInfo: true,
39450
39488
  isFilePath: true,
39451
39489
  paramType: ts.Diagnostics.FILE,
39452
39490
  category: ts.Diagnostics.Projects,
@@ -39458,6 +39496,7 @@ var ts;
39458
39496
  name: "removeComments",
39459
39497
  type: "boolean",
39460
39498
  affectsEmit: true,
39499
+ affectsMultiFileEmitBuildInfo: true,
39461
39500
  showInSimplifiedHelpView: true,
39462
39501
  category: ts.Diagnostics.Emit,
39463
39502
  defaultValueDescription: false,
@@ -39476,6 +39515,7 @@ var ts;
39476
39515
  name: "importHelpers",
39477
39516
  type: "boolean",
39478
39517
  affectsEmit: true,
39518
+ affectsMultiFileEmitBuildInfo: true,
39479
39519
  category: ts.Diagnostics.Emit,
39480
39520
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
39481
39521
  defaultValueDescription: false,
@@ -39489,6 +39529,7 @@ var ts;
39489
39529
  })),
39490
39530
  affectsEmit: true,
39491
39531
  affectsSemanticDiagnostics: true,
39532
+ affectsMultiFileEmitBuildInfo: true,
39492
39533
  category: ts.Diagnostics.Emit,
39493
39534
  description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
39494
39535
  defaultValueDescription: 0 /* Remove */,
@@ -39497,6 +39538,7 @@ var ts;
39497
39538
  name: "downlevelIteration",
39498
39539
  type: "boolean",
39499
39540
  affectsEmit: true,
39541
+ affectsMultiFileEmitBuildInfo: true,
39500
39542
  category: ts.Diagnostics.Emit,
39501
39543
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
39502
39544
  defaultValueDescription: false,
@@ -39515,6 +39557,9 @@ var ts;
39515
39557
  type: "boolean",
39516
39558
  // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
39517
39559
  // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
39560
+ // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
39561
+ // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
39562
+ affectsMultiFileEmitBuildInfo: true,
39518
39563
  showInSimplifiedHelpView: true,
39519
39564
  category: ts.Diagnostics.Type_Checking,
39520
39565
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
@@ -39524,6 +39569,7 @@ var ts;
39524
39569
  name: "noImplicitAny",
39525
39570
  type: "boolean",
39526
39571
  affectsSemanticDiagnostics: true,
39572
+ affectsMultiFileEmitBuildInfo: true,
39527
39573
  strictFlag: true,
39528
39574
  category: ts.Diagnostics.Type_Checking,
39529
39575
  description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
@@ -39533,6 +39579,7 @@ var ts;
39533
39579
  name: "strictNullChecks",
39534
39580
  type: "boolean",
39535
39581
  affectsSemanticDiagnostics: true,
39582
+ affectsMultiFileEmitBuildInfo: true,
39536
39583
  strictFlag: true,
39537
39584
  category: ts.Diagnostics.Type_Checking,
39538
39585
  description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
@@ -39541,6 +39588,8 @@ var ts;
39541
39588
  {
39542
39589
  name: "strictFunctionTypes",
39543
39590
  type: "boolean",
39591
+ affectsSemanticDiagnostics: true,
39592
+ affectsMultiFileEmitBuildInfo: true,
39544
39593
  strictFlag: true,
39545
39594
  category: ts.Diagnostics.Type_Checking,
39546
39595
  description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
@@ -39549,6 +39598,8 @@ var ts;
39549
39598
  {
39550
39599
  name: "strictBindCallApply",
39551
39600
  type: "boolean",
39601
+ affectsSemanticDiagnostics: true,
39602
+ affectsMultiFileEmitBuildInfo: true,
39552
39603
  strictFlag: true,
39553
39604
  category: ts.Diagnostics.Type_Checking,
39554
39605
  description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
@@ -39558,6 +39609,7 @@ var ts;
39558
39609
  name: "strictPropertyInitialization",
39559
39610
  type: "boolean",
39560
39611
  affectsSemanticDiagnostics: true,
39612
+ affectsMultiFileEmitBuildInfo: true,
39561
39613
  strictFlag: true,
39562
39614
  category: ts.Diagnostics.Type_Checking,
39563
39615
  description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
@@ -39567,6 +39619,7 @@ var ts;
39567
39619
  name: "noImplicitThis",
39568
39620
  type: "boolean",
39569
39621
  affectsSemanticDiagnostics: true,
39622
+ affectsMultiFileEmitBuildInfo: true,
39570
39623
  strictFlag: true,
39571
39624
  category: ts.Diagnostics.Type_Checking,
39572
39625
  description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
@@ -39576,6 +39629,7 @@ var ts;
39576
39629
  name: "useUnknownInCatchVariables",
39577
39630
  type: "boolean",
39578
39631
  affectsSemanticDiagnostics: true,
39632
+ affectsMultiFileEmitBuildInfo: true,
39579
39633
  strictFlag: true,
39580
39634
  category: ts.Diagnostics.Type_Checking,
39581
39635
  description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
@@ -39585,6 +39639,8 @@ var ts;
39585
39639
  name: "alwaysStrict",
39586
39640
  type: "boolean",
39587
39641
  affectsSourceFile: true,
39642
+ affectsEmit: true,
39643
+ affectsMultiFileEmitBuildInfo: true,
39588
39644
  strictFlag: true,
39589
39645
  category: ts.Diagnostics.Type_Checking,
39590
39646
  description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
@@ -39595,6 +39651,7 @@ var ts;
39595
39651
  name: "noUnusedLocals",
39596
39652
  type: "boolean",
39597
39653
  affectsSemanticDiagnostics: true,
39654
+ affectsMultiFileEmitBuildInfo: true,
39598
39655
  category: ts.Diagnostics.Type_Checking,
39599
39656
  description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
39600
39657
  defaultValueDescription: false,
@@ -39603,6 +39660,7 @@ var ts;
39603
39660
  name: "noUnusedParameters",
39604
39661
  type: "boolean",
39605
39662
  affectsSemanticDiagnostics: true,
39663
+ affectsMultiFileEmitBuildInfo: true,
39606
39664
  category: ts.Diagnostics.Type_Checking,
39607
39665
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
39608
39666
  defaultValueDescription: false,
@@ -39611,6 +39669,7 @@ var ts;
39611
39669
  name: "exactOptionalPropertyTypes",
39612
39670
  type: "boolean",
39613
39671
  affectsSemanticDiagnostics: true,
39672
+ affectsMultiFileEmitBuildInfo: true,
39614
39673
  category: ts.Diagnostics.Type_Checking,
39615
39674
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
39616
39675
  defaultValueDescription: false,
@@ -39619,6 +39678,7 @@ var ts;
39619
39678
  name: "noImplicitReturns",
39620
39679
  type: "boolean",
39621
39680
  affectsSemanticDiagnostics: true,
39681
+ affectsMultiFileEmitBuildInfo: true,
39622
39682
  category: ts.Diagnostics.Type_Checking,
39623
39683
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
39624
39684
  defaultValueDescription: false,
@@ -39628,6 +39688,7 @@ var ts;
39628
39688
  type: "boolean",
39629
39689
  affectsBindDiagnostics: true,
39630
39690
  affectsSemanticDiagnostics: true,
39691
+ affectsMultiFileEmitBuildInfo: true,
39631
39692
  category: ts.Diagnostics.Type_Checking,
39632
39693
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
39633
39694
  defaultValueDescription: false,
@@ -39636,6 +39697,7 @@ var ts;
39636
39697
  name: "noUncheckedIndexedAccess",
39637
39698
  type: "boolean",
39638
39699
  affectsSemanticDiagnostics: true,
39700
+ affectsMultiFileEmitBuildInfo: true,
39639
39701
  category: ts.Diagnostics.Type_Checking,
39640
39702
  description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
39641
39703
  defaultValueDescription: false,
@@ -39644,6 +39706,7 @@ var ts;
39644
39706
  name: "noImplicitOverride",
39645
39707
  type: "boolean",
39646
39708
  affectsSemanticDiagnostics: true,
39709
+ affectsMultiFileEmitBuildInfo: true,
39647
39710
  category: ts.Diagnostics.Type_Checking,
39648
39711
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
39649
39712
  defaultValueDescription: false,
@@ -39651,6 +39714,8 @@ var ts;
39651
39714
  {
39652
39715
  name: "noPropertyAccessFromIndexSignature",
39653
39716
  type: "boolean",
39717
+ affectsSemanticDiagnostics: true,
39718
+ affectsMultiFileEmitBuildInfo: true,
39654
39719
  showInSimplifiedHelpView: false,
39655
39720
  category: ts.Diagnostics.Type_Checking,
39656
39721
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
@@ -39736,6 +39801,7 @@ var ts;
39736
39801
  name: "allowSyntheticDefaultImports",
39737
39802
  type: "boolean",
39738
39803
  affectsSemanticDiagnostics: true,
39804
+ affectsMultiFileEmitBuildInfo: true,
39739
39805
  category: ts.Diagnostics.Interop_Constraints,
39740
39806
  description: ts.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
39741
39807
  defaultValueDescription: ts.Diagnostics.module_system_or_esModuleInterop
@@ -39745,6 +39811,7 @@ var ts;
39745
39811
  type: "boolean",
39746
39812
  affectsSemanticDiagnostics: true,
39747
39813
  affectsEmit: true,
39814
+ affectsMultiFileEmitBuildInfo: true,
39748
39815
  showInSimplifiedHelpView: true,
39749
39816
  category: ts.Diagnostics.Interop_Constraints,
39750
39817
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
@@ -39761,6 +39828,7 @@ var ts;
39761
39828
  name: "allowUmdGlobalAccess",
39762
39829
  type: "boolean",
39763
39830
  affectsSemanticDiagnostics: true,
39831
+ affectsMultiFileEmitBuildInfo: true,
39764
39832
  category: ts.Diagnostics.Modules,
39765
39833
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
39766
39834
  defaultValueDescription: false,
@@ -39782,6 +39850,7 @@ var ts;
39782
39850
  name: "sourceRoot",
39783
39851
  type: "string",
39784
39852
  affectsEmit: true,
39853
+ affectsMultiFileEmitBuildInfo: true,
39785
39854
  paramType: ts.Diagnostics.LOCATION,
39786
39855
  category: ts.Diagnostics.Emit,
39787
39856
  description: ts.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code,
@@ -39790,6 +39859,7 @@ var ts;
39790
39859
  name: "mapRoot",
39791
39860
  type: "string",
39792
39861
  affectsEmit: true,
39862
+ affectsMultiFileEmitBuildInfo: true,
39793
39863
  paramType: ts.Diagnostics.LOCATION,
39794
39864
  category: ts.Diagnostics.Emit,
39795
39865
  description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
@@ -39798,6 +39868,7 @@ var ts;
39798
39868
  name: "inlineSourceMap",
39799
39869
  type: "boolean",
39800
39870
  affectsEmit: true,
39871
+ affectsMultiFileEmitBuildInfo: true,
39801
39872
  category: ts.Diagnostics.Emit,
39802
39873
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
39803
39874
  defaultValueDescription: false,
@@ -39806,6 +39877,7 @@ var ts;
39806
39877
  name: "inlineSources",
39807
39878
  type: "boolean",
39808
39879
  affectsEmit: true,
39880
+ affectsMultiFileEmitBuildInfo: true,
39809
39881
  category: ts.Diagnostics.Emit,
39810
39882
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
39811
39883
  defaultValueDescription: false,
@@ -39815,6 +39887,7 @@ var ts;
39815
39887
  name: "experimentalDecorators",
39816
39888
  type: "boolean",
39817
39889
  affectsSemanticDiagnostics: true,
39890
+ affectsMultiFileEmitBuildInfo: true,
39818
39891
  category: ts.Diagnostics.Language_and_Environment,
39819
39892
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
39820
39893
  defaultValueDescription: false,
@@ -39824,6 +39897,7 @@ var ts;
39824
39897
  type: "boolean",
39825
39898
  affectsSemanticDiagnostics: true,
39826
39899
  affectsEmit: true,
39900
+ affectsMultiFileEmitBuildInfo: true,
39827
39901
  category: ts.Diagnostics.Language_and_Environment,
39828
39902
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
39829
39903
  defaultValueDescription: false,
@@ -39848,6 +39922,7 @@ var ts;
39848
39922
  type: "string",
39849
39923
  affectsSemanticDiagnostics: true,
39850
39924
  affectsEmit: true,
39925
+ affectsMultiFileEmitBuildInfo: true,
39851
39926
  affectsModuleResolution: true,
39852
39927
  category: ts.Diagnostics.Language_and_Environment,
39853
39928
  description: ts.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
@@ -39865,6 +39940,9 @@ var ts;
39865
39940
  name: "out",
39866
39941
  type: "string",
39867
39942
  affectsEmit: true,
39943
+ affectsMultiFileEmitBuildInfo: true,
39944
+ affectsDeclarationPath: true,
39945
+ affectsBundleEmitBuildInfo: true,
39868
39946
  isFilePath: false,
39869
39947
  // for correct behaviour, please use outFile
39870
39948
  category: ts.Diagnostics.Backwards_Compatibility,
@@ -39876,6 +39954,7 @@ var ts;
39876
39954
  name: "reactNamespace",
39877
39955
  type: "string",
39878
39956
  affectsEmit: true,
39957
+ affectsMultiFileEmitBuildInfo: true,
39879
39958
  category: ts.Diagnostics.Language_and_Environment,
39880
39959
  description: ts.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
39881
39960
  defaultValueDescription: "`React`",
@@ -39883,6 +39962,8 @@ var ts;
39883
39962
  {
39884
39963
  name: "skipDefaultLibCheck",
39885
39964
  type: "boolean",
39965
+ // We need to store these to determine whether `lib` files need to be rechecked
39966
+ affectsMultiFileEmitBuildInfo: true,
39886
39967
  category: ts.Diagnostics.Completeness,
39887
39968
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
39888
39969
  defaultValueDescription: false,
@@ -39898,6 +39979,7 @@ var ts;
39898
39979
  name: "emitBOM",
39899
39980
  type: "boolean",
39900
39981
  affectsEmit: true,
39982
+ affectsMultiFileEmitBuildInfo: true,
39901
39983
  category: ts.Diagnostics.Emit,
39902
39984
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
39903
39985
  defaultValueDescription: false,
@@ -39909,6 +39991,7 @@ var ts;
39909
39991
  lf: 1 /* LineFeed */
39910
39992
  })),
39911
39993
  affectsEmit: true,
39994
+ affectsMultiFileEmitBuildInfo: true,
39912
39995
  paramType: ts.Diagnostics.NEWLINE,
39913
39996
  category: ts.Diagnostics.Emit,
39914
39997
  description: ts.Diagnostics.Set_the_newline_character_for_emitting_files,
@@ -39918,6 +40001,7 @@ var ts;
39918
40001
  name: "noErrorTruncation",
39919
40002
  type: "boolean",
39920
40003
  affectsSemanticDiagnostics: true,
40004
+ affectsMultiFileEmitBuildInfo: true,
39921
40005
  category: ts.Diagnostics.Output_Formatting,
39922
40006
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
39923
40007
  defaultValueDescription: false,
@@ -39948,6 +40032,7 @@ var ts;
39948
40032
  name: "stripInternal",
39949
40033
  type: "boolean",
39950
40034
  affectsEmit: true,
40035
+ affectsMultiFileEmitBuildInfo: true,
39951
40036
  category: ts.Diagnostics.Emit,
39952
40037
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39953
40038
  defaultValueDescription: false,
@@ -39988,6 +40073,7 @@ var ts;
39988
40073
  name: "noImplicitUseStrict",
39989
40074
  type: "boolean",
39990
40075
  affectsSemanticDiagnostics: true,
40076
+ affectsMultiFileEmitBuildInfo: true,
39991
40077
  category: ts.Diagnostics.Backwards_Compatibility,
39992
40078
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
39993
40079
  defaultValueDescription: false,
@@ -39996,6 +40082,7 @@ var ts;
39996
40082
  name: "noEmitHelpers",
39997
40083
  type: "boolean",
39998
40084
  affectsEmit: true,
40085
+ affectsMultiFileEmitBuildInfo: true,
39999
40086
  category: ts.Diagnostics.Emit,
40000
40087
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
40001
40088
  defaultValueDescription: false,
@@ -40004,6 +40091,7 @@ var ts;
40004
40091
  name: "noEmitOnError",
40005
40092
  type: "boolean",
40006
40093
  affectsEmit: true,
40094
+ affectsMultiFileEmitBuildInfo: true,
40007
40095
  category: ts.Diagnostics.Emit,
40008
40096
  transpileOptionValue: undefined,
40009
40097
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
@@ -40013,6 +40101,7 @@ var ts;
40013
40101
  name: "preserveConstEnums",
40014
40102
  type: "boolean",
40015
40103
  affectsEmit: true,
40104
+ affectsMultiFileEmitBuildInfo: true,
40016
40105
  category: ts.Diagnostics.Emit,
40017
40106
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
40018
40107
  defaultValueDescription: false,
@@ -40021,6 +40110,8 @@ var ts;
40021
40110
  name: "declarationDir",
40022
40111
  type: "string",
40023
40112
  affectsEmit: true,
40113
+ affectsMultiFileEmitBuildInfo: true,
40114
+ affectsDeclarationPath: true,
40024
40115
  isFilePath: true,
40025
40116
  paramType: ts.Diagnostics.DIRECTORY,
40026
40117
  category: ts.Diagnostics.Emit,
@@ -40030,6 +40121,8 @@ var ts;
40030
40121
  {
40031
40122
  name: "skipLibCheck",
40032
40123
  type: "boolean",
40124
+ // We need to store these to determine whether `lib` files need to be rechecked
40125
+ affectsMultiFileEmitBuildInfo: true,
40033
40126
  category: ts.Diagnostics.Completeness,
40034
40127
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
40035
40128
  defaultValueDescription: false,
@@ -40039,6 +40132,7 @@ var ts;
40039
40132
  type: "boolean",
40040
40133
  affectsBindDiagnostics: true,
40041
40134
  affectsSemanticDiagnostics: true,
40135
+ affectsMultiFileEmitBuildInfo: true,
40042
40136
  category: ts.Diagnostics.Type_Checking,
40043
40137
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
40044
40138
  defaultValueDescription: undefined,
@@ -40048,6 +40142,7 @@ var ts;
40048
40142
  type: "boolean",
40049
40143
  affectsBindDiagnostics: true,
40050
40144
  affectsSemanticDiagnostics: true,
40145
+ affectsMultiFileEmitBuildInfo: true,
40051
40146
  category: ts.Diagnostics.Type_Checking,
40052
40147
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
40053
40148
  defaultValueDescription: undefined,
@@ -40056,6 +40151,7 @@ var ts;
40056
40151
  name: "suppressExcessPropertyErrors",
40057
40152
  type: "boolean",
40058
40153
  affectsSemanticDiagnostics: true,
40154
+ affectsMultiFileEmitBuildInfo: true,
40059
40155
  category: ts.Diagnostics.Backwards_Compatibility,
40060
40156
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
40061
40157
  defaultValueDescription: false,
@@ -40064,6 +40160,7 @@ var ts;
40064
40160
  name: "suppressImplicitAnyIndexErrors",
40065
40161
  type: "boolean",
40066
40162
  affectsSemanticDiagnostics: true,
40163
+ affectsMultiFileEmitBuildInfo: true,
40067
40164
  category: ts.Diagnostics.Backwards_Compatibility,
40068
40165
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
40069
40166
  defaultValueDescription: false,
@@ -40088,6 +40185,7 @@ var ts;
40088
40185
  name: "noStrictGenericChecks",
40089
40186
  type: "boolean",
40090
40187
  affectsSemanticDiagnostics: true,
40188
+ affectsMultiFileEmitBuildInfo: true,
40091
40189
  category: ts.Diagnostics.Backwards_Compatibility,
40092
40190
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
40093
40191
  defaultValueDescription: false,
@@ -40097,6 +40195,7 @@ var ts;
40097
40195
  type: "boolean",
40098
40196
  affectsSemanticDiagnostics: true,
40099
40197
  affectsEmit: true,
40198
+ affectsMultiFileEmitBuildInfo: true,
40100
40199
  category: ts.Diagnostics.Language_and_Environment,
40101
40200
  description: ts.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,
40102
40201
  defaultValueDescription: ts.Diagnostics.true_for_ES2022_and_above_including_ESNext
@@ -40105,6 +40204,7 @@ var ts;
40105
40204
  name: "preserveValueImports",
40106
40205
  type: "boolean",
40107
40206
  affectsEmit: true,
40207
+ affectsMultiFileEmitBuildInfo: true,
40108
40208
  category: ts.Diagnostics.Emit,
40109
40209
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
40110
40210
  defaultValueDescription: false,
@@ -40148,6 +40248,8 @@ var ts;
40148
40248
  /* @internal */
40149
40249
  ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
40150
40250
  /* @internal */
40251
+ ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
40252
+ /* @internal */
40151
40253
  ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
40152
40254
  /* @internal */
40153
40255
  ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
@@ -41003,6 +41105,7 @@ var ts;
41003
41105
  return optionDefinition.type;
41004
41106
  }
41005
41107
  }
41108
+ /* @internal */
41006
41109
  function getNameOfCompilerOptionValue(value, customTypeMap) {
41007
41110
  // There is a typeMap associated with this command-line option so use it to map value back to its name
41008
41111
  return ts.forEachEntry(customTypeMap, function (mapValue, key) {
@@ -41011,6 +41114,7 @@ var ts;
41011
41114
  }
41012
41115
  });
41013
41116
  }
41117
+ ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
41014
41118
  function serializeCompilerOptions(options, pathOptions) {
41015
41119
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
41016
41120
  }
@@ -65323,20 +65427,6 @@ var ts;
65323
65427
  }
65324
65428
  }
65325
65429
  }
65326
- if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
65327
- // This is a carve-out in comparability to essentially forbid comparing a type parameter
65328
- // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
65329
- var constraint = getConstraintOfTypeParameter(source);
65330
- if (constraint && hasNonCircularBaseConstraint(source)) {
65331
- while (constraint && constraint.flags & 262144 /* TypeParameter */) {
65332
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false)) {
65333
- return result;
65334
- }
65335
- constraint = getConstraintOfTypeParameter(constraint);
65336
- }
65337
- }
65338
- return 0 /* False */;
65339
- }
65340
65430
  }
65341
65431
  else if (targetFlags & 4194304 /* Index */) {
65342
65432
  var targetType_1 = target.type;
@@ -65540,8 +65630,8 @@ var ts;
65540
65630
  if (sourceFlags & 8650752 /* TypeVariable */) {
65541
65631
  // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
65542
65632
  if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
65543
- var constraint = getConstraintOfType(source) || unknownType;
65544
- if (!strictNullChecks && (!getConstraintOfType(source) || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */))) {
65633
+ var constraint = getConstraintOfType(source);
65634
+ if (!strictNullChecks && (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */))) {
65545
65635
  // A type variable with no constraint is not related to the non-primitive object type.
65546
65636
  if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
65547
65637
  resetErrorInfo(saveErrorInfo);
@@ -65549,12 +65639,12 @@ var ts;
65549
65639
  }
65550
65640
  }
65551
65641
  // 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
65552
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
65642
+ else if (constraint && (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState))) {
65553
65643
  resetErrorInfo(saveErrorInfo);
65554
65644
  return result;
65555
65645
  }
65556
65646
  // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
65557
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
65647
+ else if (constraint && (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState))) {
65558
65648
  resetErrorInfo(saveErrorInfo);
65559
65649
  return result;
65560
65650
  }
@@ -109873,7 +109963,8 @@ var ts;
109873
109963
  return;
109874
109964
  }
109875
109965
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
109876
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);
109966
+ var buildInfo = { bundle: bundle, program: program, version: version };
109967
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
109877
109968
  }
109878
109969
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
109879
109970
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -110027,13 +110118,18 @@ var ts;
110027
110118
  if (sourceMapFilePath) {
110028
110119
  var sourceMap = sourceMapGenerator.toString();
110029
110120
  ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
110121
+ if (printer.bundleFileInfo)
110122
+ printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
110030
110123
  }
110031
110124
  }
110032
110125
  else {
110033
110126
  writer.writeLine();
110034
110127
  }
110035
110128
  // Write the output file
110036
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110129
+ var text = writer.getText();
110130
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
110131
+ if (printer.bundleFileInfo)
110132
+ printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
110037
110133
  // Reset state
110038
110134
  writer.clear();
110039
110135
  }
@@ -110176,34 +110272,54 @@ var ts;
110176
110272
  }
110177
110273
  /*@internal*/
110178
110274
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
110275
+ var createHash = ts.maybeBind(host, host.createHash);
110179
110276
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
110180
- var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));
110181
- if (!buildInfoText)
110277
+ var buildInfo;
110278
+ if (host.getBuildInfo) {
110279
+ var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
110280
+ if (!hostBuildInfo)
110281
+ return buildInfoPath;
110282
+ buildInfo = hostBuildInfo;
110283
+ }
110284
+ else {
110285
+ var buildInfoText = host.readFile(buildInfoPath);
110286
+ if (!buildInfoText)
110287
+ return buildInfoPath;
110288
+ buildInfo = getBuildInfo(buildInfoText);
110289
+ }
110290
+ if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
110182
110291
  return buildInfoPath;
110183
110292
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
110184
110293
  if (!jsFileText)
110185
110294
  return jsFilePath;
110295
+ if (ts.BuilderState.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
110296
+ return jsFilePath;
110186
110297
  var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
110187
110298
  // error if no source map or for now if inline sourcemap
110188
110299
  if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
110189
110300
  return sourceMapFilePath || "inline sourcemap decoding";
110301
+ if (sourceMapFilePath && ts.BuilderState.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
110302
+ return sourceMapFilePath;
110190
110303
  // read declaration text
110191
110304
  var declarationText = declarationFilePath && host.readFile(declarationFilePath);
110192
110305
  if (declarationFilePath && !declarationText)
110193
110306
  return declarationFilePath;
110307
+ if (declarationFilePath && ts.BuilderState.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
110308
+ return declarationFilePath;
110194
110309
  var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
110195
110310
  // error if no source map or for now if inline sourcemap
110196
110311
  if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
110197
110312
  return declarationMapPath || "inline sourcemap decoding";
110198
- var buildInfo = getBuildInfo(buildInfoText);
110199
- if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))
110200
- return buildInfoPath;
110313
+ if (declarationMapPath && ts.BuilderState.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
110314
+ return declarationMapPath;
110201
110315
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
110202
110316
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
110203
110317
  /*onlyOwnText*/ true);
110204
110318
  var outputFiles = [];
110205
110319
  var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
110206
110320
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
110321
+ var changedDtsText;
110322
+ var changedDtsData;
110207
110323
  var emitHost = {
110208
110324
  getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes, true), [ownPrependInput], false); }),
110209
110325
  getCanonicalFileName: host.getCanonicalFileName,
@@ -110219,7 +110335,7 @@ var ts;
110219
110335
  getResolvedProjectReferenceToRedirect: ts.returnUndefined,
110220
110336
  getProjectReferenceRedirect: ts.returnUndefined,
110221
110337
  isSourceOfProjectReferenceRedirect: ts.returnFalse,
110222
- writeFile: function (name, text, writeByteOrderMark) {
110338
+ writeFile: function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) {
110223
110339
  switch (name) {
110224
110340
  case jsFilePath:
110225
110341
  if (jsFileText === text)
@@ -110230,8 +110346,13 @@ var ts;
110230
110346
  return;
110231
110347
  break;
110232
110348
  case buildInfoPath:
110233
- var newBuildInfo = getBuildInfo(text);
110349
+ var newBuildInfo = data.buildInfo;
110234
110350
  newBuildInfo.program = buildInfo.program;
110351
+ if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
110352
+ // Update the output signature
110353
+ newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, changedDtsData, createHash);
110354
+ newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
110355
+ }
110235
110356
  // Update sourceFileInfo
110236
110357
  var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
110237
110358
  newBuildInfo.bundle.js.sources = js.sources;
@@ -110239,11 +110360,13 @@ var ts;
110239
110360
  newBuildInfo.bundle.dts.sources = dts.sources;
110240
110361
  }
110241
110362
  newBuildInfo.bundle.sourceFiles = sourceFiles;
110242
- outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });
110363
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
110243
110364
  return;
110244
110365
  case declarationFilePath:
110245
110366
  if (declarationText === text)
110246
110367
  return;
110368
+ changedDtsText = text;
110369
+ changedDtsData = data;
110247
110370
  break;
110248
110371
  case declarationMapPath:
110249
110372
  if (declarationMapText === text)
@@ -110262,6 +110385,7 @@ var ts;
110262
110385
  getSourceFileFromReference: ts.returnUndefined,
110263
110386
  redirectTargetsMap: ts.createMultiMap(),
110264
110387
  getFileIncludeReasons: ts.notImplemented,
110388
+ createHash: createHash,
110265
110389
  };
110266
110390
  emitFiles(ts.notImplementedResolver, emitHost,
110267
110391
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -115346,12 +115470,10 @@ var ts;
115346
115470
  }
115347
115471
  ts.createCompilerHost = createCompilerHost;
115348
115472
  /*@internal*/
115349
- // TODO(shkamat): update this after reworking ts build API
115350
115473
  function createCompilerHostWorker(options, setParentNodes, system) {
115351
115474
  if (system === void 0) { system = ts.sys; }
115352
115475
  var existingDirectories = new ts.Map();
115353
115476
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
115354
- var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
115355
115477
  function getSourceFile(fileName, languageVersionOrOptions, onError) {
115356
115478
  var text;
115357
115479
  try {
@@ -115384,7 +115506,7 @@ var ts;
115384
115506
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
115385
115507
  // the system.writeFile will do its own directory creation and
115386
115508
  // the ensureDirectoriesExist call will always be redundant.
115387
- 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); });
115509
+ 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); });
115388
115510
  ts.performance.mark("afterIOWrite");
115389
115511
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
115390
115512
  }
@@ -115394,35 +115516,6 @@ var ts;
115394
115516
  }
115395
115517
  }
115396
115518
  }
115397
- var outputFingerprints;
115398
- function writeFileWorker(fileName, data, writeByteOrderMark) {
115399
- if (!ts.isWatchSet(options) || !system.getModifiedTime) {
115400
- system.writeFile(fileName, data, writeByteOrderMark);
115401
- return;
115402
- }
115403
- if (!outputFingerprints) {
115404
- outputFingerprints = new ts.Map();
115405
- }
115406
- var hash = computeHash(data);
115407
- var mtimeBefore = system.getModifiedTime(fileName);
115408
- if (mtimeBefore) {
115409
- var fingerprint = outputFingerprints.get(fileName);
115410
- // If output has not been changed, and the file has no external modification
115411
- if (fingerprint &&
115412
- fingerprint.byteOrderMark === writeByteOrderMark &&
115413
- fingerprint.hash === hash &&
115414
- fingerprint.mtime.getTime() === mtimeBefore.getTime()) {
115415
- return;
115416
- }
115417
- }
115418
- system.writeFile(fileName, data, writeByteOrderMark);
115419
- var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;
115420
- outputFingerprints.set(fileName, {
115421
- hash: hash,
115422
- byteOrderMark: writeByteOrderMark,
115423
- mtime: mtimeAfter
115424
- });
115425
- }
115426
115519
  function getDefaultLibLocation() {
115427
115520
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
115428
115521
  }
@@ -116974,6 +117067,7 @@ var ts;
116974
117067
  getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },
116975
117068
  redirectTargetsMap: redirectTargetsMap,
116976
117069
  getFileIncludeReasons: program.getFileIncludeReasons,
117070
+ createHash: ts.maybeBind(host, host.createHash),
116977
117071
  };
116978
117072
  }
116979
117073
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -119087,13 +119181,9 @@ var ts;
119087
119181
  function createManyToManyPathMap() {
119088
119182
  function create(forward, reverse, deleted) {
119089
119183
  var map = {
119090
- clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
119091
- forEach: function (fn) { return forward.forEach(fn); },
119092
119184
  getKeys: function (v) { return reverse.get(v); },
119093
119185
  getValues: function (k) { return forward.get(k); },
119094
- hasKey: function (k) { return forward.has(k); },
119095
119186
  keys: function () { return forward.keys(); },
119096
- deletedKeys: function () { return deleted; },
119097
119187
  deleteKey: function (k) {
119098
119188
  (deleted || (deleted = new ts.Set())).add(k);
119099
119189
  var set = forward.get(k);
@@ -119120,11 +119210,6 @@ var ts;
119120
119210
  });
119121
119211
  return map;
119122
119212
  },
119123
- clear: function () {
119124
- forward.clear();
119125
- reverse.clear();
119126
- deleted === null || deleted === void 0 ? void 0 : deleted.clear();
119127
- }
119128
119213
  };
119129
119214
  return map;
119130
119215
  }
@@ -119252,18 +119337,21 @@ var ts;
119252
119337
  * Creates the state of file references and signature for the new program from oldState if it is safe
119253
119338
  */
119254
119339
  function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119340
+ var _a, _b, _c;
119255
119341
  var fileInfos = new ts.Map();
119256
119342
  var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? createManyToManyPathMap() : undefined;
119257
119343
  var exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
119258
- var hasCalledUpdateShapeSignature = new ts.Set();
119259
119344
  var useOldState = canReuseOldState(referencedMap, oldState);
119260
119345
  // Ensure source files have parent pointers set
119261
119346
  newProgram.getTypeChecker();
119262
119347
  // Create the reference map, and set the file infos
119263
- for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
119264
- var sourceFile = _a[_i];
119348
+ for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) {
119349
+ var sourceFile = _d[_i];
119265
119350
  var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
119266
- var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;
119351
+ var oldUncommitedSignature = useOldState ? (_a = oldState.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(sourceFile.resolvedPath) : undefined;
119352
+ var signature = oldUncommitedSignature === undefined ?
119353
+ useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : undefined :
119354
+ oldUncommitedSignature || undefined;
119267
119355
  if (referencedMap) {
119268
119356
  var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
119269
119357
  if (newReferences) {
@@ -119271,19 +119359,26 @@ var ts;
119271
119359
  }
119272
119360
  // Copy old visible to outside files map
119273
119361
  if (useOldState) {
119274
- var exportedModules = oldState.exportedModulesMap.getValues(sourceFile.resolvedPath);
119362
+ var oldUncommitedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath);
119363
+ var exportedModules = oldUncommitedExportedModules === undefined ?
119364
+ oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) :
119365
+ oldUncommitedExportedModules || undefined;
119275
119366
  if (exportedModules) {
119276
119367
  exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119277
119368
  }
119278
119369
  }
119279
119370
  }
119280
- fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined, impliedFormat: sourceFile.impliedNodeFormat });
119371
+ fileInfos.set(sourceFile.resolvedPath, {
119372
+ version: version_2,
119373
+ signature: signature,
119374
+ affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || undefined,
119375
+ impliedFormat: sourceFile.impliedNodeFormat
119376
+ });
119281
119377
  }
119282
119378
  return {
119283
119379
  fileInfos: fileInfos,
119284
119380
  referencedMap: referencedMap,
119285
119381
  exportedModulesMap: exportedModulesMap,
119286
- hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature,
119287
119382
  useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState
119288
119383
  };
119289
119384
  }
@@ -119297,71 +119392,42 @@ var ts;
119297
119392
  }
119298
119393
  BuilderState.releaseCache = releaseCache;
119299
119394
  /**
119300
- * Creates a clone of the state
119395
+ * Gets the files affected by the path from the program
119301
119396
  */
119302
- function clone(state) {
119397
+ function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
119303
119398
  var _a, _b;
119304
- // Dont need to backup allFiles info since its cache anyway
119305
- return {
119306
- fileInfos: new ts.Map(state.fileInfos),
119307
- referencedMap: (_a = state.referencedMap) === null || _a === void 0 ? void 0 : _a.clone(),
119308
- exportedModulesMap: (_b = state.exportedModulesMap) === null || _b === void 0 ? void 0 : _b.clone(),
119309
- hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),
119310
- useFileVersionAsSignature: state.useFileVersionAsSignature,
119311
- };
119399
+ var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
119400
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119401
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119402
+ return result;
119312
119403
  }
119313
- BuilderState.clone = clone;
119314
- /**
119315
- * Gets the files affected by the path from the program
119316
- */
119317
- function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {
119318
- // Since the operation could be cancelled, the signatures are always stored in the cache
119319
- // They will be committed once it is safe to use them
119320
- // eg when calling this api from tsserver, if there is no cancellation of the operation
119321
- // In the other cases the affected files signatures are committed only after the iteration through the result is complete
119322
- var signatureCache = cacheToUpdateSignature || new ts.Map();
119404
+ BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119405
+ function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
119323
119406
  var sourceFile = programOfThisState.getSourceFileByPath(path);
119324
119407
  if (!sourceFile) {
119325
119408
  return ts.emptyArray;
119326
119409
  }
119327
- if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {
119410
+ if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
119328
119411
  return [sourceFile];
119329
119412
  }
119330
- var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);
119331
- if (!cacheToUpdateSignature) {
119332
- // Commit all the signatures in the signature cache
119333
- updateSignaturesFromCache(state, signatureCache);
119334
- }
119335
- return result;
119413
+ return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
119336
119414
  }
119337
- BuilderState.getFilesAffectedBy = getFilesAffectedBy;
119338
- /**
119339
- * Updates the signatures from the cache into state's fileinfo signatures
119340
- * This should be called whenever it is safe to commit the state of the builder
119341
- */
119342
- function updateSignaturesFromCache(state, signatureCache) {
119343
- signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });
119344
- }
119345
- BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;
119415
+ BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
119346
119416
  function updateSignatureOfFile(state, signature, path) {
119347
119417
  state.fileInfos.get(path).signature = signature;
119348
- state.hasCalledUpdateShapeSignature.add(path);
119418
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
119349
119419
  }
119350
119420
  BuilderState.updateSignatureOfFile = updateSignatureOfFile;
119351
119421
  /**
119352
119422
  * Returns if the shape of the signature has changed since last emit
119353
119423
  */
119354
- function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache, useFileVersionAsSignature) {
119424
+ function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
119425
+ var _a;
119355
119426
  if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
119356
- ts.Debug.assert(!!sourceFile);
119357
- ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state");
119358
119427
  // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
119359
- if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {
119428
+ if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
119360
119429
  return false;
119361
- }
119362
119430
  var info = state.fileInfos.get(sourceFile.resolvedPath);
119363
- if (!info)
119364
- return ts.Debug.fail();
119365
119431
  var prevSignature = info.signature;
119366
119432
  var latestSignature;
119367
119433
  if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
@@ -119372,45 +119438,55 @@ var ts;
119372
119438
  var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
119373
119439
  if (firstDts_1) {
119374
119440
  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; })); });
119375
- latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
119376
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119377
- updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
119441
+ latestSignature = computeSignature(firstDts_1.text, computeHash);
119442
+ if (latestSignature !== prevSignature) {
119443
+ updateExportedModules(state, sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit);
119378
119444
  }
119379
119445
  }
119380
119446
  }
119381
119447
  // Default is to use file version as signature
119382
119448
  if (latestSignature === undefined) {
119383
119449
  latestSignature = sourceFile.version;
119384
- if (exportedModulesMapCache && latestSignature !== prevSignature) {
119450
+ if (state.exportedModulesMap && latestSignature !== prevSignature) {
119451
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119385
119452
  // All the references in this file are exported
119386
119453
  var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : undefined;
119387
119454
  if (references) {
119388
- exportedModulesMapCache.set(sourceFile.resolvedPath, references);
119455
+ state.exportedModulesMap.set(sourceFile.resolvedPath, references);
119389
119456
  }
119390
119457
  else {
119391
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119458
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119392
119459
  }
119393
119460
  }
119394
119461
  }
119395
- cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);
119462
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(sourceFile.resolvedPath, prevSignature || false);
119463
+ (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(sourceFile.resolvedPath);
119464
+ info.signature = latestSignature;
119396
119465
  return latestSignature !== prevSignature;
119397
119466
  }
119398
119467
  BuilderState.updateShapeSignature = updateShapeSignature;
119468
+ function computeSignature(text, computeHash) {
119469
+ return (computeHash || ts.generateDjb2Hash)(text);
119470
+ }
119471
+ BuilderState.computeSignature = computeSignature;
119399
119472
  /**
119400
119473
  * Coverts the declaration emit result into exported modules map
119401
119474
  */
119402
- function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {
119475
+ function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
119476
+ if (!state.exportedModulesMap)
119477
+ return;
119478
+ (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
119403
119479
  if (!exportedModulesFromDeclarationEmit) {
119404
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119480
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119405
119481
  return;
119406
119482
  }
119407
119483
  var exportedModules;
119408
119484
  exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); });
119409
119485
  if (exportedModules) {
119410
- exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules);
119486
+ state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
119411
119487
  }
119412
119488
  else {
119413
- exportedModulesMapCache.deleteKey(sourceFile.resolvedPath);
119489
+ state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
119414
119490
  }
119415
119491
  function addExportedModule(exportedModulePaths) {
119416
119492
  if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) {
@@ -119422,19 +119498,6 @@ var ts;
119422
119498
  }
119423
119499
  }
119424
119500
  BuilderState.updateExportedModules = updateExportedModules;
119425
- /**
119426
- * Updates the exported modules from cache into state's exported modules map
119427
- * This should be called whenever it is safe to commit the state of the builder
119428
- */
119429
- function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {
119430
- var _a;
119431
- if (exportedModulesMapCache) {
119432
- ts.Debug.assert(!!state.exportedModulesMap);
119433
- (_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
119434
- exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
119435
- }
119436
- }
119437
- BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;
119438
119501
  /**
119439
119502
  * Get all the dependencies of the sourceFile
119440
119503
  */
@@ -119555,7 +119618,7 @@ var ts;
119555
119618
  /**
119556
119619
  * When program emits modular code, gets the files affected by the sourceFile whose shape has changed
119557
119620
  */
119558
- function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
119621
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
119559
119622
  if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
119560
119623
  return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
119561
119624
  }
@@ -119575,7 +119638,7 @@ var ts;
119575
119638
  if (!seenFileNamesMap.has(currentPath)) {
119576
119639
  var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
119577
119640
  seenFileNamesMap.set(currentPath, currentSourceFile);
119578
- if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
119641
+ if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
119579
119642
  queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
119580
119643
  }
119581
119644
  }
@@ -119601,32 +119664,33 @@ var ts;
119601
119664
  * Create the state so that we can iterate on changedFiles/affected files
119602
119665
  */
119603
119666
  function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) {
119667
+ var _a, _b;
119604
119668
  var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature);
119605
119669
  state.program = newProgram;
119606
119670
  var compilerOptions = newProgram.getCompilerOptions();
119607
119671
  state.compilerOptions = compilerOptions;
119672
+ var outFilePath = ts.outFile(compilerOptions);
119608
119673
  // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
119609
- if (!ts.outFile(compilerOptions)) {
119674
+ if (!outFilePath) {
119610
119675
  state.semanticDiagnosticsPerFile = new ts.Map();
119611
119676
  }
119677
+ 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)) {
119678
+ state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature;
119679
+ }
119612
119680
  state.changedFilesSet = new ts.Set();
119681
+ state.dtsChangeTime = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.dtsChangeTime : undefined;
119613
119682
  var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
119614
119683
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
119615
119684
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
119616
119685
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
119686
+ var canCopyEmitSignatures = compilerOptions.composite &&
119687
+ (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
119688
+ !outFilePath &&
119689
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
119617
119690
  if (useOldState) {
119618
- // Verify the sanity of old state
119619
- if (!oldState.currentChangedFilePath) {
119620
- var affectedSignatures = oldState.currentAffectedFilesSignatures;
119621
- ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
119622
- }
119623
- var changedFilesSet = oldState.changedFilesSet;
119624
- if (canCopySemanticDiagnostics) {
119625
- ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files");
119626
- }
119627
119691
  // Copy old state's changed files set
119628
- changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });
119629
- if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {
119692
+ (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
119693
+ if (!outFilePath && oldState.affectedFilesPendingEmit) {
119630
119694
  state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();
119631
119695
  state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);
119632
119696
  state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;
@@ -119647,6 +119711,8 @@ var ts;
119647
119711
  !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||
119648
119712
  // versions dont match
119649
119713
  oldInfo.version !== info.version ||
119714
+ // Implied formats dont match
119715
+ oldInfo.impliedFormat !== info.impliedFormat ||
119650
119716
  // Referenced files changed
119651
119717
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) ||
119652
119718
  // Referenced file was deleted in the new program
@@ -119670,27 +119736,25 @@ var ts;
119670
119736
  state.semanticDiagnosticsFromOldState.add(sourceFilePath);
119671
119737
  }
119672
119738
  }
119739
+ if (canCopyEmitSignatures) {
119740
+ var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath);
119741
+ if (oldEmitSignature)
119742
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(sourceFilePath, oldEmitSignature);
119743
+ }
119673
119744
  });
119674
119745
  // If the global file is removed, add all files as changed
119675
119746
  if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {
119676
119747
  ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)
119677
119748
  .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });
119678
119749
  }
119679
- else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
119750
+ else if (oldCompilerOptions && !outFilePath && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
119680
119751
  // Add all files to affectedFilesPendingEmit since emit changed
119681
119752
  newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });
119682
119753
  ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);
119683
119754
  state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();
119684
119755
  }
119685
- if (useOldState) {
119686
- // Any time the interpretation of a source file changes, mark it as changed
119687
- ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) {
119688
- if (state.fileInfos.has(sourceFilePath) && state.fileInfos.get(sourceFilePath).impliedFormat !== info.impliedFormat) {
119689
- state.changedFilesSet.add(sourceFilePath);
119690
- }
119691
- });
119692
- }
119693
- state.buildInfoEmitPending = !!state.changedFilesSet.size;
119756
+ // Since old states change files set is copied, any additional change means we would need to emit build info
119757
+ state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0);
119694
119758
  return state;
119695
119759
  }
119696
119760
  function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
@@ -119726,30 +119790,35 @@ var ts;
119726
119790
  ts.BuilderState.releaseCache(state);
119727
119791
  state.program = undefined;
119728
119792
  }
119729
- /**
119730
- * Creates a clone of the state
119731
- */
119732
- function cloneBuilderProgramState(state) {
119733
- var _a;
119734
- var newState = ts.BuilderState.clone(state);
119735
- newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
119736
- newState.changedFilesSet = new ts.Set(state.changedFilesSet);
119737
- newState.affectedFiles = state.affectedFiles;
119738
- newState.affectedFilesIndex = state.affectedFilesIndex;
119739
- newState.currentChangedFilePath = state.currentChangedFilePath;
119740
- newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
119741
- newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
119742
- newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
119743
- newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
119744
- newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
119745
- newState.program = state.program;
119746
- newState.compilerOptions = state.compilerOptions;
119747
- newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
119748
- newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
119749
- newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
119750
- newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
119751
- newState.programEmitComplete = state.programEmitComplete;
119752
- return newState;
119793
+ function backupEmitBuilderProgramState(state) {
119794
+ var outFilePath = ts.outFile(state.compilerOptions);
119795
+ // Only in --out changeFileSet is kept around till emit
119796
+ ts.Debug.assert(!state.changedFilesSet.size || outFilePath);
119797
+ return {
119798
+ affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(),
119799
+ affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind),
119800
+ affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex,
119801
+ seenEmittedFiles: state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles),
119802
+ programEmitComplete: state.programEmitComplete,
119803
+ emitSignatures: state.emitSignatures && new ts.Map(state.emitSignatures),
119804
+ outSignature: state.outSignature,
119805
+ dtsChangeTime: state.dtsChangeTime,
119806
+ hasChangedEmitSignature: state.hasChangedEmitSignature,
119807
+ changedFilesSet: outFilePath ? new ts.Set(state.changedFilesSet) : undefined,
119808
+ };
119809
+ }
119810
+ function restoreEmitBuilderProgramState(state, backupEmitState) {
119811
+ state.affectedFilesPendingEmit = backupEmitState.affectedFilesPendingEmit;
119812
+ state.affectedFilesPendingEmitKind = backupEmitState.affectedFilesPendingEmitKind;
119813
+ state.affectedFilesPendingEmitIndex = backupEmitState.affectedFilesPendingEmitIndex;
119814
+ state.seenEmittedFiles = backupEmitState.seenEmittedFiles;
119815
+ state.programEmitComplete = backupEmitState.programEmitComplete;
119816
+ state.emitSignatures = backupEmitState.emitSignatures;
119817
+ state.outSignature = backupEmitState.outSignature;
119818
+ state.dtsChangeTime = backupEmitState.dtsChangeTime;
119819
+ state.hasChangedEmitSignature = backupEmitState.hasChangedEmitSignature;
119820
+ if (backupEmitState.changedFilesSet)
119821
+ state.changedFilesSet = backupEmitState.changedFilesSet;
119753
119822
  }
119754
119823
  /**
119755
119824
  * Verifies that source file is ok to be used in calls that arent handled by next
@@ -119764,7 +119833,7 @@ var ts;
119764
119833
  * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained
119765
119834
  */
119766
119835
  function getNextAffectedFile(state, cancellationToken, computeHash, host) {
119767
- var _a;
119836
+ var _a, _b;
119768
119837
  while (true) {
119769
119838
  var affectedFiles = state.affectedFiles;
119770
119839
  if (affectedFiles) {
@@ -119784,10 +119853,8 @@ var ts;
119784
119853
  state.changedFilesSet.delete(state.currentChangedFilePath);
119785
119854
  state.currentChangedFilePath = undefined;
119786
119855
  // Commit the changes in file signature
119787
- ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
119788
- state.currentAffectedFilesSignatures.clear();
119789
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
119790
- (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
119856
+ (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
119857
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
119791
119858
  state.affectedFiles = undefined;
119792
119859
  }
119793
119860
  // Get next changed file
@@ -119805,12 +119872,7 @@ var ts;
119805
119872
  return program;
119806
119873
  }
119807
119874
  // Get next batch of affected files
119808
- if (!state.currentAffectedFilesSignatures)
119809
- state.currentAffectedFilesSignatures = new ts.Map();
119810
- if (state.exportedModulesMap) {
119811
- state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap());
119812
- }
119813
- state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);
119875
+ state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
119814
119876
  state.currentChangedFilePath = nextKey.value;
119815
119877
  state.affectedFilesIndex = 0;
119816
119878
  if (!state.seenAffectedFiles)
@@ -119862,7 +119924,6 @@ var ts;
119862
119924
  * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
119863
119925
  */
119864
119926
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
119865
- var _a;
119866
119927
  removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
119867
119928
  // If affected files is everything except default library, then nothing more to do
119868
119929
  if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
@@ -119870,10 +119931,9 @@ var ts;
119870
119931
  // When a change affects the global scope, all files are considered to be affected without updating their signature
119871
119932
  // That means when affected file is handled, its signature can be out of date
119872
119933
  // To avoid this, ensure that we update the signature for any affected file in this scenario.
119873
- ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
119934
+ ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
119874
119935
  return;
119875
119936
  }
119876
- 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);
119877
119937
  if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
119878
119938
  return;
119879
119939
  handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
@@ -119893,7 +119953,7 @@ var ts;
119893
119953
  // This ensures that we dont later during incremental builds considering wrong signature.
119894
119954
  // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build
119895
119955
  // But we avoid expensive full shape computation, as using file version as shape is enough for correctness.
119896
- ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
119956
+ ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
119897
119957
  // If not dts emit, nothing more to do
119898
119958
  if (ts.getEmitDeclarations(state.compilerOptions)) {
119899
119959
  addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);
@@ -119914,27 +119974,10 @@ var ts;
119914
119974
  return !state.semanticDiagnosticsFromOldState.size;
119915
119975
  }
119916
119976
  function isChangedSignature(state, path) {
119917
- var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
119918
- var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
119977
+ var oldSignature = ts.Debug.checkDefined(state.oldSignatures).get(path) || undefined;
119978
+ var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
119919
119979
  return newSignature !== oldSignature;
119920
119980
  }
119921
- function forEachKeyOfExportedModulesMap(state, filePath, fn) {
119922
- // Go through exported modules from cache first
119923
- var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
119924
- var result = keys && ts.forEachKey(keys, fn);
119925
- if (result)
119926
- return result;
119927
- // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
119928
- keys = state.exportedModulesMap.getKeys(filePath);
119929
- return keys && ts.forEachKey(keys, function (exportedFromPath) {
119930
- var _a;
119931
- // If the cache had an updated value, skip
119932
- return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
119933
- !((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
119934
- fn(exportedFromPath) :
119935
- undefined;
119936
- });
119937
- }
119938
119981
  function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
119939
119982
  var _a;
119940
119983
  if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
@@ -119949,6 +119992,7 @@ var ts;
119949
119992
  * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
119950
119993
  */
119951
119994
  function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
119995
+ var _a;
119952
119996
  // If there was change in signature (dts output) for the changed file,
119953
119997
  // then only we need to handle pending file emit
119954
119998
  if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
@@ -119975,11 +120019,10 @@ var ts;
119975
120019
  }
119976
120020
  }
119977
120021
  }
119978
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
119979
120022
  var seenFileAndExportsOfFile = new ts.Set();
119980
120023
  // Go through exported modules from cache first
119981
120024
  // If exported modules has path, all files referencing file exported from are affected
119982
- forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
120025
+ (_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
119983
120026
  if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
119984
120027
  return true;
119985
120028
  var references = state.referencedMap.getKeys(exportedFromPath);
@@ -119993,19 +120036,18 @@ var ts;
119993
120036
  * return true when all work is done and we can exit handling dts emit and semantic diagnostics
119994
120037
  */
119995
120038
  function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
119996
- var _a;
120039
+ var _a, _b;
119997
120040
  if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
119998
120041
  return undefined;
119999
120042
  if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
120000
120043
  return true;
120001
120044
  handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
120002
- ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
120003
120045
  // If exported modules has path, all files referencing file exported from are affected
120004
- forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
120046
+ (_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
120005
120047
  return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
120006
120048
  });
120007
120049
  // Remove diagnostics of files that import this file (without going to exports of referencing files)
120008
- (_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
120050
+ (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
120009
120051
  return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
120010
120052
  handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
120011
120053
  state, referencingFilePath, cancellationToken, computeHash, host);
@@ -120026,12 +120068,13 @@ var ts;
120026
120068
  }
120027
120069
  else {
120028
120070
  state.seenAffectedFiles.add(affected.resolvedPath);
120071
+ // Change in changeSet/affectedFilesPendingEmit, buildInfo needs to be emitted
120072
+ state.buildInfoEmitPending = true;
120029
120073
  if (emitKind !== undefined) {
120030
120074
  (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);
120031
120075
  }
120032
120076
  if (isPendingEmit) {
120033
120077
  state.affectedFilesPendingEmitIndex++;
120034
- state.buildInfoEmitPending = true;
120035
120078
  }
120036
120079
  else {
120037
120080
  state.affectedFilesIndex++;
@@ -120082,22 +120125,43 @@ var ts;
120082
120125
  /**
120083
120126
  * Gets the program information to be emitted in buildInfo so that we can use it to create new program
120084
120127
  */
120085
- function getProgramBuildInfo(state, getCanonicalFileName) {
120086
- if (ts.outFile(state.compilerOptions))
120087
- return undefined;
120128
+ function getProgramBuildInfo(state, getCanonicalFileName, host) {
120129
+ var outFilePath = ts.outFile(state.compilerOptions);
120130
+ if (outFilePath && !state.compilerOptions.composite)
120131
+ return;
120088
120132
  var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();
120089
120133
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
120134
+ state.dtsChangeTime = state.hasChangedEmitSignature ? ts.getCurrentTime(host).getTime() : state.dtsChangeTime;
120135
+ if (outFilePath) {
120136
+ var result_15 = {
120137
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
120138
+ outSignature: state.outSignature,
120139
+ dtsChangeTime: state.dtsChangeTime,
120140
+ };
120141
+ return result_15;
120142
+ }
120090
120143
  var fileNames = [];
120091
120144
  var fileNameToFileId = new ts.Map();
120092
120145
  var fileIdsList;
120093
120146
  var fileNamesToFileIdListId;
120147
+ var emitSignatures;
120094
120148
  var fileInfos = ts.arrayFrom(state.fileInfos.entries(), function (_a) {
120149
+ var _b, _c;
120095
120150
  var key = _a[0], value = _a[1];
120096
120151
  // Ensure fileId
120097
120152
  var fileId = toFileId(key);
120098
120153
  ts.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
120099
- var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
120100
- var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
120154
+ var oldSignature = (_b = state.oldSignatures) === null || _b === void 0 ? void 0 : _b.get(key);
120155
+ var actualSignature = oldSignature !== undefined ? oldSignature || undefined : value.signature;
120156
+ if (state.compilerOptions.composite) {
120157
+ var file = state.program.getSourceFileByPath(key);
120158
+ if (!ts.isJsonSourceFile(file) && ts.sourceFileMayBeEmitted(file, state.program)) {
120159
+ var emitSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(key);
120160
+ if (emitSignature !== actualSignature) {
120161
+ (emitSignatures || (emitSignatures = [])).push(emitSignature === undefined ? fileId : [fileId, emitSignature]);
120162
+ }
120163
+ }
120164
+ }
120101
120165
  return value.version === actualSignature ?
120102
120166
  value.affectsGlobalScope || value.impliedFormat ?
120103
120167
  // If file version is same as signature, dont serialize signature
@@ -120105,11 +120169,11 @@ var ts;
120105
120169
  // If file info only contains version and signature and both are same we can just write string
120106
120170
  value.version :
120107
120171
  actualSignature !== undefined ? // If signature is not same as version, encode signature in the fileInfo
120108
- signature === undefined ?
120172
+ oldSignature === undefined ?
120109
120173
  // If we havent computed signature, use fileInfo as is
120110
120174
  value :
120111
120175
  // Serialize fileInfo with new updated signature
120112
- { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120176
+ { version: value.version, signature: actualSignature, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
120113
120177
  // Signature of the FileInfo is undefined, serialize it as false
120114
120178
  { version: value.version, signature: false, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat };
120115
120179
  });
@@ -120124,17 +120188,13 @@ var ts;
120124
120188
  if (state.exportedModulesMap) {
120125
120189
  exportedModulesMap = ts.mapDefined(ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive), function (key) {
120126
120190
  var _a;
120127
- if (state.currentAffectedFilesExportedModulesMap) {
120128
- if ((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(key)) {
120129
- return undefined;
120130
- }
120131
- var newValue = state.currentAffectedFilesExportedModulesMap.getValues(key);
120132
- if (newValue) {
120133
- return [toFileId(key), toFileIdListId(newValue)];
120134
- }
120135
- }
120191
+ var oldValue = (_a = state.oldExportedModulesMap) === null || _a === void 0 ? void 0 : _a.get(key);
120136
120192
  // Not in temporary cache, use existing value
120137
- return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120193
+ if (oldValue === undefined)
120194
+ return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))];
120195
+ if (oldValue)
120196
+ return [toFileId(key), toFileIdListId(oldValue)];
120197
+ return undefined;
120138
120198
  });
120139
120199
  }
120140
120200
  var semanticDiagnosticsPerFile;
@@ -120145,9 +120205,7 @@ var ts;
120145
120205
  (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value.length ?
120146
120206
  [
120147
120207
  toFileId(key),
120148
- state.hasReusableDiagnostic ?
120149
- value :
120150
- convertToReusableDiagnostics(value, relativeToBuildInfo)
120208
+ convertToReusableDiagnostics(value, relativeToBuildInfo)
120151
120209
  ] :
120152
120210
  toFileId(key));
120153
120211
  }
@@ -120162,16 +120220,27 @@ var ts;
120162
120220
  }
120163
120221
  }
120164
120222
  }
120165
- return {
120223
+ var changeFileSet;
120224
+ if (state.changedFilesSet.size) {
120225
+ for (var _d = 0, _e = ts.arrayFrom(state.changedFilesSet.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {
120226
+ var path = _e[_d];
120227
+ (changeFileSet || (changeFileSet = [])).push(toFileId(path));
120228
+ }
120229
+ }
120230
+ var result = {
120166
120231
  fileNames: fileNames,
120167
120232
  fileInfos: fileInfos,
120168
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath),
120233
+ options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"),
120169
120234
  fileIdsList: fileIdsList,
120170
120235
  referencedMap: referencedMap,
120171
120236
  exportedModulesMap: exportedModulesMap,
120172
120237
  semanticDiagnosticsPerFile: semanticDiagnosticsPerFile,
120173
120238
  affectedFilesPendingEmit: affectedFilesPendingEmit,
120239
+ changeFileSet: changeFileSet,
120240
+ emitSignatures: emitSignatures,
120241
+ dtsChangeTime: state.dtsChangeTime,
120174
120242
  };
120243
+ return result;
120175
120244
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
120176
120245
  return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));
120177
120246
  }
@@ -120196,24 +120265,18 @@ var ts;
120196
120265
  }
120197
120266
  return fileIdListId;
120198
120267
  }
120199
- }
120200
- function convertToProgramBuildInfoCompilerOptions(options, relativeToBuildInfo) {
120201
- var result;
120202
- var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120203
- for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120204
- var name = _a[_i];
120205
- var optionKey = name.toLowerCase();
120206
- var optionInfo = optionsNameMap.get(optionKey);
120207
- if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
120208
- // We need to store `strict`, even though it won't be examined directly, so that the
120209
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly from the buildinfo
120210
- optionKey === "strict" ||
120211
- // We need to store these to determine whether `lib` files need to be rechecked.
120212
- optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
120213
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
120268
+ function convertToProgramBuildInfoCompilerOptions(options, optionKey) {
120269
+ var result;
120270
+ var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
120271
+ for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
120272
+ var name = _a[_i];
120273
+ var optionInfo = optionsNameMap.get(name.toLowerCase());
120274
+ if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) {
120275
+ (result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfoEnsuringAbsolutePath);
120276
+ }
120214
120277
  }
120278
+ return result;
120215
120279
  }
120216
- return result;
120217
120280
  }
120218
120281
  function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
120219
120282
  if (option) {
@@ -120287,6 +120350,10 @@ var ts;
120287
120350
  return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
120288
120351
  }
120289
120352
  ts.getBuilderCreationParameters = getBuilderCreationParameters;
120353
+ function computeSignature(text, data, computeHash) {
120354
+ return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
120355
+ }
120356
+ ts.computeSignature = computeSignature;
120290
120357
  function createBuilderProgram(kind, _a) {
120291
120358
  var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
120292
120359
  // Return same program if underlying program doesnt change
@@ -120305,8 +120372,8 @@ var ts;
120305
120372
  */
120306
120373
  var computeHash = ts.maybeBind(host, host.createHash);
120307
120374
  var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
120308
- var backupState;
120309
- newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };
120375
+ var backupEmitState;
120376
+ newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName, host); };
120310
120377
  // To ensure that we arent storing any references to old program or new program without state
120311
120378
  newProgram = undefined; // TODO: GH#18217
120312
120379
  oldProgram = undefined;
@@ -120314,20 +120381,20 @@ var ts;
120314
120381
  var getState = function () { return state; };
120315
120382
  var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
120316
120383
  builderProgram.getState = getState;
120317
- builderProgram.backupState = function () {
120318
- ts.Debug.assert(backupState === undefined);
120319
- backupState = cloneBuilderProgramState(state);
120384
+ builderProgram.backupEmitState = function () {
120385
+ ts.Debug.assert(backupEmitState === undefined);
120386
+ backupEmitState = backupEmitBuilderProgramState(state);
120320
120387
  };
120321
- builderProgram.restoreState = function () {
120322
- state = ts.Debug.checkDefined(backupState);
120323
- backupState = undefined;
120388
+ builderProgram.restoreEmitState = function () {
120389
+ restoreEmitBuilderProgramState(state, ts.Debug.checkDefined(backupEmitState));
120390
+ backupEmitState = undefined;
120324
120391
  };
120325
120392
  builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };
120326
120393
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
120327
120394
  builderProgram.emit = emit;
120328
120395
  builderProgram.releaseProgram = function () {
120329
120396
  releaseCache(state);
120330
- backupState = undefined;
120397
+ backupEmitState = undefined;
120331
120398
  };
120332
120399
  if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {
120333
120400
  builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;
@@ -120386,35 +120453,59 @@ var ts;
120386
120453
  return toAffectedFileEmitResult(state,
120387
120454
  // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120388
120455
  // Otherwise just affected file
120389
- ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120390
- getWriteFileUpdatingSignatureCallback(writeFile) :
120456
+ ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, ts.getEmitDeclarations(state.compilerOptions) ?
120457
+ getWriteFileCallback(writeFile, customTransformers) :
120391
120458
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
120392
120459
  }
120393
- function getWriteFileUpdatingSignatureCallback(writeFile) {
120460
+ function getWriteFileCallback(writeFile, customTransformers) {
120394
120461
  return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
120395
- var _a;
120462
+ var _a, _b, _c;
120396
120463
  if (ts.isDeclarationFileName(fileName)) {
120397
- ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120398
- var file = sourceFiles[0];
120399
- var info = state.fileInfos.get(file.resolvedPath);
120400
- var signature = ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath)) || info.signature;
120401
- if (signature === file.version) {
120402
- var newSignature = (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
120403
- if (newSignature !== file.version) { // Update it
120404
- if (host.storeFilesChangingSignatureDuringEmit)
120405
- (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120406
- if (state.exportedModulesMap)
120407
- ts.BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap || (state.currentAffectedFilesExportedModulesMap = ts.BuilderState.createManyToManyPathMap()));
120408
- if (state.affectedFiles && state.affectedFilesIndex < state.affectedFiles.length) {
120409
- state.currentAffectedFilesSignatures.set(file.resolvedPath, newSignature);
120464
+ if (!ts.outFile(state.compilerOptions)) {
120465
+ ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
120466
+ var newSignature = void 0;
120467
+ if (!customTransformers) {
120468
+ var file = sourceFiles[0];
120469
+ var info = state.fileInfos.get(file.resolvedPath);
120470
+ if (info.signature === file.version) {
120471
+ newSignature = computeSignature(text, data, computeHash);
120472
+ if (newSignature !== file.version) { // Update it
120473
+ if (host.storeFilesChangingSignatureDuringEmit)
120474
+ (state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
120475
+ if (state.exportedModulesMap)
120476
+ ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
120477
+ if (state.affectedFiles) {
120478
+ // Keep old signature so we know what to undo if cancellation happens
120479
+ var existing = (_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.get(file.resolvedPath);
120480
+ if (existing === undefined)
120481
+ (state.oldSignatures || (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
120482
+ info.signature = newSignature;
120483
+ }
120484
+ else {
120485
+ // These are directly commited
120486
+ info.signature = newSignature;
120487
+ (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
120488
+ }
120489
+ }
120410
120490
  }
120411
- else {
120412
- info.signature = newSignature;
120413
- if (state.exportedModulesMap)
120414
- ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
120491
+ }
120492
+ if (state.compilerOptions.composite) {
120493
+ var filePath = sourceFiles[0].resolvedPath;
120494
+ var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
120495
+ newSignature || (newSignature = computeSignature(text, data, computeHash));
120496
+ if (newSignature !== oldSignature) {
120497
+ (state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
120498
+ state.hasChangedEmitSignature = true;
120415
120499
  }
120416
120500
  }
120417
120501
  }
120502
+ else if (state.compilerOptions.composite) {
120503
+ var newSignature = computeSignature(text, data, computeHash);
120504
+ if (newSignature !== state.outSignature) {
120505
+ state.outSignature = newSignature;
120506
+ state.hasChangedEmitSignature = true;
120507
+ }
120508
+ }
120418
120509
  }
120419
120510
  if (writeFile)
120420
120511
  writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
@@ -120479,8 +120570,8 @@ var ts;
120479
120570
  }
120480
120571
  }
120481
120572
  }
120482
- return ts.Debug.checkDefined(state.program).emit(targetSourceFile, !ts.outFile(state.compilerOptions) && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120483
- getWriteFileUpdatingSignatureCallback(writeFile) :
120573
+ return ts.Debug.checkDefined(state.program).emit(targetSourceFile, ts.getEmitDeclarations(state.compilerOptions) ?
120574
+ getWriteFileCallback(writeFile, customTransformers) :
120484
120575
  writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
120485
120576
  }
120486
120577
  /**
@@ -120569,14 +120660,28 @@ var ts;
120569
120660
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
120570
120661
  }
120571
120662
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
120572
- function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
120573
- var _a;
120663
+ function createBuilderProgramUsingProgramBuildInfo(programFromBuildInfo, buildInfoPath, host) {
120664
+ var _a, _b, _c, _d, _e;
120574
120665
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
120575
120666
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
120576
- var filePaths = program.fileNames.map(toPath);
120577
- var filePathsSetList = (_a = program.fileIdsList) === null || _a === void 0 ? void 0 : _a.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
120667
+ var program = programFromBuildInfo;
120668
+ var filePaths = (_a = program.fileNames) === null || _a === void 0 ? void 0 : _a.map(toPath);
120669
+ var filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function (fileIds) { return new ts.Set(fileIds.map(toFilePath)); });
120578
120670
  var fileInfos = new ts.Map();
120579
- program.fileInfos.forEach(function (fileInfo, index) { return fileInfos.set(toFilePath(index + 1), toBuilderStateFileInfo(fileInfo)); });
120671
+ var emitSignatures = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts.outFile(program.options) ? new ts.Map() : undefined;
120672
+ (_d = program.fileInfos) === null || _d === void 0 ? void 0 : _d.forEach(function (fileInfo, index) {
120673
+ var path = toFilePath(index + 1);
120674
+ var stateFileInfo = toBuilderStateFileInfo(fileInfo);
120675
+ fileInfos.set(path, stateFileInfo);
120676
+ if (emitSignatures && stateFileInfo.signature)
120677
+ emitSignatures.set(path, stateFileInfo.signature);
120678
+ });
120679
+ (_e = program.emitSignatures) === null || _e === void 0 ? void 0 : _e.forEach(function (value) {
120680
+ if (ts.isNumber(value))
120681
+ emitSignatures.delete(toFilePath(value));
120682
+ else
120683
+ emitSignatures.set(toFilePath(value[0]), value[1]);
120684
+ });
120580
120685
  var state = {
120581
120686
  fileInfos: fileInfos,
120582
120687
  compilerOptions: program.options ? ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
@@ -120587,11 +120692,15 @@ var ts;
120587
120692
  affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
120588
120693
  affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
120589
120694
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
120695
+ changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
120696
+ dtsChangeTime: program.dtsChangeTime,
120697
+ emitSignatures: (emitSignatures === null || emitSignatures === void 0 ? void 0 : emitSignatures.size) ? emitSignatures : undefined,
120698
+ outSignature: program.outSignature,
120590
120699
  };
120591
120700
  return {
120592
120701
  getState: function () { return state; },
120593
- backupState: ts.noop,
120594
- restoreState: ts.noop,
120702
+ backupEmitState: ts.noop,
120703
+ restoreEmitState: ts.noop,
120595
120704
  getProgram: ts.notImplemented,
120596
120705
  getProgramOrUndefined: ts.returnUndefined,
120597
120706
  releaseProgram: ts.noop,
@@ -120636,12 +120745,12 @@ var ts;
120636
120745
  return map;
120637
120746
  }
120638
120747
  }
120639
- ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;
120748
+ ts.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo;
120640
120749
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
120641
120750
  return {
120642
120751
  getState: ts.notImplemented,
120643
- backupState: ts.noop,
120644
- restoreState: ts.noop,
120752
+ backupEmitState: ts.noop,
120753
+ restoreEmitState: ts.noop,
120645
120754
  getProgram: getProgram,
120646
120755
  getProgramOrUndefined: function () { return getState().program; },
120647
120756
  releaseProgram: function () { return getState().program = undefined; },
@@ -121757,9 +121866,9 @@ var ts;
121757
121866
  if (!preferSymlinks) {
121758
121867
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
121759
121868
  // so we only need to remove them from the realpath filenames.
121760
- var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
121761
- if (result_15)
121762
- return result_15;
121869
+ var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
121870
+ if (result_16)
121871
+ return result_16;
121763
121872
  }
121764
121873
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
121765
121874
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -121779,10 +121888,10 @@ var ts;
121779
121888
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
121780
121889
  var symlinkDirectory = symlinkDirectories_1[_i];
121781
121890
  var option = ts.resolvePath(symlinkDirectory, relative);
121782
- var result_16 = cb(option, target === referenceRedirect);
121891
+ var result_17 = cb(option, target === referenceRedirect);
121783
121892
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
121784
- if (result_16)
121785
- return result_16;
121893
+ if (result_17)
121894
+ return result_17;
121786
121895
  }
121787
121896
  });
121788
121897
  });
@@ -122674,6 +122783,7 @@ var ts;
122674
122783
  readDirectory: ts.maybeBind(host, host.readDirectory),
122675
122784
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
122676
122785
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
122786
+ now: ts.maybeBind(host, host.now),
122677
122787
  };
122678
122788
  function writeFile(fileName, text, writeByteOrderMark, onError) {
122679
122789
  try {
@@ -122734,6 +122844,7 @@ var ts;
122734
122844
  createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram,
122735
122845
  disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
122736
122846
  storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
122847
+ now: ts.maybeBind(system, system.now),
122737
122848
  };
122738
122849
  }
122739
122850
  ts.createProgramHost = createProgramHost;
@@ -122801,20 +122912,26 @@ var ts;
122801
122912
  var ts;
122802
122913
  (function (ts) {
122803
122914
  function readBuilderProgram(compilerOptions, host) {
122804
- if (ts.outFile(compilerOptions))
122805
- return undefined;
122806
122915
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
122807
122916
  if (!buildInfoPath)
122808
122917
  return undefined;
122809
- var content = host.readFile(buildInfoPath);
122810
- if (!content)
122811
- return undefined;
122812
- var buildInfo = ts.getBuildInfo(content);
122918
+ var buildInfo;
122919
+ if (host.getBuildInfo) {
122920
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
122921
+ if (!buildInfo)
122922
+ return undefined;
122923
+ }
122924
+ else {
122925
+ var content = host.readFile(buildInfoPath);
122926
+ if (!content)
122927
+ return undefined;
122928
+ buildInfo = ts.getBuildInfo(content);
122929
+ }
122813
122930
  if (buildInfo.version !== ts.version)
122814
122931
  return undefined;
122815
122932
  if (!buildInfo.program)
122816
122933
  return undefined;
122817
- return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
122934
+ return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
122818
122935
  }
122819
122936
  ts.readBuilderProgram = readBuilderProgram;
122820
122937
  function createIncrementalCompilerHost(options, system) {
@@ -122823,6 +122940,7 @@ var ts;
122823
122940
  host.createHash = ts.maybeBind(system, system.createHash);
122824
122941
  host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
122825
122942
  host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
122943
+ host.now = ts.maybeBind(system, system.now);
122826
122944
  ts.setGetSourceFileAsHashVersioned(host, system);
122827
122945
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
122828
122946
  return host;
@@ -123557,14 +123675,16 @@ var ts;
123557
123675
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
123558
123676
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
123559
123677
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
123560
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 7] = "UpstreamOutOfDate";
123561
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 8] = "UpstreamBlocked";
123562
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 9] = "ComputingUpstream";
123563
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 10] = "TsVersionOutputOfDate";
123678
+ UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
123679
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
123680
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
123681
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
123682
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
123564
123683
  /**
123565
123684
  * Projects with no outputs (i.e. "solution" files)
123566
123685
  */
123567
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 11] = "ContainerOnly";
123686
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 12] = "ContainerOnly";
123687
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 13] = "ForceBuild";
123568
123688
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
123569
123689
  function resolveConfigFileProjectName(project) {
123570
123690
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -123609,9 +123729,11 @@ var ts;
123609
123729
  function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {
123610
123730
  return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });
123611
123731
  }
123612
- function newer(date1, date2) {
123613
- return date2 > date1 ? date2 : date1;
123732
+ /*@internal*/
123733
+ function getCurrentTime(host) {
123734
+ return host.now ? host.now() : new Date();
123614
123735
  }
123736
+ ts.getCurrentTime = getCurrentTime;
123615
123737
  /*@internal*/
123616
123738
  function isCircularBuildOrder(buildOrder) {
123617
123739
  return !!buildOrder && !!buildOrder.buildOrder;
@@ -123701,6 +123823,7 @@ var ts;
123701
123823
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
123702
123824
  };
123703
123825
  }
123826
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
123704
123827
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
123705
123828
  var state = {
123706
123829
  host: host,
@@ -123717,8 +123840,9 @@ var ts;
123717
123840
  resolvedConfigFilePaths: new ts.Map(),
123718
123841
  configFileCache: new ts.Map(),
123719
123842
  projectStatus: new ts.Map(),
123720
- buildInfoChecked: new ts.Map(),
123721
123843
  extendedConfigCache: new ts.Map(),
123844
+ buildInfoCache: new ts.Map(),
123845
+ outputTimeStamps: new ts.Map(),
123722
123846
  builderPrograms: new ts.Map(),
123723
123847
  diagnostics: new ts.Map(),
123724
123848
  projectPendingBuild: new ts.Map(),
@@ -123742,6 +123866,7 @@ var ts;
123742
123866
  allWatchedConfigFiles: new ts.Map(),
123743
123867
  allWatchedExtendedConfigFiles: new ts.Map(),
123744
123868
  allWatchedPackageJsonFiles: new ts.Map(),
123869
+ filesWatched: new ts.Map(),
123745
123870
  lastCachedPackageJsonLookups: new ts.Map(),
123746
123871
  timerToBuildInvalidatedProject: undefined,
123747
123872
  reportFileChangeDetected: false,
@@ -123848,11 +123973,12 @@ var ts;
123848
123973
  // Config file cache
123849
123974
  ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
123850
123975
  ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
123851
- ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
123852
123976
  ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
123853
123977
  ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
123854
123978
  ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
123855
123979
  ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
123980
+ ts.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
123981
+ ts.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
123856
123982
  // Remove watches for the program no longer in the solution
123857
123983
  if (state.watch) {
123858
123984
  ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });
@@ -124143,21 +124269,21 @@ var ts;
124143
124269
  }
124144
124270
  function emit(writeFileCallback, cancellationToken, customTransformers) {
124145
124271
  var _a;
124146
- var _b, _c;
124272
+ var _b, _c, _d;
124147
124273
  ts.Debug.assertIsDefined(program);
124148
124274
  ts.Debug.assert(step === BuildStep.Emit);
124149
124275
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
124150
- program.backupState();
124276
+ program.backupEmitState();
124151
124277
  var declDiagnostics;
124152
124278
  var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
124153
124279
  var outputFiles = [];
124154
124280
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics,
124155
124281
  /*write*/ undefined,
124156
- /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken,
124282
+ /*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,
124157
124283
  /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
124158
124284
  // Don't emit .d.ts if there are decl file errors
124159
124285
  if (declDiagnostics) {
124160
- program.restoreState();
124286
+ program.restoreEmitState();
124161
124287
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
124162
124288
  return {
124163
124289
  emitSkipped: true,
@@ -124167,37 +124293,43 @@ var ts;
124167
124293
  // Actual Emit
124168
124294
  var host = state.host, compilerHost = state.compilerHost;
124169
124295
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124170
- var newestDeclarationFileContentChangedTime = minimumDate;
124171
- var anyDtsChanged = false;
124296
+ var existingBuildInfo = ((_d = state.buildInfoCache.get(projectPath)) === null || _d === void 0 ? void 0 : _d.buildInfo) || undefined;
124172
124297
  var emitterDiagnostics = ts.createDiagnosticCollection();
124173
124298
  var emittedOutputs = new ts.Map();
124299
+ var options = program.getCompilerOptions();
124300
+ var isIncremental = ts.isIncrementalCompilation(options);
124301
+ var outputTimeStampMap;
124302
+ var now;
124174
124303
  outputFiles.forEach(function (_a) {
124175
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124176
- var priorChangeTime;
124177
- if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
124178
- // Check for unchanged .d.ts files
124179
- if (host.fileExists(name) && state.readFileWithCache(name) === text) {
124180
- priorChangeTime = host.getModifiedTime(name);
124181
- }
124182
- else {
124304
+ var _b, _c;
124305
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124306
+ var path = toPath(state, name);
124307
+ emittedOutputs.set(toPath(state, name), name);
124308
+ if (buildInfo) {
124309
+ setBuildInfo(state, buildInfo, projectPath, options);
124310
+ 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)) {
124183
124311
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124184
- anyDtsChanged = true;
124185
124312
  }
124186
124313
  }
124187
- emittedOutputs.set(toPath(state, name), name);
124188
124314
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124189
- if (priorChangeTime !== undefined) {
124190
- newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
124315
+ if (!isIncremental && state.watch) {
124316
+ (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
124191
124317
  }
124192
124318
  });
124193
- finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime,
124194
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124319
+ finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
124195
124320
  return emitResult;
124196
124321
  }
124197
124322
  function emitBuildInfo(writeFileCallback, cancellationToken) {
124198
124323
  ts.Debug.assertIsDefined(program);
124199
124324
  ts.Debug.assert(step === BuildStep.EmitBuildInfo);
124200
- var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);
124325
+ var emitResult = program.emitBuildInfo(function (name, text, writeByteOrderMark, onError, sourceFiles, data) {
124326
+ if (data === null || data === void 0 ? void 0 : data.buildInfo)
124327
+ setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions());
124328
+ if (writeFileCallback)
124329
+ writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
124330
+ else
124331
+ state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
124332
+ }, cancellationToken);
124201
124333
  if (emitResult.diagnostics.length) {
124202
124334
  reportErrors(state, emitResult.diagnostics);
124203
124335
  state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true));
@@ -124210,7 +124342,7 @@ var ts;
124210
124342
  step = BuildStep.QueueReferencingProjects;
124211
124343
  return emitResult;
124212
124344
  }
124213
- function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {
124345
+ function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
124214
124346
  var _a;
124215
124347
  var emitDiagnostics = emitterDiagnostics.getDiagnostics();
124216
124348
  if (emitDiagnostics.length) {
@@ -124221,13 +124353,11 @@ var ts;
124221
124353
  emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });
124222
124354
  }
124223
124355
  // Update time stamps for rest of the outputs
124224
- var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124356
+ updateOutputTimestampsWorker(state, config, projectPath, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
124225
124357
  state.diagnostics.delete(projectPath);
124226
124358
  state.projectStatus.set(projectPath, {
124227
124359
  type: ts.UpToDateStatusType.UpToDate,
124228
- newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?
124229
- maximumDate :
124230
- newestDeclarationFileContentChangedTime,
124360
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath),
124231
124361
  oldestOutputFileName: oldestOutputFileName
124232
124362
  });
124233
124363
  afterProgramDone(state, program, config);
@@ -124262,13 +124392,21 @@ var ts;
124262
124392
  ts.Debug.assert(!!outputFiles.length);
124263
124393
  var emitterDiagnostics = ts.createDiagnosticCollection();
124264
124394
  var emittedOutputs = new ts.Map();
124395
+ var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
124396
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
124265
124397
  outputFiles.forEach(function (_a) {
124266
- var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124398
+ var _b, _c;
124399
+ var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
124267
124400
  emittedOutputs.set(toPath(state, name), name);
124401
+ if (buildInfo) {
124402
+ setBuildInfo(state, buildInfo, projectPath, config.options);
124403
+ if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.dtsChangeTime) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime)) {
124404
+ resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
124405
+ }
124406
+ }
124268
124407
  ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124269
124408
  });
124270
- var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124271
- /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
124409
+ var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags);
124272
124410
  return { emitSkipped: false, diagnostics: emitDiagnostics };
124273
124411
  }
124274
124412
  function executeSteps(till, cancellationToken, writeFile, customTransformers) {
@@ -124430,7 +124568,7 @@ var ts;
124430
124568
  state.projectCompilerOptions = state.baseCompilerOptions;
124431
124569
  }
124432
124570
  function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
124433
- var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
124571
+ var canEmitBuildInfo = program && !ts.outFile(program.getCompilerOptions());
124434
124572
  reportAndStoreErrors(state, resolvedPath, diagnostics);
124435
124573
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
124436
124574
  if (canEmitBuildInfo)
@@ -124438,9 +124576,95 @@ var ts;
124438
124576
  afterProgramDone(state, program, config);
124439
124577
  return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };
124440
124578
  }
124579
+ function isFileWatcherWithModifiedTime(value) {
124580
+ return !!value.watcher;
124581
+ }
124582
+ function getModifiedTime(state, fileName) {
124583
+ var path = toPath(state, fileName);
124584
+ var existing = state.filesWatched.get(path);
124585
+ if (state.watch && !!existing) {
124586
+ if (!isFileWatcherWithModifiedTime(existing))
124587
+ return existing;
124588
+ if (existing.modifiedTime)
124589
+ return existing.modifiedTime;
124590
+ }
124591
+ var result = ts.getModifiedTime(state.host, fileName);
124592
+ if (state.watch) {
124593
+ if (existing)
124594
+ existing.modifiedTime = result;
124595
+ else
124596
+ state.filesWatched.set(path, result);
124597
+ }
124598
+ return result;
124599
+ }
124600
+ function watchFile(state, file, callback, pollingInterval, options, watchType, project) {
124601
+ var path = toPath(state, file);
124602
+ var existing = state.filesWatched.get(path);
124603
+ if (existing && isFileWatcherWithModifiedTime(existing)) {
124604
+ existing.callbacks.push(callback);
124605
+ }
124606
+ else {
124607
+ var watcher = state.watchFile(file, function (fileName, eventKind, modifiedTime) {
124608
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
124609
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
124610
+ existing.modifiedTime = modifiedTime;
124611
+ existing.callbacks.forEach(function (cb) { return cb(fileName, eventKind, modifiedTime); });
124612
+ }, pollingInterval, options, watchType, project);
124613
+ state.filesWatched.set(path, { callbacks: [callback], watcher: watcher, modifiedTime: existing });
124614
+ }
124615
+ return {
124616
+ close: function () {
124617
+ var existing = ts.Debug.checkDefined(state.filesWatched.get(path));
124618
+ ts.Debug.assert(isFileWatcherWithModifiedTime(existing));
124619
+ if (existing.callbacks.length === 1) {
124620
+ state.filesWatched.delete(path);
124621
+ ts.closeFileWatcherOf(existing);
124622
+ }
124623
+ else {
124624
+ ts.unorderedRemoveItem(existing.callbacks, callback);
124625
+ }
124626
+ }
124627
+ };
124628
+ }
124629
+ function getOutputTimeStampMap(state, resolvedConfigFilePath) {
124630
+ if (!state.watch)
124631
+ return undefined;
124632
+ var result = state.outputTimeStamps.get(resolvedConfigFilePath);
124633
+ if (!result)
124634
+ state.outputTimeStamps.set(resolvedConfigFilePath, result = new ts.Map());
124635
+ return result;
124636
+ }
124637
+ function setBuildInfo(state, buildInfo, resolvedConfigPath, options) {
124638
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
124639
+ var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
124640
+ if (existing) {
124641
+ existing.buildInfo = buildInfo;
124642
+ existing.modifiedTime = getCurrentTime(state.host);
124643
+ }
124644
+ else {
124645
+ state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo: buildInfo, modifiedTime: getCurrentTime(state.host) });
124646
+ }
124647
+ }
124648
+ function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
124649
+ var path = toPath(state, buildInfoPath);
124650
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
124651
+ return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
124652
+ }
124653
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
124654
+ var path = toPath(state, buildInfoPath);
124655
+ var existing = state.buildInfoCache.get(resolvedConfigPath);
124656
+ if (existing !== undefined && existing.path === path) {
124657
+ return existing.buildInfo || undefined;
124658
+ }
124659
+ var value = state.readFileWithCache(buildInfoPath);
124660
+ var buildInfo = value ? ts.getBuildInfo(value) : undefined;
124661
+ ts.Debug.assert(modifiedTime || !buildInfo);
124662
+ state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
124663
+ return buildInfo;
124664
+ }
124441
124665
  function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
124442
124666
  // Check tsconfig time
124443
- var tsconfigTime = ts.getModifiedTime(state.host, configFile);
124667
+ var tsconfigTime = getModifiedTime(state, configFile);
124444
124668
  if (oldestOutputFileTime < tsconfigTime) {
124445
124669
  return {
124446
124670
  type: ts.UpToDateStatusType.OutOfDateWithSelf,
@@ -124450,88 +124674,24 @@ var ts;
124450
124674
  }
124451
124675
  }
124452
124676
  function getUpToDateStatusWorker(state, project, resolvedPath) {
124453
- var force = !!state.options.force;
124454
- var newestInputFileName = undefined;
124455
- var newestInputFileTime = minimumDate;
124456
- var host = state.host;
124457
- // Get timestamps of input files
124458
- for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {
124459
- var inputFile = _a[_i];
124460
- if (!host.fileExists(inputFile)) {
124461
- return {
124462
- type: ts.UpToDateStatusType.Unbuildable,
124463
- reason: inputFile + " does not exist"
124464
- };
124465
- }
124466
- if (!force) {
124467
- var inputTime = ts.getModifiedTime(host, inputFile);
124468
- if (inputTime > newestInputFileTime) {
124469
- newestInputFileName = inputFile;
124470
- newestInputFileTime = inputTime;
124471
- }
124472
- }
124473
- }
124677
+ var _a, _b, _c;
124474
124678
  // Container if no files are specified in the project
124475
124679
  if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {
124476
124680
  return {
124477
124681
  type: ts.UpToDateStatusType.ContainerOnly
124478
124682
  };
124479
124683
  }
124480
- // Collect the expected outputs of this project
124481
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
124482
- // Now see if all outputs are newer than the newest input
124483
- var oldestOutputFileName = "(none)";
124484
- var oldestOutputFileTime = maximumDate;
124485
- var newestOutputFileName = "(none)";
124486
- var newestOutputFileTime = minimumDate;
124487
- var missingOutputFileName;
124488
- var newestDeclarationFileContentChangedTime = minimumDate;
124489
- var isOutOfDateWithInputs = false;
124490
- if (!force) {
124491
- for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {
124492
- var output = outputs_1[_b];
124493
- // Output is missing; can stop checking
124494
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
124495
- if (!host.fileExists(output)) {
124496
- missingOutputFileName = output;
124497
- break;
124498
- }
124499
- var outputTime = ts.getModifiedTime(host, output);
124500
- if (outputTime < oldestOutputFileTime) {
124501
- oldestOutputFileTime = outputTime;
124502
- oldestOutputFileName = output;
124503
- }
124504
- // If an output is older than the newest input, we can stop checking
124505
- // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status
124506
- if (outputTime < newestInputFileTime) {
124507
- isOutOfDateWithInputs = true;
124508
- break;
124509
- }
124510
- if (outputTime > newestOutputFileTime) {
124511
- newestOutputFileTime = outputTime;
124512
- newestOutputFileName = output;
124513
- }
124514
- // Keep track of when the most recent time a .d.ts file was changed.
124515
- // In addition to file timestamps, we also keep track of when a .d.ts file
124516
- // had its file touched but not had its contents changed - this allows us
124517
- // to skip a downstream typecheck
124518
- if (ts.isDeclarationFileName(output)) {
124519
- var outputModifiedTime = ts.getModifiedTime(host, output);
124520
- newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
124521
- }
124522
- }
124523
- }
124524
- var pseudoUpToDate = false;
124525
- var usesPrepend = false;
124526
- var upstreamChangedProject;
124684
+ // Fast check to see if reference projects are buildable
124685
+ var referenceStatuses;
124686
+ var force = !!state.options.force;
124527
124687
  if (project.projectReferences) {
124528
124688
  state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });
124529
- for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
124530
- var ref = _d[_c];
124531
- usesPrepend = usesPrepend || !!(ref.prepend);
124689
+ for (var _i = 0, _d = project.projectReferences; _i < _d.length; _i++) {
124690
+ var ref = _d[_i];
124532
124691
  var resolvedRef = ts.resolveProjectReferencePath(ref);
124533
124692
  var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
124534
- var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);
124693
+ var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
124694
+ var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
124535
124695
  // Its a circular reference ignore the status of this project
124536
124696
  if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||
124537
124697
  refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project
@@ -124553,75 +124713,170 @@ var ts;
124553
124713
  upstreamProjectName: ref.path
124554
124714
  };
124555
124715
  }
124556
- // Check oldest output file name only if there is no missing output file name
124557
- // (a check we will have skipped if this is a forced build)
124558
- if (!force && !missingOutputFileName) {
124559
- // If the upstream project's newest file is older than our oldest output, we
124560
- // can't be out of date because of it
124561
- if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
124562
- continue;
124563
- }
124564
- // If the upstream project has only change .d.ts files, and we've built
124565
- // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
124566
- if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
124567
- pseudoUpToDate = true;
124568
- upstreamChangedProject = ref.path;
124569
- continue;
124570
- }
124571
- // We have an output older than an upstream output - we are out of date
124572
- ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
124716
+ if (!force)
124717
+ (referenceStatuses || (referenceStatuses = [])).push({ ref: ref, refStatus: refStatus, resolvedRefPath: resolvedRefPath, resolvedConfig: resolvedConfig });
124718
+ }
124719
+ }
124720
+ if (force)
124721
+ return { type: ts.UpToDateStatusType.ForceBuild };
124722
+ // Check buildinfo first
124723
+ var host = state.host;
124724
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
124725
+ var oldestOutputFileName = "(none)";
124726
+ var oldestOutputFileTime = maximumDate;
124727
+ var buildInfoTime;
124728
+ var newestDeclarationFileContentChangedTime;
124729
+ if (buildInfoPath) {
124730
+ var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
124731
+ buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts.getModifiedTime(host, buildInfoPath);
124732
+ if (buildInfoTime === ts.missingFileModifiedTime) {
124733
+ if (!buildInfoCacheEntry_1) {
124734
+ state.buildInfoCache.set(resolvedPath, {
124735
+ path: toPath(state, buildInfoPath),
124736
+ buildInfo: false,
124737
+ modifiedTime: buildInfoTime
124738
+ });
124739
+ }
124740
+ return {
124741
+ type: ts.UpToDateStatusType.OutputMissing,
124742
+ missingOutputFileName: buildInfoPath
124743
+ };
124744
+ }
124745
+ var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
124746
+ if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
124747
+ return {
124748
+ type: ts.UpToDateStatusType.TsVersionOutputOfDate,
124749
+ version: buildInfo.version
124750
+ };
124751
+ }
124752
+ if (buildInfo.program) {
124753
+ if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
124754
+ (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
124573
124755
  return {
124574
- type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124575
- outOfDateOutputFileName: oldestOutputFileName,
124576
- newerProjectName: ref.path
124756
+ type: ts.UpToDateStatusType.OutOfDateBuildInfo,
124757
+ buildInfoFile: buildInfoPath
124577
124758
  };
124578
124759
  }
124579
124760
  }
124761
+ oldestOutputFileTime = buildInfoTime;
124762
+ oldestOutputFileName = buildInfoPath;
124763
+ newestDeclarationFileContentChangedTime = ((_c = buildInfo.program) === null || _c === void 0 ? void 0 : _c.dtsChangeTime) ? new Date(buildInfo.program.dtsChangeTime) : undefined;
124580
124764
  }
124581
- if (missingOutputFileName !== undefined) {
124582
- return {
124583
- type: ts.UpToDateStatusType.OutputMissing,
124584
- missingOutputFileName: missingOutputFileName
124585
- };
124765
+ // Check input files
124766
+ var newestInputFileName = undefined;
124767
+ var newestInputFileTime = minimumDate;
124768
+ // Get timestamps of input files
124769
+ for (var _e = 0, _f = project.fileNames; _e < _f.length; _e++) {
124770
+ var inputFile = _f[_e];
124771
+ var inputTime = getModifiedTime(state, inputFile);
124772
+ if (inputTime === ts.missingFileModifiedTime) {
124773
+ return {
124774
+ type: ts.UpToDateStatusType.Unbuildable,
124775
+ reason: inputFile + " does not exist"
124776
+ };
124777
+ }
124778
+ // If an buildInfo is older than the newest input, we can stop checking
124779
+ if (buildInfoTime && buildInfoTime < inputTime) {
124780
+ return {
124781
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
124782
+ outOfDateOutputFileName: buildInfoPath,
124783
+ newerInputFileName: inputFile
124784
+ };
124785
+ }
124786
+ if (inputTime > newestInputFileTime) {
124787
+ newestInputFileName = inputFile;
124788
+ newestInputFileTime = inputTime;
124789
+ }
124586
124790
  }
124587
- if (isOutOfDateWithInputs) {
124588
- return {
124589
- type: ts.UpToDateStatusType.OutOfDateWithSelf,
124590
- outOfDateOutputFileName: oldestOutputFileName,
124591
- newerInputFileName: newestInputFileName
124592
- };
124791
+ // Now see if all outputs are newer than the newest input
124792
+ // Dont check output timestamps if we have buildinfo telling us output is uptodate
124793
+ if (!buildInfoPath) {
124794
+ // Collect the expected outputs of this project
124795
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
124796
+ var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
124797
+ for (var _g = 0, outputs_1 = outputs; _g < outputs_1.length; _g++) {
124798
+ var output = outputs_1[_g];
124799
+ var path = toPath(state, output);
124800
+ // Output is missing; can stop checking
124801
+ var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path);
124802
+ if (!outputTime) {
124803
+ outputTime = ts.getModifiedTime(state.host, output);
124804
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path, outputTime);
124805
+ }
124806
+ if (outputTime === ts.missingFileModifiedTime) {
124807
+ return {
124808
+ type: ts.UpToDateStatusType.OutputMissing,
124809
+ missingOutputFileName: output
124810
+ };
124811
+ }
124812
+ if (outputTime < oldestOutputFileTime) {
124813
+ oldestOutputFileTime = outputTime;
124814
+ oldestOutputFileName = output;
124815
+ }
124816
+ // If an output is older than the newest input, we can stop checking
124817
+ if (outputTime < newestInputFileTime) {
124818
+ return {
124819
+ type: ts.UpToDateStatusType.OutOfDateWithSelf,
124820
+ outOfDateOutputFileName: oldestOutputFileName,
124821
+ newerInputFileName: newestInputFileName
124822
+ };
124823
+ }
124824
+ }
124593
124825
  }
124594
- else {
124595
- // Check tsconfig time
124596
- var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
124597
- if (configStatus)
124598
- return configStatus;
124599
- // Check extended config time
124600
- var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
124601
- if (extendedConfigStatus)
124602
- return extendedConfigStatus;
124603
- // Check package file time
124604
- var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
124605
- var path = _a[0];
124606
- return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
124607
- });
124608
- if (dependentPackageFileStatus)
124609
- return dependentPackageFileStatus;
124610
- }
124611
- if (!force && !state.buildInfoChecked.has(resolvedPath)) {
124612
- state.buildInfoChecked.set(resolvedPath, true);
124613
- var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
124614
- if (buildInfoPath) {
124615
- var value = state.readFileWithCache(buildInfoPath);
124616
- var buildInfo = value && ts.getBuildInfo(value);
124617
- if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
124826
+ var seenRefs = buildInfoPath ? new ts.Set() : undefined;
124827
+ var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
124828
+ seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
124829
+ var pseudoUpToDate = false;
124830
+ var usesPrepend = false;
124831
+ var upstreamChangedProject;
124832
+ if (referenceStatuses) {
124833
+ for (var _h = 0, referenceStatuses_1 = referenceStatuses; _h < referenceStatuses_1.length; _h++) {
124834
+ var _j = referenceStatuses_1[_h], ref = _j.ref, refStatus = _j.refStatus, resolvedConfig = _j.resolvedConfig, resolvedRefPath = _j.resolvedRefPath;
124835
+ usesPrepend = usesPrepend || !!(ref.prepend);
124836
+ // If the upstream project's newest file is older than our oldest output, we
124837
+ // can't be out of date because of it
124838
+ if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
124839
+ continue;
124840
+ }
124841
+ // Check if tsbuildinfo path is shared, then we need to rebuild
124842
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
124618
124843
  return {
124619
- type: ts.UpToDateStatusType.TsVersionOutputOfDate,
124620
- version: buildInfo.version
124844
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124845
+ outOfDateOutputFileName: buildInfoPath,
124846
+ newerProjectName: ref.path
124621
124847
  };
124622
124848
  }
124849
+ // If the upstream project has only change .d.ts files, and we've built
124850
+ // *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
124851
+ if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
124852
+ pseudoUpToDate = true;
124853
+ upstreamChangedProject = ref.path;
124854
+ continue;
124855
+ }
124856
+ // We have an output older than an upstream output - we are out of date
124857
+ ts.Debug.assert(oldestOutputFileName !== undefined, "Should have an oldest output filename here");
124858
+ return {
124859
+ type: ts.UpToDateStatusType.OutOfDateWithUpstream,
124860
+ outOfDateOutputFileName: oldestOutputFileName,
124861
+ newerProjectName: ref.path
124862
+ };
124623
124863
  }
124624
124864
  }
124865
+ // Check tsconfig time
124866
+ var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);
124867
+ if (configStatus)
124868
+ return configStatus;
124869
+ // Check extended config time
124870
+ var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });
124871
+ if (extendedConfigStatus)
124872
+ return extendedConfigStatus;
124873
+ // Check package file time
124874
+ var dependentPackageFileStatus = ts.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts.emptyArray, function (_a) {
124875
+ var path = _a[0];
124876
+ return checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName);
124877
+ });
124878
+ if (dependentPackageFileStatus)
124879
+ return dependentPackageFileStatus;
124625
124880
  if (usesPrepend && pseudoUpToDate) {
124626
124881
  return {
124627
124882
  type: ts.UpToDateStatusType.OutOfDateWithPrepend,
@@ -124634,12 +124889,30 @@ var ts;
124634
124889
  type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,
124635
124890
  newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,
124636
124891
  newestInputFileTime: newestInputFileTime,
124637
- newestOutputFileTime: newestOutputFileTime,
124638
124892
  newestInputFileName: newestInputFileName,
124639
- newestOutputFileName: newestOutputFileName,
124640
124893
  oldestOutputFileName: oldestOutputFileName
124641
124894
  };
124642
124895
  }
124896
+ function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
124897
+ if (seenRefs.has(resolvedRefPath))
124898
+ return false;
124899
+ seenRefs.add(resolvedRefPath);
124900
+ var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
124901
+ if (refBuildInfo.path === buildInfoCacheEntry.path)
124902
+ return true;
124903
+ if (resolvedConfig.projectReferences) {
124904
+ // Check references
124905
+ for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
124906
+ var ref = _a[_i];
124907
+ var resolvedRef = ts.resolveProjectReferencePath(ref);
124908
+ var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
124909
+ var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
124910
+ if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
124911
+ return true;
124912
+ }
124913
+ }
124914
+ return false;
124915
+ }
124643
124916
  function getUpToDateStatus(state, project, resolvedPath) {
124644
124917
  if (project === undefined) {
124645
124918
  return { type: ts.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" };
@@ -124652,39 +124925,65 @@ var ts;
124652
124925
  state.projectStatus.set(resolvedPath, actual);
124653
124926
  return actual;
124654
124927
  }
124655
- function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
124928
+ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) {
124656
124929
  if (proj.options.noEmit)
124657
- return priorNewestUpdateTime;
124930
+ return;
124931
+ var now;
124932
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(proj.options);
124933
+ if (buildInfoPath) {
124934
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath(state, buildInfoPath)))) {
124935
+ if (!!state.options.verbose)
124936
+ reportStatus(state, verboseMessage, proj.options.configFilePath);
124937
+ state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
124938
+ getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
124939
+ }
124940
+ state.outputTimeStamps.delete(projectPath);
124941
+ return;
124942
+ }
124658
124943
  var host = state.host;
124659
124944
  var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
124945
+ var outputTimeStampMap = getOutputTimeStampMap(state, projectPath);
124946
+ var modifiedOutputs = outputTimeStampMap ? new ts.Set() : undefined;
124660
124947
  if (!skipOutputs || outputs.length !== skipOutputs.size) {
124661
124948
  var reportVerbose = !!state.options.verbose;
124662
- var now = host.now ? host.now() : new Date();
124663
124949
  for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {
124664
124950
  var file = outputs_2[_i];
124665
- if (skipOutputs && skipOutputs.has(toPath(state, file))) {
124951
+ var path = toPath(state, file);
124952
+ if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path))
124666
124953
  continue;
124667
- }
124668
124954
  if (reportVerbose) {
124669
124955
  reportVerbose = false;
124670
124956
  reportStatus(state, verboseMessage, proj.options.configFilePath);
124671
124957
  }
124672
- if (ts.isDeclarationFileName(file)) {
124673
- priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
124958
+ host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
124959
+ if (outputTimeStampMap) {
124960
+ outputTimeStampMap.set(path, now);
124961
+ modifiedOutputs.add(path);
124674
124962
  }
124675
- host.setModifiedTime(file, now);
124676
124963
  }
124677
124964
  }
124678
- return priorNewestUpdateTime;
124965
+ // Clear out timestamps not in output list any more
124966
+ outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.forEach(function (_value, key) {
124967
+ if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key))
124968
+ outputTimeStampMap.delete(key);
124969
+ });
124970
+ }
124971
+ function getDtsChangeTime(state, options, resolvedConfigPath) {
124972
+ var _a;
124973
+ if (!options.composite)
124974
+ return undefined;
124975
+ var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(options);
124976
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
124977
+ 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;
124679
124978
  }
124680
124979
  function updateOutputTimestamps(state, proj, resolvedPath) {
124681
124980
  if (state.options.dry) {
124682
124981
  return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);
124683
124982
  }
124684
- var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);
124983
+ updateOutputTimestampsWorker(state, proj, resolvedPath, ts.Diagnostics.Updating_output_timestamps_of_project_0);
124685
124984
  state.projectStatus.set(resolvedPath, {
124686
124985
  type: ts.UpToDateStatusType.UpToDate,
124687
- newestDeclarationFileContentChangedTime: priorNewestUpdateTime,
124986
+ newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
124688
124987
  oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
124689
124988
  });
124690
124989
  }
@@ -124877,12 +125176,10 @@ var ts;
124877
125176
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
124878
125177
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
124879
125178
  return;
124880
- state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {
124881
- invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);
124882
- }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));
125179
+ 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));
124883
125180
  }
124884
125181
  function watchExtendedConfigFiles(state, resolvedPath, parsed) {
124885
- ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {
125182
+ ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(state, extendedConfigFileName, function () {
124886
125183
  var _a;
124887
125184
  return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {
124888
125185
  return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);
@@ -124914,7 +125211,7 @@ var ts;
124914
125211
  if (!state.watch)
124915
125212
  return;
124916
125213
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {
124917
- 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); },
125214
+ 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); },
124918
125215
  onDeleteValue: ts.closeFileWatcher,
124919
125216
  });
124920
125217
  }
@@ -124922,7 +125219,7 @@ var ts;
124922
125219
  if (!state.watch || !state.lastCachedPackageJsonLookups)
124923
125220
  return;
124924
125221
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
124925
- 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); },
125222
+ 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); },
124926
125223
  onDeleteValue: ts.closeFileWatcher,
124927
125224
  });
124928
125225
  }
@@ -125054,19 +125351,18 @@ var ts;
125054
125351
  }
125055
125352
  }
125056
125353
  function reportUpToDateStatus(state, configFileName, status) {
125057
- if (state.options.force && (status.type === ts.UpToDateStatusType.UpToDate || status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes)) {
125058
- return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125059
- }
125060
125354
  switch (status.type) {
125061
125355
  case ts.UpToDateStatusType.OutOfDateWithSelf:
125062
- 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));
125356
+ 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));
125063
125357
  case ts.UpToDateStatusType.OutOfDateWithUpstream:
125064
- 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));
125358
+ 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));
125065
125359
  case ts.UpToDateStatusType.OutputMissing:
125066
125360
  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));
125361
+ case ts.UpToDateStatusType.OutOfDateBuildInfo:
125362
+ 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));
125067
125363
  case ts.UpToDateStatusType.UpToDate:
125068
125364
  if (status.newestInputFileTime !== undefined) {
125069
- 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 || ""));
125365
+ 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 || ""));
125070
125366
  }
125071
125367
  // Don't report anything for "up to date because it was already built" -- too verbose
125072
125368
  break;
@@ -125084,6 +125380,8 @@ var ts;
125084
125380
  return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);
125085
125381
  case ts.UpToDateStatusType.TsVersionOutputOfDate:
125086
125382
  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);
125383
+ case ts.UpToDateStatusType.ForceBuild:
125384
+ return reportStatus(state, ts.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName));
125087
125385
  case ts.UpToDateStatusType.ContainerOnly:
125088
125386
  // Don't report status on "solution" projects
125089
125387
  // falls through