Internally, we currently have a single repository that includes several components that are part of our "Common Firmware Library." These are all pretty independent pieces of code that would make good candidates for Yotta modularization. In an ideal world, we would like to keep these all in a single repository as we have found it makes maintenance simpler.
The basic layout for the repo would probably look like this:
├── module_a
│ ├── module.json
│ ├── ...
├── module_b
│ ├── module.json
│ ├── ...
Is there a way to handle this use case today? I imagine that publishing these to the registry would be one approach, but that is unlikely to happen with these modules. In the future, a private registry might be an option for us (although I understand that is not on the immediate roadmap). Here's one idea on syntax based on how it is done in pip (https://github.com/pypa/pip/pull/1215/files):
"usefulmodule": "<anything>://somwhere.git#<tag>&subdirectory=sub"
In general, I think having keyword arguments for this URL string makes sense. This is what pip and openembedded/yocto (poky) do. Currently, there is no keyword paired with tag, so I introduced the semicolon to delimit the URL from other arguments as I imagine backwards compatability being important. I have also seen ;, ?, @ and & commonly used as delimiters as they typically do not show up in tag/version names.
This features has been requested in npm but not implemented. I see the argument against not doing it, but I think there are legitimate reasons for not requiring changes be broken out to live at the top-level of repositories.