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

Showing Posts 1 to 2

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.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
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
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
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
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
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
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

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews