From 6d68b13a04ff933a73e1173e7805171def1f553d Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Sun, 18 Nov 2018 14:09:16 +1100 Subject: [PATCH] Publishable version, rename zetjs to @ndcode/zettair, add license to every file --- .gitignore | 3 +++ LICENSE | 20 ++++++++++++++++++++ binding.gyp | 6 ++---- package.json | 30 ++++++++++++++++++++++-------- test.js | 25 ++++++++++++++++++++++++- zetjs.js | 1 - zetjs.cpp => zettair.cpp | 25 ++++++++++++++++++++++++- 7 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 LICENSE delete mode 100644 zetjs.js rename zetjs.cpp => zettair.cpp (86%) diff --git a/.gitignore b/.gitignore index 4823a7c..65ff395 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ /nodesource_setup.sh /node_modules /package-lock.json +/yarn.lock +/yarn-error.log +/zettair-*.tgz diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..aa360c1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2018 Nick Downing +SPDX-License-Identifier: MIT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/binding.gyp b/binding.gyp index 1221fbe..84f53b0 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,10 +1,8 @@ { "targets": [ { - "target_name": "zet", - "sources": ["zetjs.cpp"], - "cflags": ["-I$$HOME/include"], - "library_dirs": ["$$HOME/lib"], + "target_name": "zettair", + "sources": ["zettair.cpp"], "libraries": ["-lzet"] } ] diff --git a/package.json b/package.json index 2a5b032..9d5b27c 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,25 @@ { - "name": "zetjs", - "version": "1.0.0", - "description": "Bindings to zettair search engine", - "main": "zetjs.js", - "directories": { - "doc": "doc" + "name": "@ndcode/zettair", + "version": "0.1.0", + "description": "Bindings to zettair search engine.", + "keywords": [ + "Zettair", + "bindings", + "full-text search", + "search engine", + "text query", + "search ranking" + ], + "homepage": "https://www.ndcode.org", + "repository": { + "type": "git", + "url": "https://git.ndcode.org/public/node_zettair.git" }, + "bugs": { + "email": "nick@ndcode.org" + }, + "main": "build/release/zettair.node", + "directories": {}, "dependencies": { "node-gyp": "^3.6.2" }, @@ -13,7 +27,7 @@ "scripts": { "install": "node-gyp rebuild" }, - "author": "Nick Downing", - "license": "GPL-3.0", + "author": "Nick Downing ", + "license": "MIT", "gypfile": true } diff --git a/test.js b/test.js index 244f3ad..7b10d06 100755 --- a/test.js +++ b/test.js @@ -1,6 +1,29 @@ #!/usr/bin/env node -const zetjs = require('./zetjs'); +/* + * Copyright (C) 2018 Nick Downing + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +const zetjs = require('build/release/zettair.node'); const obj = new zetjs.Index(); console.log(obj.search('moby', 0, 10)); diff --git a/zetjs.js b/zetjs.js deleted file mode 100644 index 18890e0..0000000 --- a/zetjs.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./build/Release/zet'); diff --git a/zetjs.cpp b/zettair.cpp similarity index 86% rename from zetjs.cpp rename to zettair.cpp index 84c542d..38e8812 100644 --- a/zetjs.cpp +++ b/zettair.cpp @@ -1,3 +1,26 @@ +/* + * Copyright (C) 2018 Nick Downing + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + #include #include #include @@ -5,7 +28,7 @@ #include #include -namespace zetjs { +namespace zettair { static v8::Local index_result_to_object( v8::Isolate* isolate, -- 2.34.1