Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!(NODE-3472): convert to Node-API #137

Merged
merged 3 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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