Skip to content

Commit 4a5f2bf

Browse files
committed
Fix gap in rush-serve-plugin for scaling graph
1 parent 1c311e8 commit 4a5f2bf

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

rush-plugins/rush-serve-plugin/src/phasedCommandHandler.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,21 @@ export async function phasedCommandHandler(options: IPhasedCommandHandlerOptions
125125

126126
app.use(compression({}));
127127

128-
const selectedProjects: ReadonlySet<RushConfigurationProject> = context.projectSelection;
128+
const relevantProjects: ReadonlySet<RushConfigurationProject> = context.generateFullGraph
129+
? new Set(context.rushConfiguration.projects)
130+
: expandAllDependencies(context.projectSelection);
129131

130132
const serveConfig: RushServeConfiguration = new RushServeConfiguration();
131133

132134
const routingRules: IRoutingRule[] = await serveConfig.loadProjectConfigsAsync(
133-
selectedProjects,
135+
relevantProjects,
134136
logger.terminal,
135137
globalRoutingRules
136138
);
137139

138140
const { logServePath } = options;
139141
if (logServePath) {
140-
for (const project of selectedProjects) {
142+
for (const project of relevantProjects) {
141143
const projectLogServePath: string = getLogServePathForProject(logServePath, project.packageName);
142144

143145
routingRules.push({
@@ -250,3 +252,13 @@ export async function phasedCommandHandler(options: IPhasedCommandHandlerOptions
250252
manager.hooks.onWaitingForChanges.tap(PLUGIN_NAME, logHost);
251253
});
252254
}
255+
256+
function expandAllDependencies(projects: Iterable<RushConfigurationProject>): Set<RushConfigurationProject> {
257+
const expanded: Set<RushConfigurationProject> = new Set(projects);
258+
for (const project of expanded) {
259+
for (const dependency of project.dependencyProjects) {
260+
expanded.add(dependency);
261+
}
262+
}
263+
return expanded;
264+
}

0 commit comments

Comments
 (0)