The way we have things setup, we are pretty much the "multi-brand multi-platform" example. Since we have lot of overriding (we use the same core tokens, but change the color palette to create different themes seen here), the collision warnings tend to take over the log during builds, etc.
I did not see an option to initially silence them, so I wanted to reach out before taking next steps.
I thought there was... but I am wrong. We have a config option, that is currently not documented but should be, of log. You can set it in your config like this:
{
"source": ["properties/**/*.json"],
"log": "error"
}
Although, right now it won't do what you want because the only values that would change the behavior would be to set it to 'error' in which case collision detections would fail the build. Which is the opposite of what you want.. But I think we should add a level below the default, which will not show any warnings. I can see if I can get to adding that for the next release, which should be soon? Or if you want to take a stab at it, here is the line where we add collision warnings:
https://github.com/amzn/style-dictionary/blob/master/lib/extend.js#L119
Another way you could do it is to use the include option, which is rarely used, but was meant to be for if you have a style dictionary depend on another style dictionary. Collisions between include and source do not show a warning. A fair warning, include is a bit broken right now, but will be fixed in the next release to function the same as source. Here is the PR that fixed that: #227
P.S. Super cool to see the multi-brand multi-platform setup. Excellent work!
@dbanksdesign Thanks for the response! We'll take a look at include and #227. If I find a few spare moments, I might see if I can poke around with the warning levels.
We decided to go with include seeing that the fix was just released and it worked as suggested. Thanks again! 馃憤
@dbanksdesign I was checking about the log option and looks like is not really working, I see that you check that option, so if a pass "log": false or "" I'm still getting the warnings.
This is the kind of warnings that I'm getting, what should be the approach instead? multiple tokens shouldn't finish with the same name?

@glrodasz unfortunately we have not implemented log level fully, so passing false to log won't do anything.
For those warnings specifically, they are a different type of warning. That warning is letting you know that for a specific file being generated, there will be name collisions in it (but not necessarily name collisions when merging token objects). This is usually due to not having a name transform set on the platform. If you open up the file it generated you should see a bunch of variables named '100' in there.
Either way your point is valid in that we should make the log level configuration more robust and potentially hide that output if a certain log level is set. If you would like to submit a PR for this that would be great. The code generating those warnings is here:
https://github.com/amzn/style-dictionary/blob/master/lib/buildFile.js#L50
Most helpful comment
I thought there was... but I am wrong. We have a config option, that is currently not documented but should be, of
log. You can set it in your config like this:Although, right now it won't do what you want because the only values that would change the behavior would be to set it to 'error' in which case collision detections would fail the build. Which is the opposite of what you want.. But I think we should add a level below the default, which will not show any warnings. I can see if I can get to adding that for the next release, which should be soon? Or if you want to take a stab at it, here is the line where we add collision warnings:
https://github.com/amzn/style-dictionary/blob/master/lib/extend.js#L119
Another way you could do it is to use the
includeoption, which is rarely used, but was meant to be for if you have a style dictionary depend on another style dictionary. Collisions betweenincludeandsourcedo not show a warning. A fair warning,includeis a bit broken right now, but will be fixed in the next release to function the same assource. Here is the PR that fixed that: #227P.S. Super cool to see the multi-brand multi-platform setup. Excellent work!