Skip to content

Commit

Permalink
fix: update bundle settings and make sure it works in nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
mordochi committed Feb 6, 2024
1 parent b03da36 commit 856bf01
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 41 deletions.
7 changes: 3 additions & 4 deletions packages/dappauth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"author": "Pazams <[email protected]>",
"license": "MIT",
"dependencies": {
"ethereumjs-abi": "^0.6.6",
"ethereumjs-util": "^7.1.5",
"safe-buffer": "^5.1.2",
"web3": "^1.3.1"
},
"devDependencies": {
Expand All @@ -44,13 +42,14 @@
"eslint": "^8.42.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"ethereumjs-abi": "^0.6.8",
"jest": "^29.7.0",
"onchange": "^7.1.0",
"prettier": "^1.14.3",
"rollup": "^3.29.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup-plugin-terser": "^7.0.2"
"rollup-plugin-polyfill-node": "^0.13.0",
"safe-buffer": "^5.2.1"
}
}
5 changes: 3 additions & 2 deletions packages/dappauth/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default [
name: 'DappAuth',
exports: 'auto',
},
external: ['ethereumjs-util', 'web3'],
plugins: [
copy({
targets: [
Expand All @@ -23,7 +24,6 @@ export default [
}),
commonjs(),
resolve({
browser: true,
preferBuiltins: true,
}),
json(),
Expand All @@ -41,6 +41,7 @@ export default [
format: 'es',
name: 'DappAuth',
},
external: ['ethereumjs-util', 'web3'],
plugins: [
copy({
targets: [
Expand All @@ -50,7 +51,6 @@ export default [
}),
commonjs(),
resolve({
browser: true,
preferBuiltins: true,
}),
json(),
Expand All @@ -65,6 +65,7 @@ export default [
format: 'umd',
name: 'DappAuth',
},
external: ['ethereumjs-util', 'web3'],
plugins: [
copy({
targets: [
Expand Down
65 changes: 30 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,15 @@
estree-walker "^2.0.2"
magic-string "^0.27.0"

"@rollup/plugin-inject@^5.0.4":
version "5.0.5"
resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz#616f3a73fe075765f91c5bec90176608bed277a3"
integrity sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==
dependencies:
"@rollup/pluginutils" "^5.0.1"
estree-walker "^2.0.2"
magic-string "^0.30.3"

"@rollup/plugin-node-resolve@^15.1.0", "@rollup/plugin-node-resolve@^15.2.1":
version "15.2.1"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.1.tgz"
Expand Down Expand Up @@ -3278,7 +3287,7 @@

"@types/bn.js@^4.11.3":
version "4.11.6"
resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c"
integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==
dependencies:
"@types/node" "*"
Expand Down Expand Up @@ -6641,17 +6650,17 @@ ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2:
"@scure/bip32" "1.3.1"
"@scure/bip39" "1.2.1"

ethereumjs-abi@^0.6.6:
ethereumjs-abi@^0.6.8:
version "0.6.8"
resolved "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz"
resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae"
integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==
dependencies:
bn.js "^4.11.8"
ethereumjs-util "^6.0.0"

ethereumjs-util@^6.0.0:
version "6.2.1"
resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69"
integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==
dependencies:
"@types/bn.js" "^4.11.3"
Expand Down Expand Up @@ -6683,7 +6692,7 @@ [email protected]:

[email protected]:
version "0.1.6"
resolved "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz"
resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536"
integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==
dependencies:
is-hex-prefixed "1.0.0"
Expand Down Expand Up @@ -9336,13 +9345,6 @@ lru-cache@^6.0.0:
resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz"
integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==

magic-string@^0.25.3:
version "0.25.9"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz"
integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==
dependencies:
sourcemap-codec "^1.4.8"

magic-string@^0.27.0:
version "0.27.0"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz"
Expand All @@ -9364,6 +9366,13 @@ magic-string@^0.30.2:
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"

magic-string@^0.30.3:
version "0.30.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.7.tgz#0cecd0527d473298679da95a2d7aeb8c64048505"
integrity sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"

magic-string@^0.30.5:
version "0.30.5"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9"
Expand Down Expand Up @@ -11195,29 +11204,13 @@ rollup-plugin-dts@^5.3.0:
optionalDependencies:
"@babel/code-frame" "^7.22.5"

rollup-plugin-inject@^3.0.0:
version "3.0.2"
resolved "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz"
integrity sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==
dependencies:
estree-walker "^0.6.1"
magic-string "^0.25.3"
rollup-pluginutils "^2.8.1"

rollup-plugin-json@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz"
integrity sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==
dependencies:
rollup-pluginutils "^2.5.0"

rollup-plugin-node-polyfills@^0.2.1:
version "0.2.1"
resolved "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz"
integrity sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==
dependencies:
rollup-plugin-inject "^3.0.0"

rollup-plugin-peer-deps-external@^2.2.4:
version "2.2.4"
resolved "https://registry.npmjs.org/rollup-plugin-peer-deps-external/-/rollup-plugin-peer-deps-external-2.2.4.tgz"
Expand All @@ -11230,6 +11223,13 @@ rollup-plugin-polyfill-node@^0.12.0:
dependencies:
"@rollup/plugin-inject" "^5.0.1"

rollup-plugin-polyfill-node@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.13.0.tgz#28e5705b59438da894e55133a0fe7a86b57d9b0a"
integrity sha512-FYEvpCaD5jGtyBuBFcQImEGmTxDTPbiHjJdrYIp+mFIwgXiXabxvKUK7ZT9P31ozu2Tqm9llYQMRWsfvTMTAOw==
dependencies:
"@rollup/plugin-inject" "^5.0.4"

rollup-plugin-terser@^7.0.2:
version "7.0.2"
resolved "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz"
Expand Down Expand Up @@ -11259,7 +11259,7 @@ rollup-plugin-visualizer@^5.5.4:
source-map "^0.7.4"
yargs "^17.5.1"

rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1:
rollup-pluginutils@^2.5.0:
version "2.8.2"
resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz"
integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==
Expand Down Expand Up @@ -11339,7 +11339,7 @@ [email protected], safe-buffer@~5.1.0, safe-buffer@~5.1.1:

[email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==

safe-json-utils@^1.1.1:
Expand Down Expand Up @@ -11719,11 +11719,6 @@ source-map@^0.7.4:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==

sourcemap-codec@^1.4.8:
version "1.4.8"
resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz"
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==

spawndamnit@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz"
Expand Down

0 comments on commit 856bf01

Please sign in to comment.