typescript 5.4.0-dev.20231218 → 5.4.0-dev.20231220
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 +52 -52
- package/lib/tsserver.js +87 -87
- package/lib/typescript.js +1 -1
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231220`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -42972,10 +42972,10 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
|
|
|
42972
42972
|
return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
|
|
42973
42973
|
}
|
|
42974
42974
|
}
|
|
42975
|
-
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName,
|
|
42976
|
-
if (typeof
|
|
42975
|
+
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2, conditions, mode = 0 /* Exact */) {
|
|
42976
|
+
if (typeof exports2 === "string") {
|
|
42977
42977
|
const pathOrPattern = getNormalizedAbsolutePath(
|
|
42978
|
-
combinePaths(packageDirectory,
|
|
42978
|
+
combinePaths(packageDirectory, exports2),
|
|
42979
42979
|
/*currentDirectory*/
|
|
42980
42980
|
void 0
|
|
42981
42981
|
);
|
|
@@ -42995,7 +42995,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42995
42995
|
false
|
|
42996
42996
|
);
|
|
42997
42997
|
return { moduleFileToTry: getNormalizedAbsolutePath(
|
|
42998
|
-
combinePaths(combinePaths(packageName,
|
|
42998
|
+
combinePaths(combinePaths(packageName, exports2), fragment),
|
|
42999
42999
|
/*currentDirectory*/
|
|
43000
43000
|
void 0
|
|
43001
43001
|
) };
|
|
@@ -43015,23 +43015,23 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
43015
43015
|
}
|
|
43016
43016
|
break;
|
|
43017
43017
|
}
|
|
43018
|
-
} else if (Array.isArray(
|
|
43019
|
-
return forEach(
|
|
43020
|
-
} else if (typeof
|
|
43021
|
-
if (allKeysStartWithDot(
|
|
43022
|
-
return forEach(getOwnKeys(
|
|
43018
|
+
} else if (Array.isArray(exports2)) {
|
|
43019
|
+
return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
|
|
43020
|
+
} else if (typeof exports2 === "object" && exports2 !== null) {
|
|
43021
|
+
if (allKeysStartWithDot(exports2)) {
|
|
43022
|
+
return forEach(getOwnKeys(exports2), (k) => {
|
|
43023
43023
|
const subPackageName = getNormalizedAbsolutePath(
|
|
43024
43024
|
combinePaths(packageName, k),
|
|
43025
43025
|
/*currentDirectory*/
|
|
43026
43026
|
void 0
|
|
43027
43027
|
);
|
|
43028
43028
|
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
43029
|
-
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName,
|
|
43029
|
+
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k], conditions, mode2);
|
|
43030
43030
|
});
|
|
43031
43031
|
} else {
|
|
43032
|
-
for (const key of getOwnKeys(
|
|
43032
|
+
for (const key of getOwnKeys(exports2)) {
|
|
43033
43033
|
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
43034
|
-
const subTarget =
|
|
43034
|
+
const subTarget = exports2[key];
|
|
43035
43035
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
43036
43036
|
if (result) {
|
|
43037
43037
|
return result;
|
|
@@ -46123,13 +46123,13 @@ function createTypeChecker(host) {
|
|
|
46123
46123
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
46124
46124
|
var _a, _b;
|
|
46125
46125
|
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
46126
|
-
const
|
|
46126
|
+
const exports2 = moduleSymbol.exports;
|
|
46127
46127
|
if (localSymbol) {
|
|
46128
|
-
const exportedEqualsSymbol =
|
|
46128
|
+
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
46129
46129
|
if (exportedEqualsSymbol) {
|
|
46130
46130
|
getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);
|
|
46131
46131
|
} else {
|
|
46132
|
-
const exportedSymbol =
|
|
46132
|
+
const exportedSymbol = exports2 ? find(symbolsToArray(exports2), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
|
|
46133
46133
|
const diagnostic = exportedSymbol ? error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
46134
46134
|
if (localSymbol.declarations) {
|
|
46135
46135
|
addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
|
|
@@ -46993,19 +46993,19 @@ function createTypeChecker(host) {
|
|
|
46993
46993
|
return symbolsToArray(getExportsOfModule(moduleSymbol));
|
|
46994
46994
|
}
|
|
46995
46995
|
function getExportsAndPropertiesOfModule(moduleSymbol) {
|
|
46996
|
-
const
|
|
46996
|
+
const exports2 = getExportsOfModuleAsArray(moduleSymbol);
|
|
46997
46997
|
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
|
|
46998
46998
|
if (exportEquals !== moduleSymbol) {
|
|
46999
46999
|
const type = getTypeOfSymbol(exportEquals);
|
|
47000
47000
|
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
|
47001
|
-
addRange(
|
|
47001
|
+
addRange(exports2, getPropertiesOfType(type));
|
|
47002
47002
|
}
|
|
47003
47003
|
}
|
|
47004
|
-
return
|
|
47004
|
+
return exports2;
|
|
47005
47005
|
}
|
|
47006
47006
|
function forEachExportAndPropertyOfModule(moduleSymbol, cb) {
|
|
47007
|
-
const
|
|
47008
|
-
|
|
47007
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
47008
|
+
exports2.forEach((symbol, key) => {
|
|
47009
47009
|
if (!isReservedMemberName(key)) {
|
|
47010
47010
|
cb(symbol, key);
|
|
47011
47011
|
}
|
|
@@ -47048,8 +47048,8 @@ function createTypeChecker(host) {
|
|
|
47048
47048
|
function getExportsOfModule(moduleSymbol) {
|
|
47049
47049
|
const links = getSymbolLinks(moduleSymbol);
|
|
47050
47050
|
if (!links.resolvedExports) {
|
|
47051
|
-
const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
47052
|
-
links.resolvedExports =
|
|
47051
|
+
const { exports: exports2, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
47052
|
+
links.resolvedExports = exports2;
|
|
47053
47053
|
links.typeOnlyExportStarMap = typeOnlyExportStarMap;
|
|
47054
47054
|
}
|
|
47055
47055
|
return links.resolvedExports;
|
|
@@ -47083,12 +47083,12 @@ function createTypeChecker(host) {
|
|
|
47083
47083
|
let typeOnlyExportStarMap;
|
|
47084
47084
|
const nonTypeOnlyNames = /* @__PURE__ */ new Set();
|
|
47085
47085
|
moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
|
|
47086
|
-
const
|
|
47086
|
+
const exports2 = visit(moduleSymbol) || emptySymbols;
|
|
47087
47087
|
if (typeOnlyExportStarMap) {
|
|
47088
47088
|
nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
|
|
47089
47089
|
}
|
|
47090
47090
|
return {
|
|
47091
|
-
exports,
|
|
47091
|
+
exports: exports2,
|
|
47092
47092
|
typeOnlyExportStarMap
|
|
47093
47093
|
};
|
|
47094
47094
|
function visit(symbol, exportStar, isTypeOnly) {
|
|
@@ -47277,12 +47277,12 @@ function createTypeChecker(host) {
|
|
|
47277
47277
|
if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {
|
|
47278
47278
|
return container;
|
|
47279
47279
|
}
|
|
47280
|
-
const
|
|
47281
|
-
const quick =
|
|
47280
|
+
const exports2 = getExportsOfSymbol(container);
|
|
47281
|
+
const quick = exports2.get(symbol.escapedName);
|
|
47282
47282
|
if (quick && getSymbolIfSameReference(quick, symbol)) {
|
|
47283
47283
|
return quick;
|
|
47284
47284
|
}
|
|
47285
|
-
return forEachEntry(
|
|
47285
|
+
return forEachEntry(exports2, (exported) => {
|
|
47286
47286
|
if (getSymbolIfSameReference(exported, symbol)) {
|
|
47287
47287
|
return exported;
|
|
47288
47288
|
}
|
|
@@ -49531,8 +49531,8 @@ function createTypeChecker(host) {
|
|
|
49531
49531
|
context.flags ^= 16777216 /* InInitialEntityName */;
|
|
49532
49532
|
} else {
|
|
49533
49533
|
if (parent && getExportsOfSymbol(parent)) {
|
|
49534
|
-
const
|
|
49535
|
-
forEachEntry(
|
|
49534
|
+
const exports2 = getExportsOfSymbol(parent);
|
|
49535
|
+
forEachEntry(exports2, (ex, name) => {
|
|
49536
49536
|
if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name) && name !== "export=" /* ExportEquals */) {
|
|
49537
49537
|
symbolName2 = unescapeLeadingUnderscores(name);
|
|
49538
49538
|
return true;
|
|
@@ -50156,8 +50156,8 @@ function createTypeChecker(host) {
|
|
|
50156
50156
|
return statements;
|
|
50157
50157
|
}
|
|
50158
50158
|
function mergeExportDeclarations(statements) {
|
|
50159
|
-
const
|
|
50160
|
-
if (length(
|
|
50159
|
+
const exports2 = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
|
|
50160
|
+
if (length(exports2) > 1) {
|
|
50161
50161
|
const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause);
|
|
50162
50162
|
statements = [
|
|
50163
50163
|
...nonExports,
|
|
@@ -50166,7 +50166,7 @@ function createTypeChecker(host) {
|
|
|
50166
50166
|
void 0,
|
|
50167
50167
|
/*isTypeOnly*/
|
|
50168
50168
|
false,
|
|
50169
|
-
factory.createNamedExports(flatMap(
|
|
50169
|
+
factory.createNamedExports(flatMap(exports2, (e) => cast(e.exportClause, isNamedExports).elements)),
|
|
50170
50170
|
/*moduleSpecifier*/
|
|
50171
50171
|
void 0
|
|
50172
50172
|
)
|
|
@@ -50549,8 +50549,8 @@ function createTypeChecker(host) {
|
|
|
50549
50549
|
);
|
|
50550
50550
|
}
|
|
50551
50551
|
function getNamespaceMembersForSerialization(symbol) {
|
|
50552
|
-
const
|
|
50553
|
-
return !
|
|
50552
|
+
const exports2 = getExportsOfSymbol(symbol);
|
|
50553
|
+
return !exports2 ? [] : filter(arrayFrom(exports2.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
50554
50554
|
}
|
|
50555
50555
|
function isTypeOnlyNamespace(symbol) {
|
|
50556
50556
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -52352,19 +52352,19 @@ function createTypeChecker(host) {
|
|
|
52352
52352
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
52353
52353
|
return void 0;
|
|
52354
52354
|
}
|
|
52355
|
-
const
|
|
52355
|
+
const exports2 = createSymbolTable();
|
|
52356
52356
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
52357
52357
|
const s2 = getSymbolOfNode(decl);
|
|
52358
52358
|
if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
|
|
52359
|
-
mergeSymbolTable(
|
|
52359
|
+
mergeSymbolTable(exports2, s2.exports);
|
|
52360
52360
|
}
|
|
52361
52361
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
52362
52362
|
}
|
|
52363
52363
|
const s = getSymbolOfNode(decl);
|
|
52364
52364
|
if ((_b = s == null ? void 0 : s.exports) == null ? void 0 : _b.size) {
|
|
52365
|
-
mergeSymbolTable(
|
|
52365
|
+
mergeSymbolTable(exports2, s.exports);
|
|
52366
52366
|
}
|
|
52367
|
-
const type = createAnonymousType(symbol,
|
|
52367
|
+
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
52368
52368
|
type.objectFlags |= 4096 /* JSLiteral */;
|
|
52369
52369
|
return type;
|
|
52370
52370
|
}
|
|
@@ -69537,8 +69537,8 @@ function createTypeChecker(host) {
|
|
|
69537
69537
|
}
|
|
69538
69538
|
function getJsxType(name, location) {
|
|
69539
69539
|
const namespace = getJsxNamespaceAt(location);
|
|
69540
|
-
const
|
|
69541
|
-
const typeSymbol =
|
|
69540
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
69541
|
+
const typeSymbol = exports2 && getSymbol(exports2, name, 788968 /* Type */);
|
|
69542
69542
|
return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
|
|
69543
69543
|
}
|
|
69544
69544
|
function getIntrinsicTagSymbol(node) {
|
|
@@ -72368,8 +72368,8 @@ function createTypeChecker(host) {
|
|
|
72368
72368
|
}
|
|
72369
72369
|
function createSignatureForJSXIntrinsic(node, result) {
|
|
72370
72370
|
const namespace = getJsxNamespaceAt(node);
|
|
72371
|
-
const
|
|
72372
|
-
const typeSymbol =
|
|
72371
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
72372
|
+
const typeSymbol = exports2 && getSymbol(exports2, JsxNames.Element, 788968 /* Type */);
|
|
72373
72373
|
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
|
|
72374
72374
|
const declaration = factory.createFunctionTypeNode(
|
|
72375
72375
|
/*typeParameters*/
|
|
@@ -81122,9 +81122,9 @@ function createTypeChecker(host) {
|
|
|
81122
81122
|
error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
|
|
81123
81123
|
}
|
|
81124
81124
|
}
|
|
81125
|
-
const
|
|
81126
|
-
if (
|
|
81127
|
-
|
|
81125
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
81126
|
+
if (exports2) {
|
|
81127
|
+
exports2.forEach(({ declarations, flags }, id) => {
|
|
81128
81128
|
if (id === "__export") {
|
|
81129
81129
|
return;
|
|
81130
81130
|
}
|
|
@@ -82989,8 +82989,8 @@ function createTypeChecker(host) {
|
|
|
82989
82989
|
return false;
|
|
82990
82990
|
if (importTarget === file)
|
|
82991
82991
|
return false;
|
|
82992
|
-
const
|
|
82993
|
-
for (const s of arrayFrom(
|
|
82992
|
+
const exports2 = getExportsOfModule(file.symbol);
|
|
82993
|
+
for (const s of arrayFrom(exports2.values())) {
|
|
82994
82994
|
if (s.mergeId) {
|
|
82995
82995
|
const merged = getMergedSymbol(s);
|
|
82996
82996
|
if (merged.declarations) {
|
|
@@ -106286,7 +106286,7 @@ function transformSystemModule(context) {
|
|
|
106286
106286
|
const exportStarFunction = factory2.createUniqueName("exportStar");
|
|
106287
106287
|
const m = factory2.createIdentifier("m");
|
|
106288
106288
|
const n = factory2.createIdentifier("n");
|
|
106289
|
-
const
|
|
106289
|
+
const exports2 = factory2.createIdentifier("exports");
|
|
106290
106290
|
let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default"));
|
|
106291
106291
|
if (localNames) {
|
|
106292
106292
|
condition = factory2.createLogicalAnd(
|
|
@@ -106325,7 +106325,7 @@ function transformSystemModule(context) {
|
|
|
106325
106325
|
void 0,
|
|
106326
106326
|
factory2.createVariableDeclarationList([
|
|
106327
106327
|
factory2.createVariableDeclaration(
|
|
106328
|
-
|
|
106328
|
+
exports2,
|
|
106329
106329
|
/*exclamationToken*/
|
|
106330
106330
|
void 0,
|
|
106331
106331
|
/*type*/
|
|
@@ -106345,7 +106345,7 @@ function transformSystemModule(context) {
|
|
|
106345
106345
|
condition,
|
|
106346
106346
|
factory2.createExpressionStatement(
|
|
106347
106347
|
factory2.createAssignment(
|
|
106348
|
-
factory2.createElementAccessExpression(
|
|
106348
|
+
factory2.createElementAccessExpression(exports2, n),
|
|
106349
106349
|
factory2.createElementAccessExpression(m, n)
|
|
106350
106350
|
)
|
|
106351
106351
|
)
|
|
@@ -106359,7 +106359,7 @@ function transformSystemModule(context) {
|
|
|
106359
106359
|
exportFunction,
|
|
106360
106360
|
/*typeArguments*/
|
|
106361
106361
|
void 0,
|
|
106362
|
-
[
|
|
106362
|
+
[exports2]
|
|
106363
106363
|
)
|
|
106364
106364
|
)
|
|
106365
106365
|
],
|
package/lib/tsserver.js
CHANGED
|
@@ -2335,7 +2335,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2335
2335
|
|
|
2336
2336
|
// src/compiler/corePublic.ts
|
|
2337
2337
|
var versionMajorMinor = "5.4";
|
|
2338
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2338
|
+
var version = `${versionMajorMinor}.0-dev.20231220`;
|
|
2339
2339
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2340
2340
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2341
2341
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -43127,18 +43127,18 @@ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache
|
|
|
43127
43127
|
}
|
|
43128
43128
|
return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false;
|
|
43129
43129
|
}
|
|
43130
|
-
function loadEntrypointsFromExportMap(scope,
|
|
43130
|
+
function loadEntrypointsFromExportMap(scope, exports2, state, extensions) {
|
|
43131
43131
|
let entrypoints;
|
|
43132
|
-
if (isArray(
|
|
43133
|
-
for (const target of
|
|
43132
|
+
if (isArray(exports2)) {
|
|
43133
|
+
for (const target of exports2) {
|
|
43134
43134
|
loadEntrypointsFromTargetExports(target);
|
|
43135
43135
|
}
|
|
43136
|
-
} else if (typeof
|
|
43137
|
-
for (const key in
|
|
43138
|
-
loadEntrypointsFromTargetExports(
|
|
43136
|
+
} else if (typeof exports2 === "object" && exports2 !== null && allKeysStartWithDot(exports2)) {
|
|
43137
|
+
for (const key in exports2) {
|
|
43138
|
+
loadEntrypointsFromTargetExports(exports2[key]);
|
|
43139
43139
|
}
|
|
43140
43140
|
} else {
|
|
43141
|
-
loadEntrypointsFromTargetExports(
|
|
43141
|
+
loadEntrypointsFromTargetExports(exports2);
|
|
43142
43142
|
}
|
|
43143
43143
|
return entrypoints;
|
|
43144
43144
|
function loadEntrypointsFromTargetExports(target) {
|
|
@@ -47687,10 +47687,10 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
|
|
|
47687
47687
|
return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
|
|
47688
47688
|
}
|
|
47689
47689
|
}
|
|
47690
|
-
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName,
|
|
47691
|
-
if (typeof
|
|
47690
|
+
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2, conditions, mode = 0 /* Exact */) {
|
|
47691
|
+
if (typeof exports2 === "string") {
|
|
47692
47692
|
const pathOrPattern = getNormalizedAbsolutePath(
|
|
47693
|
-
combinePaths(packageDirectory,
|
|
47693
|
+
combinePaths(packageDirectory, exports2),
|
|
47694
47694
|
/*currentDirectory*/
|
|
47695
47695
|
void 0
|
|
47696
47696
|
);
|
|
@@ -47710,7 +47710,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47710
47710
|
false
|
|
47711
47711
|
);
|
|
47712
47712
|
return { moduleFileToTry: getNormalizedAbsolutePath(
|
|
47713
|
-
combinePaths(combinePaths(packageName,
|
|
47713
|
+
combinePaths(combinePaths(packageName, exports2), fragment),
|
|
47714
47714
|
/*currentDirectory*/
|
|
47715
47715
|
void 0
|
|
47716
47716
|
) };
|
|
@@ -47730,23 +47730,23 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47730
47730
|
}
|
|
47731
47731
|
break;
|
|
47732
47732
|
}
|
|
47733
|
-
} else if (Array.isArray(
|
|
47734
|
-
return forEach(
|
|
47735
|
-
} else if (typeof
|
|
47736
|
-
if (allKeysStartWithDot(
|
|
47737
|
-
return forEach(getOwnKeys(
|
|
47733
|
+
} else if (Array.isArray(exports2)) {
|
|
47734
|
+
return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
|
|
47735
|
+
} else if (typeof exports2 === "object" && exports2 !== null) {
|
|
47736
|
+
if (allKeysStartWithDot(exports2)) {
|
|
47737
|
+
return forEach(getOwnKeys(exports2), (k) => {
|
|
47738
47738
|
const subPackageName = getNormalizedAbsolutePath(
|
|
47739
47739
|
combinePaths(packageName, k),
|
|
47740
47740
|
/*currentDirectory*/
|
|
47741
47741
|
void 0
|
|
47742
47742
|
);
|
|
47743
47743
|
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
47744
|
-
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName,
|
|
47744
|
+
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k], conditions, mode2);
|
|
47745
47745
|
});
|
|
47746
47746
|
} else {
|
|
47747
|
-
for (const key of getOwnKeys(
|
|
47747
|
+
for (const key of getOwnKeys(exports2)) {
|
|
47748
47748
|
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47749
|
-
const subTarget =
|
|
47749
|
+
const subTarget = exports2[key];
|
|
47750
47750
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47751
47751
|
if (result) {
|
|
47752
47752
|
return result;
|
|
@@ -50838,13 +50838,13 @@ function createTypeChecker(host) {
|
|
|
50838
50838
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
50839
50839
|
var _a, _b;
|
|
50840
50840
|
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
50841
|
-
const
|
|
50841
|
+
const exports2 = moduleSymbol.exports;
|
|
50842
50842
|
if (localSymbol) {
|
|
50843
|
-
const exportedEqualsSymbol =
|
|
50843
|
+
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
50844
50844
|
if (exportedEqualsSymbol) {
|
|
50845
50845
|
getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error2(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);
|
|
50846
50846
|
} else {
|
|
50847
|
-
const exportedSymbol =
|
|
50847
|
+
const exportedSymbol = exports2 ? find(symbolsToArray(exports2), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
|
|
50848
50848
|
const diagnostic = exportedSymbol ? error2(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error2(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
50849
50849
|
if (localSymbol.declarations) {
|
|
50850
50850
|
addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
|
|
@@ -51708,19 +51708,19 @@ function createTypeChecker(host) {
|
|
|
51708
51708
|
return symbolsToArray(getExportsOfModule(moduleSymbol));
|
|
51709
51709
|
}
|
|
51710
51710
|
function getExportsAndPropertiesOfModule(moduleSymbol) {
|
|
51711
|
-
const
|
|
51711
|
+
const exports2 = getExportsOfModuleAsArray(moduleSymbol);
|
|
51712
51712
|
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
|
|
51713
51713
|
if (exportEquals !== moduleSymbol) {
|
|
51714
51714
|
const type = getTypeOfSymbol(exportEquals);
|
|
51715
51715
|
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
|
51716
|
-
addRange(
|
|
51716
|
+
addRange(exports2, getPropertiesOfType(type));
|
|
51717
51717
|
}
|
|
51718
51718
|
}
|
|
51719
|
-
return
|
|
51719
|
+
return exports2;
|
|
51720
51720
|
}
|
|
51721
51721
|
function forEachExportAndPropertyOfModule(moduleSymbol, cb) {
|
|
51722
|
-
const
|
|
51723
|
-
|
|
51722
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
51723
|
+
exports2.forEach((symbol, key) => {
|
|
51724
51724
|
if (!isReservedMemberName(key)) {
|
|
51725
51725
|
cb(symbol, key);
|
|
51726
51726
|
}
|
|
@@ -51763,8 +51763,8 @@ function createTypeChecker(host) {
|
|
|
51763
51763
|
function getExportsOfModule(moduleSymbol) {
|
|
51764
51764
|
const links = getSymbolLinks(moduleSymbol);
|
|
51765
51765
|
if (!links.resolvedExports) {
|
|
51766
|
-
const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
51767
|
-
links.resolvedExports =
|
|
51766
|
+
const { exports: exports2, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
|
|
51767
|
+
links.resolvedExports = exports2;
|
|
51768
51768
|
links.typeOnlyExportStarMap = typeOnlyExportStarMap;
|
|
51769
51769
|
}
|
|
51770
51770
|
return links.resolvedExports;
|
|
@@ -51798,12 +51798,12 @@ function createTypeChecker(host) {
|
|
|
51798
51798
|
let typeOnlyExportStarMap;
|
|
51799
51799
|
const nonTypeOnlyNames = /* @__PURE__ */ new Set();
|
|
51800
51800
|
moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
|
|
51801
|
-
const
|
|
51801
|
+
const exports2 = visit(moduleSymbol) || emptySymbols;
|
|
51802
51802
|
if (typeOnlyExportStarMap) {
|
|
51803
51803
|
nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
|
|
51804
51804
|
}
|
|
51805
51805
|
return {
|
|
51806
|
-
exports,
|
|
51806
|
+
exports: exports2,
|
|
51807
51807
|
typeOnlyExportStarMap
|
|
51808
51808
|
};
|
|
51809
51809
|
function visit(symbol, exportStar, isTypeOnly) {
|
|
@@ -51992,12 +51992,12 @@ function createTypeChecker(host) {
|
|
|
51992
51992
|
if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {
|
|
51993
51993
|
return container;
|
|
51994
51994
|
}
|
|
51995
|
-
const
|
|
51996
|
-
const quick =
|
|
51995
|
+
const exports2 = getExportsOfSymbol(container);
|
|
51996
|
+
const quick = exports2.get(symbol.escapedName);
|
|
51997
51997
|
if (quick && getSymbolIfSameReference(quick, symbol)) {
|
|
51998
51998
|
return quick;
|
|
51999
51999
|
}
|
|
52000
|
-
return forEachEntry(
|
|
52000
|
+
return forEachEntry(exports2, (exported) => {
|
|
52001
52001
|
if (getSymbolIfSameReference(exported, symbol)) {
|
|
52002
52002
|
return exported;
|
|
52003
52003
|
}
|
|
@@ -54246,8 +54246,8 @@ function createTypeChecker(host) {
|
|
|
54246
54246
|
context.flags ^= 16777216 /* InInitialEntityName */;
|
|
54247
54247
|
} else {
|
|
54248
54248
|
if (parent2 && getExportsOfSymbol(parent2)) {
|
|
54249
|
-
const
|
|
54250
|
-
forEachEntry(
|
|
54249
|
+
const exports2 = getExportsOfSymbol(parent2);
|
|
54250
|
+
forEachEntry(exports2, (ex, name) => {
|
|
54251
54251
|
if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name) && name !== "export=" /* ExportEquals */) {
|
|
54252
54252
|
symbolName2 = unescapeLeadingUnderscores(name);
|
|
54253
54253
|
return true;
|
|
@@ -54871,8 +54871,8 @@ function createTypeChecker(host) {
|
|
|
54871
54871
|
return statements;
|
|
54872
54872
|
}
|
|
54873
54873
|
function mergeExportDeclarations(statements) {
|
|
54874
|
-
const
|
|
54875
|
-
if (length(
|
|
54874
|
+
const exports2 = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
|
|
54875
|
+
if (length(exports2) > 1) {
|
|
54876
54876
|
const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause);
|
|
54877
54877
|
statements = [
|
|
54878
54878
|
...nonExports,
|
|
@@ -54881,7 +54881,7 @@ function createTypeChecker(host) {
|
|
|
54881
54881
|
void 0,
|
|
54882
54882
|
/*isTypeOnly*/
|
|
54883
54883
|
false,
|
|
54884
|
-
factory.createNamedExports(flatMap(
|
|
54884
|
+
factory.createNamedExports(flatMap(exports2, (e) => cast(e.exportClause, isNamedExports).elements)),
|
|
54885
54885
|
/*moduleSpecifier*/
|
|
54886
54886
|
void 0
|
|
54887
54887
|
)
|
|
@@ -55264,8 +55264,8 @@ function createTypeChecker(host) {
|
|
|
55264
55264
|
);
|
|
55265
55265
|
}
|
|
55266
55266
|
function getNamespaceMembersForSerialization(symbol) {
|
|
55267
|
-
const
|
|
55268
|
-
return !
|
|
55267
|
+
const exports2 = getExportsOfSymbol(symbol);
|
|
55268
|
+
return !exports2 ? [] : filter(arrayFrom(exports2.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
55269
55269
|
}
|
|
55270
55270
|
function isTypeOnlyNamespace(symbol) {
|
|
55271
55271
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -57067,19 +57067,19 @@ function createTypeChecker(host) {
|
|
|
57067
57067
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
57068
57068
|
return void 0;
|
|
57069
57069
|
}
|
|
57070
|
-
const
|
|
57070
|
+
const exports2 = createSymbolTable();
|
|
57071
57071
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
57072
57072
|
const s2 = getSymbolOfNode(decl);
|
|
57073
57073
|
if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
|
|
57074
|
-
mergeSymbolTable(
|
|
57074
|
+
mergeSymbolTable(exports2, s2.exports);
|
|
57075
57075
|
}
|
|
57076
57076
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
57077
57077
|
}
|
|
57078
57078
|
const s = getSymbolOfNode(decl);
|
|
57079
57079
|
if ((_b = s == null ? void 0 : s.exports) == null ? void 0 : _b.size) {
|
|
57080
|
-
mergeSymbolTable(
|
|
57080
|
+
mergeSymbolTable(exports2, s.exports);
|
|
57081
57081
|
}
|
|
57082
|
-
const type = createAnonymousType(symbol,
|
|
57082
|
+
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
57083
57083
|
type.objectFlags |= 4096 /* JSLiteral */;
|
|
57084
57084
|
return type;
|
|
57085
57085
|
}
|
|
@@ -74252,8 +74252,8 @@ function createTypeChecker(host) {
|
|
|
74252
74252
|
}
|
|
74253
74253
|
function getJsxType(name, location) {
|
|
74254
74254
|
const namespace = getJsxNamespaceAt(location);
|
|
74255
|
-
const
|
|
74256
|
-
const typeSymbol =
|
|
74255
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
74256
|
+
const typeSymbol = exports2 && getSymbol2(exports2, name, 788968 /* Type */);
|
|
74257
74257
|
return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
|
|
74258
74258
|
}
|
|
74259
74259
|
function getIntrinsicTagSymbol(node) {
|
|
@@ -77083,8 +77083,8 @@ function createTypeChecker(host) {
|
|
|
77083
77083
|
}
|
|
77084
77084
|
function createSignatureForJSXIntrinsic(node, result) {
|
|
77085
77085
|
const namespace = getJsxNamespaceAt(node);
|
|
77086
|
-
const
|
|
77087
|
-
const typeSymbol =
|
|
77086
|
+
const exports2 = namespace && getExportsOfSymbol(namespace);
|
|
77087
|
+
const typeSymbol = exports2 && getSymbol2(exports2, JsxNames.Element, 788968 /* Type */);
|
|
77088
77088
|
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
|
|
77089
77089
|
const declaration = factory.createFunctionTypeNode(
|
|
77090
77090
|
/*typeParameters*/
|
|
@@ -85837,9 +85837,9 @@ function createTypeChecker(host) {
|
|
|
85837
85837
|
error2(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
|
|
85838
85838
|
}
|
|
85839
85839
|
}
|
|
85840
|
-
const
|
|
85841
|
-
if (
|
|
85842
|
-
|
|
85840
|
+
const exports2 = getExportsOfModule(moduleSymbol);
|
|
85841
|
+
if (exports2) {
|
|
85842
|
+
exports2.forEach(({ declarations, flags }, id) => {
|
|
85843
85843
|
if (id === "__export") {
|
|
85844
85844
|
return;
|
|
85845
85845
|
}
|
|
@@ -87704,8 +87704,8 @@ function createTypeChecker(host) {
|
|
|
87704
87704
|
return false;
|
|
87705
87705
|
if (importTarget === file)
|
|
87706
87706
|
return false;
|
|
87707
|
-
const
|
|
87708
|
-
for (const s of arrayFrom(
|
|
87707
|
+
const exports2 = getExportsOfModule(file.symbol);
|
|
87708
|
+
for (const s of arrayFrom(exports2.values())) {
|
|
87709
87709
|
if (s.mergeId) {
|
|
87710
87710
|
const merged = getMergedSymbol(s);
|
|
87711
87711
|
if (merged.declarations) {
|
|
@@ -111172,7 +111172,7 @@ function transformSystemModule(context) {
|
|
|
111172
111172
|
const exportStarFunction = factory2.createUniqueName("exportStar");
|
|
111173
111173
|
const m = factory2.createIdentifier("m");
|
|
111174
111174
|
const n = factory2.createIdentifier("n");
|
|
111175
|
-
const
|
|
111175
|
+
const exports2 = factory2.createIdentifier("exports");
|
|
111176
111176
|
let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default"));
|
|
111177
111177
|
if (localNames) {
|
|
111178
111178
|
condition = factory2.createLogicalAnd(
|
|
@@ -111211,7 +111211,7 @@ function transformSystemModule(context) {
|
|
|
111211
111211
|
void 0,
|
|
111212
111212
|
factory2.createVariableDeclarationList([
|
|
111213
111213
|
factory2.createVariableDeclaration(
|
|
111214
|
-
|
|
111214
|
+
exports2,
|
|
111215
111215
|
/*exclamationToken*/
|
|
111216
111216
|
void 0,
|
|
111217
111217
|
/*type*/
|
|
@@ -111231,7 +111231,7 @@ function transformSystemModule(context) {
|
|
|
111231
111231
|
condition,
|
|
111232
111232
|
factory2.createExpressionStatement(
|
|
111233
111233
|
factory2.createAssignment(
|
|
111234
|
-
factory2.createElementAccessExpression(
|
|
111234
|
+
factory2.createElementAccessExpression(exports2, n),
|
|
111235
111235
|
factory2.createElementAccessExpression(m, n)
|
|
111236
111236
|
)
|
|
111237
111237
|
)
|
|
@@ -111245,7 +111245,7 @@ function transformSystemModule(context) {
|
|
|
111245
111245
|
exportFunction,
|
|
111246
111246
|
/*typeArguments*/
|
|
111247
111247
|
void 0,
|
|
111248
|
-
[
|
|
111248
|
+
[exports2]
|
|
111249
111249
|
)
|
|
111250
111250
|
)
|
|
111251
111251
|
],
|
|
@@ -140696,9 +140696,9 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
|
|
|
140696
140696
|
var _a;
|
|
140697
140697
|
return needExport.has(Debug.checkDefined((_a = tryCast(d, canHaveSymbol)) == null ? void 0 : _a.symbol));
|
|
140698
140698
|
})) {
|
|
140699
|
-
const
|
|
140700
|
-
if (
|
|
140701
|
-
return
|
|
140699
|
+
const exports2 = addExport(getSynthesizedDeepClone(statement), useEs6Exports);
|
|
140700
|
+
if (exports2)
|
|
140701
|
+
return exports2;
|
|
140702
140702
|
}
|
|
140703
140703
|
return getSynthesizedDeepClone(statement);
|
|
140704
140704
|
});
|
|
@@ -149890,8 +149890,8 @@ function fixImportOfModuleExports(importingFile, exportingFile, program, changes
|
|
|
149890
149890
|
}
|
|
149891
149891
|
function convertFileToEsModule(sourceFile, checker, changes, target, quotePreference) {
|
|
149892
149892
|
const identifiers = { original: collectFreeIdentifiers(sourceFile), additional: /* @__PURE__ */ new Set() };
|
|
149893
|
-
const
|
|
149894
|
-
convertExportsAccesses(sourceFile,
|
|
149893
|
+
const exports2 = collectExportRenames(sourceFile, checker, identifiers);
|
|
149894
|
+
convertExportsAccesses(sourceFile, exports2, changes);
|
|
149895
149895
|
let moduleExportsChangedToDefault = false;
|
|
149896
149896
|
let useSitesToUnqualify;
|
|
149897
149897
|
for (const statement of filter(sourceFile.statements, isVariableStatement)) {
|
|
@@ -149901,7 +149901,7 @@ function convertFileToEsModule(sourceFile, checker, changes, target, quotePrefer
|
|
|
149901
149901
|
}
|
|
149902
149902
|
}
|
|
149903
149903
|
for (const statement of filter(sourceFile.statements, (s) => !isVariableStatement(s))) {
|
|
149904
|
-
const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target,
|
|
149904
|
+
const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference);
|
|
149905
149905
|
moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged;
|
|
149906
149906
|
}
|
|
149907
149907
|
useSitesToUnqualify == null ? void 0 : useSitesToUnqualify.forEach((replacement, original) => {
|
|
@@ -149925,13 +149925,13 @@ function collectExportRenames(sourceFile, checker, identifiers) {
|
|
|
149925
149925
|
});
|
|
149926
149926
|
return res;
|
|
149927
149927
|
}
|
|
149928
|
-
function convertExportsAccesses(sourceFile,
|
|
149928
|
+
function convertExportsAccesses(sourceFile, exports2, changes) {
|
|
149929
149929
|
forEachExportReference(sourceFile, (node, isAssignmentLhs) => {
|
|
149930
149930
|
if (isAssignmentLhs) {
|
|
149931
149931
|
return;
|
|
149932
149932
|
}
|
|
149933
149933
|
const { text } = node.name;
|
|
149934
|
-
changes.replaceNode(sourceFile, node, factory.createIdentifier(
|
|
149934
|
+
changes.replaceNode(sourceFile, node, factory.createIdentifier(exports2.get(text) || text));
|
|
149935
149935
|
});
|
|
149936
149936
|
}
|
|
149937
149937
|
function forEachExportReference(sourceFile, cb) {
|
|
@@ -149943,7 +149943,7 @@ function forEachExportReference(sourceFile, cb) {
|
|
|
149943
149943
|
node.forEachChild(recur);
|
|
149944
149944
|
});
|
|
149945
149945
|
}
|
|
149946
|
-
function convertStatement(sourceFile, statement, checker, changes, identifiers, target,
|
|
149946
|
+
function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports2, useSitesToUnqualify, quotePreference) {
|
|
149947
149947
|
switch (statement.kind) {
|
|
149948
149948
|
case 243 /* VariableStatement */:
|
|
149949
149949
|
convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);
|
|
@@ -149970,7 +149970,7 @@ function convertStatement(sourceFile, statement, checker, changes, identifiers,
|
|
|
149970
149970
|
}
|
|
149971
149971
|
case 226 /* BinaryExpression */: {
|
|
149972
149972
|
const { operatorToken } = expression;
|
|
149973
|
-
return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes,
|
|
149973
|
+
return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports2, useSitesToUnqualify);
|
|
149974
149974
|
}
|
|
149975
149975
|
}
|
|
149976
149976
|
}
|
|
@@ -150041,7 +150041,7 @@ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identi
|
|
|
150041
150041
|
return Debug.assertNever(name, `Convert to ES module got invalid syntax form ${name.kind}`);
|
|
150042
150042
|
}
|
|
150043
150043
|
}
|
|
150044
|
-
function convertAssignment(sourceFile, checker, assignment, changes,
|
|
150044
|
+
function convertAssignment(sourceFile, checker, assignment, changes, exports2, useSitesToUnqualify) {
|
|
150045
150045
|
const { left, right } = assignment;
|
|
150046
150046
|
if (!isPropertyAccessExpression(left)) {
|
|
150047
150047
|
return false;
|
|
@@ -150064,7 +150064,7 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports, us
|
|
|
150064
150064
|
}
|
|
150065
150065
|
}
|
|
150066
150066
|
} else if (isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) {
|
|
150067
|
-
convertNamedExport(sourceFile, assignment, changes,
|
|
150067
|
+
convertNamedExport(sourceFile, assignment, changes, exports2);
|
|
150068
150068
|
}
|
|
150069
150069
|
return false;
|
|
150070
150070
|
}
|
|
@@ -150086,9 +150086,9 @@ function tryChangeModuleExportsObject(object, useSitesToUnqualify) {
|
|
|
150086
150086
|
});
|
|
150087
150087
|
return statements && [statements, false];
|
|
150088
150088
|
}
|
|
150089
|
-
function convertNamedExport(sourceFile, assignment, changes,
|
|
150089
|
+
function convertNamedExport(sourceFile, assignment, changes, exports2) {
|
|
150090
150090
|
const { text } = assignment.left.name;
|
|
150091
|
-
const rename =
|
|
150091
|
+
const rename = exports2.get(text);
|
|
150092
150092
|
if (rename !== void 0) {
|
|
150093
150093
|
const newNodes = [
|
|
150094
150094
|
makeConst(
|
|
@@ -150112,10 +150112,10 @@ function convertNamedExport(sourceFile, assignment, changes, exports) {
|
|
|
150112
150112
|
function convertReExportAll(reExported, checker) {
|
|
150113
150113
|
const moduleSpecifier = reExported.text;
|
|
150114
150114
|
const moduleSymbol = checker.getSymbolAtLocation(reExported);
|
|
150115
|
-
const
|
|
150116
|
-
return
|
|
150115
|
+
const exports2 = moduleSymbol ? moduleSymbol.exports : emptyMap;
|
|
150116
|
+
return exports2.has("export=" /* ExportEquals */) ? [[reExportDefault(moduleSpecifier)], true] : !exports2.has("default" /* Default */) ? [[reExportStar(moduleSpecifier)], false] : (
|
|
150117
150117
|
// If there's some non-default export, must include both `export *` and `export default`.
|
|
150118
|
-
|
|
150118
|
+
exports2.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]
|
|
150119
150119
|
);
|
|
150120
150120
|
}
|
|
150121
150121
|
function reExportStar(moduleSpecifier) {
|
|
@@ -152641,7 +152641,7 @@ registerCodeFix({
|
|
|
152641
152641
|
getAllCodeActions(context) {
|
|
152642
152642
|
const { program } = context;
|
|
152643
152643
|
return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
|
|
152644
|
-
const
|
|
152644
|
+
const exports2 = /* @__PURE__ */ new Map();
|
|
152645
152645
|
eachDiagnostic(context, errorCodes23, (diag2) => {
|
|
152646
152646
|
const info = getInfo7(diag2.file, diag2.start, program);
|
|
152647
152647
|
if (info === void 0)
|
|
@@ -152650,16 +152650,16 @@ registerCodeFix({
|
|
|
152650
152650
|
if (tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly) === void 0 && canHaveExportModifier(node)) {
|
|
152651
152651
|
changes.insertExportModifier(moduleSourceFile, node);
|
|
152652
152652
|
} else {
|
|
152653
|
-
const moduleExports =
|
|
152653
|
+
const moduleExports = exports2.get(moduleSourceFile) || { typeOnlyExports: [], exports: [] };
|
|
152654
152654
|
if (exportName.isTypeOnly) {
|
|
152655
152655
|
moduleExports.typeOnlyExports.push(exportName);
|
|
152656
152656
|
} else {
|
|
152657
152657
|
moduleExports.exports.push(exportName);
|
|
152658
152658
|
}
|
|
152659
|
-
|
|
152659
|
+
exports2.set(moduleSourceFile, moduleExports);
|
|
152660
152660
|
}
|
|
152661
152661
|
});
|
|
152662
|
-
|
|
152662
|
+
exports2.forEach((moduleExports, moduleSourceFile) => {
|
|
152663
152663
|
const exportDeclaration = tryGetExportDeclaration(
|
|
152664
152664
|
moduleSourceFile,
|
|
152665
152665
|
/*isTypeOnly*/
|
|
@@ -160902,9 +160902,9 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160902
160902
|
}
|
|
160903
160903
|
completionKind = 3 /* MemberLike */;
|
|
160904
160904
|
isNewIdentifierLocation = false;
|
|
160905
|
-
const
|
|
160905
|
+
const exports2 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol);
|
|
160906
160906
|
const existing = new Set(namedImportsOrExports.elements.filter((n) => !isCurrentlyEditingNode(n)).map((n) => (n.propertyName || n.name).escapedText));
|
|
160907
|
-
const uniques =
|
|
160907
|
+
const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
|
|
160908
160908
|
symbols = concatenate(symbols, uniques);
|
|
160909
160909
|
if (!uniques.length) {
|
|
160910
160910
|
keywordFilters = 0 /* None */;
|
|
@@ -162506,12 +162506,12 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, c
|
|
|
162506
162506
|
const packageFile = combinePaths(packageDirectory, "package.json");
|
|
162507
162507
|
if (tryFileExists(host, packageFile)) {
|
|
162508
162508
|
const packageJson = readJson(packageFile, host);
|
|
162509
|
-
const
|
|
162510
|
-
if (
|
|
162511
|
-
if (typeof
|
|
162509
|
+
const exports2 = packageJson.exports;
|
|
162510
|
+
if (exports2) {
|
|
162511
|
+
if (typeof exports2 !== "object" || exports2 === null) {
|
|
162512
162512
|
return;
|
|
162513
162513
|
}
|
|
162514
|
-
const keys = getOwnKeys(
|
|
162514
|
+
const keys = getOwnKeys(exports2);
|
|
162515
162515
|
const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
|
|
162516
162516
|
const conditions = getConditions(compilerOptions, mode);
|
|
162517
162517
|
addCompletionEntriesFromPathsOrExports(
|
|
@@ -162521,7 +162521,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, c
|
|
|
162521
162521
|
extensionOptions,
|
|
162522
162522
|
host,
|
|
162523
162523
|
keys,
|
|
162524
|
-
(key) => singleElementArray(getPatternFromFirstMatchingCondition(
|
|
162524
|
+
(key) => singleElementArray(getPatternFromFirstMatchingCondition(exports2[key], conditions)),
|
|
162525
162525
|
comparePatternKeys
|
|
162526
162526
|
);
|
|
162527
162527
|
return;
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231220`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20231220`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
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.4.0-dev.
|
|
5
|
+
"version": "5.4.0-dev.20231220",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "63babdf7dacebcca2673a9e2b8d5dd2d7dcc6017"
|
|
117
117
|
}
|