Skip to content

Commit

Permalink
Upgrade emnapi
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Feb 14, 2023
1 parent 6a3478b commit 88fd747
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions lib/sqlite3-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ const binding_path = binary.find(path.resolve(path.join(__dirname,'../package.js
});
let binding = require(binding_path);
if (typeof binding === 'function') {
const emnapiContext = require('@tybys/emnapi-runtime').createContext();
const emnapiInitOptions = {
context: emnapiContext
context: require('@emnapi/runtime').getDefaultContext()
};
try {
// optional dependency
// support async_hooks on Node.js
emnapiInitOptions.nodeBinding = require('@tybys/emnapi-node-binding');
emnapiInitOptions.nodeBinding = require('@emnapi/node-binding');
} catch (_) {
// ignore
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
},
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.0",
"@tybys/emnapi-runtime": "^0.28.1",
"@emnapi/runtime": "^0.31.0",
"node-addon-api": "^4.2.0",
"tar": "^6.1.11"
},
"devDependencies": {
"@tybys/emnapi": "^0.28.1",
"emnapi": "^0.31.0",
"eslint": "6.8.0",
"mocha": "7.2.0",
"node-pre-gyp-github": "1.4.4"
Expand All @@ -68,7 +68,7 @@
}
},
"optionalDependencies": {
"@tybys/emnapi-node-binding": "^0.28.1",
"@emnapi/node-binding": "^0.31.0",
"node-gyp": "8.x"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions wasm/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'-std=gnu++17'
],
'ldflags': [
'--js-library=<!(node -p "require(\'@tybys/emnapi\').js_library")',
'--js-library=<!(node -p "require(\'emnapi\').js_library")',
"-sALLOW_MEMORY_GROWTH=1",
"-sEXPORTED_FUNCTIONS=['_malloc','_free']",
'-sNODEJS_CATCH_EXIT=0',
Expand All @@ -38,10 +38,10 @@
'__STDC_FORMAT_MACROS',
],
'include_dirs': [
'<!(node -p "require(\'@tybys/emnapi\').include")',
'<!(node -p "require(\'emnapi\').include")',
],
'sources': [
'<!@(node -p "require(\'@tybys/emnapi\').sources.map(x => JSON.stringify(path.relative(process.cwd(), x))).join(\' \')")'
'<!@(node -p "require(\'emnapi\').sources.map(x => JSON.stringify(path.relative(process.cwd(), x))).join(\' \')")'
],

'default_configuration': 'Release',
Expand Down

0 comments on commit 88fd747

Please sign in to comment.