ash/mix.exs

375 lines
12 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.
"""
2024-03-26 19:10:20 +13:00
@version "2.21.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",
consolidate_protocols: Mix.env() == :prod,
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, :ex_unit]],
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
def application do
[
extra_applications: [:mnesia]
]
end
2020-06-02 17:51:13 +12:00
defp docs do
[
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",
extras: [
"documentation/tutorials/get-started.md",
"documentation/tutorials/why-ash.md",
"documentation/tutorials/philosophy.md",
"documentation/tutorials/using-hexdocs.md",
"documentation/tutorials/extending-resources.md",
"documentation/how_to/contribute.md",
"documentation/how_to/define-idiomatic-actions.md",
"documentation/how_to/defining-manual-relationships.md",
"documentation/how_to/handle-errors.md",
"documentation/how_to/structure-your-project.md",
"documentation/how_to/upgrade.md",
"documentation/how_to/use-without-data-layers.md",
"documentation/how_to/validate-changes.md",
"documentation/how_to/auto-format-code.md",
"documentation/topics/actions.md",
"documentation/topics/aggregates.md",
"documentation/topics/atomics.md",
"documentation/topics/attributes.md",
"documentation/topics/bulk-actions.md",
"documentation/topics/calculations.md",
"documentation/topics/code-interface.md",
"documentation/topics/constraints.md",
"documentation/topics/development-utilities.md",
"documentation/topics/embedded-resources.md",
"documentation/topics/expressions.md",
"documentation/topics/flows.md",
"documentation/topics/glossary.md",
"documentation/topics/identities.md",
"documentation/topics/managing-relationships.md",
"documentation/topics/manual-actions.md",
"documentation/topics/monitoring.md",
"documentation/topics/multitenancy.md",
"documentation/topics/notifiers.md",
"documentation/topics/pagination.md",
"documentation/topics/phoenix.md",
"documentation/topics/policies.md",
"documentation/topics/pub_sub.md",
"documentation/topics/reactor.md",
"documentation/topics/relationships.md",
"documentation/topics/security.md",
"documentation/topics/store-context-in-process.md",
"documentation/topics/testing.md",
"documentation/topics/timeouts.md",
"documentation/topics/validations.md",
"documentation/dsls/DSL:-Ash.Resource.md",
"documentation/dsls/DSL:-Ash.Api.md",
"documentation/dsls/DSL:-Ash.Notifier.PubSub.md",
"documentation/dsls/DSL:-Ash.Policy.Authorizer.md",
"documentation/dsls/DSL:-Ash.Flow.md",
"documentation/dsls/DSL:-Ash.DataLayer.Ets.md",
"documentation/dsls/DSL:-Ash.DataLayer.Mnesia.md",
"documentation/dsls/DSL:-Ash.Registry.md",
"documentation/dsls/DSL:-Ash.Reactor.md"
],
groups_for_extras: [
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls'
],
nest_modules_by_prefix: [
Ash.Error,
Ash.Flow.Transformers,
Ash.Policy.Authorizer,
Ash.Api.Transformers,
Ash.Api.Verifiers,
Ash.Registry.Transformers,
Ash.Resource.Transformers,
Ash.Resource.Verifiers,
Ash.Registry.ResourceValidations,
Ash.Query.Function,
Ash.Query.Operator,
Ash.Resource.Change,
Ash.Resource.Validation,
Ash.Policy.Check
],
2023-10-03 01:32:13 +13:00
before_closing_head_tag: fn type ->
if type == :html do
"""
2023-10-03 03:33:58 +13:00
<script>
if (location.hostname === "hexdocs.pm") {
2023-10-03 03:33:58 +13:00
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);
2023-10-03 03:33:58 +13:00
}
</script>
2023-10-03 01:32:13 +13:00
"""
end
end,
groups_for_modules: [
2022-08-24 11:55:36 +12:00
Resources: [
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,
Ash.Resource.ManualRelationship,
Ash.Resource.Attribute.Helpers
2022-08-24 11:55:36 +12:00
],
"Action Input & Interface": [
Ash,
Ash.Api,
Ash.Query,
Ash.Changeset,
Ash.ActionInput,
Ash.BulkResult
],
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
],
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.FilterCheckWithContext,
2022-08-24 11:55:36 +12:00
Ash.Policy.SimpleCheck
2021-03-15 11:29:30 +13:00
],
Extensions: [
Ash.Resource,
Ash.DataLayer.Ets,
Ash.DataLayer.Mnesia,
Ash.DataLayer.Simple,
Ash.Notifier.PubSub,
Ash.Policy.Authorizer,
Ash.Registry,
Ash.Reactor
],
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,
~r/Ash.Api.Dsl.*/
],
2022-08-24 11:55:36 +12:00
Utilities: [
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,
Ash.Vector,
2023-02-15 15:12:39 +13:00
Ash.Union,
2022-08-24 11:55:36 +12:00
Ash.UUID,
Ash.NotLoaded,
Ash.ForbiddenField,
Ash.NotSelected,
2022-08-24 11:55:36 +12:00
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.ProcessHelpers,
Ash.Mix.Tasks.Helpers,
Ash.PlugHelpers,
Ash.SatSolver
],
Visualizations: [
Ash.Api.Info.Diagram,
Ash.Api.Info.Livebook,
Ash.Policy.Chart.Mermaid
],
2022-08-24 11:55:36 +12:00
Testing: [
Ash.Generator,
Ash.Seed,
Ash.Test
2020-10-07 18:20:03 +13:00
],
Tracing: [
Ash.Tracer,
Ash.Tracer.Simple,
Ash.Tracer.Simple.Span
],
2022-08-24 11:55:36 +12:00
Flow: [
Ash.Flow,
Ash.Flow.Result,
2022-08-24 11:55:36 +12:00
Ash.Flow.Executor,
Ash.Flow.Step,
Ash.Flow.Chart.Mermaid,
Ash.Flow.StepHelpers
2020-09-25 16:36:50 +12:00
],
Types: [
"Ash.Type",
~r/Ash.Type\./
],
2022-08-24 11:55:36 +12:00
Errors: [
Ash.Error,
~r/Ash.Error\./
],
"DSL Transformers": [
~r/\.Transformers\./,
~r/\.Verifiers\./,
Ash.Registry.ResourceValidations
],
Expressions: [
Ash.Filter.Predicate,
Ash.Filter.Simple,
Ash.Filter.Simple.Not,
~r/Ash.Query.Operator/,
~r/Ash.Query.Function/,
~r/Ash.Query.Ref/,
Ash.Query.Not,
Ash.Query.Call,
Ash.Query.BooleanExpression,
Ash.Query.Exists,
Ash.Query.Parent
],
Builtins: [
~r/Ash.Resource.Validation/,
~r/Ash.Resource.Change/,
~r/Ash.Policy.Check/
],
Introspection: [
~r/Ash.Resource.Relationships/,
~r/Ash.Resource.Calculation/,
~r/Ash.Resource.Interface/,
~r/Ash.Resource.Identity/,
~r/Ash.Resource.Attribute/,
~r/Ash.Resource.Attribute/,
~r/Ash.Resource.Aggregate/,
~r/Ash.Resource.Actions/,
~r/Ash.Flow.Step/,
~r/Ash.Flow/,
Ash.Mix.Tasks.Helpers,
Ash.Policy.FieldPolicy,
~r/Ash.Registry/,
Ash.Policy.Policy,
Ash.Notifier.PubSub.Publication
2024-01-20 04:02:15 +13:00
],
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",
Discord: "https://discord.gg/HTHRaaVPUc",
Website: "https://ash-hq.org",
Forum: "https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum"
2019-12-05 04:16:34 +13:00
}
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
[
{:spark, "~> 1.1 and >= 1.1.55"},
{:ecto, "~> 3.7"},
{:ets, "~> 0.8"},
2021-01-10 05:47:50 +13:00
{:decimal, "~> 2.0"},
{:picosat_elixir, "~> 0.2"},
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"},
{:stream_data, "~> 0.6"},
2022-08-27 09:57:03 +12:00
{:telemetry, "~> 1.1"},
{:plug, ">= 0.0.0", optional: true},
{:earmark, "~> 1.4"},
{:reactor, "~> 0.6"},
2021-01-10 05:47:50 +13:00
# Dev/Test dependencies
{:eflame, "~> 1.0", only: [:dev, :test]},
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
{:ex_check, "~> 0.12", only: [:dev, :test]},
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:mimic, "~> 1.7", only: [:test]},
{: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},
{:benchee, "~> 1.1", only: [:dev, :test]},
{:doctor, "~> 0.21", 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: [
"spark.cheat_sheets",
"docs",
"spark.replace_doc_links",
"spark.cheat_sheets_in_search"
],
"spark.cheat_sheets_in_search":
"spark.cheat_sheets_in_search --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,Ash.Reactor",
"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,Ash.Reactor",
"spark.cheat_sheets":
"spark.cheat_sheets --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,Ash.Reactor"
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