-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove N-API implementation, v6.x and v8.x support
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs/node-addon-api#463 Fixes: nodejs/node-addon-api#509 Fixes: nodejs/node-addon-api#640 PR-URL: nodejs/node-addon-api#643 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
- Loading branch information
1 parent
d7f5748
commit 46e93a1
Showing
18 changed files
with
15 additions
and
4,779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,8 @@ | ||
var path = require('path'); | ||
|
||
var versionArray = process.version | ||
.substr(1) | ||
.replace(/-.*$/, '') | ||
.split('.') | ||
.map(function(item) { | ||
return +item; | ||
}); | ||
|
||
// TODO: Check if the main node semantic version is within multiple ranges, | ||
// or detect presence of built-in N-API by some other mechanism TBD. | ||
|
||
// We know which version of Node.js first shipped the incarnation of the API | ||
// available in *this* package. So, if we find that the Node.js version is below | ||
// that, we indicate that the API is missing from Node.js. | ||
var isNodeApiBuiltin = ( | ||
versionArray[0] > 8 || | ||
(versionArray[0] == 8 && versionArray[1] >= 6) || | ||
(versionArray[0] == 6 && versionArray[1] >= 15) || | ||
(versionArray[0] == 6 && versionArray[1] >= 14 && versionArray[2] >= 2)); | ||
|
||
// The flag is not needed when the Node version is not 8, nor if the API is | ||
// built-in, because we removed the flag at the same time as creating the final | ||
// incarnation of the built-in API. | ||
var needsFlag = (!isNodeApiBuiltin && versionArray[0] == 8); | ||
|
||
var include = [__dirname]; | ||
var gyp = path.join(__dirname, 'src', 'node_api.gyp'); | ||
|
||
if (isNodeApiBuiltin) { | ||
gyp += ':nothing'; | ||
} else { | ||
gyp += ':node-api'; | ||
include.unshift(path.join(__dirname, 'external-napi')); | ||
} | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
include: include.map(function(item) { | ||
return '"' + item + '"'; | ||
}).join(' '), | ||
gyp: gyp, | ||
isNodeApiBuiltin: isNodeApiBuiltin, | ||
needsFlag: needsFlag | ||
include: `"${__dirname}"`, | ||
gyp: path.join(__dirname, 'nothing.gyp:nothing'), | ||
isNodeApiBuiltin: true, | ||
needsFlag: false | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
'targets': [ | ||
{ | ||
'target_name': 'nothing', | ||
'type': 'static_library', | ||
'sources': [ 'nothing.c' ] | ||
} | ||
] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.