node-sword-interface 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md CHANGED
@@ -35,7 +35,7 @@ This is the main class of node-sword-interface and it provides a set of static f
35
35
  * [.updateRepositoryConfig(progressCB)](#NodeSwordInterface+updateRepositoryConfig) ⇒ <code>Promise</code>
36
36
  * [.getRepoNames()](#NodeSwordInterface+getRepoNames) ⇒ <code>Array.&lt;String&gt;</code>
37
37
  * [.getRepoLanguages(repositoryName, moduleType)](#NodeSwordInterface+getRepoLanguages) ⇒ <code>Array.&lt;String&gt;</code>
38
- * [.getAllRepoModules(repositoryName, moduleType)](#NodeSwordInterface+getAllRepoModules) ⇒ <code>Array.&lt;String&gt;</code>
38
+ * [.getAllRepoModules(repositoryName, moduleType)](#NodeSwordInterface+getAllRepoModules) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
39
39
  * [.getRepoModulesByLang(repositoryName, language, moduleType, headersFilter, strongsFilter, hebrewStrongsKeys, greekStrongsKeys)](#NodeSwordInterface+getRepoModulesByLang) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
40
40
  * [.getUpdatedRepoModules(repositoryName, includeBeta)](#NodeSwordInterface+getUpdatedRepoModules) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
41
41
  * [.getRepoModule(moduleCode)](#NodeSwordInterface+getRepoModule) ⇒ [<code>ModuleObject</code>](#ModuleObject)
@@ -125,11 +125,11 @@ Note that the languages are returned as language codes.
125
125
 
126
126
  <a name="NodeSwordInterface+getAllRepoModules"></a>
127
127
 
128
- ### nodeSwordInterface.getAllRepoModules(repositoryName, moduleType) ⇒ <code>Array.&lt;String&gt;</code>
128
+ ### nodeSwordInterface.getAllRepoModules(repositoryName, moduleType) ⇒ [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject)
129
129
  Returns all modules for the given repository (default: Bible modules).
130
130
 
131
131
  **Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
132
- **Returns**: <code>Array.&lt;String&gt;</code> - An array of strings with the module codes for the Bible modules of the given repository.
132
+ **Returns**: [<code>Array.&lt;ModuleObject&gt;</code>](#ModuleObject) - An array of strings with the module codes for the Bible modules of the given repository.
133
133
 
134
134
  | Param | Type | Default | Description |
135
135
  | --- | --- | --- | --- |
package/binding.gyp CHANGED
@@ -112,8 +112,7 @@
112
112
  ],
113
113
  "libraries": [
114
114
  '<(module_root_dir)/sword_build/libsword.a',
115
- '<!@(pkg-config --libs libcurl)',
116
- '<!@(PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig" pkg-config --libs icu-uc icu-io icu-i18n)'
115
+ '<!@(pkg-config --libs libcurl)'
117
116
  ],
118
117
  "dependencies": [
119
118
  "<!(node -p \"require('node-addon-api').gyp\")",
package/index.js CHANGED
@@ -148,7 +148,7 @@ class NodeSwordInterface {
148
148
  *
149
149
  * @param {String} repositoryName - The name of the given repository.
150
150
  * @param {String} moduleType - A filter parameter that defines the moduleType (Options: BIBLE, DICT)
151
- * @return {String[]} An array of strings with the module codes for the Bible modules of the given repository.
151
+ * @return {ModuleObject[]} An array of strings with the module codes for the Bible modules of the given repository.
152
152
  */
153
153
  getAllRepoModules(repositoryName, moduleType="BIBLE") {
154
154
  return this.nativeInterface.getAllRepoModules(repositoryName, moduleType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -16,11 +16,13 @@
16
16
  "clean": "node-gyp clean",
17
17
  "doc": "jsdoc2md index.js > API.md",
18
18
  "pub": "rm -rf build node_modules sword sword_build test && npm publish ./",
19
- "deploy": "scripts/deploy_local.sh"
19
+ "deploy": "scripts/deploy_local.sh",
20
+ "postinstall": "node scripts/postinstall.js"
20
21
  },
21
22
  "author": "Tobias Klein",
22
23
  "license": "GPL-2.0+",
23
24
  "dependencies": {
25
+ "glob": "^8.0.3",
24
26
  "node-addon-api": "^4.2.0"
25
27
  },
26
28
  "repository": {
@@ -28,7 +30,7 @@
28
30
  "url": "https://github.com/ezra-project/node-sword-interface.git"
29
31
  },
30
32
  "devDependencies": {
31
- "jsdoc-to-markdown": "^7.1.0",
33
+ "jsdoc-to-markdown": "^8.0.0",
32
34
  "node-gyp": "^8.0.0"
33
35
  }
34
36
  }
@@ -34,18 +34,11 @@ git clone https://github.com/bibletime/crosswire-sword-mirror sword
34
34
  git -C sword checkout 1460f9
35
35
  patch --batch --forward -d sword -p 0 < patch/sword_globconf.patch
36
36
 
37
-
38
37
  # PATCHES
39
38
  case "$(uname -s)" in
40
- # Linux)
41
- # # We only apply the Sword ICU patch on Linux
42
- # patch --batch --forward -d sword -p 0 < patch/sword_icu.patch
43
- # ;;
44
39
  Darwin)
45
40
  # We only apply the following patch on macOS
46
41
  export MACOSX_DEPLOYMENT_TARGET=10.10
47
- export CMAKE_PREFIX_PATH=/usr/local/opt/icu4c
48
- # patch --batch --forward -d sword -p 0 < patch/sword_mac.patch
49
42
  ;;
50
43
  esac
51
44
 
@@ -0,0 +1,37 @@
1
+ /* This file is part of node-sword-interface.
2
+
3
+ Copyright (C) 2019 - 2022 Tobias Klein <contact@tklein.info>
4
+
5
+ node-sword-interface is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ node-sword-interface is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ See the GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with node-sword-interface. See the file COPYING.
17
+ If not, see <http://www.gnu.org/licenses/>. */
18
+
19
+ const glob = require('glob');
20
+ const path = require('path');
21
+ const fs = require('fs');
22
+
23
+ function postInstall() {
24
+ if (process.platform.indexOf("win") != -1) {
25
+ console.log("Copying build dependencies to build output folder.");
26
+
27
+ glob('build/sword-build-win32/lib/*.*', null, function (er, files) {
28
+ files.forEach((srcPath) => {
29
+ let fileName = path.basename(srcPath);
30
+ let destPath = path.join('build/Release', fileName);
31
+ fs.copyFileSync(srcPath, destPath);
32
+ });
33
+ });
34
+ }
35
+ }
36
+
37
+ postInstall();
@@ -88,8 +88,8 @@ void get_repo_module(RepositoryInterface& repoInterface)
88
88
 
89
89
  void get_updated_repo_modules(RepositoryInterface& repoInterface)
90
90
  {
91
- //ModuleStore moduleStore;
92
- //ModuleHelper moduleHelper(moduleStore);
91
+ ModuleStore moduleStore;
92
+ ModuleHelper moduleHelper(moduleStore);
93
93
 
94
94
  vector<SWModule*> updatedModules = repoInterface.getUpdatedRepoModules();
95
95
 
@@ -1,55 +0,0 @@
1
- Index: include/utf8transliterator.h
2
- ===================================================================
3
- --- include/utf8transliterator.h (Revision 3673)
4
- +++ include/utf8transliterator.h (Arbeitskopie)
5
- @@ -45,6 +45,9 @@
6
- #include <defs.h>
7
- #include <map>
8
-
9
- +using icu::UnicodeString;
10
- +using icu::Transliterator;
11
- +
12
- SWORD_NAMESPACE_START
13
-
14
- class SWModule;
15
- Index: src/modules/filters/scsuutf8.cpp
16
- ===================================================================
17
- --- src/modules/filters/scsuutf8.cpp (Revision 3673)
18
- +++ src/modules/filters/scsuutf8.cpp (Arbeitskopie)
19
- @@ -35,8 +35,8 @@
20
- #include <unicode/unistr.h>
21
- #endif
22
-
23
- +using icu::UnicodeString;
24
-
25
- -
26
- SWORD_NAMESPACE_START
27
-
28
-
29
- Index: src/modules/filters/utf8nfc.cpp
30
- ===================================================================
31
- --- src/modules/filters/utf8nfc.cpp (Revision 3673)
32
- +++ src/modules/filters/utf8nfc.cpp (Arbeitskopie)
33
- @@ -30,6 +30,9 @@
34
- #include <utf8nfc.h>
35
- #include <swbuf.h>
36
-
37
- +using icu::UnicodeString;
38
- +using icu::Normalizer;
39
- +
40
- SWORD_NAMESPACE_START
41
-
42
- UTF8NFC::UTF8NFC() {
43
- Index: src/modules/filters/utf8scsu.cpp
44
- ===================================================================
45
- --- src/modules/filters/utf8scsu.cpp (Revision 3673)
46
- +++ src/modules/filters/utf8scsu.cpp (Arbeitskopie)
47
- @@ -25,6 +25,8 @@
48
- #include <utf8scsu.h>
49
- #include <swbuf.h>
50
-
51
- +using icu::UnicodeString;
52
- +
53
- SWORD_NAMESPACE_START
54
-
55
-
@@ -1,62 +0,0 @@
1
- Index include/utf8transliterator.h
2
- ===================================================================
3
- --- include/utf8transliterator.h
4
- +++ include/utf8transliterator.h
5
- @@ -42,6 +42,9 @@ SE_JAMO, SE_HAN, SE_KANJI
6
-
7
- #include <unicode/translit.h>
8
-
9
- +using icu_64::UnicodeString;
10
- +using icu_64::Transliterator;
11
- +
12
- #include <defs.h>
13
- #include <map>
14
-
15
- Index src/modules/filters/scsuutf8.cpp
16
- ===================================================================
17
- --- src/modules/filters/scsuutf8.cpp
18
- +++ src/modules/filters/scsuutf8.cpp
19
- @@ -29,13 +29,14 @@
20
- * in http://www.unicode.org/unicode/reports/tr6.html
21
- */
22
-
23
- -#include <scsuutf8.h>
24
- -#include <swbuf.h>
25
- #ifdef _ICU_
26
- #include <unicode/unistr.h>
27
- #endif
28
-
29
- +using icu_64::UnicodeString;
30
-
31
- +#include <scsuutf8.h>
32
- +#include <swbuf.h>
33
-
34
- SWORD_NAMESPACE_START
35
-
36
- Index src/modules/filters/utf8nfc.cpp
37
- ===================================================================
38
- --- src/modules/filters/utf8nfc.cpp
39
- +++ src/modules/filters/utf8nfc.cpp
40
- @@ -27,6 +27,9 @@
41
- #include <unicode/normlzr.h>
42
- #include <unicode/unorm.h>
43
-
44
- +using icu_64::UnicodeString;
45
- +using icu_64::Normalizer;
46
- +
47
- #include <utf8nfc.h>
48
- #include <swbuf.h>
49
-
50
- Index src/modules/filters/utf8scsu.cpp
51
- ===================================================================
52
- --- src/modules/filters/utf8scsu.cpp
53
- +++ src/modules/filters/utf8scsu.cpp
54
- @@ -25,6 +25,8 @@
55
- #include <utf8scsu.h>
56
- #include <swbuf.h>
57
-
58
- +using icu_64::UnicodeString;
59
- +
60
- SWORD_NAMESPACE_START
61
-
62
-