Skip to content

chore: bump sharp to 0.34.5 (latest stable, binary as optional dep, no postinstall download)#453

Merged
tony8713 merged 2 commits into
test/resolver-image-snapshotsfrom
chore/bump-sharp
Jun 10, 2026
Merged

chore: bump sharp to 0.34.5 (latest stable, binary as optional dep, no postinstall download)#453
tony8713 merged 2 commits into
test/resolver-image-snapshotsfrom
chore/bump-sharp

Conversation

@tony8713

@tony8713 tony8713 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

sharp was pinned ^0.30.1. On 0.30.x the native binary is fetched in a postinstall step, which times out flakily on CI and causes intermittent install failures.

sharp 0.33+ ships platform binaries as @img/sharp-* npm optional dependencies, so there is no postinstall download step at all - the right prebuilt binary is just resolved from the lockfile. Bumped to the current latest stable, 0.34.5 (0.35.x is still RC-only), per @wa0x6e's request for the latest version.

Scope

  • package.json: sharp ^0.30.1 -> ^0.34.5
  • yarn.lock: now carries the @img/sharp-* optional deps at 0.34.5 (e.g. @img/sharp-darwin-arm64, the linux/musl/win32 variants, and @img/sharp-libvips-* at 1.2.4)
  • src/utils.ts: annotate resize() as Promise<Buffer>. sharp 0.34.5's types resolve cleanly to Buffer, so no any cast is needed - this just makes the inferred return type explicit.

Base

Based on #456 (test/resolver-image-snapshots). The shared test-snapshot changes that adapt the resolver tests to the new sharp types are inherited from that branch, not duplicated here.

Node compat

engines.node is >=22.6.0, CI runs on Node 22. sharp 0.34.5 requires Node ^18.17.0 || ^20.3.0 || >=21.0.0, so Node 22 is well within range.

🤖 Generated with Claude Code

@tony8713 tony8713 changed the title chore: bump sharp to 0.33 (binary as optional dep, no postinstall download) chore: bump sharp to 0.34.5 (latest stable, binary as optional dep, no postinstall download) Jun 7, 2026
@tony8713
tony8713 force-pushed the chore/bump-sharp branch 3 times, most recently from e21d9e1 to 634bcaf Compare June 8, 2026 15:59
…ownload)

Rebased onto test/resolver-image-snapshots. Keeps only the sharp
dependency bump and the resize() return-type adaptation; test/snapshot
changes are dropped since the new image-snapshot test helper handles
them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tony8713
tony8713 changed the base branch from master to test/resolver-image-snapshots June 10, 2026 00:29
@tony8713
tony8713 merged commit bee1873 into test/resolver-image-snapshots Jun 10, 2026
2 checks passed
@tony8713
tony8713 deleted the chore/bump-sharp branch June 10, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant