move generation to prepublish