Composer.Index (composer v0.2.0)

Copy Markdown View Source

The shell completion index: _build/composer/index.

A plain-text file of tab-separated lines that the completion script reads without starting the BEAM:

cookbook    local   Your recipes in /home/you/.config/composer
group   local:ash/  3 recipes
recipe  local:ash/base  Ash core: sourceror, ash and ash_phoenix
step    core:setup/credo    Adds Credo for static code analysis

Package cookbooks are read from their committed manifests (falling back to runtime metadata when a cookbook has none). Local group files are evaluated to read their shortdocs (they are evaluated on every run anyway); a group that fails to load lists its recipes with no shortdoc and never fails the refresh.

Every composer task refreshes the index as a side effect, and mix composer.index rebuilds it explicitly.

Summary

Functions

Builds the index lines for cookbooks.

The index path for the current project.

Writes the index atomically (a temp file, then a rename).

Functions

lines(cookbooks)

@spec lines([Composer.Cookbook.t()]) :: [String.t()]

Builds the index lines for cookbooks.

path()

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

The index path for the current project.

write(cookbooks, path \\ path())

@spec write([Composer.Cookbook.t()], Path.t()) :: :ok

Writes the index atomically (a temp file, then a rename).