Add version to shared library filename to help avoid collision

This commit is contained in:
Lovell Fuller
2025-12-19 23:55:21 +00:00
parent aaeded2b67
commit 1a2c1c8833
17 changed files with 36 additions and 20 deletions

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-darwin-arm64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-darwin-x64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -44,9 +44,10 @@ cpSync(releaseDir, libDir, {
}
});
// Generate README
const { name, description } = require(`./${platform}/package.json`);
// Generate README and index.cjs
const { version, name, description } = require(`./${platform}/package.json`);
writeFileSync(join(destDir, 'README.md'), `# \`${name}\`\n\n${description}.\n${licensing}`);
writeFileSync(join(destDir, 'index.cjs'), `module.exports = require('./lib/sharp-${platform}-${version}.node');`);
// Copy Apache-2.0 LICENSE
copyFileSync(join(__dirname, '..', 'LICENSE'), join(destDir, 'LICENSE'));

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-arm": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-arm.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-arm64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-ppc64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-riscv64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-s390x.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linux-x64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linux-x64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linuxmusl-arm64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -18,6 +18,7 @@
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.1"
},
"files": [
"index.cjs",
"lib"
],
"publishConfig": {
@@ -25,7 +26,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-linuxmusl-x64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json"
},
"engines": {

View File

@@ -23,7 +23,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-wasm32.node.js",
"./sharp.node": "./index.cjs",
"./package": "./package.json",
"./versions": "./versions.json"
},

View File

@@ -15,6 +15,7 @@
},
"preferUnplugged": true,
"files": [
"index.cjs",
"lib",
"versions.json"
],
@@ -23,7 +24,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-win32-arm64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json",
"./versions": "./versions.json"
},

View File

@@ -15,6 +15,7 @@
},
"preferUnplugged": true,
"files": [
"index.cjs",
"lib",
"versions.json"
],
@@ -23,7 +24,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-win32-ia32.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json",
"./versions": "./versions.json"
},

View File

@@ -15,6 +15,7 @@
},
"preferUnplugged": true,
"files": [
"index.cjs",
"lib",
"versions.json"
],
@@ -23,7 +24,7 @@
},
"type": "commonjs",
"exports": {
"./sharp.node": "./lib/sharp-win32-x64.node",
"./sharp.node": "./index.cjs",
"./package": "./package.json",
"./versions": "./versions.json"
},