fix(generator): write files in sorted order for predictable tests