Migrating from dpdm
dpdm is a static dependency analyzer that detects circular dependencies and unused files. rev-dep covers both and folds them into one config alongside the rest of a dependency-hygiene suite.
Why migrate​
- Speed and a single pass. rev-dep is Go-based and parallel - up to 13x faster on large repos.
- More checks, one config. dpdm focuses on cycles and unused files. rev-dep adds unused exports, unused/missing dependencies, module boundaries, restricted imports, and more.
What carries over, what changes​
- Covered well: circular dependencies, unused (orphan) files.
- Different output: dpdm can print/serialize the dependency tree (
--tree, JSON). rev-dep exposes the graph through the exploratory toolkit (files,resolve) and a JSON output forconfig run.
Feature mapping​
| dpdm | rev-dep |
|---|---|
--circular | circular command / circularImportsDetection |
--detect-unused-files-from <glob> | orphanFilesDetection (with entry points) |
--tree / -o, --output (JSON) | exploratory files - lists files imported by selected entry point |
--exit-code circular:1 | config run / rev-dep circular exit non-zero on cycles |
--skip-dynamic-imports | rev-dep traces dynamic imports as usage by design |
Translating your usage​
dpdm --circular --tree false src/index.ts
dpdm --detect-unused-files-from 'src/**/*.ts' src/index.ts
become:
{
"rules": [
{
"path": ".",
"prodEntryPoints": ["src/index.ts"],
"circularImportsDetection": {
"enabled": true,
"ignoreTypeImports": true,
"algorithm": "SCC"
},
"orphanFilesDetection": {
"enabled": true
}
}
]
}
| dpdm option | rev-dep equivalent |
|---|---|
--tsconfig | read automatically; --tsconfig-json to override |
--extensions | built-in source extensions (supported file types) |
--exclude <regexp> | graphExclude / ignoreFiles (globs) |
Running it​
# dpdm
npx dpdm --circular src/index.ts
# rev-dep
rev-dep circular # ad-hoc
rev-dep config run # CI gate
Next steps​
- Orphan files check - and note the monorepo placement guidance.
- Monorepo integration guide.