typescript 5.9.0-dev.20250604 → 5.9.0-dev.20250605
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 +81 -108
- package/lib/cs/diagnosticMessages.generated.json +1 -1
- package/lib/de/diagnosticMessages.generated.json +1 -1
- package/lib/es/diagnosticMessages.generated.json +1 -1
- package/lib/fr/diagnosticMessages.generated.json +1 -1
- package/lib/it/diagnosticMessages.generated.json +1 -1
- package/lib/ja/diagnosticMessages.generated.json +1 -1
- package/lib/ko/diagnosticMessages.generated.json +1 -1
- package/lib/pl/diagnosticMessages.generated.json +1 -1
- package/lib/pt-br/diagnosticMessages.generated.json +1 -1
- package/lib/ru/diagnosticMessages.generated.json +1 -1
- package/lib/tr/diagnosticMessages.generated.json +1 -1
- package/lib/typescript.js +85 -112
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +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.9";
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20250605`;
|
22
22
|
|
23
23
|
// src/compiler/core.ts
|
24
24
|
var emptyArray = [];
|
@@ -16534,7 +16534,7 @@ function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
|
|
16534
16534
|
if (forceDtsEmit) return true;
|
16535
16535
|
if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) return false;
|
16536
16536
|
if (!isJsonSourceFile(sourceFile)) return true;
|
16537
|
-
if (host.
|
16537
|
+
if (host.getRedirectFromSourceFile(sourceFile.fileName)) return false;
|
16538
16538
|
if (options.outFile) return true;
|
16539
16539
|
if (!options.outDir) return false;
|
16540
16540
|
if (options.rootDir || options.composite && options.configFilePath) {
|
@@ -19967,7 +19967,7 @@ function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
19967
19967
|
/*projectReferences*/
|
19968
19968
|
void 0,
|
19969
19969
|
resolvedProjectReferences,
|
19970
|
-
(resolvedRef
|
19970
|
+
(resolvedRef) => resolvedRef && cb(resolvedRef)
|
19971
19971
|
);
|
19972
19972
|
}
|
19973
19973
|
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
@@ -45462,10 +45462,10 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
|
|
45462
45462
|
);
|
45463
45463
|
}
|
45464
45464
|
function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
|
45465
|
-
var _a;
|
45465
|
+
var _a, _b;
|
45466
45466
|
const getCanonicalFileName = hostGetCanonicalFileName(host);
|
45467
45467
|
const cwd = host.getCurrentDirectory();
|
45468
|
-
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.
|
45468
|
+
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? (_a = host.getRedirectFromSourceFile(importedFileName)) == null ? void 0 : _a.outputDts : void 0;
|
45469
45469
|
const importedPath = toPath(importedFileName, cwd, getCanonicalFileName);
|
45470
45470
|
const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray;
|
45471
45471
|
const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects];
|
@@ -45475,7 +45475,7 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
|
|
45475
45475
|
const result2 = forEach(targets, (p) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p));
|
45476
45476
|
if (result2) return result2;
|
45477
45477
|
}
|
45478
|
-
const symlinkedDirectories = (
|
45478
|
+
const symlinkedDirectories = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host).getSymlinkedDirectoriesByRealpath();
|
45479
45479
|
const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
|
45480
45480
|
const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache(
|
45481
45481
|
host,
|
@@ -49222,7 +49222,7 @@ function createTypeChecker(host) {
|
|
49222
49222
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0;
|
49223
49223
|
}
|
49224
49224
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
49225
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
49225
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
49226
49226
|
if (errorNode && startsWith(moduleReference, "@types/")) {
|
49227
49227
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
49228
49228
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
@@ -49281,7 +49281,7 @@ function createTypeChecker(host) {
|
|
49281
49281
|
getAnyExtensionFromPath(moduleReference)
|
49282
49282
|
);
|
49283
49283
|
} else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
|
49284
|
-
const redirect = host.
|
49284
|
+
const redirect = (_i = host.getRedirectFromSourceFile(sourceFile.path)) == null ? void 0 : _i.resolvedRef;
|
49285
49285
|
if (redirect) {
|
49286
49286
|
const ignoreCase = !host.useCaseSensitiveFileNames();
|
49287
49287
|
const ownRootDir = host.getCommonSourceDirectory();
|
@@ -49321,7 +49321,7 @@ function createTypeChecker(host) {
|
|
49321
49321
|
if (ext === ".ts" /* Ts */ || ext === ".js" /* Js */ || ext === ".tsx" /* Tsx */ || ext === ".jsx" /* Jsx */) {
|
49322
49322
|
diagnosticDetails = createModeMismatchDetails(currentSourceFile);
|
49323
49323
|
}
|
49324
|
-
const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((
|
49324
|
+
const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((_j = overrideHost.importClause) == null ? void 0 : _j.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 205 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead;
|
49325
49325
|
diagnostics.add(createDiagnosticForNodeFromMessageChain(
|
49326
49326
|
getSourceFileOfNode(errorNode),
|
49327
49327
|
errorNode,
|
@@ -49369,9 +49369,9 @@ function createTypeChecker(host) {
|
|
49369
49369
|
}
|
49370
49370
|
if (moduleNotFoundError) {
|
49371
49371
|
if (resolvedModule) {
|
49372
|
-
const redirect = host.
|
49373
|
-
if (redirect) {
|
49374
|
-
error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
|
49372
|
+
const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName);
|
49373
|
+
if (redirect == null ? void 0 : redirect.outputDts) {
|
49374
|
+
error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName);
|
49375
49375
|
return void 0;
|
49376
49376
|
}
|
49377
49377
|
}
|
@@ -49384,14 +49384,14 @@ function createTypeChecker(host) {
|
|
49384
49384
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
49385
49385
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
49386
49386
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
49387
|
-
const suggestedExt = (
|
49387
|
+
const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
|
49388
49388
|
if (suggestedExt) {
|
49389
49389
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
49390
49390
|
} else {
|
49391
49391
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
49392
49392
|
}
|
49393
49393
|
} else {
|
49394
|
-
if ((
|
49394
|
+
if ((_l = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _l.alternateResult) {
|
49395
49395
|
const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference);
|
49396
49396
|
errorOrSuggestion(
|
49397
49397
|
/*isError*/
|
@@ -80538,6 +80538,7 @@ function createTypeChecker(host) {
|
|
80538
80538
|
return type;
|
80539
80539
|
}
|
80540
80540
|
function checkConstEnumAccess(node, type) {
|
80541
|
+
var _a;
|
80541
80542
|
const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 281 /* ExportSpecifier */;
|
80542
80543
|
if (!ok) {
|
80543
80544
|
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
|
@@ -80555,7 +80556,7 @@ function createTypeChecker(host) {
|
|
80555
80556
|
)) {
|
80556
80557
|
Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
|
80557
80558
|
const constEnumDeclaration = type.symbol.valueDeclaration;
|
80558
|
-
const redirect = host.
|
80559
|
+
const redirect = (_a = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _a.resolvedRef;
|
80559
80560
|
if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
|
80560
80561
|
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
80561
80562
|
}
|
@@ -85511,7 +85512,7 @@ function createTypeChecker(host) {
|
|
85511
85512
|
}
|
85512
85513
|
}
|
85513
85514
|
function checkAliasSymbol(node) {
|
85514
|
-
var _a, _b, _c, _d;
|
85515
|
+
var _a, _b, _c, _d, _e;
|
85515
85516
|
let symbol = getSymbolOfDeclaration(node);
|
85516
85517
|
const target = resolveAlias(symbol);
|
85517
85518
|
if (target !== unknownSymbol) {
|
@@ -85605,7 +85606,7 @@ function createTypeChecker(host) {
|
|
85605
85606
|
}
|
85606
85607
|
if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) {
|
85607
85608
|
const constEnumDeclaration = target.valueDeclaration;
|
85608
|
-
const redirect = host.
|
85609
|
+
const redirect = (_e = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _e.resolvedRef;
|
85609
85610
|
if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
|
85610
85611
|
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
85611
85612
|
}
|
@@ -89994,7 +89995,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
89994
89995
|
},
|
89995
89996
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
89996
89997
|
redirectTargetsMap: host.redirectTargetsMap,
|
89997
|
-
|
89998
|
+
getRedirectFromSourceFile: (fileName) => host.getRedirectFromSourceFile(fileName),
|
89998
89999
|
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
89999
90000
|
fileExists: (fileName) => host.fileExists(fileName),
|
90000
90001
|
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
@@ -121860,8 +121861,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
121860
121861
|
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
|
121861
121862
|
let resolvedProjectReferences;
|
121862
121863
|
let projectReferenceRedirects;
|
121863
|
-
let
|
121864
|
-
let
|
121864
|
+
let mapSourceFileToResolvedRef;
|
121865
|
+
let mapOutputFileToResolvedRef;
|
121865
121866
|
const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect;
|
121866
121867
|
const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({
|
121867
121868
|
compilerHost: host,
|
@@ -121869,7 +121870,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
121869
121870
|
useSourceOfProjectReferenceRedirect,
|
121870
121871
|
toPath: toPath3,
|
121871
121872
|
getResolvedProjectReferences,
|
121872
|
-
|
121873
|
+
getRedirectFromOutput,
|
121873
121874
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
121874
121875
|
});
|
121875
121876
|
const readFile = host.readFile.bind(host);
|
@@ -122079,12 +122080,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
122079
122080
|
getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2,
|
122080
122081
|
getProjectReferences,
|
122081
122082
|
getResolvedProjectReferences,
|
122082
|
-
|
122083
|
-
getResolvedProjectReferenceToRedirect,
|
122083
|
+
getRedirectFromSourceFile,
|
122084
122084
|
getResolvedProjectReferenceByPath,
|
122085
122085
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
122086
122086
|
isSourceOfProjectReferenceRedirect,
|
122087
|
-
|
122087
|
+
getRedirectFromOutput,
|
122088
122088
|
getCompilerOptionsForFile,
|
122089
122089
|
getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2,
|
122090
122090
|
getEmitModuleFormatOfFile,
|
@@ -122213,23 +122213,14 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
122213
122213
|
return result;
|
122214
122214
|
}
|
122215
122215
|
function getRedirectReferenceForResolution(file) {
|
122216
|
-
|
122217
|
-
|
122218
|
-
|
122216
|
+
var _a2, _b2;
|
122217
|
+
const redirect = getRedirectFromSourceFile(file.originalFileName);
|
122218
|
+
if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect == null ? void 0 : redirect.resolvedRef;
|
122219
|
+
const resultFromDts = (_a2 = getRedirectFromOutput(file.path)) == null ? void 0 : _a2.resolvedRef;
|
122219
122220
|
if (resultFromDts) return resultFromDts;
|
122220
122221
|
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) return void 0;
|
122221
122222
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
122222
|
-
return realDeclarationPath === file.path ? void 0 :
|
122223
|
-
}
|
122224
|
-
function getRedirectReferenceForResolutionFromSourceOfProject(filePath) {
|
122225
|
-
const source = getSourceOfProjectReferenceRedirect(filePath);
|
122226
|
-
if (isString(source)) return getResolvedProjectReferenceToRedirect(source);
|
122227
|
-
if (!source) return void 0;
|
122228
|
-
return forEachResolvedProjectReference2((resolvedRef) => {
|
122229
|
-
const out = resolvedRef.commandLine.options.outFile;
|
122230
|
-
if (!out) return void 0;
|
122231
|
-
return toPath3(out) === filePath ? resolvedRef : void 0;
|
122232
|
-
});
|
122223
|
+
return realDeclarationPath === file.path ? void 0 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef;
|
122233
122224
|
}
|
122234
122225
|
function compareDefaultLibFiles(a, b) {
|
122235
122226
|
return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b));
|
@@ -122601,8 +122592,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
122601
122592
|
getSourceFileByPath: program.getSourceFileByPath,
|
122602
122593
|
getSourceFiles: program.getSourceFiles,
|
122603
122594
|
isSourceFileFromExternalLibrary,
|
122604
|
-
|
122605
|
-
getProjectReferenceRedirect,
|
122595
|
+
getRedirectFromSourceFile,
|
122606
122596
|
isSourceOfProjectReferenceRedirect,
|
122607
122597
|
getSymlinkCache,
|
122608
122598
|
writeFile: writeFileCallback || writeFile2,
|
@@ -123317,9 +123307,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123317
123307
|
const sourceFile = getSourceFile2(fileName);
|
123318
123308
|
if (fail) {
|
123319
123309
|
if (!sourceFile) {
|
123320
|
-
const redirect =
|
123321
|
-
if (redirect) {
|
123322
|
-
fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName);
|
123310
|
+
const redirect = getRedirectFromSourceFile(fileName);
|
123311
|
+
if (redirect == null ? void 0 : redirect.outputDts) {
|
123312
|
+
fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, fileName);
|
123323
123313
|
} else {
|
123324
123314
|
fail(Diagnostics.File_0_not_found, fileName);
|
123325
123315
|
}
|
@@ -123405,16 +123395,16 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123405
123395
|
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
123406
123396
|
}
|
123407
123397
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
123408
|
-
var _a2;
|
123398
|
+
var _a2, _b2;
|
123409
123399
|
const path = toPath3(fileName);
|
123410
123400
|
if (useSourceOfProjectReferenceRedirect) {
|
123411
|
-
let source =
|
123401
|
+
let source = getRedirectFromOutput(path);
|
123412
123402
|
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
123413
123403
|
const realPath2 = toPath3(host.realpath(fileName));
|
123414
|
-
if (realPath2 !== path) source =
|
123404
|
+
if (realPath2 !== path) source = getRedirectFromOutput(realPath2);
|
123415
123405
|
}
|
123416
|
-
if (source) {
|
123417
|
-
const file2 =
|
123406
|
+
if (source == null ? void 0 : source.source) {
|
123407
|
+
const file2 = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
|
123418
123408
|
if (file2) addFileToFilesByName(
|
123419
123409
|
file2,
|
123420
123410
|
path,
|
@@ -123438,7 +123428,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123438
123428
|
const checkedName = file2.fileName;
|
123439
123429
|
const isRedirect = toPath3(checkedName) !== toPath3(fileName);
|
123440
123430
|
if (isRedirect) {
|
123441
|
-
fileName =
|
123431
|
+
fileName = ((_a2 = getRedirectFromSourceFile(fileName)) == null ? void 0 : _a2.outputDts) || fileName;
|
123442
123432
|
}
|
123443
123433
|
const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory);
|
123444
123434
|
const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory);
|
@@ -123467,14 +123457,13 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123467
123457
|
}
|
123468
123458
|
let redirectedPath;
|
123469
123459
|
if (!useSourceOfProjectReferenceRedirect) {
|
123470
|
-
const redirectProject =
|
123471
|
-
if (redirectProject) {
|
123472
|
-
if (redirectProject.commandLine.options.outFile) {
|
123460
|
+
const redirectProject = getRedirectFromSourceFile(fileName);
|
123461
|
+
if (redirectProject == null ? void 0 : redirectProject.outputDts) {
|
123462
|
+
if (redirectProject.resolvedRef.commandLine.options.outFile) {
|
123473
123463
|
return void 0;
|
123474
123464
|
}
|
123475
|
-
|
123476
|
-
|
123477
|
-
redirectedPath = toPath3(redirect);
|
123465
|
+
fileName = redirectProject.outputDts;
|
123466
|
+
redirectedPath = toPath3(redirectProject.outputDts);
|
123478
123467
|
}
|
123479
123468
|
}
|
123480
123469
|
const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
|
@@ -123518,7 +123507,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123518
123507
|
file.path = path;
|
123519
123508
|
file.resolvedPath = toPath3(fileName);
|
123520
123509
|
file.originalFileName = originalFileName;
|
123521
|
-
file.packageJsonLocations = ((
|
123510
|
+
file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0;
|
123522
123511
|
file.packageJsonScope = sourceFileOptions.packageJsonScope;
|
123523
123512
|
addFileIncludeReason(
|
123524
123513
|
file,
|
@@ -123573,59 +123562,17 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123573
123562
|
if (file !== void 0) missingFileNames.delete(path);
|
123574
123563
|
else missingFileNames.set(path, fileName);
|
123575
123564
|
}
|
123576
|
-
function
|
123577
|
-
|
123578
|
-
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
123579
|
-
}
|
123580
|
-
function getProjectReferenceRedirectProject(fileName) {
|
123581
|
-
if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".json" /* Json */)) {
|
123582
|
-
return void 0;
|
123583
|
-
}
|
123584
|
-
return getResolvedProjectReferenceToRedirect(fileName);
|
123585
|
-
}
|
123586
|
-
function getProjectReferenceOutputName(referencedProject, fileName) {
|
123587
|
-
const out = referencedProject.commandLine.options.outFile;
|
123588
|
-
return out ? changeExtension(out, ".d.ts" /* Dts */) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames());
|
123589
|
-
}
|
123590
|
-
function getResolvedProjectReferenceToRedirect(fileName) {
|
123591
|
-
if (mapFromFileToProjectReferenceRedirects === void 0) {
|
123592
|
-
mapFromFileToProjectReferenceRedirects = /* @__PURE__ */ new Map();
|
123593
|
-
forEachResolvedProjectReference2((referencedProject) => {
|
123594
|
-
if (toPath3(options.configFilePath) !== referencedProject.sourceFile.path) {
|
123595
|
-
referencedProject.commandLine.fileNames.forEach((f) => mapFromFileToProjectReferenceRedirects.set(toPath3(f), referencedProject.sourceFile.path));
|
123596
|
-
}
|
123597
|
-
});
|
123598
|
-
}
|
123599
|
-
const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath3(fileName));
|
123600
|
-
return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath);
|
123565
|
+
function getRedirectFromSourceFile(fileName) {
|
123566
|
+
return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName));
|
123601
123567
|
}
|
123602
123568
|
function forEachResolvedProjectReference2(cb) {
|
123603
123569
|
return forEachResolvedProjectReference(resolvedProjectReferences, cb);
|
123604
123570
|
}
|
123605
|
-
function
|
123606
|
-
|
123607
|
-
if (mapFromToProjectReferenceRedirectSource === void 0) {
|
123608
|
-
mapFromToProjectReferenceRedirectSource = /* @__PURE__ */ new Map();
|
123609
|
-
forEachResolvedProjectReference2((resolvedRef) => {
|
123610
|
-
const out = resolvedRef.commandLine.options.outFile;
|
123611
|
-
if (out) {
|
123612
|
-
const outputDts = changeExtension(out, ".d.ts" /* Dts */);
|
123613
|
-
mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), true);
|
123614
|
-
} else {
|
123615
|
-
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
123616
|
-
forEach(resolvedRef.commandLine.fileNames, (fileName) => {
|
123617
|
-
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) {
|
123618
|
-
const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
|
123619
|
-
mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), fileName);
|
123620
|
-
}
|
123621
|
-
});
|
123622
|
-
}
|
123623
|
-
});
|
123624
|
-
}
|
123625
|
-
return mapFromToProjectReferenceRedirectSource.get(path);
|
123571
|
+
function getRedirectFromOutput(path) {
|
123572
|
+
return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path);
|
123626
123573
|
}
|
123627
123574
|
function isSourceOfProjectReferenceRedirect(fileName) {
|
123628
|
-
return useSourceOfProjectReferenceRedirect && !!
|
123575
|
+
return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName);
|
123629
123576
|
}
|
123630
123577
|
function getResolvedProjectReferenceByPath(projectReferencePath) {
|
123631
123578
|
if (!projectReferenceRedirects) {
|
@@ -123793,7 +123740,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123793
123740
|
continue;
|
123794
123741
|
}
|
123795
123742
|
const isFromNodeModulesSearch = resolution.isExternalLibraryImport;
|
123796
|
-
const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !
|
123743
|
+
const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getRedirectFromSourceFile(resolution.resolvedFileName);
|
123797
123744
|
const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName));
|
123798
123745
|
const resolvedFileName = resolution.resolvedFileName;
|
123799
123746
|
if (isFromNodeModulesSearch) {
|
@@ -123903,6 +123850,30 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
123903
123850
|
sourceFile.originalFileName = refPath;
|
123904
123851
|
const resolvedRef = { commandLine, sourceFile };
|
123905
123852
|
projectReferenceRedirects.set(sourceFilePath, resolvedRef);
|
123853
|
+
if (options.configFile !== sourceFile) {
|
123854
|
+
mapSourceFileToResolvedRef ?? (mapSourceFileToResolvedRef = /* @__PURE__ */ new Map());
|
123855
|
+
mapOutputFileToResolvedRef ?? (mapOutputFileToResolvedRef = /* @__PURE__ */ new Map());
|
123856
|
+
let outDts;
|
123857
|
+
if (commandLine.options.outFile) {
|
123858
|
+
outDts = changeExtension(commandLine.options.outFile, ".d.ts" /* Dts */);
|
123859
|
+
mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.set(toPath3(outDts), { resolvedRef });
|
123860
|
+
}
|
123861
|
+
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
123862
|
+
commandLine.fileNames.forEach((fileName) => {
|
123863
|
+
if (isDeclarationFileName(fileName)) return;
|
123864
|
+
const path = toPath3(fileName);
|
123865
|
+
let outputDts;
|
123866
|
+
if (!fileExtensionIs(fileName, ".json" /* Json */)) {
|
123867
|
+
if (!commandLine.options.outFile) {
|
123868
|
+
outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
|
123869
|
+
mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName });
|
123870
|
+
} else {
|
123871
|
+
outputDts = outDts;
|
123872
|
+
}
|
123873
|
+
}
|
123874
|
+
mapSourceFileToResolvedRef.set(path, { resolvedRef, outputDts });
|
123875
|
+
});
|
123876
|
+
}
|
123906
123877
|
if (commandLine.projectReferences) {
|
123907
123878
|
resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile);
|
123908
123879
|
}
|
@@ -124623,8 +124594,8 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
124623
124594
|
);
|
124624
124595
|
}
|
124625
124596
|
function fileExistsIfProjectReferenceDts(file) {
|
124626
|
-
const source = host.
|
124627
|
-
return source !== void 0 ? isString(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0;
|
124597
|
+
const source = host.getRedirectFromOutput(host.toPath(file));
|
124598
|
+
return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0;
|
124628
124599
|
}
|
124629
124600
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
124630
124601
|
const dirPath = host.toPath(dir);
|
@@ -125153,7 +125124,8 @@ var BuilderState;
|
|
125153
125124
|
return symbol && getReferencedFilesFromImportedModuleSymbol(symbol);
|
125154
125125
|
}
|
125155
125126
|
function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) {
|
125156
|
-
|
125127
|
+
var _a;
|
125128
|
+
return toPath(((_a = program.getRedirectFromSourceFile(fileName)) == null ? void 0 : _a.outputDts) || fileName, sourceFileDirectory, getCanonicalFileName);
|
125157
125129
|
}
|
125158
125130
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
125159
125131
|
let referencedFiles;
|
@@ -127428,12 +127400,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
127428
127400
|
shouldRetryResolution,
|
127429
127401
|
logChanges
|
127430
127402
|
}) {
|
127403
|
+
var _a;
|
127431
127404
|
const path = resolutionHost.toPath(containingFile);
|
127432
127405
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
127433
127406
|
const resolvedModules = [];
|
127434
127407
|
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
127435
127408
|
const program = resolutionHost.getCurrentProgram();
|
127436
|
-
const oldRedirect = program && program.
|
127409
|
+
const oldRedirect = program && ((_a = program.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a.resolvedRef);
|
127437
127410
|
const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference;
|
127438
127411
|
const seenNamesInFile = createModeAwareCache();
|
127439
127412
|
for (const entry of entries) {
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Modifikátor abstract se může objevit jenom v deklaraci třídy, metody nebo vlastnosti.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Modifikátor accessor se může objevit jenom v deklaraci vlastnosti.",
|
2000
2000
|
"and_here_6204": "a tady.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "Na „arguments“ nelze odkazovat v inicializátorech vlastností nebo statických inicializačních blocích třídy.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "auto: Považovat soubory s importy, exporty, import.meta, jsx (s jsx: react-jsx) nebo formátem esm (s modulem node16+) za moduly.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "Výraz „await“ nelze použít uvnitř statického bloku třídy.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Výrazy await se tady povolují jen na nejvyšší úrovni souboru, když je daný soubor modul, ale tento soubor nemá žádné importy ani exporty. Zvažte možnost přidat export {}, aby se tento soubor převedl na modul.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Der Modifizierer \"abstract\" darf nur für eine Klassen-, Methoden- oder Eigenschaftendeklaration verwendet werden.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Der Accessormodifizierer kann nur in einer Eigenschaftendeklaration angezeigt werden.",
|
2000
2000
|
"and_here_6204": "und hier.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "„arguments“ kann in Eigenschaftsinitialisierern oder statischen Initialisierungsblöcken für Klassen nicht referenziert werden.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "„auto“: Dateien mit imports, exports, import.meta, jsx (mit jsx: respond-jsx) oder esm-Format (mit module: node16+) als Module behandeln.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "Der „await“-Ausdruck kann nicht innerhalb eines statischen Klassenblocks verwendet werden.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "await-Ausdrücke sind nur auf der obersten Ebene einer Datei zulässig, wenn diese Datei ein Modul ist. Diese Datei enthält jedoch keinerlei Importe oder Exporte. Erwägen Sie das Hinzufügen eines leeren \"export {}\", um diese Datei als Modul zu definieren.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "El modificador 'abstract' solo puede aparecer en una declaración de propiedad, clase o método.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "El modificador 'accessor' solo puede aparecer en una declaración de propiedad.",
|
2000
2000
|
"and_here_6204": "y aquí.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "No se puede hacer referencia a \"arguments\" en inicializadores de propiedades o en bloques de inicialización estática de clase.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": trate los archivos con importaciones, exportaciones, import.meta, jsx (con jsx: react-jsx) o formato esm (con el módulo: node16+) como módulos.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "La expresión “await” no se puede usar dentro de un bloque estático de clase.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Las expresiones \"await\" solo se permiten en el nivel superior de un archivo cuando el archivo es un módulo, pero este archivo no tiene importaciones ni exportaciones. Considere la posibilidad de agregar un elemento \"export {}\" vacío para convertir este archivo en módulo.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Le modificateur 'abstract' peut apparaître uniquement dans une déclaration de classe, de méthode ou de propriété.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Le modificateur 'accessor' ne peut apparaître que sur une déclaration de propriété.",
|
2000
2000
|
"and_here_6204": "et ici.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "Les « arguments » ne peuvent pas être référencés dans les initialiseurs de propriétés ou les blocs d'initialisation statique de classe.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "« auto » : traitez les fichiers avec des importations, des exportations, import.meta, jsx (avec jsx: react-jsx) ou un format esm (avec module : node16+) en tant que modules.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "L’expression « await » à l’intérieur d’un bloc statique de classe.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Les expressions 'await' sont uniquement autorisées au niveau supérieur d'un fichier quand celui-ci est un module, mais le fichier actuel n'a pas d'importations ou d'exportations. Ajoutez un 'export {}' vide pour faire de ce fichier un module.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Il modificatore 'abstract' può essere incluso solo in una dichiarazione di classe, metodo o proprietà.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Il modificatore 'accessor' può essere visualizzato solo in una dichiarazione di proprietà.",
|
2000
2000
|
"and_here_6204": "e in questo punto.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "Non è possibile fare riferimento ad 'arguments' negli inizializzatori di proprietà o nei blocchi di inizializzazione statica delle classi.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": considera i file con importazioni, esportazioni, import.meta, jsx (con jsx: react-jsx) o il formato esm (con modulo: node16+) come moduli.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "Non è possibile usare l'espressione 'await' all'interno di un blocco statico di classe.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Le espressioni 'await' sono consentite solo al primo livello di un file quando il file è un modulo, ma questo file non contiene importazioni o esportazioni. Provare ad aggiungere un elemento 'export {}' vuoto per trasformare il file in un modulo.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' 修飾子は、クラス宣言、メソッド宣言、またはプロパティ宣言のみに使用できます。",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "'accessor' 修飾子は、プロパティ宣言でのみ使用できます。",
|
2000
2000
|
"and_here_6204": "およびここで。",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "'arguments' は、プロパティ初期化子やクラスの静的初期化ブロック内では参照できません。",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": インポート、エクスポート、import.meta、jsx (jsx: react-jsx を使用)、または esm 形式 (モジュール: node16+) でファイルをモジュールとして扱います。",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "'await' 式はクラスの静的ブロック内では使用できません。",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "ファイルがモジュールの場合、'await' 式はそのファイルのトップ レベルでのみ使用できますが、このファイルにはインポートもエクスポートも含まれていません。空の 'export {}' を追加して、このファイルをモジュールにすることを検討してください。",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' 한정자는 클래스, 메서드 또는 속성 선언에만 나타날 수 있습니다.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "'accessor' 한정자는 속성 선언에만 나타날 수 있습니다.",
|
2000
2000
|
"and_here_6204": "및 여기.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "'arguments'는 속성 초기화기나 클래스 정적 초기화 블록에서 참조할 수 없습니다.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": 가져오기, 내보내기, import.meta, jsx(jsx: react-jsx 포함) 또는 esm 형식(모듈: node16+ 포함)이 있는 파일을 모듈로 처리합니다.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "'await' 식은 클래스 정적 블록 내에서 사용할 수 없습니다.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "'await' 식은 파일이 모듈일 경우 해당 파일의 최상위 수준에서만 사용할 수 있지만, 이 파일에는 가져오기 또는 내보내기가 없습니다. 빈 'export {}'를 추가하여 이 파일을 모듈로 만드는 것이 좋습니다.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Modyfikator „abstract” może być stosowany jedynie w przypadku deklaracji klasy, metody lub właściwości.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Modyfikator „accessor” może występować tylko w deklaracji właściwości.",
|
2000
2000
|
"and_here_6204": "i tutaj.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "Argumentów nie można odwoływać w inicjalizatorach właściwości ani w blokach inicjalizacji statycznej klasy.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "„auto”: Traktuj pliki za pomocą importów, eksportów, import.meta, jsx (z jsx: react-jsx) lub formatu esm (z modułem: node16+) jako moduły.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "Nie można użyć wyrażenia „await” wewnątrz bloku statycznego klasy.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Wyrażenia „await” na najwyższym poziomie pliku są dozwolone tylko wtedy, gdy plik jest modułem, ale ten plik nie ma żadnych importów ani eksportów. Rozważ dodanie pustego elementu „export {}”, aby ten plik był modułem.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "O modificador 'abstract' pode aparecer somente em uma declaração de classe, método ou propriedade.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "o modificador 'acessador' só pode aparecer em uma declaração de propriedade.",
|
2000
2000
|
"and_here_6204": "e aqui.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "\"arguments\" não podem ser referenciados em inicializadores de propriedade ou blocos de inicialização estática de classe.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": trata os arquivos com import, export, import.meta, jsx (com jsx: react-jsx) ou formato esm (com module: node16+) como módulos.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "A expressão 'await' não pode ser usada dentro de um bloco estático de classe.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "As expressões 'await' só são permitidas no nível superior de um arquivo quando esse arquivo é um módulo, mas não tem importações ou exportações. Considere adicionar um 'export {}' vazio para transformar este arquivo em um módulo.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "Модификатор abstract может отображаться только в объявлении класса, метода или свойства.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "Модификатор \"accessor\" может быть только в объявлении свойства.",
|
2000
2000
|
"and_here_6204": "и здесь.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "Нельзя ссылаться на \"arguments\" в инициализаторах свойств и в статических блоках инициализации классов.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": обрабатывать файлы с импортом, экспортом, import.meta, jsx (с jsx: react-jsx) или форматом esm (с модулем: node16+) как файлы с модулями.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "Выражение \"await\" нельзя использовать внутри статического блока класса.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "Выражения \"await\" допускаются только на верхнем уровне файла, если он является модулем, но не имеет импортов и экспортов. Рекомендуется добавить пустой элемент \"export {}\", чтобы сделать этот файл модулем.",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' değiştiricisi yalnızca sınıf, metot veya özellik bildiriminde görünebilir.",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "'accessor' değiştiricisi yalnızca özellik bildiriminde görünebilir.",
|
2000
2000
|
"and_here_6204": "ve buraya.",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "'arguments' özellik başlatıcılarında veya sınıf statik başlatma bloklarında kullanılamaz.",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": İçe aktarma, dışa aktarma, import.meta, jsx (jsx: react-jsx ile) veya esm biçimi (modül: node16+ ile) içeren dosyaları modül olarak ele alın.",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "‘await’ ifadesi bir sınıf statik bloğu içinde kullanılamaz.",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "'await' ifadelerine yalnızca dosya bir modül olduğunda dosyanın en üst düzeyinde izin verilir ancak bu dosyanın içeri veya dışarı aktarma işlemi yok. Bu dosyayı modül yapmak için boş bir 'export {}' eklemeyi deneyin.",
|
package/lib/typescript.js
CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
2286
2286
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
2288
2288
|
var versionMajorMinor = "5.9";
|
2289
|
-
var version = `${versionMajorMinor}.0-dev.
|
2289
|
+
var version = `${versionMajorMinor}.0-dev.20250605`;
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
@@ -20350,7 +20350,7 @@ function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
|
|
20350
20350
|
if (forceDtsEmit) return true;
|
20351
20351
|
if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) return false;
|
20352
20352
|
if (!isJsonSourceFile(sourceFile)) return true;
|
20353
|
-
if (host.
|
20353
|
+
if (host.getRedirectFromSourceFile(sourceFile.fileName)) return false;
|
20354
20354
|
if (options.outFile) return true;
|
20355
20355
|
if (!options.outDir) return false;
|
20356
20356
|
if (options.rootDir || options.composite && options.configFilePath) {
|
@@ -24065,7 +24065,7 @@ function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
24065
24065
|
/*projectReferences*/
|
24066
24066
|
void 0,
|
24067
24067
|
resolvedProjectReferences,
|
24068
|
-
(resolvedRef
|
24068
|
+
(resolvedRef) => resolvedRef && cb(resolvedRef)
|
24069
24069
|
);
|
24070
24070
|
}
|
24071
24071
|
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
@@ -50059,10 +50059,10 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
|
|
50059
50059
|
);
|
50060
50060
|
}
|
50061
50061
|
function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
|
50062
|
-
var _a;
|
50062
|
+
var _a, _b;
|
50063
50063
|
const getCanonicalFileName = hostGetCanonicalFileName(host);
|
50064
50064
|
const cwd = host.getCurrentDirectory();
|
50065
|
-
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.
|
50065
|
+
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? (_a = host.getRedirectFromSourceFile(importedFileName)) == null ? void 0 : _a.outputDts : void 0;
|
50066
50066
|
const importedPath = toPath(importedFileName, cwd, getCanonicalFileName);
|
50067
50067
|
const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray;
|
50068
50068
|
const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects];
|
@@ -50072,7 +50072,7 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
|
|
50072
50072
|
const result2 = forEach(targets, (p) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p));
|
50073
50073
|
if (result2) return result2;
|
50074
50074
|
}
|
50075
|
-
const symlinkedDirectories = (
|
50075
|
+
const symlinkedDirectories = (_b = host.getSymlinkCache) == null ? void 0 : _b.call(host).getSymlinkedDirectoriesByRealpath();
|
50076
50076
|
const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
|
50077
50077
|
const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache(
|
50078
50078
|
host,
|
@@ -53834,7 +53834,7 @@ function createTypeChecker(host) {
|
|
53834
53834
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0;
|
53835
53835
|
}
|
53836
53836
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
53837
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
53837
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
53838
53838
|
if (errorNode && startsWith(moduleReference, "@types/")) {
|
53839
53839
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
53840
53840
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
@@ -53893,7 +53893,7 @@ function createTypeChecker(host) {
|
|
53893
53893
|
getAnyExtensionFromPath(moduleReference)
|
53894
53894
|
);
|
53895
53895
|
} else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
|
53896
|
-
const redirect = host.
|
53896
|
+
const redirect = (_i = host.getRedirectFromSourceFile(sourceFile.path)) == null ? void 0 : _i.resolvedRef;
|
53897
53897
|
if (redirect) {
|
53898
53898
|
const ignoreCase = !host.useCaseSensitiveFileNames();
|
53899
53899
|
const ownRootDir = host.getCommonSourceDirectory();
|
@@ -53933,7 +53933,7 @@ function createTypeChecker(host) {
|
|
53933
53933
|
if (ext === ".ts" /* Ts */ || ext === ".js" /* Js */ || ext === ".tsx" /* Tsx */ || ext === ".jsx" /* Jsx */) {
|
53934
53934
|
diagnosticDetails = createModeMismatchDetails(currentSourceFile);
|
53935
53935
|
}
|
53936
|
-
const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((
|
53936
|
+
const message = (overrideHost == null ? void 0 : overrideHost.kind) === 272 /* ImportDeclaration */ && ((_j = overrideHost.importClause) == null ? void 0 : _j.isTypeOnly) ? Diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : (overrideHost == null ? void 0 : overrideHost.kind) === 205 /* ImportType */ ? Diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute : Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead;
|
53937
53937
|
diagnostics.add(createDiagnosticForNodeFromMessageChain(
|
53938
53938
|
getSourceFileOfNode(errorNode),
|
53939
53939
|
errorNode,
|
@@ -53981,9 +53981,9 @@ function createTypeChecker(host) {
|
|
53981
53981
|
}
|
53982
53982
|
if (moduleNotFoundError) {
|
53983
53983
|
if (resolvedModule) {
|
53984
|
-
const redirect = host.
|
53985
|
-
if (redirect) {
|
53986
|
-
error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
|
53984
|
+
const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName);
|
53985
|
+
if (redirect == null ? void 0 : redirect.outputDts) {
|
53986
|
+
error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName);
|
53987
53987
|
return void 0;
|
53988
53988
|
}
|
53989
53989
|
}
|
@@ -53996,14 +53996,14 @@ function createTypeChecker(host) {
|
|
53996
53996
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
53997
53997
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
53998
53998
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
53999
|
-
const suggestedExt = (
|
53999
|
+
const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
|
54000
54000
|
if (suggestedExt) {
|
54001
54001
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
54002
54002
|
} else {
|
54003
54003
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
54004
54004
|
}
|
54005
54005
|
} else {
|
54006
|
-
if ((
|
54006
|
+
if ((_l = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _l.alternateResult) {
|
54007
54007
|
const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference);
|
54008
54008
|
errorOrSuggestion(
|
54009
54009
|
/*isError*/
|
@@ -85150,6 +85150,7 @@ function createTypeChecker(host) {
|
|
85150
85150
|
return type;
|
85151
85151
|
}
|
85152
85152
|
function checkConstEnumAccess(node, type) {
|
85153
|
+
var _a;
|
85153
85154
|
const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 281 /* ExportSpecifier */;
|
85154
85155
|
if (!ok) {
|
85155
85156
|
error2(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
|
@@ -85167,7 +85168,7 @@ function createTypeChecker(host) {
|
|
85167
85168
|
)) {
|
85168
85169
|
Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
|
85169
85170
|
const constEnumDeclaration = type.symbol.valueDeclaration;
|
85170
|
-
const redirect = host.
|
85171
|
+
const redirect = (_a = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _a.resolvedRef;
|
85171
85172
|
if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
|
85172
85173
|
error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
85173
85174
|
}
|
@@ -90123,7 +90124,7 @@ function createTypeChecker(host) {
|
|
90123
90124
|
}
|
90124
90125
|
}
|
90125
90126
|
function checkAliasSymbol(node) {
|
90126
|
-
var _a, _b, _c, _d;
|
90127
|
+
var _a, _b, _c, _d, _e;
|
90127
90128
|
let symbol = getSymbolOfDeclaration(node);
|
90128
90129
|
const target = resolveAlias(symbol);
|
90129
90130
|
if (target !== unknownSymbol) {
|
@@ -90217,7 +90218,7 @@ function createTypeChecker(host) {
|
|
90217
90218
|
}
|
90218
90219
|
if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) {
|
90219
90220
|
const constEnumDeclaration = target.valueDeclaration;
|
90220
|
-
const redirect = host.
|
90221
|
+
const redirect = (_e = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)) == null ? void 0 : _e.resolvedRef;
|
90221
90222
|
if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
|
90222
90223
|
error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
90223
90224
|
}
|
@@ -94606,7 +94607,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
94606
94607
|
},
|
94607
94608
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
94608
94609
|
redirectTargetsMap: host.redirectTargetsMap,
|
94609
|
-
|
94610
|
+
getRedirectFromSourceFile: (fileName) => host.getRedirectFromSourceFile(fileName),
|
94610
94611
|
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
94611
94612
|
fileExists: (fileName) => host.fileExists(fileName),
|
94612
94613
|
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
@@ -126711,8 +126712,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
126711
126712
|
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
|
126712
126713
|
let resolvedProjectReferences;
|
126713
126714
|
let projectReferenceRedirects;
|
126714
|
-
let
|
126715
|
-
let
|
126715
|
+
let mapSourceFileToResolvedRef;
|
126716
|
+
let mapOutputFileToResolvedRef;
|
126716
126717
|
const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect;
|
126717
126718
|
const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({
|
126718
126719
|
compilerHost: host,
|
@@ -126720,7 +126721,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
126720
126721
|
useSourceOfProjectReferenceRedirect,
|
126721
126722
|
toPath: toPath3,
|
126722
126723
|
getResolvedProjectReferences,
|
126723
|
-
|
126724
|
+
getRedirectFromOutput,
|
126724
126725
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
126725
126726
|
});
|
126726
126727
|
const readFile = host.readFile.bind(host);
|
@@ -126930,12 +126931,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
126930
126931
|
getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2,
|
126931
126932
|
getProjectReferences,
|
126932
126933
|
getResolvedProjectReferences,
|
126933
|
-
|
126934
|
-
getResolvedProjectReferenceToRedirect,
|
126934
|
+
getRedirectFromSourceFile,
|
126935
126935
|
getResolvedProjectReferenceByPath,
|
126936
126936
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
126937
126937
|
isSourceOfProjectReferenceRedirect,
|
126938
|
-
|
126938
|
+
getRedirectFromOutput,
|
126939
126939
|
getCompilerOptionsForFile,
|
126940
126940
|
getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2,
|
126941
126941
|
getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2,
|
@@ -127064,23 +127064,14 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
127064
127064
|
return result;
|
127065
127065
|
}
|
127066
127066
|
function getRedirectReferenceForResolution(file) {
|
127067
|
-
|
127068
|
-
|
127069
|
-
|
127067
|
+
var _a2, _b2;
|
127068
|
+
const redirect = getRedirectFromSourceFile(file.originalFileName);
|
127069
|
+
if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect == null ? void 0 : redirect.resolvedRef;
|
127070
|
+
const resultFromDts = (_a2 = getRedirectFromOutput(file.path)) == null ? void 0 : _a2.resolvedRef;
|
127070
127071
|
if (resultFromDts) return resultFromDts;
|
127071
127072
|
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) return void 0;
|
127072
127073
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
127073
|
-
return realDeclarationPath === file.path ? void 0 :
|
127074
|
-
}
|
127075
|
-
function getRedirectReferenceForResolutionFromSourceOfProject(filePath) {
|
127076
|
-
const source = getSourceOfProjectReferenceRedirect(filePath);
|
127077
|
-
if (isString(source)) return getResolvedProjectReferenceToRedirect(source);
|
127078
|
-
if (!source) return void 0;
|
127079
|
-
return forEachResolvedProjectReference2((resolvedRef) => {
|
127080
|
-
const out = resolvedRef.commandLine.options.outFile;
|
127081
|
-
if (!out) return void 0;
|
127082
|
-
return toPath3(out) === filePath ? resolvedRef : void 0;
|
127083
|
-
});
|
127074
|
+
return realDeclarationPath === file.path ? void 0 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef;
|
127084
127075
|
}
|
127085
127076
|
function compareDefaultLibFiles(a, b) {
|
127086
127077
|
return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b));
|
@@ -127452,8 +127443,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
127452
127443
|
getSourceFileByPath: program.getSourceFileByPath,
|
127453
127444
|
getSourceFiles: program.getSourceFiles,
|
127454
127445
|
isSourceFileFromExternalLibrary,
|
127455
|
-
|
127456
|
-
getProjectReferenceRedirect,
|
127446
|
+
getRedirectFromSourceFile,
|
127457
127447
|
isSourceOfProjectReferenceRedirect,
|
127458
127448
|
getSymlinkCache,
|
127459
127449
|
writeFile: writeFileCallback || writeFile2,
|
@@ -128168,9 +128158,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128168
128158
|
const sourceFile = getSourceFile2(fileName);
|
128169
128159
|
if (fail) {
|
128170
128160
|
if (!sourceFile) {
|
128171
|
-
const redirect =
|
128172
|
-
if (redirect) {
|
128173
|
-
fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName);
|
128161
|
+
const redirect = getRedirectFromSourceFile(fileName);
|
128162
|
+
if (redirect == null ? void 0 : redirect.outputDts) {
|
128163
|
+
fail(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, fileName);
|
128174
128164
|
} else {
|
128175
128165
|
fail(Diagnostics.File_0_not_found, fileName);
|
128176
128166
|
}
|
@@ -128256,16 +128246,16 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128256
128246
|
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
128257
128247
|
}
|
128258
128248
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
128259
|
-
var _a2;
|
128249
|
+
var _a2, _b2;
|
128260
128250
|
const path = toPath3(fileName);
|
128261
128251
|
if (useSourceOfProjectReferenceRedirect) {
|
128262
|
-
let source =
|
128252
|
+
let source = getRedirectFromOutput(path);
|
128263
128253
|
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
128264
128254
|
const realPath2 = toPath3(host.realpath(fileName));
|
128265
|
-
if (realPath2 !== path) source =
|
128255
|
+
if (realPath2 !== path) source = getRedirectFromOutput(realPath2);
|
128266
128256
|
}
|
128267
|
-
if (source) {
|
128268
|
-
const file2 =
|
128257
|
+
if (source == null ? void 0 : source.source) {
|
128258
|
+
const file2 = findSourceFile(source.source, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
|
128269
128259
|
if (file2) addFileToFilesByName(
|
128270
128260
|
file2,
|
128271
128261
|
path,
|
@@ -128289,7 +128279,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128289
128279
|
const checkedName = file2.fileName;
|
128290
128280
|
const isRedirect = toPath3(checkedName) !== toPath3(fileName);
|
128291
128281
|
if (isRedirect) {
|
128292
|
-
fileName =
|
128282
|
+
fileName = ((_a2 = getRedirectFromSourceFile(fileName)) == null ? void 0 : _a2.outputDts) || fileName;
|
128293
128283
|
}
|
128294
128284
|
const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory);
|
128295
128285
|
const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory);
|
@@ -128318,14 +128308,13 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128318
128308
|
}
|
128319
128309
|
let redirectedPath;
|
128320
128310
|
if (!useSourceOfProjectReferenceRedirect) {
|
128321
|
-
const redirectProject =
|
128322
|
-
if (redirectProject) {
|
128323
|
-
if (redirectProject.commandLine.options.outFile) {
|
128311
|
+
const redirectProject = getRedirectFromSourceFile(fileName);
|
128312
|
+
if (redirectProject == null ? void 0 : redirectProject.outputDts) {
|
128313
|
+
if (redirectProject.resolvedRef.commandLine.options.outFile) {
|
128324
128314
|
return void 0;
|
128325
128315
|
}
|
128326
|
-
|
128327
|
-
|
128328
|
-
redirectedPath = toPath3(redirect);
|
128316
|
+
fileName = redirectProject.outputDts;
|
128317
|
+
redirectedPath = toPath3(redirectProject.outputDts);
|
128329
128318
|
}
|
128330
128319
|
}
|
128331
128320
|
const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
|
@@ -128369,7 +128358,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128369
128358
|
file.path = path;
|
128370
128359
|
file.resolvedPath = toPath3(fileName);
|
128371
128360
|
file.originalFileName = originalFileName;
|
128372
|
-
file.packageJsonLocations = ((
|
128361
|
+
file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0;
|
128373
128362
|
file.packageJsonScope = sourceFileOptions.packageJsonScope;
|
128374
128363
|
addFileIncludeReason(
|
128375
128364
|
file,
|
@@ -128424,59 +128413,17 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128424
128413
|
if (file !== void 0) missingFileNames.delete(path);
|
128425
128414
|
else missingFileNames.set(path, fileName);
|
128426
128415
|
}
|
128427
|
-
function
|
128428
|
-
|
128429
|
-
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
128430
|
-
}
|
128431
|
-
function getProjectReferenceRedirectProject(fileName) {
|
128432
|
-
if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".json" /* Json */)) {
|
128433
|
-
return void 0;
|
128434
|
-
}
|
128435
|
-
return getResolvedProjectReferenceToRedirect(fileName);
|
128436
|
-
}
|
128437
|
-
function getProjectReferenceOutputName(referencedProject, fileName) {
|
128438
|
-
const out = referencedProject.commandLine.options.outFile;
|
128439
|
-
return out ? changeExtension(out, ".d.ts" /* Dts */) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames());
|
128440
|
-
}
|
128441
|
-
function getResolvedProjectReferenceToRedirect(fileName) {
|
128442
|
-
if (mapFromFileToProjectReferenceRedirects === void 0) {
|
128443
|
-
mapFromFileToProjectReferenceRedirects = /* @__PURE__ */ new Map();
|
128444
|
-
forEachResolvedProjectReference2((referencedProject) => {
|
128445
|
-
if (toPath3(options.configFilePath) !== referencedProject.sourceFile.path) {
|
128446
|
-
referencedProject.commandLine.fileNames.forEach((f) => mapFromFileToProjectReferenceRedirects.set(toPath3(f), referencedProject.sourceFile.path));
|
128447
|
-
}
|
128448
|
-
});
|
128449
|
-
}
|
128450
|
-
const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath3(fileName));
|
128451
|
-
return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath);
|
128416
|
+
function getRedirectFromSourceFile(fileName) {
|
128417
|
+
return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName));
|
128452
128418
|
}
|
128453
128419
|
function forEachResolvedProjectReference2(cb) {
|
128454
128420
|
return forEachResolvedProjectReference(resolvedProjectReferences, cb);
|
128455
128421
|
}
|
128456
|
-
function
|
128457
|
-
|
128458
|
-
if (mapFromToProjectReferenceRedirectSource === void 0) {
|
128459
|
-
mapFromToProjectReferenceRedirectSource = /* @__PURE__ */ new Map();
|
128460
|
-
forEachResolvedProjectReference2((resolvedRef) => {
|
128461
|
-
const out = resolvedRef.commandLine.options.outFile;
|
128462
|
-
if (out) {
|
128463
|
-
const outputDts = changeExtension(out, ".d.ts" /* Dts */);
|
128464
|
-
mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), true);
|
128465
|
-
} else {
|
128466
|
-
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
128467
|
-
forEach(resolvedRef.commandLine.fileNames, (fileName) => {
|
128468
|
-
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) {
|
128469
|
-
const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
|
128470
|
-
mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), fileName);
|
128471
|
-
}
|
128472
|
-
});
|
128473
|
-
}
|
128474
|
-
});
|
128475
|
-
}
|
128476
|
-
return mapFromToProjectReferenceRedirectSource.get(path);
|
128422
|
+
function getRedirectFromOutput(path) {
|
128423
|
+
return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path);
|
128477
128424
|
}
|
128478
128425
|
function isSourceOfProjectReferenceRedirect(fileName) {
|
128479
|
-
return useSourceOfProjectReferenceRedirect && !!
|
128426
|
+
return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName);
|
128480
128427
|
}
|
128481
128428
|
function getResolvedProjectReferenceByPath(projectReferencePath) {
|
128482
128429
|
if (!projectReferenceRedirects) {
|
@@ -128644,7 +128591,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128644
128591
|
continue;
|
128645
128592
|
}
|
128646
128593
|
const isFromNodeModulesSearch = resolution.isExternalLibraryImport;
|
128647
|
-
const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !
|
128594
|
+
const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getRedirectFromSourceFile(resolution.resolvedFileName);
|
128648
128595
|
const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName));
|
128649
128596
|
const resolvedFileName = resolution.resolvedFileName;
|
128650
128597
|
if (isFromNodeModulesSearch) {
|
@@ -128754,6 +128701,30 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
|
|
128754
128701
|
sourceFile.originalFileName = refPath;
|
128755
128702
|
const resolvedRef = { commandLine, sourceFile };
|
128756
128703
|
projectReferenceRedirects.set(sourceFilePath, resolvedRef);
|
128704
|
+
if (options.configFile !== sourceFile) {
|
128705
|
+
mapSourceFileToResolvedRef ?? (mapSourceFileToResolvedRef = /* @__PURE__ */ new Map());
|
128706
|
+
mapOutputFileToResolvedRef ?? (mapOutputFileToResolvedRef = /* @__PURE__ */ new Map());
|
128707
|
+
let outDts;
|
128708
|
+
if (commandLine.options.outFile) {
|
128709
|
+
outDts = changeExtension(commandLine.options.outFile, ".d.ts" /* Dts */);
|
128710
|
+
mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.set(toPath3(outDts), { resolvedRef });
|
128711
|
+
}
|
128712
|
+
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
128713
|
+
commandLine.fileNames.forEach((fileName) => {
|
128714
|
+
if (isDeclarationFileName(fileName)) return;
|
128715
|
+
const path = toPath3(fileName);
|
128716
|
+
let outputDts;
|
128717
|
+
if (!fileExtensionIs(fileName, ".json" /* Json */)) {
|
128718
|
+
if (!commandLine.options.outFile) {
|
128719
|
+
outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
|
128720
|
+
mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName });
|
128721
|
+
} else {
|
128722
|
+
outputDts = outDts;
|
128723
|
+
}
|
128724
|
+
}
|
128725
|
+
mapSourceFileToResolvedRef.set(path, { resolvedRef, outputDts });
|
128726
|
+
});
|
128727
|
+
}
|
128757
128728
|
if (commandLine.projectReferences) {
|
128758
128729
|
resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile);
|
128759
128730
|
}
|
@@ -129474,8 +129445,8 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
129474
129445
|
);
|
129475
129446
|
}
|
129476
129447
|
function fileExistsIfProjectReferenceDts(file) {
|
129477
|
-
const source = host.
|
129478
|
-
return source !== void 0 ? isString(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0;
|
129448
|
+
const source = host.getRedirectFromOutput(host.toPath(file));
|
129449
|
+
return source !== void 0 ? isString(source.source) ? originalFileExists.call(host.compilerHost, source.source) : true : void 0;
|
129479
129450
|
}
|
129480
129451
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
129481
129452
|
const dirPath = host.toPath(dir);
|
@@ -130018,7 +129989,8 @@ var BuilderState;
|
|
130018
129989
|
return symbol && getReferencedFilesFromImportedModuleSymbol(symbol);
|
130019
129990
|
}
|
130020
129991
|
function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) {
|
130021
|
-
|
129992
|
+
var _a;
|
129993
|
+
return toPath(((_a = program.getRedirectFromSourceFile(fileName)) == null ? void 0 : _a.outputDts) || fileName, sourceFileDirectory, getCanonicalFileName);
|
130022
129994
|
}
|
130023
129995
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
130024
129996
|
let referencedFiles;
|
@@ -132340,12 +132312,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
132340
132312
|
shouldRetryResolution,
|
132341
132313
|
logChanges
|
132342
132314
|
}) {
|
132315
|
+
var _a;
|
132343
132316
|
const path = resolutionHost.toPath(containingFile);
|
132344
132317
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
132345
132318
|
const resolvedModules = [];
|
132346
132319
|
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
132347
132320
|
const program = resolutionHost.getCurrentProgram();
|
132348
|
-
const oldRedirect = program && program.
|
132321
|
+
const oldRedirect = program && ((_a = program.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a.resolvedRef);
|
132349
132322
|
const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference;
|
132350
132323
|
const seenNamesInFile = createModeAwareCache();
|
132351
132324
|
for (const entry of entries) {
|
@@ -140492,7 +140465,7 @@ function createModuleSpecifierResolutionHost(program, host) {
|
|
140492
140465
|
},
|
140493
140466
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation),
|
140494
140467
|
redirectTargetsMap: program.redirectTargetsMap,
|
140495
|
-
|
140468
|
+
getRedirectFromSourceFile: (fileName) => program.getRedirectFromSourceFile(fileName),
|
140496
140469
|
isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName),
|
140497
140470
|
getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson),
|
140498
140471
|
getFileIncludeReasons: () => program.getFileIncludeReasons(),
|
@@ -186873,7 +186846,7 @@ var Project2 = class _Project {
|
|
186873
186846
|
this.projectService.onProjectCreation(this);
|
186874
186847
|
}
|
186875
186848
|
/** @internal */
|
186876
|
-
|
186849
|
+
getRedirectFromSourceFile(_fileName) {
|
186877
186850
|
return void 0;
|
186878
186851
|
}
|
186879
186852
|
isNonTsProject() {
|
@@ -188922,9 +188895,9 @@ var ConfiguredProject2 = class extends Project2 {
|
|
188922
188895
|
(this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath);
|
188923
188896
|
}
|
188924
188897
|
/** @internal */
|
188925
|
-
|
188898
|
+
getRedirectFromSourceFile(fileName) {
|
188926
188899
|
const program = this.getCurrentProgram();
|
188927
|
-
return program && program.
|
188900
|
+
return program && program.getRedirectFromSourceFile(fileName);
|
188928
188901
|
}
|
188929
188902
|
/** @internal */
|
188930
188903
|
forEachResolvedProjectReference(cb) {
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "\"abstract\" 修饰符仅可出现在类、方法或属性声明中。",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "\"accessor\" 修饰符只能出现在属性声明中。",
|
2000
2000
|
"and_here_6204": "并在这里。",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "无法在属性初始值设定项或类静态初始化块中引用 'arguments'。",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "“auto”: 将带有导入、导出、import.meta、jsx (带有 jsx: react-jsx)或 esm 格式(带模块: node16+)的文件视为模块。",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "\"await\" 表达式不能在类静态块内使用。",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "仅当文件是模块时,才允许在该文件的顶层使用 \"await\" 表达式,但此文件没有导入或导出。请考虑添加空的 \"export {}\" 以将此文件变为模块。",
|
@@ -1998,7 +1998,7 @@
|
|
1998
1998
|
"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' 修飾元只能出現在類別宣告、方法宣告或屬性宣告。",
|
1999
1999
|
"accessor_modifier_can_only_appear_on_a_property_declaration_1275": "'accessor' 修飾詞只能出現在屬性宣告。",
|
2000
2000
|
"and_here_6204": "及此處。",
|
2001
|
-
"
|
2001
|
+
"arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": "在屬性初始化器或類別靜態初始化區塊中無法引用『arguments』。",
|
2002
2002
|
"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": 處理具有 imports、exports、import.meta, jsx (具有 jsx: react-jsx) 的檔案,或以 esm 格式 (具有 module: node16+) 作為模組。",
|
2003
2003
|
"await_expression_cannot_be_used_inside_a_class_static_block_18037": "'await' 運算式無法在類別靜態區塊內使用。",
|
2004
2004
|
"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "當檔案為模組時,只允許 'await' 運算式位於檔案的最上層,但是此檔案沒有匯入或匯出。請考慮新增空白的 'export {}',使這個檔案成為模組。",
|
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.9.0-dev.
|
5
|
+
"version": "5.9.0-dev.20250605",
|
6
6
|
"license": "Apache-2.0",
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
8
8
|
"keywords": [
|
@@ -116,5 +116,5 @@
|
|
116
116
|
"node": "20.1.0",
|
117
117
|
"npm": "8.19.4"
|
118
118
|
},
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "2b88aebaaae3dc431a56667f7b0dbc42ae329ec6"
|
120
120
|
}
|