107 lines
3.0 KiB
Elixir
107 lines
3.0 KiB
Elixir
defmodule Blogex.MixProject do
|
|
use Mix.Project
|
|
|
|
@version "0.1.0"
|
|
@source_url "https://github.com/yourorg/blogex"
|
|
|
|
def project do
|
|
[
|
|
app: :blogex,
|
|
version: @version,
|
|
elixir: "~> 1.15",
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
|
start_permanent: Mix.env() == :prod,
|
|
aliases: aliases(),
|
|
deps: deps(),
|
|
test_coverage: test_coverage(),
|
|
docs: docs(),
|
|
package: package(),
|
|
description: "A multi-blog engine powered by NimblePublisher for Phoenix apps"
|
|
]
|
|
end
|
|
|
|
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
|
defp elixirc_paths(_), do: ["lib"]
|
|
|
|
def application do
|
|
[
|
|
extra_applications: [:logger]
|
|
]
|
|
end
|
|
|
|
def cli do
|
|
[
|
|
preferred_envs: [precommit: :test]
|
|
]
|
|
end
|
|
|
|
defp deps do
|
|
[
|
|
{:nimble_publisher, "~> 2.0"},
|
|
{:floki, "~> 0.38"},
|
|
{:makeup_elixir, ">= 0.0.0"},
|
|
{:makeup_erlang, ">= 0.0.0"},
|
|
{:phoenix, "~> 1.7"},
|
|
{:phoenix_html, "~> 4.0"},
|
|
{:phoenix_live_view, "~> 1.0"},
|
|
{:jason, "~> 1.4"},
|
|
{:plug, "~> 1.15"},
|
|
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
|
|
{:rustler, "~> 0.38.0", optional: true},
|
|
{:ex_crap, "~> 0.1.1", only: [:dev, :test], runtime: false}
|
|
]
|
|
end
|
|
|
|
# The coverage floor the Lens pass enforces (`make verify` -> `make coverage`
|
|
# in blogex/). Rule: the threshold is a FLOOR. Raise it as behavior-test yaks
|
|
# land; never lower it. A drop means the change (or an exclusion) is wrong.
|
|
#
|
|
# Measured 2026-10-28, with the test scaffolding below excluded: 78.59% — the
|
|
# same via `mix test --cover` and via `mix test --cover --export-coverage
|
|
# default` + `mix test.coverage`. Floor is the integer below that.
|
|
#
|
|
# Excluded: the test scaffolding in `ignore_modules` below. The two registry
|
|
# blog doubles (Blogex.Test.AlphaBlog/BetaBlog) are deliberately not listed
|
|
# there: they are fully exercised, and excluding them measures 78.06% — the
|
|
# 78 floor holds either way.
|
|
#
|
|
# Everything in lib/blogex counts, and today's gaps are real:
|
|
# Blogex.Components and Blogex.Layout are at 0% because the router tests only
|
|
# exercise the JSON responses — covering the rendered HTML is its own yak.
|
|
# Blogex.Router (72.06%) still has its HTML arms and `match _` uncovered.
|
|
defp test_coverage do
|
|
[
|
|
summary: [threshold: 78],
|
|
ignore_modules: [
|
|
Blogex.Test.FakeBlog,
|
|
Blogex.Test.PostBuilder,
|
|
Blogex.Test.Setup
|
|
]
|
|
]
|
|
end
|
|
|
|
defp docs do
|
|
[
|
|
main: "readme",
|
|
source_url: @source_url,
|
|
extras: ["README.md"]
|
|
]
|
|
end
|
|
|
|
# Same `precommit` alias name and shape as app/mix.exs, so both apps share
|
|
# one loop: compile (warnings fatal), format, test. Heavy sensors belong in
|
|
# the Lens pass (`make verify`), not here.
|
|
defp aliases do
|
|
[
|
|
precommit: ["compile --warning-as-errors", "format", "test"]
|
|
]
|
|
end
|
|
|
|
defp package do
|
|
[
|
|
licenses: ["MIT"],
|
|
links: %{"GitHub" => @source_url}
|
|
]
|
|
end
|
|
end
|