fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support - #2301

Merged
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14
Jul 10, 2026
Merged

fix(cli-upload): pin image-size to ~1.0.2 to keep Node 14 support#2301
rishigupta1599 merged 1 commit into
masterfrom
fix/cli-upload-image-size-node14

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Problem

@percy/cli declares engines: { node: ">=14" }, but @percy/cli-upload declared its image-size dependency as the loose range "^1.0.0".

image-size raised its own engine requirement to node >=16 starting at v1.1.1 (1.0.2 = >=14, 1.1.1 / 1.2.0 / 1.2.1 = >=16). Because ^1.0.0 resolves to the latest matching version, any consumer that regenerates its lockfile against @percy/cli now pulls image-size@1.2.1 (node>=16) — silently violating @percy/cli's own engines: node>=14.

This isn't a code change in any recent CLI release — the ^1.0.0 range has been here since @percy/cli-upload was first added. It only surfaces now because (a) image-size published 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 transitive image-size@1.2.1 requires node>=16 even though @percy/cli claims >=14.

Fix

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 monorepo's own lockfile already resolved image-size@1.0.2; this just keeps every downstream consumer pinned to that line too.
  • image-size@1.0.x is API-compatible with cli-upload's usage (reading image dimensions), so no functional change.

Alternative considered

Officially dropping Node 14 (bump engines to >=16 across 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

@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>
@rishigupta1599
rishigupta1599 requested a review from a team as a code ownerJune 17, 2026 11:48
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
@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>

@rishigupta1599rishigupta1599 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

@rishigupta1599

Copy link
Copy Markdown
ContributorAuthor

Claude Code PR Review

PR:#2301Head:00427b8Reviewers: stack:code-reviewer

Summary

Pins the image-size dependency in @percy/cli-upload from ^1.0.0 (>=1.0.0 <2.0.0) to ~1.0.2 (>=1.0.2 <1.1.0) to keep Node 14 compatibility, since image-size@1.1.0+ raises its Node engine requirement to >=16/>=18. The yarn.lock entry key is updated to match.

Review Table

PriorityCategoryCheckStatusNotes
HighSecurityNo hardcoded secrets or credentialsPassDependency-range change only.
HighSecurityAuthentication/authorization checks presentN/ANo auth code touched.
HighSecurityInput validation and sanitizationN/ANo input handling touched.
HighSecurityNo IDOR — resource ownership validatedN/ANot applicable.
HighSecurityNo SQL injection (parameterized queries)N/ANo DB code.
HighCorrectnessLogic is correct, handles edge casesPass~1.0.2 correctly excludes 1.1.0+, achieving the Node 14 goal.
HighCorrectnessError handling is explicit, no swallowed exceptionsN/ANo logic changes.
HighCorrectnessNo race conditions or concurrency issuesN/ANot applicable.
MediumTestingNew code has corresponding testsN/ADependency pin; existing Node 14 CI matrix covers it.
MediumTestingError paths and edge cases testedN/ANot applicable.
MediumTestingExisting tests still pass (no regressions)PassResolved version unchanged (1.0.2); no behavioral change.
MediumPerformanceNo N+1 queries or unbounded data fetchingN/ANot applicable.
MediumPerformanceLong-running tasks use background jobsN/ANot applicable.
MediumQualityFollows existing codebase patternsPasspackage.json + yarn.lock key updated consistently.
MediumQualityChanges are focused (single concern)PassSingle dependency pin.
LowQualityMeaningful names, no dead codePassN/A.
LowQualityComments explain why, not whatPassCommit message states the Node 14 rationale.
LowQualityNo unnecessary dependencies addedPassNo new dependency; tightens an existing range.

Findings

No blocking findings. One optional style note below.

  • File:packages/cli-upload/package.json:38
  • Severity: Low
  • Reviewer: stack:code-reviewer (severity corrected by orchestrator)
  • Issue:~1.0.2 (>=1.0.2 <1.1.0) currently resolves to exactly 1.0.2, since no later 1.0.x patch exists. It works correctly. ~1.0.0 would express the same "any safe 1.0.x, exclude the breaking 1.1.0 minor" intent slightly more idiomatically and admit future 1.0.x patches.
  • Suggestion: Optional — either form is correct and both exclude 1.1.0+. Keep ~1.0.2 if a >=1.0.2 floor is intended; otherwise ~1.0.0 is marginally more conventional.

Note on the reviewer's CRITICAL (yarn.lock "manual edit")

The sub-reviewer flagged the lockfile change as a manual edit that doesn't match package.json. This was verified as a false positive and is not counted against the verdict:

  • The lockfile key was updated from image-size@^1.0.0: to image-size@~1.0.2:, which matchespackage.json exactly.
  • The resolved version was already 1.0.2 (satisfies both the old and new range), so yarn install legitimately produces only a key rename with unchanged version/resolved/integrity. An unchanged integrity hash is the expected output when the resolved version doesn't change — not evidence of a hand edit.
  • There is only one image-size entry in the lockfile; nothing else needed collapsing.

The reviewer's MEDIUM (no CI matrix change) is informational only — the existing Node 14 CI matrix already exercises cli-upload.


Verdict: PASS — focused, correct dependency pin that achieves the stated Node 14 compatibility goal; the lockfile is consistent and the sole CRITICAL was a verified false positive.

rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
@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 added a commit to percy/percy-puppeteer that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jun 17, 2026
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>
rishigupta1599 added a commit to percy/percy-nightmare that referenced this pull request Jun 19, 2026
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>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actionsgithub-actionsBot added the 🍞 stale Closed due to inactivity label Jul 7, 2026
rishigupta1599 added a commit to percy/percy-puppeteer that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-selenium-js that referenced this pull request Jul 10, 2026
* 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>
rishigupta1599 added a commit to percy/percy-testcafe that referenced this pull request Jul 10, 2026
* 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>
@rishigupta1599
rishigupta1599 merged commit bb501be into masterJul 10, 2026
46 checks passed
@rishigupta1599
rishigupta1599 deleted the fix/cli-upload-image-size-node14 branch July 10, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍞 staleClosed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rishigupta1599@pranavz28