Move jimp and every @jimp/* package to 2.2.0 together¶
- Kind: decision
- Date: 2026-11-30
- Source: Dependabot PRs #19472, #19475, #19476, #19477, #19478, #19479, #19480
- Shaped: Runtime dependency pinning
Jimp 2.2.0 added these packages to its closure. None is chosen or imported by AutoMobile; the pin tool promotes each to an exact pin, and the stdlib-first check asks for a record of each:
Dependency: @jimp/jpeg-js
Dependency: @jimp/js-ico
Dependency: @jimp/plugin-border
Dependency: @jimp/plugin-draw
Dependency: @jimp/plugin-lut
Dependency: @jimp/plugin-morphology
Dependency: @jimp/pngjs
Dependency: fflate
Dependency: opentype.js
Context¶
Dependabot opened one PR per @jimp/* package for 1.7.0 to 2.2.0. Each left a mixed 1.x/2.x tree,
which scripts/release/pin-runtime-deps.ts cannot pin, so every PR failed the same required checks.
Jimp 2 requires Node 22 and changes some image math (greyscale rounding, premultiplied-alpha resize,
loadFont file handling).
Options¶
- Merge the seven PRs one at a time. Each intermediate tree is mixed, so none can go green.
- Hold jimp at 1.7.0 with a Dependabot ignore. The hold would only delay the move.
- Move all packages in one PR and add a Dependabot group so they stay together.
Decision¶
One PR moves jimp and every @jimp/* entry to 2.2.0, and a jimp Dependabot group (jimp,
@jimp/*) keeps them together. Jimp 2.2.0 changes the dependency holds:
zodstays held at the current major: every@jimp/*package needs^4.6.7.file-typemoves to 22.x because@jimp/coreneeds^22.3.0; its major hold stays.pakohoists at 3.0.3 for@jimp/pngjs;utif2keeps a nested 1.0.11.@jimp/js-pngleavesbundledDependencies: its decoder is now the separate@jimp/pngjs, so it no longer nests a conflictingpngjs.
The bundled closure grew past its 2.5 MB budget because @jimp/core now needs fflate, which
ships a CJS twin beside its ESM build. The prepack prune drops that twin, as it does for zod, and
the budget stays at 2.5 MB (the pruned closure is 2.22 MB).
Two behavior changes needed code:
- Bun defines
self, so Jimp 2 treats it as a web worker.loadFontthen fetches the font and reads each page throughJimp.readwith afile:URL. Jimp reads that URL as a missing path.loadJimphidesselfwhile Jimp evaluates, so fonts are read from disk. - Resize now works in premultiplied alpha, so a translucent pixel can differ by one level in a color
channel (
0x31at alpha0x80becomes0x32). The Android icon test pins the new value.
Consequences¶
The runtime graph manifest, lock and Dependabot config describe one jimp version. A Dependabot group
PR still needs scripts/release/pin-runtime-deps.ts --write run by hand, since Dependabot cannot
regenerate the manifest. The buffer polyfill that Jimp 2 adds is skipped by the bundled-import smoke
check, because a bare buffer import resolves to the Node builtin.