figma-console-mcp 1.15.2 → 1.15.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AA6EH;;;GAGG;AACH,cAAM,oBAAoB;IACzB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,cAAc,CAA+C;IACrE,uGAAuG;IACvG,OAAO,CAAC,YAAY,CAAuB;IAC3C,6DAA6D;IAC7D,OAAO,CAAC,eAAe,CAA2B;IAClD,8EAA8E;IAC9E,OAAO,CAAC,gBAAgB,CAA+C;IACvE,OAAO,CAAC,MAAM,CAAe;IAI7B,OAAO,CAAC,cAAc,CAMR;;IA2Ed;;OAEG;YACW,WAAW;IA0BzB;;;OAGG;YACW,mBAAmB;IA6CjC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;OAEG;YACW,iBAAiB;IAqB/B,wDAAwD;IACxD,OAAO,CAAC,gBAAgB,CAAuB;IAE/C;;;OAGG;IACH,OAAO,CAAC,aAAa;IAgBrB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAuB1B;;OAEG;YACW,iBAAiB;IA+I/B;;OAEG;IACH,OAAO,CAAC,aAAa;IA09KrB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgK5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgC/B;AAoED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAiFH;;;GAGG;AACH,cAAM,oBAAoB;IACzB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,cAAc,CAA+C;IACrE,uGAAuG;IACvG,OAAO,CAAC,YAAY,CAAuB;IAC3C,6DAA6D;IAC7D,OAAO,CAAC,eAAe,CAA2B;IAClD,8EAA8E;IAC9E,OAAO,CAAC,gBAAgB,CAA+C;IACvE,OAAO,CAAC,MAAM,CAAe;IAI7B,OAAO,CAAC,cAAc,CAMR;;IA2Ed;;OAEG;YACW,WAAW;IA0BzB;;;OAGG;YACW,mBAAmB;IA6CjC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;OAEG;YACW,iBAAiB;IAqB/B,wDAAwD;IACxD,OAAO,CAAC,gBAAgB,CAAuB;IAE/C;;;OAGG;IACH,OAAO,CAAC,aAAa;IAgBrB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAuB1B;;OAEG;YACW,iBAAiB;IA+I/B;;OAEG;IACH,OAAO,CAAC,aAAa;IA09KrB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgK5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgC/B;AA4ED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
package/dist/local.js CHANGED
@@ -55,8 +55,13 @@ function setupStablePluginDir(sourcePluginDir) {
55
55
  }
56
56
  }
57
57
  // Write a version marker so we can detect stale copies
58
- const pkg = JSON.parse(readFileSync(join(sourcePluginDir, "..", "package.json"), "utf-8"));
59
- writeFileSync(join(stableDir, ".version"), pkg.version, "utf-8");
58
+ try {
59
+ const pkg = JSON.parse(readFileSync(join(sourcePluginDir, "..", "package.json"), "utf-8"));
60
+ writeFileSync(join(stableDir, ".version"), pkg.version, "utf-8");
61
+ }
62
+ catch {
63
+ // Non-critical — version marker is for diagnostics only
64
+ }
60
65
  logger.info({ stableDir }, "Plugin files copied to stable directory");
61
66
  return join(stableDir, "manifest.json");
62
67
  }
@@ -5131,28 +5136,35 @@ const currentFile = fileURLToPath(import.meta.url);
5131
5136
  const entryFile = process.argv[1] ? realpathSync(resolve(process.argv[1])) : "";
5132
5137
  if (currentFile === entryFile) {
5133
5138
  // Handle --print-path: print the Desktop Bridge manifest path and exit.
5134
- // Copies plugin files to the stable directory and prints that path so users
5135
- // import the bootloader version (which auto-updates on every launch).
5139
+ // MUST always print a path and exit never fall through to main().
5136
5140
  if (process.argv.includes("--print-path")) {
5137
- const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
5138
- const sourceDir = resolve(packageRoot, "figma-desktop-bridge");
5139
- // Ensure stable directory exists with latest files
5140
- const stablePath = setupStablePluginDir(sourceDir);
5141
- if (stablePath && existsSync(stablePath)) {
5142
- console.log(stablePath);
5143
- console.error("\nImport this manifest in Figma once — the bootloader will\n" +
5144
- "automatically load the latest UI from the MCP server.\n" +
5145
- "You won't need to re-import when the server updates.");
5146
- process.exit(0);
5147
- }
5148
- // Fallback to npm package path if stable dir setup failed
5149
- const manifestPath = resolve(sourceDir, "manifest.json");
5150
- if (existsSync(manifestPath)) {
5151
- console.log(manifestPath);
5141
+ try {
5142
+ const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
5143
+ const sourceDir = resolve(packageRoot, "figma-desktop-bridge");
5144
+ // Try to set up stable directory with bootloader files
5145
+ const stablePath = setupStablePluginDir(sourceDir);
5146
+ if (stablePath && existsSync(stablePath)) {
5147
+ console.log(stablePath);
5148
+ console.error("\nImport this manifest in Figma once the bootloader will\n" +
5149
+ "automatically load the latest UI from the MCP server.\n" +
5150
+ "You won't need to re-import when the server updates.");
5151
+ process.exit(0);
5152
+ }
5153
+ // Fallback to npm package path
5154
+ const manifestPath = resolve(sourceDir, "manifest.json");
5155
+ if (existsSync(manifestPath)) {
5156
+ console.log(manifestPath);
5157
+ process.exit(0);
5158
+ }
5159
+ // Last resort: print the stable dir path even if it doesn't exist yet
5160
+ // (the server will create it on first startup)
5161
+ const stableDir = join(homedir(), ".figma-console-mcp", "plugin", "manifest.json");
5162
+ console.log(stableDir);
5163
+ console.error("\nNote: This path will be populated when the MCP server starts.");
5152
5164
  process.exit(0);
5153
5165
  }
5154
- else {
5155
- console.error("figma-desktop-bridge/manifest.json not found at:", manifestPath);
5166
+ catch (error) {
5167
+ console.error("Error resolving plugin path:", error);
5156
5168
  process.exit(1);
5157
5169
  }
5158
5170
  }