defmodule LibclusterMesh.MixProject do use Mix.Project @version "0.1.0" @source_url "https://github.com/kentaro/libcluster_mesh" @spec project() :: keyword() def project do [ app: :libcluster_mesh, version: @version, elixir: "~> 1.18", elixirc_options: elixirc_options(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), dialyzer: dialyzer(), name: "libcluster_mesh", description: description(), package: package(), docs: docs(), test_coverage: [summary: [threshold: 90]] ] end @spec application() :: keyword() def application do [extra_applications: [:logger]] end @spec cli() :: keyword() def cli do [preferred_envs: [check: :test]] end defp description do "libcluster strategies for mesh VPNs (Tailscale, NetBird, LOLIPOP Zero " <> "Trust Link, plain WireGuard) that discover peers by polling the local " <> "mesh daemon — no cloud API, no API keys, no static host lists" end defp elixirc_options(env) when env in [:dev, :test], do: [warnings_as_errors: true] defp elixirc_options(_env), do: [] defp deps do [ {:libcluster, "~> 3.5"}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false} ] end defp aliases do [ check: [ "format --check-formatted", "compile --warnings-as-errors", "test --cover", "credo --strict", "dialyzer" ] ] end defp dialyzer do [ plt_add_apps: [:ex_unit], plt_local_path: "priv/plts", plt_core_path: "priv/plts", flags: [:error_handling, :underspecs, :unmatched_returns] ] end defp package do [ maintainers: ["Kentaro Kuribayashi"], licenses: ["MIT"], links: %{"GitHub" => @source_url}, files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE .formatter.exs) ] end defp docs do [ main: "readme", source_url: @source_url, source_ref: "v#{@version}", extras: ["README.md", "CHANGELOG.md", "LICENSE"], groups_for_modules: [ Overview: [LibclusterMesh], Strategies: [ Cluster.Strategy.TailscaleLocal, Cluster.Strategy.Netbird, Cluster.Strategy.LolipopZTL, Cluster.Strategy.WireGuard ], Internals: [ LibclusterMesh.CIDR, LibclusterMesh.Config, LibclusterMesh.NetbirdStatus, LibclusterMesh.Parse, LibclusterMesh.Peer, LibclusterMesh.Poller, LibclusterMesh.Runner, LibclusterMesh.Runner.SystemCmd, LibclusterMesh.TailscaleStatus, LibclusterMesh.WireGuardDump, LibclusterMesh.ZTLStatus ] ] ] end end