MCPcopy Index your code
hub / github.com/nodejs/node / queueReferencingProjects

Function queueReferencingProjects

test/fixtures/snapshot/typescript.js:125170–125233  ·  view source on GitHub ↗
(state, project, projectPath, projectIndex, config, buildOrder, buildResult)

Source from the content-addressed store, hash-verified

125168 });
125169 }
125170 function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) {
125171 // Queue only if there are no errors
125172 if (buildResult & BuildResultFlags.AnyErrors)
125173 return;
125174 // Only composite projects can be referenced by other projects
125175 if (!config.options.composite)
125176 return;
125177 // Always use build order to queue projects
125178 for (var index = projectIndex + 1; index < buildOrder.length; index++) {
125179 var nextProject = buildOrder[index];
125180 var nextProjectPath = toResolvedConfigFilePath(state, nextProject);
125181 if (state.projectPendingBuild.has(nextProjectPath))
125182 continue;
125183 var nextProjectConfig = parseConfigFile(state, nextProject, nextProjectPath);
125184 if (!nextProjectConfig || !nextProjectConfig.projectReferences)
125185 continue;
125186 for (var _i = 0, _a = nextProjectConfig.projectReferences; _i < _a.length; _i++) {
125187 var ref = _a[_i];
125188 var resolvedRefPath = resolveProjectName(state, ref.path);
125189 if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath)
125190 continue;
125191 // If the project is referenced with prepend, always build downstream projects,
125192 // If declaration output is changed, build the project
125193 // otherwise mark the project UpToDateWithUpstreamTypes so it updates output time stamps
125194 var status = state.projectStatus.get(nextProjectPath);
125195 if (status) {
125196 switch (status.type) {
125197 case ts.UpToDateStatusType.UpToDate:
125198 if (buildResult & BuildResultFlags.DeclarationOutputUnchanged) {
125199 if (ref.prepend) {
125200 state.projectStatus.set(nextProjectPath, {
125201 type: ts.UpToDateStatusType.OutOfDateWithPrepend,
125202 outOfDateOutputFileName: status.oldestOutputFileName,
125203 newerProjectName: project
125204 });
125205 }
125206 else {
125207 status.type = ts.UpToDateStatusType.UpToDateWithUpstreamTypes;
125208 }
125209 break;
125210 }
125211 // falls through
125212 case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:
125213 case ts.UpToDateStatusType.OutOfDateWithPrepend:
125214 if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {
125215 state.projectStatus.set(nextProjectPath, {
125216 type: ts.UpToDateStatusType.OutOfDateWithUpstream,
125217 outOfDateOutputFileName: status.type === ts.UpToDateStatusType.OutOfDateWithPrepend ? status.outOfDateOutputFileName : status.oldestOutputFileName,
125218 newerProjectName: project
125219 });
125220 }
125221 break;
125222 case ts.UpToDateStatusType.UpstreamBlocked:
125223 if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
125224 clearProjectStatus(state, nextProjectPath);
125225 }
125226 break;
125227 }

Callers 1

executeStepsFunction · 0.85

Calls 8

toResolvedConfigFilePathFunction · 0.85
parseConfigFileFunction · 0.85
resolveProjectNameFunction · 0.85
clearProjectStatusFunction · 0.85
addProjToQueueFunction · 0.85
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…