defmodule Zoonk.MixProject do use Mix.Project @scm_url "https://github.com/zoonk/zoonk" def project do [ app: :zoonk, version: "0.2.0-alpha", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), dialyzer: [ plt_add_apps: [:mix], plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, ignore_warnings: ".dialyzer_ignore.exs" ], name: "Zoonk", source_url: @scm_url, homepage_url: "https://zoonk.org", docs: docs(), package: package(), description: "Open-source platform for creating interactive courses" ] end # Configuration for the OTP application. # # Type `mix help compile.app` for more information. def application do [ mod: {Zoonk.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 [ {:bcrypt_elixir, "~> 3.0"}, {:credo, "~> 1.7.0", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.3.0", only: [:dev, :test], runtime: false}, {:ecto_sql, "~> 3.10.1"}, {:esbuild, "~> 0.7.0", runtime: Mix.env() == :dev}, {:ex_doc, "~> 0.29.4", only: :dev, runtime: false}, {:finch, "~> 0.14"}, {:floki, ">= 0.34.2", only: :test}, {:gettext, "~> 0.22.1"}, {:jason, "~> 1.4"}, {:mix_audit, "~> 2.1.0", only: [:dev, :test], runtime: false}, {:phoenix_ecto, "~> 4.4.1"}, {:phoenix_html, "~> 3.3.1"}, {:phoenix_live_dashboard, "~> 0.8.0"}, {:phoenix_live_reload, "~> 1.4.1", only: :dev}, {:phoenix_live_view, "~> 0.19.0"}, {:phoenix, "~> 1.7.3"}, {:plug_cowboy, "~> 2.6"}, {:postgrex, ">= 0.16.5"}, {:sobelow, "~> 0.12.1", only: [:dev, :test], runtime: false}, {:styler, "~> 0.7.11", only: [:dev, :test], runtime: false}, {:swoosh, "~> 1.11.0"}, {:tailwind, "~> 0.2.0", runtime: Mix.env() == :dev}, {:tailwind_formatter, "~> 0.3.5", only: [:dev, :test], runtime: false}, {:telemetry_metrics, "~> 0.6.1"}, {:telemetry_poller, "~> 1.0"} ] 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 [ 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 --quiet", "test"], "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"], "assets.build": ["tailwind default", "esbuild default"], "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"], ci: [ "compile --all-warnings --warnings-as-errors", "format --check-formatted", "credo --strict", "sobelow -i Config.Headers --skip", "deps.audit", "dialyzer" ], locale: ["gettext.extract", "gettext.merge priv/gettext"], icons: ["icons"] ] end defp package do [ maintainers: ["Will Ceolin"], licenses: ["MIT"], links: %{"GitHub" => @scm_url}, files: ~w(assets config lib priv/gettext priv/repo priv/static/favicon priv/static/images priv/static/robots.txt LICENSE README.md mix.exs .formatter.exs) ] end defp docs do [ main: "overview", logo: "priv/static/favicon/apple-touch-icon.png", extra_section: "GUIDES", formatters: ["html", "epub"], extras: extras(), groups_for_extras: groups_for_extras(), groups_for_modules: groups_for_modules(), nest_modules_by_prefix: nest_modules_by_prefix() ] end defp extras do [ "guides/introduction/overview.md", "guides/introduction/installation.md", "guides/introduction/ssl.md", "guides/introduction/permissions.md" ] end defp groups_for_extras do [ Introduction: ~r/guides\/introduction\/.?/ ] end defp groups_for_modules do [ Accounts: [ Zoonk.Accounts, Zoonk.Accounts.User, Zoonk.Accounts.UserNotifier, Zoonk.Accounts.UserToken ], Organizations: [ Zoonk.Organizations, Zoonk.Organizations.School, Zoonk.Organizations.SchoolData, Zoonk.Organizations.SchoolUser ], Content: [ Zoonk.Content, Zoonk.Content.Course, Zoonk.Content.Course.Config, Zoonk.Content.CourseUser ], Plugs: [ ZoonkWeb.Plugs.ActiveTab, ZoonkWeb.Plugs.AgeChecker, ZoonkWeb.Plugs.Course, ZoonkWeb.Plugs.CustomSecureBrowserHeaders, ZoonkWeb.Plugs.School, ZoonkWeb.Plugs.Translate, ZoonkWeb.Plugs.UserAuth ], Shared: [ ZoonkWeb.Shared.MultistepForm, ZoonkWeb.Shared.Slug, ZoonkWeb.Shared.Validators ], Components: [ ZoonkWeb.Components.Badge, ZoonkWeb.Components.Banner, ZoonkWeb.Components.Button, ZoonkWeb.Components.Card, ZoonkWeb.Components.Details, ZoonkWeb.Components.Dropdown, ZoonkWeb.Components.Flash, ZoonkWeb.Components.Form, ZoonkWeb.Components.Header, ZoonkWeb.Components.Icon, ZoonkWeb.Components.Image, ZoonkWeb.Components.Input, ZoonkWeb.Components.Link, ZoonkWeb.Components.List, ZoonkWeb.Components.Modal, ZoonkWeb.Components.Tab, ZoonkWeb.Components.Table, ZoonkWeb.Components.Upload, ZoonkWeb.Components.Utils ], "Account Views": [ ZoonkWeb.Components.Accounts.User, ZoonkWeb.Controller.Accounts.Age, ZoonkWeb.Controller.Accounts.UserSession, ZoonkWeb.Live.Accounts.User.Registration, ZoonkWeb.Live.Accounts.User.Login, ZoonkWeb.Live.Accounts.User.ForgotPassword, ZoonkWeb.Live.Accounts.User.ResetPassword, ZoonkWeb.Live.Accounts.User.ConfirmationInstructions, ZoonkWeb.Live.Accounts.User.Confirmation, ZoonkWeb.Live.Accounts.User.Settings ], "Organization Views": [ ZoonkWeb.Components.Organizations.SchoolCard, ZoonkWeb.Live.Organizations.School.New, ZoonkWeb.Live.Organizations.School.Edit, ZoonkWeb.Live.Organizations.School.List, ZoonkWeb.Live.Organizations.School.View, ZoonkWeb.Live.Organizations.School.UserList ], "Content Views": [ ZoonkWeb.Live.Content.Course.New, ZoonkWeb.Live.Content.Course.Edit, ZoonkWeb.Live.Content.Course.List, ZoonkWeb.Live.Content.Course.View, ZoonkWeb.Live.Content.Course.UserList ], Home: [ ZoonkWeb.Live.Home ], Privacy: [ ZoonkWeb.Privacy, ZoonkWeb.Components.Privacy ], Mailer: [ Zoonk.Mailer ], Error: [ ZoonkWeb.ErrorHTML, ZoonkWeb.ErrorJSON ], Fixtures: [ Zoonk.Fixtures.Accounts, Zoonk.Fixtures.Content, Zoonk.Fixtures.Organizations ] ] end defp nest_modules_by_prefix do [ Zoonk.Accounts, ZoonkWeb.Components.Accounts, ZoonkWeb.Controller.Accounts, ZoonkWeb.Live.Accounts.User, Zoonk.Organizations, ZoonkWeb.Components.Organization, ZoonkWeb.Live.Organizations.School, Zoonk.Content, ZoonkWeb.Live.Content.Course, ZoonkWeb.Plugs, ZoonkWeb.Shared, ZoonkWeb.Components, Zoonk.Fixtures ] end end