-
Notifications
You must be signed in to change notification settings - Fork 4
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
Build for napi runtime when node-addon-api and napi_versions found #18
Conversation
450a6b7
to
5fdda84
Compare
I've updated this PR so the I tested this with release candidate v3.0.0-rc1 of the farmhash module and it generated the expected prebuilds when using Node 10 and with
|
@lovell Why is it a requirement to have |
It's optional but highly recommended; happy to remove that check if I think of node-addon-api as the N-API equivalent of nan, without which maintaining native modules would be a(n even greater) burden. |
There are quite a few modules that don't use |
5fdda84
to
1fbb09e
Compare
This change corrects the internals to work with target versions rather than ABI versions as this is what prebuild expects with its -t flag.
napi-macros looks useful, I hadn't seen that before, thanks for the tip. I've updated this PR to remove the dependency check and rely on the presence of napi_versions only for now. |
Before this PR, we didn't support N-API at all, correct? Meaning we can safely release this as semver-minor. |
That's correct, this change can be part of a minor increment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two nitpicks, LGTM otherwise.
Co-Authored-By: Vincent Weevers <mail@vincentweevers.nl>
Co-Authored-By: Vincent Weevers <mail@vincentweevers.nl>
3.1.0 |
Once a native module has made the leap to using N-API via node-addon-api, attempting to build for node and electron ABI runtimes will fail.
This is, in part, due to a lack of a one-to-one mapping between node/electron ABIs and napi ABIs e.g. node ABI 57 maps to napi ABI 1, 2, 3 and 4.
This change is fully backwards compatible. Existing modules that do not both depend on
node-addon-api
and specify napi_versions carry on as before.