Phase engineering of two-dimensional transition metal dichalcogenides