From 1fc6217819aba8daa6a233ccd41e5d5747939791 Mon Sep 17 00:00:00 2001 From: Gregory Markou <16929357+GregTheGreek@users.noreply.github.com> Date: Sat, 25 Jul 2020 01:46:22 -0400 Subject: [PATCH] Add typescript support (#3652) * modernize web3-core * add tsconfig * add tsc to package.json * ignore lib * build works * tests pass * update script * remove old dist * address comments * change main * bump cache * add build step to ci * add pre build step for ci tests * remove comments * update changelog * revert to old dist --- .github/workflows/build.yml | 6 +- .gitignore | 1 + CHANGELOG.md | 5 + package-lock.json | 271 ++++++++++-------- package.json | 7 +- packages/web3-bzz/package.json | 3 +- packages/web3-bzz/tsconfig.json | 9 + packages/web3-core-helpers/package.json | 3 +- packages/web3-core-helpers/tsconfig.json | 9 + packages/web3-core-method/package.json | 3 +- packages/web3-core-method/tsconfig.json | 9 + packages/web3-core-promievent/package.json | 5 +- packages/web3-core-promievent/tsconfig.json | 9 + .../web3-core-requestmanager/package.json | 5 +- .../web3-core-requestmanager/tsconfig.json | 9 + packages/web3-core-subscriptions/package.json | 3 +- .../web3-core-subscriptions/tsconfig.json | 9 + packages/web3-core/package.json | 3 +- packages/web3-core/src/index.js | 117 ++++---- packages/web3-core/tsconfig.json | 9 + packages/web3-eth-abi/package.json | 3 +- packages/web3-eth-abi/tsconfig.json | 9 + packages/web3-eth-accounts/package.json | 3 +- packages/web3-eth-accounts/tsconfig.json | 9 + packages/web3-eth-contract/package.json | 3 +- packages/web3-eth-contract/tsconfig.json | 9 + packages/web3-eth-ens/package.json | 3 +- packages/web3-eth-ens/tsconfig.json | 9 + packages/web3-eth-iban/package.json | 3 +- packages/web3-eth-iban/tsconfig.json | 9 + packages/web3-eth-personal/package.json | 3 +- packages/web3-eth-personal/tsconfig.json | 9 + packages/web3-eth/package.json | 3 +- packages/web3-eth/tsconfig.json | 9 + packages/web3-net/package.json | 3 +- packages/web3-net/tsconfig.json | 9 + packages/web3-providers-http/package.json | 3 +- packages/web3-providers-http/tsconfig.json | 9 + packages/web3-providers-ipc/package.json | 3 +- packages/web3-providers-ipc/tsconfig.json | 9 + packages/web3-providers-ws/package.json | 3 +- packages/web3-providers-ws/tsconfig.json | 9 + packages/web3-shh/package.json | 3 +- packages/web3-shh/tsconfig.json | 9 + packages/web3-utils/package.json | 3 +- packages/web3-utils/tsconfig.json | 9 + packages/web3/package.json | 3 +- packages/web3/tsconfig.json | 9 + scripts/ci.sh | 4 +- scripts/e2e.ganache.sh | 1 + tsconfig.json | 9 + webpack.config.js | 2 +- 52 files changed, 473 insertions(+), 206 deletions(-) create mode 100644 packages/web3-bzz/tsconfig.json create mode 100644 packages/web3-core-helpers/tsconfig.json create mode 100644 packages/web3-core-method/tsconfig.json create mode 100644 packages/web3-core-promievent/tsconfig.json create mode 100644 packages/web3-core-requestmanager/tsconfig.json create mode 100644 packages/web3-core-subscriptions/tsconfig.json create mode 100644 packages/web3-core/tsconfig.json create mode 100644 packages/web3-eth-abi/tsconfig.json create mode 100644 packages/web3-eth-accounts/tsconfig.json create mode 100644 packages/web3-eth-contract/tsconfig.json create mode 100644 packages/web3-eth-ens/tsconfig.json create mode 100644 packages/web3-eth-iban/tsconfig.json create mode 100644 packages/web3-eth-personal/tsconfig.json create mode 100644 packages/web3-eth/tsconfig.json create mode 100644 packages/web3-net/tsconfig.json create mode 100644 packages/web3-providers-http/tsconfig.json create mode 100644 packages/web3-providers-ipc/tsconfig.json create mode 100644 packages/web3-providers-ws/tsconfig.json create mode 100644 packages/web3-shh/tsconfig.json create mode 100644 packages/web3-utils/tsconfig.json create mode 100644 packages/web3/tsconfig.json create mode 100644 tsconfig.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ba6b967e85..eb7b284b656 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: path: | node_modules */*/node_modules - key: 0-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} + key: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} - run: bash ./scripts/install.sh if: steps.cache-deps.outputs.cache-hit != 'true' - run: bash ./scripts/ci.sh @@ -48,7 +48,7 @@ jobs: path: | node_modules */*/node_modules - key: 0-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} + key: 2-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} - run: bash ./scripts/install.sh if: steps.cache-deps.outputs.cache-hit != 'true' - run: bash ./scripts/ci.sh @@ -78,7 +78,7 @@ jobs: path: | node_modules */*/node_modules - key: 0-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} + key: 2-${{ runner.os }}-node12-${{ hashFiles('**/package-lock.json') }} - run: bash ./scripts/install.sh if: steps.cache-deps.outputs.cache-hit != 'true' - run: bash ./scripts/ci.sh diff --git a/.gitignore b/.gitignore index 233658920b2..1070ac3ea47 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ contracts/ migrations/ truffle-config.js test/config/ensAddresses.json +*/**/lib diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8a9e15fbe..8ec7b9e9c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -270,7 +270,12 @@ Released with 1.0.0-beta.37 code base. ### Added +- Support for typescript files (.ts) to be writtern alongside regular .js files (#3652) + ### Changed +- `npm run build` now uses TSC to compile (.js allowed) and the build folder is now located under `lib` (#3652) +- Modernized web3-core to use newer es syntax (#3652) + ### Fixed diff --git a/package-lock.json b/package-lock.json index f1149dbd24c..2f3f2f96776 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2206,6 +2206,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", + "dev": true, "requires": { "core-js-pure": "^3.0.0", "regenerator-runtime": "^0.13.4" @@ -2214,7 +2215,8 @@ "regenerator-runtime": { "version": "0.13.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true } } }, @@ -2275,26 +2277,26 @@ } }, "@definitelytyped/header-parser": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.40.tgz", - "integrity": "sha512-XtlZMA3SoUcCLa8v3n9SzOqnrr6ZyiAtAV+CPcttvNAyd2l4sLcN72+3SHVHpH9z8HhTKaR6OC1PzzFoZXqNiA==", + "version": "0.0.41", + "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.41.tgz", + "integrity": "sha512-Q7YjpPYQPqntnLD/ntOZ2IF4hgevNOFz/SBNgfwTU6T7rDIdA5sKpp+U6wgDVNu4uEOBRApILsr6BUi4IGMaPg==", "requires": { - "@definitelytyped/typescript-versions": "^0.0.40", + "@definitelytyped/typescript-versions": "^0.0.41", "@types/parsimmon": "^1.10.1", "parsimmon": "^1.13.0" } }, "@definitelytyped/typescript-versions": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.40.tgz", - "integrity": "sha512-bhgrKayF1LRHlWgvsMtH1sa/y3JzJhsEVZiZE3xdoWyv9NjZ76dpGvXTNix2dz5585KgQJLP+cKeIdZbwHnCUA==" + "version": "0.0.41", + "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.41.tgz", + "integrity": "sha512-T4QRF8RHvxvnOzaGlitPqrRXHTpmR5sVkUivluIPG4PNK6Kd0E9ZZIdLOGRDFbPAlVbV0k+nLaB3vSuljio/sg==" }, "@definitelytyped/utils": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.40.tgz", - "integrity": "sha512-XDPvPnw57xeN0Fho67EB+KAQNwzhp8xXS0SlhjPxrpAJSuAkLPlr3mz3OHMIt2HuNCBbBUvpnN+jsVTG6N39XQ==", + "version": "0.0.41", + "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.41.tgz", + "integrity": "sha512-vphBOwkffjrU7HeTQtVafkDqG2f6DE7sTJiBnN9hMg5bmYd2E+p1TeBm+wu7Dy+4itKM0YXzUAv4h+hglkDtew==", "requires": { - "@definitelytyped/typescript-versions": "^0.0.40", + "@definitelytyped/typescript-versions": "^0.0.41", "@types/node": "^12.12.29", "charm": "^1.0.2", "fs-extra": "^8.1.0", @@ -5131,6 +5133,12 @@ "readable-stream": "^2.0.6" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -7217,7 +7225,8 @@ "core-js-pure": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -8018,9 +8027,9 @@ "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-3.6.12.tgz", "integrity": "sha512-fNqUqLcKu6up8rT7bb6rnfUCPDYTUButrHEsp4uENlsYiQJETaB+cM9eltYcUhiHtBoULEZrnl081yRvNUPcGA==", "requires": { - "@definitelytyped/header-parser": "^0.0.40", - "@definitelytyped/typescript-versions": "^0.0.40", - "@definitelytyped/utils": "^0.0.40", + "@definitelytyped/header-parser": "^0.0.41", + "@definitelytyped/typescript-versions": "^0.0.41", + "@definitelytyped/utils": "^0.0.41", "dts-critic": "^3.2.7", "fs-extra": "^6.0.1", "json-stable-stringify": "^1.0.1", @@ -9571,13 +9580,13 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { "version": "3.2.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { @@ -9586,7 +9595,7 @@ }, "bindings": { "version": "1.5.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, "requires": { @@ -9595,7 +9604,7 @@ }, "bip66": { "version": "1.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "dev": true, "requires": { @@ -9604,19 +9613,19 @@ }, "bn.js": { "version": "4.11.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "brorand": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, "browserify-aes": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -9630,25 +9639,25 @@ }, "buffer-from": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "buffer-xor": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, "camelcase": { "version": "5.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "cipher-base": { "version": "1.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { @@ -9658,7 +9667,7 @@ }, "cliui": { "version": "5.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { @@ -9669,7 +9678,7 @@ }, "color-convert": { "version": "1.9.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { @@ -9678,13 +9687,13 @@ }, "color-name": { "version": "1.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "create-hash": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -9697,7 +9706,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": false, + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -9711,7 +9720,7 @@ }, "cross-spawn": { "version": "6.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { @@ -9724,13 +9733,13 @@ }, "decamelize": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "drbg.js": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "dev": true, "requires": { @@ -9741,7 +9750,7 @@ }, "elliptic": { "version": "6.5.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "dev": true, "requires": { @@ -9756,13 +9765,13 @@ }, "emoji-regex": { "version": "7.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "end-of-stream": { "version": "1.4.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { @@ -9771,7 +9780,7 @@ }, "ethereumjs-util": { "version": "6.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "dev": true, "requires": { @@ -9786,7 +9795,7 @@ }, "ethjs-util": { "version": "0.1.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "dev": true, "requires": { @@ -9796,7 +9805,7 @@ }, "evp_bytestokey": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { @@ -9806,7 +9815,7 @@ }, "execa": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { @@ -9821,13 +9830,13 @@ }, "file-uri-to-path": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "dev": true }, "find-up": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { @@ -9836,13 +9845,13 @@ }, "get-caller-file": { "version": "2.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-stream": { "version": "4.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { @@ -9851,7 +9860,7 @@ }, "hash-base": { "version": "3.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { @@ -9861,7 +9870,7 @@ }, "hash.js": { "version": "1.1.7", - "resolved": false, + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { @@ -9871,7 +9880,7 @@ }, "hmac-drbg": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { @@ -9882,43 +9891,43 @@ }, "inherits": { "version": "2.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "invert-kv": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-hex-prefixed": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true }, "is-stream": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "isexe": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "keccak": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { @@ -9930,7 +9939,7 @@ }, "lcid": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { @@ -9939,7 +9948,7 @@ }, "locate-path": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { @@ -9949,7 +9958,7 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { @@ -9958,7 +9967,7 @@ }, "md5.js": { "version": "1.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { @@ -9969,7 +9978,7 @@ }, "mem": { "version": "4.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { @@ -9980,37 +9989,37 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimalistic-assert": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "dev": true }, "nan": { "version": "2.14.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "npm-run-path": { "version": "2.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { @@ -10019,7 +10028,7 @@ }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { @@ -10028,7 +10037,7 @@ }, "os-locale": { "version": "3.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { @@ -10039,25 +10048,25 @@ }, "p-defer": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true }, "p-finally": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-is-promise": { "version": "2.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { "version": "2.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { @@ -10066,7 +10075,7 @@ }, "p-locate": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { @@ -10075,25 +10084,25 @@ }, "p-try": { "version": "2.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-key": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "pump": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { @@ -10103,19 +10112,19 @@ }, "require-directory": { "version": "2.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "ripemd160": { "version": "2.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { @@ -10125,7 +10134,7 @@ }, "rlp": { "version": "2.2.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "dev": true, "requires": { @@ -10135,13 +10144,13 @@ }, "safe-buffer": { "version": "5.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "secp256k1": { "version": "3.7.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "dev": true, "requires": { @@ -10157,19 +10166,19 @@ }, "semver": { "version": "5.7.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "sha.js": { "version": "2.4.11", - "resolved": false, + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -10179,7 +10188,7 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { @@ -10188,25 +10197,25 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "source-map": { "version": "0.6.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { "version": "0.5.12", - "resolved": false, + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { @@ -10216,7 +10225,7 @@ }, "string-width": { "version": "3.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { @@ -10227,7 +10236,7 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { @@ -10236,13 +10245,13 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "strip-hex-prefix": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "dev": true, "requires": { @@ -10251,7 +10260,7 @@ }, "which": { "version": "1.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { @@ -10260,13 +10269,13 @@ }, "which-module": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wrap-ansi": { "version": "5.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { @@ -10277,19 +10286,19 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "y18n": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { "version": "13.2.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "dev": true, "requires": { @@ -10308,7 +10317,7 @@ }, "yargs-parser": { "version": "13.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { @@ -13118,6 +13127,12 @@ } } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "make-fetch-happen": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", @@ -15249,9 +15264,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "parsimmon": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.13.0.tgz", - "integrity": "sha512-5UIrOCW+gjbILkjKPgTgmq8LKf8TT3Iy7kN2VD7OtQ81facKn8B4gG1X94jWqXYZsxG2KbJhrv/Yq/5H6BQn7A==" + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.14.0.tgz", + "integrity": "sha512-m8aqXkvJbdsvlc1ROUKyRo+OXbD2ZTbL6iNRnGdJ4PCO0ccMEfklwHYxq5zaj0Injj2ZtC65B3Z2N9+fTTpSdw==" }, "pascalcase": { "version": "0.1.1", @@ -18004,6 +18019,27 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", @@ -20043,6 +20079,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, "requires": { "@babel/runtime-corejs3": "^7.8.3" } @@ -20070,12 +20107,12 @@ "dev": true }, "yargs": { - "version": "15.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", - "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "requires": { "cliui": "^6.0.0", - "decamelize": "^3.2.0", + "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", @@ -20124,14 +20161,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "decamelize": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", - "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", - "requires": { - "xregexp": "^4.2.4" - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -20430,6 +20459,12 @@ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/package.json b/package.json index 5c7f8e70645..5d5166455d7 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,12 @@ "scripts": { "version": "npm run build", "postinstall": "npm run bootstrap", - "build": "npm run bootstrap && webpack && cp -r ./dist ./packages/web3", + "build": "npm run bootstrap && lerna run tsc && webpack && cp -r ./dist ./packages/web3", "publish": "lerna publish", "bootstrap": "lerna bootstrap --hoist", "lint": "jshint *.js packages", - "test": "mocha --grep E2E --invert; jshint *.js packages", - "test:unit": "nyc --no-clean --silent _mocha -- -R spec --grep E2E --invert --exit", + "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 .", @@ -128,6 +128,7 @@ "nyc": "^14.1.1", "pify": "^4.0.1", "sandboxed-module": "^2.0.3", + "ts-node": "^8.10.2", "typescript": "^3.9.5", "underscore": "1.9.1", "wait-port": "^0.2.6", diff --git a/packages/web3-bzz/package.json b/packages/web3-bzz/package.json index b4a1e006d6d..48594fd026a 100644 --- a/packages/web3-bzz/package.json +++ b/packages/web3-bzz/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@types/node": "^12.12.6", "got": "9.6.0", diff --git a/packages/web3-bzz/tsconfig.json b/packages/web3-bzz/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-bzz/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core-helpers/package.json b/packages/web3-core-helpers/package.json index ef5f2dab72c..ed1db879e8a 100644 --- a/packages/web3-core-helpers/package.json +++ b/packages/web3-core-helpers/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "underscore": "1.9.1", "web3-eth-iban": "1.2.11", diff --git a/packages/web3-core-helpers/tsconfig.json b/packages/web3-core-helpers/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core-helpers/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core-method/package.json b/packages/web3-core-method/package.json index 6b0e39c03f4..db8785dd119 100644 --- a/packages/web3-core-method/package.json +++ b/packages/web3-core-method/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@ethersproject/transactions": "^5.0.0-beta.135", "underscore": "1.9.1", diff --git a/packages/web3-core-method/tsconfig.json b/packages/web3-core-method/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core-method/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core-promievent/package.json b/packages/web3-core-promievent/package.json index 267fb4b65c6..550eeebccd4 100644 --- a/packages/web3-core-promievent/package.json +++ b/packages/web3-core-promievent/package.json @@ -7,7 +7,10 @@ "engines": { "node": ">=8.0.0" }, - "main": "src/index.js", + "main": "lib/index.js", + "scripts": { + "tsc": "tsc -b tsconfig.json" + }, "dependencies": { "eventemitter3": "4.0.4" } diff --git a/packages/web3-core-promievent/tsconfig.json b/packages/web3-core-promievent/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core-promievent/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core-requestmanager/package.json b/packages/web3-core-requestmanager/package.json index 1d92800da99..1d046189dda 100644 --- a/packages/web3-core-requestmanager/package.json +++ b/packages/web3-core-requestmanager/package.json @@ -7,7 +7,10 @@ "engines": { "node": ">=8.0.0" }, - "main": "src/index.js", + "main": "lib/index.js", + "scripts": { + "tsc": "tsc -b tsconfig.json" + }, "dependencies": { "underscore": "1.9.1", "web3-core-helpers": "1.2.11", diff --git a/packages/web3-core-requestmanager/tsconfig.json b/packages/web3-core-requestmanager/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core-requestmanager/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core-subscriptions/package.json b/packages/web3-core-subscriptions/package.json index 737298eddd7..0472c165794 100644 --- a/packages/web3-core-subscriptions/package.json +++ b/packages/web3-core-subscriptions/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "eventemitter3": "4.0.4", "underscore": "1.9.1", diff --git a/packages/web3-core-subscriptions/tsconfig.json b/packages/web3-core-subscriptions/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core-subscriptions/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-core/package.json b/packages/web3-core/package.json index 9a1d64bc3f2..aef0a264540 100644 --- a/packages/web3-core/package.json +++ b/packages/web3-core/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@types/bn.js": "^4.11.5", "@types/node": "^12.12.6", diff --git a/packages/web3-core/src/index.js b/packages/web3-core/src/index.js index 93ca90e70e8..ba98b80a35c 100644 --- a/packages/web3-core/src/index.js +++ b/packages/web3-core/src/index.js @@ -20,67 +20,68 @@ * @date 2017 */ -"use strict"; +const requestManager = require("web3-core-requestmanager"); +const extend = require("./extend"); +const packageInit = (pkg, args) => { + args = Array.prototype.slice.call(args); -var requestManager = require('web3-core-requestmanager'); -var extend = require('./extend.js'); + if (!pkg) { + throw new Error('You need to instantiate using the "new" keyword.'); + } -module.exports = { - packageInit: function (pkg, args) { - args = Array.prototype.slice.call(args); - - if (!pkg) { - throw new Error('You need to instantiate using the "new" keyword.'); - } - - // make property of pkg._provider, which can properly set providers - Object.defineProperty(pkg, 'currentProvider', { - get: function () { - return pkg._provider; - }, - set: function (value) { - return pkg.setProvider(value); - }, - enumerable: true, - configurable: true - }); - - // inherit from parent package or create a new RequestManager - if (args[0] && args[0]._requestManager) { - pkg._requestManager = args[0]._requestManager; - } else { - pkg._requestManager = new requestManager.Manager(args[0], args[1]); - } - - // add givenProvider - pkg.givenProvider = requestManager.Manager.givenProvider; - pkg.providers = requestManager.Manager.providers; - - pkg._provider = pkg._requestManager.provider; - - // add SETPROVIDER function (don't overwrite if already existing) - if (!pkg.setProvider) { - pkg.setProvider = function (provider, net) { - pkg._requestManager.setProvider(provider, net); - pkg._provider = pkg._requestManager.provider; - return true; - }; - } - - pkg.setRequestManager = function(manager) { - pkg._requestManager = manager; - pkg._provider = manager.provider; - }; + // make property of pkg._provider, which can properly set providers + Object.defineProperty(pkg, 'currentProvider', { + get: () => { + return pkg._provider; + }, + set: (value) => { + return pkg.setProvider(value); + }, + enumerable: true, + configurable: true + }); + + // inherit from parent package or create a new RequestManager + if (args[0] && args[0]._requestManager) { + pkg._requestManager = args[0]._requestManager; + } else { + pkg._requestManager = new requestManager.Manager(args[0], args[1]); + } + + // add givenProvider + pkg.givenProvider = requestManager.Manager.givenProvider; + pkg.providers = requestManager.Manager.providers; - // attach batch request creation - pkg.BatchRequest = requestManager.BatchManager.bind(null, pkg._requestManager); + pkg._provider = pkg._requestManager.provider; - // attach extend function - pkg.extend = extend(pkg); - }, - addProviders: function (pkg) { - pkg.givenProvider = requestManager.Manager.givenProvider; - pkg.providers = requestManager.Manager.providers; + // add SETPROVIDER function (don't overwrite if already existing) + if (!pkg.setProvider) { + pkg.setProvider = (provider, net) => { + pkg._requestManager.setProvider(provider, net); + pkg._provider = pkg._requestManager.provider; + return true; + }; } -}; + + pkg.setRequestManager = (manager) => { + pkg._requestManager = manager; + pkg._provider = manager.provider; + }; + + // attach batch request creation + pkg.BatchRequest = requestManager.BatchManager.bind(null, pkg._requestManager); + + // attach extend function + pkg.extend = extend(pkg); +} + +const addProviders = (pkg) => { + pkg.givenProvider = requestManager.Manager.givenProvider; + pkg.providers = requestManager.Manager.providers; +} + +module.exports = { + packageInit, + addProviders +} diff --git a/packages/web3-core/tsconfig.json b/packages/web3-core/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-core/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-abi/package.json b/packages/web3-eth-abi/package.json index 479d4cd8ded..fbcbcd593d2 100644 --- a/packages/web3-eth-abi/package.json +++ b/packages/web3-eth-abi/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@ethersproject/abi": "5.0.0-beta.153", "underscore": "1.9.1", diff --git a/packages/web3-eth-abi/tsconfig.json b/packages/web3-eth-abi/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-abi/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-accounts/package.json b/packages/web3-eth-accounts/package.json index fd1d9fff487..24ec19ae5b2 100644 --- a/packages/web3-eth-accounts/package.json +++ b/packages/web3-eth-accounts/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "crypto-browserify": "3.12.0", "eth-lib": "0.2.8", diff --git a/packages/web3-eth-accounts/tsconfig.json b/packages/web3-eth-accounts/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-accounts/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-contract/package.json b/packages/web3-eth-contract/package.json index 4e11528c5cb..aef7e57184a 100644 --- a/packages/web3-eth-contract/package.json +++ b/packages/web3-eth-contract/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@types/bn.js": "^4.11.5", "underscore": "1.9.1", diff --git a/packages/web3-eth-contract/tsconfig.json b/packages/web3-eth-contract/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-contract/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-ens/package.json b/packages/web3-eth-ens/package.json index a1cb6ab78aa..61bd54ca5f9 100644 --- a/packages/web3-eth-ens/package.json +++ b/packages/web3-eth-ens/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", diff --git a/packages/web3-eth-ens/tsconfig.json b/packages/web3-eth-ens/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-ens/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-iban/package.json b/packages/web3-eth-iban/package.json index 340815812d4..d50eb2319b0 100644 --- a/packages/web3-eth-iban/package.json +++ b/packages/web3-eth-iban/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "bn.js": "^4.11.9", "web3-utils": "1.2.11" diff --git a/packages/web3-eth-iban/tsconfig.json b/packages/web3-eth-iban/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-iban/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth-personal/package.json b/packages/web3-eth-personal/package.json index 294fa8a2e3f..edf712f1e16 100644 --- a/packages/web3-eth-personal/package.json +++ b/packages/web3-eth-personal/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "@types/node": "^12.12.6", "web3-core": "1.2.11", diff --git a/packages/web3-eth-personal/tsconfig.json b/packages/web3-eth-personal/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth-personal/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-eth/package.json b/packages/web3-eth/package.json index 8b50798ada1..638622cd4e9 100644 --- a/packages/web3-eth/package.json +++ b/packages/web3-eth/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "underscore": "1.9.1", "web3-core": "1.2.11", diff --git a/packages/web3-eth/tsconfig.json b/packages/web3-eth/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-eth/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-net/package.json b/packages/web3-net/package.json index f3aca4c1600..1e208d7ac0e 100644 --- a/packages/web3-net/package.json +++ b/packages/web3-net/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "web3-core": "1.2.11", "web3-core-method": "1.2.11", diff --git a/packages/web3-net/tsconfig.json b/packages/web3-net/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-net/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-providers-http/package.json b/packages/web3-providers-http/package.json index 72e7a9151ad..0b5c5cb05ee 100644 --- a/packages/web3-providers-http/package.json +++ b/packages/web3-providers-http/package.json @@ -8,10 +8,11 @@ "node": ">=8.0.0" }, "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, "types": "types/index.d.ts", - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "web3-core-helpers": "1.2.11", "xhr2-cookies": "1.1.0" diff --git a/packages/web3-providers-http/tsconfig.json b/packages/web3-providers-http/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-providers-http/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-providers-ipc/package.json b/packages/web3-providers-ipc/package.json index e6750e4968c..8aa9d1487d4 100644 --- a/packages/web3-providers-ipc/package.json +++ b/packages/web3-providers-ipc/package.json @@ -8,10 +8,11 @@ "node": ">=8.0.0" }, "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, "types": "types/index.d.ts", - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "oboe": "2.1.4", "underscore": "1.9.1", diff --git a/packages/web3-providers-ipc/tsconfig.json b/packages/web3-providers-ipc/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-providers-ipc/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-providers-ws/package.json b/packages/web3-providers-ws/package.json index f6147eb7ba5..34425567000 100644 --- a/packages/web3-providers-ws/package.json +++ b/packages/web3-providers-ws/package.json @@ -8,10 +8,11 @@ "node": ">=8.0.0" }, "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, "types": "types/index.d.ts", - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "eventemitter3": "4.0.4", "underscore": "1.9.1", diff --git a/packages/web3-providers-ws/tsconfig.json b/packages/web3-providers-ws/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-providers-ws/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-shh/package.json b/packages/web3-shh/package.json index 3f06b8ab1d7..21931b2c01f 100644 --- a/packages/web3-shh/package.json +++ b/packages/web3-shh/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "web3-core": "1.2.11", "web3-core-method": "1.2.11", diff --git a/packages/web3-shh/tsconfig.json b/packages/web3-shh/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-shh/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3-utils/package.json b/packages/web3-utils/package.json index 3a6367be4b4..96e996ce9e5 100644 --- a/packages/web3-utils/package.json +++ b/packages/web3-utils/package.json @@ -9,9 +9,10 @@ }, "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types" }, - "main": "src/index.js", + "main": "lib/index.js", "dependencies": { "bn.js": "^4.11.9", "eth-lib": "0.2.8", diff --git a/packages/web3-utils/tsconfig.json b/packages/web3-utils/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3-utils/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/packages/web3/package.json b/packages/web3/package.json index d8350040526..59489eb70e1 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -7,7 +7,7 @@ "engines": { "node": ">=8.0.0" }, - "main": "src/index.js", + "main": "lib/index.js", "bugs": { "url": "https://github.com/ethereum/web3.js/issues" }, @@ -19,6 +19,7 @@ "author": "ethereum.org", "types": "types/index.d.ts", "scripts": { + "tsc": "tsc -b tsconfig.json", "dtslint": "dtslint --localTs ../../node_modules/typescript/lib types", "postinstall": "node angular-patch.js" }, diff --git a/packages/web3/tsconfig.json b/packages/web3/tsconfig.json new file mode 100644 index 00000000000..06cc6c15b8c --- /dev/null +++ b/packages/web3/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] + } \ No newline at end of file diff --git a/scripts/ci.sh b/scripts/ci.sh index 1ebfaf1a6ab..b385e1302f2 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -7,13 +7,14 @@ # Exit immediately on error set -o errexit +npm run build + if [ "$TEST" = "unit" ]; then npm run test:unit elif [ "$TEST" = "build_and_lint" ]; then - npm run build npm run dtslint npm run depcheck npm run bundlesize @@ -28,7 +29,6 @@ elif [ "$TEST" = "unit_and_e2e_clients" ]; then elif [ "$TEST" = "e2e_browsers" ]; then - npm run build npm run test:e2e:chrome npm run test:e2e:firefox npm run test:e2e:min diff --git a/scripts/e2e.ganache.sh b/scripts/e2e.ganache.sh index 38b763e0755..5692cd33f21 100755 --- a/scripts/e2e.ganache.sh +++ b/scripts/e2e.ganache.sh @@ -30,6 +30,7 @@ npx wait-port 8545 # Test GANACHE=true nyc --no-clean --silent _mocha -- \ --reporter spec \ + --require ts-node/register \ --grep 'E2E' \ --timeout 5000 \ --exit diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000000..025fa0089c2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "outDir": "./lib", + "allowJs": true, + "target": "esnext", + "pretty": true, + "module": "commonjs", + } +} diff --git a/webpack.config.js b/webpack.config.js index aa954d90b8e..0fc74e82798 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,7 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); module.exports = { mode: "production", entry: { - web3: "./packages/web3/src/index.js", + web3: "./packages/web3/lib/index.js", }, plugins: [ new CleanWebpackPlugin(),