5

I have multiple projects with multiple dependencies. Some of the projects share dependencies, so we have started using git versioning to allow us to update dependencies without breaking other projects.

I might have a structure like this:

Project A
   |
    ---> Dep B version 1.0.0

Project C
   |
    ---> Dep B version 2.0.0

Currently, we have our projects checked out in a single folder, then we use Zelda or NPM link to wire the dependencies into the correct node modules, so in my projects folder, I would have:

projects
  | dep_b
  | project_a 
  | project_c

Each folder is a git repo. Project A and C would look in their parent folder to find Dep B.

Up until we started using versioning, this worked just fine. However now, we have multiple versions of each dependency, and not all versions of the dependency are compatible with all the projects. I can't find an easy way to wire the correct checked-out version into the correct project.

Is there tooling that will help manage this?

Whymarrh
  • 13,139
  • 14
  • 57
  • 108
superluminary
  • 47,086
  • 25
  • 151
  • 148
  • 1
    How exactly are you managing the dependency's version in the projects? It's not clear for me from the question. Are you using `npm`? `git submodules`? – Sascha Wolf Jan 08 '19 at 12:27
  • 1
    @SaschaWolf - Straight up npm. We have a folder full of checked out git repositories, we `npm i` in each repo, then we link with `zelda ..` or `npm link`. – superluminary Jan 08 '19 at 14:41
  • What does the `package.json` file for a project look like? You can use git commits/tags with npm and each package can depend on a different version—how are you managing that now? – Whymarrh Jan 11 '19 at 18:29
  • This is one of the main uses for git submodules, one of the most common and befuddling complaints about git submodules is, you when you do `git submodule update` you get the exact committed version and not some different version. – jthill Jan 11 '19 at 19:16
  • “not all versions of the dependency are compatible with all the projects” - well, that’s a problem and sounds like versioning might not be used correctly. Any shared internal dep library builds can be pushed to a local NPM. Code that uses such does so with standard versioning, which must follow the major/minor/etc rules. Each consuming project establishes it’s own dependencies. – user2864740 Jan 11 '19 at 21:42

0 Answers0