ash/mix.exs

258 lines
6.7 KiB
Elixir
Raw Normal View History

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.
"""
2022-11-20 07:19:55 +13:00
@version "2.4.7"
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",
consolidate_protocols: Mix.env() != :test,
2019-10-03 16:08:36 +13:00
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
2019-12-05 04:16:34 +13:00
package: package(),
deps: deps(),
dialyzer: [plt_add_apps: [:mix, :mnesia, :earmark, :plug]],
2020-10-21 06:11:21 +13:00
xref: [exclude: [:mnesia]],
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
defp extras do
"documentation/**/*.md"
2022-08-19 06:15:41 +12:00
|> Path.wildcard()
|> Enum.map(fn path ->
title =
path
|> Path.basename(".md")
|> String.split(~r/[-_]/)
|> 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),
[
title: title
]}
end)
end
defp groups_for_extras do
"documentation/*"
2022-08-19 06:15:41 +12:00
|> Path.wildcard()
|> Enum.map(fn folder ->
name =
folder
|> Path.basename()
|> String.split(~r/[-_]/)
|> Enum.map_join(" ", &String.capitalize/1)
2022-08-19 06:15:41 +12:00
{name, folder |> Path.join("**") |> Path.wildcard()}
end)
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
[
2022-08-24 11:55:36 +12:00
main: "get-started",
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(),
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: [
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,
Ash.Resource.ManualRelationship
],
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
],
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,
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-08-24 11:55:36 +12:00
Utilities: [
Ash,
Ash.Page,
Ash.Page.Keyset,
Ash.Page.Offset,
Ash.Filter,
Ash.Filter.Runtime,
Ash.Sort,
Ash.CiString,
Ash.UUID,
Ash.NotLoaded,
Ash.Changeset.ManagedRelationshipHelpers,
Ash.DataLayer.Simple,
Ash.Filter.Simple,
Ash.Filter.Simple.Not,
Ash.OptionsHelpers,
2022-11-16 10:47:06 +13:00
Ash.Resource.Builder,
Ash.Tracer
],
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
],
2022-08-24 11:55:36 +12:00
Errors: [
Ash.Error,
2022-08-24 11:55:36 +12:00
Ash.Error.Exception,
Ash.Error.Stacktrace
2022-07-28 01:38:53 +12:00
],
2022-08-24 11:55:36 +12:00
Types: [
Ash.Type,
Ash.Type.Enum,
Ash.Type.Atom,
Ash.Type.Binary,
Ash.Type.Boolean,
Ash.Type.CiString,
Ash.Type.Date,
Ash.Type.Decimal,
Ash.Type.DurationName,
Ash.Type.Float,
Ash.Type.Function,
Ash.Type.Integer,
Ash.Type.Map,
Ash.Type.NaiveDatetime,
Ash.Type.String,
Ash.Type.Term,
Ash.Type.Time,
Ash.Type.UUID,
Ash.Type.UrlEncodedBinary,
Ash.Type.UtcDatetime,
Ash.Type.UtcDatetimeUsec
],
2022-08-24 11:55:36 +12:00
Transformers: [~r/\.Transformers\./, Ash.Registry.ResourceValidations],
Internals: ~r/.*/
]
]
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"],
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
defp elixirc_paths(:test) do
["lib", "test/support"]
end
2019-11-29 19:54:11 +13:00
defp elixirc_paths(_), do: ["lib"]
2019-10-03 16:08:36 +13:00
# Run "mix help deps" to learn about dependencies.
defp deps do
[
2022-11-16 15:39:57 +13:00
{:spark, "~> 0.2 and >= 0.2.10"},
{: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"},
# {:picosat_elixir, path: "../picosat_elixir"},
{:picosat_elixir, "~> 0.2"},
{:nimble_options, "~> 0.4.0"},
feat: freeform expressions feat: validatiosn in actions feat: query arguments feat: add `Ash.Query.for_read/3` feat: return changeset with API errors feat: add case insensitive string `CiString`/`:ci_string` feat: support `context/1` and `arg/1` in filter templates feat: support targeting notifications with the `for` option feat: add `ago/2` query function feat: add basic arithmetic operators (+, *, -, /) feat: `sensitive?` option for attributes feat: `sensitive?` option for arguments feat: `private` arguments, which can’t be set using `for_<action>` feat: add `prevent_change` which will erase changes just before the changeset is committed feat: add `match?` validation that supports a custom error message feat: add `interval` type to support `ago/2` function feat: add `url_encoded_binary` type feat: add `function` type improvement: `changing?` is now a validation improvement: add `Transformer.get_persisted/3` improvement: add `api` field to `Notification` improvement: standardize errors, add `to_error_class` improvement: use `Comp` everywhere Improvement: use action on changeset if set by `for_<action_type>` improvement: `action_failed?` field on change sets improvement: remove ability for data layers to add operators (for now at least) Improvement: Changeset.apply_attributes/2 now returns an error tuple Improvement: add a bunch of new/informative errors improvement: runtime filter now uses left join logic (a naive implementation of it) improvement: support more filter templates in resources Improvement: basic/naive type system for operators/functions Fix: properly expand module aliases for options w/o compile time dependency chore(engine): track changeset changes for the request with `manage_changeset?: true`
2021-01-22 09:21:58 +13:00
{:comparable, "~> 1.0"},
2021-01-23 12:20:08 +13:00
{:jason, ">= 1.0.0"},
{: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"},
2021-01-10 05:47:50 +13:00
# Dev/Test dependencies
{:ex_doc, "~> 0.22", only: :dev, runtime: false},
{:ex_check, "~> 0.12.0", only: :dev},
{:credo, ">= 0.0.0", only: :dev, runtime: false},
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
{:sobelow, ">= 0.0.0", only: :dev, runtime: false},
2022-10-04 19:03:49 +13:00
{:git_ops, "~> 2.5", only: :dev},
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false},
{:parse_trans, "3.3.0", only: [:dev, :test], override: true},
{:plug, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:benchee, "~> 1.1", only: [:dev, :test]}
]
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",
credo: "credo --strict",
docs: ["docs", "ash.replace_doc_links"],
"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