Skip to content

Commit 4a00600

Browse files
oOclaude
andcommitted
feat: integrate font database with 6 optimized operations (v0.36.0)
- Complete figma_vectors tool with sparse vector format and bulk operations - Enhanced logging with server/plugin version tracking and font database status - Comprehensive test suite cleanup and vector format coverage - Resolved rgbToHex import error and removed debug statements Designed with ❤️ by oO. Coded with ✨ by Claude Sonnet 4 Co-authored-by: Claude.AI <[email protected]>
1 parent 9aa2528 commit 4a00600

56 files changed

Lines changed: 3008 additions & 2330 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ out/
1717
figma-plugin/ui.html
1818
figma-plugin/code.js
1919
figma-plugin/dist/
20+
figma-plugin/src/generated-operations.ts
2021

2122
# Testing
2223
coverage/

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.36.0] - 2025-07-30
9+
10+
### Added
11+
- **figma_vectors tool**: Complete vector creation and manipulation system with sparse format
12+
- **Font database integration**: Comprehensive testing and optimization with 6 operations
13+
- **Enhanced logging**: Server and plugin version tracking, improved font database status messages
14+
15+
### Fixed
16+
- **Vector operations**: Resolved rgbToHex import error in get_line operation
17+
- **Code quality**: Removed debug statements, unused imports, and dead code
18+
19+
### Changed
20+
- **Test coverage**: Comprehensive test suite cleanup and vector format coverage
21+
- **Logging system**: Consistent emoji usage and resolution messages for font database operations
22+
823
## [0.35.0] - 2025-07-27
924

1025
### Added
@@ -331,7 +346,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
331346
- **Solution**: Added complete implementations for all missing component operations
332347
- **Operations Added**: `update` (modify name/description), `delete` (remove component), `remove_variant` (remove variant properties)
333348
- **Impact**: All documented component operations now work as expected
334-
- **CRITICAL: Vector Operations API Fixes**: Fixed incorrect Figma API usage in `figma_vector_operations` tool
349+
- **CRITICAL: Vector Operations API Fixes**: Fixed incorrect Figma API usage in `figma_vectors` tool
335350
- **Root Cause**: Wrong API signatures for `flatten` and `outlineStroke` methods causing "cannot read property 'id' of null" errors
336351
- **Research**: Validated against official Figma Plugin API documentation at https://www.figma.com/plugin-docs/
337352
- **API Corrections**: `figma.flatten(nodes, parent)` and `node.outlineStroke()` (not figma global methods)

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ Co-authored-by: Claude.AI <[email protected]>
2525
- Use `{type: 'OPERATION', payload: parameters}` pattern
2626
- YAML responses for all tool outputs
2727
- **JSON-RPC**: Always use `error.toString()` never `error.message`
28-
- **Debug Logging**: Use `debugLog()` from `src/utils/logger.ts` for troubleshooting - it safely ignores errors to avoid breaking JSON-RPC communication
28+
- **Debug Logging**:
29+
- Server: Use `logger.debug()` from `src/utils/logger.ts`
30+
- Plugin: Use `logger.debug()` from `figma-plugin/src/logger.ts`
31+
- Both safely ignore errors to avoid breaking JSON-RPC communication
2932

3033
### Code Standards
3134
- Follow existing patterns before creating new ones

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Rather than a thin wrapper around the Figma API, tools are organized for intuiti
2828
- **Core Design:** `figma_nodes`, `figma_text`, `figma_fills`, `figma_strokes`, `figma_effects`
2929
- **Layout & Positioning:** `figma_auto_layout`, `figma_constraints`, `figma_alignment`, `figma_hierarchy`
3030
- **Design System:** `figma_styles`, `figma_components`, `figma_instances`, `figma_variables`, `figma_fonts`
31-
- **Advanced Operations:** `figma_boolean_operations`, `figma_vector_operations`
31+
- **Advanced Operations:** `figma_boolean_operations`, `figma_vectors`
3232
- **Developer Tools:** `figma_dev_resources`, `figma_annotations`, `figma_measurements`, `figma_exports`
3333
- **System:** `figma_plugin_status`, `figma_pages`, `figma_selection`
3434

@@ -117,9 +117,10 @@ Open Claude Desktop and use any of the 24 available tools to design programmatic
117117
- "Build icon libraries with consistent stroke-to-fill conversion"
118118

119119
### Vector Operations
120-
- "Create custom icons with SVG paths and flatten complex shapes"
121-
- "Convert stroke outlines to filled paths for better scaling"
122-
- "Extract vector paths from existing shapes for modification"
120+
- "Create and edit vector shapes with vertices, paths, and bezier curves"
121+
- "Convert shapes, strokes, and text to editable vector paths"
122+
- "Extract or explode vector elements into separate shapes"
123+
- "Flatten multiple vectors into single optimized paths"
123124

124125
### Developer Handoff
125126
- "Add annotations and measurements, generate CSS for developers"
@@ -141,7 +142,7 @@ Open Claude Desktop and use any of the 24 available tools to design programmatic
141142
## 📚 Documentation
142143

143144
- **[Complete Guide](docs/guide.md)** - Setup, tools, examples, and development
144-
- **[Examples](docs/examples.md)** - Quick command reference
145+
- **[Examples](docs/examples.md)** - Common design tasks with natural language
145146
- **[Configuration](docs/configuration.md)** - Advanced server settings
146147
- **[Development](docs/development.md)** - Technical reference for contributors
147148
- **[Changelog](CHANGELOG.md)** - Version history and updates

docs/examples.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ Quick reference for common Figma design tasks using natural language.
113113
## Vector Operations
114114

115115
```
116-
"Create path: M 0 0 L 100 0 L 100 100 Z"
117-
"Outline this text"
118-
"Outline stroke on shape"
119-
"Convert to vector network"
116+
"Create triangle vector with vertices at 0,0 100,0 50,100"
117+
"Convert this rectangle to editable vector"
118+
"Outline this text for custom editing"
119+
"Extract path 2 from complex vector"
120+
"Explode vector into separate shapes"
121+
"Flatten these vectors into one"
122+
"Convert stroke to filled outline"
120123
```
121124

122125
## Export

docs/guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ npm run dev # Development mode
138138

139139
### Advanced
140140
- `figma_boolean_operations` - Union/subtract/intersect
141-
- `figma_vector_operations` - Paths and outlines
141+
- `figma_vectors` - Create/edit vectors, convert shapes/text, extract elements
142142
- `figma_exports` - Export assets
143143
- `figma_dev_resources` - CSS generation
144144
- `figma_plugin_status` - Connection status

figma-plugin/src/generated-operations.ts

Lines changed: 0 additions & 109 deletions
This file was deleted.

figma-plugin/src/logger.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,3 @@ class PluginLogger {
141141
// Export singleton logger instance
142142
export const logger = new PluginLogger();
143143

144-
// Export legacy function for backward compatibility
145-
export function pluginLog(message: string, type: LogType = 'message', data?: any) {
146-
logger.log(message, type, data);
147-
}

figma-plugin/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class FigmaPlugin {
2222

2323
private initializePlugin(): void {
2424
try {
25-
// logger.debug('Initializing plugin with auto-discovery router...');
26-
2725
// Initialize the operation router (now synchronous)
2826
operationRouter.initialize();
2927

figma-plugin/src/operation-router.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ class OperationRouter {
1818
* Initialize the router by discovering all operations
1919
*/
2020
initialize(): void {
21-
// logger.debug('🔍 Auto-discovering operations...');
2221

2322
try {
2423
this.operations = this.importOperations();
2524
const operationCount = Object.keys(this.operations).length;
2625

27-
// logger.debug(`✅ Auto-discovered ${operationCount} operations:`,
28-
// Object.keys(this.operations).sort());
2926
} catch (error) {
3027
logger.error('❌ Failed to initialize operation router:', error);
3128
throw error;
@@ -45,7 +42,6 @@ class OperationRouter {
4542
fileName !== 'base-operation'
4643
);
4744

48-
// logger.debug(`📁 Loading ${operationFiles.length} operation files from ${OPERATION_FILES.length} total files`);
4945

5046
// Import each operation module synchronously
5147
for (const fileName of operationFiles) {
@@ -56,7 +52,6 @@ class OperationRouter {
5652
for (const [exportName, exportValue] of Object.entries(module)) {
5753
if (typeof exportValue === 'function' && this.isValidOperationName(exportName)) {
5854
operations[exportName] = exportValue as OperationHandler;
59-
// logger.debug(`📝 Registered operation: ${exportName} (from ${fileName})`);
6055
}
6156
}
6257

0 commit comments

Comments
 (0)