mix.exs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. defmodule Plausible.MixProject do
  2. use Mix.Project
  3. def project do
  4. [
  5. name: "Plausible",
  6. source_url: "https://github.com/plausible/analytics",
  7. docs: docs(),
  8. app: :plausible,
  9. version: System.get_env("APP_VERSION", "0.0.1"),
  10. elixir: "~> 1.14",
  11. elixirc_paths: elixirc_paths(Mix.env()),
  12. start_permanent: Mix.env() in [:prod, :small],
  13. aliases: aliases(),
  14. deps: deps(),
  15. test_coverage: [
  16. tool: ExCoveralls
  17. ],
  18. releases: [
  19. plausible: [
  20. include_executables_for: [:unix],
  21. config_providers: [
  22. {Config.Reader,
  23. path: {:system, "RELEASE_ROOT", "/import_extra_config.exs"}, imports: []}
  24. ]
  25. ]
  26. ],
  27. dialyzer: [
  28. plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
  29. plt_add_apps: [:mix, :ex_unit]
  30. ]
  31. ]
  32. end
  33. # Configuration for the OTP application.
  34. #
  35. # Type `mix help compile.app` for more information.
  36. def application do
  37. [
  38. mod: {Plausible.Application, []},
  39. extra_applications: [
  40. :logger,
  41. :runtime_tools,
  42. :tls_certificate_check,
  43. :opentelemetry_exporter
  44. ]
  45. ]
  46. end
  47. # Specifies which paths to compile per environment.
  48. defp elixirc_paths(env) when env in [:test, :dev],
  49. do: ["lib", "test/support", "extra/lib"]
  50. defp elixirc_paths(env) when env in [:small_test, :small_dev],
  51. do: ["lib", "test/support"]
  52. defp elixirc_paths(:small), do: ["lib"]
  53. defp elixirc_paths(_), do: ["lib", "extra/lib"]
  54. # Specifies your project dependencies.
  55. #
  56. # Type `mix help deps` for examples and options.
  57. defp deps do
  58. [
  59. {:bamboo, "~> 2.3", override: true},
  60. {:bamboo_phoenix, "~> 1.0.0"},
  61. {:bamboo_postmark, git: "https://github.com/plausible/bamboo_postmark.git", branch: "main"},
  62. {:bamboo_smtp, "~> 4.1"},
  63. {:bamboo_mua, "~> 0.1.4"},
  64. {:bcrypt_elixir, "~> 3.0"},
  65. {:bypass, "~> 2.1", only: [:dev, :test, :small_test]},
  66. {:ecto_ch, "~> 0.3"},
  67. {:cloak, "~> 1.1"},
  68. {:cloak_ecto, "~> 1.2"},
  69. {:combination, "~> 0.0.3"},
  70. {:cors_plug, "~> 3.0"},
  71. {:credo, "~> 1.5", only: [:dev, :test], runtime: false},
  72. {:csv, "~> 2.3"},
  73. {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
  74. {:double, "~> 0.8.0", only: [:test, :small_test]},
  75. {:ecto, "~> 3.11.0"},
  76. {:ecto_sql, "~> 3.11.0"},
  77. {:envy, "~> 1.1.1"},
  78. {:eqrcode, "~> 0.1.10"},
  79. {:ex_machina, "~> 2.3", only: [:dev, :test, :small_dev, :small_test]},
  80. {:excoveralls, "~> 0.10", only: :test},
  81. {:finch, "~> 0.16.0"},
  82. {:floki, "~> 0.35.0", only: [:dev, :test, :small_dev, :small_test]},
  83. {:fun_with_flags, "~> 1.11.0"},
  84. {:fun_with_flags_ui, "~> 1.0"},
  85. {:locus, "~> 2.3"},
  86. {:gen_cycle, "~> 1.0.4"},
  87. {:hackney, "~> 1.8"},
  88. {:jason, "~> 1.3"},
  89. {:kaffy, "~> 0.10.2", only: [:dev, :test, :staging, :prod]},
  90. {:location, git: "https://github.com/plausible/location.git"},
  91. {:mox, "~> 1.0", only: [:test, :small_test]},
  92. {:nanoid, "~> 2.1.0"},
  93. {:nimble_totp, "~> 1.0"},
  94. {:oban, "~> 2.17.0"},
  95. {:observer_cli, "~> 1.7"},
  96. {:opentelemetry, "~> 1.1"},
  97. {:opentelemetry_api, "~> 1.1"},
  98. {:opentelemetry_ecto, "~> 1.1.0"},
  99. {:opentelemetry_exporter, "~> 1.6.0"},
  100. {:opentelemetry_phoenix, "~> 1.0"},
  101. {:opentelemetry_oban, "~> 1.0.0"},
  102. {:phoenix, "~> 1.7.0"},
  103. {:phoenix_view, "~> 2.0"},
  104. {:phoenix_ecto, "~> 4.0"},
  105. {:phoenix_html, "~> 3.3", override: true},
  106. {:phoenix_live_reload, "~> 1.2", only: [:dev, :small_dev]},
  107. {:phoenix_pubsub, "~> 2.0"},
  108. {:phoenix_live_view, "~> 0.18"},
  109. {:php_serializer, "~> 2.0"},
  110. {:plug, "~> 1.13", override: true},
  111. {:plug_cowboy, "~> 2.3"},
  112. {:postgrex, "~> 0.17.0"},
  113. {:prom_ex, "~> 1.8"},
  114. {:public_suffix, git: "https://github.com/axelson/publicsuffix-elixir"},
  115. {:ref_inspector, "~> 2.0"},
  116. {:referrer_blocklist, git: "https://github.com/plausible/referrer-blocklist.git"},
  117. {:sentry, "~> 10.0"},
  118. {:siphash, "~> 3.2"},
  119. {:timex, "~> 3.7"},
  120. {:ua_inspector, "~> 3.0"},
  121. {:ex_doc, "~> 0.28", only: :dev, runtime: false},
  122. {:ex_money, "~> 5.12"},
  123. {:mjml_eex, "~> 0.9.0"},
  124. {:mjml, "~> 1.5.0"},
  125. {:heroicons, "~> 0.5.0"},
  126. {:zxcvbn, git: "https://github.com/techgaun/zxcvbn-elixir.git"},
  127. {:open_api_spex, "~> 3.18"},
  128. {:joken, "~> 2.5"},
  129. {:paginator, git: "https://github.com/duffelhq/paginator.git"},
  130. {:scrivener_ecto, "~> 2.0"},
  131. {:esbuild, "~> 0.7", runtime: Mix.env() in [:dev, :small_dev]},
  132. {:tailwind, "~> 0.2.0", runtime: Mix.env() in [:dev, :small_dev]},
  133. {:ex_json_logger, "~> 1.4.0"},
  134. {:ecto_network, "~> 1.5.0"},
  135. {:ex_aws, "~> 2.5"},
  136. {:ex_aws_s3, "~> 2.5"},
  137. {:sweet_xml, "~> 0.7.4"},
  138. {:zstream, "~> 0.6.4"},
  139. {:con_cache, "~> 1.0"}
  140. ]
  141. end
  142. defp aliases do
  143. [
  144. setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"],
  145. "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
  146. "ecto.reset": ["ecto.drop", "ecto.setup"],
  147. test: ["ecto.create --quiet", "ecto.migrate", "test", "clean_clickhouse"],
  148. "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
  149. "assets.build": [
  150. "tailwind default",
  151. "esbuild default"
  152. ],
  153. "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
  154. ]
  155. end
  156. defp docs do
  157. [
  158. main: "readme",
  159. logo: "priv/static/images/ee/favicon-32x32.png",
  160. extras:
  161. Path.wildcard("guides/**/*.md") ++
  162. [
  163. "README.md": [filename: "readme", title: "Introduction"],
  164. "CONTRIBUTING.md": [filename: "contributing", title: "Contributing"]
  165. ],
  166. groups_for_extras: [
  167. Features: Path.wildcard("guides/features/*.md")
  168. ],
  169. before_closing_body_tag: fn
  170. :html ->
  171. """
  172. <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
  173. <script>mermaid.initialize({startOnLoad: true})</script>
  174. """
  175. _ ->
  176. ""
  177. end
  178. ]
  179. end
  180. end