mix compile.nebula (NebulaAPI v0.5.0)

Copy Markdown View Source

Mix compiler that guards against forgetting nebula_api_server/0.

Opt in from a consuming app's mix.exs:

def project do
  [
    # ...
    compilers: Mix.compilers() ++ [:nebula]
  ]
end

It runs after :app (so every module is compiled and its .beam written), reads the persisted NebulaAPI attributes straight from the beams, and fails compilation when the app has modules with local methods on this node but no nebula_api_server() wired into its supervision tree — i.e. workers that would never start. This mirrors the compile errors NebulaAPI already raises (e.g. a defapi for an unknown node).