-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
151 lines (140 loc) · 4.46 KB
/
mix.exs
File metadata and controls
151 lines (140 loc) · 4.46 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
# SPDX-FileCopyrightText: 2025 diffo_example contributors <https://github.com/diffo-dev/diffo_example/graphs.contributors>
#
# SPDX-License-Identifier: MIT
defmodule DiffoExample.MixProject do
@moduledoc false
use Mix.Project
@version "0.2.3"
@name "DiffoExample"
@description "Examples for Diffo TMF Service and Resource Manager"
@github_url "https://github.com/diffo-dev/diffo-example"
def project do
[
app: :diffo_example,
version: @version,
name: @name,
description: @description,
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
package: package(),
# ex_doc
source_url: "https://github.com/diffo-dev/diffo_example/",
homepage_url: "http://diffo.dev/diffo_example/",
elixirc_paths: elixirc_paths(Mix.env()),
# agent stuff
usage_rules: usage_rules(),
# hex.pm stuff
deps: deps(),
docs: &docs/0,
aliases: aliases()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {DiffoExample.Application, []}
]
end
defp diffo_version(default_version) do
case System.get_env("DIFFO_VERSION") do
nil -> default_version
"local" -> [path: "../diffo"]
"main" -> [git: "https://github.com/diffo-dev/diffo.git"]
"dev" -> [git: "https://github.com/diffo-dev/diffo.git", branch: "dev"]
version -> "~> #{version}"
end
end
def docs do
[
homepage_url: @github_url,
source_url: @github_url,
source_ref: "v#{@version}",
main: "readme",
logo: "logos/diffo.jpg",
extras: [
"README.md": [title: "Guide"],
"documentation/domains/access.md": [title: "The Access Domain"],
"documentation/domains/diffo_example_access.livemd": [title: "Access Livebook"],
"documentation/domains/_access_api.md": [title: "Access Domain API"],
"documentation/domains/provider.md": [title: "The Provider Domain"],
"documentation/domains/nbn.md": [title: "The NBN Domain"],
"documentation/domains/diffo_example_nbn.livemd": [title: "NBN Livebook"],
"documentation/domains/_nbn_api.md": [title: "NBN Domain API"],
"documentation/how_to/setup_mcp.md": [title: "Setup the MCP server"],
"LICENSES/MIT.md": [title: "License"]
],
groups_for_extras: [
Domains: ~r"documentation/domains",
"How To": ~r"documentation/how_to",
DSLs: ~r"documentation/dsls"
]
]
end
defp package do
[
name: :diffo_example,
licenses: ["MIT"],
files: ~w(lib .formatter.exs mix.exs README* LICENSE*),
links: %{
"GitHub" => @github_url,
"Author's home page" => "https://www.diffo.dev"
}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:diffo, diffo_version("~> 0.4.1")},
{:ash_ai, "~> 0.6"},
{:plug_cowboy, "~> 2.7"},
{:picosat_elixir, "~> 0.2.0"},
{:simple_sat, ">= 0.0.0"},
{:usage_rules, "~> 1.0", only: [:dev]},
{:req, "~> 0.5"},
{:igniter, "~> 0.6", only: [:dev, :test]},
{:ex_doc, "~> 0.37", only: [:dev, :test], runtime: false}
]
end
defp aliases() do
[
test: ["ash.setup --quiet", "test"],
setup: "ash.setup",
docs: [
"docs",
"spark.replace_doc_links"
],
"spark.formatter": [
"format .formatter.exs"
]
]
end
defp elixirc_paths(:test), do: elixirc_paths(:dev) ++ ["test/support"]
defp elixirc_paths(_), do: ["lib"]
defp usage_rules do
# Example for those using claude.
[
file: "CLAUDE.md",
# rules to include directly in CLAUDE.md
usage_rules: ["usage_rules:all"],
skills: [
location: ".claude/skills",
# build skills that combine multiple usage rules
build: [
"ash-framework": [
description:
"Use this skill working with Ash Framework or any of its extensions. Always consult this when making any domain changes, features or fixes.",
# Include all Ash dependencies
usage_rules: [:ash, ~r/^ash_/]
],
"diffo-framework": [
description:
"Use this skill working with Diffo or any related non-Ash Diffo components. Understand the provider extension and assigner.",
# Include all Diffo dependencies
usage_rules: [:diffo, ~r/^diffo_/]
]
]
]
]
end
end