prismicio / prismic-ts-codegen

A Prismic model-to-TypeScript-type generator.
Apache License 2.0
18 stars 6 forks source link

Sort types and fields consistently between generations #49

Open angeloashmore opened 1 year ago

angeloashmore commented 1 year ago

Is your feature request related to a problem? Please describe.

Deltas between generated files may be reduced by sorting all types and fields in a consistent manner.

Describe the solution you'd like

Type and their properties could be sorted alphabetically.

Describe alternatives you've considered

N/A

Additional context

N/A

lihbr commented 1 year ago

We could also suggest treating the file as a binary in .gitattributes: https://github.com/prismicio/prismic-client/blob/master/.gitattributes#L4-L6

angeloashmore commented 1 year ago

I sometimes like to look at the diff to see the full effects of a change, but that could be a good strategy for most users.