Skip to content

Commit 3c14dbb

Browse files
committed
Minimise use of engines property to improve yarn v1 support
1 parent 82cebc3 commit 3c14dbb

File tree

16 files changed

+34
-52
lines changed

16 files changed

+34
-52
lines changed

docs/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Requires libvips v8.15.3
1515
[#4111](https://github.com/lovell/sharp/pull/4111)
1616
[@project0](https://github.com/project0)
1717

18+
* Minimise use of `engines` property to improve yarn v1 support.
19+
[#4130](https://github.com/lovell/sharp/issues/4130)
20+
1821
* Ensure `sharp.format.heif` includes only AVIF when using prebuilt binaries.
1922
[#4132](https://github.com/lovell/sharp/issues/4132)
2023

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Use the [supportedArchitectures](https://pnpm.io/package_json#pnpmsupportedarchi
9292
## Custom libvips
9393

9494
To use a custom, globally-installed version of libvips instead of the provided binaries,
95-
make sure it is at least the version listed under `engines.libvips` in the `package.json` file
95+
make sure it is at least the version listed under `config.libvips` in the `package.json` file
9696
and that it can be located using `pkg-config --modversion vips-cpp`.
9797

9898
For help compiling libvips and its dependencies, please see

lib/libvips.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const semverGreaterThanOrEqualTo = require('semver/functions/gte');
1010
const semverSatisfies = require('semver/functions/satisfies');
1111
const detectLibc = require('detect-libc');
1212

13-
const { engines, optionalDependencies } = require('../package.json');
13+
const { config, engines, optionalDependencies } = require('../package.json');
1414

1515
const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || /* istanbul ignore next */
16-
engines.libvips;
16+
config.libvips;
1717
const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version;
1818

1919
const prebuiltPlatforms = [

lib/sharp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ if (sharp) {
7373
}
7474
if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {
7575
try {
76-
const { engines } = require(`@img/sharp-libvips-${runtimePlatform}/package`);
76+
const { config } = require(`@img/sharp-libvips-${runtimePlatform}/package`);
7777
const libcFound = `${familySync()} ${versionSync()}`;
78-
const libcRequires = `${engines.musl ? 'musl' : 'glibc'} ${engines.musl || engines.glibc}`;
78+
const libcRequires = `${config.musl ? 'musl' : 'glibc'} ${config.musl || config.glibc}`;
7979
help.push(
8080
'- Update your OS:',
8181
` Found ${libcFound}`,

npm/darwin-arm64/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
36-
"glibc": ">=2.26"
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
3733
},
3834
"os": [
3935
"darwin"

npm/darwin-x64/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
36-
"glibc": ">=2.26"
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
3733
},
3834
"os": [
3935
"darwin"

npm/linux-arm/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33+
},
34+
"config": {
3635
"glibc": ">=2.28"
3736
},
3837
"os": [

npm/linux-arm64/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33+
},
34+
"config": {
3635
"glibc": ">=2.26"
3736
},
3837
"os": [

npm/linux-s390x/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33+
},
34+
"config": {
3635
"glibc": ">=2.31"
3736
},
3837
"os": [

npm/linux-x64/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"./package": "./package.json"
3030
},
3131
"engines": {
32-
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
33-
"npm": ">=9.6.5",
34-
"yarn": ">=3.2.0",
35-
"pnpm": ">=7.1.0",
32+
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33+
},
34+
"config": {
3635
"glibc": ">=2.26"
3736
},
3837
"os": [

0 commit comments

Comments
 (0)