ash_phoenix/mix.exs

174 lines
4.1 KiB
Elixir
Raw Normal View History

2020-10-21 06:54:35 +13:00
defmodule AshPhoenix.MixProject do
use Mix.Project
2020-10-21 07:38:50 +13:00
@description """
Utilities for integrating Ash with Phoenix
"""
2023-09-28 11:57:11 +13:00
@version "1.2.19"
2020-10-21 07:38:50 +13:00
2020-10-21 06:54:35 +13:00
def project do
[
app: :ash_phoenix,
2020-10-21 07:38:50 +13:00
version: @version,
description: @description,
elixir: "~> 1.11",
2020-10-21 07:38:50 +13:00
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
2020-10-21 06:54:35 +13:00
start_permanent: Mix.env() == :prod,
2020-10-21 07:38:50 +13:00
test_coverage: [tool: ExCoveralls],
2022-11-04 05:45:54 +13:00
aliases: aliases(),
2020-10-21 07:38:50 +13:00
docs: docs(),
preferred_cli_env: [
coveralls: :test,
"coveralls.github": :test
],
dialyzer: [
2023-08-16 06:50:09 +12:00
plt_add_apps: [:ex_unit, :mix]
2020-10-21 07:38:50 +13:00
],
docs: docs(),
package: package(),
source_url: "https://github.com/ash-project/ash_phoenix",
homepage_url: "https://github.com/ash-project/ash_phoenix"
]
end
defp elixirc_paths(:test) do
["test/support/", "lib/"]
end
defp elixirc_paths(_env) do
["lib/"]
end
defp package do
[
name: :ash_phoenix,
licenses: ["MIT"],
files: ~w(lib .formatter.exs mix.exs README* LICENSE*
2023-09-05 11:12:14 +12:00
CHANGELOG* documentation priv),
2020-10-21 07:38:50 +13:00
links: %{
GitHub: "https://github.com/ash-project/ash_phoenix"
}
]
end
2022-08-24 07:06:12 +12:00
defp extras() do
"documentation/**/*.md"
|> Path.wildcard()
|> Enum.map(fn path ->
title =
path
|> Path.basename(".md")
|> String.split(~r/[-_]/)
2023-09-27 01:56:36 +13:00
|> Enum.map_join(" ", &capitalize/1)
2022-08-24 07:06:12 +12:00
|> case do
"F A Q" ->
"FAQ"
other ->
other
end
{String.to_atom(path),
[
title: title
]}
end)
end
2023-09-27 01:56:36 +13:00
defp capitalize(string) do
string
|> String.split(" ")
|> Enum.map(fn string ->
[hd | tail] = String.graphemes(string)
String.capitalize(hd) <> Enum.join(tail)
end)
end
2023-02-15 15:55:38 +13:00
defp groups_for_extras do
[
Tutorials: [
~r'documentation/tutorials'
],
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics'
]
end
2020-10-21 07:38:50 +13:00
defp docs do
[
2022-08-24 07:06:12 +12:00
main: "working-with-phoenix",
2020-10-21 07:38:50 +13:00
source_ref: "v#{@version}",
logo: "logos/small-logo.png",
2022-08-24 07:06:12 +12:00
extras: extras(),
2023-02-15 15:55:38 +13:00
groups_for_extras: groups_for_extras(),
2022-08-24 07:06:12 +12:00
groups_for_modules: [
"Phoenix Helpers": [
2023-09-27 01:56:36 +13:00
AshPhoenix.LiveView,
AshPhoenix.SubdomainPlug
],
Forms: [
2022-08-24 07:06:12 +12:00
AshPhoenix.Form,
AshPhoenix.Form.Auto,
2023-09-27 01:56:36 +13:00
AshPhoenix.Form.WrappedValue,
AshPhoenix.FormData.Error
],
FilterForm: [
2022-08-24 07:06:12 +12:00
AshPhoenix.FilterForm,
AshPhoenix.FilterForm.Predicate,
2023-09-27 01:56:36 +13:00
AshPhoenix.FilterForm.Arguments
2022-08-24 07:06:12 +12:00
],
Errors: [
AshPhoenix.Form.InvalidPath,
AshPhoenix.Form.NoActionConfigured,
AshPhoenix.Form.NoDataLoaded,
AshPhoenix.Form.NoFormConfigured,
AshPhoenix.Form.NoResourceConfigured
]
],
Internals: ~r/.*/
2020-10-21 06:54:35 +13:00
]
end
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
2023-01-29 03:18:35 +13:00
{:ash, ash_version("~> 2.5 and >= 2.5.10")},
2022-09-28 11:34:03 +13:00
{:phoenix, "~> 1.5.6 or ~> 1.6"},
{:phoenix_html, "~> 2.14 or ~> 3.0"},
2020-12-04 06:35:59 +13:00
{:phoenix_live_view, "~> 0.15"},
2023-02-01 18:13:04 +13:00
{:git_ops, "~> 2.5", only: [:dev, :test]},
{:ex_doc, "~> 0.23", only: [:dev, :test], runtime: false},
{:ex_check, "~> 0.14", only: [:dev, :test]},
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.14", only: [:dev, :test]}
2020-10-21 06:54:35 +13:00
]
end
2020-10-21 07:38:50 +13:00
defp ash_version(default_version) do
case System.get_env("ASH_VERSION") do
nil -> default_version
"local" -> [path: "../ash"]
"main" -> [git: "https://github.com/ash-project/ash.git"]
2020-10-21 07:38:50 +13:00
version -> "~> #{version}"
end
end
2022-11-04 05:45:54 +13:00
defp aliases do
[
2023-09-27 16:18:29 +13:00
docs: ["docs", "spark.replace_doc_links"],
2023-09-19 11:33:02 +12:00
sobelow: "sobelow --skip -i Config.Secrets --ignore-files lib/ash_phoenix/gen/live.ex"
2022-11-04 05:45:54 +13:00
]
end
2020-10-21 06:54:35 +13:00
end