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
This commit is contained in:
parent
cdb699d812
commit
713e86e877
|
@ -52,7 +52,6 @@
|
||||||
"@types/mz": "^2.7.3",
|
"@types/mz": "^2.7.3",
|
||||||
"@types/node": "^17.0.24",
|
"@types/node": "^17.0.24",
|
||||||
"@types/node-fetch": "2",
|
"@types/node-fetch": "2",
|
||||||
"@types/secp256k1": "^4.0.1",
|
|
||||||
"@types/sinon": "^10.0.0",
|
"@types/sinon": "^10.0.0",
|
||||||
"@types/sinon-chai": "^3.2.8",
|
"@types/sinon-chai": "^3.2.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.14.2",
|
"@typescript-eslint/eslint-plugin": "^4.14.2",
|
||||||
|
@ -3741,15 +3740,6 @@
|
||||||
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
|
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/secp256k1": {
|
|
||||||
"version": "4.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz",
|
|
||||||
"integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/sinon": {
|
"node_modules/@types/sinon": {
|
||||||
"version": "10.0.11",
|
"version": "10.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz",
|
||||||
|
@ -10822,6 +10812,8 @@
|
||||||
},
|
},
|
||||||
"node_modules/npm/node_modules/debug/node_modules/ms": {
|
"node_modules/npm/node_modules/debug/node_modules/ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
@ -12396,6 +12388,8 @@
|
||||||
},
|
},
|
||||||
"node_modules/npm/node_modules/semver/node_modules/lru-cache": {
|
"node_modules/npm/node_modules/semver/node_modules/lru-cache": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
@ -19382,15 +19376,6 @@
|
||||||
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
|
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/secp256k1": {
|
|
||||||
"version": "4.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz",
|
|
||||||
"integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@types/sinon": {
|
"@types/sinon": {
|
||||||
"version": "10.0.11",
|
"version": "10.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz",
|
||||||
|
@ -24660,6 +24645,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
|
@ -25831,6 +25818,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": {
|
"lru-cache": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|
|
@ -100,7 +100,6 @@
|
||||||
"@types/mz": "^2.7.3",
|
"@types/mz": "^2.7.3",
|
||||||
"@types/node": "^17.0.24",
|
"@types/node": "^17.0.24",
|
||||||
"@types/node-fetch": "2",
|
"@types/node-fetch": "2",
|
||||||
"@types/secp256k1": "^4.0.1",
|
|
||||||
"@types/sinon": "^10.0.0",
|
"@types/sinon": "^10.0.0",
|
||||||
"@types/sinon-chai": "^3.2.8",
|
"@types/sinon-chai": "^3.2.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.14.2",
|
"@typescript-eslint/eslint-plugin": "^4.14.2",
|
||||||
|
|
|
@ -95,6 +95,9 @@ function generateConfig(configType, format) {
|
||||||
// Prevent dependencies from being bundled
|
// Prevent dependencies from being bundled
|
||||||
config.external = [
|
config.external = [
|
||||||
/@babel\/runtime/,
|
/@babel\/runtime/,
|
||||||
|
'@noble/hashes/hmac',
|
||||||
|
'@noble/hashes/sha256',
|
||||||
|
'@noble/secp256k1',
|
||||||
'@solana/buffer-layout',
|
'@solana/buffer-layout',
|
||||||
'bigint-buffer',
|
'bigint-buffer',
|
||||||
'bn.js',
|
'bn.js',
|
||||||
|
@ -106,7 +109,6 @@ function generateConfig(configType, format) {
|
||||||
'js-sha3',
|
'js-sha3',
|
||||||
'node-fetch',
|
'node-fetch',
|
||||||
'rpc-websockets',
|
'rpc-websockets',
|
||||||
'secp256k1',
|
|
||||||
'superstruct',
|
'superstruct',
|
||||||
'tweetnacl',
|
'tweetnacl',
|
||||||
];
|
];
|
||||||
|
@ -159,6 +161,9 @@ function generateConfig(configType, format) {
|
||||||
config.external = [
|
config.external = [
|
||||||
/@babel\/runtime/,
|
/@babel\/runtime/,
|
||||||
'@solana/buffer-layout',
|
'@solana/buffer-layout',
|
||||||
|
'@noble/hashes/hmac',
|
||||||
|
'@noble/hashes/sha256',
|
||||||
|
'@noble/secp256k1',
|
||||||
'bigint-buffer',
|
'bigint-buffer',
|
||||||
'bn.js',
|
'bn.js',
|
||||||
'borsh',
|
'borsh',
|
||||||
|
@ -172,7 +177,6 @@ function generateConfig(configType, format) {
|
||||||
'node-fetch',
|
'node-fetch',
|
||||||
'react-native-url-polyfill',
|
'react-native-url-polyfill',
|
||||||
'rpc-websockets',
|
'rpc-websockets',
|
||||||
'secp256k1',
|
|
||||||
'superstruct',
|
'superstruct',
|
||||||
'tweetnacl',
|
'tweetnacl',
|
||||||
];
|
];
|
||||||
|
@ -180,11 +184,6 @@ function generateConfig(configType, format) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Find a workaround to avoid resolving the following JSON file:
|
|
||||||
// `node_modules/secp256k1/node_modules/elliptic/package.json`
|
|
||||||
config.plugins.push(json());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'node':
|
case 'node':
|
||||||
config.output = [
|
config.output = [
|
||||||
|
|
|
@ -1347,12 +1347,12 @@
|
||||||
|
|
||||||
"@noble/hashes@^1.1.2":
|
"@noble/hashes@^1.1.2":
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183"
|
resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz"
|
||||||
integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==
|
integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==
|
||||||
|
|
||||||
"@noble/secp256k1@^1.6.3":
|
"@noble/secp256k1@^1.6.3":
|
||||||
version "1.6.3"
|
version "1.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94"
|
resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz"
|
||||||
integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==
|
integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
|
@ -2084,13 +2084,6 @@
|
||||||
resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz"
|
resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz"
|
||||||
integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==
|
integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==
|
||||||
|
|
||||||
"@types/secp256k1@^4.0.1":
|
|
||||||
version "4.0.3"
|
|
||||||
resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz"
|
|
||||||
integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "*"
|
|
||||||
|
|
||||||
"@types/sinon-chai@^3.2.8":
|
"@types/sinon-chai@^3.2.8":
|
||||||
version "3.2.8"
|
version "3.2.8"
|
||||||
resolved "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.8.tgz"
|
resolved "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.8.tgz"
|
||||||
|
@ -8365,19 +8358,26 @@ unique-filename@^1.1.1:
|
||||||
unique-slug "^2.0.0"
|
unique-slug "^2.0.0"
|
||||||
|
|
||||||
unique-filename@^2.0.0:
|
unique-filename@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.0.tgz#c844c84c3b22e92038b0c53950f9dc34d2b55490"
|
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2"
|
||||||
integrity sha512-tpzoz2RpZ//6Zt4GPpOFTyrnfZuSvjIfe8lvx6Thp4yTQwJtAFwPlssEBE62VhGA2We5/COyNpcIu+OABu3/Yg==
|
integrity sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==
|
||||||
dependencies:
|
dependencies:
|
||||||
unique-slug "^2.0.2"
|
unique-slug "^3.0.0"
|
||||||
|
|
||||||
unique-slug@^2.0.0, unique-slug@^2.0.2:
|
unique-slug@^2.0.0:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c"
|
resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"
|
||||||
integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==
|
integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==
|
||||||
dependencies:
|
dependencies:
|
||||||
imurmurhash "^0.1.4"
|
imurmurhash "^0.1.4"
|
||||||
|
|
||||||
|
unique-slug@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-3.0.0.tgz#6d347cf57c8a7a7a6044aabd0e2d74e4d76dc7c9"
|
||||||
|
integrity sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==
|
||||||
|
dependencies:
|
||||||
|
imurmurhash "^0.1.4"
|
||||||
|
|
||||||
unique-string@^2.0.0:
|
unique-string@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz"
|
resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz"
|
||||||
|
|
Loading…
Reference in New Issue