Upgrade to Node-API version 9

This commit is contained in:
Lovell Fuller 2023-09-23 10:53:53 +01:00
parent 6578118f32
commit e618c17bd0
6 changed files with 8 additions and 7 deletions

View File

@ -36,7 +36,7 @@ jobs:
sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs" sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs"
- run: sudo docker exec sharp sh -c "npm install --build-from-source" - run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test" - run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true" - run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --upload=$prebuild_upload\" || true"
linux-arm64-glibc-node-20: linux-arm64-glibc-node-20:
resource_class: arm.medium resource_class: arm.medium
machine: machine:
@ -65,7 +65,7 @@ jobs:
sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache" sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache"
- run: sudo docker exec sharp sh -c "npm install --build-from-source" - run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test" - run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true" - run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --upload=$prebuild_upload\" || true"
linux-arm64-musl-node-20: linux-arm64-musl-node-20:
resource_class: arm.medium resource_class: arm.medium
machine: machine:

View File

@ -39,4 +39,4 @@ jobs:
if: matrix.prebuild && startsWith(github.ref, 'refs/tags/') if: matrix.prebuild && startsWith(github.ref, 'refs/tags/')
env: env:
prebuild_upload: ${{ secrets.GITHUB_TOKEN }} prebuild_upload: ${{ secrets.GITHUB_TOKEN }}
run: npx prebuild --runtime napi --target 7 run: npx prebuild

View File

@ -102,4 +102,4 @@ jobs:
if: matrix.prebuild && startsWith(github.ref, 'refs/tags/') if: matrix.prebuild && startsWith(github.ref, 'refs/tags/')
env: env:
prebuild_upload: ${{ secrets.GITHUB_TOKEN }} prebuild_upload: ${{ secrets.GITHUB_TOKEN }}
run: npx prebuild --runtime napi --target 7 run: npx prebuild

View File

@ -1,4 +1,5 @@
{ {
"runtime": "napi",
"include-regex": "(sharp-.+\\.node|libvips-cpp\\.dll)", "include-regex": "(sharp-.+\\.node|libvips-cpp\\.dll)",
"strip": true "strip": true
} }

View File

@ -70,7 +70,7 @@
}, { }, {
'target_name': 'sharp-<(platform_and_arch)', 'target_name': 'sharp-<(platform_and_arch)',
'defines': [ 'defines': [
'NAPI_VERSION=7', 'NAPI_VERSION=9',
'NODE_ADDON_API_DISABLE_DEPRECATED', 'NODE_ADDON_API_DISABLE_DEPRECATED',
'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' 'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS'
], ],

View File

@ -174,7 +174,7 @@
"win32-x64": "sha512-BwKckinJZ0Fu/EcunqiLPwOLEBWp4xf8GV7nvmVuKKz5f6B+GxoA2k9aa2wueqv4r4RJVgV/aWXZWFKOIjre/Q==" "win32-x64": "sha512-BwKckinJZ0Fu/EcunqiLPwOLEBWp4xf8GV7nvmVuKKz5f6B+GxoA2k9aa2wueqv4r4RJVgV/aWXZWFKOIjre/Q=="
}, },
"runtime": "napi", "runtime": "napi",
"target": 7 "target": 9
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
@ -184,7 +184,7 @@
}, },
"binary": { "binary": {
"napi_versions": [ "napi_versions": [
7 9
] ]
}, },
"semistandard": { "semistandard": {