Skip to content

Commit

Permalink
Fix topo sort for standAlone packages (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul authored May 14, 2024
1 parent 797ee1f commit cc563ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/dev/scripts/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -531,5 +531,10 @@ export function topoSort (dirs) {
const circularSorted = Object.keys(circular)
.sort((a, b) => circular[a].vertices.length < circular[b].vertices.length ? -1 : 1);

return sorted.concat(circularSorted);
const flattenedEdges = edges.flat();
// Packages that have no edges
/** @type {string[]} */
const standAlones = dirs.filter((d) => !flattenedEdges.includes(d));

return sorted.concat(circularSorted).concat(standAlones);
}

0 comments on commit cc563ff

Please sign in to comment.