@typescript-deploys/pr-build 5.6.0-pr-55887-49 → 5.6.0-pr-55887-54
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 +6 -2
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +176 -77
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240726`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -45476,6 +45476,7 @@ function createTypeChecker(host) {
|
|
|
45476
45476
|
getNonOptionalType: removeOptionalTypeMarker,
|
|
45477
45477
|
getTypeArguments,
|
|
45478
45478
|
typeToTypeNode: nodeBuilder.typeToTypeNode,
|
|
45479
|
+
typePredicateToTypePredicateNode: nodeBuilder.typePredicateToTypePredicateNode,
|
|
45479
45480
|
indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,
|
|
45480
45481
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
45481
45482
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
@@ -67799,6 +67800,9 @@ function createTypeChecker(host) {
|
|
|
67799
67800
|
return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType;
|
|
67800
67801
|
}
|
|
67801
67802
|
function isFunctionObjectType(type) {
|
|
67803
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
67804
|
+
return false;
|
|
67805
|
+
}
|
|
67802
67806
|
const resolved = resolveStructuredTypeMembers(type);
|
|
67803
67807
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
67804
67808
|
}
|
|
@@ -80938,7 +80942,7 @@ function createTypeChecker(host) {
|
|
|
80938
80942
|
return;
|
|
80939
80943
|
}
|
|
80940
80944
|
const declaration = local.valueDeclaration;
|
|
80941
|
-
if (!declaration || !isVariableDeclaration(declaration) || !(getCombinedNodeFlagsCached(declaration) &
|
|
80945
|
+
if (!declaration || !isVariableDeclaration(declaration) || !(getCombinedNodeFlagsCached(declaration) & 1 /* Let */) || getCombinedNodeFlagsCached(declaration) & 33554432 /* Ambient */ || declaration.exclamationToken || declaration.initializer || !declaration.type) {
|
|
80942
80946
|
return;
|
|
80943
80947
|
}
|
|
80944
80948
|
const type = getTypeFromTypeNode(declaration.type);
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3268,6 +3268,7 @@ declare namespace ts {
|
|
|
3268
3268
|
private delayUpdateProjectsOfScriptInfoPath;
|
|
3269
3269
|
private handleDeletedFile;
|
|
3270
3270
|
private watchWildcardDirectory;
|
|
3271
|
+
private onWildCardDirectoryWatcherInvoke;
|
|
3271
3272
|
private delayUpdateProjectsFromParsedConfigOnConfigFileChange;
|
|
3272
3273
|
private onConfigFileChanged;
|
|
3273
3274
|
private removeProject;
|
|
@@ -3338,6 +3339,7 @@ declare namespace ts {
|
|
|
3338
3339
|
private ensureProjectChildren;
|
|
3339
3340
|
private cleanupConfiguredProjects;
|
|
3340
3341
|
private cleanupProjectsAndScriptInfos;
|
|
3342
|
+
private tryInvokeWildCardDirectories;
|
|
3341
3343
|
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
|
|
3342
3344
|
private removeOrphanScriptInfos;
|
|
3343
3345
|
private telemetryOnOpenFile;
|
package/lib/typescript.js
CHANGED
|
@@ -2259,7 +2259,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2259
2259
|
|
|
2260
2260
|
// src/compiler/corePublic.ts
|
|
2261
2261
|
var versionMajorMinor = "5.6";
|
|
2262
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2262
|
+
var version = `${versionMajorMinor}.0-insiders.20240726`;
|
|
2263
2263
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2264
2264
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2265
2265
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -50094,6 +50094,7 @@ function createTypeChecker(host) {
|
|
|
50094
50094
|
getNonOptionalType: removeOptionalTypeMarker,
|
|
50095
50095
|
getTypeArguments,
|
|
50096
50096
|
typeToTypeNode: nodeBuilder.typeToTypeNode,
|
|
50097
|
+
typePredicateToTypePredicateNode: nodeBuilder.typePredicateToTypePredicateNode,
|
|
50097
50098
|
indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,
|
|
50098
50099
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
50099
50100
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
@@ -72417,6 +72418,9 @@ function createTypeChecker(host) {
|
|
|
72417
72418
|
return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType;
|
|
72418
72419
|
}
|
|
72419
72420
|
function isFunctionObjectType(type) {
|
|
72421
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
72422
|
+
return false;
|
|
72423
|
+
}
|
|
72420
72424
|
const resolved = resolveStructuredTypeMembers(type);
|
|
72421
72425
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
72422
72426
|
}
|
|
@@ -85556,7 +85560,7 @@ function createTypeChecker(host) {
|
|
|
85556
85560
|
return;
|
|
85557
85561
|
}
|
|
85558
85562
|
const declaration = local.valueDeclaration;
|
|
85559
|
-
if (!declaration || !isVariableDeclaration(declaration) || !(getCombinedNodeFlagsCached(declaration) &
|
|
85563
|
+
if (!declaration || !isVariableDeclaration(declaration) || !(getCombinedNodeFlagsCached(declaration) & 1 /* Let */) || getCombinedNodeFlagsCached(declaration) & 33554432 /* Ambient */ || declaration.exclamationToken || declaration.initializer || !declaration.type) {
|
|
85560
85564
|
return;
|
|
85561
85565
|
}
|
|
85562
85566
|
const type = getTypeFromTypeNode(declaration.type);
|
|
@@ -148243,7 +148247,27 @@ function getInfo4(context) {
|
|
|
148243
148247
|
return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) };
|
|
148244
148248
|
}
|
|
148245
148249
|
const typeChecker = context.program.getTypeChecker();
|
|
148246
|
-
|
|
148250
|
+
let returnType;
|
|
148251
|
+
if (typeChecker.isImplementationOfOverload(declaration)) {
|
|
148252
|
+
const signatures = typeChecker.getTypeAtLocation(declaration).getCallSignatures();
|
|
148253
|
+
if (signatures.length > 1) {
|
|
148254
|
+
returnType = typeChecker.getUnionType(mapDefined(signatures, (s) => s.getReturnType()));
|
|
148255
|
+
}
|
|
148256
|
+
}
|
|
148257
|
+
if (!returnType) {
|
|
148258
|
+
const signature = typeChecker.getSignatureFromDeclaration(declaration);
|
|
148259
|
+
if (signature) {
|
|
148260
|
+
const typePredicate = typeChecker.getTypePredicateOfSignature(signature);
|
|
148261
|
+
if (typePredicate && typePredicate.type) {
|
|
148262
|
+
const typePredicateTypeNode = typeChecker.typePredicateToTypePredicateNode(typePredicate, declaration, 1 /* NoTruncation */);
|
|
148263
|
+
if (typePredicateTypeNode) {
|
|
148264
|
+
return { declaration, returnTypeNode: typePredicateTypeNode };
|
|
148265
|
+
}
|
|
148266
|
+
} else {
|
|
148267
|
+
returnType = typeChecker.getReturnTypeOfSignature(signature);
|
|
148268
|
+
}
|
|
148269
|
+
}
|
|
148270
|
+
}
|
|
148247
148271
|
if (!returnType) {
|
|
148248
148272
|
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_determine_function_return_type) };
|
|
148249
148273
|
}
|
|
@@ -148263,18 +148287,6 @@ function isConvertibleDeclaration(node) {
|
|
|
148263
148287
|
return false;
|
|
148264
148288
|
}
|
|
148265
148289
|
}
|
|
148266
|
-
function tryGetReturnType(typeChecker, node) {
|
|
148267
|
-
if (typeChecker.isImplementationOfOverload(node)) {
|
|
148268
|
-
const signatures = typeChecker.getTypeAtLocation(node).getCallSignatures();
|
|
148269
|
-
if (signatures.length > 1) {
|
|
148270
|
-
return typeChecker.getUnionType(mapDefined(signatures, (s) => s.getReturnType()));
|
|
148271
|
-
}
|
|
148272
|
-
}
|
|
148273
|
-
const signature = typeChecker.getSignatureFromDeclaration(node);
|
|
148274
|
-
if (signature) {
|
|
148275
|
-
return typeChecker.getReturnTypeOfSignature(signature);
|
|
148276
|
-
}
|
|
148277
|
-
}
|
|
148278
148290
|
|
|
148279
148291
|
// src/services/classifier2020.ts
|
|
148280
148292
|
var TokenEncodingConsts = /* @__PURE__ */ ((TokenEncodingConsts2) => {
|
|
@@ -150172,6 +150184,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
150172
150184
|
synchronizeHostData();
|
|
150173
150185
|
Debug.assert(args.type === "file");
|
|
150174
150186
|
const sourceFile = getValidSourceFile(args.fileName);
|
|
150187
|
+
if (containsParseError(sourceFile)) return emptyArray;
|
|
150175
150188
|
const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
|
|
150176
150189
|
const mode = args.mode ?? (args.skipDestructiveCodeActions ? "SortAndCombine" /* SortAndCombine */ : "All" /* All */);
|
|
150177
150190
|
return ts_OrganizeImports_exports.organizeImports(sourceFile, formatContext, host, program, preferences, mode);
|
|
@@ -151819,6 +151832,7 @@ __export(ts_codefix_exports, {
|
|
|
151819
151832
|
setJsonCompilerOptionValue: () => setJsonCompilerOptionValue,
|
|
151820
151833
|
setJsonCompilerOptionValues: () => setJsonCompilerOptionValues,
|
|
151821
151834
|
tryGetAutoImportableReferenceFromTypeNode: () => tryGetAutoImportableReferenceFromTypeNode,
|
|
151835
|
+
typePredicateToAutoImportableTypeNode: () => typePredicateToAutoImportableTypeNode,
|
|
151822
151836
|
typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode
|
|
151823
151837
|
});
|
|
151824
151838
|
|
|
@@ -159905,7 +159919,25 @@ function withContext(context, typePrintMode, cb) {
|
|
|
159905
159919
|
if (typePrintMode === 1 /* Relative */) {
|
|
159906
159920
|
return relativeType(node);
|
|
159907
159921
|
}
|
|
159908
|
-
let type
|
|
159922
|
+
let type;
|
|
159923
|
+
if (isValueSignatureDeclaration(node)) {
|
|
159924
|
+
const signature = typeChecker.getSignatureFromDeclaration(node);
|
|
159925
|
+
if (signature) {
|
|
159926
|
+
const typePredicate = typeChecker.getTypePredicateOfSignature(signature);
|
|
159927
|
+
if (typePredicate) {
|
|
159928
|
+
if (!typePredicate.type) {
|
|
159929
|
+
return emptyInferenceResult;
|
|
159930
|
+
}
|
|
159931
|
+
return {
|
|
159932
|
+
typeNode: typePredicateToTypeNode(typePredicate, findAncestor(node, isDeclaration) ?? sourceFile, getFlags(typePredicate.type)),
|
|
159933
|
+
mutatedTarget: false
|
|
159934
|
+
};
|
|
159935
|
+
}
|
|
159936
|
+
type = typeChecker.getReturnTypeOfSignature(signature);
|
|
159937
|
+
}
|
|
159938
|
+
} else {
|
|
159939
|
+
type = typeChecker.getTypeAtLocation(node);
|
|
159940
|
+
}
|
|
159909
159941
|
if (!type) {
|
|
159910
159942
|
return emptyInferenceResult;
|
|
159911
159943
|
}
|
|
@@ -159922,11 +159954,13 @@ function withContext(context, typePrintMode, cb) {
|
|
|
159922
159954
|
if (isParameter(node) && typeChecker.requiresAddingImplicitUndefined(node)) {
|
|
159923
159955
|
type = typeChecker.getUnionType([typeChecker.getUndefinedType(), type], 0 /* None */);
|
|
159924
159956
|
}
|
|
159925
|
-
const flags = (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */;
|
|
159926
159957
|
return {
|
|
159927
|
-
typeNode: typeToTypeNode2(type, findAncestor(node, isDeclaration) ?? sourceFile,
|
|
159958
|
+
typeNode: typeToTypeNode2(type, findAncestor(node, isDeclaration) ?? sourceFile, getFlags(type)),
|
|
159928
159959
|
mutatedTarget: false
|
|
159929
159960
|
};
|
|
159961
|
+
function getFlags(type2) {
|
|
159962
|
+
return (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type2.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */;
|
|
159963
|
+
}
|
|
159930
159964
|
}
|
|
159931
159965
|
function createTypeOfFromEntityNameExpression(node) {
|
|
159932
159966
|
return factory.createTypeQueryNode(getSynthesizedDeepClone(node));
|
|
@@ -160089,11 +160123,18 @@ function withContext(context, typePrintMode, cb) {
|
|
|
160089
160123
|
});
|
|
160090
160124
|
return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2;
|
|
160091
160125
|
}
|
|
160092
|
-
function
|
|
160093
|
-
|
|
160094
|
-
|
|
160095
|
-
|
|
160096
|
-
|
|
160126
|
+
function typePredicateToTypeNode(typePredicate, enclosingDeclaration, flags = 0 /* None */) {
|
|
160127
|
+
let isTruncated = false;
|
|
160128
|
+
const result2 = typePredicateToAutoImportableTypeNode(typeChecker, importAdder, typePredicate, enclosingDeclaration, scriptTarget, declarationEmitNodeBuilderFlags2 | flags, {
|
|
160129
|
+
moduleResolverHost: program,
|
|
160130
|
+
trackSymbol() {
|
|
160131
|
+
return true;
|
|
160132
|
+
},
|
|
160133
|
+
reportTruncationError() {
|
|
160134
|
+
isTruncated = true;
|
|
160135
|
+
}
|
|
160136
|
+
});
|
|
160137
|
+
return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2;
|
|
160097
160138
|
}
|
|
160098
160139
|
function addTypeToVariableLike(decl) {
|
|
160099
160140
|
const { typeNode } = inferType(decl);
|
|
@@ -161764,6 +161805,17 @@ function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, s
|
|
|
161764
161805
|
}
|
|
161765
161806
|
return getSynthesizedDeepClone(typeNode);
|
|
161766
161807
|
}
|
|
161808
|
+
function typePredicateToAutoImportableTypeNode(checker, importAdder, typePredicate, contextNode, scriptTarget, flags, tracker) {
|
|
161809
|
+
let typePredicateNode = checker.typePredicateToTypePredicateNode(typePredicate, contextNode, flags, tracker);
|
|
161810
|
+
if ((typePredicateNode == null ? void 0 : typePredicateNode.type) && isImportTypeNode(typePredicateNode.type)) {
|
|
161811
|
+
const importableReference = tryGetAutoImportableReferenceFromTypeNode(typePredicateNode.type, scriptTarget);
|
|
161812
|
+
if (importableReference) {
|
|
161813
|
+
importSymbols(importAdder, importableReference.symbols);
|
|
161814
|
+
typePredicateNode = factory.updateTypePredicateNode(typePredicateNode, typePredicateNode.assertsModifier, typePredicateNode.parameterName, importableReference.typeNode);
|
|
161815
|
+
}
|
|
161816
|
+
}
|
|
161817
|
+
return getSynthesizedDeepClone(typePredicateNode);
|
|
161818
|
+
}
|
|
161767
161819
|
function typeContainsTypeParameter(type) {
|
|
161768
161820
|
if (type.isUnionOrIntersection()) {
|
|
161769
161821
|
return type.types.some(typeContainsTypeParameter);
|
|
@@ -183126,7 +183178,7 @@ var Project2 = class _Project {
|
|
|
183126
183178
|
}
|
|
183127
183179
|
fileExists(file) {
|
|
183128
183180
|
const path = this.toPath(file);
|
|
183129
|
-
return !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file);
|
|
183181
|
+
return !!this.projectService.getScriptInfoForPath(path) || !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file);
|
|
183130
183182
|
}
|
|
183131
183183
|
/** @internal */
|
|
183132
183184
|
resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
@@ -186150,59 +186202,13 @@ var _ProjectService = class _ProjectService {
|
|
|
186150
186202
|
watchWildcardDirectory(directory, flags, configFileName, config) {
|
|
186151
186203
|
let watcher = this.watchFactory.watchDirectory(
|
|
186152
186204
|
directory,
|
|
186153
|
-
(fileOrDirectory) =>
|
|
186154
|
-
|
|
186155
|
-
|
|
186156
|
-
|
|
186157
|
-
|
|
186158
|
-
|
|
186159
|
-
|
|
186160
|
-
this.watchPackageJsonFile(file, fileOrDirectoryPath, result);
|
|
186161
|
-
}
|
|
186162
|
-
const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
|
|
186163
|
-
if (isIgnoredFileFromWildCardWatching({
|
|
186164
|
-
watchedDirPath: this.toPath(directory),
|
|
186165
|
-
fileOrDirectory,
|
|
186166
|
-
fileOrDirectoryPath,
|
|
186167
|
-
configFileName,
|
|
186168
|
-
extraFileExtensions: this.hostConfiguration.extraFileExtensions,
|
|
186169
|
-
currentDirectory: this.currentDirectory,
|
|
186170
|
-
options: config.parsedCommandLine.options,
|
|
186171
|
-
program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames,
|
|
186172
|
-
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
|
|
186173
|
-
writeLog: (s) => this.logger.info(s),
|
|
186174
|
-
toPath: (s) => this.toPath(s),
|
|
186175
|
-
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
186176
|
-
})) return;
|
|
186177
|
-
if (config.updateLevel !== 2 /* Full */) config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
186178
|
-
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
|
186179
|
-
var _a;
|
|
186180
|
-
if (!watchWildcardDirectories) return;
|
|
186181
|
-
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
186182
|
-
if (!project) return;
|
|
186183
|
-
if (configuredProjectForConfig !== project && this.getHostPreferences().includeCompletionsForModuleExports) {
|
|
186184
|
-
const path = this.toPath(configFileName);
|
|
186185
|
-
if (find((_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) {
|
|
186186
|
-
project.markAutoImportProviderAsDirty();
|
|
186187
|
-
}
|
|
186188
|
-
}
|
|
186189
|
-
const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
|
|
186190
|
-
if (project.pendingUpdateLevel > updateLevel) return;
|
|
186191
|
-
if (this.openFiles.has(fileOrDirectoryPath)) {
|
|
186192
|
-
const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
|
|
186193
|
-
if (info.isAttached(project)) {
|
|
186194
|
-
const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */);
|
|
186195
|
-
project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
|
|
186196
|
-
} else {
|
|
186197
|
-
project.pendingUpdateLevel = updateLevel;
|
|
186198
|
-
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
186199
|
-
}
|
|
186200
|
-
} else {
|
|
186201
|
-
project.pendingUpdateLevel = updateLevel;
|
|
186202
|
-
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
186203
|
-
}
|
|
186204
|
-
});
|
|
186205
|
-
},
|
|
186205
|
+
(fileOrDirectory) => this.onWildCardDirectoryWatcherInvoke(
|
|
186206
|
+
directory,
|
|
186207
|
+
configFileName,
|
|
186208
|
+
config,
|
|
186209
|
+
result,
|
|
186210
|
+
fileOrDirectory
|
|
186211
|
+
),
|
|
186206
186212
|
flags,
|
|
186207
186213
|
this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine.watchOptions, getDirectoryPath(configFileName)),
|
|
186208
186214
|
WatchType.WildcardDirectory,
|
|
@@ -186225,6 +186231,59 @@ var _ProjectService = class _ProjectService {
|
|
|
186225
186231
|
};
|
|
186226
186232
|
return result;
|
|
186227
186233
|
}
|
|
186234
|
+
onWildCardDirectoryWatcherInvoke(directory, configFileName, config, wildCardWatcher, fileOrDirectory) {
|
|
186235
|
+
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
|
186236
|
+
const fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
|
186237
|
+
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectory))) {
|
|
186238
|
+
const file = this.getNormalizedAbsolutePath(fileOrDirectory);
|
|
186239
|
+
this.logger.info(`Config: ${configFileName} Detected new package.json: ${file}`);
|
|
186240
|
+
this.packageJsonCache.addOrUpdate(file, fileOrDirectoryPath);
|
|
186241
|
+
this.watchPackageJsonFile(file, fileOrDirectoryPath, wildCardWatcher);
|
|
186242
|
+
}
|
|
186243
|
+
const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
|
|
186244
|
+
if (isIgnoredFileFromWildCardWatching({
|
|
186245
|
+
watchedDirPath: this.toPath(directory),
|
|
186246
|
+
fileOrDirectory,
|
|
186247
|
+
fileOrDirectoryPath,
|
|
186248
|
+
configFileName,
|
|
186249
|
+
extraFileExtensions: this.hostConfiguration.extraFileExtensions,
|
|
186250
|
+
currentDirectory: this.currentDirectory,
|
|
186251
|
+
options: config.parsedCommandLine.options,
|
|
186252
|
+
program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames,
|
|
186253
|
+
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
|
|
186254
|
+
writeLog: (s) => this.logger.info(s),
|
|
186255
|
+
toPath: (s) => this.toPath(s),
|
|
186256
|
+
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
186257
|
+
})) return;
|
|
186258
|
+
if (config.updateLevel !== 2 /* Full */) config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
186259
|
+
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
|
186260
|
+
var _a;
|
|
186261
|
+
if (!watchWildcardDirectories) return;
|
|
186262
|
+
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
186263
|
+
if (!project) return;
|
|
186264
|
+
if (configuredProjectForConfig !== project && this.getHostPreferences().includeCompletionsForModuleExports) {
|
|
186265
|
+
const path = this.toPath(configFileName);
|
|
186266
|
+
if (find((_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path)) {
|
|
186267
|
+
project.markAutoImportProviderAsDirty();
|
|
186268
|
+
}
|
|
186269
|
+
}
|
|
186270
|
+
const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
|
|
186271
|
+
if (project.pendingUpdateLevel > updateLevel) return;
|
|
186272
|
+
if (this.openFiles.has(fileOrDirectoryPath)) {
|
|
186273
|
+
const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
|
|
186274
|
+
if (info.isAttached(project)) {
|
|
186275
|
+
const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */);
|
|
186276
|
+
project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
|
|
186277
|
+
} else {
|
|
186278
|
+
project.pendingUpdateLevel = updateLevel;
|
|
186279
|
+
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
186280
|
+
}
|
|
186281
|
+
} else {
|
|
186282
|
+
project.pendingUpdateLevel = updateLevel;
|
|
186283
|
+
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
186284
|
+
}
|
|
186285
|
+
});
|
|
186286
|
+
}
|
|
186228
186287
|
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
|
|
186229
186288
|
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
|
|
186230
186289
|
if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config)) return false;
|
|
@@ -188141,8 +188200,38 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188141
188200
|
}
|
|
188142
188201
|
this.removeOrphanScriptInfos();
|
|
188143
188202
|
}
|
|
188203
|
+
tryInvokeWildCardDirectories(info) {
|
|
188204
|
+
this.configFileExistenceInfoCache.forEach((configFileExistenceInfo, config) => {
|
|
188205
|
+
var _a, _b;
|
|
188206
|
+
if (!((_a = configFileExistenceInfo.config) == null ? void 0 : _a.parsedCommandLine) || contains(
|
|
188207
|
+
configFileExistenceInfo.config.parsedCommandLine.fileNames,
|
|
188208
|
+
info.fileName,
|
|
188209
|
+
!this.host.useCaseSensitiveFileNames ? equateStringsCaseInsensitive : equateStringsCaseSensitive
|
|
188210
|
+
)) {
|
|
188211
|
+
return;
|
|
188212
|
+
}
|
|
188213
|
+
(_b = configFileExistenceInfo.config.watchedDirectories) == null ? void 0 : _b.forEach((watcher, directory) => {
|
|
188214
|
+
if (containsPath(directory, info.fileName, !this.host.useCaseSensitiveFileNames)) {
|
|
188215
|
+
this.logger.info(`Invoking ${config}:: wildcard for open scriptInfo:: ${info.fileName}`);
|
|
188216
|
+
this.onWildCardDirectoryWatcherInvoke(
|
|
188217
|
+
directory,
|
|
188218
|
+
config,
|
|
188219
|
+
configFileExistenceInfo.config,
|
|
188220
|
+
watcher.watcher,
|
|
188221
|
+
info.fileName
|
|
188222
|
+
);
|
|
188223
|
+
}
|
|
188224
|
+
});
|
|
188225
|
+
});
|
|
188226
|
+
}
|
|
188144
188227
|
openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) {
|
|
188228
|
+
const existing = this.getScriptInfoForPath(normalizedPathToPath(
|
|
188229
|
+
fileName,
|
|
188230
|
+
projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory,
|
|
188231
|
+
this.toCanonicalFileName
|
|
188232
|
+
));
|
|
188145
188233
|
const info = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath);
|
|
188234
|
+
if (!existing && info && !info.isDynamic) this.tryInvokeWildCardDirectories(info);
|
|
188146
188235
|
const { retainProjects, ...result } = this.assignProjectToOpenedScriptInfo(info);
|
|
188147
188236
|
this.cleanupProjectsAndScriptInfos(
|
|
188148
188237
|
retainProjects,
|
|
@@ -188289,10 +188378,16 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188289
188378
|
}
|
|
188290
188379
|
/** @internal */
|
|
188291
188380
|
applyChangesInOpenFiles(openFiles, changedFiles, closedFiles) {
|
|
188381
|
+
let existingOpenScriptInfos;
|
|
188292
188382
|
let openScriptInfos;
|
|
188293
188383
|
let assignOrphanScriptInfosToInferredProject = false;
|
|
188294
188384
|
if (openFiles) {
|
|
188295
188385
|
for (const file of openFiles) {
|
|
188386
|
+
(existingOpenScriptInfos ?? (existingOpenScriptInfos = [])).push(this.getScriptInfoForPath(normalizedPathToPath(
|
|
188387
|
+
toNormalizedPath(file.fileName),
|
|
188388
|
+
file.projectRootPath ? this.getNormalizedAbsolutePath(file.projectRootPath) : this.currentDirectory,
|
|
188389
|
+
this.toCanonicalFileName
|
|
188390
|
+
)));
|
|
188296
188391
|
const info = this.getOrCreateOpenScriptInfo(
|
|
188297
188392
|
toNormalizedPath(file.fileName),
|
|
188298
188393
|
file.content,
|
|
@@ -188320,6 +188415,10 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188320
188415
|
}
|
|
188321
188416
|
}
|
|
188322
188417
|
let retainProjects;
|
|
188418
|
+
forEach(
|
|
188419
|
+
existingOpenScriptInfos,
|
|
188420
|
+
(existing, index) => !existing && openScriptInfos[index] && !openScriptInfos[index].isDynamic ? this.tryInvokeWildCardDirectories(openScriptInfos[index]) : void 0
|
|
188421
|
+
);
|
|
188323
188422
|
openScriptInfos == null ? void 0 : openScriptInfos.forEach((info) => {
|
|
188324
188423
|
var _a;
|
|
188325
188424
|
return (_a = this.assignProjectToOpenedScriptInfo(info).retainProjects) == null ? void 0 : _a.forEach((p) => (retainProjects ?? (retainProjects = /* @__PURE__ */ new Set())).add(p));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-pr-55887-
|
|
5
|
+
"version": "5.6.0-pr-55887-54",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|