Skip to content

Commit f8f3e49

Browse files
committed
fix atomized logic
1 parent 0ba631b commit f8f3e49

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

libs/shared/llm-context/src/lib/project-graph.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@ export function detectAtomizedTargets(targetGroups: Record<string, string[]>): {
2626
const atomizedTargetsMap = new Map<string, string[]>();
2727
const targetsToExclude: string[] = [];
2828

29-
for (const group in targetGroups) {
30-
const targets = targetGroups[group];
31-
32-
for (const target of targets) {
33-
if (targets.some((t) => t !== target && t.startsWith(target))) {
34-
rootTargets.add(target);
35-
36-
const atomizedTargets = targets.filter(
37-
(t) => t.startsWith(target) && t !== target,
38-
);
39-
atomizedTargetsMap.set(target, atomizedTargets);
40-
targetsToExclude.push(...atomizedTargets);
41-
}
29+
for (const groupName in targetGroups) {
30+
const targets = targetGroups[groupName];
31+
32+
// The group name is the root target name (from metadata)
33+
const rootTarget = groupName;
34+
const atomizedTargets = targets.filter((t) => t !== rootTarget);
35+
36+
if (atomizedTargets.length > 0) {
37+
rootTargets.add(rootTarget);
38+
atomizedTargetsMap.set(rootTarget, atomizedTargets);
39+
targetsToExclude.push(...atomizedTargets);
4240
}
4341
}
4442

0 commit comments

Comments
 (0)