# dependencies

Internal source-code dependency graph construction, circular-dependency detection, and `package.json` dependency categorization.

[`buildDependencyGraph`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/dependencies/#api-buildDependencyGraph) walks source files extracting `import`, `import()`, `require`, and `export-from` specifiers via regex, resolving relative paths to graph nodes with [`dependencies`](https://www.hyperfrontend.dev/docs/libraries/project-scope/models/#api-DependencyNode-prop-dependencies)/[`dependents`](https://www.hyperfrontend.dev/docs/libraries/project-scope/models/#api-DependencyNode-prop-dependents) edges and identifying roots (uncalled) and leaves (no outbound deps). [`findCircularDependencies`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/dependencies/#api-findCircularDependencies) performs DFS cycle detection and returns ordered cycle paths. [`getProjectDependencies`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/dependencies/#api-getProjectDependencies) categorizes `package.json` entries into runtime, development, peer, and optional buckets with totals.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/dependencies/
This file: https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/dependencies.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
