Skip to content

Commit

Permalink
feat(NODE-3472)!: convert to Node-API (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax authored and nbbeeken committed Oct 6, 2021
1 parent d16f657 commit f9481a4
Show file tree
Hide file tree
Showing 14 changed files with 520 additions and 590 deletions.
3 changes: 1 addition & 2 deletions .evergreen/run-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ run_prebuild() {
else
echo "Github token detected. Running prebuild."
npm run prebuild -- -u $NODE_GITHUB_TOKEN
npm run prebuild-legacy -- -u $NODE_GITHUB_TOKEN
echo "Prebuild's successfully submitted"
fi
}
Expand Down Expand Up @@ -49,4 +48,4 @@ else
npm run prebuild
echo "Local prebuild successful."
ls ./prebuilds
fi
fi
17 changes: 15 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@
{
'target_name': 'kerberos',
'type': 'loadable_module',
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
'include_dirs': [ "<!(node -p \"require('node-addon-api').include_dir\")" ],
'sources': [
'src/kerberos.cc'
],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.12'
},
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'conditions': [
['OS=="mac"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
}
}],
['OS=="mac" or OS=="linux"', {
'sources': [
'src/unix/base64.cc',
Expand Down Expand Up @@ -49,4 +62,4 @@
]
}
]
}
}
8 changes: 7 additions & 1 deletion package-lock.json

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

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"bindings": "^1.5.0",
"nan": "^2.14.1",
"node-addon-api": "^4.1.0",
"prebuild-install": "6.1.2"
},
"devDependencies": {
Expand All @@ -41,18 +41,25 @@
"standard-version": "^9.3.1"
},
"scripts": {
"install": "prebuild-install || node-gyp rebuild",
"install": "prebuild-install --runtime napi || node-gyp rebuild",
"format-cxx": "git-clang-format",
"format-js": "prettier --print-width 100 --tab-width 2 --single-quote --write index.js 'test/**/*.js' 'lib/**/*.js'",
"lint": "eslint index.js lib test",
"precommit": "check-clang-format",
"test": "mocha ./test",
"docs": "jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",
"rebuild": "prebuild --compile",
"prebuild": "prebuild --strip --verbose --all",
"prebuild-legacy": "prebuild --strip --verbose --runtime node --target 4.0.0",
"prebuild": "prebuild --runtime napi --strip --verbose --all",
"release": "standard-version -i HISTORY.md"
},
"engines": {
"node": ">=12.9.0"
},
"binary": {
"napi_versions": [
4
]
},
"license": "Apache-2.0",
"readmeFilename": "README.md"
}
Loading

0 comments on commit f9481a4

Please sign in to comment.