@nodii/dev 0.6.107 → 0.6.109
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 +37 -4
- package/dist/core.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -193,7 +193,9 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
193
193
|
figma scope add CHANGE_SET --scope KIND:ID [--scope ...] # widen a held set's scopes
|
|
194
194
|
figma scope set CHANGE_SET --scope KIND:ID [--scope ...] # narrow to exactly these; the rest frees
|
|
195
195
|
figma publish-plan FILE_KEY # what to publish, and what to leave unchecked in Figma's dialog
|
|
196
|
-
figma published FILE_KEY|CHANGE_SET --figma-version V
|
|
196
|
+
figma published FILE_KEY|CHANGE_SET --figma-version V [--lane-reads FILE]
|
|
197
|
+
# a file key marks every awaiting set published. Dev reads no Figma here:
|
|
198
|
+
# FIGMA_READS_NEEDED names a node to place, or a version it hasn't seen
|
|
197
199
|
figma apply CHANGE_SET --lane-reads FILE
|
|
198
200
|
# MW1-57.11: what you read through the Figma MCP, sent as data. Dev runs its
|
|
199
201
|
# gates on it with no job and no Figma call; FIGMA_READS_NEEDED names what's missing
|
|
@@ -233,7 +235,11 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
233
235
|
# change sets in dependency order (hub-260): each file's sets are actioned
|
|
234
236
|
# in order; NEXT marks the ones an operator can act on now
|
|
235
237
|
figma file add FILE_KEY --name TEXT --kind design-system|surfaces|prototype [--module M]
|
|
236
|
-
# register a Figma file in Dev so it can be locked
|
|
238
|
+
# register a Figma file in Dev so it can be locked; on a registered
|
|
239
|
+
# key, staff or the hub's Steward correct its name, kind or module
|
|
240
|
+
figma file retire FILE_KEY --reason TEXT
|
|
241
|
+
# staff or the hub's Steward: not canonical. Closes its sets still editing
|
|
242
|
+
# or awaiting publish, and refuses new locks
|
|
237
243
|
hook claude-figma-pre|claude-figma-post|safety-pre|safety-post|nudge-pre|nudge-stop|surface-gen-pre|session-start|session-kind|managed-dispatch|claude-managed-dispatch|print-settings
|
|
238
244
|
# session-start and session-kind (first prompt) print the session's kind:
|
|
239
245
|
# lane, coordinator, steward or operator assistant, with its contract (MW1-92)
|
|
@@ -712,6 +718,22 @@ const REGISTER_REFUSALS = {
|
|
|
712
718
|
FIGMA_FILE_NOT_READABLE: (key) => `Dev's Figma account can't read ${key}; share the file with that account.`,
|
|
713
719
|
};
|
|
714
720
|
|
|
721
|
+
// `figma published`: the version is the library's publish, whatever version the
|
|
722
|
+
// reads were made at, so it's always named.
|
|
723
|
+
export async function publishedBody(f) {
|
|
724
|
+
if (f.file) return JSON.parse(await readFile(f.file, "utf8"));
|
|
725
|
+
return {
|
|
726
|
+
figmaVersion: requireFlag(f, "figma-version"),
|
|
727
|
+
...(f["lane-reads"] ? { laneReads: await readLaneReads(f["lane-reads"]) } : {}),
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const FILE_RETIRE_USAGE = "figma file retire FILE_KEY --reason TEXT";
|
|
732
|
+
export async function figmaFileRetire(value, reason, { request = devRequest } = {}) {
|
|
733
|
+
if (!value || typeof reason !== "string" || !reason.trim()) throw new CliError("USAGE", FILE_RETIRE_USAGE, 2);
|
|
734
|
+
return request("POST", `/api/v1/design/files/${encode(figmaFileKey(value))}/retire`, { reason: reason.trim() });
|
|
735
|
+
}
|
|
736
|
+
|
|
715
737
|
export async function figmaFileAdd(value, flags, { request = devRequest } = {}) {
|
|
716
738
|
if (!value) throw new CliError("USAGE", "figma file add FILE_KEY --name TEXT --kind KIND [--module M]", 2);
|
|
717
739
|
const key = figmaFileKey(value);
|
|
@@ -1306,7 +1328,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1306
1328
|
// One publish covers every set awaiting publish on the file (MW1-57.8); a
|
|
1307
1329
|
// change set id keeps the per-set route.
|
|
1308
1330
|
if (action === "published" && rest[0] && !isChangeSetId(rest[0]))
|
|
1309
|
-
return emit(await figmaFilePublished(rest[0],
|
|
1331
|
+
return emit(await figmaFilePublished(rest[0], await publishedBody(f)).catch((error) => { throw laneReadsRefusal(error); }), json, (p) => figmaFilePublishedText(p.data));
|
|
1310
1332
|
// --dry-run runs Dev's dry run of the submit gate (design check --change-set)
|
|
1311
1333
|
// on the same body, and never writes (CLI-18).
|
|
1312
1334
|
const dryRun = async (id, text, file) => {
|
|
@@ -1338,7 +1360,12 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1338
1360
|
[JSON.stringify(p.data, null, 2), ...conformanceLines({ warnings: p.warnings })].join("\n"));
|
|
1339
1361
|
}
|
|
1340
1362
|
if (action === "file") {
|
|
1341
|
-
if (rest[0]
|
|
1363
|
+
if (rest[0] === "retire") {
|
|
1364
|
+
if (rest.length > 2) throw new CliError("USAGE", FILE_RETIRE_USAGE, 2);
|
|
1365
|
+
return emit(await figmaFileRetire(rest[1], f.reason), json, (p) =>
|
|
1366
|
+
`${p.data.fileKey} is retired: ${p.data.retiredReason}.${p.data.abandoned?.length ? ` Closed as abandoned: ${p.data.abandoned.join(", ")}.` : ""}`);
|
|
1367
|
+
}
|
|
1368
|
+
if (rest[0] !== "add") throw new CliError("USAGE", "figma file add FILE_KEY --name TEXT --kind KIND [--module M] | figma file retire FILE_KEY --reason TEXT", 2);
|
|
1342
1369
|
return emit(await figmaFileAdd(rest[1], f), json, (p) =>
|
|
1343
1370
|
`${p.data.fileKey} is registered in Dev: ${p.data.name} (${p.data.kind}${p.data.module ? `, ${p.data.module}` : ""}).`);
|
|
1344
1371
|
}
|
|
@@ -1364,6 +1391,12 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1364
1391
|
if (action === "log-write")
|
|
1365
1392
|
return emit(await figmaLogWrite(rest[0], requireFlag(f, "tool"), requireFlag(f, "nodes").split(",").filter(Boolean)), json);
|
|
1366
1393
|
if (action === "lane-reads-script") return console.log(laneReadsScript(f.nodes));
|
|
1394
|
+
if (action === "published" && f["lane-reads"]) {
|
|
1395
|
+
return emit(
|
|
1396
|
+
await devRequest("POST", `/api/v1/design/change-sets/${encode(rest[0])}/published`, await publishedBody(f)).catch((error) => { throw laneReadsRefusal(error); }),
|
|
1397
|
+
json,
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1367
1400
|
if (action === "apply" && f["lane-reads"]) {
|
|
1368
1401
|
const laneReads = await readLaneReads(f["lane-reads"]);
|
|
1369
1402
|
return emit(
|
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.109";
|
|
8
8
|
export const configPath = () =>
|
|
9
9
|
process.env.NODII_DEV_CONFIG_PATH ??
|
|
10
10
|
join(homedir(), ".config/nodii-dev/config.json");
|