This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
211 lines (194 loc) · 6.17 KB
/
mix.exs
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
210
211
defmodule EpiLocator.MixProject do
use Mix.Project
def project do
[
app: :epi_locator,
version: "0.1.0",
dialyzer: dialyzer(),
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
docs: docs(),
releases: [
epi_locator: [
include_executables_for: [:unix],
applications: [
runtime_tools: :permanent
]
]
],
xref: [exclude: IEx],
test_coverage: [
summary: [threshold: 0]
]
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {EpiLocator.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:cachex, "~> 3.3"},
{:commcare_api, "~> 0.2"},
{:dart_sass, "~> 0.3", runtime: Mix.env() == :dev},
{:ecto, "~> 3.4"},
{:ecto_sql, "~> 3.4"},
{:elixir_xml_to_map, "~> 2.0"},
{:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
{:euclid, "~> 0.2"},
{:ex_aws, "~> 2.0"},
{:ex_aws_cloudwatch, "~> 2.0"},
{:ex_doc, "~> 0.21", runtime: false},
{:floki, ">= 0.0.0"},
{:fun_with_flags, "~> 1.5"},
{:fun_with_flags_ui, "~> 0.7"},
{:gettext, "~> 0.11"},
{:hackney, "~> 1.8"},
{:hammox, "~> 0.2"},
{:httpoison, "~> 1.6"},
{:jason, "~> 1.1"},
{:phoenix, "~> 1.6"},
{:phoenix_ecto, "~> 4.1"},
{:phoenix_html, "~> 3.1"},
{:phoenix_live_dashboard, "~> 0.6"},
{:phoenix_live_view, "~> 0.17"},
{:plug_cowboy, "~> 2.3"},
{:postgrex, "~> 0.15"},
{:sentry, "~> 8.0"},
{:telemetry_metrics, "~> 0.4"},
{:telemetry_poller, "~> 1.0"},
{:timex, "~> 3.5"},
{:csv, "~> 2.4"},
# --------------
{:phoenix_live_reload, "~> 1.3", only: :dev},
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
# --------------
{:wallaby, "~> 0.28", runtime: false, only: :test},
# --------------
{:mix_audit, "~> 1.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.4", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.8", only: :dev},
{:nimble_totp, "~> 0.1.0"},
{:bcrypt_elixir, "~> 2.0"},
{:stream_data, "~> 0.5", only: [:dev, :test]}
]
end
defp docs do
[
api_reference: false,
main: "epi-locator",
assets: "guides/assets",
extra_section: "GUIDES",
extras: extras(),
formatters: ["html"],
source_url: "https://github.com/RatioPBC/epi-locator",
nest_modules_by_prefix: [],
before_closing_body_tag: &before_closing_body_tag/1,
before_closing_head_tag: &before_closing_head_tag/1,
output: "docs",
javascript_config_path: nil
]
end
defp before_closing_body_tag(:html) do
"""
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({ startOnLoad: false, theme: "default" });
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
graphEl.classList.add("mermaid-container");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition, function (svgSource, bindListeners) {
graphEl.innerHTML = svgSource;
bindListeners && bindListeners(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
for (const d of document.getElementsByClassName("details-following-code")) {
const codeBlock = d.nextSibling;
const details = document.createElement("details");
details.classList.add("with-code");
const summary = document.createElement("summary");
const summaryText = document.createTextNode(d.dataset.summary);
summary.appendChild(summaryText);
details.appendChild(summary);
details.appendChild(codeBlock);
d.appendChild(details);
}
});
</script>
"""
end
defp before_closing_body_tag(_), do: ""
defp before_closing_head_tag(:html) do
"""
<style>
#content.content-inner {
max-width: 1282px;
}
.mermaid-container {
background-color: white;
}
.details-following-code ~ pre {
display: none;
}
.details-following-code details.with-code pre {
display: block;
}
details > summary {
cursor: pointer;
}
</style>
"""
end
defp before_closing_head_tag(_), do: ""
defp extras do
["README.md": [filename: "epi-locator", title: "Epi Locator"], "guides/overview.md": [title: "Overview"], LICENSE: []]
end
defp dialyzer do
[
plt_add_apps: [:iex],
plt_add_deps: :app_tree,
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to install project dependencies and perform other setup tasks, run:
#
# $ mix setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
docs: ["docs", ©_images/1],
setup: ["deps.get", "ecto.setup"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.deploy": ["esbuild default --minify", "sass default --no-source-map --style=compressed", "phx.digest"]
]
end
defp copy_images(_) do
File.cp_r("guides/assets", "docs/assets")
end
end