@niroai/niro 0.8.0 → 0.10.0

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.
@@ -25,7 +25,7 @@ async function build(projectIdArg, opts = {}) {
25
25
  if (asJson) {
26
26
  emitJson({ event: "triggered", project_id: projectId, force_full_rebuild: force });
27
27
  } else {
28
- console.log(`${color.green("✓")} Build triggered for ${color.bold(projectId)}.`);
28
+ console.log(` ${color.green("✓")} Build triggered for ${color.bold(projectId)}.`);
29
29
  }
30
30
  if (opts.watch === false) return;
31
31
  await watchStatus(projectId, { json: asJson });
@@ -75,7 +75,7 @@ async function watchStatusJson(projectId) {
75
75
  }
76
76
 
77
77
  async function watchStatusHuman(projectId) {
78
- const sp = spinner.start(`Waiting for build to start... [${projectId}]`);
78
+ const sp = spinner.start(` Waiting for build to start... [${projectId}]`);
79
79
  let lastStatus = null;
80
80
  let lastLog = null;
81
81
  try {
@@ -84,7 +84,7 @@ async function watchStatusHuman(projectId) {
84
84
  try {
85
85
  data = await api.get(`/api/graph/${encodeURIComponent(projectId)}/status`);
86
86
  } catch (err) {
87
- sp.stop(`Failed to fetch status: ${err.message}`);
87
+ sp.stop(` Failed to fetch status: ${err.message}`);
88
88
  process.exitCode = 1;
89
89
  return;
90
90
  }
@@ -92,7 +92,7 @@ async function watchStatusHuman(projectId) {
92
92
  const logMessage = data.log_message || data.logMessage;
93
93
  if (st !== lastStatus || logMessage !== lastLog) {
94
94
  const coloredSt = colorizeStatus(st);
95
- const label = logMessage ? `${coloredSt} — ${logMessage}` : coloredSt;
95
+ const label = ` ${logMessage ? `${coloredSt}: ${logMessage}` : coloredSt}`;
96
96
  sp.update(label);
97
97
  lastStatus = st;
98
98
  lastLog = logMessage;
@@ -100,7 +100,7 @@ async function watchStatusHuman(projectId) {
100
100
  if (TERMINAL.has(st)) {
101
101
  const mark = st === "COMPLETED" ? color.green("✓") : color.red("✗");
102
102
  const tint = st === "COMPLETED" ? color.green : st === "FAILED" || st === "CANCELLED" ? color.red : (s) => s;
103
- sp.stop(`${mark} Build ${tint(st.toLowerCase())}.`);
103
+ sp.stop(` ${mark} Build ${tint(st.toLowerCase())}.`);
104
104
  if (st !== "COMPLETED") process.exitCode = 1;
105
105
  return;
106
106
  }
@@ -22,7 +22,7 @@ async function deleteProject(projectIdArg, opts = {}) {
22
22
 
23
23
  if (!opts.yes) {
24
24
  console.log(`${color.yellow("⚠")} About to delete project ${color.bold(projectId)}.`);
25
- console.log(color.dim(" This removes the project and its graph from the server. Registered repos stay."));
25
+ console.log(color.dim(" This removes the project and its graph from the server. Registered repos stay."));
26
26
  const typed = await prompt.ask(`Type the project name to confirm`, "");
27
27
  if (typed !== projectId) {
28
28
  console.log(`${color.red("✗")} Project name did not match — aborted.`);
@@ -53,9 +53,9 @@ function unpinIfMatches(projectId) {
53
53
  if (fs.existsSync(p)) {
54
54
  try {
55
55
  fs.unlinkSync(p);
56
- console.log(` Removed local pin at ${color.dim(p)}`);
56
+ console.log(` Removed local pin at ${color.dim(p)}`);
57
57
  } catch (err) {
58
- console.log(color.yellow(` Could not remove ${p}: ${err.message}`));
58
+ console.log(color.yellow(` Could not remove ${p}: ${err.message}`));
59
59
  }
60
60
  return;
61
61
  }
@@ -218,7 +218,7 @@ async function setEnv(projectId, pairs, opts) {
218
218
  console.log(JSON.stringify({ project_id: projectId, git_id: gitId, changed_keys: changedKeys }));
219
219
  } else {
220
220
  console.log(`${color.green("✓")} Updated env var(s) on repo ${color.dim(gitId)}: ${changedKeys.map((k) => color.bold(k)).join(", ")}`);
221
- console.log(color.dim(" (values are not shown)"));
221
+ console.log(color.dim(" (values are not shown)"));
222
222
  }
223
223
  }
224
224
 
@@ -291,12 +291,12 @@ async function listEnv(projectId, opts) {
291
291
  const appears = s.appears_in > 1
292
292
  ? color.yellow(` (appears in ${s.appears_in} files)`)
293
293
  : (s.appears_in === 1 ? color.dim(" (1 file)") : "");
294
- console.log(` - ${color.bold(s.key)}${set}${src}${appears}`);
294
+ console.log(` - ${color.bold(s.key)}${set}${src}${appears}`);
295
295
  if (s.appears_in > 1) {
296
296
  for (const c of s.candidates) {
297
297
  const shown = c.value == null ? color.dim("(empty)") : c.value;
298
298
  const marker = c.is_current ? color.green(" [current]") : "";
299
- console.log(` ${color.dim("•")} ${c.source_file}: ${shown}${marker}`);
299
+ console.log(` ${color.dim("•")} ${c.source_file}: ${shown}${marker}`);
300
300
  }
301
301
  }
302
302
  }
@@ -583,14 +583,14 @@ function maskPair(pair) {
583
583
 
584
584
  function printUsage() {
585
585
  console.error("niro edit — change an existing project. At least one action is required:");
586
- console.error(" --add-repo <gitId> map a registered repo to the project");
587
- console.error(" --remove-repo <gitId> unmap a repo (non-destructive)");
588
- console.error(" --set-env KEY=VALUE set an env var (repeatable; value never printed)");
589
- console.error(" --set-env-from KEY=FILE adopt the value FILE carries for KEY (repeatable; value never printed)");
590
- console.error(" --active-files <files> property files to keep active for env-var defaults; the rest are ignored (default: all)");
591
- console.error(" --list-env list env var keys + per-file candidates (secret values masked)");
592
- console.error(" --rescan-env rescan the repo for env vars");
593
- console.error(" --alias <newAlias> rename the project");
586
+ console.error(" --add-repo <gitId> map a registered repo to the project");
587
+ console.error(" --remove-repo <gitId> unmap a repo (non-destructive)");
588
+ console.error(" --set-env KEY=VALUE set an env var (repeatable; value never printed)");
589
+ console.error(" --set-env-from KEY=FILE adopt the value FILE carries for KEY (repeatable; value never printed)");
590
+ console.error(" --active-files <files> property files to keep active for env-var defaults; the rest are ignored (default: all)");
591
+ console.error(" --list-env list env var keys + per-file candidates (secret values masked)");
592
+ console.error(" --rescan-env rescan the repo for env vars");
593
+ console.error(" --alias <newAlias> rename the project");
594
594
  console.error("Target project: --project <alias|id>, or a .niro-project pin in this folder.");
595
595
  console.error("Env actions target --repo <gitId> (auto-selected when the project has one repo).");
596
596
  }
@@ -218,7 +218,7 @@ function printHuman(p) {
218
218
  if (proj.status) bits.push(`status: ${proj.status}`);
219
219
  if (proj.doc_gen_status) bits.push(`docs: ${proj.doc_gen_status}`);
220
220
  if (proj.updated_at) bits.push(`updated: ${proj.updated_at}`);
221
- console.log(` - ${name}${bits.length ? " — " + color.dim(bits.join(", ")) : ""}`);
221
+ console.log(` - ${name}${bits.length ? " — " + color.dim(bits.join(", ")) : ""}`);
222
222
  for (const f of proj.folders || []) {
223
223
  // Marked so the folder you are STANDING IN is obvious at a glance; the whole point is telling
224
224
  // "this worktree is the one Niro reflects" from "this one is not".
@@ -233,7 +233,7 @@ function printHuman(p) {
233
233
  temp = color.dim(` via temporary project ${f.temp_project_id}`)
234
234
  + (f.reflected === null ? color.dim(" (could not confirm)") : "");
235
235
  }
236
- console.log(color.dim(` syncing from ${f.path}`) +
236
+ console.log(color.dim(` syncing from ${f.path}`) +
237
237
  (f.branch ? color.dim(` on branch ${f.branch}`) : "") + temp + here);
238
238
  }
239
239
  }