@nnao45/figma-use 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,991 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.11.1] - 2026-01-29
9
+
10
+ ### Fixed
11
+
12
+ - **`diff visual` hanging** — command now exits properly after generating diff image
13
+ - **`diff visual` parallel export issue** — fixed race condition with sequential export calls
14
+ - **`diff create` extended property support** — now compares:
15
+ - Individual corner radii (`radii: 8 16 4 0`)
16
+ - Corner smoothing
17
+ - Blend modes
18
+ - Rotation
19
+ - Clips content (overflow)
20
+ - Effects (shadows, blur)
21
+ - Vector paths (SVG data)
22
+
23
+ ### Added
24
+
25
+ - **Vector path serialization** — `diff create` and `get-node-tree` now include SVG path data for vector nodes
26
+
27
+ ## [0.11.0] - 2026-01-23
28
+
29
+ ### Added
30
+
31
+ - **Extended styling props** — comprehensive property support for export and render
32
+ - **Corner smoothing** — iOS squircle corners (`cornerSmoothing={0.6}` → CSS `corner-shape: squircle`)
33
+ - **Individual corner radii** — `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`
34
+ - **Effects** — drop shadows (`shadow="0px 4px 8px rgba(0,0,0,0.25)"`) and blur (`blur={10}`)
35
+ - **Constraints** — `minW`, `maxW`, `minH`, `maxH`
36
+ - **Blend modes** — `blendMode="multiply"` etc.
37
+ - **Rotation** — `rotate={45}`
38
+ - **Overflow** — `overflow="hidden"` (clipsContent)
39
+ - **Stroke align** — `strokeAlign="inside"` / `"outside"`
40
+ - **Individual stroke weights** — `strokeTop`, `strokeBottom`, `strokeLeft`, `strokeRight`
41
+ - **Flex wrap** — `wrap={true}` for auto-layout
42
+ - **Absolute positioning** — `position="absolute"`
43
+ - **Flex grow** — `grow={1}`
44
+ - **Stretch** — `stretch={true}` (layoutAlign: STRETCH)
45
+
46
+ - **Improved human-readable output** — `node get` now shows:
47
+ - Corner radii with smoothing percentage
48
+ - Effects (shadows, blur)
49
+ - Rotation, blend mode, overflow
50
+ - Layout constraints (min/max width/height)
51
+
52
+ - **Smart sizing in export JSX** — respect auto-layout sizing modes
53
+ - `HUG` → no width/height (content-sized)
54
+ - `FILL` → `w="fill"` / `h="fill"`
55
+ - `FIXED` → `w={200}` / `h={100}`
56
+
57
+ - **Semantic HTML in export** — automatically convert to semantic HTML elements
58
+
59
+ ```bash
60
+ figma-use export jsx 1:23 # Input → <input>, Button → <button>
61
+ figma-use export storybook # Same for storybook
62
+ figma-use export jsx --no-semantic-html # Disable conversion
63
+ ```
64
+
65
+ Detection based on component names: `Input/*`, `Button/*`, `Checkbox/*`, etc.
66
+
67
+ - **`node replace-with`** — replace node with another node or JSX from stdin
68
+
69
+ ```bash
70
+ figma-use node replace-with <id> --target <component-id> # Creates instance
71
+ echo '<Frame .../>' | figma-use node replace-with <id> --stdin
72
+ ```
73
+
74
+ - **`analyze snapshot`** — extract accessibility tree from Figma designs
75
+ ```bash
76
+ figma-use analyze snapshot # Full page
77
+ figma-use analyze snapshot <id> -i # Interactive elements only
78
+ figma-use analyze snapshot --depth 6 # Limit depth
79
+ ```
80
+ Detects roles from component names and structure: button, checkbox, radio, switch, slider, textbox, combobox, tab, link, table, list, separator, dialog, etc.
81
+
82
+ - **`comment watch`** — wait for new comments (for agent automation)
83
+ ```bash
84
+ figma-use comment watch # Wait indefinitely
85
+ figma-use comment watch --timeout 60 # Exit after 60s if no comment
86
+ figma-use comment watch --json # JSON output with target_node
87
+ ```
88
+ Returns comment text, author, and `target_node` (exact element under the comment pin).
89
+
90
+ - **`comment resolve`** — mark comment as resolved
91
+ ```bash
92
+ figma-use comment resolve <comment-id>
93
+ ```
94
+
95
+ ### Removed
96
+
97
+ - **culori dependency** — unused color parsing library
98
+ If target is a component, creates an instance. Otherwise clones the node.
99
+
100
+ - **`node ancestors`** — get parent chain from node to page root
101
+
102
+ ```bash
103
+ figma-use node ancestors <id> # Up to 10 ancestors
104
+ figma-use node ancestors <id> --depth 5 # Limit depth
105
+ ```
106
+
107
+ - **`node bindings`** — get variable bindings for fills and strokes
108
+
109
+ ```bash
110
+ figma-use node bindings <id> # Show bound variables
111
+ ```
112
+
113
+ - **`page bounds`** — get bounding box of all objects on current page
114
+
115
+ ```bash
116
+ figma-use page bounds # Returns minX, maxX, suggestedX, etc.
117
+ ```
118
+
119
+ Useful for finding free space to place new components.
120
+
121
+ - **`variable find`** — search variables by name pattern
122
+
123
+ ```bash
124
+ figma-use variable find "Text/Neutral" # Substring match
125
+ figma-use variable find "Color" --type COLOR --limit 10
126
+ ```
127
+
128
+ - **`<instance>` in render** — create component instances in JSX render
129
+
130
+ ```tsx
131
+ <frame>
132
+ <instance component="59763:10626" />
133
+ </frame>
134
+ ```
135
+
136
+ - **`analyze` commands** — design analysis tools for discovery and audit
137
+
138
+ **`analyze clusters`** — find repeated patterns (potential components)
139
+
140
+ ```bash
141
+ figma-use analyze clusters # Find all clusters
142
+ figma-use analyze clusters --limit 10 # Show top 10
143
+ figma-use analyze clusters --min-count 5 # Min 5 instances
144
+ ```
145
+
146
+ Uses fuzzy matching with size buckets. Shows confidence score.
147
+
148
+ **`analyze colors`** — color palette usage
149
+
150
+ ```bash
151
+ figma-use analyze colors # Colors by frequency
152
+ figma-use analyze colors --show-similar # Find similar colors to merge
153
+ ```
154
+
155
+ Shows variable names (`$Colors/Neutral/200`). Same hex with different variables shown separately.
156
+
157
+ **`analyze typography`** — font usage map
158
+
159
+ ```bash
160
+ figma-use analyze typography # All font combinations
161
+ figma-use analyze typography --group-by size # Group by size
162
+ figma-use analyze typography --group-by family # Group by family
163
+ ```
164
+
165
+ **`analyze spacing`** — gap and padding values
166
+
167
+ ```bash
168
+ figma-use analyze spacing # All spacing values
169
+ figma-use analyze spacing --grid 8 # Warn if not divisible by 8
170
+ ```
171
+
172
+ - **V8 compile cache** — 25% faster startup on repeated runs (Node.js 22+)
173
+
174
+ - **`lint` command** (experimental) — design linter with 17 rules for consistency, accessibility, and best practices
175
+
176
+ ```bash
177
+ figma-use lint # Recommended preset
178
+ figma-use lint --page "Components" # Lint specific page by name
179
+ figma-use lint --preset strict # Stricter rules
180
+ figma-use lint --preset accessibility # A11y rules only
181
+ figma-use lint --rule color-contrast # Specific rule
182
+ figma-use lint -v # Verbose with suggestions
183
+ figma-use lint --json # JSON output for CI
184
+ figma-use lint --list-rules # Show all available rules
185
+ ```
186
+
187
+ **Rules by category:**
188
+
189
+ | Category | Rules |
190
+ | ------------- | ------------------------------------------------------------------------------------------ |
191
+ | Design Tokens | `no-hardcoded-colors`, `consistent-spacing`, `consistent-radius`, `effect-style-required` |
192
+ | Layout | `prefer-auto-layout`, `pixel-perfect` |
193
+ | Typography | `text-style-required`, `min-text-size`, `no-mixed-styles` |
194
+ | Accessibility | `color-contrast`, `touch-target-size` |
195
+ | Structure | `no-default-names`, `no-hidden-layers`, `no-deeply-nested`, `no-empty-frames`, `no-groups` |
196
+ | Components | `no-detached-instances` |
197
+
198
+ **Presets:** `recommended`, `strict`, `accessibility`, `design-system`
199
+
200
+ - New `packages/linter/` — standalone linting engine with ESLint-inspired architecture
201
+ - `defineRule()` helper for creating custom rules
202
+ - Configurable severity per rule (error/warning/info/off)
203
+ - Auto-fix support for fixable rules
204
+ - Console and JSON reporters
205
+
206
+ - **`set text-resize` command** — control text auto-resize mode
207
+
208
+ ```bash
209
+ figma-use set text-resize <id> height # Wrap text to width
210
+ figma-use set text-resize <id> width-and-height # Auto-size both dimensions
211
+ figma-use set text-resize <id> none # Fixed size
212
+ figma-use set text-resize <id> truncate # Truncate with ellipsis
213
+ ```
214
+
215
+ - **TEXT component properties in Storybook export** — editable text props
216
+
217
+ ```tsx
218
+ // Figma component with TEXT property "label" becomes:
219
+ export function Button({ label, variant }: ButtonProps) {
220
+ return (
221
+ <Frame>
222
+ <Text>{label}</Text>
223
+ </Frame>
224
+ )
225
+ }
226
+
227
+ // Stories get editable args:
228
+ export const Primary: StoryObj<typeof Button> = {
229
+ args: { label: 'Click me', variant: 'Primary' }
230
+ }
231
+ ```
232
+
233
+ - **`textAutoResize` in node tree** — shows text resize mode for TEXT nodes
234
+
235
+ - **`init` command** — create `.figma-use.json` config file
236
+
237
+ ```bash
238
+ figma-use init # Create with defaults
239
+ figma-use init --force # Overwrite existing
240
+ figma-use init --preset strict # Use strict lint preset
241
+ ```
242
+
243
+ - **`.figma-use.json` config file** — unified configuration for lint, storybook export, and formatting
244
+ ```json
245
+ {
246
+ "lint": { "preset": "recommended" },
247
+ "storybook": {
248
+ "page": "Components",
249
+ "out": "./stories",
250
+ "matchIcons": true,
251
+ "preferIcons": ["lucide", "tabler"],
252
+ "iconThreshold": 0.85,
253
+ "framework": "react"
254
+ },
255
+ "format": {
256
+ "pretty": true,
257
+ "semi": false,
258
+ "singleQuote": true
259
+ }
260
+ }
261
+ ```
262
+ CLI arguments override config values. Config is auto-loaded from current directory or parents.
263
+
264
+ ### Changed
265
+
266
+ - **Improved ComponentSet export** — now combines VARIANT and TEXT properties
267
+ - VARIANT props control which JSX variant to render
268
+ - TEXT props become editable string props in the component
269
+ - Stories include args for both variant selection and text editing
270
+
271
+ ### Fixed
272
+
273
+ - **TypeScript module not found** — moved `typescript` from devDependencies to dependencies, fixing `ERR_MODULE_NOT_FOUND` error when running via `npx figma-use` or `bunx figma-use` ([#2](https://github.com/dannote/figma-use/issues/2))
274
+
275
+ - **JSX export improvements**
276
+ - Include white color (`#FFFFFF`) in icon exports
277
+ - Skip hidden nodes (`visible: false`) in JSX generation
278
+ - Increase icon aspect ratio tolerance from 1.5 to 2 (for lock icons etc)
279
+
280
+ ## [0.10.1] - 2026-01-21
281
+
282
+ ### Fixed
283
+
284
+ - Show install hint when `oxfmt` is missing for `--pretty` flag
285
+
286
+ ```
287
+ oxfmt is required for --pretty. Install it:
288
+
289
+ npm install -D oxfmt
290
+ ```
291
+
292
+ ## [0.10.0] - 2026-01-21
293
+
294
+ ### Added
295
+
296
+ - **`export jsx` command** — export Figma nodes as JSX components
297
+
298
+ ```bash
299
+ figma-use export jsx <node-id> # Minified output
300
+ figma-use export jsx <node-id> --pretty # Formatted with oxfmt
301
+ ```
302
+
303
+ Features:
304
+ - Generates TypeScript AST (not string concatenation)
305
+ - Recognizes Iconify icons by name pattern → `<Icon name="lucide:save" />`
306
+ - Exports vectors as inline SVG → `<SVG src="..." />`
307
+ - Format options: `--semi`, `--single-quote`, `--tabs`, `--tab-width`, `--trailing-comma`
308
+
309
+ - **`diff jsx` command** — compare nodes as formatted JSX
310
+
311
+ ```bash
312
+ figma-use diff jsx <from-id> <to-id>
313
+ ```
314
+
315
+ Shows colorized unified diff of JSX representations.
316
+
317
+ - **`<Icon>` element in JSX** — render Iconify icons
318
+
319
+ ```tsx
320
+ <Icon name="lucide:heart" size={24} color="#EF4444" />
321
+ ```
322
+
323
+ 150k+ icons from Iconify, loaded on demand.
324
+
325
+ - **`<Section>` element** — create Figma sections (distinct from frames)
326
+
327
+ ### Changed
328
+
329
+ - **Switched from Prettier to oxfmt** for code formatting
330
+ - Faster Rust-based formatter
331
+ - Import sorting with customizable groups
332
+ - Optional dependency (graceful fallback if not installed)
333
+
334
+ - **`FormatOptions` type** now re-exported from `oxfmt`
335
+
336
+ ### Internal
337
+
338
+ - Consolidated `FigmaNode` interface into `types.ts`
339
+ - Replaced raw ANSI escape codes with `picocolors`
340
+ - Added comprehensive tests for `export jsx` and `diff jsx`
341
+
342
+ ## [0.9.2] - 2026-01-21
343
+
344
+ ### Added
345
+
346
+ - **`<Image>` element** — load images from URL in JSX
347
+
348
+ ```tsx
349
+ <Image src="https://example.com/photo.jpg" w={200} h={150} />
350
+ ```
351
+
352
+ - **Import support in stdin** — use familiar module syntax
353
+
354
+ ```tsx
355
+ import { Frame, Text, defineComponent } from 'figma-use/render'
356
+
357
+ export default () => (
358
+ <Frame>
359
+ <Text>Hello</Text>
360
+ </Frame>
361
+ )
362
+ ```
363
+
364
+ ## [0.9.1] - 2026-01-21
365
+
366
+ ### Fixed
367
+
368
+ - Add missing `svgpath` and `fontoxpath` dependencies for RPC bundle
369
+
370
+ ## [0.9.0] - 2026-01-21
371
+
372
+ ### Changed
373
+
374
+ - **BREAKING: Direct CDP communication** — no more proxy server or plugin required!
375
+
376
+ ```bash
377
+ # Old way (removed)
378
+ figma-use proxy &
379
+ # Open Figma → Plugins → Development → Figma Use
380
+
381
+ # New way
382
+ open -a Figma --args --remote-debugging-port=9222
383
+ figma-use status # Ready!
384
+ ```
385
+
386
+ - **Simplified architecture** — CLI talks directly to Figma via Chrome DevTools Protocol
387
+ - Removed `packages/proxy/` (WebSocket server)
388
+ - Removed `packages/cli/src/multiplayer/` (Kiwi protocol)
389
+ - Removed Figma plugin installation requirement
390
+ - RPC code built on-demand with esbuild (no more 374KB embedded bundle)
391
+
392
+ - **CLI bundle size reduced** — 1.85MB → 1.1MB (-41%)
393
+
394
+ - **Runtime-agnostic** — CLI now works with both Node.js and Bun
395
+
396
+ - **Package renamed** — `@dannote/figma-use` → `figma-use`
397
+
398
+ ```bash
399
+ npx figma-use status
400
+ bunx figma-use status
401
+ ```
402
+
403
+ - **Faster startup** — no WebSocket handshake, no plugin initialization
404
+
405
+ - **New JSX renderer** — uses Figma Widget API (`createNodeFromJSXAsync`) instead of custom reconciler
406
+ - Simpler architecture: components return TreeNode, processed on Figma side
407
+ - Custom JSX runtime for `.figma.tsx` files (`@jsxImportSource`)
408
+ - All style shorthands processed in `rpc.ts`
409
+
410
+ ### Added
411
+
412
+ - **`node delete` and `node clone` support multiple IDs** — operate on several nodes at once
413
+
414
+ ```bash
415
+ figma-use node delete 1:23 1:24 1:25
416
+ figma-use node clone 1:23 1:24 1:25
417
+ ```
418
+
419
+ - **Grid layout support** — CSS Grid for 2D layouts in both CLI and JSX
420
+ ```bash
421
+ figma-use set layout <id> --mode GRID --cols "100px 1fr 100px" --rows "auto" --gap 16
422
+ ```
423
+ In JSX:
424
+ ```tsx
425
+ <Frame style={{ display: 'grid', cols: '1fr 1fr 1fr', rows: 'auto auto', gap: 16 }}>
426
+ <Frame style={{ bg: '#FF6B6B' }} />
427
+ <Frame style={{ bg: '#4ECDC4' }} />
428
+ ...
429
+ </Frame>
430
+ ```
431
+ Supports `px`, `fr`, and `auto`/`hug` in template syntax. Separate gaps with `colGap` and `rowGap`.
432
+
433
+ ### Changed (MCP)
434
+
435
+ - **MCP server is now standalone** — `figma-use mcp serve` instead of running with proxy
436
+ ```bash
437
+ figma-use mcp serve # Start on port 38451
438
+ figma-use mcp serve --port 8080 # Custom port
439
+ ```
440
+
441
+ ### Removed
442
+
443
+ - `figma-use proxy` command (no longer needed)
444
+ - `figma-use plugin install/uninstall` commands (no plugin required)
445
+ - Multi-file support via proxy (use multiple Figma windows instead)
446
+ - `file list/select` commands (use multiple Figma windows instead)
447
+
448
+ ## [0.8.0] - 2026-01-20
449
+
450
+ ### Added
451
+
452
+ - **`query` command** — XPath selectors for finding nodes (powered by fontoxpath)
453
+
454
+ ```bash
455
+ figma-use query "//FRAME" # All frames
456
+ figma-use query "//FRAME[@width < 300]" # Frames narrower than 300px
457
+ figma-use query "//COMPONENT[starts-with(@name, 'Button')]" # Name starts with
458
+ figma-use query "//FRAME[contains(@name, 'Card')]" # Name contains
459
+ figma-use query "//SECTION/FRAME" # Direct children
460
+ figma-use query "//SECTION//TEXT" # All descendants
461
+ figma-use query "//*[@cornerRadius > 0]" # Any node with radius
462
+ ```
463
+
464
+ Full XPath 3.1 support: axes, predicates, functions, arithmetic
465
+
466
+ - **Multi-file support** — proxy now supports multiple simultaneous plugin connections
467
+ - Each plugin instance registers with fileKey and fileName
468
+ - `file list` — show all connected files
469
+ - `file select <name>` — switch active file (partial match supported)
470
+ - `status` shows all connected files with active marker
471
+ - **Connector commands** — work with connector lines
472
+ - `connector list` — list connectors on current page
473
+ - `connector get <id>` — get connector details (endpoints, stroke, line type)
474
+ - `connector set <id>` — update connector properties (stroke, weight, line type, caps)
475
+ - `connector create` — create connector (FigJam only, Figma API limitation)
476
+
477
+ - **`figma_render` MCP tool** — render JSX via MCP protocol
478
+
479
+ - **MCP.md** — documentation for Model Context Protocol integration
480
+
481
+ ### Changed
482
+
483
+ - Extracted `transformJsxSnippet` to separate module for reuse
484
+
485
+ ### Fixed
486
+
487
+ - `@dannote/figma-use/render` — missing `color.ts` in published package
488
+ - Proxy connection cleanup on plugin disconnect
489
+
490
+ ## [0.7.1] - 2026-01-19
491
+
492
+ ### Changed
493
+
494
+ - SKILL.md rewritten — structure like README, compact best practices
495
+ - `render --examples` updated — added Icon, shorthands, `--x`/`--y` examples
496
+ - README: added visual diff example with images
497
+
498
+ ## [0.7.0] - 2026-01-19
499
+
500
+ ### Changed
501
+
502
+ - README rewritten — focused on concepts, moved command list to REFERENCE.md
503
+ - Added REFERENCE.md with full list of 100+ commands
504
+
505
+ ### Added
506
+
507
+ - **`page current`** — show current page name and ID
508
+
509
+ ```bash
510
+ figma-use page current # Page 1 (0:1)
511
+ figma-use page current --json # {"id": "0:1", "name": "Page 1"}
512
+ ```
513
+
514
+ - **`create icon`** — add icons from Iconify (150k+ icons from 100+ sets)
515
+
516
+ ```bash
517
+ figma-use create icon mdi:home
518
+ figma-use create icon lucide:star --size 48 --color "#FFD700"
519
+ figma-use create icon heroicons:bell-solid --component # as Figma component
520
+ ```
521
+
522
+ Supports: mdi, lucide, heroicons, tabler, fa-solid, fa-regular, ri, ph, carbon, fluent, ion, bi, and more.
523
+
524
+ - **Variable references in CLI color options** — use `var:Name` or `$Name` syntax:
525
+
526
+ ```bash
527
+ figma-use create rect --x 0 --y 0 --width 100 --height 100 --fill 'var:Colors/Primary'
528
+ figma-use create icon mdi:home --color '$Brand/Accent'
529
+ ```
530
+
531
+ - **`<Icon>` primitive for JSX render** — 150k+ Iconify icons:
532
+
533
+ ```jsx
534
+ <Frame style={{ flexDirection: 'row', gap: 8 }}>
535
+ <Icon icon="mdi:home" size={24} color="#3B82F6" />
536
+ <Icon icon="lucide:star" size={32} color="#F59E0B" />
537
+ </Frame>
538
+ ```
539
+
540
+ Icons are auto-preloaded before render.
541
+
542
+ - **Tailwind-like style shorthands** for JSX render:
543
+ - Size: `w`, `h` → `width`, `height`
544
+ - Colors: `bg` → `backgroundColor`, `rounded` → `borderRadius`
545
+ - Padding: `p`, `pt`, `pr`, `pb`, `pl`, `px`, `py`
546
+ - Layout: `flex` (`"row"` | `"col"`), `justify`, `items`
547
+ - Text: `size`, `font`, `weight` → `fontSize`, `fontFamily`, `fontWeight`
548
+
549
+ ```jsx
550
+ // Before (178 chars)
551
+ <Frame style={{paddingLeft: 16, paddingRight: 16, backgroundColor: "#3B82F6", borderRadius: 6, flexDirection: "row"}}>
552
+
553
+ // After (73 chars)
554
+ <Frame style={{px: 16, bg: "#3B82F6", rounded: 6, flex: "row"}}>
555
+ ```
556
+
557
+ - **`render --x` and `--y` options** — position rendered root at specific coordinates
558
+
559
+ ### Changed
560
+
561
+ - README rewritten — focused on concepts, moved command list to REFERENCE.md
562
+ - Added REFERENCE.md with full list of 100+ commands
563
+ - CLI arguments now use kebab-case: `--stroke-weight`, `--font-size`, `--min-width`, etc.
564
+
565
+ ### Fixed
566
+
567
+ - Icon child ordering in render
568
+ - White fill removed from imported SVG icons
569
+ - Test isolation and multiplayer test reliability
570
+ - TypeScript types in .figma.tsx fixtures
571
+ - ComponentSet global registry to avoid module duplication
572
+
573
+ ## [0.6.3] - 2026-01-19
574
+
575
+ ### Added
576
+
577
+ - **`diff visual`** — create visual diff between two nodes as PNG
578
+ ```bash
579
+ figma-use diff visual --from <id1> --to <id2> --output diff.png
580
+ ```
581
+ Red pixels show differences. Options: `--scale`, `--threshold`
582
+
583
+ ### Changed
584
+
585
+ - `set rotation` now uses `--angle` flag instead of positional argument (fixes negative values like `--angle -15`)
586
+
587
+ ## [0.6.2] - 2026-01-19
588
+
589
+ ### Added
590
+
591
+ - `bun run format` — format code with oxfmt
592
+ - `bun run lint` — lint code with oxlint
593
+
594
+ ## [0.6.1] - 2026-01-19
595
+
596
+ ### Added
597
+
598
+ - **`diff` commands** (experimental) — incremental updates via unified diff patches
599
+ - `diff create --from <id> --to <id>` — compare two node trees and generate patch
600
+ - `diff apply` — apply a patch to Figma nodes (validates old values!)
601
+ - `diff show` — show diff between current state and new properties
602
+
603
+ ```bash
604
+ # Compare two frames (e.g., before/after, A/B variants)
605
+ figma-use diff create --from 123:456 --to 789:012
606
+
607
+ # Apply patch (validates old values match)
608
+ figma-use diff apply --stdin < patch.diff
609
+
610
+ # Dry run
611
+ figma-use diff apply --stdin --dry-run < patch.diff
612
+ ```
613
+
614
+ - Uses `diff` library for unified diff parsing and validation
615
+
616
+ ### Fixed
617
+
618
+ - `--timeout` now applies to single commands (e.g., `eval`) via proxy `/command`
619
+ - CLI now works after global install ([#1](https://github.com/dannote/figma-use/issues/1))
620
+ - Move `kiwi-schema` to devDependencies (already bundled into dist)
621
+
622
+ ## [0.6.0] - 2026-01-18
623
+
624
+ ### Added
625
+
626
+ - **`node bounds`** — get node position, size, center point, edges
627
+ - **`path` commands** — vector path manipulation:
628
+ - `path get <id>` — read SVG path data
629
+ - `path set <id> "M..."` — replace path data
630
+ - `path move <id> --dx --dy` — translate all points
631
+ - `path scale <id> --factor` — scale from center
632
+ - `path flip <id> --axis x|y` — mirror horizontally/vertically
633
+ - Uses [svgpath](https://github.com/fontello/svgpath) library for path transformations
634
+ - Path command tests
635
+
636
+ ## [0.5.9] - 2026-01-18
637
+
638
+ ### Changed
639
+
640
+ - Version now read from package.json instead of hardcoded
641
+
642
+ ## [0.5.8] - 2026-01-18
643
+
644
+ ### Added
645
+
646
+ - `page create` command documented in SKILL.md
647
+ - Auto-layout (hug contents) tests for render
648
+
649
+ ### Fixed
650
+
651
+ - **JSX render hug contents** — auto-layout frames now correctly calculate size from children
652
+ - `trigger-layout` moved from proxy to CLI (ensures multiplayer nodes are visible)
653
+ - Plugin retries node lookup with exponential backoff
654
+ - Switching sizingMode FIXED→AUTO forces Figma to recalculate
655
+
656
+ ## [0.5.7] - 2026-01-18
657
+
658
+ ### Fixed
659
+
660
+ - Font family and style now shown in `node tree` output
661
+
662
+ ## [0.5.6] - 2026-01-18
663
+
664
+ ### Added
665
+
666
+ - `comment list|add|delete` — manage file comments
667
+ - `version list` — view file version history
668
+ - `file info` — get file key and name
669
+ - `me` — get current user info
670
+ - `font list` — list available fonts with optional family filter
671
+ - `plugin list` — list installed development plugins
672
+ - `plugin` is now a subcommand group: `plugin install|uninstall|list|path`
673
+
674
+ ## [0.5.4] - 2026-01-18
675
+
676
+ ### Added
677
+
678
+ - **MCP server** — proxy exposes `/mcp` endpoint with 80+ auto-generated tools
679
+ - JSON-RPC over HTTP (no SDK dependency)
680
+ - Tools generated from CLI command definitions via TypeScript AST
681
+ - String args coerced to numbers using Zod
682
+ - `figma-use mcp` command shows client configuration
683
+ - MCP schema validation tests against official JSON schema
684
+ - MCP integration tests
685
+
686
+ ## [0.5.3] - 2026-01-18
687
+
688
+ ### Added
689
+
690
+ - **`set font-range`** — style text ranges (bold, color, size for specific characters)
691
+ ```bash
692
+ figma-use set font-range <id> --start 0 --end 5 --style Bold --color "#FF0000"
693
+ ```
694
+ - **`node to-component`** — convert frames to components
695
+ ```bash
696
+ figma-use node to-component <id>
697
+ figma-use node to-component "1:2 1:3 1:4" # Multiple
698
+ ```
699
+ - SKILL.md: added SVG import, font-range, grouping and auto-layout examples
700
+
701
+ ## [0.5.2] - 2026-01-18
702
+
703
+ ### Fixed
704
+
705
+ - Multiplayer connection works with Figma's updated protocol (sessionID now from plugin API)
706
+ - Proxy properly handles file switches (closes stale connections)
707
+ - `figma-use status` now shows full connection diagnostics (proxy, plugin, DevTools, file)
708
+
709
+ ## [0.5.1] - 2026-01-18
710
+
711
+ ### Added
712
+
713
+ - Package exports for `@dannote/figma-use/render` and `@dannote/figma-use/components`
714
+
715
+ ### Fixed
716
+
717
+ - SKILL.md now starts with connection check instructions
718
+ - Simplified SKILL.md for better AI agent comprehension
719
+
720
+ ## [0.5.0] - 2026-01-18
721
+
722
+ ### Added
723
+
724
+ - **`render --examples`** — full API reference for JSX rendering
725
+ - Main CLI help now mentions JSX rendering and points to `render --examples`
726
+ - **`defineComponent` for reusable components**
727
+
728
+ ```tsx
729
+ const Button = defineComponent('Button',
730
+ <Frame style={{ padding: 12, backgroundColor: '#3B82F6' }}>
731
+ <Text style={{ color: '#FFF' }}>Click me</Text>
732
+ </Frame>
733
+ )
734
+ // First usage creates Component, subsequent create Instances
735
+ <Button />
736
+ <Button />
737
+ ```
738
+
739
+ - **`defineComponentSet` for component variants**
740
+
741
+ ```tsx
742
+ const Button = defineComponentSet('Button', {
743
+ variant: ['Primary', 'Secondary'] as const,
744
+ size: ['Small', 'Large'] as const,
745
+ }, ({ variant, size }) => (
746
+ <Frame style={{
747
+ padding: size === 'Large' ? 16 : 8,
748
+ backgroundColor: variant === 'Primary' ? '#3B82F6' : '#E5E7EB'
749
+ }}>
750
+ <Text>{variant} {size}</Text>
751
+ </Frame>
752
+ ))
753
+ // Creates ComponentSet with all variant combinations
754
+ <Button variant="Primary" size="Large" />
755
+ ```
756
+
757
+ - Proper auto-sizing support (`hug contents`) for frames with `flexDirection`
758
+ - ComponentSet creates real Figma ComponentSet with `isStateGroup=true`
759
+
760
+ ### Fixed
761
+
762
+ - Auto-layout sizing mode now correctly set to FIXED when explicit dimensions provided
763
+ - TEXT nodes render with correct height (lineHeight encoding fix)
764
+ - Alignment fields use correct names (stackPrimaryAlignItems, not stackJustify)
765
+
766
+ ### Technical Notes
767
+
768
+ ComponentSet instances are created via Plugin API instead of multiplayer because
769
+ Figma reassigns GUIDs on receive, breaking symbolData.symbolID references within
770
+ the same batch. See `component-set.tsx` for detailed explanation.
771
+
772
+ ## [0.4.0] - 2026-01-18
773
+
774
+ ### Added
775
+
776
+ - **`defineVars` API for Figma variables** — bind colors to variables by name
777
+ ```tsx
778
+ const colors = defineVars({
779
+ primary: { name: 'Colors/Gray/50', value: '#F8FAFC' },
780
+ accent: { name: 'Colors/Blue/500', value: '#3B82F6' },
781
+ })
782
+ <Frame style={{ backgroundColor: colors.primary }} />
783
+ ```
784
+ - Variable binding for `backgroundColor`, `borderColor`, and text `color`
785
+ - Variables resolved by name at render time (no more magic IDs)
786
+ - `defineVars` support in stdin snippets
787
+ - Explicit fallback values in `defineVars` for proper color display
788
+
789
+ ### Fixed
790
+
791
+ - Auto-layout now works correctly via `trigger-layout` post-render
792
+ - Nested auto-layout frames trigger recursively
793
+ - Variable binding encoding matches Figma's exact wire format
794
+
795
+ ### Changed
796
+
797
+ - Marked React render and variable bindings as **experimental** in docs
798
+
799
+ ## [0.3.1] - 2026-01-18
800
+
801
+ ### Added
802
+
803
+ - **Variable binding via multiplayer protocol** — bind fill colors to Figma variables without plugin API
804
+ - `encodePaintWithVariableBinding()` — encode Paint with color variable binding
805
+ - `encodeNodeChangeWithVariables()` — encode NodeChange with variable-bound paints
806
+ - `parseVariableId()` — parse "VariableID:sessionID:localID" strings
807
+ - New exports: `VariableBinding`, `encodePaintWithVariableBinding`, `encodeNodeChangeWithVariables`, `parseVariableId`
808
+ - `bind-fill-variable` plugin command — bind fill color to variable
809
+ - `bind-stroke-variable` plugin command — bind stroke color to variable
810
+
811
+ ### Fixed
812
+
813
+ - Message field mapping: nodeChanges is field 4, reconnectSequenceNumber is field 25
814
+ - Paint variable binding format now matches Figma's exact wire format
815
+
816
+ ### Technical
817
+
818
+ - Discovered Figma's variable binding wire format via WebSocket traffic analysis
819
+ - Created capture/diff tools for binary protocol analysis (`scripts/capture.ts`, `scripts/diff-hex.ts`)
820
+ - 142 tests passing
821
+
822
+ ## [0.3.0] - 2025-01-17
823
+
824
+ ### Added
825
+
826
+ - **`render` command** — render React/TSX components directly to Figma
827
+ - From file: `figma-use render ./Card.figma.tsx`
828
+ - From stdin: `echo '<Frame style={{...}} />' | figma-use render --stdin`
829
+ - With props: `--props '{"title": "Hello"}'`
830
+ - Into parent: `--parent "1:23"`
831
+ - Dry run: `--dry-run` outputs NodeChanges JSON
832
+ - **Multiplayer WebSocket connection pooling** in proxy
833
+ - First render: ~4s (establishes connection)
834
+ - Subsequent renders: ~0.4s (10x faster!)
835
+ - Connections auto-close after 5min idle
836
+ - **React components** — `Frame`, `Text`, `Rectangle`, `Ellipse`, `Line`, `Star`, `Polygon`, `Vector`, `Component`, `Instance`, `Group`, `Page`, `View`
837
+ - **JSX intrinsic elements** — PascalCase in JSX, lowercase in output
838
+ - **culori integration** — robust color parsing (hex, rgb(), hsl(), named colors)
839
+ - `/render` endpoint in proxy for direct NodeChanges submission
840
+ - `/status` endpoint now shows multiplayer connection pool
841
+
842
+ ### Changed
843
+
844
+ - Proxy now holds persistent WebSocket connections to Figma multiplayer
845
+ - Architecture diagram updated to show dual communication paths
846
+ - 143 tests passing
847
+
848
+ ### Fixed
849
+
850
+ - TypeScript strict mode errors in tests
851
+ - NodeChanges validation before sending (must have guid)
852
+
853
+ ## [0.2.1] - 2025-01-17
854
+
855
+ ### Added
856
+
857
+ - **`profile` command** — performance profiling via Chrome DevTools Protocol
858
+ - Profile any command: `figma-use profile "get components --limit 20"`
859
+ - Shows time breakdown (Figma WASM vs JS vs GC)
860
+ - Lists top functions by CPU time
861
+ - Requires Figma with `--remote-debugging-port=9222`
862
+ - `get components --name` — filter components by name
863
+ - `get components --limit` — limit results (default 50)
864
+ - `get components --page` — filter by page
865
+ - `find --type` now works without `--name`
866
+
867
+ ### Changed
868
+
869
+ - `get components` uses early-exit recursion for better performance on large files
870
+ - `node tree --depth` now affects node count check (won't block with high depth limit)
871
+
872
+ ### Fixed
873
+
874
+ - Variant components no longer crash when accessing `componentPropertyDefinitions`
875
+ - 86 tests passing
876
+
877
+ ## [0.2.0] - 2025-01-17
878
+
879
+ ### Added
880
+
881
+ - **Subcommand structure** — commands reorganized into logical groups:
882
+ - `node get|tree|children|move|resize|rename|clone|delete`
883
+ - `create rect|ellipse|line|polygon|star|frame|text|component|instance|section|page`
884
+ - `set fill|stroke|radius|opacity|rotation|visible|text|font|effect|layout|blend|constraints|image`
885
+ - `get pages|components|styles`
886
+ - `export node|selection|screenshot`
887
+ - `selection get|set`
888
+ - `page list|set`
889
+ - `viewport get|set|zoom-to-fit`
890
+ - `variable list|get|create|set|delete|bind`
891
+ - `collection list|get|create|delete`
892
+ - `style list|create-paint|create-text|create-effect`
893
+ - `boolean union|subtract|intersect|exclude`
894
+ - `group create|ungroup|flatten`
895
+ - `find`, `import`, `eval`, `status`, `proxy`, `plugin`
896
+ - **Variables support** — full CRUD for Figma variables and collections
897
+ - **`node tree` command** — formatted hierarchy view with properties inline
898
+ - **Export size guards** — prevents oversized exports (max 4096px, 16MP)
899
+ - **Tree node limit** — `node tree` limits to 500 nodes by default
900
+ - `--force` flag to override size/node limits
901
+ - `--timeout` flag for heavy operations (export, screenshot, eval)
902
+
903
+ ### Changed
904
+
905
+ - **BREAKING**: Command syntax changed from flat to nested (e.g., `create-rectangle` → `create rect`)
906
+ - Renamed args: `--parentId` → `--parent`, `--itemSpacing` → `--gap`, `--layoutMode` → `--layout`
907
+ - Tests reorganized into separate files by command group (80 tests)
908
+
909
+ ### Fixed
910
+
911
+ - TypeScript strict mode compliance
912
+ - Figma API compatibility (BlurEffect, ExportSettings)
913
+
914
+ ## [0.1.5] - 2025-01-17
915
+
916
+ ### Added
917
+
918
+ - CHANGELOG.md
919
+ - SKILL.md included in npm package
920
+ - `--timeout` flag documentation
921
+
922
+ ## [0.1.4] - 2025-01-17
923
+
924
+ ### Added
925
+
926
+ - CONTRIBUTING.md with setup and PR guidelines
927
+
928
+ ### Changed
929
+
930
+ - Updated package description and keywords
931
+
932
+ ## [0.1.3] - 2025-01-17
933
+
934
+ ### Added
935
+
936
+ - AGENTS.md for contributors
937
+ - Git tags for all versions
938
+
939
+ ## [0.1.2] - 2025-01-17
940
+
941
+ ### Added
942
+
943
+ - `eval` command to execute arbitrary JavaScript in Figma plugin context
944
+ - `figma-use plugin` auto-installs plugin to Figma settings.json
945
+ - `--force` flag for plugin install while Figma is running
946
+ - `--uninstall` flag to remove plugin
947
+ - Architecture diagram in README
948
+ - Comparison table: official Figma MCP (read-only) vs figma-use (full control)
949
+
950
+ ### Changed
951
+
952
+ - All `proxy` and `plugin` commands now use citty for consistency
953
+ - README examples show inline styling (one command does fill + stroke + radius)
954
+
955
+ ## [0.1.1] - 2025-01-17
956
+
957
+ ### Added
958
+
959
+ - Human-readable CLI output by default (agent-browser style)
960
+ - `--json` flag for machine parsing on all commands
961
+ - 69 integration tests
962
+
963
+ ### Changed
964
+
965
+ - Renamed from figma-bridge to @dannote/figma-use
966
+
967
+ ## [0.1.0] - 2025-01-17
968
+
969
+ ### Added
970
+
971
+ - Initial release
972
+ - 60+ CLI commands for Figma control
973
+ - WebSocket proxy server (Elysia)
974
+ - Figma plugin with all command handlers
975
+ - Create commands: rectangle, ellipse, line, polygon, star, vector, frame, section, text, component, instance
976
+ - Style commands: fill, stroke, corner radius, opacity, effects, blend mode
977
+ - Layout commands: auto-layout, constraints, min/max
978
+ - Transform commands: move, resize, rotate, set parent
979
+ - Query commands: get node, children, selection, pages, components, styles
980
+ - Export commands: PNG/SVG/PDF export, screenshot
981
+ - Inline styling: `--fill`, `--stroke`, `--radius` etc. on create commands
982
+
983
+ [unreleased]: https://github.com/dannote/figma-use/compare/v0.3.0...HEAD
984
+ [0.3.0]: https://github.com/dannote/figma-use/compare/v0.2.1...v0.3.0
985
+ [0.2.1]: https://github.com/dannote/figma-use/compare/v0.2.0...v0.2.1
986
+ [0.2.0]: https://github.com/dannote/figma-use/compare/v0.1.5...v0.2.0
987
+ [0.1.5]: https://github.com/dannote/figma-use/compare/v0.1.4...v0.1.5
988
+ [0.1.4]: https://github.com/dannote/figma-use/compare/v0.1.3...v0.1.4
989
+ [0.1.3]: https://github.com/dannote/figma-use/compare/v0.1.2...v0.1.3
990
+ [0.1.2]: https://github.com/dannote/figma-use/compare/v0.1.1...v0.1.2
991
+ [0.1.1]: https://github.com/dannote/figma-use/compare/v0.1.0...v0.1.1