@nodii/dev 0.6.61 → 0.6.62

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 CHANGED
@@ -60,7 +60,7 @@ import { tuneCommand } from "./tune.js";
60
60
  import { PICKER_MODEL, TUNING_MODELS, measurePickerLatency, pickTimingStats, pickTimingText, pickTimingsPath, readPickTimings } from "./gather.js";
61
61
  import { docsCommand, rulebookCommand, rulesCommand } from "./upload.js";
62
62
  import { changeSetCommand, guidelineCommand } from "./guidelines.js";
63
- import { designCheck, designCheckChangeSet, designCheckText, designRoles, designRolesText } from "./design.js";
63
+ import { designCheck, designCheckChangeSet, designCheckText, designRoles, designRolesText, surfacesBehind, surfacesBehindText } from "./design.js";
64
64
  import { assertKnownFlags } from "./flags.js";
65
65
  import { watchdogCommand } from "./watchdog.js";
66
66
  import { machineCapacityCommand } from "./accounts.js";
@@ -128,6 +128,9 @@ Usage: nodii-dev <command> [options] [--json]
128
128
  design guideline propose ENTRY --file FILE.md [--summary TEXT] [--dry-run]
129
129
  design changeset list [--entry KEY] [--state STATE] | show ID
130
130
  design roles [ROLE ...] # the role map: each UI role's one DS component (MW6-14)
131
+ design surfaces behind [--behind] # each Surfaces file and the DS publishes it hasn't taken, with
132
+ # its Surfaces sync issue (MW8-8); lane land refuses a lane whose
133
+ # DS change reaches a file without its approved change set
131
134
  design check FILE_KEY|LINK [--nodes A,B] [--roles R,S] [--library]
132
135
  # the DS conformance check Dev's submit runs, before you submit;
133
136
  # reads Figma with FIGMA_PAT; exit 1 = DS_CONFORMANCE_FAILED or an error (--json: data.passed)
@@ -743,6 +746,10 @@ export async function main(argv = process.argv.slice(2)) {
743
746
  }
744
747
  if (command === "design" && action === "changeset") return emitCommand(await changeSetCommand(rest[0], rest.slice(1), f));
745
748
  if (command === "design" && action === "roles") return emit(await designRoles(rest), json, designRolesText);
749
+ if (command === "design" && action === "surfaces") {
750
+ if (rest[0] !== "behind" || rest.length > 1) throw new CliError("USAGE", "Usage: nodii-dev design surfaces behind [--behind]", 2);
751
+ return emit(await surfacesBehind({ onlyBehind: Boolean(f.behind) }), json, surfacesBehindText);
752
+ }
746
753
  if (command === "design" && action === "check") {
747
754
  if ((!rest[0] && f["change-set"] === undefined) || rest.length > 1)
748
755
  throw new CliError("USAGE", "design check FILE_KEY|LINK [--nodes A,B] [--roles R,S] [--library] | design check --change-set CS [--file SUBMIT.json] [--figma-version V] [--sync]", 2);
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.61";
7
+ export const VERSION = "0.6.62";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
@@ -222,7 +222,7 @@ export async function checkLogin() {
222
222
  export const encode = (value) => encodeURIComponent(value);
223
223
  // Switches never take the next token as their value, so
224
224
  // `docs upload --wait rulebook/` keeps rulebook/ as a path.
225
- const SWITCHES = new Set(["json", "wait", "pending", "dry-run", "check", "all", "fleet", "help", "yes", "mine", "no-browser", "include-drafts", "drafted", "library", "async", "sync", "force", "system", "delta", "probe", "no-probe", "not-required", "override", "critical", "no-embed"]);
225
+ const SWITCHES = new Set(["json", "wait", "pending", "dry-run", "check", "all", "fleet", "help", "yes", "mine", "no-browser", "include-drafts", "drafted", "library", "async", "sync", "force", "system", "delta", "probe", "no-probe", "not-required", "override", "critical", "no-embed", "behind"]);
226
226
  export function parseArgs(argv) {
227
227
  const flags = {};
228
228
  const args = [];
package/dist/design.js CHANGED
@@ -53,6 +53,36 @@ export function designRolesText(p) {
53
53
  return lines.join("\n");
54
54
  }
55
55
 
56
+ /**
57
+ * Surfaces behind DS (DESIGN-SYSTEM-PARITY-5, MW8-8): each Surfaces file with
58
+ * the DS publishes it has not taken; `--behind` keeps only those behind.
59
+ */
60
+ export async function surfacesBehind({ onlyBehind = false, request = devRequest } = {}) {
61
+ let payload;
62
+ try {
63
+ payload = await request("GET", "/api/v1/design/surfaces/behind");
64
+ } catch (error) {
65
+ if (error instanceof CliError && ["unroutable", "HTTP_404", "NOT_FOUND", "ROUTE_NOT_FOUND"].includes(error.code))
66
+ throw new CliError("SURFACES_BEHIND_UNAVAILABLE", `Dev doesn't serve Surfaces behind DS yet (GET /design/surfaces/behind, DESIGN-SYSTEM-PARITY-5): ${error.code}: ${error.message}`, 1, error.details);
67
+ throw error;
68
+ }
69
+ return onlyBehind ? { ...payload, data: (payload.data ?? []).filter((file) => file.behind) } : payload;
70
+ }
71
+
72
+ export function surfacesBehindText(p) {
73
+ const files = p.data ?? [];
74
+ if (!files.length) return "No Surfaces files to show.";
75
+ return files
76
+ .map((file) => {
77
+ const head = `${file.name} (${file.file_key})\t${file.behind ? `BEHIND: ${file.pending.length} DS publish${file.pending.length === 1 ? "" : "es"}` : "up to date"}`;
78
+ const rows = file.pending.map(
79
+ (sync) => ` DS ${sync.ds_version}\t${sync.issue_key ?? "no issue"}\t${sync.entries.length ? sync.entries.join(", ") : "unmapped change"}\t${sync.surfaces.length} Surface${sync.surfaces.length === 1 ? "" : "s"}`,
80
+ );
81
+ return [head, ...rows].join("\n");
82
+ })
83
+ .join("\n");
84
+ }
85
+
56
86
  /** The Figma token: FIGMA_PAT, as the design-system scripts read it, or FIGMA_TOKEN. Never printed. */
57
87
  export function figmaToken(env = process.env) {
58
88
  const token = env.FIGMA_PAT || env.FIGMA_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.61",
3
+ "version": "0.6.62",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {