@clovis500c/figma-bridge 1.5.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/dist/server.js +4267 -525
- package/package.json +5 -2
- package/plugin/code.js +907 -28
- package/plugin/ui.html +4 -2
package/README.md
CHANGED
|
@@ -15,10 +15,12 @@ and any other MCP client.
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
17
|
- **Build whole layouts in one call** from a JSON spec: auto-layout and grid, rich text, icons, images, component sets with variants and properties, prototype links.
|
|
18
|
-
- **
|
|
18
|
+
- **Import any website or HTML** as editable auto-layout frames, one per viewport ([details](docs/import-web.md)).
|
|
19
|
+
- **Round-trip the design system**: write variables with Light/Dark modes and styles from JSON, W3C tokens or Tailwind; export them to DTCG, CSS, Tailwind v3/v4, SCSS or TypeScript ([details](docs/design-system.md)).
|
|
20
|
+
- **Score and fix design system health**: token coverage, contrast, text styles, detached instances, duplicates, naming, with safe automatic fixes.
|
|
19
21
|
- **Read existing designs** compactly, search every page, and reuse the file's design system.
|
|
20
22
|
- **Check its own work** with screenshots, a design audit, and a pixel diff against a mockup.
|
|
21
|
-
- **Hand off**:
|
|
23
|
+
- **Hand off to your codebase**: export a frame into your project with its own components, tokens and stack (React, Next, Vue, Svelte, React Native; Tailwind, CSS modules, styled-components; shadcn, MUI, Chakra) ([details](docs/export-code.md)), plus Dev Mode annotations.
|
|
22
24
|
- **200 000+ icons** through Iconify, checkpoints to roll back, and a library of reusable scripts.
|
|
23
25
|
- **Zero-friction connection**: the plugin connects and reconnects on its own. Each AI command is one Ctrl+Z step, and you can cancel it from the plugin.
|
|
24
26
|
|
|
@@ -104,6 +106,8 @@ Keep the plugin open (the **—** button collapses it to a thin bar) and ask you
|
|
|
104
106
|
|
|
105
107
|
> Create our design system from `tokens.json` (Light and Dark modes), then rebuild the selected screen with those variables and show it in Dark mode.
|
|
106
108
|
|
|
109
|
+
> Import https://example.com/pricing at desktop and mobile widths, then rename the layers and swap the fonts for ours.
|
|
110
|
+
|
|
107
111
|
> Reproduce `C:\mockups\dashboard.png` as an editable frame with auto-layout, compare it with the screenshot and fix the differences.
|
|
108
112
|
|
|
109
113
|
When your agent needs you to point at something, the plugin shows **Your agent is waiting** until you select it.
|
|
@@ -117,18 +121,19 @@ To reopen the plugin later, use **Ctrl+Alt+P** or the **Figma Bridge** button in
|
|
|
117
121
|
| Tool | Purpose |
|
|
118
122
|
|---|---|
|
|
119
123
|
| `build` | Create a layout from a JSON spec in one call: grid, rich text, variants, reactions |
|
|
124
|
+
| `import_web` | Rebuild a website or HTML as editable layers, one frame per viewport |
|
|
120
125
|
| `run_script` | Run any Figma Plugin API code |
|
|
121
126
|
| `describe` | Compact outline of existing layers |
|
|
122
127
|
| `find` | Search layers on every page by name, text, type, style or component |
|
|
123
128
|
| `get_design_system` | Local styles, variables and components |
|
|
124
|
-
| `design_tokens` |
|
|
125
|
-
| `audit` | Lint
|
|
129
|
+
| `design_tokens` | Write variables (with modes) and styles from JSON, W3C tokens or Tailwind; export them to DTCG, CSS, Tailwind, SCSS or TS |
|
|
130
|
+
| `audit` | Lint layers, score the design system's health, and apply safe fixes |
|
|
126
131
|
| `screenshot` | Export a layer to an image (optionally shown to the agent) |
|
|
127
132
|
| `compare` | Pixel-diff a layer against a reference image, with a heatmap |
|
|
128
133
|
| `wait_for_selection` | Ask the user to select layers and wait for it |
|
|
129
134
|
| `prototype` | Link frames (click, hover, transitions) and set flow starting points |
|
|
130
135
|
| `annotate` | Add, list or clear Dev Mode annotations |
|
|
131
|
-
| `export_code` | Export a frame to
|
|
136
|
+
| `export_code` | Export a frame to code; with `projectPath`, code that uses the project's components and tokens |
|
|
132
137
|
| `insert_icon` · `search_icons` | Iconify icons as editable vectors |
|
|
133
138
|
| `place_image` · `import_svg` | Images from disk or URL, SVG as vectors |
|
|
134
139
|
| `checkpoint` | Save layers and restore them later |
|
|
@@ -147,6 +152,7 @@ Each tool describes its parameters to the agent, which needs no extra instructio
|
|
|
147
152
|
| **Version mismatch** | The plugin and the server come from different releases: reopen the plugin, or update both. |
|
|
148
153
|
|
|
149
154
|
Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\figma-bridge`.
|
|
155
|
+
`import_web` uses your installed Chrome or Edge; set `FIGMA_BRIDGE_BROWSER` to use another Chromium-based browser.
|
|
150
156
|
|
|
151
157
|
## Development
|
|
152
158
|
|
|
@@ -154,12 +160,13 @@ Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\
|
|
|
154
160
|
bun install # also builds the plugin and dist/server.js
|
|
155
161
|
bun run build # plugin/code.ts → plugin/code.js, src/cli.ts → dist/server.js (Node)
|
|
156
162
|
bun run check # type-check server and plugin, reject syntax Figma cannot run
|
|
157
|
-
bun test # unit tests (bridge, setup, schemas, tokens, code generation)
|
|
163
|
+
bun test # unit tests (bridge, setup, schemas, tokens, code generation, web import)
|
|
158
164
|
bun run test # end-to-end test against an open Figma file
|
|
159
165
|
```
|
|
160
166
|
|
|
161
167
|
To release, change `version` in `package.json`, then run **Actions → Release → Run workflow** on `main`: it publishes to
|
|
162
168
|
npm and creates the GitHub release.
|
|
163
169
|
|
|
164
|
-
Options: `FIGMA_BRIDGE_PORT` (default `3055`), `FIGMA_BRIDGE_CHANNEL`, `FIGMA_BRIDGE_OUT`, `FIGMA_BRIDGE_SNIPPETS
|
|
170
|
+
Options: `FIGMA_BRIDGE_PORT` (default `3055`), `FIGMA_BRIDGE_CHANNEL`, `FIGMA_BRIDGE_OUT`, `FIGMA_BRIDGE_SNIPPETS`,
|
|
171
|
+
`FIGMA_BRIDGE_BROWSER`.
|
|
165
172
|
The server listens on `127.0.0.1` only, and browsers can't send it commands.
|