Compare commits

...

2 Commits

Author SHA1 Message Date
Lovell Fuller
283c7d3f0c Drop Node.js 18, now requires Node.js >= 20.9.0 2025-12-17 15:08:34 +00:00
Lovell Fuller
34c39fa194 Upgrade to libvips v8.18.0-rc.2 2025-12-17 13:26:51 +00:00
25 changed files with 142 additions and 127 deletions

View File

@@ -31,7 +31,7 @@ please open an issue against that package instead.
<!-- Please place an [x] in the relevant box to confirm. -->
- [ ] I am using Node.js with a version that satisfies `^18.17.0 || ^20.3.0 || >=21.0.0`
- [ ] I am using Node.js with a version that satisfies `>=20.9.0`
- [ ] I am using Deno
- [ ] I am using Bun

View File

@@ -9,8 +9,8 @@ jobs:
contents: read
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v5
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
- run: npm install --ignore-scripts
@@ -31,123 +31,129 @@ jobs:
- os: ubuntu-24.04
container: rockylinux:8
nodejs_arch: x64
nodejs_version: "^18.17.0"
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: linux-x64
package: true
- os: ubuntu-24.04
container: rockylinux:8
nodejs_arch: x64
nodejs_version: "^20.3.0"
nodejs_version_major: 20
platform: linux-x64
- os: ubuntu-24.04
container: rockylinux:8
nodejs_arch: x64
nodejs_version: "^22.9.0"
nodejs_version: "^22"
nodejs_version_major: 22
platform: linux-x64
- os: ubuntu-24.04
container: node:18-alpine3.17
nodejs_version_major: 18
platform: linuxmusl-x64
package: true
container: rockylinux:8
nodejs_arch: x64
nodejs_version: "^24"
nodejs_version_major: 24
platform: linux-x64
- os: ubuntu-24.04
container: node:20-alpine3.18
nodejs_version_major: 20
platform: linuxmusl-x64
package: true
- os: ubuntu-24.04
container: node:22-alpine3.20
nodejs_version_major: 22
platform: linuxmusl-x64
- os: ubuntu-24.04
container: node:24-alpine3.22
nodejs_version_major: 24
platform: linuxmusl-x64
- os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8
nodejs_arch: arm64
nodejs_version: "^18.17.0"
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: linux-arm64
package: true
- os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8
nodejs_arch: arm64
nodejs_version: "^20.3.0"
nodejs_version_major: 20
nodejs_version: "^22"
nodejs_version_major: 22
platform: linux-arm64
- os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8
nodejs_arch: arm64
nodejs_version: "^24"
nodejs_version_major: 24
platform: linux-arm64
- os: macos-15-intel
nodejs_arch: x64
nodejs_version: "^18.17.0"
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: darwin-x64
package: true
- os: macos-15-intel
nodejs_arch: x64
nodejs_version: "^20.3.0"
nodejs_version_major: 20
nodejs_version: "^22"
nodejs_version_major: 22
platform: darwin-x64
- os: macos-15-intel
nodejs_arch: x64
nodejs_version: "^22.9.0"
nodejs_version_major: 22
nodejs_version: "^24"
nodejs_version_major: 24
platform: darwin-x64
- os: macos-15
nodejs_arch: arm64
nodejs_version: "^18.17.0"
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: darwin-arm64
package: true
- os: macos-15
nodejs_arch: arm64
nodejs_version: "^20.3.0"
nodejs_version_major: 20
nodejs_version: "^22"
nodejs_version_major: 22
platform: darwin-arm64
- os: macos-15
nodejs_arch: arm64
nodejs_version: "^22.9.0"
nodejs_version_major: 22
nodejs_version: "^24"
nodejs_version_major: 24
platform: darwin-arm64
- os: windows-2022
nodejs_arch: x86
nodejs_version: "18.18.2" # pinned to avoid 18.19.0 and npm 10
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: win32-ia32
package: true
- os: windows-2022
nodejs_arch: x86
nodejs_version: "^20.3.0"
nodejs_version_major: 20
platform: win32-ia32
- os: windows-2022
nodejs_arch: x86
nodejs_version: "^22.9.0"
nodejs_version: "^22"
nodejs_version_major: 22
platform: win32-ia32
- os: windows-2022
nodejs_arch: x64
nodejs_version: "^18.17.0"
nodejs_version_major: 18
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: win32-x64
package: true
- os: windows-2022
nodejs_arch: x64
nodejs_version: "^20.3.0"
nodejs_version_major: 20
nodejs_version: "^22"
nodejs_version_major: 22
platform: win32-x64
- os: windows-2022
nodejs_arch: x64
nodejs_version: "^22.9.0"
nodejs_version_major: 22
nodejs_version: "^24"
nodejs_version_major: 24
platform: win32-x64
- os: windows-11-arm
nodejs_arch: arm64
nodejs_version: "^20.3.0"
nodejs_version: "^20.9.0"
nodejs_version_major: 20
platform: win32-arm64
package: true
- os: windows-11-arm
nodejs_arch: arm64
nodejs_version: "^22.9.0"
nodejs_version: "^22"
nodejs_version_major: 22
platform: win32-arm64
- os: windows-11-arm
nodejs_arch: arm64
nodejs_version: "^24"
nodejs_version_major: 24
platform: win32-arm64
steps:
- name: Dependencies (Rocky Linux glibc)
if: contains(matrix.container, 'rockylinux')
@@ -159,22 +165,22 @@ jobs:
run: apk add build-base git python3 font-noto --update-cache
- name: Dependencies (Python 3.11 - macOS, Windows)
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Dependencies (Node.js)
if: "!contains(matrix.platform, 'linuxmusl')"
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.nodejs_version }}
architecture: ${{ matrix.nodejs_arch }}
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- run: npm install
- run: npm run build
- run: npm run test-unit
- if: matrix.package
run: npm run package-from-local-build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
if: matrix.package
with:
name: ${{ matrix.platform }}
@@ -191,16 +197,18 @@ jobs:
image: ${{ matrix.container }}
volumes:
- /opt:/opt:rw,rshared
- /opt:/__e/node20:ro,rshared
- /opt:/__e/node24:ro,rshared
strategy:
fail-fast: false
matrix:
include:
- container: node:18-alpine3.17
nodejs_version_major: 18
package: true
- container: node:20-alpine3.18
- container: node:20-alpine3.20
nodejs_version_major: 20
package: true
- container: node:22-alpine3.20
nodejs_version_major: 22
- container: node:24-alpine3.22
nodejs_version_major: 24
steps:
- name: Allow Linux musl containers on ARM64 runners # https://github.com/actions/runner/issues/801#issuecomment-2394425757
shell: sh
@@ -211,13 +219,13 @@ jobs:
ln -s /usr/bin/node /opt/bin/node
- name: Dependencies
run: apk add build-base git python3 font-noto --update-cache
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- run: npm install
- run: npm run build
- run: npm run test-unit
- if: matrix.package
run: npm run package-from-local-build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
if: matrix.package
with:
name: linuxmusl-arm64
@@ -238,20 +246,20 @@ jobs:
base_image: "balenalib/rpi-raspbian:bullseye"
nodejs_arch: armv6l
nodejs_hostname: unofficial-builds.nodejs.org
nodejs_version: "18.17.0"
nodejs_version_major: 18
nodejs_version: "20.9.0"
nodejs_version_major: 20
- platform: linux-s390x
base_image: "--platform=linux/s390x s390x/debian:bookworm"
nodejs_arch: s390x
nodejs_hostname: nodejs.org
nodejs_version: "18.17.0"
nodejs_version_major: 18
nodejs_version: "20.9.0"
nodejs_version_major: 20
- platform: linux-ppc64
base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm"
nodejs_arch: ppc64le
nodejs_hostname: nodejs.org
nodejs_version: "18.17.0"
nodejs_version_major: 18
nodejs_version: "20.9.0"
nodejs_version_major: 20
- platform: linux-riscv64
base_image: "--platform=linux/riscv64 riscv64/debian:trixie"
compiler_flags: "-march=rv64gc"
@@ -260,7 +268,7 @@ jobs:
nodejs_version: "20.19.5"
nodejs_version_major: 20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: uraimo/run-on-arch-action@v3
with:
arch: none
@@ -279,7 +287,7 @@ jobs:
npm run build
node --test test/unit/io.js
npm run package-from-local-build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: ${{ matrix.platform }}
path: npm/${{ matrix.platform }}
@@ -291,7 +299,7 @@ jobs:
needs: lint
name: "build-wasm32 [package]"
runs-on: ubuntu-24.04
container: "emscripten/emsdk:4.0.18"
container: "emscripten/emsdk:4.0.21"
steps:
- uses: actions/checkout@v4
- name: Dependencies
@@ -311,7 +319,7 @@ jobs:
test "$EMSCRIPTEN_VERSION_LIBVIPS" = "$EMSCRIPTEN_VERSION_SHARP"
- run: emmake npm run test-unit
- run: emmake npm run package-from-local-build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: wasm32
path: npm/wasm32
@@ -329,12 +337,12 @@ jobs:
- build-emscripten
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:
path: npm
- name: Create npm workspace tarball
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: '24'
- name: Create release notes

View File

@@ -8,7 +8,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
It can be used with all JavaScript runtimes
that provide support for Node-API v9, including
Node.js (^18.17.0 or >= 20.3.0), Deno and Bun.
Node.js (>= 20.9.0), Deno and Bun.
Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings

View File

@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.9/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",

View File

@@ -0,0 +1,8 @@
---
title: v0.35.0 - TBC
slug: changelog/v0.35.0
---
* Upgrade to libvips v8.18.0 for upstream bug fixes.
* Drop support for Node.js 18, now requires Node.js >= 20.9.0.

View File

@@ -10,7 +10,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
It can be used with all JavaScript runtimes
that provide support for Node-API v9, including
Node.js >= 18.17.0, Deno and Bun.
Node.js >= 20.9.0, Deno and Bun.
Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings

View File

@@ -39,7 +39,7 @@ deno run --allow-env --allow-ffi --allow-read --allow-sys ...
## Prerequisites
* Node-API v9 compatible runtime e.g. Node.js ^18.17.0 or >=20.3.0.
* Node-API v9 compatible runtime e.g. Node.js >= 20.9.0.
## Prebuilt binaries

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-arm64": "1.2.4"
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"os": [
"darwin"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-x64": "1.2.4"
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"os": [
"darwin"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm": "1.2.4"
"@img/sharp-libvips-linux-arm": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.31"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm64": "1.2.4"
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.26"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-ppc64": "1.2.4"
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.36"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-riscv64": "1.2.4"
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.41"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-s390x": "1.2.4"
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.36"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-x64": "1.2.4"
"@img/sharp-libvips-linux-x64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"glibc": ">=2.26"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"musl": ">=1.2.2"

View File

@@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-x64": "1.2.4"
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.1"
},
"files": [
"lib"
@@ -29,7 +29,7 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"musl": ">=1.2.2"

View File

@@ -28,10 +28,10 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"dependencies": {
"@emnapi/runtime": "^1.7.0"
"@emnapi/runtime": "^1.7.1"
},
"cpu": [
"wasm32"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"os": [
"win32"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"os": [
"win32"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"os": [
"win32"

View File

@@ -146,16 +146,16 @@
"optionalDependencies": {
"@img/sharp-darwin-arm64": "0.34.5",
"@img/sharp-darwin-x64": "0.34.5",
"@img/sharp-libvips-darwin-arm64": "1.2.4",
"@img/sharp-libvips-darwin-x64": "1.2.4",
"@img/sharp-libvips-linux-arm": "1.2.4",
"@img/sharp-libvips-linux-arm64": "1.2.4",
"@img/sharp-libvips-linux-ppc64": "1.2.4",
"@img/sharp-libvips-linux-riscv64": "1.2.4",
"@img/sharp-libvips-linux-s390x": "1.2.4",
"@img/sharp-libvips-linux-x64": "1.2.4",
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
"@img/sharp-libvips-linuxmusl-x64": "1.2.4",
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.1",
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.1",
"@img/sharp-libvips-linux-arm": "1.3.0-rc.1",
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.1",
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.1",
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.1",
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.1",
"@img/sharp-libvips-linux-x64": "1.3.0-rc.1",
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.1",
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.1",
"@img/sharp-linux-arm": "0.34.5",
"@img/sharp-linux-arm64": "0.34.5",
"@img/sharp-linux-ppc64": "0.34.5",
@@ -170,17 +170,17 @@
"@img/sharp-win32-x64": "0.34.5"
},
"devDependencies": {
"@biomejs/biome": "^2.3.4",
"@biomejs/biome": "^2.3.9",
"@cpplint/cli": "^0.1.0",
"@emnapi/runtime": "^1.7.0",
"@img/sharp-libvips-dev": "1.2.4",
"@img/sharp-libvips-dev-wasm32": "1.2.4",
"@img/sharp-libvips-win32-arm64": "1.2.4",
"@img/sharp-libvips-win32-ia32": "1.2.4",
"@img/sharp-libvips-win32-x64": "1.2.4",
"@emnapi/runtime": "^1.7.1",
"@img/sharp-libvips-dev": "1.3.0-rc.1",
"@img/sharp-libvips-dev-wasm32": "1.3.0-rc.1",
"@img/sharp-libvips-win32-arm64": "1.3.0-rc.1",
"@img/sharp-libvips-win32-ia32": "1.3.0-rc.1",
"@img/sharp-libvips-win32-x64": "1.3.0-rc.1",
"@types/node": "*",
"emnapi": "^1.7.0",
"exif-reader": "^2.0.2",
"emnapi": "^1.7.1",
"exif-reader": "^2.0.3",
"extract-zip": "^2.0.1",
"icc": "^3.0.0",
"jsdoc-to-markdown": "^9.1.3",
@@ -191,10 +191,10 @@
},
"license": "Apache-2.0",
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"config": {
"libvips": ">=8.17.3"
"libvips": ">=8.18.0"
},
"funding": {
"url": "https://opencollective.com/libvips"

View File

@@ -18,9 +18,9 @@
// Verify platform and compiler compatibility
#if (VIPS_MAJOR_VERSION < 8) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 17) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 3)
#error "libvips version 8.17.3+ is required - please see https://sharp.pixelplumbing.com/install"
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 18) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 0)
#error "libvips version 8.18.0+ is required - please see https://sharp.pixelplumbing.com/install"
#endif
#if defined(__has_include)

View File

@@ -180,7 +180,7 @@ describe('libvips binaries', () => {
process.env.npm_config_arch = 's390x';
process.env.npm_config_libc = '';
const locatorHash = libvips.yarnLocator();
assert.strictEqual(locatorHash, '4ab19140fd');
assert.strictEqual(locatorHash, '8cdba194cb');
delete process.env.npm_config_platform;
delete process.env.npm_config_arch;
delete process.env.npm_config_libc;

View File

@@ -226,12 +226,11 @@ describe('PNG', () => {
.png({ colours: 2, palette: false })
.toBuffer();
const { channels, isPalette, bitsPerSample, paletteBitDepth, size, space } = await sharp(data).metadata();
const { channels, isPalette, bitsPerSample, paletteBitDepth, space } = await sharp(data).metadata();
assert.strictEqual(channels, 1);
assert.strictEqual(isPalette, false);
assert.strictEqual(bitsPerSample, 1);
assert.strictEqual(paletteBitDepth, undefined);
assert.strictEqual(size, 89);
assert.strictEqual(space, 'b-w');
});