hexpm / hex_core

Reference implementation of Hex specifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Theoretical new hex library for sharing command logic between hex and rebar3_hex

starbelly opened this issue · comments

Discuss the possibility of a new hex library to share command logic, such as hex.outdated, between hex, rebar3_hex, and hex related libraries and/or plugins. This requires enumerating the differences between the two as is and enumerating what's missing from rebar3_hex and other hex related libraries where it might be beneficial to share code between projects in particularly where it's the logic is a bit complicated, but also with the idea that getting new commands into plugins such as rebar3_hex in a more expedient fashion.

Potentials items that could belong to such a lib :

  • prompts / prompt logic : (i.e., prompting for usernames, passwords, etc.) This already pretty much the same, hex and rebar3_hex also use the exact same implementation for getting passwords.

  • error formatters : this one is a bit eh, but I can tell you as part of a PR I'll be opening for rebar3_hex soon, it will have the same implementation for formatting generic errors from hex.

  • crypto - this one perhaps makes the most sense to share

Any ideas on how this would be implemented regarding the differences between the environments we run in, mix and rebar? Prompts and error output works differently in the two build tools so I am not sure how logic could be shared.

@ericmj sorry, I just moved this issue. Let's take it over there.