mix compile.nebula (NebulaAPI v0.6.0)

Copy Markdown View Source

Mix compiler that guards against forgetting nebula_api_server/0.

Opt in from each consuming app's mix.exs (per-app — see the umbrella note):

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

It runs after :app, reads the persisted NebulaAPI attributes from the beams, and:

  • fails when the app has local methods on this build but no nebula_api_server() is wired (workers that would never start);
  • warns when a server is wired but the app defines no defapi methods at all (a server with nothing to serve — likely a leftover nebula_api_server()).

Umbrella note

Per-app: it must be in the compilers: of each child app. mix compile in an umbrella recurses into the child apps and runs their compilers:; adding :nebula to the umbrella root mix.exs does nothing (the root's custom compilers are not invoked for an apps_path project). There is no single root-level switch — opt each app in.