bettio
Monolithic Repo and Multiple Packages - how to avoid having 100 git repos for 100 packages?
Let me introduce the context before of my questions.
In order to support some new kind of hardware in AtomVM, a driver should be written first.
It basically means writing an Elixir/Erlang module for managing that device.
E.g. In order to support lora radio chip “sx126x” I did a module called Sx126XDriver, same thing for “bq25896” power management chip and so on.
Most of the times I end having 1 driver = 1 module.
Then I would like to make some packages, it would be nice having a package for each single driver, so when I build a new project I don’t have to pull drivers for devices I don’t have.
How can I avoid having 100 git repos for 100 packages?
What I was thinking about is:
a) When dependency is on git:
- mix.exs deps: use
sparseoption when package is on git, e.g.:sparse: “apps/sx126x_driver”(should I use apps as a container directory?) - rebar3 deps: use
git_subdir
b) Otherwise on hex: just use regular hex packages, use CI for publishing in a automated way packages to hex.
- Are you aware of any relevant issue with such a similar workflow?
- Do you have any suggestion for doing this in the best way?
- Do you have any suggestion for providing the best possible developer experience to package users?
- Should I prefix/suffix each package with some common prefix/suffix to indicate they are comming from the same megarepo? Such as in my case: avm_drivers_sx126x, avm_drivers_bq25896, etc…
Otherwise do you have any opinion against a similar pattern?
@Nerves folks: did you have any similar experience?
I’m looking forward opinions about this approach.
Most Liked
mat-hek
How about keeping all drivers in a single package and enabling/disabling them in config.exs? There’s always some maintenance burden with that many packages, even if you automate releases.
rhcarvalho
You can also use depth: 1 to avoid downloading the full repo history in case there are heavy binaries.
I’d say up to you, but once people start depending on the directory structure it’s better not to change it.
This may help with discoverability, but there are other ways to deal with that too, like cross linking, or new features in ExDoc supporting cross package search.
bettio
git subtree would keep the main complexity I would like to avoid: having an excessive number of git repos.
Also, personal opinion here: git subtree introduces additional friction during development.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









