moonrepo / moon

A build system and monorepo management tool for the web ecosystem, written in Rust.
https://moonrepo.dev/moon
MIT License
2.86k stars 156 forks source link

[feature] hierarchical project grouping #1499

Open rawkode opened 3 months ago

rawkode commented 3 months ago

Is your feature request related to a problem? Please describe.

In my monorepo, I have several top level projects which are each composed of many services.

Currently I need to store the ID in each moon.yml and it's very verbose, such as top-level-project-one-service-a, top-level-project-one-service-b, and so forth.

Describe the solution you'd like

I'd like to use an intermediary moon.yml to group any subsequent projects and prefix their names.

top-level-project-one
  - moon.yml (contains prefix=top-level-one)
  - service-a
    - moon.yml
  - service-b
    - moon.yml
top-level-project-two
  - moon.yml (contains prefix=top-level-one)
  - service-a
    - moon.yml
  - service-b
    - moon.yml
milesj commented 3 months ago

Nested projects are quite complicated as they require consumers to properly define inputs for all tasks so that there's no overlap. That's pretty much the reason why they aren't "built in".

rawkode commented 3 months ago

What if there was a simpler solution where workspaces could be imported into larger workspaces and prefixes where applied there?

milesj commented 3 months ago

Yeah let me think about this.