@todoforai/figma-api 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/bridge.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/figma-api",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Figma CLI — full REST API wrapper (files, comments, variables, webhooks…) plus a plugin bridge for canvas writes.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/bridge.ts CHANGED
@@ -34,6 +34,11 @@ function json(body: unknown, status = 200): Response {
34
34
  export function startBridge(port: number): void {
35
35
  Bun.serve({
36
36
  port,
37
+ // Bun's default idleTimeout (10s) is shorter than our 25s /poll long-poll and
38
+ // 30s /cmd result-wait, so it would sever those connections mid-wait — making
39
+ // the plugin's fetch throw ("Relay unreachable") and commands silently time
40
+ // out. Hold connections long enough to cover both.
41
+ idleTimeout: 60,
37
42
  async fetch(req) {
38
43
  const url = new URL(req.url);
39
44
  if (req.method === "OPTIONS") return json({}, 204);