I am in the process of planning out a base system I will be using for dozens of projects. There will be a lot of reused code like galleries, user permission systems, page editing, etc. I would like to make it as easy as possible to keep code up to date across apps in the case that e.g. I find a bug in the gallery module.
My current thoughts are to have an npm package with the files and then manually create skeleton files inside Sails' folders. e.g. api/models/Gallery.js would essentially be require('nicsgallery/model').
This feels really hacky, and having to add in files manually on install doesn't sound great, but this would mean the actual code is under control of npm and an npm update across all apps would keep everything fresh.
If anyone has any experience trying to tackle this, or any thoughts, I'd love to hear them.