From 49ed88e8edd3d6361ebb117082435c63580825b8 Mon Sep 17 00:00:00 2001 From: kjgbot Date: Sun, 6 Sep 2026 15:21:21 +0200 Subject: [PATCH] fix(publish): make the release-tooling fixture hermetic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish pipeline's first real dispatch failed at its own `Test release tooling` step: The input did not match /missing package\/dist\/index.js/. Input: > @relayflows/surface@2.0.0 prepare > bun run build $ tsc error: script "build" exited with code 1 Error: Command failed: npm pack --ignore-scripts --json ... The fixture copies the real package.json, `prepare` and all. Despite `--ignore-scripts`, npm ran `prepare` -> `bun run build` -> `tsc` inside a temp directory that installs no toolchain, so npm failed before pack-release could emit the assertion the test is actually about. It passed on my machine only because this host happens to have the toolchain the fixture never installs — the test was reading the developer's environment, not the code. Dropping the packaging lifecycle hooks from the fixture makes it hermetic and tests what it claims to. Local run passes, but local passed before this change too, so CI is the only verification that means anything here. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1 --- scripts/publish.test.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/publish.test.mjs b/scripts/publish.test.mjs index e69ffcacd..a32db7e54 100644 --- a/scripts/publish.test.mjs +++ b/scripts/publish.test.mjs @@ -17,6 +17,15 @@ function fixture(t) { cpSync(`packages/${name}/package.json`, path); const pkg = read(path); pkg.version = '2.0.0'; + // Drop packaging lifecycle scripts. The fixture exists to exercise + // pack-release's OWN assertions, and `npm pack --ignore-scripts` was still + // running `prepare` -> `bun run build` -> `tsc` on a CI runner, so npm + // failed before the script could report `missing package/dist/index.js`. + // It passed locally only because this machine happened to have the + // toolchain the fixture does not install. + for (const hook of ['prepare', 'prepack', 'postpack', 'prepublishOnly']) { + delete pkg.scripts?.[hook]; + } writeFileSync(path, JSON.stringify(pkg)); } return root;