amzn / style-dictionary

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

Unexpected collision log #1316

Open TrevorRice opened 3 months ago

TrevorRice commented 3 months ago

As discussed in #1308, the following two files:

// colors-1.json
{
  "colors": {
    "$type": "color",
    "black": { "$value": "#000000" }
  }
}
// colors-2.json
{
  "colors": {
    "$type": "color",
    "white": { "$value": "#ffffff" }
  }
}

Result in the following console log despite the tokens being generated correctly:

Token collisions detected (1):

Collision detected at: colors! Original value: color, New value: color

This can be demonstrated in this minimally reproducible example.

Removing "$type": "color" from one or both of the files resolves the collision logging issue.

jorenbroekema commented 2 months ago

Confirmed bug: https://github.com/amzn/style-dictionary/blob/main/lib/utils/deepExtend.js#L93 here somewhere