Using bug fixes in a public dependency

My app depends on a public, open source library. There was a bug in the library, so I have forked it, fixed it and submitted a PR. This being open source, it can take a long time before the fix gets merged (and I’m perfectly OK with that). How can I use my fixed version of the lib in the meantime?

I think this is the “private package” issue discussed before. I’ve tried looking at elm-git-install, but that doesn’t seem to follow the lib’s dependencies and I’m really not going to solve the dependency graph by hand. Is there a reasonable option that would solve this use case?

1 Like

They are usually two solutions:

  1. Put the forked package in your sources, and add its src subdirectory in the source-directories of your application elm.json. Then elm install each dependency present in the package elm.json dependencies field. You could also use elm-json to install them all at once, for example:
$ cat path/to/forked/pkg/elm.json | jq -r '.dependencies | keys[]' | xargs elm-json install
  1. Publish the forked package and use it. I’m not fond of this method as this makes hard for new users to known which package to use, but this could sometimes be preferable once a package does not seem maintained anymore.
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.