Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

06.3 Dependency cycles

Keeping the workspace DAG acyclic and surviving circular path deps."

Dependency cycles

Cycles are how monorepos learn humility. The resolver builds a DAG—if you create a cycle, nothing moral happens next.

flowchart BT
  UTIL[util lib] --> CORE[core lib]
  CORE --> APP[app]

Forbidden emotional support:

flowchart LR
  A[project A] --> B[project B]
  B --> A

With source = path, cycles are just folders pointing at each other. Symptoms:

  • Resolution failures
  • Nondeterministic build order in tooling that assumed a DAG

Fix by extracting shared types into a third lower library both sides depend on—classic graph surgery, not compiler therapy.

Resist pointing production App targets at Test libs to “share helpers.” Use a dedicated Lib target for shared code.

CI and monorepos