typescript 5.0.0-dev.20221206 → 5.0.0-dev.20221207
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 +174 -139
- package/lib/tsserver.js +153265 -150990
- package/lib/tsserverlibrary.d.ts +19 -6
- package/lib/tsserverlibrary.js +216 -172
- package/lib/typescript.d.ts +19 -6
- package/lib/typescript.js +216 -172
- package/lib/typingsInstaller.js +53 -70
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
|
|
|
50
50
|
|
|
51
51
|
// src/compiler/corePublic.ts
|
|
52
52
|
var versionMajorMinor = "5.0";
|
|
53
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
53
|
+
var version = `${versionMajorMinor}.0-dev.20221207`;
|
|
54
54
|
|
|
55
55
|
// src/compiler/core.ts
|
|
56
56
|
var emptyArray = [];
|
|
@@ -1310,22 +1310,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1310
1310
|
function enableDebugInfo() {
|
|
1311
1311
|
if (isDebugInfoEnabled)
|
|
1312
1312
|
return;
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
function getWeakTypeTextMap() {
|
|
1316
|
-
if (weakTypeTextMap === void 0) {
|
|
1317
|
-
if (typeof WeakMap === "function")
|
|
1318
|
-
weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1319
|
-
}
|
|
1320
|
-
return weakTypeTextMap;
|
|
1321
|
-
}
|
|
1322
|
-
function getWeakNodeTextMap() {
|
|
1323
|
-
if (weakNodeTextMap === void 0) {
|
|
1324
|
-
if (typeof WeakMap === "function")
|
|
1325
|
-
weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1326
|
-
}
|
|
1327
|
-
return weakNodeTextMap;
|
|
1328
|
-
}
|
|
1313
|
+
const weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1314
|
+
const weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1329
1315
|
Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, {
|
|
1330
1316
|
__tsDebuggerDisplay: {
|
|
1331
1317
|
value() {
|
|
@@ -1354,11 +1340,10 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1354
1340
|
} },
|
|
1355
1341
|
__debugTypeToString: {
|
|
1356
1342
|
value() {
|
|
1357
|
-
|
|
1358
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
1343
|
+
let text = weakTypeTextMap.get(this);
|
|
1359
1344
|
if (text === void 0) {
|
|
1360
1345
|
text = this.checker.typeToString(this);
|
|
1361
|
-
|
|
1346
|
+
weakTypeTextMap.set(this, text);
|
|
1362
1347
|
}
|
|
1363
1348
|
return text;
|
|
1364
1349
|
}
|
|
@@ -1410,13 +1395,12 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1410
1395
|
value(includeTrivia) {
|
|
1411
1396
|
if (nodeIsSynthesized(this))
|
|
1412
1397
|
return "";
|
|
1413
|
-
|
|
1414
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
1398
|
+
let text = weakNodeTextMap.get(this);
|
|
1415
1399
|
if (text === void 0) {
|
|
1416
1400
|
const parseNode = getParseTreeNode(this);
|
|
1417
1401
|
const sourceFile = parseNode && getSourceFileOfNode(parseNode);
|
|
1418
1402
|
text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : "";
|
|
1419
|
-
|
|
1403
|
+
weakNodeTextMap.set(this, text);
|
|
1420
1404
|
}
|
|
1421
1405
|
return text;
|
|
1422
1406
|
}
|
|
@@ -25891,8 +25875,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
25891
25875
|
}
|
|
25892
25876
|
}
|
|
25893
25877
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
25894
|
-
|
|
25895
|
-
let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
|
|
25878
|
+
let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference);
|
|
25896
25879
|
if (result) {
|
|
25897
25880
|
if (traceEnabled) {
|
|
25898
25881
|
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -25942,11 +25925,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
25942
25925
|
if (result && result.resolvedModule)
|
|
25943
25926
|
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
25944
25927
|
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
25945
|
-
|
|
25946
|
-
|
|
25947
|
-
|
|
25948
|
-
cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
25949
|
-
}
|
|
25928
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
25929
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
25930
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
25950
25931
|
}
|
|
25951
25932
|
}
|
|
25952
25933
|
if (traceEnabled) {
|
|
@@ -26829,7 +26810,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
|
|
|
26829
26810
|
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
26830
26811
|
}
|
|
26831
26812
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
26832
|
-
const
|
|
26813
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
26833
26814
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
26834
26815
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
26835
26816
|
if (priorityExtensions) {
|
|
@@ -26843,7 +26824,7 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
|
|
|
26843
26824
|
function lookup(extensions2) {
|
|
26844
26825
|
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
26845
26826
|
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
26846
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
26827
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
|
|
26847
26828
|
if (resolutionFromCache) {
|
|
26848
26829
|
return resolutionFromCache;
|
|
26849
26830
|
}
|
|
@@ -26976,8 +26957,8 @@ function mangleScopedPackageName(packageName) {
|
|
|
26976
26957
|
}
|
|
26977
26958
|
return packageName;
|
|
26978
26959
|
}
|
|
26979
|
-
function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {
|
|
26980
|
-
const result = cache && cache.
|
|
26960
|
+
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
26961
|
+
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
26981
26962
|
if (result) {
|
|
26982
26963
|
if (state.traceEnabled) {
|
|
26983
26964
|
trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -27020,9 +27001,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
27020
27001
|
return { value: resolvedUsingSettings };
|
|
27021
27002
|
}
|
|
27022
27003
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
27023
|
-
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference);
|
|
27024
27004
|
const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
|
|
27025
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
27005
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, void 0, directory, redirectedReference, state);
|
|
27026
27006
|
if (resolutionFromCache) {
|
|
27027
27007
|
return resolutionFromCache;
|
|
27028
27008
|
}
|
|
@@ -31814,6 +31794,26 @@ var BuilderState;
|
|
|
31814
31794
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path2);
|
|
31815
31795
|
}
|
|
31816
31796
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
31797
|
+
function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
|
|
31798
|
+
programOfThisState.emit(
|
|
31799
|
+
sourceFile,
|
|
31800
|
+
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
31801
|
+
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
31802
|
+
onNewSignature(computeSignatureWithDiagnostics(
|
|
31803
|
+
programOfThisState,
|
|
31804
|
+
sourceFile,
|
|
31805
|
+
text,
|
|
31806
|
+
host,
|
|
31807
|
+
data
|
|
31808
|
+
), sourceFiles);
|
|
31809
|
+
},
|
|
31810
|
+
cancellationToken,
|
|
31811
|
+
true,
|
|
31812
|
+
void 0,
|
|
31813
|
+
true
|
|
31814
|
+
);
|
|
31815
|
+
}
|
|
31816
|
+
BuilderState2.computeDtsSignature = computeDtsSignature;
|
|
31817
31817
|
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
31818
31818
|
var _a2;
|
|
31819
31819
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
@@ -31822,26 +31822,12 @@ var BuilderState;
|
|
|
31822
31822
|
const prevSignature = info.signature;
|
|
31823
31823
|
let latestSignature;
|
|
31824
31824
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
31825
|
-
programOfThisState
|
|
31826
|
-
|
|
31827
|
-
(
|
|
31828
|
-
|
|
31829
|
-
|
|
31830
|
-
|
|
31831
|
-
sourceFile,
|
|
31832
|
-
text,
|
|
31833
|
-
host,
|
|
31834
|
-
data
|
|
31835
|
-
);
|
|
31836
|
-
if (latestSignature !== prevSignature) {
|
|
31837
|
-
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
31838
|
-
}
|
|
31839
|
-
},
|
|
31840
|
-
cancellationToken,
|
|
31841
|
-
true,
|
|
31842
|
-
void 0,
|
|
31843
|
-
true
|
|
31844
|
-
);
|
|
31825
|
+
computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => {
|
|
31826
|
+
latestSignature = signature;
|
|
31827
|
+
if (latestSignature !== prevSignature) {
|
|
31828
|
+
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
31829
|
+
}
|
|
31830
|
+
});
|
|
31845
31831
|
}
|
|
31846
31832
|
if (latestSignature === void 0) {
|
|
31847
31833
|
latestSignature = sourceFile.version;
|
|
@@ -31865,27 +31851,24 @@ var BuilderState;
|
|
|
31865
31851
|
if (!state.exportedModulesMap)
|
|
31866
31852
|
return;
|
|
31867
31853
|
(state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
|
|
31868
|
-
|
|
31869
|
-
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
31870
|
-
return;
|
|
31871
|
-
}
|
|
31872
|
-
let exportedModules;
|
|
31873
|
-
exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)));
|
|
31854
|
+
const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit);
|
|
31874
31855
|
if (exportedModules) {
|
|
31875
31856
|
state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
|
|
31876
31857
|
} else {
|
|
31877
31858
|
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
31878
31859
|
}
|
|
31879
|
-
function addExportedModule(exportedModulePaths) {
|
|
31880
|
-
if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) {
|
|
31881
|
-
if (!exportedModules) {
|
|
31882
|
-
exportedModules = /* @__PURE__ */ new Set();
|
|
31883
|
-
}
|
|
31884
|
-
exportedModulePaths.forEach((path2) => exportedModules.add(path2));
|
|
31885
|
-
}
|
|
31886
|
-
}
|
|
31887
31860
|
}
|
|
31888
31861
|
BuilderState2.updateExportedModules = updateExportedModules;
|
|
31862
|
+
function getExportedModules(exportedModulesFromDeclarationEmit) {
|
|
31863
|
+
let exportedModules;
|
|
31864
|
+
exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach(
|
|
31865
|
+
(symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach(
|
|
31866
|
+
(path2) => (exportedModules != null ? exportedModules : exportedModules = /* @__PURE__ */ new Set()).add(path2)
|
|
31867
|
+
)
|
|
31868
|
+
);
|
|
31869
|
+
return exportedModules;
|
|
31870
|
+
}
|
|
31871
|
+
BuilderState2.getExportedModules = getExportedModules;
|
|
31889
31872
|
function getAllDependencies(state, programOfThisState, sourceFile) {
|
|
31890
31873
|
const compilerOptions = programOfThisState.getCompilerOptions();
|
|
31891
31874
|
if (outFile(compilerOptions)) {
|
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": "5.0.0-dev.
|
|
5
|
+
"version": "5.0.0-dev.20221207",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|