Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit ef5a6da

Browse files
authored
Update rollup script to exclude new secp256k1 and hmac/sha256 dependencies (#27428)
* fix: repair build script, not to bundle @noble libraries but to keep them as external deps * chore: remove secp256k1 Typescript types
1 parent f8b5608 commit ef5a6da

File tree

4 files changed

+29
-42
lines changed

4 files changed

+29
-42
lines changed

package-lock.json

+8-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
"@types/mz": "^2.7.3",
101101
"@types/node": "^17.0.24",
102102
"@types/node-fetch": "2",
103-
"@types/secp256k1": "^4.0.1",
104103
"@types/sinon": "^10.0.0",
105104
"@types/sinon-chai": "^3.2.8",
106105
"@typescript-eslint/eslint-plugin": "^4.14.2",

rollup.config.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ function generateConfig(configType, format) {
9595
// Prevent dependencies from being bundled
9696
config.external = [
9797
/@babel\/runtime/,
98+
'@noble/hashes/hmac',
99+
'@noble/hashes/sha256',
100+
'@noble/secp256k1',
98101
'@solana/buffer-layout',
99102
'bigint-buffer',
100103
'bn.js',
@@ -106,7 +109,6 @@ function generateConfig(configType, format) {
106109
'js-sha3',
107110
'node-fetch',
108111
'rpc-websockets',
109-
'secp256k1',
110112
'superstruct',
111113
'tweetnacl',
112114
];
@@ -159,6 +161,9 @@ function generateConfig(configType, format) {
159161
config.external = [
160162
/@babel\/runtime/,
161163
'@solana/buffer-layout',
164+
'@noble/hashes/hmac',
165+
'@noble/hashes/sha256',
166+
'@noble/secp256k1',
162167
'bigint-buffer',
163168
'bn.js',
164169
'borsh',
@@ -172,19 +177,13 @@ function generateConfig(configType, format) {
172177
'node-fetch',
173178
'react-native-url-polyfill',
174179
'rpc-websockets',
175-
'secp256k1',
176180
'superstruct',
177181
'tweetnacl',
178182
];
179183

180184
break;
181185
}
182186
}
183-
184-
// TODO: Find a workaround to avoid resolving the following JSON file:
185-
// `node_modules/secp256k1/node_modules/elliptic/package.json`
186-
config.plugins.push(json());
187-
188187
break;
189188
case 'node':
190189
config.output = [

yarn.lock

+15-15
Original file line numberDiff line numberDiff line change
@@ -1347,12 +1347,12 @@
13471347

13481348
"@noble/hashes@^1.1.2":
13491349
version "1.1.2"
1350-
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183"
1350+
resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz"
13511351
integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==
13521352

13531353
"@noble/secp256k1@^1.6.3":
13541354
version "1.6.3"
1355-
resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94"
1355+
resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz"
13561356
integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==
13571357

13581358
"@nodelib/fs.scandir@2.1.5":
@@ -2084,13 +2084,6 @@
20842084
resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz"
20852085
integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==
20862086

2087-
"@types/secp256k1@^4.0.1":
2088-
version "4.0.3"
2089-
resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz"
2090-
integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==
2091-
dependencies:
2092-
"@types/node" "*"
2093-
20942087
"@types/sinon-chai@^3.2.8":
20952088
version "3.2.8"
20962089
resolved "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.8.tgz"
@@ -8365,19 +8358,26 @@ unique-filename@^1.1.1:
83658358
unique-slug "^2.0.0"
83668359

83678360
unique-filename@^2.0.0:
8368-
version "2.0.0"
8369-
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.0.tgz#c844c84c3b22e92038b0c53950f9dc34d2b55490"
8370-
integrity sha512-tpzoz2RpZ//6Zt4GPpOFTyrnfZuSvjIfe8lvx6Thp4yTQwJtAFwPlssEBE62VhGA2We5/COyNpcIu+OABu3/Yg==
8361+
version "2.0.1"
8362+
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2"
8363+
integrity sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==
83718364
dependencies:
8372-
unique-slug "^2.0.2"
8365+
unique-slug "^3.0.0"
83738366

8374-
unique-slug@^2.0.0, unique-slug@^2.0.2:
8367+
unique-slug@^2.0.0:
83758368
version "2.0.2"
8376-
resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c"
8369+
resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"
83778370
integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==
83788371
dependencies:
83798372
imurmurhash "^0.1.4"
83808373

8374+
unique-slug@^3.0.0:
8375+
version "3.0.0"
8376+
resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-3.0.0.tgz#6d347cf57c8a7a7a6044aabd0e2d74e4d76dc7c9"
8377+
integrity sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==
8378+
dependencies:
8379+
imurmurhash "^0.1.4"
8380+
83818381
unique-string@^2.0.0:
83828382
version "2.0.0"
83838383
resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz"

0 commit comments

Comments
 (0)