defmodule SuperCache.MixProject do use Mix.Project def project do [ app: :super_cache, version: "0.8.0", elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), config_path: "config/config.exs", # Docs name: "SuperCache", source_url: "https://github.com/ohhi-vn/super_cache", homepage_url: "https://ohhi.vn", docs: docs(), description: description(), package: package(), aliases: [ tidewave: "run --no-halt -e 'Agent.start(fn -> Bandit.start_link(plug: Tidewave, port: 4000) end)'" ], 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 "A library for cache data in memory. The library uses partition storage for a can cache service a mount of requests. Support common ways like: tuple, struct, key/value, queue & stack" end defp package() do [ maintainers: ["Manh Van Vu"], licenses: ["MIT"], links: %{ "GitHub" => "https://github.com/ohhi-vn/super_cache", "About us" => "https://ohhi.vn/team" } ] 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 end