Skip to content

Support npm 12 pack --json output shape in size report - #30

Merged
KayleeWilliams merged 2 commits into
mainfrom
KayleeWilliams/fix-perf-npm-pack
Aug 11, 2026
Merged

Support npm 12 pack --json output shape in size report#30
KayleeWilliams merged 2 commits into
mainfrom
KayleeWilliams/fix-perf-npm-pack

Conversation

@KayleeWilliams

Copy link
Copy Markdown
Owner

npm 12 changed npm pack --dry-run --json from returning an array of
package summaries to an object keyed by package name, so destructuring
the parsed output threw TypeError: {} is not iterable and failed
bun run perf (which CI runs on every pull request).

Accept both shapes so the report works regardless of the npm version
bundled with the active Node/CI runner.


Stack created with GitHub Stacks CLIGive Feedback 💬

npm 12 changed `npm pack --dry-run --json` from returning an array of
package summaries to an object keyed by package name, so destructuring
the parsed output threw `TypeError: {} is not iterable` and failed
`bun run perf` (which CI runs on every pull request).

Accept both shapes so the report works regardless of the npm version
bundled with the active Node/CI runner.
@KayleeWilliams
KayleeWilliams marked this pull request as ready for review August 11, 2026 12:39
Runner images still bundle npm 10, which returns the old array shape from
`npm pack --json`, so CI would not have exercised the npm 12 object shape
this commit handles. Installing npm 12 makes the perf step cover the
shape published releases actually run against, and printing the version
records which shape was tested.
@KayleeWilliams
KayleeWilliams merged commit f9c12ce into main Aug 11, 2026
1 check passed
@KayleeWilliams
KayleeWilliams deleted the KayleeWilliams/fix-perf-npm-pack branch August 11, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant