Monorepo Dependency Graph Viewer
Build a deterministic workspace package DAG locally, detect cycles, and export Mermaid diagrams.
Examples
Internal vs external split
@demo/core depends on @demo/utils: workspace:* and react: ^19internalDependencies: ["@demo/utils"], externalDependencies: ["react"], topologicalOrder: ["@demo/utils", "@demo/core"], layers: { "@demo/utils": 0, "@demo/core": 1 }The workspace: spec creates an edge and layer 1; the npm range stays external and out of the graph.
Two-package cycle plus isolated node
a ↔ z via workspace:*, plus isolated with no depscycles: [["a","z","a"]], topologicalOrder: ["isolated", "a", "z"]DFS reports the a→z→a loop while the isolated package orders first at layer 0.
About this tool
Monorepo Dep Graph Viewer builds a workspace graph with buildDependencyGraph(workspaceYaml, inputs): parseWorkspaceGlobs reads the packages: list (block dash items and inline [..] forms, # comments stripped, ! negations dropped, duplicates deduped), inputs outside every glob are excluded, malformed package.json entries land in errors, and packages sort alphabetically by name for deterministic output.
Each package splits its combined dependencies/devDependencies/peerDependencies/optionalDependencies into internalDependencies (spec starts with workspace: OR the name exists in the workspace) versus externalDependencies (everything else, e.g. react: ^19). Internal links become sorted edges with their raw spec, cycles are found by depth-first search (a↔z yields [["a", "z", "a"]] with cyclicPackages ["a", "z"]), and topologicalOrder emits dependencies-first with alphabetical tie-breaking — cyclic leftovers append alphabetically after the acyclic nodes.
Layers derive from the order (layer = max(dep layer) + 1, so isolated packages sit at 0), and mermaid renders a flowchart TD with one pkg_<sanitized>[<label>] node per package plus pkg_from -->|<spec>| pkg_to lines for every internal edge — non-alphanumeric name characters collapse to _ in IDs.
How to use this tool
Describe the workspace
Paste pnpm-workspace-style YAML (packages: globs) and the package.json inputs; only glob-matched packages enter the graph.
Read internal vs external
workspace:* specs (or any dep name present in the workspace) count as internal edges; bare npm ranges like react ^19 stay external.
Break the cycles
Check cycles/cyclicPackages — a two-package loop reports [["a","z","a"]] — and remove or invert one edge before relying on the order.
Use cases
Sequencing workspace builds
Read topologicalOrder and layers to build leaf packages (layer 0) before their dependents.
Finding accidental cycles
Surface a↔z workspace loops that block topological builds and decide which direction to cut.
Embedding the graph in docs
Paste the Mermaid flowchart TD block — containing every internal edge — into Markdown or a wiki page.
Common mistakes
Mistake:Assuming every listed dependency is internal.
Fix:Only workspace:-prefixed specs or names present in the workspace are internal; plain npm ranges are external even when a workspace package shares the name pattern.
Mistake:Treating topologicalOrder as cycle-free proof.
Fix:Cyclic packages are appended alphabetically after the acyclic order — always check cycles/cyclicPackages alongside the order.
Frequently asked questions
What does this tool do?
It builds a workspace graph with buildDependencyGraph(workspaceYaml, inputs): glob-matched packages sort alphabetically, deps split into internal vs external, cycles are DFS-detected, and the result carries topologicalOrder, layers, and a flowchart TD Mermaid block.
What counts as internal, and what do cycles and layers look like?
A dep is internal when its spec starts with workspace: or its name exists in the workspace (react ^19 stays external); a↔z yields cycles [["a","z","a"]] with cyclicPackages ["a","z"]; and an isolated package sits at layer 0 and orders first.
Is my package data uploaded or stored?
No. Glob matching, edge building, cycle search, and Mermaid rendering are pure client-side computation — manifests never leave your browser.
Does the Mermaid output cover every edge?
Yes. Each internal edge renders one pkg_from -->|<spec>| pkg_to line (names sanitized to pkg_<A-Za-z0-9_>), so every entry in edges appears verbatim in the mermaid string.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
AI Function Calling Schema Generator
Generate function calling JSON schemas from TypeScript interfaces
Algorithm Arena & Data Structure Visualizer
Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.
Ansible Playbook Generator
Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML