From 73d2c83f08d60e1c393b840d2562e54e3cfdb5c5 Mon Sep 17 00:00:00 2001 From: Harkaran Brar Date: Mon, 30 Mar 2026 21:17:50 -0700 Subject: [PATCH] fix: parse npm pack JSON output in smoke test Handle npm pack output in JSON mode used by changeset publish so smoke validation resolves tarball filename correctly in CI. --- test/smoke/pack-smoke.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/smoke/pack-smoke.mjs b/test/smoke/pack-smoke.mjs index a7f3dbf..a1615a6 100644 --- a/test/smoke/pack-smoke.mjs +++ b/test/smoke/pack-smoke.mjs @@ -7,11 +7,17 @@ const repoRoot = resolve(new URL('../..', import.meta.url).pathname) const sandbox = mkdtempSync(join(tmpdir(), 'ocex-pack-smoke-')) try { - const packedName = execSync('npm pack --silent', { + const packedRaw = execSync('npm pack --json --silent', { cwd: repoRoot, encoding: 'utf8' }).trim() + const packed = JSON.parse(packedRaw) + const packedName = Array.isArray(packed) ? packed[0]?.filename : null + if (!packedName) { + throw new Error('npm pack did not return a tarball filename') + } + const tarball = join(repoRoot, packedName) const probeDir = join(sandbox, 'probe') execSync('mkdir -p probe', { cwd: sandbox })