From 405031d431d56d9eea5654bf39dfec36b2627099 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 22 Nov 2022 11:53:36 -0500 Subject: [PATCH 01/29] adding webpack 5 --- package.json | 10 +++++++--- webpack.config.js | 25 ++++++++++++++++++------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d1fe647f5b9..40d181c8580 100644 --- a/package.json +++ b/package.json @@ -110,8 +110,8 @@ "bundlesize": "^0.18.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", - "clean-webpack-plugin": "^3.0.0", "core-js": "^3.6.5", + "crypto-browserify": "^3.12.0", "crypto-js": "^3.3.0", "decache": "^4.6.0", "dependency-check": "^4.1.0", @@ -119,6 +119,7 @@ "ethers": "^5.4.4", "fetch-mock": "^9.11.0", "ganache-cli": "^6.12.0", + "https-browserify": "^1.0.0", "jshint": "^2.12.0", "karma": "^6.3.19", "karma-browserify": "^7.0.0", @@ -130,12 +131,15 @@ "mocha": "^6.2.3", "nyc": "^14.1.1", "pify": "^4.0.1", + "process": "^0.11.10", "rimraf": "^3.0.2", "sandboxed-module": "^2.0.4", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", "ts-node": "^9.0.0", "typescript": "^3.9.7", "wait-port": "^0.2.9", - "webpack": "^4.44.2", - "webpack-cli": "^4.9.1" + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index 1b16d73ca1f..c020ce4dafe 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,10 +1,5 @@ const path = require("path"); const webpack = require("webpack"); -const { CleanWebpackPlugin } = require("clean-webpack-plugin"); -// https://github.com/webpack/webpack/issues/13572#issuecomment-923736472 -const crypto = require("crypto"); -const crypto_createHash_alg = crypto.createHash; -crypto.createHash = (algorithm, options ) => crypto_createHash_alg(algorithm == "md4" ? "sha256" : algorithm, options); module.exports = { mode: "production", @@ -12,7 +7,6 @@ module.exports = { web3: "./packages/web3/lib/index.js", }, plugins: [ - new CleanWebpackPlugin(), new webpack.SourceMapDevToolPlugin({ filename: "[file].map", }), @@ -28,8 +22,24 @@ module.exports = { // To avoid blotting up the `bn.js` library all over the packages // use single library instance. "bn.js": path.resolve(__dirname, 'node_modules/bn.js') - } + }, + fallback: { + buffer: require.resolve('buffer'), + https: require.resolve('https-browserify'), + http: require.resolve("stream-http"), + stream: require.resolve("stream-browserify"), + crypto: require.resolve("crypto-browserify"), + }, + }, + plugins: [ + new webpack.ProvidePlugin({ + process: 'process/browser', + }), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }), + ], module: { rules: [ { @@ -63,5 +73,6 @@ module.exports = { path: path.resolve(__dirname, "dist"), library: "Web3", libraryTarget: "umd", + clean: true, }, }; From 5d4c7b8d9d8065b56e087d2aa8cea2b154f92ab9 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 23 Nov 2022 11:04:48 -0500 Subject: [PATCH 02/29] updating --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index 40d181c8580..f3b05c50da1 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,12 @@ "ts-node": "^9.0.0", "typescript": "^3.9.7", "wait-port": "^0.2.9", +<<<<<<< Updated upstream "webpack": "^5.75.0", "webpack-cli": "^5.0.0" +======= + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" +>>>>>>> Stashed changes } } From 83bd4d7b50db763dc103b250da7a723b8522858e Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 24 Nov 2022 12:15:01 -0500 Subject: [PATCH 03/29] updating webpack config --- webpack.config.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index c020ce4dafe..3863b85807f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,5 @@ const path = require("path"); const webpack = require("webpack"); - module.exports = { mode: "production", entry: { @@ -16,7 +15,13 @@ module.exports = { return /(.*\/genesisStates\/.*\.json)/.test(resource) }, }), - ], + new webpack.ProvidePlugin({ + process: 'process/browser', + }), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }), + ], resolve: { alias: { // To avoid blotting up the `bn.js` library all over the packages @@ -32,14 +37,7 @@ module.exports = { }, }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser', - }), - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'], - }), - ], + module: { rules: [ { From e49729812eb73bc982ca52f7f22249d2ef9ec3a2 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 24 Nov 2022 14:18:10 -0500 Subject: [PATCH 04/29] updating to webpack 5 --- package.json | 291 +++++++++++++++++++++++++-------------------------- 1 file changed, 143 insertions(+), 148 deletions(-) diff --git a/package.json b/package.json index f3b05c50da1..29397d07f24 100644 --- a/package.json +++ b/package.json @@ -1,150 +1,145 @@ { - "name": "web3.js", - "private": true, - "description": "Ethereum JavaScript API wrapper repository", - "license": "LGPL-3.0", - "engines": { - "node": ">=11.0.0" - }, - "main": "./packages/web3/src/index.js", - "bundlesize": [ - { - "path": "./packages/web3/dist/web3.min.js", - "maxSize": "1.5 mB", - "compression": "none" - } - ], - "scripts": { - "version": "npm run build", - "postinstall": "npm run bootstrap", - "build": "npm run bootstrap && lerna run compile && webpack && cp -r ./dist ./packages/web3", - "publish": "lerna publish", - "bootstrap": "lerna bootstrap --hoist", - "lint": "jshint *.js packages", - "test": "mocha -R spec --require ts-node/register --grep E2E --invert", - "test:unit": "nyc --no-clean --silent _mocha -- -R spec --require ts-node/register --grep E2E --invert --exit", - "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", - "dtslint": "lerna run dtslint", - "depcheck": "lerna exec dependency-check -- --missing --verbose .", - "bundlesize": "bundlesize || true", - "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", - "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", - "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", - "test:e2e:geth:insta": "bash ./scripts/e2e.geth.instamine.sh", - "test:e2e:clients": "npm run test:e2e:ganache && npm run test:e2e:geth:insta && npm run test:e2e:geth:auto", - "test:e2e:chrome": "bash ./scripts/e2e.chrome.sh", - "test:e2e:firefox": "bash ./scripts/e2e.firefox.sh", - "test:e2e:min": "bash ./scripts/e2e.min.sh", - "test:e2e:cdn": "bash ./scripts/e2e.cdn.sh", - "test:e2e:browsers": "npm run build && npm run test:e2e:chrome && npm run test:e2e:firefox", - "test:e2e:publish": "bash ./scripts/e2e.npm.publish.sh", - "test:e2e:truffle": "bash ./scripts/e2e.truffle.sh", - "test:e2e:mosaic": "bash ./scripts/e2e.mosaic.sh", - "test:e2e:ganache:core": "bash ./scripts/e2e.ganache.core.sh", - "test:e2e:gnosis:dex": "bash ./scripts/e2e.gnosis.dex.sh", - "ci": "bash ./scripts/ci.sh", - "cov:clean": "rimraf .nyc_output && rimraf coverage", - "cov:merge_reports": "nyc report --reporter=lcov --reporter=html" - }, - "repository": { - "type": "git", - "url": "https://github.com/ethereum/web3.js.git" - }, - "homepage": "https://github.com/ethereum/web3.js", - "bugs": { - "url": "https://github.com/ethereum/web3.js/issues" - }, - "keywords": [ - "Ethereum", - "JavaScript", - "API" - ], - "author": "ethereum.org", - "authors": [ - { - "name": "Fabian Vogelsteller", - "email": "fabian@ethereum.org", - "homepage": "https://github.com/frozeman" - }, - { - "name": "Marek Kotewicz", - "email": "marek@parity.io", - "url": "https://github.com/debris" - }, - { - "name": "Marian Oancea", - "url": "https://github.com/cubedro" - }, - { - "name": "Gav Wood", - "email": "g@parity.io", - "homepage": "http://gavwood.com" - }, - { - "name": "Jeffery Wilcke", - "email": "jeffrey.wilcke@ethereum.org", - "url": "https://github.com/obscuren" - } - ], - "devDependencies": { - "@babel/cli": "^7.12.1", - "@babel/core": "^7.12.3", - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@babel/plugin-transform-modules-commonjs": "^7.12.1", - "@babel/plugin-transform-runtime": "^7.12.1", - "@babel/preset-env": "^7.12.1", - "@babel/preset-typescript": "^7.12.1", - "@babel/runtime": "^7.12.1", - "@chainsafe/geth-dev-assistant": "^0.1.10", - "@ensdomains/ens": "^0.6.0", - "@ensdomains/resolver": "^0.2.4", - "@types/bignumber.js": "^4.0.2", - "@types/bn.js": "^5.1.0", - "@types/node": "^12.12.68", - "@types/prettier": "2.6.0", - "babel-loader": "^8.1.0", - "bignumber.js": "^9.0.1", - "bn.js": "^5.2.1", - "browserify": "^16.5.2", - "buffer": "^4.9.2", - "bundlesize": "^0.18.0", - "chai": "^4.2.0", - "chai-as-promised": "^7.1.1", - "core-js": "^3.6.5", - "crypto-browserify": "^3.12.0", - "crypto-js": "^3.3.0", - "decache": "^4.6.0", - "dependency-check": "^4.1.0", - "ethereumjs-util": "^7.1.0", - "ethers": "^5.4.4", - "fetch-mock": "^9.11.0", - "ganache-cli": "^6.12.0", - "https-browserify": "^1.0.0", - "jshint": "^2.12.0", - "karma": "^6.3.19", - "karma-browserify": "^7.0.0", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^1.3.0", - "karma-mocha": "^2.0.1", - "karma-spec-reporter": "0.0.32", - "lerna": "^4.0.0", - "mocha": "^6.2.3", - "nyc": "^14.1.1", - "pify": "^4.0.1", - "process": "^0.11.10", - "rimraf": "^3.0.2", - "sandboxed-module": "^2.0.4", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "ts-node": "^9.0.0", - "typescript": "^3.9.7", - "wait-port": "^0.2.9", -<<<<<<< Updated upstream - "webpack": "^5.75.0", - "webpack-cli": "^5.0.0" -======= - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" ->>>>>>> Stashed changes - } + "name": "web3.js", + "private": true, + "description": "Ethereum JavaScript API wrapper repository", + "license": "LGPL-3.0", + "engines": { + "node": ">=11.0.0" + }, + "main": "./packages/web3/src/index.js", + "bundlesize": [ + { + "path": "./packages/web3/dist/web3.min.js", + "maxSize": "1.5 mB", + "compression": "none" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/ethereum/web3.js.git" + }, + "homepage": "https://github.com/ethereum/web3.js", + "bugs": { + "url": "https://github.com/ethereum/web3.js/issues" + }, + "keywords": [ + "Ethereum", + "JavaScript", + "API" + ], + "author": "ethereum.org", + "authors": [ + { + "name": "Fabian Vogelsteller", + "email": "fabian@ethereum.org", + "homepage": "https://github.com/frozeman" + }, + { + "name": "Marek Kotewicz", + "email": "marek@parity.io", + "url": "https://github.com/debris" + }, + { + "name": "Marian Oancea", + "url": "https://github.com/cubedro" + }, + { + "name": "Gav Wood", + "email": "g@parity.io", + "homepage": "http://gavwood.com" + }, + { + "name": "Jeffery Wilcke", + "email": "jeffrey.wilcke@ethereum.org", + "url": "https://github.com/obscuren" + } + ], + "devDependencies": { + "@babel/cli": "^7.12.1", + "@babel/core": "^7.12.3", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-runtime": "^7.12.1", + "@babel/preset-env": "^7.12.1", + "@babel/preset-typescript": "^7.12.1", + "@babel/runtime": "^7.12.1", + "@chainsafe/geth-dev-assistant": "^0.1.10", + "@ensdomains/ens": "^0.6.0", + "@ensdomains/resolver": "^0.2.4", + "@types/bignumber.js": "^4.0.2", + "@types/bn.js": "^5.1.0", + "@types/node": "^12.12.68", + "@types/prettier": "2.6.0", + "babel-loader": "^8.1.0", + "bignumber.js": "^9.0.1", + "bn.js": "^5.2.1", + "browserify": "^16.5.2", + "buffer": "^4.9.2", + "bundlesize": "^0.18.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "core-js": "^3.6.5", + "crypto-browserify": "^3.12.0", + "crypto-js": "^3.3.0", + "decache": "^4.6.0", + "dependency-check": "^4.1.0", + "ethereumjs-util": "^7.1.0", + "ethers": "^5.4.4", + "fetch-mock": "^9.11.0", + "ganache-cli": "^6.12.0", + "https-browserify": "^1.0.0", + "jshint": "^2.12.0", + "karma": "^6.3.19", + "karma-browserify": "^7.0.0", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^1.3.0", + "karma-mocha": "^2.0.1", + "karma-spec-reporter": "0.0.32", + "lerna": "^4.0.0", + "mocha": "^6.2.3", + "nyc": "^14.1.1", + "pify": "^4.0.1", + "process": "^0.11.10", + "rimraf": "^3.0.2", + "sandboxed-module": "^2.0.4", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "ts-node": "^9.0.0", + "typescript": "^3.9.7", + "wait-port": "^0.2.9", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0" + }, + "dependencies": { + "@chainsafe/lodestar-types": "^0.13.0", + "@ethereumjs/common": "2.5.0", + "@ethereumjs/tx": "3.3.2", + "@ethersproject/abi": "^5.6.3", + "@ethersproject/transactions": "^5.6.2", + "@types/jest": "^26.0.14", + "abortcontroller-polyfill": "^1.7.3", + "axios": "^0.21.1", + "babel-jest": "^26.6.3", + "content-hash": "^2.5.2", + "cross-fetch": "^3.1.4", + "dtslint": "^3.4.1", + "es6-promise": "^4.2.8", + "eth-ens-namehash": "2.0.8", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "eventemitter3": "4.0.4", + "got": "12.1.0", + "jest": "^26.5.3", + "number-to-bn": "1.7.0", + "oboe": "2.1.5", + "randombytes": "^2.1.0", + "scrypt-js": "^3.0.1", + "swarm-js": "^0.1.40", + "ts-jest": "^26.4.4", + "utf8": "3.0.0", + "util": "^0.12.0", + "uuid": "^9.0.0", + "websocket": "^1.0.32" + } } From 4797c9f589e8913849fdd792fbd9c0edf676aa69 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 24 Nov 2022 14:33:37 -0500 Subject: [PATCH 05/29] fixing scripts --- package.json | 142 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 87 insertions(+), 55 deletions(-) diff --git a/package.json b/package.json index 29397d07f24..160b5613d9e 100644 --- a/package.json +++ b/package.json @@ -1,59 +1,91 @@ { - "name": "web3.js", - "private": true, - "description": "Ethereum JavaScript API wrapper repository", - "license": "LGPL-3.0", - "engines": { - "node": ">=11.0.0" - }, - "main": "./packages/web3/src/index.js", - "bundlesize": [ - { - "path": "./packages/web3/dist/web3.min.js", - "maxSize": "1.5 mB", - "compression": "none" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/ethereum/web3.js.git" - }, - "homepage": "https://github.com/ethereum/web3.js", - "bugs": { - "url": "https://github.com/ethereum/web3.js/issues" - }, - "keywords": [ - "Ethereum", - "JavaScript", - "API" - ], - "author": "ethereum.org", - "authors": [ - { - "name": "Fabian Vogelsteller", - "email": "fabian@ethereum.org", - "homepage": "https://github.com/frozeman" - }, - { - "name": "Marek Kotewicz", - "email": "marek@parity.io", - "url": "https://github.com/debris" - }, - { - "name": "Marian Oancea", - "url": "https://github.com/cubedro" - }, - { - "name": "Gav Wood", - "email": "g@parity.io", - "homepage": "http://gavwood.com" - }, - { - "name": "Jeffery Wilcke", - "email": "jeffrey.wilcke@ethereum.org", - "url": "https://github.com/obscuren" - } - ], + "name": "web3.js", + "private": true, + "description": "Ethereum JavaScript API wrapper repository", + "license": "LGPL-3.0", + "engines": { + "node": ">=11.0.0" + }, + "main": "./packages/web3/src/index.js", + "bundlesize": [ + { + "path": "./packages/web3/dist/web3.min.js", + "maxSize": "1.5 mB", + "compression": "none" + } + ], + "scripts": { + "version": "npm run build", + "postinstall": "npm run bootstrap", + "build": "npm run bootstrap && lerna run compile && webpack && cp -r ./dist ./packages/web3", + "publish": "lerna publish", + "bootstrap": "lerna bootstrap --hoist", + "lint": "jshint *.js packages", + "test": "mocha -R spec --require ts-node/register --grep E2E --invert", + "test:unit": "nyc --no-clean --silent _mocha -- -R spec --require ts-node/register --grep E2E --invert --exit", + "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", + "dtslint": "lerna run dtslint", + "depcheck": "lerna exec dependency-check -- --missing --verbose .", + "bundlesize": "bundlesize || true", + "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", + "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", + "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", + "test:e2e:geth:insta": "bash ./scripts/e2e.geth.instamine.sh", + "test:e2e:clients": "npm run test:e2e:ganache && npm run test:e2e:geth:insta && npm run test:e2e:geth:auto", + "test:e2e:chrome": "bash ./scripts/e2e.chrome.sh", + "test:e2e:firefox": "bash ./scripts/e2e.firefox.sh", + "test:e2e:min": "bash ./scripts/e2e.min.sh", + "test:e2e:cdn": "bash ./scripts/e2e.cdn.sh", + "test:e2e:browsers": "npm run build && npm run test:e2e:chrome && npm run test:e2e:firefox", + "test:e2e:publish": "bash ./scripts/e2e.npm.publish.sh", + "test:e2e:truffle": "bash ./scripts/e2e.truffle.sh", + "test:e2e:mosaic": "bash ./scripts/e2e.mosaic.sh", + "test:e2e:ganache:core": "bash ./scripts/e2e.ganache.core.sh", + "test:e2e:gnosis:dex": "bash ./scripts/e2e.gnosis.dex.sh", + "ci": "bash ./scripts/ci.sh", + "cov:clean": "rimraf .nyc_output && rimraf coverage", + "cov:merge_reports": "nyc report --reporter=lcov --reporter=html" + }, + "repository": { + "type": "git", + "url": "https://github.com/ethereum/web3.js.git" + }, + "homepage": "https://github.com/ethereum/web3.js", + "bugs": { + "url": "https://github.com/ethereum/web3.js/issues" + }, + "keywords": [ + "Ethereum", + "JavaScript", + "API" + ], + "author": "ethereum.org", + "authors": [ + { + "name": "Fabian Vogelsteller", + "email": "fabian@ethereum.org", + "homepage": "https://github.com/frozeman" + }, + { + "name": "Marek Kotewicz", + "email": "marek@parity.io", + "url": "https://github.com/debris" + }, + { + "name": "Marian Oancea", + "url": "https://github.com/cubedro" + }, + { + "name": "Gav Wood", + "email": "g@parity.io", + "homepage": "http://gavwood.com" + }, + { + "name": "Jeffery Wilcke", + "email": "jeffrey.wilcke@ethereum.org", + "url": "https://github.com/obscuren" + } + ], "devDependencies": { "@babel/cli": "^7.12.1", "@babel/core": "^7.12.3", From 73df5ffb1e3d7770bbbe5f9270714a697cf2d113 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 24 Nov 2022 14:41:50 -0500 Subject: [PATCH 06/29] removing unused deps --- package.json | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/package.json b/package.json index 160b5613d9e..9b8f9da3aac 100644 --- a/package.json +++ b/package.json @@ -141,37 +141,5 @@ "wait-port": "^0.2.9", "webpack": "^5.75.0", "webpack-cli": "^5.0.0" - }, - "dependencies": { - "@chainsafe/lodestar-types": "^0.13.0", - "@ethereumjs/common": "2.5.0", - "@ethereumjs/tx": "3.3.2", - "@ethersproject/abi": "^5.6.3", - "@ethersproject/transactions": "^5.6.2", - "@types/jest": "^26.0.14", - "abortcontroller-polyfill": "^1.7.3", - "axios": "^0.21.1", - "babel-jest": "^26.6.3", - "content-hash": "^2.5.2", - "cross-fetch": "^3.1.4", - "dtslint": "^3.4.1", - "es6-promise": "^4.2.8", - "eth-ens-namehash": "2.0.8", - "eth-lib": "0.2.8", - "ethereum-bloom-filters": "^1.0.6", - "ethjs-unit": "0.1.6", - "eventemitter3": "4.0.4", - "got": "12.1.0", - "jest": "^26.5.3", - "number-to-bn": "1.7.0", - "oboe": "2.1.5", - "randombytes": "^2.1.0", - "scrypt-js": "^3.0.1", - "swarm-js": "^0.1.40", - "ts-jest": "^26.4.4", - "utf8": "3.0.0", - "util": "^0.12.0", - "uuid": "^9.0.0", - "websocket": "^1.0.32" } } From 09835b4c76ce4efa5d610b954b40aa4e63ef305b Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 25 Nov 2022 13:46:39 -0500 Subject: [PATCH 07/29] updating packages --- packages/web3-eth-accounts/package.json | 1 - packages/web3-eth-accounts/src/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index 8c360bd8ffd..3260e638e15 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -16,7 +16,6 @@ "dependencies": { "@ethereumjs/common": "2.5.0", "@ethereumjs/tx": "3.3.2", - "crypto-browserify": "3.12.0", "eth-lib": "0.2.8", "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index 39ecaa7f747..c673ddd132b 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -25,7 +25,7 @@ var core = require('web3-core'); var Method = require('web3-core-method'); var Account = require('eth-lib/lib/account'); -var cryp = (typeof global === 'undefined') ? require('crypto-browserify') : require('crypto'); +var cryp = require("crypto"); var scrypt = require('scrypt-js'); var uuid = require('uuid'); var utils = require('web3-utils'); From c785c92a621f837450bd4876a321c24f106458d1 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 25 Nov 2022 16:04:19 -0500 Subject: [PATCH 08/29] updating libraries --- package.json | 112 ++++++++++++------------ packages/web3-eth-accounts/package.json | 2 +- webpack.config.js | 10 +-- 3 files changed, 61 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 9b8f9da3aac..2d108581c2c 100644 --- a/package.json +++ b/package.json @@ -86,60 +86,60 @@ "url": "https://github.com/obscuren" } ], - "devDependencies": { - "@babel/cli": "^7.12.1", - "@babel/core": "^7.12.3", - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@babel/plugin-transform-modules-commonjs": "^7.12.1", - "@babel/plugin-transform-runtime": "^7.12.1", - "@babel/preset-env": "^7.12.1", - "@babel/preset-typescript": "^7.12.1", - "@babel/runtime": "^7.12.1", - "@chainsafe/geth-dev-assistant": "^0.1.10", - "@ensdomains/ens": "^0.6.0", - "@ensdomains/resolver": "^0.2.4", - "@types/bignumber.js": "^4.0.2", - "@types/bn.js": "^5.1.0", - "@types/node": "^12.12.68", - "@types/prettier": "2.6.0", - "babel-loader": "^8.1.0", - "bignumber.js": "^9.0.1", - "bn.js": "^5.2.1", - "browserify": "^16.5.2", - "buffer": "^4.9.2", - "bundlesize": "^0.18.0", - "chai": "^4.2.0", - "chai-as-promised": "^7.1.1", - "core-js": "^3.6.5", - "crypto-browserify": "^3.12.0", - "crypto-js": "^3.3.0", - "decache": "^4.6.0", - "dependency-check": "^4.1.0", - "ethereumjs-util": "^7.1.0", - "ethers": "^5.4.4", - "fetch-mock": "^9.11.0", - "ganache-cli": "^6.12.0", - "https-browserify": "^1.0.0", - "jshint": "^2.12.0", - "karma": "^6.3.19", - "karma-browserify": "^7.0.0", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^1.3.0", - "karma-mocha": "^2.0.1", - "karma-spec-reporter": "0.0.32", - "lerna": "^4.0.0", - "mocha": "^6.2.3", - "nyc": "^14.1.1", - "pify": "^4.0.1", - "process": "^0.11.10", - "rimraf": "^3.0.2", - "sandboxed-module": "^2.0.4", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "ts-node": "^9.0.0", - "typescript": "^3.9.7", - "wait-port": "^0.2.9", - "webpack": "^5.75.0", - "webpack-cli": "^5.0.0" - } + "devDependencies": { + "@babel/cli": "^7.12.1", + "@babel/core": "^7.12.3", + "@babel/plugin-proposal-class-properties": "^7.12.1", + "@babel/plugin-transform-modules-commonjs": "^7.12.1", + "@babel/plugin-transform-runtime": "^7.12.1", + "@babel/preset-env": "^7.12.1", + "@babel/preset-typescript": "^7.12.1", + "@babel/runtime": "^7.12.1", + "@chainsafe/geth-dev-assistant": "^0.1.10", + "@ensdomains/ens": "^0.6.0", + "@ensdomains/resolver": "^0.2.4", + "@types/bignumber.js": "^4.0.2", + "@types/bn.js": "^5.1.0", + "@types/node": "^12.12.68", + "@types/prettier": "2.6.0", + "babel-loader": "^8.1.0", + "bignumber.js": "^9.0.1", + "bn.js": "^5.2.1", + "browserify": "^16.5.2", + "buffer": "^4.9.2", + "bundlesize": "^0.18.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "core-js": "^3.6.5", + "crypto-browserify": "^3.12.0", + "crypto-js": "^3.3.0", + "decache": "^4.6.0", + "dependency-check": "^4.1.0", + "ethereumjs-util": "^7.1.5", + "ethers": "^5.4.4", + "fetch-mock": "^9.11.0", + "ganache-cli": "^6.12.0", + "https-browserify": "^1.0.0", + "jshint": "^2.12.0", + "karma": "^6.3.19", + "karma-browserify": "^7.0.0", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^1.3.0", + "karma-mocha": "^2.0.1", + "karma-spec-reporter": "0.0.32", + "lerna": "^4.0.0", + "mocha": "^6.2.3", + "nyc": "^14.1.1", + "pify": "^4.0.1", + "process": "^0.11.10", + "rimraf": "^3.0.2", + "sandboxed-module": "^2.0.4", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "ts-node": "^9.0.0", + "typescript": "^3.9.7", + "wait-port": "^0.2.9", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0" + } } diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index 3260e638e15..b9c004dc399 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -17,8 +17,8 @@ "@ethereumjs/common": "2.5.0", "@ethereumjs/tx": "3.3.2", "eth-lib": "0.2.8", - "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", + "ethereumjs-util": "^7.1.5", "uuid": "^9.0.0", "web3-core": "1.8.1", "web3-core-helpers": "1.8.1", diff --git a/webpack.config.js b/webpack.config.js index 3863b85807f..b268e745820 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,23 +17,21 @@ module.exports = { }), new webpack.ProvidePlugin({ process: 'process/browser', - }), - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'], + Buffer: ['buffer', 'Buffer'] }), ], resolve: { alias: { // To avoid blotting up the `bn.js` library all over the packages // use single library instance. - "bn.js": path.resolve(__dirname, 'node_modules/bn.js') + "bn.js": path.resolve(__dirname, 'node_modules/bn.js'), + 'ethereumjs-util': path.resolve(__dirname, 'node_modules/ethereumjs-util') }, fallback: { - buffer: require.resolve('buffer'), https: require.resolve('https-browserify'), http: require.resolve("stream-http"), - stream: require.resolve("stream-browserify"), crypto: require.resolve("crypto-browserify"), + stream: false, }, }, From 2079622124ecec333ef9d498e7e92db2bc920f08 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 25 Nov 2022 16:40:48 -0500 Subject: [PATCH 09/29] updating to add webpack 5 info --- CHANGELOG.md | 11 ++++++++++- README.md | 4 +++- packages/web3-eth-accounts/src/index.js | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4c25a8d74..6f52b75e7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -614,7 +614,16 @@ Released with 1.0.0-beta.37 code base. ## [Unreleased] +### Changed + +- Updated Webpack 4 to Webpack 5, more details at (#5629) +- `crypto-browserify` module has moved from node builds to webpack builds for polyfilling browsers (#5629) + ### Fixed - Fixed types for `web3.utils._jsonInterfaceMethodToString` (#5550) -- Fixed Next.js builds failing on Node.js v16, Abortcontroller added if it doesn't exist globally (#5601) \ No newline at end of file +- Fixed Next.js builds failing on Node.js v16, Abortcontroller added if it doesn't exist globally (#5601) + +### Removed + +- `clean-webpack-plugin` has been removed from dev-dependencies (#5629) diff --git a/README.md b/README.md index 3d34d5b12ed..f5dea992271 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,9 @@ If you are using the types in a `commonjs` module, like in a Node app, you just ### Web3 and Create-react-app -If you are using create-react-app version >=5 you may run into issues building. This is because NodeJS polyfills are not included in the latest version of create-react-app. +** UPDATE: If you are facing any issues with create-react-app or angular, make sure you are using a web3 version of 1.8.0 or greater, as its been fixed ** + +If you are using create-react-app version >=5 you may run into issues building. This is because NodeJS polyfills are not included in the latest version of create-react-app. ### Solution diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index c673ddd132b..ba208cc3089 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -25,7 +25,7 @@ var core = require('web3-core'); var Method = require('web3-core-method'); var Account = require('eth-lib/lib/account'); -var cryp = require("crypto"); +var cryp = require('crypto'); var scrypt = require('scrypt-js'); var uuid = require('uuid'); var utils = require('web3-utils'); From fa7fb084c3bf61ffda1512ddf01931bc2e4b51fe Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 25 Nov 2022 16:48:01 -0500 Subject: [PATCH 10/29] adding webpack 5 changes --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f52b75e7b0..2e4e440a1c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -617,7 +617,8 @@ Released with 1.0.0-beta.37 code base. ### Changed - Updated Webpack 4 to Webpack 5, more details at (#5629) -- `crypto-browserify` module has moved from node builds to webpack builds for polyfilling browsers (#5629) +- `crypto-browserify` module is now used only in webpack builds for polyfilling browsers (#5629) +- Updated `ethereumjs-util` to `7.1.5` (#5629) ### Fixed @@ -627,3 +628,7 @@ Released with 1.0.0-beta.37 code base. ### Removed - `clean-webpack-plugin` has been removed from dev-dependencies (#5629) + +### Added + +- `https-browserify`, `process`, `stream-browserify`, `stream-http`, `crypto-browserify` added to dev-dependencies for polyfilling (#5629) \ No newline at end of file From 743403bc9beca712b77f89b009244c1fa09119df Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 28 Nov 2022 13:54:37 -0500 Subject: [PATCH 11/29] updating crypto --- packages/web3-eth-accounts/package.json | 3 ++- packages/web3-eth-accounts/src/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index b9c004dc399..174e9e31876 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -16,9 +16,10 @@ "dependencies": { "@ethereumjs/common": "2.5.0", "@ethereumjs/tx": "3.3.2", + "crypto-browserify": "^3.12.0", "eth-lib": "0.2.8", - "scrypt-js": "^3.0.1", "ethereumjs-util": "^7.1.5", + "scrypt-js": "^3.0.1", "uuid": "^9.0.0", "web3-core": "1.8.1", "web3-core-helpers": "1.8.1", diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index ba208cc3089..39ecaa7f747 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -25,7 +25,7 @@ var core = require('web3-core'); var Method = require('web3-core-method'); var Account = require('eth-lib/lib/account'); -var cryp = require('crypto'); +var cryp = (typeof global === 'undefined') ? require('crypto-browserify') : require('crypto'); var scrypt = require('scrypt-js'); var uuid = require('uuid'); var utils = require('web3-utils'); From 0a8166f5bf9f3ce031995410bab83efe750163e8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 30 Nov 2022 11:47:14 -0500 Subject: [PATCH 12/29] updatingwebpack config --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b268e745820..1c2282df0a1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,7 +31,7 @@ module.exports = { https: require.resolve('https-browserify'), http: require.resolve("stream-http"), crypto: require.resolve("crypto-browserify"), - stream: false, + stream: require.resolve("stream-browserify") }, }, From 3f9ee85a9ba80148215fd1d21ee03dd49e30cf94 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 1 Dec 2022 11:17:14 -0500 Subject: [PATCH 13/29] removing crypto-broswrify --- packages/web3-eth-accounts/package.json | 1 - packages/web3-eth-accounts/src/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index 174e9e31876..2093cf57cc9 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -16,7 +16,6 @@ "dependencies": { "@ethereumjs/common": "2.5.0", "@ethereumjs/tx": "3.3.2", - "crypto-browserify": "^3.12.0", "eth-lib": "0.2.8", "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index 39ecaa7f747..ba208cc3089 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -25,7 +25,7 @@ var core = require('web3-core'); var Method = require('web3-core-method'); var Account = require('eth-lib/lib/account'); -var cryp = (typeof global === 'undefined') ? require('crypto-browserify') : require('crypto'); +var cryp = require('crypto'); var scrypt = require('scrypt-js'); var uuid = require('uuid'); var utils = require('web3-utils'); From 64faeec743c2120cfa8d98dd7dfff5e4ca192dfb Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Dec 2022 13:04:14 -0500 Subject: [PATCH 14/29] add read-streamable --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e895b79d9..4d3d5240681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -633,3 +633,4 @@ Released with 1.0.0-beta.37 code base. ### Added - `https-browserify`, `process`, `stream-browserify`, `stream-http`, `crypto-browserify` added to dev-dependencies for polyfilling (#5629) +- Add `readable-stream` to dev-dependancies for webpack (#5629) \ No newline at end of file From 04961d14caa70df9d3f92241f502e277c25ce28b Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Dec 2022 15:26:36 -0500 Subject: [PATCH 15/29] update lerna to v5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c2b64e4fa7..dae9a6206d6 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "karma-firefox-launcher": "^1.3.0", "karma-mocha": "^2.0.1", "karma-spec-reporter": "0.0.32", - "lerna": "^4.0.0", + "lerna": "^5.6.2", "mocha": "^6.2.3", "nyc": "^14.1.1", "pify": "^4.0.1", From 67695379640ce5da37ff1ed52c59b16a53ddf6b7 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Dec 2022 16:18:42 -0500 Subject: [PATCH 16/29] upgrade to lerna 6 --- lerna.json | 3 ++- nx.json | 15 +++++++++++++++ package.json | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 nx.json diff --git a/lerna.json b/lerna.json index 1965a8d48d0..1f2800a2eaf 100644 --- a/lerna.json +++ b/lerna.json @@ -11,5 +11,6 @@ }, "packages": [ "packages/*" - ] + ], + "useNx": true } diff --git a/nx.json b/nx.json new file mode 100644 index 00000000000..6e5fe71bbef --- /dev/null +++ b/nx.json @@ -0,0 +1,15 @@ +{ + "tasksRunnerOptions": { + "default": { + "runner": "nx/tasks-runners/default", + "options": { + "cacheableOperations": [ + "compile", + "type-check" + ] + } + } + }, + "targetDefaults": { + } +} diff --git a/package.json b/package.json index dae9a6206d6..1c202bad380 100644 --- a/package.json +++ b/package.json @@ -127,8 +127,9 @@ "karma-firefox-launcher": "^1.3.0", "karma-mocha": "^2.0.1", "karma-spec-reporter": "0.0.32", - "lerna": "^5.6.2", + "lerna": "^6.1.0", "mocha": "^6.2.3", + "nx": "^15.2.4", "nyc": "^14.1.1", "pify": "^4.0.1", "process": "^0.11.10", From 7d84d6039be8f9d3581333e171ab4784eceed14c Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Dec 2022 11:31:57 -0500 Subject: [PATCH 17/29] updating tools --- .github/workflows/build.yml | 4 ++-- nx.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb8dc91c79c..33520e85695 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 - uses: actions/checkout@v2 - uses: actions/cache@v2 @@ -118,7 +118,7 @@ jobs: steps: - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 - uses: actions/checkout@v2 - run: bash ./scripts/ci.sh eth2: diff --git a/nx.json b/nx.json index 6e5fe71bbef..49592352d0c 100644 --- a/nx.json +++ b/nx.json @@ -5,7 +5,7 @@ "options": { "cacheableOperations": [ "compile", - "type-check" + "bootstrap" ] } } From 8fd367d6b6e5643da6286f6605e006313246dde1 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Dec 2022 12:10:33 -0500 Subject: [PATCH 18/29] remove bundlesize --- package.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/package.json b/package.json index 1c202bad380..0e35769cb73 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,6 @@ "node": ">=11.0.0" }, "main": "./packages/web3/src/index.js", - "bundlesize": [ - { - "path": "./packages/web3/dist/web3.min.js", - "maxSize": "1.5 mB", - "compression": "none" - } - ], "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", @@ -107,7 +100,6 @@ "bn.js": "^5.2.1", "browserify": "^16.5.2", "buffer": "^4.9.2", - "bundlesize": "^0.18.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "core-js": "^3.6.5", From bc5b980636fe2dbb42a6debe05bbc69195cf1001 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Dec 2022 14:47:15 -0500 Subject: [PATCH 19/29] adding lerna 6 changes --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d3d5240681..2e70a748ed2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -619,6 +619,7 @@ Released with 1.0.0-beta.37 code base. - Updated Webpack 4 to Webpack 5, more details at (#5629) - `crypto-browserify` module is now used only in webpack builds for polyfilling browsers (#5629) - Updated `ethereumjs-util` to `7.1.5` (#5629) +- Updated `lerna` 4 to version 6 (#5680) ### Fixed @@ -629,6 +630,7 @@ Released with 1.0.0-beta.37 code base. ### Removed - `clean-webpack-plugin` has been removed from dev-dependencies (#5629) +- `bundlesize` has been removed from dev-dependencies (#5629) ### Added diff --git a/package.json b/package.json index 0e35769cb73..9f7ac3d3f84 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "version": "npm run build", "postinstall": "npm run bootstrap", "build": "npm run bootstrap && lerna run compile && webpack && cp -r ./dist ./packages/web3", + "build-no-cache": "npm run bootstrap && lerna run compile --skip-nx-cache && webpack && cp -r ./dist ./packages/web3", "publish": "lerna publish", "bootstrap": "lerna bootstrap --hoist", "lint": "jshint *.js packages", @@ -19,7 +20,6 @@ "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", "dtslint": "lerna run dtslint", "depcheck": "lerna exec dependency-check -- --missing --verbose .", - "bundlesize": "bundlesize || true", "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", From 62d5208a16d7c7bda46bd4aee9f5271c91e216ed Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Dec 2022 15:00:14 -0500 Subject: [PATCH 20/29] remove bundlesize --- scripts/ci.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.sh b/scripts/ci.sh index bed14c88849..ec8f9a4fd49 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -19,7 +19,6 @@ elif [ "$TEST" = "build_and_lint" ]; then npm run build npm run dtslint npm run depcheck - npm run bundlesize elif [ "$TEST" = "unit_and_e2e_clients" ]; then From 189f9a04d548ed6fb1f509390535fa3f7cf9e8cc Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2022 09:03:20 -0500 Subject: [PATCH 21/29] update bundlesize --- package.json | 8 ++++++++ scripts/ci.sh | 1 + 2 files changed, 9 insertions(+) diff --git a/package.json b/package.json index 9f7ac3d3f84..957c5f46cfb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,13 @@ "node": ">=11.0.0" }, "main": "./packages/web3/src/index.js", + "bundlesize": [ + { + "path": "./packages/web3/dist/web3.min.js", + "maxSize": "1.5 mB", + "compression": "none" + } + ], "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", @@ -100,6 +107,7 @@ "bn.js": "^5.2.1", "browserify": "^16.5.2", "buffer": "^4.9.2", + "bundlesize": "^0.18.1", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "core-js": "^3.6.5", diff --git a/scripts/ci.sh b/scripts/ci.sh index ec8f9a4fd49..bed14c88849 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -19,6 +19,7 @@ elif [ "$TEST" = "build_and_lint" ]; then npm run build npm run dtslint npm run depcheck + npm run bundlesize elif [ "$TEST" = "unit_and_e2e_clients" ]; then From af2005442ec0d6482be8f34dee8184a7c5193615 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2022 09:17:05 -0500 Subject: [PATCH 22/29] bunldlesize update --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 957c5f46cfb..918e5098493 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", "dtslint": "lerna run dtslint", "depcheck": "lerna exec dependency-check -- --missing --verbose .", + "bundlesize": "bundlesize || true", "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", From 10467e48da57219c1ee5ad7cbf471c2658ac937e Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2022 09:32:00 -0500 Subject: [PATCH 23/29] remove bundlesize --- package.json | 9 --------- scripts/ci.sh | 1 - 2 files changed, 10 deletions(-) diff --git a/package.json b/package.json index 918e5098493..9f7ac3d3f84 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,6 @@ "node": ">=11.0.0" }, "main": "./packages/web3/src/index.js", - "bundlesize": [ - { - "path": "./packages/web3/dist/web3.min.js", - "maxSize": "1.5 mB", - "compression": "none" - } - ], "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", @@ -27,7 +20,6 @@ "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", "dtslint": "lerna run dtslint", "depcheck": "lerna exec dependency-check -- --missing --verbose .", - "bundlesize": "bundlesize || true", "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", @@ -108,7 +100,6 @@ "bn.js": "^5.2.1", "browserify": "^16.5.2", "buffer": "^4.9.2", - "bundlesize": "^0.18.1", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "core-js": "^3.6.5", diff --git a/scripts/ci.sh b/scripts/ci.sh index bed14c88849..ec8f9a4fd49 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -19,7 +19,6 @@ elif [ "$TEST" = "build_and_lint" ]; then npm run build npm run dtslint npm run depcheck - npm run bundlesize elif [ "$TEST" = "unit_and_e2e_clients" ]; then From e8339765a1772e959feec57d23fa15b405aa5c3c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2022 13:39:46 -0500 Subject: [PATCH 24/29] update packages for window test --- scripts/e2e.npm.publish.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/e2e.npm.publish.sh b/scripts/e2e.npm.publish.sh index f832655db44..d56e401e92c 100755 --- a/scripts/e2e.npm.publish.sh +++ b/scripts/e2e.npm.publish.sh @@ -21,11 +21,11 @@ fi # To model publication correctly, this script needs to run # without web3's dev deps being installed. It installs # what it needs here. -npm install -g verdaccio@4.4.4 +npm install -g verdaccio@5.18.0 npm install -g npm-auth-to-token@1.0.0 -npm install -g lerna@^3.20.2 -npm install -g typescript@^3.9.5 -npm install -g webpack@^4.44.1 webpack-cli@^3.3.12 clean-webpack-plugin@^3.0.0 +npm install -g lerna@^6.1.0 +npm install -g typescript@^4.1 +npm install -g webpack@^5.75.0 webpack-cli@^5 # Launch npm proxy registry and save pid to kill server (req. in Windows env) verdaccio --config verdaccio.yml & From ef203746f582ab965f3832caeca1d1362243f3c7 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2022 14:14:01 -0500 Subject: [PATCH 25/29] adding back bundlesize --- package.json | 9 +++++++++ scripts/ci.sh | 1 + 2 files changed, 10 insertions(+) diff --git a/package.json b/package.json index 9f7ac3d3f84..918e5098493 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,13 @@ "node": ">=11.0.0" }, "main": "./packages/web3/src/index.js", + "bundlesize": [ + { + "path": "./packages/web3/dist/web3.min.js", + "maxSize": "1.5 mB", + "compression": "none" + } + ], "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", @@ -20,6 +27,7 @@ "test:cov": "npm run cov:clean && npm run test:unit && npm run test:e2e:clients && npm run cov:merge_reports", "dtslint": "lerna run dtslint", "depcheck": "lerna exec dependency-check -- --missing --verbose .", + "bundlesize": "bundlesize || true", "geth": "geth-dev-assistant --accounts 5 --tag stable --gasLimit 7000000", "test:e2e:ganache": "bash ./scripts/e2e.ganache.sh", "test:e2e:geth:auto": "bash ./scripts/e2e.geth.automine.sh", @@ -100,6 +108,7 @@ "bn.js": "^5.2.1", "browserify": "^16.5.2", "buffer": "^4.9.2", + "bundlesize": "^0.18.1", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "core-js": "^3.6.5", diff --git a/scripts/ci.sh b/scripts/ci.sh index ec8f9a4fd49..bed14c88849 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -19,6 +19,7 @@ elif [ "$TEST" = "build_and_lint" ]; then npm run build npm run dtslint npm run depcheck + npm run bundlesize elif [ "$TEST" = "unit_and_e2e_clients" ]; then From 4d0730b0965a64badae255040f9cda75b21af2ac Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Dec 2022 11:42:23 -0500 Subject: [PATCH 26/29] removing nx --- lerna.json | 3 +-- nx.json | 15 --------------- package.json | 4 +--- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 nx.json diff --git a/lerna.json b/lerna.json index 1f2800a2eaf..1965a8d48d0 100644 --- a/lerna.json +++ b/lerna.json @@ -11,6 +11,5 @@ }, "packages": [ "packages/*" - ], - "useNx": true + ] } diff --git a/nx.json b/nx.json deleted file mode 100644 index 49592352d0c..00000000000 --- a/nx.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tasksRunnerOptions": { - "default": { - "runner": "nx/tasks-runners/default", - "options": { - "cacheableOperations": [ - "compile", - "bootstrap" - ] - } - } - }, - "targetDefaults": { - } -} diff --git a/package.json b/package.json index 918e5098493..5c6f4e8b6c7 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", - "build": "npm run bootstrap && lerna run compile && webpack && cp -r ./dist ./packages/web3", - "build-no-cache": "npm run bootstrap && lerna run compile --skip-nx-cache && webpack && cp -r ./dist ./packages/web3", + "build": "npm run bootstrap && lerna run compile --skip-nx-cache && webpack && cp -r ./dist ./packages/web3", "publish": "lerna publish", "bootstrap": "lerna bootstrap --hoist", "lint": "jshint *.js packages", @@ -130,7 +129,6 @@ "karma-spec-reporter": "0.0.32", "lerna": "^6.1.0", "mocha": "^6.2.3", - "nx": "^15.2.4", "nyc": "^14.1.1", "pify": "^4.0.1", "process": "^0.11.10", From f9b15eecde679b0c1403eab13eedd03c956a92ce Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Dec 2022 11:54:07 -0500 Subject: [PATCH 27/29] adding nx back to dev-deps --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5c6f4e8b6c7..8cadb1c033e 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "karma-spec-reporter": "0.0.32", "lerna": "^6.1.0", "mocha": "^6.2.3", + "nx": "^15.3.0", "nyc": "^14.1.1", "pify": "^4.0.1", "process": "^0.11.10", From 8109be49c888209ab530cfe05b94f8346fabfa2d Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Dec 2022 14:00:05 -0500 Subject: [PATCH 28/29] add use nx false flag --- lerna.json | 3 ++- package.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lerna.json b/lerna.json index 1965a8d48d0..e10b296fb62 100644 --- a/lerna.json +++ b/lerna.json @@ -11,5 +11,6 @@ }, "packages": [ "packages/*" - ] + ], + "useNx": false } diff --git a/package.json b/package.json index 8cadb1c033e..5c6f4e8b6c7 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,6 @@ "karma-spec-reporter": "0.0.32", "lerna": "^6.1.0", "mocha": "^6.2.3", - "nx": "^15.3.0", "nyc": "^14.1.1", "pify": "^4.0.1", "process": "^0.11.10", From 6f574ba7bbbc065421d5b5ebf1208cc415a7f684 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Dec 2022 14:05:11 -0500 Subject: [PATCH 29/29] add nx as dev-dep --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5c6f4e8b6c7..8cadb1c033e 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "karma-spec-reporter": "0.0.32", "lerna": "^6.1.0", "mocha": "^6.2.3", + "nx": "^15.3.0", "nyc": "^14.1.1", "pify": "^4.0.1", "process": "^0.11.10",