mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
chore: more extension docs for new docs site
This commit is contained in:
parent
27df3f0ba8
commit
7b02117531
9 changed files with 45 additions and 1 deletions
|
@ -112,4 +112,8 @@ defmodule Ash.Api.Dsl do
|
|||
"""
|
||||
|
||||
use Ash.Dsl.Extension, sections: @sections
|
||||
|
||||
def name, do: "Api"
|
||||
def target, do: "Ash.Api"
|
||||
def default_for_target?, do: true
|
||||
end
|
||||
|
|
|
@ -27,8 +27,16 @@ defmodule Ash.DataLayer.Ets do
|
|||
]
|
||||
]
|
||||
}
|
||||
|
||||
use Ash.Dsl.Extension, sections: [@ets]
|
||||
|
||||
@impl true
|
||||
def name, do: "Ets"
|
||||
@impl true
|
||||
def target, do: "Ash.Resource"
|
||||
@impl true
|
||||
def type, do: "DataLayer"
|
||||
|
||||
alias Ash.Actions.Sort
|
||||
alias Ash.Dsl.Extension
|
||||
|
||||
|
|
|
@ -34,6 +34,13 @@ defmodule Ash.DataLayer.Mnesia do
|
|||
|
||||
use Ash.Dsl.Extension, sections: [@mnesia]
|
||||
|
||||
@impl true
|
||||
def name, do: "Mnesia"
|
||||
@impl true
|
||||
def target, do: "Ash.Resource"
|
||||
@impl true
|
||||
def type, do: "DataLayer"
|
||||
|
||||
alias Ash.Actions.Sort
|
||||
alias Ash.Dsl.Extension
|
||||
alias :mnesia, as: Mnesia
|
||||
|
|
|
@ -8,6 +8,8 @@ defmodule Ash.DataLayer.Simple do
|
|||
|
||||
use Ash.Dsl.Extension, transformers: [], sections: []
|
||||
|
||||
def show_in_docs?, do: false
|
||||
|
||||
def can?(_, :create), do: true
|
||||
def can?(_, :update), do: true
|
||||
def can?(_, :destroy), do: true
|
||||
|
|
|
@ -113,7 +113,15 @@ defmodule Ash.Dsl.Extension do
|
|||
@callback name() :: String.t()
|
||||
@callback target() :: String.t()
|
||||
@callback default_for_target?() :: boolean
|
||||
@optional_callbacks [name: 0, target: 0, default_for_target?: 0]
|
||||
@callback show_in_docs?() :: boolean
|
||||
@callback type() :: String.t()
|
||||
@optional_callbacks [
|
||||
name: 0,
|
||||
target: 0,
|
||||
default_for_target?: 0,
|
||||
show_in_docs?: 0,
|
||||
type: 0
|
||||
]
|
||||
|
||||
defp dsl!(resource) do
|
||||
Code.ensure_compiled!(resource)
|
||||
|
|
|
@ -287,4 +287,8 @@ defmodule Ash.Flow.Dsl do
|
|||
use Ash.Dsl.Extension,
|
||||
sections: @sections,
|
||||
transformers: @transformers
|
||||
|
||||
def name, do: "Flow"
|
||||
def target, do: "Ash.Flow"
|
||||
def default_for_target?, do: true
|
||||
end
|
||||
|
|
|
@ -136,6 +136,10 @@ defmodule Ash.Notifier.PubSub do
|
|||
|
||||
use Ash.Dsl.Extension, sections: @sections
|
||||
|
||||
def name, do: "PubSub"
|
||||
def target, do: "Ash.Resource"
|
||||
def type, do: "Notifier"
|
||||
|
||||
def publications(resource) do
|
||||
Ash.Dsl.Extension.get_entities(resource, [:pub_sub])
|
||||
end
|
||||
|
|
|
@ -8,4 +8,7 @@ defmodule Ash.Registry.ResourceValidations do
|
|||
]
|
||||
|
||||
use Ash.Dsl.Extension, transformers: @transformers
|
||||
|
||||
def name, do: "Resource Validations"
|
||||
def target, do: "Ash.Registry"
|
||||
end
|
||||
|
|
|
@ -25,6 +25,10 @@ defmodule Ash.Registry do
|
|||
|
||||
alias Ash.Dsl.Extension
|
||||
|
||||
def name, do: "Registry"
|
||||
def target, do: "Ash.Registry"
|
||||
def default_for_target?, do: true
|
||||
|
||||
@spec entries(t()) :: list(module)
|
||||
def entries(registry) do
|
||||
case registry |> Extension.get_entities([:entries]) |> Enum.map(& &1.entry) do
|
||||
|
|
Loading…
Reference in a new issue