wayfarer/mix.exs

125 lines
3.3 KiB
Elixir
Raw Normal View History

2023-10-14 11:10:56 +13:00
defmodule Wayfarer.MixProject do
2023-10-13 18:46:21 +13:00
use Mix.Project
2023-10-13 19:05:21 +13:00
@moduledoc """
A runtime-configurable HTTP reverse proxy based on Bandit.
"""
2023-11-19 17:57:26 +13:00
@version "0.4.0"
2023-10-13 19:05:21 +13:00
2023-10-13 18:46:21 +13:00
def project do
[
2023-10-14 11:10:56 +13:00
app: :wayfarer,
2023-10-13 19:05:21 +13:00
version: @version,
2023-10-13 18:46:21 +13:00
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
2023-10-13 19:05:21 +13:00
consolidate_protocols: Mix.env() != :test,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
description: @moduledoc,
package: package(),
2024-02-05 14:54:41 +13:00
source_url: "https://harton.dev/james/wayfarer",
homepage_url: "https://harton.dev/james/wayfarer",
2023-10-13 19:05:21 +13:00
aliases: aliases(),
dialyzer: [plt_add_apps: []],
docs: [
2023-10-14 11:10:56 +13:00
main: "Wayfarer",
formatters: ["html"],
extra_section: "GUIDES",
filter_modules: ~r/^Elixir.Wayfarer/,
2024-02-05 14:54:41 +13:00
source_url_pattern: "https://harton.dev/james/wayfarer/src/branch/main/%{path}#L%{line}",
spark: [
extensions: [
%{
module: Wayfarer.Dsl,
name: "Wayfarer.Dsl",
target: "Wayfarer",
type: "Wayfarer"
}
]
],
extras:
["README.md"]
|> Enum.concat(Path.wildcard("documentation/**/*.{md,livemd,cheatmd}")),
groups_for_extras:
"documentation/*"
|> Path.wildcard()
|> Enum.map(fn dir ->
name =
dir
|> Path.split()
|> List.last()
|> String.split("_")
|> Enum.map_join(" ", &String.capitalize/1)
files =
dir
|> Path.join("**.{md,livemd,cheatmd}")
|> Path.wildcard()
{name, files}
end)
2023-10-13 19:05:21 +13:00
]
]
end
defp package do
[
2023-10-14 11:10:56 +13:00
name: :wayfarer,
2023-10-13 19:05:21 +13:00
files: ~w[lib .formatter.exs mix.exs README.md LICENSE.md CHANGELOG.md],
maintainers: ["James Harton <james@harton.nz>"],
2023-10-13 19:05:21 +13:00
licenses: ["HL3-FULL"],
links: %{
2024-02-05 14:54:41 +13:00
"Source" => "https://harton.dev/james/wayfarer"
2023-10-13 19:05:21 +13:00
},
2024-02-05 14:54:41 +13:00
source_url: "https://harton.dev/james/wayfarer"
2023-10-13 18:46:21 +13:00
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
2023-10-13 19:05:21 +13:00
extra_applications: [:logger],
2023-10-14 11:10:56 +13:00
mod: {Wayfarer.Application, []}
2023-10-13 18:46:21 +13:00
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
2023-10-13 19:05:21 +13:00
opts = [only: ~w[dev test]a, runtime: false]
2023-10-13 18:46:21 +13:00
[
{:bandit, "~> 1.0"},
{:castore, "~> 1.0"},
{:ip, "~> 2.0"},
{:mint, "~> 1.5"},
{:nimble_options, "~> 1.0"},
{:plug, "~> 1.15"},
{:spark, "~> 2.0"},
{:telemetry, "~> 1.2"},
{:websock, "~> 0.5"},
2023-10-13 19:05:21 +13:00
# Dev/test
{:credo, "~> 1.7", opts},
{:dialyxir, "~> 1.3", opts},
{:doctor, "~> 0.21", opts},
{:earmark, ">= 0.0.0", opts},
{:ex_check, "~> 0.16", opts},
2023-10-13 19:05:21 +13:00
{:ex_doc, ">= 0.0.0", opts},
{:faker, "~> 0.18", opts},
2023-10-13 19:05:21 +13:00
{:git_ops, "~> 2.6", opts},
{:mimic, "~> 1.7", Keyword.delete(opts, :runtime)},
2023-10-13 19:05:21 +13:00
{:mix_audit, "~> 2.1", opts}
2023-10-13 18:46:21 +13:00
]
end
2023-10-13 19:05:21 +13:00
defp aliases,
do: [
"spark.formatter": "spark.formatter --extensions=Wayfarer.Dsl",
"spark.cheat_sheets": "spark.cheat_sheets --extensions=Wayfarer.Dsl"
]
2023-10-13 19:05:21 +13:00
defp elixirc_paths(env) when env in ~w[dev test]a, do: ~w[lib test/support]
defp elixirc_paths(_), do: ~w[lib]
2023-10-13 18:46:21 +13:00
end