Update LKG.

This commit is contained in:
Daniel Rosenwasser
2019-12-03 23:33:19 -08:00
parent e65ce53dd8
commit 79facc0d17
7 changed files with 136 additions and 111 deletions
+16 -17
View File
@@ -10129,28 +10129,29 @@ var ts;
return ts.removeFileExtension(path) + ".d.ts";
}
ts.getDeclarationEmitOutputFilePathWorker = getDeclarationEmitOutputFilePathWorker;
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -35323,7 +35324,7 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -72886,7 +72887,7 @@ var ts;
ts.isBuildInfoFile = isBuildInfoFile;
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -73116,7 +73117,7 @@ var ts;
var emitSkipped = false;
var exportedModulesFromDeclarationEmit;
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -73468,6 +73469,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -78130,13 +78132,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
}
@@ -78447,6 +78445,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
var path = toPath(f);
if (getSourceFileByPath(path))
@@ -79533,7 +79532,7 @@ var ts;
var rootPaths = ts.arrayToSet(rootNames, toPath);
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}
+32 -20
View File
@@ -13051,30 +13051,31 @@ var ts;
* @param host An EmitHost.
* @param targetSourceFile An optional target source file to emit.
*/
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -42703,7 +42704,8 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -89389,7 +89391,7 @@ var ts;
*/
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -89633,7 +89635,7 @@ var ts;
var exportedModulesFromDeclarationEmit;
// Emit each output file
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -90021,6 +90023,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -95137,14 +95140,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
// source file is allowed to be emitted and its not source of project reference redirect
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
// If a rootDir is specified use it as the commonSourceDirectory
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
@@ -95547,6 +95545,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
// Use local caches
var path = toPath(f);
@@ -96767,7 +96766,7 @@ var ts;
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
// Ignore file that is not emitted
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}
@@ -135732,7 +135731,11 @@ var ts;
ConfiguredProject.prototype.directoryExistsIfProjectReferenceDeclDir = function (dir) {
var dirPath = this.toPath(dir);
var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator); });
return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
ts.startsWith(dirPath, declDirPath + "/"); });
};
/**
* This implementation of directoryExists checks if the directory being requested is
@@ -135767,6 +135770,15 @@ var ts;
}
return this.fileOrDirectoryExistsUsingSource(path, /*isFile*/ false);
};
/**
* Call super.getDirectories only if directory actually present on the host
* This is needed to ensure that we arent getting directories that we fake about presence for
*/
ConfiguredProject.prototype.getDirectories = function (path) {
return !this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks || _super.prototype.directoryExists.call(this, path) ?
_super.prototype.getDirectories.call(this, path) :
[];
};
ConfiguredProject.prototype.realpathIfSymlinkedProjectReferenceDts = function (s) {
return this.symlinkedFiles && this.symlinkedFiles.get(this.toPath(s));
};
@@ -135785,7 +135797,7 @@ var ts;
var directoryPath = ts.ensureTrailingDirectorySeparator(this.toPath(directory));
if (this.symlinkedDirectories.has(directoryPath))
return;
var real = this.projectService.host.realpath(directory);
var real = ts.normalizePath(this.projectService.host.realpath(directory));
var realPath;
if (real === directory ||
(realPath = ts.ensureTrailingDirectorySeparator(this.toPath(real))) === directoryPath) {
+5
View File
@@ -8705,6 +8705,11 @@ declare namespace ts.server {
* If it is it returns true irrespective of whether that directory exists on host
*/
directoryExists(path: string): boolean;
/**
* Call super.getDirectories only if directory actually present on the host
* This is needed to ensure that we arent getting directories that we fake about presence for
*/
getDirectories(path: string): string[];
private realpathIfSymlinkedProjectReferenceDts;
private getRealpath;
private handleDirectoryCouldBeSymlink;
+32 -20
View File
@@ -13201,30 +13201,31 @@ var ts;
* @param host An EmitHost.
* @param targetSourceFile An optional target source file to emit.
*/
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -42853,7 +42854,8 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -89539,7 +89541,7 @@ var ts;
*/
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -89783,7 +89785,7 @@ var ts;
var exportedModulesFromDeclarationEmit;
// Emit each output file
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -90171,6 +90173,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -95287,14 +95290,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
// source file is allowed to be emitted and its not source of project reference redirect
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
// If a rootDir is specified use it as the commonSourceDirectory
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
@@ -95697,6 +95695,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
// Use local caches
var path = toPath(f);
@@ -96917,7 +96916,7 @@ var ts;
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
// Ignore file that is not emitted
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}
@@ -135882,7 +135881,11 @@ var ts;
ConfiguredProject.prototype.directoryExistsIfProjectReferenceDeclDir = function (dir) {
var dirPath = this.toPath(dir);
var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath || ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator); });
return ts.forEachKey(this.mapOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
ts.startsWith(dirPath, declDirPath + "/"); });
};
/**
* This implementation of directoryExists checks if the directory being requested is
@@ -135917,6 +135920,15 @@ var ts;
}
return this.fileOrDirectoryExistsUsingSource(path, /*isFile*/ false);
};
/**
* Call super.getDirectories only if directory actually present on the host
* This is needed to ensure that we arent getting directories that we fake about presence for
*/
ConfiguredProject.prototype.getDirectories = function (path) {
return !this.useSourceOfProjectReferenceRedirect() || !this.projectReferenceCallbacks || _super.prototype.directoryExists.call(this, path) ?
_super.prototype.getDirectories.call(this, path) :
[];
};
ConfiguredProject.prototype.realpathIfSymlinkedProjectReferenceDts = function (s) {
return this.symlinkedFiles && this.symlinkedFiles.get(this.toPath(s));
};
@@ -135935,7 +135947,7 @@ var ts;
var directoryPath = ts.ensureTrailingDirectorySeparator(this.toPath(directory));
if (this.symlinkedDirectories.has(directoryPath))
return;
var real = this.projectService.host.realpath(directory);
var real = ts.normalizePath(this.projectService.host.realpath(directory));
var realPath;
if (real === directory ||
(realPath = ts.ensureTrailingDirectorySeparator(this.toPath(real))) === directoryPath) {
+17 -18
View File
@@ -13190,30 +13190,31 @@ var ts;
* @param host An EmitHost.
* @param targetSourceFile An optional target source file to emit.
*/
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -42842,7 +42843,8 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -89528,7 +89530,7 @@ var ts;
*/
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -89772,7 +89774,7 @@ var ts;
var exportedModulesFromDeclarationEmit;
// Emit each output file
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -90160,6 +90162,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -95276,14 +95279,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
// source file is allowed to be emitted and its not source of project reference redirect
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
// If a rootDir is specified use it as the commonSourceDirectory
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
@@ -95686,6 +95684,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
// Use local caches
var path = toPath(f);
@@ -96906,7 +96905,7 @@ var ts;
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
// Ignore file that is not emitted
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}
+17 -18
View File
@@ -13190,30 +13190,31 @@ var ts;
* @param host An EmitHost.
* @param targetSourceFile An optional target source file to emit.
*/
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -42842,7 +42843,8 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -89528,7 +89530,7 @@ var ts;
*/
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -89772,7 +89774,7 @@ var ts;
var exportedModulesFromDeclarationEmit;
// Emit each output file
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -90160,6 +90162,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -95276,14 +95279,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
// source file is allowed to be emitted and its not source of project reference redirect
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
// If a rootDir is specified use it as the commonSourceDirectory
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
@@ -95686,6 +95684,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
// Use local caches
var path = toPath(f);
@@ -96906,7 +96905,7 @@ var ts;
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
// Ignore file that is not emitted
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}
+17 -18
View File
@@ -13040,30 +13040,31 @@ var ts;
* @param host An EmitHost.
* @param targetSourceFile An optional target source file to emit.
*/
function getSourceFilesToEmit(host, targetSourceFile) {
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
return ts.filter(host.getSourceFiles(), function (sourceFile) {
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
var options = host.getCompilerOptions();
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
!sourceFile.isDeclarationFile &&
!isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
!host.isSourceFileFromExternalLibrary(sourceFile) &&
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -42692,7 +42693,8 @@ var ts;
}
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
@@ -89378,7 +89380,7 @@ var ts;
*/
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
var prepends = host.getPrependNodes();
@@ -89622,7 +89624,7 @@ var ts;
var exportedModulesFromDeclarationEmit;
// Emit each output file
enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
exit();
return {
emitSkipped: emitSkipped,
@@ -90010,6 +90012,7 @@ var ts;
getLibFileFromReference: ts.notImplemented,
isSourceFileFromExternalLibrary: ts.returnFalse,
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
isSourceOfProjectReferenceRedirect: ts.returnFalse,
writeFile: function (name, text, writeByteOrderMark) {
switch (name) {
case jsFilePath:
@@ -95126,14 +95129,9 @@ var ts;
function toPath(fileName) {
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
}
function isValidSourceFileForEmit(file) {
// source file is allowed to be emitted and its not source of project reference redirect
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
!isSourceOfProjectReferenceRedirect(file.fileName);
}
function getCommonSourceDirectory() {
if (commonSourceDirectory === undefined) {
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
// If a rootDir is specified use it as the commonSourceDirectory
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
@@ -95536,6 +95534,7 @@ var ts;
return __assign(__assign({ getPrependNodes: getPrependNodes,
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
// Use local caches
var path = toPath(f);
@@ -96756,7 +96755,7 @@ var ts;
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
var file = files_3[_i];
// Ignore file that is not emitted
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
}
}