defmodule PhoenixLiveState.MixProject do
  use Mix.Project

  @app :phoenix_live_state
  @version "0.1.0"
  @name "Phoenix Live State"
  @description """
  PhoenixLiveState enables LiveView processes to share reactive state across a
  cluster of nodes. Attach LiveViews to a state server and get automatic assign
  synchronization.
  """
  @github "https://github.com/msramos/phoenix_live_state"

  def project do
    [
      app: @app,
      version: @version,
      elixir: "~> 1.15",
      start_permanent: Mix.env() == :prod,
      name: @name,
      description: @description,
      deps: deps(),
      docs: docs(),
      package: package(),
      source_url: @github
    ]
  end

  def application do
    [
      extra_applications: [:logger]
    ]
  end

  defp deps do
    [
      {:phoenix_live_view, "~> 1.0"},
      {:ex_doc, "~> 0.34", only: :dev, runtime: false, warn_if_outdated: true},
      {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
      {:credo, "~> 1.7", only: [:dev, :test], runtime: false}
    ]
  end

  defp docs do
    [
      extras: ["README.md", "CHANGELOG.md"],
      licenes: ["MIT"],
      files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE.md),
      links: %{
        Changelog: "https://github.com/msramos/phoenix_live_state/releases",
        GitHub: "https://github.com/msramos/phoenix_live_state"
      }
    ]
  end

  defp package do
    [
      name: "phoenix_live_state",
      licenses: ["MIT"],
      links: %{"GitHub" => @github}
    ]
  end
end
