@atelier-ui/create-workspace 0.2.40 → 0.2.42

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.2.42 (2026-09-10)
2
+
3
+ This was a version bump only for create-workspace to align it with other projects, there were no code changes.
4
+
5
+ ## 0.2.41 (2026-09-07)
6
+
7
+ ### 🚀 Features
8
+
9
+ - **create-workspace:** pin figma-console-mcp in the scaffolded .mcp.json ([6b23b2b](https://github.com/DominikPieper/atelier-ui/commit/6b23b2b))
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Claude Fable 5.1
14
+ - Dominik Pieper @DominikPieper
15
+
1
16
  ## 0.2.40 (2026-09-07)
2
17
 
3
18
  This was a version bump only for create-workspace to align it with other projects, there were no code changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelier-ui/create-workspace",
3
- "version": "0.2.40",
3
+ "version": "0.2.42",
4
4
  "description": "Nx preset for Atelier workshop workspaces",
5
5
  "keywords": [
6
6
  "nx",
@@ -205,6 +205,31 @@ function loadMcpEndpoints() {
205
205
  }
206
206
  }
207
207
 
208
+ /**
209
+ * Reads the exact `figma-console-mcp@<version>` pin off the `figma-console`
210
+ * server's `args` in `.mcp.json` — the same file `loadMcpEndpoints()` reads,
211
+ * just a different server shape (`command: npx`, not `type: http`). Returns
212
+ * null when `.mcp.json` is missing, has no `figma-console` entry, or that
213
+ * entry isn't pinned to an exact version (e.g. `@latest`) — every caller
214
+ * treats null as "nothing to compare against," not as a failure.
215
+ */
216
+ function getPinnedFigmaConsoleVersion() {
217
+ const mcpPath = resolve(ROOT, '.mcp.json');
218
+ if (!existsSync(mcpPath)) return null;
219
+ try {
220
+ const config = JSON.parse(readFileSync(mcpPath, 'utf8'));
221
+ const args = config.mcpServers?.['figma-console']?.args;
222
+ if (!Array.isArray(args)) return null;
223
+ for (const arg of args) {
224
+ const match = /^figma-console-mcp@(\d+\.\d+\.\d+)$/.exec(arg);
225
+ if (match) return match[1];
226
+ }
227
+ return null;
228
+ } catch {
229
+ return null;
230
+ }
231
+ }
232
+
208
233
  // ── Checks ───────────────────────────────────────────────────────────
209
234
  function checkNode() {
210
235
  const required = { major: 22, minor: 12, patch: 0 };
@@ -275,16 +300,49 @@ function checkClaudeCli() {
275
300
  async function checkFigmaSetup() {
276
301
  // 1. Desktop Bridge plugin manifest — the primary channel.
277
302
  const manifestPath = join(homedir(), '.figma-console-mcp', 'plugin', 'manifest.json');
303
+ const pinnedVersion = getPinnedFigmaConsoleVersion();
304
+ const pinnedSpec = pinnedVersion ? `figma-console-mcp@${pinnedVersion}` : 'figma-console-mcp@latest';
278
305
  if (existsSync(manifestPath)) {
279
306
  ok('Figma Desktop Bridge plugin', `manifest at ${manifestPath}`);
280
307
  } else {
281
308
  warn(
282
309
  'Figma Desktop Bridge plugin',
283
310
  'manifest not found',
284
- 'Run `npx -y figma-console-mcp@latest --help` once, then Figma → Plugins → Development → Import plugin from manifest…',
311
+ `Run \`npx -y ${pinnedSpec} --help\` once, then Figma → Plugins → Development → Import plugin from manifest…`,
285
312
  );
286
313
  }
287
314
 
315
+ // 1b. .version marker vs. the exact version .mcp.json pins. The package
316
+ // writes this file (setupStablePluginDir(), dist/local.js) specifically so
317
+ // staleness between "what the npm package installed on disk" and "what
318
+ // this workspace is pinned to" can be detected — nothing read it back
319
+ // until now. This is a warning, not a hard failure: a stale on-disk build
320
+ // does not block the workshop (the Bridge still connects and runs), and
321
+ // the files self-heal on the next `figma-console-mcp` server start anyway
322
+ // — treating it as fatal would fail preflight over something that fixes
323
+ // itself the moment Claude Code (re)starts the MCP.
324
+ if (existsSync(manifestPath)) {
325
+ const versionPath = join(homedir(), '.figma-console-mcp', 'plugin', '.version');
326
+ if (!existsSync(versionPath)) {
327
+ warn(
328
+ 'Plugin files .version marker',
329
+ 'manifest exists but no .version file next to it',
330
+ `Run \`npx -y ${pinnedSpec} --help\` once to refresh ~/.figma-console-mcp/plugin/ with a current build`,
331
+ );
332
+ } else if (pinnedVersion) {
333
+ const diskVersion = readFileSync(versionPath, 'utf8').trim();
334
+ if (diskVersion === pinnedVersion) {
335
+ ok('Plugin files vs. .mcp.json pin', `both ${diskVersion}`);
336
+ } else {
337
+ warn(
338
+ 'Plugin files vs. .mcp.json pin',
339
+ `on-disk .version is ${diskVersion}, .mcp.json pins ${pinnedVersion}`,
340
+ `Run \`npx -y ${pinnedSpec} --help\` once to refresh the files, then re-run (or re-import) the plugin in Figma Desktop — see https://atelier.pieper.io/runbook#plugin-update`,
341
+ );
342
+ }
343
+ }
344
+ }
345
+
288
346
  // 2. Bridge WebSocket port range — at least one port must be usable.
289
347
  const bridgePorts = [9223, 9224, 9225, 9226, 9227, 9228, 9229, 9230, 9231, 9232];
290
348
  let freeCount = 0;
@@ -238,7 +238,7 @@ file exports). The Desktop Bridge covers creation and inspection without a token
238
238
  // optional — only needed for REST-backed reads. See ${SITE_URL}/figma-token.
239
239
  mcpServers['figma-console'] = {
240
240
  command: 'npx',
241
- args: ['-y', 'figma-console-mcp@latest'],
241
+ args: ['-y', 'figma-console-mcp@1.40.0'],
242
242
  env: {
243
243
  FIGMA_ACCESS_TOKEN: '${FIGMA_ACCESS_TOKEN:-}',
244
244
  ENABLE_MCP_APPS: 'true',