-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-figma-console.js
More file actions
55 lines (53 loc) · 1.48 KB
/
test-figma-console.js
File metadata and controls
55 lines (53 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Figma Plugin Console Test Script
*
* PURPOSE: Test if the plugin is receiving and processing JSON
*
* USAGE:
* 1. Open Figma plugin
* 2. Open Figma Plugin Console: Plugins → Development → Show/Hide Console
* 3. In the plugin UI textarea, paste the test JSON below
* 4. Click Convert
* 5. Check the console output
*
* EXPECTED OUTPUT:
* 🚀 Plugin code.ts loaded and running
* 📡 Setting up message listener...
* 📨 Message received from UI: convert-json
* 📦 Full message: {...}
* ✅ convert-json message detected
* 🔍 JSON Data received: {"type":"CANVAS"...
* 🔍 JSON type: CANVAS
* 🔍 Has children: true
* 🔍 Children count: 1
* ✅ Creating node: body
* 📐 Position: x=0, y=0, width=100, height=100
*/
// Minimal test JSON for debugging
const testJson = {
"type": "CANVAS",
"name": "Debug Test",
"children": [
{
"type": "body",
"text": "Hello World",
"styles": {
"backgroundColor": "rgb(255, 255, 255)",
"fontSize": "16px",
"color": "rgb(0, 0, 0)"
},
"position": {
"absolute": {
"x": 0,
"y": 0,
"width": 200,
"height": 100
}
}
}
]
};
console.log('📋 TEST JSON - Copy this into the plugin:');
console.log(JSON.stringify(testJson, null, 2));
console.log('\n✅ Test JSON ready - paste into Figma plugin textarea and click Convert');
console.log('📡 Watch the Figma Plugin Console for logs starting with 🚀 and 📨');