From f9efaf6384d93d9f08d81be6043923f2b13cd4dd Mon Sep 17 00:00:00 2001 From: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Date: Mon, 31 Oct 2022 13:31:09 +0100 Subject: [PATCH] Fix nodejs package and path (#1341) * Fix path * Fix published package * Remove unused import --- .changes/build-fix.md | 6 ++++++ .changes/config.json | 6 ++++++ client/bindings/nodejs/jest.config.js | 2 +- client/bindings/nodejs/lib/bindings.ts | 2 +- client/bindings/nodejs/types/generateAddressesOptions.ts | 1 - 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changes/build-fix.md diff --git a/.changes/build-fix.md b/.changes/build-fix.md new file mode 100644 index 000000000..1166ebade --- /dev/null +++ b/.changes/build-fix.md @@ -0,0 +1,6 @@ + +--- +"nodejs-binding": patch +--- + +Run tsc before publishing. diff --git a/.changes/config.json b/.changes/config.json index 3107b42ff..9ecea3814 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -21,6 +21,12 @@ { "command": "dasel put string -f Cargo.toml '.dependencies.iota-client.features.[1]' mqtt" }, + { + "command": "yarn --ignore-scripts" + }, + { + "command": "tsc" + }, { "command": "cat Cargo.toml" } diff --git a/client/bindings/nodejs/jest.config.js b/client/bindings/nodejs/jest.config.js index 3c4eec214..d82be59e0 100644 --- a/client/bindings/nodejs/jest.config.js +++ b/client/bindings/nodejs/jest.config.js @@ -4,6 +4,6 @@ module.exports = { testEnvironment: 'node', testMatch: ['/test/**/*.(test|spec).ts'], moduleNameMapper: { - 'index.node': '/index.node', + 'index.node': '/build/Release/index.node', }, }; diff --git a/client/bindings/nodejs/lib/bindings.ts b/client/bindings/nodejs/lib/bindings.ts index 864265ee0..e3545183f 100644 --- a/client/bindings/nodejs/lib/bindings.ts +++ b/client/bindings/nodejs/lib/bindings.ts @@ -4,7 +4,7 @@ import type { MessageHandler } from './MessageHandler'; // @ts-ignore: path is set to match runtime transpiled js path -import addon = require('../../index.node'); +import addon = require('../../build/Release/index.node'); const { initLogger, sendMessage, messageHandlerNew, listen } = addon; diff --git a/client/bindings/nodejs/types/generateAddressesOptions.ts b/client/bindings/nodejs/types/generateAddressesOptions.ts index 64f23f870..42075514e 100644 --- a/client/bindings/nodejs/types/generateAddressesOptions.ts +++ b/client/bindings/nodejs/types/generateAddressesOptions.ts @@ -1,7 +1,6 @@ // Copyright 2021-2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 import type { CoinType } from '../lib'; -import type { Network } from './network'; import type { IRange } from './range'; /**