@nodii/dev 0.6.133 → 0.6.134
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 +7 -3
- package/dist/core.js +1 -1
- package/dist/figma.js +7 -4
- package/dist/flags.js +1 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -196,7 +196,9 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
196
196
|
# scopes: component:NODE page:NODE section:NODE foundations create:PAGE:NAME;
|
|
197
197
|
# no --scope locks the whole file (DEC-0032)
|
|
198
198
|
figma scope add CHANGE_SET --scope KIND:ID [--scope ...] # widen a held set's scopes
|
|
199
|
-
figma scope set CHANGE_SET --scope KIND:ID [--scope ...]
|
|
199
|
+
figma scope set CHANGE_SET --scope KIND:ID [--scope ...] [--lane-reads FILE]
|
|
200
|
+
# narrow to exactly these; the rest frees. The gate runs on your
|
|
201
|
+
# MCP and REST reads; reads over 8 MB go up to the set in chunks (hub-310)
|
|
200
202
|
figma publish-plan FILE_KEY [--lane-reads FILE]
|
|
201
203
|
# what to publish, and what to leave unchecked in Figma's dialog. With
|
|
202
204
|
# --lane-reads Dev runs no job: it takes your MCP reads, and the version
|
|
@@ -1410,8 +1412,10 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1410
1412
|
if (action === "lock")
|
|
1411
1413
|
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));
|
|
1412
1414
|
if (action === "scope") {
|
|
1413
|
-
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);
|
|
1414
|
-
if (rest[0] === "set")
|
|
1415
|
+
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 ...] (set also takes --lane-reads FILE)", 2);
|
|
1416
|
+
if (rest[0] === "set")
|
|
1417
|
+
return emit(await figmaScopeSet(rest[1], scopesFrom(f), f["lane-reads"] ? { laneReads: await readLaneReads(f["lane-reads"]) } : {}), json, (p) => figmaScopeSetText(rest[1], p.data));
|
|
1418
|
+
if (f["lane-reads"]) throw new CliError("USAGE", "figma scope add does not take --lane-reads: Dev reads nothing to widen a set. Narrowing takes them: figma scope set CHANGE_SET --scope KIND:ID --lane-reads FILE", 2);
|
|
1415
1419
|
return emit(await figmaScopeAdd(rest[1], scopesFrom(f)), json, (p) =>
|
|
1416
1420
|
`${rest[1]} holds ${p.data?.scopes?.length ?? "its"} scope(s)${p.data?.scopes?.length ? `: ${p.data.scopes.map(scopeText).join(", ")}` : ""}`);
|
|
1417
1421
|
}
|
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.134";
|
|
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
|
@@ -706,11 +706,14 @@ export async function figmaScopeAdd(id, scopes, { request = devRequest, laneScop
|
|
|
706
706
|
* sit inside what the set holds: the whole file holds everything, a page its
|
|
707
707
|
* components and creates.
|
|
708
708
|
*/
|
|
709
|
-
export async function figmaScopeSet(id, scopes, { request = devRequest, laneScope = currentLaneFigmaScope } = {}) {
|
|
710
|
-
if (!id || !scopes.length) throw new CliError("USAGE", `figma scope set CHANGE_SET ${SCOPE_USAGE} [--scope ...]`, 2);
|
|
709
|
+
export async function figmaScopeSet(id, scopes, { request = devRequest, laneScope = currentLaneFigmaScope, laneReads, progress } = {}) {
|
|
710
|
+
if (!id || !scopes.length) throw new CliError("USAGE", `figma scope set CHANGE_SET ${SCOPE_USAGE} [--scope ...] [--lane-reads FILE]`, 2);
|
|
711
711
|
await assertChangeSetInLaneScope(id, scopes, request, laneScope);
|
|
712
712
|
try {
|
|
713
|
-
|
|
713
|
+
// MW1-57.11: the narrowing's gate runs on the lane's reads; reads over a
|
|
714
|
+
// chunk go up to the set first and are named by readIds (hub-310).
|
|
715
|
+
const reads = await laneReadsBody(id, laneReads, { request, ...(progress ? { progress } : {}) });
|
|
716
|
+
return await request("PUT", `/api/v1/design/change-sets/${encode(id)}/scopes`, { scopes, ...reads });
|
|
714
717
|
} catch (error) {
|
|
715
718
|
if (error?.code === "SCOPE_NOT_NARROWER")
|
|
716
719
|
throw new CliError(error.code, `${error.message}\nscope set only narrows; to claim more, run nodii-dev figma scope add ${id} --scope ...`, error.exitCode ?? 1, error.details);
|
|
@@ -725,7 +728,7 @@ export async function figmaScopeSet(id, scopes, { request = devRequest, laneScop
|
|
|
725
728
|
error.exitCode ?? 1,
|
|
726
729
|
error.details,
|
|
727
730
|
);
|
|
728
|
-
throw scopeRefusal(error, id) ?? error;
|
|
731
|
+
throw laneReadsRefusal(scopeRefusal(error, id) ?? error);
|
|
729
732
|
}
|
|
730
733
|
}
|
|
731
734
|
|
package/dist/flags.js
CHANGED
|
@@ -75,6 +75,7 @@ export const COMMAND_FLAGS = {
|
|
|
75
75
|
"figma changeset": ["file", "actionable", "all", "limit"],
|
|
76
76
|
"figma apply": ["file", "figma-version", "lane-reads"],
|
|
77
77
|
"figma lock": ["title", "scope", "lane-reads"],
|
|
78
|
+
"figma scope": ["scope", "lane-reads"],
|
|
78
79
|
"surface generate": ["write", "check", "fetch", "all", "module", "type", "figma-version", "report", "post-scoreboard", "resume"],
|
|
79
80
|
};
|
|
80
81
|
|