Entries in the repo are currently unordered. But some entries should ideally be sorted in a specific way, especially constants:
- "bitfield" constants should be sorted by the amount of bits instead of a direct numeric comparison
- card names make more sense to be sorted by name
- archetypes should be grouped so subarchetypes stick with their main archetype
Right now, the loader simply sorts entries alphabetically after parsing, except for constants which are sorted by value. Archetype sorting is also harcoded.
A similar project, the factorio runtime docs specifies an "order" property on entries, but this approach feels cumbersome to maintain.
One idea is to use the filenames as the basis for sorting, since they're not necessarily the same as the entry name.