wojtekmach

wojtekmach

Hex Core Team

Today we are releasing the first version of hex_core, an Erlang library to interact with Hex.pm and other servers implementing Hex specifications.

Before talking about hex_core, let’s ask a simple question: What is Hex? The short answer is, it’s a package manager for the Erlang ecosystem. The long answer is that by Hex we may mean a few different things:

  1. A set of specifications of building clients and servers that can interact with each other: https://github.com/hexpm/specifications
  2. A server for hosting packages like the official server located at https://hex.pm
  3. Clients for interacting with servers, e.g. Hex for Elixir and rebar3_hex for Erlang projects

The goal of hex_core is to be the reference implementation of Hex specifications used by Hex clients and servers.

As of this announcement the hex_core package itself is available on Hex.pm.

Usage in an Erlang project

  1. Create a new project: rebar3 new lib example

  2. Add hex_core to rebar.config:

    {deps, [
      {hex_core, "0.1.0"}
    ]}
    
  3. Start the shell to and count all packages published to Hex.pm:

    $ rebar3 shell
    erl> inets:start(), ssl:start(),
    erl> Config = hex_core:default_config(),
    erl> {ok, {200, _, #{packages := Packages}}} = hex_repo:get_names(Config),
    erl> length(Packages).
    6764
    

Usage in an Elixir project

  1. Create a new project: mix new example

  2. Add hex_core to mix.exs:

    defp deps() do
      [{:hex_core, "~> 0.1"}]
    end
    
  3. Start the shell to and search for all packages matching query “riak”:

    $ iex -S mix
    iex> :inets.start() ; :ssl.start()
    iex> config = :hex_core.default_config()
    iex> options = [sort: :downloads]
    iex> {:ok, {200, _, packages}} = :hex_api_package.search(config, "riak", options)
    iex> Enum.map(packages, & &1["name"])
    ["riak_pb", "riakc", ...]
    

See README at https://github.com/hexpm/hex_core for more usage examples.

Future work

After the initial release we plan to work with the community to integrate hex_core into their projects and respond to feedback.

We will also be focused on releasing a minimal Hex server, built on top of hex_core, to be a starting point for people wanting to run Hex on their own infrastructure. Stay tuned!

Link to original announcement: Announcing hex core | Hex

Most Liked

aseigo

aseigo

w00t! Already using it in hexagon. Not a big fan of the API exposing the http details so directly (response codes and raw headers) as I feel it exposes implementation details too directly, but other than that small niggle it’s been a pleasure to use. Kudos to the hex devs! :slight_smile:

wojtekmach

wojtekmach OP

Hex Core Team

Hexagon is exactly the kind of project we wanted people to build with hex_core, thanks again for that! I’ve created an issue to discuss the API: High-level API · Issue #32 · hexpm/hex_core · GitHub.

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New

Other Trending Topics Top

mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
lawik
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./ The firs...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews