Minga.Extensions.RecipePacks (Minga v0.1.0)

Copy Markdown View Source

Starts bundled recipe packs and registers their tool recipes through extension-owned sources.

Bundled packs use the same Minga.Tool.Recipe.Registry.register/2 path as third-party recipe packs. Each pack module provides a recipes/0 function returning a list of %Recipe{} structs. Stopping or reloading a pack removes all its recipes (and their command-index entries) from the registry without affecting other packs' recipes or user-supplied recipes.

Summary

Types

A module that implements the recipe-pack extension callbacks.

Runtime state for the bundled pack starter.

Functions

Returns a specification to start this module under a supervisor.

Returns bundled recipe pack modules in startup order.

Registers all recipes owned by a pack, replacing stale entries from an earlier load.

Reloads a pack by removing its previous source-owned entries, then registering its current recipes.

Returns the contribution source used for a pack.

Starts the bundled recipe pack loader.

Unregisters all recipes owned by a pack.

Types

pack_module()

@type pack_module() :: module()

A module that implements the recipe-pack extension callbacks.

state()

@type state() :: %{loaded: [atom()], failed: [{atom(), term()}]}

Runtime state for the bundled pack starter.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

packs()

@spec packs() :: [pack_module()]

Returns bundled recipe pack modules in startup order.

register_pack(pack_module)

@spec register_pack(pack_module()) :: :ok | {:error, term()}

Registers all recipes owned by a pack, replacing stale entries from an earlier load.

reload_pack(pack_module)

@spec reload_pack(pack_module()) :: :ok | {:error, term()}

Reloads a pack by removing its previous source-owned entries, then registering its current recipes.

source_for(pack_module)

@spec source_for(pack_module()) :: {:extension, atom()}

Returns the contribution source used for a pack.

start_link(opts \\ [])

@spec start_link(keyword()) :: Agent.on_start()

Starts the bundled recipe pack loader.

unregister_pack(pack_module)

@spec unregister_pack(pack_module()) :: :ok

Unregisters all recipes owned by a pack.