Composer.Manifest (composer v0.2.0)

Copy Markdown View Source

A cookbook's static manifest: lib/composer/<package>/manifest.exs.

The manifest is plain data - the cookbook's name, package and version, and every step's id, summary and facets, and every recipe's id ("group/name") and shortdoc - so tools such as shell completion can read a cookbook without running its code.

It is written by mix composer.cookbook.manifest and committed. It is never written at compile time, and mix composer.cookbook.lint fails when it is out of date.

Summary

Functions

Builds a cookbook's manifest data, sorted by id.

The manifest's path inside the cookbook's source tree.

Reads a committed manifest. It is plain data, so evaluating it runs no cookbook code.

Returns %{id: "group/name", shortdoc: "..."} for every recipe of a cookbook, sorted by id. A recipe whose group fails to load gets an empty shortdoc; lint reports the group.

Renders manifest data as formatted Elixir source, deterministically.

Functions

build(cookbook)

@spec build(Composer.Cookbook.t()) :: map()

Builds a cookbook's manifest data, sorted by id.

path(cookbook)

@spec path(Composer.Cookbook.t()) :: Path.t() | nil

The manifest's path inside the cookbook's source tree.

read(cookbook)

@spec read(Composer.Cookbook.t()) :: {:ok, map()} | :error

Reads a committed manifest. It is plain data, so evaluating it runs no cookbook code.

recipes(cookbook)

@spec recipes(Composer.Cookbook.t()) :: [%{id: String.t(), shortdoc: String.t()}]

Returns %{id: "group/name", shortdoc: "..."} for every recipe of a cookbook, sorted by id. A recipe whose group fails to load gets an empty shortdoc; lint reports the group.

render(data)

@spec render(map()) :: String.t()

Renders manifest data as formatted Elixir source, deterministically.