By walling around your entire supply with buildings, you can effectively keep your units from leaving your spawn via caging. This can work with or without a hero, but works best with a hero. There needs to be a tiny opening in the cage otherwise the units will spawn outside the cage. Holding a hero at the said opening will keep the units from spawning outside.
Here is a video showcasing a no hero cage dubbed "Chin Chin's Package":
Here is a hero cage.
It is possible to create a cage utilizing a floodgate, allowing units to defend both top or bot.
On off versions of Nexus Wars, there are bizarre iteration of the cage, creating unworldly situations.
Cages were not intended to be strategically viable.