mateodelnorte / meta

tool for turning many repos into a meta repo. why choose many repos or a monolithic repo, when you can have both with a meta repo?
MIT License
2.03k stars 95 forks source link

Using commander's arguments/options and improve filtering capability of meta #280

Closed klarkent closed 2 years ago

klarkent commented 2 years ago

🤓 Question 1

Hello Mateo and Patrick, I introduced meta in the company I work for some time ago. I liked the idea of a monorepo with all the projects having a separate git project. I have been looking for ways to improve the productivity here and I've been struggling a bit with meta as I can do something with ALL the projects but not with some of them (easily, that is). I wanted to introduce some way of filtering and I started looking around at the code and I quickly noticed that a lot of the args and options are parsed manually from the process.argv array. I already prepared changes locally to replace those with the commander-way. So the first question is: is there a particular reason why the parsing has been done manually?

🤓🤓 Question 2

The second question is about the possibility of filtering the projects being worked on.

Use case

I want to update all projects that have a specific version of a dependency (or just a random fixed list of them) and perform several commands, for example:

I have accomplished all this writing a script most of the time, but recently meta search appeared and I immediately saw the opportunity of joining that plugin with my needs here. Also, the method I used is very error-prone and passing --exclude or --exclude-only with every command quickly becomes annoying. My first idea was to use the .ignore property in the .meta or .looprc files but to my surprise, both are completely ignored by meta and I found some places where the options to exclude/include files or directories is even actively removed 😢

After looking at the code, I noticed that the list of folders that every plugin works on is taken from the projects property on the .meta file. It would be easy to introduce some filtering logic there but there would be so many options and I wanted to check with you guys to see which (if any) you would prefer. My ideas:

Sorry for the super lengthy post.