-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
130 lines (112 loc) · 3.03 KB
/
mix.exs
File metadata and controls
130 lines (112 loc) · 3.03 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
defmodule SuperCache.MixProject do
use Mix.Project
def project do
[
app: :super_cache,
version: "1.3.0",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
config_path: "config/config.exs",
elixirc_paths: elixirc_paths(Mix.env()),
# Docs
name: "SuperCache",
source_url: "https://github.com/ohhi-vn/super_cache",
homepage_url: "https://ohhi.vn",
docs: docs(),
description: description(),
package: package(),
aliases: aliases(),
usage_rules: usage_rules()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
dev_app =
if Mix.env() == :dev do
[:observer, :wx, :tools, :runtime_tools]
else
[]
end
[
mod: {SuperCache.Application, []},
extra_applications: [:logger] ++ dev_app
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, "~> 0.40", only: :dev, runtime: false},
{:benchee, "~> 1.5", only: :dev},
# support AI in dev env.
{:tidewave, "~> 0.5", only: [:dev]},
{:usage_rules, "~> 1.2", only: [:dev]},
{:bandit, "~> 1.10", only: :dev}
]
end
defp description() do
"An in-memory caching library using tuples as the core data type, with support for structs, key/value pairs, queues, and stacks. Includes experimental distributed caching."
end
defp package() do
[
maintainers: ["Manh Van Vu"],
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/ohhi-vn/super_cache",
"About us" => "https://ohhi.vn/"
}
]
end
defp docs do
[
main: "readme",
extras: extras()
]
end
defp extras do
list =
"guides/**/*.md"
|> Path.wildcard()
list = list ++ ["README.md"]
list
|> Enum.map(fn path ->
title =
path
|> Path.basename(".md")
|> String.split(~r|[-_]|)
|> Enum.map_join(" ", &String.capitalize/1)
|> case do
"F A Q" -> "FAQ"
no_change -> no_change
end
{String.to_atom(path),
[
title: title,
default: title == "Guide"
]}
end)
end
defp usage_rules do
[
file: "AGENTS.md",
usage_rules: :all
]
end
defp aliases() do
[
tidewave:
"run --no-halt -e 'Agent.start(fn -> Bandit.start_link(plug: Tidewave, port: 4000) end)'",
# Normal unit tests — no distribution required.
test: ["test --exclude cluster"],
# Cluster integration tests — spawns peer nodes via :peer.
# VM flags (--name, --cookie) must be passed via --erl to the runtime,
# not directly to mix test which does not understand them.
"test.cluster": [
"cmd elixir --name primary@127.0.0.1 --cookie test_secret -S mix test --only cluster"
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "examples/support"]
defp elixirc_paths(_), do: ["lib"]
end