From d1b00f1cf5046361630afa4da33c3cb90024fae2 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Wed, 13 May 2026 08:19:19 +0200 Subject: [PATCH] =?UTF-8?q?feat(scripts):=20pnpm=20work=20dispatch=20?= =?UTF-8?q?=E2=80=94=20wire=20CLI=20to=20dispatch.mjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/work/cli.mjs | 15 +++++++++++++-- scripts/work/cli.test.mjs | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/work/cli.mjs b/scripts/work/cli.mjs index 504088a..2b11527 100644 --- a/scripts/work/cli.mjs +++ b/scripts/work/cli.mjs @@ -114,7 +114,12 @@ function mark(status) { } function usage() { - console.log("Usage: pnpm work "); + console.log( + "Usage: pnpm work ", + ); + console.log( + " dispatch Print the next dispatch plan (use --execute to invoke sandcastle)", + ); process.exit(2); } @@ -124,4 +129,10 @@ else if (cmd === "status") printStatus(); else if (cmd === "next") printNext(); else if (cmd === "ready") printReady(); else if (cmd === "blocked") printBlocked(); -else usage(); +else if (cmd === "dispatch") { + // Re-dispatch to the dispatch script so it can handle its own --execute flag + import("./dispatch.mjs").catch((e) => { + console.error(e); + process.exit(1); + }); +} else usage(); diff --git a/scripts/work/cli.test.mjs b/scripts/work/cli.test.mjs index e41a037..c7e169a 100644 --- a/scripts/work/cli.test.mjs +++ b/scripts/work/cli.test.mjs @@ -51,4 +51,9 @@ describe("pnpm work cli", () => { const out = run("blocked"); expect(out.length).toBeGreaterThan(0); }); + + it("dispatch prints a plan", () => { + const out = run("dispatch"); + expect(out).toContain("Dispatch plan"); + }); });