macrome-js / macrome

The in-tree build system
MIT License
7 stars 1 forks source link

CLI support for multiple projects #12

Open conartist6 opened 3 years ago

conartist6 commented 3 years ago

I've always intended to support monorepos and have built macrome in such a way that it understands that the root of a project might not be the root of the version control system.

How them should macrome run on multiple projects at once? This question is still a little thorny, but I believe the correct solution is to make multiple instances of the Macrome class in a single execution environment. We really want a single execution environment because otherwise all the code for the build system and its dependencies would have to be evaluated multiple times, which would be tremendously wasteful.

In most circumstances though the user will not want to use the programmatic API to create multiple instances though, so this should be a responsibility of the CLI. The CLI will need logic to search for (or accept configuration of) projects. Presumably something lerna-ish is advisable where a special root configuration includes details on where to look for projects. This would presumably be something like a macrome.projects.json file which could contain an array of globs for directories to be searched for projects. If I'm feeling particularly integration-happy I could also support reading this data directly from lerna.json.