Skip to content

Commit 576058d

Browse files
committed
chore: move tweetnacl to devDependencies
1 parent 29f7ddf commit 576058d

6 files changed

Lines changed: 3 additions & 19 deletions

File tree

bun.lockb

1.99 KB
Binary file not shown.

bundle.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ bun build ./packages/federation-sdk/src/index.ts \
115115
-e @rocket.chat/emitter \
116116
-e reflect-metadata \
117117
-e tsyringe \
118-
-e tweetnacl \
119118
--production \
120119
--sourcemap=inline
121120
*/

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"sinon": "^20.0.0",
1515
"tsconfig-paths": "^4.2.0",
1616
"turbo": "~2.5.6",
17-
"typescript": "~5.9.2"
17+
"typescript": "~5.9.2",
18+
"tweetnacl": "^1.0.3"
1819
},
1920
"workspaces": ["packages/*"],
2021
"dependencies": {
@@ -23,8 +24,7 @@
2324
"reflect-metadata": "^0.2.2",
2425
"rollup": "^4.52.4",
2526
"rollup-plugin-dts": "^6.2.3",
26-
"tsyringe": "^4.10.0",
27-
"tweetnacl": "^1.0.3"
27+
"tsyringe": "^4.10.0"
2828
},
2929
"husky": {
3030
"hooks": {

packages/core/src/utils/signJson.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { encodeCanonicalJson } from '@rocket.chat/federation-crypto';
2-
import nacl from 'tweetnacl';
32
import type { SigningKey } from '../types';
43
import { EncryptionValidAlgorithm } from '../types';
54
import { toBinaryData, toUnpaddedBase64 } from './binaryData';
@@ -54,15 +53,3 @@ export const isValidAlgorithm = (
5453
): algorithm is EncryptionValidAlgorithm => {
5554
return Object.values(EncryptionValidAlgorithm).includes(algorithm as any);
5655
};
57-
58-
export async function signData(
59-
data: string | Uint8Array,
60-
signingKey: Uint8Array,
61-
): Promise<Uint8Array> {
62-
const signature = nacl.sign.detached(
63-
typeof data === 'string' ? new TextEncoder().encode(data) : data,
64-
signingKey,
65-
);
66-
67-
return signature;
68-
}

packages/federation-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"mongodb": "^6.16.0",
2424
"reflect-metadata": "^0.2.2",
2525
"tsyringe": "^4.10.0",
26-
"tweetnacl": "^1.0.3",
2726
"zod": "^3.24.1"
2827
},
2928
"license": "AGPL-3.0",

rollup.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const isExternal = (id) => {
3131
'pino',
3232
'pino-std-serializers',
3333
'sonic-boom',
34-
'tweetnacl',
3534
].includes(id)
3635
) {
3736
return true;

0 commit comments

Comments
 (0)