defmodule Quiver.MixProject do use Mix.Project def project do [ app: :quiver, description: description(), package: package(), version: "0.4.0", elixir: "~> 1.19", elixirc_paths: elixirc_paths(Mix.env()), docs: docs(), dialyzer: [ plt_core_path: "_plts/core" ], preferred_cli_env: [ coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test, "coveralls.cobertura": :test ], start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases() ] end # Run "mix help compile.app" to learn about applications. def application do [ mod: {Quiver.Application, []}, extra_applications: [:logger, :ssl, :public_key] ] end defp docs do benchmark_extras = "guides/benchmarks/*.md" |> Path.wildcard() |> Enum.sort() |> Enum.map(fn path -> name = path |> Path.basename(".md") |> String.replace("_", " ") |> String.split() |> Enum.map_join(" ", &String.capitalize/1) {path, title: name} end) [ main: "readme", source_url: "https://github.com/edlontech/quiver", extras: [ {"README.md", title: "Overview"}, {"guides/getting-started.md", title: "Getting Started"}, {"guides/architecture.md", title: "Architecture"}, {"guides/error-handling.md", title: "Error Handling"}, {"guides/telemetry.md", title: "Telemetry"}, {"guides/http3.md", title: "HTTP/3"}, {"CHANGELOG.md", title: "Changelog"}, {"LICENSE", title: "License"} ] ++ benchmark_extras, groups_for_extras: [ Guides: [ "guides/getting-started.md", "guides/architecture.md", "guides/error-handling.md", "guides/telemetry.md", "guides/http3.md" ], Benchmarks: ~r/guides\/benchmarks\/.+/, About: [ "CHANGELOG.md", "LICENSE" ] ], groups_for_modules: [ "Client API": [ Quiver, Quiver.Request, Quiver.Response, Quiver.StreamResponse ], Integrations: [ Tesla.Adapter.Quiver ], Configuration: [ Quiver.Supervisor, Quiver.Config, Quiver.Config.Rule ], Telemetry: [ Quiver.Telemetry ], Errors: [ Quiver.Error, ~r/Quiver\.Error\./ ], Pools: [ Quiver.Pool, Quiver.Pool.Manager, Quiver.Pool.HTTP1, Quiver.Pool.HTTP2, Quiver.Pool.HTTP2.Connection, Quiver.Pool.HTTP3, Quiver.Pool.HTTP3.Connection ], Connections: [ Quiver.Conn, Quiver.Conn.HTTP1, Quiver.Conn.HTTP2, Quiver.Conn.HTTP3, ~r/Quiver\.Conn\.HTTP[123]\./ ], Transports: [ Quiver.Transport, Quiver.Transport.SSL, Quiver.Transport.TCP ] ], nest_modules_by_prefix: [ Quiver.Error, Quiver.Conn, Quiver.Pool ] ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(:dev), do: ["lib", "bench/support"] defp elixirc_paths(_), do: ["lib"] defp deps do [ {:assert_eventually, "~> 1.0", only: :test}, {:bandit, "~> 1.0", only: [:dev, :test]}, {:benchee, "~> 1.0", only: :dev}, {:benchee_markdown, "~> 0.3", only: :dev}, {:benchee_json, "~> 1.0", only: :dev}, {:finch, "~> 0.21", only: :dev}, {:castore, "~> 1.0"}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:doctor, "~> 0.22", only: :dev}, {:ex_check, "~> 0.16", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.18", only: [:dev, :test]}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:gen_state_machine, "~> 3.0"}, {:hpax, "~> 1.0"}, {:mimic, "~> 2.2", only: :test}, {:mix_audit, ">= 0.0.0", only: [:dev, :test], runtime: false}, {:nimble_pool, "~> 1.1"}, {:recode, "~> 0.8", only: [:dev], runtime: false}, {:splode, "~> 0.2"}, {:telemetry, "~> 1.0"}, {:tesla, "~> 1.16", optional: true}, {:testcontainers, "~> 1.13", only: [:test, :dev]}, {:tidewave, "~> 0.5", only: :dev, runtime: false}, {:quic, "~> 1.6"}, {:zoi, "~> 0.11"} ] end defp aliases do [ test: ["test --exclude integration --exclude smoke"], "test.integration": ["test --only integration"], "test.smoke": ["test --only smoke"], "smoke.certs": ["cmd ./docker/generate_certs.sh"], "smoke.up": ["cmd docker compose -f docker/docker-compose.yml up -d --wait h3-server"], "smoke.down": ["cmd docker compose -f docker/docker-compose.yml down"], "bench.concurrency": ["run bench/concurrency.exs"], "bench.payload": ["run bench/payload.exs"], "bench.pool_pressure": ["run bench/pool_pressure.exs"], "bench.profile_payload": ["run bench/profile_payload.exs"], "bench.streaming": ["run bench/streaming.exs"], "bench.vs_finch": ["run bench/vs_finch.exs"], "bench.vs_tesla": ["run bench/vs_tesla.exs"], "bench.http3": ["run bench/http3.exs"], "bench.all": [ "bench.concurrency", "bench.payload", "bench.pool_pressure", "bench.profile_payload", "bench.streaming", "bench.vs_finch", "bench.vs_tesla", "bench.http3" ] ] end def cli do [ preferred_envs: [ coveralls: :test, "coveralls.post": :test, "coveralls.github": :test, "coveralls.html": :test, "test.integration": :test, "test.smoke": :test ] ] end defp description() do "A blazing fast, resilient, and easy-to-use HTTP client for Elixir" end defp package() do [ licenses: ["MIT"], links: %{"GitHub" => "https://github.com/edlontech/quiver"}, files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE .formatter.exs) ] end end