From 03b28fa57835db545876df84f1f19d833ca110a4 Mon Sep 17 00:00:00 2001 From: Crypto Sheik <93099369+0xCryptoSheik@users.noreply.github.com> Date: Thu, 28 Oct 2021 19:36:22 +0200 Subject: [PATCH 1/3] feat(tree-shaking): enable browser target webpack tree-shaking feat(tree-shaking): make an unbundled transpiled build using Babel These files are meant to be consumed by Webpack in a way that will enable tree-shaking. feat(tree-shaking): enable webpack tree-shaking by marking lib as side-effects free Even though this is not exactly true, web3.js isn't strictly pure, it should be safe. --- web3.js/babel.config.json | 1 + web3.js/package-lock.json | 105 ++++++++++++++++++++++++++++++++++++++ web3.js/package.json | 10 ++-- web3.js/rollup.config.js | 31 ----------- 4 files changed, 112 insertions(+), 35 deletions(-) diff --git a/web3.js/babel.config.json b/web3.js/babel.config.json index f8a99f501bf63e..17e4241b151b03 100644 --- a/web3.js/babel.config.json +++ b/web3.js/babel.config.json @@ -3,6 +3,7 @@ [ "@babel/preset-env", { + "modules": false, "bugfixes": true } ], diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index a2a8b5c15a898d..838dd91cc6feb4 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -25,6 +25,7 @@ "tweetnacl": "^1.0.0" }, "devDependencies": { + "@babel/cli": "^7.15.7", "@babel/core": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.1", "@babel/plugin-transform-runtime": "^7.12.10", @@ -109,6 +110,53 @@ "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==", "dev": true }, + "node_modules/@babel/cli": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.15.7.tgz", + "integrity": "sha512-YW5wOprO2LzMjoWZ5ZG6jfbY9JnkDxuHDwvnrThnuYtByorova/I0HNXJedrUfwuXFQfYOjcqDA4PU3qlZGZjg==", + "dev": true, + "dependencies": { + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + }, + "bin": { + "babel": "bin/babel.js", + "babel-external-helpers": "bin/babel-external-helpers.js" + }, + "engines": { + "node": ">=6.9.0" + }, + "optionalDependencies": { + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", + "chokidar": "^3.4.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/cli/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@babel/cli/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", @@ -2997,6 +3045,13 @@ "node": ">=8" } }, + "node_modules/@nicolo-ribaudo/chokidar-2": { + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", + "dev": true, + "optional": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -8067,6 +8122,12 @@ "node": ">=12" } }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -18134,6 +18195,37 @@ } } }, + "@babel/cli": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.15.7.tgz", + "integrity": "sha512-YW5wOprO2LzMjoWZ5ZG6jfbY9JnkDxuHDwvnrThnuYtByorova/I0HNXJedrUfwuXFQfYOjcqDA4PU3qlZGZjg==", + "dev": true, + "requires": { + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", + "chokidar": "^3.4.0", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + } + } + }, "@babel/code-frame": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", @@ -20194,6 +20286,13 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@nicolo-ribaudo/chokidar-2": { + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", + "dev": true, + "optional": true + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -24246,6 +24345,12 @@ "universalify": "^2.0.0" } }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", diff --git a/web3.js/package.json b/web3.js/package.json index 00c31f8df3cf9b..cc1ba41f9b9a16 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -19,9 +19,9 @@ "publishConfig": { "access": "public" }, + "sideEffects": false, "browser": { - "./lib/index.cjs.js": "./lib/index.browser.esm.js", - "./lib/index.esm.js": "./lib/index.browser.esm.js" + "./lib/index.esm.js": "./lib/transpiled-esm/index.js" }, "main": "lib/index.cjs.js", "module": "lib/index.esm.js", @@ -37,9 +37,10 @@ "/src" ], "scripts": { - "build": "npm run clean; cross-env NODE_ENV=production rollup -c; npm run type:gen; npm run flow:gen; npm run flow:check", + "build": "npm run clean; cross-env NODE_ENV=production rollup -c; npm run build:transpiled-esm; npm run type:gen; npm run flow:gen; npm run flow:check", "build:browser-test": "rollup -c test/rollup.config.js", "build:fixtures": "set -ex; ./test/fixtures/noop-program/build.sh", + "build:transpiled-esm": "babel src --extensions .ts --source-maps true --out-dir ./lib/transpiled-esm", "clean": "rimraf ./coverage ./lib", "codecov": "set -ex; npm run test:cover; cat ./coverage/lcov.info | codecov", "dev": "cross-env NODE_ENV=development rollup -c", @@ -78,6 +79,7 @@ "tweetnacl": "^1.0.0" }, "devDependencies": { + "@babel/cli": "^7.15.7", "@babel/core": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.1", "@babel/plugin-transform-runtime": "^7.12.10", @@ -143,4 +145,4 @@ "engines": { "node": ">=12.20.0" } -} +} \ No newline at end of file diff --git a/web3.js/rollup.config.js b/web3.js/rollup.config.js index f98382be0fa295..8a2f47f0d087d8 100644 --- a/web3.js/rollup.config.js +++ b/web3.js/rollup.config.js @@ -69,36 +69,6 @@ function generateConfig(configType, format) { switch (configType) { case 'browser': switch (format) { - case 'esm': { - config.output = [ - { - file: 'lib/index.browser.esm.js', - format: 'es', - sourcemap: true, - }, - ]; - - // Prevent dependencies from being bundled - config.external = [ - /@babel\/runtime/, - '@solana/buffer-layout', - 'bn.js', - 'borsh', - 'bs58', - 'buffer', - 'crypto-hash', - 'http', - 'https', - 'jayson/lib/client/browser', - 'js-sha3', - 'rpc-websockets', - 'secp256k1', - 'superstruct', - 'tweetnacl', - ]; - - break; - } case 'iife': { config.external = ['http', 'https']; @@ -152,6 +122,5 @@ function generateConfig(configType, format) { export default [ generateConfig('node'), - generateConfig('browser', 'esm'), generateConfig('browser', 'iife'), ]; From b124896e6fb8ff8bd350f29d777e4659a5e15d59 Mon Sep 17 00:00:00 2001 From: Crypto Sheik <93099369+0xCryptoSheik@users.noreply.github.com> Date: Wed, 24 Nov 2021 22:01:54 +0100 Subject: [PATCH 2/3] feat(tree-shaking): transform process.env vars when no bundling This way we don't have to force the consumer to do it themselves, also closer to the previous ESM bundled behavior. --- web3.js/babel.config.js | 56 +++++++++++++++++++++++++++++ web3.js/babel.config.json | 32 ----------------- web3.js/package-lock.json | 74 +++++++++++++++++++++++++++++++++++++++ web3.js/package.json | 6 ++-- web3.js/rollup.config.js | 5 +-- 5 files changed, 135 insertions(+), 38 deletions(-) create mode 100644 web3.js/babel.config.js delete mode 100644 web3.js/babel.config.json diff --git a/web3.js/babel.config.js b/web3.js/babel.config.js new file mode 100644 index 00000000000000..29dd5c383c0b98 --- /dev/null +++ b/web3.js/babel.config.js @@ -0,0 +1,56 @@ +const isCalledByBundler = caller => caller.name.startsWith('@rollup'); + +module.exports = api => { + const calledByBundler = api.caller(isCalledByBundler); + const transformEnvVariables = + !calledByBundler && + process.env.NODE_ENV && + process.env.BROWSER !== undefined; + + return { + presets: [ + [ + '@babel/preset-env', + { + modules: false, + bugfixes: true, + }, + ], + ['@babel/preset-typescript'], + ], + plugins: [ + [ + '@babel/plugin-proposal-class-properties', + { + loose: true, + }, + ], + [ + '@babel/plugin-proposal-private-methods', + { + loose: true, + }, + ], + [ + '@babel/plugin-proposal-private-property-in-object', + { + loose: true, + }, + ], + transformEnvVariables && [ + 'transform-inline-environment-variables', + { + include: ['NODE_ENV', 'BROWSER'], + }, + ], + transformEnvVariables && [ + 'minify-dead-code-elimination', + { + keepFnName: true, + keepFnArgs: true, + keepClassName: true, + }, + ], + ].filter(Boolean), + }; +}; diff --git a/web3.js/babel.config.json b/web3.js/babel.config.json deleted file mode 100644 index 17e4241b151b03..00000000000000 --- a/web3.js/babel.config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "modules": false, - "bugfixes": true - } - ], - ["@babel/preset-typescript"] - ], - "plugins": [ - [ - "@babel/plugin-proposal-class-properties", - { - "loose": true - } - ], - [ - "@babel/plugin-proposal-private-methods", - { - "loose": true - } - ], - [ - "@babel/plugin-proposal-private-property-in-object", - { - "loose": true - } - ] - ] -} \ No newline at end of file diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index 838dd91cc6feb4..5f21e10a4f2178 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -54,6 +54,8 @@ "@types/sinon": "^10.0.0", "@typescript-eslint/eslint-plugin": "^4.14.2", "@typescript-eslint/parser": "^4.14.2", + "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-transform-inline-environment-variables": "^0.4.3", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "codecov": "^3.0.4", @@ -4872,6 +4874,24 @@ "follow-redirects": "^1.10.0" } }, + "node_modules/babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "node_modules/babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "node_modules/babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, "node_modules/babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", @@ -4881,6 +4901,18 @@ "object.assign": "^4.1.0" } }, + "node_modules/babel-plugin-minify-dead-code-elimination": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", + "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", @@ -4929,6 +4961,12 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-plugin-transform-inline-environment-variables": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-environment-variables/-/babel-plugin-transform-inline-environment-variables-0.4.3.tgz", + "integrity": "sha1-o7CYgzU76LXiM24/8e+KXZP5xIk=", + "dev": true + }, "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -21738,6 +21776,24 @@ "follow-redirects": "^1.10.0" } }, + "babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", @@ -21747,6 +21803,18 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-minify-dead-code-elimination": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", + "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, "babel-plugin-polyfill-corejs2": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", @@ -21785,6 +21853,12 @@ "@babel/helper-define-polyfill-provider": "^0.2.4" } }, + "babel-plugin-transform-inline-environment-variables": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-environment-variables/-/babel-plugin-transform-inline-environment-variables-0.4.3.tgz", + "integrity": "sha1-o7CYgzU76LXiM24/8e+KXZP5xIk=", + "dev": true + }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", diff --git a/web3.js/package.json b/web3.js/package.json index cc1ba41f9b9a16..c3390593af3644 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -40,7 +40,7 @@ "build": "npm run clean; cross-env NODE_ENV=production rollup -c; npm run build:transpiled-esm; npm run type:gen; npm run flow:gen; npm run flow:check", "build:browser-test": "rollup -c test/rollup.config.js", "build:fixtures": "set -ex; ./test/fixtures/noop-program/build.sh", - "build:transpiled-esm": "babel src --extensions .ts --source-maps true --out-dir ./lib/transpiled-esm", + "build:transpiled-esm": "cross-env BROWSER=true babel src --extensions .ts --source-maps true --out-dir ./lib/transpiled-esm", "clean": "rimraf ./coverage ./lib", "codecov": "set -ex; npm run test:cover; cat ./coverage/lcov.info | codecov", "dev": "cross-env NODE_ENV=development rollup -c", @@ -108,6 +108,8 @@ "@types/sinon": "^10.0.0", "@typescript-eslint/eslint-plugin": "^4.14.2", "@typescript-eslint/parser": "^4.14.2", + "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-transform-inline-environment-variables": "^0.4.3", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "codecov": "^3.0.4", @@ -145,4 +147,4 @@ "engines": { "node": ">=12.20.0" } -} \ No newline at end of file +} diff --git a/web3.js/rollup.config.js b/web3.js/rollup.config.js index 8a2f47f0d087d8..9d3ac1d5a38ad0 100644 --- a/web3.js/rollup.config.js +++ b/web3.js/rollup.config.js @@ -120,7 +120,4 @@ function generateConfig(configType, format) { return config; } -export default [ - generateConfig('node'), - generateConfig('browser', 'iife'), -]; +export default [generateConfig('node'), generateConfig('browser', 'iife')]; From 96fad32d4f376e8881959e78d63fcf23baa0cee8 Mon Sep 17 00:00:00 2001 From: Crypto Sheik <93099369+0xCryptoSheik@users.noreply.github.com> Date: Wed, 24 Nov 2021 23:26:00 +0100 Subject: [PATCH 3/3] feat(tree-shaking): remove dead import for browser esm build removes the need of resolving http/https modules by consumers --- web3.js/babel.config.js | 6 ++++++ web3.js/package-lock.json | 17 +++++++++++++++++ web3.js/package.json | 1 + 3 files changed, 24 insertions(+) diff --git a/web3.js/babel.config.js b/web3.js/babel.config.js index 29dd5c383c0b98..f98a217aa6942f 100644 --- a/web3.js/babel.config.js +++ b/web3.js/babel.config.js @@ -51,6 +51,12 @@ module.exports = api => { keepClassName: true, }, ], + transformEnvVariables && [ + 'babel-plugin-transform-remove-imports', + { + test: 'agent-manager', + }, + ], ].filter(Boolean), }; }; diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index 5f21e10a4f2178..6cc8ceee088ff9 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -56,6 +56,7 @@ "@typescript-eslint/parser": "^4.14.2", "babel-plugin-minify-dead-code-elimination": "^0.5.1", "babel-plugin-transform-inline-environment-variables": "^0.4.3", + "babel-plugin-transform-remove-imports": "^1.7.0", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "codecov": "^3.0.4", @@ -4967,6 +4968,15 @@ "integrity": "sha1-o7CYgzU76LXiM24/8e+KXZP5xIk=", "dev": true }, + "node_modules/babel-plugin-transform-remove-imports": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-imports/-/babel-plugin-transform-remove-imports-1.7.0.tgz", + "integrity": "sha512-gprmWf6ry5qrnxMyiDaxZpXzZJP6R9FRA+p0AImLIWRmSEGtlKcFprHKeGMZYkII9rJR6Q1hYou+n1fk6rWf2g==", + "dev": true, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -21859,6 +21869,13 @@ "integrity": "sha1-o7CYgzU76LXiM24/8e+KXZP5xIk=", "dev": true }, + "babel-plugin-transform-remove-imports": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-imports/-/babel-plugin-transform-remove-imports-1.7.0.tgz", + "integrity": "sha512-gprmWf6ry5qrnxMyiDaxZpXzZJP6R9FRA+p0AImLIWRmSEGtlKcFprHKeGMZYkII9rJR6Q1hYou+n1fk6rWf2g==", + "dev": true, + "requires": {} + }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", diff --git a/web3.js/package.json b/web3.js/package.json index c3390593af3644..3fcce55164db05 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -110,6 +110,7 @@ "@typescript-eslint/parser": "^4.14.2", "babel-plugin-minify-dead-code-elimination": "^0.5.1", "babel-plugin-transform-inline-environment-variables": "^0.4.3", + "babel-plugin-transform-remove-imports": "^1.7.0", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "codecov": "^3.0.4",