zuke.tools.dpdm

← Python API reference

@zuke/dpdm 1.1.0: @zuke/dpdm — a typed DpdmTasks wrapper for the [dpdm](https://github.com/acrazing/dpdm) CLI (module dependency graph and circular-import analysis), for use in Zuke builds.

Symbols

#

DpdmAnalyzeSettings

class
class DpdmAnalyzeSettings(ToolSettings)

Settings for a dpdm analysis run.

  • transform() -> Self

    Transform TypeScript modules to JavaScript before analysis (--transform).

  • no_tree() -> Self

    Suppress the dependency tree output (--no-tree).

  • no_circular() -> Self

    Suppress the circular-dependency output (--no-circular).

  • no_warning() -> Self

    Suppress warnings about unresolved/missing modules (--no-warning).

  • no_progress() -> Self

    Disable the progress bar (--no-progress).

  • output(path: str) -> Self

    Write the analysis as JSON to a file (--output).

  • tsconfig(path: str) -> Self

    Use an explicit tsconfig for module resolution (--tsconfig).

  • context(path: str) -> Self

    Set the context directory used to shorten printed paths (--context).

  • extensions(*exts: str) -> Self

    Extensions to resolve, e.g. .ts, .tsx (--extensions).

  • js(*exts: str) -> Self

    Extensions treated as JavaScript-like (--js).

  • include(pattern: str) -> Self

    Only analyze files matching this regular expression (--include).

  • exclude(pattern: str) -> Self

    Skip files matching this regular expression (--exclude).

  • skip_dynamic_imports(mode: Literal['circular', 'tree']) -> Self

    Skip dynamic imports when detecting circular or tree (--skip-dynamic-imports).

  • detect_unused_files_from(glob: str) -> Self

    Detect unused files starting from this glob (--detect-unused-files-from).

  • exit_code(rule: str) -> Self

    Exit with a code when a case occurs, e.g. circular:1 (--exit-code).

  • entries(*paths: str) -> Self

    The entry files or globs to analyze (appended after all options).

#

DpdmTasks

class
class DpdmTasks

Typed task functions for the dpdm CLI.

  • static async analyze(ctx: ServiceContext, configure: Callable[[DpdmAnalyzeSettings], DpdmAnalyzeSettings] | None=None) -> ExecResult

    Analyze dependencies and circular imports: dpdm <flags> <entries...>.