Comparing version 0.33.0-alpha.4 to 0.33.0-alpha.6
@@ -6,3 +6,3 @@ // Copyright 2013 Lovell Fuller and others. | ||
const { useGlobalLibvips, globalLibvipsVersion, log, gypRebuild } = require('../lib/libvips'); | ||
const { useGlobalLibvips, globalLibvipsVersion, log, spawnRebuild } = require('../lib/libvips'); | ||
@@ -13,8 +13,17 @@ const buildFromSource = (msg) => { | ||
try { | ||
require('node-gyp'); | ||
require('node-addon-api'); | ||
log('Found node-addon-api'); | ||
} catch (err) { | ||
log('You might need to install node-gyp'); | ||
log('Please add node-addon-api to your dependencies'); | ||
return; | ||
} | ||
try { | ||
const gyp = require('node-gyp'); | ||
log(`Found node-gyp version ${gyp().version}`); | ||
} catch (err) { | ||
log('Please add node-gyp to your dependencies'); | ||
return; | ||
} | ||
log('See https://sharp.pixelplumbing.com/install#building-from-source'); | ||
const status = gypRebuild(); | ||
const status = spawnRebuild(); | ||
if (status !== 0) { | ||
@@ -21,0 +30,0 @@ process.exit(status); |
@@ -83,4 +83,4 @@ // Copyright 2013 Lovell Fuller and others. | ||
/* istanbul ignore next */ | ||
const gypRebuild = () => | ||
spawnSync('node-gyp rebuild', { | ||
const spawnRebuild = () => | ||
spawnSync('node-gyp rebuild --directory=src', { | ||
...spawnSyncOptions, | ||
@@ -150,3 +150,3 @@ stdio: 'inherit' | ||
log, | ||
gypRebuild, | ||
spawnRebuild, | ||
globalLibvipsVersion, | ||
@@ -153,0 +153,0 @@ pkgConfigPath, |
@@ -12,2 +12,3 @@ // Copyright 2013 Lovell Fuller and others. | ||
const runtimePlatform = runtimePlatformArch(); | ||
const [isLinux, isMacOs, isWindows] = ['linux', 'darwin', 'win32'].map(os => runtimePlatform.startsWith(os)); | ||
@@ -17,3 +18,3 @@ /* istanbul ignore next */ | ||
// Check for local build | ||
module.exports = require(`../build/Release/sharp-${runtimePlatform}.node`); | ||
module.exports = require(`../src/build/Release/sharp-${runtimePlatform}.node`); | ||
} catch (errLocal) { | ||
@@ -34,7 +35,11 @@ try { | ||
if (prebuiltPlatforms.includes(runtimePlatform)) { | ||
help.push(`- Add an explicit dependency for the runtime platform: "npm install --force @sharpen/sharp-${runtimePlatform}"`); | ||
help.push('- Add explicit dependencies for the runtime platform:'); | ||
help.push(` npm install --force @sharpen/sharp-${runtimePlatform}`); | ||
if (!isWindows) { | ||
help.push(` npm install --force @sharpen/sharp-libvips-${runtimePlatform}`); | ||
} | ||
} else { | ||
help.push(`- The ${runtimePlatform} platform requires manual installation of libvips >= ${minimumLibvipsVersion}`); | ||
} | ||
if (runtimePlatform.startsWith('linux') && /symbol not found/i.test(errPackage)) { | ||
if (isLinux && /symbol not found/i.test(errPackage)) { | ||
try { | ||
@@ -47,4 +52,5 @@ const { engines } = require(`@sharpen/sharp-libvips-${runtimePlatform}/package`); | ||
} | ||
if (runtimePlatform.startsWith('darwin') && /Incompatible library version/.test(errLocal.message)) { | ||
help.push('- Update Homebrew: "brew update && brew upgrade vips"'); | ||
if (isMacOs && /Incompatible library version/.test(errLocal.message)) { | ||
help.push('- Update Homebrew:'); | ||
help.push(' brew update && brew upgrade vips'); | ||
} | ||
@@ -55,5 +61,5 @@ if (errPackage.code === 'ERR_DLOPEN_DISABLED') { | ||
// Link to installation docs | ||
if (runtimePlatform.startsWith('linux') && /Module did not self-register/.test(errLocal.message + errPackage.message)) { | ||
if (isLinux && /Module did not self-register/.test(errLocal.message + errPackage.message)) { | ||
help.push('- Using worker threads on Linux? See https://sharp.pixelplumbing.com/install#worker-threads'); | ||
} else if (runtimePlatform.startsWith('win32') && /The specified procedure could not be found/.test(errPackage.message)) { | ||
} else if (isWindows && /The specified procedure could not be found/.test(errPackage.message)) { | ||
help.push('- Using the canvas package on Windows? See https://sharp.pixelplumbing.com/install#canvas-and-windows'); | ||
@@ -60,0 +66,0 @@ } else { |
{ | ||
"name": "sharp", | ||
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images", | ||
"version": "0.33.0-alpha.4", | ||
"version": "0.33.0-alpha.6", | ||
"author": "Lovell Fuller <npm@lovell.info>", | ||
@@ -93,3 +93,3 @@ "homepage": "https://github.com/lovell/sharp", | ||
"install": "node install/check", | ||
"clean": "rm -rf build/ .nyc_output/ coverage/ test/fixtures/output.*", | ||
"clean": "rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*", | ||
"test": "npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types", | ||
@@ -111,6 +111,5 @@ "test-lint": "semistandard && cpplint", | ||
"files": [ | ||
"binding.gyp", | ||
"install", | ||
"lib", | ||
"src" | ||
"src/*.{cc,h,gyp}" | ||
], | ||
@@ -142,8 +141,7 @@ "repository": { | ||
"detect-libc": "^2.0.2", | ||
"node-addon-api": "^7.0.0", | ||
"semver": "^7.5.4" | ||
}, | ||
"optionalDependencies": { | ||
"@sharpen/sharp-darwin-arm64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-darwin-x64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-darwin-arm64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-darwin-x64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-libvips-darwin-arm64": "0.0.1-alpha.2", | ||
@@ -156,9 +154,9 @@ "@sharpen/sharp-libvips-darwin-x64": "0.0.1-alpha.2", | ||
"@sharpen/sharp-libvips-linuxmusl-x64": "0.0.1-alpha.2", | ||
"@sharpen/sharp-linux-arm": "0.0.1-alpha.4", | ||
"@sharpen/sharp-linux-arm64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-linux-x64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-linuxmusl-arm64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-linuxmusl-x64": "0.0.1-alpha.4", | ||
"@sharpen/sharp-win32-ia32": "0.0.1-alpha.4", | ||
"@sharpen/sharp-win32-x64": "0.0.1-alpha.4" | ||
"@sharpen/sharp-linux-arm": "0.0.1-alpha.6", | ||
"@sharpen/sharp-linux-arm64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-linux-x64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-linuxmusl-arm64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-linuxmusl-x64": "0.0.1-alpha.6", | ||
"@sharpen/sharp-win32-ia32": "0.0.1-alpha.6", | ||
"@sharpen/sharp-win32-x64": "0.0.1-alpha.6" | ||
}, | ||
@@ -178,2 +176,3 @@ "devDependencies": { | ||
"mocha": "^10.2.0", | ||
"node-addon-api": "^7.0.0", | ||
"nyc": "^15.1.0", | ||
@@ -180,0 +179,0 @@ "prebuild": "^12.1.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
478789
19
6566
18
+ Added@sharpen/sharp-darwin-arm64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-darwin-x64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-linux-arm@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-linux-arm64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-linux-x64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-linuxmusl-arm64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-linuxmusl-x64@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-win32-ia32@0.0.1-alpha.6(transitive)
+ Added@sharpen/sharp-win32-x64@0.0.1-alpha.6(transitive)
- Removednode-addon-api@^7.0.0
- Removed@sharpen/sharp-darwin-arm64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-darwin-x64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-linux-arm@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-linux-arm64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-linux-x64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-linuxmusl-arm64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-linuxmusl-x64@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-win32-ia32@0.0.1-alpha.4(transitive)
- Removed@sharpen/sharp-win32-x64@0.0.1-alpha.4(transitive)
- Removednode-addon-api@7.1.1(transitive)