Packages

Locale-aware and script-aware URL slugs. German ö→oe, Estonian ö→o, Ukrainian Київ→kyiv. Cyrillic and Greek romanization from cited national standards. Pure Elixir, no NIF, zero dependencies.

Current section

Files

Jump to
Raw

mix.exs

defmodule LocaleSlug.MixProject do
use Mix.Project
@version "0.2.0"
@description "Locale-aware and script-aware URL slugs. German ö→oe, Estonian ö→o, Ukrainian Київ→kyiv. Cyrillic and Greek romanization from cited national standards. Pure Elixir, no NIF, zero dependencies."
@source_url "https://github.com/mdon/locale_slug"
def project do
[
app: :locale_slug,
version: @version,
description: @description,
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
docs: docs(),
aliases: aliases(),
name: "LocaleSlug",
source_url: @source_url
]
end
defp aliases do
[
precommit: [
"format",
"compile --warnings-as-errors --force",
"credo --strict",
"test"
]
]
end
def application do
[extra_applications: [:logger]]
end
def cli do
[preferred_envs: [precommit: :test]]
end
defp elixirc_paths(_), do: ["lib"]
# yamerl is DEV-ONLY on purpose. The YAML tables under priv/ are the contributor
# surface, but they are compiled to lib/locale_slug/generated_tables.ex by
# `mix locale_slug.gen`, and that file is committed. So a consumer of this package
# gets pure Elixir with ZERO dependencies and no YAML parsing at their build time.
# test/generated_tables_test.exs fails if the committed file drifts from the YAML.
defp deps do
[
{:yamerl, "~> 0.10", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end
defp package do
[
name: "locale_slug",
maintainers: ["mdon"],
licenses: ["MIT"],
links: %{"GitHub" => @source_url},
files: ~w(lib priv .formatter.exs mix.exs README.md LICENSE CHANGELOG.md NOTICE)
]
end
defp docs do
[
main: "LocaleSlug",
source_ref: "v#{@version}",
extras: ["README.md", "CHANGELOG.md"]
]
end
end