2020-10-21 06:54:35 +13:00
|
|
|
defmodule AshPhoenix.MixProject do
|
|
|
|
use Mix.Project
|
|
|
|
|
2020-10-21 07:38:50 +13:00
|
|
|
@description """
|
2024-05-02 07:25:16 +12:00
|
|
|
Utilities for integrating Ash and Phoenix
|
2020-10-21 07:38:50 +13:00
|
|
|
"""
|
|
|
|
|
2024-08-01 12:59:35 +12:00
|
|
|
@version "2.1.1"
|
2020-10-21 07:38:50 +13:00
|
|
|
|
2020-10-21 06:54:35 +13:00
|
|
|
def project do
|
|
|
|
[
|
2020-10-21 14:25:28 +13:00
|
|
|
app: :ash_phoenix,
|
2020-10-21 07:38:50 +13:00
|
|
|
version: @version,
|
2020-10-21 14:25:28 +13:00
|
|
|
description: @description,
|
2023-06-23 13:37:19 +12:00
|
|
|
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,
|
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"],
|
2022-08-24 07:48:13 +12:00
|
|
|
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
|
|
|
|
|
|
|
|
defp docs do
|
|
|
|
[
|
2024-05-02 07:25:16 +12:00
|
|
|
main: "readme",
|
2020-10-21 07:38:50 +13:00
|
|
|
source_ref: "v#{@version}",
|
|
|
|
logo: "logos/small-logo.png",
|
2024-01-13 08:51:15 +13:00
|
|
|
extras: [
|
2024-05-02 07:25:16 +12:00
|
|
|
{"README.md", title: "Home"},
|
2024-01-13 08:51:15 +13:00
|
|
|
"documentation/tutorials/getting-started-with-ash-and-phoenix.md",
|
2024-05-09 10:45:39 +12:00
|
|
|
"documentation/topics/union-forms.md",
|
|
|
|
"CHANGELOG.md"
|
2024-01-13 08:51:15 +13:00
|
|
|
],
|
|
|
|
groups_for_extras: [
|
|
|
|
Tutorials: ~r'documentation/tutorials',
|
|
|
|
"How To": ~r'documentation/how_to',
|
2024-05-09 10:45:39 +12:00
|
|
|
Topics: ~r'documentation/topics',
|
|
|
|
"About AshPhoenix": [
|
|
|
|
"CHANGELOG.md"
|
|
|
|
]
|
2024-01-13 08:51:15 +13:00
|
|
|
],
|
2023-10-03 01:35:23 +13:00
|
|
|
before_closing_head_tag: fn type ->
|
|
|
|
if type == :html do
|
|
|
|
"""
|
2023-10-03 03:56:43 +13:00
|
|
|
<script>
|
|
|
|
if (location.hostname === "hexdocs.pm") {
|
|
|
|
var script = document.createElement("script");
|
|
|
|
script.src = "https://plausible.io/js/script.js";
|
|
|
|
script.setAttribute("defer", "defer")
|
|
|
|
script.setAttribute("data-domain", "ashhexdocs")
|
|
|
|
document.head.appendChild(script);
|
|
|
|
}
|
|
|
|
</script>
|
2023-10-03 01:35:23 +13:00
|
|
|
"""
|
|
|
|
end
|
|
|
|
end,
|
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
|
|
|
|
],
|
2023-10-25 03:22:24 +13:00
|
|
|
Generators: [
|
|
|
|
Mix.Tasks.AshPhoenix.Gen.Html,
|
|
|
|
Mix.Tasks.AshPhoenix.Gen.Live
|
|
|
|
],
|
2023-09-27 01:56:36 +13:00
|
|
|
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
|
|
|
|
]
|
2023-01-18 19:02:01 +13:00
|
|
|
],
|
|
|
|
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
|
|
|
|
[
|
2024-05-11 09:33:54 +12:00
|
|
|
{:ash, ash_version("~> 3.0")},
|
2022-09-28 11:34:03 +13:00
|
|
|
{:phoenix, "~> 1.5.6 or ~> 1.6"},
|
2024-01-22 06:59:55 +13:00
|
|
|
{:phoenix_html, "~> 4.0"},
|
2024-05-20 23:52:15 +12:00
|
|
|
{:phoenix_live_view, "~> 0.20.3 or ~> 1.0"},
|
2024-03-28 16:44:54 +13:00
|
|
|
{:simple_sat, "~> 0.1", only: [:dev, :test]},
|
2023-02-01 18:13:04 +13:00
|
|
|
{:git_ops, "~> 2.5", only: [:dev, :test]},
|
2024-05-11 10:24:02 +12:00
|
|
|
{:ex_doc, "~> 0.32", only: [:dev, :test], override: true},
|
2023-02-01 18:13:04 +13:00
|
|
|
{: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},
|
2024-04-23 01:53:30 +12:00
|
|
|
{:mix_audit, ">= 0.0.0", only: [:dev, :test], runtime: false}
|
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"]
|
2022-05-14 12:43:50 +12:00
|
|
|
"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
|