defmodule ExkPasswd.MixProject do use Mix.Project @version "0.2.0" @source_url "https://github.com/futhr/exk_passwd" def project do [ app: :exk_passwd, version: @version, elixir: "~> 1.16", start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), # Supress consolidate_protocols warnings in dev environment consolidate_protocols: Mix.env() != :dev, # Hex package description: description(), package: package(), # Documentation name: "ExkPasswd", source_url: @source_url, homepage_url: @source_url, docs: docs(), test_coverage: [tool: ExCoveralls, minimum_coverage: 95.0], dialyzer: [ # Store PLT in priv to avoid rebuilding plt_core_path: "priv/plts", plt_file: {:no_warn, "priv/plts/exk_passwd.plt"}, # Minimal warnings - only real type errors flags: [:error_handling, :unknown], # Add test dependencies for better coverage plt_add_apps: [:mix, :ex_unit] ] ] end def application do [ extra_applications: [:crypto] ] end def cli do [ preferred_envs: [ check: :dev, coveralls: :test, "coveralls.html": :test, "coveralls.json": :test, "test.watch": :test ] ] end defp deps do [ {:statistex, "~> 1.0", only: [:dev, :test], runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.40", only: :dev, runtime: false}, {:doctest_formatter, "~> 0.4", only: :dev, runtime: false}, {:ex_check, "~> 0.16", only: [:dev], runtime: false}, {:doctor, "~> 0.23", only: :dev, runtime: false}, {:mix_audit, "~> 2.1", only: [:dev, :test], runtime: false}, {:benchee, "~> 1.5", only: :dev, runtime: false}, {:benchee_markdown, "~> 0.3", only: :dev, runtime: false}, {:excoveralls, "~> 0.18", only: :test}, {:castore, "~> 1.0", only: :test}, {:mix_test_watch, "~> 1.2", only: [:dev, :test], runtime: false}, {:git_ops, "~> 2.10", only: [:dev]} ] end defp aliases do [ # Setup setup: ["deps.get", "deps.compile", "compile"], # Testing "test.watch": ["test.watch --stale"], # Benchmarks bench: ["bench.all"], "bench.all": ["bench.password", "bench.dict", "bench.batch"], "bench.password": ["run bench/password_generation.exs"], "bench.dict": ["run bench/dictionary.exs"], "bench.batch": ["run bench/batch.exs"], # Documentation docs: ["docs --formatter html"], # Release release: ["git_ops.release"] ] end defp description do """ Secure, memorable password generation using the XKPasswd method. Combines random words with configurable transforms to create strong, easy-to-remember passwords. Zero runtime dependencies, uses only Elixir stdlib and :crypto. """ end defp package do [ files: ~w( lib priv/dict docs .formatter.exs mix.exs README.md LICENSE.md CHANGELOG.md AGENTS.md usage-rules.md ), maintainers: [ "Michael Westbay ", "Tobias Bohwalli " ], licenses: ["BSD-2-Clause"], source_url: @source_url, links: %{ "GitHub" => @source_url, "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md", "Issues" => "#{@source_url}/issues", "Original Perl" => "https://github.com/bbusschots/hsxkpasswd", "EFF Wordlist" => "https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases" } ] end defp docs do [ main: "readme", assets: %{"priv/static" => "assets"}, extras: [ "README.md": [title: "Overview"], "docs/SECURITY.md": [title: "Security"], "docs/LIVEBOOK_SETUP.md": [title: "Livebook & Benchmarking"], "notebooks/quickstart.livemd": [title: "Quick Start"], "notebooks/advanced.livemd": [title: "Advanced Usage"], "notebooks/security.livemd": [title: "Security Analysis"], "notebooks/benchmarks.livemd": [title: "Benchmarks"], "notebooks/i18n_chinese.livemd": [title: "Chinese i18n (Pinyin)"], "notebooks/i18n_japanese.livemd": [title: "Japanese i18n (Romaji)"], "notebooks/contributing.livemd": [title: "Contributing Guide (Interactive)"], "bench/output/password_generation.md": [title: "Password Generation Benchmarks"], "bench/output/dictionary.md": [title: "Dictionary Benchmarks"], "bench/output/batch.md": [title: "Batch Generation Benchmarks"], "CHANGELOG.md": [title: "Changelog"], "CONTRIBUTING.md": [title: "Contributing"], "LICENSE.md": [title: "License"] ], groups_for_modules: [ "Core API": [ ExkPasswd ], Configuration: [ ExkPasswd.Config, ExkPasswd.Config.Presets, ExkPasswd.Config.Schema, ExkPasswd.Validator ], "Password Generation": [ ExkPasswd.Password, ExkPasswd.Batch, ExkPasswd.Token, ExkPasswd.Buffer ], Transforms: [ ExkPasswd.Transform, ExkPasswd.Transform.CaseTransform, ExkPasswd.Transform.Substitution ], "Security Analysis": [ ExkPasswd.Entropy, ExkPasswd.Strength ], Utilities: [ ExkPasswd.Dictionary, ExkPasswd.Random ] ], groups_for_extras: [ "Getting Started": ~r/README|docs\/SECURITY|docs\/LIVEBOOK_SETUP/, "Interactive Tutorials": ~r/notebooks\//, "Benchmark Results": ~r/bench\/output\//, Reference: ~r/CHANGELOG|CONTRIBUTING|LICENSE/ ], source_ref: "v#{@version}", source_url: @source_url, formatters: ["html"] ] end end