mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
807 stars 71 forks source link

Elements are imported twice, in two different places #152

Closed glouhaichi closed 2 years ago

glouhaichi commented 2 years ago

Below is our current figmagic.json configuration:

{
    "templates": {
        "templatePathGraphic": "./node_modules/figmagic/templates/graphic",
        "templatePathReact": "./node_modules/figmagic/templates/react",
        "templatePathStorybook": "./node_modules/figmagic/templates/story",
        "templatePathStyled": "./node_modules/figmagic/templates/styled"
    },
    "outputFormatCss": "js",
    "outputFormatElements": "js",
    "outputFormatTokens": "js",
    "outputFolderTokens": "./src/frontend/tokens",
    "outputFolderElements": "./src/frontend/elements",
    "outputFolderGraphics": "./src/frontend/graphics",
    "tokensRelativeImportPrefix": "../../",
    "recompileLocal": false,
    "syncGraphics": false,
    "syncElements": true,
    "syncTokens": true,
    "camelizeTokenNames": false
}

After running npm run figmagic, the tokens as well as the elements are imported correctly under the src/frontend directory. However, the elements are also imported directly in the project root (./).

I've taken a look at the Figma file and all seems to be where it should be: tokens under "Design Tokens", and elements under "Elements". The "Graphics", "Components", and "Views" sections are empty.

Are we doing something wrong in the Figma file or the configuration? Is this a bug?

mikaelvesavuori commented 2 years ago

It seems the main file (JS/TS) is generated at the root. I will investigate.

mikaelvesavuori commented 2 years ago

Sorry for the delay. This should be fixed now, in 4.4.3.