Hello r/node.I currently am working on a client and a server app which are in different git repositories. They however do share a fair bit of code (like its data file format, and some other functions as well.)When I improve one of these shared bits of code, I'm doing it in both repositories. Of course this isn't the ideal way to work.My question is, how could I make the shared code available to both in a way that is still easy to maintain ?I thought of using either npm modules or git modules, but both have pros and cons.In my understanding, npm shouldn't be used for that as those functions, definitions and other constants would only be used by my apps anyway. Doing an update also requires some work since I'd need to test the code in the client AND the server, and then publish to npm.From what I also gathered, git modules are kind of overkill and hard to use. You can apparently get easily lost with how and if/when you need to update your submodules. For example, if I need to push a small modification to one of the modules, can I do it from my main git repository and push it to the submodule's git?I realize this is not 100% node-related, but I was curious on how you all deal with such an issue.Thanks for your replies :)
Submitted April 02, 2019 at 03:22PM by AxelTerizaki
No comments:
Post a Comment