@nodii/dev 0.6.94 → 0.6.96
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 +1 -1
- package/dist/figma.js +5 -3
- package/dist/hooks.js +2 -2
- package/dist/lane-supervisor.js +7 -1
- package/package.json +1 -1
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.
|
|
7
|
+
export const VERSION = "0.6.96";
|
|
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
|
@@ -194,7 +194,7 @@ export function submitMode(f) {
|
|
|
194
194
|
return Boolean(f.sync);
|
|
195
195
|
}
|
|
196
196
|
const DONE = new Set(["succeeded", "failed"]);
|
|
197
|
-
const jobName = (job) => (job.kind === "conformance" ? "dry run" : job.kind === "resubmit" ? "re-submit" : "submit");
|
|
197
|
+
const jobName = (job) => (job.kind === "conformance" ? "dry run" : job.kind === "resubmit" ? "re-submit" : job.kind === "log_write" ? "logged write" : "submit");
|
|
198
198
|
|
|
199
199
|
export const submitJobPath = (job) => `/api/v1/design/change-sets/${encode(job.changeSetId)}/submit-jobs/${encode(job.id)}`;
|
|
200
200
|
|
|
@@ -744,8 +744,10 @@ export const figmaConformance = (id, body = {}, { request = devRequest, sync = f
|
|
|
744
744
|
changeSetCall(id, (method, path, b) => (sync ? request(method, path, b) : changeSetJob(method, path, b, { changeSetId: id, kind: "conformance", request, ...options })))(
|
|
745
745
|
"POST", `/api/v1/design/change-sets/${encode(id)}/conformance`, body);
|
|
746
746
|
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
/** A large write's placement reads run as a job on Dev (hub-237): this polls it and answers as the plain call does. */
|
|
748
|
+
export const figmaLogWrite = (id, tool, nodeIds, { request, pollRequest, ...options } = {}) =>
|
|
749
|
+
changeSetCall(id, (method, path, body) => (request ? request(method, path, body) : changeSetJob(method, path, body, { changeSetId: id, kind: "log_write", ...(pollRequest ? { request: pollRequest } : {}), ...options })))(
|
|
750
|
+
"POST", `/api/v1/design/change-sets/${encode(id)}/writes`, { tool, nodeIds });
|
|
749
751
|
|
|
750
752
|
/** One publish for the file: every awaiting_publish set on it (MW1-57.8). */
|
|
751
753
|
export async function figmaFilePublished(value, payload, { request = devRequest } = {}) {
|
package/dist/hooks.js
CHANGED
|
@@ -258,7 +258,7 @@ export async function heartbeatCurrentLane(request = devRequest, { cwd = process
|
|
|
258
258
|
if (laneKey) {
|
|
259
259
|
const lane = (await request("GET", `/api/v1/lanes/${encodeURIComponent(laneKey)}`)).data;
|
|
260
260
|
if (lane.repositories?.some((repository) => repository.branch === branch)) {
|
|
261
|
-
await request("POST", `/api/v1/lanes/${encodeURIComponent(lane.id)}/heartbeat`, { via: "nodii-dev" });
|
|
261
|
+
await request("POST", `/api/v1/lanes/${encodeURIComponent(lane.id)}/heartbeat`, { via: "nodii-dev", source: "hook" });
|
|
262
262
|
return { heartbeated: true, key: lane.key };
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -266,7 +266,7 @@ export async function heartbeatCurrentLane(request = devRequest, { cwd = process
|
|
|
266
266
|
const lanes = (await request("GET", "/api/v1/lanes?limit=200")).data ?? [];
|
|
267
267
|
const lane = lanes.find((x) => x.branch === branch && !["on_dev", "stopped"].includes(x.status));
|
|
268
268
|
if (!lane) return { heartbeated: false, reason: "no lane for current branch" };
|
|
269
|
-
await request("POST", `/api/v1/lanes/${encodeURIComponent(lane.id)}/heartbeat`, { via: "nodii-dev" });
|
|
269
|
+
await request("POST", `/api/v1/lanes/${encodeURIComponent(lane.id)}/heartbeat`, { via: "nodii-dev", source: "hook" });
|
|
270
270
|
return { heartbeated: true, key: lane.key };
|
|
271
271
|
}
|
|
272
272
|
|
package/dist/lane-supervisor.js
CHANGED
|
@@ -100,7 +100,13 @@ export const laneBlocked = (lane) => Boolean(laneBlockedReason(lane));
|
|
|
100
100
|
export function laneBlockedReason(lane) {
|
|
101
101
|
const step = (lane?.steps ?? []).find((candidate) => candidate.state === "blocked");
|
|
102
102
|
if (step) return `Lane step ${step.side}/${step.stepKey} is blocked.`;
|
|
103
|
-
|
|
103
|
+
// hub-283: the open waits first, then the latest heartbeat that says something.
|
|
104
|
+
// A noteless or hook heartbeat never clears a WAITING or BLOCKED.
|
|
105
|
+
const waits = (lane?.waits ?? []).map((wait) => wait.targetRef).filter(Boolean);
|
|
106
|
+
if (waits.length) return `Lane waits on ${waits.join(", ")}.`;
|
|
107
|
+
const heartbeat = (lane?.events ?? [])
|
|
108
|
+
.filter((event) => event.type === "heartbeat" && event.metadata?.source !== "hook" && String(event.metadata?.note ?? "").trim())
|
|
109
|
+
.at(-1);
|
|
104
110
|
const note = String(heartbeat?.metadata?.note ?? "");
|
|
105
111
|
return /^\s*blocked\b/i.test(note) || /^\s*WAITING\s*:/.test(note) ? `Lane heartbeat: ${note.slice(0, 500)}` : null;
|
|
106
112
|
}
|