figma2mobile-local 0.1.3 → 0.1.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.
package/README.md CHANGED
@@ -287,4 +287,4 @@ malware — either is fine.
287
287
 
288
288
  ---
289
289
 
290
- Node ≥ 18. Build: c5bd9a3-20260802103746
290
+ Node ≥ 18. Build: d5f26d8-20260802104924
package/integrity.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "buildId": "c5bd9a3-20260802103746",
3
- "bundleSha256": "f94cceaed9831ccd05a2fd96daecdc42848d55c4f06390fea8a1009fee728a54"
2
+ "buildId": "d5f26d8-20260802104924",
3
+ "bundleSha256": "7cca3a82acc4f5a774d057dee76d6109c7ac07314431536bd837f06a83167669"
4
4
  }
package/loader.cjs CHANGED
@@ -16,7 +16,7 @@ const path = require("node:path");
16
16
  const crypto = require("node:crypto");
17
17
  const readline = require("node:readline");
18
18
 
19
- const BUILD_ID = "c5bd9a3-20260802103746"; // pack-npx.sh thay bang build id that
19
+ const BUILD_ID = "d5f26d8-20260802104924"; // pack-npx.sh thay bang build id that
20
20
  const ROOT = __dirname;
21
21
  const BUNDLE = path.join(ROOT, "main.obf.cjs");
22
22
 
@@ -292,39 +292,39 @@ async function pickAgentsClack(clack) {
292
292
  }
293
293
 
294
294
  // Build the manual-config + Figma-import guide (reused by clack note & plain out).
295
- function guideText(manifestPath, hasSkill, target) {
295
+ // Short, always-shown: the only manual steps left after auto-register.
296
+ function figmaSteps(manifestPath) {
297
+ return [
298
+ "1. Open Figma Desktop (Figma web cannot reach localhost).",
299
+ "2. Menu > Plugins > Development > Import plugin from manifest...",
300
+ "3. Select this file:",
301
+ ` ${manifestPath}`,
302
+ "4. Run: Plugins > Development > Figma2Mobile Local",
303
+ ].join("\n");
304
+ }
305
+
306
+ // Verbose manual MCP config — only shown when NO agent was auto-registered
307
+ // (otherwise it is noise). Kept compact.
308
+ function manualConfig() {
296
309
  const jsonEntry = JSON.stringify(
297
310
  { mcpServers: { [MCP_NAME]: MCP_ENTRY } },
298
311
  null,
299
312
  2,
300
313
  );
301
314
  const tomlArgs = MCP_ENTRY.args.map((a) => JSON.stringify(a)).join(", ");
302
- const lines = [
303
- `Manual install (other agents, or to verify)${IS_WIN ? " [Windows]" : ""}:`,
304
- " MCP config JSON:",
305
- ...jsonEntry.split("\n").map((l) => ` ${l}`),
315
+ return [
316
+ `JSON (Claude Code / Cursor / Claude Desktop)${IS_WIN ? " [Windows]" : ""}:`,
317
+ ...jsonEntry.split("\n").map((l) => ` ${l}`),
306
318
  "",
307
- ...AGENTS.map((a) => ` ${a.label.padEnd(12)} ${a.manual}`),
308
- " Claude Desktop File: (macOS) ~/Library/Application Support/Claude/claude_desktop_config.json",
309
- " (Windows) %APPDATA%\\Claude\\claude_desktop_config.json",
310
- " (Linux) ~/.config/Claude/claude_desktop_config.json",
311
- " Codex TOML block:",
312
- ` [mcp_servers.${MCP_NAME}]`,
313
- ` command = ${JSON.stringify(MCP_ENTRY.command)}`,
314
- ` args = [${tomlArgs}]`,
319
+ "TOML (Codex CLI · ~/.codex/config.toml):",
320
+ ` [mcp_servers.${MCP_NAME}]`,
321
+ ` command = ${JSON.stringify(MCP_ENTRY.command)}`,
322
+ ` args = [${tomlArgs}]`,
315
323
  "",
316
- "Import the plugin into Figma Desktop:",
317
- " 1. Open Figma Desktop (Figma web cannot reach localhost).",
318
- " 2. Menu > Plugins > Development > Import plugin from manifest...",
319
- ` 3. Select: ${manifestPath}`,
320
- " 4. Run: Plugins > Development > Figma2Mobile Local",
321
- ];
322
- if (hasSkill)
323
- lines.push(
324
- "",
325
- `Native-layout implementation skill: ${path.join(target, "skills")}`,
326
- );
327
- return lines.join("\n");
324
+ "Config file per agent:",
325
+ ...AGENTS.map((a) => ` ${a.label.padEnd(12)} ${a.file}`),
326
+ " Claude Desktop (macOS) ~/Library/Application Support/Claude/claude_desktop_config.json",
327
+ ].join("\n");
328
328
  }
329
329
 
330
330
  async function installPlugin(args) {
@@ -382,44 +382,47 @@ async function installPlugin(args) {
382
382
  }
383
383
  if (spin) spin.stop("MCP config written");
384
384
 
385
- // 4. Report + guide.
385
+ // 4. Report — keep it short. Manual config shown ONLY if nothing was registered.
386
386
  const manifestPath = path.join(target, "plugin", "manifest.json");
387
- const guide = guideText(manifestPath, hasSkill, target);
387
+ const registered = results.filter((r) => !r.error);
388
+ const failed = results.filter((r) => r.error);
388
389
  const verbOf = (s) =>
389
390
  s === "added" ? "added" : s === "updated" ? "updated" : "already present";
390
391
 
391
392
  if (clack) {
392
- const reg = results.length
393
- ? results
394
- .map((r) =>
395
- r.error
396
- ? `✗ ${r.agent.label}: ${r.error}`
397
- : `✓ ${r.agent.label}: ${verbOf(r.state)} -> ${r.agent.file}`,
398
- )
393
+ const reg = registered.length
394
+ ? registered
395
+ .map((r) => `✓ ${r.agent.label} (${verbOf(r.state)})`)
399
396
  .join("\n")
400
- : "No agent selected — plugin extracted only.";
401
- clack.note(`${target}\n\n${reg}`, "Plugin extracted + MCP registered");
402
- clack.note(guide, "Next steps");
397
+ : "No MCP client registered — plugin extracted only.";
398
+ clack.note(reg, "MCP client");
399
+ for (const r of failed) clack.log?.warn?.(`${r.agent.label}: ${r.error}`);
400
+ clack.note(figmaSteps(manifestPath), "Import into Figma Desktop");
401
+ if (!registered.length) clack.note(manualConfig(), "Manual MCP config");
403
402
  clack.outro(
404
- results.length
403
+ registered.length
405
404
  ? "Done. Restart your MCP client, then import the plugin into Figma."
406
- : "Done. Import the plugin into Figma when ready.",
405
+ : "Done. Add the MCP config above, then import the plugin into Figma.",
407
406
  );
408
407
  process.exit(0);
409
408
  }
410
409
 
411
410
  // Plain output (flags / no-TTY / clack unavailable).
412
- out("\n✓ Plugin + skill extracted to:\n");
413
- out(` ${target}\n\n`);
414
- if (results.length) {
415
- out("MCP registered (existing files backed up as .bak-<timestamp>):\n");
416
- for (const r of results) {
417
- if (r.error) out(` ✗ ${r.agent.label}: ${r.error}\n`);
418
- else out(` ✓ ${r.agent.label}: ${verbOf(r.state)} -> ${r.agent.file}\n`);
419
- }
420
- out("\n Restart the agent to load the new MCP server.\n\n");
411
+ out(`\n✓ Plugin extracted → ${target}\n`);
412
+ if (registered.length) {
413
+ out("\nMCP registered (backup .bak-<timestamp>):\n");
414
+ for (const r of registered)
415
+ out(` ✓ ${r.agent.label} (${verbOf(r.state)})\n`);
416
+ out(" Restart your MCP client to load it.\n");
417
+ }
418
+ for (const r of failed) out(` ✗ ${r.agent.label}: ${r.error}\n`);
419
+ out("\nImport into Figma Desktop:\n");
420
+ for (const l of figmaSteps(manifestPath).split("\n")) out(` ${l}\n`);
421
+ if (!registered.length) {
422
+ out("\nManual MCP config:\n");
423
+ for (const l of manualConfig().split("\n")) out(` ${l}\n`);
421
424
  }
422
- out(`${guide}\n\n`);
425
+ out("\n");
423
426
  process.exit(0);
424
427
  }
425
428