Proper way to handle JS dependencies in gem-based themes?

Do you all have any suggestions for including JS dependencies in a gem-based theme? I don’t want to have JS dependency source code in my repository because that’s another thing to maintain. It would great if npm or yarn could just download them on the user’s machine.