Crowdhailer

Crowdhailer

Creator of Raxx

Opinions on using MonoRepos for library code?

I’m considering using a single Github repository that will contain the code for more than one mix project, where each mix project is hosted on hex. I think it is a good idea for my usecase but wondered if there were any negatives I had not considered. Rather than discuss my usecase which is a project very much under development It might be easier to explain in the context of a more established project such as ex_aws.

Currently ex_aws has a single lib directory in which there is the code for iteration with many amazon services such as SNS S3 EC2. If following SemVer then a breaking change to any one of these pieces of functionality will require a major version change. However the majority of users are probably only using a fraction of the services available.

What would be the benefits/costs of changing to the following structure?

ex_aws (repo root)
-- ex_aws_s3 (individual mix project)
---- lib
------ s3
---- mix.exs
-- ex_aws_ec2 (another individual mix project)
---- lib
------ ec2
---- mix.exs

In this case a breaking change to ex_aws_ec2 could be released to hex without changing anything about ex_aws_s3.
In addition keeping them all together allows a single readme etc for documentation about the whole project.

For those whole are familiar I think I am looking for a way to implement something similar to the features feature available in the Rust ecosystem

First Post!

michalmuskala

michalmuskala

Hex doesn’t really care if the project is in source control at all. When publishing you’d cd into the appropriate directory project and run mix hex.publish from there. Other than that I believe it should “Just Work™”.

Most Liked

Gazler

Gazler

Phoenix Core Team

This is coming in 1.4 with sparse checkouts.

Search for “sparse” on deps – Mix v1.4.5

  [{:somedep, github: "someuser/somedep", sparse: "some/nested/dir"}]
benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

It’s likely not actually relevant to the overall point of the post, but the argument against breaking up ExAws is:

  • Breaking changes are incredibly rare, because breaking changes with the AWS API are incredibly rare.
  • Quite a bit of code is shared across services, because most service modules are just nice ways of creating one of only a handful of operation structs.

Last Post!

CharlesO

CharlesO

Kindly include an example in the documentation for this :sparse option.

Where Next?

Popular in Discussions Top

mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19814 150
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement