Sometimes I find monorepo on GitHub that consists of multiple npm packages, which I would like to make some modification and use it in my projects. But it's much harder for npm to install package from a git subdirectory than to install from a git repository[1][2]. Since I would make my own modification, I wonder how can I set up my own git repository so that it is easy for npm to install, and for me to merge upstream changes.
Currently, I used this guide from GitHub to split the package from the rest of the monorepo, i.e.
git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME BRANCH-NAME
Npm can install the repo easily, but I find it difficult to merge any upstream change.
Has anyone done this before? Any idea?