defmodule Filo.MixProject do use Mix.Project @version "0.2.0" @source_url "https://github.com/cwisecarver/filo" def project do [ app: :filo, version: @version, elixir: "~> 1.20", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), description: description(), package: package(), source_url: @source_url, name: "Filo", docs: docs() ] end def application do [ extra_applications: [:logger] ] end def cli do [preferred_envs: [precommit: :test]] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do [ {:plug, "~> 1.16"}, {:jason, "~> 1.4"}, # The WebSock behaviour for the Hrana-over-WebSocket handler. Behaviour # only (like Plug) — the host brings the actual server (Bandit/Cowboy). {:websock, "~> 0.5"}, # Optional: the transport behind the default `Filo.Client.Transport.Mint`. # Only needed by hosts that use the Hrana *client*; server-only hosts, and # clients that bring their own `:transport`, never pull it in. {:mint, "~> 1.6", optional: true}, # Test-only: a real HTTP/WebSocket server, plus a real SQLite engine for # the end-to-end executor, to run libsql clients against Filo. The library # itself ships a Plug and a WebSock handler and never depends on either. {:bandit, "~> 1.0", only: :test}, {:exqlite, "~> 0.27", only: :test}, {:ex_doc, "~> 0.34", only: :dev, runtime: false} ] end defp aliases do [ precommit: [ "compile --warning-as-errors", "deps.unlock --unused", "format --check-formatted", "test" ] ] end defp description do # This is the one line people read in Hex search results, so it says what Filo IS # (both halves) rather than how it is built. "A Hrana (libSQL) protocol server and client for Elixir — speak libSQL's wire " <> "protocol from any Plug app, backed by the SQLite engine of your choice." end defp package do [ licenses: ["MIT"], maintainers: ["Chris Wisecarver"], # Explicit, because Hex's default list silently omitted CONTRIBUTING.md while # including README/LICENSE/CHANGELOG — and docs/ lists it as an ex_doc extra, so # a missing file would have broken the published docs build. # Deliberately NOT shipped: AGENTS.md / CLAUDE.md (agent instructions, not user # docs) and test/ (needs bandit + exqlite, which are test-only deps). files: ~w(lib .formatter.exs mix.exs README.md LICENSE CHANGELOG.md CONTRIBUTING.md), links: %{ "GitHub" => @source_url, "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md" } ] end defp docs do [ main: "Filo", # Must match a tag that actually exists at the documented code. v0.1.0 was # tagged at the initial commit, so before v0.2.0 every source link for # Filo.Client (added after that tag) pointed into a tree without it. source_ref: "v#{@version}", extras: ["README.md", "CHANGELOG.md", "CONTRIBUTING.md"], groups_for_modules: [ Server: [Filo.Plug, Filo.Socket, Filo.Streams, Filo.Stream, Filo.Executor], Client: [Filo.Client, Filo.Client.Transport, Filo.Client.Transport.Mint], Protocol: [Filo.Value, Filo.Stmt, Filo.StmtResult, Filo.Error, Filo.Baton] ] ] end end