Skip to content

Commit

Permalink
Remove nodejs dependencies by switching to node-rsa fork (#100)
Browse files Browse the repository at this point in the history
* [worker] replace node-rsa implementation

* v0.12.2-alpha.0

* [worker] fix use import new node-rsa lib in correct package

* v0.12.3-alpha.0

* [worker] fix use correct import path for new node-rsa lib

* v0.12.4-alpha.0
  • Loading branch information
clangenb authored Apr 29, 2024
1 parent c1a86c7 commit ec10495
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 32 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"publishConfig": {
"directory": "build"
},
"version": "0.12.1"
"version": "0.12.4-alpha.0"
}
4 changes: 2 additions & 2 deletions packages/node-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
},
"sideEffects": false,
"type": "module",
"version": "0.12.1",
"version": "0.12.4-alpha.0",
"main": "index.js",
"dependencies": {
"@encointer/types": "^0.12.1",
"@encointer/types": "^0.12.4-alpha.0",
"@polkadot/api": "^10.9.1",
"tslib": "^2.5.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"sideEffects": false,
"type": "module",
"version": "0.12.1",
"version": "0.12.4-alpha.0",
"main": "index.js",
"scripts": {
"generate:defs": "node --experimental-specifier-resolution=node --loader ts-node/esm ../../node_modules/.bin/polkadot-types-from-defs --package @encointer/types/interfaces --input ./src/interfaces",
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"sideEffects": false,
"type": "module",
"types": "./index.d.ts",
"version": "0.12.1",
"version": "0.12.4-alpha.0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
Expand Down
10 changes: 5 additions & 5 deletions packages/worker-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
"sideEffects": false,
"type": "module",
"types": "./index.d.ts",
"version": "0.12.1",
"version": "0.12.4-alpha.0",
"main": "index.js",
"dependencies": {
"@encointer/node-api": "^0.12.1",
"@encointer/types": "^0.12.1",
"@encointer/util": "^0.12.1",
"@encointer/node-api": "^0.12.4-alpha.0",
"@encointer/types": "^0.12.4-alpha.0",
"@encointer/util": "^0.12.4-alpha.0",
"@learntheropes/node-rsa": "^1.1.3",
"@polkadot/api": "^10.9.1",
"@polkadot/keyring": "^12.3.2",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/wasm-crypto": "^7.2.1",
"bs58": "^4.0.1",
"node-rsa": "^1.1.1",
"promised-map": "^1.0.0",
"websocket": "^1.0.34",
"websocket-as-promised": "^2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/worker-api/src/encointerWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {u32, u64, Vec} from '@polkadot/types';
import {communityIdentifierFromString} from '@encointer/util';

// @ts-ignore
import NodeRSA from 'node-rsa';
import NodeRSA from '@learntheropes/node-rsa';

import type {
CommunityIdentifier,
Expand Down
2 changes: 1 addition & 1 deletion packages/worker-api/src/integriteeWorker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {u32} from '@polkadot/types';

// @ts-ignore
import NodeRSA from 'node-rsa';
import NodeRSA from '@learntheropes/node-rsa';


import type {KeyringPair} from '@polkadot/keyring/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/worker-api/src/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { parseI64F64 } from '@encointer/util';
import { u8aToBn } from '@polkadot/util';

// @ts-ignore
import NodeRSA from 'node-rsa';
import NodeRSA from '@learntheropes/node-rsa';

import type { IWorker } from './interface.js';
import type { BalanceEntry } from "@encointer/types";
Expand Down
2 changes: 1 addition & 1 deletion packages/worker-api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {options as encointerOptions} from '@encointer/node-api';
import {parseI64F64} from '@encointer/util';

// @ts-ignore
import NodeRSA from 'node-rsa';
import NodeRSA from '@learntheropes/node-rsa';

import type {
Vault
Expand Down
47 changes: 29 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -755,18 +755,18 @@ __metadata:
languageName: node
linkType: hard

"@encointer/node-api@^0.12.1, @encointer/node-api@workspace:packages/node-api":
"@encointer/node-api@^0.12.4-alpha.0, @encointer/node-api@workspace:packages/node-api":
version: 0.0.0-use.local
resolution: "@encointer/node-api@workspace:packages/node-api"
dependencies:
"@encointer/types": ^0.12.1
"@encointer/types": ^0.12.4-alpha.0
"@polkadot/api": ^10.9.1
"@polkadot/util-crypto": ^12.3.2
tslib: ^2.5.3
languageName: unknown
linkType: soft

"@encointer/types@^0.12.1, @encointer/types@workspace:packages/types":
"@encointer/types@^0.12.4-alpha.0, @encointer/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@encointer/types@workspace:packages/types"
dependencies:
Expand All @@ -781,7 +781,7 @@ __metadata:
languageName: unknown
linkType: soft

"@encointer/util@^0.12.1, @encointer/util@workspace:packages/util":
"@encointer/util@^0.12.4-alpha.0, @encointer/util@workspace:packages/util":
version: 0.0.0-use.local
resolution: "@encointer/util@workspace:packages/util"
dependencies:
Expand All @@ -798,9 +798,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@encointer/worker-api@workspace:packages/worker-api"
dependencies:
"@encointer/node-api": ^0.12.1
"@encointer/types": ^0.12.1
"@encointer/util": ^0.12.1
"@encointer/node-api": ^0.12.4-alpha.0
"@encointer/types": ^0.12.4-alpha.0
"@encointer/util": ^0.12.4-alpha.0
"@learntheropes/node-rsa": ^1.1.3
"@polkadot/api": ^10.9.1
"@polkadot/keyring": ^12.3.2
"@polkadot/types": ^10.9.1
Expand All @@ -809,7 +810,6 @@ __metadata:
"@polkadot/wasm-crypto": ^7.2.1
"@types/bs58": ^4.0.1
bs58: ^4.0.1
node-rsa: ^1.1.1
promised-map: ^1.0.0
websocket: ^1.0.34
websocket-as-promised: ^2.0.1
Expand Down Expand Up @@ -1277,6 +1277,16 @@ __metadata:
languageName: node
linkType: hard

"@learntheropes/node-rsa@npm:^1.1.3":
version: 1.1.3
resolution: "@learntheropes/node-rsa@npm:1.1.3"
dependencies:
asn1: ^0.2.4
buffer: ^6.0.3
checksum: d35d8efe2ade9b5502b541e3c5b13c5959b400b1213c49bc926c6c6fb5147d7f89bcb58b5f539214f5e065d16071ec90bca6513fb7fb61d4e0ad39fff4cc8c49
languageName: node
linkType: hard

"@leichtgewicht/ip-codec@npm:^2.0.1":
version: 2.0.4
resolution: "@leichtgewicht/ip-codec@npm:2.0.4"
Expand Down Expand Up @@ -4966,6 +4976,16 @@ __metadata:
languageName: node
linkType: hard

"buffer@npm:^6.0.3":
version: 6.0.3
resolution: "buffer@npm:6.0.3"
dependencies:
base64-js: ^1.3.1
ieee754: ^1.2.1
checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9
languageName: node
linkType: hard

"bufferutil@npm:^4.0.1":
version: 4.0.5
resolution: "bufferutil@npm:4.0.5"
Expand Down Expand Up @@ -8711,7 +8731,7 @@ __metadata:
languageName: node
linkType: hard

"ieee754@npm:^1.1.13":
"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1":
version: 1.2.1
resolution: "ieee754@npm:1.2.1"
checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e
Expand Down Expand Up @@ -11353,15 +11373,6 @@ __metadata:
languageName: node
linkType: hard

"node-rsa@npm:^1.1.1":
version: 1.1.1
resolution: "node-rsa@npm:1.1.1"
dependencies:
asn1: ^0.2.4
checksum: c03a6c8f69557326d2110086ce9610b4b17ef0fd594f76202225b7eb93fc0b342fb31714f6b3cf8d38320cf63c4790a3034e5d47a12f2c27d1900599ec9bd545
languageName: node
linkType: hard

"node-source-walk@npm:^4.0.0, node-source-walk@npm:^4.2.0":
version: 4.2.0
resolution: "node-source-walk@npm:4.2.0"
Expand Down

0 comments on commit ec10495

Please sign in to comment.