This may be a bit complicated to follow but I'll do my best. I have a series of API modules that I'm using with Browserify, and some of them call other modules as well. They are pretty much interwoven, which is going to make updates difficult.
For example, let's say I have five modules: A, B, C, D, and E. A is required by B and C, and B is required by C, D, and E. If I need to make some updates to A that are breaking changes, I could version it, but then I need to update the require statements in B and C. And since B is now using a different version of A, I need to version B as well, which means changing the require statements in C, D, and E. So a single change in one module means I have to reversion everything else.
I should note that the main reason for this is that I have to keep old versions around. These are small microsites, and one site might get built with A - E and the next might get built with A' - E', but I still need to be able to build both independently. Even though the change to A' may not have an effect on the API it exposes, I have no desire to have to go back and re-test every single project ever built with each single file modification.
I thought about having a separate per-project file that could be required in and it then requires all of the versioned modules for that project, but that's a circular dependency.
If it matters, I'm using Gulp and Browserify to build the final JS file.
I found something that would do the trick: aliasify
I changed my require statements to require('Api/ModuleA')
and then in the aliasify config I map Api/ModuleA
to ./libs/Api/ModuleA-1.0
and it picks up the version I want every time it requires Module A.