fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301rishigupta1599 wants to merge 1 commit into
Conversation
@percy/cli-upload declared image-size as "^1.0.0", a loose range. image-size raised its engine requirement to node>=16 starting at v1.1.1, so any consumer regenerating its lockfile against @percy/cli now resolves image-size@1.2.1 (node>=16) — silently breaking @percy/cli's own declared `engines: node>=14`. This surfaces in downstream SDKs (percy-puppeteer, percy-selenium-js, percy-testcafe, percy-nightmare): their Node 14 CI legs fail on install because the transitive image-size requires node>=16, even though @percy/cli claims >=14. Constrain the range to ~1.0.2 (>=1.0.2 <1.1.0) — the last image-size line that supports node>=14 — so @percy/cli honors its own engines field again. The CLI's own lockfile already resolved 1.0.2; this just keeps every downstream consumer on that line. image-size 1.0.x is API-compatible with cli-upload's usage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@percy/cli (>=14) transitively pulls image-size via @percy/cli-upload's loose "^1.0.0" range, which now resolves to image-size@1.2.1 (requires node>=16), breaking this SDK's Node 14 CI leg on install. Force image-size back to the node>=14-compatible 1.0.x line. Temporary workaround pending the upstream CLI fix (percy/cli#2301); remove once this SDK bumps to the patched @percy/cli release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rishigupta1599
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 1 inline finding(s). Full report in the PR comment below. Verdict: Passed.
| "@percy/cli-command": "1.32.0", | ||
| "fast-glob": "^3.2.11", | ||
| "image-size": "^1.0.0" | ||
| "image-size": "~1.0.2" |
There was a problem hiding this comment.
[Low] Range works, but consider ~1.0.0
~1.0.2 (>=1.0.2 <1.1.0) correctly excludes image-size@1.1.0+ (which drops Node 14), so the fix is valid. It currently resolves to exactly 1.0.2. If the intent is just "any safe 1.0.x, exclude the breaking 1.1.0 minor", ~1.0.0 expresses that slightly more idiomatically and admits future 1.0.x patches.
Suggestion: Optional — keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.
Reviewer: stack:code-reviewer
Claude Code PR ReviewPR: #2301 • Head: 00427b8 • Reviewers: stack:code-reviewer SummaryPins the Review Table
FindingsNo blocking findings. One optional style note below.
Note on the reviewer's CRITICAL (
|
@percy/cli (>=14) transitively pulls image-size via @percy/cli-upload's loose "^1.0.0" range, which now resolves to image-size@1.2.1 (requires node>=16), breaking this SDK's Node 14 CI leg on install. Force image-size back to the node>=14-compatible 1.0.x line. Temporary workaround pending the upstream CLI fix (percy/cli#2301); remove once this SDK bumps to the patched @percy/cli release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@percy/cli (>=14) transitively pulls image-size via @percy/cli-upload's loose "^1.0.0" range, which now resolves to image-size@1.2.1 (requires node>=16), breaking this SDK's Node 14 CI leg on install. Force image-size back to the node>=14-compatible 1.0.x line. Temporary workaround pending the upstream CLI fix (percy/cli#2301); remove once this SDK bumps to the patched @percy/cli release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
@percy/clideclaresengines: { node: ">=14" }, but@percy/cli-uploaddeclared itsimage-sizedependency as the loose range"^1.0.0".image-sizeraised its own engine requirement tonode >=16starting at v1.1.1 (1.0.2 =>=14, 1.1.1 / 1.2.0 / 1.2.1 =>=16). Because^1.0.0resolves to the latest matching version, any consumer that regenerates its lockfile against@percy/clinow pullsimage-size@1.2.1(node>=16) — silently violating@percy/cli's ownengines: node>=14.This isn't a code change in any recent CLI release — the
^1.0.0range has been here since@percy/cli-uploadwas first added. It only surfaces now because (a)image-sizepublished a node-bumping release and (b) downstream lockfiles get regenerated (e.g. when SDKs bump@percy/cli).Observed impact
Downstream Percy SDKs that still test Node 14 (
percy-puppeteer,percy-selenium-js,percy-testcafe,percy-nightmare) fail their Node 14 CI legs on install, because the transitiveimage-size@1.2.1requiresnode>=16even though@percy/cliclaims>=14.Fix
Constrain the range to
~1.0.2(>=1.0.2 <1.1.0) — the lastimage-sizeline that supportsnode>=14— so@percy/clihonors its ownenginesfield again.image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.image-size@1.0.xis API-compatible withcli-upload's usage (reading image dimensions), so no functional change.Alternative considered
Officially dropping Node 14 (bump
enginesto>=16across the CLI + SDK matrices). That's a larger, breaking decision; this PR is the minimal fix that restores the currently declared support contract. Happy to go the other direction if maintainers prefer to drop Node 14.🤖 Generated with Claude Code