fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
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>
Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several loose transitive ranges to latest versions that dropped Node 14/16 support, breaking the Node 14 CI leg on install (engine-strict): - image-size 1.2.1 (node>=16) via @percy/cli-upload "^1.0.0" - node-releases 2.0.47 (node>=18) via nyc -> babel -> browserslist - snyk-nodejs-lockfile-parser 2.7.1 (node>=18) via @percy/cli-command, which also pulled @yarnpkg/core@4 + tar@7 (all node>=18) Pin each back to its last Node-14-compatible line via resolutions. Downgrading snyk-nodejs-lockfile-parser to 1.59.0 also drops the entire @yarnpkg/tar@7 subtree. Temporary workaround pending upstream CLI fix (percy/cli#2301); remove once this SDK moves to a CLI release that supports Node 14 cleanly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several loose transitive ranges to versions that dropped Node 14/16 support, breaking the Node 14 CI leg on install (engine-strict): - image-size 1.2.1 (node>=16) via @percy/cli-upload - node-releases 2.0.47 (node>=18) via nyc -> babel -> browserslist - snyk-nodejs-lockfile-parser 2.7.1 (node>=18) via @percy/cli-command (also pulled @yarnpkg/core@4 + tar@7) Pin each back to its last Node-14-compatible line via resolutions. Temporary workaround pending upstream CLI fix (percy/cli#2301). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several
loose ranges to versions that dropped Node 14 support, breaking the Node 14 CI
leg on install (engine-strict). Pin each back to its last Node-14-compatible
line:
- image-size ~1.0.2 (was 1.2.1, node>=16; via @percy/cli-upload)
- node-releases 2.0.19 (was 2.0.47, node>=18; via nyc->babel->browserslist)
- snyk-nodejs-lockfile-parser 1.59.0 (was 2.7.1, node>=18; via @percy/cli-command;
also drops the @yarnpkg/core@4 + tar@7 subtree)
- testcafe 2.0.1 (devDep) (regen pulled 2.6.2, node>=16; 2.0.1 is what master used)
- testcafe-hammerhead 24.7.4 (testcafe-legacy-api's ">=19.4.0" pulled 31.7.8, node>=20)
- minimatch 9.0.5 (@types/minimatch's "*" pulled 10.2.5, node>=18)
Temporary workaround pending upstream CLI fix (percy/cli#2301).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This SDK has no committed lockfile, so CI's bare `yarn` resolves dependencies fresh to the latest versions each run. Via @percy/core, that now pulls node-releases@2.0.47 (node>=18, through nyc->babel->browserslist) and snyk-nodejs-lockfile-parser@2.7.1 (node>=18, which also drags in @yarnpkg/core@4 + tar@7) — and yarn hard-fails on the engine mismatch, breaking the Node 14 leg on install. Pin both back to their last Node-14-compatible line via resolutions (yarn honors these on the fresh install); the snyk pin also drops the @yarnpkg/tar@7 subtree. Temporary workaround pending the upstream CLI fix (percy/cli#2301). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
* fix: merge .percy.yml config options with snapshot options for serializeDOM Previously, only per-snapshot options were passed to PercyDOM.serialize(), ignoring config-level settings (enableJavaScript, disableShadowDOM, etc.) from .percy.yml. Now config.snapshot is used as defaults, with per-snapshot options taking priority. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add test for config.snapshot undefined to achieve 100% branch coverage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: use utils.mergeSnapshotOptions() from @percy/sdk-utils Replace inline config merge with centralized utility from sdk-utils. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(test): remove duplicate @percy/sdk-utils import (ESM SyntaxError) Ref: PER-8053 * chore: bump @percy deps to ^1.32.0 (published mergeSnapshotOptions); regen lockfile Ref: PER-8053 * build: pin image-size to ~1.0.2 via resolutions to keep Node 14 CI green @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> * build: pin transitive deps to keep Node 14 CI green Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several loose transitive ranges to latest versions that dropped Node 14/16 support, breaking the Node 14 CI leg on install (engine-strict): - image-size 1.2.1 (node>=16) via @percy/cli-upload "^1.0.0" - node-releases 2.0.47 (node>=18) via nyc -> babel -> browserslist - snyk-nodejs-lockfile-parser 2.7.1 (node>=18) via @percy/cli-command, which also pulled @yarnpkg/core@4 + tar@7 (all node>=18) Pin each back to its last Node-14-compatible line via resolutions. Downgrading snyk-nodejs-lockfile-parser to 1.59.0 also drops the entire @yarnpkg/tar@7 subtree. Temporary workaround pending upstream CLI fix (percy/cli#2301); remove once this SDK moves to a CLI release that supports Node 14 cleanly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test: identify readiness eval by the waitForReady invocation guard The readiness-gate specs identified the readiness page.evaluate call by matching the substring "PercyDOM.waitForReady" in the script arg. The newer @percy/dom bundle (injected via fetchPercyDOM at index.js, pulled in by the @percy/cli ^1.32.0 bump) now *defines* PercyDOM.waitForReady, so that substring also appears in the bundle-injection string. The loose match then: - grabbed the bundle string instead of the readiness script (so the config- JSON assertions failed), and - made the reject-mocks reject the bundle injection itself, which propagated to the outer catch and logged "Could not take DOM snapshot". Match on the invocation guard `typeof PercyDOM.waitForReady === 'function'` emitted by sdk-utils.waitForReadyScript instead — present in the readiness script (both promise and callback modes), absent from the @percy/dom bundle. Product code unchanged; the config-merge (PER-8053) specs already pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: merge .percy.yml config options with snapshot options for serializeDOM Previously, only per-snapshot options were passed to PercyDOM.serialize(), ignoring config-level settings (enableJavaScript, disableShadowDOM, etc.) from .percy.yml. Now config.snapshot is used as defaults, with per-snapshot options taking priority. Also simplified minHeight fallback in captureResponsiveDOM since it's now always present in merged options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove dead default parameter in captureDOM for 100% branch coverage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: use utils.mergeSnapshotOptions() from @percy/sdk-utils Replace inline config merge with centralized utility from sdk-utils. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump @percy/sdk-utils + @percy/cli to ^1.32.0 (published mergeSnapshotOptions) Ref: PER-8053 * chore: regenerate yarn.lock for @percy 1.32.0 via sanctioned install Ref: PER-8053 * build: pin image-size to ~1.0.2 via resolutions to keep Node 14 CI green @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> * build: pin transitive deps to keep Node 14 CI green Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several loose transitive ranges to versions that dropped Node 14/16 support, breaking the Node 14 CI leg on install (engine-strict): - image-size 1.2.1 (node>=16) via @percy/cli-upload - node-releases 2.0.47 (node>=18) via nyc -> babel -> browserslist - snyk-nodejs-lockfile-parser 2.7.1 (node>=18) via @percy/cli-command (also pulled @yarnpkg/core@4 + tar@7) Pin each back to its last Node-14-compatible line via resolutions. Temporary workaround pending upstream CLI fix (percy/cli#2301). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: drop dead default param on captureDOM to satisfy 100% branch gate The merge combined master's `captureDOM(driver, options = {})` default with our config-merge, whose sole caller passes `mergeSnapshotOptions(options)` — always a defined object. That makes the `= {}` default branch unreachable, so the 100% branch-coverage gate fell to 99.64% (uncovered branch at index.js:584). Drop the now-dead default; the single caller always supplies a defined options object. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: merge .percy.yml config options with snapshot options for serializeDOM Previously, only per-snapshot options were passed to PercyDOM.serialize(), ignoring config-level settings (enableJavaScript, disableShadowDOM, etc.) from .percy.yml. Now config.snapshot is used as defaults, with per-snapshot options taking priority. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: use utils.mergeSnapshotOptions() from @percy/sdk-utils Replace inline config merge with centralized utility from sdk-utils. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump @percy/sdk-utils + @percy/cli to ^1.32.0 (published mergeSnapshotOptions) Ref: PER-8053 * chore: bump @percy deps to ^1.32.0 (published mergeSnapshotOptions); regen lockfile Ref: PER-8053 * build: pin image-size to ~1.0.2 via resolutions to keep Node 14 CI green @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> * build: pin transitive deps to keep Node 14 CI green Regenerating the lockfile for the @percy/cli ^1.32.0 bump re-resolved several loose ranges to versions that dropped Node 14 support, breaking the Node 14 CI leg on install (engine-strict). Pin each back to its last Node-14-compatible line: - image-size ~1.0.2 (was 1.2.1, node>=16; via @percy/cli-upload) - node-releases 2.0.19 (was 2.0.47, node>=18; via nyc->babel->browserslist) - snyk-nodejs-lockfile-parser 1.59.0 (was 2.7.1, node>=18; via @percy/cli-command; also drops the @yarnpkg/core@4 + tar@7 subtree) - testcafe 2.0.1 (devDep) (regen pulled 2.6.2, node>=16; 2.0.1 is what master used) - testcafe-hammerhead 24.7.4 (testcafe-legacy-api's ">=19.4.0" pulled 31.7.8, node>=20) - minimatch 9.0.5 (@types/minimatch's "*" pulled 10.2.5, node>=18) Temporary workaround pending upstream CLI fix (percy/cli#2301). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <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