amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.93k stars 557 forks source link

Token output sort order casing bug #937

Open withinsight opened 1 year ago

withinsight commented 1 year ago

I'm experiencing an odd behavior with the sort order of token output.

When I have the top-level JSON source as uppercase, if I change to lowercase, the output sort order changes (it should not).

For example, if I change this JSON:

uppercase

to this:

lowercase

and then build Style Dictionary, it changes the sort order in the token output apparently randomly:

big-diff

Further, if I prefix the lowercased source JSON with numbers, it retains the proper sort order in the output, for example:

numbers
withinsight commented 1 year ago

The token output should retain the sort order from the source JSON, right?

mryechkin commented 1 year ago

@withinsight you would think so, but it doesn't sound like it: https://github.com/amzn/style-dictionary/issues/777#issuecomment-1040851259