ash_graphql/mix.exs

180 lines
5.2 KiB
Elixir
Raw Normal View History

2020-05-02 04:32:56 +12:00
defmodule AshGraphql.MixProject do
use Mix.Project
2020-08-14 10:55:34 +12:00
@description """
An absinthe-backed graphql extension for Ash
"""
2024-01-13 08:34:33 +13:00
@version "0.26.9"
2020-08-14 10:55:34 +12:00
2020-05-02 04:32:56 +12:00
def project do
[
app: :ash_graphql,
2020-08-14 10:55:34 +12:00
version: @version,
2021-01-22 17:16:10 +13:00
elixir: "~> 1.11",
2020-05-02 04:32:56 +12:00
start_permanent: Mix.env() == :prod,
2020-08-14 10:55:34 +12:00
package: package(),
aliases: aliases(),
deps: deps(),
2020-12-02 18:07:15 +13:00
elixirc_paths: elixirc_paths(Mix.env()),
2020-09-24 12:54:57 +12:00
dialyzer: [plt_add_apps: [:ash]],
2020-08-14 10:55:34 +12:00
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.github": :test
],
docs: docs(),
description: @description,
source_url: "https://github.com/ash-project/ash_graphql",
homepage_url: "https://github.com/ash-project/ash_graphql"
]
end
2020-12-02 18:07:15 +13:00
defp elixirc_paths(:test) do
elixirc_paths(:dev) ++ ["test/support"]
end
defp elixirc_paths(_) do
["lib"]
end
2020-08-14 10:55:34 +12:00
defp docs do
[
main: "getting-started-with-graphql",
2020-08-14 10:55:34 +12:00
source_ref: "v#{@version}",
logo: "logos/small-logo.png",
extra_section: "GUIDES",
2023-10-03 01:35:53 +13:00
before_closing_head_tag: fn type ->
if type == :html do
"""
<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:53 +13:00
"""
end
end,
2024-01-13 08:53:43 +13:00
extras: [
"documentation/tutorials/getting-started-with-graphql.md",
"documentation/how_to/authorize-with-graphql.md",
"documentation/how_to/handle-errors.md",
"documentation/how_to/use-enums-with-graphql.md",
"documentation/how_to/use-json-with-graphql.md",
"documentation/how_to/use-subscriptions-with-graphql.md",
"documentation/how_to/use-unions-with-graphql.md",
"documentation/topics/monitoring.md",
"documentation/topics/graphql-generation.md",
"documentation/topics/modifying-the-resolution.md",
"documentation/topics/relay.md",
"documentation/dsls/DSL:-AshGraphql.Api.cheatmd",
"documentation/dsls/DSL:-AshGraphql.Resource.cheatmd"
],
groups_for_extras: [
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls'
],
groups_for_modules: [
2023-02-09 16:59:20 +13:00
AshGraphql: [
AshGraphql
],
Introspection: [
AshGraphql.Resource.Info,
AshGraphql.Api.Info,
AshGraphql.Resource,
AshGraphql.Api,
AshGraphql.Resource.Action,
AshGraphql.Resource.ManagedRelationship,
AshGraphql.Resource.Mutation,
AshGraphql.Resource.Query
],
Errors: [
AshGraphql.Error,
AshGraphql.Errors
],
Miscellaneous: [
AshGraphql.Resource.Helpers
],
2024-01-13 08:34:15 +13:00
Utilities: [
AshGraphql.ContextHelpers,
AshGraphql.DefaultErrorHandler,
AshGraphql.Plug,
AshGraphql.Subscription,
AshGraphql.Type,
AshGraphql.Types.JSON,
AshGraphql.Types.JSONString
]
]
2020-08-14 10:55:34 +12:00
]
end
defp package do
[
name: :ash_graphql,
licenses: ["MIT"],
files: ~w(lib .formatter.exs mix.exs README* LICENSE*
CHANGELOG* documentation),
2020-08-14 10:55:34 +12:00
links: %{
GitHub: "https://github.com/ash-project/ash_graphql"
}
2020-05-02 04:32:56 +12:00
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ash, ash_version("~> 2.17")},
2020-12-01 12:17:00 +13:00
{:absinthe_plug, "~> 1.4"},
2022-04-27 03:35:09 +12:00
{:absinthe, "~> 1.7"},
2020-08-14 09:39:59 +12:00
{:jason, "~> 1.2"},
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
{:ex_check, "~> 0.12", only: [:dev, :test]},
2023-02-01 17:54:39 +13:00
{: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]},
{:excoveralls, "~> 0.13", only: [:dev, :test]},
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
2020-05-02 04:32:56 +12:00
]
end
2020-08-14 09:39:59 +12:00
2020-08-26 07:33:11 +12:00
defp ash_version(default_version) do
case System.get_env("ASH_VERSION") do
nil -> default_version
"local" -> [path: "../ash"]
2022-05-21 04:28:02 +12:00
"main" -> [git: "https://github.com/ash-project/ash.git"]
2020-08-26 07:33:11 +12:00
version -> "~> #{version}"
end
end
2020-08-14 10:55:34 +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.formatter": "spark.formatter --extensions AshGraphql.Resource,AshGraphql.Api",
"spark.cheat_sheets_in_search":
"spark.cheat_sheets_in_search --extensions AshGraphql.Resource,AshGraphql.Api",
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshGraphql.Resource,AshGraphql.Api"
2020-08-14 10:55:34 +12:00
]
end
end