Skip to content

Commit da4418e

Browse files
committed
fix(@angular/cli): fix sourceRoot resolution for MCP projects tool
Ensure that project.sourceRoot is used directly as it is already relative to the workspace root, preventing duplicated path prefixes for sub-projects.
1 parent f1ed025 commit da4418e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/cli/src/commands/mcp/tools/projects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ async function loadAndParseWorkspace(
467467
const projects = [];
468468
const workspaceRoot = dirname(configFile);
469469
for (const [name, project] of ws.projects.entries()) {
470-
const sourceRoot = posix.join(project.root, project.sourceRoot ?? 'src');
470+
const sourceRoot = project.sourceRoot ?? posix.join(project.root, 'src');
471471
const fullSourceRoot = join(workspaceRoot, sourceRoot);
472472
const unitTestFramework = getUnitTestFramework(project.targets.get('test'));
473473
const styleLanguage = await getProjectStyleLanguage(project, ws, fullSourceRoot);

0 commit comments

Comments
 (0)