-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathmix.exs
More file actions
245 lines (235 loc) · 8.09 KB
/
mix.exs
File metadata and controls
245 lines (235 loc) · 8.09 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
defmodule Plausible.MixProject do
use Mix.Project
def project do
[
name: "Plausible",
source_url: "https://github.com/plausible/analytics",
docs: docs(),
app: :plausible,
version: System.get_env("APP_VERSION", "0.0.1"),
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() in [:prod, :ce, :load],
aliases: aliases(),
deps: deps(),
test_coverage: [
tool: ExCoveralls
],
listeners: [Phoenix.CodeReloader],
releases: [
plausible: [
include_executables_for: [:unix],
config_providers: [
{Config.Reader,
path: {:system, "RELEASE_ROOT", "/import_extra_config.exs"}, imports: []}
]
]
],
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix, :ex_unit]
]
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {Plausible.Application, []},
extra_applications:
[
:logger,
:runtime_tools,
:tls_certificate_check,
:opentelemetry_exporter
] ++ if(Mix.env() in [:dev, :load], do: [:tools, :observer, :wx], else: [])
]
end
def cli do
[
preferred_envs: [
"test.e2e": :e2e_test,
"test.e2e.ui": :e2e_test
]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(env) when env in [:test, :e2e_test, :dev],
do: ["lib", "test/support", "extra/lib"]
defp elixirc_paths(env) when env in [:ce_test, :ce_dev],
do: ["lib", "test/support"]
defp elixirc_paths(:ce), do: ["lib"]
defp elixirc_paths(_), do: ["lib", "extra/lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:bamboo, "~> 2.3", override: true},
{:bamboo_postmark, git: "https://github.com/plausible/bamboo_postmark.git", branch: "main"},
{:bamboo_smtp, "~> 4.1"},
{:bamboo_mua, "~> 0.2.0"},
{:bcrypt_elixir, "~> 3.3"},
{:bypass, "~> 2.1", only: [:dev, :test, :ce_test, :e2e_test]},
{:ecto_ch, "~> 0.8.6"},
{:cloak, "~> 1.1"},
{:cloak_ecto, "~> 1.2"},
{:combination, "~> 0.0.3"},
{:cors_plug, "~> 3.0"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:double, "~> 0.8.0", only: [:dev, :test, :ce_test, :ce_dev, :e2e_test]},
{:ecto, "~> 3.13.5"},
{:ecto_sql, "~> 3.13.2"},
{:envy, "~> 1.1.1"},
{:eqrcode, "~> 0.2.1"},
{:ex_machina, "~> 2.3", only: [:dev, :test, :ce_dev, :ce_test, :e2e_test]},
{:excoveralls, "~> 0.10", only: :test},
{:finch, "~> 0.20.0"},
{:lazy_html, "~> 0.1.8"},
{:fun_with_flags, "~> 1.13.0"},
{:fun_with_flags_ui, "~> 1.0"},
{:locus, "~> 2.3"},
{:gen_cycle, "~> 1.0.4"},
{:hackney, "~> 1.8"},
{:jason, "~> 1.3"},
{:location, git: "https://github.com/plausible/location.git"},
{:mox, "~> 1.0", only: [:test, :ce_test, :e2e_test]},
{:nanoid, "~> 2.1.0"},
{:nimble_totp, "~> 1.0"},
{:oban, "~> 2.20.1"},
{:observer_cli, "~> 1.7"},
{:opentelemetry, "~> 1.7"},
{:opentelemetry_api, "~> 1.5"},
{:opentelemetry_ecto, "~> 1.2"},
{:opentelemetry_exporter, "~> 1.10"},
{:opentelemetry_phoenix, "~> 2.0.1"},
{:opentelemetry_oban, "~> 1.1"},
{:opentelemetry_cowboy, "~> 1.0"},
# # https://github.com/open-telemetry/opentelemetry-erlang-contrib/issues/428
{:opentelemetry_semantic_conventions, "~> 1.27", override: true},
{:phoenix, "~> 1.8.2"},
{:phoenix_view, "~> 2.0"},
{:phoenix_ecto, "~> 4.5"},
{:phoenix_html, "~> 4.1"},
{:phoenix_live_reload, "~> 1.2", only: [:dev, :ce_dev]},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_live_view, "~> 1.1.17"},
{:php_serializer, "~> 2.0"},
{:plug, "~> 1.13", override: true},
{:prima, "~> 0.2.5"},
{:plug_cowboy, "~> 2.3"},
{:polymorphic_embed, "~> 5.0"},
{:postgrex, "~> 0.21.1"},
{:prom_ex, "~> 1.8"},
{:peep, "~> 3.0"},
{:public_suffix, git: "https://github.com/axelson/publicsuffix-elixir"},
{:ref_inspector, "~> 2.0"},
{:referrer_blocklist, git: "https://github.com/plausible/referrer-blocklist.git"},
{:sentry, "~> 11.0.4"},
{:simple_saml, "~> 1.2"},
{:xml_builder, "~> 2.1"},
{:siphash, "~> 3.2"},
{:timex, "~> 3.7"},
{:ua_inspector,
git: "https://github.com/plausible/ua_inspector.git", branch: "sanitize-pre"},
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
{:ex_money, "~> 5.12"},
{:mjml_eex, "~> 0.12.0"},
{:mjml, "~> 4.0.0"},
{:heroicons, "~> 0.5.0"},
{:zxcvbn, git: "https://github.com/techgaun/zxcvbn-elixir.git"},
{:open_api_spex, "~> 3.22.1"},
{:joken, "~> 2.5"},
{:paginator, git: "https://github.com/duffelhq/paginator.git"},
{:scrivener_ecto, "~> 3.1"},
{:esbuild, "~> 0.7", runtime: Mix.env() in [:dev, :ce_dev]},
{:tailwind, "~> 0.4.0", runtime: Mix.env() in [:dev, :ce_dev]},
{:ex_json_logger, "~> 1.4.0"},
{:ecto_network, "~> 1.6.0"},
{:ex_aws, "~> 2.5"},
{:ex_aws_s3, "~> 2.5"},
{:sweet_xml, "~> 0.7.4"},
{:zstream, "~> 0.6.4"},
{:con_cache,
git: "https://github.com/aerosol/con_cache", branch: "ensure-dirty-ops-emit-telemetry"},
{:req, "~> 0.5.16"},
{:opentelemetry_req, "~> 1.0"},
{:happy_tcp, github: "ruslandoga/happy_tcp", only: [:ce, :ce_dev, :ce_test, :e2e_test]},
{:ex_json_schema, "~> 0.11.1"},
{:odgn_json_pointer, "~> 3.1.0"},
{:phoenix_bakery, "~> 0.1.2", only: [:ce, :ce_dev, :ce_test, :e2e_test]},
{:site_encrypt, github: "sasa1977/site_encrypt", only: [:ce, :ce_dev, :ce_test, :e2e_test]},
{:phoenix_storybook, "~> 0.9"},
{:libcluster, "~> 3.5"}
]
end
defp aliases do
[
setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test", "clean_clickhouse"],
"test.e2e": [
"esbuild default",
"ecto.create --quiet",
"ecto.migrate",
"clean_postgres",
"clean_clickhouse",
# NOTE: This speeds up subsequent backend app
# startup. It's not clear why though :shrug:
"run -e \":noop\"",
"cmd npm run --prefix ./e2e test"
],
"test.e2e.ui": [
"esbuild default",
"ecto.create --quiet",
"ecto.migrate",
"clean_postgres",
"clean_clickhouse",
# NOTE: This speeds up subsequent backend app
# startup. It's not clear why though :shrug:
"run -e \":noop\"",
"cmd npm run --prefix ./e2e test:ui"
],
"assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
"assets.typecheck": ["cmd npm --prefix assets run typecheck"],
"assets.build": [
"tailwind default",
"tailwind storybook",
"esbuild default"
],
"assets.deploy": [
"tailwind default --minify",
"tailwind storybook --minify",
"esbuild default --minify",
"phx.digest"
]
]
end
defp docs do
[
main: "readme",
logo: "priv/static/images/ee/favicon-32x32.png",
extras:
Path.wildcard("guides/**/*.md") ++
[
"README.md": [filename: "readme", title: "Introduction"],
"CONTRIBUTING.md": [filename: "contributing", title: "Contributing"]
],
groups_for_extras: [
Features: Path.wildcard("guides/features/*.md")
],
before_closing_body_tag: fn
:html ->
"""
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad: true})</script>
"""
_ ->
""
end
]
end
end