If not? It depends.
Are you already using NPM? Do you have access to an internal NPM packet server? Have you ever used GIT directly for NPM dependencies at home?
- Yes, then do not break the mold. Follow your current pattern.
- No. Then you should consider how you are going to do this.
Technically, NPM supports GIT repositories as packages. However, compatibility with GIT is often interrupted or incomplete compared to an NPM packet server.
NPM Package Servers are not trivial to install, configure or maintain. How do you intend to support them?
If you do not want to trust NPM, then your options are:
- git checkout to a subdirectory.
- Copy the package to a local directory and update it manually.
Neither of the two solutions is great. I favor the second only because git's hierarchical checks can be problematic.
However, manual solution requires diligence, especially if there is an implicit link here. Like all projects that need the same appearance, or the communications layer must be identical between projects.
Consider breaking down the shared components further so that only the shared functionality actually required is shared.
As they would in the main repository of the project.
- Make changes
- Make extraction request
Of course, you must have the diligence, testing and automation to verify / update the subsequent dependencies (or notify the needs / problems).