lukasoppermann / style-dictionary-utils

A package of transforms, formats, filters, etc. to use in your style dictionary config to transform your design tokens
MIT License
176 stars 17 forks source link

Camel casing the ESM output #74

Closed Wildhoney closed 6 months ago

Wildhoney commented 7 months ago

I've seen this issue with nested/json which claims to have been resolved, but I still seem to have the same issue.

Essentially using:

ts: {
  transforms: ["name/cti/camel"],
  buildPath: "build/",
  files: [
    {
      filter: "isSource",
      destination: "tokens.ts",
      format: "javascript/esm",
    },
  ],
}

I would expect the output map to be camel cased, but it isn't. Is this not possible?

Instead I get:

export default {
  "border-radius": {
    small: "5px",
    medium: "10px",
    large: "20px",
  }
}
lukasoppermann commented 6 months ago

Hey, name/cti/camel or any cti transformer does not work in most cases. However, I just added a new transformer to solve the problem for you name/pathtocamelcase

Wildhoney commented 6 months ago

Thank you 🙏