Writes ports before components.