From ebfc0fd1b2e96eea5e1b31bcd10ca02dc875fbff Mon Sep 17 00:00:00 2001 From: Zac Pullen Date: Thu, 14 Oct 2021 14:54:31 +0800 Subject: [PATCH] fix: add dirname to fix binary import --- lib.ts | 2 +- package.json | 1 + tsconfig.json | 2 +- yarn.lock | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib.ts b/lib.ts index 2d3a082..fdce046 100644 --- a/lib.ts +++ b/lib.ts @@ -1,7 +1,7 @@ import * as nbind from '@mcesystems/nbind'; import * as LibTypes from './lib-types'; -const lib = nbind.init().lib; +const lib = nbind.init(__dirname).lib; export const TeosSea = lib.TeosSea; diff --git a/package.json b/package.json index e8958d1..37083fd 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "homepage": "https://github.com/Greenroom-Robotics/GSW-node#readme", "dependencies": { "@mcesystems/nbind": "^0.3.18", + "@types/node": "^16.10.9", "autogypi": "^0.2.2", "cmake-js": "^6.2.1", "copyfiles": "^2.4.1", diff --git a/tsconfig.json b/tsconfig.json index 2c99db6..af30605 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "outDir": "./dist", "baseUrl": "./", "incremental": true, - "types": ["jest"] + "types": ["jest", "node"] }, "include": [ "lib-types.d.ts", diff --git a/yarn.lock b/yarn.lock index 9b86df1..298e66c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -623,6 +623,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.4.tgz#592f12b0b5f357533ddc3310b0176d42ea3e45d1" integrity sha512-EITwVTX5B4nDjXjGeQAfXOrm+Jn+qNjDmyDRtWoD+wZsl/RDPRTFRKivs4Mt74iOFlLOrE5+Kf+p5yjyhm3+cA== +"@types/node@^16.10.9": + version "16.10.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.9.tgz#8f1cdd517972f76a3b928298f4c0747cd6fef25a" + integrity sha512-H9ReOt+yqIJPCutkTYjFjlyK6WEMQYT9hLZMlWtOjFQY2ItppsWZ6RJf8Aw+jz5qTYceuHvFgPIaKOHtLAEWBw== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"