Publishable version, rename zetjs to @ndcode/zettair, add license to every file
authorNick Downing <nick@ndcode.org>
Sun, 18 Nov 2018 03:09:16 +0000 (14:09 +1100)
committerNick Downing <nick@ndcode.org>
Sun, 18 Nov 2018 03:11:02 +0000 (14:11 +1100)
.gitignore
LICENSE [new file with mode: 0644]
binding.gyp
package.json
test.js
zetjs.js [deleted file]
zettair.cpp [moved from zetjs.cpp with 86% similarity]

index 4823a7c..65ff395 100644 (file)
@@ -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 (file)
index 0000000..aa360c1
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright (C) 2018 Nick Downing <nick@ndcode.org>
+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.
index 1221fbe..84f53b0 100644 (file)
@@ -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"]
     }
   ]
index 2a5b032..9d5b27c 100644 (file)
@@ -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 <nick@ndcode.org>",
+  "license": "MIT",
   "gypfile": true
 }
diff --git a/test.js b/test.js
index 244f3ad..7b10d06 100755 (executable)
--- a/test.js
+++ b/test.js
@@ -1,6 +1,29 @@
 #!/usr/bin/env node
 
-const zetjs = require('./zetjs');
+/*
+ * Copyright (C) 2018 Nick Downing <nick@ndcode.org>
+ * 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 (file)
index 18890e0..0000000
--- a/zetjs.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./build/Release/zet');
similarity index 86%
rename from zetjs.cpp
rename to zettair.cpp
index 84c542d..38e8812 100644 (file)
--- a/zetjs.cpp
@@ -1,3 +1,26 @@
+/*
+ * Copyright (C) 2018 Nick Downing <nick@ndcode.org>
+ * 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 <node.h>
 #include <node_object_wrap.h>
 #include <stdlib.h>
@@ -5,7 +28,7 @@
 #include <zettair/def.h>
 #include <zettair/index.h>
 
-namespace zetjs {
+namespace zettair {
 
 static v8::Local<v8::Object> index_result_to_object(
   v8::Isolate* isolate,