@nodii/dev 0.6.106 → 0.6.107

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/dist/cli.js CHANGED
@@ -187,7 +187,7 @@ Usage: nodii-dev <command> [options] [--json]
187
187
  # --all --fetch skips and reports a Surface that is not published;
188
188
  # --post-scoreboard comments the per-module scoreboard on the issue;
189
189
  # a 429 stops the read, and --fetch --write --resume keeps what is saved
190
- figma lock FILE_KEY --title TEXT [--scope KIND:ID ...]
190
+ figma lock FILE_KEY --title TEXT [--scope KIND:ID ...] [--lane-reads FILE]
191
191
  # scopes: component:NODE page:NODE section:NODE foundations create:PAGE:NAME;
192
192
  # no --scope locks the whole file (DEC-0032)
193
193
  figma scope add CHANGE_SET --scope KIND:ID [--scope ...] # widen a held set's scopes
@@ -1292,7 +1292,7 @@ export async function main(argv = process.argv.slice(2)) {
1292
1292
  }
1293
1293
  if (command === "figma") {
1294
1294
  if (action === "lock")
1295
- return emit(await figmaLock(rest[0], requireFlag(f, "title"), { scopes: scopesFrom(f) }), json, (p) => figmaLockText(p.data));
1295
+ return emit(await figmaLock(rest[0], requireFlag(f, "title"), { scopes: scopesFrom(f), ...(f["lane-reads"] ? { laneReads: await readLaneReads(f["lane-reads"]) } : {}) }).catch((error) => { throw laneReadsRefusal(error); }), json, (p) => figmaLockText(p.data));
1296
1296
  if (action === "scope") {
1297
1297
  if (!["add", "set"].includes(rest[0]) || !rest[1] || rest.length > 2) throw new CliError("USAGE", "figma scope add|set CHANGE_SET --scope KIND:ID [--scope ...]", 2);
1298
1298
  if (rest[0] === "set") return emit(await figmaScopeSet(rest[1], scopesFrom(f)), json, (p) => figmaScopeSetText(rest[1], p.data));
package/dist/core.js CHANGED
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
4
4
  import { homedir, platform } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
 
7
- export const VERSION = "0.6.106";
7
+ export const VERSION = "0.6.107";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
package/dist/figma.js CHANGED
@@ -642,13 +642,14 @@ export const holdsSet = (check) => Boolean(check?.changeSetId) && (check.allowed
642
642
 
643
643
  const isWholeFile = (scopes) => !scopes?.length || scopes.some((s) => s.kind === "file");
644
644
 
645
- export async function figmaLock(value, title, { scopes = [], request = devRequest, laneScope = currentLaneFigmaScope } = {}) {
645
+ export async function figmaLock(value, title, { scopes = [], request = devRequest, laneScope = currentLaneFigmaScope, laneReads } = {}) {
646
646
  const key = figmaFileKey(value);
647
647
  // The lane's Freeze bounds which files and component sets it may lock.
648
648
  await assertWithinLaneScope(await laneScope({}, { request }), key, scopes);
649
649
  const result = await fileCall(key, request)("POST", `/api/v1/design/files/${encode(key)}/lock`, {
650
650
  changeSetTitle: title,
651
651
  ...(scopes.length ? { scopes } : {}),
652
+ ...(laneReads ? { laneReads } : {}),
652
653
  });
653
654
  // A Dev that doesn't know scopes ignores them and locks the whole file,
654
655
  // which blocks every other lane: say so loudly instead of exiting 0.
@@ -1005,7 +1006,7 @@ export function laneReadsScript(nodes) {
1005
1006
  const ids = nodeIdList(nodes);
1006
1007
  if (!ids.length) throw new CliError("USAGE", "figma lane-reads-script --nodes ID[,ID]", 2);
1007
1008
  return `// Run through the Figma MCP's use_figma. It only reads. Set figmaVersion in the
1008
- // result to the version you read at (nodii-dev figma changeset show), and add
1009
+ // result to the version you read at (for a new claim, the file's newest version), and add
1009
1010
  // base: { atBase, offBase, how } if Dev asks for a base comparison.
1010
1011
  const ids = ${JSON.stringify(ids)};
1011
1012
  const nodes = [];
@@ -1036,6 +1037,7 @@ for (const id of ids) {
1036
1037
  topComponent: top ? { id: top.id, name: top.name } : null,
1037
1038
  });
1038
1039
  }
1039
- return { figmaVersion: "SET-ME", nodes, gone };
1040
+ const pages = figma.root.children.map((page) => ({ id: page.id, name: page.name }));
1041
+ return { figmaVersion: "SET-ME", pages, nodes, gone };
1040
1042
  `;
1041
1043
  }
package/dist/flags.js CHANGED
@@ -72,7 +72,7 @@ export const COMMAND_FLAGS = {
72
72
  // hub-260: list takes these; show takes none.
73
73
  "figma changeset": ["file", "actionable", "all", "limit"],
74
74
  "figma apply": ["file", "figma-version", "lane-reads"],
75
- "figma lock": ["title", "scope"],
75
+ "figma lock": ["title", "scope", "lane-reads"],
76
76
  "surface generate": ["write", "check", "fetch", "all", "module", "type", "figma-version", "report", "post-scoreboard", "resume"],
77
77
  };
78
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.106",
3
+ "version": "0.6.107",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {