Skip to content

Commit

Permalink
Merge pull request #3 from m-novikov/fix-windows-build
Browse files Browse the repository at this point in the history
Use lowercase sql in bindings. Closes: #1
  • Loading branch information
m-novikov authored Sep 23, 2021
2 parents b47bb8c + f6d7384 commit 513d538
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/src/** linguist-vendored
/examples/* linguist-vendored
*.js eof=lf
* text=auto eof=lf
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
os: [ubuntu-latest, windows-latest]
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"arrowParens": "avoid",
"trailingComma": "all"
"trailingComma": "all",
"endOfLine": "auto"
}
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"targets": [
{
"target_name": "tree_sitter_SQL_binding",
"target_name": "tree_sitter_sql_binding",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"src"
Expand Down
8 changes: 4 additions & 4 deletions bindings/node/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace v8;

extern "C" TSLanguage * tree_sitter_SQL();
extern "C" TSLanguage * tree_sitter_sql();

namespace {

Expand All @@ -17,12 +17,12 @@ void Init(Local<Object> exports, Local<Object> module) {

Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_SQL());
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_sql());

Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("SQL").ToLocalChecked());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("sql").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}

NODE_MODULE(tree_sitter_SQL_binding, Init)
NODE_MODULE(tree_sitter_sql_binding, Init)

} // namespace
4 changes: 2 additions & 2 deletions bindings/node/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
try {
module.exports = require("../../build/Release/tree_sitter_SQL_binding");
module.exports = require("../../build/Release/tree_sitter_sql_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_SQL_binding");
module.exports = require("../../build/Debug/tree_sitter_sql_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
Expand Down
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@
"lexer",
"sql"
],
"repository": {
"type": "git",
"url": "https://github.com/m-novikov/tree-sitter-sql"
},
"author": "Maksim Novikov <mnovikov.work@gmail.com>",
"repository": "https://github.com/m-novikov/tree-sitter-sql",
"author": "Maksim Novikov <mnovikov.work@gmail.com>",
"license": "MIT",
"dependencies": {
"nan": "^2.14.2"
},
"devDependencies": {
"prettier": "2.3.0",
"prettier": "^2.4.1",
"tree-sitter-cli": "^0.20.0"
},
"tree-sitter": [
Expand Down

0 comments on commit 513d538

Please sign in to comment.