Context:
We're creating a new solution consisting of multiple app portals (for lack of a better term), each portal will need to leverage off of a base project that will already include some of my employed proprietary code, as well as any new features pertaining to that portal. Our current app leaves much to be desired, and as we're getting a fresh start, we'd like to go at it the right way. (Thus I'd like to rubberduck my thoughts somewhat)
I've thought of a few possible ways to solve this. Each with it's pro' and cons.
1. GIT Fork A Base Project:
This seems like the most straight forward way. Have a PortalCore project, then have each project fork it in a downstream only fashion.
The flow would be:
Fork PortalCore > Core will be kept up to date via updating via GIT master
2. Base Project NPM Package:
This seems like an ideal route, as with each deployment the latest version of our base package/project will be installed with each portal.
npm
package install outside of the npm folder (this pertains to my question). We'll need to share the build file via some other means if we want it to sit in the project root.The flow would be:
New Project > Add Portal Core npm > Make custom build task, or grab from some central repo > Will be kept up to date via npm install > Gulp Build
3. Combination of the above
Have a git project only containing our base npm
modules, & build config. The build can then handle things like moving files to the right location (example. node_modles -> root)
The flow would be:
Fork PortalCore > Core will be kept up to date via
npm
install > Gulp Build
npm
package (or another package manager) install files to a specific location? (I have checked the npm
forum, and this seems like a dead end. But I thought I'd try my luck here) The answer to this ended up being much simpler than I expected:
Put all shared services in separate common NPM packages (common components,shared / common services, etc.)
And create a few yeoman generators that assists with initial project initialisation. (The only drawback is someone needs to maintain them, should some new core dependency come along... but such is dev life.)