hecate_plugin_codegen (hecate_sdk v0.6.2)

View Source

Code generation for plugin scaffolding.

Generates Erlang source files from baked-in templates following hecate naming conventions and evoq behaviour patterns.

Four entry points: plugin/1 -- full plugin skeleton (root app, sup, rebar.config, manifest) division/1 -- aggregate + state + department apps desk/1 -- CMD, PRJ, or QRY desk with tests integration/1 -- emitter, listener, process manager, requester, responder

Templates are organized in sub-modules: hecate_plugin_codegen_plugin -- plugin + division templates hecate_plugin_codegen_cmd -- CMD desk templates hecate_plugin_codegen_prj -- PRJ desk templates hecate_plugin_codegen_qry -- QRY desk templates hecate_plugin_codegen_integration -- integration templates

All functions return {ok, [FilePath]} and are idempotent (skip existing files).

Summary

Functions

app_atom_name(Name)

-spec app_atom_name(binary() | atom() | string()) -> string().

b(V)

-spec b(string() | binary() | atom()) -> binary().

callback_module_name(Name)

-spec callback_module_name(binary() | atom() | string()) -> string().

delivery(Opts)

-spec delivery(map()) -> {ok, [string()]}.

desk(Opts)

-spec desk(map()) -> {ok, [string()]}.

division(Opts)

-spec division(map()) -> {ok, [string()]}.

fmt(Fmt, Args)

-spec fmt(string(), [term()]) -> string().

integration(Opts)

-spec integration(map()) -> {ok, [string()]}.

plugin(Opts)

-spec plugin(map()) -> {ok, [string()]}.

pluralize(Word)

-spec pluralize(string()) -> string().

replace_src_with_test(Path)

-spec replace_src_with_test(string()) -> string().

s(V)

-spec s(binary() | atom() | string()) -> string().

sdk_version()

-spec sdk_version() -> string().

store_name(Name)

-spec store_name(binary() | atom() | string()) -> string().

subject_from_cmd(CmdMod)

-spec subject_from_cmd(binary() | atom() | string()) -> string().

write_files(Files)

-spec write_files([{string(), string()}]) -> {ok, [string()]}.