fix(lib/plugins): fix depedency graphing logic

This commit is contained in:
PalmDevs 2025-07-21 21:27:17 +07:00
parent b4abedf954
commit 831636f14c
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -33,15 +33,18 @@ export function computePendingNodes() {
pRootNodes.clear()
while (stack.length) {
const plugin = stack.pop()!
if (visited.has(plugin)) continue
const plugin = stack.shift()!
if (plugin.manifest.dependencies?.length)
for (const dep of getPluginDependencies(plugin)) stack.push(dep)
else {
if (visited.has(plugin)) {
pListOrdered.push(plugin)
visited.add(plugin)
continue
}
if (plugin.manifest.dependencies?.length) {
for (const dep of getPluginDependencies(plugin)) stack.push(dep)
stack.push(plugin)
visited.add(plugin)
} else pListOrdered.push(plugin)
}
}