@typescript-deploys/pr-build 5.6.0-pr-58668-2 → 5.6.0-pr-58514-9
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 +15 -18
- package/lib/typescript.js +15 -18
- package/package.json +1 -1
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.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240610`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -19189,7 +19189,7 @@ function createNameResolver({
|
|
|
19189
19189
|
}
|
|
19190
19190
|
break;
|
|
19191
19191
|
}
|
|
19192
|
-
if (isSelfReferenceLocation(location)) {
|
|
19192
|
+
if (isSelfReferenceLocation(location, lastLocation)) {
|
|
19193
19193
|
lastSelfReferenceLocation = location;
|
|
19194
19194
|
}
|
|
19195
19195
|
lastLocation = location;
|
|
@@ -19290,8 +19290,10 @@ function createNameResolver({
|
|
|
19290
19290
|
}
|
|
19291
19291
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
19292
19292
|
}
|
|
19293
|
-
function isSelfReferenceLocation(node) {
|
|
19293
|
+
function isSelfReferenceLocation(node, lastLocation) {
|
|
19294
19294
|
switch (node.kind) {
|
|
19295
|
+
case 169 /* Parameter */:
|
|
19296
|
+
return !!lastLocation && lastLocation === node.name;
|
|
19295
19297
|
case 262 /* FunctionDeclaration */:
|
|
19296
19298
|
case 263 /* ClassDeclaration */:
|
|
19297
19299
|
case 264 /* InterfaceDeclaration */:
|
|
@@ -46513,8 +46515,6 @@ function createTypeChecker(host) {
|
|
|
46513
46515
|
moduleName,
|
|
46514
46516
|
moduleName,
|
|
46515
46517
|
moduleNotFoundError,
|
|
46516
|
-
/*ignoreErrors*/
|
|
46517
|
-
false,
|
|
46518
46518
|
/*isForAugmentation*/
|
|
46519
46519
|
true
|
|
46520
46520
|
);
|
|
@@ -48082,14 +48082,14 @@ function createTypeChecker(host) {
|
|
|
48082
48082
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
48083
48083
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
48084
48084
|
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
48085
|
-
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage
|
|
48085
|
+
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
48086
48086
|
}
|
|
48087
|
-
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError,
|
|
48088
|
-
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError,
|
|
48087
|
+
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
48088
|
+
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
48089
48089
|
}
|
|
48090
48090
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
48091
48091
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
48092
|
-
if (
|
|
48092
|
+
if (startsWith(moduleReference, "@types/")) {
|
|
48093
48093
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
48094
48094
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
48095
48095
|
error(errorNode, diag2, withoutAtTypePrefix, moduleReference);
|
|
@@ -48111,7 +48111,7 @@ function createTypeChecker(host) {
|
|
|
48111
48111
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
48112
48112
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
48113
48113
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
48114
|
-
const resolutionDiagnostic =
|
|
48114
|
+
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
48115
48115
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
48116
48116
|
if (sourceFile) {
|
|
48117
48117
|
if (resolutionDiagnostic) {
|
|
@@ -48119,7 +48119,7 @@ function createTypeChecker(host) {
|
|
|
48119
48119
|
}
|
|
48120
48120
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
48121
48121
|
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
48122
|
-
if (
|
|
48122
|
+
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
48123
48123
|
error(
|
|
48124
48124
|
errorNode,
|
|
48125
48125
|
Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
|
|
@@ -48128,13 +48128,13 @@ function createTypeChecker(host) {
|
|
|
48128
48128
|
}
|
|
48129
48129
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
48130
48130
|
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
48131
|
-
if (
|
|
48131
|
+
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
48132
48132
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
48133
48133
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
48134
48134
|
}
|
|
48135
48135
|
}
|
|
48136
48136
|
if (sourceFile.symbol) {
|
|
48137
|
-
if (
|
|
48137
|
+
if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
48138
48138
|
errorOnImplicitAnyModule(
|
|
48139
48139
|
/*isError*/
|
|
48140
48140
|
false,
|
|
@@ -48145,7 +48145,7 @@ function createTypeChecker(host) {
|
|
|
48145
48145
|
moduleReference
|
|
48146
48146
|
);
|
|
48147
48147
|
}
|
|
48148
|
-
if (
|
|
48148
|
+
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
48149
48149
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
48150
48150
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
48151
48151
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -48205,7 +48205,7 @@ function createTypeChecker(host) {
|
|
|
48205
48205
|
}
|
|
48206
48206
|
return getMergedSymbol(sourceFile.symbol);
|
|
48207
48207
|
}
|
|
48208
|
-
if (
|
|
48208
|
+
if (moduleNotFoundError) {
|
|
48209
48209
|
error(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName);
|
|
48210
48210
|
}
|
|
48211
48211
|
return void 0;
|
|
@@ -48220,9 +48220,6 @@ function createTypeChecker(host) {
|
|
|
48220
48220
|
return getMergedSymbol(pattern.symbol);
|
|
48221
48221
|
}
|
|
48222
48222
|
}
|
|
48223
|
-
if (!errorNode) {
|
|
48224
|
-
return void 0;
|
|
48225
|
-
}
|
|
48226
48223
|
if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
|
|
48227
48224
|
if (isForAugmentation) {
|
|
48228
48225
|
const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
|
package/lib/typescript.js
CHANGED
|
@@ -2375,7 +2375,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2375
2375
|
|
|
2376
2376
|
// src/compiler/corePublic.ts
|
|
2377
2377
|
var versionMajorMinor = "5.6";
|
|
2378
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2378
|
+
var version = `${versionMajorMinor}.0-insiders.20240610`;
|
|
2379
2379
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2380
2380
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2381
2381
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -23436,7 +23436,7 @@ function createNameResolver({
|
|
|
23436
23436
|
}
|
|
23437
23437
|
break;
|
|
23438
23438
|
}
|
|
23439
|
-
if (isSelfReferenceLocation(location)) {
|
|
23439
|
+
if (isSelfReferenceLocation(location, lastLocation)) {
|
|
23440
23440
|
lastSelfReferenceLocation = location;
|
|
23441
23441
|
}
|
|
23442
23442
|
lastLocation = location;
|
|
@@ -23537,8 +23537,10 @@ function createNameResolver({
|
|
|
23537
23537
|
}
|
|
23538
23538
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
23539
23539
|
}
|
|
23540
|
-
function isSelfReferenceLocation(node) {
|
|
23540
|
+
function isSelfReferenceLocation(node, lastLocation) {
|
|
23541
23541
|
switch (node.kind) {
|
|
23542
|
+
case 169 /* Parameter */:
|
|
23543
|
+
return !!lastLocation && lastLocation === node.name;
|
|
23542
23544
|
case 262 /* FunctionDeclaration */:
|
|
23543
23545
|
case 263 /* ClassDeclaration */:
|
|
23544
23546
|
case 264 /* InterfaceDeclaration */:
|
|
@@ -51286,8 +51288,6 @@ function createTypeChecker(host) {
|
|
|
51286
51288
|
moduleName,
|
|
51287
51289
|
moduleName,
|
|
51288
51290
|
moduleNotFoundError,
|
|
51289
|
-
/*ignoreErrors*/
|
|
51290
|
-
false,
|
|
51291
51291
|
/*isForAugmentation*/
|
|
51292
51292
|
true
|
|
51293
51293
|
);
|
|
@@ -52855,14 +52855,14 @@ function createTypeChecker(host) {
|
|
|
52855
52855
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
52856
52856
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
52857
52857
|
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
52858
|
-
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage
|
|
52858
|
+
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
52859
52859
|
}
|
|
52860
|
-
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError,
|
|
52861
|
-
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError,
|
|
52860
|
+
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
52861
|
+
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
52862
52862
|
}
|
|
52863
52863
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
52864
52864
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
52865
|
-
if (
|
|
52865
|
+
if (startsWith(moduleReference, "@types/")) {
|
|
52866
52866
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
52867
52867
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
52868
52868
|
error2(errorNode, diag2, withoutAtTypePrefix, moduleReference);
|
|
@@ -52884,7 +52884,7 @@ function createTypeChecker(host) {
|
|
|
52884
52884
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
52885
52885
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
52886
52886
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
52887
|
-
const resolutionDiagnostic =
|
|
52887
|
+
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
52888
52888
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
52889
52889
|
if (sourceFile) {
|
|
52890
52890
|
if (resolutionDiagnostic) {
|
|
@@ -52892,7 +52892,7 @@ function createTypeChecker(host) {
|
|
|
52892
52892
|
}
|
|
52893
52893
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
52894
52894
|
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
52895
|
-
if (
|
|
52895
|
+
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
52896
52896
|
error2(
|
|
52897
52897
|
errorNode,
|
|
52898
52898
|
Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
|
|
@@ -52901,13 +52901,13 @@ function createTypeChecker(host) {
|
|
|
52901
52901
|
}
|
|
52902
52902
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
52903
52903
|
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
52904
|
-
if (
|
|
52904
|
+
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
52905
52905
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
52906
52906
|
error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
52907
52907
|
}
|
|
52908
52908
|
}
|
|
52909
52909
|
if (sourceFile.symbol) {
|
|
52910
|
-
if (
|
|
52910
|
+
if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
52911
52911
|
errorOnImplicitAnyModule(
|
|
52912
52912
|
/*isError*/
|
|
52913
52913
|
false,
|
|
@@ -52918,7 +52918,7 @@ function createTypeChecker(host) {
|
|
|
52918
52918
|
moduleReference
|
|
52919
52919
|
);
|
|
52920
52920
|
}
|
|
52921
|
-
if (
|
|
52921
|
+
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
52922
52922
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
52923
52923
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
52924
52924
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -52978,7 +52978,7 @@ function createTypeChecker(host) {
|
|
|
52978
52978
|
}
|
|
52979
52979
|
return getMergedSymbol(sourceFile.symbol);
|
|
52980
52980
|
}
|
|
52981
|
-
if (
|
|
52981
|
+
if (moduleNotFoundError) {
|
|
52982
52982
|
error2(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName);
|
|
52983
52983
|
}
|
|
52984
52984
|
return void 0;
|
|
@@ -52993,9 +52993,6 @@ function createTypeChecker(host) {
|
|
|
52993
52993
|
return getMergedSymbol(pattern.symbol);
|
|
52994
52994
|
}
|
|
52995
52995
|
}
|
|
52996
|
-
if (!errorNode) {
|
|
52997
|
-
return void 0;
|
|
52998
|
-
}
|
|
52999
52996
|
if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
|
|
53000
52997
|
if (isForAugmentation) {
|
|
53001
52998
|
const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-pr-
|
|
5
|
+
"version": "5.6.0-pr-58514-9",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|