@swisseph/node 1.0.4 → 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.
@@ -1,3 +1,4 @@
1
+ #include <cstdint>
1
2
  #include <napi.h>
2
3
  #include "swephexp.h"
3
4
  #include <cstring>
package/binding.gyp CHANGED
@@ -16,8 +16,7 @@
16
16
  ],
17
17
  "include_dirs": [
18
18
  "<!@(node -p \"require('node-addon-api').include\")",
19
- "libswe",
20
- "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1"
19
+ "libswe"
21
20
  ],
22
21
  "dependencies": [
23
22
  "<!(node -p \"require('node-addon-api').gyp\")"
@@ -29,10 +28,16 @@
29
28
  ["OS=='mac'", {
30
29
  "xcode_settings": {
31
30
  "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
31
+ "GCC_ENABLE_CPP_RTTI": "YES",
32
32
  "CLANG_CXX_LIBRARY": "libc++",
33
33
  "CLANG_CXX_LANGUAGE_STANDARD": "c++14",
34
34
  "MACOSX_DEPLOYMENT_TARGET": "10.15",
35
- "OTHER_CPLUSPLUSFLAGS": ["-std=c++14", "-stdlib=libc++"]
35
+ "OTHER_CPLUSPLUSFLAGS": [
36
+ "-std=c++14",
37
+ "-stdlib=libc++",
38
+ "-isysroot",
39
+ "<!@(xcrun --show-sdk-path)"
40
+ ]
36
41
  },
37
42
  "cflags_cc": ["-std=c++14", "-stdlib=libc++"]
38
43
  }],
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ exports.close = close;
54
54
  const core_1 = require("@swisseph/core");
55
55
  const path = __importStar(require("path"));
56
56
  // Import the native addon
57
- const binding = require('../build/Release/swisseph.node');
57
+ const binding = require('node-gyp-build')(path.join(__dirname, '..'));
58
58
  // Track if ephemeris path has been explicitly set
59
59
  let ephemerisPathSet = false;
60
60
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisseph/node",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Swiss Ephemeris for Node.js - high precision astronomical calculations with native bindings",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,7 +19,8 @@
19
19
  "ephemeris",
20
20
  "libswe",
21
21
  "scripts",
22
- "README.md"
22
+ "README.md",
23
+ "prebuilds"
23
24
  ],
24
25
  "keywords": [
25
26
  "astronomy",
@@ -49,6 +50,7 @@
49
50
  },
50
51
  "dependencies": {
51
52
  "node-addon-api": "^7.1.0",
53
+ "node-gyp-build": "^4.8.4",
52
54
  "@swisseph/core": "1.0.4"
53
55
  },
54
56
  "devDependencies": {
@@ -56,6 +58,7 @@
56
58
  "@types/node": "^20.10.6",
57
59
  "jest": "^29.7.0",
58
60
  "node-gyp": "^10.0.1",
61
+ "prebuildify": "^6.0.1",
59
62
  "ts-jest": "^29.1.1",
60
63
  "ts-node": "^10.9.2",
61
64
  "typescript": "^5.3.3"
@@ -64,9 +67,10 @@
64
67
  "node": ">=14.0.0"
65
68
  },
66
69
  "scripts": {
67
- "install": "node scripts/setup-libswe.js && node-gyp rebuild",
70
+ "preinstall": "node scripts/setup-libswe.js",
71
+ "install": "node-gyp-build",
68
72
  "copy:libswe": "mkdir -p libswe && cp ../../native/libswe/* libswe/",
69
- "prebuild": "npm run copy:libswe",
73
+ "prebuild": "node scripts/setup-libswe.js && prebuildify --napi --strip --name swisseph",
70
74
  "build": "node-gyp rebuild && tsc",
71
75
  "build:native": "node-gyp rebuild",
72
76
  "build:js": "tsc",