Personally, I wouldn’t take npm’s trend of single-function libraries as a virtuous example, quite the opposite in fact, as the
left-pad incident showed! What you need to consider is how much common code exists between the apps that could go into the library. I wouldn’t put UI code into the lib, because that would probably need to change independently from one app to the other. Surely I would group together common logic, configuration and utilities, pretty much anything you have duplicated between the code bases and think it could be shared. Keep in mind that you’re creating a lib specific to your apps, so you don’t need to design it for a general usage, like Guava for example.