Skip to content

Commit cc563ff

Browse files
authored
Fix topo sort for standAlone packages (#1143)
1 parent 797ee1f commit cc563ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/dev/scripts/util.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,5 +531,10 @@ export function topoSort (dirs) {
531531
const circularSorted = Object.keys(circular)
532532
.sort((a, b) => circular[a].vertices.length < circular[b].vertices.length ? -1 : 1);
533533

534-
return sorted.concat(circularSorted);
534+
const flattenedEdges = edges.flat();
535+
// Packages that have no edges
536+
/** @type {string[]} */
537+
const standAlones = dirs.filter((d) => !flattenedEdges.includes(d));
538+
539+
return sorted.concat(circularSorted).concat(standAlones);
535540
}

0 commit comments

Comments
 (0)