Skip to content

Commit

Permalink
WIP: Remove extraneous keys from engines property
Browse files Browse the repository at this point in the history
Prevent unmaintained yarn v1 from coughing up furballs
  • Loading branch information
lovell committed Aug 13, 2024
1 parent ad36fa0 commit ebd6fc4
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 54 deletions.
4 changes: 2 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Ready-compiled sharp and libvips binaries are provided for use on the most commo

* macOS x64 (>= 10.13)
* macOS ARM64
* Linux ARM (glibc >= 2.31)
* Linux ARM (glibc >= 2.28)
* Linux ARM64 (glibc >= 2.26, musl >= 1.2.2)
* Linux s390x (glibc >= 2.31)
* Linux x64 (glibc >= 2.26, musl >= 1.2.2, CPU with SSE4.2)
Expand Down Expand Up @@ -92,7 +92,7 @@ Use the [supportedArchitectures](https://pnpm.io/package_json#pnpmsupportedarchi
## Custom libvips

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`.

For help compiling libvips and its dependencies, please see
Expand Down
4 changes: 2 additions & 2 deletions lib/libvips.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const semverGreaterThanOrEqualTo = require('semver/functions/gte');
const semverSatisfies = require('semver/functions/satisfies');
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 */
engines.libvips;
config.libvips;
const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version;

const prebuiltPlatforms = [
Expand Down
4 changes: 2 additions & 2 deletions lib/sharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ if (sharp) {
}
if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {
try {
const { engines } = require(`@img/sharp-libvips-${runtimePlatform}/package`);
const { config } = require(`@img/sharp-libvips-${runtimePlatform}/package`);
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(
'- Update your OS:',
` Found ${libcFound}`,
Expand Down
6 changes: 1 addition & 5 deletions npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
"./package": "./package.json"
},
"engines": {
"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"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"os": [
"darwin"
Expand Down
6 changes: 1 addition & 5 deletions npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
"./package": "./package.json"
},
"engines": {
"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"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"os": [
"darwin"
Expand Down
7 changes: 3 additions & 4 deletions npm/linux-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"glibc": ">=2.28"
},
"os": [
Expand Down
7 changes: 3 additions & 4 deletions npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"glibc": ">=2.26"
},
"os": [
Expand Down
7 changes: 3 additions & 4 deletions npm/linux-s390x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"glibc": ">=2.31"
},
"os": [
Expand Down
7 changes: 3 additions & 4 deletions npm/linux-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"glibc": ">=2.26"
},
"os": [
Expand Down
7 changes: 3 additions & 4 deletions npm/linuxmusl-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"musl": ">=1.2.2"
},
"os": [
Expand Down
7 changes: 3 additions & 4 deletions npm/linuxmusl-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
"./package": "./package.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0",
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"config": {
"musl": ">=1.2.2"
},
"os": [
Expand Down
5 changes: 1 addition & 4 deletions npm/wasm32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"dependencies": {
"@emnapi/runtime": "^1.2.0"
Expand Down
5 changes: 1 addition & 4 deletions npm/win32-ia32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"os": [
"win32"
Expand Down
5 changes: 1 addition & 4 deletions npm/win32-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"./versions": "./versions.json"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"npm": ">=9.6.5",
"yarn": ">=3.2.0",
"pnpm": ">=7.1.0"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"os": [
"win32"
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"@img/sharp-darwin-x64": "0.33.4",
"@img/sharp-libvips-darwin-arm64": "1.0.4",
"@img/sharp-libvips-darwin-x64": "1.0.4",
"@img/sharp-libvips-linux-arm": "1.0.4",
"@img/sharp-libvips-linux-arm": "1.0.5",
"@img/sharp-libvips-linux-arm64": "1.0.4",
"@img/sharp-libvips-linux-s390x": "1.0.4",
"@img/sharp-libvips-linux-x64": "1.0.4",
Expand Down Expand Up @@ -187,7 +187,9 @@
},
"license": "Apache-2.0",
"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"
},
"funding": {
Expand Down

0 comments on commit ebd6fc4

Please sign in to comment.