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