ZealDocsets.Project (zeal_docsets v0.1.7)

Copy Markdown View Source

Reads a Mix project's direct dependencies and their locked versions.

Combines information from two sources:

  • mix.exs - identifies the direct dependencies of the project, their version requirements, and which Mix environments they belong to.
  • mix.lock - provides the exact resolved versions currently locked.

Only Hex-sourced dependencies available in the :prod environment are included by default. Git and path dependencies are excluded because they may not have a corresponding page on hexdocs.pm. Extra packages requested via the CLI can also be appended even when they are not present in the target project's dependency tree.

Summary

Functions

Loads and returns the list of resolved direct Hex dependencies for the Mix project at path.

Parses an extra package specification.

Functions

load!(path, opts \\ [])

@spec load!(
  Path.t(),
  keyword()
) :: [ZealDocsets.Dep.t()]

Loads and returns the list of resolved direct Hex dependencies for the Mix project at path.

Options

  • :include_dev - when true, also includes dependencies declared for the :dev environment. Defaults to false.
  • :include_test - when true, also includes dependencies declared for the :test environment. Defaults to false.
  • :current_project - when true, reads dependency information from the currently loaded Mix project instead of reloading the project from disk. This is the supported mode when zeal_docsets is used as a dependency.
  • :extra_packages - a list of extra Hex packages to include even when they are not declared in mix.exs. Each entry accepts name or name@version.

Returns

A list of %ZealDocsets.Dep{} structs sorted alphabetically by package name. Each struct has a confirmed :hex source and a non-nil :version.

Raises

parse_extra_package_spec!(spec)

@spec parse_extra_package_spec!(String.t()) :: {String.t(), String.t() | nil}

Parses an extra package specification.

Accepted formats are package and package@version.