Minimise use of engines property to improve yarn v1 support

This commit is contained in:
Lovell Fuller 2024-08-13 09:05:11 +01:00
parent 82cebc31d0
commit 3c14dbb21e
16 changed files with 34 additions and 52 deletions

View File

@ -15,6 +15,9 @@ Requires libvips v8.15.3
[#4111](https://github.com/lovell/sharp/pull/4111) [#4111](https://github.com/lovell/sharp/pull/4111)
[@project0](https://github.com/project0) [@project0](https://github.com/project0)
* Minimise use of `engines` property to improve yarn v1 support.
[#4130](https://github.com/lovell/sharp/issues/4130)
* Ensure `sharp.format.heif` includes only AVIF when using prebuilt binaries. * Ensure `sharp.format.heif` includes only AVIF when using prebuilt binaries.
[#4132](https://github.com/lovell/sharp/issues/4132) [#4132](https://github.com/lovell/sharp/issues/4132)

View File

@ -92,7 +92,7 @@ Use the [supportedArchitectures](https://pnpm.io/package_json#pnpmsupportedarchi
## Custom libvips ## Custom libvips
To use a custom, globally-installed version of libvips instead of the provided binaries, To use a custom, globally-installed version of libvips instead of the provided binaries,
make sure it is at least the version listed under `engines.libvips` in the `package.json` file make sure it is at least the version listed under `config.libvips` in the `package.json` file
and that it can be located using `pkg-config --modversion vips-cpp`. and that it can be located using `pkg-config --modversion vips-cpp`.
For help compiling libvips and its dependencies, please see For help compiling libvips and its dependencies, please see

View File

@ -10,10 +10,10 @@ const semverGreaterThanOrEqualTo = require('semver/functions/gte');
const semverSatisfies = require('semver/functions/satisfies'); const semverSatisfies = require('semver/functions/satisfies');
const detectLibc = require('detect-libc'); const detectLibc = require('detect-libc');
const { engines, optionalDependencies } = require('../package.json'); const { config, engines, optionalDependencies } = require('../package.json');
const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || /* istanbul ignore next */ const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || /* istanbul ignore next */
engines.libvips; config.libvips;
const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version; const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version;
const prebuiltPlatforms = [ const prebuiltPlatforms = [

View File

@ -73,9 +73,9 @@ if (sharp) {
} }
if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) { if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {
try { try {
const { engines } = require(`@img/sharp-libvips-${runtimePlatform}/package`); const { config } = require(`@img/sharp-libvips-${runtimePlatform}/package`);
const libcFound = `${familySync()} ${versionSync()}`; const libcFound = `${familySync()} ${versionSync()}`;
const libcRequires = `${engines.musl ? 'musl' : 'glibc'} ${engines.musl || engines.glibc}`; const libcRequires = `${config.musl ? 'musl' : 'glibc'} ${config.musl || config.glibc}`;
help.push( help.push(
'- Update your OS:', '- Update your OS:',
` Found ${libcFound}`, ` Found ${libcFound}`,

View File

@ -29,11 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.26"
}, },
"os": [ "os": [
"darwin" "darwin"

View File

@ -29,11 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"glibc": ">=2.26"
}, },
"os": [ "os": [
"darwin" "darwin"

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"glibc": ">=2.28" "glibc": ">=2.28"
}, },
"os": [ "os": [

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"glibc": ">=2.26" "glibc": ">=2.26"
}, },
"os": [ "os": [

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"glibc": ">=2.31" "glibc": ">=2.31"
}, },
"os": [ "os": [

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"glibc": ">=2.26" "glibc": ">=2.26"
}, },
"os": [ "os": [

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"musl": ">=1.2.2" "musl": ">=1.2.2"
}, },
"os": [ "os": [

View File

@ -29,10 +29,9 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5", },
"yarn": ">=3.2.0", "config": {
"pnpm": ">=7.1.0",
"musl": ">=1.2.2" "musl": ">=1.2.2"
}, },
"os": [ "os": [

View File

@ -28,10 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
}, },
"dependencies": { "dependencies": {
"@emnapi/runtime": "^1.2.0" "@emnapi/runtime": "^1.2.0"

View File

@ -28,10 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
}, },
"os": [ "os": [
"win32" "win32"

View File

@ -28,10 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
}, },
"os": [ "os": [
"win32" "win32"

View File

@ -187,7 +187,9 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"libvips": ">=8.15.3" "libvips": ">=8.15.3"
}, },
"funding": { "funding": {