shipbench 0.9.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.
Files changed (2) hide show
  1. package/dist/index.js +56 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5241,7 +5241,7 @@ Task description in Markdown.
5241
5241
  - **assignee** (optional): Freeform string label (e.g. \`claude\`, \`antigravity\`, or \`human\`). Informational only \u2014 task eligibility is governed strictly by \`status\` and \`depends_on\`. Moving a task to \`in-progress\` signals that work has started.
5242
5242
  - **tags** (optional): Array of freeform strings.
5243
5243
  - **depends_on** (optional): Array of task slugs that must be finished before this task can start. An omitted field and an empty array mean the same thing. A slug must name a task file that exists; a task may not depend on itself, and two tasks may not depend on each other.
5244
- - **related** (optional): Array of task slugs this task is associated with \u2014 the spike behind a decision, a sibling task sharing a surface. It points at other work without ordering it: it gates nothing, never blocks archiving, and stays out of the dependency graph. A slug must name a live or archived task file, and a task may not name itself. The association reads in both directions: JSON from \`task list\` and \`task search\` shows it from either task in \`related_tasks\`, while \`task get\` reports the file as written. Use \`depends_on\` when one task has to finish first, and \`related\` when the other task only explains or shares context.
5244
+ - **related** (optional): Array of task slugs this task is associated with \u2014 the spike behind a decision, a sibling task sharing a surface. It points at other work without ordering it: it gates nothing, never blocks archiving, and stays out of the dependency graph. A slug must name a live or archived task file, and a task may not name itself. The association reads in both directions: JSON from \`task list\` and \`task search\` shows it from either task in \`related_tasks\`, while \`task get\` reports the file as written. Use \`depends_on\` when one task has to finish first, and \`related\` when the other task only explains or shares context. When a description links to another task, also record that task here (or in \`depends_on\`): a slug resolves wherever the task is filed, while a relative Markdown link stops resolving once either file moves to \`tasks/archive/\`.
5245
5245
  - **flag** (optional): Marks the task for attention without changing its column \u2014 a one-line reason, or \`true\` when there is none to give. What a flag means is this project's call. Informational only: it gates nothing, and nothing clears it automatically. Omit the field when the task is not flagged.
5246
5246
  - **created** (required): ISO 8601 timestamp. Set once on creation, never modify.
5247
5247
  - **updated** (required): ISO 8601 timestamp. Update on every modification.
@@ -5483,6 +5483,45 @@ async function initProject(adapter, options2) {
5483
5483
  };
5484
5484
  }
5485
5485
 
5486
+ // ../../packages/core/src/links.ts
5487
+ var INLINE_LINK = /\]\(\s*(<[^>\n]*>|[^\s)]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?\s*\)/g;
5488
+ var REFERENCE_DEFINITION = /^ {0,3}\[[^\]\n]+\]:\s*(<[^>\n]*>|\S+)/gm;
5489
+ var FENCED_CODE = /^ {0,3}(`{3,}|~{3,})[^\n]*\n[\s\S]*?(?:^ {0,3}\1[^\n]*$|(?![\s\S]))/gm;
5490
+ var INLINE_CODE = /(`+)[^`]*?\1/g;
5491
+ var SCHEME = /^[a-z][a-z0-9+.-]*:/i;
5492
+ var TASK_HREF = /^(?:\.\/)?(?:archive\/|\.\.\/)?([^/]+)\.md$|(?:^|\/)\.shipbench\/tasks\/(?:archive\/)?([^/]+)\.md$/;
5493
+ function taskSlugOfHref(raw) {
5494
+ const href = raw.startsWith("<") ? raw.slice(1, -1).trim() : raw;
5495
+ if (!href || href.startsWith("#") || SCHEME.test(href)) return null;
5496
+ const path = href.replace(/[?#].*$/, "");
5497
+ let decoded;
5498
+ try {
5499
+ decoded = decodeURIComponent(path);
5500
+ } catch {
5501
+ return null;
5502
+ }
5503
+ const match = TASK_HREF.exec(decoded);
5504
+ return match ? match[1] ?? match[2] : null;
5505
+ }
5506
+ function taskLinkTargets(markdown) {
5507
+ const prose = markdown.replace(FENCED_CODE, "").replace(INLINE_CODE, "");
5508
+ const slugs = /* @__PURE__ */ new Set();
5509
+ for (const pattern of [INLINE_LINK, REFERENCE_DEFINITION]) {
5510
+ for (const match of prose.matchAll(pattern)) {
5511
+ const slug = taskSlugOfHref(match[1]);
5512
+ if (slug) slugs.add(slug);
5513
+ }
5514
+ }
5515
+ return [...slugs];
5516
+ }
5517
+ function tasksLinkingTo(tasks, slug) {
5518
+ return tasks.filter(
5519
+ (task) => task.slug !== slug && [task.body, ...task.comments.map((comment) => comment.text)].some(
5520
+ (text) => taskLinkTargets(text).includes(slug)
5521
+ )
5522
+ ).map((task) => task.slug).sort();
5523
+ }
5524
+
5486
5525
  // ../../packages/core/src/search.ts
5487
5526
  var SNIPPET_CONTEXT_BEFORE = 40;
5488
5527
  var SNIPPET_CONTEXT_AFTER = 80;
@@ -6873,7 +6912,7 @@ async function runTui(options2) {
6873
6912
  }
6874
6913
 
6875
6914
  // src/cli.ts
6876
- var VERSION = true ? "0.9.0" : "0.0.0-dev";
6915
+ var VERSION = true ? "0.10.0" : "0.0.0-dev";
6877
6916
  function commaList(value) {
6878
6917
  return value.split(",").map((s) => s.trim()).filter(Boolean);
6879
6918
  }
@@ -8223,6 +8262,17 @@ function createCli(opts) {
8223
8262
  throw new Error("--force can only be used when archiving one task.");
8224
8263
  }
8225
8264
  const config = await loadCliConfig();
8265
+ const warnAboutLinksToArchived = async (slugs) => {
8266
+ if (slugs.length === 0) return;
8267
+ const { tasks } = await listTasks(adapter, config);
8268
+ for (const archivedSlug of slugs) {
8269
+ const linking = tasksLinkingTo(tasks, archivedSlug);
8270
+ if (linking.length === 0) continue;
8271
+ output.warning(
8272
+ `${linking.join(", ")} ${linking.length === 1 ? "links" : "link"} to ${archivedSlug}, which is now at archive/${archivedSlug}.md. Update the link, or name ${archivedSlug} in related.`
8273
+ );
8274
+ }
8275
+ };
8226
8276
  if (raw.done) {
8227
8277
  const { tasks } = await listTasks(adapter, config);
8228
8278
  const doneTasks = tasks.filter(
@@ -8237,6 +8287,7 @@ function createCli(opts) {
8237
8287
  archived.push(await archiveTask(adapter, config, candidate.slug));
8238
8288
  if (!raw.json) chrome(`Archived task: ${candidate.slug}`);
8239
8289
  }
8290
+ await warnAboutLinksToArchived(archived.map((task2) => task2.slug));
8240
8291
  if (raw.json) {
8241
8292
  data(JSON.stringify(archived.map(taskJson), null, 2));
8242
8293
  return;
@@ -8250,9 +8301,10 @@ function createCli(opts) {
8250
8301
  });
8251
8302
  if (raw.json) {
8252
8303
  printTask(archived);
8253
- return;
8304
+ } else {
8305
+ chrome(`Archived task: ${slug}`);
8254
8306
  }
8255
- chrome(`Archived task: ${slug}`);
8307
+ await warnAboutLinksToArchived([archived.slug]);
8256
8308
  } catch (error) {
8257
8309
  if (error instanceof ArchiveBlockedError) {
8258
8310
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipbench",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Git-native project management for solo developers. Each task is a Markdown file in your repository, with a CLI and a local board on top.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,14 +33,14 @@
33
33
  "dependencies": {
34
34
  "chokidar": "^5.0.0",
35
35
  "commander": "^15.0.0",
36
- "@shipbench/board": "0.9.0"
36
+ "@shipbench/board": "0.10.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26.0.1",
40
40
  "gray-matter": "^4.0.3",
41
41
  "tsup": "^8.0.0",
42
42
  "typescript": "^5.5.0",
43
- "@shipbench/core": "0.9.0"
43
+ "@shipbench/core": "0.10.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup",