Skip to main content

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​

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 for config run.

Feature mapping​

dpdmrev-dep
--circularcircular 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:1config run / rev-dep circular exit non-zero on cycles
--skip-dynamic-importsrev-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 optionrev-dep equivalent
--tsconfigread automatically; --tsconfig-json to override
--extensionsbuilt-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​