@typescript-deploys/pr-build 4.9.0-pr-50293-2 → 4.9.0-pr-50306-2

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.
@@ -108,7 +108,7 @@ var ts;
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = ts.versionMajorMinor + ".0-insiders.20220813";
111
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220815";
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -7029,7 +7029,6 @@ var ts;
7029
7029
  // not actually work.
7030
7030
  var byteOrderMarkIndicator = "\uFEFF";
7031
7031
  function getNodeSystem() {
7032
- var _a;
7033
7032
  var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
7034
7033
  var _fs = require("fs");
7035
7034
  var _path = require("path");
@@ -7039,7 +7038,7 @@ var ts;
7039
7038
  try {
7040
7039
  _crypto = require("crypto");
7041
7040
  }
7042
- catch (_b) {
7041
+ catch (_a) {
7043
7042
  _crypto = undefined;
7044
7043
  }
7045
7044
  var activeSession;
@@ -7050,10 +7049,10 @@ var ts;
7050
7049
  var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
7051
7050
  var platform = _os.platform();
7052
7051
  var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
7053
- var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
7052
+ var fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
7054
7053
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
7055
7054
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
7056
- var _c = createSystemWatchFunctions({
7055
+ var _b = createSystemWatchFunctions({
7057
7056
  pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
7058
7057
  getModifiedTime: getModifiedTime,
7059
7058
  setTimeout: setTimeout,
@@ -7073,7 +7072,7 @@ var ts;
7073
7072
  defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
7074
7073
  inodeWatching: isLinuxOrMacOs,
7075
7074
  sysLog: sysLog,
7076
- }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
7075
+ }), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory;
7077
7076
  var nodeSystem = {
7078
7077
  args: process.argv.slice(2),
7079
7078
  newLine: _os.EOL,
@@ -7466,9 +7465,12 @@ var ts;
7466
7465
  function getDirectories(path) {
7467
7466
  return getAccessibleFileSystemEntries(path).directories.slice();
7468
7467
  }
7468
+ function fsRealPathHandlingLongPath(path) {
7469
+ return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
7470
+ }
7469
7471
  function realpath(path) {
7470
7472
  try {
7471
- return realpathSync(path);
7473
+ return fsRealpath(path);
7472
7474
  }
7473
7475
  catch (_a) {
7474
7476
  return path;
@@ -27759,12 +27761,10 @@ var ts;
27759
27761
  node.helpers = ts.map(bundleFileInfo.sources && bundleFileInfo.sources.helpers, function (name) { return ts.getAllUnscopedEmitHelpers().get(name); });
27760
27762
  return node;
27761
27763
  }
27762
- function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPathOrHost, declarationPathOrOptions, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {
27764
+ function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {
27763
27765
  var node = ts.parseNodeFactory.createInputFiles();
27764
27766
  if (!ts.isString(javascriptTextOrReadFileText)) {
27765
27767
  var cache_1 = new ts.Map();
27766
- var host_1 = javascriptPathOrHost;
27767
- var options_1 = declarationPathOrOptions;
27768
27768
  var textGetter_1 = function (path) {
27769
27769
  if (path === undefined)
27770
27770
  return undefined;
@@ -27780,18 +27780,11 @@ var ts;
27780
27780
  return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
27781
27781
  };
27782
27782
  var buildInfo_1;
27783
- var getAndCacheBuildInfo = function () {
27784
- var _a, _b, _c;
27785
- if (buildInfo_1 === undefined && declarationMapTextOrBuildInfoPath) {
27786
- if (host_1 === null || host_1 === void 0 ? void 0 : host_1.getBuildInfo) {
27787
- buildInfo_1 = (_a = host_1.getBuildInfo(declarationMapTextOrBuildInfoPath, options_1)) !== null && _a !== void 0 ? _a : false;
27788
- }
27789
- else {
27790
- var result = textGetter_1(declarationMapTextOrBuildInfoPath);
27791
- if (result)
27792
- (_b = host_1 === null || host_1 === void 0 ? void 0 : host_1.buildInfoCallbacks) === null || _b === void 0 ? void 0 : _b.onRead(result.length, options_1);
27793
- buildInfo_1 = result !== undefined ? (_c = ts.getBuildInfo(declarationMapTextOrBuildInfoPath, result)) !== null && _c !== void 0 ? _c : false : false;
27794
- }
27783
+ var getAndCacheBuildInfo_1 = function (getText) {
27784
+ var _a;
27785
+ if (buildInfo_1 === undefined) {
27786
+ var result = getText();
27787
+ buildInfo_1 = result !== undefined ? (_a = ts.getBuildInfo(node.buildInfoPath, result)) !== null && _a !== void 0 ? _a : false : false;
27795
27788
  }
27796
27789
  return buildInfo_1 || undefined;
27797
27790
  };
@@ -27805,7 +27798,7 @@ var ts;
27805
27798
  javascriptMapText: { get: function () { return textGetter_1(javascriptMapPath); } },
27806
27799
  declarationText: { get: function () { return definedTextGetter_1(ts.Debug.checkDefined(javascriptMapTextOrDeclarationPath)); } },
27807
27800
  declarationMapText: { get: function () { return textGetter_1(declarationMapPath); } },
27808
- buildInfo: { get: getAndCacheBuildInfo },
27801
+ buildInfo: { get: function () { return getAndCacheBuildInfo_1(function () { return textGetter_1(declarationMapTextOrBuildInfoPath); }); } }
27809
27802
  });
27810
27803
  }
27811
27804
  else {
@@ -27815,8 +27808,8 @@ var ts;
27815
27808
  node.declarationText = declarationTextOrJavascriptPath;
27816
27809
  node.declarationMapPath = declarationMapPath;
27817
27810
  node.declarationMapText = declarationMapTextOrBuildInfoPath;
27818
- node.javascriptPath = javascriptPathOrHost;
27819
- node.declarationPath = declarationPathOrOptions;
27811
+ node.javascriptPath = javascriptPath;
27812
+ node.declarationPath = declarationPath;
27820
27813
  node.buildInfoPath = buildInfoPath;
27821
27814
  node.buildInfo = buildInfo;
27822
27815
  node.oldFileOfCurrentEmit = oldFileOfCurrentEmit;
@@ -41833,8 +41826,8 @@ var ts;
41833
41826
  entries.push({ value: "" });
41834
41827
  }
41835
41828
  entries.push({ value: "/* " + category + " */" });
41836
- for (var _i = 0, options_2 = options; _i < options_2.length; _i++) {
41837
- var option = options_2[_i];
41829
+ for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
41830
+ var option = options_1[_i];
41838
41831
  var optionName = void 0;
41839
41832
  if (compilerOptionsMap.has(option.name)) {
41840
41833
  optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
@@ -86890,9 +86883,9 @@ var ts;
86890
86883
  var paramTag = node.parent.parent;
86891
86884
  if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {
86892
86885
  // Else we will add a diagnostic, see `checkJSDocVariadicType`.
86893
- var host_2 = ts.getHostSignatureFromJSDoc(paramTag);
86886
+ var host_1 = ts.getHostSignatureFromJSDoc(paramTag);
86894
86887
  var isCallbackTag = ts.isJSDocCallbackTag(paramTag.parent.parent);
86895
- if (host_2 || isCallbackTag) {
86888
+ if (host_1 || isCallbackTag) {
86896
86889
  /*
86897
86890
  Only return an array type if the corresponding parameter is marked as a rest parameter, or if there are no parameters.
86898
86891
  So in the following situation we will not create an array type:
@@ -86902,7 +86895,7 @@ var ts;
86902
86895
  */
86903
86896
  var lastParamDeclaration = isCallbackTag
86904
86897
  ? ts.lastOrUndefined(paramTag.parent.parent.typeExpression.parameters)
86905
- : ts.lastOrUndefined(host_2.parameters);
86898
+ : ts.lastOrUndefined(host_1.parameters);
86906
86899
  var symbol = ts.getParameterSymbolFromJSDoc(paramTag);
86907
86900
  if (!lastParamDeclaration ||
86908
86901
  symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) {
@@ -89687,9 +89680,9 @@ var ts;
89687
89680
  }
89688
89681
  var parent = ts.walkUpParenthesizedTypes(node.parent);
89689
89682
  if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
89690
- var host_3 = ts.getJSDocHost(parent);
89691
- if (host_3) {
89692
- parent = ts.getSingleVariableOfVariableStatement(host_3) || host_3;
89683
+ var host_2 = ts.getJSDocHost(parent);
89684
+ if (host_2) {
89685
+ parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
89693
89686
  }
89694
89687
  }
89695
89688
  switch (parent.kind) {
@@ -111693,7 +111686,6 @@ var ts;
111693
111686
  }
111694
111687
  }
111695
111688
  function emitBuildInfo(bundle, buildInfoPath) {
111696
- var _a;
111697
111689
  // Write build information if applicable
111698
111690
  if (!buildInfoPath || targetSourceFile || emitSkipped)
111699
111691
  return;
@@ -111704,10 +111696,8 @@ var ts;
111704
111696
  }
111705
111697
  var version = ts.version; // Extracted into a const so the form is stable between namespace and module
111706
111698
  var buildInfo = { bundle: bundle, program: program, version: version };
111707
- var buildInfoText = getBuildInfoText(buildInfo);
111708
- (_a = host.buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onWrite(buildInfoText.length);
111709
111699
  // Pass buildinfo as additional data to avoid having to reparse
111710
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, buildInfoText, /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
111700
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), /*writeByteOrderMark*/ false, /*sourceFiles*/ undefined, { buildInfo: buildInfo });
111711
111701
  }
111712
111702
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
111713
111703
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -112014,20 +112004,19 @@ var ts;
112014
112004
  }
112015
112005
  /*@internal*/
112016
112006
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
112017
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit" /* Emit */, "emitUsingBuildInfo", {}, /*separateBeginAndEnd*/ true);
112018
- ts.performance.mark("beforeEmit");
112019
- var result = emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers);
112020
- ts.performance.mark("afterEmit");
112021
- ts.performance.measure("Emit", "beforeEmit", "afterEmit");
112022
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
112023
- return result;
112024
- }
112025
- ts.emitUsingBuildInfo = emitUsingBuildInfo;
112026
- function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers) {
112027
112007
  var createHash = ts.maybeBind(host, host.createHash);
112028
112008
  var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
112029
- // If host directly provides buildinfo we can get it directly. This allows host to cache the buildinfo
112030
- var buildInfo = host.getBuildInfo(buildInfoPath, config.options);
112009
+ var buildInfo;
112010
+ if (host.getBuildInfo) {
112011
+ // If host directly provides buildinfo we can get it directly. This allows host to cache the buildinfo
112012
+ buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
112013
+ }
112014
+ else {
112015
+ var buildInfoText = host.readFile(buildInfoPath);
112016
+ if (!buildInfoText)
112017
+ return buildInfoPath;
112018
+ buildInfo = getBuildInfo(buildInfoPath, buildInfoText);
112019
+ }
112031
112020
  if (!buildInfo)
112032
112021
  return buildInfoPath;
112033
112022
  if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
@@ -112060,7 +112049,7 @@ var ts;
112060
112049
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo,
112061
112050
  /*onlyOwnText*/ true);
112062
112051
  var outputFiles = [];
112063
- var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); }, host);
112052
+ var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
112064
112053
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
112065
112054
  var changedDtsText;
112066
112055
  var changedDtsData;
@@ -112103,8 +112092,7 @@ var ts;
112103
112092
  newBuildInfo.bundle.dts.sources = dts.sources;
112104
112093
  }
112105
112094
  newBuildInfo.bundle.sourceFiles = sourceFiles;
112106
- var newBuildInfoText = getBuildInfoText(newBuildInfo);
112107
- outputFiles.push({ name: name, text: newBuildInfoText, writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
112095
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
112108
112096
  return;
112109
112097
  case declarationFilePath:
112110
112098
  if (declarationText === text)
@@ -112130,12 +112118,12 @@ var ts;
112130
112118
  redirectTargetsMap: ts.createMultiMap(),
112131
112119
  getFileIncludeReasons: ts.notImplemented,
112132
112120
  createHash: createHash,
112133
- buildInfoCallbacks: host.buildInfoCallbacks,
112134
112121
  };
112135
112122
  emitFiles(ts.notImplementedResolver, emitHost,
112136
112123
  /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
112137
112124
  return outputFiles;
112138
112125
  }
112126
+ ts.emitUsingBuildInfo = emitUsingBuildInfo;
112139
112127
  var PipelinePhase;
112140
112128
  (function (PipelinePhase) {
112141
112129
  PipelinePhase[PipelinePhase["Notification"] = 0] = "Notification";
@@ -117250,12 +117238,15 @@ var ts;
117250
117238
  }
117251
117239
  ts.createCompilerHost = createCompilerHost;
117252
117240
  /*@internal*/
117253
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
117254
- return function (fileName, languageVersionOrOptions, onError) {
117241
+ function createCompilerHostWorker(options, setParentNodes, system) {
117242
+ if (system === void 0) { system = ts.sys; }
117243
+ var existingDirectories = new ts.Map();
117244
+ var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
117245
+ function getSourceFile(fileName, languageVersionOrOptions, onError) {
117255
117246
  var text;
117256
117247
  try {
117257
117248
  ts.performance.mark("beforeIORead");
117258
- text = readFile(fileName, getCompilerOptions().charset);
117249
+ text = compilerHost.readFile(fileName);
117259
117250
  ts.performance.mark("afterIORead");
117260
117251
  ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
117261
117252
  }
@@ -117266,18 +117257,24 @@ var ts;
117266
117257
  text = "";
117267
117258
  }
117268
117259
  return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
117269
- };
117270
- }
117271
- ts.createGetSourceFile = createGetSourceFile;
117272
- /*@internal*/
117273
- function createWriteFile(writeFile, createDirectory, directoryExists) {
117274
- return function (fileName, data, writeByteOrderMark, onError) {
117260
+ }
117261
+ function directoryExists(directoryPath) {
117262
+ if (existingDirectories.has(directoryPath)) {
117263
+ return true;
117264
+ }
117265
+ if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) {
117266
+ existingDirectories.set(directoryPath, true);
117267
+ return true;
117268
+ }
117269
+ return false;
117270
+ }
117271
+ function writeFile(fileName, data, writeByteOrderMark, onError) {
117275
117272
  try {
117276
117273
  ts.performance.mark("beforeIOWrite");
117277
117274
  // NOTE: If patchWriteFileEnsuringDirectory has been called,
117278
117275
  // the system.writeFile will do its own directory creation and
117279
117276
  // the ensureDirectoriesExist call will always be redundant.
117280
- ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, writeFile, createDirectory, directoryExists);
117277
+ 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); });
117281
117278
  ts.performance.mark("afterIOWrite");
117282
117279
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
117283
117280
  }
@@ -117286,23 +117283,6 @@ var ts;
117286
117283
  onError(e.message);
117287
117284
  }
117288
117285
  }
117289
- };
117290
- }
117291
- ts.createWriteFile = createWriteFile;
117292
- /*@internal*/
117293
- function createCompilerHostWorker(options, setParentNodes, system) {
117294
- if (system === void 0) { system = ts.sys; }
117295
- var existingDirectories = new ts.Map();
117296
- var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
117297
- function directoryExists(directoryPath) {
117298
- if (existingDirectories.has(directoryPath)) {
117299
- return true;
117300
- }
117301
- if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) {
117302
- existingDirectories.set(directoryPath, true);
117303
- return true;
117304
- }
117305
- return false;
117306
117286
  }
117307
117287
  function getDefaultLibLocation() {
117308
117288
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
@@ -117310,10 +117290,10 @@ var ts;
117310
117290
  var newLine = ts.getNewLineCharacter(options, function () { return system.newLine; });
117311
117291
  var realpath = system.realpath && (function (path) { return system.realpath(path); });
117312
117292
  var compilerHost = {
117313
- getSourceFile: createGetSourceFile(function (fileName) { return compilerHost.readFile(fileName); }, function () { return options; }, setParentNodes),
117293
+ getSourceFile: getSourceFile,
117314
117294
  getDefaultLibLocation: getDefaultLibLocation,
117315
117295
  getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
117316
- writeFile: createWriteFile(function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); }),
117296
+ writeFile: writeFile,
117317
117297
  getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }),
117318
117298
  useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; },
117319
117299
  getCanonicalFileName: getCanonicalFileName,
@@ -118924,7 +118904,6 @@ var ts;
118924
118904
  redirectTargetsMap: redirectTargetsMap,
118925
118905
  getFileIncludeReasons: program.getFileIncludeReasons,
118926
118906
  createHash: ts.maybeBind(host, host.createHash),
118927
- buildInfoCallbacks: host.buildInfoCallbacks,
118928
118907
  };
118929
118908
  }
118930
118909
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -118955,7 +118934,7 @@ var ts;
118955
118934
  var path = toPath(fileName);
118956
118935
  var sourceFile = getSourceFileByPath(path);
118957
118936
  return sourceFile ? sourceFile.text : filesByName.has(path) ? undefined : host.readFile(path);
118958
- }, host);
118937
+ });
118959
118938
  }
118960
118939
  function isSourceFileFromExternalLibrary(file) {
118961
118940
  return !!sourceFilesFoundSearchingNodeModules.get(file.path);
@@ -120938,7 +120917,7 @@ var ts;
120938
120917
  }
120939
120918
  ts.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike;
120940
120919
  /* @internal */
120941
- function createPrependNodes(projectReferences, getCommandLine, readFile, host) {
120920
+ function createPrependNodes(projectReferences, getCommandLine, readFile) {
120942
120921
  if (!projectReferences)
120943
120922
  return ts.emptyArray;
120944
120923
  var nodes;
@@ -120951,7 +120930,7 @@ var ts;
120951
120930
  if (!out)
120952
120931
  continue;
120953
120932
  var _a = ts.getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;
120954
- var node = ts.createInputFiles(readFile, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath, host, resolvedRefOpts.options);
120933
+ var node = ts.createInputFiles(readFile, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath);
120955
120934
  (nodes || (nodes = [])).push(node);
120956
120935
  }
120957
120936
  }
@@ -121768,10 +121747,10 @@ var ts;
121768
121747
  if (!state.cleanedDiagnosticsOfLibFiles) {
121769
121748
  state.cleanedDiagnosticsOfLibFiles = true;
121770
121749
  var program_1 = ts.Debug.checkDefined(state.program);
121771
- var options_3 = program_1.getCompilerOptions();
121750
+ var options_2 = program_1.getCompilerOptions();
121772
121751
  ts.forEach(program_1.getSourceFiles(), function (f) {
121773
121752
  return program_1.isSourceFileDefaultLibrary(f) &&
121774
- !ts.skipTypeChecking(f, options_3, program_1) &&
121753
+ !ts.skipTypeChecking(f, options_2, program_1) &&
121775
121754
  removeSemanticDiagnosticsOf(state, f.resolvedPath);
121776
121755
  });
121777
121756
  }
@@ -124956,11 +124935,25 @@ var ts;
124956
124935
  var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
124957
124936
  var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
124958
124937
  return {
124959
- getSourceFile: ts.createGetSourceFile(function (fileName, encoding) { return host.readFile(fileName, encoding); }, getCompilerOptions,
124960
- /*setParentNodes*/ undefined),
124938
+ getSourceFile: function (fileName, languageVersionOrOptions, onError) {
124939
+ var text;
124940
+ try {
124941
+ ts.performance.mark("beforeIORead");
124942
+ text = host.readFile(fileName, getCompilerOptions().charset);
124943
+ ts.performance.mark("afterIORead");
124944
+ ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
124945
+ }
124946
+ catch (e) {
124947
+ if (onError) {
124948
+ onError(e.message);
124949
+ }
124950
+ text = "";
124951
+ }
124952
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
124953
+ },
124961
124954
  getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
124962
124955
  getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
124963
- writeFile: ts.createWriteFile(function (path, data, writeByteOrderMark) { return host.writeFile(path, data, writeByteOrderMark); }, function (path) { return host.createDirectory(path); }, function (path) { return host.directoryExists(path); }),
124956
+ writeFile: writeFile,
124964
124957
  getCurrentDirectory: ts.memoize(function () { return host.getCurrentDirectory(); }),
124965
124958
  useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; },
124966
124959
  getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames),
@@ -124976,8 +124969,23 @@ var ts;
124976
124969
  readDirectory: ts.maybeBind(host, host.readDirectory),
124977
124970
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
124978
124971
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
124979
- buildInfoCallbacks: host.buildInfoCallbacks,
124980
124972
  };
124973
+ function writeFile(fileName, text, writeByteOrderMark, onError) {
124974
+ try {
124975
+ ts.performance.mark("beforeIOWrite");
124976
+ // NOTE: If patchWriteFileEnsuringDirectory has been called,
124977
+ // the host.writeFile will do its own directory creation and
124978
+ // the ensureDirectoriesExist call will always be redundant.
124979
+ ts.writeFileEnsuringDirectories(fileName, text, writeByteOrderMark, function (path, data, writeByteOrderMark) { return host.writeFile(path, data, writeByteOrderMark); }, function (path) { return host.createDirectory(path); }, function (path) { return host.directoryExists(path); });
124980
+ ts.performance.mark("afterIOWrite");
124981
+ ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
124982
+ }
124983
+ catch (e) {
124984
+ if (onError) {
124985
+ onError(e.message);
124986
+ }
124987
+ }
124988
+ }
124981
124989
  }
124982
124990
  ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
124983
124991
  function setGetSourceFileAsHashVersioned(compilerHost, host) {
@@ -125089,20 +125097,18 @@ var ts;
125089
125097
  var ts;
125090
125098
  (function (ts) {
125091
125099
  function readBuilderProgram(compilerOptions, host) {
125092
- var _a;
125093
125100
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
125094
125101
  if (!buildInfoPath)
125095
125102
  return undefined;
125096
125103
  var buildInfo;
125097
125104
  if (host.getBuildInfo) {
125098
125105
  // host provides buildinfo, get it from there. This allows host to cache it
125099
- buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions);
125106
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
125100
125107
  }
125101
125108
  else {
125102
125109
  var content = host.readFile(buildInfoPath);
125103
125110
  if (!content)
125104
125111
  return undefined;
125105
- (_a = host.buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onRead(content.length, compilerOptions);
125106
125112
  buildInfo = ts.getBuildInfo(buildInfoPath, content);
125107
125113
  }
125108
125114
  if (!buildInfo || buildInfo.version !== ts.version || !buildInfo.program)
@@ -125345,7 +125351,7 @@ var ts;
125345
125351
  }
125346
125352
  reportFileChangeDetectedOnCreateProgram = false;
125347
125353
  if (host.afterProgramCreate && program !== builderProgram) {
125348
- host.afterProgramCreate(builderProgram, compilerHost);
125354
+ host.afterProgramCreate(builderProgram);
125349
125355
  }
125350
125356
  compilerHost.readFile = originalReadFile;
125351
125357
  compilerHost.fileExists = originalFileExists;
@@ -125983,7 +125989,7 @@ var ts;
125983
125989
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
125984
125990
  };
125985
125991
  }
125986
- compilerHost.getBuildInfo = function (fileName, options) { return getBuildInfo(state, fileName, options, toResolvedConfigFilePath(state, options.configFilePath), /*modifiedTime*/ undefined); };
125992
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), /*modifiedTime*/ undefined); };
125987
125993
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
125988
125994
  var state = {
125989
125995
  host: host,
@@ -126435,7 +126441,7 @@ var ts;
126435
126441
  }
126436
126442
  function emit(writeFileCallback, cancellationToken, customTransformers) {
126437
126443
  var _a;
126438
- var _b, _c, _d, _e, _f;
126444
+ var _b, _c, _d;
126439
126445
  ts.Debug.assertIsDefined(program);
126440
126446
  ts.Debug.assert(step === BuildStep.Emit);
126441
126447
  // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly
@@ -126450,8 +126456,6 @@ var ts;
126450
126456
  // Don't emit .d.ts if there are decl file errors
126451
126457
  if (declDiagnostics) {
126452
126458
  program.restoreEmitState(saved);
126453
- // Revert buildInfo write size
126454
- (_d = state.compilerHost.buildInfoCallbacks) === null || _d === void 0 ? void 0 : _d.revertLastWrite();
126455
126459
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
126456
126460
  return {
126457
126461
  emitSkipped: true,
@@ -126460,8 +126464,7 @@ var ts;
126460
126464
  }
126461
126465
  // Actual Emit
126462
126466
  var host = state.host, compilerHost = state.compilerHost;
126463
- (_e = compilerHost.buildInfoCallbacks) === null || _e === void 0 ? void 0 : _e.clearLastWrite();
126464
- var resultFlags = ((_f = program.hasChangedEmitSignature) === null || _f === void 0 ? void 0 : _f.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
126467
+ var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
126465
126468
  var emitterDiagnostics = ts.createDiagnosticCollection();
126466
126469
  var emittedOutputs = new ts.Map();
126467
126470
  var options = program.getCompilerOptions();
@@ -126528,7 +126531,7 @@ var ts;
126528
126531
  return emitDiagnostics;
126529
126532
  }
126530
126533
  function emitBundle(writeFileCallback, customTransformers) {
126531
- var _a, _b, _c, _d;
126534
+ var _a, _b;
126532
126535
  ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
126533
126536
  if (state.options.dry) {
126534
126537
  reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
@@ -126541,11 +126544,10 @@ var ts;
126541
126544
  // Update js, and source map
126542
126545
  var compilerHost = state.compilerHost;
126543
126546
  state.projectCompilerOptions = config.options;
126544
- (_b = (_a = state.host).beforeEmitBundle) === null || _b === void 0 ? void 0 : _b.call(_a, config, compilerHost);
126545
126547
  var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
126546
126548
  var refName = resolveProjectName(state, ref.path);
126547
126549
  return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
126548
- }, customTransformers || ((_d = (_c = state.host).getCustomTransformers) === null || _d === void 0 ? void 0 : _d.call(_c, project)));
126550
+ }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
126549
126551
  if (ts.isString(outputFiles)) {
126550
126552
  reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
126551
126553
  step = BuildStep.BuildInvalidatedProjectOfBundle;
@@ -126743,12 +126745,12 @@ var ts;
126743
126745
  if (state.write)
126744
126746
  ts.listFiles(program, state.write);
126745
126747
  if (state.host.afterProgramEmitAndDiagnostics) {
126746
- state.host.afterProgramEmitAndDiagnostics(program, state.compilerHost);
126748
+ state.host.afterProgramEmitAndDiagnostics(program);
126747
126749
  }
126748
126750
  program.releaseProgram();
126749
126751
  }
126750
126752
  else if (state.host.afterEmitBundle) {
126751
- state.host.afterEmitBundle(config, state.compilerHost);
126753
+ state.host.afterEmitBundle(config);
126752
126754
  }
126753
126755
  state.projectCompilerOptions = state.baseCompilerOptions;
126754
126756
  }
@@ -126848,16 +126850,13 @@ var ts;
126848
126850
  var existing = state.buildInfoCache.get(resolvedConfigPath);
126849
126851
  return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
126850
126852
  }
126851
- function getBuildInfo(state, buildInfoPath, options, resolvedConfigPath, modifiedTime) {
126852
- var _a;
126853
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
126853
126854
  var path = toPath(state, buildInfoPath);
126854
126855
  var existing = state.buildInfoCache.get(resolvedConfigPath);
126855
126856
  if (existing !== undefined && existing.path === path) {
126856
126857
  return existing.buildInfo || undefined;
126857
126858
  }
126858
126859
  var value = state.readFileWithCache(buildInfoPath);
126859
- if (value)
126860
- (_a = (modifiedTime ? state.host : state.compilerHost).buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onRead(value.length, options);
126861
126860
  var buildInfo = value ? ts.getBuildInfo(buildInfoPath, value) : undefined;
126862
126861
  state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
126863
126862
  return buildInfo;
@@ -126943,7 +126942,7 @@ var ts;
126943
126942
  missingOutputFileName: buildInfoPath
126944
126943
  };
126945
126944
  }
126946
- var buildInfo = getBuildInfo(state, buildInfoPath, project.options, resolvedPath, buildInfoTime);
126945
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime);
126947
126946
  if (!buildInfo) {
126948
126947
  // Error reading buildInfo
126949
126948
  return {
@@ -5430,7 +5430,7 @@ declare namespace ts {
5430
5430
  /** If provided, use this method to get parsed command lines for referenced projects */
5431
5431
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5432
5432
  /** If provided, callback to invoke after every new program creation */
5433
- afterProgramCreate?(program: T, host?: CompilerHost): void;
5433
+ afterProgramCreate?(program: T): void;
5434
5434
  }
5435
5435
  /**
5436
5436
  * Host to create watch with root files and options
@@ -5521,7 +5521,7 @@ declare namespace ts {
5521
5521
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
5522
5522
  reportDiagnostic: DiagnosticReporter;
5523
5523
  reportSolutionBuilderStatus: DiagnosticReporter;
5524
- afterProgramEmitAndDiagnostics?(program: T, host?: CompilerHost): void;
5524
+ afterProgramEmitAndDiagnostics?(program: T): void;
5525
5525
  }
5526
5526
  interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> {
5527
5527
  reportErrorSummary?: ReportEmitErrorSummary;