maltejur / directus-extension-generate-types

Create types for your directus project in your favourite language.
Other
199 stars 24 forks source link

Sort properties on collection types alphabetically #16

Closed badrange closed 1 year ago

badrange commented 1 year ago

In our project we often get diffs where the order of properties on a collection type changes in the type file when a developer adds new types to the Directus schema.

I'm not sure what causes it, it could be that different developers have different orders of creation of fields in their database or something else.

I think it would be great if the properties on each collection type would be sorted alphabetically, that way we'd see fewer changes after updates and reduce the risk of merge conflicts if several people would add new fields to directus/new properties to the collection types.

maltejur commented 1 year ago

Fixed in https://github.com/maltejur/directus-extension-generate-types/commit/f02c82f25acb2cd10aa7a1d4a5829482fcf23517

badrange commented 1 year ago

Thank you for this fix, it will be very helpful to all teams using this extension!