Skip to content

Commit aa0b1d4

Browse files
authored
chore: update dependencies (#131)
Currently dependencies are out of date which cause security problems. Since this snap is also used with gator snap the security problems get propagated through the dependency tree. This PR updates all the dependency to the latest version (except eslint and zod dependencies) and fixates versions in `package.json`. Eslint dependencies should be addressed in a separate PR since they result in changes in the whole code base - style wise.
1 parent f290456 commit aa0b1d4

File tree

7 files changed

+1314
-2991
lines changed

7 files changed

+1314
-2991
lines changed

constraints.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, null, DependencyType) :-
9191
DependencyType == 'devDependencies'.
9292

9393
% The package must specify the expected node version constraint.
94-
gen_enforced_field(WorkspaceCwd, 'engines.node', '^18.18 || >=20').
94+
gen_enforced_field(WorkspaceCwd, 'engines.node', '^20 || >=22').
9595

9696
% The package is public.
9797
gen_enforced_field(WorkspaceCwd, 'publishConfig.access', 'public').

package.json

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,47 @@
5252
"tscheck": "tsc --noEmit"
5353
},
5454
"devDependencies": {
55-
"@lavamoat/allow-scripts": "^3.0.4",
56-
"@lavamoat/preinstall-always-fail": "^2.0.0",
57-
"@metamask/auto-changelog": "^3.4.4",
58-
"@metamask/eslint-config": "^12.2.0",
59-
"@metamask/eslint-config-jest": "^12.1.0",
60-
"@metamask/eslint-config-nodejs": "^12.1.0",
61-
"@metamask/eslint-config-typescript": "^12.1.0",
62-
"@metamask/rpc-errors": "^6.3.0",
63-
"@metamask/snaps-cli": "^6.7.0",
64-
"@metamask/snaps-controllers": "^10.0.1",
65-
"@metamask/snaps-jest": "^8.13.0",
66-
"@metamask/snaps-sdk": "^6.19.0",
67-
"@metamask/utils": "^11.2.0",
68-
"@noble/ciphers": "^0.5.3",
69-
"@noble/curves": "^1.4.2",
70-
"@noble/hashes": "^1.4.0",
71-
"@types/jest": "^29.5.12",
72-
"@types/node": "^20.14.9",
73-
"@typescript-eslint/eslint-plugin": "^7.15.0",
74-
"@typescript-eslint/parser": "^7.15.0",
75-
"depcheck": "^1.4.7",
76-
"eslint": "^8.57.0",
77-
"eslint-config-prettier": "^9.1.0",
78-
"eslint-plugin-import": "^2.29.1",
79-
"eslint-plugin-jest": "^27.9.0",
80-
"eslint-plugin-jsdoc": "^48.5.0",
81-
"eslint-plugin-n": "^16.6.2",
82-
"eslint-plugin-prettier": "^5.1.3",
83-
"eslint-plugin-promise": "^6.4.0",
84-
"jest": "^29.7.0",
85-
"prettier": "^3.3.2",
86-
"prettier-plugin-packagejson": "^2.5.0",
87-
"rimraf": "^5.0.7",
88-
"ts-jest": "^29.1.5",
89-
"ts-node": "^10.9.2",
90-
"typescript": "^5.5.3",
91-
"zod": "^3.23.8"
55+
"@lavamoat/allow-scripts": "3.3.4",
56+
"@lavamoat/preinstall-always-fail": "2.1.1",
57+
"@metamask/auto-changelog": "5.0.2",
58+
"@metamask/eslint-config": "12.2.0",
59+
"@metamask/eslint-config-jest": "12.1.0",
60+
"@metamask/eslint-config-nodejs": "12.1.0",
61+
"@metamask/eslint-config-typescript": "12.1.0",
62+
"@metamask/rpc-errors": "7.0.3",
63+
"@metamask/snaps-cli": "8.1.1",
64+
"@metamask/snaps-controllers": "14.1.0",
65+
"@metamask/snaps-jest": "9.3.0",
66+
"@metamask/snaps-sdk": "8.1.0",
67+
"@metamask/utils": "11.4.2",
68+
"@noble/ciphers": "1.3.0",
69+
"@noble/curves": "1.9.2",
70+
"@noble/hashes": "1.8.0",
71+
"@types/jest": "29.5.14",
72+
"@types/node": "24.0.14",
73+
"@typescript-eslint/eslint-plugin": "7.18.0",
74+
"@typescript-eslint/parser": "7.18.0",
75+
"depcheck": "1.4.7",
76+
"eslint": "8.57.1",
77+
"eslint-config-prettier": "9.1.0",
78+
"eslint-plugin-import": "2.32.0",
79+
"eslint-plugin-jest": "27.9.0",
80+
"eslint-plugin-jsdoc": "48.11.0",
81+
"eslint-plugin-n": "16.6.2",
82+
"eslint-plugin-prettier": "5.5.1",
83+
"eslint-plugin-promise": "6.6.0",
84+
"jest": "29.7.0",
85+
"prettier": "3.6.2",
86+
"prettier-plugin-packagejson": "2.5.18",
87+
"rimraf": "6.0.1",
88+
"ts-jest": "29.4.0",
89+
"ts-node": "10.9.2",
90+
"typescript": "5.8.3",
91+
"zod": "3.25.76"
9292
},
9393
"packageManager": "[email protected]",
9494
"engines": {
95-
"node": "^18.18 || >=20"
95+
"node": "^20 || >=22"
9696
},
9797
"publishConfig": {
9898
"access": "public",
@@ -103,7 +103,8 @@
103103
"@lavamoat/preinstall-always-fail": false,
104104
"@metamask/snaps-jest>@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>keccak": false,
105105
"@metamask/snaps-jest>@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>secp256k1": false,
106-
"ts-node>@swc/core": false
106+
"ts-node>@swc/core": false,
107+
"jest>@jest/core>jest-resolve>unrs-resolver": false
107108
}
108109
}
109110
}

snap.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { SnapConfig } from '@metamask/snaps-cli';
44
import { resolve } from 'path';
55

66
const config: SnapConfig = {
7-
bundler: 'webpack',
87
input: resolve(__dirname, 'src/index.ts'),
98
server: {
109
port: 8080,

snap.manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/message-signing-snap.git"
88
},
99
"source": {
10-
"shasum": "HWZ8hcJfaFq0sleE9d/eGuHTQou3kaBneWbSa24ubls=",
10+
"shasum": "uxT3GTjwIHdy570UipoaQR/Ids6HT/xYWTYvsw74k4o=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",
@@ -31,6 +31,6 @@
3131
"snaps": true
3232
}
3333
},
34-
"platformVersion": "6.19.0",
34+
"platformVersion": "8.1.0",
3535
"manifestVersion": "0.1"
3636
}

src/utils/ERC1024.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe('errors:', () => {
156156
ciphertext: 'SOLw4OmDAhhQJf20Wk9uQbe60x1XpZIwYeMU',
157157
};
158158
expect(() => ERC1024.decrypt(encrypted as any, receiverSecret)).toThrow(
159-
'Uint8Array expected of length 24, not of length=9',
159+
'Uint8Array expected of length 24, got length=9',
160160
);
161161
});
162162

src/utils/nacl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { randomBytes } from '@noble/ciphers/crypto';
21
import { hsalsa, secretbox } from '@noble/ciphers/salsa';
32
import { u32, u8 } from '@noble/ciphers/utils';
3+
import { randomBytes } from '@noble/ciphers/webcrypto';
44
import { x25519 } from '@noble/curves/ed25519';
55

66
const PUBLIC_KEY_BYTES = 32;

0 commit comments

Comments
 (0)