# `mix nbpr.releasable`
[🔗](https://github.com/jimsynz/nbpr/blob/v0.7.0/lib/mix/tasks/nbpr.releasable.ex#L1)

Diffs each package's `mix.exs` `@version` against the latest version
published to hex.pm, returning the topo-sorted list of packages that
need a fresh release tag.

    mix nbpr.releasable [--json] [--root <path>]

## Topological order

Every `:nbpr_*` package depends on `:nbpr`, so when both bump in the
same push, `:nbpr` is emitted first. Sibling deps declared via
`nbpr_dep(:nbpr_<x>, ...)` are honoured: `nbpr_tcpdump` (which depends
on `nbpr_libpcap`) lands after `nbpr_libpcap` in the output.

## Output

Without flags: human-readable lines, one per releasable.

With `--json`: a JSON array; consumed by `auto-release.yml`.

    [
      {"name":"nbpr","version":"0.1.0","tag":"nbpr-v0.1.0","hex_version":null},
      {"name":"nbpr_libpcap","version":"1.10.5","tag":"nbpr_libpcap-v1.10.5","hex_version":null}
    ]

## Flags

  * `--json` — emit a JSON array
  * `--root <path>` — workspace root (defaults to current directory)

# `compute`

```elixir
@spec compute(Path.t(), (String.t() -&gt;
                     {:ok, String.t()} | :not_found | {:error, term()})) :: [
  %{
    name: String.t(),
    version: String.t(),
    tag: String.t(),
    hex_version: String.t() | nil,
    deps: [String.t()]
  }
]
```

Computes the topo-sorted list of releasable packages.

`hex_lookup` is a 1-arity function called with each package name; it
must return `{:ok, version}` for an existing Hex package, `:not_found`
if Hex doesn't know about the package, or `{:error, reason}` for
transport failures (which abort the run).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
