@nodii/dev 0.6.74 → 0.6.75

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/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.74";
7
+ export const VERSION = "0.6.75";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
package/dist/design.js CHANGED
@@ -86,7 +86,7 @@ export function surfacesBehindText(p) {
86
86
  /** The Figma token: FIGMA_PAT, as the design-system scripts read it, or FIGMA_TOKEN. Never printed. */
87
87
  export function figmaToken(env = process.env) {
88
88
  const token = env.FIGMA_PAT || env.FIGMA_TOKEN;
89
- if (!token) throw new CliError("FIGMA_TOKEN_REQUIRED", "design check reads the file from Figma's REST API: set FIGMA_PAT to a Figma personal access token that can read the file.", 2);
89
+ if (!token) throw new CliError("FIGMA_TOKEN_REQUIRED", "design check reads the file from Figma's REST API: set FIGMA_PAT to a Figma personal access token that can read the file. nodii-dev reads FIGMA_PAT (or FIGMA_TOKEN) from the process environment only, never from a file; a lane worktree has no .env.local of its own, so export it in the shell that runs the command, for example from the main checkout's .env.local.", 2);
90
90
  return token;
91
91
  }
92
92
 
package/dist/lanes.js CHANGED
@@ -675,11 +675,14 @@ export async function laneCommand(action, args, flags, deps = {}) {
675
675
  // A --gate flag on lane review is a claim, not a run, so it signs nothing. Their scope, stack and
676
676
  // auth posture are unknown to this tool, so a test receipt comes from receipt write or the stack tool.
677
677
  const gatesRun = ranGates.map((command) => ({ command, exitCode: 0 }));
678
+ // A body with checks carries no exitReason (Dev computes it), so the receipt
679
+ // takes the outcome Dev will compute (NODII-DEV-CLI-66).
680
+ const exitReason = body.exitReason ?? (body.checks?.length ? runOutcome(body.checks) : undefined);
678
681
  const attachReceipt = await signReceipt?.(ref, "review", { commit: body.head, ...(cwd ? { cwd } : {}), details: {
679
682
  checks: [...gatesRun, ...(body.checks?.length
680
683
  ? body.checks.map((check) => ({ name: check.check, outcome: check.outcome, exitCode: runOutcome([check]) === "CLEAN" ? 0 : 1 }))
681
- : [{ name: "review", outcome: body.exitReason, exitCode: ["CLEAN", "NOT_REQUIRED"].includes(body.exitReason) ? 0 : 1 }])],
682
- review: { exitReason: body.exitReason, base: body.base, head: body.head, findings: body.findings?.length ?? 0 },
684
+ : [{ name: "review", outcome: exitReason, exitCode: ["CLEAN", "NOT_REQUIRED"].includes(exitReason) ? 0 : 1 }])],
685
+ review: { exitReason, base: body.base, head: body.head, findings: body.findings?.length ?? 0 },
683
686
  } });
684
687
  await attachReceipt?.();
685
688
  const payload = await request("POST", `/api/v1/lanes/${encode(id)}/review`, body);
package/dist/review.js CHANGED
@@ -483,11 +483,23 @@ export async function figmaFindings(figma, { catalog, check, changeSets = {} })
483
483
  frameUrl: frameUrl(frame.fileKey, frame.nodeId ?? finding.nodeId),
484
484
  state: frame.state,
485
485
  });
486
+ // A component key Figma can't resolve is a finding, never a frame without
487
+ // its url (NODII-DEV-CLI-66). Minor: nothing was checked against a main.
488
+ for (const warning of data.warnings ?? [])
489
+ findings.push({
490
+ perspective: "figma",
491
+ severity: "minor",
492
+ summary: `${warning.check} at ${warning.nodeId}`.slice(0, 500),
493
+ detail: (warning.detail || warning.check).slice(0, 10_000),
494
+ frameUrl: frameUrl(frame.fileKey, frame.nodeId ?? warning.nodeId),
495
+ state: frame.state,
496
+ });
486
497
  }
487
498
  return {
488
499
  findings,
489
500
  inputs: {
490
- frames: frames.map((frame) => ({ fileKey: frame.fileKey, nodeId: frame.nodeId, state: frame.state, frameUrl: frame.nodeId ? frameUrl(frame.fileKey, frame.nodeId) : `https://www.figma.com/design/${frame.fileKey}` })),
501
+ // Dev's check contract names a frame by url and state.
502
+ frames: frames.map((frame) => ({ fileKey: frame.fileKey, nodeId: frame.nodeId, state: frame.state, url: frame.nodeId ? frameUrl(frame.fileKey, frame.nodeId) : `https://www.figma.com/design/${frame.fileKey}` })),
491
503
  libraryVersions: [...versions],
492
504
  frameComparison: "not_built",
493
505
  ...(scopedFrames.length ? { changeSets: Object.entries(changeSets).map(([fileKey, scoped]) => ({ fileKey, ids: scoped.changeSets, nodes: scoped.nodes.length })), rule: "MW2-38.3" } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.74",
3
+ "version": "0.6.75",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {