Hex v0.20 released

· by Eric Meadows-Jönsson

Organization managed public packages

A bit more than year ago we released private packages with organizations. With it you can add members to your organization and publish private packages only accessible by the members of the organization. The private packages are published to a separate repository (hosted by hex.pm) making sure they are separate from public packages.

Now we are adding the ability to also manage public packages through your organizations. This means that a company such as Plataformatec can use Hex organizations to manage open source Hex packages just like private packages can be managed by organizations. It can also be useful for open source projects that manage multiple packages with multiple maintainers.

When you first publish a new package you will be asked if you want to own it yourself or if it should be managed by an organization you are member of. An already published package can be transferred to an organization by running mix hex.owner transfer PACKAGE ORGANIZATION.

Note that public packages managed by an organization does not change its namespace, all public packages still belong to the same global namespace, this feature is only changing the ownership of the package.

Diffing package versions

The new mix hex.package diff command shows the difference between two package versions directly in the command line. By calling mix hex.package diff decimal 1.6.0..1.7.0 you will see a diff of the two versions. See the video below for examples on how you can combine it with colordiff and less.

Diff can be a great tool for debugging as well as code auditing, for more information and documentation run mix help hex.package.

Per-project configuration

From this release you can configure Hex inside your mix project. This can for example be useful if you have some packages in a self-hosted private repository. Instead of every user of the package setting up the correct configuration you can instead this configuration to the project itself:

# mix.exs

defmodule MyApp.MixProject
  def project() do
      # ...
      hex: hex()

  defp hex() do
      api_url: "https://hex.example.com/api"

For more information about Hex configuration run mix help hex.config.

Install the latest version of Hex by running mix local.hex. The release includes a few other improvements and bug fixes, for a full list of changes check the release notes.