I’m writing a collection of LiveView components, and have a couple of Phoenix demo apps that show the components in use.
For development and test, I’ve organized the LV components and Phx demos into separate umbrella apps in a single repo.
When it comes time to distribute the LV components as a hex package, would it be possible to publish just the component subapp to hex.pm? If so, how? Would I just run
mix hex.publish out of the subapp root?
If it is not possible to publish a Hex Package from an Umbrella Subapp, no worries. It’s simple enough to break out the LV components into a separate repo if necessary. Any feedback welcome.
It is possible, check GitHub - straw-hat-team/beam-monorepo
Some things to pay attention to:
- Fix Doc links beam-monorepo/mix.exs at 6edd32c540ef649e6a48c6c1bde5d57ee4f4dfc8 · straw-hat-team/beam-monorepo · GitHub
- Publishing using GitHub Actions is a bit trickier beam-monorepo/cd.yml at 6edd32c540ef649e6a48c6c1bde5d57ee4f4dfc8 · straw-hat-team/beam-monorepo · GitHub learn more about it here: github-actions-workflows/elixir/umbrella-publish at master · straw-hat-team/github-actions-workflows · GitHub
What is missing?
During the test, if one package depends on another one, you will require to swap the dependency definition in your
mix. exs file (I haven’t done it or tested it) because during test or development you will require the dependency to be
in_umbrella while publishing it will be a regular dependency.
I hope it helps you, please share back the experience.