erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Is rebar3_hex required in modern/recent versions of rebar3? #333

Closed joeljuca closed 6 months ago

joeljuca commented 6 months ago

While reading the docs on pkg management at rebar3.org, the subcmd hex is presented as a built-in thing instead of a separate plugin that needs to be installed before usage. I'm not very familiar with rebar3, so I'm not sure if I need to "install" rebar3_hex in my rebar3.config or if it's something that comes bundled in modern rebar3.

I'm using Erlang v25.3.2.3 and rebar3 v3.22.1, both installed through asdf.

Whichever the answer, I believe it would be great to have it stated in README.md, perhaps also describing which versions of rebar3 would require installing it manually, and which ones would bring rebar3_hex bundled in itself.

tsloughter commented 6 months ago

The rebar3_hex plugin is required for publishing packages only. Installing packages works fine without any plugin.

Agreed this should be stated clearly in the docs, it has been a source of confusion.

paulo-ferraz-oliveira commented 6 months ago

Yes, as stated by @tsloughter, rebar3_hex is not bundled (or installed) with rebar3, even in the latest version. Maybe a pull request to https://github.com/tsloughter/rebar3.org, to update the documentation, is the best option, at the moment.

In case it wasn't made clear, or you still have doubts, it suffices to do ~{deps, [rebar3_hex]}~ {project_plugins, [rebar3_hex]} in your rebar.config to have the plugin and its commands (under rebar3 hex) available for use.

tsloughter commented 6 months ago

Not in deps. You want {project_plugins, [rebar3_hex]}. for doing stuff like publishing a package.

paulo-ferraz-oliveira commented 6 months ago

Yeah, sorry, project_plugins 👍 I'll also fix it above.

joeljuca commented 6 months ago

Thanks for clarifying, @tsloughter @paulo-ferraz-oliveira!

paulo-ferraz-oliveira commented 6 months ago

Feel free to close the issue if you feel there's nothing else we can do from this repo. 👍

joeljuca commented 6 months ago

Thanks for clarifying, @tsloughter @paulo-ferraz-oliveira!

I avoided closing this issue to remember coming back here to submit a PR about it – and I got the time to do so today. :)

https://github.com/erlef/rebar3_hex/pull/334