1

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)

enter image description here

enter image description here

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.

  • Con: If the base changes, we'll need to manually update all of the dependant projects.
  • Pro: Easier to implement initially, and I believe will reduce some of the other more "laborious" tasks. (Example, single build file that will travel with each new portal with our build requirements.)

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.

  • Con: From my research it seems like we're not able to have a 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.
  • Pro: Updates automatically rolled out with the build process

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


Questions:
  1. Is there a way to have an 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)
  2. Are we frankensteining it? We don't want to create a new monster. Does this logic make sense ITO creating something that should be somewhat modular by design, but allows for easier maintenance. How do the big boys do this... if they do this?
Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106

1 Answers1

0

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.)

Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106