From ab33dae69d7934d95ab4ef0a70d4107b128b7fd3 Mon Sep 17 00:00:00 2001 From: "dayuan.jiang" Date: Mon, 5 Oct 2026 22:43:05 +0900 Subject: [PATCH] fix(mcp-server): read npm 12's pack output in the package check 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) {