maybe a stupid question and maybe already asked but I would like to know, how I can add a modified fork as new package to hex. Don't want to know how register with hex register and hex publish. Just want to know which changes I have to make.
I forked an original repo repo to my fork.
I changed the link from a string to json, to allow easy parsing in web clients and added a configuration, what was aksed for in an issue at github. Now I want to use my repo as a hex package, but have no idea, what I need to change in the mix.ex file and maybe other files. I want to keep the MIT stuff, but need to rename something to use it as hex package. Never created a hex package before. wanted to rename it as scrivener-headers-json, but as a java/chsarp developer which is used to use maven/nuget I have no idea. Maybe someone could help me a bit and could show me how I could change the needed stuff to make this lib work with hex as a new package, keeping the MIT from the creator and add my custom code.
The way that is widely accepted in OS community would be to provide a pull request to the original repo to share your work with other users if it makes sense.
If you just need your own additional functionality that barely would be used by anybody else, the only thing you need to update in your main project mix.exs
file, where instead of original
defp deps do
[{:scrivener_headers, "~> 3.1"}]
end
you put
defp deps do
[{:scrivener_headers,
git: "https://github.com/Sardoan/scrivener_headers"}]
end
There could be the only reason you might want to publish the new version to hex
: the original version is not maintained anymore and the maintainer is not reachable. Then you change the name of the package (and the name of the main module.) That would be enough.
This has many caveats though: future users will discover two versions of essentially the same gem, they will struggle to choose between, there will be a mess and therefore this is strongly discouraged by the community unless a bullet-proof reason to do so despite all the consequences exists.