2019-10-03 16:08:36 +13:00
|
|
|
defmodule Ash.MixProject do
|
2020-06-02 17:51:13 +12:00
|
|
|
@moduledoc false
|
2019-10-03 16:08:36 +13:00
|
|
|
use Mix.Project
|
|
|
|
|
2019-12-05 04:18:00 +13:00
|
|
|
@description """
|
|
|
|
A resource declaration and interaction library. Built with pluggable data layers, and
|
|
|
|
designed to be used by multiple front ends.
|
|
|
|
"""
|
|
|
|
|
2023-06-29 03:04:09 +12:00
|
|
|
@version "2.11.0-rc.2"
|
2020-06-01 17:23:33 +12:00
|
|
|
|
2019-10-03 16:08:36 +13:00
|
|
|
def project do
|
|
|
|
[
|
|
|
|
app: :ash,
|
2020-06-01 17:23:33 +12:00
|
|
|
version: @version,
|
2021-01-22 09:36:49 +13:00
|
|
|
elixir: "~> 1.11",
|
2021-01-07 08:39:56 +13:00
|
|
|
consolidate_protocols: Mix.env() != :test,
|
2019-10-03 16:08:36 +13:00
|
|
|
start_permanent: Mix.env() == :prod,
|
2019-11-28 18:24:29 +13:00
|
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
2019-12-05 04:16:34 +13:00
|
|
|
package: package(),
|
|
|
|
deps: deps(),
|
2022-10-28 11:52:42 +13:00
|
|
|
dialyzer: [plt_add_apps: [:mix, :mnesia, :earmark, :plug]],
|
2019-12-06 07:45:02 +13:00
|
|
|
docs: docs(),
|
2020-06-02 15:37:50 +12:00
|
|
|
aliases: aliases(),
|
2019-12-05 04:18:00 +13:00
|
|
|
description: @description,
|
2019-12-05 04:16:34 +13:00
|
|
|
source_url: "https://github.com/ash-project/ash",
|
|
|
|
homepage_url: "https://github.com/ash-project/ash"
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2023-06-23 08:26:03 +12:00
|
|
|
def application do
|
|
|
|
[
|
|
|
|
extra_applications: [:mnesia]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2022-09-20 02:14:08 +12:00
|
|
|
defp extras do
|
2022-08-20 05:13:27 +12:00
|
|
|
"documentation/**/*.md"
|
2022-08-19 06:15:41 +12:00
|
|
|
|> Path.wildcard()
|
|
|
|
|> Enum.map(fn path ->
|
|
|
|
title =
|
|
|
|
path
|
|
|
|
|> Path.basename(".md")
|
|
|
|
|> String.split(~r/[-_]/)
|
2022-09-20 02:14:08 +12:00
|
|
|
|> Enum.map_join(" ", &String.capitalize/1)
|
2022-08-19 06:15:41 +12:00
|
|
|
|> case do
|
|
|
|
"F A Q" ->
|
|
|
|
"FAQ"
|
|
|
|
|
|
|
|
other ->
|
|
|
|
other
|
|
|
|
end
|
|
|
|
|
|
|
|
{String.to_atom(path),
|
|
|
|
[
|
2023-01-18 18:34:20 +13:00
|
|
|
title: title,
|
|
|
|
default: title == "Get Started"
|
2022-08-19 06:15:41 +12:00
|
|
|
]}
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
2022-09-20 02:14:08 +12:00
|
|
|
defp groups_for_extras do
|
2023-01-18 18:34:20 +13:00
|
|
|
[
|
|
|
|
Tutorials: [
|
|
|
|
"documentation/tutorials/get-started.md",
|
|
|
|
"documentation/tutorials/philosophy.md",
|
|
|
|
"documentation/tutorials/why-ash.md",
|
|
|
|
~r'documentation/tutorials'
|
|
|
|
],
|
|
|
|
"How To": ~r'documentation/how_to',
|
|
|
|
Topics: ~r'documentation/topics'
|
|
|
|
]
|
2022-08-19 06:15:41 +12:00
|
|
|
end
|
|
|
|
|
2020-06-02 17:51:13 +12:00
|
|
|
defp docs do
|
2019-12-06 07:45:02 +13:00
|
|
|
# The main page in the docs
|
2020-06-14 18:39:11 +12:00
|
|
|
[
|
2022-08-24 11:55:36 +12:00
|
|
|
main: "get-started",
|
2020-06-14 18:39:11 +12:00
|
|
|
source_ref: "v#{@version}",
|
|
|
|
logo: "logos/small-logo.png",
|
2020-07-10 01:25:48 +12:00
|
|
|
extra_section: "GUIDES",
|
2022-08-19 06:15:41 +12:00
|
|
|
extras: extras(),
|
|
|
|
groups_for_extras: groups_for_extras(),
|
2023-01-18 18:34:20 +13:00
|
|
|
spark: [
|
|
|
|
extensions: [
|
|
|
|
%{
|
|
|
|
module: Ash.Resource.Dsl,
|
|
|
|
name: "Resource",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "Resource",
|
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Api.Dsl,
|
|
|
|
name: "Api",
|
|
|
|
target: "Ash.Api",
|
|
|
|
type: "Api",
|
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.DataLayer.Ets,
|
|
|
|
name: "Ets",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "DataLayer"
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.DataLayer.Mnesia,
|
|
|
|
name: "Mnesia",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "DataLayer"
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Policy.Authorizer,
|
|
|
|
name: "Policy Authorizer",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "Authorizer"
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Flow.Dsl,
|
|
|
|
name: "Flow",
|
|
|
|
target: "Ash.Flow",
|
|
|
|
type: "Flow",
|
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Notifier.PubSub,
|
|
|
|
name: "PubSub",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "Notifier"
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Registry.Dsl,
|
|
|
|
name: "Registry",
|
|
|
|
target: "Ash.Registry",
|
|
|
|
type: "Registry",
|
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Registry.ResourceValidations,
|
|
|
|
name: "Resource Validations",
|
|
|
|
type: "Extension",
|
|
|
|
target: "Ash.Registry"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
mix_tasks: [
|
|
|
|
Charts: [
|
|
|
|
Mix.Tasks.Ash.GenerateFlowCharts
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
2020-06-14 18:39:11 +12:00
|
|
|
groups_for_modules: [
|
2022-08-24 11:55:36 +12:00
|
|
|
"Extensions & DSLs": [
|
|
|
|
Ash.Api.Dsl,
|
|
|
|
Ash.Resource.Dsl,
|
|
|
|
Ash.Flow.Dsl,
|
|
|
|
Ash.DataLayer.Ets,
|
|
|
|
Ash.DataLayer.Mnesia,
|
|
|
|
Ash.DataLayer.Simple,
|
|
|
|
Ash.Notifier.PubSub,
|
|
|
|
Ash.Policy.Authorizer,
|
|
|
|
Ash.Registry,
|
|
|
|
Ash.Registry.Dsl,
|
|
|
|
Ash.Resource
|
|
|
|
],
|
|
|
|
Resources: [
|
2020-06-14 18:39:11 +12:00
|
|
|
Ash.Api,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Filter.TemplateHelpers,
|
|
|
|
Ash.Calculation,
|
|
|
|
Ash.Resource.Calculation.Builtins,
|
|
|
|
Ash.CodeInterface,
|
|
|
|
Ash.DataLayer,
|
|
|
|
Ash.Notifier,
|
|
|
|
Ash.Notifier.Notification,
|
|
|
|
Ash.Resource.ManualRead,
|
2023-01-04 03:10:53 +13:00
|
|
|
Ash.Resource.ManualCreate,
|
|
|
|
Ash.Resource.ManualUpdate,
|
|
|
|
Ash.Resource.ManualDestroy,
|
2023-01-27 16:18:14 +13:00
|
|
|
Ash.Resource.ManualRelationship,
|
|
|
|
Ash.Resource.Attribute.Helpers
|
2022-08-24 11:55:36 +12:00
|
|
|
],
|
|
|
|
Queries: [
|
2020-07-12 18:25:53 +12:00
|
|
|
Ash.Query,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Resource.Preparation,
|
|
|
|
Ash.Resource.Preparation.Builtins,
|
|
|
|
Ash.Query.Calculation,
|
|
|
|
Ash.Query.Aggregate
|
|
|
|
],
|
|
|
|
Changesets: [
|
2020-10-12 16:55:47 +13:00
|
|
|
Ash.Changeset,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Resource.Change,
|
|
|
|
Ash.Resource.Change.Builtins,
|
|
|
|
Ash.Resource.Validation,
|
|
|
|
Ash.Resource.Validation.Builtins
|
2020-06-14 18:39:11 +12:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Authorization: [
|
|
|
|
Ash.Authorizer,
|
|
|
|
Ash.Policy.Check,
|
2022-09-08 07:03:09 +12:00
|
|
|
Ash.Policy.Check.Builtins,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Policy.FilterCheck,
|
2022-11-23 21:36:55 +13:00
|
|
|
Ash.Policy.FilterCheckWithContext,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Policy.SimpleCheck
|
2021-03-15 11:29:30 +13:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Introspection: [
|
|
|
|
Ash.Api.Info,
|
|
|
|
Ash.Registry.Info,
|
|
|
|
Ash.Resource.Info,
|
|
|
|
Ash.Flow.Info,
|
|
|
|
Ash.Policy.Info,
|
|
|
|
Ash.DataLayer.Ets.Info,
|
|
|
|
Ash.DataLayer.Mnesia.Info,
|
|
|
|
Ash.Notifier.PubSub.Info
|
2022-02-03 11:02:28 +13:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Utilities: [
|
|
|
|
Ash,
|
2023-03-21 16:11:55 +13:00
|
|
|
Ash.Expr,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.Page,
|
|
|
|
Ash.Page.Keyset,
|
|
|
|
Ash.Page.Offset,
|
|
|
|
Ash.Filter,
|
|
|
|
Ash.Filter.Runtime,
|
|
|
|
Ash.Sort,
|
|
|
|
Ash.CiString,
|
2023-02-15 15:12:39 +13:00
|
|
|
Ash.Union,
|
2022-08-24 11:55:36 +12:00
|
|
|
Ash.UUID,
|
|
|
|
Ash.NotLoaded,
|
|
|
|
Ash.Changeset.ManagedRelationshipHelpers,
|
|
|
|
Ash.DataLayer.Simple,
|
|
|
|
Ash.Filter.Simple,
|
|
|
|
Ash.Filter.Simple.Not,
|
2022-10-25 07:06:07 +13:00
|
|
|
Ash.OptionsHelpers,
|
2022-11-16 10:47:06 +13:00
|
|
|
Ash.Resource.Builder,
|
|
|
|
Ash.Tracer
|
2021-01-29 08:47:59 +13:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Testing: [
|
|
|
|
Ash.Generator,
|
|
|
|
Ash.Seed,
|
|
|
|
Ash.Test
|
2020-10-07 18:20:03 +13:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Flow: [
|
|
|
|
Ash.Flow,
|
|
|
|
Ash.Flow.Executor,
|
|
|
|
Ash.Flow.Step,
|
|
|
|
Ash.Flow.Chart.Mermaid,
|
|
|
|
Ash.Flow.StepHelpers
|
2020-09-25 16:36:50 +12:00
|
|
|
],
|
2023-01-18 18:34:20 +13:00
|
|
|
Types: [
|
|
|
|
"Ash.Type",
|
|
|
|
~r/Ash.Type\./
|
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Errors: [
|
2021-03-20 11:23:48 +13:00
|
|
|
Ash.Error,
|
2023-01-18 18:34:20 +13:00
|
|
|
~r/Ash.Error\./
|
2021-01-29 08:47:59 +13:00
|
|
|
],
|
2022-08-24 11:55:36 +12:00
|
|
|
Transformers: [~r/\.Transformers\./, Ash.Registry.ResourceValidations],
|
|
|
|
Internals: ~r/.*/
|
2020-06-14 18:39:11 +12:00
|
|
|
]
|
|
|
|
]
|
2019-12-06 07:45:02 +13:00
|
|
|
end
|
|
|
|
|
2019-12-05 04:16:34 +13:00
|
|
|
defp package do
|
|
|
|
[
|
2020-07-21 14:16:28 +12:00
|
|
|
name: :ash,
|
2019-12-05 04:16:34 +13:00
|
|
|
licenses: ["MIT"],
|
2022-08-20 05:13:27 +12:00
|
|
|
files: ~w(lib .formatter.exs mix.exs README* LICENSE*
|
|
|
|
CHANGELOG* documentation),
|
2019-12-05 04:16:34 +13:00
|
|
|
links: %{
|
|
|
|
GitHub: "https://github.com/ash-project/ash"
|
|
|
|
}
|
2019-10-03 16:08:36 +13:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2019-11-28 18:24:29 +13:00
|
|
|
defp elixirc_paths(:test) do
|
|
|
|
["lib", "test/support"]
|
|
|
|
end
|
|
|
|
|
2019-11-29 19:54:11 +13:00
|
|
|
defp elixirc_paths(_), do: ["lib"]
|
2019-11-28 18:24:29 +13:00
|
|
|
|
2019-10-03 16:08:36 +13:00
|
|
|
# Run "mix help deps" to learn about dependencies.
|
|
|
|
defp deps do
|
2019-11-28 18:24:29 +13:00
|
|
|
[
|
2023-06-23 04:28:39 +12:00
|
|
|
{:spark, "~> 1.1 and >= 1.1.18"},
|
2021-09-14 03:44:56 +12:00
|
|
|
{:ecto, "~> 3.7"},
|
2019-12-07 09:54:30 +13:00
|
|
|
{:ets, "~> 0.8.0"},
|
2021-01-10 05:47:50 +13:00
|
|
|
{:decimal, "~> 2.0"},
|
2021-08-30 04:36:16 +12:00
|
|
|
{:picosat_elixir, "~> 0.2"},
|
2021-01-22 09:21:58 +13:00
|
|
|
{:comparable, "~> 1.0"},
|
2021-01-23 12:20:08 +13:00
|
|
|
{:jason, ">= 1.0.0"},
|
2022-04-19 05:39:54 +12:00
|
|
|
{:earmark, "~> 1.4", optional: true},
|
2022-06-22 13:00:47 +12:00
|
|
|
{:stream_data, "~> 0.5.0"},
|
2022-08-27 09:57:03 +12:00
|
|
|
{:telemetry, "~> 1.1"},
|
2022-11-21 05:14:58 +13:00
|
|
|
{:plug, ">= 0.0.0", optional: true},
|
2021-01-10 05:47:50 +13:00
|
|
|
# Dev/Test dependencies
|
2023-02-01 05:39:34 +13:00
|
|
|
{:ex_doc, "~> 0.22", only: [:dev, :test], runtime: false},
|
|
|
|
{:ex_check, "~> 0.12.0", 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},
|
|
|
|
{:git_ops, "~> 2.5", only: [:dev, :test]},
|
|
|
|
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false},
|
2021-12-14 12:17:34 +13:00
|
|
|
{:parse_trans, "3.3.0", only: [:dev, :test], override: true},
|
2023-02-01 05:15:09 +13:00
|
|
|
{:benchee, "~> 1.1", only: [:dev, :test]},
|
|
|
|
{:doctor, "~> 0.21", only: [:dev, :test]}
|
2019-11-28 18:24:29 +13:00
|
|
|
]
|
2019-10-03 16:08:36 +13:00
|
|
|
end
|
2020-06-02 15:37:50 +12:00
|
|
|
|
2020-06-02 17:47:25 +12:00
|
|
|
defp aliases do
|
|
|
|
[
|
|
|
|
sobelow: "sobelow --skip",
|
2020-06-15 18:40:33 +12:00
|
|
|
credo: "credo --strict",
|
2022-11-03 20:47:05 +13:00
|
|
|
docs: ["docs", "ash.replace_doc_links"],
|
2022-08-16 08:02:22 +12:00
|
|
|
"spark.formatter":
|
|
|
|
"spark.formatter --extensions Ash.Resource.Dsl,Ash.Api.Dsl,Ash.Flow.Dsl,Ash.Registry.Dsl,Ash.DataLayer.Ets,Ash.DataLayer.Mnesia,Ash.Notifier.PubSub,Ash.Policy.Authorizer"
|
2020-06-02 17:47:25 +12:00
|
|
|
]
|
2020-06-02 15:37:50 +12:00
|
|
|
end
|
2019-10-03 16:08:36 +13:00
|
|
|
end
|