@harborppm/cli 0.71.0 → 0.72.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.
package/dist/app.mjs CHANGED
@@ -5879,6 +5879,14 @@ function neighbourStatus(data, projectId, status, step) {
5879
5879
  function projectTasks(data, projectId) {
5880
5880
  return [...tasksOf(data.tasks, projectId)].sort((a, b) => STATUS_ORDER.indexOf(a.status) - STATUS_ORDER.indexOf(b.status) || (a.number ?? 0) - (b.number ?? 0));
5881
5881
  }
5882
+ /**
5883
+ * The project a new task goes in when none was picked: the only open one,
5884
+ * First voyage aside, as harbor add does. Null when there's a choice to make.
5885
+ */
5886
+ function soleOpenProject(projects) {
5887
+ const open = projects.filter((p) => p.health !== "done" && !isVoyageProject(p.id));
5888
+ return open.length === 1 ? open[0].id : null;
5889
+ }
5882
5890
  function blocked(data, task) {
5883
5891
  return isBlocked$1(task, data.tasks);
5884
5892
  }
@@ -12688,7 +12696,7 @@ function NewTask({ projectId, status, width, onDone, onFull }) {
12688
12696
  const { store } = useDeps();
12689
12697
  const projects = useHarbor((s) => s.projects);
12690
12698
  const me = useHarbor((s) => s.currentUserId);
12691
- const [project, setProject] = useState(projectId);
12699
+ const [project, setProject] = useState(() => projectId ?? soleOpenProject(projects));
12692
12700
  const chosen = projects.find((p) => p.id === project);
12693
12701
  if (!chosen) return /* @__PURE__ */ jsx(Box, {
12694
12702
  width,
package/lib/cli.mjs CHANGED
@@ -447,7 +447,7 @@ const REPEAT_WORD = { weekly: "every week", biweekly: "every two weeks", monthly
447
447
  const WEEKDAYS = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
448
448
 
449
449
  /** The one open project a task can go in (First voyage aside), or why --project is needed. */
450
- async function onlyProject(client, harbor) {
450
+ async function onlyProject(client, harbor, say = "--project NAME") {
451
451
  const r = await client.call("list_projects", {
452
452
  harbor,
453
453
  health: ["on-track", "at-risk", "off-track", "paused"],
@@ -459,7 +459,7 @@ async function onlyProject(client, harbor) {
459
459
  throw new HarborError('This harbor has no open project yet; harbor project "NAME" --program P makes one.');
460
460
  const names = open.slice(0, 3).map((p) => p.name);
461
461
  const more = open.length > 3 || r.total > 5 ? ", …" : "";
462
- throw new HarborError(`Say which project: --project NAME (${names.join(", ")}${more}).`);
462
+ throw new HarborError(`Say which project: ${say} (${names.join(", ")}${more}).`);
463
463
  }
464
464
 
465
465
  const WEEKDAY_NAME = WEEKDAYS.map((d) => d[0].toUpperCase() + d.slice(1));
@@ -1194,11 +1194,13 @@ const DETAIL = {
1194
1194
  ' harbor risk "TITLE" --project P writes: logs a risk on the project',
1195
1195
  ' harbor risk "TITLE" --program P writes: logs one on the program',
1196
1196
  " [--impact 1-5] [--probability 1-5] [--owner NAME] [--due DATE]",
1197
+ " With neither, it goes in the harbor's one open project (First voyage aside).",
1197
1198
  ],
1198
1199
  issue: [
1199
1200
  ' harbor issue "TITLE" --project P writes: logs an issue on the project',
1200
1201
  ' harbor issue "TITLE" --program P writes: logs one on the program',
1201
1202
  " [--impact 1-5] [--owner NAME] [--due DATE]",
1203
+ " With neither, it goes in the harbor's one open project (First voyage aside).",
1202
1204
  ],
1203
1205
  decision: [
1204
1206
  ' harbor decision "TITLE" --project P writes: logs a decision to make',
@@ -1206,6 +1208,7 @@ const DETAIL = {
1206
1208
  " [--owner NAME] [--due DATE] (the date to decide by)",
1207
1209
  " [--turned-down T] (what was turned down, and why not)",
1208
1210
  " [--look-again DATE] (when it comes back to the top of the brief)",
1211
+ " With neither, it goes in the harbor's one open project (First voyage aside).",
1209
1212
  ' harbor decision "TITLE" --supersedes "OLD"',
1210
1213
  " writes: a decision that replaces an",
1211
1214
  " earlier one, which reads as",
@@ -1288,6 +1291,9 @@ const OTHER_NAMES = {
1288
1291
  longpole: "harbor why PROJECT shows what's holding it up.",
1289
1292
  "long-pole": "harbor why PROJECT shows what's holding it up.",
1290
1293
  pilot: "harbor show TASK says the date its owner's queue suggests; --due pilot on add or edit takes it.",
1294
+ milestone: "Milestones belong to a program: in the app (harbor), open the program and press m; or on the website.",
1295
+ milestones: "The app's program screen lists them: harbor, then 4, and Enter on a program.",
1296
+ decide: 'harbor decision "TITLE" --project P logs a decision.',
1291
1297
  dock: "harbor try PROJECT is the dry dock.",
1292
1298
  "dry-dock": "harbor try PROJECT is the dry dock.",
1293
1299
  };
@@ -3407,8 +3413,9 @@ export async function run(argv, io = {}) {
3407
3413
  ),
3408
3414
  ),
3409
3415
  );
3416
+ // Neither: the harbor's one open project, as harbor add does.
3410
3417
  if (!values.project && !values.program && !values.supersedes) {
3411
- throw new HarborError("Say where it belongs: --project NAME or --program NAME.");
3418
+ values.project = await onlyProject(client, harbor, "--project NAME or --program NAME");
3412
3419
  }
3413
3420
  return call(
3414
3421
  "log_raid",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborppm/cli",
3
- "version": "0.71.0",
3
+ "version": "0.72.0",
4
4
  "description": "Harbor from the terminal: a full-screen app with everything, plus commands for scripts and agents.",
5
5
  "keywords": [
6
6
  "harbor",