Skip to content

v0.4.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 15 Sep 09:04
· 2 commits to main since this release
dc178bd

Minor Changes

  • ab01a1e: BREAKING: if an upper token group does not have a tokenset property, it will get placed in a "global" tokenset by default. This means that no action is required by the user of the transformer to get a working JSON for Figma Tokens Plugin, but this change is potentially breaking because of how it changes the JSON output.

    Before

    {
      "core": {
        "color": {
          "primary": {
            "base": {
              "type": "color",
              "value": "#14b8a6"
            },
            "secondary": {
              "type": "color",
              "value": "#ff0000"
            }
          }
        }
      }
    }

    Nothing is changed in the output. However, if you have references, they might be broken because the plugin will interpret this as "color" being the upper property in a tokenset called "core".

    After

    {
      "core": {
        "color": {
          "primary": {
            "base": {
              "type": "color",
              "value": "#14b8a6"
            },
            "secondary": {
              "type": "color",
              "value": "#ff0000"
            }
          }
        }
      }
    }

    turns into

    {
      "global": {
        "core": {
          "color": {
            "primary": {
              "base": {
                "type": "color",
                "value": "#14b8a6"
              },
              "secondary": {
                "type": "color",
                "value": "#ff0000"
              }
            }
          }
        }
      }
    }

    Your reference, for example {core.color.primary.base} will now work properly because "core" is not interpreted as the tokenset, "global" is.

Patch Changes

  • ab01a1e: Fix clean-meta utility by using a proper isObject check which excludes arrays (values can be arrays).