ZealDocsets.Runner (zeal_docsets v0.1.7)

Copy Markdown View Source

Coordinates dependency selection and docset generation for a target project.

This module contains the side-effectful build pipeline but does not exit the VM. It returns a structured result that can be rendered by the CLI, Mix task, or tests.

Summary

Functions

Returns the default external workspace path used for downloads and output.

Filters dependencies by package name when a package filter is provided.

Runs dependency discovery and docset generation for a target project.

Summarizes build results into built, skipped, and failed counts.

Types

progress_event()

@type progress_event() ::
  {:resolving_extra_package, String.t(), String.t(), String.t() | nil}
  | {:resolved_extra_package, String.t(), String.t(), String.t()}
  | {:starting, String.t(), String.t(), pos_integer(), non_neg_integer()}
  | {:downloading, String.t(), String.t()}
  | {:building, String.t(), String.t()}
  | {:installing, String.t(), String.t(), boolean()}
  | {:finished, String.t(), String.t()}
  | {:skipped, String.t(), String.t()}
  | {:failed, String.t(), String.t(), String.t()}

result()

@type result() :: {:ok | :skipped | :error, String.t(), String.t()}

run_result()

@type run_result() :: %{
  project_path: Path.t(),
  workspace: Path.t(),
  zeal_path: Path.t(),
  install?: boolean(),
  concurrency: pos_integer(),
  include_dev: boolean(),
  include_test: boolean(),
  extra_packages: [String.t()],
  missing_icons: [String.t()],
  results: [result()],
  summary: summary()
}

summary()

@type summary() :: %{
  built: non_neg_integer(),
  skipped: non_neg_integer(),
  failed: non_neg_integer()
}

Functions

default_workspace()

@spec default_workspace() :: Path.t()

Returns the default external workspace path used for downloads and output.

filter_packages(deps, packages)

@spec filter_packages([map()], [String.t()]) :: list()

Filters dependencies by package name when a package filter is provided.

When packages is empty, the original dependency list is returned.

run(project_path, zeal_path, opts)

@spec run(Path.t(), Path.t(), keyword()) :: run_result()

Runs dependency discovery and docset generation for a target project.

Returns a map containing execution settings, per-package results, a build summary, and a list of packages whose generated docsets do not include a custom icon.

summarize(results)

@spec summarize([result()]) :: summary()

Summarizes build results into built, skipped, and failed counts.