From 5df951e91001bf69f25a7f7ec458b1b8c037cec2 Mon Sep 17 00:00:00 2001 From: Dmitry Fomin <80476878+Amiditin@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:07:56 +0300 Subject: [PATCH] feat: fragments generator (#41) * feat: add base fragments-cli * feat: add base fragments-generator * feat: add load-node method to figma-file-loader * feat: add theme option to generate fragments command * feat: add process-file theme path * feat: add get-value-key-from-theme to fragments-generator strategy * feat: add component wrapper fro fragments * feat: add create wrapper element for array text elements * feat: add figma file-utils with process and write file utils destructure fragments-cli run util * refactor: parse node-id in load-node method * feat: add create dynamic fragments tree to fragments generator * refactor: destructure create-fragment strategy * feat: add dynamic imports when creating component * feat: add theme-mapping strategy * feat: add create-text strategy * feat: add create-box strategy * refactor: move getting attributes to theme-mapping strategy * feat: add to-px-string util * refactor: move getting box attributes to theme-mapping strategy * feat: add get-border-radius to theme-mapping strategy * feat: add get-border to theme-mapping strategy * feat: add get-shadow to theme-mapping strategy * feat: add background attribute to create box element * feat: add width and height attributes to create-box-element * feat: add id attribute to formatted-message element * feat: add text-align attribute to create-text-element * feat: add create-button strategy * feat: add base create-input strategy * feat: add create-input strategy to create-fragment * feat: add theme-mapping strategy test * feat: add create-box strategy test * feat: add create-text strategy test * feat: add create-button strategy test * feat: add create-input strategy test * feat: add is-instance to figma utils * feat: add question to get figma access token to figma-cli * fix: eslint validation * chore: add yarn sdks * chore: add exports to package json files * chore: remove generate-fragments script * refactor: use import from node * refactor: use pino logger instead of npmlog * feat: add name option to generate fragment * refactor: change fragment generator strategies folder structure and file names * docs: add fragments-generator to readme * chore: remove exports from packages * feat: add display-name prop to create-component result * feat: add options to pino logger --- .pnp.cjs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.pnp.cjs b/.pnp.cjs index f078874..0f4eec8 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -1890,6 +1890,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["@babel/standalone", [\ + ["npm:7.22.20", {\ + "packageLocation": "../.yarn/berry/cache/@babel-standalone-npm-7.22.20-674a6ef7e3-10.zip/node_modules/@babel/standalone/",\ + "packageDependencies": [\ + ["@babel/standalone", "npm:7.22.20"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@babel/template", [\ ["npm:7.24.7", {\ "packageLocation": "../.yarn/berry/cache/@babel-template-npm-7.24.7-d08a527e2b-10.zip/node_modules/@babel/template/",\ @@ -10112,6 +10121,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["help-me", [\ + ["npm:5.0.0", {\ + "packageLocation": "../.yarn/berry/cache/help-me-npm-5.0.0-6239bd310f-10.zip/node_modules/help-me/",\ + "packageDependencies": [\ + ["help-me", "npm:5.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["html-escaper", [\ ["npm:2.0.2", {\ "packageLocation": "../.yarn/berry/cache/html-escaper-npm-2.0.2-38e51ef294-10.zip/node_modules/html-escaper/",\