I have a small monorepo with a few projects (they share the same data stores, so it's easier to have them together in a monorepo for development and testing). Each project is in its own folder, with its own package.json. Each project is meant to be deployed on its own (independent of the other projects).
I would like to share some code between the projects. I want to maintain their relative independence, so I'd rather not have to create a "build" step in the root repo folder, as well as having each project's own build step. Ideally deployment of each project would continue to be done in the project's folder, without it needing to know about other projects.
I know I could create an npm module in the repo and npm link to it from each project. This is the solution I'm leaning toward. But I'm wondering if anyone has a better idea.
Here's an example of what the directory structure kinda looks like:
/package.json
/docker-compose.yml
/project-1/package.json
/project-2/package.json
If I went with the npm link solution, I would add something like a project-shared folder and link to it from project-1 and project-2.