feat(bindings): add prebuildify to node
Co-Authored-By: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
parent
69cf13bc05
commit
072865e450
4 changed files with 106 additions and 88 deletions
|
|
@ -4,6 +4,7 @@ target/
|
|||
|
||||
# Node artifacts
|
||||
build/
|
||||
prebuilds/
|
||||
node_modules/
|
||||
*.tgz
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,6 @@
|
|||
try {
|
||||
module.exports = require("../../build/Release/tree_sitter_PARSER_NAME_binding");
|
||||
} catch (error1) {
|
||||
if (error1.code !== "MODULE_NOT_FOUND") {
|
||||
throw error1;
|
||||
}
|
||||
try {
|
||||
module.exports = require("../../build/Debug/tree_sitter_PARSER_NAME_binding");
|
||||
} catch (error2) {
|
||||
if (error2.code !== "MODULE_NOT_FOUND") {
|
||||
throw error2;
|
||||
}
|
||||
throw error1
|
||||
}
|
||||
}
|
||||
const root = require("path").join(__dirname, "..", "..");
|
||||
|
||||
module.exports = require("node-gyp-build")(root);
|
||||
|
||||
try {
|
||||
module.exports.nodeTypeInfo = require("../../src/node-types.json");
|
||||
|
|
|
|||
|
|
@ -16,14 +16,17 @@
|
|||
"grammar.js",
|
||||
"binding.gyp",
|
||||
"types/dsl.d.ts",
|
||||
"prebuilds/**",
|
||||
"bindings/node/*",
|
||||
"queries/*",
|
||||
"src/**"
|
||||
],
|
||||
"dependencies": {
|
||||
"node-addon-api": "^7.1.0"
|
||||
"node-addon-api": "^7.1.0",
|
||||
"node-gyp-build": "^4.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prebuildify": "^6.0.0",
|
||||
"tree-sitter-cli": "^CLI_VERSION"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
@ -35,6 +38,8 @@
|
|||
}
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node-gyp-build",
|
||||
"prebuildify": "prebuildify --napi --strip",
|
||||
"build": "tree-sitter generate --no-bindings",
|
||||
"build-wasm": "tree-sitter build-wasm",
|
||||
"test": "tree-sitter test",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue