Some intentionally publish sources for audit and compatibility purpose, still proprietary though.
I'm really surprised more companies don't do this... Simply make the whole code repo public on github, but don't give any license to allow anyone else to use it.
You get 90% of the kudos for being opensource-friendly, while no serious sized company can just clone your code and steal all your business.
Is this the future OSS enthusiasts want?! * shakes fist *