typescript 4.9.0-dev.20220904 → 4.9.0-dev.20220908
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/tsc.js +40 -39
- package/lib/tsserver.js +44 -59
- package/lib/tsserverlibrary.js +44 -45
- package/lib/typescript.js +44 -45
- package/lib/typescriptServices.js +44 -45
- package/lib/typingsInstaller.js +44 -45
- package/package.json +1 -3
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220908");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -6127,7 +6127,6 @@ var ts;
|
|
|
6127
6127
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6128
6128
|
/* @internal */
|
|
6129
6129
|
ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6130
|
-
/* @internal */
|
|
6131
6130
|
function setCustomPollingValues(system) {
|
|
6132
6131
|
if (!system.getEnvironmentVariable) {
|
|
6133
6132
|
return;
|
|
@@ -6170,7 +6169,6 @@ var ts;
|
|
|
6170
6169
|
createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
|
|
6171
6170
|
}
|
|
6172
6171
|
}
|
|
6173
|
-
ts.setCustomPollingValues = setCustomPollingValues;
|
|
6174
6172
|
function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
|
|
6175
6173
|
var definedValueCopyToIndex = pollIndex;
|
|
6176
6174
|
// Max visit would be all elements of the queue
|
|
@@ -6216,7 +6214,6 @@ var ts;
|
|
|
6216
6214
|
}
|
|
6217
6215
|
}
|
|
6218
6216
|
}
|
|
6219
|
-
/* @internal */
|
|
6220
6217
|
function createDynamicPriorityPollingWatchFile(host) {
|
|
6221
6218
|
var watchedFiles = [];
|
|
6222
6219
|
var changedFilesInLastPoll = [];
|
|
@@ -6325,7 +6322,6 @@ var ts;
|
|
|
6325
6322
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
|
|
6326
6323
|
}
|
|
6327
6324
|
}
|
|
6328
|
-
ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
|
|
6329
6325
|
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
|
|
6330
6326
|
// One file can have multiple watchers
|
|
6331
6327
|
var fileWatcherCallbacks = ts.createMultiMap();
|
|
@@ -6404,42 +6400,38 @@ var ts;
|
|
|
6404
6400
|
pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
|
|
6405
6401
|
}
|
|
6406
6402
|
}
|
|
6407
|
-
|
|
6408
|
-
function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
|
|
6409
|
-
var cache = new ts.Map();
|
|
6410
|
-
var callbacksCache = ts.createMultiMap();
|
|
6403
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
|
|
6411
6404
|
var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6405
|
+
var path = toCanonicalFileName(name);
|
|
6406
|
+
var existing = cache.get(path);
|
|
6407
|
+
if (existing) {
|
|
6408
|
+
existing.callbacks.push(callback);
|
|
6409
|
+
}
|
|
6410
|
+
else {
|
|
6411
|
+
cache.set(path, {
|
|
6412
|
+
watcher: createWatcher((
|
|
6413
|
+
// Cant infer types correctly so lets satisfy checker
|
|
6414
|
+
function (param1, param2, param3) { var _a; return (_a = cache.get(path)) === null || _a === void 0 ? void 0 : _a.callbacks.slice().forEach(function (cb) { return cb(param1, param2, param3); }); })),
|
|
6415
|
+
callbacks: [callback]
|
|
6416
|
+
});
|
|
6417
|
+
}
|
|
6418
|
+
return {
|
|
6419
|
+
close: function () {
|
|
6420
|
+
var watcher = cache.get(path);
|
|
6421
|
+
// Watcher is not expected to be undefined, but if it is normally its because
|
|
6422
|
+
// exception was thrown somewhere else and watch state is not what it should be
|
|
6423
|
+
if (!watcher)
|
|
6424
|
+
return;
|
|
6425
|
+
if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
|
|
6426
|
+
return;
|
|
6427
|
+
cache.delete(path);
|
|
6428
|
+
ts.closeFileWatcherOf(watcher);
|
|
6423
6429
|
}
|
|
6424
|
-
callbacksCache.add(path, callback);
|
|
6425
|
-
return {
|
|
6426
|
-
close: function () {
|
|
6427
|
-
var watcher = ts.Debug.checkDefined(cache.get(path));
|
|
6428
|
-
callbacksCache.remove(path, callback);
|
|
6429
|
-
watcher.refCount--;
|
|
6430
|
-
if (watcher.refCount)
|
|
6431
|
-
return;
|
|
6432
|
-
cache.delete(path);
|
|
6433
|
-
ts.closeFileWatcherOf(watcher);
|
|
6434
|
-
}
|
|
6435
|
-
};
|
|
6436
6430
|
};
|
|
6437
6431
|
}
|
|
6438
|
-
ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
|
|
6439
6432
|
/**
|
|
6440
6433
|
* Returns true if file status changed
|
|
6441
6434
|
*/
|
|
6442
|
-
/*@internal*/
|
|
6443
6435
|
function onWatchedFileStat(watchedFile, modifiedTime) {
|
|
6444
6436
|
var oldTime = watchedFile.mtime.getTime();
|
|
6445
6437
|
var newTime = modifiedTime.getTime();
|
|
@@ -6451,7 +6443,6 @@ var ts;
|
|
|
6451
6443
|
}
|
|
6452
6444
|
return false;
|
|
6453
6445
|
}
|
|
6454
|
-
ts.onWatchedFileStat = onWatchedFileStat;
|
|
6455
6446
|
/*@internal*/
|
|
6456
6447
|
function getFileWatcherEventKind(oldTime, newTime) {
|
|
6457
6448
|
return oldTime === 0
|
|
@@ -6479,7 +6470,6 @@ var ts;
|
|
|
6479
6470
|
* that means if this is recursive watcher, watch the children directories as well
|
|
6480
6471
|
* (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)
|
|
6481
6472
|
*/
|
|
6482
|
-
/*@internal*/
|
|
6483
6473
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
6484
6474
|
var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, fileSystemEntryExists = _a.fileSystemEntryExists, realpath = _a.realpath, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout;
|
|
6485
6475
|
var cache = new ts.Map();
|
|
@@ -6688,18 +6678,15 @@ var ts;
|
|
|
6688
6678
|
return ts.stringContains(toCanonicalFilePath(path), searchPath);
|
|
6689
6679
|
}
|
|
6690
6680
|
}
|
|
6691
|
-
ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
|
|
6692
6681
|
/*@internal*/
|
|
6693
6682
|
var FileSystemEntryKind;
|
|
6694
6683
|
(function (FileSystemEntryKind) {
|
|
6695
6684
|
FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
|
|
6696
6685
|
FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
|
|
6697
6686
|
})(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
|
|
6698
|
-
/*@internal*/
|
|
6699
6687
|
function createFileWatcherCallback(callback) {
|
|
6700
6688
|
return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
|
|
6701
6689
|
}
|
|
6702
|
-
ts.createFileWatcherCallback = createFileWatcherCallback;
|
|
6703
6690
|
function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
|
|
6704
6691
|
return function (eventName, _relativeFileName, modifiedTime) {
|
|
6705
6692
|
if (eventName === "rename") {
|
|
@@ -6733,7 +6720,10 @@ var ts;
|
|
|
6733
6720
|
}
|
|
6734
6721
|
/*@internal*/
|
|
6735
6722
|
function createSystemWatchFunctions(_a) {
|
|
6736
|
-
var
|
|
6723
|
+
var pollingWatchFileWorker = _a.pollingWatchFileWorker, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
|
|
6724
|
+
var pollingWatches = new ts.Map();
|
|
6725
|
+
var fsWatches = new ts.Map();
|
|
6726
|
+
var fsWatchesRecursive = new ts.Map();
|
|
6737
6727
|
var dynamicPollingWatchFile;
|
|
6738
6728
|
var fixedChunkSizePollingWatchFile;
|
|
6739
6729
|
var nonPollingWatchFile;
|
|
@@ -6797,7 +6787,7 @@ var ts;
|
|
|
6797
6787
|
// Use notifications from FS to watch with falling back to fs.watchFile
|
|
6798
6788
|
generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
|
|
6799
6789
|
// Default to do not use fixed polling interval
|
|
6800
|
-
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.
|
|
6790
|
+
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
|
|
6801
6791
|
}
|
|
6802
6792
|
}
|
|
6803
6793
|
function generateWatchFileOptions(watchFile, fallbackPolling, options) {
|
|
@@ -6868,7 +6858,13 @@ var ts;
|
|
|
6868
6858
|
};
|
|
6869
6859
|
}
|
|
6870
6860
|
}
|
|
6861
|
+
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
6862
|
+
return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
|
|
6863
|
+
}
|
|
6871
6864
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6865
|
+
return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
|
|
6866
|
+
}
|
|
6867
|
+
function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6872
6868
|
var lastDirectoryPartWithDirectorySeparator;
|
|
6873
6869
|
var lastDirectoryPart;
|
|
6874
6870
|
if (inodeWatching) {
|
|
@@ -7047,7 +7043,7 @@ var ts;
|
|
|
7047
7043
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7048
7044
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7049
7045
|
var _b = createSystemWatchFunctions({
|
|
7050
|
-
|
|
7046
|
+
pollingWatchFileWorker: fsWatchFileWorker,
|
|
7051
7047
|
getModifiedTime: getModifiedTime,
|
|
7052
7048
|
setTimeout: setTimeout,
|
|
7053
7049
|
clearTimeout: clearTimeout,
|
|
@@ -39883,6 +39879,7 @@ var ts;
|
|
|
39883
39879
|
shortName: "h",
|
|
39884
39880
|
type: "boolean",
|
|
39885
39881
|
showInSimplifiedHelpView: true,
|
|
39882
|
+
isCommandLineOnly: true,
|
|
39886
39883
|
category: ts.Diagnostics.Command_line_Options,
|
|
39887
39884
|
description: ts.Diagnostics.Print_this_message,
|
|
39888
39885
|
defaultValueDescription: false,
|
|
@@ -39891,6 +39888,8 @@ var ts;
|
|
|
39891
39888
|
name: "help",
|
|
39892
39889
|
shortName: "?",
|
|
39893
39890
|
type: "boolean",
|
|
39891
|
+
isCommandLineOnly: true,
|
|
39892
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
39894
39893
|
defaultValueDescription: false,
|
|
39895
39894
|
},
|
|
39896
39895
|
{
|
|
@@ -66869,8 +66868,8 @@ var ts;
|
|
|
66869
66868
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
66870
66869
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
66871
66870
|
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
66872
|
-
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false)) {
|
|
66873
|
-
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false);
|
|
66871
|
+
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
66872
|
+
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
|
|
66874
66873
|
if (result) {
|
|
66875
66874
|
return result;
|
|
66876
66875
|
}
|
|
@@ -90586,7 +90585,7 @@ var ts;
|
|
|
90586
90585
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
90587
90586
|
}
|
|
90588
90587
|
var nodeArguments = node.arguments;
|
|
90589
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90588
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90590
90589
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90591
90590
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90592
90591
|
if (nodeArguments.length > 1) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20220908",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"mocha-fivemat-progress-reporter": "latest",
|
|
91
91
|
"ms": "^2.1.3",
|
|
92
92
|
"node-fetch": "^2.6.7",
|
|
93
|
-
"prex": "^0.4.7",
|
|
94
93
|
"source-map-support": "latest",
|
|
95
94
|
"typescript": "^4.8.2",
|
|
96
95
|
"vinyl": "latest",
|
|
@@ -110,7 +109,6 @@
|
|
|
110
109
|
"clean": "gulp clean",
|
|
111
110
|
"gulp": "gulp",
|
|
112
111
|
"lint": "gulp lint",
|
|
113
|
-
"lint:ci": "gulp lint --ci",
|
|
114
112
|
"setup-hooks": "node scripts/link-hooks.js"
|
|
115
113
|
},
|
|
116
114
|
"browser": {
|