-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathmix.exs
More file actions
209 lines (196 loc) · 6.29 KB
/
mix.exs
File metadata and controls
209 lines (196 loc) · 6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# SPDX-FileCopyrightText: 2024 ash_ai contributors <https://github.com/ash-project/ash_ai/graphs/contributors>
#
# SPDX-License-Identifier: MIT
defmodule AshAi.MixProject do
use Mix.Project
@description """
Integrated LLM features for your Ash application.
"""
@version "0.5.0"
@source_url "https://github.com/ash-project/ash_ai"
def project do
[
app: :ash_ai,
version: @version,
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
package: package(),
consolidate_protocols: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
docs: &docs/0,
dialyzer: [plt_add_apps: [:ash, :mix]],
description: @description,
source_url: @source_url,
homepage_url: @source_url,
preferred_cli_env: [
"test.create": :test,
"test.migrate": :test,
"test.rollback": :test,
"test.migrate_tenants": :test,
"test.check_migrations": :test,
"test.drop": :test,
"test.generate_migrations": :test,
"test.reset": :test,
"test.full_reset": :test
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {AshAi.Application, []}
]
end
defp docs do
[
main: "readme",
source_ref: "v#{@version}",
logo: "logos/small-logo.png",
extra_section: "GUIDES",
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>
"""
end
end,
extras: [
{"README.md", title: "Home"},
{"documentation/dsls/DSL-AshAi.md", search_data: Spark.Docs.search_data_for(AshAi)},
{"documentation/models/gemini.md", title: "Gemini"},
"CHANGELOG.md"
],
groups_for_extras: [
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls',
"About AshGraphql": [
"CHANGELOG.md"
]
],
groups_for_modules: [
AshGraphql: [
AshGraphql
],
Introspection: [
AshGraphql.Resource.Info,
AshGraphql.Domain.Info,
AshGraphql.Resource,
AshGraphql.Domain,
AshGraphql.Resource.Action,
AshGraphql.Resource.ManagedRelationship,
AshGraphql.Resource.Mutation,
AshGraphql.Resource.Query
],
Errors: [
AshGraphql.Error,
AshGraphql.Errors
],
Miscellaneous: [
AshGraphql.Resource.Helpers
],
Utilities: [
AshGraphql.ContextHelpers,
AshGraphql.DefaultErrorHandler,
AshGraphql.Plug,
AshGraphql.Subscription,
AshGraphql.Type,
AshGraphql.Types.JSON,
AshGraphql.Types.JSONString
]
]
]
end
defp elixirc_paths(:test) do
["test/support/", "lib/"]
end
defp elixirc_paths(_env) do
["lib/"]
end
defp package do
[
maintainers: [
"Zach Daniel <zach@zachdaniel.dev>"
],
licenses: ["MIT"],
files: ~w(lib .formatter.exs mix.exs README* LICENSE* usage-rules.md
CHANGELOG* documentation),
links: %{
"GitHub" => @source_url,
"Discord" => "https://discord.gg/HTHRaaVPUc",
"Website" => "https://ash-hq.org",
"Forum" => "https://elixirforum.com/c/ash-framework-forum/",
"Changelog" => "#{@source_url}/blob/main/CHANGELOG.md",
"REUSE Compliance" => "https://api.reuse.software/info/github.com/ash-project/ash_ai"
}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ash, ash_version("~> 3.0 and >= 3.7.1")},
{:ash_json_api, "~> 1.4 and >= 1.4.27"},
{:open_api_spex, "~> 3.0"},
{:langchain, "~> 0.4"},
{:ash_postgres, "~> 2.5", optional: true},
{:ash_oban, "~> 0.5", optional: true},
{:ash_phoenix, "~> 2.0", optional: true},
{:igniter, "~> 0.5", optional: true},
{:plug, "~> 1.17", optional: true},
{:ash_authentication, "~> 4.8", optional: true},
# dev/test deps
{:phx_new, "~> 1.7", optional: true},
{:ex_doc, "~> 0.37-rc", 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},
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:git_ops, "~> 2.5", only: [:dev, :test]},
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false},
{:simple_sat, ">= 0.0.0", only: :test},
{:mix_audit, ">= 0.0.0", only: [:dev, :test], runtime: false}
]
end
defp aliases do
[
"spark.formatter": "spark.formatter --extensions AshAi",
sobelow: "sobelow --skip",
credo: "credo --strict",
docs: [
"spark.cheat_sheets",
"docs",
"spark.replace_doc_links"
],
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshAi",
"test.generate_migrations": "ash_postgres.generate_migrations",
"test.check_migrations": "ash_postgres.generate_migrations --check",
"test.migrate_tenants": "ash_postgres.migrate --tenants",
"test.migrate": "ash_postgres.migrate",
"test.rollback": "ash_postgres.rollback",
"test.create": "ash_postgres.create",
"test.full_reset": ["test.generate_migrations", "test.reset"],
"test.reset": ["test.drop", "test.create", "test.migrate", "ash_postgres.migrate --tenants"],
"test.drop": "ash_postgres.drop"
]
end
defp ash_version(default_version) do
case System.get_env("ASH_VERSION") do
nil -> default_version
"local" -> [path: "../ash", override: true]
"main" -> [git: "https://github.com/ash-project/ash.git", override: true]
version -> "~> #{version}"
end
end
end