IANAL but I think it would depend on how such income is categorized. If it is considered as contract work, then no you can't. You can only legally work for your employer who is sponsoring your visa.
I agree with DarmokJalad1701, it's not worth risking it
This is exactly my status too right now. I contribute to opensource here and there but apart from that its mostly hacking away at my own libraries, some of which are mildly popular (600stars)
yes, a 100% they can. look at the payouts of nodeJS or Nuxt or VueJS developers - and rightly so. Top contributors who fix a lot of bugs get payouts of 10,000+ USD every month.