+5
-7
@@ -8,5 +8,3 @@ /*! | ||
| const { createHash } = require('node:crypto'); | ||
| const semverCoerce = require('semver/functions/coerce'); | ||
| const semverGreaterThanOrEqualTo = require('semver/functions/gte'); | ||
| const semverSatisfies = require('semver/functions/satisfies'); | ||
| const semver = require('semver'); | ||
| const detectLibc = require('detect-libc'); | ||
@@ -17,3 +15,3 @@ const pkg = require('../package.json'); | ||
| const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || pkg.config.libvips; | ||
| const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version; | ||
| const minimumLibvipsVersion = semver.coerce(minimumLibvipsVersionLabelled).version; | ||
@@ -87,3 +85,3 @@ const prebuiltPlatforms = [ | ||
| if (process.release?.name === 'node' && process.versions) { | ||
| if (!semverSatisfies(process.versions.node, pkg.engines.node)) { | ||
| if (!semver.satisfies(process.versions.node, pkg.engines.node)) { | ||
| return { found: process.versions.node, expected: pkg.engines.node }; | ||
@@ -114,3 +112,3 @@ } | ||
| const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`); | ||
| const npmVersion = semverCoerce(pkg.optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { | ||
| const npmVersion = semver.coerce(pkg.optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { | ||
| includePrerelease: true | ||
@@ -200,3 +198,3 @@ }).version; | ||
| /* node:coverage ignore next */ | ||
| return !!globalVipsVersion && semverGreaterThanOrEqualTo(globalVipsVersion, minimumLibvipsVersion); | ||
| return !!globalVipsVersion && semver.gte(globalVipsVersion, minimumLibvipsVersion); | ||
| }; | ||
@@ -203,0 +201,0 @@ |
+5
-7
@@ -8,5 +8,3 @@ /*! | ||
| import { createHash } from 'node:crypto'; | ||
| import semverCoerce from 'semver/functions/coerce'; | ||
| import semverGreaterThanOrEqualTo from 'semver/functions/gte'; | ||
| import semverSatisfies from 'semver/functions/satisfies'; | ||
| import semver from 'semver'; | ||
| import detectLibc from 'detect-libc'; | ||
@@ -17,3 +15,3 @@ import pkg from '../package.json' with { type: 'json' }; | ||
| const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || pkg.config.libvips; | ||
| const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version; | ||
| const minimumLibvipsVersion = semver.coerce(minimumLibvipsVersionLabelled).version; | ||
@@ -87,3 +85,3 @@ const prebuiltPlatforms = [ | ||
| if (process.release?.name === 'node' && process.versions) { | ||
| if (!semverSatisfies(process.versions.node, pkg.engines.node)) { | ||
| if (!semver.satisfies(process.versions.node, pkg.engines.node)) { | ||
| return { found: process.versions.node, expected: pkg.engines.node }; | ||
@@ -114,3 +112,3 @@ } | ||
| const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`); | ||
| const npmVersion = semverCoerce(pkg.optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { | ||
| const npmVersion = semver.coerce(pkg.optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { | ||
| includePrerelease: true | ||
@@ -200,3 +198,3 @@ }).version; | ||
| /* node:coverage ignore next */ | ||
| return !!globalVipsVersion && semverGreaterThanOrEqualTo(globalVipsVersion, minimumLibvipsVersion); | ||
| return !!globalVipsVersion && semver.gte(globalVipsVersion, minimumLibvipsVersion); | ||
| }; | ||
@@ -203,0 +201,0 @@ |
+7
-3
@@ -10,4 +10,8 @@ /*! | ||
| const { version } = require('../package.json'); | ||
| const { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = require("./libvips.cjs"); | ||
| const libvips = require("./libvips.cjs"); | ||
| const pkg = require('../package.json'); | ||
| const { version } = pkg; | ||
| const { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = libvips; | ||
| const runtimePlatform = runtimePlatformArch(); | ||
@@ -100,3 +104,3 @@ | ||
| errors.forEach((err) => { | ||
| if (err.code !== "MODULE_NOT_FOUND") { | ||
| if (!err.code.endsWith("MODULE_NOT_FOUND")) { | ||
| help.push(`${err.code}: ${err.message}`); | ||
@@ -103,0 +107,0 @@ } |
+28
-22
@@ -8,6 +8,12 @@ /*! | ||
| import { createRequire } from "node:module" | ||
| import { familySync, versionSync } from "detect-libc"; | ||
| import { version } from '../package.json'; | ||
| import { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } from "./libvips.mjs"; | ||
| import libvips from "./libvips.mjs"; | ||
| import pkg from '../package.json' with { type: 'json' }; | ||
| const require = createRequire(import.meta.url); | ||
| const { version } = pkg; | ||
| const { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = libvips; | ||
| const runtimePlatform = runtimePlatformArch(); | ||
@@ -20,3 +26,3 @@ | ||
| try { | ||
| sharp = await import(`../src/build/Release/sharp-${runtimePlatform}-${version}.node`); | ||
| sharp = require(`../src/build/Release/sharp-${runtimePlatform}-${version}.node`); | ||
| } catch (err) { | ||
@@ -27,3 +33,3 @@ errors.push(err); | ||
| try { | ||
| sharp = await import(`../src/build/Release/sharp-wasm32-${version}.node`); | ||
| sharp = require(`../src/build/Release/sharp-wasm32-${version}.node`); | ||
| } catch (err) { | ||
@@ -37,49 +43,49 @@ errors.push(err); | ||
| case "darwin-arm64": | ||
| sharp = await import("@img/sharp-darwin-arm64/sharp.node"); | ||
| sharp = require("@img/sharp-darwin-arm64/sharp.node"); | ||
| break; | ||
| case "darwin-x64": | ||
| sharp = await import("@img/sharp-darwin-x64/sharp.node"); | ||
| sharp = require("@img/sharp-darwin-x64/sharp.node"); | ||
| break; | ||
| case "linux-arm": | ||
| sharp = await import("@img/sharp-linux-arm/sharp.node"); | ||
| sharp = require("@img/sharp-linux-arm/sharp.node"); | ||
| break; | ||
| case "linux-arm64": | ||
| sharp = await import("@img/sharp-linux-arm64/sharp.node"); | ||
| sharp = require("@img/sharp-linux-arm64/sharp.node"); | ||
| break; | ||
| case "linux-ppc64": | ||
| sharp = await import("@img/sharp-linux-ppc64/sharp.node"); | ||
| sharp = require("@img/sharp-linux-ppc64/sharp.node"); | ||
| break; | ||
| case "linux-riscv64": | ||
| sharp = await import("@img/sharp-linux-riscv64/sharp.node"); | ||
| sharp = require("@img/sharp-linux-riscv64/sharp.node"); | ||
| break; | ||
| case "linux-s390x": | ||
| sharp = await import("@img/sharp-linux-s390x/sharp.node"); | ||
| sharp = require("@img/sharp-linux-s390x/sharp.node"); | ||
| break; | ||
| case "linux-x64": | ||
| sharp = await import("@img/sharp-linux-x64/sharp.node"); | ||
| sharp = require("@img/sharp-linux-x64/sharp.node"); | ||
| break; | ||
| case "linuxmusl-arm64": | ||
| sharp = await import("@img/sharp-linuxmusl-arm64/sharp.node"); | ||
| sharp = require("@img/sharp-linuxmusl-arm64/sharp.node"); | ||
| break; | ||
| case "linuxmusl-x64": | ||
| sharp = await import("@img/sharp-linuxmusl-x64/sharp.node"); | ||
| sharp = require("@img/sharp-linuxmusl-x64/sharp.node"); | ||
| break; | ||
| case "win32-arm64": | ||
| sharp = await import("@img/sharp-win32-arm64/sharp.node"); | ||
| sharp = require("@img/sharp-win32-arm64/sharp.node"); | ||
| break; | ||
| case "win32-ia32": | ||
| sharp = await import("@img/sharp-win32-ia32/sharp.node"); | ||
| sharp = require("@img/sharp-win32-ia32/sharp.node"); | ||
| break; | ||
| case "win32-x64": | ||
| sharp = await import("@img/sharp-win32-x64/sharp.node"); | ||
| sharp = require("@img/sharp-win32-x64/sharp.node"); | ||
| break; | ||
| case "freebsd-arm64": | ||
| case "freebsd-x64": | ||
| sharp = await import("@img/sharp-freebsd-wasm32/sharp.node"); | ||
| sharp = require("@img/sharp-freebsd-wasm32/sharp.node"); | ||
| break; | ||
| case "linux-wasm32": | ||
| sharp = await import("@img/sharp-webcontainers-wasm32/sharp.node"); | ||
| sharp = require("@img/sharp-webcontainers-wasm32/sharp.node"); | ||
| break; | ||
| default: | ||
| sharp = await import("@img/sharp-wasm32/sharp.node"); | ||
| sharp = require("@img/sharp-wasm32/sharp.node"); | ||
| break; | ||
@@ -103,3 +109,3 @@ } | ||
| errors.forEach((err) => { | ||
| if (err.code !== "MODULE_NOT_FOUND") { | ||
| if (!err.code.endsWith("MODULE_NOT_FOUND")) { | ||
| help.push(`${err.code}: ${err.message}`); | ||
@@ -135,3 +141,3 @@ } | ||
| try { | ||
| const { config } = await import(`@img/sharp-libvips-${runtimePlatform}/package`); | ||
| const { config } = require(`@img/sharp-libvips-${runtimePlatform}/package`); | ||
| const libcFound = `${familySync()} ${versionSync()}`; | ||
@@ -138,0 +144,0 @@ const libcRequires = `${config.musl ? "musl" : "glibc"} ${config.musl || config.glibc}`; |
+3
-3
@@ -7,10 +7,11 @@ /*! | ||
| const events = require('node:events'); | ||
| const { availableParallelism } = require("node:os"); | ||
| const detectLibc = require('detect-libc'); | ||
| const is = require('./is.cjs'); | ||
| const { runtimePlatformArch } = require('./libvips.cjs'); | ||
| const libvips = require('./libvips.cjs'); | ||
| const sharp = require('./sharp.cjs'); | ||
| const pkg = require("../package.json"); | ||
| const runtimePlatform = runtimePlatformArch(); | ||
| const runtimePlatform = libvips.runtimePlatformArch(); | ||
| const libvipsVersion = sharp.libvipsVersion(); | ||
@@ -161,3 +162,2 @@ | ||
| // Reduce default concurrency when musl thread over-subscription detected | ||
| const { availableParallelism } = require('node:os') | ||
| sharp.concurrency(availableParallelism()); | ||
@@ -164,0 +164,0 @@ } |
+8
-6
@@ -7,10 +7,13 @@ /*! | ||
| import events from 'node:events'; | ||
| import { createRequire } from "node:module"; | ||
| import { availableParallelism } from "node:os"; | ||
| import detectLibc from 'detect-libc'; | ||
| import is from './is.mjs'; | ||
| import { runtimePlatformArch } from './libvips.mjs'; | ||
| import libvips from './libvips.mjs'; | ||
| import sharp from './sharp.mjs'; | ||
| import pkg from "../package.json" with { type: "json" }; | ||
| const runtimePlatform = runtimePlatformArch(); | ||
| const require = createRequire(import.meta.url); | ||
| const runtimePlatform = libvips.runtimePlatformArch(); | ||
| const libvipsVersion = sharp.libvipsVersion(); | ||
@@ -66,6 +69,6 @@ | ||
| try { | ||
| versions = await import(`@img/sharp-${runtimePlatform}/versions`); | ||
| versions = require(`@img/sharp-${runtimePlatform}/versions`); | ||
| } catch (_) { | ||
| try { | ||
| versions = await import(`@img/sharp-libvips-${runtimePlatform}/versions`); | ||
| versions = require(`@img/sharp-libvips-${runtimePlatform}/versions`); | ||
| } catch (_) {} | ||
@@ -75,3 +78,3 @@ } | ||
| try { | ||
| versions = await import('@img/sharp-wasm32/versions'); | ||
| versions = require('@img/sharp-wasm32/versions'); | ||
| } catch (_) {} | ||
@@ -163,3 +166,2 @@ } | ||
| // Reduce default concurrency when musl thread over-subscription detected | ||
| const { availableParallelism } = await import('node:os') | ||
| sharp.concurrency(availableParallelism()); | ||
@@ -166,0 +168,0 @@ } |
+17
-17
| { | ||
| "name": "sharp", | ||
| "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images", | ||
| "version": "0.35.0-rc.4", | ||
| "version": "0.35.0-rc.5", | ||
| "author": "Lovell Fuller <npm@lovell.info>", | ||
@@ -158,5 +158,5 @@ "homepage": "https://sharp.pixelplumbing.com", | ||
| "optionalDependencies": { | ||
| "@img/sharp-darwin-arm64": "0.35.0-rc.4", | ||
| "@img/sharp-darwin-x64": "0.35.0-rc.4", | ||
| "@img/sharp-freebsd-wasm32": "0.35.0-rc.4", | ||
| "@img/sharp-darwin-arm64": "0.35.0-rc.5", | ||
| "@img/sharp-darwin-x64": "0.35.0-rc.5", | ||
| "@img/sharp-freebsd-wasm32": "0.35.0-rc.5", | ||
| "@img/sharp-libvips-darwin-arm64": "1.3.0-rc.5", | ||
@@ -172,14 +172,14 @@ "@img/sharp-libvips-darwin-x64": "1.3.0-rc.5", | ||
| "@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.5", | ||
| "@img/sharp-linux-arm": "0.35.0-rc.4", | ||
| "@img/sharp-linux-arm64": "0.35.0-rc.4", | ||
| "@img/sharp-linux-ppc64": "0.35.0-rc.4", | ||
| "@img/sharp-linux-riscv64": "0.35.0-rc.4", | ||
| "@img/sharp-linux-s390x": "0.35.0-rc.4", | ||
| "@img/sharp-linux-x64": "0.35.0-rc.4", | ||
| "@img/sharp-linuxmusl-arm64": "0.35.0-rc.4", | ||
| "@img/sharp-linuxmusl-x64": "0.35.0-rc.4", | ||
| "@img/sharp-webcontainers-wasm32": "0.35.0-rc.4", | ||
| "@img/sharp-win32-arm64": "0.35.0-rc.4", | ||
| "@img/sharp-win32-ia32": "0.35.0-rc.4", | ||
| "@img/sharp-win32-x64": "0.35.0-rc.4" | ||
| "@img/sharp-linux-arm": "0.35.0-rc.5", | ||
| "@img/sharp-linux-arm64": "0.35.0-rc.5", | ||
| "@img/sharp-linux-ppc64": "0.35.0-rc.5", | ||
| "@img/sharp-linux-riscv64": "0.35.0-rc.5", | ||
| "@img/sharp-linux-s390x": "0.35.0-rc.5", | ||
| "@img/sharp-linux-x64": "0.35.0-rc.5", | ||
| "@img/sharp-linuxmusl-arm64": "0.35.0-rc.5", | ||
| "@img/sharp-linuxmusl-x64": "0.35.0-rc.5", | ||
| "@img/sharp-webcontainers-wasm32": "0.35.0-rc.5", | ||
| "@img/sharp-win32-arm64": "0.35.0-rc.5", | ||
| "@img/sharp-win32-ia32": "0.35.0-rc.5", | ||
| "@img/sharp-win32-x64": "0.35.0-rc.5" | ||
| }, | ||
@@ -201,3 +201,3 @@ "devDependencies": { | ||
| "node-addon-api": "^8.7.0", | ||
| "node-gyp": "^12.2.0", | ||
| "node-gyp": "^12.3.0", | ||
| "tar-fs": "^3.1.2", | ||
@@ -204,0 +204,0 @@ "tsd": "^0.33.0" |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
13661
0.03%1
-50%768367
-0.02%