From 7fccf68edfce6748c48d72aead0d0b1ab8e120c9 Mon Sep 17 00:00:00 2001 From: Dayuan Jiang <34411969+DayuanJiang@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:58:56 +0900 Subject: [PATCH] fix(mcp-server): read npm 12's pack output in the package check (#952) The publish workflow installs the latest npm, and npm 12 prints `npm pack --json` as an object keyed by package name instead of a list, so check-package failed and 0.3.0 was not published. Accept both. --- packages/mcp-server/scripts/check-package.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/mcp-server/scripts/check-package.mjs b/packages/mcp-server/scripts/check-package.mjs index 133cbdf2..a739ea32 100644 --- a/packages/mcp-server/scripts/check-package.mjs +++ b/packages/mcp-server/scripts/check-package.mjs @@ -11,9 +11,11 @@ const REQUIRED = [ "dist/preview/preview.js", ] -const [pack] = JSON.parse( +const output = JSON.parse( execSync("npm pack --dry-run --json", { encoding: "utf8" }), ) +// npm 11 prints a list, npm 12 an object keyed by package name +const pack = Array.isArray(output) ? output[0] : Object.values(output)[0] const files = new Set(pack.files.map((f) => f.path)) const missing = REQUIRED.filter((f) => !files.has(f)) if (missing.length > 0) {