Skip to content

Commit

Permalink
Revert "build(deps): bump node-addon-api from 8.1.0 to 8.2.0 (#280)" (#…
Browse files Browse the repository at this point in the history
…281)

This reverts commit 42334b9.
  • Loading branch information
mmomtchev authored Oct 3, 2024
1 parent 42334b9 commit 86ca17c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-14, windows-2019]
node-version: [18.x, 20.x, 22.x]
node-version: [16.x, 18.x, 20.x, 22.x]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- node-version: 16.x
platform: ubuntu-22.04
- node-version: 16.x
platform: ubuntu-24.04
- node-version: 16.x
python-version: 3.12
- platform: ubuntu-24.04
python-version: 3.8

Expand All @@ -45,7 +51,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-20.04, macos-12, macos-14, windows-2019]
node-version: [18.x, 20.x, 22.x]
node-version: [16.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- macos-12
- macos-13
- macos-14
node-version: [18.x, 20.x, 22.x]
node-version: [16.x, 18.x, 20.x, 22.x]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- platform: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- macos-12
- macos-13
- macos-14
node-version: [18.x, 20.x, 22.x]
node-version: [16.x, 18.x, 20.x, 22.x]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- platform: ubuntu-24.04
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [1.6.0]
### [1.6.0]
- macOS Apple Silicon prebuilt binaries
- Tested with Node.js 22
- Drop Node.js 16 support
- Drop macOS 11 support
- Fix (and test) all compression modules on all platforms
- Recompiling the built-in Python now requires that `conan>=2.0.0` is installed
Expand Down
7 changes: 5 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
['OS == "win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1
'ExceptionHandling': 1,
'AdditionalOptions': [' /std:c++14' ]
},
},
'conditions': [
Expand Down Expand Up @@ -94,9 +95,11 @@
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7'
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CPLUSPLUSFLAGS': [ '-std=c++14' ]
},
'cflags': [ '-fvisibility=hidden '],
'cflags_cc': [ '-std=c++14' ],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
}]
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"typescript": "^5.3.3"
},
"engines": {
"node": ">= 18.0.0"
"node": ">= 16.0.0"
},
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
Expand Down
10 changes: 9 additions & 1 deletion src/objstore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ Value PyObjectWrap::New(Napi::Env env, PyStrongRef &&obj) {
}
VERBOSE_PYOBJ(OBJS, *obj, "Objstore insert");

js = context->pyObj->New({External<PyObject>::New(env, obj.gift())});
// This is a very ugly workaround for https://github.com/nodejs/node-addon-api/issues/1239
napi_value ext = External<PyObject>::New(env, obj.gift());
napi_value jsval;
napi_status r = napi_new_instance(env, context->pyObj->Value(), 1, &ext, &jsval);
if (r != napi_ok) {
napi_throw(env, Napi::Value());
return Napi::Value();
}
js = Napi::Value(env, jsval).ToObject();

auto result = ObjectWrap::Unwrap(js);
context->object_store.insert({*result->self, result});
Expand Down

0 comments on commit 86ca17c

Please sign in to comment.