Can I develop independent Composer projects that share dependencies (same package+version) without having multiple copies of each reused dependency on my computer? That's the concrete question. But I'm a novice at package managers (though I know PHP fairly well), so in case I asked the wrong question, the abstract question/real scenario that prompted it is below.
Disambiguation
Very similar questions have been asked and answered a number of times. Here's what I'm not asking:
I am not questioning the core Composer assumption that it manages packages for a single project.
I am not coordinating multiple related projects that share dependencies by design. These are independent projects.
I do not want to change the way local and production environments are coordinated.
I am not asking about managing packages, but rather managing files from a package manager.
I am not using two versions of the same package in a single project, though a different project might use a different version.
I am not mixing custom local packages with public Packagist packages.
I am not optimizing downloads; but rather storage and uploads.
What problem would it solve?
I prefer to use cloud storage, version control, and package managers simultaneously. Git and package managers of course coordinate well. I've been using git and OneDrive together for a while, and while the coordination isn't perfect, it's worked. I regularly perform wide-ranging refactors by hand, so I often have a large number of uncommitted modifications for a while as I find and test the best refactoring strategy. OneDrive backs up the current state, git tracks the history, and GitHub adds redundancy and coordination to the history. Because I usually only change one file at a time, OneDrive was handling the sync burden acceptably before I added Composer. Now it chokes when I add/change a package. That makes sense, since many packages add large numbers of files, and each file requires its own sync record. But of course I don't actually need those package-managed files synced.
I can imagine a way to have it all, where each project is a normal Composer project, but my local Composer installs package versions to a global location and puts pointers in the project to the versions of packages actually in use. Then my cloud storage would sync my current working files and symlinks but none of the package-managed files behind the symlinks, other devs could still clone from GitHub without cloning my symlinks, and local storage could be efficient across packages. But managing symlinks and versions by hand sounds tedious and error-prone.