-
Notifications
You must be signed in to change notification settings - Fork 599
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
make node-addon-api examples context-sensistive #139
make node-addon-api examples context-sensistive #139
Conversation
This removes global static references from the examples, so that they might work with worker threads.
Looks like Travis doesn't yet have a version of Node.js 12.x that ships with N-API 6. |
Maybe limit version like this node-addon-examples/thread_safe_function_round_trip/napi/package.json Lines 10 to 13 in b024ee9
Also github action looks like not using latest Node.js 12 yet |
I give it more test, should const semver = require('semver')
const assert = require('assert').strict
const rule = '~10 >=10.20 || >=12.17 '
assert.equal(false, semver.satisfies('10.19.0', rule))
assert.ok(semver.satisfies('10.20.0', rule))
assert.equal(false, semver.satisfies('12.16.0', rule))
assert.ok(semver.satisfies('12.19.0', rule)) |
c3cbab0
to
74158c7
Compare
74158c7
to
f0d91a0
Compare
@nodejs/n-api it looks like it's not Travis that has old versions of Node.js but GitHub actions. Thus, with the "engines" change proposed by @gengjiawen the examples are actually only run on Travis so we have some testing there. |
It looks like github by default doesn't grab the latest available version of Node.js if one specifies "10.x" or "12.x", but will grab the latest version if one specifies it exactly (I used "10.21.0" and "12.18.0"). |
So, now the examples are run on both Travis and GitHub actions. |
This removes global static references from the examples, so that they
might work with worker threads.