Skip to content

Commit d9ddc8b

Browse files
committed
fix: fixed circular deps detection
1 parent 500b54b commit d9ddc8b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/build/build-circular-deps.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,24 @@ export async function buildCircularDeps(basePath: string): Promise<boolean> {
1313
const madgeRes = await madge(path.join(basePath, "src"), {
1414
fileExtensions: ["ts"],
1515
detectiveOptions: {
16-
skipTypeImports: true,
16+
ts: {
17+
skipTypeImports: true,
18+
},
1719
},
1820
}),
1921
circularDeps = madgeRes.circular();
2022

2123
if (circularDeps.length) {
22-
throw new Error(`Circular dependencies found: ${circularDeps.join(", ")}`);
23-
}
24+
console.error("Circular dependencies found!");
25+
26+
for (const dep of circularDeps) {
27+
console.error(`${dep.join(" > ")}`);
28+
}
2429

25-
res = true;
30+
res = false;
31+
} else {
32+
res = true;
33+
}
2634
} catch (e) {
2735
console.error(e);
2836
}

0 commit comments

Comments
 (0)