Packages

A WebSocket client built on gen_statem and Mint.

Current section

Files

Jump to
parley mix.exs
Raw

mix.exs

defmodule Parley.MixProject do
use Mix.Project
@version "0.1.0"
@source_url "https://github.com/joaop21/parley"
def project do
[
app: :parley,
version: @version,
elixir: "~> 1.19",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
dialyzer: dialyzer(),
name: "Parley",
description: "A WebSocket client built on gen_statem and Mint.",
source_url: @source_url,
package: package(),
docs: docs()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {Parley.Application, []}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp dialyzer do
[
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
end
defp package do
[
maintainers: ["João Silva"],
licenses: ["MIT"],
links: %{"Repository" => @source_url, "Documentation" => "https://hexdocs.pm/parley"},
files: ~w(lib .formatter.exs mix.exs README.md LICENSE)
]
end
defp docs do
[
main: "Parley",
source_ref: "v#{@version}",
source_url: @source_url,
extras: ["README.md", "LICENSE"],
groups_for_docs: [
Connection: &(&1[:kind] == :function),
Callbacks: &(&1[:kind] == :callback)
],
before_closing_body_tag: %{
html: """
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
}
]
end
defp deps do
[
{:mint_web_socket, "~> 1.0"},
{:castore, "~> 1.0"},
{:bandit, "~> 1.0", only: :test},
{:websock_adapter, "~> 0.5", only: :test},
{:ex_doc, "~> 0.35", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
]
end
end