From 7f94ddaa5d4ee36d844e754250064840d991742c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?NB=F0=9F=98=88?= Date: Sat, 26 Sep 2026 19:01:26 +0200 Subject: [PATCH] fix: read npm 12 pack output in the tarball check (0.4.1) npm 12 prints `npm pack --json` as an object keyed by package name, not an array. The v0.4.0 release failed on this, so nothing was published for it. 0.4.1 carries the same changes. --- CHANGELOG.md | 12 +++++++++++- package.json | 2 +- tools/test-package-tarball.mjs | 7 +++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abc5c18..828f5e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,17 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -## [0.4.0] — 2026-09-26 +## [0.4.1] — 2026-09-26 + +The `v0.4.0` tag was not published: its release check failed with npm 12. 0.4.1 +has the same changes, listed below. + +### Fixed + +- The package tarball check reads the `npm pack --json` output of npm 11 (an + array) and of npm 12 (an object keyed by package name). + +## [0.4.0] — 2026-09-26 (not published) ### Added diff --git a/package.json b/package.json index e0ac939..7aa1a33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@norbert_bodziony/bloub", "private": false, - "version": "0.4.0", + "version": "0.4.1", "type": "module", "description": "SVG recreation of the x.ai bot avatar. One shape morphing through 14 states, measured off the reference video frame by frame.", "license": "MIT", diff --git a/tools/test-package-tarball.mjs b/tools/test-package-tarball.mjs index f320238..8685a8b 100644 --- a/tools/test-package-tarball.mjs +++ b/tools/test-package-tarball.mjs @@ -16,12 +16,15 @@ function run(command, args, cwd) { } try { - const packed = JSON.parse( + const output = JSON.parse( execFileSync('npm', ['pack', ...(packageSpec ? [packageSpec] : []), '--json', '--pack-destination', temporary], { cwd: root, encoding: 'utf8' }) - )[0] + ) + // npm 11 rend un tableau, npm 12 un objet indexe par nom de paquet. + const packed = Array.isArray(output) ? output[0] : Object.values(output)[0] + if (!packed?.files) throw new Error(`Unexpected npm pack output: ${JSON.stringify(output).slice(0, 200)}`) const packedPaths = packed.files.map((file) => file.path) const forbidden = packedPaths.filter( (path) => path.endsWith('.map') || path.startsWith('src/') || path.includes('mediabunny')