@nodii/dev 0.6.108 → 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 +20 -2
- 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
|
|
@@ -716,6 +718,16 @@ const REGISTER_REFUSALS = {
|
|
|
716
718
|
FIGMA_FILE_NOT_READABLE: (key) => `Dev's Figma account can't read ${key}; share the file with that account.`,
|
|
717
719
|
};
|
|
718
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
|
+
|
|
719
731
|
const FILE_RETIRE_USAGE = "figma file retire FILE_KEY --reason TEXT";
|
|
720
732
|
export async function figmaFileRetire(value, reason, { request = devRequest } = {}) {
|
|
721
733
|
if (!value || typeof reason !== "string" || !reason.trim()) throw new CliError("USAGE", FILE_RETIRE_USAGE, 2);
|
|
@@ -1316,7 +1328,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1316
1328
|
// One publish covers every set awaiting publish on the file (MW1-57.8); a
|
|
1317
1329
|
// change set id keeps the per-set route.
|
|
1318
1330
|
if (action === "published" && rest[0] && !isChangeSetId(rest[0]))
|
|
1319
|
-
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));
|
|
1320
1332
|
// --dry-run runs Dev's dry run of the submit gate (design check --change-set)
|
|
1321
1333
|
// on the same body, and never writes (CLI-18).
|
|
1322
1334
|
const dryRun = async (id, text, file) => {
|
|
@@ -1379,6 +1391,12 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1379
1391
|
if (action === "log-write")
|
|
1380
1392
|
return emit(await figmaLogWrite(rest[0], requireFlag(f, "tool"), requireFlag(f, "nodes").split(",").filter(Boolean)), json);
|
|
1381
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
|
+
}
|
|
1382
1400
|
if (action === "apply" && f["lane-reads"]) {
|
|
1383
1401
|
const laneReads = await readLaneReads(f["lane-reads"]);
|
|
1384
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");
|