Hey folks,
I’m juggling four Vue.js projects in different repos and it’s a pain keeping the dependencies in sync. I’m looking for a simple way to handle this without going crazy with custom scripts.
Here’s what I’m after:
- A master list of dependencies and versions
- Each project picks what it needs from the list
- Option to use different versions if needed
- Works smoothly with npm install
- Plays nice with separate repos (not monorepo)
- Something that fits with npm if possible
I’ve looked at npm Workspaces, Yarn, pnpm, Renovate, and Nx, but they’re not quite right for various reasons.
Anyone know of a tool or npm trick that can do this? Ideally something light that won’t mess up my workflow. Thanks!
hey man, i feel ur pain. have u tried lerna? it’s pretty neat for managing multiple packages. u can keep ur projects separate but still share dependencies. it’s not too hard to set up and works with npm. might be worth checkin out. just my 2 cents!
I’ve been in a similar situation managing multiple Vue projects and found that using a combination of npm-check-updates and a custom package.json script can really help. In my case, I created a master package.json that contains all the shared dependencies and then developed a simple Node script to synchronize this master list with each project’s own package.json. The script reads the master file, compares it with the project files, and updates only the shared dependencies. When I needed a different version for a specific project, I simply overrode it in the project-specific package.json. This approach is lightweight, works well with separate repositories, and integrates seamlessly with npm install.
Have you considered using a private npm package for managing shared dependencies? I’ve found this approach quite effective.
Create a separate repo for a package containing your common dependencies, publish it to a private npm registry (or use npm’s package scope feature), and include it in each project’s package.json. This way, you can centralize version management and easily update across all projects by bumping the version of your shared package. It’s lightweight, works with npm, and doesn’t require changing your workflow much. The downside is a bit more setup initially, but it pays off in the long run. You can even include shared configs or utility functions in this package if needed. Just remember to keep your package-lock.json files updated in each project to maintain consistency.